Commit graph

31 commits

Author SHA1 Message Date
c1560e108d Harden hostd auth and operator password hashing
---
Build: pass | Tests: FAIL — 4 failed (pre-existing controlplane-api tenant fixture cases)
2026-05-03 06:50:06 +02:00
96f7ffb06e TTS: avoid node-edge-tts dependency (use edge-tts CLI)
---

Build: pass | Tests: pass — 1556 passed (94 files)
2026-04-19 13:17:31 +00:00
4315ef3f63 feat(telegram): add TTS voice replies via Microsoft Edge TTS
Add text-to-speech synthesis for Telegram voice notes using node-edge-tts.
Voice: en-US-JennyMultilingualNeural (multilingual EN+SL). Output format:
ogg-24khz-16bit-mono-opus (Telegram-native voice bubble). Configurable
auto-mode: always (default), inbound, tagged, off. Strip markdown before
synthesis. Truncate to 1500 chars. sendVoice with path traversal guard and
VOICE_MESSAGES_FORBIDDEN fallback.

---
Build: pass | Tests: pass — 19 passed (1 file) (Sam & Claude)
2026-04-19 15:12:04 +02:00
326e862005 feat(phase3): add 8 pi extension tools to clawdie-harness
Tools registered via ExtensionAPI.registerTool() (TypeBox schemas):
- jail_status: structured jail list from bastille-list (not raw text)
- system_health: composite — jails + ZFS + PF in one call
- skills_search: fuzzy search library.yaml, returns SKILL.md content inline
- skills_content: get full SKILL.md for a known skill id
- task_create: create controlplane task for specialist delegation
- task_status: check task status or list recent tasks
- hostd: privileged op passthrough (15 ops, safety rules apply)

Also adds @sinclair/typebox@0.34.49 (matches pi's bundled version) and a
tsconfig for the extension directory to resolve the global pi package.

Pre-existing type errors in original index.ts (ctx.ui) left untouched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  942 passed (942)

---
Build: pass | Tests: FAIL — Tests  40 failed | 766 passed (806)
2026-04-13 23:18:41 +00:00
c19e08758b Refactor harness extension safety model and add runner tests
---
Build: pass | Tests: pass — Tests  873 passed (873)
2026-04-11 14:47:18 +00:00
8e661311b5 feat(db): migrate SQLite to Postgres OPS_DB (Sam & Claude)
Replace better-sqlite3 with pg Pool for all operational data (chats,
messages, tasks, sessions, router_state, registered_groups). New
OPS_DB_URL config drives a dedicated ops database alongside the
existing memory and skills databases.

All db.ts functions are now async. Callers in src/, setup/, and tests
updated accordingly. Tests use a mock pool (src/test-helpers.ts) so
they run without a live Postgres connection.

---
Build: pass | Tests: not run (Linux)
2026-04-11 12:21:27 +02:00
325d74b676 fix: resolve Better Auth deps 2026-04-08 18:49:30 +00:00
e221be0095 Rename agent-executor → controlplane-runner (Sam & ZAI) 2026-04-07 16:34:04 +02:00
2e682ae4e0 chore(release): v1.0.2 (Sam & Codex)
- Bump package version to 1.0.2

- Add 1.0.2 changelog entry

---

Build: pass | Tests: pass — 603 passed (44 files)

---
Build: pass | Tests: pass — Tests  603 passed (603)
2026-04-03 09:38:54 +00:00
e73afafbb2 feat: switch embeddings to OpenAI text-embedding-3-small; add embed-docs.py
- embed-docs.py: new script to batch-embed project docs into klavdija_brain
  (37 docs → 852 chunks with session_id pattern doc:<path>)
- import-memories.py: updated embed() to send Authorization header and
  dimensions=1024 parameter for OpenAI/configurable provider support
- memories-transfer-v2.json: recovered historical session memories (local copy)
- package.json: add @supabase/supabase-js dependency
- src/channels/telegram.ts, src/config.ts: Telegram channel integration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-28 20:44:09 +00:00
1292449526 v0.3.0 - From Manual Setup to Guided Wizard 🧙
## Headline Features

- Setup wizard: FreeBSD bsdinstall-style TUI for first-time setup
- Project-relative tmp/: No more /tmp usage
- Infrastructure as code: Ansible reads all IPs from .env
- Password-protected-site: Auto-generated htpasswd during wizard

## Attribution

This release was made possible with assistance from:

AI Systems: Openclaw, NanoClaw, z.ai, Anthropic Claude, OpenAI Codex, OpenRouter, Deepseek, Groq, Ollama, pi-tui

Human: Peter Steinberger
2026-03-10 20:35:42 +00:00
b6c7ca6399 Internal IP and domain redesign
Replace all hardcoded IPs (192.168.100.x) and domains (clawdie.si)
with configurable placeholders. Real values now live exclusively in
.env (gitignored).

Network: code defaults to 10.0.0.x, configurable via WARDEN_SUBNET_BASE,
WARDEN_GATEWAY, WARDEN_CONTROL_PLANE_IP env vars in jail-config.ts.

Domain: code defaults to clawdie.local, configurable via CLAWDIE_DOMAIN
env var. Subdomain scheme: controlplane/db/cms/gui.{domain}.

Also includes PGVector Phase 0 prep:
- Created ai_brain database with pgvector extensions
- Added pg + @types/pg npm packages
- Added CLAWDIE_DB_URL to .env
- Renamed db from 'clawdie' to 'ai_brain' across Ansible and docs
- Resolved embedding model: OpenRouter text-embedding-3-large at 1536d
- Added docs/pgvector-install-log.md

Renamed ai.clawdie.si → controlplane.{domain} (more descriptive).
Renamed vm.clawdie.si → gui.{domain}.

76 files updated across source, tests, skills, docs, Ansible, and scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 09:21:44 +00:00
Clawdie
f4d4f28d23 Release 0.2.0 milestone 2026-03-08 20:11:24 +01:00
Clawdie
daa3d1256b Fix VNET gateway provisioning and bump version 2026-03-08 17:38:07 +01:00
Clawdie
609673f2b8 Rename root package to controlplane 2026-03-08 14:31:12 +01:00
Clawdie
4e394d6194 Fix build imports and setup branding 2026-03-07 22:03:41 +01:00
Clawdie
4fccff3f4e refactor: replace WhatsApp with Telegram, rename container→jail, migrate skills to .agent/
- Replace WhatsApp channel (@whiskeysockets/baileys) with Telegram (grammy)
  - Add src/channels/telegram.ts, remove src/channels/whatsapp.ts + whatsapp-auth.ts
  - TELEGRAM_BOT_TOKEN required; fatal exit if not set
  - Remove @whiskeysockets/baileys, qrcode, qrcode-terminal packages
  - Update routing tests to use tg: JID format

- Rename container→jail throughout src/
  - container-runner.ts → jail-runner.ts (jexec-based spawn)
  - container-runtime.ts → jail-ops.ts (stopJail, ensureJailRunning, cleanupStaleJails)
  - Add jail-config.ts, jail-runtime.ts for FreeBSD jail provisioning
  - Rename config exports: CONTAINER_TIMEOUT→JAIL_TIMEOUT, MAX_CONCURRENT_CONTAINERS→MAX_CONCURRENT_JAILS
  - Update group-queue.ts: isTaskContainer→isTaskJail, activeContainers→activeJails

- Migrate skills from .claude/skills/ to .agent/skills/
  - Add tmux-screenshot skill (ANSI color PNG renderer, wide-char fix, 24-bit truecolor)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 18:36:27 +01:00
github-actions[bot]
d897ad4973 chore: bump version to 1.1.3 2026-02-25 21:13:50 +00:00
Gabi Simons
c57d2afcc0 refactor: remove deterministic caching system from skills engine (#453) 2026-02-24 15:49:29 +02:00
github-actions[bot]
78f3fe7fbd chore: bump version to 1.1.2 2026-02-24 05:04:43 +00:00
github-actions[bot]
3325de4c44 chore: bump version to 1.1.1 2026-02-24 04:56:55 +00:00
gavrielc
9d9db52131 chore: bump version to 1.1.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 02:05:42 +02:00
gavrielc
6e10deecc8 Skills engine v0.1 + multi-channel infrastructure (#307)
* refactor: multi-channel infrastructure with explicit channel/is_group tracking

- Add channels[] array and findChannel() routing in index.ts, replacing
  hardcoded whatsapp.* calls with channel-agnostic callbacks
- Add channel TEXT and is_group INTEGER columns to chats table with
  COALESCE upsert to protect existing values from null overwrites
- is_group defaults to 0 (safe: unknown chats excluded from groups)
- WhatsApp passes explicit channel='whatsapp' and isGroup to onChatMetadata
- getAvailableGroups filters on is_group instead of JID pattern matching
- findChannel logs warnings instead of silently dropping unroutable JIDs
- Migration backfills channel/is_group from JID patterns for existing DBs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: skills engine v0.1 — deterministic skill packages with rerere resolution

Three-way merge engine for applying skill packages on top of a core
codebase. Skills declare which files they add/modify, and the engine
uses git merge-file for conflict detection with git rerere for
automatic resolution of previously-seen conflicts.

Key components:
- apply: three-way merge with backup/rollback safety net
- replay: clean-slate replay for uninstall and rebase
- update: core version updates with deletion detection
- rebase: bake applied skills into base (one-way)
- manifest: validation with path traversal protection
- resolution-cache: pre-computed rerere resolutions
- structured: npm deps, env vars, docker-compose merging
- CI: per-skill test matrix with conflict detection

151 unit tests covering merge, rerere, backup, replay, uninstall,
update, rebase, structured ops, and edge cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add Discord and Telegram skill packages

Skill packages for adding Discord and Telegram channels to NanoClaw.
Each package includes:
- Channel implementation (add/src/channels/)
- Three-way merge targets for index.ts, config.ts, routing.test.ts
- Intent docs explaining merge invariants
- Standalone integration tests
- manifest.yaml with dependency/conflict declarations

Applied via: npx tsx scripts/apply-skill.ts .claude/skills/add-discord
These are inert until applied — no runtime impact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* remove unused docs (skills-system-status, implementation-guide)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 01:55:00 +02:00
gavrielc
add0dfc136 feat: add setup skill with scripted steps (#258)
Replace inline SKILL.md instructions with executable shell scripts
for each setup phase (environment check, deps, container, auth,
groups, channels, mounts, service, verify). Scripts emit structured
status blocks for reliable parsing.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 00:23:49 +02:00
gavrielc
ab27f95e32 Refactor index (#156)
* feat: add Telegram channel with agent swarm support

Add Telegram as a messaging channel that can run alongside WhatsApp
or standalone (TELEGRAM_ONLY mode). Includes bot pool support for
agent swarms where each subagent appears as a different bot identity
in the group.

- Add grammy dependency for Telegram Bot API
- Route messages through tg: JID prefix convention
- Add storeMessageDirect for non-Baileys channels
- Add sender field to IPC send_message for swarm identity
- Support TELEGRAM_BOT_TOKEN, TELEGRAM_ONLY, TELEGRAM_BOT_POOL config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add index.ts refactor plan

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: extract channel abstraction, IPC, and router from index.ts

Break the 1088-line monolith into focused modules:
- src/channels/whatsapp.ts: WhatsAppChannel class implementing Channel interface
- src/ipc.ts: IPC watcher and task processing with dependency injection
- src/router.ts: message formatting, outbound routing, channel lookup
- src/types.ts: Channel interface, OnInboundMessage, OnChatMetadata types

Also adds regression test suite (98 tests), updates all documentation
and skill files to reflect the new architecture.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ci: add test workflow for PRs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: remove accidentally committed pool-bot assets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ci): remove grammy from base dependencies

Grammy is installed by the /add-telegram skill, not a base dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:36:37 +02:00
gavrielc
f9417ba179 Add prettier
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:14:17 +02:00
gavrielc
cd83b06a8a Add container output size limiting to prevent memory issues (#18)
* Fix potential memory DoS via unbounded container output

Add CONTAINER_MAX_OUTPUT_SIZE (default 10MB) to limit accumulated
stdout/stderr from container processes. Without this limit, a malicious
or buggy container could emit huge output leading to host memory
exhaustion.

Changes:
- Add configurable CONTAINER_MAX_OUTPUT_SIZE in config.ts
- Implement size-limited output buffering in runContainerAgent
- Log warnings when truncation occurs
- Include truncation status in container logs

https://claude.ai/code/session_01TjVDwwaGwbcFDdmrFF2y8B

* Update package-lock.json

https://claude.ai/code/session_01TjVDwwaGwbcFDdmrFF2y8B

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-01 23:09:50 +02:00
gavrielc
fa13b14dae Add built-in scheduler with group-scoped tasks
- Custom nanoclaw MCP server with scheduling tools (schedule_task,
  list_tasks, get_task, update_task, pause/resume/cancel_task, send_message)
- Tasks run as full agents in their group's context
- Support for cron, interval, and one-time schedules
- Task run logging with duration and results
- Main channel has Bash access for admin tasks (query DB, manage groups)
- Other groups restricted to file operations only
- Updated docs and requirements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:00:37 +02:00
gavrielc
8a385c7988 Separate WhatsApp auth from daemon into standalone script
- Add src/auth.ts for interactive QR code authentication
- Add `npm run auth` script
- Update setup skill for current Node.js architecture
- Daemon (src/index.ts) now only uses stored credentials

Auth is run during setup; daemon assumes credentials exist and
shows macOS notification if re-auth is needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:06:25 +02:00
gavrielc
e1867f8d27 Replace QR code display with macOS notification
The daemon should never show interactive QR codes. If auth is needed,
send a macOS notification alerting the user to run /setup, then exit.

Also removes unused qrcode-terminal dependency.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:01:41 +02:00
gavrielc
c17823a732 Initial commit: NanoClaw - Personal Claude assistant via WhatsApp
A minimal Node.js application that connects Claude Agent SDK to WhatsApp
using baileys. Features per-group memory via CLAUDE.md files, session
continuity, scheduled tasks, and Gmail integration via MCP.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:54:24 +02:00