korveniq 1.0.1 → 1.0.3
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/bin/index.js +1 -1
- package/lib/build-profile.json +5 -0
- package/lib/chat.js +3 -1
- package/lib/endpoints.js +8 -5
- package/lib/select-menu.js +154 -0
- package/lib/tool-parser.js +2 -1
- package/lib/tools.js +13 -0
- package/lib/utils.js +12 -0
- package/node_modules/@socket.io/component-emitter/LICENSE +24 -0
- package/node_modules/@socket.io/component-emitter/Readme.md +79 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +176 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.js +169 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/package.json +28 -0
- package/node_modules/ansi-regex/index.d.ts +37 -0
- package/node_modules/ansi-regex/index.js +10 -0
- package/node_modules/ansi-regex/license +9 -0
- package/node_modules/ansi-regex/package.json +55 -0
- package/node_modules/ansi-regex/readme.md +78 -0
- package/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/bl/.travis.yml +17 -0
- package/node_modules/bl/BufferList.js +396 -0
- package/node_modules/bl/LICENSE.md +13 -0
- package/node_modules/bl/README.md +247 -0
- package/node_modules/bl/bl.js +84 -0
- package/node_modules/bl/package.json +37 -0
- package/node_modules/bl/test/convert.js +21 -0
- package/node_modules/bl/test/indexOf.js +492 -0
- package/node_modules/bl/test/isBufferList.js +32 -0
- package/node_modules/bl/test/test.js +869 -0
- package/node_modules/buffer/AUTHORS.md +70 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +186 -0
- package/node_modules/buffer/index.js +1817 -0
- package/node_modules/buffer/package.json +96 -0
- package/node_modules/chalk/index.d.ts +415 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +68 -0
- package/node_modules/chalk/readme.md +341 -0
- package/node_modules/chalk/source/index.js +229 -0
- package/node_modules/chalk/source/templates.js +134 -0
- package/node_modules/chalk/source/util.js +39 -0
- package/node_modules/cli-cursor/index.d.ts +45 -0
- package/node_modules/cli-cursor/index.js +35 -0
- package/node_modules/cli-cursor/license +9 -0
- package/node_modules/cli-cursor/package.json +46 -0
- package/node_modules/cli-cursor/readme.md +55 -0
- package/node_modules/cli-spinners/index.d.ts +128 -0
- package/node_modules/cli-spinners/index.js +15 -0
- package/node_modules/cli-spinners/license +9 -0
- package/node_modules/cli-spinners/package.json +50 -0
- package/node_modules/cli-spinners/readme.md +54 -0
- package/node_modules/cli-spinners/spinners.json +1622 -0
- package/node_modules/clone/.npmignore +4 -0
- package/node_modules/clone/LICENSE +18 -0
- package/node_modules/clone/README.md +126 -0
- package/node_modules/clone/clone.iml +10 -0
- package/node_modules/clone/clone.js +166 -0
- package/node_modules/clone/package.json +51 -0
- package/node_modules/color-convert/CHANGELOG.md +54 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +839 -0
- package/node_modules/color-convert/index.js +81 -0
- package/node_modules/color-convert/package.json +48 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +28 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1157 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2509 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +520 -0
- package/node_modules/commander/lib/option.js +330 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +84 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +969 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +60 -0
- package/node_modules/debug/src/browser.js +271 -0
- package/node_modules/debug/src/common.js +274 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/defaults/LICENSE +22 -0
- package/node_modules/defaults/README.md +39 -0
- package/node_modules/defaults/index.js +13 -0
- package/node_modules/defaults/package.json +33 -0
- package/node_modules/defaults/test.js +34 -0
- package/node_modules/define-lazy-prop/index.d.ts +33 -0
- package/node_modules/define-lazy-prop/index.js +19 -0
- package/node_modules/define-lazy-prop/license +9 -0
- package/node_modules/define-lazy-prop/package.json +48 -0
- package/node_modules/define-lazy-prop/readme.md +64 -0
- package/node_modules/engine.io-client/LICENSE +22 -0
- package/node_modules/engine.io-client/README.md +331 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +14 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +38 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +67 -0
- package/node_modules/engine.io-client/build/cjs/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/cjs/globals.js +26 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +20 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.js +97 -0
- package/node_modules/engine.io-client/build/cjs/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/index.js +29 -0
- package/node_modules/engine.io-client/build/cjs/package.json +10 -0
- package/node_modules/engine.io-client/build/cjs/socket.d.ts +439 -0
- package/node_modules/engine.io-client/build/cjs/socket.js +698 -0
- package/node_modules/engine.io-client/build/cjs/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/cjs/transport.js +153 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.js +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +60 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +285 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +54 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.js +165 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.js +136 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +78 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +94 -0
- package/node_modules/engine.io-client/build/cjs/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/cjs/util.js +65 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm/globals.node.d.ts +20 -0
- package/node_modules/engine.io-client/build/esm/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/index.js +14 -0
- package/node_modules/engine.io-client/build/esm/package.json +10 -0
- package/node_modules/engine.io-client/build/esm/socket.d.ts +439 -0
- package/node_modules/engine.io-client/build/esm/socket.js +662 -0
- package/node_modules/engine.io-client/build/esm/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm/transport.js +142 -0
- package/node_modules/engine.io-client/build/esm/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +271 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.js +145 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.js +125 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.js +80 -0
- package/node_modules/engine.io-client/build/esm/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm/util.js +59 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +20 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm-debug/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/index.js +14 -0
- package/node_modules/engine.io-client/build/esm-debug/package.json +10 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +439 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.js +691 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.js +145 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +276 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +158 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +128 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +87 -0
- package/node_modules/engine.io-client/build/esm-debug/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm-debug/util.js +59 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.js +2989 -0
- package/node_modules/engine.io-client/dist/engine.io.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -0
- package/node_modules/engine.io-client/node_modules/debug/LICENSE +20 -0
- package/node_modules/engine.io-client/node_modules/debug/README.md +481 -0
- package/node_modules/engine.io-client/node_modules/debug/package.json +64 -0
- package/node_modules/engine.io-client/node_modules/debug/src/browser.js +272 -0
- package/node_modules/engine.io-client/node_modules/debug/src/common.js +292 -0
- package/node_modules/engine.io-client/node_modules/debug/src/index.js +10 -0
- package/node_modules/engine.io-client/node_modules/debug/src/node.js +263 -0
- package/node_modules/engine.io-client/package.json +95 -0
- package/node_modules/engine.io-parser/LICENSE +22 -0
- package/node_modules/engine.io-parser/Readme.md +158 -0
- package/node_modules/engine.io-parser/build/cjs/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/cjs/commons.js +19 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +48 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +66 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.js +59 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +72 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.js +38 -0
- package/node_modules/engine.io-parser/build/cjs/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/cjs/index.js +164 -0
- package/node_modules/engine.io-parser/build/cjs/package.json +8 -0
- package/node_modules/engine.io-parser/build/esm/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/esm/commons.js +14 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +43 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +62 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.js +55 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +68 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.js +33 -0
- package/node_modules/engine.io-parser/build/esm/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/esm/index.js +156 -0
- package/node_modules/engine.io-parser/build/esm/package.json +8 -0
- package/node_modules/engine.io-parser/package.json +46 -0
- package/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +46 -0
- package/node_modules/has-flag/readme.md +89 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +52 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/is-docker/cli.js +5 -0
- package/node_modules/is-docker/index.d.ts +15 -0
- package/node_modules/is-docker/index.js +29 -0
- package/node_modules/is-docker/license +9 -0
- package/node_modules/is-docker/package.json +42 -0
- package/node_modules/is-docker/readme.md +27 -0
- package/node_modules/is-interactive/index.d.ts +31 -0
- package/node_modules/is-interactive/index.js +9 -0
- package/node_modules/is-interactive/license +9 -0
- package/node_modules/is-interactive/package.json +38 -0
- package/node_modules/is-interactive/readme.md +51 -0
- package/node_modules/is-unicode-supported/index.d.ts +14 -0
- package/node_modules/is-unicode-supported/index.js +13 -0
- package/node_modules/is-unicode-supported/license +9 -0
- package/node_modules/is-unicode-supported/package.json +41 -0
- package/node_modules/is-unicode-supported/readme.md +35 -0
- package/node_modules/is-wsl/index.d.ts +15 -0
- package/node_modules/is-wsl/index.js +31 -0
- package/node_modules/is-wsl/license +9 -0
- package/node_modules/is-wsl/package.json +45 -0
- package/node_modules/is-wsl/readme.md +36 -0
- package/node_modules/log-symbols/browser.js +8 -0
- package/node_modules/log-symbols/index.d.ts +25 -0
- package/node_modules/log-symbols/index.js +19 -0
- package/node_modules/log-symbols/license +9 -0
- package/node_modules/log-symbols/package.json +52 -0
- package/node_modules/log-symbols/readme.md +51 -0
- package/node_modules/mimic-fn/index.d.ts +54 -0
- package/node_modules/mimic-fn/index.js +13 -0
- package/node_modules/mimic-fn/license +9 -0
- package/node_modules/mimic-fn/package.json +42 -0
- package/node_modules/mimic-fn/readme.md +69 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/onetime/index.d.ts +64 -0
- package/node_modules/onetime/index.js +44 -0
- package/node_modules/onetime/license +9 -0
- package/node_modules/onetime/package.json +43 -0
- package/node_modules/onetime/readme.md +94 -0
- package/node_modules/open/index.d.ts +153 -0
- package/node_modules/open/index.js +334 -0
- package/node_modules/open/license +9 -0
- package/node_modules/open/package.json +61 -0
- package/node_modules/open/readme.md +171 -0
- package/node_modules/open/xdg-open +1066 -0
- package/node_modules/ora/index.d.ts +277 -0
- package/node_modules/ora/index.js +407 -0
- package/node_modules/ora/license +9 -0
- package/node_modules/ora/package.json +57 -0
- package/node_modules/ora/readme.md +264 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +106 -0
- package/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +190 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +641 -0
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +68 -0
- package/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/restore-cursor/index.d.ts +13 -0
- package/node_modules/restore-cursor/index.js +9 -0
- package/node_modules/restore-cursor/license +9 -0
- package/node_modules/restore-cursor/package.json +52 -0
- package/node_modules/restore-cursor/readme.md +26 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +202 -0
- package/node_modules/signal-exit/package.json +38 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/socket.io-client/LICENSE +21 -0
- package/node_modules/socket.io-client/README.md +29 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +69 -0
- package/node_modules/socket.io-client/build/cjs/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/cjs/index.js +76 -0
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/cjs/manager.js +416 -0
- package/node_modules/socket.io-client/build/cjs/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/on.js +9 -0
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/cjs/socket.js +910 -0
- package/node_modules/socket.io-client/build/cjs/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/cjs/url.js +69 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm/index.js +58 -0
- package/node_modules/socket.io-client/build/esm/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm/manager.js +367 -0
- package/node_modules/socket.io-client/build/esm/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/on.js +6 -0
- package/node_modules/socket.io-client/build/esm/package.json +5 -0
- package/node_modules/socket.io-client/build/esm/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm/socket.js +882 -0
- package/node_modules/socket.io-client/build/esm/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm/url.js +59 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm-debug/index.js +62 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.js +386 -0
- package/node_modules/socket.io-client/build/esm-debug/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/on.js +6 -0
- package/node_modules/socket.io-client/build/esm-debug/package.json +5 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.js +903 -0
- package/node_modules/socket.io-client/build/esm-debug/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm-debug/url.js +63 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.js +4908 -0
- package/node_modules/socket.io-client/dist/socket.io.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -0
- package/node_modules/socket.io-client/package.json +101 -0
- package/node_modules/socket.io-parser/LICENSE +20 -0
- package/node_modules/socket.io-parser/Readme.md +81 -0
- package/node_modules/socket.io-parser/build/cjs/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/cjs/binary.js +90 -0
- package/node_modules/socket.io-parser/build/cjs/index.d.ts +101 -0
- package/node_modules/socket.io-parser/build/cjs/index.js +366 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.js +54 -0
- package/node_modules/socket.io-parser/build/cjs/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm/binary.js +86 -0
- package/node_modules/socket.io-parser/build/esm/index.d.ts +101 -0
- package/node_modules/socket.io-parser/build/esm/index.js +352 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.js +86 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +101 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.js +357 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm-debug/package.json +3 -0
- package/node_modules/socket.io-parser/node_modules/debug/LICENSE +20 -0
- package/node_modules/socket.io-parser/node_modules/debug/README.md +481 -0
- package/node_modules/socket.io-parser/node_modules/debug/package.json +64 -0
- package/node_modules/socket.io-parser/node_modules/debug/src/browser.js +272 -0
- package/node_modules/socket.io-parser/node_modules/debug/src/common.js +292 -0
- package/node_modules/socket.io-parser/node_modules/debug/src/index.js +10 -0
- package/node_modules/socket.io-parser/node_modules/debug/src/node.js +263 -0
- package/node_modules/socket.io-parser/package.json +44 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +34 -0
- package/node_modules/strip-ansi/index.d.ts +17 -0
- package/node_modules/strip-ansi/index.js +4 -0
- package/node_modules/strip-ansi/license +9 -0
- package/node_modules/strip-ansi/package.json +54 -0
- package/node_modules/strip-ansi/readme.md +46 -0
- package/node_modules/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +135 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +53 -0
- package/node_modules/supports-color/readme.md +76 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/wcwidth/.npmignore +1 -0
- package/node_modules/wcwidth/LICENSE +30 -0
- package/node_modules/wcwidth/Readme.md +33 -0
- package/node_modules/wcwidth/combining.js +50 -0
- package/node_modules/wcwidth/docs/index.md +65 -0
- package/node_modules/wcwidth/index.js +99 -0
- package/node_modules/wcwidth/package.json +42 -0
- package/node_modules/wcwidth/test/index.js +64 -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 +1407 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/node_modules/xmlhttprequest-ssl/LICENSE +22 -0
- package/node_modules/xmlhttprequest-ssl/README.md +67 -0
- package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +689 -0
- package/node_modules/xmlhttprequest-ssl/package.json +40 -0
- package/package.json +8 -15
package/bin/index.js
CHANGED
|
@@ -221,7 +221,7 @@ Examples:
|
|
|
221
221
|
Environment:
|
|
222
222
|
KORVENIQ_TOKEN use this token instead of the saved login (CI, scripts)
|
|
223
223
|
KORVENIQ_HOME folder for settings and credentials (default ~/.korveniq)
|
|
224
|
-
KORVENIQ_API_URL address of the Korveniq API (
|
|
224
|
+
KORVENIQ_API_URL address of the Korveniq API (optional: the official one is built in)
|
|
225
225
|
KORVENIQ_DEBUG=1 same as --debug
|
|
226
226
|
KORVENIQ_RETRIES=n automatic retries of safe requests, 0-5 (default 2)
|
|
227
227
|
KORVENIQ_ASCII=1 ASCII symbols instead of Unicode
|
package/lib/chat.js
CHANGED
|
@@ -289,7 +289,9 @@ async function showWelcome(session) {
|
|
|
289
289
|
/** Ask the user to confirm the working directory. Ctrl+C counts as "no". */
|
|
290
290
|
async function confirmDirectory() {
|
|
291
291
|
try {
|
|
292
|
-
|
|
292
|
+
// The path gets its own line: a long path never splits the question (or the menu under it) across rows.
|
|
293
|
+
console.log(` Working in: ${theme.bold(sanitizeForTerminal(process.cwd(), { singleLine: true }))}`);
|
|
294
|
+
const ok = await askYesNo('Proceed?');
|
|
293
295
|
console.log();
|
|
294
296
|
return ok;
|
|
295
297
|
} catch (err) {
|
package/lib/endpoints.js
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* The Socket.IO server runs on the same origin as baseUrl (no /api/v1 path);
|
|
21
21
|
* set "socketUrl" in endpoints.json only if it ever moves.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
* "baseUrl" in ~/.korveniq/endpoints.json
|
|
23
|
+
* The official production API address is built in (DEFAULT_BASE_URL, authorized by the owner and the one the web app uses), so
|
|
24
|
+
* nobody has to configure anything. KORVENIQ_API_URL or "baseUrl" in ~/.korveniq/endpoints.json still override it (staging, tests).
|
|
25
25
|
*
|
|
26
26
|
* Endpoint names the CLI uses: login, me, createChat, listChats, getChat,
|
|
27
27
|
* deleteChat, renameChat, chatReadiness, chatCapabilities, sendMessage, runStatus, cancelRun.
|
|
@@ -32,8 +32,11 @@ const path = require('path');
|
|
|
32
32
|
const { CONFIG_DIR } = require('./config');
|
|
33
33
|
const { CliError } = require('./errors');
|
|
34
34
|
|
|
35
|
+
/** The official production API (the address the Korveniq web app itself uses). */
|
|
36
|
+
const DEFAULT_BASE_URL = 'https://u12489-kefu-4808c2f6.singapore-a.gpuhub.com:8443';
|
|
37
|
+
|
|
35
38
|
const DEFAULTS = {
|
|
36
|
-
baseUrl:
|
|
39
|
+
baseUrl: DEFAULT_BASE_URL,
|
|
37
40
|
endpoints: {
|
|
38
41
|
login: 'POST /api/v1/auth/login',
|
|
39
42
|
me: 'GET /api/v1/auth/me',
|
|
@@ -124,7 +127,7 @@ function load() {
|
|
|
124
127
|
}
|
|
125
128
|
if (!baseUrl) {
|
|
126
129
|
throw Object.assign(new CliError('No API address is configured', {
|
|
127
|
-
action: 'Set the address of the Korveniq API
|
|
130
|
+
action: 'Set the address of the Korveniq API for example:',
|
|
128
131
|
commands: ['KORVENIQ_API_URL=https://<api address> korveniq', 'or put { "baseUrl": "https://<api address>" } in ~/.korveniq/endpoints.json'],
|
|
129
132
|
}), { configError: true });
|
|
130
133
|
}
|
|
@@ -173,4 +176,4 @@ function socketUrl() {
|
|
|
173
176
|
return load().socketUrl;
|
|
174
177
|
}
|
|
175
178
|
|
|
176
|
-
module.exports = { get, load, socketUrl };
|
|
179
|
+
module.exports = { get, load, socketUrl, DEFAULT_BASE_URL };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An arrow-key selection menu for confirmation dialogs (Claude Code style).
|
|
5
|
+
*
|
|
6
|
+
* ? Run this command?
|
|
7
|
+
* ❯ 1. Yes
|
|
8
|
+
* 2. No
|
|
9
|
+
*
|
|
10
|
+
* Up/Down (or k/j, Tab) move, Enter confirms, Esc and Ctrl+C cancel (the caller treats a cancel as "no").
|
|
11
|
+
* The letter keys given as `key` on an option, and the digits 1-9, only MOVE the highlight: a stray
|
|
12
|
+
* keystroke never approves anything, Enter always decides. The highlighted option at the start is
|
|
13
|
+
* `initial`; callers start on the safe option for everything that changes something.
|
|
14
|
+
*
|
|
15
|
+
* Each redraw is one write (cursor up + clear + the whole frame), so nothing flickers or repeats.
|
|
16
|
+
* Raw mode and the 'keypress' listeners are restored on every way out. Without a TTY the caller
|
|
17
|
+
* must not use this (see canSelect()).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const readline = require('readline');
|
|
21
|
+
const { theme, symbols } = require('./ui');
|
|
22
|
+
|
|
23
|
+
const ESC = '\x1b';
|
|
24
|
+
const POINTER = symbols.bullet === '⏺' ? '❯' : '>';
|
|
25
|
+
|
|
26
|
+
/** True when both ends are a terminal, so arrow keys can work. */
|
|
27
|
+
function canSelect(input = process.stdin, output = process.stdout) {
|
|
28
|
+
return Boolean(input && input.isTTY && output && output.isTTY && typeof input.setRawMode === 'function');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Everything outside the cursor's own row: how many terminal rows `text` occupies at `columns`. */
|
|
32
|
+
function rowsOf(text, columns) {
|
|
33
|
+
const width = Math.max(1, columns || 80);
|
|
34
|
+
let rows = 0;
|
|
35
|
+
for (const line of text.split('\n')) {
|
|
36
|
+
// Strip colour codes before measuring.
|
|
37
|
+
const plain = line.replace(/\x1b\[[0-9;]*m/g, '');
|
|
38
|
+
rows += Math.max(1, Math.ceil(plain.length / width));
|
|
39
|
+
}
|
|
40
|
+
return rows;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Show a menu and wait for a choice.
|
|
45
|
+
* @param {object} opts
|
|
46
|
+
* @param {string} opts.question already styled
|
|
47
|
+
* @param {Array<{ label: string, value: any, key?: string, hint?: string, danger?: boolean }>} opts.options
|
|
48
|
+
* @param {number} [opts.initial=0] index highlighted first
|
|
49
|
+
* @param {NodeJS.ReadStream} [opts.input]
|
|
50
|
+
* @param {NodeJS.WriteStream} [opts.output]
|
|
51
|
+
* @returns {Promise<{ cancelled: boolean, value: any, index: number }>}
|
|
52
|
+
*/
|
|
53
|
+
function selectMenu({ question, options, initial = 0, input = process.stdin, output = process.stdout }) {
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
let index = Math.min(Math.max(initial, 0), options.length - 1);
|
|
56
|
+
let drawnRows = 0;
|
|
57
|
+
let settled = false;
|
|
58
|
+
|
|
59
|
+
const frame = () => {
|
|
60
|
+
const lines = [`${question}`];
|
|
61
|
+
options.forEach((o, i) => {
|
|
62
|
+
const on = i === index;
|
|
63
|
+
const tint = o.danger ? theme.warn : theme.aiLabel;
|
|
64
|
+
const pointer = on ? tint(POINTER) : ' ';
|
|
65
|
+
const text = `${i + 1}. ${o.label}`;
|
|
66
|
+
const hint = o.hint ? ` ${theme.dim(o.hint)}` : '';
|
|
67
|
+
lines.push(` ${pointer} ${on ? tint(theme.bold(text)) : text}${hint}`);
|
|
68
|
+
});
|
|
69
|
+
lines.push(theme.dim(' Up/Down to move, Enter to confirm, Esc to cancel'));
|
|
70
|
+
return lines.join('\n');
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const draw = () => {
|
|
74
|
+
const text = frame();
|
|
75
|
+
// Back to the first row of the previous frame, clear to the end of the screen, write the new frame.
|
|
76
|
+
const up = drawnRows > 0 ? `\r${ESC}[${drawnRows - 1 > 0 ? drawnRows - 1 : 0}A${ESC}[J` : '';
|
|
77
|
+
output.write(`${up || ''}${text}`);
|
|
78
|
+
drawnRows = rowsOf(text, output.columns);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
readline.emitKeypressEvents(input);
|
|
82
|
+
const wasRaw = input.isRaw;
|
|
83
|
+
input.setRawMode(true);
|
|
84
|
+
input.resume();
|
|
85
|
+
output.write(`${ESC}[?25l`); // hide the cursor while the menu is up
|
|
86
|
+
|
|
87
|
+
const finish = (cancelled) => {
|
|
88
|
+
if (settled) return;
|
|
89
|
+
settled = true;
|
|
90
|
+
input.removeListener('keypress', onKey);
|
|
91
|
+
input.removeListener('end', onEnd);
|
|
92
|
+
input.removeListener('close', onEnd);
|
|
93
|
+
try {
|
|
94
|
+
input.setRawMode(Boolean(wasRaw));
|
|
95
|
+
} catch {
|
|
96
|
+
/* terminal gone */
|
|
97
|
+
}
|
|
98
|
+
if (!wasRaw) input.pause();
|
|
99
|
+
// Leave one line: the question and the chosen answer, instead of the whole menu.
|
|
100
|
+
const up = drawnRows > 0 ? `\r${ESC}[${Math.max(drawnRows - 1, 0)}A${ESC}[J` : '';
|
|
101
|
+
const chosen = options[index];
|
|
102
|
+
const summary = cancelled
|
|
103
|
+
? `${question} ${theme.dim('(cancelled)')}`
|
|
104
|
+
: `${question} ${(chosen.danger ? theme.warn : theme.bold)(chosen.label)}`;
|
|
105
|
+
output.write(`${up}${summary}\n${ESC}[?25h`);
|
|
106
|
+
resolve({ cancelled, value: cancelled ? undefined : chosen.value, index });
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const move = (delta) => {
|
|
110
|
+
index = (index + delta + options.length) % options.length;
|
|
111
|
+
draw();
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
function onKey(str, key = {}) {
|
|
115
|
+
if (settled) return;
|
|
116
|
+
if (key.ctrl && key.name === 'c') return finish(true);
|
|
117
|
+
if (key.ctrl && key.name === 'd') return finish(true);
|
|
118
|
+
switch (key.name) {
|
|
119
|
+
case 'escape':
|
|
120
|
+
return finish(true);
|
|
121
|
+
case 'return':
|
|
122
|
+
case 'enter':
|
|
123
|
+
return finish(false);
|
|
124
|
+
case 'up':
|
|
125
|
+
return move(-1);
|
|
126
|
+
case 'down':
|
|
127
|
+
return move(1);
|
|
128
|
+
case 'tab':
|
|
129
|
+
return move(key.shift ? -1 : 1);
|
|
130
|
+
default:
|
|
131
|
+
}
|
|
132
|
+
const ch = String(str || '').toLowerCase();
|
|
133
|
+
if (ch === 'k') return move(-1);
|
|
134
|
+
if (ch === 'j') return move(1);
|
|
135
|
+
let target = -1;
|
|
136
|
+
if (/^[1-9]$/.test(ch)) target = Number(ch) - 1;
|
|
137
|
+
else if (ch) target = options.findIndex((o) => o.key && o.key.toLowerCase() === ch);
|
|
138
|
+
if (target >= 0 && target < options.length && target !== index) {
|
|
139
|
+
index = target;
|
|
140
|
+
draw();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function onEnd() {
|
|
144
|
+
finish(true); // input ended: never approve
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
input.on('keypress', onKey);
|
|
148
|
+
input.once('end', onEnd);
|
|
149
|
+
input.once('close', onEnd);
|
|
150
|
+
draw();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
module.exports = { selectMenu, canSelect, rowsOf };
|
package/lib/tool-parser.js
CHANGED
|
@@ -490,7 +490,8 @@ function extractToolCalls({ text = '', message = null, nonces = null, markerHint
|
|
|
490
490
|
/* not a call: just prose that mentions the tag */
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
|
|
493
|
+
// `raw` tells two different refused blocks apart (the loop guard counts the SAME failing call, not every refusal).
|
|
494
|
+
if (well) calls.push({ name: null, misplaced: true, error: MISPLACED_HINT, raw: text.slice(r.bodyStart, r.bodyEnd) });
|
|
494
495
|
} else if (r.kind === 'xml') {
|
|
495
496
|
const { open } = r;
|
|
496
497
|
const body = text.slice(r.bodyStart, r.bodyEnd);
|
package/lib/tools.js
CHANGED
|
@@ -90,6 +90,7 @@ const path = require('path');
|
|
|
90
90
|
const { spawn, spawnSync } = require('child_process');
|
|
91
91
|
const ui = require('./ui');
|
|
92
92
|
const { theme, ask, onInterrupt, sanitizeForTerminal, hasHiddenChars, countHiddenChars } = require('./utils');
|
|
93
|
+
const selectMenu = require('./select-menu');
|
|
93
94
|
const { CancelledError } = require('./errors');
|
|
94
95
|
const { CONFIG_DIR } = require('./config');
|
|
95
96
|
const sandbox = require('./sandbox');
|
|
@@ -1208,6 +1209,18 @@ class ToolRunner {
|
|
|
1208
1209
|
const mgr = require('./notifications').manager();
|
|
1209
1210
|
mgr.transition('awaiting_approval');
|
|
1210
1211
|
try {
|
|
1212
|
+
if (this.prompt === ask && selectMenu.canSelect()) {
|
|
1213
|
+
// A real terminal: arrow keys + Enter. "No" is always highlighted first; Esc / Ctrl+C means no.
|
|
1214
|
+
const options = [{ label: 'Yes', value: 'yes', key: 'y' }];
|
|
1215
|
+
if (allowAlways) options.push({ label: `Yes, ${alwaysHint}`, value: 'always', key: 'a' });
|
|
1216
|
+
options.push({ label: 'No', value: 'no', key: 'n' });
|
|
1217
|
+
const safe = options.length - 1;
|
|
1218
|
+
// The unsandboxed choice goes below "No": from the highlighted default, Up reaches the safe yeses, and only a deliberate Down reaches it.
|
|
1219
|
+
if (allowUnrestricted) options.push({ label: 'Yes, without the sandbox', value: 'unrestricted', key: 'u', danger: true });
|
|
1220
|
+
const r = await selectMenu.selectMenu({ question: ` ${theme.warn('?')} ${theme.bold(question)}`, options, initial: safe });
|
|
1221
|
+
if (r.cancelled) return 'no';
|
|
1222
|
+
return r.value;
|
|
1223
|
+
}
|
|
1211
1224
|
const answer = String(await this.prompt(approvalText(question, { allowAlways, alwaysHint, allowUnrestricted }))).toLowerCase();
|
|
1212
1225
|
if (answer === 'y' || answer === 'yes') return 'yes';
|
|
1213
1226
|
if (allowUnrestricted && (answer === 'u' || answer === 'unrestricted')) return 'unrestricted';
|
package/lib/utils.js
CHANGED
|
@@ -112,6 +112,18 @@ function askHidden(question) {
|
|
|
112
112
|
* @returns {Promise<boolean>}
|
|
113
113
|
*/
|
|
114
114
|
async function askYesNo(question, { default: dflt = true } = {}) {
|
|
115
|
+
const menu = require('./select-menu');
|
|
116
|
+
if (menu.canSelect()) {
|
|
117
|
+
// Arrow keys + Enter. The highlight starts on the default; Esc / Ctrl+C is "no" (or a cancel, like Ctrl+C at the typed prompt).
|
|
118
|
+
const r = await menu.selectMenu({
|
|
119
|
+
question: ` ${theme.warn('?')} ${theme.bold(question)}`,
|
|
120
|
+
options: [{ label: 'Yes', value: true, key: 'y' }, { label: 'No', value: false, key: 'n' }],
|
|
121
|
+
initial: dflt ? 0 : 1,
|
|
122
|
+
});
|
|
123
|
+
require('./notifications').manager().noteUserActivity();
|
|
124
|
+
if (r.cancelled) throw new CancelledError();
|
|
125
|
+
return r.value;
|
|
126
|
+
}
|
|
115
127
|
const hint = dflt ? '[Y/n]' : '[y/N]';
|
|
116
128
|
for (;;) {
|
|
117
129
|
const answer = (await ask(`${question} ${theme.dim(hint)} `)).toLowerCase();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Component contributors <dev@component.io>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person
|
|
6
|
+
obtaining a copy of this software and associated documentation
|
|
7
|
+
files (the "Software"), to deal in the Software without
|
|
8
|
+
restriction, including without limitation the rights to use,
|
|
9
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the
|
|
11
|
+
Software is furnished to do so, subject to the following
|
|
12
|
+
conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be
|
|
15
|
+
included in all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# `@socket.io/component-emitter`
|
|
2
|
+
|
|
3
|
+
Event emitter component.
|
|
4
|
+
|
|
5
|
+
This project is a fork of the [`component-emitter`](https://github.com/sindresorhus/component-emitter) project, with [Socket.IO](https://socket.io/)-specific TypeScript typings.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
$ npm i @socket.io/component-emitter
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## API
|
|
14
|
+
|
|
15
|
+
### Emitter(obj)
|
|
16
|
+
|
|
17
|
+
The `Emitter` may also be used as a mixin. For example
|
|
18
|
+
a "plain" object may become an emitter, or you may
|
|
19
|
+
extend an existing prototype.
|
|
20
|
+
|
|
21
|
+
As an `Emitter` instance:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { Emitter } from '@socket.io/component-emitter';
|
|
25
|
+
|
|
26
|
+
var emitter = new Emitter;
|
|
27
|
+
emitter.emit('something');
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
As a mixin:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { Emitter } from '@socket.io/component-emitter';
|
|
34
|
+
|
|
35
|
+
var user = { name: 'tobi' };
|
|
36
|
+
Emitter(user);
|
|
37
|
+
|
|
38
|
+
user.emit('im a user');
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
As a prototype mixin:
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import { Emitter } from '@socket.io/component-emitter';
|
|
45
|
+
|
|
46
|
+
Emitter(User.prototype);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Emitter#on(event, fn)
|
|
50
|
+
|
|
51
|
+
Register an `event` handler `fn`.
|
|
52
|
+
|
|
53
|
+
### Emitter#once(event, fn)
|
|
54
|
+
|
|
55
|
+
Register a single-shot `event` handler `fn`,
|
|
56
|
+
removed immediately after it is invoked the
|
|
57
|
+
first time.
|
|
58
|
+
|
|
59
|
+
### Emitter#off(event, fn)
|
|
60
|
+
|
|
61
|
+
* Pass `event` and `fn` to remove a listener.
|
|
62
|
+
* Pass `event` to remove all listeners on that event.
|
|
63
|
+
* Pass nothing to remove all listeners on all events.
|
|
64
|
+
|
|
65
|
+
### Emitter#emit(event, ...)
|
|
66
|
+
|
|
67
|
+
Emit an `event` with variable option args.
|
|
68
|
+
|
|
69
|
+
### Emitter#listeners(event)
|
|
70
|
+
|
|
71
|
+
Return an array of callbacks, or an empty array.
|
|
72
|
+
|
|
73
|
+
### Emitter#hasListeners(event)
|
|
74
|
+
|
|
75
|
+
Check if this emitter has `event` handlers.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An events map is an interface that maps event names to their value, which
|
|
3
|
+
* represents the type of the `on` listener.
|
|
4
|
+
*/
|
|
5
|
+
export interface EventsMap {
|
|
6
|
+
[event: string]: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The default events map, used if no EventsMap is given. Using this EventsMap
|
|
11
|
+
* is equivalent to accepting all event names, and any data.
|
|
12
|
+
*/
|
|
13
|
+
export interface DefaultEventsMap {
|
|
14
|
+
[event: string]: (...args: any[]) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns a union type containing all the keys of an event map.
|
|
19
|
+
*/
|
|
20
|
+
export type EventNames<Map extends EventsMap> = keyof Map & (string | symbol);
|
|
21
|
+
|
|
22
|
+
/** The tuple type representing the parameters of an event listener */
|
|
23
|
+
export type EventParams<
|
|
24
|
+
Map extends EventsMap,
|
|
25
|
+
Ev extends EventNames<Map>
|
|
26
|
+
> = Parameters<Map[Ev]>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The event names that are either in ReservedEvents or in UserEvents
|
|
30
|
+
*/
|
|
31
|
+
export type ReservedOrUserEventNames<
|
|
32
|
+
ReservedEventsMap extends EventsMap,
|
|
33
|
+
UserEvents extends EventsMap
|
|
34
|
+
> = EventNames<ReservedEventsMap> | EventNames<UserEvents>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Type of a listener of a user event or a reserved event. If `Ev` is in
|
|
38
|
+
* `ReservedEvents`, the reserved event listener is returned.
|
|
39
|
+
*/
|
|
40
|
+
export type ReservedOrUserListener<
|
|
41
|
+
ReservedEvents extends EventsMap,
|
|
42
|
+
UserEvents extends EventsMap,
|
|
43
|
+
Ev extends ReservedOrUserEventNames<ReservedEvents, UserEvents>
|
|
44
|
+
> = FallbackToUntypedListener<
|
|
45
|
+
Ev extends EventNames<ReservedEvents>
|
|
46
|
+
? ReservedEvents[Ev]
|
|
47
|
+
: Ev extends EventNames<UserEvents>
|
|
48
|
+
? UserEvents[Ev]
|
|
49
|
+
: never
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Returns an untyped listener type if `T` is `never`; otherwise, returns `T`.
|
|
54
|
+
*
|
|
55
|
+
* This is a hack to mitigate https://github.com/socketio/socket.io/issues/3833.
|
|
56
|
+
* Needed because of https://github.com/microsoft/TypeScript/issues/41778
|
|
57
|
+
*/
|
|
58
|
+
type FallbackToUntypedListener<T> = [T] extends [never]
|
|
59
|
+
? (...args: any[]) => void | Promise<void>
|
|
60
|
+
: T;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Strictly typed version of an `EventEmitter`. A `TypedEventEmitter` takes type
|
|
64
|
+
* parameters for mappings of event names to event data types, and strictly
|
|
65
|
+
* types method calls to the `EventEmitter` according to these event maps.
|
|
66
|
+
*
|
|
67
|
+
* @typeParam ListenEvents - `EventsMap` of user-defined events that can be
|
|
68
|
+
* listened to with `on` or `once`
|
|
69
|
+
* @typeParam EmitEvents - `EventsMap` of user-defined events that can be
|
|
70
|
+
* emitted with `emit`
|
|
71
|
+
* @typeParam ReservedEvents - `EventsMap` of reserved events, that can be
|
|
72
|
+
* emitted by socket.io with `emitReserved`, and can be listened to with
|
|
73
|
+
* `listen`.
|
|
74
|
+
*/
|
|
75
|
+
export class Emitter<
|
|
76
|
+
ListenEvents extends EventsMap,
|
|
77
|
+
EmitEvents extends EventsMap,
|
|
78
|
+
ReservedEvents extends EventsMap = {}
|
|
79
|
+
> {
|
|
80
|
+
/**
|
|
81
|
+
* Adds the `listener` function as an event listener for `ev`.
|
|
82
|
+
*
|
|
83
|
+
* @param ev Name of the event
|
|
84
|
+
* @param listener Callback function
|
|
85
|
+
*/
|
|
86
|
+
on<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
|
87
|
+
ev: Ev,
|
|
88
|
+
listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
|
89
|
+
): this;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Adds a one-time `listener` function as an event listener for `ev`.
|
|
93
|
+
*
|
|
94
|
+
* @param ev Name of the event
|
|
95
|
+
* @param listener Callback function
|
|
96
|
+
*/
|
|
97
|
+
once<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
|
98
|
+
ev: Ev,
|
|
99
|
+
listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
|
100
|
+
): this;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Removes the `listener` function as an event listener for `ev`.
|
|
104
|
+
*
|
|
105
|
+
* @param ev Name of the event
|
|
106
|
+
* @param listener Callback function
|
|
107
|
+
*/
|
|
108
|
+
off<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
|
109
|
+
ev?: Ev,
|
|
110
|
+
listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
|
111
|
+
): this;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Emits an event.
|
|
115
|
+
*
|
|
116
|
+
* @param ev Name of the event
|
|
117
|
+
* @param args Values to send to listeners of this event
|
|
118
|
+
*/
|
|
119
|
+
emit<Ev extends EventNames<EmitEvents>>(
|
|
120
|
+
ev: Ev,
|
|
121
|
+
...args: EventParams<EmitEvents, Ev>
|
|
122
|
+
): this;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Emits a reserved event.
|
|
126
|
+
*
|
|
127
|
+
* This method is `protected`, so that only a class extending
|
|
128
|
+
* `StrictEventEmitter` can emit its own reserved events.
|
|
129
|
+
*
|
|
130
|
+
* @param ev Reserved event name
|
|
131
|
+
* @param args Arguments to emit along with the event
|
|
132
|
+
*/
|
|
133
|
+
protected emitReserved<Ev extends EventNames<ReservedEvents>>(
|
|
134
|
+
ev: Ev,
|
|
135
|
+
...args: EventParams<ReservedEvents, Ev>
|
|
136
|
+
): this;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Returns the listeners listening to an event.
|
|
140
|
+
*
|
|
141
|
+
* @param event Event name
|
|
142
|
+
* @returns Array of listeners subscribed to `event`
|
|
143
|
+
*/
|
|
144
|
+
listeners<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
|
145
|
+
event: Ev
|
|
146
|
+
): ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>[];
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Returns true if there is a listener for this event.
|
|
150
|
+
*
|
|
151
|
+
* @param event Event name
|
|
152
|
+
* @returns boolean
|
|
153
|
+
*/
|
|
154
|
+
hasListeners<
|
|
155
|
+
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
|
156
|
+
>(event: Ev): boolean;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Removes the `listener` function as an event listener for `ev`.
|
|
160
|
+
*
|
|
161
|
+
* @param ev Name of the event
|
|
162
|
+
* @param listener Callback function
|
|
163
|
+
*/
|
|
164
|
+
removeListener<
|
|
165
|
+
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
|
166
|
+
>(
|
|
167
|
+
ev?: Ev,
|
|
168
|
+
listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
|
169
|
+
): this;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Removes all `listener` function as an event listener for `ev`.
|
|
173
|
+
*
|
|
174
|
+
* @param ev Name of the event
|
|
175
|
+
*/
|
|
176
|
+
removeAllListeners<
|
|
177
|
+
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
|
178
|
+
>(ev?: Ev): this;
|
|
179
|
+
}
|