refactor: Migrate from ActivityPub federation to native Swarm network

- Remove ActivityPub infrastructure (webfinger, nodeinfo, inbox, activities, signatures)
- Implement native peer-to-peer Swarm network with gossip protocol
- Replace federated timeline with Swarm timeline aggregating posts from all nodes
- Migrate direct messaging to end-to-end encrypted Swarm Chat system
- Update user interactions (follow, like, repost) to use Swarm protocol
- Add cryptographic key management for DID-based identity system
- Remove server-bound identity model in favor of portable DID identities
- Update documentation to reflect Swarm architecture and capabilities
- Add debug utilities and chat testing tools for Swarm network
- Refactor database schema to support distributed user directory
- Update bot framework to work with Swarm network interactions
- Simplify API routes to use Swarm protocol instead of ActivityPub
- This transition enables true peer-to-peer communication, instant interactions, and encrypted messaging while maintaining sovereign identity through DIDs
This commit is contained in:
Christomatt
2026-01-27 01:27:15 +01:00
parent 6b8eeb6814
commit eb63194c56
49 changed files with 1173 additions and 3559 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
* Bot Manager Service
*
* Core orchestrator for bot lifecycle, configuration, and operations.
* Handles bot CRUD operations, user linking, and ActivityPub key generation.
* Handles bot CRUD operations, user linking, and cryptographic key generation.
*
* Bots are first-class users with their own profiles, handles, and posts.
* Each bot has an owner (human user) who manages it.
@@ -12,7 +12,7 @@
import { db, bots, users, botContentSources, botContentItems, botMentions, botActivityLogs, botRateLimits, follows } from '@/db';
import { eq, and, count } from 'drizzle-orm';
import { generateKeyPair } from '@/lib/activitypub/signatures';
import { generateKeyPair } from '@/lib/crypto/keys';
import {
encryptApiKey,
decryptApiKey,
@@ -333,7 +333,7 @@ export async function createBot(ownerId: string, config: BotCreateInput): Promis
throw new BotHandleTakenError(config.handle);
}
// Generate ActivityPub keys for the bot's user account
// Generate cryptographic keys for the bot's user account
const { publicKey, privateKey } = await generateKeyPair();
// Encrypt the API key and private key