@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,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Terminal, ITerminalAddon, IMarker, IBufferRange } from '@xterm/xterm';
|
|
7
|
+
|
|
8
|
+
declare module '@xterm/addon-serialize' {
|
|
9
|
+
/**
|
|
10
|
+
* An xterm.js addon that enables serialization of terminal contents.
|
|
11
|
+
*/
|
|
12
|
+
export class SerializeAddon implements ITerminalAddon {
|
|
13
|
+
|
|
14
|
+
constructor();
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Activates the addon.
|
|
18
|
+
* @param terminal The terminal the addon is being loaded in.
|
|
19
|
+
*/
|
|
20
|
+
public activate(terminal: Terminal): void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Serializes terminal rows into a string that can be written back to the terminal to restore
|
|
24
|
+
* the state. The cursor will also be positioned to the correct cell. When restoring a terminal
|
|
25
|
+
* it is best to do before `Terminal.open` is called to avoid wasting CPU cycles rendering
|
|
26
|
+
* incomplete frames.
|
|
27
|
+
*
|
|
28
|
+
* It's recommended that you write the serialized data into a terminal of the same size in which
|
|
29
|
+
* it originated from and then resize it after if needed.
|
|
30
|
+
*
|
|
31
|
+
* @param options Custom options to allow control over what gets serialized.
|
|
32
|
+
*/
|
|
33
|
+
public serialize(options?: ISerializeOptions): string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Serializes terminal content as HTML, which can be written to the clipboard using the
|
|
37
|
+
* `text/html` mimetype. For applications that support it, the pasted text should then retain
|
|
38
|
+
* its colors/styles.
|
|
39
|
+
*
|
|
40
|
+
* @param options Custom options to allow control over what gets serialized.
|
|
41
|
+
*/
|
|
42
|
+
public serializeAsHTML(options?: Partial<IHTMLSerializeOptions>): string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Disposes the addon.
|
|
46
|
+
*/
|
|
47
|
+
public dispose(): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ISerializeOptions {
|
|
51
|
+
/**
|
|
52
|
+
* The row range to serialize. The an explicit range is specified, the cursor will get its final
|
|
53
|
+
* repositioning.
|
|
54
|
+
*/
|
|
55
|
+
range?: ISerializeRange;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The number of rows in the scrollback buffer to serialize, starting from the bottom of the
|
|
59
|
+
* scrollback buffer. When not specified, all available rows in the scrollback buffer will be
|
|
60
|
+
* serialized. This will be ignored if {@link range} is specified.
|
|
61
|
+
*/
|
|
62
|
+
scrollback?: number;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Whether to exclude the terminal modes from the serialization. False by default.
|
|
66
|
+
*/
|
|
67
|
+
excludeModes?: boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Whether to exclude the alt buffer from the serialization. False by default.
|
|
71
|
+
*/
|
|
72
|
+
excludeAltBuffer?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface IHTMLSerializeOptions {
|
|
76
|
+
/**
|
|
77
|
+
* The number of rows in the scrollback buffer to serialize, starting from the bottom of the
|
|
78
|
+
* scrollback buffer. When not specified, all available rows in the scrollback buffer will be
|
|
79
|
+
* serialized. This setting is ignored if {@link IHTMLSerializeOptions.onlySelection} is true.
|
|
80
|
+
*/
|
|
81
|
+
scrollback: number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Whether to only serialize the selection. If false, the whole active buffer is serialized in HTML.
|
|
85
|
+
* False by default.
|
|
86
|
+
*/
|
|
87
|
+
onlySelection: boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Whether to include the global background of the terminal. False by default.
|
|
91
|
+
*/
|
|
92
|
+
includeGlobalBackground: boolean;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The range to serialize. This is prioritized over {@link onlySelection}.
|
|
96
|
+
*/
|
|
97
|
+
range?: ISerializeBufferRange;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface ISerializeBufferRange {
|
|
101
|
+
startLine: number;
|
|
102
|
+
endLine: number;
|
|
103
|
+
startCol: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface ISerializeRange {
|
|
107
|
+
/**
|
|
108
|
+
* The line to start serializing (inclusive).
|
|
109
|
+
*/
|
|
110
|
+
start: IMarker | number;
|
|
111
|
+
/**
|
|
112
|
+
* The line to end serializing (inclusive).
|
|
113
|
+
*/
|
|
114
|
+
end: IMarker | number;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## @xterm/addon-web-links
|
|
2
|
+
|
|
3
|
+
An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables web links. This addon requires xterm.js v4+.
|
|
4
|
+
|
|
5
|
+
### Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save @xterm/addon-web-links
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { Terminal } from '@xterm/xterm';
|
|
15
|
+
import { WebLinksAddon } from '@xterm/addon-web-links';
|
|
16
|
+
|
|
17
|
+
const terminal = new Terminal();
|
|
18
|
+
terminal.loadAddon(new WebLinksAddon());
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/addon-web-links/typings/addon-web-links.d.ts) for more advanced usage.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebLinksAddon=t():e.WebLinksAddon=t()}(globalThis,(()=>(()=>{"use strict";var e={490:(e,t)=>{function n(e){try{const t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(e,t,n,o={}){this._terminal=e,this._regex=t,this._handler=n,this._options=o}provideLinks(e,t){const n=o.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map((e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){const{range:o}=e;this._options.hover(t,n,o)}},e)))}};class o{static computeLink(e,t,r,i){const s=new RegExp(t.source,(t.flags||"")+"g"),[a,c]=o._getWindowedLineStrings(e-1,r),l=a.join("");let d;const p=[];for(;d=s.exec(l);){const e=d[0];if(!n(e))continue;const[t,s]=o._mapStrIdx(r,c,0,d.index),[a,l]=o._mapStrIdx(r,t,s,e.length);if(-1===t||-1===s||-1===a||-1===l)continue;const h={start:{x:s+1,y:t+1},end:{x:l,y:a+1}};p.push({range:h,text:e,activate:i})}return p}static _getWindowedLineStrings(e,t){let n,o=e,r=e,i=0,s="";const a=[];if(n=t.buffer.active.getLine(e)){const e=n.translateToString(!0);if(n.isWrapped&&" "!==e[0]){for(i=0;(n=t.buffer.active.getLine(--o))&&i<2048&&(s=n.translateToString(!0),i+=s.length,a.push(s),n.isWrapped&&-1===s.indexOf(" ")););a.reverse()}for(a.push(e),i=0;(n=t.buffer.active.getLine(++r))&&n.isWrapped&&i<2048&&(s=n.translateToString(!0),i+=s.length,a.push(s),-1===s.indexOf(" ")););}return[a,o]}static _mapStrIdx(e,t,n,o){const r=e.buffer.active,i=r.getNullCell();let s=n;for(;o;){const e=r.getLine(t);if(!e)return[-1,-1];for(let n=s;n<e.length;++n){e.getCell(n,i);const s=i.getChars();if(i.getWidth()&&(o-=s.length||1,n===e.length-1&&""===s)){const e=r.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,i),2===i.getWidth()&&(o+=1))}if(o<0)return[t,n]}t++,s=0}return[t,s]}}t.LinkComputer=o}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.WebLinksAddon=void 0;const t=n(490),r=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function i(e,t){const n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}e.WebLinksAddon=class{constructor(e=i,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;const n=this._options,o=n.urlRegex||r;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,o,this._handler,n))}dispose(){this._linkProvider?.dispose()}}})(),o})()));
|
|
2
|
+
//# sourceMappingURL=addon-web-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addon-web-links.js","mappings":"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","sources":["webpack://WebLinksAddon/webpack/universalModuleDefinition","webpack://WebLinksAddon/./src/WebLinkProvider.ts","webpack://WebLinksAddon/webpack/bootstrap","webpack://WebLinksAddon/./src/WebLinksAddon.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"WebLinksAddon\"] = factory();\n\telse\n\t\troot[\"WebLinksAddon\"] = factory();\n})(globalThis, () => {\nreturn ","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILinkProvider, ILink, Terminal, IViewportRange, IBufferLine } from '@xterm/xterm';\n\nexport interface ILinkProviderOptions {\n hover?(event: MouseEvent, text: string, location: IViewportRange): void;\n leave?(event: MouseEvent, text: string): void;\n urlRegex?: RegExp;\n}\n\nexport class WebLinkProvider implements ILinkProvider {\n\n constructor(\n private readonly _terminal: Terminal,\n private readonly _regex: RegExp,\n private readonly _handler: (event: MouseEvent, uri: string) => void,\n private readonly _options: ILinkProviderOptions = {}\n ) {\n\n }\n\n public provideLinks(y: number, callback: (links: ILink[] | undefined) => void): void {\n const links = LinkComputer.computeLink(y, this._regex, this._terminal, this._handler);\n callback(this._addCallbacks(links));\n }\n\n private _addCallbacks(links: ILink[]): ILink[] {\n return links.map(link => {\n link.leave = this._options.leave;\n link.hover = (event: MouseEvent, uri: string): void => {\n if (this._options.hover) {\n const { range } = link;\n this._options.hover(event, uri, range);\n }\n };\n return link;\n });\n }\n}\n\nfunction isUrl(urlString: string): boolean {\n try {\n const url = new URL(urlString);\n const parsedBase = url.password && url.username\n ? `${url.protocol}//${url.username}:${url.password}@${url.host}`\n : url.username\n ? `${url.protocol}//${url.username}@${url.host}`\n : `${url.protocol}//${url.host}`;\n return urlString.toLocaleLowerCase().startsWith(parsedBase.toLocaleLowerCase());\n } catch (e) {\n return false;\n }\n}\n\nexport class LinkComputer {\n public static computeLink(y: number, regex: RegExp, terminal: Terminal, activate: (event: MouseEvent, uri: string) => void): ILink[] {\n const rex = new RegExp(regex.source, (regex.flags || '') + 'g');\n\n const [lines, startLineIndex] = LinkComputer._getWindowedLineStrings(y - 1, terminal);\n const line = lines.join('');\n\n let match;\n const result: ILink[] = [];\n\n while (match = rex.exec(line)) {\n const text = match[0];\n\n // check via URL if the matched text would form a proper url\n if (!isUrl(text)) {\n continue;\n }\n\n // map string positions back to buffer positions\n // values are 0-based right side excluding\n const [startY, startX] = LinkComputer._mapStrIdx(terminal, startLineIndex, 0, match.index);\n const [endY, endX] = LinkComputer._mapStrIdx(terminal, startY, startX, text.length);\n\n if (startY === -1 || startX === -1 || endY === -1 || endX === -1) {\n continue;\n }\n\n // range expects values 1-based right side including, thus +1 except for endX\n const range = {\n start: {\n x: startX + 1,\n y: startY + 1\n },\n end: {\n x: endX,\n y: endY + 1\n }\n };\n\n result.push({ range, text, activate });\n }\n\n return result;\n }\n\n /**\n * Get wrapped content lines for the current line index.\n * The top/bottom line expansion stops at whitespaces or length > 2048.\n * Returns an array with line strings and the top line index.\n *\n * NOTE: We pull line strings with trimRight=true on purpose to make sure\n * to correctly match urls with early wrapped wide chars. This corrupts the string index\n * for 1:1 backmapping to buffer positions, thus needs an additional correction in _mapStrIdx.\n */\n private static _getWindowedLineStrings(lineIndex: number, terminal: Terminal): [string[], number] {\n let line: IBufferLine | undefined;\n let topIdx = lineIndex;\n let bottomIdx = lineIndex;\n let length = 0;\n let content = '';\n const lines: string[] = [];\n\n if ((line = terminal.buffer.active.getLine(lineIndex))) {\n const currentContent = line.translateToString(true);\n\n // expand top, stop on whitespaces or length > 2048\n if (line.isWrapped && currentContent[0] !== ' ') {\n length = 0;\n while ((line = terminal.buffer.active.getLine(--topIdx)) && length < 2048) {\n content = line.translateToString(true);\n length += content.length;\n lines.push(content);\n if (!line.isWrapped || content.indexOf(' ') !== -1) {\n break;\n }\n }\n lines.reverse();\n }\n\n // append current line\n lines.push(currentContent);\n\n // expand bottom, stop on whitespaces or length > 2048\n length = 0;\n while ((line = terminal.buffer.active.getLine(++bottomIdx)) && line.isWrapped && length < 2048) {\n content = line.translateToString(true);\n length += content.length;\n lines.push(content);\n if (content.indexOf(' ') !== -1) {\n break;\n }\n }\n }\n return [lines, topIdx];\n }\n\n /**\n * Map a string index back to buffer positions.\n * Returns buffer position as [lineIndex, columnIndex] 0-based,\n * or [-1, -1] in case the lookup ran into a non-existing line.\n */\n private static _mapStrIdx(terminal: Terminal, lineIndex: number, rowIndex: number, stringIndex: number): [number, number] {\n const buf = terminal.buffer.active;\n const cell = buf.getNullCell();\n let start = rowIndex;\n while (stringIndex) {\n const line = buf.getLine(lineIndex);\n if (!line) {\n return [-1, -1];\n }\n for (let i = start; i < line.length; ++i) {\n line.getCell(i, cell);\n const chars = cell.getChars();\n const width = cell.getWidth();\n if (width) {\n stringIndex -= chars.length || 1;\n\n // correct stringIndex for early wrapped wide chars:\n // - currently only happens at last cell\n // - cells to the right are reset with chars='' and width=1 in InputHandler.print\n // - follow-up line must be wrapped and contain wide char at first cell\n // --> if all these conditions are met, correct stringIndex by +1\n if (i === line.length - 1 && chars === '') {\n const line = buf.getLine(lineIndex + 1);\n if (line && line.isWrapped) {\n line.getCell(0, cell);\n if (cell.getWidth() === 2) {\n stringIndex += 1;\n }\n }\n }\n }\n if (stringIndex < 0) {\n return [lineIndex, i];\n }\n }\n lineIndex++;\n start = 0;\n }\n return [lineIndex, start];\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport type { Terminal, ITerminalAddon, IDisposable } from '@xterm/xterm';\nimport type { WebLinksAddon as IWebLinksApi } from '@xterm/addon-web-links';\nimport { ILinkProviderOptions, WebLinkProvider } from './WebLinkProvider';\n\n// consider everthing starting with http:// or https://\n// up to first whitespace, `\"` or `'` as url\n// NOTE: The repeated end clause is needed to not match a dangling `:`\n// resembling the old (...)*([^:\"\\'\\\\s]) final path clause\n// additionally exclude early + final:\n// - unsafe from rfc3986: !*'()\n// - unsafe chars from rfc1738: {}|\\^~[]` (minus [] as we need them for ipv6 adresses, also allow ~)\n// also exclude as finals:\n// - final interpunction like ,.!?\n// - any sort of brackets <>()[]{} (not spec conform, but often used to enclose urls)\n// - unsafe chars from rfc1738: {}|\\^~[]`\nconst strictUrlRegex = /(https?|HTTPS?):[/]{2}[^\\s\"'!*(){}|\\\\\\^<>`]*[^\\s\"':,.!?{}|\\\\\\^~\\[\\]`()<>]/;\n\n\nfunction handleLink(event: MouseEvent, uri: string): void {\n const newWindow = window.open();\n if (newWindow) {\n try {\n newWindow.opener = null;\n } catch {\n // no-op, Electron can throw\n }\n newWindow.location.href = uri;\n } else {\n console.warn('Opening link blocked as opener could not be cleared');\n }\n}\n\nexport class WebLinksAddon implements ITerminalAddon , IWebLinksApi {\n private _terminal: Terminal | undefined;\n private _linkProvider: IDisposable | undefined;\n\n constructor(\n private _handler: (event: MouseEvent, uri: string) => void = handleLink,\n private _options: ILinkProviderOptions = {}\n ) {\n }\n\n public activate(terminal: Terminal): void {\n this._terminal = terminal;\n const options = this._options as ILinkProviderOptions;\n const regex = options.urlRegex || strictUrlRegex;\n this._linkProvider = this._terminal.registerLinkProvider(new WebLinkProvider(this._terminal, regex, this._handler, options));\n }\n\n public dispose(): void {\n this._linkProvider?.dispose();\n }\n}\n"],"names":["root","factory","exports","module","define","amd","globalThis","isUrl","urlString","url","URL","parsedBase","password","username","protocol","host","toLocaleLowerCase","startsWith","e","constructor","_terminal","_regex","_handler","_options","provideLinks","y","callback","links","LinkComputer","computeLink","this","_addCallbacks","map","link","leave","hover","event","uri","range","regex","terminal","activate","rex","RegExp","source","flags","lines","startLineIndex","_getWindowedLineStrings","line","join","match","result","exec","text","startY","startX","_mapStrIdx","index","endY","endX","length","start","x","end","push","lineIndex","topIdx","bottomIdx","content","buffer","active","getLine","currentContent","translateToString","isWrapped","indexOf","reverse","rowIndex","stringIndex","buf","cell","getNullCell","i","getCell","chars","getChars","getWidth","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","strictUrlRegex","handleLink","newWindow","window","open","opener","location","href","console","warn","options","urlRegex","_linkProvider","registerLinkProvider","WebLinkProvider","dispose"],"sourceRoot":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
3
|
+
* @license MIT
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
6
|
+
* @license MIT
|
|
7
|
+
*
|
|
8
|
+
* Originally forked from (with the author's permission):
|
|
9
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
10
|
+
* http://bellard.org/jslinux/
|
|
11
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
12
|
+
*/
|
|
13
|
+
/*---------------------------------------------------------------------------------------------
|
|
14
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
15
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
16
|
+
*--------------------------------------------------------------------------------------------*/
|
|
17
|
+
var v=class{constructor(e,t,n,o={}){this._terminal=e;this._regex=t;this._handler=n;this._options=o}provideLinks(e,t){let n=g.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(n,o)=>{if(this._options.hover){let{range:p}=t;this._options.hover(n,o,p)}},t))}};function k(l){try{let e=new URL(l),t=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return l.toLocaleLowerCase().startsWith(t.toLocaleLowerCase())}catch{return!1}}var g=class l{static computeLink(e,t,n,o){let p=new RegExp(t.source,(t.flags||"")+"g"),[i,r]=l._getWindowedLineStrings(e-1,n),s=i.join(""),a,d=[];for(;a=p.exec(s);){let u=a[0];if(!k(u))continue;let[c,h]=l._mapStrIdx(n,r,0,a.index),[m,f]=l._mapStrIdx(n,c,h,u.length);if(c===-1||h===-1||m===-1||f===-1)continue;let b={start:{x:h+1,y:c+1},end:{x:f,y:m+1}};d.push({range:b,text:u,activate:o})}return d}static _getWindowedLineStrings(e,t){let n,o=e,p=e,i=0,r="",s=[];if(n=t.buffer.active.getLine(e)){let a=n.translateToString(!0);if(n.isWrapped&&a[0]!==" "){for(i=0;(n=t.buffer.active.getLine(--o))&&i<2048&&(r=n.translateToString(!0),i+=r.length,s.push(r),!(!n.isWrapped||r.indexOf(" ")!==-1)););s.reverse()}for(s.push(a),i=0;(n=t.buffer.active.getLine(++p))&&n.isWrapped&&i<2048&&(r=n.translateToString(!0),i+=r.length,s.push(r),r.indexOf(" ")===-1););}return[s,o]}static _mapStrIdx(e,t,n,o){let p=e.buffer.active,i=p.getNullCell(),r=n;for(;o;){let s=p.getLine(t);if(!s)return[-1,-1];for(let a=r;a<s.length;++a){s.getCell(a,i);let d=i.getChars();if(i.getWidth()&&(o-=d.length||1,a===s.length-1&&d==="")){let c=p.getLine(t+1);c&&c.isWrapped&&(c.getCell(0,i),i.getWidth()===2&&(o+=1))}if(o<0)return[t,a]}t++,r=0}return[t,r]}};var _=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function w(l,e){let t=window.open();if(t){try{t.opener=null}catch{}t.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var L=class{constructor(e=w,t={}){this._handler=e;this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||_;this._linkProvider=this._terminal.registerLinkProvider(new v(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}};export{L as WebLinksAddon};
|
|
18
|
+
//# sourceMappingURL=addon-web-links.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/WebLinkProvider.ts", "../src/WebLinksAddon.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILinkProvider, ILink, Terminal, IViewportRange, IBufferLine } from '@xterm/xterm';\n\nexport interface ILinkProviderOptions {\n hover?(event: MouseEvent, text: string, location: IViewportRange): void;\n leave?(event: MouseEvent, text: string): void;\n urlRegex?: RegExp;\n}\n\nexport class WebLinkProvider implements ILinkProvider {\n\n constructor(\n private readonly _terminal: Terminal,\n private readonly _regex: RegExp,\n private readonly _handler: (event: MouseEvent, uri: string) => void,\n private readonly _options: ILinkProviderOptions = {}\n ) {\n\n }\n\n public provideLinks(y: number, callback: (links: ILink[] | undefined) => void): void {\n const links = LinkComputer.computeLink(y, this._regex, this._terminal, this._handler);\n callback(this._addCallbacks(links));\n }\n\n private _addCallbacks(links: ILink[]): ILink[] {\n return links.map(link => {\n link.leave = this._options.leave;\n link.hover = (event: MouseEvent, uri: string): void => {\n if (this._options.hover) {\n const { range } = link;\n this._options.hover(event, uri, range);\n }\n };\n return link;\n });\n }\n}\n\nfunction isUrl(urlString: string): boolean {\n try {\n const url = new URL(urlString);\n const parsedBase = url.password && url.username\n ? `${url.protocol}//${url.username}:${url.password}@${url.host}`\n : url.username\n ? `${url.protocol}//${url.username}@${url.host}`\n : `${url.protocol}//${url.host}`;\n return urlString.toLocaleLowerCase().startsWith(parsedBase.toLocaleLowerCase());\n } catch (e) {\n return false;\n }\n}\n\nexport class LinkComputer {\n public static computeLink(y: number, regex: RegExp, terminal: Terminal, activate: (event: MouseEvent, uri: string) => void): ILink[] {\n const rex = new RegExp(regex.source, (regex.flags || '') + 'g');\n\n const [lines, startLineIndex] = LinkComputer._getWindowedLineStrings(y - 1, terminal);\n const line = lines.join('');\n\n let match;\n const result: ILink[] = [];\n\n while (match = rex.exec(line)) {\n const text = match[0];\n\n // check via URL if the matched text would form a proper url\n if (!isUrl(text)) {\n continue;\n }\n\n // map string positions back to buffer positions\n // values are 0-based right side excluding\n const [startY, startX] = LinkComputer._mapStrIdx(terminal, startLineIndex, 0, match.index);\n const [endY, endX] = LinkComputer._mapStrIdx(terminal, startY, startX, text.length);\n\n if (startY === -1 || startX === -1 || endY === -1 || endX === -1) {\n continue;\n }\n\n // range expects values 1-based right side including, thus +1 except for endX\n const range = {\n start: {\n x: startX + 1,\n y: startY + 1\n },\n end: {\n x: endX,\n y: endY + 1\n }\n };\n\n result.push({ range, text, activate });\n }\n\n return result;\n }\n\n /**\n * Get wrapped content lines for the current line index.\n * The top/bottom line expansion stops at whitespaces or length > 2048.\n * Returns an array with line strings and the top line index.\n *\n * NOTE: We pull line strings with trimRight=true on purpose to make sure\n * to correctly match urls with early wrapped wide chars. This corrupts the string index\n * for 1:1 backmapping to buffer positions, thus needs an additional correction in _mapStrIdx.\n */\n private static _getWindowedLineStrings(lineIndex: number, terminal: Terminal): [string[], number] {\n let line: IBufferLine | undefined;\n let topIdx = lineIndex;\n let bottomIdx = lineIndex;\n let length = 0;\n let content = '';\n const lines: string[] = [];\n\n if ((line = terminal.buffer.active.getLine(lineIndex))) {\n const currentContent = line.translateToString(true);\n\n // expand top, stop on whitespaces or length > 2048\n if (line.isWrapped && currentContent[0] !== ' ') {\n length = 0;\n while ((line = terminal.buffer.active.getLine(--topIdx)) && length < 2048) {\n content = line.translateToString(true);\n length += content.length;\n lines.push(content);\n if (!line.isWrapped || content.indexOf(' ') !== -1) {\n break;\n }\n }\n lines.reverse();\n }\n\n // append current line\n lines.push(currentContent);\n\n // expand bottom, stop on whitespaces or length > 2048\n length = 0;\n while ((line = terminal.buffer.active.getLine(++bottomIdx)) && line.isWrapped && length < 2048) {\n content = line.translateToString(true);\n length += content.length;\n lines.push(content);\n if (content.indexOf(' ') !== -1) {\n break;\n }\n }\n }\n return [lines, topIdx];\n }\n\n /**\n * Map a string index back to buffer positions.\n * Returns buffer position as [lineIndex, columnIndex] 0-based,\n * or [-1, -1] in case the lookup ran into a non-existing line.\n */\n private static _mapStrIdx(terminal: Terminal, lineIndex: number, rowIndex: number, stringIndex: number): [number, number] {\n const buf = terminal.buffer.active;\n const cell = buf.getNullCell();\n let start = rowIndex;\n while (stringIndex) {\n const line = buf.getLine(lineIndex);\n if (!line) {\n return [-1, -1];\n }\n for (let i = start; i < line.length; ++i) {\n line.getCell(i, cell);\n const chars = cell.getChars();\n const width = cell.getWidth();\n if (width) {\n stringIndex -= chars.length || 1;\n\n // correct stringIndex for early wrapped wide chars:\n // - currently only happens at last cell\n // - cells to the right are reset with chars='' and width=1 in InputHandler.print\n // - follow-up line must be wrapped and contain wide char at first cell\n // --> if all these conditions are met, correct stringIndex by +1\n if (i === line.length - 1 && chars === '') {\n const line = buf.getLine(lineIndex + 1);\n if (line && line.isWrapped) {\n line.getCell(0, cell);\n if (cell.getWidth() === 2) {\n stringIndex += 1;\n }\n }\n }\n }\n if (stringIndex < 0) {\n return [lineIndex, i];\n }\n }\n lineIndex++;\n start = 0;\n }\n return [lineIndex, start];\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport type { Terminal, ITerminalAddon, IDisposable } from '@xterm/xterm';\nimport type { WebLinksAddon as IWebLinksApi } from '@xterm/addon-web-links';\nimport { ILinkProviderOptions, WebLinkProvider } from './WebLinkProvider';\n\n// consider everthing starting with http:// or https://\n// up to first whitespace, `\"` or `'` as url\n// NOTE: The repeated end clause is needed to not match a dangling `:`\n// resembling the old (...)*([^:\"\\'\\\\s]) final path clause\n// additionally exclude early + final:\n// - unsafe from rfc3986: !*'()\n// - unsafe chars from rfc1738: {}|\\^~[]` (minus [] as we need them for ipv6 adresses, also allow ~)\n// also exclude as finals:\n// - final interpunction like ,.!?\n// - any sort of brackets <>()[]{} (not spec conform, but often used to enclose urls)\n// - unsafe chars from rfc1738: {}|\\^~[]`\nconst strictUrlRegex = /(https?|HTTPS?):[/]{2}[^\\s\"'!*(){}|\\\\\\^<>`]*[^\\s\"':,.!?{}|\\\\\\^~\\[\\]`()<>]/;\n\n\nfunction handleLink(event: MouseEvent, uri: string): void {\n const newWindow = window.open();\n if (newWindow) {\n try {\n newWindow.opener = null;\n } catch {\n // no-op, Electron can throw\n }\n newWindow.location.href = uri;\n } else {\n console.warn('Opening link blocked as opener could not be cleared');\n }\n}\n\nexport class WebLinksAddon implements ITerminalAddon , IWebLinksApi {\n private _terminal: Terminal | undefined;\n private _linkProvider: IDisposable | undefined;\n\n constructor(\n private _handler: (event: MouseEvent, uri: string) => void = handleLink,\n private _options: ILinkProviderOptions = {}\n ) {\n }\n\n public activate(terminal: Terminal): void {\n this._terminal = terminal;\n const options = this._options as ILinkProviderOptions;\n const regex = options.urlRegex || strictUrlRegex;\n this._linkProvider = this._terminal.registerLinkProvider(new WebLinkProvider(this._terminal, regex, this._handler, options));\n }\n\n public dispose(): void {\n this._linkProvider?.dispose();\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["WebLinkProvider", "_terminal", "_regex", "_handler", "_options", "y", "callback", "links", "LinkComputer", "link", "event", "uri", "range", "isUrl", "urlString", "url", "parsedBase", "_LinkComputer", "regex", "terminal", "activate", "rex", "lines", "startLineIndex", "line", "match", "result", "text", "startY", "startX", "endY", "endX", "lineIndex", "topIdx", "bottomIdx", "length", "content", "currentContent", "rowIndex", "stringIndex", "buf", "cell", "start", "i", "chars", "strictUrlRegex", "handleLink", "event", "uri", "newWindow", "WebLinksAddon", "_handler", "_options", "terminal", "options", "regex", "WebLinkProvider"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xterm/addon-web-links",
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "The xterm.js authors",
|
|
6
|
+
"url": "https://xtermjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"main": "lib/addon-web-links.js",
|
|
9
|
+
"module": "lib/addon-web-links.mjs",
|
|
10
|
+
"types": "typings/addon-web-links.d.ts",
|
|
11
|
+
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-web-links",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"terminal",
|
|
15
|
+
"xterm",
|
|
16
|
+
"xterm.js"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "../../node_modules/.bin/tsc -p .",
|
|
20
|
+
"prepackage": "npm run build",
|
|
21
|
+
"package": "../../node_modules/.bin/webpack",
|
|
22
|
+
"prepublishOnly": "npm run package",
|
|
23
|
+
"start": "node ../../demo/start"
|
|
24
|
+
},
|
|
25
|
+
"commit": "f447274f430fd22513f6adbf9862d19524471c04"
|
|
26
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ILinkProvider, ILink, Terminal, IViewportRange, IBufferLine } from '@xterm/xterm';
|
|
7
|
+
|
|
8
|
+
export interface ILinkProviderOptions {
|
|
9
|
+
hover?(event: MouseEvent, text: string, location: IViewportRange): void;
|
|
10
|
+
leave?(event: MouseEvent, text: string): void;
|
|
11
|
+
urlRegex?: RegExp;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class WebLinkProvider implements ILinkProvider {
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
private readonly _terminal: Terminal,
|
|
18
|
+
private readonly _regex: RegExp,
|
|
19
|
+
private readonly _handler: (event: MouseEvent, uri: string) => void,
|
|
20
|
+
private readonly _options: ILinkProviderOptions = {}
|
|
21
|
+
) {
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public provideLinks(y: number, callback: (links: ILink[] | undefined) => void): void {
|
|
26
|
+
const links = LinkComputer.computeLink(y, this._regex, this._terminal, this._handler);
|
|
27
|
+
callback(this._addCallbacks(links));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private _addCallbacks(links: ILink[]): ILink[] {
|
|
31
|
+
return links.map(link => {
|
|
32
|
+
link.leave = this._options.leave;
|
|
33
|
+
link.hover = (event: MouseEvent, uri: string): void => {
|
|
34
|
+
if (this._options.hover) {
|
|
35
|
+
const { range } = link;
|
|
36
|
+
this._options.hover(event, uri, range);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return link;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isUrl(urlString: string): boolean {
|
|
45
|
+
try {
|
|
46
|
+
const url = new URL(urlString);
|
|
47
|
+
const parsedBase = url.password && url.username
|
|
48
|
+
? `${url.protocol}//${url.username}:${url.password}@${url.host}`
|
|
49
|
+
: url.username
|
|
50
|
+
? `${url.protocol}//${url.username}@${url.host}`
|
|
51
|
+
: `${url.protocol}//${url.host}`;
|
|
52
|
+
return urlString.toLocaleLowerCase().startsWith(parsedBase.toLocaleLowerCase());
|
|
53
|
+
} catch (e) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class LinkComputer {
|
|
59
|
+
public static computeLink(y: number, regex: RegExp, terminal: Terminal, activate: (event: MouseEvent, uri: string) => void): ILink[] {
|
|
60
|
+
const rex = new RegExp(regex.source, (regex.flags || '') + 'g');
|
|
61
|
+
|
|
62
|
+
const [lines, startLineIndex] = LinkComputer._getWindowedLineStrings(y - 1, terminal);
|
|
63
|
+
const line = lines.join('');
|
|
64
|
+
|
|
65
|
+
let match;
|
|
66
|
+
const result: ILink[] = [];
|
|
67
|
+
|
|
68
|
+
while (match = rex.exec(line)) {
|
|
69
|
+
const text = match[0];
|
|
70
|
+
|
|
71
|
+
// check via URL if the matched text would form a proper url
|
|
72
|
+
if (!isUrl(text)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// map string positions back to buffer positions
|
|
77
|
+
// values are 0-based right side excluding
|
|
78
|
+
const [startY, startX] = LinkComputer._mapStrIdx(terminal, startLineIndex, 0, match.index);
|
|
79
|
+
const [endY, endX] = LinkComputer._mapStrIdx(terminal, startY, startX, text.length);
|
|
80
|
+
|
|
81
|
+
if (startY === -1 || startX === -1 || endY === -1 || endX === -1) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// range expects values 1-based right side including, thus +1 except for endX
|
|
86
|
+
const range = {
|
|
87
|
+
start: {
|
|
88
|
+
x: startX + 1,
|
|
89
|
+
y: startY + 1
|
|
90
|
+
},
|
|
91
|
+
end: {
|
|
92
|
+
x: endX,
|
|
93
|
+
y: endY + 1
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
result.push({ range, text, activate });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Get wrapped content lines for the current line index.
|
|
105
|
+
* The top/bottom line expansion stops at whitespaces or length > 2048.
|
|
106
|
+
* Returns an array with line strings and the top line index.
|
|
107
|
+
*
|
|
108
|
+
* NOTE: We pull line strings with trimRight=true on purpose to make sure
|
|
109
|
+
* to correctly match urls with early wrapped wide chars. This corrupts the string index
|
|
110
|
+
* for 1:1 backmapping to buffer positions, thus needs an additional correction in _mapStrIdx.
|
|
111
|
+
*/
|
|
112
|
+
private static _getWindowedLineStrings(lineIndex: number, terminal: Terminal): [string[], number] {
|
|
113
|
+
let line: IBufferLine | undefined;
|
|
114
|
+
let topIdx = lineIndex;
|
|
115
|
+
let bottomIdx = lineIndex;
|
|
116
|
+
let length = 0;
|
|
117
|
+
let content = '';
|
|
118
|
+
const lines: string[] = [];
|
|
119
|
+
|
|
120
|
+
if ((line = terminal.buffer.active.getLine(lineIndex))) {
|
|
121
|
+
const currentContent = line.translateToString(true);
|
|
122
|
+
|
|
123
|
+
// expand top, stop on whitespaces or length > 2048
|
|
124
|
+
if (line.isWrapped && currentContent[0] !== ' ') {
|
|
125
|
+
length = 0;
|
|
126
|
+
while ((line = terminal.buffer.active.getLine(--topIdx)) && length < 2048) {
|
|
127
|
+
content = line.translateToString(true);
|
|
128
|
+
length += content.length;
|
|
129
|
+
lines.push(content);
|
|
130
|
+
if (!line.isWrapped || content.indexOf(' ') !== -1) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
lines.reverse();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// append current line
|
|
138
|
+
lines.push(currentContent);
|
|
139
|
+
|
|
140
|
+
// expand bottom, stop on whitespaces or length > 2048
|
|
141
|
+
length = 0;
|
|
142
|
+
while ((line = terminal.buffer.active.getLine(++bottomIdx)) && line.isWrapped && length < 2048) {
|
|
143
|
+
content = line.translateToString(true);
|
|
144
|
+
length += content.length;
|
|
145
|
+
lines.push(content);
|
|
146
|
+
if (content.indexOf(' ') !== -1) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return [lines, topIdx];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Map a string index back to buffer positions.
|
|
156
|
+
* Returns buffer position as [lineIndex, columnIndex] 0-based,
|
|
157
|
+
* or [-1, -1] in case the lookup ran into a non-existing line.
|
|
158
|
+
*/
|
|
159
|
+
private static _mapStrIdx(terminal: Terminal, lineIndex: number, rowIndex: number, stringIndex: number): [number, number] {
|
|
160
|
+
const buf = terminal.buffer.active;
|
|
161
|
+
const cell = buf.getNullCell();
|
|
162
|
+
let start = rowIndex;
|
|
163
|
+
while (stringIndex) {
|
|
164
|
+
const line = buf.getLine(lineIndex);
|
|
165
|
+
if (!line) {
|
|
166
|
+
return [-1, -1];
|
|
167
|
+
}
|
|
168
|
+
for (let i = start; i < line.length; ++i) {
|
|
169
|
+
line.getCell(i, cell);
|
|
170
|
+
const chars = cell.getChars();
|
|
171
|
+
const width = cell.getWidth();
|
|
172
|
+
if (width) {
|
|
173
|
+
stringIndex -= chars.length || 1;
|
|
174
|
+
|
|
175
|
+
// correct stringIndex for early wrapped wide chars:
|
|
176
|
+
// - currently only happens at last cell
|
|
177
|
+
// - cells to the right are reset with chars='' and width=1 in InputHandler.print
|
|
178
|
+
// - follow-up line must be wrapped and contain wide char at first cell
|
|
179
|
+
// --> if all these conditions are met, correct stringIndex by +1
|
|
180
|
+
if (i === line.length - 1 && chars === '') {
|
|
181
|
+
const line = buf.getLine(lineIndex + 1);
|
|
182
|
+
if (line && line.isWrapped) {
|
|
183
|
+
line.getCell(0, cell);
|
|
184
|
+
if (cell.getWidth() === 2) {
|
|
185
|
+
stringIndex += 1;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (stringIndex < 0) {
|
|
191
|
+
return [lineIndex, i];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
lineIndex++;
|
|
195
|
+
start = 0;
|
|
196
|
+
}
|
|
197
|
+
return [lineIndex, start];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Terminal, ITerminalAddon, IDisposable } from '@xterm/xterm';
|
|
7
|
+
import type { WebLinksAddon as IWebLinksApi } from '@xterm/addon-web-links';
|
|
8
|
+
import { ILinkProviderOptions, WebLinkProvider } from './WebLinkProvider';
|
|
9
|
+
|
|
10
|
+
// consider everthing starting with http:// or https://
|
|
11
|
+
// up to first whitespace, `"` or `'` as url
|
|
12
|
+
// NOTE: The repeated end clause is needed to not match a dangling `:`
|
|
13
|
+
// resembling the old (...)*([^:"\'\\s]) final path clause
|
|
14
|
+
// additionally exclude early + final:
|
|
15
|
+
// - unsafe from rfc3986: !*'()
|
|
16
|
+
// - unsafe chars from rfc1738: {}|\^~[]` (minus [] as we need them for ipv6 adresses, also allow ~)
|
|
17
|
+
// also exclude as finals:
|
|
18
|
+
// - final interpunction like ,.!?
|
|
19
|
+
// - any sort of brackets <>()[]{} (not spec conform, but often used to enclose urls)
|
|
20
|
+
// - unsafe chars from rfc1738: {}|\^~[]`
|
|
21
|
+
const strictUrlRegex = /(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function handleLink(event: MouseEvent, uri: string): void {
|
|
25
|
+
const newWindow = window.open();
|
|
26
|
+
if (newWindow) {
|
|
27
|
+
try {
|
|
28
|
+
newWindow.opener = null;
|
|
29
|
+
} catch {
|
|
30
|
+
// no-op, Electron can throw
|
|
31
|
+
}
|
|
32
|
+
newWindow.location.href = uri;
|
|
33
|
+
} else {
|
|
34
|
+
console.warn('Opening link blocked as opener could not be cleared');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class WebLinksAddon implements ITerminalAddon , IWebLinksApi {
|
|
39
|
+
private _terminal: Terminal | undefined;
|
|
40
|
+
private _linkProvider: IDisposable | undefined;
|
|
41
|
+
|
|
42
|
+
constructor(
|
|
43
|
+
private _handler: (event: MouseEvent, uri: string) => void = handleLink,
|
|
44
|
+
private _options: ILinkProviderOptions = {}
|
|
45
|
+
) {
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public activate(terminal: Terminal): void {
|
|
49
|
+
this._terminal = terminal;
|
|
50
|
+
const options = this._options as ILinkProviderOptions;
|
|
51
|
+
const regex = options.urlRegex || strictUrlRegex;
|
|
52
|
+
this._linkProvider = this._terminal.registerLinkProvider(new WebLinkProvider(this._terminal, regex, this._handler, options));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public dispose(): void {
|
|
56
|
+
this._linkProvider?.dispose();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
|
|
3
|
+
* @license MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import { Terminal, ITerminalAddon, IViewportRange } from '@xterm/xterm';
|
|
8
|
+
|
|
9
|
+
declare module '@xterm/addon-web-links' {
|
|
10
|
+
/**
|
|
11
|
+
* An xterm.js addon that enables web links.
|
|
12
|
+
*/
|
|
13
|
+
export class WebLinksAddon implements ITerminalAddon {
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new web links addon.
|
|
16
|
+
* @param handler The callback when the link is called.
|
|
17
|
+
*
|
|
18
|
+
* Note that this may not work when the terminal is hosted inside an iframe,
|
|
19
|
+
* in that case provide a custom handler in that case being mindful of
|
|
20
|
+
* possible security issues like reverse tabnapping.
|
|
21
|
+
* @param options Options for the link provider.
|
|
22
|
+
*/
|
|
23
|
+
constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkProviderOptions);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Activates the addon
|
|
27
|
+
* @param terminal The terminal the addon is being loaded in.
|
|
28
|
+
*/
|
|
29
|
+
public activate(terminal: Terminal): void;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Disposes the addon.
|
|
33
|
+
*/
|
|
34
|
+
public dispose(): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* An object containing options for a link provider.
|
|
39
|
+
*/
|
|
40
|
+
export interface ILinkProviderOptions {
|
|
41
|
+
/**
|
|
42
|
+
* A callback that fires when the mouse hovers over a link.
|
|
43
|
+
*/
|
|
44
|
+
hover?(event: MouseEvent, text: string, location: IViewportRange): void;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A callback that fires when the mouse leaves a link. Note that this can
|
|
48
|
+
* happen even when tooltipCallback hasn't fired for the link yet.
|
|
49
|
+
*/
|
|
50
|
+
leave?(event: MouseEvent, text: string): void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A callback to use instead of the default one.
|
|
54
|
+
*/
|
|
55
|
+
urlRegex?: RegExp;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# [](https://xtermjs.org)
|
|
2
|
+
|
|
3
|
+
⚠ This package is experimental
|
|
4
|
+
|
|
5
|
+
`xterm-headless` is a headless terminal that can be run in node.js. This is useful in combination with the frontend [`xterm`](https://www.npmjs.com/package/xterm) for example to keep track of a terminal's state on a remote server where the process is hosted.
|
|
6
|
+
|
|
7
|
+
## Getting Started
|
|
8
|
+
|
|
9
|
+
First, you need to install the module, we ship exclusively through npm, so you need that installed and then add xterm.js as a dependency by running:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install xterm-headless
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Then import as you would a regular node package. The recommended way to load `xterm-headless` is with TypeScript and the ES6 module syntax:
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
import { Terminal } from '@xterm/headless';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## API
|
|
22
|
+
|
|
23
|
+
The full API for `xterm-headless` is contained within the [TypeScript declaration file](https://github.com/xtermjs/xterm.js/blob/master/typings/xterm-headless.d.ts), use the branch/tag picker in GitHub (`w`) to navigate to the correct version of the API.
|
|
24
|
+
|
|
25
|
+
Note that some APIs are marked *experimental*, these are added to enable experimentation with new ideas without committing to support it like a normal [semver](https://semver.org/) API. Note that these APIs can change radically between versions, so be sure to read release notes if you plan on using experimental APIs.
|
|
26
|
+
|
|
27
|
+
### Addons
|
|
28
|
+
|
|
29
|
+
Addons in `xterm-headless` work the [same as in `xterm`](https://github.com/xtermjs/xterm.js/blob/master/README.md#addons) with the one caveat being that the addon needs to be packaged for node.js and not use any DOM APIs.
|
|
30
|
+
|
|
31
|
+
Currently no official addons are packaged on npm.
|