santree 0.7.4 → 0.7.6
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 +2 -3
- package/dist/commands/config.d.ts +12 -0
- package/dist/commands/config.js +444 -0
- package/dist/commands/dashboard.js +187 -80
- package/dist/commands/helpers/statusline.js +0 -30
- package/dist/commands/issue/index.d.ts +1 -1
- package/dist/commands/issue/index.js +1 -1
- package/dist/commands/pr/context.d.ts +7 -0
- package/dist/commands/pr/context.js +36 -0
- package/dist/commands/pr/fix.d.ts +11 -2
- package/dist/commands/pr/fix.js +64 -12
- package/dist/commands/worktree/create.js +17 -11
- package/dist/commands/worktree/open.js +3 -2
- package/dist/commands/worktree/switch.js +3 -11
- package/dist/lib/ai.d.ts +11 -0
- package/dist/lib/ai.js +71 -2
- package/dist/lib/cd-hint.d.ts +18 -0
- package/dist/lib/cd-hint.js +27 -0
- package/dist/lib/claude-config.d.ts +26 -0
- package/dist/lib/claude-config.js +121 -0
- package/dist/lib/config/TrackerPicker.d.ts +10 -0
- package/dist/lib/config/TrackerPicker.js +113 -0
- package/dist/lib/config/diagnostics.d.ts +37 -0
- package/dist/lib/config/diagnostics.js +190 -0
- package/dist/lib/config-store.d.ts +23 -0
- package/dist/lib/config-store.js +68 -0
- package/dist/lib/dashboard/DetailPanel.d.ts +7 -2
- package/dist/lib/dashboard/DetailPanel.js +54 -37
- package/dist/lib/dashboard/IssueList.d.ts +5 -1
- package/dist/lib/dashboard/IssueList.js +24 -5
- package/dist/lib/dashboard/MultilineTextArea.js +1 -1
- package/dist/lib/dashboard/Overlays.js +3 -4
- package/dist/lib/dashboard/ReviewDetailPanel.js +11 -2
- package/dist/lib/dashboard/ReviewList.js +6 -3
- package/dist/lib/dashboard/data.js +7 -34
- package/dist/lib/dashboard/external-editor.d.ts +1 -1
- package/dist/lib/dashboard/external-editor.js +3 -2
- package/dist/lib/dashboard/types.d.ts +19 -2
- package/dist/lib/dashboard/types.js +68 -2
- package/dist/lib/exec.d.ts +13 -0
- package/dist/lib/exec.js +11 -1
- package/dist/lib/fix-loop.d.ts +45 -0
- package/dist/lib/fix-loop.js +83 -0
- package/dist/lib/git.d.ts +3 -29
- package/dist/lib/git.js +6 -62
- package/dist/lib/github.d.ts +70 -0
- package/dist/lib/github.js +128 -0
- package/dist/lib/multiplexer/cmux.js +143 -17
- package/dist/lib/multiplexer/none.js +3 -3
- package/dist/lib/multiplexer/tmux.js +5 -29
- package/dist/lib/multiplexer/types.d.ts +34 -1
- package/dist/lib/open-url.d.ts +3 -2
- package/dist/lib/open-url.js +5 -4
- package/dist/lib/prompts.d.ts +35 -1
- package/dist/lib/prompts.js +7 -0
- package/dist/lib/setup/apply.d.ts +16 -0
- package/dist/lib/setup/apply.js +35 -0
- package/dist/lib/setup/gitignore.d.ts +24 -0
- package/dist/lib/setup/gitignore.js +95 -0
- package/dist/lib/setup/steps.d.ts +39 -0
- package/dist/lib/setup/steps.js +333 -0
- package/dist/lib/setup/tools.d.ts +23 -0
- package/dist/lib/setup/tools.js +47 -0
- package/dist/lib/squirrel-loader.d.ts +3 -1
- package/dist/lib/squirrel-loader.js +2 -2
- package/dist/lib/trackers/github/index.js +2 -2
- package/dist/lib/trackers/local/store.js +1 -1
- package/package.json +1 -2
- package/prompts/fix-context.njk +79 -0
- package/prompts/fix-loop.njk +18 -0
- package/prompts/pr.njk +1 -1
- package/dist/commands/doctor.d.ts +0 -2
- package/dist/commands/doctor.js +0 -618
- package/dist/commands/github/auth.d.ts +0 -2
- package/dist/commands/github/auth.js +0 -56
- package/dist/commands/github/index.d.ts +0 -1
- package/dist/commands/github/index.js +0 -1
- package/dist/commands/helpers/english-tutor/index.d.ts +0 -1
- package/dist/commands/helpers/english-tutor/index.js +0 -1
- package/dist/commands/helpers/english-tutor/install.d.ts +0 -8
- package/dist/commands/helpers/english-tutor/install.js +0 -24
- package/dist/commands/helpers/english-tutor/prompt.d.ts +0 -2
- package/dist/commands/helpers/english-tutor/prompt.js +0 -16
- package/dist/commands/helpers/english-tutor/session-start.d.ts +0 -2
- package/dist/commands/helpers/english-tutor/session-start.js +0 -34
- package/dist/commands/helpers/english-tutor/uninstall.d.ts +0 -2
- package/dist/commands/helpers/english-tutor/uninstall.js +0 -15
- package/dist/commands/helpers/session-signal/end.d.ts +0 -2
- package/dist/commands/helpers/session-signal/end.js +0 -13
- package/dist/commands/helpers/session-signal/index.d.ts +0 -1
- package/dist/commands/helpers/session-signal/index.js +0 -1
- package/dist/commands/helpers/session-signal/install.d.ts +0 -8
- package/dist/commands/helpers/session-signal/install.js +0 -24
- package/dist/commands/helpers/session-signal/notification.d.ts +0 -2
- package/dist/commands/helpers/session-signal/notification.js +0 -13
- package/dist/commands/helpers/session-signal/prompt.d.ts +0 -2
- package/dist/commands/helpers/session-signal/prompt.js +0 -13
- package/dist/commands/helpers/session-signal/stop.d.ts +0 -2
- package/dist/commands/helpers/session-signal/stop.js +0 -13
- package/dist/commands/helpers/shell-init.d.ts +0 -11
- package/dist/commands/helpers/shell-init.js +0 -122
- package/dist/commands/issue/setup.d.ts +0 -2
- package/dist/commands/issue/setup.js +0 -108
- package/dist/commands/issue/switch.d.ts +0 -12
- package/dist/commands/issue/switch.js +0 -38
- package/dist/commands/linear/switch.d.ts +0 -2
- package/dist/commands/linear/switch.js +0 -75
- package/dist/lib/english-tutor.d.ts +0 -13
- package/dist/lib/english-tutor.js +0 -125
- package/dist/lib/session-signal.d.ts +0 -16
- package/dist/lib/session-signal.js +0 -104
- package/prompts/english-tutor-prompt.njk +0 -15
- package/shell/init.bash.njk +0 -129
- package/shell/init.zsh.njk +0 -204
package/shell/init.zsh.njk
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
# Santree Shell Integration for Zsh — self-caching bootstrap
|
|
2
|
-
# ===========================================================
|
|
3
|
-
#
|
|
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).
|
|
11
|
-
#
|
|
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)"
|
|
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)"
|
|
34
|
-
#
|
|
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
|
|
43
|
-
|
|
44
|
-
# Export marker so `santree doctor` can verify shell integration is loaded
|
|
45
|
-
export SANTREE_SHELL_INTEGRATION=1
|
|
46
|
-
|
|
47
|
-
function santree() {
|
|
48
|
-
# -------------------------------------------------------------------------
|
|
49
|
-
# STEP 1: Handle deleted directory recovery
|
|
50
|
-
# -------------------------------------------------------------------------
|
|
51
|
-
if [[ ! -d "$(pwd 2>/dev/null)" ]]; then
|
|
52
|
-
local current_path="$(pwd 2>/dev/null)"
|
|
53
|
-
|
|
54
|
-
if [[ "$current_path" == */.santree/worktrees/* ]]; then
|
|
55
|
-
local main_repo="${current_path%%/.santree/worktrees/*}"
|
|
56
|
-
if [[ -d "$main_repo" ]]; then
|
|
57
|
-
echo "⚠ Worktree directory deleted. Returning to main repo."
|
|
58
|
-
cd "$main_repo" || cd ~ || return 1
|
|
59
|
-
else
|
|
60
|
-
cd ~ || return 1
|
|
61
|
-
fi
|
|
62
|
-
else
|
|
63
|
-
echo "⚠ Current directory no longer exists. Returning to home."
|
|
64
|
-
cd ~ || return 1
|
|
65
|
-
fi
|
|
66
|
-
fi
|
|
67
|
-
|
|
68
|
-
# -------------------------------------------------------------------------
|
|
69
|
-
# STEP 2: Handle commands that need directory switching
|
|
70
|
-
# -------------------------------------------------------------------------
|
|
71
|
-
if [[ "$1" == "worktree" && ("$2" == "create" || "$2" == "switch") ]]; then
|
|
72
|
-
local output
|
|
73
|
-
output=$(command santree "$@" 2>&1)
|
|
74
|
-
local exit_code=$?
|
|
75
|
-
|
|
76
|
-
if [[ "$output" == *SANTREE_CD:* ]]; then
|
|
77
|
-
echo "$output" | grep -v "SANTREE_CD:" | grep -v "SANTREE_WORK:" | grep -v "SANTREE_WORK_CONTEXT:"
|
|
78
|
-
|
|
79
|
-
local target_dir=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g' | grep "SANTREE_CD:" | sed 's/.*SANTREE_CD://')
|
|
80
|
-
|
|
81
|
-
if [[ -n "$target_dir" && -d "$target_dir" ]]; then
|
|
82
|
-
cd "$target_dir" && echo "Switched to: $target_dir"
|
|
83
|
-
fi
|
|
84
|
-
|
|
85
|
-
if [[ "$output" == *SANTREE_WORK:* ]]; then
|
|
86
|
-
local work_mode=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g' | grep "^SANTREE_WORK:" | sed 's/.*SANTREE_WORK://')
|
|
87
|
-
local context_file=""
|
|
88
|
-
if [[ "$output" == *SANTREE_WORK_CONTEXT:* ]]; then
|
|
89
|
-
context_file=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g' | grep "SANTREE_WORK_CONTEXT:" | sed 's/.*SANTREE_WORK_CONTEXT://')
|
|
90
|
-
fi
|
|
91
|
-
if [[ -n "$context_file" ]]; then
|
|
92
|
-
[[ "$work_mode" == "plan" ]] && command santree worktree work --plan --context-file "$context_file" || command santree worktree work --context-file "$context_file"
|
|
93
|
-
else
|
|
94
|
-
[[ "$work_mode" == "plan" ]] && command santree worktree work --plan || command santree worktree work
|
|
95
|
-
fi
|
|
96
|
-
fi
|
|
97
|
-
else
|
|
98
|
-
echo "$output"
|
|
99
|
-
fi
|
|
100
|
-
return $exit_code
|
|
101
|
-
fi
|
|
102
|
-
|
|
103
|
-
# -------------------------------------------------------------------------
|
|
104
|
-
# STEP 3: Pass through all other commands
|
|
105
|
-
# -------------------------------------------------------------------------
|
|
106
|
-
command santree "$@"
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
# Aliases for convenience
|
|
110
|
-
alias st='santree'
|
|
111
|
-
alias stw='santree worktree'
|
|
112
|
-
|
|
113
|
-
# Quick create worktree with work+plan+tmux (prompts for branch)
|
|
114
|
-
function stn() {
|
|
115
|
-
local branch
|
|
116
|
-
vared -p "Branch name: " branch
|
|
117
|
-
[[ -z "$branch" ]] && echo "Branch name required" && return 1
|
|
118
|
-
santree worktree create "$branch" --work --plan --tmux
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
# =============================================================================
|
|
122
|
-
# Zsh Completions (auto-generated)
|
|
123
|
-
# =============================================================================
|
|
124
|
-
|
|
125
|
-
__santree_get_worktree_branches() {
|
|
126
|
-
local -a branches
|
|
127
|
-
branches=(${(f)"$(git worktree list --porcelain 2>/dev/null | grep '^branch ' | sed 's/branch refs\/heads\///')"})
|
|
128
|
-
_describe -t branches 'worktree branches' branches
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
__santree_get_all_branches() {
|
|
132
|
-
local -a branches
|
|
133
|
-
branches=(${(f)"$(git branch -a 2>/dev/null | sed 's/^[* ] //' | sed 's/remotes\/origin\///' | sort -u)"})
|
|
134
|
-
_describe -t branches 'git branches' branches
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
__santree_commands() {
|
|
138
|
-
local -a commands
|
|
139
|
-
commands=(
|
|
140
|
-
{%- for cmd in commands %}
|
|
141
|
-
'{{ cmd.name }}:{{ cmd.description }}'
|
|
142
|
-
{%- endfor %}
|
|
143
|
-
)
|
|
144
|
-
_describe -t commands 'santree commands' commands
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
{% for cmd in commands %}
|
|
148
|
-
__santree_{{ cmd.funcName }}() {
|
|
149
|
-
{%- if cmd.options.length == 0 and not cmd.hasArgs %}
|
|
150
|
-
return 0
|
|
151
|
-
{%- else %}
|
|
152
|
-
_arguments \
|
|
153
|
-
{%- if cmd.argCompletion == 'worktree_branches' %}
|
|
154
|
-
'1:branch:__santree_get_worktree_branches'{% if cmd.options.length > 0 %} \{% endif %}
|
|
155
|
-
{%- elif cmd.argCompletion == 'shells' %}
|
|
156
|
-
'1:shell:(zsh bash)'{% if cmd.options.length > 0 %} \{% endif %}
|
|
157
|
-
{%- elif cmd.argCompletion == 'static' %}
|
|
158
|
-
'1:subcommand:({{ cmd.argCompletionValues }})'{% if cmd.options.length > 0 %} \{% endif %}
|
|
159
|
-
{%- elif cmd.hasArgs %}
|
|
160
|
-
'1:branch name:'{% if cmd.options.length > 0 %} \{% endif %}
|
|
161
|
-
{%- endif %}
|
|
162
|
-
{%- for opt in cmd.options %}
|
|
163
|
-
'--{{ opt.name }}[{{ opt.description }}]{% if opt.completion == 'all_branches' %}:base branch:__santree_get_all_branches{% endif %}'{% if not loop.last %} \{% endif %}
|
|
164
|
-
{%- endfor %}
|
|
165
|
-
{%- endif %}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
{% endfor %}
|
|
169
|
-
_santree() {
|
|
170
|
-
local curcontext="$curcontext" state line
|
|
171
|
-
typeset -A opt_args
|
|
172
|
-
|
|
173
|
-
_arguments -C \
|
|
174
|
-
'1: :->command' \
|
|
175
|
-
'*:: :->args'
|
|
176
|
-
|
|
177
|
-
case $state in
|
|
178
|
-
command)
|
|
179
|
-
__santree_commands
|
|
180
|
-
;;
|
|
181
|
-
args)
|
|
182
|
-
case $line[1] in
|
|
183
|
-
{%- for cmd in commands %}
|
|
184
|
-
{{ cmd.name }})
|
|
185
|
-
__santree_{{ cmd.funcName }}
|
|
186
|
-
;;
|
|
187
|
-
{%- endfor %}
|
|
188
|
-
esac
|
|
189
|
-
;;
|
|
190
|
-
esac
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
# Register completions (only if compdef is available)
|
|
194
|
-
if (( $+functions[compdef] )); then
|
|
195
|
-
compdef _santree santree
|
|
196
|
-
compdef _santree st
|
|
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
|