@xelth/eck-snapshot 5.8.6 → 6.0.0

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 CHANGED
@@ -1,190 +1,71 @@
1
- # eck-snapshot
1
+ # 📸 eckSnapshot v6.0
2
2
 
3
- A CLI tool that packs your entire Git repository into a single text file optimized for LLMs. Give any AI full project context in one copy-paste.
3
+ A specialized, AI-native CLI tool designed to create and restore single-file text snapshots of Git repositories. Optimized for providing full project context to Large Language Models (LLMs) and serving as the coordination hub for Multi-Agent AI Architectures.
4
4
 
5
- ```bash
6
- npm install -g @xelth/eck-snapshot
7
- ```
8
-
9
- ## Recommended AI Setup
10
-
11
- For best results, we recommend splitting roles between models:
5
+ ## 🌟 Key Features
12
6
 
13
- - **Architect** (large context window): Gemini, Grok Fast, ChatGPT upload the full snapshot, design the architecture, plan tasks
14
- - **Coder** (execution): Claude (via Claude Code), GLM (via OpenCode) receive tasks from the architect, write and fix code
7
+ * **🧠 Multi-Agent Protocol (Royal Court):** Built-in support for the "Royal Court" architecture. Delegate tasks from a Senior Architect (Claude/Gemini) to Junior Managers, who orchestrate a swarm of specialized GLM-4.7 workers.
8
+ * **☠️ Skeleton Mode:** Uses `Tree-sitter` and `Babel` to strip function bodies, drastically reducing token count while preserving structural context. Supports JS/TS, Rust, Go, Python, C, Java, and Kotlin.
9
+ * **🔄 Smart Delta Updates:** Tracks incremental changes via Git anchors with sequential numbering. Now accurately tracks and reports deleted files to prevent LLM hallucinations.
10
+ * **🛡️ Security (SecretScanner):** Automatically redacts API keys and credentials before sending context to LLMs. Features both Regex matching and **Shannon Entropy** analysis for catching non-standard hardcoded secrets.
11
+ * **📊 Telemetry Hub:** Integrated with a Rust-based microservice (`eck-telemetry`) for tracking agent execution metrics, auto-syncing token estimation weights via linear regression, and in-memory caching.
12
+ * **🔌 Native MCP Integration:** Instantly spins up Model Context Protocol (MCP) servers (`eck-core` for context sync and `glm-zai` for worker swarms) for Claude Code and OpenCode.
15
13
 
16
- eck-snapshot generates tailored instructions (`CLAUDE.md`, `AGENTS.md`) for each role automatically.
17
-
18
- ## Core Workflow
19
-
20
- ### 1. Full Snapshot
21
-
22
- Run `eck-snapshot` in your project root. It scans every tracked file, filters out noise (lock files, build artifacts, secrets), and produces a single `.md` file ready for an AI chat.
14
+ ## 🚀 Quick Start
23
15
 
16
+ ### Installation
24
17
  ```bash
25
- eck-snapshot
26
- # -> .eck/snapshots/eckMyProject_26-02-15_12-00_abc1234.md
27
- ```
28
-
29
- Upload the file to your architect AI and start working.
30
-
31
- ### 2. Incremental Update
32
-
33
- After you make changes, don't re-send the entire project. Send only what changed since the last full snapshot:
34
-
35
- ```bash
36
- eck-snapshot update
37
- # -> .eck/snapshots/eckMyProject_26-02-15_14-30_abc1234_up1_42kb.md
38
- ```
39
-
40
- This uses a Git anchor (saved automatically during full snapshot) to detect all modified files and includes their full content. No redundant diffs, no wasted tokens.
41
-
42
- Notice the `_42kb` suffix in the filename — this is the **Anti-Truncation Guard** (see below).
43
-
44
- ## Context Profiles
45
-
46
- Large repositories waste tokens on irrelevant code. Profiles let you partition the codebase so the AI only sees what matters.
47
-
48
- ### Auto-Detection
49
-
50
- Let AI scan your directory tree and generate profiles automatically:
51
-
52
- ```bash
53
- eck-snapshot profile-detect
54
- # -> Saves profiles to .eck/profiles.json
55
- ```
56
-
57
- ### Manual Guide
58
-
59
- For very large repos where auto-detection is too slow, generate a prompt guide, paste it into a powerful Web LLM (Gemini, ChatGPT), and save the resulting JSON:
60
-
61
- ```bash
62
- eck-snapshot generate-profile-guide
63
- # -> .eck/profile_generation_guide.md (paste into AI, get profiles back)
64
- ```
65
-
66
- ### Using Profiles
67
-
68
- ```bash
69
- eck-snapshot --profile # List all available profiles
70
- eck-snapshot --profile backend # Use a named profile
71
- eck-snapshot --profile backend --skeleton # Profile + skeleton mode
72
- eck-snapshot --profile "src/**/*.rs,-**/test_*" # Ad-hoc glob filtering
73
- ```
74
-
75
- Profiles work with both full snapshots and incremental updates.
76
-
77
- ## Anti-Truncation Guard
78
-
79
- Web AI interfaces (Gemini, ChatGPT) sometimes silently drop the content of large uploaded files, replacing them with a small JSON metadata stub like `{"fileName": "...", "contentFetchId": "..."}`. The AI then hallucinates code it never actually received.
80
-
81
- eck-snapshot counters this with two mechanisms:
82
-
83
- **1. Size-stamped filenames.** Every snapshot — full and incremental — embeds its exact size in kilobytes directly in the filename:
84
-
85
- ```
86
- eckMyProject_26-02-15_12-00_abc1234_1250kb.md ← full snapshot
87
- eckMyProject_26-02-15_14-30_abc1234_up1_42kb.md ← incremental update
18
+ npm install -g @xelth/eck-snapshot
88
19
  ```
89
20
 
90
- **2. AI instructions baked into the snapshot.** The snapshot header instructs the AI to cross-check the `kb` value in the filename against the actual payload it received. If there is a mismatch, the AI is required to stop and alert you instead of hallucinating:
91
-
92
- > 🚨 **System Error:** The web interface truncated the file `eckMyProject_..._1250kb.md`. I only received the metadata/JSON stub, not the actual 1250 kb of code. Please split the snapshot or paste the text directly.
93
-
94
- This protection works on any web interface that embeds the filename (Gemini, ChatGPT, Grok, etc.).
95
-
96
- ## Smart Filtering
97
-
98
- eck-snapshot automatically detects your project type (Rust, Node.js, Android, Python, etc.) and excludes language-specific noise:
99
-
100
- - **Rust**: `Cargo.lock`, `target/`
101
- - **Node.js**: `package-lock.json`, `node_modules/`
102
- - **Android**: build artifacts, generated code
103
- - **All projects**: `.git/`, IDE configs, binary files
104
-
105
- The built-in `SecretScanner` also redacts API keys, tokens, and credentials before they reach the AI.
106
-
107
- ## Multi-Agent Architecture
108
-
109
- eck-snapshot generates tailored `CLAUDE.md` instructions for different AI agent roles:
110
-
21
+ ### Basic Usage
111
22
  ```bash
112
- eck-snapshot --jas # Junior Architect Sonnet - fast, standard features
113
- eck-snapshot --jao # Junior Architect Opus - deep, critical architecture
114
- eck-snapshot --jag # Junior Architect Gemini - massive context tasks
115
- ```
116
-
117
- ### Chinese Delegation (`--zh`)
23
+ # Create a standard full snapshot
24
+ eck-snapshot snapshot
118
25
 
119
- For GLM Z.AI workers (trained on Chinese data), the `--zh` flag instructs the architect to formulate all worker tasks in Chinese, improving output quality:
26
+ # Create a highly compressed skeleton snapshot
27
+ eck-snapshot snapshot --skeleton
120
28
 
121
- ```bash
122
- eck-snapshot --jas --zh # Claude Code: delegate to GLM workers in Chinese
123
- eck-snapshot --zh # OpenCode/GLM: generate AGENTS.md with Chinese protocol
29
+ # Create an incremental update (only changed/deleted files)
30
+ eck-snapshot update
124
31
  ```
125
32
 
126
- The architect still communicates with you in your language. Only the `instruction` parameter sent to GLM workers switches to Chinese. Code, variable names, and commit messages stay in English.
33
+ ## 🤖 AI Swarm Setup (GLM Z.AI)
127
34
 
128
- ### MCP Server Integration
35
+ eckSnapshot v6 acts as the bridge between your primary AI IDE (Claude Code or OpenCode) and a cost-effective GLM-4.7 worker swarm.
129
36
 
130
- Delegate coding tasks to the GLM Z.AI Worker Fleet via MCP:
37
+ 1. **Get an API Key:** Register at [Z.AI](https://z.ai) and set `export ZAI_API_KEY="your-key"`.
38
+ 2. **Setup MCP Servers:**
39
+ ```bash
40
+ eck-snapshot setup-mcp --both
41
+ ```
42
+ 3. **Initialize Project Manifests:**
43
+ ```bash
44
+ # Generates smart instructions (CLAUDE.md / AGENTS.md)
45
+ eck-snapshot snapshot --jas # For Claude Code (Sonnet 4.5)
46
+ eck-snapshot snapshot --jaz # For OpenCode (GLM-4.7)
47
+ ```
131
48
 
132
- ```bash
133
- export ZAI_API_KEY="your-key"
134
- eck-snapshot setup-mcp --both # Setup for Claude Code + OpenCode
135
- ```
49
+ ## 📁 The `.eck/` Manifest Directory
136
50
 
137
- This gives your AI access to specialized workers: `glm_zai_frontend`, `glm_zai_backend`, `glm_zai_qa`, `glm_zai_refactor`, and the `eck_finish_task` commit tool.
51
+ eckSnapshot automatically maintains a `.eck/` directory in your project to provide deep context to AI agents:
52
+ - `CONTEXT.md` - High-level architecture (Auto-generated)
53
+ - `ENVIRONMENT.md` - Runtime specifics (Auto-generated)
54
+ - `ROADMAP.md` & `TECH_DEBT.md` - Strategic planning
55
+ - `RUNTIME_STATE.md` - Live port/process status
138
56
 
139
- ## Skeleton Mode & Lazy Loading
57
+ *Note: The tool automatically filters confidential files like `SERVER_ACCESS.md` from snapshots to ensure security.*
140
58
 
141
- For extremely large projects, skeleton mode strips function bodies and keeps only signatures, types, and structure:
59
+ ## 📈 Token Estimation
142
60
 
61
+ Train the local estimator to perfectly predict token counts for your specific project:
143
62
  ```bash
144
- eck-snapshot --skeleton
145
- ```
146
-
147
- When using skeleton mode, the AI can request full content of specific files on demand:
148
-
149
- ```bash
150
- eck-snapshot show src/auth.rs src/handlers/sync.rs
151
- ```
152
-
153
- Useful for initial orientation in massive codebases, but full snapshots with profiles are usually more practical.
154
-
155
- ## Other Commands
63
+ # Manually push agent telemetry
64
+ eck-snapshot telemetry push
156
65
 
157
- ```bash
158
- eck-snapshot restore <snapshot> # Restore files from a snapshot to disk
159
- eck-snapshot prune <snapshot> # AI-powered snapshot size reduction
160
- eck-snapshot doctor # Check project health
161
- eck-snapshot env push # Encrypt and sync .eck/ config between machines
162
- eck-snapshot env pull # Restore .eck/ config on another machine
66
+ # Sync global token weights from the Telemetry Hub
67
+ eck-snapshot telemetry sync-weights
163
68
  ```
164
69
 
165
- ## Changelog
166
-
167
- ### v5.8.6
168
- - **Anti-Truncation Guard:** Every snapshot filename now includes its size in KB (e.g., `_1250kb.md`). The snapshot header instructs the AI to verify the payload size matches the filename and alert the user if the web UI truncated the file instead of hallucinating missing code.
169
- - **Incremental snapshot filtering parity:** `eck-snapshot update` now applies the same file guards as full snapshots — hidden paths (`.idea/`, `.vscode/`), binary files, and glob patterns in `filesToIgnore` are all properly filtered out, preventing IDE config files or committed binaries from bloating update snapshots.
170
-
171
- ### v5.8.5
172
- - Re-publish to fix missing README on npmjs.com.
173
-
174
- ### v5.8.4
175
- - Fixed directory filtering in incremental snapshots. Paths like `web/build/app.js` are now correctly ignored when `build/` is in the ignore list.
176
-
177
- ### v5.8.3
178
- - Optimized agent report formatting with clean Markdown to improve token efficiency.
179
- - Fixed report injection order so it appears correctly after system instructions.
180
-
181
- ### v5.8.2
182
- - Fixed agent report injection in incremental snapshots. The `AnswerToSA.md` file is now preserved on disk for manual debugging and uses an internal `[SYSTEM: EMBEDDED]` marker to prevent duplicate injections into future snapshots.
183
-
184
- ### v5.8.1
185
- - Improved Android project parsing by ignoring boilerplate and vector graphics.
186
- - Removed duplicate `ecksnapshot` MCP server and fixed JSON parsing in `update-auto`.
187
-
188
70
  ## License
189
-
190
- MIT
71
+ MIT © xelth-com
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xelth/eck-snapshot",
3
- "version": "5.8.6",
4
- "description": "A powerful CLI tool to create and restore single-file text snapshots of Git repositories and directories. Optimized for AI context and LLM workflows.",
3
+ "version": "6.0.0",
4
+ "description": "A powerful CLI tool to create and restore single-file text snapshots of Git repositories. Optimized for AI context, LLM workflows, and multi-agent Swarm coordination.",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "bin": {
@@ -24,8 +24,22 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
24
24
  return {
25
25
  tools: [
26
26
  {
27
- name: "eck_finish_task",
28
- description: "Completes the current coding task. 1) Overwrites AnswerToSA.md with status for the Architect. 2) Stages all changes. 3) Commits with the provided message. 4) Automatically updates the context snapshot. Use this instead of manual git commands.",
27
+ name: "eck_fail_task",
28
+ description: "Use this if you are stuck, blocked, or unable to complete the task. It saves your report to AnswerToSA.md and generates an emergency snapshot WITHOUT committing broken code. Do NOT use this if tests pass.",
29
+ inputSchema: {
30
+ type: "object",
31
+ properties: {
32
+ status: {
33
+ type: "string",
34
+ description: "Detailed explanation of why you are blocked, what you tried, and what the Architect should know."
35
+ }
36
+ },
37
+ required: ["status"]
38
+ }
39
+ },
40
+ {
41
+ name: "eck_finish_task",
42
+ description: "Completes the current coding task. 1) Overwrites AnswerToSA.md with status for the Architect. 2) Stages all changes. 3) Commits with the provided message. 4) Automatically updates the context snapshot. WARNING: USE ONLY ONCE PER TASK WHEN 100% FINISHED. Do NOT use this for intermediate saves or testing during your debugging loop.",
29
43
  inputSchema: {
30
44
  type: "object",
31
45
  properties: {
@@ -46,6 +60,40 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
46
60
  });
47
61
 
48
62
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
63
+ if (request.params.name === "eck_fail_task") {
64
+ const { status } = request.params.arguments;
65
+ const workDir = process.cwd();
66
+
67
+ try {
68
+ const answerDir = path.join(workDir, '.eck', 'lastsnapshot');
69
+ await fs.mkdir(answerDir, { recursive: true });
70
+ await fs.writeFile(
71
+ path.join(answerDir, 'AnswerToSA.md'),
72
+ `# Agent Report (BLOCKED/FAILED)\n\n${status}\n`,
73
+ 'utf-8'
74
+ );
75
+
76
+ const cliPath = path.join(PROJECT_ROOT, "index.js");
77
+ const { stdout } = await execa("node", [cliPath, "update-auto", "--fail"], { cwd: workDir, timeout: 120000 });
78
+
79
+ let result;
80
+ try {
81
+ result = JSON.parse(stdout);
82
+ } catch (e) {
83
+ return { content: [{ type: "text", text: `⚠️ Task aborted, but snapshot update returned invalid JSON: ${stdout}` }] };
84
+ }
85
+
86
+ return {
87
+ content: [{
88
+ type: "text",
89
+ text: `🚨 Task marked as FAILED.\n📝 AnswerToSA.md updated\n📸 Emergency Snapshot: ${result.snapshot_file} (${result.files_count} files)`
90
+ }]
91
+ };
92
+ } catch (error) {
93
+ return { content: [{ type: "text", text: `❌ Error: ${error.message}\n${error.stderr || ''}` }], isError: true };
94
+ }
95
+ }
96
+
49
97
  if (request.params.name === "eck_finish_task") {
50
98
  const { status, message } = request.params.arguments;
51
99
  const workDir = process.cwd();
@@ -106,14 +154,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
106
154
  };
107
155
  });
108
156
 
109
- const transport = new StdioServerTransport();
110
- await server.connect(transport);
111
-
112
- // --- Graceful Shutdown Handler ---
113
- process.stdout.on('error', (err) => {
114
- if (err.code === 'EPIPE') {
115
- process.exit(0);
116
- }
117
- });
118
- process.on('SIGINT', () => process.exit(0));
119
- process.on('SIGTERM', () => process.exit(0));
157
+ const transport = new StdioServerTransport();
158
+ await server.connect(transport);
159
+
160
+ // --- Graceful Shutdown Handler ---
161
+ process.stdout.on('error', (err) => {
162
+ if (err.code === 'EPIPE') {
163
+ process.exit(0);
164
+ }
165
+ });
166
+ process.on('SIGINT', () => process.exit(0));
167
+ process.on('SIGTERM', () => process.exit(0));
package/setup.json CHANGED
@@ -576,66 +576,70 @@
576
576
  "capabilities": ["npm", "git", "basic editing"],
577
577
  "restrictions": ["Do not use for complex architectural tasks"]
578
578
  },
579
- "jas": {
580
- "active": true,
581
- "name": "Junior Architect (Sonnet 4.5)",
582
- "description": "Smart & Fast Manager. Best for standard features and refactoring. Manages GLM Z.AI workers.",
583
- "guiSupport": true,
584
- "identification": {
585
- "markers": ["sonnet", "fast_architect"]
586
- },
587
- "capabilities": [
588
- "glm_zai_frontend",
589
- "glm_zai_backend",
590
- "glm_zai_qa",
591
- "glm_zai_refactor",
592
- "glm_zai_general",
593
- "git operations",
594
- "npm run dev"
595
- ],
596
- "restrictions": [
597
- "Prefer delegating heavy coding to GLM Z.AI workers",
598
- "Focus on glue code and logic verification"
599
- ]
600
- },
601
- "jao": {
602
- "active": true,
603
- "name": "Junior Architect (Opus 4.5)",
604
- "description": "Deep Thinker & Planner. Expensive. Use for critical architecture, security, and complex logic.",
605
- "guiSupport": true,
606
- "identification": {
607
- "markers": ["opus", "deep_architect"]
608
- },
609
- "capabilities": [
610
- "glm_zai_frontend",
611
- "glm_zai_backend",
612
- "glm_zai_qa",
613
- "glm_zai_refactor",
614
- "glm_zai_general",
615
- "analysis"
616
- ],
617
- "restrictions": [
618
- "STRICTLY DELEGATE boilerplate to GLM Z.AI",
619
- "Verify every line of code generated by workers",
620
- "Plan before execution"
621
- ]
622
- },
623
- "jag": {
624
- "active": true,
625
- "name": "Junior Architect (Gemini 3 Pro)",
626
- "description": "Massive Context Handler. Use when changes span >50 files or require full repo understanding.",
627
- "guiSupport": false,
628
- "identification": {
629
- "markers": ["gemini_wsl"]
630
- },
631
- "capabilities": [
632
- "read entire repo",
633
- "delegate to claude"
634
- ],
635
- "restrictions": [
636
- "Experimental environment"
637
- ]
638
- },
579
+ "jas": {
580
+ "active": true,
581
+ "name": "Junior Architect (Sonnet 4.5)",
582
+ "description": "Project Mode Orchestrator (Claude Code only). Smart & Fast Manager. Manages GLM Z.AI workers for efficient task delegation.",
583
+ "guiSupport": true,
584
+ "identification": {
585
+ "markers": ["sonnet", "fast_architect"]
586
+ },
587
+ "capabilities": [
588
+ "glm_zai_frontend",
589
+ "glm_zai_backend",
590
+ "glm_zai_qa",
591
+ "glm_zai_refactor",
592
+ "glm_zai_general",
593
+ "git operations",
594
+ "npm run dev"
595
+ ],
596
+ "restrictions": [
597
+ "Prefer delegating heavy coding to GLM Z.AI workers",
598
+ "Focus on glue code and logic verification"
599
+ ]
600
+ },
601
+ "jao": {
602
+ "active": true,
603
+ "name": "Junior Architect (Opus 4.5)",
604
+ "description": "Project Mode Orchestrator (Claude Code only). Deep Thinker & Planner. Expensive. Use for critical architecture, security, and complex logic.",
605
+ "guiSupport": true,
606
+ "identification": {
607
+ "markers": ["opus", "deep_architect"]
608
+ },
609
+ "capabilities": [
610
+ "glm_zai_frontend",
611
+ "glm_zai_backend",
612
+ "glm_zai_qa",
613
+ "glm_zai_refactor",
614
+ "glm_zai_general",
615
+ "analysis"
616
+ ],
617
+ "restrictions": [
618
+ "STRICTLY DELEGATE boilerplate to GLM Z.AI",
619
+ "Verify every line of code generated by workers",
620
+ "Plan before execution"
621
+ ]
622
+ },
623
+ "jaz": {
624
+ "active": true,
625
+ "name": "Junior Architect (GLM-4.7 via OpenCode)",
626
+ "description": "Project Orchestrator for OpenCode. Highly accessible/budget-friendly. Manages the GLM Z.AI worker swarm.",
627
+ "guiSupport": true,
628
+ "identification": {
629
+ "markers": ["opencode", "glm-4.7"]
630
+ },
631
+ "capabilities": [
632
+ "glm_zai_frontend",
633
+ "glm_zai_backend",
634
+ "glm_zai_qa",
635
+ "glm_zai_refactor",
636
+ "glm_zai_general",
637
+ "git operations"
638
+ ],
639
+ "restrictions": [
640
+ "Strictly delegate complex/large logic to workers to preserve context window"
641
+ ]
642
+ },
639
643
  "production_server": {
640
644
  "active": true,
641
645
  "name": "Production Server Agent (AGENT_PROD_SERVER)",
package/src/cli/cli.js CHANGED
@@ -17,6 +17,7 @@ import { executePrompt, executePromptWithSession } from '../services/claudeCliSe
17
17
  import { detectProfiles } from './commands/detectProfiles.js';
18
18
  import { generateProfileGuide } from './commands/generateProfileGuide.js';
19
19
  import { setupGemini } from './commands/setupGemini.js';
20
+ import { pushTelemetry } from '../utils/telemetry.js';
20
21
 
21
22
  import { showFile } from './commands/showFile.js';
22
23
  import { runDoctor } from './commands/doctor.js';
@@ -181,9 +182,9 @@ Option C: Using Profiles
181
182
  .option('--enhanced', 'Use enhanced multi-agent headers (default: true)', true)
182
183
  .option('--profile [name]', 'Filter files using profiles and/or ad-hoc glob patterns. Run without argument to list available profiles.')
183
184
  .option('--agent', 'Generate a snapshot optimized for a command-line agent')
184
- .option('--jag', 'Generate snapshot for Junior Architect Gemini (Gemini 3 Pro)')
185
- .option('--jas', 'Configure project for Junior Architect Sonnet (Sonnet 4.5)')
186
- .option('--jao', 'Configure project for Junior Architect Opus (Opus 4.5)')
185
+ .option('--jas', 'Enable Project Mode for Junior Architect Sonnet (Claude Code only)')
186
+ .option('--jao', 'Enable Project Mode for Junior Architect Opus (Claude Code only)')
187
+ .option('--jaz', 'Enable Project Mode for Junior Architect GLM (OpenCode Z.AI only)')
187
188
  .option('--zh', 'Communicate with GLM Z.AI workers in Chinese for better quality')
188
189
  .option('--skeleton', 'Enable skeleton mode: strip function bodies to save context window tokens')
189
190
  .option('--max-lines-per-file <number>', 'Truncate files to max N lines (e.g., 200 for compact snapshots)', (val) => parseInt(val))
@@ -204,6 +205,7 @@ Quick --profile Examples:
204
205
  .description('Create a delta snapshot of changed files since the last full snapshot')
205
206
  .argument('[repoPath]', 'Path to the repository', process.cwd())
206
207
  .option('--config <path>', 'Configuration file path')
208
+ .option('-f, --fail', 'Create an emergency snapshot without git commit')
207
209
  .action(updateSnapshot);
208
210
 
209
211
  // Auto/Silent Update command for Agents
@@ -211,6 +213,7 @@ Quick --profile Examples:
211
213
  .command('update-auto')
212
214
  .description('Silent update for AI agents (JSON output)')
213
215
  .argument('[repoPath]', 'Path to the repository', process.cwd())
216
+ .option('-f, --fail', 'Create an emergency snapshot without git commit')
214
217
  .action(updateSnapshotJson);
215
218
 
216
219
  // Restore command
@@ -403,5 +406,24 @@ Quick --profile Examples:
403
406
  .option('-v, --verbose', 'Show detailed output')
404
407
  .action(envPull);
405
408
 
409
+ // Telemetry commands
410
+ const telemetryCmd = program.command('telemetry').description('Manage Telemetry Hub synchronization');
411
+ telemetryCmd
412
+ .command('push')
413
+ .description('Manually push the latest AnswerToSA.md report to xelth.com/T/report')
414
+ .argument('[repoPath]', 'Path to the repository', process.cwd())
415
+ .action(async (repoPath) => {
416
+ console.log(chalk.blue('Pushing agent telemetry...'));
417
+ await pushTelemetry(repoPath, false);
418
+ });
419
+
420
+ telemetryCmd
421
+ .command('sync-weights')
422
+ .description('Fetch the latest global token estimation weights from Telemetry Hub')
423
+ .action(async () => {
424
+ const { syncTokenWeights } = await import('../utils/tokenEstimator.js');
425
+ await syncTokenWeights();
426
+ });
427
+
406
428
  program.parse(process.argv);
407
429
  }