@sng2c/pi-the-giver 0.1.0 → 0.1.1
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/node_modules/@earendil-works/pi-tui/README.md +779 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +54 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +632 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +104 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +249 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +1916 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +76 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +37 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +426 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +31 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +69 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +95 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +688 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +159 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +185 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +19 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js +89 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +110 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js +32 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +193 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +174 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +184 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.js +1173 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +44 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +339 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +85 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +324 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +88 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +315 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +227 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +1077 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +25 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +79 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +1017 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/license +9 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/package.json +83 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/readme.md +297 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/index.d.ts +325 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/index.js +225 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/utilities.js +33 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/node_modules/@earendil-works/pi-tui/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/node_modules/@earendil-works/pi-tui/package.json +52 -0
- package/node_modules/@types/mime-types/LICENSE +21 -0
- package/node_modules/@types/mime-types/README.md +28 -0
- package/node_modules/@types/mime-types/index.d.ts +9 -0
- package/node_modules/@types/mime-types/package.json +25 -0
- package/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/node_modules/get-east-asian-width/index.js +30 -0
- package/node_modules/get-east-asian-width/license +9 -0
- package/node_modules/get-east-asian-width/lookup-data.js +21 -0
- package/node_modules/get-east-asian-width/lookup.js +138 -0
- package/node_modules/get-east-asian-width/package.json +71 -0
- package/node_modules/get-east-asian-width/readme.md +65 -0
- package/node_modules/get-east-asian-width/utilities.js +24 -0
- package/node_modules/jiti/LICENSE +21 -0
- package/node_modules/jiti/README.md +258 -0
- package/node_modules/jiti/dist/babel.cjs +257 -0
- package/node_modules/jiti/dist/jiti.cjs +1 -0
- package/node_modules/jiti/lib/jiti-cli.mjs +34 -0
- package/node_modules/jiti/lib/jiti-hooks.mjs +124 -0
- package/node_modules/jiti/lib/jiti-native.mjs +121 -0
- package/node_modules/jiti/lib/jiti-register.d.mts +1 -0
- package/node_modules/jiti/lib/jiti-register.mjs +4 -0
- package/node_modules/jiti/lib/jiti-static.mjs +23 -0
- package/node_modules/jiti/lib/jiti.cjs +30 -0
- package/node_modules/jiti/lib/jiti.d.cts +8 -0
- package/node_modules/jiti/lib/jiti.d.mts +8 -0
- package/node_modules/jiti/lib/jiti.mjs +29 -0
- package/node_modules/jiti/lib/types.d.ts +420 -0
- package/node_modules/jiti/package.json +146 -0
- package/node_modules/koffi/CHANGELOG.md +1093 -0
- package/node_modules/koffi/LICENSE.txt +22 -0
- package/node_modules/koffi/README.md +43 -0
- package/node_modules/koffi/build/koffi/darwin_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/darwin_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_armhf/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_loong64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_riscv64d/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/musl_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/musl_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/openbsd_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/openbsd_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.node +0 -0
- package/node_modules/koffi/doc/benchmarks.md +126 -0
- package/node_modules/koffi/doc/callbacks.md +210 -0
- package/node_modules/koffi/doc/contribute.md +148 -0
- package/node_modules/koffi/doc/functions.md +250 -0
- package/node_modules/koffi/doc/index.md +61 -0
- package/node_modules/koffi/doc/input.md +471 -0
- package/node_modules/koffi/doc/migration.md +159 -0
- package/node_modules/koffi/doc/misc.md +180 -0
- package/node_modules/koffi/doc/output.md +305 -0
- package/node_modules/koffi/doc/packaging.md +88 -0
- package/node_modules/koffi/doc/platforms.md +36 -0
- package/node_modules/koffi/doc/pointers.md +328 -0
- package/node_modules/koffi/doc/start.md +118 -0
- package/node_modules/koffi/doc/unions.md +186 -0
- package/node_modules/koffi/doc/variables.md +102 -0
- package/node_modules/koffi/index.d.ts +288 -0
- package/node_modules/koffi/index.js +634 -0
- package/node_modules/koffi/indirect.js +533 -0
- package/node_modules/koffi/lib/native/base/base.cc +11015 -0
- package/node_modules/koffi/lib/native/base/base.hh +6003 -0
- package/node_modules/koffi/lib/native/base/crc.inc +2214 -0
- package/node_modules/koffi/lib/native/base/crc_gen.py +72 -0
- package/node_modules/koffi/lib/native/base/mimetypes.inc +1248 -0
- package/node_modules/koffi/lib/native/base/mimetypes_gen.py +58 -0
- package/node_modules/koffi/lib/native/base/tower.cc +821 -0
- package/node_modules/koffi/lib/native/base/tower.hh +81 -0
- package/node_modules/koffi/lib/native/base/unicode.inc +408 -0
- package/node_modules/koffi/lib/native/base/unicode_gen.py +152 -0
- package/node_modules/koffi/package.json +38 -0
- package/node_modules/koffi/src/cnoke/LICENSE.txt +22 -0
- package/node_modules/koffi/src/cnoke/README.md +99 -0
- package/node_modules/koffi/src/cnoke/assets/FindCNoke.cmake +127 -0
- package/node_modules/koffi/src/cnoke/assets/toolchains.json +126 -0
- package/node_modules/koffi/src/cnoke/assets/win_delay_hook.c +36 -0
- package/node_modules/koffi/src/cnoke/cnoke.js +170 -0
- package/node_modules/koffi/src/cnoke/package.json +24 -0
- package/node_modules/koffi/src/cnoke/src/builder.js +511 -0
- package/node_modules/koffi/src/cnoke/src/index.js +10 -0
- package/node_modules/koffi/src/cnoke/src/tools.js +407 -0
- package/node_modules/koffi/src/koffi/CMakeLists.txt +182 -0
- package/node_modules/koffi/src/koffi/src/abi_arm32.cc +1018 -0
- package/node_modules/koffi/src/koffi/src/abi_arm32_asm.S +169 -0
- package/node_modules/koffi/src/koffi/src/abi_arm64.cc +1295 -0
- package/node_modules/koffi/src/koffi/src/abi_arm64_asm.S +195 -0
- package/node_modules/koffi/src/koffi/src/abi_arm64_asm.asm +174 -0
- package/node_modules/koffi/src/koffi/src/abi_loong64.cc +5 -0
- package/node_modules/koffi/src/koffi/src/abi_loong64_asm.S +204 -0
- package/node_modules/koffi/src/koffi/src/abi_riscv64.cc +915 -0
- package/node_modules/koffi/src/koffi/src/abi_riscv64_asm.S +203 -0
- package/node_modules/koffi/src/koffi/src/abi_x64_sysv.cc +939 -0
- package/node_modules/koffi/src/koffi/src/abi_x64_sysv_asm.S +231 -0
- package/node_modules/koffi/src/koffi/src/abi_x64_win.cc +715 -0
- package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.S +166 -0
- package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.asm +192 -0
- package/node_modules/koffi/src/koffi/src/abi_x86.cc +860 -0
- package/node_modules/koffi/src/koffi/src/abi_x86_asm.S +193 -0
- package/node_modules/koffi/src/koffi/src/abi_x86_asm.asm +177 -0
- package/node_modules/koffi/src/koffi/src/call.cc +1326 -0
- package/node_modules/koffi/src/koffi/src/call.hh +179 -0
- package/node_modules/koffi/src/koffi/src/errno.inc +462 -0
- package/node_modules/koffi/src/koffi/src/ffi.cc +2702 -0
- package/node_modules/koffi/src/koffi/src/ffi.hh +354 -0
- package/node_modules/koffi/src/koffi/src/init.js +105 -0
- package/node_modules/koffi/src/koffi/src/parser.cc +220 -0
- package/node_modules/koffi/src/koffi/src/parser.hh +54 -0
- package/node_modules/koffi/src/koffi/src/util.cc +1807 -0
- package/node_modules/koffi/src/koffi/src/util.hh +221 -0
- package/node_modules/koffi/src/koffi/src/uv.cc +193 -0
- package/node_modules/koffi/src/koffi/src/uv.def +10 -0
- package/node_modules/koffi/src/koffi/src/uv.hh +40 -0
- package/node_modules/koffi/src/koffi/src/win32.cc +198 -0
- package/node_modules/koffi/src/koffi/src/win32.hh +119 -0
- package/node_modules/koffi/src/koffi/tools/write_trampolines.js +77 -0
- package/node_modules/koffi/vendor/node-addon-api/LICENSE.md +9 -0
- package/node_modules/koffi/vendor/node-addon-api/README.md +95 -0
- package/node_modules/koffi/vendor/node-addon-api/napi-inl.deprecated.h +186 -0
- package/node_modules/koffi/vendor/node-addon-api/napi-inl.h +7033 -0
- package/node_modules/koffi/vendor/node-addon-api/napi.h +3309 -0
- package/node_modules/koffi/vendor/node-api-headers/LICENSE +21 -0
- package/node_modules/koffi/vendor/node-api-headers/README.md +95 -0
- package/node_modules/koffi/vendor/node-api-headers/def/js_native_api.def +125 -0
- package/node_modules/koffi/vendor/node-api-headers/def/node_api.def +157 -0
- package/node_modules/koffi/vendor/node-api-headers/include/js_native_api.h +591 -0
- package/node_modules/koffi/vendor/node-api-headers/include/js_native_api_types.h +210 -0
- package/node_modules/koffi/vendor/node-api-headers/include/node_api.h +265 -0
- package/node_modules/koffi/vendor/node-api-headers/include/node_api_types.h +58 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/aix.h +32 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/bsd.h +34 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/darwin.h +61 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/errno.h +483 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/linux.h +34 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/os390.h +33 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/posix.h +31 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/sunos.h +44 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/threadpool.h +37 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/tree.h +521 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/unix.h +512 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/version.h +43 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv/win.h +698 -0
- package/node_modules/koffi/vendor/node-api-headers/include/uv.h +1990 -0
- package/node_modules/marked/LICENSE.md +44 -0
- package/node_modules/marked/README.md +106 -0
- package/node_modules/marked/bin/main.js +282 -0
- package/node_modules/marked/bin/marked.js +15 -0
- package/node_modules/marked/lib/marked.cjs +2211 -0
- package/node_modules/marked/lib/marked.cjs.map +7 -0
- package/node_modules/marked/lib/marked.d.cts +728 -0
- package/node_modules/marked/lib/marked.d.ts +728 -0
- package/node_modules/marked/lib/marked.esm.js +2189 -0
- package/node_modules/marked/lib/marked.esm.js.map +7 -0
- package/node_modules/marked/lib/marked.umd.js +2213 -0
- package/node_modules/marked/lib/marked.umd.js.map +7 -0
- package/node_modules/marked/man/marked.1 +111 -0
- package/node_modules/marked/man/marked.1.md +92 -0
- package/node_modules/marked/marked.min.js +69 -0
- package/node_modules/marked/package.json +111 -0
- package/node_modules/mime-db/HISTORY.md +541 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +109 -0
- package/node_modules/mime-db/db.json +9342 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +56 -0
- package/node_modules/mime-types/HISTORY.md +428 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +126 -0
- package/node_modules/mime-types/index.js +211 -0
- package/node_modules/mime-types/mimeScore.js +57 -0
- package/node_modules/mime-types/package.json +49 -0
- package/node_modules/pi-subagents/CHANGELOG.md +1179 -0
- package/node_modules/pi-subagents/README.md +1380 -0
- package/node_modules/pi-subagents/agents/context-builder.md +46 -0
- package/node_modules/pi-subagents/agents/delegate.md +12 -0
- package/node_modules/pi-subagents/agents/oracle.md +73 -0
- package/node_modules/pi-subagents/agents/planner.md +55 -0
- package/node_modules/pi-subagents/agents/researcher.md +52 -0
- package/node_modules/pi-subagents/agents/reviewer.md +79 -0
- package/node_modules/pi-subagents/agents/scout.md +50 -0
- package/node_modules/pi-subagents/agents/worker.md +55 -0
- package/node_modules/pi-subagents/install.mjs +92 -0
- package/node_modules/pi-subagents/package.json +80 -0
- package/node_modules/pi-subagents/prompts/gather-context-and-clarify.md +13 -0
- package/node_modules/pi-subagents/prompts/parallel-cleanup.md +59 -0
- package/node_modules/pi-subagents/prompts/parallel-context-build.md +55 -0
- package/node_modules/pi-subagents/prompts/parallel-handoff-plan.md +61 -0
- package/node_modules/pi-subagents/prompts/parallel-research.md +50 -0
- package/node_modules/pi-subagents/prompts/parallel-review.md +54 -0
- package/node_modules/pi-subagents/prompts/review-loop.md +41 -0
- package/node_modules/pi-subagents/skills/pi-subagents/SKILL.md +860 -0
- package/node_modules/pi-subagents/src/agents/agent-management.ts +880 -0
- package/node_modules/pi-subagents/src/agents/agent-scope.ts +6 -0
- package/node_modules/pi-subagents/src/agents/agent-selection.ts +25 -0
- package/node_modules/pi-subagents/src/agents/agent-serializer.ts +110 -0
- package/node_modules/pi-subagents/src/agents/agents.ts +1423 -0
- package/node_modules/pi-subagents/src/agents/chain-serializer.ts +252 -0
- package/node_modules/pi-subagents/src/agents/frontmatter.ts +93 -0
- package/node_modules/pi-subagents/src/agents/identity.ts +30 -0
- package/node_modules/pi-subagents/src/agents/proactive-skills.ts +191 -0
- package/node_modules/pi-subagents/src/agents/skills.ts +729 -0
- package/node_modules/pi-subagents/src/extension/companion-suggestions.ts +359 -0
- package/node_modules/pi-subagents/src/extension/config.ts +39 -0
- package/node_modules/pi-subagents/src/extension/control-notices.ts +92 -0
- package/node_modules/pi-subagents/src/extension/doctor.ts +222 -0
- package/node_modules/pi-subagents/src/extension/fanout-child.ts +172 -0
- package/node_modules/pi-subagents/src/extension/index.ts +681 -0
- package/node_modules/pi-subagents/src/extension/schemas.ts +265 -0
- package/node_modules/pi-subagents/src/intercom/intercom-bridge.ts +412 -0
- package/node_modules/pi-subagents/src/intercom/result-intercom.ts +377 -0
- package/node_modules/pi-subagents/src/profiles/profiles.ts +637 -0
- package/node_modules/pi-subagents/src/runs/background/async-execution.ts +1021 -0
- package/node_modules/pi-subagents/src/runs/background/async-job-tracker.ts +431 -0
- package/node_modules/pi-subagents/src/runs/background/async-resume.ts +391 -0
- package/node_modules/pi-subagents/src/runs/background/async-status.ts +370 -0
- package/node_modules/pi-subagents/src/runs/background/chain-append.ts +282 -0
- package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.ts +191 -0
- package/node_modules/pi-subagents/src/runs/background/completion-dedupe.ts +63 -0
- package/node_modules/pi-subagents/src/runs/background/control-channel.ts +227 -0
- package/node_modules/pi-subagents/src/runs/background/notify.ts +108 -0
- package/node_modules/pi-subagents/src/runs/background/parallel-groups.ts +45 -0
- package/node_modules/pi-subagents/src/runs/background/result-watcher.ts +316 -0
- package/node_modules/pi-subagents/src/runs/background/run-id-resolver.ts +83 -0
- package/node_modules/pi-subagents/src/runs/background/run-status.ts +274 -0
- package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.ts +368 -0
- package/node_modules/pi-subagents/src/runs/background/subagent-runner.ts +2797 -0
- package/node_modules/pi-subagents/src/runs/background/top-level-async.ts +13 -0
- package/node_modules/pi-subagents/src/runs/foreground/chain-clarify.ts +1333 -0
- package/node_modules/pi-subagents/src/runs/foreground/chain-execution.ts +1239 -0
- package/node_modules/pi-subagents/src/runs/foreground/execution.ts +1110 -0
- package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.ts +3299 -0
- package/node_modules/pi-subagents/src/runs/shared/acceptance.ts +879 -0
- package/node_modules/pi-subagents/src/runs/shared/chain-outputs.ts +116 -0
- package/node_modules/pi-subagents/src/runs/shared/completion-guard.ts +147 -0
- package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.ts +295 -0
- package/node_modules/pi-subagents/src/runs/shared/long-running-guard.ts +175 -0
- package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +365 -0
- package/node_modules/pi-subagents/src/runs/shared/model-fallback.ts +145 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-events.ts +877 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-path.ts +52 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-render.ts +115 -0
- package/node_modules/pi-subagents/src/runs/shared/parallel-utils.ts +197 -0
- package/node_modules/pi-subagents/src/runs/shared/pi-args.ts +242 -0
- package/node_modules/pi-subagents/src/runs/shared/pi-spawn.ts +147 -0
- package/node_modules/pi-subagents/src/runs/shared/run-history.ts +60 -0
- package/node_modules/pi-subagents/src/runs/shared/single-output.ts +180 -0
- package/node_modules/pi-subagents/src/runs/shared/structured-output.ts +77 -0
- package/node_modules/pi-subagents/src/runs/shared/subagent-control.ts +223 -0
- package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +222 -0
- package/node_modules/pi-subagents/src/runs/shared/workflow-graph.ts +206 -0
- package/node_modules/pi-subagents/src/runs/shared/worktree.ts +600 -0
- package/node_modules/pi-subagents/src/shared/artifacts.ts +112 -0
- package/node_modules/pi-subagents/src/shared/atomic-json.ts +73 -0
- package/node_modules/pi-subagents/src/shared/file-coalescer.ts +40 -0
- package/node_modules/pi-subagents/src/shared/fork-context.ts +187 -0
- package/node_modules/pi-subagents/src/shared/formatters.ts +133 -0
- package/node_modules/pi-subagents/src/shared/jsonl-writer.ts +81 -0
- package/node_modules/pi-subagents/src/shared/model-info.ts +78 -0
- package/node_modules/pi-subagents/src/shared/post-exit-stdio-guard.ts +85 -0
- package/node_modules/pi-subagents/src/shared/session-identity.ts +10 -0
- package/node_modules/pi-subagents/src/shared/session-tokens.ts +44 -0
- package/node_modules/pi-subagents/src/shared/settings.ts +448 -0
- package/node_modules/pi-subagents/src/shared/status-format.ts +49 -0
- package/node_modules/pi-subagents/src/shared/types.ts +1142 -0
- package/node_modules/pi-subagents/src/shared/utils.ts +554 -0
- package/node_modules/pi-subagents/src/slash/prompt-template-bridge.ts +420 -0
- package/node_modules/pi-subagents/src/slash/slash-bridge.ts +176 -0
- package/node_modules/pi-subagents/src/slash/slash-commands.ts +1282 -0
- package/node_modules/pi-subagents/src/slash/slash-live-state.ts +292 -0
- package/node_modules/pi-subagents/src/tui/render-helpers.ts +80 -0
- package/node_modules/pi-subagents/src/tui/render.ts +1740 -0
- package/node_modules/typebox/build/compile/code.d.mts +12 -0
- package/node_modules/typebox/build/compile/code.mjs +65 -0
- package/node_modules/typebox/build/compile/compile.d.mts +6 -0
- package/node_modules/typebox/build/compile/compile.mjs +12 -0
- package/node_modules/typebox/build/compile/index.d.mts +8 -0
- package/node_modules/typebox/build/compile/index.mjs +14 -0
- package/node_modules/typebox/build/compile/validator.d.mts +42 -0
- package/node_modules/typebox/build/compile/validator.mjs +116 -0
- package/node_modules/typebox/build/error/errors.d.mts +214 -0
- package/node_modules/typebox/build/error/errors.mjs +18 -0
- package/node_modules/typebox/build/error/index.d.mts +1 -0
- package/node_modules/typebox/build/error/index.mjs +1 -0
- package/node_modules/typebox/build/format/_idna.d.mts +2 -0
- package/node_modules/typebox/build/format/_idna.mjs +216 -0
- package/node_modules/typebox/build/format/_puny.d.mts +1 -0
- package/node_modules/typebox/build/format/_puny.mjs +74 -0
- package/node_modules/typebox/build/format/_registry.d.mts +15 -0
- package/node_modules/typebox/build/format/_registry.mjs +96 -0
- package/node_modules/typebox/build/format/date-time.d.mts +6 -0
- package/node_modules/typebox/build/format/date-time.mjs +11 -0
- package/node_modules/typebox/build/format/date.d.mts +6 -0
- package/node_modules/typebox/build/format/date.mjs +19 -0
- package/node_modules/typebox/build/format/duration.d.mts +5 -0
- package/node_modules/typebox/build/format/duration.mjs +8 -0
- package/node_modules/typebox/build/format/email.d.mts +5 -0
- package/node_modules/typebox/build/format/email.mjs +8 -0
- package/node_modules/typebox/build/format/format.d.mts +22 -0
- package/node_modules/typebox/build/format/format.mjs +22 -0
- package/node_modules/typebox/build/format/hostname.d.mts +7 -0
- package/node_modules/typebox/build/format/hostname.mjs +18 -0
- package/node_modules/typebox/build/format/idn-email.d.mts +5 -0
- package/node_modules/typebox/build/format/idn-email.mjs +8 -0
- package/node_modules/typebox/build/format/idn-hostname.d.mts +7 -0
- package/node_modules/typebox/build/format/idn-hostname.mjs +19 -0
- package/node_modules/typebox/build/format/index.d.mts +4 -0
- package/node_modules/typebox/build/format/index.mjs +4 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +6 -0
- package/node_modules/typebox/build/format/ipv4.mjs +38 -0
- package/node_modules/typebox/build/format/ipv6.d.mts +5 -0
- package/node_modules/typebox/build/format/ipv6.mjs +67 -0
- package/node_modules/typebox/build/format/iri-reference.d.mts +5 -0
- package/node_modules/typebox/build/format/iri-reference.mjs +60 -0
- package/node_modules/typebox/build/format/iri.d.mts +5 -0
- package/node_modules/typebox/build/format/iri.mjs +13 -0
- package/node_modules/typebox/build/format/json-pointer-uri-fragment.d.mts +6 -0
- package/node_modules/typebox/build/format/json-pointer-uri-fragment.mjs +9 -0
- package/node_modules/typebox/build/format/json-pointer.d.mts +6 -0
- package/node_modules/typebox/build/format/json-pointer.mjs +9 -0
- package/node_modules/typebox/build/format/regex.d.mts +6 -0
- package/node_modules/typebox/build/format/regex.mjs +17 -0
- package/node_modules/typebox/build/format/relative-json-pointer.d.mts +6 -0
- package/node_modules/typebox/build/format/relative-json-pointer.mjs +9 -0
- package/node_modules/typebox/build/format/time.d.mts +5 -0
- package/node_modules/typebox/build/format/time.mjs +27 -0
- package/node_modules/typebox/build/format/uri-reference.d.mts +5 -0
- package/node_modules/typebox/build/format/uri-reference.mjs +9 -0
- package/node_modules/typebox/build/format/uri-template.d.mts +6 -0
- package/node_modules/typebox/build/format/uri-template.mjs +10 -0
- package/node_modules/typebox/build/format/uri.d.mts +5 -0
- package/node_modules/typebox/build/format/uri.mjs +135 -0
- package/node_modules/typebox/build/format/url.d.mts +6 -0
- package/node_modules/typebox/build/format/url.mjs +9 -0
- package/node_modules/typebox/build/format/uuid.d.mts +6 -0
- package/node_modules/typebox/build/format/uuid.mjs +9 -0
- package/node_modules/typebox/build/guard/emit.d.mts +58 -0
- package/node_modules/typebox/build/guard/emit.mjs +194 -0
- package/node_modules/typebox/build/guard/globals.d.mts +35 -0
- package/node_modules/typebox/build/guard/globals.mjs +90 -0
- package/node_modules/typebox/build/guard/guard.d.mts +63 -0
- package/node_modules/typebox/build/guard/guard.mjs +208 -0
- package/node_modules/typebox/build/guard/index.d.mts +6 -0
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/native.d.mts +20 -0
- package/node_modules/typebox/build/guard/native.mjs +60 -0
- package/node_modules/typebox/build/guard/string.d.mts +6 -0
- package/node_modules/typebox/build/guard/string.mjs +164 -0
- package/node_modules/typebox/build/index.d.mts +8 -0
- package/node_modules/typebox/build/index.mjs +14 -0
- package/node_modules/typebox/build/schema/build.d.mts +35 -0
- package/node_modules/typebox/build/schema/build.mjs +99 -0
- package/node_modules/typebox/build/schema/check.d.mts +6 -0
- package/node_modules/typebox/build/schema/check.mjs +14 -0
- package/node_modules/typebox/build/schema/compile.d.mts +22 -0
- package/node_modules/typebox/build/schema/compile.mjs +46 -0
- package/node_modules/typebox/build/schema/engine/_context.d.mts +35 -0
- package/node_modules/typebox/build/schema/engine/_context.mjs +129 -0
- package/node_modules/typebox/build/schema/engine/_exact_optional.d.mts +3 -0
- package/node_modules/typebox/build/schema/engine/_exact_optional.mjs +20 -0
- package/node_modules/typebox/build/schema/engine/_externals.d.mts +7 -0
- package/node_modules/typebox/build/schema/engine/_externals.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/_functions.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/_guard.mjs +26 -0
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +4 -0
- package/node_modules/typebox/build/schema/engine/_reducer.mjs +45 -0
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +29 -0
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +18 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +107 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_unique.mjs +5 -0
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +50 -0
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +110 -0
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/allOf.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +52 -0
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +5 -0
- package/node_modules/typebox/build/schema/engine/boolean.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/const.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/const.mjs +30 -0
- package/node_modules/typebox/build/schema/engine/contains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/contains.mjs +42 -0
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +45 -0
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +40 -0
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +38 -0
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/enum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/enum.mjs +33 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/format.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/format.mjs +26 -0
- package/node_modules/typebox/build/schema/engine/if.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/if.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/index.d.mts +49 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +55 -0
- package/node_modules/typebox/build/schema/engine/items.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +68 -0
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +42 -0
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maximum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minContains.mjs +41 -0
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minItems.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minLength.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minimum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/not.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/not.mjs +37 -0
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +58 -0
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/pattern.mjs +28 -0
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +44 -0
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +35 -0
- package/node_modules/typebox/build/schema/engine/properties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/properties.mjs +75 -0
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +39 -0
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/ref.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/ref.mjs +58 -0
- package/node_modules/typebox/build/schema/engine/required.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/required.mjs +32 -0
- package/node_modules/typebox/build/schema/engine/schema.d.mts +9 -0
- package/node_modules/typebox/build/schema/engine/schema.mjs +352 -0
- package/node_modules/typebox/build/schema/engine/type.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/type.mjs +74 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +51 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +51 -0
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +51 -0
- package/node_modules/typebox/build/schema/errors.d.mts +6 -0
- package/node_modules/typebox/build/schema/errors.mjs +24 -0
- package/node_modules/typebox/build/schema/index.d.mts +3 -0
- package/node_modules/typebox/build/schema/index.mjs +9 -0
- package/node_modules/typebox/build/schema/parse.d.mts +13 -0
- package/node_modules/typebox/build/schema/parse.mjs +27 -0
- package/node_modules/typebox/build/schema/pointer/index.d.mts +2 -0
- package/node_modules/typebox/build/schema/pointer/index.mjs +2 -0
- package/node_modules/typebox/build/schema/pointer/pointer-get.d.mts +9 -0
- package/node_modules/typebox/build/schema/pointer/pointer-get.mjs +2 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +10 -0
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +96 -0
- package/node_modules/typebox/build/schema/resolve/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/resolve/index.mjs +1 -0
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +3 -0
- package/node_modules/typebox/build/schema/resolve/ref.mjs +146 -0
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +1 -0
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +1 -0
- package/node_modules/typebox/build/schema/schema.d.mts +10 -0
- package/node_modules/typebox/build/schema/schema.mjs +10 -0
- package/node_modules/typebox/build/schema/static/additionalProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/additionalProperties.mjs +3 -0
- package/node_modules/typebox/build/schema/static/allOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/allOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/anyOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/anyOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/const.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/const.mjs +2 -0
- package/node_modules/typebox/build/schema/static/enum.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/enum.mjs +2 -0
- package/node_modules/typebox/build/schema/static/if.d.mts +15 -0
- package/node_modules/typebox/build/schema/static/if.mjs +2 -0
- package/node_modules/typebox/build/schema/static/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/index.mjs +1 -0
- package/node_modules/typebox/build/schema/static/items.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/items.mjs +2 -0
- package/node_modules/typebox/build/schema/static/oneOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/oneOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/patternProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/patternProperties.mjs +2 -0
- package/node_modules/typebox/build/schema/static/prefixItems.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/prefixItems.mjs +2 -0
- package/node_modules/typebox/build/schema/static/properties.d.mts +11 -0
- package/node_modules/typebox/build/schema/static/properties.mjs +2 -0
- package/node_modules/typebox/build/schema/static/ref.d.mts +8 -0
- package/node_modules/typebox/build/schema/static/ref.mjs +3 -0
- package/node_modules/typebox/build/schema/static/required.d.mts +13 -0
- package/node_modules/typebox/build/schema/static/required.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +55 -0
- package/node_modules/typebox/build/schema/static/schema.mjs +2 -0
- package/node_modules/typebox/build/schema/static/static.d.mts +4 -0
- package/node_modules/typebox/build/schema/static/static.mjs +3 -0
- package/node_modules/typebox/build/schema/static/type.d.mts +4 -0
- package/node_modules/typebox/build/schema/static/type.mjs +3 -0
- package/node_modules/typebox/build/schema/static/unevaluatedProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/unevaluatedProperties.mjs +3 -0
- package/node_modules/typebox/build/schema/static/~comparer.d.mts +6 -0
- package/node_modules/typebox/build/schema/static/~comparer.mjs +2 -0
- package/node_modules/typebox/build/schema/static/~elements.d.mts +18 -0
- package/node_modules/typebox/build/schema/static/~elements.mjs +2 -0
- package/node_modules/typebox/build/schema/static/~non-readonly.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/~non-readonly.mjs +2 -0
- package/node_modules/typebox/build/schema/static/~readonly.d.mts +6 -0
- package/node_modules/typebox/build/schema/static/~readonly.mjs +2 -0
- package/node_modules/typebox/build/schema/types/_guard.d.mts +10 -0
- package/node_modules/typebox/build/schema/types/_guard.mjs +16 -0
- package/node_modules/typebox/build/schema/types/_refine.d.mts +13 -0
- package/node_modules/typebox/build/schema/types/_refine.mjs +18 -0
- package/node_modules/typebox/build/schema/types/additionalItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/additionalItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/additionalProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/additionalProperties.mjs +14 -0
- package/node_modules/typebox/build/schema/types/allOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/allOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/anchor.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/anchor.mjs +12 -0
- package/node_modules/typebox/build/schema/types/anyOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/anyOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/const.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/const.mjs +12 -0
- package/node_modules/typebox/build/schema/types/contains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/contains.mjs +14 -0
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +13 -0
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +13 -0
- package/node_modules/typebox/build/schema/types/default.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/default.mjs +12 -0
- package/node_modules/typebox/build/schema/types/defs.d.mts +6 -0
- package/node_modules/typebox/build/schema/types/defs.mjs +12 -0
- package/node_modules/typebox/build/schema/types/dependencies.d.mts +11 -0
- package/node_modules/typebox/build/schema/types/dependencies.mjs +16 -0
- package/node_modules/typebox/build/schema/types/dependentRequired.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/dependentRequired.mjs +15 -0
- package/node_modules/typebox/build/schema/types/dependentSchemas.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/dependentSchemas.mjs +15 -0
- package/node_modules/typebox/build/schema/types/dynamicAnchor.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/dynamicAnchor.mjs +12 -0
- package/node_modules/typebox/build/schema/types/dynamicRef.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/dynamicRef.mjs +12 -0
- package/node_modules/typebox/build/schema/types/else.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/else.mjs +14 -0
- package/node_modules/typebox/build/schema/types/enum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/enum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/exclusiveMaximum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/exclusiveMaximum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/exclusiveMinimum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/exclusiveMinimum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/format.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/format.mjs +13 -0
- package/node_modules/typebox/build/schema/types/id.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/id.mjs +13 -0
- package/node_modules/typebox/build/schema/types/if.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/if.mjs +14 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +54 -0
- package/node_modules/typebox/build/schema/types/index.mjs +60 -0
- package/node_modules/typebox/build/schema/types/items.d.mts +19 -0
- package/node_modules/typebox/build/schema/types/items.mjs +26 -0
- package/node_modules/typebox/build/schema/types/maxContains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxContains.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxItems.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxLength.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxLength.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxProperties.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maximum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maximum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minContains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minContains.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minItems.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minLength.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minLength.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minProperties.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minimum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minimum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/multipleOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/multipleOf.mjs +13 -0
- package/node_modules/typebox/build/schema/types/not.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/not.mjs +14 -0
- package/node_modules/typebox/build/schema/types/oneOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/oneOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/pattern.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/pattern.mjs +14 -0
- package/node_modules/typebox/build/schema/types/patternProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/patternProperties.mjs +15 -0
- package/node_modules/typebox/build/schema/types/prefixItems.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/prefixItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/properties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/properties.mjs +15 -0
- package/node_modules/typebox/build/schema/types/propertyNames.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/propertyNames.mjs +15 -0
- package/node_modules/typebox/build/schema/types/recursiveAnchor.d.mts +12 -0
- package/node_modules/typebox/build/schema/types/recursiveAnchor.mjs +19 -0
- package/node_modules/typebox/build/schema/types/recursiveRef.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/recursiveRef.mjs +12 -0
- package/node_modules/typebox/build/schema/types/ref.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/ref.mjs +13 -0
- package/node_modules/typebox/build/schema/types/required.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/required.mjs +14 -0
- package/node_modules/typebox/build/schema/types/schema.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/schema.mjs +14 -0
- package/node_modules/typebox/build/schema/types/then.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/then.mjs +14 -0
- package/node_modules/typebox/build/schema/types/type.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/type.mjs +15 -0
- package/node_modules/typebox/build/schema/types/unevaluatedItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/unevaluatedItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/unevaluatedProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/unevaluatedProperties.mjs +14 -0
- package/node_modules/typebox/build/schema/types/uniqueItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/uniqueItems.mjs +13 -0
- package/node_modules/typebox/build/system/arguments/arguments.d.mts +5 -0
- package/node_modules/typebox/build/system/arguments/arguments.mjs +9 -0
- package/node_modules/typebox/build/system/arguments/index.d.mts +1 -0
- package/node_modules/typebox/build/system/arguments/index.mjs +1 -0
- package/node_modules/typebox/build/system/environment/environment.d.mts +1 -0
- package/node_modules/typebox/build/system/environment/environment.mjs +1 -0
- package/node_modules/typebox/build/system/environment/evaluate.d.mts +9 -0
- package/node_modules/typebox/build/system/environment/evaluate.mjs +37 -0
- package/node_modules/typebox/build/system/environment/index.d.mts +1 -0
- package/node_modules/typebox/build/system/environment/index.mjs +1 -0
- package/node_modules/typebox/build/system/hashing/hash.d.mts +4 -0
- package/node_modules/typebox/build/system/hashing/hash.mjs +232 -0
- package/node_modules/typebox/build/system/hashing/index.d.mts +1 -0
- package/node_modules/typebox/build/system/hashing/index.mjs +1 -0
- package/node_modules/typebox/build/system/index.d.mts +4 -0
- package/node_modules/typebox/build/system/index.mjs +4 -0
- package/node_modules/typebox/build/system/locale/_config.d.mts +7 -0
- package/node_modules/typebox/build/system/locale/_config.mjs +15 -0
- package/node_modules/typebox/build/system/locale/_locale.d.mts +40 -0
- package/node_modules/typebox/build/system/locale/_locale.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ar_001.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ar_001.mjs +41 -0
- package/node_modules/typebox/build/system/locale/bn_BD.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +41 -0
- package/node_modules/typebox/build/system/locale/cs_CZ.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +41 -0
- package/node_modules/typebox/build/system/locale/de_DE.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/de_DE.mjs +41 -0
- package/node_modules/typebox/build/system/locale/el_GR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/el_GR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/en_US.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/en_US.mjs +40 -0
- package/node_modules/typebox/build/system/locale/es_419.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_419.mjs +41 -0
- package/node_modules/typebox/build/system/locale/es_AR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_AR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/es_ES.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_ES.mjs +41 -0
- package/node_modules/typebox/build/system/locale/es_MX.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_MX.mjs +41 -0
- package/node_modules/typebox/build/system/locale/fa_IR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/fil_PH.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +41 -0
- package/node_modules/typebox/build/system/locale/fr_CA.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +41 -0
- package/node_modules/typebox/build/system/locale/fr_FR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ha_NG.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +41 -0
- package/node_modules/typebox/build/system/locale/hi_IN.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +41 -0
- package/node_modules/typebox/build/system/locale/hu_HU.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +41 -0
- package/node_modules/typebox/build/system/locale/id_ID.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/id_ID.mjs +41 -0
- package/node_modules/typebox/build/system/locale/index.d.mts +1 -0
- package/node_modules/typebox/build/system/locale/index.mjs +1 -0
- package/node_modules/typebox/build/system/locale/it_IT.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/it_IT.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ja_JP.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ko_KR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ms_MY.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +41 -0
- package/node_modules/typebox/build/system/locale/nl_NL.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +41 -0
- package/node_modules/typebox/build/system/locale/pl_PL.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +41 -0
- package/node_modules/typebox/build/system/locale/pt_BR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/pt_PT.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ro_RO.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ru_RU.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +41 -0
- package/node_modules/typebox/build/system/locale/sv_SE.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +41 -0
- package/node_modules/typebox/build/system/locale/sw_TZ.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +41 -0
- package/node_modules/typebox/build/system/locale/th_TH.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/th_TH.mjs +41 -0
- package/node_modules/typebox/build/system/locale/tr_TR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/uk_UA.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ur_PK.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +41 -0
- package/node_modules/typebox/build/system/locale/vi_VN.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +41 -0
- package/node_modules/typebox/build/system/locale/yo_NG.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +41 -0
- package/node_modules/typebox/build/system/locale/zh_Hans.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +41 -0
- package/node_modules/typebox/build/system/locale/zh_Hant.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +41 -0
- package/node_modules/typebox/build/system/memory/assign.d.mts +14 -0
- package/node_modules/typebox/build/system/memory/assign.mjs +11 -0
- package/node_modules/typebox/build/system/memory/clone.d.mts +6 -0
- package/node_modules/typebox/build/system/memory/clone.mjs +63 -0
- package/node_modules/typebox/build/system/memory/create.d.mts +8 -0
- package/node_modules/typebox/build/system/memory/create.mjs +30 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/discard.mjs +17 -0
- package/node_modules/typebox/build/system/memory/index.d.mts +1 -0
- package/node_modules/typebox/build/system/memory/index.mjs +1 -0
- package/node_modules/typebox/build/system/memory/memory.d.mts +6 -0
- package/node_modules/typebox/build/system/memory/memory.mjs +7 -0
- package/node_modules/typebox/build/system/memory/metrics.d.mts +14 -0
- package/node_modules/typebox/build/system/memory/metrics.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +7 -0
- package/node_modules/typebox/build/system/memory/update.mjs +32 -0
- package/node_modules/typebox/build/system/settings/index.d.mts +1 -0
- package/node_modules/typebox/build/system/settings/index.mjs +1 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +56 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +32 -0
- package/node_modules/typebox/build/system/system.d.mts +6 -0
- package/node_modules/typebox/build/system/system.mjs +6 -0
- package/node_modules/typebox/build/system/unreachable/index.d.mts +1 -0
- package/node_modules/typebox/build/system/unreachable/index.mjs +1 -0
- package/node_modules/typebox/build/system/unreachable/unreachable.d.mts +3 -0
- package/node_modules/typebox/build/system/unreachable/unreachable.mjs +6 -0
- package/node_modules/typebox/build/type/action/_optional.d.mts +19 -0
- package/node_modules/typebox/build/type/action/_optional.mjs +40 -0
- package/node_modules/typebox/build/type/action/_readonly.d.mts +19 -0
- package/node_modules/typebox/build/type/action/_readonly.mjs +40 -0
- package/node_modules/typebox/build/type/action/awaited.d.mts +11 -0
- package/node_modules/typebox/build/type/action/awaited.mjs +12 -0
- package/node_modules/typebox/build/type/action/capitalize.d.mts +11 -0
- package/node_modules/typebox/build/type/action/capitalize.mjs +12 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/conditional.mjs +12 -0
- package/node_modules/typebox/build/type/action/constructor-parameters.d.mts +11 -0
- package/node_modules/typebox/build/type/action/constructor-parameters.mjs +12 -0
- package/node_modules/typebox/build/type/action/evaluate.d.mts +11 -0
- package/node_modules/typebox/build/type/action/evaluate.mjs +12 -0
- package/node_modules/typebox/build/type/action/exclude.d.mts +11 -0
- package/node_modules/typebox/build/type/action/exclude.mjs +12 -0
- package/node_modules/typebox/build/type/action/extract.d.mts +11 -0
- package/node_modules/typebox/build/type/action/extract.mjs +12 -0
- package/node_modules/typebox/build/type/action/index.d.mts +27 -0
- package/node_modules/typebox/build/type/action/index.mjs +27 -0
- package/node_modules/typebox/build/type/action/indexed.d.mts +14 -0
- package/node_modules/typebox/build/type/action/indexed.mjs +15 -0
- package/node_modules/typebox/build/type/action/instance-type.d.mts +11 -0
- package/node_modules/typebox/build/type/action/instance-type.mjs +12 -0
- package/node_modules/typebox/build/type/action/interface.d.mts +14 -0
- package/node_modules/typebox/build/type/action/interface.mjs +20 -0
- package/node_modules/typebox/build/type/action/keyof.d.mts +11 -0
- package/node_modules/typebox/build/type/action/keyof.mjs +12 -0
- package/node_modules/typebox/build/type/action/lowercase.d.mts +11 -0
- package/node_modules/typebox/build/type/action/lowercase.mjs +12 -0
- package/node_modules/typebox/build/type/action/mapped.d.mts +12 -0
- package/node_modules/typebox/build/type/action/mapped.mjs +12 -0
- package/node_modules/typebox/build/type/action/module.d.mts +12 -0
- package/node_modules/typebox/build/type/action/module.mjs +12 -0
- package/node_modules/typebox/build/type/action/non-nullable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/non-nullable.mjs +12 -0
- package/node_modules/typebox/build/type/action/omit.d.mts +14 -0
- package/node_modules/typebox/build/type/action/omit.mjs +15 -0
- package/node_modules/typebox/build/type/action/options.d.mts +12 -0
- package/node_modules/typebox/build/type/action/options.mjs +12 -0
- package/node_modules/typebox/build/type/action/parameters.d.mts +11 -0
- package/node_modules/typebox/build/type/action/parameters.mjs +12 -0
- package/node_modules/typebox/build/type/action/partial.d.mts +11 -0
- package/node_modules/typebox/build/type/action/partial.mjs +12 -0
- package/node_modules/typebox/build/type/action/pick.d.mts +14 -0
- package/node_modules/typebox/build/type/action/pick.mjs +15 -0
- package/node_modules/typebox/build/type/action/readonly-type.d.mts +11 -0
- package/node_modules/typebox/build/type/action/readonly-type.mjs +12 -0
- package/node_modules/typebox/build/type/action/required.d.mts +11 -0
- package/node_modules/typebox/build/type/action/required.mjs +12 -0
- package/node_modules/typebox/build/type/action/return-type.d.mts +11 -0
- package/node_modules/typebox/build/type/action/return-type.mjs +12 -0
- package/node_modules/typebox/build/type/action/uncapitalize.d.mts +11 -0
- package/node_modules/typebox/build/type/action/uncapitalize.mjs +12 -0
- package/node_modules/typebox/build/type/action/uppercase.d.mts +11 -0
- package/node_modules/typebox/build/type/action/uppercase.mjs +12 -0
- package/node_modules/typebox/build/type/engine/awaited/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/awaited/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +19 -0
- package/node_modules/typebox/build/type/engine/call/distribute-arguments.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/call/distribute-arguments.mjs +59 -0
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +23 -0
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +48 -0
- package/node_modules/typebox/build/type/engine/call/resolve-arguments.d.mts +13 -0
- package/node_modules/typebox/build/type/engine/call/resolve-arguments.mjs +39 -0
- package/node_modules/typebox/build/type/engine/call/resolve-target.d.mts +25 -0
- package/node_modules/typebox/build/type/engine/call/resolve-target.mjs +27 -0
- package/node_modules/typebox/build/type/engine/conditional/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/conditional/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/conditional/instantiate.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/conditional/instantiate.mjs +19 -0
- package/node_modules/typebox/build/type/engine/constructor-parameters/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/constructor-parameters/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/constructor-parameters/instantiate.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/constructor-parameters/instantiate.mjs +22 -0
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +19 -0
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +24 -0
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +54 -0
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +25 -0
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +53 -0
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +31 -0
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +53 -0
- package/node_modules/typebox/build/type/engine/cyclic/index.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/cyclic/index.mjs +6 -0
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +30 -0
- package/node_modules/typebox/build/type/engine/cyclic/target.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/cyclic/target.mjs +16 -0
- package/node_modules/typebox/build/type/engine/enum/enum-to-union.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/enum/enum-to-union.mjs +24 -0
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +2 -0
- package/node_modules/typebox/build/type/engine/enum/index.mjs +2 -0
- package/node_modules/typebox/build/type/engine/enum/typescript-enum-to-enum-values.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/enum/typescript-enum-to-enum-values.mjs +9 -0
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +47 -0
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +22 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +63 -0
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +27 -0
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +55 -0
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +27 -0
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +11 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +8 -0
- package/node_modules/typebox/build/type/engine/evaluate/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs +17 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +11 -0
- package/node_modules/typebox/build/type/engine/exclude/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/exclude/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/exclude/instantiate.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/exclude/instantiate.mjs +37 -0
- package/node_modules/typebox/build/type/engine/extract/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/extract/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/extract/instantiate.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/extract/instantiate.mjs +37 -0
- package/node_modules/typebox/build/type/engine/helpers/index.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/helpers/index.mjs +3 -0
- package/node_modules/typebox/build/type/engine/helpers/keys-to-indexer.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/helpers/keys-to-indexer.mjs +15 -0
- package/node_modules/typebox/build/type/engine/helpers/keys.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/helpers/keys.mjs +8 -0
- package/node_modules/typebox/build/type/engine/helpers/union.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/helpers/union.mjs +3 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +31 -0
- package/node_modules/typebox/build/type/engine/index.mjs +37 -0
- package/node_modules/typebox/build/type/engine/indexable/from-cyclic.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/indexable/from-cyclic.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from-enum.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/indexable/from-enum.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from-intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from-intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from-literal.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/indexable/from-literal.mjs +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from-template-literal.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from-template-literal.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from-type.d.mts +17 -0
- package/node_modules/typebox/build/type/engine/indexable/from-type.mjs +22 -0
- package/node_modules/typebox/build/type/engine/indexable/from-union.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/indexable/from-union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/indexable/to-indexable-keys.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/indexable/to-indexable-keys.mjs +12 -0
- package/node_modules/typebox/build/type/engine/indexable/to-indexable.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/indexable/to-indexable.mjs +14 -0
- package/node_modules/typebox/build/type/engine/indexed/array-indexer.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/indexed/array-indexer.mjs +18 -0
- package/node_modules/typebox/build/type/engine/indexed/from-array.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/indexed/from-array.mjs +35 -0
- package/node_modules/typebox/build/type/engine/indexed/from-object.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/indexed/from-object.mjs +18 -0
- package/node_modules/typebox/build/type/engine/indexed/from-tuple.d.mts +13 -0
- package/node_modules/typebox/build/type/engine/indexed/from-tuple.mjs +35 -0
- package/node_modules/typebox/build/type/engine/indexed/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/indexed/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +21 -0
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +37 -0
- package/node_modules/typebox/build/type/engine/instance-type/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/instance-type/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/instance-type/instantiate.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/instance-type/instantiate.mjs +20 -0
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +167 -0
- package/node_modules/typebox/build/type/engine/instantiate.mjs +172 -0
- package/node_modules/typebox/build/type/engine/interface/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/interface/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/interface/instantiate.mjs +19 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from-literal.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from-literal.mjs +9 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from-template-literal.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from-template-literal.mjs +8 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from-type.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from-type.mjs +13 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from-union.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from-union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/intrinsics/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/intrinsics/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/intrinsics/instantiate.d.mts +34 -0
- package/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs +48 -0
- package/node_modules/typebox/build/type/engine/intrinsics/mapping.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from-any.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/keyof/from-any.mjs +8 -0
- package/node_modules/typebox/build/type/engine/keyof/from-array.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from-array.mjs +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from-object.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/keyof/from-object.mjs +20 -0
- package/node_modules/typebox/build/type/engine/keyof/from-record.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from-record.mjs +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from-tuple.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from-tuple.mjs +7 -0
- package/node_modules/typebox/build/type/engine/keyof/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/keyof/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +27 -0
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +45 -0
- package/node_modules/typebox/build/type/engine/mapped/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/mapped/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/mapped/instantiate.d.mts +25 -0
- package/node_modules/typebox/build/type/engine/mapped/instantiate.mjs +50 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped-variants.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped-variants.mjs +29 -0
- package/node_modules/typebox/build/type/engine/module/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/module/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +21 -0
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +34 -0
- package/node_modules/typebox/build/type/engine/non-nullable/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/non-nullable/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/non-nullable/instantiate.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/non-nullable/instantiate.mjs +22 -0
- package/node_modules/typebox/build/type/engine/object/collapse.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/object/collapse.mjs +14 -0
- package/node_modules/typebox/build/type/engine/object/from-cyclic.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/object/from-cyclic.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from-intersect.d.mts +17 -0
- package/node_modules/typebox/build/type/engine/object/from-intersect.mjs +22 -0
- package/node_modules/typebox/build/type/engine/object/from-object.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/object/from-object.mjs +4 -0
- package/node_modules/typebox/build/type/engine/object/from-tuple.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/object/from-tuple.mjs +9 -0
- package/node_modules/typebox/build/type/engine/object/from-type.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/object/from-type.mjs +20 -0
- package/node_modules/typebox/build/type/engine/object/from-union.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/object/from-union.mjs +26 -0
- package/node_modules/typebox/build/type/engine/object/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/object/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/omit/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/omit/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/omit/instantiate.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/omit/instantiate.mjs +31 -0
- package/node_modules/typebox/build/type/engine/options/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/options/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/options/instantiate.mjs +13 -0
- package/node_modules/typebox/build/type/engine/parameters/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/parameters/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +22 -0
- package/node_modules/typebox/build/type/engine/partial/from-cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/partial/from-cyclic.mjs +11 -0
- package/node_modules/typebox/build/type/engine/partial/from-intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from-intersect.mjs +7 -0
- package/node_modules/typebox/build/type/engine/partial/from-object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/partial/from-object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/partial/from-type.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/partial/from-type.mjs +17 -0
- package/node_modules/typebox/build/type/engine/partial/from-union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from-union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/partial/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/partial/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/partial/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/partial/instantiate.mjs +14 -0
- package/node_modules/typebox/build/type/engine/patterns/index.d.mts +2 -0
- package/node_modules/typebox/build/type/engine/patterns/index.mjs +2 -0
- package/node_modules/typebox/build/type/engine/patterns/pattern.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/patterns/pattern.mjs +11 -0
- package/node_modules/typebox/build/type/engine/patterns/template.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/patterns/template.mjs +20 -0
- package/node_modules/typebox/build/type/engine/pick/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/pick/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/pick/instantiate.d.mts +17 -0
- package/node_modules/typebox/build/type/engine/pick/instantiate.mjs +32 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-array.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-array.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-cyclic.mjs +11 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-intersect.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-tuple.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-tuple.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-type.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-type.mjs +22 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly-type/from-union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly-type/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/readonly-type/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/readonly-type/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/readonly-type/instantiate.mjs +14 -0
- package/node_modules/typebox/build/type/engine/record/from-key-any.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/record/from-key-any.mjs +6 -0
- package/node_modules/typebox/build/type/engine/record/from-key-boolean.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/record/from-key-boolean.mjs +5 -0
- package/node_modules/typebox/build/type/engine/record/from-key-enum.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/record/from-key-enum.mjs +8 -0
- package/node_modules/typebox/build/type/engine/record/from-key-integer.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from-key-integer.mjs +7 -0
- package/node_modules/typebox/build/type/engine/record/from-key-intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from-key-intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/record/from-key-literal.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/record/from-key-literal.mjs +10 -0
- package/node_modules/typebox/build/type/engine/record/from-key-number.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from-key-number.mjs +7 -0
- package/node_modules/typebox/build/type/engine/record/from-key-string.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from-key-string.mjs +12 -0
- package/node_modules/typebox/build/type/engine/record/from-key-template-literal.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/record/from-key-template-literal.mjs +12 -0
- package/node_modules/typebox/build/type/engine/record/from-key-union.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/record/from-key-union.mjs +39 -0
- package/node_modules/typebox/build/type/engine/record/from-key.d.mts +24 -0
- package/node_modules/typebox/build/type/engine/record/from-key.mjs +40 -0
- package/node_modules/typebox/build/type/engine/record/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/record/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/record/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/record/instantiate.mjs +16 -0
- package/node_modules/typebox/build/type/engine/record/record-create.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/record/record-create.mjs +7 -0
- package/node_modules/typebox/build/type/engine/ref/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/ref/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +10 -0
- package/node_modules/typebox/build/type/engine/required/from-cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/required/from-cyclic.mjs +11 -0
- package/node_modules/typebox/build/type/engine/required/from-intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from-intersect.mjs +7 -0
- package/node_modules/typebox/build/type/engine/required/from-object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/required/from-object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/required/from-type.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/required/from-type.mjs +17 -0
- package/node_modules/typebox/build/type/engine/required/from-union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from-union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/required/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/required/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/required/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/required/instantiate.mjs +14 -0
- package/node_modules/typebox/build/type/engine/rest/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/rest/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/rest/spread.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/rest/spread.mjs +19 -0
- package/node_modules/typebox/build/type/engine/return-type/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/return-type/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/return-type/instantiate.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/return-type/instantiate.mjs +18 -0
- package/node_modules/typebox/build/type/engine/template-literal/create.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/template-literal/create.mjs +5 -0
- package/node_modules/typebox/build/type/engine/template-literal/decode.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/template-literal/decode.mjs +87 -0
- package/node_modules/typebox/build/type/engine/template-literal/encode.d.mts +31 -0
- package/node_modules/typebox/build/type/engine/template-literal/encode.mjs +80 -0
- package/node_modules/typebox/build/type/engine/template-literal/index.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/template-literal/index.mjs +6 -0
- package/node_modules/typebox/build/type/engine/template-literal/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/template-literal/instantiate.mjs +14 -0
- package/node_modules/typebox/build/type/engine/template-literal/is-finite.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/template-literal/is-finite.mjs +30 -0
- package/node_modules/typebox/build/type/engine/template-literal/is-pattern.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/template-literal/is-pattern.mjs +9 -0
- package/node_modules/typebox/build/type/engine/template-literal/static.d.mts +18 -0
- package/node_modules/typebox/build/type/engine/template-literal/static.mjs +2 -0
- package/node_modules/typebox/build/type/engine/tuple/to-object.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/tuple/to-object.mjs +14 -0
- package/node_modules/typebox/build/type/extends/any.d.mts +9 -0
- package/node_modules/typebox/build/type/extends/any.mjs +12 -0
- package/node_modules/typebox/build/type/extends/array.d.mts +20 -0
- package/node_modules/typebox/build/type/extends/array.mjs +21 -0
- package/node_modules/typebox/build/type/extends/async-iterator.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/async-iterator.mjs +9 -0
- package/node_modules/typebox/build/type/extends/bigint.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/bigint.mjs +9 -0
- package/node_modules/typebox/build/type/extends/boolean.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/boolean.mjs +9 -0
- package/node_modules/typebox/build/type/extends/constructor.d.mts +10 -0
- package/node_modules/typebox/build/type/extends/constructor.mjs +17 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/enum.mjs +6 -0
- package/node_modules/typebox/build/type/extends/extends-left.d.mts +55 -0
- package/node_modules/typebox/build/type/extends/extends-left.mjs +83 -0
- package/node_modules/typebox/build/type/extends/extends-right.d.mts +25 -0
- package/node_modules/typebox/build/type/extends/extends-right.mjs +43 -0
- package/node_modules/typebox/build/type/extends/extends.d.mts +11 -0
- package/node_modules/typebox/build/type/extends/extends.mjs +15 -0
- package/node_modules/typebox/build/type/extends/function.d.mts +10 -0
- package/node_modules/typebox/build/type/extends/function.mjs +17 -0
- package/node_modules/typebox/build/type/extends/index.d.mts +2 -0
- package/node_modules/typebox/build/type/extends/index.mjs +2 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +34 -0
- package/node_modules/typebox/build/type/extends/inference.mjs +62 -0
- package/node_modules/typebox/build/type/extends/integer.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/integer.mjs +10 -0
- package/node_modules/typebox/build/type/extends/intersect.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/intersect.mjs +15 -0
- package/node_modules/typebox/build/type/extends/iterator.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/iterator.mjs +9 -0
- package/node_modules/typebox/build/type/extends/literal.d.mts +18 -0
- package/node_modules/typebox/build/type/extends/literal.mjs +44 -0
- package/node_modules/typebox/build/type/extends/never.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/never.mjs +9 -0
- package/node_modules/typebox/build/type/extends/null.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/null.mjs +9 -0
- package/node_modules/typebox/build/type/extends/number.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/number.mjs +9 -0
- package/node_modules/typebox/build/type/extends/object.d.mts +25 -0
- package/node_modules/typebox/build/type/extends/object.mjs +87 -0
- package/node_modules/typebox/build/type/extends/parameters.d.mts +15 -0
- package/node_modules/typebox/build/type/extends/parameters.mjs +27 -0
- package/node_modules/typebox/build/type/extends/promise.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/promise.mjs +9 -0
- package/node_modules/typebox/build/type/extends/result.d.mts +27 -0
- package/node_modules/typebox/build/type/extends/result.mjs +39 -0
- package/node_modules/typebox/build/type/extends/return-type.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/return-type.mjs +9 -0
- package/node_modules/typebox/build/type/extends/string.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/string.mjs +9 -0
- package/node_modules/typebox/build/type/extends/symbol.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/symbol.mjs +9 -0
- package/node_modules/typebox/build/type/extends/template-literal.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/template-literal.mjs +7 -0
- package/node_modules/typebox/build/type/extends/tuple.d.mts +25 -0
- package/node_modules/typebox/build/type/extends/tuple.mjs +60 -0
- package/node_modules/typebox/build/type/extends/undefined.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/undefined.mjs +10 -0
- package/node_modules/typebox/build/type/extends/union.d.mts +11 -0
- package/node_modules/typebox/build/type/extends/union.mjs +23 -0
- package/node_modules/typebox/build/type/extends/unknown.d.mts +9 -0
- package/node_modules/typebox/build/type/extends/unknown.mjs +12 -0
- package/node_modules/typebox/build/type/extends/void.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/void.mjs +9 -0
- package/node_modules/typebox/build/type/index.d.mts +5 -0
- package/node_modules/typebox/build/type/index.mjs +5 -0
- package/node_modules/typebox/build/type/script/index.d.mts +1 -0
- package/node_modules/typebox/build/type/script/index.mjs +1 -0
- package/node_modules/typebox/build/type/script/mapping.d.mts +365 -0
- package/node_modules/typebox/build/type/script/mapping.mjs +532 -0
- package/node_modules/typebox/build/type/script/parser.d.mts +260 -0
- package/node_modules/typebox/build/type/script/parser.mjs +135 -0
- package/node_modules/typebox/build/type/script/script.d.mts +17 -0
- package/node_modules/typebox/build/type/script/script.mjs +21 -0
- package/node_modules/typebox/build/type/script/token/bigint.d.mts +8 -0
- package/node_modules/typebox/build/type/script/token/bigint.mjs +14 -0
- package/node_modules/typebox/build/type/script/token/const.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/const.mjs +18 -0
- package/node_modules/typebox/build/type/script/token/ident.d.mts +16 -0
- package/node_modules/typebox/build/type/script/token/ident.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/index.d.mts +12 -0
- package/node_modules/typebox/build/type/script/token/index.mjs +12 -0
- package/node_modules/typebox/build/type/script/token/integer.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/integer.mjs +19 -0
- package/node_modules/typebox/build/type/script/token/internal/char.d.mts +75 -0
- package/node_modules/typebox/build/type/script/token/internal/char.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -0
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +15 -0
- package/node_modules/typebox/build/type/script/token/internal/many.d.mts +7 -0
- package/node_modules/typebox/build/type/script/token/internal/many.mjs +14 -0
- package/node_modules/typebox/build/type/script/token/internal/match.d.mts +6 -0
- package/node_modules/typebox/build/type/script/token/internal/match.mjs +11 -0
- package/node_modules/typebox/build/type/script/token/internal/optional.d.mts +5 -0
- package/node_modules/typebox/build/type/script/token/internal/optional.mjs +9 -0
- package/node_modules/typebox/build/type/script/token/internal/take.d.mts +6 -0
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +34 -0
- package/node_modules/typebox/build/type/script/token/internal/trim.d.mts +19 -0
- package/node_modules/typebox/build/type/script/token/internal/trim.mjs +34 -0
- package/node_modules/typebox/build/type/script/token/number.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/number.mjs +19 -0
- package/node_modules/typebox/build/type/script/token/rest.d.mts +4 -0
- package/node_modules/typebox/build/type/script/token/rest.mjs +9 -0
- package/node_modules/typebox/build/type/script/token/span.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/span.mjs +24 -0
- package/node_modules/typebox/build/type/script/token/string.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/string.mjs +20 -0
- package/node_modules/typebox/build/type/script/token/unsigned_integer.d.mts +16 -0
- package/node_modules/typebox/build/type/script/token/unsigned_integer.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/unsigned_number.d.mts +17 -0
- package/node_modules/typebox/build/type/script/token/unsigned_number.mjs +38 -0
- package/node_modules/typebox/build/type/script/token/until.d.mts +7 -0
- package/node_modules/typebox/build/type/script/token/until.mjs +24 -0
- package/node_modules/typebox/build/type/script/token/until_1.d.mts +5 -0
- package/node_modules/typebox/build/type/script/token/until_1.mjs +12 -0
- package/node_modules/typebox/build/type/types/_codec.d.mts +30 -0
- package/node_modules/typebox/build/type/types/_codec.mjs +61 -0
- package/node_modules/typebox/build/type/types/_immutable.d.mts +16 -0
- package/node_modules/typebox/build/type/types/_immutable.mjs +26 -0
- package/node_modules/typebox/build/type/types/_optional.d.mts +16 -0
- package/node_modules/typebox/build/type/types/_optional.mjs +27 -0
- package/node_modules/typebox/build/type/types/_readonly.d.mts +16 -0
- package/node_modules/typebox/build/type/types/_readonly.mjs +26 -0
- package/node_modules/typebox/build/type/types/_refine.d.mts +19 -0
- package/node_modules/typebox/build/type/types/_refine.mjs +20 -0
- package/node_modules/typebox/build/type/types/any.d.mts +10 -0
- package/node_modules/typebox/build/type/types/any.mjs +18 -0
- package/node_modules/typebox/build/type/types/array.d.mts +17 -0
- package/node_modules/typebox/build/type/types/array.mjs +24 -0
- package/node_modules/typebox/build/type/types/async-iterator.d.mts +16 -0
- package/node_modules/typebox/build/type/types/async-iterator.mjs +24 -0
- package/node_modules/typebox/build/type/types/base.d.mts +50 -0
- package/node_modules/typebox/build/type/types/base.mjs +84 -0
- package/node_modules/typebox/build/type/types/bigint.d.mts +12 -0
- package/node_modules/typebox/build/type/types/bigint.mjs +21 -0
- package/node_modules/typebox/build/type/types/boolean.d.mts +11 -0
- package/node_modules/typebox/build/type/types/boolean.mjs +17 -0
- package/node_modules/typebox/build/type/types/call.d.mts +16 -0
- package/node_modules/typebox/build/type/types/call.mjs +22 -0
- package/node_modules/typebox/build/type/types/constructor.d.mts +18 -0
- package/node_modules/typebox/build/type/types/constructor.mjs +24 -0
- package/node_modules/typebox/build/type/types/cyclic.d.mts +16 -0
- package/node_modules/typebox/build/type/types/cyclic.mjs +29 -0
- package/node_modules/typebox/build/type/types/deferred.d.mts +12 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +16 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +16 -0
- package/node_modules/typebox/build/type/types/enum.mjs +17 -0
- package/node_modules/typebox/build/type/types/function.d.mts +21 -0
- package/node_modules/typebox/build/type/types/function.mjs +25 -0
- package/node_modules/typebox/build/type/types/generic.d.mts +13 -0
- package/node_modules/typebox/build/type/types/generic.mjs +17 -0
- package/node_modules/typebox/build/type/types/identifier.d.mts +11 -0
- package/node_modules/typebox/build/type/types/identifier.mjs +17 -0
- package/node_modules/typebox/build/type/types/index.d.mts +48 -0
- package/node_modules/typebox/build/type/types/index.mjs +54 -0
- package/node_modules/typebox/build/type/types/infer.d.mts +15 -0
- package/node_modules/typebox/build/type/types/infer.mjs +20 -0
- package/node_modules/typebox/build/type/types/integer.d.mts +12 -0
- package/node_modules/typebox/build/type/types/integer.mjs +21 -0
- package/node_modules/typebox/build/type/types/intersect.d.mts +15 -0
- package/node_modules/typebox/build/type/types/intersect.mjs +24 -0
- package/node_modules/typebox/build/type/types/iterator.d.mts +16 -0
- package/node_modules/typebox/build/type/types/iterator.mjs +24 -0
- package/node_modules/typebox/build/type/types/literal.d.mts +31 -0
- package/node_modules/typebox/build/type/types/literal.mjs +62 -0
- package/node_modules/typebox/build/type/types/never.d.mts +12 -0
- package/node_modules/typebox/build/type/types/never.mjs +22 -0
- package/node_modules/typebox/build/type/types/null.d.mts +11 -0
- package/node_modules/typebox/build/type/types/null.mjs +17 -0
- package/node_modules/typebox/build/type/types/number.d.mts +12 -0
- package/node_modules/typebox/build/type/types/number.mjs +21 -0
- package/node_modules/typebox/build/type/types/object.d.mts +18 -0
- package/node_modules/typebox/build/type/types/object.mjs +28 -0
- package/node_modules/typebox/build/type/types/parameter.d.mts +17 -0
- package/node_modules/typebox/build/type/types/parameter.mjs +21 -0
- package/node_modules/typebox/build/type/types/promise.d.mts +16 -0
- package/node_modules/typebox/build/type/types/promise.mjs +24 -0
- package/node_modules/typebox/build/type/types/properties.d.mts +42 -0
- package/node_modules/typebox/build/type/types/properties.mjs +15 -0
- package/node_modules/typebox/build/type/types/record.d.mts +48 -0
- package/node_modules/typebox/build/type/types/record.mjs +64 -0
- package/node_modules/typebox/build/type/types/ref.d.mts +19 -0
- package/node_modules/typebox/build/type/types/ref.mjs +18 -0
- package/node_modules/typebox/build/type/types/rest.d.mts +11 -0
- package/node_modules/typebox/build/type/types/rest.mjs +17 -0
- package/node_modules/typebox/build/type/types/schema.d.mts +176 -0
- package/node_modules/typebox/build/type/types/schema.mjs +15 -0
- package/node_modules/typebox/build/type/types/static.d.mts +48 -0
- package/node_modules/typebox/build/type/types/static.mjs +3 -0
- package/node_modules/typebox/build/type/types/string.d.mts +12 -0
- package/node_modules/typebox/build/type/types/string.mjs +22 -0
- package/node_modules/typebox/build/type/types/symbol.d.mts +11 -0
- package/node_modules/typebox/build/type/types/symbol.mjs +17 -0
- package/node_modules/typebox/build/type/types/template-literal.d.mts +26 -0
- package/node_modules/typebox/build/type/types/template-literal.mjs +31 -0
- package/node_modules/typebox/build/type/types/this.d.mts +14 -0
- package/node_modules/typebox/build/type/types/this.mjs +17 -0
- package/node_modules/typebox/build/type/types/tuple.d.mts +38 -0
- package/node_modules/typebox/build/type/types/tuple.mjs +25 -0
- package/node_modules/typebox/build/type/types/undefined.d.mts +11 -0
- package/node_modules/typebox/build/type/types/undefined.mjs +17 -0
- package/node_modules/typebox/build/type/types/union.d.mts +15 -0
- package/node_modules/typebox/build/type/types/union.mjs +24 -0
- package/node_modules/typebox/build/type/types/unknown.d.mts +10 -0
- package/node_modules/typebox/build/type/types/unknown.mjs +17 -0
- package/node_modules/typebox/build/type/types/unsafe.d.mts +11 -0
- package/node_modules/typebox/build/type/types/unsafe.mjs +18 -0
- package/node_modules/typebox/build/type/types/void.d.mts +11 -0
- package/node_modules/typebox/build/type/types/void.mjs +17 -0
- package/node_modules/typebox/build/typebox.d.mts +73 -0
- package/node_modules/typebox/build/typebox.mjs +89 -0
- package/node_modules/typebox/build/value/assert/assert.d.mts +14 -0
- package/node_modules/typebox/build/value/assert/assert.mjs +28 -0
- package/node_modules/typebox/build/value/assert/index.d.mts +1 -0
- package/node_modules/typebox/build/value/assert/index.mjs +1 -0
- package/node_modules/typebox/build/value/check/check.d.mts +5 -0
- package/node_modules/typebox/build/value/check/check.mjs +11 -0
- package/node_modules/typebox/build/value/check/index.d.mts +1 -0
- package/node_modules/typebox/build/value/check/index.mjs +1 -0
- package/node_modules/typebox/build/value/clean/additional.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/additional.mjs +6 -0
- package/node_modules/typebox/build/value/clean/clean.d.mts +15 -0
- package/node_modules/typebox/build/value/clean/clean.mjs +15 -0
- package/node_modules/typebox/build/value/clean/from-array.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-array.mjs +8 -0
- package/node_modules/typebox/build/value/clean/from-base.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-base.mjs +4 -0
- package/node_modules/typebox/build/value/clean/from-cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/clean/from-intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-intersect.mjs +26 -0
- package/node_modules/typebox/build/value/clean/from-object.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-object.mjs +31 -0
- package/node_modules/typebox/build/value/clean/from-record.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-record.mjs +32 -0
- package/node_modules/typebox/build/value/clean/from-ref.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-ref.mjs +8 -0
- package/node_modules/typebox/build/value/clean/from-tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-tuple.mjs +14 -0
- package/node_modules/typebox/build/value/clean/from-type.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-type.mjs +23 -0
- package/node_modules/typebox/build/value/clean/from-union.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from-union.mjs +13 -0
- package/node_modules/typebox/build/value/clean/index.d.mts +1 -0
- package/node_modules/typebox/build/value/clean/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +5 -0
- package/node_modules/typebox/build/value/clone/clone.mjs +82 -0
- package/node_modules/typebox/build/value/clone/index.d.mts +1 -0
- package/node_modules/typebox/build/value/clone/index.mjs +1 -0
- package/node_modules/typebox/build/value/codec/callback.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/callback.mjs +25 -0
- package/node_modules/typebox/build/value/codec/decode.d.mts +12 -0
- package/node_modules/typebox/build/value/codec/decode.mjs +50 -0
- package/node_modules/typebox/build/value/codec/encode.d.mts +12 -0
- package/node_modules/typebox/build/value/codec/encode.mjs +50 -0
- package/node_modules/typebox/build/value/codec/from-array.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-array.mjs +38 -0
- package/node_modules/typebox/build/value/codec/from-cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-cyclic.mjs +8 -0
- package/node_modules/typebox/build/value/codec/from-intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-intersect.mjs +58 -0
- package/node_modules/typebox/build/value/codec/from-object.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-object.mjs +45 -0
- package/node_modules/typebox/build/value/codec/from-record.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-record.mjs +44 -0
- package/node_modules/typebox/build/value/codec/from-ref.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-ref.mjs +31 -0
- package/node_modules/typebox/build/value/codec/from-tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-tuple.mjs +35 -0
- package/node_modules/typebox/build/value/codec/from-type.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-type.mjs +22 -0
- package/node_modules/typebox/build/value/codec/from-union.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from-union.mjs +40 -0
- package/node_modules/typebox/build/value/codec/has.d.mts +5 -0
- package/node_modules/typebox/build/value/codec/has.mjs +93 -0
- package/node_modules/typebox/build/value/codec/index.d.mts +3 -0
- package/node_modules/typebox/build/value/codec/index.mjs +3 -0
- package/node_modules/typebox/build/value/convert/convert.d.mts +13 -0
- package/node_modules/typebox/build/value/convert/convert.mjs +15 -0
- package/node_modules/typebox/build/value/convert/from-additional.d.mts +6 -0
- package/node_modules/typebox/build/value/convert/from-additional.mjs +18 -0
- package/node_modules/typebox/build/value/convert/from-array.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-array.mjs +7 -0
- package/node_modules/typebox/build/value/convert/from-base.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-base.mjs +4 -0
- package/node_modules/typebox/build/value/convert/from-bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-bigint.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from-boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-boolean.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from-cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from-enum.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-enum.mjs +7 -0
- package/node_modules/typebox/build/value/convert/from-integer.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-integer.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from-intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-intersect.mjs +8 -0
- package/node_modules/typebox/build/value/convert/from-literal.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-literal.mjs +44 -0
- package/node_modules/typebox/build/value/convert/from-null.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-null.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from-number.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-number.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from-object.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-object.mjs +28 -0
- package/node_modules/typebox/build/value/convert/from-record.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-record.mjs +23 -0
- package/node_modules/typebox/build/value/convert/from-ref.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-ref.mjs +8 -0
- package/node_modules/typebox/build/value/convert/from-string.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-string.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from-template-literal.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-template-literal.mjs +7 -0
- package/node_modules/typebox/build/value/convert/from-tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-tuple.mjs +11 -0
- package/node_modules/typebox/build/value/convert/from-type.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-type.mjs +45 -0
- package/node_modules/typebox/build/value/convert/from-undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-undefined.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from-union.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-union.mjs +13 -0
- package/node_modules/typebox/build/value/convert/from-void.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from-void.mjs +6 -0
- package/node_modules/typebox/build/value/convert/index.d.mts +1 -0
- package/node_modules/typebox/build/value/convert/index.mjs +1 -0
- package/node_modules/typebox/build/value/convert/try/index.d.mts +1 -0
- package/node_modules/typebox/build/value/convert/try/index.mjs +1 -0
- package/node_modules/typebox/build/value/convert/try/try-array.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try-array.mjs +6 -0
- package/node_modules/typebox/build/value/convert/try/try-bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try-bigint.mjs +45 -0
- package/node_modules/typebox/build/value/convert/try/try-boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try-boolean.mjs +41 -0
- package/node_modules/typebox/build/value/convert/try/try-null.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try-null.mjs +44 -0
- package/node_modules/typebox/build/value/convert/try/try-number.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try-number.mjs +44 -0
- package/node_modules/typebox/build/value/convert/try/try-result.d.mts +8 -0
- package/node_modules/typebox/build/value/convert/try/try-result.mjs +17 -0
- package/node_modules/typebox/build/value/convert/try/try-string.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try-string.mjs +12 -0
- package/node_modules/typebox/build/value/convert/try/try-undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try-undefined.mjs +44 -0
- package/node_modules/typebox/build/value/convert/try/try.d.mts +8 -0
- package/node_modules/typebox/build/value/convert/try/try.mjs +8 -0
- package/node_modules/typebox/build/value/create/create.d.mts +5 -0
- package/node_modules/typebox/build/value/create/create.mjs +11 -0
- package/node_modules/typebox/build/value/create/error.d.mts +5 -0
- package/node_modules/typebox/build/value/create/error.mjs +7 -0
- package/node_modules/typebox/build/value/create/from-array.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-array.mjs +10 -0
- package/node_modules/typebox/build/value/create/from-async-iterator.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-async-iterator.mjs +5 -0
- package/node_modules/typebox/build/value/create/from-base.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-base.mjs +4 -0
- package/node_modules/typebox/build/value/create/from-bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-bigint.mjs +7 -0
- package/node_modules/typebox/build/value/create/from-boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-boolean.mjs +4 -0
- package/node_modules/typebox/build/value/create/from-constructor.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-constructor.mjs +10 -0
- package/node_modules/typebox/build/value/create/from-cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/create/from-default.d.mts +3 -0
- package/node_modules/typebox/build/value/create/from-default.mjs +10 -0
- package/node_modules/typebox/build/value/create/from-enum.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-enum.mjs +6 -0
- package/node_modules/typebox/build/value/create/from-function.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-function.mjs +6 -0
- package/node_modules/typebox/build/value/create/from-integer.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-integer.mjs +8 -0
- package/node_modules/typebox/build/value/create/from-intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-intersect.mjs +8 -0
- package/node_modules/typebox/build/value/create/from-iterator.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-iterator.mjs +5 -0
- package/node_modules/typebox/build/value/create/from-literal.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-literal.mjs +4 -0
- package/node_modules/typebox/build/value/create/from-never.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-never.mjs +5 -0
- package/node_modules/typebox/build/value/create/from-null.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-null.mjs +4 -0
- package/node_modules/typebox/build/value/create/from-number.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-number.mjs +8 -0
- package/node_modules/typebox/build/value/create/from-object.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-object.mjs +9 -0
- package/node_modules/typebox/build/value/create/from-promise.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-promise.mjs +5 -0
- package/node_modules/typebox/build/value/create/from-record.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-record.mjs +8 -0
- package/node_modules/typebox/build/value/create/from-ref.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-ref.mjs +9 -0
- package/node_modules/typebox/build/value/create/from-string.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-string.mjs +9 -0
- package/node_modules/typebox/build/value/create/from-symbol.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-symbol.mjs +4 -0
- package/node_modules/typebox/build/value/create/from-template-literal.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-template-literal.mjs +11 -0
- package/node_modules/typebox/build/value/create/from-tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-tuple.mjs +5 -0
- package/node_modules/typebox/build/value/create/from-type.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-type.mjs +69 -0
- package/node_modules/typebox/build/value/create/from-undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-undefined.mjs +4 -0
- package/node_modules/typebox/build/value/create/from-union.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-union.mjs +9 -0
- package/node_modules/typebox/build/value/create/from-void.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from-void.mjs +4 -0
- package/node_modules/typebox/build/value/create/index.d.mts +2 -0
- package/node_modules/typebox/build/value/create/index.mjs +2 -0
- package/node_modules/typebox/build/value/default/default.d.mts +13 -0
- package/node_modules/typebox/build/value/default/default.mjs +15 -0
- package/node_modules/typebox/build/value/default/from-array.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-array.mjs +12 -0
- package/node_modules/typebox/build/value/default/from-base.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-base.mjs +5 -0
- package/node_modules/typebox/build/value/default/from-cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-cyclic.mjs +7 -0
- package/node_modules/typebox/build/value/default/from-default.d.mts +3 -0
- package/node_modules/typebox/build/value/default/from-default.mjs +13 -0
- package/node_modules/typebox/build/value/default/from-intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-intersect.mjs +9 -0
- package/node_modules/typebox/build/value/default/from-object.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-object.mjs +32 -0
- package/node_modules/typebox/build/value/default/from-record.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-record.mjs +26 -0
- package/node_modules/typebox/build/value/default/from-ref.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-ref.mjs +9 -0
- package/node_modules/typebox/build/value/default/from-tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-tuple.mjs +14 -0
- package/node_modules/typebox/build/value/default/from-type.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-type.mjs +27 -0
- package/node_modules/typebox/build/value/default/from-union.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from-union.mjs +14 -0
- package/node_modules/typebox/build/value/default/index.d.mts +1 -0
- package/node_modules/typebox/build/value/default/index.mjs +1 -0
- package/node_modules/typebox/build/value/delta/diff.d.mts +10 -0
- package/node_modules/typebox/build/value/delta/diff.mjs +129 -0
- package/node_modules/typebox/build/value/delta/edit.d.mts +24 -0
- package/node_modules/typebox/build/value/delta/edit.mjs +17 -0
- package/node_modules/typebox/build/value/delta/index.d.mts +3 -0
- package/node_modules/typebox/build/value/delta/index.mjs +3 -0
- package/node_modules/typebox/build/value/delta/patch.d.mts +8 -0
- package/node_modules/typebox/build/value/delta/patch.mjs +42 -0
- package/node_modules/typebox/build/value/equal/equal.d.mts +2 -0
- package/node_modules/typebox/build/value/equal/equal.mjs +6 -0
- package/node_modules/typebox/build/value/equal/index.d.mts +1 -0
- package/node_modules/typebox/build/value/equal/index.mjs +1 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +16 -0
- package/node_modules/typebox/build/value/errors/errors.mjs +17 -0
- package/node_modules/typebox/build/value/errors/index.d.mts +1 -0
- package/node_modules/typebox/build/value/errors/index.mjs +1 -0
- package/node_modules/typebox/build/value/hash/hash.d.mts +6 -0
- package/node_modules/typebox/build/value/hash/hash.mjs +10 -0
- package/node_modules/typebox/build/value/hash/index.d.mts +1 -0
- package/node_modules/typebox/build/value/hash/index.mjs +1 -0
- package/node_modules/typebox/build/value/index.d.mts +21 -0
- package/node_modules/typebox/build/value/index.mjs +30 -0
- package/node_modules/typebox/build/value/mutate/error.d.mts +3 -0
- package/node_modules/typebox/build/value/mutate/error.mjs +6 -0
- package/node_modules/typebox/build/value/mutate/from-array.d.mts +2 -0
- package/node_modules/typebox/build/value/mutate/from-array.mjs +16 -0
- package/node_modules/typebox/build/value/mutate/from-object.d.mts +2 -0
- package/node_modules/typebox/build/value/mutate/from-object.mjs +27 -0
- package/node_modules/typebox/build/value/mutate/from-unknown.d.mts +2 -0
- package/node_modules/typebox/build/value/mutate/from-unknown.mjs +7 -0
- package/node_modules/typebox/build/value/mutate/from-value.d.mts +2 -0
- package/node_modules/typebox/build/value/mutate/from-value.mjs +12 -0
- package/node_modules/typebox/build/value/mutate/index.d.mts +1 -0
- package/node_modules/typebox/build/value/mutate/index.mjs +1 -0
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +9 -0
- package/node_modules/typebox/build/value/mutate/mutate.mjs +39 -0
- package/node_modules/typebox/build/value/parse/index.d.mts +1 -0
- package/node_modules/typebox/build/value/parse/index.mjs +1 -0
- package/node_modules/typebox/build/value/parse/parse.d.mts +11 -0
- package/node_modules/typebox/build/value/parse/parse.mjs +47 -0
- package/node_modules/typebox/build/value/pipeline/index.d.mts +1 -0
- package/node_modules/typebox/build/value/pipeline/index.mjs +1 -0
- package/node_modules/typebox/build/value/pipeline/pipeline.d.mts +10 -0
- package/node_modules/typebox/build/value/pipeline/pipeline.mjs +15 -0
- package/node_modules/typebox/build/value/pointer/index.d.mts +1 -0
- package/node_modules/typebox/build/value/pointer/index.mjs +1 -0
- package/node_modules/typebox/build/value/repair/error.d.mts +7 -0
- package/node_modules/typebox/build/value/repair/error.mjs +8 -0
- package/node_modules/typebox/build/value/repair/from-array.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-array.mjs +39 -0
- package/node_modules/typebox/build/value/repair/from-base.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-base.mjs +8 -0
- package/node_modules/typebox/build/value/repair/from-enum.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-enum.mjs +7 -0
- package/node_modules/typebox/build/value/repair/from-intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-intersect.mjs +8 -0
- package/node_modules/typebox/build/value/repair/from-object.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-object.mjs +33 -0
- package/node_modules/typebox/build/value/repair/from-record.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-record.mjs +33 -0
- package/node_modules/typebox/build/value/repair/from-ref.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-ref.mjs +9 -0
- package/node_modules/typebox/build/value/repair/from-template-literal.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-template-literal.mjs +7 -0
- package/node_modules/typebox/build/value/repair/from-tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-tuple.mjs +12 -0
- package/node_modules/typebox/build/value/repair/from-type.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-type.mjs +86 -0
- package/node_modules/typebox/build/value/repair/from-union.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-union.mjs +24 -0
- package/node_modules/typebox/build/value/repair/from-unknown.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from-unknown.mjs +12 -0
- package/node_modules/typebox/build/value/repair/index.d.mts +1 -0
- package/node_modules/typebox/build/value/repair/index.mjs +1 -0
- package/node_modules/typebox/build/value/repair/repair.d.mts +17 -0
- package/node_modules/typebox/build/value/repair/repair.mjs +20 -0
- package/node_modules/typebox/build/value/shared/index.d.mts +3 -0
- package/node_modules/typebox/build/value/shared/index.mjs +4 -0
- package/node_modules/typebox/build/value/shared/optional-undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/shared/optional-undefined.mjs +15 -0
- package/node_modules/typebox/build/value/shared/union-priority-sort.d.mts +3 -0
- package/node_modules/typebox/build/value/shared/union-priority-sort.mjs +36 -0
- package/node_modules/typebox/build/value/shared/union-score-select.d.mts +3 -0
- package/node_modules/typebox/build/value/shared/union-score-select.mjs +51 -0
- package/node_modules/typebox/build/value/value.d.mts +16 -0
- package/node_modules/typebox/build/value/value.mjs +16 -0
- package/node_modules/typebox/license +23 -0
- package/node_modules/typebox/package.json +87 -0
- package/node_modules/typebox/readme.md +361 -0
- package/package.json +1 -40
- package/skills/giver/SKILL.md +24 -9
|
@@ -0,0 +1,1916 @@
|
|
|
1
|
+
import { getKeybindings } from "../keybindings.js";
|
|
2
|
+
import { decodePrintableKey, matchesKey } from "../keys.js";
|
|
3
|
+
import { KillRing } from "../kill-ring.js";
|
|
4
|
+
import { CURSOR_MARKER } from "../tui.js";
|
|
5
|
+
import { UndoStack } from "../undo-stack.js";
|
|
6
|
+
import { getSegmenter, isPunctuationChar, isWhitespaceChar, truncateToWidth, visibleWidth } from "../utils.js";
|
|
7
|
+
import { SelectList } from "./select-list.js";
|
|
8
|
+
const baseSegmenter = getSegmenter();
|
|
9
|
+
/** Regex matching paste markers like `[paste #1 +123 lines]` or `[paste #2 1234 chars]`. */
|
|
10
|
+
const PASTE_MARKER_REGEX = /\[paste #(\d+)( (\+\d+ lines|\d+ chars))?\]/g;
|
|
11
|
+
/** Non-global version for single-segment testing. */
|
|
12
|
+
const PASTE_MARKER_SINGLE = /^\[paste #(\d+)( (\+\d+ lines|\d+ chars))?\]$/;
|
|
13
|
+
/** Check if a segment is a paste marker (i.e. was merged by segmentWithMarkers). */
|
|
14
|
+
function isPasteMarker(segment) {
|
|
15
|
+
return segment.length >= 10 && PASTE_MARKER_SINGLE.test(segment);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A segmenter that wraps Intl.Segmenter and merges graphemes that fall
|
|
19
|
+
* within paste markers into single atomic segments. This makes cursor
|
|
20
|
+
* movement, deletion, word-wrap, etc. treat paste markers as single units.
|
|
21
|
+
*
|
|
22
|
+
* Only markers whose numeric ID exists in `validIds` are merged.
|
|
23
|
+
*/
|
|
24
|
+
function segmentWithMarkers(text, validIds) {
|
|
25
|
+
// Fast path: no paste markers in the text or no valid IDs.
|
|
26
|
+
if (validIds.size === 0 || !text.includes("[paste #")) {
|
|
27
|
+
return baseSegmenter.segment(text);
|
|
28
|
+
}
|
|
29
|
+
// Find all marker spans with valid IDs.
|
|
30
|
+
const markers = [];
|
|
31
|
+
for (const m of text.matchAll(PASTE_MARKER_REGEX)) {
|
|
32
|
+
const id = Number.parseInt(m[1], 10);
|
|
33
|
+
if (!validIds.has(id))
|
|
34
|
+
continue;
|
|
35
|
+
markers.push({ start: m.index, end: m.index + m[0].length });
|
|
36
|
+
}
|
|
37
|
+
if (markers.length === 0) {
|
|
38
|
+
return baseSegmenter.segment(text);
|
|
39
|
+
}
|
|
40
|
+
// Build merged segment list.
|
|
41
|
+
const baseSegments = baseSegmenter.segment(text);
|
|
42
|
+
const result = [];
|
|
43
|
+
let markerIdx = 0;
|
|
44
|
+
for (const seg of baseSegments) {
|
|
45
|
+
// Skip past markers that are entirely before this segment.
|
|
46
|
+
while (markerIdx < markers.length && markers[markerIdx].end <= seg.index) {
|
|
47
|
+
markerIdx++;
|
|
48
|
+
}
|
|
49
|
+
const marker = markerIdx < markers.length ? markers[markerIdx] : null;
|
|
50
|
+
if (marker && seg.index >= marker.start && seg.index < marker.end) {
|
|
51
|
+
// This segment falls inside a marker.
|
|
52
|
+
// If this is the first segment of the marker, emit a merged segment.
|
|
53
|
+
if (seg.index === marker.start) {
|
|
54
|
+
const markerText = text.slice(marker.start, marker.end);
|
|
55
|
+
result.push({
|
|
56
|
+
segment: markerText,
|
|
57
|
+
index: marker.start,
|
|
58
|
+
input: text,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// Otherwise skip (already merged into the first segment).
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
result.push(seg);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Split a line into word-wrapped chunks.
|
|
71
|
+
* Wraps at word boundaries when possible, falling back to character-level
|
|
72
|
+
* wrapping for words longer than the available width.
|
|
73
|
+
*
|
|
74
|
+
* @param line - The text line to wrap
|
|
75
|
+
* @param maxWidth - Maximum visible width per chunk
|
|
76
|
+
* @param preSegmented - Optional pre-segmented graphemes (e.g. with paste-marker awareness).
|
|
77
|
+
* When omitted the default Intl.Segmenter is used.
|
|
78
|
+
* @returns Array of chunks with text and position information
|
|
79
|
+
*/
|
|
80
|
+
export function wordWrapLine(line, maxWidth, preSegmented) {
|
|
81
|
+
if (!line || maxWidth <= 0) {
|
|
82
|
+
return [{ text: "", startIndex: 0, endIndex: 0 }];
|
|
83
|
+
}
|
|
84
|
+
const lineWidth = visibleWidth(line);
|
|
85
|
+
if (lineWidth <= maxWidth) {
|
|
86
|
+
return [{ text: line, startIndex: 0, endIndex: line.length }];
|
|
87
|
+
}
|
|
88
|
+
const chunks = [];
|
|
89
|
+
const segments = preSegmented ?? [...baseSegmenter.segment(line)];
|
|
90
|
+
let currentWidth = 0;
|
|
91
|
+
let chunkStart = 0;
|
|
92
|
+
// Wrap opportunity: the position after the last whitespace before a non-whitespace
|
|
93
|
+
// grapheme, i.e. where a line break is allowed.
|
|
94
|
+
let wrapOppIndex = -1;
|
|
95
|
+
let wrapOppWidth = 0;
|
|
96
|
+
for (let i = 0; i < segments.length; i++) {
|
|
97
|
+
const seg = segments[i];
|
|
98
|
+
const grapheme = seg.segment;
|
|
99
|
+
const gWidth = visibleWidth(grapheme);
|
|
100
|
+
const charIndex = seg.index;
|
|
101
|
+
const isWs = !isPasteMarker(grapheme) && isWhitespaceChar(grapheme);
|
|
102
|
+
// Overflow check before advancing.
|
|
103
|
+
if (currentWidth + gWidth > maxWidth) {
|
|
104
|
+
if (wrapOppIndex >= 0 && currentWidth - wrapOppWidth + gWidth <= maxWidth) {
|
|
105
|
+
// Backtrack to last wrap opportunity (the remaining content
|
|
106
|
+
// plus the current grapheme still fits within maxWidth).
|
|
107
|
+
chunks.push({ text: line.slice(chunkStart, wrapOppIndex), startIndex: chunkStart, endIndex: wrapOppIndex });
|
|
108
|
+
chunkStart = wrapOppIndex;
|
|
109
|
+
currentWidth -= wrapOppWidth;
|
|
110
|
+
}
|
|
111
|
+
else if (chunkStart < charIndex) {
|
|
112
|
+
// No viable wrap opportunity: force-break at current position.
|
|
113
|
+
// This also handles the case where backtracking to a word
|
|
114
|
+
// boundary wouldn't help because the remaining content plus
|
|
115
|
+
// the current grapheme (e.g. a wide character) still exceeds
|
|
116
|
+
// maxWidth.
|
|
117
|
+
chunks.push({ text: line.slice(chunkStart, charIndex), startIndex: chunkStart, endIndex: charIndex });
|
|
118
|
+
chunkStart = charIndex;
|
|
119
|
+
currentWidth = 0;
|
|
120
|
+
}
|
|
121
|
+
wrapOppIndex = -1;
|
|
122
|
+
}
|
|
123
|
+
if (gWidth > maxWidth) {
|
|
124
|
+
// Single atomic segment wider than maxWidth (e.g. paste marker
|
|
125
|
+
// in a narrow terminal). Re-wrap it at grapheme granularity.
|
|
126
|
+
// The segment remains logically atomic for cursor
|
|
127
|
+
// movement / editing — the split is purely visual for word-wrap layout.
|
|
128
|
+
const subChunks = wordWrapLine(grapheme, maxWidth);
|
|
129
|
+
for (let j = 0; j < subChunks.length - 1; j++) {
|
|
130
|
+
const sc = subChunks[j];
|
|
131
|
+
chunks.push({ text: sc.text, startIndex: charIndex + sc.startIndex, endIndex: charIndex + sc.endIndex });
|
|
132
|
+
}
|
|
133
|
+
const last = subChunks[subChunks.length - 1];
|
|
134
|
+
chunkStart = charIndex + last.startIndex;
|
|
135
|
+
currentWidth = visibleWidth(last.text);
|
|
136
|
+
wrapOppIndex = -1;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
// Advance.
|
|
140
|
+
currentWidth += gWidth;
|
|
141
|
+
// Record wrap opportunity: whitespace followed by non-whitespace.
|
|
142
|
+
// Multiple spaces join (no break between them); the break point is
|
|
143
|
+
// after the last space before the next word.
|
|
144
|
+
const next = segments[i + 1];
|
|
145
|
+
if (isWs && next && (isPasteMarker(next.segment) || !isWhitespaceChar(next.segment))) {
|
|
146
|
+
wrapOppIndex = next.index;
|
|
147
|
+
wrapOppWidth = currentWidth;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// Push final chunk.
|
|
151
|
+
chunks.push({ text: line.slice(chunkStart), startIndex: chunkStart, endIndex: line.length });
|
|
152
|
+
return chunks;
|
|
153
|
+
}
|
|
154
|
+
const SLASH_COMMAND_SELECT_LIST_LAYOUT = {
|
|
155
|
+
minPrimaryColumnWidth: 12,
|
|
156
|
+
maxPrimaryColumnWidth: 32,
|
|
157
|
+
};
|
|
158
|
+
const ATTACHMENT_AUTOCOMPLETE_DEBOUNCE_MS = 20;
|
|
159
|
+
export class Editor {
|
|
160
|
+
state = {
|
|
161
|
+
lines: [""],
|
|
162
|
+
cursorLine: 0,
|
|
163
|
+
cursorCol: 0,
|
|
164
|
+
};
|
|
165
|
+
/** Focusable interface - set by TUI when focus changes */
|
|
166
|
+
focused = false;
|
|
167
|
+
tui;
|
|
168
|
+
theme;
|
|
169
|
+
paddingX = 0;
|
|
170
|
+
// Store last render width for cursor navigation
|
|
171
|
+
lastWidth = 80;
|
|
172
|
+
// Vertical scrolling support
|
|
173
|
+
scrollOffset = 0;
|
|
174
|
+
// Border color (can be changed dynamically)
|
|
175
|
+
borderColor;
|
|
176
|
+
// Autocomplete support
|
|
177
|
+
autocompleteProvider;
|
|
178
|
+
autocompleteList;
|
|
179
|
+
autocompleteState = null;
|
|
180
|
+
autocompletePrefix = "";
|
|
181
|
+
autocompleteMaxVisible = 5;
|
|
182
|
+
autocompleteAbort;
|
|
183
|
+
autocompleteDebounceTimer;
|
|
184
|
+
autocompleteRequestTask = Promise.resolve();
|
|
185
|
+
autocompleteStartToken = 0;
|
|
186
|
+
autocompleteRequestId = 0;
|
|
187
|
+
// Paste tracking for large pastes
|
|
188
|
+
pastes = new Map();
|
|
189
|
+
pasteCounter = 0;
|
|
190
|
+
// Bracketed paste mode buffering
|
|
191
|
+
pasteBuffer = "";
|
|
192
|
+
isInPaste = false;
|
|
193
|
+
// Prompt history for up/down navigation
|
|
194
|
+
history = [];
|
|
195
|
+
historyIndex = -1; // -1 = not browsing, 0 = most recent, 1 = older, etc.
|
|
196
|
+
// Kill ring for Emacs-style kill/yank operations
|
|
197
|
+
killRing = new KillRing();
|
|
198
|
+
lastAction = null;
|
|
199
|
+
// Character jump mode
|
|
200
|
+
jumpMode = null;
|
|
201
|
+
// Preferred visual column for vertical cursor movement (sticky column)
|
|
202
|
+
preferredVisualCol = null;
|
|
203
|
+
// When the cursor is snapped to the start of an atomic segment, e.g. a
|
|
204
|
+
// paste marker, cursorCol no longer reflects where the cursor would have
|
|
205
|
+
// landed. This field stores the pre-snap cursorCol so that the next
|
|
206
|
+
// vertical move can resolve it to a visual column on whatever VL it belongs
|
|
207
|
+
// to.
|
|
208
|
+
snappedFromCursorCol = null;
|
|
209
|
+
// Undo support
|
|
210
|
+
undoStack = new UndoStack();
|
|
211
|
+
onSubmit;
|
|
212
|
+
onChange;
|
|
213
|
+
disableSubmit = false;
|
|
214
|
+
constructor(tui, theme, options = {}) {
|
|
215
|
+
this.tui = tui;
|
|
216
|
+
this.theme = theme;
|
|
217
|
+
this.borderColor = theme.borderColor;
|
|
218
|
+
const paddingX = options.paddingX ?? 0;
|
|
219
|
+
this.paddingX = Number.isFinite(paddingX) ? Math.max(0, Math.floor(paddingX)) : 0;
|
|
220
|
+
const maxVisible = options.autocompleteMaxVisible ?? 5;
|
|
221
|
+
this.autocompleteMaxVisible = Number.isFinite(maxVisible) ? Math.max(3, Math.min(20, Math.floor(maxVisible))) : 5;
|
|
222
|
+
}
|
|
223
|
+
/** Set of currently valid paste IDs, for marker-aware segmentation. */
|
|
224
|
+
validPasteIds() {
|
|
225
|
+
return new Set(this.pastes.keys());
|
|
226
|
+
}
|
|
227
|
+
/** Segment text with paste-marker awareness, only merging markers with valid IDs. */
|
|
228
|
+
segment(text) {
|
|
229
|
+
return segmentWithMarkers(text, this.validPasteIds());
|
|
230
|
+
}
|
|
231
|
+
getPaddingX() {
|
|
232
|
+
return this.paddingX;
|
|
233
|
+
}
|
|
234
|
+
setPaddingX(padding) {
|
|
235
|
+
const newPadding = Number.isFinite(padding) ? Math.max(0, Math.floor(padding)) : 0;
|
|
236
|
+
if (this.paddingX !== newPadding) {
|
|
237
|
+
this.paddingX = newPadding;
|
|
238
|
+
this.tui.requestRender();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
getAutocompleteMaxVisible() {
|
|
242
|
+
return this.autocompleteMaxVisible;
|
|
243
|
+
}
|
|
244
|
+
setAutocompleteMaxVisible(maxVisible) {
|
|
245
|
+
const newMaxVisible = Number.isFinite(maxVisible) ? Math.max(3, Math.min(20, Math.floor(maxVisible))) : 5;
|
|
246
|
+
if (this.autocompleteMaxVisible !== newMaxVisible) {
|
|
247
|
+
this.autocompleteMaxVisible = newMaxVisible;
|
|
248
|
+
this.tui.requestRender();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
setAutocompleteProvider(provider) {
|
|
252
|
+
this.cancelAutocomplete();
|
|
253
|
+
this.autocompleteProvider = provider;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Add a prompt to history for up/down arrow navigation.
|
|
257
|
+
* Called after successful submission.
|
|
258
|
+
*/
|
|
259
|
+
addToHistory(text) {
|
|
260
|
+
const trimmed = text.trim();
|
|
261
|
+
if (!trimmed)
|
|
262
|
+
return;
|
|
263
|
+
// Don't add consecutive duplicates
|
|
264
|
+
if (this.history.length > 0 && this.history[0] === trimmed)
|
|
265
|
+
return;
|
|
266
|
+
this.history.unshift(trimmed);
|
|
267
|
+
// Limit history size
|
|
268
|
+
if (this.history.length > 100) {
|
|
269
|
+
this.history.pop();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
isEditorEmpty() {
|
|
273
|
+
return this.state.lines.length === 1 && this.state.lines[0] === "";
|
|
274
|
+
}
|
|
275
|
+
isOnFirstVisualLine() {
|
|
276
|
+
const visualLines = this.buildVisualLineMap(this.lastWidth);
|
|
277
|
+
const currentVisualLine = this.findCurrentVisualLine(visualLines);
|
|
278
|
+
return currentVisualLine === 0;
|
|
279
|
+
}
|
|
280
|
+
isOnLastVisualLine() {
|
|
281
|
+
const visualLines = this.buildVisualLineMap(this.lastWidth);
|
|
282
|
+
const currentVisualLine = this.findCurrentVisualLine(visualLines);
|
|
283
|
+
return currentVisualLine === visualLines.length - 1;
|
|
284
|
+
}
|
|
285
|
+
navigateHistory(direction) {
|
|
286
|
+
this.lastAction = null;
|
|
287
|
+
if (this.history.length === 0)
|
|
288
|
+
return;
|
|
289
|
+
const newIndex = this.historyIndex - direction; // Up(-1) increases index, Down(1) decreases
|
|
290
|
+
if (newIndex < -1 || newIndex >= this.history.length)
|
|
291
|
+
return;
|
|
292
|
+
// Capture state when first entering history browsing mode
|
|
293
|
+
if (this.historyIndex === -1 && newIndex >= 0) {
|
|
294
|
+
this.pushUndoSnapshot();
|
|
295
|
+
}
|
|
296
|
+
this.historyIndex = newIndex;
|
|
297
|
+
if (this.historyIndex === -1) {
|
|
298
|
+
// Returned to "current" state - clear editor
|
|
299
|
+
this.setTextInternal("");
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
this.setTextInternal(this.history[this.historyIndex] || "");
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/** Internal setText that doesn't reset history state - used by navigateHistory */
|
|
306
|
+
setTextInternal(text) {
|
|
307
|
+
const lines = text.split("\n");
|
|
308
|
+
this.state.lines = lines.length === 0 ? [""] : lines;
|
|
309
|
+
this.state.cursorLine = this.state.lines.length - 1;
|
|
310
|
+
this.setCursorCol(this.state.lines[this.state.cursorLine]?.length || 0);
|
|
311
|
+
// Reset scroll - render() will adjust to show cursor
|
|
312
|
+
this.scrollOffset = 0;
|
|
313
|
+
if (this.onChange) {
|
|
314
|
+
this.onChange(this.getText());
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
invalidate() {
|
|
318
|
+
// No cached state to invalidate currently
|
|
319
|
+
}
|
|
320
|
+
render(width) {
|
|
321
|
+
const maxPadding = Math.max(0, Math.floor((width - 1) / 2));
|
|
322
|
+
const paddingX = Math.min(this.paddingX, maxPadding);
|
|
323
|
+
const contentWidth = Math.max(1, width - paddingX * 2);
|
|
324
|
+
// Layout width: with padding the cursor can overflow into it,
|
|
325
|
+
// without padding we reserve 1 column for the cursor.
|
|
326
|
+
const layoutWidth = Math.max(1, contentWidth - (paddingX ? 0 : 1));
|
|
327
|
+
// Store for cursor navigation (must match wrapping width)
|
|
328
|
+
this.lastWidth = layoutWidth;
|
|
329
|
+
const horizontal = this.borderColor("─");
|
|
330
|
+
// Layout the text
|
|
331
|
+
const layoutLines = this.layoutText(layoutWidth);
|
|
332
|
+
// Calculate max visible lines: 30% of terminal height, minimum 5 lines
|
|
333
|
+
const terminalRows = this.tui.terminal.rows;
|
|
334
|
+
const maxVisibleLines = Math.max(5, Math.floor(terminalRows * 0.3));
|
|
335
|
+
// Find the cursor line index in layoutLines
|
|
336
|
+
let cursorLineIndex = layoutLines.findIndex((line) => line.hasCursor);
|
|
337
|
+
if (cursorLineIndex === -1)
|
|
338
|
+
cursorLineIndex = 0;
|
|
339
|
+
// Adjust scroll offset to keep cursor visible
|
|
340
|
+
if (cursorLineIndex < this.scrollOffset) {
|
|
341
|
+
this.scrollOffset = cursorLineIndex;
|
|
342
|
+
}
|
|
343
|
+
else if (cursorLineIndex >= this.scrollOffset + maxVisibleLines) {
|
|
344
|
+
this.scrollOffset = cursorLineIndex - maxVisibleLines + 1;
|
|
345
|
+
}
|
|
346
|
+
// Clamp scroll offset to valid range
|
|
347
|
+
const maxScrollOffset = Math.max(0, layoutLines.length - maxVisibleLines);
|
|
348
|
+
this.scrollOffset = Math.max(0, Math.min(this.scrollOffset, maxScrollOffset));
|
|
349
|
+
// Get visible lines slice
|
|
350
|
+
const visibleLines = layoutLines.slice(this.scrollOffset, this.scrollOffset + maxVisibleLines);
|
|
351
|
+
const result = [];
|
|
352
|
+
const leftPadding = " ".repeat(paddingX);
|
|
353
|
+
const rightPadding = leftPadding;
|
|
354
|
+
// Render top border (with scroll indicator if scrolled down)
|
|
355
|
+
if (this.scrollOffset > 0) {
|
|
356
|
+
const indicator = `─── ↑ ${this.scrollOffset} more `;
|
|
357
|
+
const remaining = width - visibleWidth(indicator);
|
|
358
|
+
if (remaining >= 0) {
|
|
359
|
+
result.push(this.borderColor(indicator + "─".repeat(remaining)));
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
result.push(this.borderColor(truncateToWidth(indicator, width)));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
result.push(horizontal.repeat(width));
|
|
367
|
+
}
|
|
368
|
+
// Render each visible layout line
|
|
369
|
+
// Emit hardware cursor marker only when focused and not showing autocomplete
|
|
370
|
+
const emitCursorMarker = this.focused && !this.autocompleteState;
|
|
371
|
+
for (const layoutLine of visibleLines) {
|
|
372
|
+
let displayText = layoutLine.text;
|
|
373
|
+
let lineVisibleWidth = visibleWidth(layoutLine.text);
|
|
374
|
+
let cursorInPadding = false;
|
|
375
|
+
// Add cursor if this line has it
|
|
376
|
+
if (layoutLine.hasCursor && layoutLine.cursorPos !== undefined) {
|
|
377
|
+
const before = displayText.slice(0, layoutLine.cursorPos);
|
|
378
|
+
const after = displayText.slice(layoutLine.cursorPos);
|
|
379
|
+
// Hardware cursor marker (zero-width, emitted before fake cursor for IME positioning)
|
|
380
|
+
const marker = emitCursorMarker ? CURSOR_MARKER : "";
|
|
381
|
+
if (after.length > 0) {
|
|
382
|
+
// Cursor is on a character (grapheme) - replace it with highlighted version
|
|
383
|
+
// Get the first grapheme from 'after'
|
|
384
|
+
const afterGraphemes = [...this.segment(after)];
|
|
385
|
+
const firstGrapheme = afterGraphemes[0]?.segment || "";
|
|
386
|
+
const restAfter = after.slice(firstGrapheme.length);
|
|
387
|
+
const cursor = `\x1b[7m${firstGrapheme}\x1b[0m`;
|
|
388
|
+
displayText = before + marker + cursor + restAfter;
|
|
389
|
+
// lineVisibleWidth stays the same - we're replacing, not adding
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
// Cursor is at the end - add highlighted space
|
|
393
|
+
const cursor = "\x1b[7m \x1b[0m";
|
|
394
|
+
displayText = before + marker + cursor;
|
|
395
|
+
lineVisibleWidth = lineVisibleWidth + 1;
|
|
396
|
+
// If cursor overflows content width into the padding, flag it
|
|
397
|
+
if (lineVisibleWidth > contentWidth && paddingX > 0) {
|
|
398
|
+
cursorInPadding = true;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
// Calculate padding based on actual visible width
|
|
403
|
+
const padding = " ".repeat(Math.max(0, contentWidth - lineVisibleWidth));
|
|
404
|
+
const lineRightPadding = cursorInPadding ? rightPadding.slice(1) : rightPadding;
|
|
405
|
+
// Render the line (no side borders, just horizontal lines above and below)
|
|
406
|
+
result.push(`${leftPadding}${displayText}${padding}${lineRightPadding}`);
|
|
407
|
+
}
|
|
408
|
+
// Render bottom border (with scroll indicator if more content below)
|
|
409
|
+
const linesBelow = layoutLines.length - (this.scrollOffset + visibleLines.length);
|
|
410
|
+
if (linesBelow > 0) {
|
|
411
|
+
const indicator = `─── ↓ ${linesBelow} more `;
|
|
412
|
+
const remaining = width - visibleWidth(indicator);
|
|
413
|
+
result.push(this.borderColor(indicator + "─".repeat(Math.max(0, remaining))));
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
result.push(horizontal.repeat(width));
|
|
417
|
+
}
|
|
418
|
+
// Add autocomplete list if active
|
|
419
|
+
if (this.autocompleteState && this.autocompleteList) {
|
|
420
|
+
const autocompleteResult = this.autocompleteList.render(contentWidth);
|
|
421
|
+
for (const line of autocompleteResult) {
|
|
422
|
+
const lineWidth = visibleWidth(line);
|
|
423
|
+
const linePadding = " ".repeat(Math.max(0, contentWidth - lineWidth));
|
|
424
|
+
result.push(`${leftPadding}${line}${linePadding}${rightPadding}`);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return result;
|
|
428
|
+
}
|
|
429
|
+
handleInput(data) {
|
|
430
|
+
const kb = getKeybindings();
|
|
431
|
+
// Handle character jump mode (awaiting next character to jump to)
|
|
432
|
+
if (this.jumpMode !== null) {
|
|
433
|
+
// Cancel if the hotkey is pressed again
|
|
434
|
+
if (kb.matches(data, "tui.editor.jumpForward") || kb.matches(data, "tui.editor.jumpBackward")) {
|
|
435
|
+
this.jumpMode = null;
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
const printable = decodePrintableKey(data) ?? (data.charCodeAt(0) >= 32 ? data : undefined);
|
|
439
|
+
if (printable !== undefined) {
|
|
440
|
+
// Printable character - perform the jump
|
|
441
|
+
const direction = this.jumpMode;
|
|
442
|
+
this.jumpMode = null;
|
|
443
|
+
this.jumpToChar(printable, direction);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
// Control character - cancel and fall through to normal handling
|
|
447
|
+
this.jumpMode = null;
|
|
448
|
+
}
|
|
449
|
+
// Handle bracketed paste mode
|
|
450
|
+
if (data.includes("\x1b[200~")) {
|
|
451
|
+
this.isInPaste = true;
|
|
452
|
+
this.pasteBuffer = "";
|
|
453
|
+
data = data.replace("\x1b[200~", "");
|
|
454
|
+
}
|
|
455
|
+
if (this.isInPaste) {
|
|
456
|
+
this.pasteBuffer += data;
|
|
457
|
+
const endIndex = this.pasteBuffer.indexOf("\x1b[201~");
|
|
458
|
+
if (endIndex !== -1) {
|
|
459
|
+
const pasteContent = this.pasteBuffer.substring(0, endIndex);
|
|
460
|
+
if (pasteContent.length > 0) {
|
|
461
|
+
this.handlePaste(pasteContent);
|
|
462
|
+
}
|
|
463
|
+
this.isInPaste = false;
|
|
464
|
+
const remaining = this.pasteBuffer.substring(endIndex + 6);
|
|
465
|
+
this.pasteBuffer = "";
|
|
466
|
+
if (remaining.length > 0) {
|
|
467
|
+
this.handleInput(remaining);
|
|
468
|
+
}
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
// Ctrl+C - let parent handle (exit/clear)
|
|
474
|
+
if (kb.matches(data, "tui.input.copy")) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
// Undo
|
|
478
|
+
if (kb.matches(data, "tui.editor.undo")) {
|
|
479
|
+
this.undo();
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
// Handle autocomplete mode
|
|
483
|
+
if (this.autocompleteState && this.autocompleteList) {
|
|
484
|
+
if (kb.matches(data, "tui.select.cancel")) {
|
|
485
|
+
this.cancelAutocomplete();
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
if (kb.matches(data, "tui.select.up") || kb.matches(data, "tui.select.down")) {
|
|
489
|
+
this.autocompleteList.handleInput(data);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
if (kb.matches(data, "tui.input.tab")) {
|
|
493
|
+
const selected = this.autocompleteList.getSelectedItem();
|
|
494
|
+
if (selected && this.autocompleteProvider) {
|
|
495
|
+
this.pushUndoSnapshot();
|
|
496
|
+
this.lastAction = null;
|
|
497
|
+
const result = this.autocompleteProvider.applyCompletion(this.state.lines, this.state.cursorLine, this.state.cursorCol, selected, this.autocompletePrefix);
|
|
498
|
+
this.state.lines = result.lines;
|
|
499
|
+
this.state.cursorLine = result.cursorLine;
|
|
500
|
+
this.setCursorCol(result.cursorCol);
|
|
501
|
+
this.cancelAutocomplete();
|
|
502
|
+
if (this.onChange)
|
|
503
|
+
this.onChange(this.getText());
|
|
504
|
+
}
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
if (kb.matches(data, "tui.select.confirm")) {
|
|
508
|
+
const selected = this.autocompleteList.getSelectedItem();
|
|
509
|
+
if (selected && this.autocompleteProvider) {
|
|
510
|
+
this.pushUndoSnapshot();
|
|
511
|
+
this.lastAction = null;
|
|
512
|
+
const result = this.autocompleteProvider.applyCompletion(this.state.lines, this.state.cursorLine, this.state.cursorCol, selected, this.autocompletePrefix);
|
|
513
|
+
this.state.lines = result.lines;
|
|
514
|
+
this.state.cursorLine = result.cursorLine;
|
|
515
|
+
this.setCursorCol(result.cursorCol);
|
|
516
|
+
if (this.autocompletePrefix.startsWith("/")) {
|
|
517
|
+
this.cancelAutocomplete();
|
|
518
|
+
// Fall through to submit
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
this.cancelAutocomplete();
|
|
522
|
+
if (this.onChange)
|
|
523
|
+
this.onChange(this.getText());
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
// Tab - trigger completion
|
|
530
|
+
if (kb.matches(data, "tui.input.tab") && !this.autocompleteState) {
|
|
531
|
+
this.handleTabCompletion();
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
// Deletion actions
|
|
535
|
+
if (kb.matches(data, "tui.editor.deleteToLineEnd")) {
|
|
536
|
+
this.deleteToEndOfLine();
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
if (kb.matches(data, "tui.editor.deleteToLineStart")) {
|
|
540
|
+
this.deleteToStartOfLine();
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
if (kb.matches(data, "tui.editor.deleteWordBackward")) {
|
|
544
|
+
this.deleteWordBackwards();
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
if (kb.matches(data, "tui.editor.deleteWordForward")) {
|
|
548
|
+
this.deleteWordForward();
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
if (kb.matches(data, "tui.editor.deleteCharBackward") || matchesKey(data, "shift+backspace")) {
|
|
552
|
+
this.handleBackspace();
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
if (kb.matches(data, "tui.editor.deleteCharForward") || matchesKey(data, "shift+delete")) {
|
|
556
|
+
this.handleForwardDelete();
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
// Kill ring actions
|
|
560
|
+
if (kb.matches(data, "tui.editor.yank")) {
|
|
561
|
+
this.yank();
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
if (kb.matches(data, "tui.editor.yankPop")) {
|
|
565
|
+
this.yankPop();
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
// Cursor movement actions
|
|
569
|
+
if (kb.matches(data, "tui.editor.cursorLineStart")) {
|
|
570
|
+
this.moveToLineStart();
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
if (kb.matches(data, "tui.editor.cursorLineEnd")) {
|
|
574
|
+
this.moveToLineEnd();
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
if (kb.matches(data, "tui.editor.cursorWordLeft")) {
|
|
578
|
+
this.moveWordBackwards();
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
if (kb.matches(data, "tui.editor.cursorWordRight")) {
|
|
582
|
+
this.moveWordForwards();
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
// New line
|
|
586
|
+
if (kb.matches(data, "tui.input.newLine") ||
|
|
587
|
+
(data.charCodeAt(0) === 10 && data.length > 1) ||
|
|
588
|
+
data === "\x1b\r" ||
|
|
589
|
+
data === "\x1b[13;2~" ||
|
|
590
|
+
(data.length > 1 && data.includes("\x1b") && data.includes("\r")) ||
|
|
591
|
+
(data === "\n" && data.length === 1)) {
|
|
592
|
+
if (this.shouldSubmitOnBackslashEnter(data, kb)) {
|
|
593
|
+
this.handleBackspace();
|
|
594
|
+
this.submitValue();
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
this.addNewLine();
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
// Submit (Enter)
|
|
601
|
+
if (kb.matches(data, "tui.input.submit")) {
|
|
602
|
+
if (this.disableSubmit)
|
|
603
|
+
return;
|
|
604
|
+
// Workaround for terminals without Shift+Enter support:
|
|
605
|
+
// If char before cursor is \, delete it and insert newline instead of submitting.
|
|
606
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
607
|
+
if (this.state.cursorCol > 0 && currentLine[this.state.cursorCol - 1] === "\\") {
|
|
608
|
+
this.handleBackspace();
|
|
609
|
+
this.addNewLine();
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
this.submitValue();
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
// Arrow key navigation (with history support)
|
|
616
|
+
if (kb.matches(data, "tui.editor.cursorUp")) {
|
|
617
|
+
if (this.isEditorEmpty()) {
|
|
618
|
+
this.navigateHistory(-1);
|
|
619
|
+
}
|
|
620
|
+
else if (this.historyIndex > -1 && this.isOnFirstVisualLine()) {
|
|
621
|
+
this.navigateHistory(-1);
|
|
622
|
+
}
|
|
623
|
+
else if (this.isOnFirstVisualLine()) {
|
|
624
|
+
// Already at top - jump to start of line
|
|
625
|
+
this.moveToLineStart();
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
this.moveCursor(-1, 0);
|
|
629
|
+
}
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
if (kb.matches(data, "tui.editor.cursorDown")) {
|
|
633
|
+
if (this.historyIndex > -1 && this.isOnLastVisualLine()) {
|
|
634
|
+
this.navigateHistory(1);
|
|
635
|
+
}
|
|
636
|
+
else if (this.isOnLastVisualLine()) {
|
|
637
|
+
// Already at bottom - jump to end of line
|
|
638
|
+
this.moveToLineEnd();
|
|
639
|
+
}
|
|
640
|
+
else {
|
|
641
|
+
this.moveCursor(1, 0);
|
|
642
|
+
}
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
if (kb.matches(data, "tui.editor.cursorRight")) {
|
|
646
|
+
this.moveCursor(0, 1);
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
if (kb.matches(data, "tui.editor.cursorLeft")) {
|
|
650
|
+
this.moveCursor(0, -1);
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
// Page up/down - scroll by page and move cursor
|
|
654
|
+
if (kb.matches(data, "tui.editor.pageUp")) {
|
|
655
|
+
this.pageScroll(-1);
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
if (kb.matches(data, "tui.editor.pageDown")) {
|
|
659
|
+
this.pageScroll(1);
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
// Character jump mode triggers
|
|
663
|
+
if (kb.matches(data, "tui.editor.jumpForward")) {
|
|
664
|
+
this.jumpMode = "forward";
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
if (kb.matches(data, "tui.editor.jumpBackward")) {
|
|
668
|
+
this.jumpMode = "backward";
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
// Shift+Space - insert regular space
|
|
672
|
+
if (matchesKey(data, "shift+space")) {
|
|
673
|
+
this.insertCharacter(" ");
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const printable = decodePrintableKey(data);
|
|
677
|
+
if (printable !== undefined) {
|
|
678
|
+
this.insertCharacter(printable);
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
// Regular characters
|
|
682
|
+
if (data.charCodeAt(0) >= 32) {
|
|
683
|
+
this.insertCharacter(data);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
layoutText(contentWidth) {
|
|
687
|
+
const layoutLines = [];
|
|
688
|
+
if (this.state.lines.length === 0 || (this.state.lines.length === 1 && this.state.lines[0] === "")) {
|
|
689
|
+
// Empty editor
|
|
690
|
+
layoutLines.push({
|
|
691
|
+
text: "",
|
|
692
|
+
hasCursor: true,
|
|
693
|
+
cursorPos: 0,
|
|
694
|
+
});
|
|
695
|
+
return layoutLines;
|
|
696
|
+
}
|
|
697
|
+
// Process each logical line
|
|
698
|
+
for (let i = 0; i < this.state.lines.length; i++) {
|
|
699
|
+
const line = this.state.lines[i] || "";
|
|
700
|
+
const isCurrentLine = i === this.state.cursorLine;
|
|
701
|
+
const lineVisibleWidth = visibleWidth(line);
|
|
702
|
+
if (lineVisibleWidth <= contentWidth) {
|
|
703
|
+
// Line fits in one layout line
|
|
704
|
+
if (isCurrentLine) {
|
|
705
|
+
layoutLines.push({
|
|
706
|
+
text: line,
|
|
707
|
+
hasCursor: true,
|
|
708
|
+
cursorPos: this.state.cursorCol,
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
layoutLines.push({
|
|
713
|
+
text: line,
|
|
714
|
+
hasCursor: false,
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
// Line needs wrapping - use word-aware wrapping
|
|
720
|
+
const chunks = wordWrapLine(line, contentWidth, [...this.segment(line)]);
|
|
721
|
+
for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) {
|
|
722
|
+
const chunk = chunks[chunkIndex];
|
|
723
|
+
if (!chunk)
|
|
724
|
+
continue;
|
|
725
|
+
const cursorPos = this.state.cursorCol;
|
|
726
|
+
const isLastChunk = chunkIndex === chunks.length - 1;
|
|
727
|
+
// Determine if cursor is in this chunk
|
|
728
|
+
// For word-wrapped chunks, we need to handle the case where
|
|
729
|
+
// cursor might be in trimmed whitespace at end of chunk
|
|
730
|
+
let hasCursorInChunk = false;
|
|
731
|
+
let adjustedCursorPos = 0;
|
|
732
|
+
if (isCurrentLine) {
|
|
733
|
+
if (isLastChunk) {
|
|
734
|
+
// Last chunk: cursor belongs here if >= startIndex
|
|
735
|
+
hasCursorInChunk = cursorPos >= chunk.startIndex;
|
|
736
|
+
adjustedCursorPos = cursorPos - chunk.startIndex;
|
|
737
|
+
}
|
|
738
|
+
else {
|
|
739
|
+
// Non-last chunk: cursor belongs here if in range [startIndex, endIndex)
|
|
740
|
+
// But we need to handle the visual position in the trimmed text
|
|
741
|
+
hasCursorInChunk = cursorPos >= chunk.startIndex && cursorPos < chunk.endIndex;
|
|
742
|
+
if (hasCursorInChunk) {
|
|
743
|
+
adjustedCursorPos = cursorPos - chunk.startIndex;
|
|
744
|
+
// Clamp to text length (in case cursor was in trimmed whitespace)
|
|
745
|
+
if (adjustedCursorPos > chunk.text.length) {
|
|
746
|
+
adjustedCursorPos = chunk.text.length;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
if (hasCursorInChunk) {
|
|
752
|
+
layoutLines.push({
|
|
753
|
+
text: chunk.text,
|
|
754
|
+
hasCursor: true,
|
|
755
|
+
cursorPos: adjustedCursorPos,
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
else {
|
|
759
|
+
layoutLines.push({
|
|
760
|
+
text: chunk.text,
|
|
761
|
+
hasCursor: false,
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
return layoutLines;
|
|
768
|
+
}
|
|
769
|
+
getText() {
|
|
770
|
+
return this.state.lines.join("\n");
|
|
771
|
+
}
|
|
772
|
+
expandPasteMarkers(text) {
|
|
773
|
+
let result = text;
|
|
774
|
+
for (const [pasteId, pasteContent] of this.pastes) {
|
|
775
|
+
const markerRegex = new RegExp(`\\[paste #${pasteId}( (\\+\\d+ lines|\\d+ chars))?\\]`, "g");
|
|
776
|
+
result = result.replace(markerRegex, () => pasteContent);
|
|
777
|
+
}
|
|
778
|
+
return result;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Get text with paste markers expanded to their actual content.
|
|
782
|
+
* Use this when you need the full content (e.g., for external editor).
|
|
783
|
+
*/
|
|
784
|
+
getExpandedText() {
|
|
785
|
+
return this.expandPasteMarkers(this.state.lines.join("\n"));
|
|
786
|
+
}
|
|
787
|
+
getLines() {
|
|
788
|
+
return [...this.state.lines];
|
|
789
|
+
}
|
|
790
|
+
getCursor() {
|
|
791
|
+
return { line: this.state.cursorLine, col: this.state.cursorCol };
|
|
792
|
+
}
|
|
793
|
+
setText(text) {
|
|
794
|
+
this.cancelAutocomplete();
|
|
795
|
+
this.lastAction = null;
|
|
796
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
797
|
+
const normalized = this.normalizeText(text);
|
|
798
|
+
// Push undo snapshot if content differs (makes programmatic changes undoable)
|
|
799
|
+
if (this.getText() !== normalized) {
|
|
800
|
+
this.pushUndoSnapshot();
|
|
801
|
+
}
|
|
802
|
+
this.setTextInternal(normalized);
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Insert text at the current cursor position.
|
|
806
|
+
* Used for programmatic insertion (e.g., clipboard image markers).
|
|
807
|
+
* This is atomic for undo - single undo restores entire pre-insert state.
|
|
808
|
+
*/
|
|
809
|
+
insertTextAtCursor(text) {
|
|
810
|
+
if (!text)
|
|
811
|
+
return;
|
|
812
|
+
this.cancelAutocomplete();
|
|
813
|
+
this.pushUndoSnapshot();
|
|
814
|
+
this.lastAction = null;
|
|
815
|
+
this.historyIndex = -1;
|
|
816
|
+
this.insertTextAtCursorInternal(text);
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Normalize text for editor storage:
|
|
820
|
+
* - Normalize line endings (\r\n and \r -> \n)
|
|
821
|
+
* - Expand tabs to 4 spaces
|
|
822
|
+
*/
|
|
823
|
+
normalizeText(text) {
|
|
824
|
+
return text.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\t/g, " ");
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Internal text insertion at cursor. Handles single and multi-line text.
|
|
828
|
+
* Does not push undo snapshots or trigger autocomplete - caller is responsible.
|
|
829
|
+
* Normalizes line endings and calls onChange once at the end.
|
|
830
|
+
*/
|
|
831
|
+
insertTextAtCursorInternal(text) {
|
|
832
|
+
if (!text)
|
|
833
|
+
return;
|
|
834
|
+
// Normalize line endings and tabs
|
|
835
|
+
const normalized = this.normalizeText(text);
|
|
836
|
+
const insertedLines = normalized.split("\n");
|
|
837
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
838
|
+
const beforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
839
|
+
const afterCursor = currentLine.slice(this.state.cursorCol);
|
|
840
|
+
if (insertedLines.length === 1) {
|
|
841
|
+
// Single line - insert at cursor position
|
|
842
|
+
this.state.lines[this.state.cursorLine] = beforeCursor + normalized + afterCursor;
|
|
843
|
+
this.setCursorCol(this.state.cursorCol + normalized.length);
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
// Multi-line insertion
|
|
847
|
+
this.state.lines = [
|
|
848
|
+
// All lines before current line
|
|
849
|
+
...this.state.lines.slice(0, this.state.cursorLine),
|
|
850
|
+
// The first inserted line merged with text before cursor
|
|
851
|
+
beforeCursor + insertedLines[0],
|
|
852
|
+
// All middle inserted lines
|
|
853
|
+
...insertedLines.slice(1, -1),
|
|
854
|
+
// The last inserted line with text after cursor
|
|
855
|
+
insertedLines[insertedLines.length - 1] + afterCursor,
|
|
856
|
+
// All lines after current line
|
|
857
|
+
...this.state.lines.slice(this.state.cursorLine + 1),
|
|
858
|
+
];
|
|
859
|
+
this.state.cursorLine += insertedLines.length - 1;
|
|
860
|
+
this.setCursorCol((insertedLines[insertedLines.length - 1] || "").length);
|
|
861
|
+
}
|
|
862
|
+
if (this.onChange) {
|
|
863
|
+
this.onChange(this.getText());
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
// All the editor methods from before...
|
|
867
|
+
insertCharacter(char, skipUndoCoalescing) {
|
|
868
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
869
|
+
// Undo coalescing (fish-style):
|
|
870
|
+
// - Consecutive word chars coalesce into one undo unit
|
|
871
|
+
// - Space captures state before itself (so undo removes space+following word together)
|
|
872
|
+
// - Each space is separately undoable
|
|
873
|
+
// Skip coalescing when called from atomic operations (e.g., handlePaste)
|
|
874
|
+
if (!skipUndoCoalescing) {
|
|
875
|
+
if (isWhitespaceChar(char) || this.lastAction !== "type-word") {
|
|
876
|
+
this.pushUndoSnapshot();
|
|
877
|
+
}
|
|
878
|
+
this.lastAction = "type-word";
|
|
879
|
+
}
|
|
880
|
+
const line = this.state.lines[this.state.cursorLine] || "";
|
|
881
|
+
const before = line.slice(0, this.state.cursorCol);
|
|
882
|
+
const after = line.slice(this.state.cursorCol);
|
|
883
|
+
this.state.lines[this.state.cursorLine] = before + char + after;
|
|
884
|
+
this.setCursorCol(this.state.cursorCol + char.length);
|
|
885
|
+
if (this.onChange) {
|
|
886
|
+
this.onChange(this.getText());
|
|
887
|
+
}
|
|
888
|
+
// Check if we should trigger or update autocomplete
|
|
889
|
+
if (!this.autocompleteState) {
|
|
890
|
+
// Auto-trigger for "/" at the start of a line (slash commands)
|
|
891
|
+
if (char === "/" && this.isAtStartOfMessage()) {
|
|
892
|
+
this.tryTriggerAutocomplete();
|
|
893
|
+
}
|
|
894
|
+
// Auto-trigger for symbol-based completion like @ or # at token boundaries
|
|
895
|
+
else if (char === "@" || char === "#") {
|
|
896
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
897
|
+
const textBeforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
898
|
+
const charBeforeSymbol = textBeforeCursor[textBeforeCursor.length - 2];
|
|
899
|
+
if (textBeforeCursor.length === 1 || charBeforeSymbol === " " || charBeforeSymbol === "\t") {
|
|
900
|
+
this.tryTriggerAutocomplete();
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
// Also auto-trigger when typing letters in a slash command or symbol completion context
|
|
904
|
+
else if (/[a-zA-Z0-9.\-_]/.test(char)) {
|
|
905
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
906
|
+
const textBeforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
907
|
+
// Check if we're in a slash command (with or without space for arguments)
|
|
908
|
+
if (this.isInSlashCommandContext(textBeforeCursor)) {
|
|
909
|
+
this.tryTriggerAutocomplete();
|
|
910
|
+
}
|
|
911
|
+
// Check if we're in a symbol-based completion context like @ or #
|
|
912
|
+
else if (textBeforeCursor.match(/(?:^|[\s])[@#][^\s]*$/)) {
|
|
913
|
+
this.tryTriggerAutocomplete();
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
else {
|
|
918
|
+
this.updateAutocomplete();
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
handlePaste(pastedText) {
|
|
922
|
+
this.cancelAutocomplete();
|
|
923
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
924
|
+
this.lastAction = null;
|
|
925
|
+
this.pushUndoSnapshot();
|
|
926
|
+
// Some terminals (e.g. tmux popups with extended-keys-format=csi-u) re-encode
|
|
927
|
+
// control bytes inside bracketed paste as CSI-u Ctrl+<letter> sequences
|
|
928
|
+
// (ESC [ <codepoint> ; 5 u). Decode those back to their literal byte so the
|
|
929
|
+
// per-char filter below preserves newlines instead of stripping ESC and
|
|
930
|
+
// leaking the printable tail (e.g. "[106;5u") into the editor.
|
|
931
|
+
const decodedText = pastedText.replace(/\x1b\[(\d+);5u/g, (match, code) => {
|
|
932
|
+
const cp = Number(code);
|
|
933
|
+
if (cp >= 97 && cp <= 122)
|
|
934
|
+
return String.fromCharCode(cp - 96);
|
|
935
|
+
if (cp >= 65 && cp <= 90)
|
|
936
|
+
return String.fromCharCode(cp - 64);
|
|
937
|
+
return match;
|
|
938
|
+
});
|
|
939
|
+
// Clean the pasted text: normalize line endings, expand tabs
|
|
940
|
+
const cleanText = this.normalizeText(decodedText);
|
|
941
|
+
// Filter out non-printable characters except newlines
|
|
942
|
+
let filteredText = cleanText
|
|
943
|
+
.split("")
|
|
944
|
+
.filter((char) => char === "\n" || char.charCodeAt(0) >= 32)
|
|
945
|
+
.join("");
|
|
946
|
+
// If pasting a file path (starts with /, ~, or .) and the character before
|
|
947
|
+
// the cursor is a word character, prepend a space for better readability
|
|
948
|
+
if (/^[/~.]/.test(filteredText)) {
|
|
949
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
950
|
+
const charBeforeCursor = this.state.cursorCol > 0 ? currentLine[this.state.cursorCol - 1] : "";
|
|
951
|
+
if (charBeforeCursor && /\w/.test(charBeforeCursor)) {
|
|
952
|
+
filteredText = ` ${filteredText}`;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
// Split into lines to check for large paste
|
|
956
|
+
const pastedLines = filteredText.split("\n");
|
|
957
|
+
// Check if this is a large paste (> 10 lines or > 1000 characters)
|
|
958
|
+
const totalChars = filteredText.length;
|
|
959
|
+
if (pastedLines.length > 10 || totalChars > 1000) {
|
|
960
|
+
// Store the paste and insert a marker
|
|
961
|
+
this.pasteCounter++;
|
|
962
|
+
const pasteId = this.pasteCounter;
|
|
963
|
+
this.pastes.set(pasteId, filteredText);
|
|
964
|
+
// Insert marker like "[paste #1 +123 lines]" or "[paste #1 1234 chars]"
|
|
965
|
+
const marker = pastedLines.length > 10
|
|
966
|
+
? `[paste #${pasteId} +${pastedLines.length} lines]`
|
|
967
|
+
: `[paste #${pasteId} ${totalChars} chars]`;
|
|
968
|
+
this.insertTextAtCursorInternal(marker);
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
if (pastedLines.length === 1) {
|
|
972
|
+
// Single line - insert atomically (do not trigger autocomplete during paste)
|
|
973
|
+
this.insertTextAtCursorInternal(filteredText);
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
// Multi-line paste - use direct state manipulation
|
|
977
|
+
this.insertTextAtCursorInternal(filteredText);
|
|
978
|
+
}
|
|
979
|
+
addNewLine() {
|
|
980
|
+
this.cancelAutocomplete();
|
|
981
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
982
|
+
this.lastAction = null;
|
|
983
|
+
this.pushUndoSnapshot();
|
|
984
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
985
|
+
const before = currentLine.slice(0, this.state.cursorCol);
|
|
986
|
+
const after = currentLine.slice(this.state.cursorCol);
|
|
987
|
+
// Split current line
|
|
988
|
+
this.state.lines[this.state.cursorLine] = before;
|
|
989
|
+
this.state.lines.splice(this.state.cursorLine + 1, 0, after);
|
|
990
|
+
// Move cursor to start of new line
|
|
991
|
+
this.state.cursorLine++;
|
|
992
|
+
this.setCursorCol(0);
|
|
993
|
+
if (this.onChange) {
|
|
994
|
+
this.onChange(this.getText());
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
shouldSubmitOnBackslashEnter(data, kb) {
|
|
998
|
+
if (this.disableSubmit)
|
|
999
|
+
return false;
|
|
1000
|
+
if (!matchesKey(data, "enter"))
|
|
1001
|
+
return false;
|
|
1002
|
+
const submitKeys = kb.getKeys("tui.input.submit");
|
|
1003
|
+
const hasShiftEnter = submitKeys.includes("shift+enter") || submitKeys.includes("shift+return");
|
|
1004
|
+
if (!hasShiftEnter)
|
|
1005
|
+
return false;
|
|
1006
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1007
|
+
return this.state.cursorCol > 0 && currentLine[this.state.cursorCol - 1] === "\\";
|
|
1008
|
+
}
|
|
1009
|
+
submitValue() {
|
|
1010
|
+
this.cancelAutocomplete();
|
|
1011
|
+
const result = this.expandPasteMarkers(this.state.lines.join("\n")).trim();
|
|
1012
|
+
this.state = { lines: [""], cursorLine: 0, cursorCol: 0 };
|
|
1013
|
+
this.pastes.clear();
|
|
1014
|
+
this.pasteCounter = 0;
|
|
1015
|
+
this.historyIndex = -1;
|
|
1016
|
+
this.scrollOffset = 0;
|
|
1017
|
+
this.undoStack.clear();
|
|
1018
|
+
this.lastAction = null;
|
|
1019
|
+
if (this.onChange)
|
|
1020
|
+
this.onChange("");
|
|
1021
|
+
if (this.onSubmit)
|
|
1022
|
+
this.onSubmit(result);
|
|
1023
|
+
}
|
|
1024
|
+
handleBackspace() {
|
|
1025
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
1026
|
+
this.lastAction = null;
|
|
1027
|
+
if (this.state.cursorCol > 0) {
|
|
1028
|
+
this.pushUndoSnapshot();
|
|
1029
|
+
// Delete grapheme before cursor (handles emojis, combining characters, etc.)
|
|
1030
|
+
const line = this.state.lines[this.state.cursorLine] || "";
|
|
1031
|
+
const beforeCursor = line.slice(0, this.state.cursorCol);
|
|
1032
|
+
// Find the last grapheme in the text before cursor
|
|
1033
|
+
const graphemes = [...this.segment(beforeCursor)];
|
|
1034
|
+
const lastGrapheme = graphemes[graphemes.length - 1];
|
|
1035
|
+
const graphemeLength = lastGrapheme ? lastGrapheme.segment.length : 1;
|
|
1036
|
+
const before = line.slice(0, this.state.cursorCol - graphemeLength);
|
|
1037
|
+
const after = line.slice(this.state.cursorCol);
|
|
1038
|
+
this.state.lines[this.state.cursorLine] = before + after;
|
|
1039
|
+
this.setCursorCol(this.state.cursorCol - graphemeLength);
|
|
1040
|
+
}
|
|
1041
|
+
else if (this.state.cursorLine > 0) {
|
|
1042
|
+
this.pushUndoSnapshot();
|
|
1043
|
+
// Merge with previous line
|
|
1044
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1045
|
+
const previousLine = this.state.lines[this.state.cursorLine - 1] || "";
|
|
1046
|
+
this.state.lines[this.state.cursorLine - 1] = previousLine + currentLine;
|
|
1047
|
+
this.state.lines.splice(this.state.cursorLine, 1);
|
|
1048
|
+
this.state.cursorLine--;
|
|
1049
|
+
this.setCursorCol(previousLine.length);
|
|
1050
|
+
}
|
|
1051
|
+
if (this.onChange) {
|
|
1052
|
+
this.onChange(this.getText());
|
|
1053
|
+
}
|
|
1054
|
+
// Update or re-trigger autocomplete after backspace
|
|
1055
|
+
if (this.autocompleteState) {
|
|
1056
|
+
this.updateAutocomplete();
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
// If autocomplete was cancelled (no matches), re-trigger if we're in a completable context
|
|
1060
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1061
|
+
const textBeforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
1062
|
+
// Slash command context
|
|
1063
|
+
if (this.isInSlashCommandContext(textBeforeCursor)) {
|
|
1064
|
+
this.tryTriggerAutocomplete();
|
|
1065
|
+
}
|
|
1066
|
+
// Symbol-based completion context like @ or #
|
|
1067
|
+
else if (textBeforeCursor.match(/(?:^|[\s])[@#][^\s]*$/)) {
|
|
1068
|
+
this.tryTriggerAutocomplete();
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Set cursor column and clear preferredVisualCol.
|
|
1074
|
+
* Use this for all non-vertical cursor movements to reset sticky column behavior.
|
|
1075
|
+
*/
|
|
1076
|
+
setCursorCol(col) {
|
|
1077
|
+
this.state.cursorCol = col;
|
|
1078
|
+
this.preferredVisualCol = null;
|
|
1079
|
+
this.snappedFromCursorCol = null;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Move cursor to a target visual line, applying sticky column logic.
|
|
1083
|
+
* Shared by moveCursor() and pageScroll().
|
|
1084
|
+
*/
|
|
1085
|
+
moveToVisualLine(visualLines, currentVisualLine, targetVisualLine) {
|
|
1086
|
+
const currentVL = visualLines[currentVisualLine];
|
|
1087
|
+
const targetVL = visualLines[targetVisualLine];
|
|
1088
|
+
if (!(currentVL && targetVL))
|
|
1089
|
+
return;
|
|
1090
|
+
// When the cursor was snapped to a segment start, resolve the pre-snap
|
|
1091
|
+
// position against the VL it belongs to. This gives the correct visual
|
|
1092
|
+
// column even after a resize reshuffles VLs.
|
|
1093
|
+
let currentVisualCol;
|
|
1094
|
+
if (this.snappedFromCursorCol !== null) {
|
|
1095
|
+
const vlIndex = this.findVisualLineAt(visualLines, currentVL.logicalLine, this.snappedFromCursorCol);
|
|
1096
|
+
currentVisualCol = this.snappedFromCursorCol - visualLines[vlIndex].startCol;
|
|
1097
|
+
}
|
|
1098
|
+
else {
|
|
1099
|
+
currentVisualCol = this.state.cursorCol - currentVL.startCol;
|
|
1100
|
+
}
|
|
1101
|
+
// For non-last segments, clamp to length-1 to stay within the segment
|
|
1102
|
+
const isLastSourceSegment = currentVisualLine === visualLines.length - 1 ||
|
|
1103
|
+
visualLines[currentVisualLine + 1]?.logicalLine !== currentVL.logicalLine;
|
|
1104
|
+
const sourceMaxVisualCol = isLastSourceSegment ? currentVL.length : Math.max(0, currentVL.length - 1);
|
|
1105
|
+
const isLastTargetSegment = targetVisualLine === visualLines.length - 1 ||
|
|
1106
|
+
visualLines[targetVisualLine + 1]?.logicalLine !== targetVL.logicalLine;
|
|
1107
|
+
const targetMaxVisualCol = isLastTargetSegment ? targetVL.length : Math.max(0, targetVL.length - 1);
|
|
1108
|
+
const moveToVisualCol = this.computeVerticalMoveColumn(currentVisualCol, sourceMaxVisualCol, targetMaxVisualCol);
|
|
1109
|
+
// Set cursor position
|
|
1110
|
+
this.state.cursorLine = targetVL.logicalLine;
|
|
1111
|
+
const targetCol = targetVL.startCol + moveToVisualCol;
|
|
1112
|
+
const logicalLine = this.state.lines[targetVL.logicalLine] || "";
|
|
1113
|
+
this.state.cursorCol = Math.min(targetCol, logicalLine.length);
|
|
1114
|
+
// Snap cursor to atomic segment boundary (e.g. paste markers)
|
|
1115
|
+
// so the cursor never lands in the middle of a multi-grapheme unit.
|
|
1116
|
+
// Single-grapheme segments don't need snapping.
|
|
1117
|
+
const segments = [...this.segment(logicalLine)];
|
|
1118
|
+
for (const seg of segments) {
|
|
1119
|
+
if (seg.index > this.state.cursorCol)
|
|
1120
|
+
break;
|
|
1121
|
+
if (seg.segment.length <= 1)
|
|
1122
|
+
continue;
|
|
1123
|
+
if (this.state.cursorCol < seg.index + seg.segment.length) {
|
|
1124
|
+
const isContinuation = seg.index < targetVL.startCol;
|
|
1125
|
+
const isMovingDown = targetVisualLine > currentVisualLine;
|
|
1126
|
+
if (isContinuation && isMovingDown) {
|
|
1127
|
+
// The segment started on a previous visual line, and we
|
|
1128
|
+
// already visited it on the way down. Skip all remaining
|
|
1129
|
+
// continuation VLs and land on the first VL past it.
|
|
1130
|
+
const segEnd = seg.index + seg.segment.length;
|
|
1131
|
+
let next = targetVisualLine + 1;
|
|
1132
|
+
while (next < visualLines.length &&
|
|
1133
|
+
visualLines[next].logicalLine === targetVL.logicalLine &&
|
|
1134
|
+
visualLines[next].startCol < segEnd) {
|
|
1135
|
+
next++;
|
|
1136
|
+
}
|
|
1137
|
+
if (next < visualLines.length) {
|
|
1138
|
+
this.moveToVisualLine(visualLines, currentVisualLine, next);
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
// Snap to the start of the segment so it gets highlighted.
|
|
1143
|
+
// Store the pre-snap position so the next vertical move can
|
|
1144
|
+
// resolve it to the correct visual column.
|
|
1145
|
+
this.snappedFromCursorCol = this.state.cursorCol;
|
|
1146
|
+
this.state.cursorCol = seg.index;
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
// No snap occurred – we moved out of the atomic segment.
|
|
1151
|
+
this.snappedFromCursorCol = null;
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* Compute the target visual column for vertical cursor movement.
|
|
1155
|
+
* Implements the sticky column decision table:
|
|
1156
|
+
*
|
|
1157
|
+
* | P | S | T | U | Scenario | Set Preferred | Move To |
|
|
1158
|
+
* |---|---|---|---| ---------------------------------------------------- |---------------|-------------|
|
|
1159
|
+
* | 0 | * | 0 | - | Start nav, target fits | null | current |
|
|
1160
|
+
* | 0 | * | 1 | - | Start nav, target shorter | current | target end |
|
|
1161
|
+
* | 1 | 0 | 0 | 0 | Clamped, target fits preferred | null | preferred |
|
|
1162
|
+
* | 1 | 0 | 0 | 1 | Clamped, target longer but still can't fit preferred | keep | target end |
|
|
1163
|
+
* | 1 | 0 | 1 | - | Clamped, target even shorter | keep | target end |
|
|
1164
|
+
* | 1 | 1 | 0 | - | Rewrapped, target fits current | null | current |
|
|
1165
|
+
* | 1 | 1 | 1 | - | Rewrapped, target shorter than current | current | target end |
|
|
1166
|
+
*
|
|
1167
|
+
* Where:
|
|
1168
|
+
* - P = preferred col is set
|
|
1169
|
+
* - S = cursor in middle of source line (not clamped to end)
|
|
1170
|
+
* - T = target line shorter than current visual col
|
|
1171
|
+
* - U = target line shorter than preferred col
|
|
1172
|
+
*/
|
|
1173
|
+
computeVerticalMoveColumn(currentVisualCol, sourceMaxVisualCol, targetMaxVisualCol) {
|
|
1174
|
+
const hasPreferred = this.preferredVisualCol !== null; // P
|
|
1175
|
+
const cursorInMiddle = currentVisualCol < sourceMaxVisualCol; // S
|
|
1176
|
+
const targetTooShort = targetMaxVisualCol < currentVisualCol; // T
|
|
1177
|
+
if (!hasPreferred || cursorInMiddle) {
|
|
1178
|
+
if (targetTooShort) {
|
|
1179
|
+
// Cases 2 and 7
|
|
1180
|
+
this.preferredVisualCol = currentVisualCol;
|
|
1181
|
+
return targetMaxVisualCol;
|
|
1182
|
+
}
|
|
1183
|
+
// Cases 1 and 6
|
|
1184
|
+
this.preferredVisualCol = null;
|
|
1185
|
+
return currentVisualCol;
|
|
1186
|
+
}
|
|
1187
|
+
const targetCantFitPreferred = targetMaxVisualCol < this.preferredVisualCol; // U
|
|
1188
|
+
if (targetTooShort || targetCantFitPreferred) {
|
|
1189
|
+
// Cases 4 and 5
|
|
1190
|
+
return targetMaxVisualCol;
|
|
1191
|
+
}
|
|
1192
|
+
// Case 3
|
|
1193
|
+
const result = this.preferredVisualCol;
|
|
1194
|
+
this.preferredVisualCol = null;
|
|
1195
|
+
return result;
|
|
1196
|
+
}
|
|
1197
|
+
moveToLineStart() {
|
|
1198
|
+
this.lastAction = null;
|
|
1199
|
+
this.setCursorCol(0);
|
|
1200
|
+
}
|
|
1201
|
+
moveToLineEnd() {
|
|
1202
|
+
this.lastAction = null;
|
|
1203
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1204
|
+
this.setCursorCol(currentLine.length);
|
|
1205
|
+
}
|
|
1206
|
+
deleteToStartOfLine() {
|
|
1207
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
1208
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1209
|
+
if (this.state.cursorCol > 0) {
|
|
1210
|
+
this.pushUndoSnapshot();
|
|
1211
|
+
// Calculate text to be deleted and save to kill ring (backward deletion = prepend)
|
|
1212
|
+
const deletedText = currentLine.slice(0, this.state.cursorCol);
|
|
1213
|
+
this.killRing.push(deletedText, { prepend: true, accumulate: this.lastAction === "kill" });
|
|
1214
|
+
this.lastAction = "kill";
|
|
1215
|
+
// Delete from start of line up to cursor
|
|
1216
|
+
this.state.lines[this.state.cursorLine] = currentLine.slice(this.state.cursorCol);
|
|
1217
|
+
this.setCursorCol(0);
|
|
1218
|
+
}
|
|
1219
|
+
else if (this.state.cursorLine > 0) {
|
|
1220
|
+
this.pushUndoSnapshot();
|
|
1221
|
+
// At start of line - merge with previous line, treating newline as deleted text
|
|
1222
|
+
this.killRing.push("\n", { prepend: true, accumulate: this.lastAction === "kill" });
|
|
1223
|
+
this.lastAction = "kill";
|
|
1224
|
+
const previousLine = this.state.lines[this.state.cursorLine - 1] || "";
|
|
1225
|
+
this.state.lines[this.state.cursorLine - 1] = previousLine + currentLine;
|
|
1226
|
+
this.state.lines.splice(this.state.cursorLine, 1);
|
|
1227
|
+
this.state.cursorLine--;
|
|
1228
|
+
this.setCursorCol(previousLine.length);
|
|
1229
|
+
}
|
|
1230
|
+
if (this.onChange) {
|
|
1231
|
+
this.onChange(this.getText());
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
deleteToEndOfLine() {
|
|
1235
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
1236
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1237
|
+
if (this.state.cursorCol < currentLine.length) {
|
|
1238
|
+
this.pushUndoSnapshot();
|
|
1239
|
+
// Calculate text to be deleted and save to kill ring (forward deletion = append)
|
|
1240
|
+
const deletedText = currentLine.slice(this.state.cursorCol);
|
|
1241
|
+
this.killRing.push(deletedText, { prepend: false, accumulate: this.lastAction === "kill" });
|
|
1242
|
+
this.lastAction = "kill";
|
|
1243
|
+
// Delete from cursor to end of line
|
|
1244
|
+
this.state.lines[this.state.cursorLine] = currentLine.slice(0, this.state.cursorCol);
|
|
1245
|
+
}
|
|
1246
|
+
else if (this.state.cursorLine < this.state.lines.length - 1) {
|
|
1247
|
+
this.pushUndoSnapshot();
|
|
1248
|
+
// At end of line - merge with next line, treating newline as deleted text
|
|
1249
|
+
this.killRing.push("\n", { prepend: false, accumulate: this.lastAction === "kill" });
|
|
1250
|
+
this.lastAction = "kill";
|
|
1251
|
+
const nextLine = this.state.lines[this.state.cursorLine + 1] || "";
|
|
1252
|
+
this.state.lines[this.state.cursorLine] = currentLine + nextLine;
|
|
1253
|
+
this.state.lines.splice(this.state.cursorLine + 1, 1);
|
|
1254
|
+
}
|
|
1255
|
+
if (this.onChange) {
|
|
1256
|
+
this.onChange(this.getText());
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
deleteWordBackwards() {
|
|
1260
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
1261
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1262
|
+
// If at start of line, behave like backspace at column 0 (merge with previous line)
|
|
1263
|
+
if (this.state.cursorCol === 0) {
|
|
1264
|
+
if (this.state.cursorLine > 0) {
|
|
1265
|
+
this.pushUndoSnapshot();
|
|
1266
|
+
// Treat newline as deleted text (backward deletion = prepend)
|
|
1267
|
+
this.killRing.push("\n", { prepend: true, accumulate: this.lastAction === "kill" });
|
|
1268
|
+
this.lastAction = "kill";
|
|
1269
|
+
const previousLine = this.state.lines[this.state.cursorLine - 1] || "";
|
|
1270
|
+
this.state.lines[this.state.cursorLine - 1] = previousLine + currentLine;
|
|
1271
|
+
this.state.lines.splice(this.state.cursorLine, 1);
|
|
1272
|
+
this.state.cursorLine--;
|
|
1273
|
+
this.setCursorCol(previousLine.length);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
else {
|
|
1277
|
+
this.pushUndoSnapshot();
|
|
1278
|
+
// Save lastAction before cursor movement (moveWordBackwards resets it)
|
|
1279
|
+
const wasKill = this.lastAction === "kill";
|
|
1280
|
+
const oldCursorCol = this.state.cursorCol;
|
|
1281
|
+
this.moveWordBackwards();
|
|
1282
|
+
const deleteFrom = this.state.cursorCol;
|
|
1283
|
+
this.setCursorCol(oldCursorCol);
|
|
1284
|
+
const deletedText = currentLine.slice(deleteFrom, this.state.cursorCol);
|
|
1285
|
+
this.killRing.push(deletedText, { prepend: true, accumulate: wasKill });
|
|
1286
|
+
this.lastAction = "kill";
|
|
1287
|
+
this.state.lines[this.state.cursorLine] =
|
|
1288
|
+
currentLine.slice(0, deleteFrom) + currentLine.slice(this.state.cursorCol);
|
|
1289
|
+
this.setCursorCol(deleteFrom);
|
|
1290
|
+
}
|
|
1291
|
+
if (this.onChange) {
|
|
1292
|
+
this.onChange(this.getText());
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
deleteWordForward() {
|
|
1296
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
1297
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1298
|
+
// If at end of line, merge with next line (delete the newline)
|
|
1299
|
+
if (this.state.cursorCol >= currentLine.length) {
|
|
1300
|
+
if (this.state.cursorLine < this.state.lines.length - 1) {
|
|
1301
|
+
this.pushUndoSnapshot();
|
|
1302
|
+
// Treat newline as deleted text (forward deletion = append)
|
|
1303
|
+
this.killRing.push("\n", { prepend: false, accumulate: this.lastAction === "kill" });
|
|
1304
|
+
this.lastAction = "kill";
|
|
1305
|
+
const nextLine = this.state.lines[this.state.cursorLine + 1] || "";
|
|
1306
|
+
this.state.lines[this.state.cursorLine] = currentLine + nextLine;
|
|
1307
|
+
this.state.lines.splice(this.state.cursorLine + 1, 1);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
else {
|
|
1311
|
+
this.pushUndoSnapshot();
|
|
1312
|
+
// Save lastAction before cursor movement (moveWordForwards resets it)
|
|
1313
|
+
const wasKill = this.lastAction === "kill";
|
|
1314
|
+
const oldCursorCol = this.state.cursorCol;
|
|
1315
|
+
this.moveWordForwards();
|
|
1316
|
+
const deleteTo = this.state.cursorCol;
|
|
1317
|
+
this.setCursorCol(oldCursorCol);
|
|
1318
|
+
const deletedText = currentLine.slice(this.state.cursorCol, deleteTo);
|
|
1319
|
+
this.killRing.push(deletedText, { prepend: false, accumulate: wasKill });
|
|
1320
|
+
this.lastAction = "kill";
|
|
1321
|
+
this.state.lines[this.state.cursorLine] =
|
|
1322
|
+
currentLine.slice(0, this.state.cursorCol) + currentLine.slice(deleteTo);
|
|
1323
|
+
}
|
|
1324
|
+
if (this.onChange) {
|
|
1325
|
+
this.onChange(this.getText());
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
handleForwardDelete() {
|
|
1329
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
1330
|
+
this.lastAction = null;
|
|
1331
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1332
|
+
if (this.state.cursorCol < currentLine.length) {
|
|
1333
|
+
this.pushUndoSnapshot();
|
|
1334
|
+
// Delete grapheme at cursor position (handles emojis, combining characters, etc.)
|
|
1335
|
+
const afterCursor = currentLine.slice(this.state.cursorCol);
|
|
1336
|
+
// Find the first grapheme at cursor
|
|
1337
|
+
const graphemes = [...this.segment(afterCursor)];
|
|
1338
|
+
const firstGrapheme = graphemes[0];
|
|
1339
|
+
const graphemeLength = firstGrapheme ? firstGrapheme.segment.length : 1;
|
|
1340
|
+
const before = currentLine.slice(0, this.state.cursorCol);
|
|
1341
|
+
const after = currentLine.slice(this.state.cursorCol + graphemeLength);
|
|
1342
|
+
this.state.lines[this.state.cursorLine] = before + after;
|
|
1343
|
+
}
|
|
1344
|
+
else if (this.state.cursorLine < this.state.lines.length - 1) {
|
|
1345
|
+
this.pushUndoSnapshot();
|
|
1346
|
+
// At end of line - merge with next line
|
|
1347
|
+
const nextLine = this.state.lines[this.state.cursorLine + 1] || "";
|
|
1348
|
+
this.state.lines[this.state.cursorLine] = currentLine + nextLine;
|
|
1349
|
+
this.state.lines.splice(this.state.cursorLine + 1, 1);
|
|
1350
|
+
}
|
|
1351
|
+
if (this.onChange) {
|
|
1352
|
+
this.onChange(this.getText());
|
|
1353
|
+
}
|
|
1354
|
+
// Update or re-trigger autocomplete after forward delete
|
|
1355
|
+
if (this.autocompleteState) {
|
|
1356
|
+
this.updateAutocomplete();
|
|
1357
|
+
}
|
|
1358
|
+
else {
|
|
1359
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1360
|
+
const textBeforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
1361
|
+
// Slash command context
|
|
1362
|
+
if (this.isInSlashCommandContext(textBeforeCursor)) {
|
|
1363
|
+
this.tryTriggerAutocomplete();
|
|
1364
|
+
}
|
|
1365
|
+
// Symbol-based completion context like @ or #
|
|
1366
|
+
else if (textBeforeCursor.match(/(?:^|[\s])[@#][^\s]*$/)) {
|
|
1367
|
+
this.tryTriggerAutocomplete();
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
/**
|
|
1372
|
+
* Build a mapping from visual lines to logical positions.
|
|
1373
|
+
* Returns an array where each element represents a visual line with:
|
|
1374
|
+
* - logicalLine: index into this.state.lines
|
|
1375
|
+
* - startCol: starting column in the logical line
|
|
1376
|
+
* - length: length of this visual line segment
|
|
1377
|
+
*/
|
|
1378
|
+
buildVisualLineMap(width) {
|
|
1379
|
+
const visualLines = [];
|
|
1380
|
+
for (let i = 0; i < this.state.lines.length; i++) {
|
|
1381
|
+
const line = this.state.lines[i] || "";
|
|
1382
|
+
const lineVisWidth = visibleWidth(line);
|
|
1383
|
+
if (line.length === 0) {
|
|
1384
|
+
// Empty line still takes one visual line
|
|
1385
|
+
visualLines.push({ logicalLine: i, startCol: 0, length: 0 });
|
|
1386
|
+
}
|
|
1387
|
+
else if (lineVisWidth <= width) {
|
|
1388
|
+
visualLines.push({ logicalLine: i, startCol: 0, length: line.length });
|
|
1389
|
+
}
|
|
1390
|
+
else {
|
|
1391
|
+
// Line needs wrapping - use word-aware wrapping
|
|
1392
|
+
const chunks = wordWrapLine(line, width, [...this.segment(line)]);
|
|
1393
|
+
for (const chunk of chunks) {
|
|
1394
|
+
visualLines.push({
|
|
1395
|
+
logicalLine: i,
|
|
1396
|
+
startCol: chunk.startIndex,
|
|
1397
|
+
length: chunk.endIndex - chunk.startIndex,
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
return visualLines;
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Find the visual line index that contains the given logical position.
|
|
1406
|
+
*/
|
|
1407
|
+
findVisualLineAt(visualLines, line, col) {
|
|
1408
|
+
for (let i = 0; i < visualLines.length; i++) {
|
|
1409
|
+
const vl = visualLines[i];
|
|
1410
|
+
if (!vl || vl.logicalLine !== line)
|
|
1411
|
+
continue;
|
|
1412
|
+
const offset = col - vl.startCol;
|
|
1413
|
+
// Cursor is in this segment if it's within range. For the last
|
|
1414
|
+
// segment of a logical line, cursor can be at length (end position)
|
|
1415
|
+
const isLastSegmentOfLine = i === visualLines.length - 1 || visualLines[i + 1]?.logicalLine !== vl.logicalLine;
|
|
1416
|
+
if (offset >= 0 && (offset < vl.length || (isLastSegmentOfLine && offset === vl.length))) {
|
|
1417
|
+
return i;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
return visualLines.length - 1;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Find the visual line index for the current cursor position.
|
|
1424
|
+
*/
|
|
1425
|
+
findCurrentVisualLine(visualLines) {
|
|
1426
|
+
return this.findVisualLineAt(visualLines, this.state.cursorLine, this.state.cursorCol);
|
|
1427
|
+
}
|
|
1428
|
+
moveCursor(deltaLine, deltaCol) {
|
|
1429
|
+
this.lastAction = null;
|
|
1430
|
+
const visualLines = this.buildVisualLineMap(this.lastWidth);
|
|
1431
|
+
const currentVisualLine = this.findCurrentVisualLine(visualLines);
|
|
1432
|
+
if (deltaLine !== 0) {
|
|
1433
|
+
const targetVisualLine = currentVisualLine + deltaLine;
|
|
1434
|
+
if (targetVisualLine >= 0 && targetVisualLine < visualLines.length) {
|
|
1435
|
+
this.moveToVisualLine(visualLines, currentVisualLine, targetVisualLine);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
if (deltaCol !== 0) {
|
|
1439
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1440
|
+
if (deltaCol > 0) {
|
|
1441
|
+
// Moving right - move by one grapheme (handles emojis, combining characters, etc.)
|
|
1442
|
+
if (this.state.cursorCol < currentLine.length) {
|
|
1443
|
+
const afterCursor = currentLine.slice(this.state.cursorCol);
|
|
1444
|
+
const graphemes = [...this.segment(afterCursor)];
|
|
1445
|
+
const firstGrapheme = graphemes[0];
|
|
1446
|
+
this.setCursorCol(this.state.cursorCol + (firstGrapheme ? firstGrapheme.segment.length : 1));
|
|
1447
|
+
}
|
|
1448
|
+
else if (this.state.cursorLine < this.state.lines.length - 1) {
|
|
1449
|
+
// Wrap to start of next logical line
|
|
1450
|
+
this.state.cursorLine++;
|
|
1451
|
+
this.setCursorCol(0);
|
|
1452
|
+
}
|
|
1453
|
+
else {
|
|
1454
|
+
// At end of last line - can't move, but set preferredVisualCol for up/down navigation
|
|
1455
|
+
const currentVL = visualLines[currentVisualLine];
|
|
1456
|
+
if (currentVL) {
|
|
1457
|
+
this.preferredVisualCol = this.state.cursorCol - currentVL.startCol;
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
else {
|
|
1462
|
+
// Moving left - move by one grapheme (handles emojis, combining characters, etc.)
|
|
1463
|
+
if (this.state.cursorCol > 0) {
|
|
1464
|
+
const beforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
1465
|
+
const graphemes = [...this.segment(beforeCursor)];
|
|
1466
|
+
const lastGrapheme = graphemes[graphemes.length - 1];
|
|
1467
|
+
this.setCursorCol(this.state.cursorCol - (lastGrapheme ? lastGrapheme.segment.length : 1));
|
|
1468
|
+
}
|
|
1469
|
+
else if (this.state.cursorLine > 0) {
|
|
1470
|
+
// Wrap to end of previous logical line
|
|
1471
|
+
this.state.cursorLine--;
|
|
1472
|
+
const prevLine = this.state.lines[this.state.cursorLine] || "";
|
|
1473
|
+
this.setCursorCol(prevLine.length);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* Scroll by a page (direction: -1 for up, 1 for down).
|
|
1480
|
+
* Moves cursor by the page size while keeping it in bounds.
|
|
1481
|
+
*/
|
|
1482
|
+
pageScroll(direction) {
|
|
1483
|
+
this.lastAction = null;
|
|
1484
|
+
const terminalRows = this.tui.terminal.rows;
|
|
1485
|
+
const pageSize = Math.max(5, Math.floor(terminalRows * 0.3));
|
|
1486
|
+
const visualLines = this.buildVisualLineMap(this.lastWidth);
|
|
1487
|
+
const currentVisualLine = this.findCurrentVisualLine(visualLines);
|
|
1488
|
+
const targetVisualLine = Math.max(0, Math.min(visualLines.length - 1, currentVisualLine + direction * pageSize));
|
|
1489
|
+
this.moveToVisualLine(visualLines, currentVisualLine, targetVisualLine);
|
|
1490
|
+
}
|
|
1491
|
+
moveWordBackwards() {
|
|
1492
|
+
this.lastAction = null;
|
|
1493
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1494
|
+
// If at start of line, move to end of previous line
|
|
1495
|
+
if (this.state.cursorCol === 0) {
|
|
1496
|
+
if (this.state.cursorLine > 0) {
|
|
1497
|
+
this.state.cursorLine--;
|
|
1498
|
+
const prevLine = this.state.lines[this.state.cursorLine] || "";
|
|
1499
|
+
this.setCursorCol(prevLine.length);
|
|
1500
|
+
}
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
const textBeforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
1504
|
+
const graphemes = [...this.segment(textBeforeCursor)];
|
|
1505
|
+
let newCol = this.state.cursorCol;
|
|
1506
|
+
// Skip trailing whitespace
|
|
1507
|
+
while (graphemes.length > 0 &&
|
|
1508
|
+
!isPasteMarker(graphemes[graphemes.length - 1]?.segment || "") &&
|
|
1509
|
+
isWhitespaceChar(graphemes[graphemes.length - 1]?.segment || "")) {
|
|
1510
|
+
newCol -= graphemes.pop()?.segment.length || 0;
|
|
1511
|
+
}
|
|
1512
|
+
if (graphemes.length > 0) {
|
|
1513
|
+
const lastGrapheme = graphemes[graphemes.length - 1]?.segment || "";
|
|
1514
|
+
if (isPasteMarker(lastGrapheme)) {
|
|
1515
|
+
// Paste marker is a single atomic word
|
|
1516
|
+
newCol -= graphemes.pop()?.segment.length || 0;
|
|
1517
|
+
}
|
|
1518
|
+
else if (isPunctuationChar(lastGrapheme)) {
|
|
1519
|
+
// Skip punctuation run
|
|
1520
|
+
while (graphemes.length > 0 &&
|
|
1521
|
+
isPunctuationChar(graphemes[graphemes.length - 1]?.segment || "") &&
|
|
1522
|
+
!isPasteMarker(graphemes[graphemes.length - 1]?.segment || "")) {
|
|
1523
|
+
newCol -= graphemes.pop()?.segment.length || 0;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
else {
|
|
1527
|
+
// Skip word run
|
|
1528
|
+
while (graphemes.length > 0 &&
|
|
1529
|
+
!isWhitespaceChar(graphemes[graphemes.length - 1]?.segment || "") &&
|
|
1530
|
+
!isPunctuationChar(graphemes[graphemes.length - 1]?.segment || "") &&
|
|
1531
|
+
!isPasteMarker(graphemes[graphemes.length - 1]?.segment || "")) {
|
|
1532
|
+
newCol -= graphemes.pop()?.segment.length || 0;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
this.setCursorCol(newCol);
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Yank (paste) the most recent kill ring entry at cursor position.
|
|
1540
|
+
*/
|
|
1541
|
+
yank() {
|
|
1542
|
+
if (this.killRing.length === 0)
|
|
1543
|
+
return;
|
|
1544
|
+
this.pushUndoSnapshot();
|
|
1545
|
+
const text = this.killRing.peek();
|
|
1546
|
+
this.insertYankedText(text);
|
|
1547
|
+
this.lastAction = "yank";
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Cycle through kill ring (only works immediately after yank or yank-pop).
|
|
1551
|
+
* Replaces the last yanked text with the previous entry in the ring.
|
|
1552
|
+
*/
|
|
1553
|
+
yankPop() {
|
|
1554
|
+
// Only works if we just yanked and have more than one entry
|
|
1555
|
+
if (this.lastAction !== "yank" || this.killRing.length <= 1)
|
|
1556
|
+
return;
|
|
1557
|
+
this.pushUndoSnapshot();
|
|
1558
|
+
// Delete the previously yanked text (still at end of ring before rotation)
|
|
1559
|
+
this.deleteYankedText();
|
|
1560
|
+
// Rotate the ring: move end to front
|
|
1561
|
+
this.killRing.rotate();
|
|
1562
|
+
// Insert the new most recent entry (now at end after rotation)
|
|
1563
|
+
const text = this.killRing.peek();
|
|
1564
|
+
this.insertYankedText(text);
|
|
1565
|
+
this.lastAction = "yank";
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Insert text at cursor position (used by yank operations).
|
|
1569
|
+
*/
|
|
1570
|
+
insertYankedText(text) {
|
|
1571
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
1572
|
+
const lines = text.split("\n");
|
|
1573
|
+
if (lines.length === 1) {
|
|
1574
|
+
// Single line - insert at cursor
|
|
1575
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1576
|
+
const before = currentLine.slice(0, this.state.cursorCol);
|
|
1577
|
+
const after = currentLine.slice(this.state.cursorCol);
|
|
1578
|
+
this.state.lines[this.state.cursorLine] = before + text + after;
|
|
1579
|
+
this.setCursorCol(this.state.cursorCol + text.length);
|
|
1580
|
+
}
|
|
1581
|
+
else {
|
|
1582
|
+
// Multi-line insert
|
|
1583
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1584
|
+
const before = currentLine.slice(0, this.state.cursorCol);
|
|
1585
|
+
const after = currentLine.slice(this.state.cursorCol);
|
|
1586
|
+
// First line merges with text before cursor
|
|
1587
|
+
this.state.lines[this.state.cursorLine] = before + (lines[0] || "");
|
|
1588
|
+
// Insert middle lines
|
|
1589
|
+
for (let i = 1; i < lines.length - 1; i++) {
|
|
1590
|
+
this.state.lines.splice(this.state.cursorLine + i, 0, lines[i] || "");
|
|
1591
|
+
}
|
|
1592
|
+
// Last line merges with text after cursor
|
|
1593
|
+
const lastLineIndex = this.state.cursorLine + lines.length - 1;
|
|
1594
|
+
this.state.lines.splice(lastLineIndex, 0, (lines[lines.length - 1] || "") + after);
|
|
1595
|
+
// Update cursor position
|
|
1596
|
+
this.state.cursorLine = lastLineIndex;
|
|
1597
|
+
this.setCursorCol((lines[lines.length - 1] || "").length);
|
|
1598
|
+
}
|
|
1599
|
+
if (this.onChange) {
|
|
1600
|
+
this.onChange(this.getText());
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Delete the previously yanked text (used by yank-pop).
|
|
1605
|
+
* The yanked text is derived from killRing[end] since it hasn't been rotated yet.
|
|
1606
|
+
*/
|
|
1607
|
+
deleteYankedText() {
|
|
1608
|
+
const yankedText = this.killRing.peek();
|
|
1609
|
+
if (!yankedText)
|
|
1610
|
+
return;
|
|
1611
|
+
const yankLines = yankedText.split("\n");
|
|
1612
|
+
if (yankLines.length === 1) {
|
|
1613
|
+
// Single line - delete backward from cursor
|
|
1614
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1615
|
+
const deleteLen = yankedText.length;
|
|
1616
|
+
const before = currentLine.slice(0, this.state.cursorCol - deleteLen);
|
|
1617
|
+
const after = currentLine.slice(this.state.cursorCol);
|
|
1618
|
+
this.state.lines[this.state.cursorLine] = before + after;
|
|
1619
|
+
this.setCursorCol(this.state.cursorCol - deleteLen);
|
|
1620
|
+
}
|
|
1621
|
+
else {
|
|
1622
|
+
// Multi-line delete - cursor is at end of last yanked line
|
|
1623
|
+
const startLine = this.state.cursorLine - (yankLines.length - 1);
|
|
1624
|
+
const startCol = (this.state.lines[startLine] || "").length - (yankLines[0] || "").length;
|
|
1625
|
+
// Get text after cursor on current line
|
|
1626
|
+
const afterCursor = (this.state.lines[this.state.cursorLine] || "").slice(this.state.cursorCol);
|
|
1627
|
+
// Get text before yank start position
|
|
1628
|
+
const beforeYank = (this.state.lines[startLine] || "").slice(0, startCol);
|
|
1629
|
+
// Remove all lines from startLine to cursorLine and replace with merged line
|
|
1630
|
+
this.state.lines.splice(startLine, yankLines.length, beforeYank + afterCursor);
|
|
1631
|
+
// Update cursor
|
|
1632
|
+
this.state.cursorLine = startLine;
|
|
1633
|
+
this.setCursorCol(startCol);
|
|
1634
|
+
}
|
|
1635
|
+
if (this.onChange) {
|
|
1636
|
+
this.onChange(this.getText());
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
pushUndoSnapshot() {
|
|
1640
|
+
this.undoStack.push(this.state);
|
|
1641
|
+
}
|
|
1642
|
+
undo() {
|
|
1643
|
+
this.historyIndex = -1; // Exit history browsing mode
|
|
1644
|
+
const snapshot = this.undoStack.pop();
|
|
1645
|
+
if (!snapshot)
|
|
1646
|
+
return;
|
|
1647
|
+
Object.assign(this.state, snapshot);
|
|
1648
|
+
this.lastAction = null;
|
|
1649
|
+
this.preferredVisualCol = null;
|
|
1650
|
+
if (this.onChange) {
|
|
1651
|
+
this.onChange(this.getText());
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* Jump to the first occurrence of a character in the specified direction.
|
|
1656
|
+
* Multi-line search. Case-sensitive. Skips the current cursor position.
|
|
1657
|
+
*/
|
|
1658
|
+
jumpToChar(char, direction) {
|
|
1659
|
+
this.lastAction = null;
|
|
1660
|
+
const isForward = direction === "forward";
|
|
1661
|
+
const lines = this.state.lines;
|
|
1662
|
+
const end = isForward ? lines.length : -1;
|
|
1663
|
+
const step = isForward ? 1 : -1;
|
|
1664
|
+
for (let lineIdx = this.state.cursorLine; lineIdx !== end; lineIdx += step) {
|
|
1665
|
+
const line = lines[lineIdx] || "";
|
|
1666
|
+
const isCurrentLine = lineIdx === this.state.cursorLine;
|
|
1667
|
+
// Current line: start after/before cursor; other lines: search full line
|
|
1668
|
+
const searchFrom = isCurrentLine
|
|
1669
|
+
? isForward
|
|
1670
|
+
? this.state.cursorCol + 1
|
|
1671
|
+
: this.state.cursorCol - 1
|
|
1672
|
+
: undefined;
|
|
1673
|
+
const idx = isForward ? line.indexOf(char, searchFrom) : line.lastIndexOf(char, searchFrom);
|
|
1674
|
+
if (idx !== -1) {
|
|
1675
|
+
this.state.cursorLine = lineIdx;
|
|
1676
|
+
this.setCursorCol(idx);
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
// No match found - cursor stays in place
|
|
1681
|
+
}
|
|
1682
|
+
moveWordForwards() {
|
|
1683
|
+
this.lastAction = null;
|
|
1684
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1685
|
+
// If at end of line, move to start of next line
|
|
1686
|
+
if (this.state.cursorCol >= currentLine.length) {
|
|
1687
|
+
if (this.state.cursorLine < this.state.lines.length - 1) {
|
|
1688
|
+
this.state.cursorLine++;
|
|
1689
|
+
this.setCursorCol(0);
|
|
1690
|
+
}
|
|
1691
|
+
return;
|
|
1692
|
+
}
|
|
1693
|
+
const textAfterCursor = currentLine.slice(this.state.cursorCol);
|
|
1694
|
+
const segments = this.segment(textAfterCursor);
|
|
1695
|
+
const iterator = segments[Symbol.iterator]();
|
|
1696
|
+
let next = iterator.next();
|
|
1697
|
+
let newCol = this.state.cursorCol;
|
|
1698
|
+
// Skip leading whitespace
|
|
1699
|
+
while (!next.done && !isPasteMarker(next.value.segment) && isWhitespaceChar(next.value.segment)) {
|
|
1700
|
+
newCol += next.value.segment.length;
|
|
1701
|
+
next = iterator.next();
|
|
1702
|
+
}
|
|
1703
|
+
if (!next.done) {
|
|
1704
|
+
const firstGrapheme = next.value.segment;
|
|
1705
|
+
if (isPasteMarker(firstGrapheme)) {
|
|
1706
|
+
// Paste marker is a single atomic word
|
|
1707
|
+
newCol += firstGrapheme.length;
|
|
1708
|
+
}
|
|
1709
|
+
else if (isPunctuationChar(firstGrapheme)) {
|
|
1710
|
+
// Skip punctuation run
|
|
1711
|
+
while (!next.done && isPunctuationChar(next.value.segment) && !isPasteMarker(next.value.segment)) {
|
|
1712
|
+
newCol += next.value.segment.length;
|
|
1713
|
+
next = iterator.next();
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
else {
|
|
1717
|
+
// Skip word run
|
|
1718
|
+
while (!next.done &&
|
|
1719
|
+
!isWhitespaceChar(next.value.segment) &&
|
|
1720
|
+
!isPunctuationChar(next.value.segment) &&
|
|
1721
|
+
!isPasteMarker(next.value.segment)) {
|
|
1722
|
+
newCol += next.value.segment.length;
|
|
1723
|
+
next = iterator.next();
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
this.setCursorCol(newCol);
|
|
1728
|
+
}
|
|
1729
|
+
// Slash menu only allowed on the first line of the editor
|
|
1730
|
+
isSlashMenuAllowed() {
|
|
1731
|
+
return this.state.cursorLine === 0;
|
|
1732
|
+
}
|
|
1733
|
+
// Helper method to check if cursor is at start of message (for slash command detection)
|
|
1734
|
+
isAtStartOfMessage() {
|
|
1735
|
+
if (!this.isSlashMenuAllowed())
|
|
1736
|
+
return false;
|
|
1737
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1738
|
+
const beforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
1739
|
+
return beforeCursor.trim() === "" || beforeCursor.trim() === "/";
|
|
1740
|
+
}
|
|
1741
|
+
isInSlashCommandContext(textBeforeCursor) {
|
|
1742
|
+
return this.isSlashMenuAllowed() && textBeforeCursor.trimStart().startsWith("/");
|
|
1743
|
+
}
|
|
1744
|
+
// Autocomplete methods
|
|
1745
|
+
/**
|
|
1746
|
+
* Find the best autocomplete item index for the given prefix.
|
|
1747
|
+
* Returns -1 if no match is found.
|
|
1748
|
+
*
|
|
1749
|
+
* Match priority:
|
|
1750
|
+
* 1. Exact match (prefix === item.value) -> always selected
|
|
1751
|
+
* 2. Prefix match -> first item whose value starts with prefix
|
|
1752
|
+
* 3. No match -> -1 (keep default highlight)
|
|
1753
|
+
*
|
|
1754
|
+
* Matching is case-sensitive and checks item.value only.
|
|
1755
|
+
*/
|
|
1756
|
+
getBestAutocompleteMatchIndex(items, prefix) {
|
|
1757
|
+
if (!prefix)
|
|
1758
|
+
return -1;
|
|
1759
|
+
let firstPrefixIndex = -1;
|
|
1760
|
+
for (let i = 0; i < items.length; i++) {
|
|
1761
|
+
const value = items[i].value;
|
|
1762
|
+
if (value === prefix) {
|
|
1763
|
+
return i; // Exact match always wins
|
|
1764
|
+
}
|
|
1765
|
+
if (firstPrefixIndex === -1 && value.startsWith(prefix)) {
|
|
1766
|
+
firstPrefixIndex = i;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
return firstPrefixIndex;
|
|
1770
|
+
}
|
|
1771
|
+
createAutocompleteList(prefix, items) {
|
|
1772
|
+
const layout = prefix.startsWith("/") ? SLASH_COMMAND_SELECT_LIST_LAYOUT : undefined;
|
|
1773
|
+
return new SelectList(items, this.autocompleteMaxVisible, this.theme.selectList, layout);
|
|
1774
|
+
}
|
|
1775
|
+
tryTriggerAutocomplete(explicitTab = false) {
|
|
1776
|
+
this.requestAutocomplete({ force: false, explicitTab });
|
|
1777
|
+
}
|
|
1778
|
+
handleTabCompletion() {
|
|
1779
|
+
if (!this.autocompleteProvider)
|
|
1780
|
+
return;
|
|
1781
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1782
|
+
const beforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
1783
|
+
if (this.isInSlashCommandContext(beforeCursor) && !beforeCursor.trimStart().includes(" ")) {
|
|
1784
|
+
this.handleSlashCommandCompletion();
|
|
1785
|
+
}
|
|
1786
|
+
else {
|
|
1787
|
+
this.forceFileAutocomplete(true);
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
handleSlashCommandCompletion() {
|
|
1791
|
+
this.requestAutocomplete({ force: false, explicitTab: true });
|
|
1792
|
+
}
|
|
1793
|
+
forceFileAutocomplete(explicitTab = false) {
|
|
1794
|
+
this.requestAutocomplete({ force: true, explicitTab });
|
|
1795
|
+
}
|
|
1796
|
+
requestAutocomplete(options) {
|
|
1797
|
+
if (!this.autocompleteProvider)
|
|
1798
|
+
return;
|
|
1799
|
+
if (options.force) {
|
|
1800
|
+
const shouldTrigger = !this.autocompleteProvider.shouldTriggerFileCompletion ||
|
|
1801
|
+
this.autocompleteProvider.shouldTriggerFileCompletion(this.state.lines, this.state.cursorLine, this.state.cursorCol);
|
|
1802
|
+
if (!shouldTrigger) {
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
this.cancelAutocompleteRequest();
|
|
1807
|
+
const startToken = ++this.autocompleteStartToken;
|
|
1808
|
+
const debounceMs = this.getAutocompleteDebounceMs(options);
|
|
1809
|
+
if (debounceMs > 0) {
|
|
1810
|
+
this.autocompleteDebounceTimer = setTimeout(() => {
|
|
1811
|
+
this.autocompleteDebounceTimer = undefined;
|
|
1812
|
+
void this.startAutocompleteRequest(startToken, options);
|
|
1813
|
+
}, debounceMs);
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
void this.startAutocompleteRequest(startToken, options);
|
|
1817
|
+
}
|
|
1818
|
+
async startAutocompleteRequest(startToken, options) {
|
|
1819
|
+
const previousTask = this.autocompleteRequestTask;
|
|
1820
|
+
this.autocompleteRequestTask = (async () => {
|
|
1821
|
+
await previousTask;
|
|
1822
|
+
if (startToken !== this.autocompleteStartToken || !this.autocompleteProvider) {
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1825
|
+
const controller = new AbortController();
|
|
1826
|
+
this.autocompleteAbort = controller;
|
|
1827
|
+
const requestId = ++this.autocompleteRequestId;
|
|
1828
|
+
const snapshotText = this.getText();
|
|
1829
|
+
const snapshotLine = this.state.cursorLine;
|
|
1830
|
+
const snapshotCol = this.state.cursorCol;
|
|
1831
|
+
await this.runAutocompleteRequest(requestId, controller, snapshotText, snapshotLine, snapshotCol, options);
|
|
1832
|
+
})();
|
|
1833
|
+
await this.autocompleteRequestTask;
|
|
1834
|
+
}
|
|
1835
|
+
getAutocompleteDebounceMs(options) {
|
|
1836
|
+
if (options.explicitTab || options.force) {
|
|
1837
|
+
return 0;
|
|
1838
|
+
}
|
|
1839
|
+
const currentLine = this.state.lines[this.state.cursorLine] || "";
|
|
1840
|
+
const textBeforeCursor = currentLine.slice(0, this.state.cursorCol);
|
|
1841
|
+
const isSymbolAutocompleteContext = /(?:^|[ \t])(?:@(?:"[^"]*|[^\s]*)|#[^\s]*)$/.test(textBeforeCursor);
|
|
1842
|
+
return isSymbolAutocompleteContext ? ATTACHMENT_AUTOCOMPLETE_DEBOUNCE_MS : 0;
|
|
1843
|
+
}
|
|
1844
|
+
async runAutocompleteRequest(requestId, controller, snapshotText, snapshotLine, snapshotCol, options) {
|
|
1845
|
+
if (!this.autocompleteProvider)
|
|
1846
|
+
return;
|
|
1847
|
+
const suggestions = await this.autocompleteProvider.getSuggestions(this.state.lines, this.state.cursorLine, this.state.cursorCol, { signal: controller.signal, force: options.force });
|
|
1848
|
+
if (!this.isAutocompleteRequestCurrent(requestId, controller, snapshotText, snapshotLine, snapshotCol)) {
|
|
1849
|
+
return;
|
|
1850
|
+
}
|
|
1851
|
+
this.autocompleteAbort = undefined;
|
|
1852
|
+
if (!suggestions || !Array.isArray(suggestions.items) || suggestions.items.length === 0) {
|
|
1853
|
+
this.cancelAutocomplete();
|
|
1854
|
+
this.tui.requestRender();
|
|
1855
|
+
return;
|
|
1856
|
+
}
|
|
1857
|
+
if (options.force && options.explicitTab && suggestions.items.length === 1) {
|
|
1858
|
+
const item = suggestions.items[0];
|
|
1859
|
+
this.pushUndoSnapshot();
|
|
1860
|
+
this.lastAction = null;
|
|
1861
|
+
const result = this.autocompleteProvider.applyCompletion(this.state.lines, this.state.cursorLine, this.state.cursorCol, item, suggestions.prefix);
|
|
1862
|
+
this.state.lines = result.lines;
|
|
1863
|
+
this.state.cursorLine = result.cursorLine;
|
|
1864
|
+
this.setCursorCol(result.cursorCol);
|
|
1865
|
+
if (this.onChange)
|
|
1866
|
+
this.onChange(this.getText());
|
|
1867
|
+
this.tui.requestRender();
|
|
1868
|
+
return;
|
|
1869
|
+
}
|
|
1870
|
+
this.applyAutocompleteSuggestions(suggestions, options.force ? "force" : "regular");
|
|
1871
|
+
this.tui.requestRender();
|
|
1872
|
+
}
|
|
1873
|
+
isAutocompleteRequestCurrent(requestId, controller, snapshotText, snapshotLine, snapshotCol) {
|
|
1874
|
+
return (!controller.signal.aborted &&
|
|
1875
|
+
requestId === this.autocompleteRequestId &&
|
|
1876
|
+
this.getText() === snapshotText &&
|
|
1877
|
+
this.state.cursorLine === snapshotLine &&
|
|
1878
|
+
this.state.cursorCol === snapshotCol);
|
|
1879
|
+
}
|
|
1880
|
+
applyAutocompleteSuggestions(suggestions, state) {
|
|
1881
|
+
this.autocompletePrefix = suggestions.prefix;
|
|
1882
|
+
this.autocompleteList = this.createAutocompleteList(suggestions.prefix, suggestions.items);
|
|
1883
|
+
const bestMatchIndex = this.getBestAutocompleteMatchIndex(suggestions.items, suggestions.prefix);
|
|
1884
|
+
if (bestMatchIndex >= 0) {
|
|
1885
|
+
this.autocompleteList.setSelectedIndex(bestMatchIndex);
|
|
1886
|
+
}
|
|
1887
|
+
this.autocompleteState = state;
|
|
1888
|
+
}
|
|
1889
|
+
cancelAutocompleteRequest() {
|
|
1890
|
+
this.autocompleteStartToken += 1;
|
|
1891
|
+
if (this.autocompleteDebounceTimer) {
|
|
1892
|
+
clearTimeout(this.autocompleteDebounceTimer);
|
|
1893
|
+
this.autocompleteDebounceTimer = undefined;
|
|
1894
|
+
}
|
|
1895
|
+
this.autocompleteAbort?.abort();
|
|
1896
|
+
this.autocompleteAbort = undefined;
|
|
1897
|
+
}
|
|
1898
|
+
clearAutocompleteUi() {
|
|
1899
|
+
this.autocompleteState = null;
|
|
1900
|
+
this.autocompleteList = undefined;
|
|
1901
|
+
this.autocompletePrefix = "";
|
|
1902
|
+
}
|
|
1903
|
+
cancelAutocomplete() {
|
|
1904
|
+
this.cancelAutocompleteRequest();
|
|
1905
|
+
this.clearAutocompleteUi();
|
|
1906
|
+
}
|
|
1907
|
+
isShowingAutocomplete() {
|
|
1908
|
+
return this.autocompleteState !== null;
|
|
1909
|
+
}
|
|
1910
|
+
updateAutocomplete() {
|
|
1911
|
+
if (!this.autocompleteState || !this.autocompleteProvider)
|
|
1912
|
+
return;
|
|
1913
|
+
this.requestAutocomplete({ force: this.autocompleteState === "force", explicitTab: false });
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
//# sourceMappingURL=editor.js.map
|