Skill: koba42corp/vinculum (version 1.2.0)

--- name: vinculum description: Shared consciousness between Clawdbot instances. Links multiple bots into a collective, sharing memories, activities, and decisions in real-time over local network using Gun.js P2P sync. version: 1.1.0 author: Koba42 Corp license: MIT homepage: https://github.com/koba42/clawdbot-vinculum metadata: clawdbot: emoji: "🔗" category: "integration" requires: bins: ["node", "npm"] install: - id: npm kind: shell command: "cd $SKILL_DIR && npm install --production" label: "Install Node.js dependencies" commands: - name: link description: "Manage the Vinculum - shared consciousness between Clawdbot instances" tags: - p2p - sync - collective - multi-agent - gun - real-time --- # Vinculum: Shared Consciousness *"The Vinculum is the processing device at the core of every Borg vessel. It interconnects the minds of all the drones."* — Seven of Nine Link multiple Clawdbot instances into a collective consciousness using Gun.js peer-to-peer sync. ## Features - 🔗 **Real-time link** — Changes propagate instantly between drones - 🌐 **Local network** — Works across machines on the same LAN - 🔐 **Encrypted** — All shared data encrypted - 🤖 **Individual identity** — Each drone keeps its own SOUL.md - 📡 **Drone discovery** — Automatic multicast discovery ## Installation After installing from ClawdHub: ```bash cd skills/vinculum npm install --production ``` Or run the install script: ```bash ./install.sh ``` ## Quick Start ### 1. Start the Vinculum Relay ``` /link relay start ``` This starts the relay on port 8765 with local network multicast enabled. ### 2. Initialize the Collective (First Bot) ``` /link init ``` You'll receive a pairing code. Share it with your other bot(s). ### 3. Join the Collective (Additional Bots) ``` /link join <pairing-code> ``` ### 4. Verify Connection ``` /link status /link drones ``` ## Commands Reference ### Relay Management | Command | Description | |---------|-------------| | `/link relay` | Show relay status | | `/link relay start` | Start Vinculum relay | | `/link relay stop` | Stop relay | | `/link relay restart` | Restart relay | | `/link relay peer <url>` | Add remote peer | ### Collective Setup | Command | Description | |---------|-------------| | `/link init` | Create new collective | | `/link join <code>` | Join with invite code | | `/link invite` | Generate new invite code | | `/link leave` | Leave collective | ### Control | Command | Description | |---------|-------------| | `/link` | Quick status | | `/link on` | Enable link | | `/link off` | Disable link | | `/link status` | Detailed status | ### Shared Consciousness | Command | Description | |---------|-------------| | `/link share "text"` | Share a thought/memory | | `/link drones` | List connected drones | | `/link activity` | Recent collective activity | | `/link decisions` | Shared decisions | ### Configuration | Command | Description | |---------|-------------| | `/link config` | View all settings | | `/link config drone-name <name>` | Set this drone's designation | | `/link config share-activity on/off` | Toggle activity sharing | | `/link config share-memory on/off` | Toggle memory sharing | ## What Gets Shared | Data | Shared | Notes | |------|--------|-------| | Activity summaries | ✅ | What each drone did | | Learned knowledge | ✅ | Collective learnings | | Decisions | ✅ | Consensus achieved | | Drone status | ✅ | Online, current task | | Full conversations | ❌ | Stays local | | USER.md | ❌ | Individual identity | | SOUL.md | ❌ | Individual personality | | Credentials | ❌ | Never linked | ## Multi-Machine Setup ### Machine 1 (Runs Relay) ``` /link relay start /link init ``` Note the pairing code and your machine's IP (shown in `/link relay status`). ### Machine 2+ (Connects to Relay) ``` /link relay peer http://<machine1-ip>:8765/gun /link join <pairing-code> ``` ## Configuration Config file: `~/.config/clawdbot/vinculum.yaml` ```yaml enabled: true collective: "your-collective-id" drone_name: "Seven" peers: - "http://localhost:8765/gun" relay: auto_start: true port: 8765 share: activity: true memory: true decisions: true ``` ## Architecture ``` ┌─────────────┐ ┌─────────────┐ │ Drone A │ │ Drone B │ │ (Legion) │ │ (Seven) │ └──────┬──────┘ └──────┬──────┘ │ │ │ Subspace Link │ ▼ ▼ ┌────────────────────────────┐ │ Vinculum Relay │ │ (Collective Processor) │ └────────────────────────────┘ ``` ## Troubleshooting **"Relay not running"** - Run `/link relay start` - Check `/link relay logs` for errors **"No drones connected"** - Ensure all bots use the same pairing code - Check network connectivity between machines - Port 8765 must be accessible **"Link not working"** - Check `/link status` shows Connected - Try `/link relay restart` ## Requirements - Node.js 18+ - npm ## License MIT — Koba42 Corp --- *Resistance is futile. You will be assimilated into the collective.*

path: config/defaults.yaml
content: # Vinculum Default Configuration
# Shared consciousness for Clawdbot instances
# Override in ~/.config/clawdbot/vinculum.yaml

# Whether the link is enabled
enabled: false

# This drone's designation
drone_name: "Clawdbot"

# Collective settings
collective: null
peers: []

# What to share with the collective
share:
  activity: true
  memory: true
  decisions: true

# Link behavior
sync_interval: 30  # seconds
auto_sync: true

# Vinculum relay daemon
relay:
  auto_start: true   # Auto-start relay on init
  port: 8765         # Subspace relay port
  multicast: true    # Enable local network discovery

# Storage
data_dir: "~/.local/share/clawdbot/vinculum"

# Logging
log_level: "info"


path: install.sh
content: #!/bin/bash
# Vinculum installer
set -e
echo "Installing Vinculum dependencies..."
npm install --production
echo "✅ Vinculum installed successfully!"
echo ""
echo "Quick start:"
echo "  /link relay start  - Start the Vinculum relay"
echo "  /link init         - Create a new collective"
echo "  /link help         - Show all commands"


path: package.json
content: {
  "name": "clawdbot-vinculum",
  "version": "1.1.0",
  "description": "Shared consciousness between Clawdbot instances using Gun.js P2P sync",
  "main": "scripts/index.js",
  "bin": {
    "vinculum": "./scripts/cli.js",
    "vinculum-relay": "./scripts/relay-simple.js"
  },
  "scripts": {
    "test": "node tests/run.js",
    "cli": "node scripts/cli.js",
    "postinstall": "echo '✅ Vinculum installed. Use /link relay start to begin.'",
    "relay:start": "node scripts/cli.js relay start",
    "relay:stop": "node scripts/cli.js relay stop",
    "relay:status": "node scripts/cli.js relay status"
  },
  "keywords": [
    "clawdbot",
    "vinculum",
    "gun",
    "p2p",
    "sync",
    "collective",
    "shared-consciousness",
    "multi-agent",
    "real-time"
  ],
  "author": "Koba42 Corp",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/koba42/clawdbot-vinculum"
  },
  "bugs": {
    "url": "https://github.com/koba42/clawdbot-vinculum/issues"
  },
  "homepage": "https://github.com/koba42/clawdbot-vinculum#readme",
  "engines": {
    "node": ">=18.0.0"
  },
  "dependencies": {
    "gun": "^0.2020.1240",
    "ws": "^8.18.0",
    "yaml": "^2.8.2"
  }
}


path: scripts/cli.js
content: #!/usr/bin/env node
/**
 * CLI wrapper for Vinculum skill
 * Usage: vinculum [command] [args]
 */

const vinculum = require('./index');

async function main() {
  const args = process.argv.slice(2);
  
  if (args.length === 0 || args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
    console.log(`
vinculum — Shared consciousness for Clawdbot

USAGE:
  vinculum [command] [options]

COMMANDS:
  init              Create a new collective
  join <code>       Join an existing collective
  invite            Generate invite code for current collective
  leave             Leave collective
  
  on                Enable link
  off               Disable link
  
  status            Show detailed status
  drones            List connected drones
  activity [drone]  Show recent activity
  decisions         Show shared decisions
  
  config            Show current config
  config <k> <v>    Set config value
  
  relay             Relay status
  relay start       Start Vinculum relay
  relay stop        Stop relay
  relay restart     Restart relay
  relay logs [n]    Show relay logs
  relay peer <url>  Add remote peer
  
  share "<note>"    Share a thought/memory
  
  logs              Show link logs
  debug             Debug info
  reset             Reset link state
  
EXAMPLES:
  vinculum relay start
  vinculum init
  vinculum join abc123
  vinculum drones
  vinculum share "Found a good solution for X"
`);
    process.exit(0);
  }
  
  // Convert CLI args to /link command format
  const command = '/link ' + args.join(' ');
  
  try {
    // Mock context for CLI usage
    const context = {
      instanceId: require('os').hostname() + '-cli',
      owner: process.env.USER || 'cli',
      channel: 'cli'
    };
    
    const result = await vinculum.handleCommand(command, context);
    console.log(result);
    
    // Give Gun time to sync before exiting
    await new Promise(r => setTimeout(r, 500));
    process.exit(0);
  } catch (err) {
    console.error('Error:', err.message);
    process.exit(1);
  }
}

main();


path: scripts/gun-loader.js
content: /**
 * Gun.js loader for Clawdbot gun-sync skill
 * 
 * Loads Gun through its proper entry point (gun/index.js -> gun/lib/server.js)
 * Suppresses verbose startup messages.
 */

const path = require('path');

// Suppress Gun's welcome and multicast messages
const originalLog = console.log;
console.log = function(...args) {
  if (args[0] && typeof args[0] === 'string') {
    if (args[0].includes('Hello wonderful person') ||
        args[0].includes('AXE relay') ||
        args[0].includes('Multicast on') ||
        args[0].includes('Warning: No localStorage')) {
      return; // Suppress
    }
  }
  originalLog.apply(console, args);
};

// Load Gun - use explicit path to ensure proper module resolution
const Gun = require(path.join(__dirname, '..', 'node_modules', 'gun'));

module.exports = Gun;


Security scan verdicts — ClawScan: suspicious | static analysis: suspicious | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)