@tractorscorch/clank 1.4.1 → 1.4.4
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/CHANGELOG.md +223 -205
- package/README.md +189 -172
- package/dist/index.js +36 -20
- package/dist/index.js.map +1 -1
- package/package.json +58 -58
package/CHANGELOG.md
CHANGED
|
@@ -1,205 +1,223 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to Clank will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## [1.4.
|
|
10
|
-
|
|
11
|
-
###
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **Rate
|
|
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
|
-
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Clank will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## [1.4.4] — 2026-03-22
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- **Gateway crash after 4-5 messages** — confirmation handler WebSocket listeners were never removed on timeout, accumulating orphaned handlers per message until the process crashed
|
|
13
|
+
- **Engine listener limit** — set `maxListeners` to 30 on AgentEngine (Node.js default of 10 was too low since each message cycle wires 10 event listeners)
|
|
14
|
+
- **Rate limiter memory leak** — stale session entries in the rate limiter Map were never purged; added periodic cleanup when map exceeds 100 entries
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## [1.4.3] — 2026-03-22
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **Telegram streaming stutter** — fixed race condition where multiple partial messages were sent instead of editing a single message; added synchronous guard flag to prevent duplicate `sendMessage` calls while the initial message promise is in-flight
|
|
22
|
+
- **Gateway killed by `clear` on Windows** — replaced `fork()` with `spawn()` + `windowsHide` for background gateway process; `fork` kept an IPC channel tied to the parent console, so clearing PowerShell killed the gateway
|
|
23
|
+
- **`clank update` fails on Windows** — added `--force` to the npm install command to overwrite locked shim files (`clank.ps1`, `clank.cmd`)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## [1.4.1] — 2026-03-23
|
|
28
|
+
|
|
29
|
+
### Security
|
|
30
|
+
- **Config get redaction** — `config get` action now redacts sensitive keys (apiKey, token, botToken) before returning to LLM context
|
|
31
|
+
- **Config set protection** — config tool now blocks prototype pollution (`__proto__`, `constructor`, `prototype`)
|
|
32
|
+
- **Rate limit streaming path** — `handleInboundMessageStreaming` now enforced (was bypassing rate limiter)
|
|
33
|
+
- **SSRF private IPs** — web_fetch now blocks RFC 1918 ranges (10.x, 192.168.x, 172.16-31.x) and IPv4-mapped IPv6
|
|
34
|
+
- **STT workspace containment** — speech_to_text tool now uses guardPath() to prevent reading files outside workspace
|
|
35
|
+
|
|
36
|
+
### Audit Result
|
|
37
|
+
- 0 dependency vulnerabilities
|
|
38
|
+
- 14 PASS, 1 WARN (bash blocklist is defense-in-depth), 0 FAIL
|
|
39
|
+
- Grade: A
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## [1.4.0] — 2026-03-23
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- **Telegram streaming** — responses edit in real-time as tokens arrive (800ms interval, respects rate limits)
|
|
47
|
+
- **Telegram image handling** — send photos to the bot, routed to agent with image URL
|
|
48
|
+
- **Telegram document handling** — send files to the bot, saved to temp with sanitized filenames, agent can read them
|
|
49
|
+
- **File share tool** — `share_file` lets the agent send workspace files through channels (workspace containment enforced)
|
|
50
|
+
- **Per-agent voice** — each agent can have its own ElevenLabs voice ID in config
|
|
51
|
+
- **Compact prompt mode** — `compactPrompt: true` strips workspace files for small model context optimization
|
|
52
|
+
- **Thinking control** — `thinking: "off"` suppresses extended reasoning for faster responses
|
|
53
|
+
- **Auto-memory persistence** — "remember X", preference statements, and corrections auto-saved to MEMORY.md
|
|
54
|
+
- **Web UI session history** — loads last 50 messages on connect and session switch
|
|
55
|
+
- **Rate limiting** — 20 messages per minute per session, prevents model flooding
|
|
56
|
+
|
|
57
|
+
### Improved
|
|
58
|
+
- **Model retry** — one retry with 2s backoff on transient connection failures
|
|
59
|
+
- **Session resume compaction** — auto-compacts on load if over context budget
|
|
60
|
+
- **Memory persistence instruction** — system prompt now encourages the agent to save learnings
|
|
61
|
+
|
|
62
|
+
### Security
|
|
63
|
+
- Telegram document uploads: filename sanitized (path traversal protection), 10MB size limit
|
|
64
|
+
- File share tool: workspace containment via guardPath
|
|
65
|
+
- Rate limiting prevents denial-of-service via message flooding
|
|
66
|
+
- Per-agent voice IDs read from config only (not from user input)
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## [1.3.1] — 2026-03-23
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
- **STT not working** — local whisper.cpp was selected by default but not installed. Added Groq as the recommended free STT provider (whisper-large-v3-turbo).
|
|
74
|
+
- **STT provider priority:** Groq (free, fast) → OpenAI Whisper → local whisper.cpp
|
|
75
|
+
- **Setup wizard:** STT now offers Groq as option 1 (recommended), OpenAI as option 2, local as option 3
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## [1.3.0] — 2026-03-23
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
- **ElevenLabs integration** — text-to-speech via ElevenLabs API, configurable during onboarding
|
|
83
|
+
- **Whisper integration** — speech-to-text via OpenAI Whisper API or local whisper.cpp
|
|
84
|
+
- **Voice tools (3):** `text_to_speech`, `speech_to_text`, `list_voices` — agent can generate and transcribe audio
|
|
85
|
+
- **Telegram voice messages** — send a voice message → auto-transcribed via Whisper → routed to agent → response as voice (ElevenLabs) or text
|
|
86
|
+
- **Integrations config section** — unified config for third-party API services (ElevenLabs, Whisper, image gen, extensible)
|
|
87
|
+
- **Setup wizard integrations step** — configure ElevenLabs, Whisper, and other API services during onboarding
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
- Tool count: 21 total (10 core + 11 self-config/voice)
|
|
91
|
+
- Setup wizard now asks about integrations for all users (not just advanced mode)
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## [1.2.1] — 2026-03-23
|
|
96
|
+
|
|
97
|
+
### Fixed
|
|
98
|
+
- **Gateway crash on restart** — stale Telegram messages queued while offline no longer flood the model. Messages older than 30s before startup are dropped.
|
|
99
|
+
- **Parallel model overload** — Telegram messages from the same chat are now processed sequentially (per-chat queue) instead of all at once.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## [1.2.0] — 2026-03-22
|
|
104
|
+
|
|
105
|
+
### Added
|
|
106
|
+
- **Two-tier context compaction** — critical for local model performance:
|
|
107
|
+
- Tier 1 (fast): system prompt budgeting, tool result dedup, message truncation, aggressive dropping
|
|
108
|
+
- Tier 2 (LLM-summarized): model generates conversation recap replacing oldest messages. Preserves meaning over long sessions.
|
|
109
|
+
- Token budgeting: reserves 25% for response, budgets system prompt separately from conversation
|
|
110
|
+
- **`clank update`** — update to latest npm version, preserves config/sessions/memory, restarts gateway
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## [1.1.0] — 2026-03-22
|
|
115
|
+
|
|
116
|
+
### Security Hardening
|
|
117
|
+
- **Bash tool:** expanded blocklist from 5 to 25 patterns — covers flag variations, shell-in-shell, encoded payloads, PowerShell, system damage commands
|
|
118
|
+
- **Path traversal:** all file tools (read, write, edit, list, search, glob) now enforce workspace containment via `guardPath()` — blocks absolute paths and `../` traversal outside workspace
|
|
119
|
+
- **Config redaction:** API keys, bot tokens, and auth tokens are stripped from config before exposing to LLM context or WebSocket clients
|
|
120
|
+
- **Prototype pollution:** config.set RPC blocks `__proto__`, `constructor`, `prototype` keys
|
|
121
|
+
- **SSRF protection:** web_fetch blocks localhost, cloud metadata endpoints (169.254.169.254), .internal/.local hostnames, file:// protocol
|
|
122
|
+
- **Gateway auth:** auto-generates token on startup if mode is "token" but no token configured — prevents accidental open gateways
|
|
123
|
+
- **Status endpoint:** /status now requires Bearer token authentication
|
|
124
|
+
- **Tool confirmations:** gateway respects autoApprove config instead of blindly approving — 30s timeout defaults to deny
|
|
125
|
+
- **.gitignore:** added config.json5, *.pem, *.key, credentials.json to prevent accidental secret commits
|
|
126
|
+
|
|
127
|
+
### Bug Fixes
|
|
128
|
+
- **Telegram bot not responding:** `bot.start()` was blocking (awaited) which prevented the gateway from finishing startup. Now runs non-blocking with `onStart` callback.
|
|
129
|
+
- **Telegram allowFrom:** now matches both `@username` and numeric user IDs (was only matching numeric)
|
|
130
|
+
- **grammY missing:** added as real dependency (was dynamic import that failed silently)
|
|
131
|
+
- **Local server URL not saved:** setup wizard now saves detected server baseUrl for all local providers (was only saving Ollama)
|
|
132
|
+
- **Port conflict:** default port changed to 18790 (was 18789, conflicted with OpenClaw/Claude Code)
|
|
133
|
+
- **--web flag:** `clank chat --web` now auto-starts gateway and opens browser
|
|
134
|
+
- **Gateway text/message param:** accepts both `message` and `text` fields from clients
|
|
135
|
+
|
|
136
|
+
### Added
|
|
137
|
+
- **TUI:** rich terminal UI with streaming, tool cards, thinking blocks, agent/session/model pickers, slash commands, shell integration (`!command`)
|
|
138
|
+
- **Web Control UI:** 8-panel dashboard — Chat, Agents, Sessions, Config (JSON editor), Pipelines, Cron, Logs, Channels
|
|
139
|
+
- **Telegram slash commands:** /help, /status, /agents, /agent, /sessions, /new, /reset, /model, /think
|
|
140
|
+
- **CLI commands:** tui, dashboard, pipeline, cron, channels, uninstall
|
|
141
|
+
- **Background gateway:** runs as detached process, Telegram/Discord stay alive while CLI/TUI/Web run on top
|
|
142
|
+
- **Gateway singleton:** refuses to start if already running on the port
|
|
143
|
+
- **Self-config tools (8):** config, manage_channel, manage_agent, manage_model, manage_session, manage_cron, gateway_status, send_message
|
|
144
|
+
- **Google Gemini provider** with streaming and function calling
|
|
145
|
+
- **Memory system:** TF-IDF cosine similarity with decay scoring, categorized storage
|
|
146
|
+
- **Encryption:** AES-256-GCM for API keys, PIN hashing with timing-safe comparison
|
|
147
|
+
- **Web search:** Brave Search API integration
|
|
148
|
+
- **Config hot-reload:** watches config.json5 for changes
|
|
149
|
+
- **`clank uninstall`:** removes all data, daemon, and npm package
|
|
150
|
+
|
|
151
|
+
### Changed
|
|
152
|
+
- Default command (`clank` with no args) starts gateway in background then launches TUI
|
|
153
|
+
- `clank gateway start` now runs in background by default (`--foreground` for blocking mode)
|
|
154
|
+
- `clank gateway restart` fully implemented (stop + start)
|
|
155
|
+
- Protocol updated to v1 spec with 17 RPC methods and 11 event types
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## [1.0.0] — 2026-03-22
|
|
160
|
+
|
|
161
|
+
Initial release — Clank Gateway foundation.
|
|
162
|
+
|
|
163
|
+
### Architecture
|
|
164
|
+
- Single gateway daemon (HTTP + WebSocket on port 18789)
|
|
165
|
+
- WebSocket JSON-RPC protocol v1 with 17 RPC methods and 11 event types
|
|
166
|
+
- All interfaces are equal — CLI, TUI, Web UI, Telegram, Discord
|
|
167
|
+
|
|
168
|
+
### Engine
|
|
169
|
+
- AgentEngine with ReAct loop (stream → tool calls → execute → loop, max 50 iterations)
|
|
170
|
+
- Pluggable ContextEngine with compaction optimized for local models (60% threshold vs 80% cloud)
|
|
171
|
+
- Tool tiering: full/core/auto — reduces tool count for smaller models
|
|
172
|
+
- PromptFallbackProvider for models without native function calling
|
|
173
|
+
|
|
174
|
+
### Providers
|
|
175
|
+
- Ollama (primary) — auto-detect, dynamic context window, tool support checking
|
|
176
|
+
- Anthropic Claude — Messages API with SSE streaming
|
|
177
|
+
- OpenAI — also covers LM Studio, vLLM, llama.cpp (OpenAI-compatible)
|
|
178
|
+
- Google Gemini — streaming with function calling
|
|
179
|
+
- Provider router with fallback chain and local server auto-detection
|
|
180
|
+
- Reasoning/thinking content support (Qwen, DeepSeek, etc.)
|
|
181
|
+
|
|
182
|
+
### Tools (18 total)
|
|
183
|
+
- **Core (10):** read_file, write_file, edit_file, list_directory, search_files, glob_files, bash, git, web_search (Brave), web_fetch
|
|
184
|
+
- **Self-config (8):** config, manage_channel, manage_agent, manage_model, manage_session, manage_cron, gateway_status, send_message
|
|
185
|
+
|
|
186
|
+
### Interfaces
|
|
187
|
+
- **CLI:** 12 commands — chat, gateway, setup, fix, models, agents, daemon, tui, dashboard, pipeline, cron, channels
|
|
188
|
+
- **TUI:** Rich terminal UI with streaming, tool cards, thinking blocks, agent/session/model pickers, slash commands, shell integration
|
|
189
|
+
- **Web Control UI:** 8-panel SPA — Chat, Agents, Sessions, Config (JSON editor), Pipelines, Cron, Logs, Channels
|
|
190
|
+
- **Telegram:** Full adapter with slash commands, typing indicators, response chunking, permission allowlists, group mention checking
|
|
191
|
+
- **Discord:** Full adapter with typing, reply threading, response chunking
|
|
192
|
+
|
|
193
|
+
### Multi-Agent
|
|
194
|
+
- Named agents with separate models, workspaces, and tool access
|
|
195
|
+
- Config-driven routing with binding priority tiers (peer → guild → team → channel → default)
|
|
196
|
+
- Normalized session keys for cross-channel continuity (dm:telegram:123, cli:main, etc.)
|
|
197
|
+
|
|
198
|
+
### Systems
|
|
199
|
+
- **Memory:** TF-IDF cosine similarity with decay scoring, categorized storage (identity/knowledge/lessons/context)
|
|
200
|
+
- **Sessions:** JSON transcript persistence, prune/cap/reset, cross-channel shared sessions
|
|
201
|
+
- **Config:** JSON5 with env var substitution, hot-reload watcher, defaults with deep merge
|
|
202
|
+
- **Cron:** JSONL job store, 30s tick interval, run logging, retry tracking
|
|
203
|
+
- **Pipelines:** Sequential step execution with agent handoffs, state persistence
|
|
204
|
+
- **Plugins:** Discovery (~/.clank/plugins/ + node_modules/clank-plugin-*), 25+ hook types
|
|
205
|
+
- **Heartbeat:** Periodic probes from HEARTBEAT.md, quiet hours
|
|
206
|
+
- **Voice:** TTS (ElevenLabs + piper), STT (whisper.cpp)
|
|
207
|
+
- **Daemon:** Cross-platform service — macOS (launchd), Windows (Task Scheduler), Linux (systemd)
|
|
208
|
+
|
|
209
|
+
### Security
|
|
210
|
+
- AES-256-GCM encryption for API keys (PBKDF2, 100K iterations)
|
|
211
|
+
- PIN verification with timing-safe comparison
|
|
212
|
+
- 3-tier tool safety system (low/medium/high) with auto-approve settings
|
|
213
|
+
- Gateway binds to localhost by default, token-based auth
|
|
214
|
+
|
|
215
|
+
### Onboarding
|
|
216
|
+
- `clank setup` wizard — Quick Start (under 2 minutes) and Advanced flows
|
|
217
|
+
- Auto-detects local model servers (Ollama, LM Studio, llama.cpp, vLLM)
|
|
218
|
+
- Configures cloud providers, Telegram, Discord, Brave Search, voice, agents
|
|
219
|
+
- `clank fix` diagnostics with auto-repair
|
|
220
|
+
|
|
221
|
+
### Workspace
|
|
222
|
+
- Bootstrap templates: SOUL.md, USER.md, IDENTITY.md, BOOTSTRAP.md, AGENTS.md, TOOLS.md, MEMORY.md, HEARTBEAT.md
|
|
223
|
+
- System prompt builder loads workspace files + project context (.clank.md)
|