buninu 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/.bashrc +11 -0
- package/ARCHITECTURE.md +452 -0
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/apps/bun/make-bunBin.sh +84 -0
- package/apps/jsgotty/LICENSE +23 -0
- package/apps/jsgotty/LICENSES/Apache-2.0-zmodem.js.txt +201 -0
- package/apps/jsgotty/NOTICE +21 -0
- package/apps/jsgotty/README.en.md +290 -0
- package/apps/jsgotty/README.md +292 -0
- package/apps/jsgotty/client.mjs +700 -0
- package/apps/jsgotty/env.sh +2 -0
- package/apps/jsgotty/gotty.js +3325 -0
- package/apps/jsgotty/node_modules/.package-lock.json +35 -0
- package/apps/jsgotty/node_modules/node-addon-api/LICENSE.md +9 -0
- package/apps/jsgotty/node_modules/node-addon-api/README.md +319 -0
- package/apps/jsgotty/node_modules/node-addon-api/common.gypi +20 -0
- package/apps/jsgotty/node_modules/node-addon-api/except.gypi +25 -0
- package/apps/jsgotty/node_modules/node-addon-api/index.js +12 -0
- package/apps/jsgotty/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/apps/jsgotty/node_modules/node-addon-api/napi-inl.h +6607 -0
- package/apps/jsgotty/node_modules/node-addon-api/napi.h +3201 -0
- package/apps/jsgotty/node_modules/node-addon-api/node_addon_api.gyp +32 -0
- package/apps/jsgotty/node_modules/node-addon-api/node_api.gyp +9 -0
- package/apps/jsgotty/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/apps/jsgotty/node_modules/node-addon-api/nothing.c +0 -0
- package/apps/jsgotty/node_modules/node-addon-api/package-support.json +21 -0
- package/apps/jsgotty/node_modules/node-addon-api/package.json +480 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/README.md +73 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/eslint-format.js +79 -0
- package/apps/jsgotty/node_modules/ws/LICENSE +20 -0
- package/apps/jsgotty/node_modules/ws/README.md +548 -0
- package/apps/jsgotty/node_modules/ws/browser.js +8 -0
- package/apps/jsgotty/node_modules/ws/index.js +22 -0
- package/apps/jsgotty/node_modules/ws/lib/buffer-util.js +131 -0
- package/apps/jsgotty/node_modules/ws/lib/constants.js +19 -0
- package/apps/jsgotty/node_modules/ws/lib/event-target.js +292 -0
- package/apps/jsgotty/node_modules/ws/lib/extension.js +203 -0
- package/apps/jsgotty/node_modules/ws/lib/limiter.js +55 -0
- package/apps/jsgotty/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/apps/jsgotty/node_modules/ws/lib/receiver.js +760 -0
- package/apps/jsgotty/node_modules/ws/lib/sender.js +607 -0
- package/apps/jsgotty/node_modules/ws/lib/stream.js +161 -0
- package/apps/jsgotty/node_modules/ws/lib/subprotocol.js +62 -0
- package/apps/jsgotty/node_modules/ws/lib/validation.js +152 -0
- package/apps/jsgotty/node_modules/ws/lib/websocket-server.js +562 -0
- package/apps/jsgotty/node_modules/ws/lib/websocket.js +1407 -0
- package/apps/jsgotty/node_modules/ws/package.json +70 -0
- package/apps/jsgotty/node_modules/ws/wrapper.mjs +21 -0
- package/apps/jsgotty/package-lock.json +46 -0
- package/apps/jsgotty/package.json +13 -0
- package/apps/jsgotty/patches/windowsPtyAgent.js +326 -0
- package/apps/jsgotty/patches/windowsTerminal.js +204 -0
- package/apps/jsgotty/rz.js +199 -0
- package/apps/jsgotty/single-exe/README.md +80 -0
- package/apps/jsgotty/single-exe/assetsHelper.js +90 -0
- package/apps/jsgotty/single-exe/assetsLoader.mjs +85 -0
- package/apps/jsgotty/single-exe/compiled.js +138 -0
- package/apps/jsgotty/single-exe/entry.mjs +9 -0
- package/apps/jsgotty/single-exe/packAssets.sh +7 -0
- package/apps/jsgotty/static/css/index.css +13 -0
- package/apps/jsgotty/static/css/kitty.css +61 -0
- package/apps/jsgotty/static/css/xterm.css +218 -0
- package/apps/jsgotty/static/css/xterm_customize.css +32 -0
- package/apps/jsgotty/static/favicon.ico +0 -0
- package/apps/jsgotty/static/help.md +125 -0
- package/apps/jsgotty/static/icon.svg +66 -0
- package/apps/jsgotty/static/icon_192.png +0 -0
- package/apps/jsgotty/static/index.html +164 -0
- package/apps/jsgotty/static/js/gotty.js +31537 -0
- package/apps/jsgotty/static/js/gotty.js.LICENSE.txt +7 -0
- package/apps/jsgotty/static/js/gotty.js.map +1 -0
- package/apps/jsgotty/static/js/gotty.licenses.txt +650 -0
- package/apps/jsgotty/static/js/kitty.js +1045 -0
- package/apps/jsgotty/static/js/windows_bridge.js +194 -0
- package/apps/jsgotty/static/js/xterm-addon-unicode11.js +2 -0
- package/apps/jsgotty/static/js/zmodem.js +1 -0
- package/apps/jsgotty/static/manifest.json +15 -0
- package/apps/jsgotty/sz.js +273 -0
- package/apps/jsgotty/tests/kitty-order.test.js +58 -0
- package/apps/jsgotty/viu.mjs +393 -0
- package/apps/jsgotty/wgotty +62 -0
- package/apps/jsgotty/windows-bridge-node.js +60 -0
- package/apps/jsgotty/zmodem-node.js +260 -0
- package/apps/jsmdcui/CHANGELOG.md +1048 -0
- package/apps/jsmdcui/LICENSE +22 -0
- package/apps/jsmdcui/README.md +1269 -0
- package/apps/jsmdcui/cdp-maze.js +141 -0
- package/apps/jsmdcui/clean.sh +9 -0
- package/apps/jsmdcui/demos/basic.jpg +0 -0
- package/apps/jsmdcui/demos/chinese.md +32 -0
- package/apps/jsmdcui/demos/event.md +170 -0
- package/apps/jsmdcui/demos/good.jpg +0 -0
- package/apps/jsmdcui/demos/image-processor.md +366 -0
- package/apps/jsmdcui/demos/image-processor.zh-TW.md +366 -0
- package/apps/jsmdcui/demos/img-change.md +73 -0
- package/apps/jsmdcui/demos/imgtool-zh.md +298 -0
- package/apps/jsmdcui/demos/imgtool.md +298 -0
- package/apps/jsmdcui/demos/maze.md +149 -0
- package/apps/jsmdcui/demos/reactive.md +40 -0
- package/apps/jsmdcui/demos/reader.md +513 -0
- package/apps/jsmdcui/demos/select.md +63 -0
- package/apps/jsmdcui/demos/todo-zh.md +190 -0
- package/apps/jsmdcui/demos/todo.md +191 -0
- package/apps/jsmdcui/edit +9 -0
- package/apps/jsmdcui/jsmdcui.sh +5 -0
- package/apps/jsmdcui/llm-maze.txt +94 -0
- package/apps/jsmdcui/package.json +19 -0
- package/apps/jsmdcui/project_structure.txt +35 -0
- package/apps/jsmdcui/runmd.mjs +1140 -0
- package/apps/jsmdcui/runtime/colorschemes/atom-dark.micro +33 -0
- package/apps/jsmdcui/runtime/colorschemes/bubblegum.micro +31 -0
- package/apps/jsmdcui/runtime/colorschemes/cmc-16.micro +47 -0
- package/apps/jsmdcui/runtime/colorschemes/cmc-tc.micro +43 -0
- package/apps/jsmdcui/runtime/colorschemes/darcula.micro +34 -0
- package/apps/jsmdcui/runtime/colorschemes/default.micro +1 -0
- package/apps/jsmdcui/runtime/colorschemes/dracula-tc.micro +49 -0
- package/apps/jsmdcui/runtime/colorschemes/dukedark-tc.micro +38 -0
- package/apps/jsmdcui/runtime/colorschemes/dukelight-tc.micro +38 -0
- package/apps/jsmdcui/runtime/colorschemes/dukeubuntu-tc.micro +38 -0
- package/apps/jsmdcui/runtime/colorschemes/geany.micro +29 -0
- package/apps/jsmdcui/runtime/colorschemes/gotham.micro +29 -0
- package/apps/jsmdcui/runtime/colorschemes/gruvbox-tc.micro +29 -0
- package/apps/jsmdcui/runtime/colorschemes/gruvbox.micro +26 -0
- package/apps/jsmdcui/runtime/colorschemes/material-tc.micro +36 -0
- package/apps/jsmdcui/runtime/colorschemes/monokai-dark.micro +28 -0
- package/apps/jsmdcui/runtime/colorschemes/monokai.micro +34 -0
- package/apps/jsmdcui/runtime/colorschemes/one-dark.micro +39 -0
- package/apps/jsmdcui/runtime/colorschemes/railscast.micro +37 -0
- package/apps/jsmdcui/runtime/colorschemes/simple.micro +33 -0
- package/apps/jsmdcui/runtime/colorschemes/solarized-tc.micro +31 -0
- package/apps/jsmdcui/runtime/colorschemes/solarized.micro +30 -0
- package/apps/jsmdcui/runtime/colorschemes/sunny-day.micro +29 -0
- package/apps/jsmdcui/runtime/colorschemes/twilight.micro +40 -0
- package/apps/jsmdcui/runtime/colorschemes/zenburn.micro +30 -0
- package/apps/jsmdcui/runtime/help/actions.md +161 -0
- package/apps/jsmdcui/runtime/help/cdp.md +124 -0
- package/apps/jsmdcui/runtime/help/colors.md +421 -0
- package/apps/jsmdcui/runtime/help/commands.md +161 -0
- package/apps/jsmdcui/runtime/help/copypaste.md +149 -0
- package/apps/jsmdcui/runtime/help/defaultkeys.md +148 -0
- package/apps/jsmdcui/runtime/help/help.md +1269 -0
- package/apps/jsmdcui/runtime/help/keybindings.md +355 -0
- package/apps/jsmdcui/runtime/help/linter.md +90 -0
- package/apps/jsmdcui/runtime/help/options.md +709 -0
- package/apps/jsmdcui/runtime/help/plugins.md +544 -0
- package/apps/jsmdcui/runtime/help/tutorial.md +112 -0
- package/apps/jsmdcui/runtime/jsplugins/cdp/cdp-server.js +1185 -0
- package/apps/jsmdcui/runtime/jsplugins/cdp/cdp.js +201 -0
- package/apps/jsmdcui/runtime/jsplugins/chapter/chapter.js +111 -0
- package/apps/jsmdcui/runtime/jsplugins/diff/diff.js +46 -0
- package/apps/jsmdcui/runtime/jsplugins/example/example.js +117 -0
- package/apps/jsmdcui/runtime/jsplugins/linter/linter.js +281 -0
- package/apps/jsmdcui/runtime/plugins/autoclose/autoclose.lua +75 -0
- package/apps/jsmdcui/runtime/plugins/ftoptions/ftoptions.lua +17 -0
- package/apps/jsmdcui/runtime/plugins/literate/README.md +5 -0
- package/apps/jsmdcui/runtime/plugins/literate/literate.lua +55 -0
- package/apps/jsmdcui/runtime/plugins/status/help/status.md +21 -0
- package/apps/jsmdcui/runtime/plugins/status/status.lua +62 -0
- package/apps/jsmdcui/runtime/syntax/LICENSE +22 -0
- package/apps/jsmdcui/runtime/syntax/PowerShell.yaml +128 -0
- package/apps/jsmdcui/runtime/syntax/README.md +63 -0
- package/apps/jsmdcui/runtime/syntax/ada.yaml +43 -0
- package/apps/jsmdcui/runtime/syntax/apacheconf.yaml +59 -0
- package/apps/jsmdcui/runtime/syntax/arduino.yaml +101 -0
- package/apps/jsmdcui/runtime/syntax/asciidoc.yaml +51 -0
- package/apps/jsmdcui/runtime/syntax/asm.yaml +123 -0
- package/apps/jsmdcui/runtime/syntax/ats.yaml +99 -0
- package/apps/jsmdcui/runtime/syntax/awk.yaml +44 -0
- package/apps/jsmdcui/runtime/syntax/b.yaml +87 -0
- package/apps/jsmdcui/runtime/syntax/bat.yaml +57 -0
- package/apps/jsmdcui/runtime/syntax/c.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/caddyfile.yaml +23 -0
- package/apps/jsmdcui/runtime/syntax/cake.yaml +7 -0
- package/apps/jsmdcui/runtime/syntax/clojure.yaml +38 -0
- package/apps/jsmdcui/runtime/syntax/cmake.yaml +42 -0
- package/apps/jsmdcui/runtime/syntax/coffeescript.yaml +56 -0
- package/apps/jsmdcui/runtime/syntax/colortest.yaml +19 -0
- package/apps/jsmdcui/runtime/syntax/conky.yaml +17 -0
- package/apps/jsmdcui/runtime/syntax/cpp.yaml +91 -0
- package/apps/jsmdcui/runtime/syntax/crontab.yaml +36 -0
- package/apps/jsmdcui/runtime/syntax/crystal.yaml +72 -0
- package/apps/jsmdcui/runtime/syntax/csharp.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/css.yaml +44 -0
- package/apps/jsmdcui/runtime/syntax/csx.yaml +8 -0
- package/apps/jsmdcui/runtime/syntax/cuda.yaml +68 -0
- package/apps/jsmdcui/runtime/syntax/cython.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/d.yaml +121 -0
- package/apps/jsmdcui/runtime/syntax/dart.yaml +46 -0
- package/apps/jsmdcui/runtime/syntax/default.yaml +10 -0
- package/apps/jsmdcui/runtime/syntax/dockerfile.yaml +36 -0
- package/apps/jsmdcui/runtime/syntax/dot.yaml +29 -0
- package/apps/jsmdcui/runtime/syntax/elixir.yaml +30 -0
- package/apps/jsmdcui/runtime/syntax/elm.yaml +38 -0
- package/apps/jsmdcui/runtime/syntax/erb.yaml +42 -0
- package/apps/jsmdcui/runtime/syntax/erlang.yaml +45 -0
- package/apps/jsmdcui/runtime/syntax/fish.yaml +48 -0
- package/apps/jsmdcui/runtime/syntax/forth.yaml +34 -0
- package/apps/jsmdcui/runtime/syntax/fortran.yaml +64 -0
- package/apps/jsmdcui/runtime/syntax/freebsd-kernel.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/fsharp.yaml +48 -0
- package/apps/jsmdcui/runtime/syntax/gdscript.yaml +61 -0
- package/apps/jsmdcui/runtime/syntax/gemini.yaml +19 -0
- package/apps/jsmdcui/runtime/syntax/gentoo-ebuild.yaml +48 -0
- package/apps/jsmdcui/runtime/syntax/gentoo-etc-portage.yaml +23 -0
- package/apps/jsmdcui/runtime/syntax/git-commit.yaml +35 -0
- package/apps/jsmdcui/runtime/syntax/git-config.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/git-rebase-todo.yaml +19 -0
- package/apps/jsmdcui/runtime/syntax/gleam.yaml +69 -0
- package/apps/jsmdcui/runtime/syntax/glsl.yaml +26 -0
- package/apps/jsmdcui/runtime/syntax/gnuplot.yaml +15 -0
- package/apps/jsmdcui/runtime/syntax/go.yaml +62 -0
- package/apps/jsmdcui/runtime/syntax/godoc.yaml +17 -0
- package/apps/jsmdcui/runtime/syntax/golo.yaml +73 -0
- package/apps/jsmdcui/runtime/syntax/gomod.yaml +31 -0
- package/apps/jsmdcui/runtime/syntax/graphql.yaml +47 -0
- package/apps/jsmdcui/runtime/syntax/groff.yaml +30 -0
- package/apps/jsmdcui/runtime/syntax/groovy.yaml +111 -0
- package/apps/jsmdcui/runtime/syntax/haml.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/hare.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/haskell.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/hc.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/html.yaml +70 -0
- package/apps/jsmdcui/runtime/syntax/html4.yaml +25 -0
- package/apps/jsmdcui/runtime/syntax/html5.yaml +25 -0
- package/apps/jsmdcui/runtime/syntax/ini.yaml +23 -0
- package/apps/jsmdcui/runtime/syntax/inputrc.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/java.yaml +37 -0
- package/apps/jsmdcui/runtime/syntax/javascript.yaml +124 -0
- package/apps/jsmdcui/runtime/syntax/jinja2.yaml +19 -0
- package/apps/jsmdcui/runtime/syntax/json.yaml +39 -0
- package/apps/jsmdcui/runtime/syntax/jsonnet.yaml +92 -0
- package/apps/jsmdcui/runtime/syntax/julia.yaml +57 -0
- package/apps/jsmdcui/runtime/syntax/justfile.yaml +40 -0
- package/apps/jsmdcui/runtime/syntax/keymap.yaml +27 -0
- package/apps/jsmdcui/runtime/syntax/kickstart.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/kotlin.yaml +66 -0
- package/apps/jsmdcui/runtime/syntax/kvlang.yaml +67 -0
- package/apps/jsmdcui/runtime/syntax/ledger.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/lfe.yaml +17 -0
- package/apps/jsmdcui/runtime/syntax/lilypond.yaml +26 -0
- package/apps/jsmdcui/runtime/syntax/lisp.yaml +17 -0
- package/apps/jsmdcui/runtime/syntax/log.yaml +92 -0
- package/apps/jsmdcui/runtime/syntax/lua.yaml +111 -0
- package/apps/jsmdcui/runtime/syntax/mail.yaml +25 -0
- package/apps/jsmdcui/runtime/syntax/makefile.yaml +38 -0
- package/apps/jsmdcui/runtime/syntax/man.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/markdown.yaml +64 -0
- package/apps/jsmdcui/runtime/syntax/mc.yaml +23 -0
- package/apps/jsmdcui/runtime/syntax/meson.yaml +51 -0
- package/apps/jsmdcui/runtime/syntax/micro.yaml +34 -0
- package/apps/jsmdcui/runtime/syntax/mpdconf.yaml +13 -0
- package/apps/jsmdcui/runtime/syntax/msbuild.yaml +6 -0
- package/apps/jsmdcui/runtime/syntax/nanorc.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/nftables.yaml +30 -0
- package/apps/jsmdcui/runtime/syntax/nginx.yaml +22 -0
- package/apps/jsmdcui/runtime/syntax/nim.yaml +27 -0
- package/apps/jsmdcui/runtime/syntax/nix.yaml +32 -0
- package/apps/jsmdcui/runtime/syntax/nu.yaml +114 -0
- package/apps/jsmdcui/runtime/syntax/objc.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/ocaml.yaml +43 -0
- package/apps/jsmdcui/runtime/syntax/octave.yaml +83 -0
- package/apps/jsmdcui/runtime/syntax/odin.yaml +64 -0
- package/apps/jsmdcui/runtime/syntax/pascal.yaml +45 -0
- package/apps/jsmdcui/runtime/syntax/patch.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/peg.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/perl.yaml +58 -0
- package/apps/jsmdcui/runtime/syntax/php.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/pkg-config.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/po.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/pony.yaml +37 -0
- package/apps/jsmdcui/runtime/syntax/pov.yaml +21 -0
- package/apps/jsmdcui/runtime/syntax/privoxy-action.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/privoxy-config.yaml +10 -0
- package/apps/jsmdcui/runtime/syntax/privoxy-filter.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/proto.yaml +40 -0
- package/apps/jsmdcui/runtime/syntax/prql.yaml +84 -0
- package/apps/jsmdcui/runtime/syntax/puppet.yaml +22 -0
- package/apps/jsmdcui/runtime/syntax/python2.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/python3.yaml +80 -0
- package/apps/jsmdcui/runtime/syntax/r.yaml +32 -0
- package/apps/jsmdcui/runtime/syntax/raku.yaml +42 -0
- package/apps/jsmdcui/runtime/syntax/reST.yaml +18 -0
- package/apps/jsmdcui/runtime/syntax/renpy.yaml +15 -0
- package/apps/jsmdcui/runtime/syntax/rpmspec.yaml +43 -0
- package/apps/jsmdcui/runtime/syntax/ruby.yaml +73 -0
- package/apps/jsmdcui/runtime/syntax/rust.yaml +78 -0
- package/apps/jsmdcui/runtime/syntax/sage.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/scad.yaml +53 -0
- package/apps/jsmdcui/runtime/syntax/scala.yaml +33 -0
- package/apps/jsmdcui/runtime/syntax/sed.yaml +13 -0
- package/apps/jsmdcui/runtime/syntax/sh.yaml +69 -0
- package/apps/jsmdcui/runtime/syntax/sls.yaml +15 -0
- package/apps/jsmdcui/runtime/syntax/smalltalk.yaml +55 -0
- package/apps/jsmdcui/runtime/syntax/solidity.yaml +41 -0
- package/apps/jsmdcui/runtime/syntax/sql.yaml +35 -0
- package/apps/jsmdcui/runtime/syntax/stata.yaml +67 -0
- package/apps/jsmdcui/runtime/syntax/svelte.yaml +27 -0
- package/apps/jsmdcui/runtime/syntax/swift.yaml +103 -0
- package/apps/jsmdcui/runtime/syntax/systemd.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/tcl.yaml +18 -0
- package/apps/jsmdcui/runtime/syntax/terraform.yaml +87 -0
- package/apps/jsmdcui/runtime/syntax/tex.yaml +32 -0
- package/apps/jsmdcui/runtime/syntax/toml.yaml +56 -0
- package/apps/jsmdcui/runtime/syntax/twig.yaml +55 -0
- package/apps/jsmdcui/runtime/syntax/typescript.yaml +49 -0
- package/apps/jsmdcui/runtime/syntax/v.yaml +80 -0
- package/apps/jsmdcui/runtime/syntax/vala.yaml +26 -0
- package/apps/jsmdcui/runtime/syntax/verilog.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/vhdl.yaml +37 -0
- package/apps/jsmdcui/runtime/syntax/vi.yaml +31 -0
- package/apps/jsmdcui/runtime/syntax/vue.yaml +64 -0
- package/apps/jsmdcui/runtime/syntax/xml.yaml +37 -0
- package/apps/jsmdcui/runtime/syntax/xresources.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/yaml.yaml +34 -0
- package/apps/jsmdcui/runtime/syntax/yum.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/zig.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/zscript.yaml +72 -0
- package/apps/jsmdcui/runtime/syntax/zsh.yaml +52 -0
- package/apps/jsmdcui/single-exe/README.md +473 -0
- package/apps/jsmdcui/single-exe/assetsHelper.js +191 -0
- package/apps/jsmdcui/single-exe/assetsLoader.mjs +85 -0
- package/apps/jsmdcui/single-exe/compiled.js +212 -0
- package/apps/jsmdcui/single-exe/entry.mjs +10 -0
- package/apps/jsmdcui/single-exe/packAssets.sh +7 -0
- package/apps/jsmdcui/src/MDCUI_DEFAULT_EDIT +0 -0
- package/apps/jsmdcui/src/buffer/backup.js +165 -0
- package/apps/jsmdcui/src/buffer/buffer.js +126 -0
- package/apps/jsmdcui/src/buffer/fixed3-codec.js +140 -0
- package/apps/jsmdcui/src/buffer/loc.js +38 -0
- package/apps/jsmdcui/src/buffer/message.js +29 -0
- package/apps/jsmdcui/src/build-args.js +40 -0
- package/apps/jsmdcui/src/config/clean.js +172 -0
- package/apps/jsmdcui/src/config/colorscheme.js +99 -0
- package/apps/jsmdcui/src/config/config.js +125 -0
- package/apps/jsmdcui/src/config/defaults.js +109 -0
- package/apps/jsmdcui/src/cui/fence-events.mjs +144 -0
- package/apps/jsmdcui/src/cui/heading-ids.mjs +1568 -0
- package/apps/jsmdcui/src/cui/id-collision.mjs +111 -0
- package/apps/jsmdcui/src/cui/identity.mjs +26 -0
- package/apps/jsmdcui/src/cui/kitty-debug.mjs +25 -0
- package/apps/jsmdcui/src/cui/kitty-images.mjs +280 -0
- package/apps/jsmdcui/src/cui/kitty-mode.mjs +6 -0
- package/apps/jsmdcui/src/cui/rerender-queue.mjs +66 -0
- package/apps/jsmdcui/src/cui/rpc.mjs +1525 -0
- package/apps/jsmdcui/src/cui/server.mjs +128 -0
- package/apps/jsmdcui/src/cui/table-render.mjs +286 -0
- package/apps/jsmdcui/src/cui/table-row-edit.mjs +226 -0
- package/apps/jsmdcui/src/cui/task-checkbox.mjs +60 -0
- package/apps/jsmdcui/src/cui/template-components.mjs +253 -0
- package/apps/jsmdcui/src/cui/text-block-resize.mjs +177 -0
- package/apps/jsmdcui/src/cui/tui-links.mjs +560 -0
- package/apps/jsmdcui/src/display/ansi-style.js +60 -0
- package/apps/jsmdcui/src/highlight/highlighter.js +243 -0
- package/apps/jsmdcui/src/highlight/parser.js +225 -0
- package/apps/jsmdcui/src/index.js +9573 -0
- package/apps/jsmdcui/src/lua/engine.js +68 -0
- package/apps/jsmdcui/src/platform/archive.js +50 -0
- package/apps/jsmdcui/src/platform/clipboard.js +278 -0
- package/apps/jsmdcui/src/platform/commands.js +221 -0
- package/apps/jsmdcui/src/platform/terminal.js +5 -0
- package/apps/jsmdcui/src/plugins/js-bridge.js +3377 -0
- package/apps/jsmdcui/src/plugins/manager.js +674 -0
- package/apps/jsmdcui/src/runtime/encodings.js +10 -0
- package/apps/jsmdcui/src/runtime/registry.js +134 -0
- package/apps/jsmdcui/src/screen/cell-buffer.js +81 -0
- package/apps/jsmdcui/src/screen/events.js +263 -0
- package/apps/jsmdcui/src/screen/screen.js +249 -0
- package/apps/jsmdcui/src/screen/vt100.js +571 -0
- package/apps/jsmdcui/src/shell/shell.js +70 -0
- package/apps/jsmdcui/testapp.md +78 -0
- package/apps/jsmdcui/tests/assets-helper.test.js +150 -0
- package/apps/jsmdcui/tests/backup.test.js +158 -0
- package/apps/jsmdcui/tests/cat-markdown.test.js +139 -0
- package/apps/jsmdcui/tests/cmphex3b64.js +95 -0
- package/apps/jsmdcui/tests/compiled-runtime.test.js +139 -0
- package/apps/jsmdcui/tests/config-settings.test.js +52 -0
- package/apps/jsmdcui/tests/demo.test.js +447 -0
- package/apps/jsmdcui/tests/docs-sync.test.js +14 -0
- package/apps/jsmdcui/tests/fence-events.test.js +1293 -0
- package/apps/jsmdcui/tests/heading-ids.test.js +559 -0
- package/apps/jsmdcui/tests/heading-list-selector.test.js +2393 -0
- package/apps/jsmdcui/tests/id-collision.test.js +514 -0
- package/apps/jsmdcui/tests/js-plugin-prompts.test.js +110 -0
- package/apps/jsmdcui/tests/key-event.md +10 -0
- package/apps/jsmdcui/tests/kitty-demo.md +184 -0
- package/apps/jsmdcui/tests/kitty-images.test.js +288 -0
- package/apps/jsmdcui/tests/kitty-mode.test.js +14 -0
- package/apps/jsmdcui/tests/platform-commands.test.js +18 -0
- package/apps/jsmdcui/tests/platform-terminal.test.js +8 -0
- package/apps/jsmdcui/tests/pty-demo.js +492 -0
- package/apps/jsmdcui/tests/rerender-queue.test.js +130 -0
- package/apps/jsmdcui/tests/table-render.test.js +150 -0
- package/apps/jsmdcui/tests/table-row-edit.test.js +138 -0
- package/apps/jsmdcui/tests/task-checkbox.test.js +33 -0
- package/apps/jsmdcui/tests/template-components.test.js +422 -0
- package/apps/jsmdcui/tests/text-block-resize.test.js +222 -0
- package/apps/jsmdcui/tests/textarea.md +8 -0
- package/apps/jsmdcui/tests/tui-links.test.js +298 -0
- package/apps/jsmdcui/tests/wui-responsive-images.test.js +60 -0
- package/apps/jsmdcui/tests/wui.test.js +108 -0
- package/apps/jsmdcui/tests/wv-client.js +96 -0
- package/apps/jsmdcui/tui +7 -0
- package/apps/jsmdcui/wui +9 -0
- package/apps/musl-la/LICENSES/Apache-2.0_LLVM_Exceptions_license.txt +311 -0
- package/apps/musl-la/LICENSES/Apache-2.0_license.txt +177 -0
- package/apps/musl-la/LICENSES/BSD-3-Clause_license.txt +43 -0
- package/apps/musl-la/LICENSES/GPL-3.0.txt +674 -0
- package/apps/musl-la/LICENSES/LGPL-3.0.txt +165 -0
- package/apps/musl-la/LICENSES/MIT.txt +21 -0
- package/apps/musl-la/LICENSES/curl_license.txt +22 -0
- package/apps/musl-la/LICENSES/gcc_runtime_exception.txt +73 -0
- package/apps/musl-la/LICENSES/zlib_license.txt +22 -0
- package/apps/musl-la/LICENSE_musl.txt +193 -0
- package/apps/musl-la/NOTICE +56 -0
- package/apps/musl-la/ldmusl +0 -0
- package/apps/musl-la/libgcc_s.so.1 +0 -0
- package/apps/musl-la/libstdc++.so.6 +0 -0
- package/apps/musl-la/musl-la.sh +5 -0
- package/bin/bun.sh +57 -0
- package/bin/glow.sh +5 -0
- package/bin/init.js +395 -0
- package/bin/jmi.sh +5 -0
- package/bin/jsgotty.sh +5 -0
- package/bin/libsh-loader.c +135 -0
- package/bin/libsh-loader.so +0 -0
- package/bin/multicall.sh +90 -0
- package/bin/shc.js +5 -0
- package/bin/switch_to_android.sh +9 -0
- package/bin/switch_to_linux.sh +7 -0
- package/icon.png +0 -0
- package/package.json +31 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env jsmdcui
|
|
2
|
+
|
|
3
|
+
# Select and Task List Demo
|
|
4
|
+
|
|
5
|
+
Use `Enter` or `Space` to toggle a task item in the TUI, then activate these
|
|
6
|
+
links to read the values under headings at different levels.
|
|
7
|
+
|
|
8
|
+
- [Read primary color (h2 single value)](javascript:showHeadingValue('select-primary-color'))
|
|
9
|
+
- [Read enabled features (h3 array)](javascript:showHeadingValue('enabled-features'))
|
|
10
|
+
- [Read log level (h4 single value)](javascript:showHeadingValue('select-log-level'))
|
|
11
|
+
- [Read permissions (h2 array)](javascript:showHeadingValue('permissions'))
|
|
12
|
+
- [Read every group](javascript:showAllHeadingValues())
|
|
13
|
+
|
|
14
|
+
## Select Primary Color
|
|
15
|
+
|
|
16
|
+
- [ ] Red
|
|
17
|
+
- [x] Green
|
|
18
|
+
- [x] Nested green detail (ignored)
|
|
19
|
+
- [ ] Another nested detail (ignored)
|
|
20
|
+
- [x] Blue (ignored because select returns the first checked value)
|
|
21
|
+
|
|
22
|
+
### Enabled Features
|
|
23
|
+
|
|
24
|
+
- [x] Search
|
|
25
|
+
- [ ] Notifications
|
|
26
|
+
- [x] Nested notification option (ignored)
|
|
27
|
+
- [x] Offline mode
|
|
28
|
+
- [x] Sync
|
|
29
|
+
|
|
30
|
+
#### Select Log Level
|
|
31
|
+
|
|
32
|
+
- [ ] Debug
|
|
33
|
+
- [x] Info
|
|
34
|
+
- [ ] Warning
|
|
35
|
+
- [ ] Error
|
|
36
|
+
|
|
37
|
+
## Permissions
|
|
38
|
+
|
|
39
|
+
- [x] Read
|
|
40
|
+
- [x] Write
|
|
41
|
+
- [x] Write temporary files (ignored)
|
|
42
|
+
- [ ] Write system files (ignored)
|
|
43
|
+
- [ ] Execute
|
|
44
|
+
- [x] Share
|
|
45
|
+
|
|
46
|
+
```js front
|
|
47
|
+
export function showHeadingValue(id)
|
|
48
|
+
{
|
|
49
|
+
const value = $('#'+id).val();
|
|
50
|
+
alert(id+': '+JSON.stringify(value));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function showAllHeadingValues()
|
|
54
|
+
{
|
|
55
|
+
const values = {
|
|
56
|
+
primaryColor: $('#select-primary-color').val(),
|
|
57
|
+
enabledFeatures: $('#enabled-features').val(),
|
|
58
|
+
logLevel: $('#select-log-level').val(),
|
|
59
|
+
permissions: $('#permissions').val(),
|
|
60
|
+
};
|
|
61
|
+
alert(JSON.stringify(values, null, 2));
|
|
62
|
+
}
|
|
63
|
+
```
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
#!/usr/bin/env jsmdcui
|
|
2
|
+
|
|
3
|
+
# Todo List
|
|
4
|
+
|
|
5
|
+
## Todos
|
|
6
|
+
|
|
7
|
+
- [ ] canvas support
|
|
8
|
+
- [x] push/pop/splice/slice list items
|
|
9
|
+
- [x] image by --kitty
|
|
10
|
+
- [ ] clean up codebase
|
|
11
|
+
|
|
12
|
+
## Actions
|
|
13
|
+
|
|
14
|
+
```text#todo-input
|
|
15
|
+
Fly to the moon
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
在上方輸入 Todo 文字,再選擇新增或移除。移除會刪除第一個文字完全相同的項目。
|
|
19
|
+
|
|
20
|
+
- [新增 Todo](javascript:addTodo())
|
|
21
|
+
- .
|
|
22
|
+
- [移除 Todo](javascript:removeTodo())
|
|
23
|
+
- .
|
|
24
|
+
- [顯示已完成](javascript:showCompleted())
|
|
25
|
+
- .
|
|
26
|
+
- [顯示未完成](javascript:showPending())
|
|
27
|
+
|
|
28
|
+
## 存檔/讀檔
|
|
29
|
+
|
|
30
|
+
```text#todo-file
|
|
31
|
+
todo_list.json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
在上方輸入 JSON 檔案路徑。存檔會寫入人類可讀的 JSON;讀檔會在確認後取代目前的 Todo 清單。
|
|
35
|
+
|
|
36
|
+
- [儲存 Todos](javascript:saveTodos())
|
|
37
|
+
- .
|
|
38
|
+
- [讀取 Todos](javascript:loadTodos())
|
|
39
|
+
|
|
40
|
+
## 操作結果:
|
|
41
|
+
|
|
42
|
+
```text#todo-status
|
|
43
|
+
尚未操作
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Filtered Result
|
|
47
|
+
|
|
48
|
+
```text#todo-result
|
|
49
|
+
點按「顯示已完成」或「顯示未完成」查看結果
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```js front
|
|
53
|
+
function todoText() {
|
|
54
|
+
return $('#todo-input').val().trim();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function showItems(title, checked) {
|
|
58
|
+
const items = $('#todos')
|
|
59
|
+
.slice()
|
|
60
|
+
.filter(item => item.checked === checked);
|
|
61
|
+
|
|
62
|
+
const output = items.length
|
|
63
|
+
? items.map(item => `${item.checked ? '✓' : '○'} ${item.value}`).join('\n')
|
|
64
|
+
: '(沒有項目)';
|
|
65
|
+
$('#todo-result').val(`${title}\n${output}`);
|
|
66
|
+
$('#todo-status').val(`找到 ${items.length} 個${title}項目`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function todoFile() {
|
|
70
|
+
return $('#todo-file').val().trim();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function describeError(error) {
|
|
74
|
+
return error?.message || String(error);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function addTodo() {
|
|
78
|
+
const value = todoText();
|
|
79
|
+
if (!value) {
|
|
80
|
+
$('#todo-status').val('新增失敗:請先輸入 Todo 文字');
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const length = $('#todos').push(value);
|
|
85
|
+
$('#todo-input').val('');
|
|
86
|
+
$('#todo-status').val(`已新增「${value}」,目前共有 ${length} 個 Todo`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function removeTodo() {
|
|
90
|
+
const value = todoText();
|
|
91
|
+
if (!value) {
|
|
92
|
+
$('#todo-status').val('移除失敗:請輸入要移除的 Todo 文字');
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const items = $('#todos').slice();
|
|
97
|
+
const index = items.findIndex(item => item.value === value);
|
|
98
|
+
if (index < 0) {
|
|
99
|
+
$('#todo-status').val(`移除失敗:找不到「${value}」`);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const removed = $('#todos').splice(index, 1);
|
|
104
|
+
$('#todo-input').val('');
|
|
105
|
+
$('#todo-status').val(`已移除「${removed[0]}」`);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function showCompleted() {
|
|
109
|
+
showItems('已完成', true);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function showPending() {
|
|
113
|
+
showItems('未完成', false);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export async function saveTodos() {
|
|
117
|
+
const file = todoFile();
|
|
118
|
+
if (!file) {
|
|
119
|
+
$('#todo-status').val('存檔失敗:請先輸入 JSON 檔案路徑');
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
const obj = { todos: $('#todos').slice() };
|
|
125
|
+
const result = await rpc.saveTodoList(file, obj);
|
|
126
|
+
$('#todo-status').val(`已將 ${obj.todos.length} 個 Todo 儲存至 ${result.path}`);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
$('#todo-status').val(`存檔失敗:${describeError(error)}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export async function loadTodos() {
|
|
133
|
+
const file = todoFile();
|
|
134
|
+
if (!file) {
|
|
135
|
+
$('#todo-status').val('讀檔失敗:請先輸入 JSON 檔案路徑');
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
try {
|
|
139
|
+
const result = await rpc.loadTodoList(file);
|
|
140
|
+
const json = JSON.stringify(result.obj, null, 1);
|
|
141
|
+
if (!confirm(`要用「${file}」中的以下 JSON 取代目前的 Todo 清單嗎?\n\n${json}`)) {
|
|
142
|
+
$('#todo-status').val('已取消讀檔,目前的 Todos 未變更');
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const current = $('#todos').slice();
|
|
146
|
+
$('#todos').splice(0, current.length, ...result.obj.todos);
|
|
147
|
+
$('#todo-status').val(`已從 ${result.path} 讀取 ${result.obj.todos.length} 個 Todo`);
|
|
148
|
+
} catch (error) {
|
|
149
|
+
$('#todo-status').val(`讀檔失敗:${describeError(error)}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```js back
|
|
155
|
+
import { resolve } from 'node:path';
|
|
156
|
+
|
|
157
|
+
function todoPath(input) {
|
|
158
|
+
const value = String(input ?? '').trim();
|
|
159
|
+
if (!value) throw new Error('請先輸入 JSON 檔案路徑');
|
|
160
|
+
return resolve(value);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function validateTodoObject(obj) {
|
|
164
|
+
if (!obj || typeof obj !== 'object' || !Array.isArray(obj.todos))
|
|
165
|
+
throw new Error('Todo JSON 必須是包含 todos 陣列的物件');
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
todos: obj.todos.map((item, index) => {
|
|
169
|
+
if (!item || typeof item !== 'object' || typeof item.value !== 'string')
|
|
170
|
+
throw new Error(`第 ${index + 1} 個 Todo 項目必須包含字串 value`);
|
|
171
|
+
return { value: item.value, checked: Boolean(item.checked) };
|
|
172
|
+
}),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export async function saveTodoList(input, obj) {
|
|
177
|
+
const path = todoPath(input);
|
|
178
|
+
const validated = validateTodoObject(obj);
|
|
179
|
+
await Bun.write(path, JSON.stringify(validated, null, 1) + '\n');
|
|
180
|
+
return { path };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export async function loadTodoList(input) {
|
|
184
|
+
const path = todoPath(input);
|
|
185
|
+
const file = Bun.file(path);
|
|
186
|
+
if (!await file.exists()) throw new Error(`找不到 Todo 檔案:${path}`);
|
|
187
|
+
const obj = validateTodoObject(JSON.parse(await file.text()));
|
|
188
|
+
return { path, obj };
|
|
189
|
+
}
|
|
190
|
+
```
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
#!/usr/bin/env jsmdcui
|
|
2
|
+
|
|
3
|
+
# Todo List
|
|
4
|
+
|
|
5
|
+
## Todos
|
|
6
|
+
|
|
7
|
+
- [ ] canvas support
|
|
8
|
+
- [x] push/pop/splice/slice list items
|
|
9
|
+
- [x] image by --kitty
|
|
10
|
+
- [ ] clean up codebase
|
|
11
|
+
|
|
12
|
+
## Actions
|
|
13
|
+
|
|
14
|
+
```text#todo-input
|
|
15
|
+
Fly to the moon
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Enter Todo text above, then choose Add or Remove. Remove deletes the first item whose text matches exactly.
|
|
19
|
+
|
|
20
|
+
- [Add Todo](javascript:addTodo())
|
|
21
|
+
- .
|
|
22
|
+
- [Remove Todo](javascript:removeTodo())
|
|
23
|
+
- .
|
|
24
|
+
- [Show Completed](javascript:showCompleted())
|
|
25
|
+
- .
|
|
26
|
+
- [Show Pending](javascript:showPending())
|
|
27
|
+
|
|
28
|
+
## Save / Load
|
|
29
|
+
|
|
30
|
+
```text#todo-file
|
|
31
|
+
todo_list.json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Enter a JSON file path above. Saving writes human-readable JSON; loading replaces the current Todo list after confirmation.
|
|
35
|
+
|
|
36
|
+
- [Save Todos](javascript:saveTodos())
|
|
37
|
+
- .
|
|
38
|
+
- [Load Todos](javascript:loadTodos())
|
|
39
|
+
|
|
40
|
+
## Operation Result
|
|
41
|
+
|
|
42
|
+
```text#todo-status
|
|
43
|
+
No action yet
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Filtered Result
|
|
47
|
+
|
|
48
|
+
```text#todo-result
|
|
49
|
+
Select “Show Completed” or “Show Pending” to view matching items
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```js front
|
|
53
|
+
function todoText() {
|
|
54
|
+
return $('#todo-input').val().trim();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function showItems(title, checked) {
|
|
58
|
+
const items = $('#todos')
|
|
59
|
+
.slice()
|
|
60
|
+
.filter(item => item.checked === checked);
|
|
61
|
+
|
|
62
|
+
const output = items.length
|
|
63
|
+
? items.map(item => `${item.checked ? '✓' : '○'} ${item.value}`).join('\n')
|
|
64
|
+
: '(No items)';
|
|
65
|
+
const noun = items.length === 1 ? 'item' : 'items';
|
|
66
|
+
$('#todo-result').val(`${title}\n${output}`);
|
|
67
|
+
$('#todo-status').val(`Found ${items.length} ${title.toLowerCase()} ${noun}`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function todoFile() {
|
|
71
|
+
return $('#todo-file').val().trim();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function describeError(error) {
|
|
75
|
+
return error?.message || String(error);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function addTodo() {
|
|
79
|
+
const value = todoText();
|
|
80
|
+
if (!value) {
|
|
81
|
+
$('#todo-status').val('Add failed: enter Todo text first');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const length = $('#todos').push(value);
|
|
86
|
+
$('#todo-input').val('');
|
|
87
|
+
$('#todo-status').val(`Added “${value}”; ${length} Todos total`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function removeTodo() {
|
|
91
|
+
const value = todoText();
|
|
92
|
+
if (!value) {
|
|
93
|
+
$('#todo-status').val('Remove failed: enter the Todo text to remove');
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const items = $('#todos').slice();
|
|
98
|
+
const index = items.findIndex(item => item.value === value);
|
|
99
|
+
if (index < 0) {
|
|
100
|
+
$('#todo-status').val(`Remove failed: could not find “${value}”`);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const removed = $('#todos').splice(index, 1);
|
|
105
|
+
$('#todo-input').val('');
|
|
106
|
+
$('#todo-status').val(`Removed “${removed[0]}”`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function showCompleted() {
|
|
110
|
+
showItems('Completed', true);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function showPending() {
|
|
114
|
+
showItems('Pending', false);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export async function saveTodos() {
|
|
118
|
+
const file = todoFile();
|
|
119
|
+
if (!file) {
|
|
120
|
+
$('#todo-status').val('Save failed: enter a JSON file path first');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
const obj = { todos: $('#todos').slice() };
|
|
126
|
+
const result = await rpc.saveTodoList(file, obj);
|
|
127
|
+
$('#todo-status').val(`Saved ${obj.todos.length} Todos to ${result.path}`);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
$('#todo-status').val(`Save failed: ${describeError(error)}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export async function loadTodos() {
|
|
134
|
+
const file = todoFile();
|
|
135
|
+
if (!file) {
|
|
136
|
+
$('#todo-status').val('Load failed: enter a JSON file path first');
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
const result = await rpc.loadTodoList(file);
|
|
141
|
+
const json = JSON.stringify(result.obj, null, 1);
|
|
142
|
+
if (!confirm(`Replace the current Todo list with this JSON from “${file}”?\n\n${json}`)) {
|
|
143
|
+
$('#todo-status').val('Load cancelled; current Todos were not changed');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const current = $('#todos').slice();
|
|
147
|
+
$('#todos').splice(0, current.length, ...result.obj.todos);
|
|
148
|
+
$('#todo-status').val(`Loaded ${result.obj.todos.length} Todos from ${result.path}`);
|
|
149
|
+
} catch (error) {
|
|
150
|
+
$('#todo-status').val(`Load failed: ${describeError(error)}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```js back
|
|
156
|
+
import { resolve } from 'node:path';
|
|
157
|
+
|
|
158
|
+
function todoPath(input) {
|
|
159
|
+
const value = String(input ?? '').trim();
|
|
160
|
+
if (!value) throw new Error('Enter a JSON file path first');
|
|
161
|
+
return resolve(value);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function validateTodoObject(obj) {
|
|
165
|
+
if (!obj || typeof obj !== 'object' || !Array.isArray(obj.todos))
|
|
166
|
+
throw new Error('Todo JSON must be an object containing a todos array');
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
todos: obj.todos.map((item, index) => {
|
|
170
|
+
if (!item || typeof item !== 'object' || typeof item.value !== 'string')
|
|
171
|
+
throw new Error(`Todo item ${index + 1} must contain a string value`);
|
|
172
|
+
return { value: item.value, checked: Boolean(item.checked) };
|
|
173
|
+
}),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export async function saveTodoList(input, obj) {
|
|
178
|
+
const path = todoPath(input);
|
|
179
|
+
const validated = validateTodoObject(obj);
|
|
180
|
+
await Bun.write(path, JSON.stringify(validated, null, 1) + '\n');
|
|
181
|
+
return { path };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export async function loadTodoList(input) {
|
|
185
|
+
const path = todoPath(input);
|
|
186
|
+
const file = Bun.file(path);
|
|
187
|
+
if (!await file.exists()) throw new Error(`Todo file not found: ${path}`);
|
|
188
|
+
const obj = validateTodoObject(JSON.parse(await file.text()));
|
|
189
|
+
return { path, obj };
|
|
190
|
+
}
|
|
191
|
+
```
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
你正在透過 Bun.WebView 操作 jsmdcui TUI App。
|
|
2
|
+
|
|
3
|
+
CDP 連線位址:
|
|
4
|
+
|
|
5
|
+
ws://127.0.0.1:9222/devtools/browser/cdp-server
|
|
6
|
+
|
|
7
|
+
可用操作:
|
|
8
|
+
|
|
9
|
+
1. 取得完整純文字 UI:
|
|
10
|
+
|
|
11
|
+
await view.evaluate("micro.getAllText()")
|
|
12
|
+
|
|
13
|
+
2. 取得包含 ANSI 樣式與 OSC 8 link 的完整 UI:
|
|
14
|
+
|
|
15
|
+
await view.evaluate("micro.getAllAnsiText()")
|
|
16
|
+
|
|
17
|
+
3. 點擊 buffer 座標:
|
|
18
|
+
|
|
19
|
+
await view.click(column, line)
|
|
20
|
+
|
|
21
|
+
column 與 line 都是 1-based。
|
|
22
|
+
這是整份 buffer 的座標,不是螢幕 pixel。
|
|
23
|
+
不支援 selector click。
|
|
24
|
+
|
|
25
|
+
4. 發送真正的鍵盤事件:
|
|
26
|
+
|
|
27
|
+
await view.press("ArrowUp")
|
|
28
|
+
await view.press("ArrowDown")
|
|
29
|
+
await view.press("ArrowLeft")
|
|
30
|
+
await view.press("ArrowRight")
|
|
31
|
+
await view.press("r", { modifiers: ["Control"] })
|
|
32
|
+
|
|
33
|
+
5. 每次 click 或 press 後,重新取得 UI 快照確認結果。
|
|
34
|
+
|
|
35
|
+
Maze 操作方式:
|
|
36
|
+
|
|
37
|
+
先在 micro.getAllText() 中找到包含 "Put the cursor here" 的行,計算該文字的
|
|
38
|
+
1-based column/line,然後 click 該位置,讓 Maze controls 取得焦點。
|
|
39
|
+
|
|
40
|
+
Maze controls 取得焦點後:
|
|
41
|
+
|
|
42
|
+
- ArrowUp:上
|
|
43
|
+
- ArrowDown:下
|
|
44
|
+
- ArrowLeft:左
|
|
45
|
+
- ArrowRight:右
|
|
46
|
+
- Ctrl-R:重新開始
|
|
47
|
+
|
|
48
|
+
每次移動後可讀取狀態:
|
|
49
|
+
|
|
50
|
+
await view.evaluate("$('#last-key').val()")
|
|
51
|
+
|
|
52
|
+
取得完整迷宮畫面:
|
|
53
|
+
|
|
54
|
+
await view.evaluate("$('#character').val()")
|
|
55
|
+
|
|
56
|
+
看到狀態包含 "Escaped the maze" 代表成功。抵達終點時不會呼叫 alert;大型
|
|
57
|
+
慶祝內容會直接顯示在 character 區域,並提示使用 Ctrl-R 重新開始。
|
|
58
|
+
|
|
59
|
+
初始化與聚焦 controls 的範例:
|
|
60
|
+
|
|
61
|
+
const view = new Bun.WebView({
|
|
62
|
+
backend: {
|
|
63
|
+
type: "chrome",
|
|
64
|
+
url: "ws://127.0.0.1:9222/devtools/browser/cdp-server",
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const cell = await view.evaluate(`
|
|
69
|
+
(() => {
|
|
70
|
+
const lines = micro.getAllText().split("\\n");
|
|
71
|
+
const y = lines.findIndex(line =>
|
|
72
|
+
line.includes("Put the cursor here")
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
x: lines[y].indexOf("Put the cursor here") + 1,
|
|
77
|
+
y: y + 1,
|
|
78
|
+
};
|
|
79
|
+
})()
|
|
80
|
+
`);
|
|
81
|
+
|
|
82
|
+
await view.click(cell.x, cell.y);
|
|
83
|
+
await view.press("r", { modifiers: ["Control"] });
|
|
84
|
+
|
|
85
|
+
alert 注意事項:
|
|
86
|
+
|
|
87
|
+
Maze 抵達終點不會觸發 alert。不過 jsmdcui 其他操作若呼叫同步 alert(),CDP
|
|
88
|
+
operation 會等待使用者直接在實際 terminal 按 Enter 關閉;alert 阻塞期間,無法
|
|
89
|
+
再透過 view.press("Enter") 關閉它。無人值守自動化應避免觸發同步 alert,或預先
|
|
90
|
+
提供替代的 dialog handling。
|
|
91
|
+
|
|
92
|
+
操作完成後呼叫:
|
|
93
|
+
|
|
94
|
+
view.close();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jsmdcui",
|
|
3
|
+
"version": "0.17.3",
|
|
4
|
+
"description": "Markdown as a Common UI for Terminals and Web Browsers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"bin": {
|
|
9
|
+
"jsmdcui": "./src/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "bun ./src/index.js --demo",
|
|
13
|
+
"tui": "bun ./tui",
|
|
14
|
+
"wui": "bun ./wui",
|
|
15
|
+
"edit": "bun ./edit",
|
|
16
|
+
"check": "bun ./src/index.js --check",
|
|
17
|
+
"clean": "bun ./clean.sh"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
testapp.md
|
|
2
|
+
│
|
|
3
|
+
┌──────────────┴──────────────┐
|
|
4
|
+
│ │
|
|
5
|
+
▼ ▼
|
|
6
|
+
Browser HTML TUI ANSI
|
|
7
|
+
│ │
|
|
8
|
+
javascript:foo() extract javascript:
|
|
9
|
+
│ │
|
|
10
|
+
▼ ▼
|
|
11
|
+
window.frontFunc() evalFront(frontMod, text)
|
|
12
|
+
│ │
|
|
13
|
+
└──────────────┬──────────────┘
|
|
14
|
+
▼
|
|
15
|
+
testapp.md.front.js
|
|
16
|
+
│
|
|
17
|
+
rpc.someFunc()
|
|
18
|
+
┌───────────┴───────────┐
|
|
19
|
+
│ │
|
|
20
|
+
Browser TUI
|
|
21
|
+
│ │
|
|
22
|
+
RPC Proxy client import * as rpc
|
|
23
|
+
│ from back module
|
|
24
|
+
▼ │
|
|
25
|
+
fetch rpc │
|
|
26
|
+
│ │
|
|
27
|
+
▼ │
|
|
28
|
+
server.mjs │
|
|
29
|
+
│ │
|
|
30
|
+
▼ │
|
|
31
|
+
evalBack(backMod, reqjson) │
|
|
32
|
+
│ │
|
|
33
|
+
└───────────┬───────────┘
|
|
34
|
+
▼
|
|
35
|
+
testapp.md.back.js
|