create-walle 0.9.30 → 0.9.32

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.
Files changed (112) hide show
  1. package/package.json +1 -1
  2. package/template/claude-task-manager/api-prompts.js +410 -5
  3. package/template/claude-task-manager/api-reviews.js +251 -3
  4. package/template/claude-task-manager/approval-agent.js +322 -24
  5. package/template/claude-task-manager/db.js +77 -13
  6. package/template/claude-task-manager/docs/codex-app-server-approvals.md +35 -1
  7. package/template/claude-task-manager/docs/postgres-concurrency-dgx-spark.html +407 -0
  8. package/template/claude-task-manager/docs/prompt-manager-redesign-proposal.html +667 -0
  9. package/template/claude-task-manager/docs/resume-ux-redesign.html +493 -0
  10. package/template/claude-task-manager/docs/review-redesign-proposal.html +892 -0
  11. package/template/claude-task-manager/docs/unified-auto-approver-proposal.html +520 -0
  12. package/template/claude-task-manager/git-utils.js +164 -26
  13. package/template/claude-task-manager/lib/agent-capabilities.js +26 -5
  14. package/template/claude-task-manager/lib/agent-cli-cache.js +1 -1
  15. package/template/claude-task-manager/lib/agent-presets.js +12 -0
  16. package/template/claude-task-manager/lib/agent-version-service.js +650 -0
  17. package/template/claude-task-manager/lib/approval-drift.js +57 -0
  18. package/template/claude-task-manager/lib/approval-hook.js +13 -0
  19. package/template/claude-task-manager/lib/auth-rules.js +6 -0
  20. package/template/claude-task-manager/lib/broadcast-payload-memo.js +109 -0
  21. package/template/claude-task-manager/lib/coding-agent-models.js +89 -8
  22. package/template/claude-task-manager/lib/db-owner-cooperative-scheduler.js +10 -1
  23. package/template/claude-task-manager/lib/document-review.js +75 -1
  24. package/template/claude-task-manager/lib/escalation-review.js +33 -3
  25. package/template/claude-task-manager/lib/headless-term-service.js +54 -9
  26. package/template/claude-task-manager/lib/mcp-risk.js +128 -0
  27. package/template/claude-task-manager/lib/microsoft-dev-tunnel-setup.js +51 -2
  28. package/template/claude-task-manager/lib/native-agent-model-args.js +149 -0
  29. package/template/claude-task-manager/lib/opencode-conversation-store.js +269 -0
  30. package/template/claude-task-manager/lib/permission-match.js +77 -5
  31. package/template/claude-task-manager/lib/read-pool-client.js +15 -6
  32. package/template/claude-task-manager/lib/restore-backoff.js +82 -0
  33. package/template/claude-task-manager/lib/runtime-registry.js +1 -0
  34. package/template/claude-task-manager/lib/scheduled-wake.js +42 -0
  35. package/template/claude-task-manager/lib/session-capture.js +33 -6
  36. package/template/claude-task-manager/lib/session-history.js +60 -3
  37. package/template/claude-task-manager/lib/session-jobs.js +19 -0
  38. package/template/claude-task-manager/lib/session-restore.js +5 -4
  39. package/template/claude-task-manager/lib/session-standup.js +2 -0
  40. package/template/claude-task-manager/lib/session-stream.js +9 -0
  41. package/template/claude-task-manager/lib/state-sync/cell-diff.js +31 -4
  42. package/template/claude-task-manager/lib/state-sync/restore-frame-hold.js +39 -0
  43. package/template/claude-task-manager/lib/tui-input-modes.js +40 -0
  44. package/template/claude-task-manager/lib/walle-ctm-history.js +103 -36
  45. package/template/claude-task-manager/lib/walle-session-model-catalog.js +7 -1
  46. package/template/claude-task-manager/lib/walle-token-chip.js +65 -0
  47. package/template/claude-task-manager/package.json +1 -1
  48. package/template/claude-task-manager/providers/claude-code.js +20 -1
  49. package/template/claude-task-manager/providers/codex-mcp-extract.js +33 -0
  50. package/template/claude-task-manager/providers/codex-mcp.js +23 -20
  51. package/template/claude-task-manager/providers/codex.js +65 -1
  52. package/template/claude-task-manager/public/css/prompts.css +345 -0
  53. package/template/claude-task-manager/public/css/reviews.css +248 -40
  54. package/template/claude-task-manager/public/css/walle-session.css +90 -26
  55. package/template/claude-task-manager/public/index.html +2031 -428
  56. package/template/claude-task-manager/public/js/document-review-links.js +255 -13
  57. package/template/claude-task-manager/public/js/file-context-menu.js +185 -0
  58. package/template/claude-task-manager/public/js/message-renderer.js +46 -1
  59. package/template/claude-task-manager/public/js/mobile-review-core.js +54 -0
  60. package/template/claude-task-manager/public/js/prompt-diff.js +55 -0
  61. package/template/claude-task-manager/public/js/prompt-editor-chrome.js +108 -0
  62. package/template/claude-task-manager/public/js/prompt-editor-modes.js +87 -0
  63. package/template/claude-task-manager/public/js/prompt-organize.js +179 -0
  64. package/template/claude-task-manager/public/js/prompt-reuse.js +77 -0
  65. package/template/claude-task-manager/public/js/prompts.js +683 -215
  66. package/template/claude-task-manager/public/js/resume-state.js +186 -0
  67. package/template/claude-task-manager/public/js/reviews.js +402 -121
  68. package/template/claude-task-manager/public/js/screenshot-router.js +91 -0
  69. package/template/claude-task-manager/public/js/session-search-utils.js +81 -0
  70. package/template/claude-task-manager/public/js/state-sync-client.js +134 -17
  71. package/template/claude-task-manager/public/js/stream-view.js +93 -20
  72. package/template/claude-task-manager/public/js/walle-session.js +183 -32
  73. package/template/claude-task-manager/public/js/walle.js +21 -9
  74. package/template/claude-task-manager/public/m/app.css +117 -0
  75. package/template/claude-task-manager/public/m/app.js +309 -3
  76. package/template/claude-task-manager/public/m/index.html +56 -1
  77. package/template/claude-task-manager/server.js +724 -305
  78. package/template/claude-task-manager/workers/db-owner-worker.js +8 -0
  79. package/template/claude-task-manager/workers/read-pool-worker.js +4 -0
  80. package/template/claude-task-manager/workers/state-detectors/claude-code.js +10 -1
  81. package/template/docs/proposals/2026-06-23-local-model-right-path.html +340 -0
  82. package/template/docs/proposals/2026-06-24-qlora-done-right.md +255 -0
  83. package/template/package.json +1 -1
  84. package/template/wall-e/api-walle.js +21 -3
  85. package/template/wall-e/bin/train-gemma-e4b-tooluse.js +27 -4
  86. package/template/wall-e/brain.js +50 -5
  87. package/template/wall-e/chat/force-compact.js +73 -0
  88. package/template/wall-e/chat.js +137 -9
  89. package/template/wall-e/coding/action-memory-policy.js +120 -1
  90. package/template/wall-e/coding/compaction-service.js +10 -3
  91. package/template/wall-e/coding/model-router.js +116 -0
  92. package/template/wall-e/coding-orchestrator.js +303 -11
  93. package/template/wall-e/coding-prompts.js +1 -1
  94. package/template/wall-e/docs/skill-self-heal-design.html +429 -0
  95. package/template/wall-e/llm/client.js +115 -6
  96. package/template/wall-e/llm/codex-cli.js +71 -23
  97. package/template/wall-e/llm/codex-cli.plugin.json +1 -0
  98. package/template/wall-e/llm/default-fallback.js +71 -11
  99. package/template/wall-e/llm/mlx-worker.js +0 -0
  100. package/template/wall-e/llm/mlx.js +46 -12
  101. package/template/wall-e/llm/provider-error.js +9 -3
  102. package/template/wall-e/llm/provider-health-state.js +561 -11
  103. package/template/wall-e/llm/registry.js +6 -0
  104. package/template/wall-e/llm/routing-policy.js +255 -25
  105. package/template/wall-e/llm/tool-call-validator.js +156 -0
  106. package/template/wall-e/skills/skill-dispatch-decision.js +82 -2
  107. package/template/wall-e/skills/skill-planner.js +72 -5
  108. package/template/wall-e/tools/command-registry.js +34 -0
  109. package/template/wall-e/training/gemma-e4b-qlora.js +197 -1
  110. package/template/wall-e/training/mlx_lora_launch.py +196 -0
  111. package/template/wall-e/training/training-coexistence.sh +87 -0
  112. package/template/wall-e/training/training-mem-guard.sh +76 -0
@@ -0,0 +1,87 @@
1
+ #!/bin/bash
2
+ # training-coexistence.sh — reclaim RAM headroom for a heavy training run by
3
+ # stopping *memory-heavy, non-essential* apps, then restoring them afterward.
4
+ #
5
+ # Design constraints (learned the hard way):
6
+ # - NEVER stop the browser: the CTM/Wall-E UI runs in it (localhost:3456).
7
+ # - NEVER stop CTM, Wall-E, or the EDR agent.
8
+ # - Only stop apps that actually FREE RAM on exit (SIGSTOP does not reclaim
9
+ # memory — it only freezes — so we quit/stop, not pause).
10
+ #
11
+ # Config (user-customizable): ~/.walle/training-coexistence.json
12
+ # { "stopApps": ["OrbStack"], "minFreeGb": 8 }
13
+ # Anything in the hard denylist below is refused even if listed.
14
+ #
15
+ # Usage: training-coexistence.sh pause (stops configured apps, prints what it did)
16
+ # training-coexistence.sh restore (restarts what pause stopped)
17
+ set -u
18
+ CFG="${WALLE_COEXIST_CONFIG:-$HOME/.walle/training-coexistence.json}"
19
+ STATE="$HOME/.walle/.training-coexistence-stopped"
20
+ # ERE (macOS grep has no -P); matched case-insensitively via grep -i.
21
+ DENY_RE='chrome|chromium|safari|arc|brave|edge|firefox|claude task|ctm|wall-e|walle|node|cortex|traps|paloalto|windowserver|finder|terminal|iterm'
22
+
23
+ read_list(){ # stopApps from config, or default OrbStack
24
+ if [ -f "$CFG" ] && command -v node >/dev/null 2>&1; then
25
+ node -e 'try{const c=require(process.argv[1]);process.stdout.write((c.stopApps||["OrbStack"]).join("\n"))}catch(e){process.stdout.write("OrbStack")}' "$CFG"
26
+ else echo "OrbStack"; fi
27
+ }
28
+
29
+ stop_app(){
30
+ local app="$1"
31
+ if echo "$app" | grep -qiE 'orbstack|orb'; then
32
+ command -v orb >/dev/null 2>&1 && { orb stop >/dev/null 2>&1 && echo "OrbStack"; return; }
33
+ fi
34
+ # generic: graceful quit via AppleScript (frees RAM on exit)
35
+ osascript -e "quit app \"$app\"" >/dev/null 2>&1 && echo "$app"
36
+ }
37
+
38
+ stop_ollama_server(){ # stop the SERVER (not just unload) so Wall-E can't reload it mid-run.
39
+ command -v ollama >/dev/null 2>&1 || return
40
+ if brew services list 2>/dev/null | grep -qiE '^ollama +started'; then
41
+ brew services stop ollama >/dev/null 2>&1 && { echo "OLLAMA:brew" >> "$STATE"; echo "stopped ollama (brew service)"; return; }
42
+ fi
43
+ if pgrep -fl 'Ollama.app' >/dev/null 2>&1; then
44
+ osascript -e 'quit app "Ollama"' >/dev/null 2>&1 && { echo "OLLAMA:app" >> "$STATE"; echo "stopped Ollama.app"; return; }
45
+ fi
46
+ if pgrep -f 'ollama serve' >/dev/null 2>&1; then
47
+ pkill -f 'ollama serve' >/dev/null 2>&1 && { echo "OLLAMA:bare" >> "$STATE"; echo "stopped ollama serve (bare)"; return; }
48
+ fi
49
+ }
50
+
51
+ restore_ollama(){
52
+ case "$1" in
53
+ OLLAMA:brew) brew services start ollama >/dev/null 2>&1 && echo "restarted ollama (brew service)";;
54
+ OLLAMA:app) open -a Ollama >/dev/null 2>&1 && echo "restarted Ollama.app";;
55
+ OLLAMA:bare) nohup ollama serve >/dev/null 2>&1 & echo "restarted ollama serve (bare)";;
56
+ esac
57
+ }
58
+
59
+ want_ollama(){ # default ON; config { "unloadOllama": false } to disable
60
+ if [ -f "$CFG" ] && command -v node >/dev/null 2>&1; then
61
+ node -e 'try{const c=require(process.argv[1]);process.stdout.write(String(c.unloadOllama!==false))}catch(e){process.stdout.write("true")}' "$CFG"
62
+ else echo "true"; fi
63
+ }
64
+
65
+ case "${1:-}" in
66
+ pause)
67
+ : > "$STATE"
68
+ [ "$(want_ollama)" = "true" ] && stop_ollama_server
69
+ while IFS= read -r app; do
70
+ [ -z "$app" ] && continue
71
+ if echo "$app" | grep -qiE "$DENY_RE"; then echo "REFUSED (denylist): $app" >&2; continue; fi
72
+ done_app=$(stop_app "$app")
73
+ [ -n "$done_app" ] && { echo "$done_app" >> "$STATE"; echo "stopped: $done_app"; }
74
+ done < <(read_list)
75
+ ;;
76
+ restore)
77
+ [ -f "$STATE" ] || { echo "nothing to restore"; exit 0; }
78
+ while IFS= read -r app; do
79
+ [ -z "$app" ] && continue
80
+ case "$app" in OLLAMA:*) restore_ollama "$app"; continue;; esac
81
+ if echo "$app" | grep -qiE 'orbstack|orb'; then command -v orb >/dev/null 2>&1 && orb start >/dev/null 2>&1 && echo "restarted: OrbStack"
82
+ else open -a "$app" >/dev/null 2>&1 && echo "restarted: $app"; fi
83
+ done < "$STATE"
84
+ rm -f "$STATE"
85
+ ;;
86
+ *) echo "usage: $0 pause|restore" >&2; exit 2;;
87
+ esac
@@ -0,0 +1,76 @@
1
+ #!/bin/bash
2
+ # training-mem-guard.sh — host-OOM watchdog for MLX training runs.
3
+ #
4
+ # MLX's set_memory_limit is a SOFT guideline (it only raises once RAM+swap is
5
+ # exhausted), so a runaway training process can still drive the whole machine
6
+ # into a jetsam low-memory kill / restart — which on this box would take down
7
+ # the live CTM/Wall-E sessions. This watchdog is the hard guarantee: it polls
8
+ # the trainer's RSS and system available memory and SIGTERMs the trainer BEFORE
9
+ # the host is endangered. Pair it with frequent --save-every so a kill costs
10
+ # only minutes.
11
+ #
12
+ # Usage:
13
+ # training-mem-guard.sh --match <pgrep-pattern> --cap-gb N --min-free-gb M \
14
+ # [--interval S] [--log PATH]
15
+ #
16
+ # Kills the matched process (and its tree) if EITHER:
17
+ # - its RSS exceeds --cap-gb, or
18
+ # - system available memory drops below --min-free-gb.
19
+ set -u
20
+ MATCH="mlx_lora_launch"; CAP_GB=40; MIN_FREE_GB=8; INTERVAL=5; LOG=/dev/stderr
21
+ while [ $# -gt 0 ]; do
22
+ case "$1" in
23
+ --match) MATCH="$2"; shift 2;;
24
+ --cap-gb) CAP_GB="$2"; shift 2;;
25
+ --min-free-gb) MIN_FREE_GB="$2"; shift 2;;
26
+ --interval) INTERVAL="$2"; shift 2;;
27
+ --log) LOG="$2"; shift 2;;
28
+ *) echo "unknown arg $1" >&2; exit 2;;
29
+ esac
30
+ done
31
+ PAGE=$(sysctl -n hw.pagesize 2>/dev/null || echo 16384)
32
+ log(){ echo "[mem-guard $(date '+%H:%M:%S')] $*" >> "$LOG"; }
33
+
34
+ avail_gb(){
35
+ # available ≈ (free + inactive + speculative + purgeable) pages * pagesize
36
+ vm_stat 2>/dev/null | awk -v pg="$PAGE" '
37
+ /Pages free/ {f=$3}
38
+ /Pages inactive/ {i=$3}
39
+ /Pages speculative/ {s=$3}
40
+ /Pages purgeable/ {p=$3}
41
+ END { gsub(/\./,"",f); gsub(/\./,"",i); gsub(/\./,"",s); gsub(/\./,"",p);
42
+ printf "%.2f", (f+i+s+p)*pg/1073741824 }'
43
+ }
44
+
45
+ log "armed: match=$MATCH cap=${CAP_GB}GB min_free=${MIN_FREE_GB}GB interval=${INTERVAL}s"
46
+ # Startup grace: the trainer (node -> python child) may not exist yet. Wait up
47
+ # to ~180s for it to first appear before the "gone -> exit" logic applies, so we
48
+ # don't exit immediately on a launch race.
49
+ appeared=0
50
+ for _ in $(seq 1 45); do
51
+ if [ -n "$(pgrep -f "$MATCH" | head -1)" ]; then appeared=1; break; fi
52
+ sleep 4
53
+ done
54
+ [ "$appeared" = 1 ] && log "trainer detected — monitoring" || log "trainer never appeared in grace window — exiting"
55
+ [ "$appeared" = 1 ] || exit 0
56
+ while true; do
57
+ PID=$(pgrep -f "$MATCH" | head -1)
58
+ if [ -z "$PID" ]; then log "trainer gone — exiting clean"; exit 0; fi
59
+ RSS_KB=$(ps -o rss= -p "$PID" 2>/dev/null | tr -d ' ')
60
+ [ -z "$RSS_KB" ] && { log "pid $PID vanished"; exit 0; }
61
+ RSS_GB=$(awk -v k="$RSS_KB" 'BEGIN{printf "%.2f", k/1048576}')
62
+ AVAIL=$(avail_gb)
63
+ over_rss=$(awk -v r="$RSS_GB" -v c="$CAP_GB" 'BEGIN{print (r>c)?1:0}')
64
+ low_free=$(awk -v a="$AVAIL" -v m="$MIN_FREE_GB" 'BEGIN{print (a<m)?1:0}')
65
+ if [ "$over_rss" = 1 ] || [ "$low_free" = 1 ]; then
66
+ why="rss=${RSS_GB}GB(cap=${CAP_GB}) avail=${AVAIL}GB(min=${MIN_FREE_GB})"
67
+ log "BREACH ($why) — SIGTERM trainer tree pid=$PID to protect host"
68
+ # kill the node parent tree too so the driver stops cleanly
69
+ PPID_=$(ps -o ppid= -p "$PID" 2>/dev/null | tr -d ' ')
70
+ kill -TERM "$PID" 2>/dev/null
71
+ [ -n "$PPID_" ] && kill -TERM "$PPID_" 2>/dev/null
72
+ sleep 3; kill -KILL "$PID" 2>/dev/null
73
+ exit 1
74
+ fi
75
+ sleep "$INTERVAL"
76
+ done