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

@@ -8,9 +8,9 @@ import fs from 'fs';
import path from 'path';
import { STORE_DIR } from '../src/config.ts';
import { initDatabase, setRegisteredGroup } from '../src/db.ts';
import { initDatabase, setRegisteredGroup } from '../src/v1/db.ts';
import { isValidGroupFolder } from '../src/group-folder.ts';
import { logger } from '../src/logger.ts';
import { log } from '../src/log.js';
import { emitStatus } from './status.ts';
interface RegisterArgs {
@@ -90,7 +90,7 @@ export async function run(args: string[]): Promise<void> {
process.exit(4);
}
logger.info(parsed, 'Registering channel');
log.info('Registering channel', parsed);
// Ensure data and store directories exist (store/ may not exist on
// fresh installs that skip WhatsApp auth, which normally creates it)
@@ -109,7 +109,7 @@ export async function run(args: string[]): Promise<void> {
isMain: parsed.isMain,
});
logger.info('Wrote registration to SQLite');
log.info('Wrote registration to SQLite');
// Create group folders
fs.mkdirSync(path.join(projectRoot, 'groups', parsed.folder, 'logs'), {
@@ -133,9 +133,9 @@ export async function run(args: string[]): Promise<void> {
: path.join(projectRoot, 'groups', 'global', 'CLAUDE.md');
if (fs.existsSync(templatePath)) {
fs.copyFileSync(templatePath, groupClaudeMdPath);
logger.info(
{ file: groupClaudeMdPath, template: templatePath },
log.info(
'Created CLAUDE.md from template',
{ file: groupClaudeMdPath, template: templatePath },
);
}
}
@@ -143,9 +143,9 @@ export async function run(args: string[]): Promise<void> {
// Update assistant name in CLAUDE.md files if different from default
let nameUpdated = false;
if (parsed.assistantName !== 'Andy') {
logger.info(
{ from: 'Andy', to: parsed.assistantName },
log.info(
'Updating assistant name',
{ from: 'Andy', to: parsed.assistantName },
);
const groupsDir = path.join(projectRoot, 'groups');
@@ -163,7 +163,7 @@ export async function run(args: string[]): Promise<void> {
`You are ${parsed.assistantName}`,
);
fs.writeFileSync(mdFile, content);
logger.info({ file: mdFile }, 'Updated CLAUDE.md');
log.info('Updated CLAUDE.md', { file: mdFile });
}
}
@@ -183,7 +183,7 @@ export async function run(args: string[]): Promise<void> {
} else {
fs.writeFileSync(envFile, `ASSISTANT_NAME="${parsed.assistantName}"\n`);
}
logger.info('Set ASSISTANT_NAME in .env');
log.info('Set ASSISTANT_NAME in .env');
nameUpdated = true;
}