fss-link 1.6.1 → 1.6.12

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 (43) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +63 -316
  3. package/bundle/fss-link.js +4038 -134262
  4. package/docs/CONFIGURATION.md +200 -0
  5. package/docs/README.md +192 -0
  6. package/docs/TOOLS.md +268 -0
  7. package/docs/assets/batch_0001_fss-link-terminal-interface.png +0 -0
  8. package/docs/assets/batch_0002_multiprovider-connection-hub-a.png +0 -0
  9. package/docs/assets/batch_0003_database-persistence-system-a.png +0 -0
  10. package/docs/assets/batch_0004_context-window-compression-a.png +0 -0
  11. package/docs/assets/batch_0005_file-operations-with-safety.png +0 -0
  12. package/docs/assets/batch_0006_semantic-search-rag-system.png +0 -0
  13. package/docs/assets/batch_0008_document-parsing-suite-a.png +0 -0
  14. package/docs/assets/batch_0009_web-research-tools-a.png +0 -0
  15. package/docs/assets/batch_0010_texttospeech-voice-output-a.png +0 -0
  16. package/docs/assets/batch_0011_shell-command-execution-a.png +0 -0
  17. package/docs/assets/batch_0012_mcp-extension-system-a.png +0 -0
  18. package/docs/assets/batch_0014_approval-mode-switches-a.png +0 -0
  19. package/docs/assets/batch_0015_folder-trust-system-a.png +0 -0
  20. package/package.json +53 -38
  21. package/scripts/check-publish.js +2 -1
  22. package/scripts/install-linux.sh +1 -2
  23. package/scripts/install-macos.sh +1 -2
  24. package/scripts/install-windows.ps1 +1 -2
  25. package/scripts/prebundle-sync-dist.js +51 -0
  26. package/README.pdf +0 -0
  27. package/scripts/analyze-session-logs.sh +0 -279
  28. package/scripts/emergency-kill-all-tests.sh +0 -95
  29. package/scripts/emergency-kill-vitest.sh +0 -95
  30. package/scripts/extract-session-logs.sh +0 -202
  31. package/scripts/get-previous-tag.js +0 -213
  32. package/scripts/get-release-version.js +0 -119
  33. package/scripts/index-session-logs.sh +0 -173
  34. package/scripts/local_telemetry.js +0 -219
  35. package/scripts/memory-monitor.sh +0 -165
  36. package/scripts/process-session-log.py +0 -302
  37. package/scripts/quick-install.sh +0 -195
  38. package/scripts/telemetry_gcp.js +0 -188
  39. package/scripts/telemetry_utils.js +0 -421
  40. package/scripts/test-windows-paths.js +0 -51
  41. package/scripts/tests/get-release-version.test.js +0 -110
  42. package/scripts/tests/test-setup.ts +0 -12
  43. package/scripts/tests/vitest.config.ts +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fss-link",
3
- "version": "1.6.1",
3
+ "version": "1.6.12",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },
@@ -13,7 +13,7 @@
13
13
  "url": "git+https://github.com/FSSCoding/fss-link.git"
14
14
  },
15
15
  "config": {
16
- "sandboxImageUri": "ghcr.io/fsscoding/fss-link:0.0.10"
16
+ "sandboxImageUri": "ghcr.io/fsscoding/fss-link:1.6.12"
17
17
  },
18
18
  "scripts": {
19
19
  "start": "node scripts/start.js",
@@ -28,7 +28,7 @@
28
28
  "build:all": "npm run build && npm run build:sandbox && npm run build:vscode",
29
29
  "build:packages": "npm run build --workspaces",
30
30
  "build:sandbox": "node scripts/build_sandbox.js --skip-npm-install-build",
31
- "bundle": "npm run generate && node esbuild.config.js && node scripts/copy_bundle_assets.js",
31
+ "bundle": "npm run generate && node scripts/prebundle-sync-dist.js && node esbuild.config.js && node scripts/copy_bundle_assets.js",
32
32
  "prepublishOnly": "node scripts/check-publish.js",
33
33
  "test": "npm run test --workspaces --if-present",
34
34
  "test:ci": "npm run test:ci --workspaces --if-present && npm run test:scripts",
@@ -56,7 +56,28 @@
56
56
  },
57
57
  "files": [
58
58
  "bundle/",
59
- "scripts/",
59
+ "docs/",
60
+ "scripts/build_package.js",
61
+ "scripts/build_sandbox.js",
62
+ "scripts/build_vscode_companion.js",
63
+ "scripts/build.js",
64
+ "scripts/check-build-status.js",
65
+ "scripts/check-publish.js",
66
+ "scripts/clean.js",
67
+ "scripts/copy_bundle_assets.js",
68
+ "scripts/copy_files.js",
69
+ "scripts/create_alias.sh",
70
+ "scripts/generate-git-commit-info.js",
71
+ "scripts/install-linux.sh",
72
+ "scripts/install-macos.sh",
73
+ "scripts/install-windows.ps1",
74
+ "scripts/postinstall-message.js",
75
+ "scripts/prebundle-sync-dist.js",
76
+ "scripts/prepare-package.js",
77
+ "scripts/sandbox_command.js",
78
+ "scripts/start.js",
79
+ "scripts/telemetry.js",
80
+ "scripts/version.js",
60
81
  "README.md",
61
82
  "LICENSE"
62
83
  ],
@@ -70,8 +91,12 @@
70
91
  "@types/qrcode-terminal": "^0.12.2",
71
92
  "@types/shell-quote": "^1.7.5",
72
93
  "@types/sql.js": "^1.4.9",
94
+ "@types/turndown": "^5.0.5",
95
+ "@types/jsdom": "^21.1.7",
96
+ "@types/mozilla__readability": "^0.4.2",
97
+ "@types/update-notifier": "^6.0.8",
73
98
  "@types/uuid": "^10.0.0",
74
- "@vitest/coverage-v8": "^3.1.1",
99
+ "@vitest/coverage-v8": "^4.0.0",
75
100
  "concurrently": "^9.2.0",
76
101
  "cross-env": "^7.0.3",
77
102
  "esbuild": "^0.25.0",
@@ -81,7 +106,6 @@
81
106
  "eslint-plugin-license-header": "^0.8.0",
82
107
  "eslint-plugin-react": "^7.37.5",
83
108
  "eslint-plugin-react-hooks": "^5.2.0",
84
- "glob": "^10.4.5",
85
109
  "globals": "^16.0.0",
86
110
  "json": "^11.0.0",
87
111
  "lodash": "^4.17.21",
@@ -90,44 +114,25 @@
90
114
  "mock-fs": "^5.5.0",
91
115
  "msw": "^2.10.4",
92
116
  "prettier": "^3.5.3",
93
- "react-devtools-core": "^4.28.5",
117
+ "react-devtools-core": "^7.0.1",
94
118
  "tsx": "^4.20.3",
95
119
  "typescript-eslint": "^8.30.1",
96
- "vitest": "^3.2.4"
120
+ "vitest": "^4.0.0"
97
121
  },
98
122
  "dependencies": {
99
- "@google/genai": "1.9.0",
123
+ "@google/genai": "1.13.0",
100
124
  "@iarna/toml": "^2.2.5",
101
125
  "@modelcontextprotocol/sdk": "^1.15.1",
102
126
  "@mozilla/readability": "^0.6.0",
103
- "@opentelemetry/api": "^1.9.0",
104
- "@opentelemetry/api-logs": "^0.206.0",
105
- "@opentelemetry/core": "^2.1.0",
106
- "@opentelemetry/exporter-logs-otlp-grpc": "^0.206.0",
107
- "@opentelemetry/exporter-logs-otlp-http": "^0.206.0",
108
- "@opentelemetry/exporter-metrics-otlp-grpc": "^0.206.0",
109
- "@opentelemetry/exporter-metrics-otlp-http": "^0.206.0",
110
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.206.0",
111
- "@opentelemetry/exporter-trace-otlp-http": "^0.206.0",
112
- "@opentelemetry/instrumentation-http": "^0.206.0",
113
- "@opentelemetry/otlp-exporter-base": "^0.206.0",
114
- "@opentelemetry/resources": "^2.1.0",
115
- "@opentelemetry/sdk-logs": "^0.206.0",
116
- "@opentelemetry/sdk-metrics": "^2.1.0",
117
- "@opentelemetry/sdk-node": "^0.206.0",
118
- "@opentelemetry/sdk-trace-node": "^2.1.0",
119
- "@opentelemetry/semantic-conventions": "^1.37.0",
120
- "@types/jsdom": "^21.1.7",
121
- "@types/mozilla__readability": "^0.4.2",
122
- "@types/update-notifier": "^6.0.8",
123
127
  "axios": "^1.11.0",
124
128
  "chalk": "^5.3.0",
125
129
  "cheerio": "^1.1.2",
126
130
  "command-exists": "^1.2.9",
127
- "diff": "^7.0.0",
131
+ "diff": "^9.0.0",
128
132
  "dotenv": "^17.1.0",
133
+ "exceljs": "^4.4.0",
129
134
  "fs-extra": "^11.3.1",
130
- "glob": "^10.4.1",
135
+ "glob": "^13.0.6",
131
136
  "highlight.js": "^11.11.1",
132
137
  "ink": "^6.1.1",
133
138
  "ink-big-text": "^2.0.0",
@@ -139,16 +144,16 @@
139
144
  "jsdom": "^27.0.0",
140
145
  "lowlight": "^3.3.0",
141
146
  "mime-types": "^3.0.1",
142
- "node-fetch": "^3.3.2",
143
147
  "open": "^10.1.2",
144
148
  "p-limit": "^7.1.1",
149
+ "pdf-to-img": "^6.0.0",
145
150
  "proper-lockfile": "^4.1.2",
146
151
  "qrcode-terminal": "^0.12.0",
147
- "react": "19.1.1",
148
- "react-dom": "19.1.1",
152
+ "react": "^19.2.0",
153
+ "react-dom": "^19.2.0",
149
154
  "read-package-up": "^11.0.0",
150
- "shell-quote": "^1.8.3",
151
155
  "sharp": "^0.34.4",
156
+ "shell-quote": "^1.8.3",
152
157
  "signal-exit": "^4.1.0",
153
158
  "simple-git": "^3.28.0",
154
159
  "sql.js": "^1.11.0",
@@ -156,13 +161,23 @@
156
161
  "strip-ansi": "^7.1.0",
157
162
  "strip-json-comments": "^3.1.1",
158
163
  "tiktoken": "^1.0.20",
164
+ "turndown": "^7.2.0",
165
+ "turndown-plugin-gfm": "^1.0.2",
159
166
  "undici": "^7.10.0",
160
- "update-notifier": "^7.3.1",
161
- "xlsx": "^0.18.5",
162
167
  "xml2js": "^0.6.0",
163
168
  "yargs": "^17.7.2",
164
169
  "yauzl": "^3.0.0",
165
- "zod": "^3.23.8"
170
+ "zod": "^4.0.0"
171
+ },
172
+ "overrides": {
173
+ "archiver": "^8.0.0",
174
+ "unzipper": "^0.12.3",
175
+ "fast-csv": "^5.0.7",
176
+ "encoding-sniffer": "^1.0.2",
177
+ "gaxios": "^7.1.4",
178
+ "exceljs": {
179
+ "uuid": "^9.0.1"
180
+ }
166
181
  },
167
182
  "optionalDependencies": {
168
183
  "@lydell/node-pty": "1.1.0",
@@ -79,7 +79,8 @@ if (fs.existsSync(bundlePath)) {
79
79
  `version = "${pkg.version}"`,
80
80
  `'version':'${pkg.version}'`,
81
81
  ];
82
- const hasVersion = versionPatterns.some(pattern => bundleContent.includes(pattern));
82
+ const hasVersion = versionPatterns.some(pattern => bundleContent.includes(pattern))
83
+ || bundleContent.includes(pkg.version);
83
84
 
84
85
  if (!hasVersion) {
85
86
  console.error(`❌ ERROR: Bundle version mismatch`);
@@ -216,8 +216,7 @@ print_usage() {
216
216
  fss-link models setup # Set up model profiles
217
217
 
218
218
  📚 Documentation:
219
- https://github.com/FSSCoding/fss-link/blob/main/INSTALLATION.md
220
- https://github.com/FSSCoding/fss-link/blob/main/fss-docs/README.md
219
+ https://github.com/FSSCoding/fss-link/blob/main/docs/README.md
221
220
 
222
221
  🎯 Example Usage:
223
222
  fss-link -p "analyze this project"
@@ -253,8 +253,7 @@ print_usage() {
253
253
  fss-link models setup # Set up model profiles
254
254
 
255
255
  📚 Documentation:
256
- https://github.com/FSSCoding/fss-link/blob/main/INSTALLATION.md
257
- https://github.com/FSSCoding/fss-link/blob/main/fss-docs/README.md
256
+ https://github.com/FSSCoding/fss-link/blob/main/docs/README.md
258
257
 
259
258
  🎯 Example Usage:
260
259
  fss-link -p "analyze this project"
@@ -315,8 +315,7 @@ function Show-Usage {
315
315
  fss-link models setup # Set up model profiles
316
316
 
317
317
  📚 Documentation:
318
- https://github.com/FSSCoding/fss-link/blob/main/INSTALLATION.md
319
- https://github.com/FSSCoding/fss-link/blob/main/fss-docs/README.md
318
+ https://github.com/FSSCoding/fss-link/blob/main/docs/README.md
320
319
 
321
320
  🎯 Example Usage:
322
321
  fss-link -p "analyze this project"
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Pre-bundle dist sync — ensures dist/ directories contain current TypeScript
3
+ * source compiled to JS before esbuild runs.
4
+ *
5
+ * esbuild resolves fss-link-core via package.json "main": "dist/index.js",
6
+ * so dist/ must match the current .ts source. Without this step, any prior
7
+ * `tsc` run can leave stale .js in dist/ that silently poisons the bundle.
8
+ *
9
+ * Uses `tsc --noCheck` to emit without type-checking (fast, ignores
10
+ * pre-existing type errors in parsers/tests that don't affect runtime).
11
+ *
12
+ * Also builds the browser-target web client package (separate esbuild
13
+ * pipeline from the Node CLI bundler), so the link instance's embedded
14
+ * HTTP server serves fresh assets at runtime.
15
+ */
16
+
17
+ import { execSync } from 'child_process';
18
+ import { dirname, resolve } from 'path';
19
+ import { fileURLToPath } from 'url';
20
+
21
+ const __dirname = dirname(fileURLToPath(import.meta.url));
22
+ const root = resolve(__dirname, '..');
23
+
24
+ const packages = ['packages/core', 'packages/cli'];
25
+
26
+ for (const pkg of packages) {
27
+ const tsconfig = resolve(root, pkg, 'tsconfig.json');
28
+ try {
29
+ execSync(`npx tsc --noCheck -p ${tsconfig}`, {
30
+ cwd: root,
31
+ stdio: 'pipe',
32
+ timeout: 30000,
33
+ });
34
+ } catch (err) {
35
+ console.error(`Warning: dist sync failed for ${pkg}:`, err.message);
36
+ // Non-fatal — bundle will use whatever dist/ has
37
+ }
38
+ }
39
+
40
+ // Build the browser web-client — its own esbuild config, emits dist/bundle.js
41
+ // and dist/index.html which the link instance's wsServer serves at the root.
42
+ try {
43
+ execSync('npm run build --workspace=@fsscoding/fss-link-web-client', {
44
+ cwd: root,
45
+ stdio: 'pipe',
46
+ timeout: 60000,
47
+ });
48
+ } catch (err) {
49
+ console.error('Warning: web-client build failed:', err.message);
50
+ // Non-fatal — wsServer falls back to fss-prototypes/web-client if dist is missing
51
+ }
package/README.pdf DELETED
Binary file
@@ -1,279 +0,0 @@
1
- #!/bin/bash
2
- # FSS Link Session Log Analyzer
3
- # Quick analysis and searching of processed session logs
4
-
5
- set -euo pipefail
6
-
7
- # Configuration
8
- PROCESSED_DIR="/MASTERFOLDER/Projects/fss-link/fss-live-testing/session-logs/processed"
9
- ANALYSIS_DIR="/MASTERFOLDER/Projects/fss-link/fss-live-testing/session-logs/analysis"
10
-
11
- # Colors
12
- RED='\033[0;31m'
13
- GREEN='\033[0;32m'
14
- YELLOW='\033[1;33m'
15
- BLUE='\033[0;34m'
16
- NC='\033[0m'
17
-
18
- usage() {
19
- cat << EOF
20
- Usage: $0 [COMMAND] [OPTIONS]
21
-
22
- Analyze FSS Link session logs for testing validation.
23
-
24
- COMMANDS:
25
- stats Show statistics for all sessions
26
- search TERM Search for specific term in sessions
27
- tools TOOL Find sessions using specific tool
28
- errors Find sessions with errors
29
- summary FILE Generate summary report for session
30
-
31
- OPTIONS:
32
- -h, --help Show this help message
33
-
34
- EXAMPLES:
35
- $0 stats # Show all session statistics
36
- $0 search "read_file" # Find sessions mentioning read_file
37
- $0 tools TodoWrite # Find sessions using TodoWrite
38
- $0 errors # Find sessions with errors
39
- $0 summary SESSION_*.md # Summarize specific session
40
-
41
- EOF
42
- exit 1
43
- }
44
-
45
- # Show statistics for all processed sessions
46
- show_stats() {
47
- echo -e "${BLUE}=== Session Log Statistics ===${NC}\n"
48
-
49
- if [[ ! -d "${PROCESSED_DIR}" ]] || [[ -z "$(ls -A ${PROCESSED_DIR} 2>/dev/null)" ]]; then
50
- echo -e "${RED}No processed sessions found in ${PROCESSED_DIR}${NC}"
51
- exit 1
52
- fi
53
-
54
- local total_sessions=0
55
- local total_messages=0
56
- local total_tool_calls=0
57
- local total_errors=0
58
-
59
- for session in "${PROCESSED_DIR}"/*.md; do
60
- if [[ ! -f "${session}" ]]; then
61
- continue
62
- fi
63
-
64
- ((total_sessions++))
65
-
66
- # Extract metadata from session file
67
- messages=$(grep "^\*\*Total Messages\*\*:" "${session}" | sed 's/.*: //')
68
- tool_calls=$(grep "^\*\*Tool Calls\*\*:" "${session}" | sed 's/.*: //' || echo "0")
69
- errors=$(grep "^\*\*Errors\*\*:" "${session}" | sed 's/.*: //' || echo "0")
70
-
71
- # Extract from metadata section if not in header
72
- if [[ -z "${messages}" ]]; then
73
- messages=$(grep '"total_messages":' "${session}" | sed 's/.*: //' | tr -d ',' || echo "0")
74
- fi
75
- if [[ -z "${tool_calls}" ]] || [[ "${tool_calls}" == "0" ]]; then
76
- tool_calls=$(grep '"total_tool_calls":' "${session}" | sed 's/.*: //' | tr -d ',' || echo "0")
77
- fi
78
- if [[ -z "${errors}" ]] || [[ "${errors}" == "0" ]]; then
79
- errors=$(grep '"total_errors":' "${session}" | sed 's/.*: //' | tr -d ',' || echo "0")
80
- fi
81
-
82
- total_messages=$((total_messages + messages))
83
- total_tool_calls=$((total_tool_calls + tool_calls))
84
- total_errors=$((total_errors + errors))
85
-
86
- session_name=$(basename "${session}")
87
- echo -e "${GREEN}${session_name}${NC}"
88
- echo " Messages: ${messages}"
89
- echo " Tool calls: ${tool_calls}"
90
- echo " Errors: ${errors}"
91
- echo ""
92
- done
93
-
94
- echo -e "${YELLOW}=== Totals ===${NC}"
95
- echo "Sessions analyzed: ${total_sessions}"
96
- echo "Total messages: ${total_messages}"
97
- echo "Total tool calls: ${total_tool_calls}"
98
- echo "Total errors: ${total_errors}"
99
- }
100
-
101
- # Search for term in sessions
102
- search_term() {
103
- local term="$1"
104
- echo -e "${BLUE}=== Searching for: '${term}' ===${NC}\n"
105
-
106
- for session in "${PROCESSED_DIR}"/*.md; do
107
- if [[ ! -f "${session}" ]]; then
108
- continue
109
- fi
110
-
111
- if grep -qi "${term}" "${session}"; then
112
- session_name=$(basename "${session}")
113
- count=$(grep -ci "${term}" "${session}")
114
- echo -e "${GREEN}${session_name}${NC} - ${count} matches"
115
-
116
- # Show first few matches with context
117
- grep -ni "${term}" "${session}" | head -3 | while read -r line; do
118
- echo " ${line}"
119
- done
120
- echo ""
121
- fi
122
- done
123
- }
124
-
125
- # Find sessions using specific tool
126
- find_tool_usage() {
127
- local tool="$1"
128
- echo -e "${BLUE}=== Sessions using tool: '${tool}' ===${NC}\n"
129
-
130
- for session in "${PROCESSED_DIR}"/*.md; do
131
- if [[ ! -f "${session}" ]]; then
132
- continue
133
- fi
134
-
135
- # Check in tools_used metadata or tool call sections
136
- if grep -qi "\"${tool}\"" "${session}" || grep -qi "\[FUNCTION CALL: ${tool}\]" "${session}"; then
137
- session_name=$(basename "${session}")
138
- call_count=$(grep -ci "\[FUNCTION CALL: ${tool}\]" "${session}" || echo "0")
139
-
140
- echo -e "${GREEN}${session_name}${NC}"
141
- echo " Tool calls: ${call_count}"
142
-
143
- # Extract tool calls section summary if exists
144
- if grep -qi "### ${tool}" "${session}"; then
145
- summary=$(grep -A 1 "### ${tool}" "${session}" | tail -1)
146
- echo " ${summary}"
147
- fi
148
- echo ""
149
- fi
150
- done
151
- }
152
-
153
- # Find sessions with errors
154
- find_errors() {
155
- echo -e "${BLUE}=== Sessions with Errors ===${NC}\n"
156
-
157
- local found=0
158
-
159
- for session in "${PROCESSED_DIR}"/*.md; do
160
- if [[ ! -f "${session}" ]]; then
161
- continue
162
- fi
163
-
164
- errors=$(grep '"total_errors":' "${session}" | sed 's/.*: //' | tr -d ',' || echo "0")
165
-
166
- if [[ "${errors}" != "0" ]] && [[ -n "${errors}" ]]; then
167
- ((found++))
168
- session_name=$(basename "${session}")
169
- echo -e "${RED}${session_name}${NC} - ${errors} errors"
170
-
171
- # Show error section if exists
172
- if grep -q "## Errors and Issues" "${session}"; then
173
- grep -A 5 "## Errors and Issues" "${session}" | tail -4
174
- fi
175
- echo ""
176
- fi
177
- done
178
-
179
- if [[ ${found} -eq 0 ]]; then
180
- echo -e "${GREEN}No errors found in any session!${NC}"
181
- fi
182
- }
183
-
184
- # Generate summary for specific session
185
- generate_summary() {
186
- local session_file="$1"
187
-
188
- if [[ ! -f "${session_file}" ]]; then
189
- echo -e "${RED}Session file not found: ${session_file}${NC}"
190
- exit 1
191
- fi
192
-
193
- session_name=$(basename "${session_file}")
194
- echo -e "${BLUE}=== Summary: ${session_name} ===${NC}\n"
195
-
196
- # Extract key metadata
197
- messages=$(grep '"total_messages":' "${session_file}" | sed 's/.*: //' | tr -d ',')
198
- tool_calls=$(grep '"total_tool_calls":' "${session_file}" | sed 's/.*: //' | tr -d ',')
199
- errors=$(grep '"total_errors":' "${session_file}" | sed 's/.*: //' | tr -d ',')
200
- session_date=$(grep '"session_date":' "${session_file}" | sed 's/.*: "//' | tr -d '",')
201
-
202
- echo -e "${YELLOW}Basic Info:${NC}"
203
- echo " Date: ${session_date}"
204
- echo " Messages: ${messages}"
205
- echo " Tool calls: ${tool_calls}"
206
- echo " Errors: ${errors}"
207
- echo ""
208
-
209
- # Extract tools used
210
- echo -e "${YELLOW}Tools Used:${NC}"
211
- grep '"tools_used":' -A 12 "${session_file}" | grep '"' | sed 's/.*"//;s/".*//' | sed 's/^/ - /'
212
- echo ""
213
-
214
- # Show tool call breakdown
215
- echo -e "${YELLOW}Tool Call Breakdown:${NC}"
216
- grep -E "^### .* \([0-9]+ calls\)" "${session_file}" | sed 's/^###/ -/'
217
- echo ""
218
-
219
- # Check for key events
220
- echo -e "${YELLOW}Key Events:${NC}"
221
- if grep -q "NO NO NO" "${session_file}"; then
222
- echo " ⚠️ User correction detected"
223
- fi
224
- if grep -qi "TodoWrite" "${session_file}"; then
225
- todo_count=$(grep -ci "todo_write" "${session_file}")
226
- echo " ✓ TodoWrite used: ${todo_count} times"
227
- fi
228
- if grep -qi "Production Ready" "${session_file}"; then
229
- echo " ✓ Testing completed - marked as Production Ready"
230
- fi
231
- }
232
-
233
- # Main execution
234
- main() {
235
- if [[ $# -eq 0 ]]; then
236
- usage
237
- fi
238
-
239
- mkdir -p "${ANALYSIS_DIR}"
240
-
241
- case "$1" in
242
- stats)
243
- show_stats
244
- ;;
245
- search)
246
- if [[ $# -lt 2 ]]; then
247
- echo -e "${RED}Error: search requires a term${NC}"
248
- usage
249
- fi
250
- search_term "$2"
251
- ;;
252
- tools)
253
- if [[ $# -lt 2 ]]; then
254
- echo -e "${RED}Error: tools requires a tool name${NC}"
255
- usage
256
- fi
257
- find_tool_usage "$2"
258
- ;;
259
- errors)
260
- find_errors
261
- ;;
262
- summary)
263
- if [[ $# -lt 2 ]]; then
264
- echo -e "${RED}Error: summary requires a session file${NC}"
265
- usage
266
- fi
267
- generate_summary "$2"
268
- ;;
269
- -h|--help)
270
- usage
271
- ;;
272
- *)
273
- echo -e "${RED}Unknown command: $1${NC}"
274
- usage
275
- ;;
276
- esac
277
- }
278
-
279
- main "$@"
@@ -1,95 +0,0 @@
1
- #!/bin/bash
2
-
3
- # 🚨 NUCLEAR OPTION: Kill ALL test-related processes
4
- # Purpose: Emergency system recovery when tests cripple the PC
5
- # Usage: ./scripts/emergency-kill-all-tests.sh
6
-
7
- set -e
8
-
9
- RED='\033[0;31m'
10
- YELLOW='\033[1;33m'
11
- GREEN='\033[0;32m'
12
- NC='\033[0m'
13
-
14
- echo -e "${RED}💣 NUCLEAR TEST KILLER - EMERGENCY SYSTEM RECOVERY${NC}"
15
- echo -e "${YELLOW}⚠️ This will kill ALL Node.js test processes immediately${NC}"
16
- echo ""
17
-
18
- # Find all test-related processes
19
- echo "Scanning for dangerous processes..."
20
-
21
- # More comprehensive process detection
22
- VITEST_PIDS=$(pgrep -f "vitest" 2>/dev/null || true)
23
- NODE_TEST_PIDS=$(pgrep -f "node.*test" 2>/dev/null || true)
24
- JEST_PIDS=$(pgrep -f "jest" 2>/dev/null || true)
25
- MOCHA_PIDS=$(pgrep -f "mocha" 2>/dev/null || true)
26
- NODE_FSS_PIDS=$(pgrep -f "node.*fss-link" 2>/dev/null || true)
27
-
28
- ALL_PIDS="${VITEST_PIDS} ${NODE_TEST_PIDS} ${JEST_PIDS} ${MOCHA_PIDS} ${NODE_FSS_PIDS}"
29
-
30
- if [ -z "$(echo $ALL_PIDS | tr -d ' ')" ]; then
31
- echo -e "${GREEN}✅ No test processes found${NC}"
32
- exit 0
33
- fi
34
-
35
- echo -e "${RED}🎯 TARGETS IDENTIFIED:${NC}"
36
- echo "$ALL_PIDS" | tr ' ' '\n' | while read -r pid; do
37
- if [ -n "$pid" ] && [ "$pid" != " " ]; then
38
- ps -p "$pid" -o pid,%cpu,%mem,cmd 2>/dev/null || true
39
- fi
40
- done
41
-
42
- echo ""
43
- echo -e "${YELLOW}⚡ IMMEDIATE FORCE KILL - NO MERCY${NC}"
44
- echo "Killing all processes with SIGKILL..."
45
-
46
- # Nuclear option - kill everything immediately
47
- for pid in $ALL_PIDS; do
48
- if [ -n "$pid" ] && [ "$pid" != " " ]; then
49
- kill -KILL "$pid" 2>/dev/null && echo "💀 KILLED PID $pid" || true
50
- fi
51
- done
52
-
53
- # Also kill any node processes using excessive memory (>1GB)
54
- echo ""
55
- echo -e "${YELLOW}🔍 Checking for memory hogs (>1GB)...${NC}"
56
- ps aux --no-headers | awk '$6 > 1000000 && /node/ {print $2, $6/1024 "MB", $11}' | while read -r line; do
57
- if [ -n "$line" ]; then
58
- pid=$(echo "$line" | awk '{print $1}')
59
- echo -e "${RED}Found memory hog: $line${NC}"
60
- kill -KILL "$pid" 2>/dev/null && echo "💀 KILLED memory hog PID $pid" || true
61
- fi
62
- done
63
-
64
- sleep 2
65
-
66
- # Final verification
67
- echo ""
68
- echo -e "${GREEN}🔍 Final system check...${NC}"
69
- SURVIVORS=$(pgrep -f "vitest\|jest\|mocha\|node.*test" 2>/dev/null || true)
70
- if [ -n "$SURVIVORS" ]; then
71
- echo -e "${RED}❌ SURVIVORS DETECTED:${NC}"
72
- ps -p $SURVIVORS -o pid,%cpu,%mem,cmd 2>/dev/null || true
73
- echo ""
74
- echo -e "${YELLOW}Manual intervention required:${NC}"
75
- echo "sudo kill -9 $SURVIVORS"
76
- else
77
- echo -e "${GREEN}🎉 MISSION ACCOMPLISHED - All test processes eliminated${NC}"
78
- fi
79
-
80
- # System recovery commands
81
- echo ""
82
- echo -e "${GREEN}🚑 SYSTEM RECOVERY PROTOCOL:${NC}"
83
- echo "1. Clear memory caches:"
84
- echo " sync && echo 3 | sudo tee /proc/sys/vm/drop_caches"
85
- echo ""
86
- echo "2. Check available memory:"
87
- echo " free -h"
88
- echo ""
89
- echo "3. Check system load:"
90
- echo " uptime"
91
- echo ""
92
- echo "4. Monitor for zombies:"
93
- echo " ps aux | grep defunct"
94
- echo ""
95
- echo -e "${YELLOW}System should be responsive now. Monitor for 30 seconds before resuming work.${NC}"