santree 0.2.15 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/commands/dashboard.js +159 -119
- package/dist/commands/doctor.js +66 -1
- package/dist/commands/helpers/text-editor.d.ts +13 -0
- package/dist/commands/helpers/text-editor.js +118 -0
- package/dist/commands/worktree/create.d.ts +1 -0
- package/dist/commands/worktree/create.js +30 -38
- package/dist/lib/ai.js +11 -8
- package/dist/lib/dashboard/MultilineTextArea.js +306 -22
- package/dist/lib/dashboard/Overlays.d.ts +2 -2
- package/dist/lib/dashboard/Overlays.js +6 -5
- package/dist/lib/dashboard/data.js +5 -5
- package/dist/lib/dashboard/external-editor.d.ts +12 -0
- package/dist/lib/dashboard/external-editor.js +74 -0
- package/dist/lib/dashboard/types.d.ts +13 -1
- package/dist/lib/dashboard/types.js +13 -0
- package/dist/lib/git.d.ts +6 -4
- package/dist/lib/git.js +8 -33
- package/dist/lib/multiplexer/cmux.d.ts +2 -0
- package/dist/lib/multiplexer/cmux.js +97 -0
- package/dist/lib/multiplexer/index.d.ts +4 -0
- package/dist/lib/multiplexer/index.js +20 -0
- package/dist/lib/multiplexer/none.d.ts +2 -0
- package/dist/lib/multiplexer/none.js +22 -0
- package/dist/lib/multiplexer/tmux.d.ts +2 -0
- package/dist/lib/multiplexer/tmux.js +82 -0
- package/dist/lib/multiplexer/types.d.ts +23 -0
- package/dist/lib/multiplexer/types.js +3 -0
- package/dist/lib/session-signal.js +5 -8
- package/package.json +1 -1
- package/shell/init.zsh.njk +45 -15
package/shell/init.zsh.njk
CHANGED
|
@@ -1,22 +1,45 @@
|
|
|
1
|
-
# Santree Shell Integration for Zsh
|
|
2
|
-
#
|
|
1
|
+
# Santree Shell Integration for Zsh — self-caching bootstrap
|
|
2
|
+
# ===========================================================
|
|
3
3
|
#
|
|
4
|
-
# This
|
|
5
|
-
#
|
|
6
|
-
#
|
|
4
|
+
# This output is produced by `santree helpers shell-init zsh`. The santree CLI
|
|
5
|
+
# cold-starts in several seconds (Node + Pastel), so eval'ing it on every shell
|
|
6
|
+
# launch is too slow. To avoid that, the bootstrap below writes the rendered
|
|
7
|
+
# integration body to a cache file once, then sources the cache. Subsequent
|
|
8
|
+
# shells can source the cache file directly — bypassing the santree CLI
|
|
9
|
+
# entirely — and the cache self-invalidates whenever the santree binary is
|
|
10
|
+
# upgraded (see the self-validation header at the top of the cache content).
|
|
7
11
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
12
|
+
# .zshrc usage (one-liner with first-run fallback):
|
|
13
|
+
# _SI=${XDG_CACHE_HOME:-$HOME/.cache}/santree/init-zsh.zsh
|
|
14
|
+
# [[ -f $_SI ]] && source $_SI || eval "$(santree helpers shell-init zsh)"
|
|
10
15
|
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
+
# Behavior:
|
|
17
|
+
# - First shell after install: cache miss → runs santree (slow), writes cache.
|
|
18
|
+
# - Subsequent shells: source cache directly (fast, no santree spawn).
|
|
19
|
+
# - After `npm i -g santree` upgrade: cache mtime older than new binary,
|
|
20
|
+
# self-validation triggers a one-time regeneration in that shell.
|
|
21
|
+
|
|
22
|
+
_santree_cache="${SANTREE_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/santree}/init-zsh.zsh"
|
|
23
|
+
mkdir -p "${_santree_cache:h}"
|
|
24
|
+
|
|
25
|
+
# Write the integration body to the cache file. Single-quoted heredoc
|
|
26
|
+
# delimiter ('SANTREE_INIT_BODY_EOF__') prevents parameter expansion of the
|
|
27
|
+
# body — the variables and functions are evaluated only when the cache file
|
|
28
|
+
# is sourced, not during this write.
|
|
29
|
+
cat > "$_santree_cache" <<'SANTREE_INIT_BODY_EOF__'
|
|
30
|
+
# Santree Shell Integration for Zsh
|
|
31
|
+
# ==================================
|
|
32
|
+
# AUTO-GENERATED CACHE — do not edit. Regenerate with:
|
|
33
|
+
# eval "$(santree helpers shell-init zsh)"
|
|
16
34
|
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
35
|
+
# Self-validation: if the santree binary on $PATH is newer than this cache
|
|
36
|
+
# file, fall back to the slow path: re-run santree, which overwrites this
|
|
37
|
+
# cache and re-sources the fresh integration. `return` short-circuits the
|
|
38
|
+
# (now-stale) body below so its definitions don't get loaded.
|
|
39
|
+
if [[ ${commands[santree]:-} -nt ${(%):-%x} ]]; then
|
|
40
|
+
eval "$(command santree helpers shell-init zsh)"
|
|
41
|
+
return
|
|
42
|
+
fi
|
|
20
43
|
|
|
21
44
|
# Export marker so `santree doctor` can verify shell integration is loaded
|
|
22
45
|
export SANTREE_SHELL_INTEGRATION=1
|
|
@@ -172,3 +195,10 @@ if (( $+functions[compdef] )); then
|
|
|
172
195
|
compdef _santree santree
|
|
173
196
|
compdef _santree st
|
|
174
197
|
fi
|
|
198
|
+
SANTREE_INIT_BODY_EOF__
|
|
199
|
+
|
|
200
|
+
# Source the cache we just wrote so this shell gets the integration immediately.
|
|
201
|
+
# Future shells can skip the santree CLI and source the cache directly via the
|
|
202
|
+
# .zshrc one-liner shown in the comment block at the top of this output.
|
|
203
|
+
source "$_santree_cache"
|
|
204
|
+
unset _santree_cache
|