v2: make v2 the main entry point, move v1 to src/v1/

- Move all v1 files (index, router, container-runner, db, ipc, types,
  logger, channels/registry, and all utilities) to src/v1/ as a
  fully self-contained archive with no shared dependencies
- Rename v2 files to remove -v2 suffix (index-v2.ts → index.ts, etc.)
- Update all imports across v2 source, tests, and setup files
- Migrate shared utilities (config, env, container-runtime, mount-security,
  timezone, group-folder) from pino logger to v2 log module
- Migrate setup/ files from logger to log with argument order swap
- Container agent-runner: move v1 entry to v1/, rename v2 to index.ts
- Update setup skill to offer all 13 v2 channels
- Install all Chat SDK adapter packages
- dist/index.js now runs v2; dist/v1/index.js runs v1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-04-09 11:40:36 +03:00
parent 12af451069
commit 9486d56b01
96 changed files with 7904 additions and 3040 deletions

View File

@@ -0,0 +1 @@
{"sessionId":"56e89c33-b844-4e6a-8df3-2210b2fb4a4d","pid":47993,"acquiredAt":1775696579277}

View File

@@ -9,7 +9,7 @@ This skill adds Google Chat support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/gchat-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/gchat.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @chat-adapter/gchat
Uncomment the Google Chat import in `src/channels/index.ts`:
```typescript
import './gchat-v2.js';
import './gchat.js';
```
### Build
@@ -72,7 +72,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './gchat-v2.js'` in `src/channels/index.ts`
1. Comment out `import './gchat.js'` in `src/channels/index.ts`
2. Remove `GCHAT_CREDENTIALS` from `.env`
3. `npm uninstall @chat-adapter/gchat`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds GitHub support to NanoClaw v2 using the Chat SDK bridge. The age
## Phase 1: Pre-flight
Check if `src/channels/github-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/github.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @chat-adapter/github
Uncomment the GitHub import in `src/channels/index.ts`:
```typescript
import './github-v2.js';
import './github.js';
```
### Build
@@ -74,7 +74,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './github-v2.js'` in `src/channels/index.ts`
1. Comment out `import './github.js'` in `src/channels/index.ts`
2. Remove `GITHUB_TOKEN` and `GITHUB_WEBHOOK_SECRET` from `.env`
3. `npm uninstall @chat-adapter/github`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds iMessage support to NanoClaw v2 using the Chat SDK bridge. Suppo
## Phase 1: Pre-flight
Check if `src/channels/imessage-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/imessage.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install chat-adapter-imessage
Uncomment the iMessage import in `src/channels/index.ts`:
```typescript
import './imessage-v2.js';
import './imessage.js';
```
### Build
@@ -80,7 +80,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './imessage-v2.js'` in `src/channels/index.ts`
1. Comment out `import './imessage.js'` in `src/channels/index.ts`
2. Remove iMessage env vars from `.env`
3. `npm uninstall chat-adapter-imessage`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds Linear support to NanoClaw v2 using the Chat SDK bridge. The age
## Phase 1: Pre-flight
Check if `src/channels/linear-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/linear.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @chat-adapter/linear
Uncomment the Linear import in `src/channels/index.ts`:
```typescript
import './linear-v2.js';
import './linear.js';
```
### Build
@@ -71,7 +71,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './linear-v2.js'` in `src/channels/index.ts`
1. Comment out `import './linear.js'` in `src/channels/index.ts`
2. Remove `LINEAR_API_KEY` and `LINEAR_WEBHOOK_SECRET` from `.env`
3. `npm uninstall @chat-adapter/linear`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds Matrix support to NanoClaw v2 using the Chat SDK bridge. Works w
## Phase 1: Pre-flight
Check if `src/channels/matrix-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/matrix.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @beeper/chat-adapter-matrix
Uncomment the Matrix import in `src/channels/index.ts`:
```typescript
import './matrix-v2.js';
import './matrix.js';
```
### Build
@@ -71,7 +71,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './matrix-v2.js'` in `src/channels/index.ts`
1. Comment out `import './matrix.js'` in `src/channels/index.ts`
2. Remove `MATRIX_BASE_URL`, `MATRIX_ACCESS_TOKEN`, `MATRIX_USER_ID`, `MATRIX_BOT_USERNAME` from `.env`
3. `npm uninstall @beeper/chat-adapter-matrix`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds email support via Resend to NanoClaw v2 using the Chat SDK bridg
## Phase 1: Pre-flight
Check if `src/channels/resend-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/resend.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @resend/chat-sdk-adapter
Uncomment the Resend import in `src/channels/index.ts`:
```typescript
import './resend-v2.js';
import './resend.js';
```
### Build
@@ -73,7 +73,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './resend-v2.js'` in `src/channels/index.ts`
1. Comment out `import './resend.js'` in `src/channels/index.ts`
2. Remove `RESEND_API_KEY`, `RESEND_FROM_ADDRESS`, `RESEND_FROM_NAME`, `RESEND_WEBHOOK_SECRET` from `.env`
3. `npm uninstall @resend/chat-sdk-adapter`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds Slack support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/slack-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/slack.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @chat-adapter/slack
Uncomment the Slack import in `src/channels/index.ts`:
```typescript
import './slack-v2.js';
import './slack.js';
```
### Build
@@ -75,7 +75,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './slack-v2.js'` in `src/channels/index.ts`
1. Comment out `import './slack.js'` in `src/channels/index.ts`
2. Remove `SLACK_BOT_TOKEN` and `SLACK_SIGNING_SECRET` from `.env`
3. `npm uninstall @chat-adapter/slack`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds Microsoft Teams support to NanoClaw v2 using the Chat SDK bridge
## Phase 1: Pre-flight
Check if `src/channels/teams-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/teams.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @chat-adapter/teams
Uncomment the Teams import in `src/channels/index.ts`:
```typescript
import './teams-v2.js';
import './teams.js';
```
### Build
@@ -69,7 +69,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './teams-v2.js'` in `src/channels/index.ts`
1. Comment out `import './teams.js'` in `src/channels/index.ts`
2. Remove `TEAMS_APP_ID` and `TEAMS_APP_PASSWORD` from `.env`
3. `npm uninstall @chat-adapter/teams`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds Telegram support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/telegram-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/telegram.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @chat-adapter/telegram
Uncomment the Telegram import in `src/channels/index.ts`:
```typescript
import './telegram-v2.js';
import './telegram.js';
```
### Build
@@ -76,7 +76,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './telegram-v2.js'` in `src/channels/index.ts`
1. Comment out `import './telegram.js'` in `src/channels/index.ts`
2. Remove `TELEGRAM_BOT_TOKEN` from `.env`
3. `npm uninstall @chat-adapter/telegram`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds Cisco Webex support to NanoClaw v2 using the Chat SDK bridge.
## Phase 1: Pre-flight
Check if `src/channels/webex-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/webex.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @bitbasti/chat-adapter-webex
Uncomment the Webex import in `src/channels/index.ts`:
```typescript
import './webex-v2.js';
import './webex.js';
```
### Build
@@ -69,7 +69,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './webex-v2.js'` in `src/channels/index.ts`
1. Comment out `import './webex.js'` in `src/channels/index.ts`
2. Remove `WEBEX_BOT_TOKEN` and `WEBEX_WEBHOOK_SECRET` from `.env`
3. `npm uninstall @bitbasti/chat-adapter-webex`
4. Rebuild and restart

View File

@@ -9,7 +9,7 @@ This skill adds WhatsApp support via the official Meta WhatsApp Business Cloud A
## Phase 1: Pre-flight
Check if `src/channels/whatsapp-cloud-v2.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
Check if `src/channels/whatsapp-cloud.ts` exists and the import is uncommented in `src/channels/index.ts`. If both are in place, skip to Phase 3.
## Phase 2: Apply Code Changes
@@ -24,7 +24,7 @@ npm install @chat-adapter/whatsapp
Uncomment the WhatsApp Cloud API import in `src/channels/index.ts`:
```typescript
import './whatsapp-cloud-v2.js';
import './whatsapp-cloud.js';
```
### Build
@@ -76,7 +76,7 @@ launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
## Removal
1. Comment out `import './whatsapp-cloud-v2.js'` in `src/channels/index.ts`
1. Comment out `import './whatsapp-cloud.js'` in `src/channels/index.ts`
2. Remove `WHATSAPP_ACCESS_TOKEN`, `WHATSAPP_PHONE_NUMBER_ID`, `WHATSAPP_APP_SECRET`, `WHATSAPP_VERIFY_TOKEN` from `.env`
3. `npm uninstall @chat-adapter/whatsapp`
4. Rebuild and restart

View File

@@ -242,26 +242,43 @@ Verify the proxy starts: `npm run dev` should show "Credential proxy listening"
## 5. Set Up Channels
AskUserQuestion (multiSelect): Which messaging channels do you want to enable?
- WhatsApp (authenticates via QR code or pairing code)
- Telegram (authenticates via bot token from @BotFather)
- Slack (authenticates via Slack app with Socket Mode)
- Discord (authenticates via Discord bot token)
- Discord (bot token + public key)
- Slack (bot token + signing secret)
- Telegram (bot token from @BotFather)
- GitHub (PR/issue comment threads)
- Linear (issue comment threads)
- Microsoft Teams (Azure Bot)
- Google Chat (service account)
- WhatsApp Cloud API (Meta Business API)
- WhatsApp Baileys (QR code / pairing code)
- Resend (email)
- Matrix (any homeserver)
- Webex (bot token)
- iMessage (macOS local or Photon API)
**Delegate to each selected channel's own skill.** Each channel skill handles its own code installation, authentication, registration, and JID resolution. This avoids duplicating channel-specific logic and ensures JIDs are always correct.
**Delegate to each selected channel's own skill.** Each channel skill handles its own package installation, authentication, registration, and configuration. This avoids duplicating channel-specific logic.
For each selected channel, invoke its skill:
- **WhatsApp:** Invoke `/add-whatsapp`
- **Telegram:** Invoke `/add-telegram`
- **Slack:** Invoke `/add-slack`
- **Discord:** Invoke `/add-discord`
- **Slack:** Invoke `/add-slack-v2`
- **Telegram:** Invoke `/add-telegram-v2`
- **GitHub:** Invoke `/add-github-v2`
- **Linear:** Invoke `/add-linear-v2`
- **Microsoft Teams:** Invoke `/add-teams-v2`
- **Google Chat:** Invoke `/add-gchat-v2`
- **WhatsApp Cloud API:** Invoke `/add-whatsapp-cloud-v2`
- **WhatsApp Baileys:** Invoke `/add-whatsapp`
- **Resend:** Invoke `/add-resend-v2`
- **Matrix:** Invoke `/add-matrix-v2`
- **Webex:** Invoke `/add-webex-v2`
- **iMessage:** Invoke `/add-imessage-v2`
Each skill will:
1. Install the channel code (via `git merge` of the skill branch)
2. Collect credentials/tokens and write to `.env`
3. Authenticate (WhatsApp QR/pairing, or verify token-based connection)
4. Register the chat with the correct JID format
5. Build and verify
1. Install the Chat SDK adapter package
2. Uncomment the channel import in `src/channels/index.ts`
3. Collect credentials/tokens and write to `.env`
4. Build and verify
**After all channel skills complete**, install dependencies and rebuild — channel merges may introduce new packages: