@xelth/eck-snapshot 5.9.0 → 6.4.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 +267 -190
- package/package.json +15 -2
- package/scripts/mcp-eck-core.js +61 -13
- package/setup.json +114 -80
- package/src/cli/cli.js +235 -385
- package/src/cli/commands/createSnapshot.js +336 -122
- package/src/cli/commands/recon.js +244 -0
- package/src/cli/commands/setupMcp.js +278 -19
- package/src/cli/commands/trainTokens.js +42 -32
- package/src/cli/commands/updateSnapshot.js +128 -76
- package/src/core/depthConfig.js +54 -0
- package/src/core/skeletonizer.js +71 -18
- package/src/templates/architect-prompt.template.md +34 -0
- package/src/templates/multiAgent.md +18 -10
- package/src/templates/opencode/coder.template.md +44 -17
- package/src/templates/opencode/junior-architect.template.md +45 -15
- package/src/templates/skeleton-instruction.md +1 -1
- package/src/utils/aiHeader.js +57 -27
- package/src/utils/claudeMdGenerator.js +136 -78
- package/src/utils/fileUtils.js +1011 -1016
- package/src/utils/gitUtils.js +12 -8
- package/src/utils/opencodeAgentsGenerator.js +8 -2
- package/src/utils/projectDetector.js +66 -21
- package/src/utils/tokenEstimator.js +11 -7
- package/src/cli/commands/consilium.js +0 -86
- package/src/cli/commands/detectProfiles.js +0 -98
- package/src/cli/commands/envSync.js +0 -319
- package/src/cli/commands/generateProfileGuide.js +0 -144
- package/src/cli/commands/pruneSnapshot.js +0 -106
- package/src/cli/commands/restoreSnapshot.js +0 -173
- package/src/cli/commands/setupGemini.js +0 -149
- package/src/cli/commands/setupGemini.test.js +0 -115
- package/src/cli/commands/showFile.js +0 -39
- package/src/services/claudeCliService.js +0 -626
- package/src/services/claudeCliService.test.js +0 -267
package/README.md
CHANGED
|
@@ -1,190 +1,267 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
A CLI tool that
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
eck
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
1
|
+
# 📸 eckSnapshot v6.3.2 (AI-Native Edition)
|
|
2
|
+
|
|
3
|
+
A specialized, AI-native CLI tool that creates single-file text snapshots of entire Git repositories and feeds them directly into LLM context windows. Instead of letting AI agents guess which files to read, eckSnapshot force-feeds the complete project into the model's context — giving it a "university degree" in your codebase from the very first prompt.
|
|
4
|
+
|
|
5
|
+
It also serves as the coordination hub for multi-agent AI coding workflows: generating role-specific instructions (`CLAUDE.md`, `AGENTS.md`), maintaining project manifests (`.eck/` directory), and providing MCP integration for automatic context sync after every code change.
|
|
6
|
+
|
|
7
|
+
> **Want to see it in action?** This project snapshots itself.
|
|
8
|
+
> [**Download ecksnapshot-context.md**](https://github.com/xelth-com/eckSnapshot/releases/download/v6.2.3/ecksnapshot-context.md) (364 KB), drop it into [Gemini](https://gemini.google.com/), ChatGPT, or any LLM with a large context window — and ask anything in your language — the AI will answer you natively while keeping code-level discussions in English. It becomes a Senior Architect who built this tool.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 📦 Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g @xelth/eck-snapshot
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 🎯 The Battle-Tested Workflow
|
|
21
|
+
|
|
22
|
+
### 1. Initial Context (Full Snapshot)
|
|
23
|
+
Take a full snapshot and feed it to a powerful **Web LLM** — the **Senior Architect**.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
eck-snapshot
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The generated `.md` file goes into the chat of your chosen Architect model. The Architect analyzes the full codebase and produces a detailed technical plan.
|
|
30
|
+
|
|
31
|
+
*(For massive monorepos, slice the context using profiles: `eck-snapshot '{"name": "eck_snapshot", "arguments": {"profile": "frontend"}}'`)*
|
|
32
|
+
|
|
33
|
+
### 2. Direct Execution
|
|
34
|
+
Pass the Architect's technical plan to your local **Coder agent** (Claude Code / OpenCode / Codex). The Coder implements the changes directly in your repository.
|
|
35
|
+
|
|
36
|
+
### 3. Auto-Updates
|
|
37
|
+
When the Coder agent finishes a task, it automatically calls the built-in MCP tool (`eck_finish_task`), which commits the code and generates an incremental delta update snapshot. Feed that update back to the Architect to keep it in sync.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🧠 Which Models to Use
|
|
42
|
+
|
|
43
|
+
### Senior Architect (Web LLM — reads the snapshot)
|
|
44
|
+
|
|
45
|
+
The Architect needs a **massive context window** and strong reasoning to digest the full codebase snapshot:
|
|
46
|
+
|
|
47
|
+
| Model | Context Window | Notes |
|
|
48
|
+
|-------|---------------|-------|
|
|
49
|
+
| **Grok 4 Fast** | **2M tokens** | Largest context available. Can swallow even the biggest monorepos whole. |
|
|
50
|
+
| **Gemini 3.1 Pro** | 1M tokens | Excellent for large projects. Handles huge snapshots effortlessly. *(Author's choice)* |
|
|
51
|
+
| **ChatGPT (GPT-5.4 via web)** | 1M tokens | Works, but can be stubborn with instructions. You **MUST** paste the specific prompt provided at the end of the snapshot output as your first message — otherwise ChatGPT will act as a generic code reviewer instead of assuming the Architect role. |
|
|
52
|
+
|
|
53
|
+
### Coder Agent (Local — executes the plan)
|
|
54
|
+
|
|
55
|
+
The Coder needs **tool access** (file editing, terminal, MCP) and works locally in your repository:
|
|
56
|
+
|
|
57
|
+
| Tool | Engine | Best For |
|
|
58
|
+
|------|--------|----------|
|
|
59
|
+
| **Claude Code** | Claude Sonnet/Opus 4.6 (1M context) | Primary choice. Deep tool integration, native MCP support, context compaction for long sessions. |
|
|
60
|
+
| **OpenCode** | GLM-4.7 / any model | Cost-effective alternative. AGENTS.md support, GLM Z.AI worker swarm via MCP. |
|
|
61
|
+
| **Codex CLI** | GPT models | OpenAI's coding agent. Auto-configured via `.codex/config.toml`. |
|
|
62
|
+
|
|
63
|
+
### MCP Setup (One-Time)
|
|
64
|
+
Register the MCP servers so your Coder agent can auto-commit and sync context:
|
|
65
|
+
```bash
|
|
66
|
+
eck-snapshot setup-mcp
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🤖 The AI-Native JSON Interface (New in v6.1)
|
|
72
|
+
|
|
73
|
+
`eck-snapshot` is a **100% pure JSON/MCP bridge**. AI agents interact with the CLI by passing a single JSON payload:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
eck-snapshot '{"name": "eck_snapshot", "arguments": {"profile": "backend", "jas": true}}'
|
|
77
|
+
eck-snapshot '{"name": "eck_update"}'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 🧑💻 Human Shorthands (Ranked by Usage)
|
|
81
|
+
For humans typing in the terminal, short commands work too:
|
|
82
|
+
|
|
83
|
+
| # | Command | Description |
|
|
84
|
+
|---|---------|-------------|
|
|
85
|
+
| 1 | `eck-snapshot snapshot` | Full project snapshot |
|
|
86
|
+
| 2 | `eck-snapshot update` | Delta update (changed files only) |
|
|
87
|
+
| 3 | `eck-snapshot profile [name]` | Snapshot filtered by profile (no arg = list profiles) |
|
|
88
|
+
| 4 | `eck-snapshot scout [0-9]` | Scout external repo (see depth scale below) |
|
|
89
|
+
| 5 | `eck-snapshot fetch "src/**/*.rs"` | Fetch specific files by glob |
|
|
90
|
+
| 6 | `eck-snapshot link [0-9]` | Linked companion snapshot |
|
|
91
|
+
| 7 | `eck-snapshot booklm` | Export for NotebookLM — Scout mode (see below) |
|
|
92
|
+
| 8 | `eck-snapshot notelm` | Export for NotebookLM — Architect mode (see below) |
|
|
93
|
+
| 9 | `eck-snapshot setup-mcp` | Configure MCP servers |
|
|
94
|
+
| 10 | `eck-snapshot detect` | Detect project type and active filters |
|
|
95
|
+
| 11 | `eck-snapshot doctor` | Check project health and stubs |
|
|
96
|
+
|
|
97
|
+
Running `eck-snapshot` with no arguments defaults to a full snapshot.
|
|
98
|
+
|
|
99
|
+
### ✉️ Feedback & Telemetry
|
|
100
|
+
```bash
|
|
101
|
+
eck-snapshot -e "Great tool, but scout could be faster" # Normal feedback
|
|
102
|
+
eck-snapshot -E "Crash on Windows when path has spaces" # Urgent bug report
|
|
103
|
+
eck-snapshot telemetry disable # Opt out completely
|
|
104
|
+
eck-snapshot telemetry enable # Opt back in
|
|
105
|
+
eck-snapshot telemetry # Check current status
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Feedback is saved locally to `.eck/telemetry_queue.json` and will be sent to developers during the next telemetry sync.
|
|
109
|
+
|
|
110
|
+
#### 🔒 Datenschutz / Privacy
|
|
111
|
+
By default, eck-snapshot collects **anonymous usage counts** and **crash logs** to improve the tool. **NO source code or sensitive data is ever sent.** Each CLI instance is identified by a random UUID stored in `~/.eck/cli-config.json`. You can completely disable telemetry at any time with `eck-snapshot telemetry disable`.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 🔗 Cross-Context: Scouts & Links (Working with External Projects)
|
|
116
|
+
|
|
117
|
+
When your AI is working on **Project A** but needs awareness of **Project B** (a shared backend, a component library, a microservice), feeding it a standard snapshot of Project B will cause "context pollution" — the AI forgets which project it's supposed to edit.
|
|
118
|
+
|
|
119
|
+
eckSnapshot solves this with two complementary tools that share a **unified depth scale (0-9)** for controlling how much content is included:
|
|
120
|
+
|
|
121
|
+
### `scout` — Quick Exploration (read-only)
|
|
122
|
+
Run inside the external repository:
|
|
123
|
+
```bash
|
|
124
|
+
cd ../project-b
|
|
125
|
+
eck-snapshot scout # depth 0: tree only (fast overview)
|
|
126
|
+
eck-snapshot scout 3 # depth 3: tree + 60 lines per file
|
|
127
|
+
eck-snapshot scout 5 # depth 5: tree + function signatures
|
|
128
|
+
```
|
|
129
|
+
*Result:* Generates `.eck/scouts/scout_tree_...md` — a directory tree (and optionally file contents) with strict instructions telling the AI **NOT** to edit this code. Feed it to your AI, and it can request specific files via `eck-snapshot fetch "src/**/*.js"`.
|
|
130
|
+
|
|
131
|
+
### `link` — Deep Cross-Context Snapshot (companion file)
|
|
132
|
+
Run inside the companion project:
|
|
133
|
+
```bash
|
|
134
|
+
cd ../project-b
|
|
135
|
+
eck-snapshot link 5 # skeleton: function signatures
|
|
136
|
+
eck-snapshot link 9 # full: complete file contents
|
|
137
|
+
```
|
|
138
|
+
*Result:* Generates a standalone `link_*.md` file saved to `.eck/links/` with a read-only cross-context header. Upload it alongside your main project snapshot. The AI will automatically receive instructions to **not edit** the linked project and will be given `eck_fetch` commands to drill deeper if needed.
|
|
139
|
+
|
|
140
|
+
### `fetch` — Targeted File Extraction (by glob pattern)
|
|
141
|
+
```bash
|
|
142
|
+
eck-snapshot fetch "src/core/parser.js" "docs/**/*.md"
|
|
143
|
+
```
|
|
144
|
+
*Result:* Generates `.eck/scouts/scout_data_...md` containing only the requested file contents, perfectly formatted for reading without losing the primary role.
|
|
145
|
+
|
|
146
|
+
### Shared Depth Scale (0-9)
|
|
147
|
+
Both `scout` and `link` use the same depth scale to control content granularity:
|
|
148
|
+
|
|
149
|
+
| Depth | Mode | Use Case |
|
|
150
|
+
|-------|------|----------|
|
|
151
|
+
| **0** | Tree only | "Just show me the folder structure" |
|
|
152
|
+
| **1** | Truncated (10 lines) | Imports and file headers only |
|
|
153
|
+
| **2** | Truncated (30 lines) | Quick surface scan |
|
|
154
|
+
| **3** | Truncated (60 lines) | API surface overview |
|
|
155
|
+
| **4** | Truncated (100 lines) | Detailed surface scan |
|
|
156
|
+
| **5** | Skeleton | Function/class signatures only (no docs) |
|
|
157
|
+
| **6** | Skeleton + docs | Signatures with JSDoc/docstrings preserved |
|
|
158
|
+
| **7** | Full (compact) | Full content, truncated at 500 lines per file |
|
|
159
|
+
| **8** | Full (standard) | Full content, truncated at 1000 lines per file |
|
|
160
|
+
| **9** | Full (unlimited) | Everything, no limits |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 🌟 Core Features
|
|
165
|
+
|
|
166
|
+
* **🔄 Smart Delta Updates:** Tracks incremental changes via Git anchors. Accurately tracks and reports deleted files to prevent LLM hallucinations.
|
|
167
|
+
* **🛡️ Security (SecretScanner):** Automatically redacts API keys and credentials before sending context to LLMs. Features both Regex matching and **Shannon Entropy** analysis.
|
|
168
|
+
* **🔌 Native MCP Integration:** Instantly spins up Model Context Protocol (MCP) servers (`eck-core` and `glm-zai`) for Claude Code, OpenCode, and Codex.
|
|
169
|
+
* **📁 The `.eck/` Manifest:** Automatically maintains project context files (`CONTEXT.md`, `ROADMAP.md`, `TECH_DEBT.md`). Dynamic scanning — any `.md` file you add to `.eck/` is automatically included in snapshots.
|
|
170
|
+
* **☠️ Skeleton Mode:** Uses Tree-sitter and Babel to strip function bodies, drastically reducing token count for huge codebases.
|
|
171
|
+
* **📚 NotebookLM Export:** Semantic chunking for Google's NotebookLM with "Brain + Body" architecture (see below).
|
|
172
|
+
* **🧠 Multi-Agent Protocol:** Junior Architect delegation system for multi-agent coding workflows (see below).
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 📚 NotebookLM Integration (New in v6.3 — Testing)
|
|
177
|
+
|
|
178
|
+
> **Status:** Active testing. The core chunking works, prompt tuning is ongoing.
|
|
179
|
+
|
|
180
|
+
### The Problem
|
|
181
|
+
Your project is 2M+ tokens. Your Architect (Gemini/Grok) has a limited context window and costs money per query. You can't afford to feed the full codebase on every question.
|
|
182
|
+
|
|
183
|
+
### The Solution: Free RAG via NotebookLM
|
|
184
|
+
Google's NotebookLM supports up to **50 sources** and uses **RAG** (Retrieval-Augmented Generation) to search across them for free. eckSnapshot splits your codebase into semantically packed chunks that NotebookLM can index and search.
|
|
185
|
+
|
|
186
|
+
### Architecture: Brain + Body
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
Part 0 (Brain) — Instructions, .eck/ manifests, full directory tree. No code.
|
|
190
|
+
Part 1 (Body) — Source code chunk (~2.5MB), grouped by directory.
|
|
191
|
+
Part 2 (Body) — Source code chunk (~2.5MB), grouped by directory.
|
|
192
|
+
...
|
|
193
|
+
Part N (Body) — Source code chunk (~2.5MB), grouped by directory.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Files are packed using a **directory-aware bin packing** algorithm: files from the same folder stay together for better RAG retrieval. The directory tree lives only in Part 0 to avoid duplication across chunks.
|
|
197
|
+
|
|
198
|
+
### Two Modes
|
|
199
|
+
|
|
200
|
+
**`booklm` — The Scout (Primary Use Case)**
|
|
201
|
+
```bash
|
|
202
|
+
eck-snapshot booklm
|
|
203
|
+
```
|
|
204
|
+
NotebookLM becomes a free "code librarian" for your paid Architect. Ask it: *"I'm working on fiscalization, which files do I need?"* — it analyzes the entire codebase via RAG and returns precise `eck-snapshot fetch` commands:
|
|
205
|
+
```bash
|
|
206
|
+
cd /path/to/project
|
|
207
|
+
eck-snapshot fetch "**/FiscalPrinter.kt" "**/TaxCalculator.kt" "**/receipt_config.json"
|
|
208
|
+
```
|
|
209
|
+
You run the fetch command locally, get a tiny focused snapshot, and hand *that* to your real Architect. This saves money and context window.
|
|
210
|
+
|
|
211
|
+
**`notelm` — The Architect (Experimental)**
|
|
212
|
+
```bash
|
|
213
|
+
eck-snapshot notelm
|
|
214
|
+
```
|
|
215
|
+
Same chunking, but Part 0 instructs NotebookLM to act as the Senior Architect itself — analyzing architecture, proposing refactoring, designing features. This is experimental and results vary.
|
|
216
|
+
|
|
217
|
+
### Quick Start
|
|
218
|
+
1. Run `eck-snapshot booklm` (or `notelm`) inside your project
|
|
219
|
+
2. Upload all generated `part*.md` files as sources in a new NotebookLM project
|
|
220
|
+
3. Paste the **Starter Prompt** (printed in your terminal) as your first message
|
|
221
|
+
4. Start asking questions
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 🧠 Multi-Agent Protocol: Junior Architects (Testing)
|
|
226
|
+
|
|
227
|
+
> **Status:** Active testing. The delegation protocol works, prompt optimization is ongoing.
|
|
228
|
+
|
|
229
|
+
### The Concept
|
|
230
|
+
For large projects, a single AI can't hold the full context AND write code efficiently. eckSnapshot implements a **Royal Court** hierarchy:
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
Senior Architect (Gemini/Grok — Web LLM, huge context)
|
|
234
|
+
│
|
|
235
|
+
├── Junior Architect Sonnet (jas) — Claude Code with Sonnet 4.6
|
|
236
|
+
├── Junior Architect Opus (jao) — Claude Code with Opus 4.6
|
|
237
|
+
├── Junior Architect GLM (jaz) — OpenCode with GLM-4.7
|
|
238
|
+
│ │
|
|
239
|
+
│ └── GLM Z.AI Workers (MCP) — cheap bulk coding
|
|
240
|
+
│
|
|
241
|
+
└── Coder (default) — standard developer mode
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
The Senior Architect reads the full snapshot, plans the work, and delegates tasks via the Eck-Protocol v2. Junior Architects receive filtered snapshots with role-specific `CLAUDE.md` / `AGENTS.md` instructions and execute the plan locally.
|
|
245
|
+
|
|
246
|
+
### Usage
|
|
247
|
+
```bash
|
|
248
|
+
eck-snapshot '{"name": "eck_snapshot", "arguments": {"jas": true}}' # Sonnet mode
|
|
249
|
+
eck-snapshot '{"name": "eck_snapshot", "arguments": {"jao": true}}' # Opus mode
|
|
250
|
+
eck-snapshot '{"name": "eck_snapshot", "arguments": {"jaz": true}}' # GLM/OpenCode mode
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Each mode generates a snapshot with tailored AI headers and updates the corresponding agent config file (`CLAUDE.md` for jas/jao, `AGENTS.md` for jaz).
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 💡 The Philosophy: Why force a full snapshot?
|
|
258
|
+
|
|
259
|
+
LLMs work like humans who have memorized a textbook. Giving an AI a "file search" tool is like putting a beginner next to a bookshelf — they have to guess what to look for. Forcing a complete project snapshot into the LLM's massive context window is like giving it a university degree in your specific codebase. That is what `eck-snapshot` does.
|
|
260
|
+
|
|
261
|
+
## Ethical Automation Policy
|
|
262
|
+
|
|
263
|
+
This project respects the Terms of Service of AI providers. We do not implement browser automation to bypass or spoof web chat interfaces intended for human use. All AI integrations use official APIs.
|
|
264
|
+
|
|
265
|
+
## License
|
|
266
|
+
MIT © xelth-com
|
|
267
|
+
<div align="right"><sup>made in Eschborn</sup></div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xelth/eck-snapshot",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A powerful CLI tool to create and restore single-file text snapshots of Git repositories
|
|
3
|
+
"version": "6.4.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
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"llm",
|
|
8
|
+
"mcp",
|
|
9
|
+
"snapshot",
|
|
10
|
+
"context",
|
|
11
|
+
"claude",
|
|
12
|
+
"gemini",
|
|
13
|
+
"grok",
|
|
14
|
+
"chatgpt",
|
|
15
|
+
"agent",
|
|
16
|
+
"prompt"
|
|
17
|
+
],
|
|
5
18
|
"main": "index.js",
|
|
6
19
|
"type": "module",
|
|
7
20
|
"bin": {
|
package/scripts/mcp-eck-core.js
CHANGED
|
@@ -23,9 +23,23 @@ const server = new Server(
|
|
|
23
23
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
24
24
|
return {
|
|
25
25
|
tools: [
|
|
26
|
+
{
|
|
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
|
+
},
|
|
26
40
|
{
|
|
27
41
|
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.
|
|
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, JSON.stringify({ name: "eck_update_auto", arguments: { fail: true } })], { 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();
|
|
@@ -68,7 +116,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
68
116
|
|
|
69
117
|
// 4. Auto Update Snapshot
|
|
70
118
|
const cliPath = path.join(PROJECT_ROOT, "index.js");
|
|
71
|
-
const { stdout } = await execa("node", [cliPath, "
|
|
119
|
+
const { stdout } = await execa("node", [cliPath, JSON.stringify({ name: "eck_update_auto" })], { cwd: workDir, timeout: 120000 });
|
|
72
120
|
|
|
73
121
|
let result;
|
|
74
122
|
try {
|
|
@@ -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));
|