itermbot 1.0.13 → 1.0.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itermbot",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "iTermBot: ReAct agent (LangChain) + DeepAgent (DeepAgents) using BotBotGo packages",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env bash
2
+ set -u
3
+
4
+ TOP_N=15
5
+ SHOW_HOTSPOTS=1
6
+ HOME_PATH="${HOME:-}"
7
+ DATA_PATH="/System/Volumes/Data"
8
+
9
+ print_usage() {
10
+ cat <<'EOF'
11
+ Usage: locate-heavy-paths.sh [options]
12
+
13
+ Read-only disk usage locator for macOS.
14
+ It only reports heavy directories and does not delete anything.
15
+
16
+ Options:
17
+ --top N Show top N lines per section (default: 15)
18
+ --home PATH Override home path (default: $HOME)
19
+ --data PATH Override data volume path (default: /System/Volumes/Data)
20
+ --no-hotspots Skip known hotspot checks
21
+ -h, --help Show help
22
+ EOF
23
+ }
24
+
25
+ while [[ $# -gt 0 ]]; do
26
+ case "$1" in
27
+ --top)
28
+ TOP_N="${2:-}"
29
+ shift 2
30
+ ;;
31
+ --home)
32
+ HOME_PATH="${2:-}"
33
+ shift 2
34
+ ;;
35
+ --data)
36
+ DATA_PATH="${2:-}"
37
+ shift 2
38
+ ;;
39
+ --no-hotspots)
40
+ SHOW_HOTSPOTS=0
41
+ shift
42
+ ;;
43
+ -h|--help)
44
+ print_usage
45
+ exit 0
46
+ ;;
47
+ *)
48
+ echo "Unknown option: $1" >&2
49
+ print_usage >&2
50
+ exit 1
51
+ ;;
52
+ esac
53
+ done
54
+
55
+ if ! [[ "$TOP_N" =~ ^[0-9]+$ ]] || [[ "$TOP_N" -le 0 ]]; then
56
+ echo "Invalid --top value: $TOP_N" >&2
57
+ exit 1
58
+ fi
59
+
60
+ if [[ -z "$HOME_PATH" ]]; then
61
+ echo "HOME is not set; use --home PATH" >&2
62
+ exit 1
63
+ fi
64
+
65
+ print_header() {
66
+ local title="$1"
67
+ printf "\n== %s ==\n" "$title"
68
+ }
69
+
70
+ run_df() {
71
+ print_header "Filesystem Pressure"
72
+ if ! df -h /; then
73
+ echo "Failed: df -h /" >&2
74
+ fi
75
+ }
76
+
77
+ run_du_top() {
78
+ local path="$1"
79
+ local label="$2"
80
+
81
+ print_header "$label"
82
+ if [[ ! -d "$path" ]]; then
83
+ echo "Skip (not found): $path"
84
+ return 0
85
+ fi
86
+
87
+ du -xhd 1 "$path" 2>/dev/null | sort -hr | head -n "$TOP_N"
88
+ }
89
+
90
+ run_hotspots() {
91
+ local -a hotspots=(
92
+ "$HOME_PATH/Downloads"
93
+ "$HOME_PATH/Desktop"
94
+ "$HOME_PATH/Movies"
95
+ "$HOME_PATH/Pictures"
96
+ "$HOME_PATH/Library/Application Support/MobileSync/Backup"
97
+ "$HOME_PATH/Library/Developer/Xcode"
98
+ "$HOME_PATH/Library/Developer/CoreSimulator"
99
+ "$HOME_PATH/Library/Developer/Xcode/DerivedData"
100
+ "$HOME_PATH/Library/Containers/com.docker.docker"
101
+ "$HOME_PATH/Library/Caches"
102
+ "$HOME_PATH/Library/Containers"
103
+ "/opt/homebrew/Cellar"
104
+ "/opt/homebrew/Caskroom"
105
+ "$HOME_PATH/Library/Caches/Homebrew"
106
+ "/private/var/vm"
107
+ )
108
+
109
+ print_header "Known Hotspots (depth=1)"
110
+ for p in "${hotspots[@]}"; do
111
+ if [[ -d "$p" ]]; then
112
+ echo "-- $p"
113
+ du -xhd 1 "$p" 2>/dev/null | sort -hr | head -n 8
114
+ fi
115
+ done
116
+
117
+ print_header "Time Machine Local Snapshots (diagnostic only)"
118
+ if command -v tmutil >/dev/null 2>&1; then
119
+ tmutil listlocalsnapshots / 2>/dev/null || true
120
+ else
121
+ echo "tmutil not found"
122
+ fi
123
+ }
124
+
125
+ echo "Disk usage locator (read-only). No cleanup actions are performed."
126
+ run_df
127
+ run_du_top "$DATA_PATH" "Top Directories: $DATA_PATH (depth=1)"
128
+ run_du_top "$HOME_PATH" "Top Directories: $HOME_PATH (depth=1)"
129
+
130
+ if [[ "$SHOW_HOTSPOTS" -eq 1 ]]; then
131
+ run_hotspots
132
+ fi
133
+
134
+ print_header "Done"
135
+ echo "Only location analysis completed. No files were deleted or modified."
@@ -1,6 +1,9 @@
1
1
  declare module "@botbotgo/agent" {
2
2
  export function createAgentDeepRuntime(...args: any[]): any;
3
3
  export function createAgentReactRuntime(...args: any[]): any;
4
+ }
5
+
6
+ declare module "@botbotgo/agent/recovery" {
4
7
  export function runWithTextToolCallRecovery(...args: any[]): Promise<any>;
5
8
  }
6
9
 
@@ -5,7 +5,7 @@ import {
5
5
  setDirectCommandTranslationPrompt,
6
6
  tryHandleDirectTargetPanelCommand,
7
7
  } from "../../dist/iterm/direct-command-router.js";
8
- import { runWithTextToolCallRecovery } from "@botbotgo/agent";
8
+ import { runWithTextToolCallRecovery } from "@botbotgo/agent/recovery";
9
9
 
10
10
  setDirectCommandTranslationPrompt([
11
11
  "You convert a user's single terminal request into exactly one safe shell command.",
@@ -9,7 +9,7 @@ import { resolveConfigPath } from "@botbotgo/common/config";
9
9
  import { createAgentModel } from "@botbotgo/model";
10
10
  import { createAgentTools } from "@botbotgo/toolkit";
11
11
  import { itermListCurrentWindowSessions } from "@botbotgo/toolkit-builtin/iterm";
12
- import { runWithTextToolCallRecovery } from "@botbotgo/agent";
12
+ import { runWithTextToolCallRecovery } from "@botbotgo/agent/recovery";
13
13
  import { runLlmHealthCheck } from "../../dist/startup/diagnostics.js";
14
14
  import { tryHandleDirectTargetPanelCommand } from "../../dist/iterm/direct-command-router.js";
15
15
 
@@ -1,7 +1,7 @@
1
1
  import test, { beforeEach } from "node:test";
2
2
  import assert from "node:assert/strict";
3
3
  import { AgentContextTokens } from "@botbotgo/common";
4
- import { runWithTextToolCallRecovery } from "@botbotgo/agent";
4
+ import { runWithTextToolCallRecovery } from "@botbotgo/agent/recovery";
5
5
 
6
6
  beforeEach(() => {
7
7
  delete process.env.ITB_BOOTSTRAP_EVIDENCE_COMMAND;
@@ -1,7 +1,7 @@
1
1
  import test, { beforeEach } from "node:test";
2
2
  import assert from "node:assert/strict";
3
3
  import { AgentContextTokens } from "@botbotgo/common";
4
- import { runWithTextToolCallRecovery } from "@botbotgo/agent";
4
+ import { runWithTextToolCallRecovery } from "@botbotgo/agent/recovery";
5
5
 
6
6
  beforeEach(() => {
7
7
  delete process.env.ITB_BOOTSTRAP_EVIDENCE_COMMAND;
@@ -1,7 +1,7 @@
1
1
  import test, { beforeEach } from "node:test";
2
2
  import assert from "node:assert/strict";
3
3
  import { AgentContextTokens } from "@botbotgo/common";
4
- import { runWithTextToolCallRecovery } from "@botbotgo/agent";
4
+ import { runWithTextToolCallRecovery } from "@botbotgo/agent/recovery";
5
5
 
6
6
  beforeEach(() => {
7
7
  delete process.env.ITB_BOOTSTRAP_EVIDENCE_COMMAND;