@stackmemoryai/stackmemory 0.5.49 → 0.5.52

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 (42) hide show
  1. package/README.md +17 -3
  2. package/dist/cli/claude-sm.js +246 -5
  3. package/dist/cli/claude-sm.js.map +3 -3
  4. package/dist/cli/commands/handoff.js +27 -12
  5. package/dist/cli/commands/handoff.js.map +2 -2
  6. package/dist/cli/commands/sweep.js +190 -421
  7. package/dist/cli/commands/sweep.js.map +3 -3
  8. package/dist/cli/index.js +10 -2
  9. package/dist/cli/index.js.map +2 -2
  10. package/dist/core/config/feature-flags.js +7 -1
  11. package/dist/core/config/feature-flags.js.map +2 -2
  12. package/dist/core/context/enhanced-rehydration.js +355 -9
  13. package/dist/core/context/enhanced-rehydration.js.map +3 -3
  14. package/dist/core/context/shared-context-layer.js +229 -0
  15. package/dist/core/context/shared-context-layer.js.map +2 -2
  16. package/dist/features/sweep/index.js +20 -0
  17. package/dist/features/sweep/index.js.map +7 -0
  18. package/dist/features/sweep/prediction-client.js +155 -0
  19. package/dist/features/sweep/prediction-client.js.map +7 -0
  20. package/dist/features/sweep/prompt-builder.js +85 -0
  21. package/dist/features/sweep/prompt-builder.js.map +7 -0
  22. package/dist/features/sweep/pty-wrapper.js +171 -0
  23. package/dist/features/sweep/pty-wrapper.js.map +7 -0
  24. package/dist/features/sweep/state-watcher.js +87 -0
  25. package/dist/features/sweep/state-watcher.js.map +7 -0
  26. package/dist/features/sweep/status-bar.js +88 -0
  27. package/dist/features/sweep/status-bar.js.map +7 -0
  28. package/dist/features/sweep/sweep-server-manager.js +226 -0
  29. package/dist/features/sweep/sweep-server-manager.js.map +7 -0
  30. package/dist/features/sweep/tab-interceptor.js +38 -0
  31. package/dist/features/sweep/tab-interceptor.js.map +7 -0
  32. package/dist/features/sweep/types.js +18 -0
  33. package/dist/features/sweep/types.js.map +7 -0
  34. package/dist/integrations/claude-code/lifecycle-hooks.js +3 -3
  35. package/dist/integrations/claude-code/lifecycle-hooks.js.map +1 -1
  36. package/package.json +1 -1
  37. package/scripts/auto-handoff.sh +1 -1
  38. package/scripts/claude-sm-autostart.js +174 -132
  39. package/scripts/setup-claude-integration.js +14 -10
  40. package/scripts/stackmemory-auto-handoff.sh +3 -3
  41. package/scripts/test-session-handoff.sh +2 -2
  42. package/scripts/test-setup-e2e.sh +154 -0
@@ -32,10 +32,10 @@ capture_handoff() {
32
32
  echo -e "${YELLOW}📸 Capturing handoff context...${NC}"
33
33
  log "Capturing handoff: reason=$reason, exit_code=$exit_code"
34
34
 
35
- # Run stackmemory handoff command
35
+ # Run stackmemory capture command
36
36
  if command -v "$STACKMEMORY_BIN" &> /dev/null; then
37
37
  # Capture the handoff
38
- "$STACKMEMORY_BIN" handoff --no-commit 2>&1 | tee -a "$LOG_FILE"
38
+ "$STACKMEMORY_BIN" capture --no-commit 2>&1 | tee -a "$LOG_FILE"
39
39
 
40
40
  # Save additional metadata
41
41
  local metadata_file="${HANDOFF_DIR}/last-handoff-meta.json"
@@ -75,7 +75,7 @@ EOF
75
75
  done
76
76
  fi
77
77
 
78
- echo -e "${GREEN}✨ Run 'stackmemory handoff restore' in your next session${NC}"
78
+ echo -e "${GREEN}✨ Run 'stackmemory restore' in your next session${NC}"
79
79
  else
80
80
  echo -e "${RED}❌ StackMemory not found${NC}"
81
81
  log "ERROR: StackMemory binary not found"
@@ -73,7 +73,7 @@ echo
73
73
 
74
74
  # 3. Generate handoff
75
75
  echo -e "${BLUE}3. Generating handoff summary...${NC}"
76
- stackmemory handoff > /tmp/handoff-test.md
76
+ stackmemory capture > /tmp/handoff-test.md
77
77
  echo -e "${GREEN}✓ Handoff generated${NC}"
78
78
  echo " Saved to: /tmp/handoff-test.md"
79
79
  echo
@@ -159,7 +159,7 @@ echo " • Last handoff: ./.stackmemory/last-handoff.md"
159
159
  echo " • Session data: ~/.stackmemory/sessions/"
160
160
  echo
161
161
  echo -e "${YELLOW}💡 To use in new Claude session:${NC}"
162
- echo " 1. Run: stackmemory handoff"
162
+ echo " 1. Run: stackmemory capture"
163
163
  echo " 2. Copy the handoff summary"
164
164
  echo " 3. Paste at start of new session"
165
165
  echo " 4. Context will be automatically loaded"
@@ -0,0 +1,154 @@
1
+ #!/usr/bin/env bash
2
+ # E2E test for claude-sm config setup
3
+ # Tests the interactive setup wizard flow
4
+
5
+ set -euo pipefail
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8
+ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
9
+ CONFIG_PATH="$HOME/.stackmemory/claude-sm.json"
10
+ BACKUP_PATH="$HOME/.stackmemory/claude-sm.json.bak"
11
+
12
+ # Colors
13
+ RED='\033[0;31m'
14
+ GREEN='\033[0;32m'
15
+ GRAY='\033[0;90m'
16
+ NC='\033[0m'
17
+
18
+ pass=0
19
+ fail=0
20
+
21
+ ok() { echo -e " ${GREEN}PASS${NC} $1"; pass=$((pass + 1)); }
22
+ ko() { echo -e " ${RED}FAIL${NC} $1"; fail=$((fail + 1)); }
23
+
24
+ echo "=== claude-sm config setup E2E tests ==="
25
+ echo ""
26
+
27
+ # Backup existing config
28
+ if [ -f "$CONFIG_PATH" ]; then
29
+ cp "$CONFIG_PATH" "$BACKUP_PATH"
30
+ echo -e "${GRAY}Backed up existing config${NC}"
31
+ fi
32
+
33
+ # 1. Test config show works
34
+ echo "--- Test: config show ---"
35
+ output=$(node "$PROJECT_DIR/dist/cli/claude-sm.js" config show 2>&1 || true)
36
+ if echo "$output" | grep -q "defaultSweep"; then
37
+ ok "config show displays defaultSweep"
38
+ else
39
+ ko "config show missing defaultSweep"
40
+ fi
41
+ if echo "$output" | grep -q "defaultGreptile"; then
42
+ ok "config show displays defaultGreptile"
43
+ else
44
+ ko "config show missing defaultGreptile"
45
+ fi
46
+
47
+ # 2. Test config set sweep
48
+ echo "--- Test: config set sweep ---"
49
+ node "$PROJECT_DIR/dist/cli/claude-sm.js" config set sweep false 2>&1
50
+ output=$(node "$PROJECT_DIR/dist/cli/claude-sm.js" config show 2>&1 || true)
51
+ if echo "$output" | grep -q "defaultSweep.*false\|defaultSweep"; then
52
+ ok "config set sweep false applied"
53
+ else
54
+ ko "config set sweep false not applied"
55
+ fi
56
+
57
+ node "$PROJECT_DIR/dist/cli/claude-sm.js" config set sweep true 2>&1
58
+ output=$(node "$PROJECT_DIR/dist/cli/claude-sm.js" config show 2>&1 || true)
59
+ if echo "$output" | grep -q "defaultSweep.*true\|defaultSweep"; then
60
+ ok "config set sweep true applied"
61
+ else
62
+ ko "config set sweep true not applied"
63
+ fi
64
+
65
+ # 3. Test config set greptile
66
+ echo "--- Test: config set greptile ---"
67
+ node "$PROJECT_DIR/dist/cli/claude-sm.js" config set greptile false 2>&1
68
+ output=$(node "$PROJECT_DIR/dist/cli/claude-sm.js" config show 2>&1 || true)
69
+ if echo "$output" | grep -q "defaultGreptile"; then
70
+ ok "config set greptile applied"
71
+ else
72
+ ko "config set greptile not applied"
73
+ fi
74
+
75
+ # 4. Test config greptile-on / greptile-off
76
+ echo "--- Test: greptile-on/off ---"
77
+ node "$PROJECT_DIR/dist/cli/claude-sm.js" config greptile-on 2>&1
78
+ if grep -q '"defaultGreptile":.*true' "$CONFIG_PATH"; then
79
+ ok "greptile-on sets true in config file"
80
+ else
81
+ ko "greptile-on did not set true"
82
+ fi
83
+
84
+ node "$PROJECT_DIR/dist/cli/claude-sm.js" config greptile-off 2>&1
85
+ if grep -q '"defaultGreptile":.*false' "$CONFIG_PATH"; then
86
+ ok "greptile-off sets false in config file"
87
+ else
88
+ ko "greptile-off did not set false"
89
+ fi
90
+
91
+ # 5. Test that setup command exists (non-interactive check)
92
+ echo "--- Test: setup command exists ---"
93
+ output=$(node "$PROJECT_DIR/dist/cli/claude-sm.js" config --help 2>&1 || true)
94
+ if echo "$output" | grep -q "setup"; then
95
+ ok "setup command listed in config help"
96
+ else
97
+ ko "setup command not in config help"
98
+ fi
99
+
100
+ # 6. Test node-pty dynamic import (should not crash if missing)
101
+ echo "--- Test: node-pty optional ---"
102
+ node -e "
103
+ import('node-pty')
104
+ .then(() => { console.log('node-pty: installed'); process.exit(0); })
105
+ .catch(() => { console.log('node-pty: not installed (OK)'); process.exit(0); });
106
+ " 2>&1
107
+ ok "node-pty check does not crash"
108
+
109
+ # 7. Verify node-pty is NOT in optionalDependencies
110
+ echo "--- Test: node-pty removed from optionalDeps ---"
111
+ if grep -q '"node-pty"' "$PROJECT_DIR/package.json"; then
112
+ ko "node-pty still in package.json"
113
+ else
114
+ ok "node-pty removed from package.json"
115
+ fi
116
+
117
+ # 8. Test feature flags include greptile
118
+ echo "--- Test: feature flags ---"
119
+ node -e "
120
+ import { getFeatureFlags } from '$PROJECT_DIR/dist/core/config/feature-flags.js';
121
+ const flags = getFeatureFlags();
122
+ if ('greptile' in flags) {
123
+ console.log('greptile flag exists: ' + flags.greptile);
124
+ process.exit(0);
125
+ } else {
126
+ console.error('greptile flag missing');
127
+ process.exit(1);
128
+ }
129
+ " 2>&1 && ok "greptile feature flag exists" || ko "greptile feature flag missing"
130
+
131
+ # 9. Verify build artifacts exist
132
+ echo "--- Test: build artifacts ---"
133
+ if [ -f "$PROJECT_DIR/dist/cli/claude-sm.js" ]; then
134
+ ok "dist/cli/claude-sm.js exists"
135
+ else
136
+ ko "dist/cli/claude-sm.js missing"
137
+ fi
138
+
139
+ if [ -f "$PROJECT_DIR/dist/features/sweep/pty-wrapper.js" ]; then
140
+ ok "dist/features/sweep/pty-wrapper.js exists"
141
+ else
142
+ ko "dist/features/sweep/pty-wrapper.js missing"
143
+ fi
144
+
145
+ # Restore config
146
+ if [ -f "$BACKUP_PATH" ]; then
147
+ mv "$BACKUP_PATH" "$CONFIG_PATH"
148
+ echo -e "${GRAY}Restored original config${NC}"
149
+ fi
150
+
151
+ # Summary
152
+ echo ""
153
+ echo "=== Results: ${GREEN}$pass passed${NC}, ${RED}$fail failed${NC} ==="
154
+ [ "$fail" -eq 0 ] && exit 0 || exit 1