@songtonyli/dsh-cli 0.1.20 → 0.1.22
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/README.md +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +30 -22
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +30 -22
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +1037 -181
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +4 -1
- package/node_modules/@shikijs/core/LICENSE +22 -0
- package/node_modules/@shikijs/core/README.md +5 -0
- package/node_modules/@shikijs/core/dist/index.mjs +1425 -0
- package/node_modules/@shikijs/core/dist/textmate.mjs +2 -0
- package/node_modules/@shikijs/core/dist/types.mjs +2 -0
- package/node_modules/@shikijs/core/package.json +55 -0
- package/node_modules/@shikijs/engine-javascript/LICENSE +22 -0
- package/node_modules/@shikijs/engine-javascript/README.md +9 -0
- package/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs +47 -0
- package/node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs +27 -0
- package/node_modules/@shikijs/engine-javascript/dist/index.mjs +4 -0
- package/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs +77 -0
- package/node_modules/@shikijs/engine-javascript/package.json +38 -0
- package/node_modules/@shikijs/engine-oniguruma/LICENSE +22 -0
- package/node_modules/@shikijs/engine-oniguruma/README.md +9 -0
- package/node_modules/@shikijs/engine-oniguruma/dist/index.mjs +449 -0
- package/node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.mjs +8 -0
- package/node_modules/@shikijs/engine-oniguruma/package.json +41 -0
- package/node_modules/@shikijs/langs/LICENSE +22 -0
- package/node_modules/@shikijs/langs/README.md +7 -0
- package/node_modules/@shikijs/langs/dist/1c-query.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/1c.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/abap.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/actionscript-3.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/actionscript.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/ada.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/adoc.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/ahk.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/ahk1.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/ahk2.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/angular-expression.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/angular-html.mjs +16 -0
- package/node_modules/@shikijs/langs/dist/angular-inline-style.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/angular-inline-template.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/angular-let-declaration.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/angular-template-blocks.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/angular-template.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/angular-ts.mjs +18 -0
- package/node_modules/@shikijs/langs/dist/apache.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/apex.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/apl.mjs +16 -0
- package/node_modules/@shikijs/langs/dist/applescript.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/ara.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/as3.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/asciidoc.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/asm.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/astro.mjs +18 -0
- package/node_modules/@shikijs/langs/dist/awk.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/ballerina.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/bash.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/bat.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/batch.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/be.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/beancount.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/berry.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/bibtex.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/bicep.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/bird.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/bird2.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/blade.mjs +20 -0
- package/node_modules/@shikijs/langs/dist/bsl.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/c.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/c3.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/cadence.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/cairo.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/cdc.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/chapel.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/chpl.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/cjs.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/clarity.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/clj.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/clojure.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/closure-templates.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/cmake.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/cmd.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/cobol.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/codeowners.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/codeql.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/coffee.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/coffeescript.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/common-lisp.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/console.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/coq.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/cpp-macro.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/cpp.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/cql.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/crystal.mjs +18 -0
- package/node_modules/@shikijs/langs/dist/cs.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/csharp.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/css.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/csv.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/cts.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/cue.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/cypher.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/d.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/dart.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/dax.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/desktop.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/diff.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/docker.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/dockerfile.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/dotenv.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/dream-maker.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/edge.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/elisp.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/elixir.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/elm.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/erb.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/erl.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/erlang.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/es-tag-css.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/es-tag-glsl.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/es-tag-html.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/es-tag-sql.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/es-tag-xml.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/f.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/f03.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/f08.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/f18.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/f77.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/f90.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/f95.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/fennel.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/fish.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/fluent.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/for.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/fortran-fixed-form.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/fortran-free-form.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/fs.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/fsharp.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/fsl.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/ftl.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/gd.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/gdresource.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/gdscript.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/gdshader.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/genie.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/gherkin.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/git-commit.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/git-rebase.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/gjs.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/gleam.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/glimmer-js.mjs +14 -0
- package/node_modules/@shikijs/langs/dist/glimmer-ts.mjs +14 -0
- package/node_modules/@shikijs/langs/dist/glsl.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/gn.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/gnuplot.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/go.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/gql.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/graphql.mjs +14 -0
- package/node_modules/@shikijs/langs/dist/groovy.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/gts.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/hack.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/haml.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/handlebars.mjs +14 -0
- package/node_modules/@shikijs/langs/dist/haskell.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/haxe.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/hbs.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/hcl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/hjson.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/hlsl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/hs.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/html-derivative.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/html.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/http.mjs +14 -0
- package/node_modules/@shikijs/langs/dist/hurl.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/hxml.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/hy.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/imba.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/index.mjs +367 -0
- package/node_modules/@shikijs/langs/dist/ini.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/jade.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/java.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/javascript.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/jinja-html.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/jinja.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/jison.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/jl.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/js.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/json.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/json5.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/jsonc.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/jsonl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/jsonnet.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/jssm.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/jsx.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/julia.mjs +16 -0
- package/node_modules/@shikijs/langs/dist/just.mjs +18 -0
- package/node_modules/@shikijs/langs/dist/justfile.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/kdl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/kotlin.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/kql.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/kt.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/kts.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/kusto.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/latex.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/lean.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/lean4.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/less.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/liquid.mjs +14 -0
- package/node_modules/@shikijs/langs/dist/lisp.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/lit.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/llvm.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/log.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/logo.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/lua.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/luau.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/make.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/makefile.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/markdown-nix.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/markdown-vue.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/markdown.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/marko.mjs +14 -0
- package/node_modules/@shikijs/langs/dist/matlab.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/mbt.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/mbti.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/md.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/mdc.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/mdx.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/mediawiki.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/mermaid.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/mips.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/mipsasm.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/mjs.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/mmd.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/mojo.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/moonbit.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/move.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/mts.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/nar.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/narrat.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/nextflow-groovy.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/nextflow.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/nf.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/nginx.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/nim.mjs +20 -0
- package/node_modules/@shikijs/langs/dist/nix.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/nsis.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/nu.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/nushell.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/objc.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/objective-c.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/objective-cpp.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/ocaml.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/odin.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/openscad.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/org.mjs +100 -0
- package/node_modules/@shikijs/langs/dist/pascal.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/perl.mjs +16 -0
- package/node_modules/@shikijs/langs/dist/perl6.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/php.mjs +18 -0
- package/node_modules/@shikijs/langs/dist/pkl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/plsql.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/po.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/polar.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/postcss.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/pot.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/potx.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/powerquery.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/powershell.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/prisma.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/prolog.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/properties.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/proto.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/protobuf.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/ps.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/ps1.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/pug.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/puppet.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/purescript.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/pwsh.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/py.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/python.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/ql.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/qml.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/qmldir.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/qss.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/r.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/racket.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/raku.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/razor.mjs +10 -0
- package/node_modules/@shikijs/langs/dist/rb.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/rbs.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/reg.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/regex.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/regexp.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/rel.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/riscv.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/ron.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/rosmsg.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/rs.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/rst.mjs +22 -0
- package/node_modules/@shikijs/langs/dist/ruby-signature.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/ruby.mjs +30 -0
- package/node_modules/@shikijs/langs/dist/rust.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/sas.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/sass.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/scad.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/scala.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/scheme.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/scss.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/sdbl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/sh.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/shader.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/shaderlab.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/shell.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/shellscript.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/shellsession.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/smalltalk.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/smithy.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/solidity.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/soy.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/sparql.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/spl.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/splunk.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/sql.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/ssh-config.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/stata.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/styl.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/stylus.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/surql.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/surrealql.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/svelte.mjs +14 -0
- package/node_modules/@shikijs/langs/dist/swift.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/system-verilog.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/systemd.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/talon.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/talonscript.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/tasl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/tcl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/templ.mjs +12 -0
- package/node_modules/@shikijs/langs/dist/terraform.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/tex.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/tf.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/tfvars.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/toml.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/tres.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/ts-tags.mjs +18 -0
- package/node_modules/@shikijs/langs/dist/ts.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/tscn.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/tsp.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/tsv.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/tsx.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/turtle.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/twig.mjs +18 -0
- package/node_modules/@shikijs/langs/dist/typ.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/typescript.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/typespec.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/typst.mjs +120 -0
- package/node_modules/@shikijs/langs/dist/v.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/vala.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/vb.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/verilog.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/vhdl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/vim.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/viml.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/vimscript.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/vue-directives.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/vue-html.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/vue-interpolations.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/vue-vine.mjs +18 -0
- package/node_modules/@shikijs/langs/dist/vue.mjs +26 -0
- package/node_modules/@shikijs/langs/dist/vy.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/vyper.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/wasm.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/wenyan.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/wgsl.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/wiki.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/wikitext.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/wit.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/wl.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/wolfram.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/xml.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/xsl.mjs +8 -0
- package/node_modules/@shikijs/langs/dist/yaml.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/yml.mjs +2 -0
- package/node_modules/@shikijs/langs/dist/zenscript.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/zig.mjs +5 -0
- package/node_modules/@shikijs/langs/dist/zsh.mjs +2 -0
- package/node_modules/@shikijs/langs/package.json +398 -0
- package/node_modules/@shikijs/primitive/LICENSE +22 -0
- package/node_modules/@shikijs/primitive/dist/index.mjs +834 -0
- package/node_modules/@shikijs/primitive/dist/textmate.mjs +2 -0
- package/node_modules/@shikijs/primitive/dist/types.mjs +2 -0
- package/node_modules/@shikijs/primitive/package.json +51 -0
- package/node_modules/@shikijs/themes/LICENSE +22 -0
- package/node_modules/@shikijs/themes/README.md +7 -0
- package/node_modules/@shikijs/themes/dist/andromeeda.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/aurora-x.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/ayu-dark.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/ayu-light.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/ayu-mirage.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/catppuccin-frappe.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/catppuccin-latte.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/catppuccin-macchiato.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/catppuccin-mocha.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/dark-plus.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/dracula-soft.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/dracula.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/everforest-dark.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/everforest-light.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/github-dark-default.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/github-dark-dimmed.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/github-dark-high-contrast.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/github-dark.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/github-light-default.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/github-light-high-contrast.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/github-light.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/gruvbox-light-hard.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/gruvbox-light-medium.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/gruvbox-light-soft.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/horizon-bright.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/horizon.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/houston.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/index.mjs +67 -0
- package/node_modules/@shikijs/themes/dist/kanagawa-dragon.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/kanagawa-lotus.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/kanagawa-wave.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/laserwave.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/light-plus.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/material-theme-darker.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/material-theme-lighter.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/material-theme-ocean.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/material-theme-palenight.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/material-theme.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/min-dark.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/min-light.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/monokai.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/night-owl-light.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/night-owl.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/nord.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/one-dark-pro.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/one-light.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/plastic.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/poimandres.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/red.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/rose-pine-dawn.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/rose-pine-moon.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/rose-pine.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/slack-dark.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/slack-ochin.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/snazzy-light.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/solarized-dark.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/solarized-light.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/synthwave-84.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/tokyo-night.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/vesper.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/vitesse-black.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/vitesse-dark.mjs +2 -0
- package/node_modules/@shikijs/themes/dist/vitesse-light.mjs +2 -0
- package/node_modules/@shikijs/themes/package.json +103 -0
- package/node_modules/@shikijs/types/LICENSE +22 -0
- package/node_modules/@shikijs/types/README.md +7 -0
- package/node_modules/@shikijs/types/dist/index.mjs +9 -0
- package/node_modules/@shikijs/types/package.json +35 -0
- package/node_modules/@shikijs/vscode-textmate/LICENSE.md +21 -0
- package/node_modules/@shikijs/vscode-textmate/README.md +9 -0
- package/node_modules/@shikijs/vscode-textmate/dist/index.js +3216 -0
- package/node_modules/@shikijs/vscode-textmate/package.json +35 -0
- package/node_modules/@types/hast/LICENSE +21 -0
- package/node_modules/@types/hast/README.md +15 -0
- package/node_modules/@types/hast/package.json +47 -0
- package/node_modules/@types/mdast/LICENSE +21 -0
- package/node_modules/@types/mdast/README.md +15 -0
- package/node_modules/@types/mdast/package.json +46 -0
- package/node_modules/@types/unist/LICENSE +21 -0
- package/node_modules/@types/unist/README.md +15 -0
- package/node_modules/@types/unist/package.json +59 -0
- package/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml +31 -0
- package/node_modules/@ungap/structured-clone/LICENSE +15 -0
- package/node_modules/@ungap/structured-clone/README.md +95 -0
- package/node_modules/@ungap/structured-clone/cjs/deserialize.js +112 -0
- package/node_modules/@ungap/structured-clone/cjs/index.js +27 -0
- package/node_modules/@ungap/structured-clone/cjs/json.js +24 -0
- package/node_modules/@ungap/structured-clone/cjs/package.json +1 -0
- package/node_modules/@ungap/structured-clone/cjs/serialize.js +174 -0
- package/node_modules/@ungap/structured-clone/cjs/types.js +22 -0
- package/node_modules/@ungap/structured-clone/esm/deserialize.js +113 -0
- package/node_modules/@ungap/structured-clone/esm/index.js +25 -0
- package/node_modules/@ungap/structured-clone/esm/json.js +21 -0
- package/node_modules/@ungap/structured-clone/esm/serialize.js +175 -0
- package/node_modules/@ungap/structured-clone/esm/types.js +11 -0
- package/node_modules/@ungap/structured-clone/package.json +52 -0
- package/node_modules/@ungap/structured-clone/structured-json.js +1 -0
- package/node_modules/ccount/index.js +27 -0
- package/node_modules/ccount/license +22 -0
- package/node_modules/ccount/package.json +63 -0
- package/node_modules/ccount/readme.md +149 -0
- package/node_modules/character-entities-html4/index.js +259 -0
- package/node_modules/character-entities-html4/license +22 -0
- package/node_modules/character-entities-html4/package.json +70 -0
- package/node_modules/character-entities-html4/readme.md +153 -0
- package/node_modules/character-entities-legacy/index.js +113 -0
- package/node_modules/character-entities-legacy/license +22 -0
- package/node_modules/character-entities-legacy/package.json +68 -0
- package/node_modules/character-entities-legacy/readme.md +157 -0
- package/node_modules/comma-separated-tokens/index.js +74 -0
- package/node_modules/comma-separated-tokens/license +22 -0
- package/node_modules/comma-separated-tokens/package.json +64 -0
- package/node_modules/comma-separated-tokens/readme.md +167 -0
- package/node_modules/dequal/dist/index.js +86 -0
- package/node_modules/dequal/dist/index.min.js +1 -0
- package/node_modules/dequal/dist/index.mjs +84 -0
- package/node_modules/dequal/license +21 -0
- package/node_modules/dequal/lite/index.js +31 -0
- package/node_modules/dequal/lite/index.min.js +1 -0
- package/node_modules/dequal/lite/index.mjs +29 -0
- package/node_modules/dequal/package.json +51 -0
- package/node_modules/dequal/readme.md +112 -0
- package/node_modules/devlop/lib/default.js +9 -0
- package/node_modules/devlop/lib/development.js +238 -0
- package/node_modules/devlop/license +22 -0
- package/node_modules/devlop/package.json +70 -0
- package/node_modules/devlop/readme.md +360 -0
- package/node_modules/hast-util-to-html/index.js +8 -0
- package/node_modules/hast-util-to-html/lib/handle/comment.js +52 -0
- package/node_modules/hast-util-to-html/lib/handle/doctype.js +27 -0
- package/node_modules/hast-util-to-html/lib/handle/element.js +265 -0
- package/node_modules/hast-util-to-html/lib/handle/index.js +47 -0
- package/node_modules/hast-util-to-html/lib/handle/raw.js +27 -0
- package/node_modules/hast-util-to-html/lib/handle/root.js +22 -0
- package/node_modules/hast-util-to-html/lib/handle/text.js +38 -0
- package/node_modules/hast-util-to-html/lib/index.js +257 -0
- package/node_modules/hast-util-to-html/lib/omission/closing.js +358 -0
- package/node_modules/hast-util-to-html/lib/omission/omission.js +44 -0
- package/node_modules/hast-util-to-html/lib/omission/opening.js +148 -0
- package/node_modules/hast-util-to-html/lib/omission/util/siblings.js +50 -0
- package/node_modules/hast-util-to-html/license +22 -0
- package/node_modules/hast-util-to-html/package.json +99 -0
- package/node_modules/hast-util-to-html/readme.md +486 -0
- package/node_modules/hast-util-whitespace/index.js +1 -0
- package/node_modules/hast-util-whitespace/lib/index.js +34 -0
- package/node_modules/hast-util-whitespace/license +22 -0
- package/node_modules/hast-util-whitespace/package.json +75 -0
- package/node_modules/hast-util-whitespace/readme.md +231 -0
- package/node_modules/html-void-elements/index.js +27 -0
- package/node_modules/html-void-elements/license +22 -0
- package/node_modules/html-void-elements/package.json +70 -0
- package/node_modules/html-void-elements/readme.md +164 -0
- package/node_modules/mdast-util-to-hast/index.js +7 -0
- package/node_modules/mdast-util-to-hast/lib/footer.js +250 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +27 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/break.js +22 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/code.js +49 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/delete.js +27 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +27 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +70 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/heading.js +27 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/html.js +28 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +39 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/image.js +35 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/index.js +68 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +31 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +44 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/link.js +36 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +119 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/list.js +52 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +27 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/root.js +22 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/strong.js +27 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +29 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +63 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/table.js +61 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/text.js +24 -0
- package/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +27 -0
- package/node_modules/mdast-util-to-hast/lib/index.js +106 -0
- package/node_modules/mdast-util-to-hast/lib/revert.js +49 -0
- package/node_modules/mdast-util-to-hast/lib/state.js +476 -0
- package/node_modules/mdast-util-to-hast/license +22 -0
- package/node_modules/mdast-util-to-hast/package.json +111 -0
- package/node_modules/mdast-util-to-hast/readme.md +1725 -0
- package/node_modules/micromark-util-character/dev/index.js +252 -0
- package/node_modules/micromark-util-character/index.js +246 -0
- package/node_modules/micromark-util-character/license +22 -0
- package/node_modules/micromark-util-character/package.json +54 -0
- package/node_modules/micromark-util-character/readme.md +446 -0
- package/node_modules/micromark-util-encode/index.js +33 -0
- package/node_modules/micromark-util-encode/license +22 -0
- package/node_modules/micromark-util-encode/package.json +47 -0
- package/node_modules/micromark-util-encode/readme.md +176 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.js +124 -0
- package/node_modules/micromark-util-sanitize-uri/index.js +107 -0
- package/node_modules/micromark-util-sanitize-uri/license +22 -0
- package/node_modules/micromark-util-sanitize-uri/package.json +56 -0
- package/node_modules/micromark-util-sanitize-uri/readme.md +214 -0
- package/node_modules/micromark-util-symbol/lib/codes.js +158 -0
- package/node_modules/micromark-util-symbol/lib/constants.js +44 -0
- package/node_modules/micromark-util-symbol/lib/default.js +4 -0
- package/node_modules/micromark-util-symbol/lib/types.js +453 -0
- package/node_modules/micromark-util-symbol/lib/values.js +109 -0
- package/node_modules/micromark-util-symbol/license +22 -0
- package/node_modules/micromark-util-symbol/package.json +43 -0
- package/node_modules/micromark-util-symbol/readme.md +168 -0
- package/node_modules/micromark-util-types/index.js +2 -0
- package/node_modules/micromark-util-types/license +22 -0
- package/node_modules/micromark-util-types/package.json +71 -0
- package/node_modules/micromark-util-types/readme.md +151 -0
- package/node_modules/oniguruma-parser/LICENSE +21 -0
- package/node_modules/oniguruma-parser/README.md +310 -0
- package/node_modules/oniguruma-parser/dist/bundle.js +2 -0
- package/node_modules/oniguruma-parser/dist/generator/generate.js +2 -0
- package/node_modules/oniguruma-parser/dist/index.js +2 -0
- package/node_modules/oniguruma-parser/dist/oniguruma-parser.min.js +904 -0
- package/node_modules/oniguruma-parser/dist/optimizer/optimizations.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/optimize.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/alternation-to-class.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/expose-anchors.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/extract-prefix-2.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/extract-prefix.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/extract-suffix.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/merge-ranges.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/optionalize.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/prevent-redos.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/remove-empty-groups.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/remove-useless-flags.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/simplify-callouts.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/unnest-useless-classes.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/unwrap-negation-wrappers.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/unwrap-useless-classes.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/unwrap-useless-groups.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/use-shorthands.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/use-unicode-aliases.js +2 -0
- package/node_modules/oniguruma-parser/dist/optimizer/transforms/use-unicode-props.js +2 -0
- package/node_modules/oniguruma-parser/dist/parser/node-utils.js +2 -0
- package/node_modules/oniguruma-parser/dist/parser/parse.js +2 -0
- package/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js +34 -0
- package/node_modules/oniguruma-parser/dist/traverser/traverse.js +2 -0
- package/node_modules/oniguruma-parser/dist/unicode.js +872 -0
- package/node_modules/oniguruma-parser/dist/utils.js +2 -0
- package/node_modules/oniguruma-parser/package.json +56 -0
- package/node_modules/oniguruma-to-es/LICENSE +21 -0
- package/node_modules/oniguruma-to-es/README.md +1110 -0
- package/node_modules/oniguruma-to-es/dist/cjs/index.js +3145 -0
- package/node_modules/oniguruma-to-es/dist/cjs/package.json +1 -0
- package/node_modules/oniguruma-to-es/dist/esm/index.js +1878 -0
- package/node_modules/oniguruma-to-es/dist/esm/package.json +1 -0
- package/node_modules/oniguruma-to-es/dist/index.min.js +142 -0
- package/node_modules/oniguruma-to-es/package.json +49 -0
- package/node_modules/property-information/index.js +17 -0
- package/node_modules/property-information/lib/aria.js +61 -0
- package/node_modules/property-information/lib/find.js +97 -0
- package/node_modules/property-information/lib/hast-to-react.js +30 -0
- package/node_modules/property-information/lib/html.js +332 -0
- package/node_modules/property-information/lib/normalize.js +12 -0
- package/node_modules/property-information/lib/svg.js +569 -0
- package/node_modules/property-information/lib/util/case-insensitive-transform.js +13 -0
- package/node_modules/property-information/lib/util/case-sensitive-transform.js +11 -0
- package/node_modules/property-information/lib/util/create.js +69 -0
- package/node_modules/property-information/lib/util/defined-info.js +60 -0
- package/node_modules/property-information/lib/util/info.js +32 -0
- package/node_modules/property-information/lib/util/merge.js +27 -0
- package/node_modules/property-information/lib/util/schema.js +29 -0
- package/node_modules/property-information/lib/util/types.js +13 -0
- package/node_modules/property-information/lib/xlink.js +17 -0
- package/node_modules/property-information/lib/xml.js +9 -0
- package/node_modules/property-information/lib/xmlns.js +9 -0
- package/node_modules/property-information/license +22 -0
- package/node_modules/property-information/package.json +76 -0
- package/node_modules/property-information/readme.md +1073 -0
- package/node_modules/regex/LICENSE +21 -0
- package/node_modules/regex/README.md +972 -0
- package/node_modules/regex/dist/cjs/package.json +1 -0
- package/node_modules/regex/dist/cjs/regex.js +1335 -0
- package/node_modules/regex/dist/esm/package.json +1 -0
- package/node_modules/regex/dist/esm/regex.js +1313 -0
- package/node_modules/regex/dist/regex.min.js +76 -0
- package/node_modules/regex/package.json +49 -0
- package/node_modules/regex/src/atomic.js +224 -0
- package/node_modules/regex/src/backcompat.js +64 -0
- package/node_modules/regex/src/flag-n.js +49 -0
- package/node_modules/regex/src/flag-x.js +198 -0
- package/node_modules/regex/src/internals.js +2 -0
- package/node_modules/regex/src/pattern.js +45 -0
- package/node_modules/regex/src/regex.js +389 -0
- package/node_modules/regex/src/subclass.js +98 -0
- package/node_modules/regex/src/subroutines.js +375 -0
- package/node_modules/regex/src/utils-internals.js +33 -0
- package/node_modules/regex/src/utils.js +401 -0
- package/node_modules/regex-recursion/LICENSE +21 -0
- package/node_modules/regex-recursion/README.md +151 -0
- package/node_modules/regex-recursion/dist/regex-recursion.min.js +2 -0
- package/node_modules/regex-recursion/package.json +39 -0
- package/node_modules/regex-recursion/src/index.js +365 -0
- package/node_modules/regex-utilities/LICENSE +21 -0
- package/node_modules/regex-utilities/README.md +78 -0
- package/node_modules/regex-utilities/package.json +27 -0
- package/node_modules/regex-utilities/src/index.js +170 -0
- package/node_modules/shiki/LICENSE +22 -0
- package/node_modules/shiki/README.md +15 -0
- package/node_modules/shiki/dist/bundle-full.mjs +25 -0
- package/node_modules/shiki/dist/bundle-web.mjs +347 -0
- package/node_modules/shiki/dist/core-unwasm.mjs +10 -0
- package/node_modules/shiki/dist/core.mjs +3 -0
- package/node_modules/shiki/dist/engine-javascript.mjs +2 -0
- package/node_modules/shiki/dist/engine-oniguruma.mjs +8 -0
- package/node_modules/shiki/dist/index.mjs +8 -0
- package/node_modules/shiki/dist/langs/1c-query.mjs +1 -0
- package/node_modules/shiki/dist/langs/1c.mjs +1 -0
- package/node_modules/shiki/dist/langs/abap.mjs +1 -0
- package/node_modules/shiki/dist/langs/actionscript-3.mjs +1 -0
- package/node_modules/shiki/dist/langs/actionscript.mjs +1 -0
- package/node_modules/shiki/dist/langs/ada.mjs +1 -0
- package/node_modules/shiki/dist/langs/adoc.mjs +1 -0
- package/node_modules/shiki/dist/langs/ahk.mjs +1 -0
- package/node_modules/shiki/dist/langs/ahk1.mjs +1 -0
- package/node_modules/shiki/dist/langs/ahk2.mjs +1 -0
- package/node_modules/shiki/dist/langs/angular-expression.mjs +1 -0
- package/node_modules/shiki/dist/langs/angular-html.mjs +1 -0
- package/node_modules/shiki/dist/langs/angular-inline-style.mjs +1 -0
- package/node_modules/shiki/dist/langs/angular-inline-template.mjs +1 -0
- package/node_modules/shiki/dist/langs/angular-let-declaration.mjs +1 -0
- package/node_modules/shiki/dist/langs/angular-template-blocks.mjs +1 -0
- package/node_modules/shiki/dist/langs/angular-template.mjs +1 -0
- package/node_modules/shiki/dist/langs/angular-ts.mjs +1 -0
- package/node_modules/shiki/dist/langs/apache.mjs +1 -0
- package/node_modules/shiki/dist/langs/apex.mjs +1 -0
- package/node_modules/shiki/dist/langs/apl.mjs +1 -0
- package/node_modules/shiki/dist/langs/applescript.mjs +1 -0
- package/node_modules/shiki/dist/langs/ara.mjs +1 -0
- package/node_modules/shiki/dist/langs/as3.mjs +1 -0
- package/node_modules/shiki/dist/langs/asciidoc.mjs +1 -0
- package/node_modules/shiki/dist/langs/asm.mjs +1 -0
- package/node_modules/shiki/dist/langs/astro.mjs +1 -0
- package/node_modules/shiki/dist/langs/awk.mjs +1 -0
- package/node_modules/shiki/dist/langs/ballerina.mjs +1 -0
- package/node_modules/shiki/dist/langs/bash.mjs +1 -0
- package/node_modules/shiki/dist/langs/bat.mjs +1 -0
- package/node_modules/shiki/dist/langs/batch.mjs +1 -0
- package/node_modules/shiki/dist/langs/be.mjs +1 -0
- package/node_modules/shiki/dist/langs/beancount.mjs +1 -0
- package/node_modules/shiki/dist/langs/berry.mjs +1 -0
- package/node_modules/shiki/dist/langs/bibtex.mjs +1 -0
- package/node_modules/shiki/dist/langs/bicep.mjs +1 -0
- package/node_modules/shiki/dist/langs/bird.mjs +1 -0
- package/node_modules/shiki/dist/langs/bird2.mjs +1 -0
- package/node_modules/shiki/dist/langs/blade.mjs +1 -0
- package/node_modules/shiki/dist/langs/bsl.mjs +1 -0
- package/node_modules/shiki/dist/langs/c.mjs +1 -0
- package/node_modules/shiki/dist/langs/c3.mjs +1 -0
- package/node_modules/shiki/dist/langs/cadence.mjs +1 -0
- package/node_modules/shiki/dist/langs/cairo.mjs +1 -0
- package/node_modules/shiki/dist/langs/cdc.mjs +1 -0
- package/node_modules/shiki/dist/langs/chapel.mjs +1 -0
- package/node_modules/shiki/dist/langs/chpl.mjs +1 -0
- package/node_modules/shiki/dist/langs/cjs.mjs +1 -0
- package/node_modules/shiki/dist/langs/clarity.mjs +1 -0
- package/node_modules/shiki/dist/langs/clj.mjs +1 -0
- package/node_modules/shiki/dist/langs/clojure.mjs +1 -0
- package/node_modules/shiki/dist/langs/closure-templates.mjs +1 -0
- package/node_modules/shiki/dist/langs/cmake.mjs +1 -0
- package/node_modules/shiki/dist/langs/cmd.mjs +1 -0
- package/node_modules/shiki/dist/langs/cobol.mjs +1 -0
- package/node_modules/shiki/dist/langs/codeowners.mjs +1 -0
- package/node_modules/shiki/dist/langs/codeql.mjs +1 -0
- package/node_modules/shiki/dist/langs/coffee.mjs +1 -0
- package/node_modules/shiki/dist/langs/coffeescript.mjs +1 -0
- package/node_modules/shiki/dist/langs/common-lisp.mjs +1 -0
- package/node_modules/shiki/dist/langs/console.mjs +1 -0
- package/node_modules/shiki/dist/langs/coq.mjs +1 -0
- package/node_modules/shiki/dist/langs/cpp-macro.mjs +1 -0
- package/node_modules/shiki/dist/langs/cpp.mjs +1 -0
- package/node_modules/shiki/dist/langs/cql.mjs +1 -0
- package/node_modules/shiki/dist/langs/crystal.mjs +1 -0
- package/node_modules/shiki/dist/langs/cs.mjs +1 -0
- package/node_modules/shiki/dist/langs/csharp.mjs +1 -0
- package/node_modules/shiki/dist/langs/css.mjs +1 -0
- package/node_modules/shiki/dist/langs/csv.mjs +1 -0
- package/node_modules/shiki/dist/langs/cts.mjs +1 -0
- package/node_modules/shiki/dist/langs/cue.mjs +1 -0
- package/node_modules/shiki/dist/langs/cypher.mjs +1 -0
- package/node_modules/shiki/dist/langs/d.mjs +1 -0
- package/node_modules/shiki/dist/langs/dart.mjs +1 -0
- package/node_modules/shiki/dist/langs/dax.mjs +1 -0
- package/node_modules/shiki/dist/langs/desktop.mjs +1 -0
- package/node_modules/shiki/dist/langs/diff.mjs +1 -0
- package/node_modules/shiki/dist/langs/docker.mjs +1 -0
- package/node_modules/shiki/dist/langs/dockerfile.mjs +1 -0
- package/node_modules/shiki/dist/langs/dotenv.mjs +1 -0
- package/node_modules/shiki/dist/langs/dream-maker.mjs +1 -0
- package/node_modules/shiki/dist/langs/edge.mjs +1 -0
- package/node_modules/shiki/dist/langs/elisp.mjs +1 -0
- package/node_modules/shiki/dist/langs/elixir.mjs +1 -0
- package/node_modules/shiki/dist/langs/elm.mjs +1 -0
- package/node_modules/shiki/dist/langs/emacs-lisp.mjs +1 -0
- package/node_modules/shiki/dist/langs/erb.mjs +1 -0
- package/node_modules/shiki/dist/langs/erl.mjs +1 -0
- package/node_modules/shiki/dist/langs/erlang.mjs +1 -0
- package/node_modules/shiki/dist/langs/es-tag-css.mjs +1 -0
- package/node_modules/shiki/dist/langs/es-tag-glsl.mjs +1 -0
- package/node_modules/shiki/dist/langs/es-tag-html.mjs +1 -0
- package/node_modules/shiki/dist/langs/es-tag-sql.mjs +1 -0
- package/node_modules/shiki/dist/langs/es-tag-xml.mjs +1 -0
- package/node_modules/shiki/dist/langs/f.mjs +1 -0
- package/node_modules/shiki/dist/langs/f03.mjs +1 -0
- package/node_modules/shiki/dist/langs/f08.mjs +1 -0
- package/node_modules/shiki/dist/langs/f18.mjs +1 -0
- package/node_modules/shiki/dist/langs/f77.mjs +1 -0
- package/node_modules/shiki/dist/langs/f90.mjs +1 -0
- package/node_modules/shiki/dist/langs/f95.mjs +1 -0
- package/node_modules/shiki/dist/langs/fennel.mjs +1 -0
- package/node_modules/shiki/dist/langs/fish.mjs +1 -0
- package/node_modules/shiki/dist/langs/fluent.mjs +1 -0
- package/node_modules/shiki/dist/langs/for.mjs +1 -0
- package/node_modules/shiki/dist/langs/fortran-fixed-form.mjs +1 -0
- package/node_modules/shiki/dist/langs/fortran-free-form.mjs +1 -0
- package/node_modules/shiki/dist/langs/fs.mjs +1 -0
- package/node_modules/shiki/dist/langs/fsharp.mjs +1 -0
- package/node_modules/shiki/dist/langs/fsl.mjs +1 -0
- package/node_modules/shiki/dist/langs/ftl.mjs +1 -0
- package/node_modules/shiki/dist/langs/gd.mjs +1 -0
- package/node_modules/shiki/dist/langs/gdresource.mjs +1 -0
- package/node_modules/shiki/dist/langs/gdscript.mjs +1 -0
- package/node_modules/shiki/dist/langs/gdshader.mjs +1 -0
- package/node_modules/shiki/dist/langs/genie.mjs +1 -0
- package/node_modules/shiki/dist/langs/gherkin.mjs +1 -0
- package/node_modules/shiki/dist/langs/git-commit.mjs +1 -0
- package/node_modules/shiki/dist/langs/git-rebase.mjs +1 -0
- package/node_modules/shiki/dist/langs/gjs.mjs +1 -0
- package/node_modules/shiki/dist/langs/gleam.mjs +1 -0
- package/node_modules/shiki/dist/langs/glimmer-js.mjs +1 -0
- package/node_modules/shiki/dist/langs/glimmer-ts.mjs +1 -0
- package/node_modules/shiki/dist/langs/glsl.mjs +1 -0
- package/node_modules/shiki/dist/langs/gn.mjs +1 -0
- package/node_modules/shiki/dist/langs/gnuplot.mjs +1 -0
- package/node_modules/shiki/dist/langs/go.mjs +1 -0
- package/node_modules/shiki/dist/langs/gql.mjs +1 -0
- package/node_modules/shiki/dist/langs/graphql.mjs +1 -0
- package/node_modules/shiki/dist/langs/groovy.mjs +1 -0
- package/node_modules/shiki/dist/langs/gts.mjs +1 -0
- package/node_modules/shiki/dist/langs/hack.mjs +1 -0
- package/node_modules/shiki/dist/langs/haml.mjs +1 -0
- package/node_modules/shiki/dist/langs/handlebars.mjs +1 -0
- package/node_modules/shiki/dist/langs/haskell.mjs +1 -0
- package/node_modules/shiki/dist/langs/haxe.mjs +1 -0
- package/node_modules/shiki/dist/langs/hbs.mjs +1 -0
- package/node_modules/shiki/dist/langs/hcl.mjs +1 -0
- package/node_modules/shiki/dist/langs/hjson.mjs +1 -0
- package/node_modules/shiki/dist/langs/hlsl.mjs +1 -0
- package/node_modules/shiki/dist/langs/hs.mjs +1 -0
- package/node_modules/shiki/dist/langs/html-derivative.mjs +1 -0
- package/node_modules/shiki/dist/langs/html.mjs +1 -0
- package/node_modules/shiki/dist/langs/http.mjs +1 -0
- package/node_modules/shiki/dist/langs/hurl.mjs +1 -0
- package/node_modules/shiki/dist/langs/hxml.mjs +1 -0
- package/node_modules/shiki/dist/langs/hy.mjs +1 -0
- package/node_modules/shiki/dist/langs/imba.mjs +1 -0
- package/node_modules/shiki/dist/langs/ini.mjs +1 -0
- package/node_modules/shiki/dist/langs/jade.mjs +1 -0
- package/node_modules/shiki/dist/langs/java.mjs +1 -0
- package/node_modules/shiki/dist/langs/javascript.mjs +1 -0
- package/node_modules/shiki/dist/langs/jinja-html.mjs +1 -0
- package/node_modules/shiki/dist/langs/jinja.mjs +1 -0
- package/node_modules/shiki/dist/langs/jison.mjs +1 -0
- package/node_modules/shiki/dist/langs/jl.mjs +1 -0
- package/node_modules/shiki/dist/langs/js.mjs +1 -0
- package/node_modules/shiki/dist/langs/json.mjs +1 -0
- package/node_modules/shiki/dist/langs/json5.mjs +1 -0
- package/node_modules/shiki/dist/langs/jsonc.mjs +1 -0
- package/node_modules/shiki/dist/langs/jsonl.mjs +1 -0
- package/node_modules/shiki/dist/langs/jsonnet.mjs +1 -0
- package/node_modules/shiki/dist/langs/jssm.mjs +1 -0
- package/node_modules/shiki/dist/langs/jsx.mjs +1 -0
- package/node_modules/shiki/dist/langs/julia.mjs +1 -0
- package/node_modules/shiki/dist/langs/just.mjs +1 -0
- package/node_modules/shiki/dist/langs/justfile.mjs +1 -0
- package/node_modules/shiki/dist/langs/kdl.mjs +1 -0
- package/node_modules/shiki/dist/langs/kotlin.mjs +1 -0
- package/node_modules/shiki/dist/langs/kql.mjs +1 -0
- package/node_modules/shiki/dist/langs/kt.mjs +1 -0
- package/node_modules/shiki/dist/langs/kts.mjs +1 -0
- package/node_modules/shiki/dist/langs/kusto.mjs +1 -0
- package/node_modules/shiki/dist/langs/latex.mjs +1 -0
- package/node_modules/shiki/dist/langs/lean.mjs +1 -0
- package/node_modules/shiki/dist/langs/lean4.mjs +1 -0
- package/node_modules/shiki/dist/langs/less.mjs +1 -0
- package/node_modules/shiki/dist/langs/liquid.mjs +1 -0
- package/node_modules/shiki/dist/langs/lisp.mjs +1 -0
- package/node_modules/shiki/dist/langs/lit.mjs +1 -0
- package/node_modules/shiki/dist/langs/llvm.mjs +1 -0
- package/node_modules/shiki/dist/langs/log.mjs +1 -0
- package/node_modules/shiki/dist/langs/logo.mjs +1 -0
- package/node_modules/shiki/dist/langs/lua.mjs +1 -0
- package/node_modules/shiki/dist/langs/luau.mjs +1 -0
- package/node_modules/shiki/dist/langs/make.mjs +1 -0
- package/node_modules/shiki/dist/langs/makefile.mjs +1 -0
- package/node_modules/shiki/dist/langs/markdown-nix.mjs +1 -0
- package/node_modules/shiki/dist/langs/markdown-vue.mjs +1 -0
- package/node_modules/shiki/dist/langs/markdown.mjs +1 -0
- package/node_modules/shiki/dist/langs/marko.mjs +1 -0
- package/node_modules/shiki/dist/langs/matlab.mjs +1 -0
- package/node_modules/shiki/dist/langs/mbt.mjs +1 -0
- package/node_modules/shiki/dist/langs/mbti.mjs +1 -0
- package/node_modules/shiki/dist/langs/md.mjs +1 -0
- package/node_modules/shiki/dist/langs/mdc.mjs +1 -0
- package/node_modules/shiki/dist/langs/mdx.mjs +1 -0
- package/node_modules/shiki/dist/langs/mediawiki.mjs +1 -0
- package/node_modules/shiki/dist/langs/mermaid.mjs +1 -0
- package/node_modules/shiki/dist/langs/mips.mjs +1 -0
- package/node_modules/shiki/dist/langs/mipsasm.mjs +1 -0
- package/node_modules/shiki/dist/langs/mjs.mjs +1 -0
- package/node_modules/shiki/dist/langs/mmd.mjs +1 -0
- package/node_modules/shiki/dist/langs/mojo.mjs +1 -0
- package/node_modules/shiki/dist/langs/moonbit.mjs +1 -0
- package/node_modules/shiki/dist/langs/move.mjs +1 -0
- package/node_modules/shiki/dist/langs/mts.mjs +1 -0
- package/node_modules/shiki/dist/langs/nar.mjs +1 -0
- package/node_modules/shiki/dist/langs/narrat.mjs +1 -0
- package/node_modules/shiki/dist/langs/nextflow-groovy.mjs +1 -0
- package/node_modules/shiki/dist/langs/nextflow.mjs +1 -0
- package/node_modules/shiki/dist/langs/nf.mjs +1 -0
- package/node_modules/shiki/dist/langs/nginx.mjs +1 -0
- package/node_modules/shiki/dist/langs/nim.mjs +1 -0
- package/node_modules/shiki/dist/langs/nix.mjs +1 -0
- package/node_modules/shiki/dist/langs/nsis.mjs +1 -0
- package/node_modules/shiki/dist/langs/nu.mjs +1 -0
- package/node_modules/shiki/dist/langs/nushell.mjs +1 -0
- package/node_modules/shiki/dist/langs/objc.mjs +1 -0
- package/node_modules/shiki/dist/langs/objective-c.mjs +1 -0
- package/node_modules/shiki/dist/langs/objective-cpp.mjs +1 -0
- package/node_modules/shiki/dist/langs/ocaml.mjs +1 -0
- package/node_modules/shiki/dist/langs/odin.mjs +1 -0
- package/node_modules/shiki/dist/langs/openscad.mjs +1 -0
- package/node_modules/shiki/dist/langs/org.mjs +1 -0
- package/node_modules/shiki/dist/langs/pascal.mjs +1 -0
- package/node_modules/shiki/dist/langs/perl.mjs +1 -0
- package/node_modules/shiki/dist/langs/perl6.mjs +1 -0
- package/node_modules/shiki/dist/langs/php.mjs +1 -0
- package/node_modules/shiki/dist/langs/pkl.mjs +1 -0
- package/node_modules/shiki/dist/langs/plsql.mjs +1 -0
- package/node_modules/shiki/dist/langs/po.mjs +1 -0
- package/node_modules/shiki/dist/langs/polar.mjs +1 -0
- package/node_modules/shiki/dist/langs/postcss.mjs +1 -0
- package/node_modules/shiki/dist/langs/pot.mjs +1 -0
- package/node_modules/shiki/dist/langs/potx.mjs +1 -0
- package/node_modules/shiki/dist/langs/powerquery.mjs +1 -0
- package/node_modules/shiki/dist/langs/powershell.mjs +1 -0
- package/node_modules/shiki/dist/langs/prisma.mjs +1 -0
- package/node_modules/shiki/dist/langs/prolog.mjs +1 -0
- package/node_modules/shiki/dist/langs/properties.mjs +1 -0
- package/node_modules/shiki/dist/langs/proto.mjs +1 -0
- package/node_modules/shiki/dist/langs/protobuf.mjs +1 -0
- package/node_modules/shiki/dist/langs/ps.mjs +1 -0
- package/node_modules/shiki/dist/langs/ps1.mjs +1 -0
- package/node_modules/shiki/dist/langs/pug.mjs +1 -0
- package/node_modules/shiki/dist/langs/puppet.mjs +1 -0
- package/node_modules/shiki/dist/langs/purescript.mjs +1 -0
- package/node_modules/shiki/dist/langs/pwsh.mjs +1 -0
- package/node_modules/shiki/dist/langs/py.mjs +1 -0
- package/node_modules/shiki/dist/langs/python.mjs +1 -0
- package/node_modules/shiki/dist/langs/ql.mjs +1 -0
- package/node_modules/shiki/dist/langs/qml.mjs +1 -0
- package/node_modules/shiki/dist/langs/qmldir.mjs +1 -0
- package/node_modules/shiki/dist/langs/qss.mjs +1 -0
- package/node_modules/shiki/dist/langs/r.mjs +1 -0
- package/node_modules/shiki/dist/langs/racket.mjs +1 -0
- package/node_modules/shiki/dist/langs/raku.mjs +1 -0
- package/node_modules/shiki/dist/langs/razor.mjs +1 -0
- package/node_modules/shiki/dist/langs/rb.mjs +1 -0
- package/node_modules/shiki/dist/langs/rbs.mjs +1 -0
- package/node_modules/shiki/dist/langs/reg.mjs +1 -0
- package/node_modules/shiki/dist/langs/regex.mjs +1 -0
- package/node_modules/shiki/dist/langs/regexp.mjs +1 -0
- package/node_modules/shiki/dist/langs/rel.mjs +1 -0
- package/node_modules/shiki/dist/langs/riscv.mjs +1 -0
- package/node_modules/shiki/dist/langs/ron.mjs +1 -0
- package/node_modules/shiki/dist/langs/rosmsg.mjs +1 -0
- package/node_modules/shiki/dist/langs/rs.mjs +1 -0
- package/node_modules/shiki/dist/langs/rst.mjs +1 -0
- package/node_modules/shiki/dist/langs/ruby-signature.mjs +1 -0
- package/node_modules/shiki/dist/langs/ruby.mjs +1 -0
- package/node_modules/shiki/dist/langs/rust.mjs +1 -0
- package/node_modules/shiki/dist/langs/sas.mjs +1 -0
- package/node_modules/shiki/dist/langs/sass.mjs +1 -0
- package/node_modules/shiki/dist/langs/scad.mjs +1 -0
- package/node_modules/shiki/dist/langs/scala.mjs +1 -0
- package/node_modules/shiki/dist/langs/scheme.mjs +1 -0
- package/node_modules/shiki/dist/langs/scss.mjs +1 -0
- package/node_modules/shiki/dist/langs/sdbl.mjs +1 -0
- package/node_modules/shiki/dist/langs/sh.mjs +1 -0
- package/node_modules/shiki/dist/langs/shader.mjs +1 -0
- package/node_modules/shiki/dist/langs/shaderlab.mjs +1 -0
- package/node_modules/shiki/dist/langs/shell.mjs +1 -0
- package/node_modules/shiki/dist/langs/shellscript.mjs +1 -0
- package/node_modules/shiki/dist/langs/shellsession.mjs +1 -0
- package/node_modules/shiki/dist/langs/smalltalk.mjs +1 -0
- package/node_modules/shiki/dist/langs/smithy.mjs +1 -0
- package/node_modules/shiki/dist/langs/solidity.mjs +1 -0
- package/node_modules/shiki/dist/langs/soy.mjs +1 -0
- package/node_modules/shiki/dist/langs/sparql.mjs +1 -0
- package/node_modules/shiki/dist/langs/spl.mjs +1 -0
- package/node_modules/shiki/dist/langs/splunk.mjs +1 -0
- package/node_modules/shiki/dist/langs/sql.mjs +1 -0
- package/node_modules/shiki/dist/langs/ssh-config.mjs +1 -0
- package/node_modules/shiki/dist/langs/stata.mjs +1 -0
- package/node_modules/shiki/dist/langs/styl.mjs +1 -0
- package/node_modules/shiki/dist/langs/stylus.mjs +1 -0
- package/node_modules/shiki/dist/langs/surql.mjs +1 -0
- package/node_modules/shiki/dist/langs/surrealql.mjs +1 -0
- package/node_modules/shiki/dist/langs/svelte.mjs +1 -0
- package/node_modules/shiki/dist/langs/swift.mjs +1 -0
- package/node_modules/shiki/dist/langs/system-verilog.mjs +1 -0
- package/node_modules/shiki/dist/langs/systemd.mjs +1 -0
- package/node_modules/shiki/dist/langs/talon.mjs +1 -0
- package/node_modules/shiki/dist/langs/talonscript.mjs +1 -0
- package/node_modules/shiki/dist/langs/tasl.mjs +1 -0
- package/node_modules/shiki/dist/langs/tcl.mjs +1 -0
- package/node_modules/shiki/dist/langs/templ.mjs +1 -0
- package/node_modules/shiki/dist/langs/terraform.mjs +1 -0
- package/node_modules/shiki/dist/langs/tex.mjs +1 -0
- package/node_modules/shiki/dist/langs/tf.mjs +1 -0
- package/node_modules/shiki/dist/langs/tfvars.mjs +1 -0
- package/node_modules/shiki/dist/langs/toml.mjs +1 -0
- package/node_modules/shiki/dist/langs/tres.mjs +1 -0
- package/node_modules/shiki/dist/langs/ts-tags.mjs +1 -0
- package/node_modules/shiki/dist/langs/ts.mjs +1 -0
- package/node_modules/shiki/dist/langs/tscn.mjs +1 -0
- package/node_modules/shiki/dist/langs/tsp.mjs +1 -0
- package/node_modules/shiki/dist/langs/tsv.mjs +1 -0
- package/node_modules/shiki/dist/langs/tsx.mjs +1 -0
- package/node_modules/shiki/dist/langs/turtle.mjs +1 -0
- package/node_modules/shiki/dist/langs/twig.mjs +1 -0
- package/node_modules/shiki/dist/langs/typ.mjs +1 -0
- package/node_modules/shiki/dist/langs/typescript.mjs +1 -0
- package/node_modules/shiki/dist/langs/typespec.mjs +1 -0
- package/node_modules/shiki/dist/langs/typst.mjs +1 -0
- package/node_modules/shiki/dist/langs/v.mjs +1 -0
- package/node_modules/shiki/dist/langs/vala.mjs +1 -0
- package/node_modules/shiki/dist/langs/vb.mjs +1 -0
- package/node_modules/shiki/dist/langs/verilog.mjs +1 -0
- package/node_modules/shiki/dist/langs/vhdl.mjs +1 -0
- package/node_modules/shiki/dist/langs/vim.mjs +1 -0
- package/node_modules/shiki/dist/langs/viml.mjs +1 -0
- package/node_modules/shiki/dist/langs/vimscript.mjs +1 -0
- package/node_modules/shiki/dist/langs/vue-directives.mjs +1 -0
- package/node_modules/shiki/dist/langs/vue-html.mjs +1 -0
- package/node_modules/shiki/dist/langs/vue-interpolations.mjs +1 -0
- package/node_modules/shiki/dist/langs/vue-sfc-style-variable-injection.mjs +1 -0
- package/node_modules/shiki/dist/langs/vue-vine.mjs +1 -0
- package/node_modules/shiki/dist/langs/vue.mjs +1 -0
- package/node_modules/shiki/dist/langs/vy.mjs +1 -0
- package/node_modules/shiki/dist/langs/vyper.mjs +1 -0
- package/node_modules/shiki/dist/langs/wasm.mjs +1 -0
- package/node_modules/shiki/dist/langs/wenyan.mjs +1 -0
- package/node_modules/shiki/dist/langs/wgsl.mjs +1 -0
- package/node_modules/shiki/dist/langs/wiki.mjs +1 -0
- package/node_modules/shiki/dist/langs/wikitext.mjs +1 -0
- package/node_modules/shiki/dist/langs/wit.mjs +1 -0
- package/node_modules/shiki/dist/langs/wl.mjs +1 -0
- package/node_modules/shiki/dist/langs/wolfram.mjs +1 -0
- package/node_modules/shiki/dist/langs/xml.mjs +1 -0
- package/node_modules/shiki/dist/langs/xsl.mjs +1 -0
- package/node_modules/shiki/dist/langs/yaml.mjs +1 -0
- package/node_modules/shiki/dist/langs/yml.mjs +1 -0
- package/node_modules/shiki/dist/langs/zenscript.mjs +1 -0
- package/node_modules/shiki/dist/langs/zig.mjs +1 -0
- package/node_modules/shiki/dist/langs/zsh.mjs +1 -0
- package/node_modules/shiki/dist/langs-bundle-full-xQVO1Cek.mjs +1326 -0
- package/node_modules/shiki/dist/langs.mjs +2 -0
- package/node_modules/shiki/dist/onig.wasm +0 -0
- package/node_modules/shiki/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/node_modules/shiki/dist/textmate.mjs +2 -0
- package/node_modules/shiki/dist/themes/andromeeda.mjs +1 -0
- package/node_modules/shiki/dist/themes/aurora-x.mjs +1 -0
- package/node_modules/shiki/dist/themes/ayu-dark.mjs +1 -0
- package/node_modules/shiki/dist/themes/ayu-light.mjs +1 -0
- package/node_modules/shiki/dist/themes/ayu-mirage.mjs +1 -0
- package/node_modules/shiki/dist/themes/catppuccin-frappe.mjs +1 -0
- package/node_modules/shiki/dist/themes/catppuccin-latte.mjs +1 -0
- package/node_modules/shiki/dist/themes/catppuccin-macchiato.mjs +1 -0
- package/node_modules/shiki/dist/themes/catppuccin-mocha.mjs +1 -0
- package/node_modules/shiki/dist/themes/dark-plus.mjs +1 -0
- package/node_modules/shiki/dist/themes/dracula-soft.mjs +1 -0
- package/node_modules/shiki/dist/themes/dracula.mjs +1 -0
- package/node_modules/shiki/dist/themes/everforest-dark.mjs +1 -0
- package/node_modules/shiki/dist/themes/everforest-light.mjs +1 -0
- package/node_modules/shiki/dist/themes/github-dark-default.mjs +1 -0
- package/node_modules/shiki/dist/themes/github-dark-dimmed.mjs +1 -0
- package/node_modules/shiki/dist/themes/github-dark-high-contrast.mjs +1 -0
- package/node_modules/shiki/dist/themes/github-dark.mjs +1 -0
- package/node_modules/shiki/dist/themes/github-light-default.mjs +1 -0
- package/node_modules/shiki/dist/themes/github-light-high-contrast.mjs +1 -0
- package/node_modules/shiki/dist/themes/github-light.mjs +1 -0
- package/node_modules/shiki/dist/themes/gruvbox-dark-hard.mjs +1 -0
- package/node_modules/shiki/dist/themes/gruvbox-dark-medium.mjs +1 -0
- package/node_modules/shiki/dist/themes/gruvbox-dark-soft.mjs +1 -0
- package/node_modules/shiki/dist/themes/gruvbox-light-hard.mjs +1 -0
- package/node_modules/shiki/dist/themes/gruvbox-light-medium.mjs +1 -0
- package/node_modules/shiki/dist/themes/gruvbox-light-soft.mjs +1 -0
- package/node_modules/shiki/dist/themes/horizon-bright.mjs +1 -0
- package/node_modules/shiki/dist/themes/horizon.mjs +1 -0
- package/node_modules/shiki/dist/themes/houston.mjs +1 -0
- package/node_modules/shiki/dist/themes/kanagawa-dragon.mjs +1 -0
- package/node_modules/shiki/dist/themes/kanagawa-lotus.mjs +1 -0
- package/node_modules/shiki/dist/themes/kanagawa-wave.mjs +1 -0
- package/node_modules/shiki/dist/themes/laserwave.mjs +1 -0
- package/node_modules/shiki/dist/themes/light-plus.mjs +1 -0
- package/node_modules/shiki/dist/themes/material-theme-darker.mjs +1 -0
- package/node_modules/shiki/dist/themes/material-theme-lighter.mjs +1 -0
- package/node_modules/shiki/dist/themes/material-theme-ocean.mjs +1 -0
- package/node_modules/shiki/dist/themes/material-theme-palenight.mjs +1 -0
- package/node_modules/shiki/dist/themes/material-theme.mjs +1 -0
- package/node_modules/shiki/dist/themes/min-dark.mjs +1 -0
- package/node_modules/shiki/dist/themes/min-light.mjs +1 -0
- package/node_modules/shiki/dist/themes/monokai.mjs +1 -0
- package/node_modules/shiki/dist/themes/night-owl-light.mjs +1 -0
- package/node_modules/shiki/dist/themes/night-owl.mjs +1 -0
- package/node_modules/shiki/dist/themes/nord.mjs +1 -0
- package/node_modules/shiki/dist/themes/one-dark-pro.mjs +1 -0
- package/node_modules/shiki/dist/themes/one-light.mjs +1 -0
- package/node_modules/shiki/dist/themes/plastic.mjs +1 -0
- package/node_modules/shiki/dist/themes/poimandres.mjs +1 -0
- package/node_modules/shiki/dist/themes/red.mjs +1 -0
- package/node_modules/shiki/dist/themes/rose-pine-dawn.mjs +1 -0
- package/node_modules/shiki/dist/themes/rose-pine-moon.mjs +1 -0
- package/node_modules/shiki/dist/themes/rose-pine.mjs +1 -0
- package/node_modules/shiki/dist/themes/slack-dark.mjs +1 -0
- package/node_modules/shiki/dist/themes/slack-ochin.mjs +1 -0
- package/node_modules/shiki/dist/themes/snazzy-light.mjs +1 -0
- package/node_modules/shiki/dist/themes/solarized-dark.mjs +1 -0
- package/node_modules/shiki/dist/themes/solarized-light.mjs +1 -0
- package/node_modules/shiki/dist/themes/synthwave-84.mjs +1 -0
- package/node_modules/shiki/dist/themes/tokyo-night.mjs +1 -0
- package/node_modules/shiki/dist/themes/vesper.mjs +1 -0
- package/node_modules/shiki/dist/themes/vitesse-black.mjs +1 -0
- package/node_modules/shiki/dist/themes/vitesse-dark.mjs +1 -0
- package/node_modules/shiki/dist/themes/vitesse-light.mjs +1 -0
- package/node_modules/shiki/dist/themes.mjs +396 -0
- package/node_modules/shiki/dist/types.mjs +1 -0
- package/node_modules/shiki/dist/wasm.mjs +3 -0
- package/node_modules/shiki/package.json +67 -0
- package/node_modules/space-separated-tokens/index.js +24 -0
- package/node_modules/space-separated-tokens/license +22 -0
- package/node_modules/space-separated-tokens/package.json +59 -0
- package/node_modules/space-separated-tokens/readme.md +156 -0
- package/node_modules/stringify-entities/index.js +6 -0
- package/node_modules/stringify-entities/lib/constant/dangerous.js +16 -0
- package/node_modules/stringify-entities/lib/core.js +117 -0
- package/node_modules/stringify-entities/lib/index.js +36 -0
- package/node_modules/stringify-entities/lib/util/format-basic.js +9 -0
- package/node_modules/stringify-entities/lib/util/format-smart.js +69 -0
- package/node_modules/stringify-entities/lib/util/to-decimal.js +16 -0
- package/node_modules/stringify-entities/lib/util/to-hexadecimal.js +16 -0
- package/node_modules/stringify-entities/lib/util/to-named.js +57 -0
- package/node_modules/stringify-entities/license +22 -0
- package/node_modules/stringify-entities/package.json +77 -0
- package/node_modules/stringify-entities/readme.md +233 -0
- package/node_modules/trim-lines/index.js +69 -0
- package/node_modules/trim-lines/license +22 -0
- package/node_modules/trim-lines/package.json +58 -0
- package/node_modules/trim-lines/readme.md +125 -0
- package/node_modules/unist-util-is/index.js +7 -0
- package/node_modules/unist-util-is/lib/index.js +296 -0
- package/node_modules/unist-util-is/license +22 -0
- package/node_modules/unist-util-is/package.json +95 -0
- package/node_modules/unist-util-is/readme.md +351 -0
- package/node_modules/unist-util-position/index.js +1 -0
- package/node_modules/unist-util-position/lib/index.js +95 -0
- package/node_modules/unist-util-position/license +22 -0
- package/node_modules/unist-util-position/package.json +68 -0
- package/node_modules/unist-util-position/readme.md +243 -0
- package/node_modules/unist-util-stringify-position/index.js +1 -0
- package/node_modules/unist-util-stringify-position/lib/index.js +84 -0
- package/node_modules/unist-util-stringify-position/license +22 -0
- package/node_modules/unist-util-stringify-position/package.json +72 -0
- package/node_modules/unist-util-stringify-position/readme.md +206 -0
- package/node_modules/unist-util-visit/index.js +2 -0
- package/node_modules/unist-util-visit/lib/index.js +312 -0
- package/node_modules/unist-util-visit/license +22 -0
- package/node_modules/unist-util-visit/package.json +100 -0
- package/node_modules/unist-util-visit/readme.md +313 -0
- package/node_modules/unist-util-visit-parents/index.js +2 -0
- package/node_modules/unist-util-visit-parents/lib/color.js +7 -0
- package/node_modules/unist-util-visit-parents/lib/color.node.js +7 -0
- package/node_modules/unist-util-visit-parents/lib/index.js +399 -0
- package/node_modules/unist-util-visit-parents/license +22 -0
- package/node_modules/unist-util-visit-parents/package.json +98 -0
- package/node_modules/unist-util-visit-parents/readme.md +388 -0
- package/node_modules/vfile/index.js +2 -0
- package/node_modules/vfile/lib/index.js +643 -0
- package/node_modules/vfile/lib/minpath.browser.js +426 -0
- package/node_modules/vfile/lib/minpath.js +1 -0
- package/node_modules/vfile/lib/minproc.browser.js +8 -0
- package/node_modules/vfile/lib/minproc.js +1 -0
- package/node_modules/vfile/lib/minurl.browser.js +76 -0
- package/node_modules/vfile/lib/minurl.js +2 -0
- package/node_modules/vfile/lib/minurl.shared.js +31 -0
- package/node_modules/vfile/license +21 -0
- package/node_modules/vfile/package.json +126 -0
- package/node_modules/vfile/readme.md +785 -0
- package/node_modules/vfile-message/index.js +5 -0
- package/node_modules/vfile-message/lib/index.js +314 -0
- package/node_modules/vfile-message/license +22 -0
- package/node_modules/vfile-message/package.json +72 -0
- package/node_modules/vfile-message/readme.md +252 -0
- package/node_modules/zwitch/index.js +118 -0
- package/node_modules/zwitch/license +22 -0
- package/node_modules/zwitch/package.json +64 -0
- package/node_modules/zwitch/readme.md +226 -0
- package/package.json +93 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { CURSOR_MARKER, Container, Editor, Input, Loader, Markdown, ProcessTerminal, SelectList, Text, TuiMainScreen, decodeKittyPrintable, fuzzyFilter, matchesKey, sliceByColumn, stripTerminalSequences, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
2
|
+
import { CURSOR_MARKER, Container, Editor, Input, Loader, Markdown, ProcessTerminal, SelectList, Text, TuiMainScreen, decodeKittyPrintable, fuzzyFilter, isKeyRelease, matchesKey, sliceByColumn, stripTerminalSequences, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
3
3
|
import z from "@deepseek-ai/schemastery";
|
|
4
4
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
5
5
|
import { installModelSelection } from "@deepseek-ai/dsh-agent";
|
|
@@ -318,6 +318,17 @@ function describeFailure(error) {
|
|
|
318
318
|
return error instanceof Error ? error.message : String(error);
|
|
319
319
|
}
|
|
320
320
|
/**
|
|
321
|
+
* The extension of a path, lowercased, as a language hint for its content.
|
|
322
|
+
* @param path - a file path in either separator style.
|
|
323
|
+
* @returns the extension without its dot, or undefined for a dotfile or an
|
|
324
|
+
* extensionless name.
|
|
325
|
+
*/
|
|
326
|
+
function extensionOf(path) {
|
|
327
|
+
const base = path.slice(Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\")) + 1);
|
|
328
|
+
const dot = base.lastIndexOf(".");
|
|
329
|
+
return dot <= 0 ? void 0 : base.slice(dot + 1).toLowerCase();
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
321
332
|
* Parse the model's raw argument JSON for presentation.
|
|
322
333
|
* @param argumentsJson - the `tool/call` event's verbatim argument string.
|
|
323
334
|
* @returns the parsed value, or undefined when it is not JSON.
|
|
@@ -330,15 +341,52 @@ function parseArguments(argumentsJson) {
|
|
|
330
341
|
}
|
|
331
342
|
}
|
|
332
343
|
/**
|
|
333
|
-
* Render a diff for a card body
|
|
344
|
+
* Render a diff for a card body, with the code span behind each changed or
|
|
345
|
+
* context row so the card can colour the file's own language.
|
|
334
346
|
* @param diff - one file's old and new text.
|
|
335
|
-
* @returns rows
|
|
347
|
+
* @returns the rows and their spans; the `…` gap markers carry no span.
|
|
336
348
|
*/
|
|
337
|
-
function
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
349
|
+
function diffBody(diff) {
|
|
350
|
+
const lang = extensionOf(diff.path);
|
|
351
|
+
const rows = hunks(diffLines(diff.oldText, diff.newText), DIFF_CONTEXT_LINES);
|
|
352
|
+
const lines = [];
|
|
353
|
+
const code = [];
|
|
354
|
+
for (const row of rows) {
|
|
355
|
+
if (row === void 0) {
|
|
356
|
+
lines.push(" …");
|
|
357
|
+
code.push(void 0);
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
const prefix = row.kind === "added" ? "+ " : row.kind === "removed" ? "- " : " ";
|
|
361
|
+
lines.push(prefix + row.text);
|
|
362
|
+
code.push(lang === void 0 ? void 0 : {
|
|
363
|
+
lang,
|
|
364
|
+
prefix,
|
|
365
|
+
source: row.text
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
lines,
|
|
370
|
+
code
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Concatenate bodies: a heading row per diff, then that diff's rows.
|
|
375
|
+
* @param diffs - the files in display order.
|
|
376
|
+
* @returns one body for the whole card half.
|
|
377
|
+
*/
|
|
378
|
+
function diffsBody(diffs) {
|
|
379
|
+
const lines = [];
|
|
380
|
+
const code = [];
|
|
381
|
+
for (const diff of diffs) {
|
|
382
|
+
const body = diffBody(diff);
|
|
383
|
+
lines.push(diff.path, ...body.lines);
|
|
384
|
+
code.push(void 0, ...body.code);
|
|
385
|
+
}
|
|
386
|
+
return {
|
|
387
|
+
lines,
|
|
388
|
+
code
|
|
389
|
+
};
|
|
342
390
|
}
|
|
343
391
|
/**
|
|
344
392
|
* Text for a tool call from its presentation view, falling back to the raw
|
|
@@ -376,46 +424,91 @@ function toolCallText(argumentsJson, view) {
|
|
|
376
424
|
}
|
|
377
425
|
case "diff": return {
|
|
378
426
|
title: view.title,
|
|
379
|
-
|
|
427
|
+
...diffsBody(view.diffs)
|
|
380
428
|
};
|
|
381
429
|
default: return assertNever(view, "tui tool call view");
|
|
382
430
|
}
|
|
383
431
|
}
|
|
384
432
|
/**
|
|
385
|
-
*
|
|
386
|
-
*
|
|
433
|
+
* {@link toolResultLines} with the code span behind each row of a `read` or
|
|
434
|
+
* `diff` card, so the card draws the file's own language in colour.
|
|
387
435
|
* @param view - the tool's `presentResult` view, when it has one.
|
|
388
436
|
* @param content - the model-facing result content.
|
|
389
|
-
* @returns the rows,
|
|
437
|
+
* @returns the rows and, for the two code cards, their spans.
|
|
390
438
|
*/
|
|
391
|
-
function
|
|
392
|
-
if (view === void 0) return contentText(content).split("\n").filter((line) => line !== "");
|
|
439
|
+
function toolResultBody(view, content) {
|
|
440
|
+
if (view === void 0) return { lines: contentText(content).split("\n").filter((line) => line !== "") };
|
|
393
441
|
switch (view.card) {
|
|
394
|
-
case "generic": return contentText(view.content ?? content).split("\n").filter((line) => line !== "");
|
|
442
|
+
case "generic": return { lines: contentText(view.content ?? content).split("\n").filter((line) => line !== "") };
|
|
395
443
|
case "terminal": {
|
|
396
444
|
const lines = (view.output ?? "").split("\n");
|
|
397
445
|
while (lines.length > 0 && lines.at(-1) === "") lines.pop();
|
|
398
446
|
if (view.exitCode !== void 0 && view.exitCode !== 0) lines.push(`exit ${String(view.exitCode)}`);
|
|
399
447
|
if (view.signal !== void 0) lines.push(`signal ${view.signal}`);
|
|
400
|
-
return lines;
|
|
448
|
+
return { lines };
|
|
401
449
|
}
|
|
402
|
-
case "diff": return view.diffs
|
|
450
|
+
case "diff": return diffsBody(view.diffs);
|
|
403
451
|
case "search": {
|
|
404
452
|
const lines = view.shape === "matches" ? view.files.flatMap((file) => file.matches.map((match) => `${file.path}:${String(match.lineNumber)}: ${match.line}`)) : [...view.paths];
|
|
405
453
|
if (view.truncated) lines.push(`… ${String(view.total)} total`);
|
|
406
|
-
return lines;
|
|
454
|
+
return { lines };
|
|
455
|
+
}
|
|
456
|
+
case "read": {
|
|
457
|
+
const lang = view.lang;
|
|
458
|
+
const rows = view.lines.map((line) => ({
|
|
459
|
+
prefix: `${String(line.number).padStart(4)}│ `,
|
|
460
|
+
source: line.text
|
|
461
|
+
}));
|
|
462
|
+
return {
|
|
463
|
+
lines: rows.map((row) => `${row.prefix}${row.source}`),
|
|
464
|
+
...lang === void 0 ? {} : { code: rows.map((row) => ({
|
|
465
|
+
lang,
|
|
466
|
+
...row
|
|
467
|
+
})) }
|
|
468
|
+
};
|
|
407
469
|
}
|
|
408
|
-
case "read": return view.lines.map((line) => `${String(line.number).padStart(4)}│ ${line.text}`);
|
|
409
470
|
case "web": {
|
|
410
|
-
if (view.kind === "fetch") return [`${view.url} (${String(view.statusCode)})`];
|
|
471
|
+
if (view.kind === "fetch") return { lines: [`${view.url} (${String(view.statusCode)})`] };
|
|
411
472
|
const lines = view.sources.map((source) => source.title === void 0 ? source.url : `${source.title} — ${source.url}`);
|
|
412
473
|
if (view.answer !== void 0) lines.unshift(view.answer);
|
|
413
|
-
return lines;
|
|
474
|
+
return { lines };
|
|
414
475
|
}
|
|
415
476
|
default: return assertNever(view, "tui tool result view");
|
|
416
477
|
}
|
|
417
478
|
}
|
|
418
479
|
/**
|
|
480
|
+
* Draw card rows in syntax colour where a highlighter and a span allow it.
|
|
481
|
+
* Consecutive spans of one language are coloured as one block, so a comment
|
|
482
|
+
* or string that spans rows keeps its colour; a group the highlighter cannot
|
|
483
|
+
* colour yet, or colours to a different row count, draws plain and is drawn
|
|
484
|
+
* again once its grammar lands.
|
|
485
|
+
* @param lines - the plain rows.
|
|
486
|
+
* @param code - the span behind each row, aligned by index; absent rows draw plain.
|
|
487
|
+
* @param highlight - the highlighter; absent draws every row plain.
|
|
488
|
+
* @returns the rows to draw, same length as `lines`.
|
|
489
|
+
*/
|
|
490
|
+
function paintCodeRows(lines, code, highlight) {
|
|
491
|
+
if (code === void 0 || highlight === void 0) return [...lines];
|
|
492
|
+
const out = [...lines];
|
|
493
|
+
let index = 0;
|
|
494
|
+
while (index < lines.length) {
|
|
495
|
+
const span = code[index];
|
|
496
|
+
if (span === void 0) {
|
|
497
|
+
index += 1;
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
let end = index + 1;
|
|
501
|
+
while (end < lines.length && code[end]?.lang === span.lang) end += 1;
|
|
502
|
+
const group = code.slice(index, end);
|
|
503
|
+
const coloured = highlight.lines(group.map((row) => row.source).join("\n"), span.lang);
|
|
504
|
+
if (coloured !== void 0 && coloured.length === group.length) coloured.forEach((text, offset) => {
|
|
505
|
+
out[index + offset] = `${group[offset].prefix}${text}`;
|
|
506
|
+
});
|
|
507
|
+
index = end;
|
|
508
|
+
}
|
|
509
|
+
return out;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
419
512
|
* Cut rows to a maximum, naming what was left out on one trailing row. Every
|
|
420
513
|
* surface that shows part of something longer folds it this way - the collapsed
|
|
421
514
|
* tool card, an approval's call detail, the focused-section inspector - and each
|
|
@@ -991,17 +1084,17 @@ function reportChange(result) {
|
|
|
991
1084
|
return text;
|
|
992
1085
|
}
|
|
993
1086
|
/** Control Sequence Introducer. */
|
|
994
|
-
const CSI = "\x1B[";
|
|
1087
|
+
const CSI$1 = "\x1B[";
|
|
995
1088
|
/**
|
|
996
1089
|
* Ends the foreground color a recolored run set. SGR 39 restores the default
|
|
997
1090
|
* foreground only: bold, italic, underline, inverse, and the background set by
|
|
998
1091
|
* enclosing markdown styling stay in force.
|
|
999
1092
|
*/
|
|
1000
|
-
const RESET_FOREGROUND = `${CSI}39m`;
|
|
1093
|
+
const RESET_FOREGROUND$1 = `${CSI$1}39m`;
|
|
1001
1094
|
/** Faint intensity: the only ramp level the two-level mode draws. */
|
|
1002
|
-
const DIM = `${CSI}2m`;
|
|
1095
|
+
const DIM = `${CSI$1}2m`;
|
|
1003
1096
|
/** Ends faint intensity. SGR 22 also ends bold, which shares the code. */
|
|
1004
|
-
const RESET_INTENSITY = `${CSI}22m`;
|
|
1097
|
+
const RESET_INTENSITY = `${CSI$1}22m`;
|
|
1005
1098
|
/** Ages the two-level mode draws faint; later ages draw as rendered. */
|
|
1006
1099
|
const DIM_AGES = 2;
|
|
1007
1100
|
/** First xterm 256-color grayscale index. */
|
|
@@ -1013,7 +1106,7 @@ const GRAY_FIRST_VALUE = 8;
|
|
|
1013
1106
|
/** Gray value step between consecutive grayscale indices. */
|
|
1014
1107
|
const GRAY_VALUE_STEP = 10;
|
|
1015
1108
|
/** Relative-luminance weights used to pick the nearest gray. */
|
|
1016
|
-
const LUMINANCE = {
|
|
1109
|
+
const LUMINANCE$1 = {
|
|
1017
1110
|
r: .2126,
|
|
1018
1111
|
g: .7152,
|
|
1019
1112
|
b: .0722
|
|
@@ -1075,7 +1168,7 @@ function resolveFadeCapability(input) {
|
|
|
1075
1168
|
* @param steps - brightness levels; defaults to {@link FADE_STEPS}.
|
|
1076
1169
|
* @returns `steps` levels, darkest first.
|
|
1077
1170
|
*/
|
|
1078
|
-
function buildFadeRamp(bg, fg, steps =
|
|
1171
|
+
function buildFadeRamp(bg, fg, steps = 12) {
|
|
1079
1172
|
return Array.from({ length: steps }, (_unused, level) => {
|
|
1080
1173
|
if (level === steps - 1) return {
|
|
1081
1174
|
r: fg.r,
|
|
@@ -1169,7 +1262,7 @@ function fadeSgr(style, age) {
|
|
|
1169
1262
|
* @returns `ESC[38;2;R;G;Bm` with each channel clamped to a byte.
|
|
1170
1263
|
*/
|
|
1171
1264
|
function truecolorSgr(color) {
|
|
1172
|
-
return `${CSI}38;2;${channel(color.r)};${channel(color.g)};${channel(color.b)}m`;
|
|
1265
|
+
return `${CSI$1}38;2;${channel(color.r)};${channel(color.g)};${channel(color.b)}m`;
|
|
1173
1266
|
}
|
|
1174
1267
|
/**
|
|
1175
1268
|
* Encode one level as the nearest xterm grayscale index.
|
|
@@ -1177,9 +1270,9 @@ function truecolorSgr(color) {
|
|
|
1177
1270
|
* @returns `ESC[38;5;Nm` with N in 232..255.
|
|
1178
1271
|
*/
|
|
1179
1272
|
function grayscaleSgr(color) {
|
|
1180
|
-
const luminance = LUMINANCE.r * color.r + LUMINANCE.g * color.g + LUMINANCE.b * color.b;
|
|
1273
|
+
const luminance = LUMINANCE$1.r * color.r + LUMINANCE$1.g * color.g + LUMINANCE$1.b * color.b;
|
|
1181
1274
|
const step = Math.round((luminance - GRAY_FIRST_VALUE) / GRAY_VALUE_STEP);
|
|
1182
|
-
return `${CSI}38;5;${GRAY_FIRST_INDEX + Math.max(0, Math.min(GRAY_LEVELS - 1, step))}m`;
|
|
1275
|
+
return `${CSI$1}38;5;${GRAY_FIRST_INDEX + Math.max(0, Math.min(GRAY_LEVELS - 1, step))}m`;
|
|
1183
1276
|
}
|
|
1184
1277
|
/**
|
|
1185
1278
|
* Clamp one channel to what an SGR byte carries.
|
|
@@ -1196,7 +1289,7 @@ function channel(value) {
|
|
|
1196
1289
|
* `ESC[39m` for the color modes, which set a foreground.
|
|
1197
1290
|
*/
|
|
1198
1291
|
function restoreFor(capability) {
|
|
1199
|
-
return capability === "dim" ? RESET_INTENSITY : RESET_FOREGROUND;
|
|
1292
|
+
return capability === "dim" ? RESET_INTENSITY : RESET_FOREGROUND$1;
|
|
1200
1293
|
}
|
|
1201
1294
|
/** Every SGR sequence, the sequences a block's own palette styling writes. */
|
|
1202
1295
|
const SGR_SEQUENCE = /\u001b\[[0-9;]*m/g;
|
|
@@ -1326,7 +1419,7 @@ const ANSI16 = [
|
|
|
1326
1419
|
* @returns the weighted sum of the channels.
|
|
1327
1420
|
*/
|
|
1328
1421
|
function colorLuminance(color) {
|
|
1329
|
-
return LUMINANCE.r * color.r + LUMINANCE.g * color.g + LUMINANCE.b * color.b;
|
|
1422
|
+
return LUMINANCE$1.r * color.r + LUMINANCE$1.g * color.g + LUMINANCE$1.b * color.b;
|
|
1330
1423
|
}
|
|
1331
1424
|
/**
|
|
1332
1425
|
* The color a float-out starts from: the assumed foreground when that is
|
|
@@ -1367,7 +1460,7 @@ function settledRgb(state, fg) {
|
|
|
1367
1460
|
* @returns the SGR sequence, or empty when the capability cannot encode a mix.
|
|
1368
1461
|
*/
|
|
1369
1462
|
function encodeMix(capability, color) {
|
|
1370
|
-
return capability === "truecolor" ? truecolorSgr(color) : `${CSI}38;5;${String(nearestAnsi256(color))}m`;
|
|
1463
|
+
return capability === "truecolor" ? truecolorSgr(color) : `${CSI$1}38;5;${String(nearestAnsi256(color))}m`;
|
|
1371
1464
|
}
|
|
1372
1465
|
/**
|
|
1373
1466
|
* Rebuild one card row as a per-run float-out mix.
|
|
@@ -1392,7 +1485,7 @@ function floatOutLine(line, t, capability, fg) {
|
|
|
1392
1485
|
last = start + match[0].length;
|
|
1393
1486
|
}
|
|
1394
1487
|
if (last < line.length) out += paintSegment(line.slice(last), state, t, capability, fg);
|
|
1395
|
-
return `${out}${RESET_FOREGROUND}`;
|
|
1488
|
+
return `${out}${RESET_FOREGROUND$1}`;
|
|
1396
1489
|
}
|
|
1397
1490
|
/**
|
|
1398
1491
|
* Overlay one text run with the float-out mix for the SGR in force.
|
|
@@ -1564,7 +1657,7 @@ var FadeTracker = class {
|
|
|
1564
1657
|
chunks = [];
|
|
1565
1658
|
openChunk = void 0;
|
|
1566
1659
|
constructor(options) {
|
|
1567
|
-
this.steps = options.steps ??
|
|
1660
|
+
this.steps = options.steps ?? 12;
|
|
1568
1661
|
this.stepMs = options.stepMs ?? 33;
|
|
1569
1662
|
this.now = options.now;
|
|
1570
1663
|
}
|
|
@@ -1723,10 +1816,14 @@ var FadeRegistry = class {
|
|
|
1723
1816
|
* Whitespace is skipped on both sides while matching, so a chunk still matches
|
|
1724
1817
|
* after the renderer turned its space into a line break or trimmed it.
|
|
1725
1818
|
*
|
|
1726
|
-
* Markdown rewrites text, so a chunk may
|
|
1727
|
-
*
|
|
1728
|
-
*
|
|
1729
|
-
*
|
|
1819
|
+
* Markdown rewrites text, so a chunk's characters may reach the screen without
|
|
1820
|
+
* the syntax around them, or not at all. The rendered text is therefore matched
|
|
1821
|
+
* as a subsequence of what was streamed: a character the renderer consumed is
|
|
1822
|
+
* skipped and the columns keep their alignment, so a delta that closes a bold
|
|
1823
|
+
* run or a code span no longer drops the whole tail to the foreground for one
|
|
1824
|
+
* frame. Matching stops at a chunk fewer than half of whose characters are
|
|
1825
|
+
* there at all - text this tail never reached; that chunk and every older one
|
|
1826
|
+
* then draw at the foreground, unchanged.
|
|
1730
1827
|
*
|
|
1731
1828
|
* Styling inside a recolored run survives. The run reasserts the sequences in
|
|
1732
1829
|
* force at its start, so an enclosing bold or italic continues across it; an
|
|
@@ -1750,7 +1847,7 @@ var FadeRegistry = class {
|
|
|
1750
1847
|
*/
|
|
1751
1848
|
function recolorTail(lines, spans, style, from = 0, mode = "in") {
|
|
1752
1849
|
if (spans.length === 0 || lines.length === 0) return [...lines];
|
|
1753
|
-
const cells = cellsFromEnd(lines);
|
|
1850
|
+
const cells = new CellWalk(cellsFromEnd(lines));
|
|
1754
1851
|
const runs = [];
|
|
1755
1852
|
for (const span of [...spans].reverse()) {
|
|
1756
1853
|
const covered = consumeSpan(cells, span.text);
|
|
@@ -1795,26 +1892,86 @@ function* cellsFromEnd(lines) {
|
|
|
1795
1892
|
}
|
|
1796
1893
|
}
|
|
1797
1894
|
/**
|
|
1895
|
+
* The backwards cell walk with one cell of pushback, so a chunk that hands a
|
|
1896
|
+
* cell back leaves it for the chunk before it rather than eating it.
|
|
1897
|
+
*/
|
|
1898
|
+
var CellWalk = class {
|
|
1899
|
+
cells;
|
|
1900
|
+
pending;
|
|
1901
|
+
/**
|
|
1902
|
+
* @param cells - the backwards walk over the rendered lines.
|
|
1903
|
+
*/
|
|
1904
|
+
constructor(cells) {
|
|
1905
|
+
this.cells = cells;
|
|
1906
|
+
}
|
|
1907
|
+
/**
|
|
1908
|
+
* The next cell towards the start of the text.
|
|
1909
|
+
* @returns the cell, or undefined once the walk is spent.
|
|
1910
|
+
*/
|
|
1911
|
+
next() {
|
|
1912
|
+
const held = this.pending;
|
|
1913
|
+
if (held !== void 0) {
|
|
1914
|
+
this.pending = void 0;
|
|
1915
|
+
return held;
|
|
1916
|
+
}
|
|
1917
|
+
const step = this.cells.next();
|
|
1918
|
+
return step.done ? void 0 : step.value;
|
|
1919
|
+
}
|
|
1920
|
+
/**
|
|
1921
|
+
* Put one cell back for the next read.
|
|
1922
|
+
* @param cell - the cell the caller did not claim.
|
|
1923
|
+
*/
|
|
1924
|
+
back(cell) {
|
|
1925
|
+
this.pending = cell;
|
|
1926
|
+
}
|
|
1927
|
+
};
|
|
1928
|
+
/**
|
|
1798
1929
|
* Take the cells one chunk covers off the walk.
|
|
1930
|
+
*
|
|
1931
|
+
* Markdown is rendered, not echoed: `**bold**` reaches the screen as `bold`,
|
|
1932
|
+
* a fence and a bullet disappear, and a link keeps its text and drops its
|
|
1933
|
+
* target. A character of the chunk that the renderer consumed therefore has no
|
|
1934
|
+
* cell, and it is skipped rather than failing the whole tail - the rendered
|
|
1935
|
+
* text is matched as a subsequence of what was streamed. Only a chunk whose
|
|
1936
|
+
* cells have run out ends the walk, because past that point the columns
|
|
1937
|
+
* belong to text this tail never appended.
|
|
1799
1938
|
* @param cells - the backwards walk, positioned at the end of the region still unclaimed.
|
|
1800
1939
|
* @param text - the chunk's text as it was appended.
|
|
1801
1940
|
* @returns the cells the chunk covers, whitespace included, or undefined when
|
|
1802
|
-
* the
|
|
1941
|
+
* the walk reached the start of the rendered text mid-chunk.
|
|
1803
1942
|
*/
|
|
1804
1943
|
function consumeSpan(cells, text) {
|
|
1805
1944
|
const wanted = Array.from(GRAPHEMES.segment(text), (part) => part.segment).filter((part) => !isBlank(part)).reverse();
|
|
1806
1945
|
const covered = [];
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1946
|
+
let index = 0;
|
|
1947
|
+
let matched = 0;
|
|
1948
|
+
while (index < wanted.length) {
|
|
1949
|
+
let cell = cells.next();
|
|
1950
|
+
while (cell !== void 0 && isBlank(cell.grapheme)) {
|
|
1951
|
+
covered.push(cell);
|
|
1952
|
+
cell = cells.next();
|
|
1953
|
+
}
|
|
1954
|
+
if (cell === void 0) break;
|
|
1955
|
+
/* v8 ignore next -- the loop condition holds the index inside the list */
|
|
1956
|
+
const want = wanted[index] ?? "";
|
|
1957
|
+
if (cell.grapheme === want) {
|
|
1958
|
+
covered.push(cell);
|
|
1959
|
+
matched += 1;
|
|
1960
|
+
index += 1;
|
|
1961
|
+
} else if (wanted.includes(cell.grapheme, index + 1) || MARKDOWN_SYNTAX.test(want)) {
|
|
1962
|
+
cells.back(cell);
|
|
1963
|
+
index += 1;
|
|
1964
|
+
} else covered.push(cell);
|
|
1965
|
+
}
|
|
1966
|
+
return matched * 2 >= wanted.length ? covered : void 0;
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Characters a Markdown renderer consumes rather than draws: emphasis and code
|
|
1970
|
+
* fences, headings and rules, list and quote markers, and link brackets. A
|
|
1971
|
+
* chunk's own character that the rendered text does not carry is one of these
|
|
1972
|
+
* far more often than it is text the renderer dropped outright.
|
|
1973
|
+
*/
|
|
1974
|
+
const MARKDOWN_SYNTAX = /^[*_`~#>[\]()|\\!+=-]$/u;
|
|
1818
1975
|
/**
|
|
1819
1976
|
* Whether a grapheme draws nothing.
|
|
1820
1977
|
* @param grapheme - one grapheme cluster.
|
|
@@ -2003,10 +2160,13 @@ function colorEnabled(env, isTty) {
|
|
|
2003
2160
|
/**
|
|
2004
2161
|
* The Markdown theme derived from the palette.
|
|
2005
2162
|
* @param palette - the active palette.
|
|
2163
|
+
* @param highlight - colours fenced code; omitted draws every block plain,
|
|
2164
|
+
* which is also what a block whose language has no grammar here draws as.
|
|
2006
2165
|
* @returns a complete pi-tui Markdown theme.
|
|
2007
2166
|
*/
|
|
2008
|
-
function markdownTheme(palette) {
|
|
2167
|
+
function markdownTheme(palette, highlight) {
|
|
2009
2168
|
return {
|
|
2169
|
+
highlightCode: (code, lang) => highlight?.lines(code, lang) ?? code.split("\n"),
|
|
2010
2170
|
heading: (text) => palette.bold(palette.accent(text)),
|
|
2011
2171
|
link: palette.accent,
|
|
2012
2172
|
linkUrl: palette.dim,
|
|
@@ -2322,7 +2482,7 @@ var AssistantBlock = class {
|
|
|
2322
2482
|
this.theme = theme;
|
|
2323
2483
|
this.turn = turn;
|
|
2324
2484
|
const palette = theme.palette;
|
|
2325
|
-
this.markdown = new Markdown("", 0, 0, markdownTheme(palette));
|
|
2485
|
+
this.markdown = new Markdown("", 0, 0, markdownTheme(palette, theme.codeHighlight));
|
|
2326
2486
|
this.reasoningText = new Text("", 0, 0);
|
|
2327
2487
|
}
|
|
2328
2488
|
/**
|
|
@@ -2497,6 +2657,8 @@ var ToolBlock = class {
|
|
|
2497
2657
|
foldable = true;
|
|
2498
2658
|
status = "running";
|
|
2499
2659
|
resultLines = [];
|
|
2660
|
+
/** The code span behind each result row, for a `read` or `diff` result; absent otherwise. */
|
|
2661
|
+
resultCode;
|
|
2500
2662
|
expanded = false;
|
|
2501
2663
|
fade;
|
|
2502
2664
|
resultFade;
|
|
@@ -2572,9 +2734,11 @@ var ToolBlock = class {
|
|
|
2572
2734
|
* Attach the result rows and settle the status.
|
|
2573
2735
|
* @param lines - the result rows before preview truncation.
|
|
2574
2736
|
* @param isError - whether the tool reported failure.
|
|
2737
|
+
* @param code - the span behind each row, for a result the card colours as code.
|
|
2575
2738
|
*/
|
|
2576
|
-
setResult(lines, isError) {
|
|
2739
|
+
setResult(lines, isError, code) {
|
|
2577
2740
|
this.resultLines = lines;
|
|
2741
|
+
this.resultCode = code;
|
|
2578
2742
|
this.status = isError ? "error" : "done";
|
|
2579
2743
|
}
|
|
2580
2744
|
/**
|
|
@@ -2597,7 +2761,8 @@ var ToolBlock = class {
|
|
|
2597
2761
|
const { marked, content: outer } = focusFrame(width, this.highlight);
|
|
2598
2762
|
const header = `${this.status === "running" ? palette.warning("●") : this.status === "done" ? palette.success("●") : palette.error("●")} ${palette.bold(this.name)}${this.call.title === "" ? "" : ` ${palette.dim(this.call.title)}`}`;
|
|
2599
2763
|
const body = [...this.call.lines, ...this.resultLines];
|
|
2600
|
-
const
|
|
2764
|
+
const code = this.call.code === void 0 && this.resultCode === void 0 ? void 0 : [...this.call.code ?? new Array(this.call.lines.length).fill(void 0), ...this.resultCode ?? new Array(this.resultLines.length).fill(void 0)];
|
|
2765
|
+
const shown = paintCodeRows(this.expanded ? body : foldRows(body, this.theme.toolPreviewLines, (hidden) => foldMarker(hidden, marked ? "marked" : "transcript")), code, this.theme.codeHighlight);
|
|
2601
2766
|
const callCount = Math.min(this.call.lines.length, shown.length);
|
|
2602
2767
|
const inner = Math.max(1, outer - 4);
|
|
2603
2768
|
const rows = (lines) => lines.flatMap((line) => wrapTextWithAnsi(line, inner).map((part) => ` ${palette.dim("│")} ${part}`));
|
|
@@ -2926,10 +3091,10 @@ function rowsOfText(text) {
|
|
|
2926
3091
|
//#endregion
|
|
2927
3092
|
//#region lib/types/editor.js
|
|
2928
3093
|
/**
|
|
2929
|
-
* The prompt editor's caret. pi-tui draws the caret cell
|
|
2930
|
-
* video; this module takes that block off the rendered lines
|
|
2931
|
-
* DECSCUSR sequences
|
|
2932
|
-
*
|
|
3094
|
+
* The prompt editor's caret and word navigation. pi-tui draws the caret cell
|
|
3095
|
+
* itself in reverse video; this module takes that block off the rendered lines,
|
|
3096
|
+
* names the DECSCUSR sequences for a blinking bar, and maps Shift+Left/Right to
|
|
3097
|
+
* pi-tui's word movement.
|
|
2933
3098
|
* @module @deepseek-ai/dsh-tui-app/editor
|
|
2934
3099
|
*/
|
|
2935
3100
|
/**
|
|
@@ -2943,6 +3108,10 @@ const SET_BLINKING_BAR_CURSOR = "\x1B[5 q";
|
|
|
2943
3108
|
* before it releases the terminal.
|
|
2944
3109
|
*/
|
|
2945
3110
|
const SET_TERMINAL_DEFAULT_CURSOR = "\x1B[0 q";
|
|
3111
|
+
/** Canonical Ctrl+Left sequence bound to pi-tui's word-backward action. */
|
|
3112
|
+
const WORD_LEFT = "\x1B[1;5D";
|
|
3113
|
+
/** Canonical Ctrl+Right sequence bound to pi-tui's word-forward action. */
|
|
3114
|
+
const WORD_RIGHT = "\x1B[1;5C";
|
|
2946
3115
|
/** SGR reverse video on, which pi-tui opens its drawn block cursor with. */
|
|
2947
3116
|
const REVERSE_VIDEO_ON = "\x1B[7m";
|
|
2948
3117
|
/** SGR reset, which pi-tui closes its drawn block cursor with. */
|
|
@@ -2978,9 +3147,11 @@ function stripBlockCursor(line) {
|
|
|
2978
3147
|
* placed from the `CURSOR_MARKER` the editor emits at the same position. This
|
|
2979
3148
|
* subclass removes that block from the lines `render` returns so the
|
|
2980
3149
|
* terminal's own cursor - which the application shapes with
|
|
2981
|
-
* `SET_BLINKING_BAR_CURSOR` - is the only caret on screen.
|
|
2982
|
-
*
|
|
2983
|
-
*
|
|
3150
|
+
* `SET_BLINKING_BAR_CURSOR` - is the only caret on screen. It also gives
|
|
3151
|
+
* Shift+Left and Shift+Right the editor's existing word-backward and
|
|
3152
|
+
* word-forward actions. Text, autocomplete, padding, borders, scrolling,
|
|
3153
|
+
* submission, and history otherwise remain pi-tui's, and the component writes
|
|
3154
|
+
* to no terminal itself.
|
|
2984
3155
|
*
|
|
2985
3156
|
* pi-tui emits the marker only while the editor is focused, yet it draws the
|
|
2986
3157
|
* block either way, so an unfocused editor would keep a caret while another
|
|
@@ -2990,6 +3161,21 @@ function stripBlockCursor(line) {
|
|
|
2990
3161
|
* terminal cursor stays with the region that owns the keyboard.
|
|
2991
3162
|
*/
|
|
2992
3163
|
var BarCursorEditor = class extends Editor {
|
|
3164
|
+
/**
|
|
3165
|
+
* Handle Shift+Left and Shift+Right as pi-tui's word movements.
|
|
3166
|
+
* @param data - the bytes the terminal sent.
|
|
3167
|
+
*/
|
|
3168
|
+
handleInput(data) {
|
|
3169
|
+
if (matchesKey(data, "shift+left")) {
|
|
3170
|
+
super.handleInput(WORD_LEFT);
|
|
3171
|
+
return;
|
|
3172
|
+
}
|
|
3173
|
+
if (matchesKey(data, "shift+right")) {
|
|
3174
|
+
super.handleInput(WORD_RIGHT);
|
|
3175
|
+
return;
|
|
3176
|
+
}
|
|
3177
|
+
super.handleInput(data);
|
|
3178
|
+
}
|
|
2993
3179
|
/**
|
|
2994
3180
|
* Render the editor without pi-tui's drawn block cursor.
|
|
2995
3181
|
* @param width - the total width to lay the editor out in.
|
|
@@ -3045,10 +3231,10 @@ function effortItems(reasoning) {
|
|
|
3045
3231
|
* The dim row under the picker heading.
|
|
3046
3232
|
* @param reasoning - what the model declares.
|
|
3047
3233
|
* @param effort - the effort in force, or undefined for the provider default.
|
|
3048
|
-
* @returns one row naming the effort in force and
|
|
3234
|
+
* @returns one row naming the effort in force and how to dismiss the picker.
|
|
3049
3235
|
*/
|
|
3050
3236
|
function effortHint(reasoning, effort) {
|
|
3051
|
-
return `current: ${effortName(reasoning, effort)} · Esc keeps it
|
|
3237
|
+
return `current: ${effortName(reasoning, effort)} · Esc keeps it`;
|
|
3052
3238
|
}
|
|
3053
3239
|
/**
|
|
3054
3240
|
* The effort a typed `/effort` argument names. A declared id wins over the
|
|
@@ -3315,7 +3501,8 @@ function widestHint(region) {
|
|
|
3315
3501
|
*/
|
|
3316
3502
|
const KEY_LINES = {
|
|
3317
3503
|
editor: [
|
|
3318
|
-
"Enter sends · Shift+Enter newline · ↑↓ history · Ctrl+S steers
|
|
3504
|
+
"Enter sends · Shift+Enter newline · ↑↓ history · Ctrl+S steers",
|
|
3505
|
+
"Shift+Tab effort list · Shift+←→ words",
|
|
3319
3506
|
"@ completes paths and sessions · / completes commands · Tab takes one",
|
|
3320
3507
|
`${ENTRY_KEYS} · Ctrl+G reader`,
|
|
3321
3508
|
"Ctrl+O folds every tool card and context row",
|
|
@@ -4734,7 +4921,7 @@ function effortSegment(effort) {
|
|
|
4734
4921
|
return {
|
|
4735
4922
|
id: "effort",
|
|
4736
4923
|
label: unset ? "effort default" : `effort ${effort}`,
|
|
4737
|
-
detail: printed([unset ? "reasoning effort: the model's own default" : `reasoning effort: ${effort}`,
|
|
4924
|
+
detail: printed([unset ? "reasoning effort: the model's own default" : `reasoning effort: ${effort}`, "Shift+Tab or /effort opens the effort list"])
|
|
4738
4925
|
};
|
|
4739
4926
|
}
|
|
4740
4927
|
/**
|
|
@@ -5182,6 +5369,13 @@ var ListPrompt = class {
|
|
|
5182
5369
|
highlight(index) {
|
|
5183
5370
|
this.list.setSelectedIndex(index);
|
|
5184
5371
|
}
|
|
5372
|
+
/**
|
|
5373
|
+
* The row the highlight sits on.
|
|
5374
|
+
* @returns that row, or null while the list shows no row.
|
|
5375
|
+
*/
|
|
5376
|
+
selected() {
|
|
5377
|
+
return this.list.getSelectedItem();
|
|
5378
|
+
}
|
|
5185
5379
|
handleInput(data) {
|
|
5186
5380
|
this.list.handleInput(data);
|
|
5187
5381
|
}
|
|
@@ -5250,8 +5444,10 @@ function rowText(row) {
|
|
|
5250
5444
|
* once the query is empty. The visible rows are the query's fuzzy matches
|
|
5251
5445
|
* against each row's label and description, best match first; the row in
|
|
5252
5446
|
* force keeps its mark and stays highlighted only while the query is empty.
|
|
5447
|
+
* `Ctrl+S` hands the highlighted row to `onSave` without closing the picker.
|
|
5253
5448
|
*/
|
|
5254
5449
|
var PickPrompt = class extends ListPrompt {
|
|
5450
|
+
items;
|
|
5255
5451
|
/** Every row in declared order, without the mark, as matched against. */
|
|
5256
5452
|
rows;
|
|
5257
5453
|
/** The same rows with the in-force one marked, shown while the query is empty. */
|
|
@@ -5262,6 +5458,8 @@ var PickPrompt = class extends ListPrompt {
|
|
|
5262
5458
|
query = "";
|
|
5263
5459
|
/** The rows the list shows: all of them, or the query's matches. */
|
|
5264
5460
|
visible;
|
|
5461
|
+
/** What `Ctrl+S` does with the highlighted row, when the caller gave it a meaning. */
|
|
5462
|
+
onSave;
|
|
5265
5463
|
constructor(palette, title, items, options = {}) {
|
|
5266
5464
|
const rows = items.map((item) => ({ ...item }));
|
|
5267
5465
|
const inForce = items.findIndex((item) => item.value === options.current);
|
|
@@ -5270,10 +5468,12 @@ var PickPrompt = class extends ListPrompt {
|
|
|
5270
5468
|
label: `${row.label}${CURRENT_MARK}`
|
|
5271
5469
|
} : row);
|
|
5272
5470
|
super(palette, `${palette.accent("?")} ${palette.bold(title)}`, options.body ?? [], [...markedRows], (row) => items.find((item) => item.value === row.value), () => void 0, options.layout);
|
|
5471
|
+
this.items = items;
|
|
5273
5472
|
this.rows = rows;
|
|
5274
5473
|
this.markedRows = markedRows;
|
|
5275
5474
|
this.inForce = inForce;
|
|
5276
5475
|
this.visible = markedRows;
|
|
5476
|
+
this.onSave = options.onSave;
|
|
5277
5477
|
if (inForce > 0) this.highlight(inForce);
|
|
5278
5478
|
}
|
|
5279
5479
|
/**
|
|
@@ -5303,6 +5503,12 @@ var PickPrompt = class extends ListPrompt {
|
|
|
5303
5503
|
this.setQuery("");
|
|
5304
5504
|
return;
|
|
5305
5505
|
}
|
|
5506
|
+
if (matchesKey(data, "ctrl+s")) {
|
|
5507
|
+
const row = this.selected();
|
|
5508
|
+
const item = row === null ? void 0 : this.items.find((candidate) => candidate.value === row.value);
|
|
5509
|
+
if (item !== void 0) this.onSave?.(item);
|
|
5510
|
+
return;
|
|
5511
|
+
}
|
|
5306
5512
|
const typed = typedText(data);
|
|
5307
5513
|
if (typed === void 0) {
|
|
5308
5514
|
super.handleInput(data);
|
|
@@ -5632,8 +5838,8 @@ const TOO_SMALL = `terminal too small for the reader (needs ${String(24)}×${Str
|
|
|
5632
5838
|
*/
|
|
5633
5839
|
const READER_HINTS = {
|
|
5634
5840
|
list: [
|
|
5635
|
-
"↑↓ turns · → opens · / filters · Esc closes",
|
|
5636
|
-
"↑↓
|
|
5841
|
+
"↑↓ sections · PgUp PgDn turns · → opens · / filters · Esc closes",
|
|
5842
|
+
"↑↓ sections · → opens · Esc closes",
|
|
5637
5843
|
"Esc closes"
|
|
5638
5844
|
],
|
|
5639
5845
|
pane: [
|
|
@@ -5810,6 +6016,40 @@ function readerGeometryFor(state, groups, blocks, width, rows, minColumns) {
|
|
|
5810
6016
|
};
|
|
5811
6017
|
}
|
|
5812
6018
|
/**
|
|
6019
|
+
* The rows the turn list draws: every turn, with the sections of the one being
|
|
6020
|
+
* read listed under it. Only that turn opens, so the list stays a timeline a
|
|
6021
|
+
* long session can still be walked through, and the sections of another turn
|
|
6022
|
+
* are one step away rather than behind a key of their own.
|
|
6023
|
+
* @param state - where the reader is.
|
|
6024
|
+
* @param groups - the turns the list names.
|
|
6025
|
+
* @returns the rows in drawing order, each marked when the cursor holds it.
|
|
6026
|
+
*/
|
|
6027
|
+
function readerOutline(state, groups) {
|
|
6028
|
+
const held = groupIndex(state, groups);
|
|
6029
|
+
return groups.flatMap((group, index) => {
|
|
6030
|
+
const turn = {
|
|
6031
|
+
kind: "turn",
|
|
6032
|
+
group,
|
|
6033
|
+
open: index === held
|
|
6034
|
+
};
|
|
6035
|
+
if (index !== held) return [turn];
|
|
6036
|
+
return [turn, ...group.sections.map((cursor) => ({
|
|
6037
|
+
kind: "section",
|
|
6038
|
+
cursor,
|
|
6039
|
+
held: sameCursor(cursor, state.cursor)
|
|
6040
|
+
}))];
|
|
6041
|
+
});
|
|
6042
|
+
}
|
|
6043
|
+
/**
|
|
6044
|
+
* Every section of every listed turn, in reading order, which is what the
|
|
6045
|
+
* list's own `Up` and `Down` step along.
|
|
6046
|
+
* @param groups - the turns the list names.
|
|
6047
|
+
* @returns one cursor per section.
|
|
6048
|
+
*/
|
|
6049
|
+
function allSections(groups) {
|
|
6050
|
+
return groups.flatMap((group) => [...group.sections]);
|
|
6051
|
+
}
|
|
6052
|
+
/**
|
|
5813
6053
|
* The largest first visible panel row; 0 while the whole turn fits at once.
|
|
5814
6054
|
* @param geometry - the reader's geometry.
|
|
5815
6055
|
* @returns the row the scroll stops at.
|
|
@@ -5844,6 +6084,44 @@ function targetIndex(to, index, count) {
|
|
|
5844
6084
|
}
|
|
5845
6085
|
}
|
|
5846
6086
|
/**
|
|
6087
|
+
* The panel measure of one turn, which is the geometry's own while the cursor
|
|
6088
|
+
* stays in the turn it was measured for and a fresh one once it crosses into
|
|
6089
|
+
* another.
|
|
6090
|
+
* @param group - the turn to measure.
|
|
6091
|
+
* @param held - the turn the geometry was measured for.
|
|
6092
|
+
* @param geometry - the reader's geometry.
|
|
6093
|
+
* @param blocks - the navigable blocks.
|
|
6094
|
+
* @returns where each of that turn's sections starts.
|
|
6095
|
+
*/
|
|
6096
|
+
function measureOf(group, held, geometry, blocks) {
|
|
6097
|
+
if (group === held) return geometry.measure;
|
|
6098
|
+
return geometry.pane === 0 ? EMPTY_MEASURE : measurePane(group, blocks, geometry.pane);
|
|
6099
|
+
}
|
|
6100
|
+
/**
|
|
6101
|
+
* Put the reader on one section, with the panel scrolled to its header.
|
|
6102
|
+
* @param state - where the reader is.
|
|
6103
|
+
* @param cursor - the section to read.
|
|
6104
|
+
* @param groups - the turns the list names.
|
|
6105
|
+
* @param geometry - the reader's geometry.
|
|
6106
|
+
* @param blocks - the navigable blocks.
|
|
6107
|
+
* @returns the state on that section.
|
|
6108
|
+
*/
|
|
6109
|
+
function readSection(state, cursor, groups, geometry, blocks) {
|
|
6110
|
+
const held = groups[groupIndex(state, groups)];
|
|
6111
|
+
const next = groups[turnIndexOf(cursor, groups)];
|
|
6112
|
+
/* v8 ignore next -- every cursor the list steps to comes from a listed turn */
|
|
6113
|
+
if (next === void 0) return state;
|
|
6114
|
+
const measure = measureOf(next, held, geometry, blocks);
|
|
6115
|
+
const index = next.sections.findIndex((section) => sameCursor(section, cursor));
|
|
6116
|
+
/* v8 ignore next -- the cursor came from this turn's own sections, so the measure has its row */
|
|
6117
|
+
const header = measure.headers[index] ?? 0;
|
|
6118
|
+
return {
|
|
6119
|
+
...state,
|
|
6120
|
+
cursor,
|
|
6121
|
+
offset: Math.min(header, Math.max(0, measure.total - geometry.body))
|
|
6122
|
+
};
|
|
6123
|
+
}
|
|
6124
|
+
/**
|
|
5847
6125
|
* The state without its query.
|
|
5848
6126
|
* @param state - where the reader is.
|
|
5849
6127
|
* @returns the same state with the list naming every turn again.
|
|
@@ -5886,7 +6164,7 @@ function readAt(state, offset, groups, geometry) {
|
|
|
5886
6164
|
*/
|
|
5887
6165
|
function selectTurn(state, index, groups) {
|
|
5888
6166
|
const cursor = cursorAt(groups, index, 0);
|
|
5889
|
-
/* v8 ignore next --
|
|
6167
|
+
/* v8 ignore next -- the caller refuses an empty list first */
|
|
5890
6168
|
if (cursor === void 0) return state;
|
|
5891
6169
|
return {
|
|
5892
6170
|
...state,
|
|
@@ -5895,23 +6173,6 @@ function selectTurn(state, index, groups) {
|
|
|
5895
6173
|
};
|
|
5896
6174
|
}
|
|
5897
6175
|
/**
|
|
5898
|
-
* Answer one page key: a page of the panel's rows with one row of overlap, or
|
|
5899
|
-
* a list's worth of turns.
|
|
5900
|
-
* @param state - where the reader is.
|
|
5901
|
-
* @param step - 1 for the next page, -1 for the previous one.
|
|
5902
|
-
* @param groups - the turns the list names.
|
|
5903
|
-
* @param geometry - the reader's geometry.
|
|
5904
|
-
* @returns the state after the page.
|
|
5905
|
-
*/
|
|
5906
|
-
function pageBy(state, step, groups, geometry) {
|
|
5907
|
-
if (state.column === "pane") {
|
|
5908
|
-
const by = Math.max(1, geometry.body - 1);
|
|
5909
|
-
return readAt(state, clamp(state.offset + step * by, 0, maxOffset(geometry)), groups, geometry);
|
|
5910
|
-
}
|
|
5911
|
-
if (groups.length === 0) return state;
|
|
5912
|
-
return selectTurn(state, clamp(groupIndex(state, groups) + step * Math.max(1, geometry.body), 0, groups.length - 1), groups);
|
|
5913
|
-
}
|
|
5914
|
-
/**
|
|
5915
6176
|
* Answer `Escape` on the query line: clear the query, then close the line and
|
|
5916
6177
|
* list every turn again. From either panel the key closes the reader instead,
|
|
5917
6178
|
* which {@link readerClosesOnEscape} reports.
|
|
@@ -5943,13 +6204,22 @@ function readerClosesOnEscape(state) {
|
|
|
5943
6204
|
* @param intent - what the key meant.
|
|
5944
6205
|
* @param groups - the turns the list names, already narrowed by the query.
|
|
5945
6206
|
* @param geometry - the reader's geometry, with the turn panel measured.
|
|
6207
|
+
* @param blocks - the navigable blocks, for the panel rows of a turn the
|
|
6208
|
+
* geometry was not measured for, which is what the list crossing a turn
|
|
6209
|
+
* boundary lands on.
|
|
5946
6210
|
* @returns the state after the press; the state itself when nothing moves.
|
|
5947
6211
|
*/
|
|
5948
|
-
function reduceReader(state, intent, groups, geometry) {
|
|
6212
|
+
function reduceReader(state, intent, groups, geometry, blocks) {
|
|
5949
6213
|
switch (intent.kind) {
|
|
5950
|
-
case "
|
|
6214
|
+
case "section": {
|
|
6215
|
+
const sections = allSections(groups);
|
|
6216
|
+
const at = sections.findIndex((section) => sameCursor(section, state.cursor));
|
|
6217
|
+
const cursor = sections[targetIndex(intent.to, Math.max(0, at), sections.length)];
|
|
6218
|
+
return cursor === void 0 ? state : readSection(state, cursor, groups, geometry, blocks);
|
|
6219
|
+
}
|
|
6220
|
+
case "turn": return groups.length === 0 ? state : selectTurn(state, clamp(groupIndex(state, groups) + intent.step, 0, groups.length - 1), groups);
|
|
5951
6221
|
case "scroll": return readAt(state, targetIndex(intent.to, state.offset, maxOffset(geometry) + 1), groups, geometry);
|
|
5952
|
-
case "page": return
|
|
6222
|
+
case "page": return readAt(state, clamp(state.offset + intent.step * Math.max(1, geometry.body - 1), 0, maxOffset(geometry)), groups, geometry);
|
|
5953
6223
|
case "column": return {
|
|
5954
6224
|
...state,
|
|
5955
6225
|
column: intent.to
|
|
@@ -6035,38 +6305,62 @@ function cell(text, width) {
|
|
|
6035
6305
|
* One row of the turn list: the mark, the turn number, its prompt, and what
|
|
6036
6306
|
* the turn contributed.
|
|
6037
6307
|
* @param group - the turn.
|
|
6038
|
-
* @param
|
|
6308
|
+
* @param open - whether this is the turn being read, whose sections follow it.
|
|
6039
6309
|
* @param focused - whether the list itself has the keyboard.
|
|
6040
6310
|
* @param palette - the palette the row is styled with.
|
|
6041
6311
|
* @param width - the list's columns.
|
|
6042
6312
|
* @returns the row, exactly `width` columns.
|
|
6043
6313
|
*/
|
|
6044
|
-
function listRow(group,
|
|
6314
|
+
function listRow(group, open, focused, palette, width) {
|
|
6045
6315
|
const marks = markerStrip(group.markers);
|
|
6046
6316
|
const room = Math.max(1, width - visibleWidth(marks));
|
|
6047
|
-
const lead =
|
|
6048
|
-
const label = truncateToWidth(group.label, Math.max(1, room - visibleWidth(lead) - (
|
|
6049
|
-
const head = `${lead}${
|
|
6317
|
+
const lead = ` ${String(group.turn)} `;
|
|
6318
|
+
const label = truncateToWidth(group.label, Math.max(1, room - visibleWidth(lead) - (open ? 2 : 0)), ELLIPSIS$1);
|
|
6319
|
+
const head = `${lead}${open ? `[${label}]` : label}`;
|
|
6050
6320
|
const paint = (text) => {
|
|
6051
|
-
if (!
|
|
6321
|
+
if (!open) return palette.dim(text);
|
|
6052
6322
|
return focused ? palette.bold(palette.accent(text)) : palette.accent(text);
|
|
6053
6323
|
};
|
|
6054
6324
|
const text = truncateToWidth(paint(head), room, ELLIPSIS$1);
|
|
6055
6325
|
return `${text}${" ".repeat(Math.max(0, room - visibleWidth(text)))}${palette.dim(marks)}`;
|
|
6056
6326
|
}
|
|
6327
|
+
/** Columns a section row is indented by, so the turn it belongs to reads as its heading. */
|
|
6328
|
+
const SECTION_INDENT = " ";
|
|
6057
6329
|
/**
|
|
6058
|
-
*
|
|
6059
|
-
*
|
|
6060
|
-
* @param
|
|
6330
|
+
* One section row of the turn list: the mark, the indent, and the label the
|
|
6331
|
+
* panel heads that section with.
|
|
6332
|
+
* @param cursor - the section.
|
|
6333
|
+
* @param blocks - the navigable blocks.
|
|
6334
|
+
* @param selected - whether the cursor holds it.
|
|
6335
|
+
* @param focused - whether the list itself has the keyboard.
|
|
6336
|
+
* @param palette - the palette the row is styled with.
|
|
6337
|
+
* @param width - the list's columns.
|
|
6338
|
+
* @returns the row, exactly `width` columns.
|
|
6339
|
+
*/
|
|
6340
|
+
function sectionRow(cursor, blocks, selected, focused, palette, width) {
|
|
6341
|
+
const found = sectionAt(cursor, blocks);
|
|
6342
|
+
const label = found === void 0 ? "" : paneLabel(found.block, found.part);
|
|
6343
|
+
const head = `${selected ? LIST_MARK : " "}${SECTION_INDENT}${label}`;
|
|
6344
|
+
const paint = (text) => {
|
|
6345
|
+
if (!selected) return palette.dim(text);
|
|
6346
|
+
return focused ? palette.bold(palette.accent(text)) : palette.accent(text);
|
|
6347
|
+
};
|
|
6348
|
+
return cell(paint(head), width);
|
|
6349
|
+
}
|
|
6350
|
+
/**
|
|
6351
|
+
* The turn list's rows, windowed so the row the cursor holds is always drawn.
|
|
6352
|
+
* @param rows - the outline the list draws.
|
|
6353
|
+
* @param blocks - the navigable blocks, for each section's own label.
|
|
6061
6354
|
* @param focused - whether the list itself has the keyboard.
|
|
6062
6355
|
* @param palette - the palette the rows are styled with.
|
|
6063
6356
|
* @param width - the list's columns.
|
|
6064
6357
|
* @param body - the rows the body has.
|
|
6065
6358
|
* @returns the rows to draw, oldest first.
|
|
6066
6359
|
*/
|
|
6067
|
-
function listColumn(
|
|
6068
|
-
const
|
|
6069
|
-
|
|
6360
|
+
function listColumn(rows, blocks, focused, palette, width, body) {
|
|
6361
|
+
const cursor = rows.findIndex((row) => row.kind === "section" && row.held);
|
|
6362
|
+
const start = clamp(Math.max(0, cursor) - Math.floor(Math.max(0, body - 1) / 2), 0, Math.max(0, rows.length - body));
|
|
6363
|
+
return rows.slice(start, start + body).map((row) => row.kind === "turn" ? listRow(row.group, row.open, focused, palette, width) : sectionRow(row.cursor, blocks, row.held, focused, palette, width));
|
|
6070
6364
|
}
|
|
6071
6365
|
/**
|
|
6072
6366
|
* One section header inside the turn panel.
|
|
@@ -6176,7 +6470,7 @@ function readerRows(state, groups, render) {
|
|
|
6176
6470
|
const columns = [];
|
|
6177
6471
|
if (geometry.list > 0) columns.push({
|
|
6178
6472
|
width: geometry.list,
|
|
6179
|
-
rows: groups.length === 0 ? [palette.dim(`no turn matches "${state.query ?? ""}"`)] : listColumn(groups,
|
|
6473
|
+
rows: groups.length === 0 ? [palette.dim(`no turn matches "${state.query ?? ""}"`)] : listColumn(readerOutline(state, groups), blocks, state.column !== "pane", palette, geometry.list, geometry.body)
|
|
6180
6474
|
});
|
|
6181
6475
|
if (geometry.pane > 0) columns.push({
|
|
6182
6476
|
width: geometry.pane,
|
|
@@ -6294,7 +6588,7 @@ var ReaderPane = class {
|
|
|
6294
6588
|
const layout = `${String(geometry.pane)}x${String(geometry.body)}`;
|
|
6295
6589
|
if (this.layout !== layout) {
|
|
6296
6590
|
this.layout = layout;
|
|
6297
|
-
this.state = reduceReader(this.state, { kind: "anchor" }, visible, geometry);
|
|
6591
|
+
this.state = reduceReader(this.state, { kind: "anchor" }, visible, geometry, blocks);
|
|
6298
6592
|
}
|
|
6299
6593
|
return readerRows(this.state, visible, {
|
|
6300
6594
|
palette: this.options.palette,
|
|
@@ -6343,7 +6637,7 @@ var ReaderPane = class {
|
|
|
6343
6637
|
}
|
|
6344
6638
|
const intent = this.intentOf(data);
|
|
6345
6639
|
if (intent === void 0) return;
|
|
6346
|
-
this.state = reduceReader(this.state, intent, visible, geometry);
|
|
6640
|
+
this.state = reduceReader(this.state, intent, visible, geometry, blocks);
|
|
6347
6641
|
}
|
|
6348
6642
|
/** Close the reader from outside, which is what quitting and `Ctrl+C` do. */
|
|
6349
6643
|
withdraw() {
|
|
@@ -6417,27 +6711,27 @@ function filterIntent(data) {
|
|
|
6417
6711
|
*/
|
|
6418
6712
|
function listIntent(data) {
|
|
6419
6713
|
if (matchesKey(data, "up")) return {
|
|
6420
|
-
kind: "
|
|
6714
|
+
kind: "section",
|
|
6421
6715
|
to: "previous"
|
|
6422
6716
|
};
|
|
6423
6717
|
if (matchesKey(data, "down")) return {
|
|
6424
|
-
kind: "
|
|
6718
|
+
kind: "section",
|
|
6425
6719
|
to: "next"
|
|
6426
6720
|
};
|
|
6427
6721
|
if (matchesKey(data, "home")) return {
|
|
6428
|
-
kind: "
|
|
6722
|
+
kind: "section",
|
|
6429
6723
|
to: "first"
|
|
6430
6724
|
};
|
|
6431
6725
|
if (matchesKey(data, "end")) return {
|
|
6432
|
-
kind: "
|
|
6726
|
+
kind: "section",
|
|
6433
6727
|
to: "last"
|
|
6434
6728
|
};
|
|
6435
6729
|
if (matchesKey(data, "pageUp")) return {
|
|
6436
|
-
kind: "
|
|
6730
|
+
kind: "turn",
|
|
6437
6731
|
step: -1
|
|
6438
6732
|
};
|
|
6439
6733
|
if (matchesKey(data, "pageDown")) return {
|
|
6440
|
-
kind: "
|
|
6734
|
+
kind: "turn",
|
|
6441
6735
|
step: 1
|
|
6442
6736
|
};
|
|
6443
6737
|
if (matchesKey(data, "right") || matchesKey(data, "tab") || matchesKey(data, "enter")) return {
|
|
@@ -6482,6 +6776,343 @@ function paneIntent(data) {
|
|
|
6482
6776
|
};
|
|
6483
6777
|
}
|
|
6484
6778
|
//#endregion
|
|
6779
|
+
//#region lib/types/highlight.js
|
|
6780
|
+
/**
|
|
6781
|
+
* Syntax colour for fenced code in the transcript: the grammars a fence may
|
|
6782
|
+
* ask for, the theme its colours come from, and the SGR one token is drawn
|
|
6783
|
+
* with.
|
|
6784
|
+
*
|
|
6785
|
+
* Nothing loads at start. A grammar is a few hundred kilobytes of TextMate
|
|
6786
|
+
* patterns and the first tokenisation of one compiles them, so a session that
|
|
6787
|
+
* never renders a fenced block pays neither. The first block of a language
|
|
6788
|
+
* draws plain, its grammar is imported and warmed off the render path, and
|
|
6789
|
+
* the application is told to draw the frame again - the same "render what you
|
|
6790
|
+
* have, correct it when it lands" the rest of this surface uses.
|
|
6791
|
+
*
|
|
6792
|
+
* Colours come from a shiki theme rather than the palette: a theme
|
|
6793
|
+
* distinguishes a keyword from a type from a number, which the nine palette
|
|
6794
|
+
* roles cannot, and the transcript is where the model's code is read. The
|
|
6795
|
+
* theme is chosen from the terminal's own background, so a light terminal is
|
|
6796
|
+
* not given dark-theme colours, and a terminal that answers neither a colour
|
|
6797
|
+
* depth nor a background gets no colour at all.
|
|
6798
|
+
* @module @deepseek-ai/dsh-tui-app/highlight
|
|
6799
|
+
*/
|
|
6800
|
+
/**
|
|
6801
|
+
* The grammars a fence may name, each behind its own import so a language is
|
|
6802
|
+
* paid for only where it is rendered. Exported so one spec can prove every
|
|
6803
|
+
* entry resolves to a module that is really installed. The list is what a coding session
|
|
6804
|
+
* actually shows: the languages of this repository, the shells it runs, the
|
|
6805
|
+
* formats it configures with, and the languages a model most often answers a
|
|
6806
|
+
* question in.
|
|
6807
|
+
*/
|
|
6808
|
+
const GRAMMARS = new Map([
|
|
6809
|
+
["typescript", () => import("@shikijs/langs/typescript")],
|
|
6810
|
+
["shellscript", () => import("@shikijs/langs/shellscript")],
|
|
6811
|
+
["json", () => import("@shikijs/langs/json")],
|
|
6812
|
+
["python", () => import("@shikijs/langs/python")],
|
|
6813
|
+
["yaml", () => import("@shikijs/langs/yaml")],
|
|
6814
|
+
["rust", () => import("@shikijs/langs/rust")],
|
|
6815
|
+
["go", () => import("@shikijs/langs/go")],
|
|
6816
|
+
["java", () => import("@shikijs/langs/java")],
|
|
6817
|
+
["c", () => import("@shikijs/langs/c")],
|
|
6818
|
+
["cpp", () => import("@shikijs/langs/cpp")],
|
|
6819
|
+
["ruby", () => import("@shikijs/langs/ruby")],
|
|
6820
|
+
["sql", () => import("@shikijs/langs/sql")],
|
|
6821
|
+
["html", () => import("@shikijs/langs/html")],
|
|
6822
|
+
["css", () => import("@shikijs/langs/css")],
|
|
6823
|
+
["markdown", () => import("@shikijs/langs/markdown")],
|
|
6824
|
+
["toml", () => import("@shikijs/langs/toml")],
|
|
6825
|
+
["diff", () => import("@shikijs/langs/diff")]
|
|
6826
|
+
]);
|
|
6827
|
+
/**
|
|
6828
|
+
* What a fence's info string resolves to. A `Map`, not an object: the string
|
|
6829
|
+
* comes from the model, so `constructor` or `__proto__` must miss rather than
|
|
6830
|
+
* resolve an inherited property. The JavaScript family resolves to the
|
|
6831
|
+
* TypeScript grammar, which tokenises plain JavaScript exactly and JSX
|
|
6832
|
+
* approximately - one grammar instead of two for the same colours.
|
|
6833
|
+
*/
|
|
6834
|
+
const ALIASES = new Map([
|
|
6835
|
+
["typescript", "typescript"],
|
|
6836
|
+
["ts", "typescript"],
|
|
6837
|
+
["tsx", "typescript"],
|
|
6838
|
+
["javascript", "typescript"],
|
|
6839
|
+
["js", "typescript"],
|
|
6840
|
+
["jsx", "typescript"],
|
|
6841
|
+
["mjs", "typescript"],
|
|
6842
|
+
["shell", "shellscript"],
|
|
6843
|
+
["sh", "shellscript"],
|
|
6844
|
+
["bash", "shellscript"],
|
|
6845
|
+
["zsh", "shellscript"],
|
|
6846
|
+
["console", "shellscript"],
|
|
6847
|
+
["shellscript", "shellscript"],
|
|
6848
|
+
["json", "json"],
|
|
6849
|
+
["jsonc", "json"],
|
|
6850
|
+
["python", "python"],
|
|
6851
|
+
["py", "python"],
|
|
6852
|
+
["yaml", "yaml"],
|
|
6853
|
+
["yml", "yaml"],
|
|
6854
|
+
["rust", "rust"],
|
|
6855
|
+
["rs", "rust"],
|
|
6856
|
+
["go", "go"],
|
|
6857
|
+
["golang", "go"],
|
|
6858
|
+
["java", "java"],
|
|
6859
|
+
["c", "c"],
|
|
6860
|
+
["h", "c"],
|
|
6861
|
+
["cpp", "cpp"],
|
|
6862
|
+
["c++", "cpp"],
|
|
6863
|
+
["cc", "cpp"],
|
|
6864
|
+
["ruby", "ruby"],
|
|
6865
|
+
["rb", "ruby"],
|
|
6866
|
+
["sql", "sql"],
|
|
6867
|
+
["html", "html"],
|
|
6868
|
+
["xml", "html"],
|
|
6869
|
+
["css", "css"],
|
|
6870
|
+
["markdown", "markdown"],
|
|
6871
|
+
["md", "markdown"],
|
|
6872
|
+
["toml", "toml"],
|
|
6873
|
+
["diff", "diff"],
|
|
6874
|
+
["patch", "diff"]
|
|
6875
|
+
]);
|
|
6876
|
+
/** The theme a dark terminal takes, and the one a light terminal takes. */
|
|
6877
|
+
const THEMES = {
|
|
6878
|
+
dark: () => import("@shikijs/themes/github-dark-default"),
|
|
6879
|
+
light: () => import("@shikijs/themes/github-light-default")
|
|
6880
|
+
};
|
|
6881
|
+
/** Relative-luminance weights, as {@link backgroundIsLight} reads a background. */
|
|
6882
|
+
const LUMINANCE = {
|
|
6883
|
+
r: .2126,
|
|
6884
|
+
g: .7152,
|
|
6885
|
+
b: .0722
|
|
6886
|
+
};
|
|
6887
|
+
/** Luminance above which a background counts as light. */
|
|
6888
|
+
const LIGHT_ABOVE = 128;
|
|
6889
|
+
/** Control Sequence Introducer. */
|
|
6890
|
+
const CSI = "\x1B[";
|
|
6891
|
+
/** Ends the foreground a token was drawn with; other styling is left alone. */
|
|
6892
|
+
const RESET_FOREGROUND = `${CSI}39m`;
|
|
6893
|
+
/** Opens bold, for a theme's bold token styles. */
|
|
6894
|
+
const BOLD = `${CSI}1m`;
|
|
6895
|
+
/** Opens italic, for a theme's italic token styles. */
|
|
6896
|
+
const ITALIC = `${CSI}3m`;
|
|
6897
|
+
/** Ends bold. */
|
|
6898
|
+
const RESET_BOLD = `${CSI}22m`;
|
|
6899
|
+
/** Ends italic. */
|
|
6900
|
+
const RESET_ITALIC = `${CSI}23m`;
|
|
6901
|
+
/** shiki's `FontStyle` bits, which its themed tokens carry as a number. */
|
|
6902
|
+
const FONT_STYLE = {
|
|
6903
|
+
italic: 1,
|
|
6904
|
+
bold: 2,
|
|
6905
|
+
underline: 4
|
|
6906
|
+
};
|
|
6907
|
+
/**
|
|
6908
|
+
* Which theme one terminal takes.
|
|
6909
|
+
* @param background - the terminal's background, or undefined when it answered none.
|
|
6910
|
+
* @returns true for a light terminal; a terminal that answered nothing is
|
|
6911
|
+
* treated as dark, which is what a terminal that answers nothing usually is.
|
|
6912
|
+
*/
|
|
6913
|
+
function backgroundIsLight(background) {
|
|
6914
|
+
if (background === void 0) return false;
|
|
6915
|
+
return LUMINANCE.r * background.r + LUMINANCE.g * background.g + LUMINANCE.b * background.b > LIGHT_ABOVE;
|
|
6916
|
+
}
|
|
6917
|
+
/**
|
|
6918
|
+
* Decide how far the terminal encodes a token colour.
|
|
6919
|
+
*
|
|
6920
|
+
* This is the colour depth alone: a user who asked for reduced motion still
|
|
6921
|
+
* gets coloured code, because colour is not motion.
|
|
6922
|
+
* @param input - whether the palette emits SGR at all, and the environment.
|
|
6923
|
+
* @returns the depth {@link tokenSgr} encodes under.
|
|
6924
|
+
*/
|
|
6925
|
+
function resolveColorDepth(input) {
|
|
6926
|
+
if (!input.paletteEnabled) return "none";
|
|
6927
|
+
const term = input.env.TERM ?? "";
|
|
6928
|
+
if (term === "dumb") return "none";
|
|
6929
|
+
const colorterm = (input.env.COLORTERM ?? "").toLowerCase();
|
|
6930
|
+
if (colorterm === "truecolor" || colorterm === "24bit") return "truecolor";
|
|
6931
|
+
return term.includes("256color") ? "ansi256" : "none";
|
|
6932
|
+
}
|
|
6933
|
+
/**
|
|
6934
|
+
* The sequence one token's colour opens with.
|
|
6935
|
+
* @param color - the theme's colour for the token, e.g. `#79c0ff`.
|
|
6936
|
+
* @param depth - how far the terminal encodes it.
|
|
6937
|
+
* @returns the sequence, or the empty string when the colour cannot be read
|
|
6938
|
+
* or the terminal encodes none.
|
|
6939
|
+
*/
|
|
6940
|
+
function tokenSgr(color, depth) {
|
|
6941
|
+
if (depth === "none") return "";
|
|
6942
|
+
const rgb = parseHexColor(color);
|
|
6943
|
+
if (rgb === void 0) return "";
|
|
6944
|
+
return depth === "truecolor" ? `${CSI}38;2;${String(rgb.r)};${String(rgb.g)};${String(rgb.b)}m` : `${CSI}38;5;${String(nearestAnsi256(rgb))}m`;
|
|
6945
|
+
}
|
|
6946
|
+
/**
|
|
6947
|
+
* The grammar registration one module carries.
|
|
6948
|
+
* @param module - the imported grammar module.
|
|
6949
|
+
* @returns the registration array, unwrapped through however many `default`
|
|
6950
|
+
* layers the module system put around it.
|
|
6951
|
+
*/
|
|
6952
|
+
function grammarOf(module) {
|
|
6953
|
+
const first = module.default;
|
|
6954
|
+
if (Array.isArray(first) || typeof first !== "object" || first === null) return first;
|
|
6955
|
+
return first.default ?? first;
|
|
6956
|
+
}
|
|
6957
|
+
/**
|
|
6958
|
+
* Read one `#rgb` or `#rrggbb` colour.
|
|
6959
|
+
* @param color - the theme's colour string.
|
|
6960
|
+
* @returns the channels, or undefined for anything else, which is what a
|
|
6961
|
+
* theme naming a colour this module cannot read yields.
|
|
6962
|
+
*/
|
|
6963
|
+
function parseHexColor(color) {
|
|
6964
|
+
if (color === void 0) return void 0;
|
|
6965
|
+
const body = /^#([0-9a-f]{3}|[0-9a-f]{6})$/iu.exec(color)?.[1];
|
|
6966
|
+
if (body === void 0) return void 0;
|
|
6967
|
+
const wide = body.length === 6 ? body : body.replace(/./gu, (part) => `${part}${part}`);
|
|
6968
|
+
return {
|
|
6969
|
+
r: Number.parseInt(wide.slice(0, 2), 16),
|
|
6970
|
+
g: Number.parseInt(wide.slice(2, 4), 16),
|
|
6971
|
+
b: Number.parseInt(wide.slice(4, 6), 16)
|
|
6972
|
+
};
|
|
6973
|
+
}
|
|
6974
|
+
/**
|
|
6975
|
+
* The transcript's syntax highlighter: one shiki core, built when the first
|
|
6976
|
+
* fence resolves a grammar and grown as further languages are asked for.
|
|
6977
|
+
*/
|
|
6978
|
+
var SyntaxHighlighter = class {
|
|
6979
|
+
options;
|
|
6980
|
+
/** The shiki core, once a theme and one grammar have landed. */
|
|
6981
|
+
core;
|
|
6982
|
+
/**
|
|
6983
|
+
* The core being built, so two fences of different languages on one frame
|
|
6984
|
+
* share it: each would otherwise build a core of its own, and the one that
|
|
6985
|
+
* finished last would be the only one holding a grammar.
|
|
6986
|
+
*/
|
|
6987
|
+
building;
|
|
6988
|
+
/** The theme's own name, which `codeToTokens` resolves it by. */
|
|
6989
|
+
theme = "";
|
|
6990
|
+
/** Grammar ids already registered on the core. */
|
|
6991
|
+
loaded = /* @__PURE__ */ new Set();
|
|
6992
|
+
/** Grammar ids whose import is in flight, so each is asked for once. */
|
|
6993
|
+
pending = /* @__PURE__ */ new Set();
|
|
6994
|
+
/**
|
|
6995
|
+
* @param options - the colour depth, the terminal background, and the redraw request.
|
|
6996
|
+
*/
|
|
6997
|
+
constructor(options) {
|
|
6998
|
+
this.options = options;
|
|
6999
|
+
}
|
|
7000
|
+
/**
|
|
7001
|
+
* Colour one fenced block.
|
|
7002
|
+
* @param code - the block's source, newline separated.
|
|
7003
|
+
* @param lang - the fence's info string, or undefined for a bare fence.
|
|
7004
|
+
* @returns one styled line per source line, or undefined while the language
|
|
7005
|
+
* has no grammar here, its grammar is still loading, or the terminal takes
|
|
7006
|
+
* no colour - all of which the Markdown renderer draws plain.
|
|
7007
|
+
*/
|
|
7008
|
+
lines(code, lang) {
|
|
7009
|
+
if (this.options.depth === "none") return void 0;
|
|
7010
|
+
const resolved = ALIASES.get((lang ?? "").toLowerCase());
|
|
7011
|
+
if (resolved === void 0) return void 0;
|
|
7012
|
+
if (!this.loaded.has(resolved)) {
|
|
7013
|
+
this.load(resolved);
|
|
7014
|
+
return;
|
|
7015
|
+
}
|
|
7016
|
+
const core = this.core;
|
|
7017
|
+
/* v8 ignore next -- a loaded grammar means the core is built */
|
|
7018
|
+
if (core === void 0) return void 0;
|
|
7019
|
+
try {
|
|
7020
|
+
const { tokens } = core.codeToTokens(code, {
|
|
7021
|
+
lang: resolved,
|
|
7022
|
+
theme: this.theme
|
|
7023
|
+
});
|
|
7024
|
+
return tokens.map((line) => line.map((token) => this.paint(token)).join("") + RESET_FOREGROUND);
|
|
7025
|
+
} catch {
|
|
7026
|
+
this.loaded.delete(resolved);
|
|
7027
|
+
return;
|
|
7028
|
+
}
|
|
7029
|
+
}
|
|
7030
|
+
/**
|
|
7031
|
+
* Draw one token with the theme's colour and font style.
|
|
7032
|
+
* @param token - the themed token.
|
|
7033
|
+
* @returns the token's text, wrapped in the sequences it is drawn with.
|
|
7034
|
+
*/
|
|
7035
|
+
paint(token) {
|
|
7036
|
+
const color = tokenSgr(token.color, this.options.depth);
|
|
7037
|
+
/* v8 ignore next -- shiki writes a style of 0 rather than leaving it out */
|
|
7038
|
+
const style = token.fontStyle ?? 0;
|
|
7039
|
+
const bold = (style & FONT_STYLE.bold) === 0 ? "" : BOLD;
|
|
7040
|
+
const italic = (style & FONT_STYLE.italic) === 0 ? "" : ITALIC;
|
|
7041
|
+
const closeBold = bold === "" ? "" : RESET_BOLD;
|
|
7042
|
+
const closeItalic = italic === "" ? "" : RESET_ITALIC;
|
|
7043
|
+
return `${color}${bold}${italic}${token.content}${closeItalic}${closeBold}`;
|
|
7044
|
+
}
|
|
7045
|
+
/**
|
|
7046
|
+
* Bring up the core for one grammar, then ask for the frame again.
|
|
7047
|
+
* @param id - the grammar to register.
|
|
7048
|
+
*/
|
|
7049
|
+
async load(id) {
|
|
7050
|
+
if (this.pending.has(id)) return;
|
|
7051
|
+
const grammar = GRAMMARS.get(id);
|
|
7052
|
+
/* v8 ignore next -- every alias resolves to a grammar in the same table */
|
|
7053
|
+
if (grammar === void 0) return;
|
|
7054
|
+
this.pending.add(id);
|
|
7055
|
+
try {
|
|
7056
|
+
const module = await (this.options.import ?? ((load) => load()))(grammar);
|
|
7057
|
+
if (!await this.register(id, module)) return;
|
|
7058
|
+
} catch {
|
|
7059
|
+
this.loaded.delete(id);
|
|
7060
|
+
return;
|
|
7061
|
+
} finally {
|
|
7062
|
+
this.pending.delete(id);
|
|
7063
|
+
}
|
|
7064
|
+
this.options.changed();
|
|
7065
|
+
}
|
|
7066
|
+
/**
|
|
7067
|
+
* Put one grammar on the core, building the core and its theme first.
|
|
7068
|
+
* @param id - the grammar's id.
|
|
7069
|
+
* @param module - the grammar module.
|
|
7070
|
+
* @returns whether the core now resolves that id.
|
|
7071
|
+
*/
|
|
7072
|
+
async register(id, module) {
|
|
7073
|
+
const core = await this.ensureCore();
|
|
7074
|
+
await core.loadLanguage(grammarOf(module));
|
|
7075
|
+
if (!core.getLoadedLanguages().includes(id)) return false;
|
|
7076
|
+
this.loaded.add(id);
|
|
7077
|
+
core.codeToTokens("", {
|
|
7078
|
+
lang: id,
|
|
7079
|
+
theme: this.theme
|
|
7080
|
+
});
|
|
7081
|
+
return true;
|
|
7082
|
+
}
|
|
7083
|
+
/**
|
|
7084
|
+
* The core, built once however many languages ask for it at the same time.
|
|
7085
|
+
* @returns the core.
|
|
7086
|
+
*/
|
|
7087
|
+
async ensureCore() {
|
|
7088
|
+
const built = this.core;
|
|
7089
|
+
if (built !== void 0) return built;
|
|
7090
|
+
this.building ??= this.buildCore();
|
|
7091
|
+
return this.building;
|
|
7092
|
+
}
|
|
7093
|
+
/**
|
|
7094
|
+
* Build the core with the theme the terminal's background asks for.
|
|
7095
|
+
* @returns the core, which every later grammar registers on.
|
|
7096
|
+
*/
|
|
7097
|
+
async buildCore() {
|
|
7098
|
+
const run = this.options.import ?? ((load) => load());
|
|
7099
|
+
const [{ createHighlighterCoreSync }, { createJavaScriptRegexEngine }, theme] = await Promise.all([
|
|
7100
|
+
import("shiki/core"),
|
|
7101
|
+
import("shiki/engine/javascript"),
|
|
7102
|
+
run(THEMES[backgroundIsLight(this.options.background()) ? "light" : "dark"])
|
|
7103
|
+
]);
|
|
7104
|
+
/* v8 ignore next -- every bundled theme carries its own name */
|
|
7105
|
+
this.theme = theme.default.name ?? "";
|
|
7106
|
+
const core = createHighlighterCoreSync({
|
|
7107
|
+
themes: [theme.default],
|
|
7108
|
+
langs: [],
|
|
7109
|
+
engine: createJavaScriptRegexEngine({ forgiving: true })
|
|
7110
|
+
});
|
|
7111
|
+
this.core = core;
|
|
7112
|
+
return core;
|
|
7113
|
+
}
|
|
7114
|
+
};
|
|
7115
|
+
//#endregion
|
|
6485
7116
|
//#region lib/types/screen.js
|
|
6486
7117
|
/**
|
|
6487
7118
|
* The main screen this application renders through, and the repaint rule the
|
|
@@ -6523,6 +7154,40 @@ function repaintFloor(start, viewportTop) {
|
|
|
6523
7154
|
return Math.max(0, viewportTop - start);
|
|
6524
7155
|
}
|
|
6525
7156
|
/**
|
|
7157
|
+
* Blank rows at the foot of the frame, which a surface mounts while it needs
|
|
7158
|
+
* the whole viewport.
|
|
7159
|
+
*
|
|
7160
|
+
* The renderer repaints a line only at or after {@link repaintFloor}'s own
|
|
7161
|
+
* `viewportTop`, a high-water mark a taller frame raises for good. A frame
|
|
7162
|
+
* that has since shrunk therefore leaves the top of the viewport out of
|
|
7163
|
+
* reach, and an overlay that may not draw there stops short of the screen.
|
|
7164
|
+
* These rows push the frame back up to that mark: the terminal scrolls by
|
|
7165
|
+
* exactly the shortfall, every line of the viewport becomes repaintable
|
|
7166
|
+
* again, and an overlay composited into the frame's last `terminal.rows`
|
|
7167
|
+
* lines covers all of them. They are never seen - the overlay is drawn over
|
|
7168
|
+
* them, and they are gone before it is.
|
|
7169
|
+
*
|
|
7170
|
+
* pi-tui's `Text` drops blank lines, so the rows are a component of their own.
|
|
7171
|
+
*/
|
|
7172
|
+
var ViewportPad = class {
|
|
7173
|
+
rows;
|
|
7174
|
+
/**
|
|
7175
|
+
* @param rows - how many blank lines to draw, read on every render.
|
|
7176
|
+
*/
|
|
7177
|
+
constructor(rows) {
|
|
7178
|
+
this.rows = rows;
|
|
7179
|
+
}
|
|
7180
|
+
invalidate() {}
|
|
7181
|
+
/**
|
|
7182
|
+
* Draw the pad.
|
|
7183
|
+
* @returns that many empty lines, and none at all where the frame already
|
|
7184
|
+
* reaches the mark.
|
|
7185
|
+
*/
|
|
7186
|
+
render() {
|
|
7187
|
+
return Array.from({ length: Math.max(0, this.rows()) }, () => "");
|
|
7188
|
+
}
|
|
7189
|
+
};
|
|
7190
|
+
/**
|
|
6526
7191
|
* The main screen that settles each frame between building it and writing it.
|
|
6527
7192
|
*
|
|
6528
7193
|
* The guard is handed the frame's first repaintable line: the higher of the
|
|
@@ -6570,7 +7235,8 @@ var GuardedMainScreen = class extends TuiMainScreen {
|
|
|
6570
7235
|
//#region lib/types/sessions.js
|
|
6571
7236
|
/**
|
|
6572
7237
|
* Session facts the terminal shows and switches between: the persisted
|
|
6573
|
-
* session list with titles, and the label rows of the `/sessions`
|
|
7238
|
+
* session list with titles, and the label rows of the `/sessions` and
|
|
7239
|
+
* `/resume` picker.
|
|
6574
7240
|
* @module @deepseek-ai/dsh-tui-app/sessions
|
|
6575
7241
|
*/
|
|
6576
7242
|
/**
|
|
@@ -6924,6 +7590,22 @@ var ToastPane = class {
|
|
|
6924
7590
|
*/
|
|
6925
7591
|
/** A second Ctrl+C inside this window quits. */
|
|
6926
7592
|
const QUIT_DOUBLE_PRESS_MS = 600;
|
|
7593
|
+
/** What input reports while the host is opening another session. */
|
|
7594
|
+
const SESSION_SWITCH_WAIT = "wait for the session switch to finish";
|
|
7595
|
+
/** The one extra key the model picker answers, stated above its rows. */
|
|
7596
|
+
const MODEL_PICKER_HINT = "Ctrl+S saves the highlighted model as the default for the next launch";
|
|
7597
|
+
/**
|
|
7598
|
+
* Read a picker row value back into a selection.
|
|
7599
|
+
* @param value - `provider/model`, as {@link TuiApp.modelItems} writes it.
|
|
7600
|
+
* @returns the provider and model.
|
|
7601
|
+
*/
|
|
7602
|
+
function splitModelValue(value) {
|
|
7603
|
+
const slash = value.indexOf("/");
|
|
7604
|
+
return {
|
|
7605
|
+
provider: value.slice(0, slash),
|
|
7606
|
+
model: value.slice(slash + 1)
|
|
7607
|
+
};
|
|
7608
|
+
}
|
|
6927
7609
|
/** What the transcript is told when a session switch took the conversation the reader was showing. */
|
|
6928
7610
|
const READER_GONE = "the transcript changed · reader closed";
|
|
6929
7611
|
/**
|
|
@@ -7054,6 +7736,10 @@ const LOCAL_COMMANDS = [
|
|
|
7054
7736
|
name: "sessions",
|
|
7055
7737
|
description: "Switch to another session"
|
|
7056
7738
|
},
|
|
7739
|
+
{
|
|
7740
|
+
name: "resume",
|
|
7741
|
+
description: "Resume a previous session"
|
|
7742
|
+
},
|
|
7057
7743
|
{
|
|
7058
7744
|
name: "new",
|
|
7059
7745
|
description: "Start a new session"
|
|
@@ -7159,8 +7845,18 @@ var TuiApp = class {
|
|
|
7159
7845
|
/** Draws the focused transcript section, and nothing at all while the keyboard is elsewhere. */
|
|
7160
7846
|
inspector;
|
|
7161
7847
|
editor;
|
|
7848
|
+
/** Holds {@link queue} exactly while the bound Agent's inbox has a prompt waiting. */
|
|
7849
|
+
queueSlot = new Container();
|
|
7850
|
+
/** The prompts queued for the next turn or step, drawn above the editor until the loop claims them. */
|
|
7851
|
+
queue;
|
|
7162
7852
|
/** Holds {@link panel} exactly while the bound session has subagent rows. */
|
|
7163
7853
|
panelSlot = new Container();
|
|
7854
|
+
/** Blank rows that give the mounted reader the whole viewport; see {@link ViewportPad}. */
|
|
7855
|
+
pad = new ViewportPad(() => this.readerPad);
|
|
7856
|
+
/** Colours fenced code in replies; see {@link SyntaxHighlighter}. */
|
|
7857
|
+
codeHighlight;
|
|
7858
|
+
/** The terminal's background once it answered; undefined until then, and on a terminal that answers none. */
|
|
7859
|
+
background;
|
|
7164
7860
|
panel;
|
|
7165
7861
|
footer;
|
|
7166
7862
|
modals;
|
|
@@ -7230,6 +7926,8 @@ var TuiApp = class {
|
|
|
7230
7926
|
panelLift = 0;
|
|
7231
7927
|
/** The reader on screen right now, while one is open. */
|
|
7232
7928
|
reader;
|
|
7929
|
+
/** Blank rows {@link ViewportPad} draws so the mounted reader covers the whole viewport. */
|
|
7930
|
+
readerPad = 0;
|
|
7233
7931
|
/** The motion growing the open reader into place; settled or absent draws it whole. */
|
|
7234
7932
|
readerOpening;
|
|
7235
7933
|
/** The reader shrinking away, still mounted until its motion settles. */
|
|
@@ -7258,8 +7956,10 @@ var TuiApp = class {
|
|
|
7258
7956
|
toolsExpanded = false;
|
|
7259
7957
|
/** Set while a session switch awaits the host, so input cannot target the session being left. */
|
|
7260
7958
|
switching = false;
|
|
7261
|
-
/**
|
|
7262
|
-
|
|
7959
|
+
/** The current-model effort command, including its lookup and optional picker. */
|
|
7960
|
+
effortOperation;
|
|
7961
|
+
/** The persisted-session picker shared by `/resume` and `/sessions`, including its listing. */
|
|
7962
|
+
sessionPicker;
|
|
7263
7963
|
/** Serializes `/attach` reads so pending attachments keep the typed order. */
|
|
7264
7964
|
attaching = Promise.resolve();
|
|
7265
7965
|
usage = EMPTY_USAGE;
|
|
@@ -7269,10 +7969,22 @@ var TuiApp = class {
|
|
|
7269
7969
|
this.deps = deps;
|
|
7270
7970
|
const palette = deps.palette;
|
|
7271
7971
|
this.bound = deps.initial;
|
|
7972
|
+
this.codeHighlight = new SyntaxHighlighter({
|
|
7973
|
+
depth: deps.codeHighlight ? resolveColorDepth({
|
|
7974
|
+
paletteEnabled: palette.enabled,
|
|
7975
|
+
env: deps.env
|
|
7976
|
+
}) : "none",
|
|
7977
|
+
background: () => this.background,
|
|
7978
|
+
changed: () => {
|
|
7979
|
+
this.chat.invalidate();
|
|
7980
|
+
this.tui.requestRender();
|
|
7981
|
+
}
|
|
7982
|
+
});
|
|
7272
7983
|
this.theme = {
|
|
7273
7984
|
palette,
|
|
7274
7985
|
toolPreviewLines: deps.toolPreviewLines,
|
|
7275
|
-
contextPreviewLines: deps.contextPreviewLines
|
|
7986
|
+
contextPreviewLines: deps.contextPreviewLines,
|
|
7987
|
+
codeHighlight: this.codeHighlight
|
|
7276
7988
|
};
|
|
7277
7989
|
this.tui = new GuardedMainScreen(deps.terminal, true, (viewportTop, width, frameLines) => {
|
|
7278
7990
|
return this.settleFrame(viewportTop, width, frameLines);
|
|
@@ -7292,6 +8004,7 @@ var TuiApp = class {
|
|
|
7292
8004
|
this.editor.onSubmit = (text) => {
|
|
7293
8005
|
this.onSubmit(text);
|
|
7294
8006
|
};
|
|
8007
|
+
this.queue = new Text("", 0, 0);
|
|
7295
8008
|
this.panel = new Text("", 0, 0);
|
|
7296
8009
|
this.footer = new FooterBar(() => ({
|
|
7297
8010
|
segments: this.segments,
|
|
@@ -7314,9 +8027,11 @@ var TuiApp = class {
|
|
|
7314
8027
|
this.statusSlot,
|
|
7315
8028
|
this.modalSlot,
|
|
7316
8029
|
this.inspector,
|
|
8030
|
+
this.queueSlot,
|
|
7317
8031
|
this.editor,
|
|
7318
8032
|
this.panelSlot,
|
|
7319
|
-
this.footer
|
|
8033
|
+
this.footer,
|
|
8034
|
+
this.pad
|
|
7320
8035
|
];
|
|
7321
8036
|
for (const child of tree) this.tui.addChild(child);
|
|
7322
8037
|
}
|
|
@@ -7345,6 +8060,12 @@ var TuiApp = class {
|
|
|
7345
8060
|
this.markSubagentsStale();
|
|
7346
8061
|
}), ctx.on("subagent/end", () => {
|
|
7347
8062
|
this.markSubagentsStale();
|
|
8063
|
+
}), ctx.on("agent/inbox/inserted", ({ agent: subject }) => {
|
|
8064
|
+
if (subject === this.agent) this.refreshQueue();
|
|
8065
|
+
}), ctx.on("agent/inbox/claimed", ({ agent: subject }) => {
|
|
8066
|
+
if (subject === this.agent) this.refreshQueue();
|
|
8067
|
+
}), ctx.on("agent/inbox/discarded", ({ agent: subject }) => {
|
|
8068
|
+
if (subject === this.agent) this.refreshQueue();
|
|
7348
8069
|
}), ctx.on("approval/request", (request, next) => {
|
|
7349
8070
|
if (request.agent !== this.agent) return next();
|
|
7350
8071
|
return this.askApproval(request.toolName, request.reason, request.callId, request.signal);
|
|
@@ -7393,6 +8114,7 @@ var TuiApp = class {
|
|
|
7393
8114
|
async resolveFadeRamp(capability) {
|
|
7394
8115
|
const background = await this.tui.queryTerminalBackgroundColor({ timeoutMs: BACKGROUND_QUERY_TIMEOUT_MS });
|
|
7395
8116
|
if (this.stopped) return;
|
|
8117
|
+
this.background = background;
|
|
7396
8118
|
this.fadeStyle = background === void 0 ? {
|
|
7397
8119
|
capability: "dim",
|
|
7398
8120
|
ramp: []
|
|
@@ -7407,6 +8129,7 @@ var TuiApp = class {
|
|
|
7407
8129
|
this.stopped = true;
|
|
7408
8130
|
this.updateTicker();
|
|
7409
8131
|
this.updateFadeTicker();
|
|
8132
|
+
this.cancelPickers();
|
|
7410
8133
|
for (const dispose of this.disposers.splice(0)) dispose();
|
|
7411
8134
|
this.modals.withdrawActive();
|
|
7412
8135
|
this.dropReader();
|
|
@@ -7447,6 +8170,7 @@ var TuiApp = class {
|
|
|
7447
8170
|
this.replaying = false;
|
|
7448
8171
|
if (reading) this.notice(READER_GONE);
|
|
7449
8172
|
this.refreshHeader();
|
|
8173
|
+
this.refreshQueue();
|
|
7450
8174
|
this.refreshFooter();
|
|
7451
8175
|
this.refreshSubagentPanel();
|
|
7452
8176
|
this.reconcileSubagents();
|
|
@@ -7461,6 +8185,7 @@ var TuiApp = class {
|
|
|
7461
8185
|
this.notice("stop the running turn (Esc twice) before switching sessions", "error");
|
|
7462
8186
|
return;
|
|
7463
8187
|
}
|
|
8188
|
+
this.cancelPickers();
|
|
7464
8189
|
this.switching = true;
|
|
7465
8190
|
let next;
|
|
7466
8191
|
try {
|
|
@@ -7577,6 +8302,25 @@ var TuiApp = class {
|
|
|
7577
8302
|
this.tui.requestRender();
|
|
7578
8303
|
}
|
|
7579
8304
|
/**
|
|
8305
|
+
* Redraw the queued prompts above the editor from the bound Agent's inbox.
|
|
8306
|
+
* The slot is mounted exactly while a prompt waits, so the editor sits
|
|
8307
|
+
* directly under the conversation the rest of the time.
|
|
8308
|
+
*/
|
|
8309
|
+
refreshQueue() {
|
|
8310
|
+
const palette = this.deps.palette;
|
|
8311
|
+
const inbox = this.agent.inbox;
|
|
8312
|
+
const row = (label, message) => `${palette.dim(`⏳ ${label}`)} ${contentText(message.content).split("\n", 1).join("")}`;
|
|
8313
|
+
const rows = [...inbox.nextStep.map((message) => row("next step", message)), ...inbox.nextTurn.map((message) => row("next turn", message))];
|
|
8314
|
+
const mounted = this.queueSlot.children.length > 0;
|
|
8315
|
+
if (rows.length === 0) {
|
|
8316
|
+
if (mounted) this.queueSlot.removeChild(this.queue);
|
|
8317
|
+
} else {
|
|
8318
|
+
this.queue.setText(rows.join("\n"));
|
|
8319
|
+
if (!mounted) this.queueSlot.addChild(this.queue);
|
|
8320
|
+
}
|
|
8321
|
+
this.tui.requestRender();
|
|
8322
|
+
}
|
|
8323
|
+
/**
|
|
7580
8324
|
* Redraw the panel from the last listing and a fresh sample of the live
|
|
7581
8325
|
* facts. The panel is mounted exactly while it has a row, so the last
|
|
7582
8326
|
* resident child leaving takes the panel with it — and the keyboard back to
|
|
@@ -7748,6 +8492,23 @@ var TuiApp = class {
|
|
|
7748
8492
|
this.chat.addChild(new Text(rows.join("\n"), 0, 1));
|
|
7749
8493
|
this.tui.requestRender();
|
|
7750
8494
|
}
|
|
8495
|
+
/** Retire and withdraw current-model effort work. */
|
|
8496
|
+
cancelEffortOperation() {
|
|
8497
|
+
const operation = this.effortOperation;
|
|
8498
|
+
this.effortOperation = void 0;
|
|
8499
|
+
operation?.controller.abort();
|
|
8500
|
+
}
|
|
8501
|
+
/** Retire and withdraw persisted-session picker work. */
|
|
8502
|
+
cancelSessionPicker() {
|
|
8503
|
+
const operation = this.sessionPicker;
|
|
8504
|
+
this.sessionPicker = void 0;
|
|
8505
|
+
operation?.controller.abort();
|
|
8506
|
+
}
|
|
8507
|
+
/** Withdraw picker work before quit or a session switch. */
|
|
8508
|
+
cancelPickers() {
|
|
8509
|
+
this.cancelEffortOperation();
|
|
8510
|
+
this.cancelSessionPicker();
|
|
8511
|
+
}
|
|
7751
8512
|
/**
|
|
7752
8513
|
* Show one prompt through the modal queue. Whichever docked region holds
|
|
7753
8514
|
* the keyboard gives it up first: the queue hands focus to the editor once
|
|
@@ -7968,8 +8729,8 @@ var TuiApp = class {
|
|
|
7968
8729
|
showStatus() {
|
|
7969
8730
|
this.showBlock(statusReport(this.statusFacts()));
|
|
7970
8731
|
}
|
|
7971
|
-
currentSelection() {
|
|
7972
|
-
const { selection, agent } =
|
|
8732
|
+
currentSelection(bound = this.bound) {
|
|
8733
|
+
const { selection, agent } = bound;
|
|
7973
8734
|
const selected = selection.current ?? agent.session.requestHeader()?.config;
|
|
7974
8735
|
if (selected !== void 0) return selected;
|
|
7975
8736
|
return {
|
|
@@ -7978,8 +8739,9 @@ var TuiApp = class {
|
|
|
7978
8739
|
};
|
|
7979
8740
|
}
|
|
7980
8741
|
/**
|
|
7981
|
-
* Answer one key
|
|
8742
|
+
* Answer one terminal key report.
|
|
7982
8743
|
*
|
|
8744
|
+
* Kitty release reports are consumed before they can repeat the press.
|
|
7983
8745
|
* A visible prompt owns the whole key stream; `Ctrl+C` and `Ctrl+D` keep
|
|
7984
8746
|
* their global meaning wherever the keyboard is; everything else is what
|
|
7985
8747
|
* {@link resolveKey} makes of the key in the region that holds it.
|
|
@@ -7993,6 +8755,7 @@ var TuiApp = class {
|
|
|
7993
8755
|
* editor answers.
|
|
7994
8756
|
*/
|
|
7995
8757
|
onKey(data) {
|
|
8758
|
+
if (isKeyRelease(data)) return { consume: true };
|
|
7996
8759
|
this.finishReaderClose();
|
|
7997
8760
|
if (this.modals.isActive()) {
|
|
7998
8761
|
if (!matchesKey(data, "ctrl+c")) return void 0;
|
|
@@ -8068,11 +8831,11 @@ var TuiApp = class {
|
|
|
8068
8831
|
this.onSubmit(this.editor.getText(), "steer");
|
|
8069
8832
|
return { consume: true };
|
|
8070
8833
|
case "effort":
|
|
8071
|
-
this.
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
);
|
|
8834
|
+
if (this.switching) {
|
|
8835
|
+
this.notice(SESSION_SWITCH_WAIT, "error");
|
|
8836
|
+
return { consume: true };
|
|
8837
|
+
}
|
|
8838
|
+
this.dispatchCommand("/effort");
|
|
8076
8839
|
return { consume: true };
|
|
8077
8840
|
case "type":
|
|
8078
8841
|
this.focusEditor();
|
|
@@ -8603,20 +9366,28 @@ var TuiApp = class {
|
|
|
8603
9366
|
const text = raw.trim();
|
|
8604
9367
|
if (text === "") return;
|
|
8605
9368
|
if (this.switching) {
|
|
8606
|
-
this.notice(
|
|
9369
|
+
this.notice(SESSION_SWITCH_WAIT, "error");
|
|
8607
9370
|
return;
|
|
8608
9371
|
}
|
|
8609
9372
|
this.editor.setText("");
|
|
8610
9373
|
this.editor.addToHistory(text);
|
|
8611
9374
|
if (text.startsWith("/")) {
|
|
8612
|
-
|
|
8613
|
-
this.runCommand(text).catch((error) => {
|
|
8614
|
-
this.notice(`${name} failed: ${describeFailure(error)}`, "error");
|
|
8615
|
-
});
|
|
9375
|
+
this.dispatchCommand(text);
|
|
8616
9376
|
return;
|
|
8617
9377
|
}
|
|
8618
9378
|
this.submit(text, mode);
|
|
8619
9379
|
}
|
|
9380
|
+
/**
|
|
9381
|
+
* Run one slash command and turn a rejection into a terminal notice.
|
|
9382
|
+
* @param line - the complete slash-command line.
|
|
9383
|
+
* @returns when the command or its failure notice settles.
|
|
9384
|
+
*/
|
|
9385
|
+
dispatchCommand(line) {
|
|
9386
|
+
const name = line.slice(0, line.indexOf(" ") === -1 ? void 0 : line.indexOf(" "));
|
|
9387
|
+
return this.runCommand(line).catch((error) => {
|
|
9388
|
+
this.notice(`${name} failed: ${describeFailure(error)}`, "error");
|
|
9389
|
+
});
|
|
9390
|
+
}
|
|
8620
9391
|
submit(text, mode = "queue") {
|
|
8621
9392
|
const agent = this.agent;
|
|
8622
9393
|
const attachments = this.pending.splice(0);
|
|
@@ -8627,17 +9398,19 @@ var TuiApp = class {
|
|
|
8627
9398
|
}],
|
|
8628
9399
|
source: { kind: "user" }
|
|
8629
9400
|
});
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
9401
|
+
if (agent.status !== "running") {
|
|
9402
|
+
this.submittedIds.add(message.id);
|
|
9403
|
+
const shown = attachments.length === 0 ? text : `${text}\n${attachments.map((attachment) => `[${attachment.block.type}: ${attachment.name}]`).join(" ")}`;
|
|
9404
|
+
this.chat.addChild(new UserBlock(this.theme, shown, this.turn));
|
|
9405
|
+
agent.followup(message);
|
|
9406
|
+
} else if (mode === "steer") {
|
|
8635
9407
|
agent.steer(message);
|
|
8636
9408
|
this.notice("steering the running turn: it reaches the next step");
|
|
8637
9409
|
} else {
|
|
8638
9410
|
agent.followup(message);
|
|
8639
9411
|
this.notice("queued for the next turn (Ctrl+S steers the running turn instead)");
|
|
8640
9412
|
}
|
|
9413
|
+
this.refreshQueue();
|
|
8641
9414
|
this.refreshFooter();
|
|
8642
9415
|
}
|
|
8643
9416
|
async runCommand(line) {
|
|
@@ -8659,13 +9432,15 @@ var TuiApp = class {
|
|
|
8659
9432
|
this.openReader();
|
|
8660
9433
|
return;
|
|
8661
9434
|
case "model":
|
|
9435
|
+
this.cancelEffortOperation();
|
|
8662
9436
|
await this.chooseModel(argument);
|
|
8663
9437
|
return;
|
|
8664
9438
|
case "effort":
|
|
8665
|
-
await this.
|
|
9439
|
+
await this.runCurrentEffort(argument);
|
|
8666
9440
|
return;
|
|
8667
9441
|
case "sessions":
|
|
8668
|
-
|
|
9442
|
+
case "resume":
|
|
9443
|
+
await this.openSessionPicker();
|
|
8669
9444
|
return;
|
|
8670
9445
|
case "new":
|
|
8671
9446
|
await this.switchSession(() => this.deps.host.create(), "new session");
|
|
@@ -8778,15 +9553,7 @@ var TuiApp = class {
|
|
|
8778
9553
|
async chooseModel(argument) {
|
|
8779
9554
|
const { selection } = this.bound;
|
|
8780
9555
|
if (argument === "save") {
|
|
8781
|
-
|
|
8782
|
-
/* v8 ignore next 4 -- the runner injects the default-model service; only teardown can remove it */
|
|
8783
|
-
if (defaults === void 0) {
|
|
8784
|
-
this.notice("no default model service is composed", "error");
|
|
8785
|
-
return;
|
|
8786
|
-
}
|
|
8787
|
-
const current = this.currentSelection();
|
|
8788
|
-
await defaults.saveSelection(current);
|
|
8789
|
-
this.notice(`default model saved: ${current.provider}/${current.model}`, "success");
|
|
9556
|
+
await this.saveDefaultModel(this.currentSelection());
|
|
8790
9557
|
return;
|
|
8791
9558
|
}
|
|
8792
9559
|
let next;
|
|
@@ -8807,16 +9574,19 @@ var TuiApp = class {
|
|
|
8807
9574
|
return;
|
|
8808
9575
|
}
|
|
8809
9576
|
const current = this.currentSelection();
|
|
8810
|
-
const picked = await this.showModal(new PickPrompt(this.deps.palette, "Model for the next request", items, {
|
|
9577
|
+
const picked = await this.showModal(new PickPrompt(this.deps.palette, "Model for the next request", items, {
|
|
9578
|
+
body: [MODEL_PICKER_HINT],
|
|
9579
|
+
current: `${current.provider}/${current.model}`,
|
|
9580
|
+
onSave: (item) => {
|
|
9581
|
+
this.saveDefaultModel(splitModelValue(item.value));
|
|
9582
|
+
}
|
|
9583
|
+
}));
|
|
8811
9584
|
if (picked === void 0) return;
|
|
8812
|
-
|
|
8813
|
-
next = {
|
|
8814
|
-
provider: picked.value.slice(0, slash),
|
|
8815
|
-
model: picked.value.slice(slash + 1)
|
|
8816
|
-
};
|
|
9585
|
+
next = splitModelValue(picked.value);
|
|
8817
9586
|
}
|
|
8818
9587
|
const effort = await this.chooseEffort(next);
|
|
8819
9588
|
if (effort === null) return;
|
|
9589
|
+
this.cancelEffortOperation();
|
|
8820
9590
|
selection.current = effort === void 0 ? next : {
|
|
8821
9591
|
...next,
|
|
8822
9592
|
reasoningEffort: effort
|
|
@@ -8825,6 +9595,26 @@ var TuiApp = class {
|
|
|
8825
9595
|
this.refreshFooter();
|
|
8826
9596
|
}
|
|
8827
9597
|
/**
|
|
9598
|
+
* Record `model` as the default every later launch starts from. The
|
|
9599
|
+
* reasoning effort rides along when the selection carries one.
|
|
9600
|
+
* @param model - the provider and model to save.
|
|
9601
|
+
*/
|
|
9602
|
+
async saveDefaultModel(model) {
|
|
9603
|
+
const defaults = this.deps.ctx.get("agentDefaultModel");
|
|
9604
|
+
/* v8 ignore next 4 -- the runner injects the default-model service; only teardown can remove it */
|
|
9605
|
+
if (defaults === void 0) {
|
|
9606
|
+
this.notice("no default model service is composed", "error");
|
|
9607
|
+
return;
|
|
9608
|
+
}
|
|
9609
|
+
try {
|
|
9610
|
+
await defaults.saveSelection(model);
|
|
9611
|
+
} catch (error) {
|
|
9612
|
+
this.notice(`default model not saved: ${describeFailure(error)}`, "error");
|
|
9613
|
+
return;
|
|
9614
|
+
}
|
|
9615
|
+
this.notice(`default model saved: ${model.provider}/${model.model}`, "success");
|
|
9616
|
+
}
|
|
9617
|
+
/**
|
|
8828
9618
|
* Offer the model's reasoning efforts when it declares more than one. The
|
|
8829
9619
|
* picker opens on the effort already in force for that exact model.
|
|
8830
9620
|
* @param model - the model the user picked.
|
|
@@ -8848,15 +9638,59 @@ var TuiApp = class {
|
|
|
8848
9638
|
return picked.value === "" ? void 0 : ReasoningEffortId(picked.value);
|
|
8849
9639
|
}
|
|
8850
9640
|
/**
|
|
9641
|
+
* Whether asynchronous command or picker work may no longer affect its
|
|
9642
|
+
* originating session.
|
|
9643
|
+
* @param bound - the session binding that started the work.
|
|
9644
|
+
* @param signal - cancellation owned by the picker operation.
|
|
9645
|
+
* @returns true after cancellation, quit, or a session switch.
|
|
9646
|
+
*/
|
|
9647
|
+
operationAbandoned(bound, signal) {
|
|
9648
|
+
return this.stopped || this.switching || this.bound !== bound || signal?.aborted === true;
|
|
9649
|
+
}
|
|
9650
|
+
/**
|
|
9651
|
+
* Whether current-model effort work lost either its session or selection.
|
|
9652
|
+
* @param bound - the session binding that started the work.
|
|
9653
|
+
* @param selected - that binding's explicit selection when the work began.
|
|
9654
|
+
* @param signal - cancellation owned by the effort operation.
|
|
9655
|
+
* @returns true when applying the result would overwrite newer state.
|
|
9656
|
+
*/
|
|
9657
|
+
effortAbandoned(bound, selected, signal) {
|
|
9658
|
+
return bound.selection.current !== selected || this.operationAbandoned(bound, signal);
|
|
9659
|
+
}
|
|
9660
|
+
/**
|
|
9661
|
+
* Run one current-model effort command; equal active arguments share it and
|
|
9662
|
+
* a different argument supersedes it.
|
|
9663
|
+
* @param argument - a declared effort id, `default`, or empty for the picker.
|
|
9664
|
+
* @returns when this effort operation settles.
|
|
9665
|
+
*/
|
|
9666
|
+
runCurrentEffort(argument) {
|
|
9667
|
+
if (this.effortOperation?.argument === argument) return this.effortOperation.done;
|
|
9668
|
+
this.cancelEffortOperation();
|
|
9669
|
+
const controller = new AbortController();
|
|
9670
|
+
const operation = {
|
|
9671
|
+
argument,
|
|
9672
|
+
controller,
|
|
9673
|
+
done: Promise.resolve()
|
|
9674
|
+
};
|
|
9675
|
+
this.effortOperation = operation;
|
|
9676
|
+
operation.done = this.chooseCurrentEffort(argument, this.bound, controller.signal).finally(() => {
|
|
9677
|
+
if (this.effortOperation === operation) this.effortOperation = void 0;
|
|
9678
|
+
});
|
|
9679
|
+
return operation.done;
|
|
9680
|
+
}
|
|
9681
|
+
/**
|
|
8851
9682
|
* Choose the bound model's reasoning effort for the next request: an empty
|
|
8852
9683
|
* argument opens the picker on the effort in force, `default` restores the
|
|
8853
9684
|
* provider default, and anything else names a declared effort.
|
|
8854
9685
|
* @param argument - a declared effort id, `default`, or empty.
|
|
9686
|
+
* @param bound - the session binding whose selection the lookup describes.
|
|
9687
|
+
* @param signal - withdraws an empty-argument picker when the session changes.
|
|
8855
9688
|
*/
|
|
8856
|
-
async chooseCurrentEffort(argument) {
|
|
8857
|
-
const
|
|
9689
|
+
async chooseCurrentEffort(argument, bound, signal) {
|
|
9690
|
+
const selected = bound.selection.current;
|
|
9691
|
+
const current = this.currentSelection(bound);
|
|
8858
9692
|
const lookup = await this.lookupEfforts(current);
|
|
8859
|
-
if (this.
|
|
9693
|
+
if (this.effortAbandoned(bound, selected, signal)) return;
|
|
8860
9694
|
if (lookup.kind !== "ready") {
|
|
8861
9695
|
this.reportEffortLookup(lookup, current);
|
|
8862
9696
|
return;
|
|
@@ -8875,28 +9709,11 @@ var TuiApp = class {
|
|
|
8875
9709
|
const picked = await this.showModal(new PickPrompt(this.deps.palette, `Reasoning effort · ${current.provider}/${current.model}`, effortItems(reasoning), {
|
|
8876
9710
|
body: [effortHint(reasoning, current.reasoningEffort)],
|
|
8877
9711
|
current: current.reasoningEffort ?? ""
|
|
8878
|
-
}));
|
|
8879
|
-
if (picked === void 0) return;
|
|
9712
|
+
}), signal);
|
|
9713
|
+
if (picked === void 0 || this.effortAbandoned(bound, selected, signal)) return;
|
|
8880
9714
|
this.applyEffort(current, picked.value === "" ? void 0 : ReasoningEffortId(picked.value));
|
|
8881
9715
|
}
|
|
8882
9716
|
/**
|
|
8883
|
-
* Advance the bound selection to the next reasoning effort, wrapping through
|
|
8884
|
-
* the provider default. A model with fewer than two efforts has nothing to cycle.
|
|
8885
|
-
*/
|
|
8886
|
-
async cycleEffort() {
|
|
8887
|
-
if (this.stopped || this.modals.isActive()) return;
|
|
8888
|
-
const current = this.currentSelection();
|
|
8889
|
-
const lookup = await this.lookupEfforts(current);
|
|
8890
|
-
if (this.stopped) return;
|
|
8891
|
-
if (lookup.kind !== "ready") {
|
|
8892
|
-
this.reportEffortLookup(lookup, current);
|
|
8893
|
-
return;
|
|
8894
|
-
}
|
|
8895
|
-
const steps = [void 0, ...lookup.reasoning.efforts.map((effort) => effort.id)];
|
|
8896
|
-
const index = steps.findIndex((step) => step === current.reasoningEffort);
|
|
8897
|
-
this.applyEffort(current, steps[index === -1 ? 1 : (index + 1) % steps.length]);
|
|
8898
|
-
}
|
|
8899
|
-
/**
|
|
8900
9717
|
* Read what one model declares about reasoning effort.
|
|
8901
9718
|
* @param model - the model to resolve.
|
|
8902
9719
|
* @returns the declared efforts, or why the terminal has none to offer.
|
|
@@ -8976,9 +9793,38 @@ var TuiApp = class {
|
|
|
8976
9793
|
}
|
|
8977
9794
|
return items;
|
|
8978
9795
|
}
|
|
8979
|
-
|
|
9796
|
+
/**
|
|
9797
|
+
* Open the one persisted-session picker shared by `/sessions` and `/resume`.
|
|
9798
|
+
* @returns when the active picker operation settles.
|
|
9799
|
+
*/
|
|
9800
|
+
openSessionPicker() {
|
|
9801
|
+
if (this.sessionPicker !== void 0) return this.sessionPicker.done;
|
|
9802
|
+
const controller = new AbortController();
|
|
9803
|
+
const operation = {
|
|
9804
|
+
controller,
|
|
9805
|
+
done: Promise.resolve()
|
|
9806
|
+
};
|
|
9807
|
+
this.sessionPicker = operation;
|
|
9808
|
+
operation.done = this.chooseSession(this.bound, controller.signal).finally(() => {
|
|
9809
|
+
if (this.sessionPicker === operation) this.sessionPicker = void 0;
|
|
9810
|
+
});
|
|
9811
|
+
return operation.done;
|
|
9812
|
+
}
|
|
9813
|
+
/**
|
|
9814
|
+
* List and open sessions for one still-current binding.
|
|
9815
|
+
* @param bound - the session that was current when listing began.
|
|
9816
|
+
* @param signal - cancels listing and withdraws its queued or visible picker.
|
|
9817
|
+
*/
|
|
9818
|
+
async chooseSession(bound, signal) {
|
|
8980
9819
|
this.notice("listing sessions…");
|
|
8981
|
-
|
|
9820
|
+
let choices;
|
|
9821
|
+
try {
|
|
9822
|
+
choices = await listSessionChoices(this.deps.ctx, bound.agent.session.id, signal);
|
|
9823
|
+
} catch (error) {
|
|
9824
|
+
if (signal.aborted) return;
|
|
9825
|
+
throw error;
|
|
9826
|
+
}
|
|
9827
|
+
if (this.operationAbandoned(bound, signal)) return;
|
|
8982
9828
|
if (choices.length === 0) {
|
|
8983
9829
|
this.notice("no persisted sessions are listed by the composed query engine", "error");
|
|
8984
9830
|
return;
|
|
@@ -8987,8 +9833,9 @@ var TuiApp = class {
|
|
|
8987
9833
|
value: choice.id,
|
|
8988
9834
|
...describeSession(choice)
|
|
8989
9835
|
}));
|
|
8990
|
-
const picked = await this.showModal(new PickPrompt(this.deps.palette, "Switch to a session", items));
|
|
8991
|
-
|
|
9836
|
+
const picked = await this.showModal(new PickPrompt(this.deps.palette, "Switch to a session", items), signal);
|
|
9837
|
+
if (picked === void 0 || this.operationAbandoned(bound, signal)) return;
|
|
9838
|
+
const target = choices.find((choice) => choice.id === picked.value);
|
|
8992
9839
|
if (target === void 0 || target.current) return;
|
|
8993
9840
|
await this.switchSession(() => this.deps.host.resume(target.id), "resumed");
|
|
8994
9841
|
}
|
|
@@ -9052,6 +9899,7 @@ var TuiApp = class {
|
|
|
9052
9899
|
const inbox = this.agent.inbox;
|
|
9053
9900
|
if (argument === "clear") {
|
|
9054
9901
|
inbox.clear();
|
|
9902
|
+
this.refreshQueue();
|
|
9055
9903
|
this.notice("queue cleared", "success");
|
|
9056
9904
|
return;
|
|
9057
9905
|
}
|
|
@@ -9425,7 +10273,13 @@ var TuiApp = class {
|
|
|
9425
10273
|
*/
|
|
9426
10274
|
settleFrame(viewportTop, width, frameLines) {
|
|
9427
10275
|
const rows = this.deps.terminal.rows;
|
|
9428
|
-
|
|
10276
|
+
const floor = repaintFloor(Math.max(frameLines - this.readerPad, rows) - rows, viewportTop);
|
|
10277
|
+
const pad = this.reader === void 0 && this.readerClosing === void 0 ? 0 : floor;
|
|
10278
|
+
this.viewportFloor = floor - pad;
|
|
10279
|
+
if (pad !== this.readerPad) {
|
|
10280
|
+
this.readerPad = pad;
|
|
10281
|
+
return true;
|
|
10282
|
+
}
|
|
9429
10283
|
const section = this.focusedSection();
|
|
9430
10284
|
const wanted = section !== void 0 && this.focus === "transcript" ? {
|
|
9431
10285
|
block: section.block,
|
|
@@ -9558,8 +10412,8 @@ var TuiApp = class {
|
|
|
9558
10412
|
const block = this.toolBlocks.get(result.toolCallId);
|
|
9559
10413
|
if (block === void 0) break;
|
|
9560
10414
|
const isError = result.isError === true;
|
|
9561
|
-
const
|
|
9562
|
-
block.setResult(
|
|
10415
|
+
const body = toolResultBody(this.presentResult(block.name, this.toolArguments.get(result.toolCallId), result.content, isError, event.data.meta), result.content);
|
|
10416
|
+
block.setResult(body.lines, isError, body.code);
|
|
9563
10417
|
this.fadeBlock((fade) => {
|
|
9564
10418
|
block.setResultFade(fade);
|
|
9565
10419
|
});
|
|
@@ -9763,9 +10617,10 @@ const Config = z.object({
|
|
|
9763
10617
|
contextPreviewLines: z.natural().min(1).default(4),
|
|
9764
10618
|
focusPreviewLines: z.natural().min(1).default(12),
|
|
9765
10619
|
readerMinColumns: z.natural().min(40).default(60),
|
|
10620
|
+
codeHighlight: z.boolean().default(true),
|
|
9766
10621
|
toastMs: z.natural().min(500).default(TOAST_MS),
|
|
9767
10622
|
liveRefreshMs: z.natural().min(100).default(1e3),
|
|
9768
|
-
streamFadeSteps: z.natural().min(2).default(
|
|
10623
|
+
streamFadeSteps: z.natural().min(2).default(12),
|
|
9769
10624
|
streamFadeStepMs: z.natural().min(16).default(33),
|
|
9770
10625
|
reducedMotion: z.boolean().default(false),
|
|
9771
10626
|
openBrowser: z.boolean().default(true)
|
|
@@ -9942,6 +10797,7 @@ async function run(ctx, config, host) {
|
|
|
9942
10797
|
contextPreviewLines: config.contextPreviewLines,
|
|
9943
10798
|
focusPreviewLines: config.focusPreviewLines,
|
|
9944
10799
|
readerMinColumns: config.readerMinColumns,
|
|
10800
|
+
codeHighlight: config.codeHighlight,
|
|
9945
10801
|
toastMs: config.toastMs,
|
|
9946
10802
|
liveRefreshMs: config.liveRefreshMs,
|
|
9947
10803
|
fadeSteps: config.streamFadeSteps,
|