@sesamespace/hivemind 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/{chunk-2OIRJFI5.js → chunk-3T6RYEZF.js} +9 -5
  2. package/dist/chunk-3T6RYEZF.js.map +1 -0
  3. package/dist/{chunk-RXCV57H3.js → chunk-CGSXJVSS.js} +2 -2
  4. package/dist/{chunk-OQ272HKA.js → chunk-LNV373IF.js} +28 -3
  5. package/dist/chunk-LNV373IF.js.map +1 -0
  6. package/dist/chunk-PPQGQHXJ.js +151 -0
  7. package/dist/chunk-PPQGQHXJ.js.map +1 -0
  8. package/dist/{chunk-YEOAEJ62.js → chunk-S3RVZBPZ.js} +2 -2
  9. package/dist/chunk-YHRGEWAZ.js +2326 -0
  10. package/dist/chunk-YHRGEWAZ.js.map +1 -0
  11. package/dist/commands/fleet.js +3 -4
  12. package/dist/commands/init.js +1 -2
  13. package/dist/commands/service.js +1 -2
  14. package/dist/commands/start.js +3 -4
  15. package/dist/commands/upgrade.js +0 -1
  16. package/dist/index.js +2 -3
  17. package/dist/main.js +6 -7
  18. package/dist/main.js.map +1 -1
  19. package/dist/start.js +1 -2
  20. package/dist/start.js.map +1 -1
  21. package/install.sh +55 -122
  22. package/npm-package.json +1 -3
  23. package/package.json +3 -2
  24. package/packages/cli/src/commands/init.ts +8 -4
  25. package/packages/cli/src/commands/service.ts +91 -73
  26. package/packages/cli/src/commands/start.ts +37 -1
  27. package/packages/runtime/package.json +1 -1
  28. package/packages/runtime/src/config.ts +1 -1
  29. package/scripts/build-npm.sh +1 -3
  30. package/tsup.config.ts +1 -1
  31. package/dist/chunk-2OIRJFI5.js.map +0 -1
  32. package/dist/chunk-7D4SUZUM.js +0 -38
  33. package/dist/chunk-7D4SUZUM.js.map +0 -1
  34. package/dist/chunk-LRK64BAK.js +0 -3601
  35. package/dist/chunk-LRK64BAK.js.map +0 -1
  36. package/dist/chunk-MBS5A6BZ.js +0 -132
  37. package/dist/chunk-MBS5A6BZ.js.map +0 -1
  38. package/dist/chunk-OQ272HKA.js.map +0 -1
  39. /package/dist/{chunk-RXCV57H3.js.map → chunk-CGSXJVSS.js.map} +0 -0
  40. /package/dist/{chunk-YEOAEJ62.js.map → chunk-S3RVZBPZ.js.map} +0 -0
package/install.sh CHANGED
@@ -1,9 +1,23 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
- # Hivemind — One-shot install for macOS (Apple Silicon)
5
- # Usage (from repo): cd hivemind && ./install.sh <sesame-api-key>
6
- # Preferred: curl -sL api.sesame.space/api/v1/hivemind/install | bash -s -- <sesame-api-key>
4
+ # Hivemind — One-shot install for macOS
5
+ # Usage: curl -sL api.sesame.space/api/v1/hivemind/install | bash -s -- <sesame-api-key>
6
+
7
+ # --- Handle curl-pipe-bash stdin issue ---
8
+ # When piped from curl, stdin is the script itself. We need stdin for interactive prompts.
9
+ # Self-extract: download to temp, re-exec from disk with /dev/tty as stdin.
10
+ if [ -z "${HIVEMIND_INSTALL_REEXEC:-}" ]; then
11
+ TMPSCRIPT="$(mktemp /tmp/hivemind-install.XXXXXX)"
12
+ # If we're being piped, cat has already consumed stdin — use $0 or re-download
13
+ cat > "$TMPSCRIPT" < /dev/stdin 2>/dev/null || cp "$0" "$TMPSCRIPT" 2>/dev/null || true
14
+ # If the temp file is empty or too small, we're running from disk already
15
+ if [ -s "$TMPSCRIPT" ] && [ "$(wc -c < "$TMPSCRIPT")" -gt 100 ]; then
16
+ chmod +x "$TMPSCRIPT"
17
+ HIVEMIND_INSTALL_REEXEC=1 exec bash "$TMPSCRIPT" "$@" < /dev/tty
18
+ fi
19
+ rm -f "$TMPSCRIPT"
20
+ fi
7
21
 
8
22
  BOLD='\033[1m'
9
23
  GREEN='\033[0;32m'
@@ -16,6 +30,8 @@ warn() { echo -e "${YELLOW}[!]${NC} $1"; }
16
30
  err() { echo -e "${RED}[✗]${NC} $1"; }
17
31
  step() { echo -e "\n${BOLD}→ $1${NC}"; }
18
32
 
33
+ HIVEMIND_HOME="${HIVEMIND_HOME:-$HOME/hivemind}"
34
+
19
35
  echo -e "${BOLD}"
20
36
  echo " ╦ ╦╦╦ ╦╔═╗╔╦╗╦╔╗╔╔╦╗"
21
37
  echo " ╠═╣║╚╗╔╝║╣ ║║║║║║║ ║║"
@@ -50,138 +66,55 @@ else
50
66
  fi
51
67
  fi
52
68
 
53
- # pnpm
54
- if ! command -v pnpm &>/dev/null; then
55
- warn "pnpm not found — installing..."
56
- npm install -g pnpm
69
+ # --- 2. Install hivemind via npm ---
70
+ step "Installing @sesamespace/hivemind"
71
+ npm install -g @sesamespace/hivemind
72
+ info "Hivemind CLI installed: $(which hivemind)"
73
+
74
+ # --- 3. Set up HIVEMIND_HOME ---
75
+ step "Setting up ${HIVEMIND_HOME}"
76
+ mkdir -p "${HIVEMIND_HOME}/config"
77
+
78
+ # Copy default config
79
+ NPM_GLOBAL="$(npm root -g)"
80
+ DEFAULT_CONFIG="${NPM_GLOBAL}/@sesamespace/hivemind/config/default.toml"
81
+ if [ -f "$DEFAULT_CONFIG" ]; then
82
+ cp "$DEFAULT_CONFIG" "${HIVEMIND_HOME}/config/default.toml"
83
+ info "Copied default config"
57
84
  else
58
- info "pnpm $(pnpm -v)"
85
+ warn "Default config not found at ${DEFAULT_CONFIG} — skipping"
59
86
  fi
60
87
 
61
- # Rust
62
- if ! command -v cargo &>/dev/null; then
63
- warn "Rust not found — installing via rustup..."
64
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
65
- source "$HOME/.cargo/env"
66
- else
67
- info "Rust $(rustc --version | awk '{print $2}')"
68
- fi
88
+ # --- 4. Initialize agent ---
89
+ step "Initializing agent"
69
90
 
70
- # Ollama
71
- if ! command -v ollama &>/dev/null; then
72
- warn "Ollama not found installing via brew..."
73
- brew install ollama
74
- else
75
- info "Ollama found"
91
+ SESAME_KEY="${1:-${SESAME_API_KEY:-}}"
92
+ if [ -z "$SESAME_KEY" ]; then
93
+ read -rp " Sesame API key: " SESAME_KEY
76
94
  fi
77
95
 
78
- # --- 2. Pull embedding model ---
79
- step "Setting up Ollama embedding model"
80
-
81
- # Start Ollama if not running
82
- if ! curl -s http://localhost:11434/api/tags &>/dev/null; then
83
- warn "Ollama not running — starting..."
84
- ollama serve &>/dev/null &
85
- sleep 3
96
+ if [ -z "$SESAME_KEY" ]; then
97
+ err "Sesame API key is required"
98
+ exit 1
86
99
  fi
87
100
 
88
- if ollama list 2>/dev/null | grep -q "nomic-embed-text"; then
89
- info "nomic-embed-text model ready"
90
- else
91
- warn "Pulling nomic-embed-text (274MB)..."
92
- ollama pull nomic-embed-text
93
- info "nomic-embed-text ready"
94
- fi
95
-
96
- # --- 3. Build TypeScript packages ---
97
- step "Installing Node dependencies"
98
- pnpm install
99
- info "Dependencies installed"
100
-
101
- step "Building TypeScript"
102
- pnpm build
103
- info "TypeScript build complete"
104
-
105
- # --- 4. Build Rust memory daemon ---
106
- step "Building memory daemon (Rust — this takes ~60s first time)"
107
- cd packages/memory
108
- cargo build --release 2>&1 | tail -3
109
- cd ../..
110
- info "Memory daemon built"
111
-
112
- # --- 5. Configuration via Sesame ---
113
- step "Configuring agent via Sesame"
114
-
115
- if [ -f ".env" ]; then
116
- info "Existing .env found — keeping it"
117
- else
118
- SESAME_KEY="${1:-${SESAME_API_KEY:-}}"
119
- if [ -z "$SESAME_KEY" ]; then
120
- read -rp " Sesame API key: " SESAME_KEY
121
- fi
122
- node packages/cli/dist/main.js init "$SESAME_KEY"
123
- fi
101
+ export HIVEMIND_HOME
102
+ hivemind init "$SESAME_KEY" --non-interactive
124
103
 
125
- # --- 6. Create launch script ---
126
- step "Creating launch script"
127
-
128
- cat > start.sh <<'LAUNCH'
129
- #!/usr/bin/env bash
130
- set -euo pipefail
131
-
132
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
133
- cd "$SCRIPT_DIR"
134
-
135
- # Load env
136
- if [ -f .env ]; then
137
- set -a; source .env; set +a
138
- fi
139
-
140
- # Start memory daemon if not running
141
- if ! curl -s http://localhost:3434/health &>/dev/null; then
142
- echo "[hivemind] Starting memory daemon..."
143
- nohup ./packages/memory/target/release/hivemind-memory > /tmp/hivemind-memory.log 2>&1 &
144
- sleep 2
145
- if curl -s http://localhost:3434/health &>/dev/null; then
146
- echo "[hivemind] Memory daemon ready"
147
- else
148
- echo "[hivemind] WARNING: Memory daemon failed to start"
149
- fi
150
- else
151
- echo "[hivemind] Memory daemon already running"
152
- fi
153
-
154
- # Start Ollama if not running
155
- if ! curl -s http://localhost:11434/api/tags &>/dev/null; then
156
- echo "[hivemind] Starting Ollama..."
157
- ollama serve &>/dev/null &
158
- sleep 3
159
- fi
160
-
161
- # Start agent (auto-restart on crash)
162
- echo "[hivemind] Starting agent..."
163
- while true; do
164
- node packages/cli/dist/main.js start --config config/default.toml
165
- EXIT_CODE=$?
166
- echo "[hivemind] Agent exited with code $EXIT_CODE — restarting in 5s..."
167
- sleep 5
168
- done
169
- LAUNCH
170
-
171
- chmod +x start.sh
172
- info "Created start.sh (with auto-restart)"
104
+ # --- 5. Install launchd service ---
105
+ step "Installing launchd service"
106
+ hivemind service install
173
107
 
174
108
  # --- Done ---
175
109
  echo ""
176
110
  echo -e "${GREEN}${BOLD} ✓ Hivemind installed successfully!${NC}"
177
111
  echo ""
178
- echo " To start the agent:"
179
- echo " ./start.sh"
180
- echo ""
181
- echo " To start in background:"
182
- echo " nohup ./start.sh > /tmp/hivemind.log 2>&1 &"
112
+ echo " Home: ${HIVEMIND_HOME}"
113
+ echo " Config: ${HIVEMIND_HOME}/config/"
114
+ echo " Logs: /tmp/hivemind-agent.log"
183
115
  echo ""
184
- echo " Logs:"
185
- echo " Agent: stdout (or /tmp/hivemind.log)"
186
- echo " Memory: /tmp/hivemind-memory.log"
116
+ echo " Commands:"
117
+ echo " hivemind service status — Check service"
118
+ echo " hivemind service logs — View logs"
119
+ echo " hivemind upgrade — Update to latest"
187
120
  echo ""
package/npm-package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sesamespace/hivemind",
3
- "version": "0.2.0",
3
+ "version": "0.4.3",
4
4
  "description": "Cognitive architecture for AI agents with multi-layered memory",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,8 +13,6 @@
13
13
  "README.md"
14
14
  ],
15
15
  "dependencies": {
16
- "@iarna/toml": "^2.2.5",
17
- "@sesamespace/sdk": "^0.1.6",
18
16
  "ws": "^8.18.0"
19
17
  },
20
18
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sesamespace/hivemind",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "Cognitive architecture for AI agents with multi-layered memory",
5
5
  "scripts": {
6
6
  "build": "pnpm -r build",
@@ -13,7 +13,8 @@
13
13
  "pnpm": ">=9.0.0"
14
14
  },
15
15
  "dependencies": {
16
- "@sesamespace/sdk": "^0.1.6"
16
+ "@sesamespace/sdk": "^0.1.6",
17
+ "smol-toml": "^1.6.0"
17
18
  },
18
19
  "devDependencies": {
19
20
  "tsup": "^8.5.1"
@@ -2,8 +2,9 @@ import { resolve, dirname } from "path";
2
2
  import { existsSync, writeFileSync, mkdirSync, readFileSync } from "fs";
3
3
  import { createInterface } from "readline";
4
4
  import { SesameClient } from "@sesamespace/sdk";
5
+ import { homedir } from "os";
5
6
 
6
- const HIVEMIND_DIR = resolve(process.env.HIVEMIND_HOME || ".");
7
+ const HIVEMIND_DIR = resolve(process.env.HIVEMIND_HOME || resolve(homedir(), "hivemind"));
7
8
  const CONFIG_DIR = resolve(HIVEMIND_DIR, "config");
8
9
  const WORKSPACE_DIR = resolve(HIVEMIND_DIR, "workspace");
9
10
  const ENV_FILE = resolve(HIVEMIND_DIR, ".env");
@@ -179,6 +180,9 @@ workspace = "workspace"
179
180
 
180
181
  ${config.llmModel ? `[llm]\nmodel = "${config.llmModel}"` : "# [llm] using defaults"}
181
182
  ${config.llmBaseUrl ? `# base_url = "${config.llmBaseUrl}"` : ""}
183
+
184
+ [sesame]
185
+ api_key = "${sesameApiKey}"
182
186
  `;
183
187
 
184
188
  writeFileSync(LOCAL_TOML, localToml);
@@ -200,10 +204,10 @@ AGENT_NAME=${config.agentName}
200
204
  ✓ Hivemind initialized for ${config.agentName}!
201
205
 
202
206
  To start the agent:
203
- ./start.sh
207
+ hivemind start
204
208
 
205
- To start in background:
206
- nohup ./start.sh > /tmp/hivemind.log 2>&1 &
209
+ To install as a service:
210
+ hivemind service install
207
211
 
208
212
  Agent ID: ${config.agentId}
209
213
  Channels: ${config.channels.map((c) => c.name || c.id).join(", ")}
@@ -1,21 +1,69 @@
1
1
  import { resolve } from "path";
2
- import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
2
+ import { writeFileSync, existsSync, unlinkSync, mkdirSync } from "fs";
3
3
  import { execSync } from "child_process";
4
4
  import { homedir } from "os";
5
5
 
6
6
  const LAUNCH_AGENTS_DIR = resolve(homedir(), "Library/LaunchAgents");
7
7
  const AGENT_LABEL = "com.hivemind.agent";
8
- const MEMORY_LABEL = "com.hivemind.memory";
8
+
9
+ function getHivemindHome(): string {
10
+ return process.env.HIVEMIND_HOME || resolve(homedir(), "hivemind");
11
+ }
12
+
13
+ function getHivemindBin(): string {
14
+ // Try to find the hivemind binary
15
+ try {
16
+ const which = execSync("which hivemind", { encoding: "utf-8" }).trim();
17
+ if (which) return which;
18
+ } catch {}
19
+ // Fallback to process.argv[1] (the script being run)
20
+ return process.argv[1] || "hivemind";
21
+ }
22
+
23
+ function generatePlist(hivemindHome: string, hivemindBin: string): string {
24
+ return `<?xml version="1.0" encoding="UTF-8"?>
25
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
26
+ <plist version="1.0">
27
+ <dict>
28
+ <key>Label</key>
29
+ <string>${AGENT_LABEL}</string>
30
+ <key>ProgramArguments</key>
31
+ <array>
32
+ <string>${hivemindBin}</string>
33
+ <string>start</string>
34
+ </array>
35
+ <key>WorkingDirectory</key>
36
+ <string>${hivemindHome}</string>
37
+ <key>EnvironmentVariables</key>
38
+ <dict>
39
+ <key>PATH</key>
40
+ <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
41
+ <key>HIVEMIND_HOME</key>
42
+ <string>${hivemindHome}</string>
43
+ </dict>
44
+ <key>RunAtLoad</key>
45
+ <true/>
46
+ <key>KeepAlive</key>
47
+ <true/>
48
+ <key>StandardOutPath</key>
49
+ <string>/tmp/hivemind-agent.log</string>
50
+ <key>StandardErrorPath</key>
51
+ <string>/tmp/hivemind-error.log</string>
52
+ <key>ThrottleInterval</key>
53
+ <integer>5</integer>
54
+ </dict>
55
+ </plist>`;
56
+ }
9
57
 
10
58
  export async function runServiceCommand(args: string[]): Promise<void> {
11
59
  const subcommand = args[0];
12
60
 
13
61
  switch (subcommand) {
14
62
  case "install":
15
- await installServices(args.slice(1));
63
+ await installService();
16
64
  break;
17
65
  case "uninstall":
18
- await uninstallServices();
66
+ await uninstallService();
19
67
  break;
20
68
  case "status":
21
69
  showStatus();
@@ -33,84 +81,59 @@ export async function runServiceCommand(args: string[]): Promise<void> {
33
81
  }
34
82
  }
35
83
 
36
- async function installServices(_args: string[]): Promise<void> {
37
- const hivemindHome = process.env.HIVEMIND_HOME || process.cwd();
84
+ async function installService(): Promise<void> {
85
+ const hivemindHome = getHivemindHome();
86
+ const hivemindBin = getHivemindBin();
38
87
 
39
- console.log(`\n→ Installing launchd services for ${hivemindHome}\n`);
88
+ console.log(`\n→ Installing launchd service for ${hivemindHome}\n`);
89
+ console.log(` Binary: ${hivemindBin}`);
40
90
 
41
91
  mkdirSync(LAUNCH_AGENTS_DIR, { recursive: true });
42
92
 
43
- // Find plist templates
44
- const scriptDirs = [
45
- resolve(hivemindHome, "scripts"),
46
- resolve(dirname(dirname(dirname(fileURLToPath(import.meta.url)))), "scripts"),
47
- ];
48
-
49
- for (const label of [MEMORY_LABEL, AGENT_LABEL]) {
50
- const plistFile = `${label}.plist`;
51
- let templatePath = "";
52
-
53
- for (const dir of scriptDirs) {
54
- const p = resolve(dir, plistFile);
55
- if (existsSync(p)) { templatePath = p; break; }
56
- }
93
+ const plistContent = generatePlist(hivemindHome, hivemindBin);
94
+ const destPath = resolve(LAUNCH_AGENTS_DIR, `${AGENT_LABEL}.plist`);
57
95
 
58
- if (!templatePath) {
59
- console.error(` Template not found: ${plistFile}`);
60
- continue;
61
- }
96
+ // Unload if already loaded
97
+ try { execSync(`launchctl unload ${destPath} 2>/dev/null`); } catch {}
62
98
 
63
- let content = readFileSync(templatePath, "utf-8");
64
- content = content.replace(/__HIVEMIND_HOME__/g, hivemindHome);
99
+ writeFileSync(destPath, plistContent);
100
+ execSync(`launchctl load ${destPath}`);
65
101
 
66
- const destPath = resolve(LAUNCH_AGENTS_DIR, plistFile);
67
- writeFileSync(destPath, content);
68
-
69
- // Unload if already loaded, then load
70
- try { execSync(`launchctl unload ${destPath} 2>/dev/null`); } catch {}
71
- execSync(`launchctl load ${destPath}`);
72
-
73
- console.log(` ✓ ${label} installed and started`);
74
- }
75
-
76
- console.log("\n Services will auto-start on boot.\n");
102
+ console.log(` ✓ ${AGENT_LABEL} installed and started`);
103
+ console.log("\n Service will auto-start on boot.");
104
+ console.log(" Logs: /tmp/hivemind-agent.log, /tmp/hivemind-error.log\n");
77
105
  }
78
106
 
79
- async function uninstallServices(): Promise<void> {
80
- console.log("\n→ Uninstalling launchd services\n");
81
-
82
- for (const label of [AGENT_LABEL, MEMORY_LABEL]) {
83
- const plistPath = resolve(LAUNCH_AGENTS_DIR, `${label}.plist`);
84
- if (existsSync(plistPath)) {
85
- try { execSync(`launchctl unload ${plistPath} 2>/dev/null`); } catch {}
86
- const { unlinkSync } = await import("fs");
87
- unlinkSync(plistPath);
88
- console.log(` ${label} uninstalled`);
89
- } else {
90
- console.log(` - ${label} not installed`);
91
- }
107
+ async function uninstallService(): Promise<void> {
108
+ console.log("\n→ Uninstalling launchd service\n");
109
+
110
+ const plistPath = resolve(LAUNCH_AGENTS_DIR, `${AGENT_LABEL}.plist`);
111
+ if (existsSync(plistPath)) {
112
+ try { execSync(`launchctl unload ${plistPath} 2>/dev/null`); } catch {}
113
+ unlinkSync(plistPath);
114
+ console.log(` ✓ ${AGENT_LABEL} uninstalled`);
115
+ } else {
116
+ console.log(` - ${AGENT_LABEL} not installed`);
92
117
  }
93
118
  console.log("");
94
119
  }
95
120
 
96
121
  function showStatus(): void {
97
122
  console.log("\n→ Service status\n");
98
- for (const label of [MEMORY_LABEL, AGENT_LABEL]) {
99
- try {
100
- const out = execSync(`launchctl list ${label} 2>/dev/null`, { encoding: "utf-8" });
101
- const pidMatch = out.match(/"PID"\s*=\s*(\d+)/);
102
- const pid = pidMatch ? pidMatch[1] : "unknown";
103
- console.log(` ✓ ${label}: running (PID ${pid})`);
104
- } catch {
105
- console.log(` - ${label}: not running`);
106
- }
123
+ try {
124
+ const out = execSync(`launchctl list ${AGENT_LABEL} 2>/dev/null`, { encoding: "utf-8" });
125
+ const pidMatch = out.match(/"PID"\s*=\s*(\d+)/);
126
+ const pid = pidMatch ? pidMatch[1] : "unknown";
127
+ console.log(` ✓ ${AGENT_LABEL}: running (PID ${pid})`);
128
+ } catch {
129
+ console.log(` - ${AGENT_LABEL}: not running`);
107
130
  }
108
131
  console.log("");
109
132
  }
110
133
 
111
134
  function showLogs(which?: string): void {
112
- const logFile = which === "memory"
113
- ? "/tmp/hivemind-memory.log"
135
+ const logFile = which === "error"
136
+ ? "/tmp/hivemind-error.log"
114
137
  : "/tmp/hivemind-agent.log";
115
138
  try {
116
139
  execSync(`tail -30 ${logFile}`, { stdio: "inherit" });
@@ -120,22 +143,17 @@ function showLogs(which?: string): void {
120
143
  }
121
144
 
122
145
  function printHelp(): void {
123
- console.log(`hivemind service — Manage launchd services
146
+ console.log(`hivemind service — Manage launchd service
124
147
 
125
148
  Usage: hivemind service <subcommand>
126
149
 
127
150
  Subcommands:
128
- install Install and start launchd services (survives reboots)
129
- uninstall Stop and remove launchd services
151
+ install Install and start launchd service (survives reboots)
152
+ uninstall Stop and remove launchd service
130
153
  status Show service status
131
- logs [agent|memory] Show recent logs
154
+ logs [agent|error] Show recent logs
132
155
 
133
- Services:
134
- com.hivemind.memory Memory daemon (Rust, port 3434)
135
- com.hivemind.agent — Agent runtime (Node.js, Sesame)
156
+ Service:
157
+ com.hivemind.agent Agent runtime (Node.js, Sesame)
136
158
  `);
137
159
  }
138
-
139
- // Helpers for ESM
140
- import { fileURLToPath } from "url";
141
- import { dirname } from "path";
@@ -1,10 +1,46 @@
1
1
  import { resolve } from "path";
2
- import { existsSync } from "fs";
2
+ import { existsSync, readFileSync } from "fs";
3
+ import { homedir } from "os";
3
4
  import { startPipeline } from "@hivemind/runtime";
4
5
 
5
6
  const DEFAULT_CONFIG = "config/default.toml";
6
7
 
8
+ /**
9
+ * Load .env file from HIVEMIND_HOME, setting any missing env vars.
10
+ * Simple KEY=VALUE parser — no dotenv dependency needed.
11
+ */
12
+ function loadEnvFile(dir: string): void {
13
+ const envPath = resolve(dir, ".env");
14
+ if (!existsSync(envPath)) return;
15
+
16
+ try {
17
+ const content = readFileSync(envPath, "utf-8");
18
+ for (const line of content.split("\n")) {
19
+ const trimmed = line.trim();
20
+ if (!trimmed || trimmed.startsWith("#")) continue;
21
+ const eqIdx = trimmed.indexOf("=");
22
+ if (eqIdx < 1) continue;
23
+ const key = trimmed.slice(0, eqIdx).trim();
24
+ let value = trimmed.slice(eqIdx + 1).trim();
25
+ // Strip surrounding quotes
26
+ if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
27
+ value = value.slice(1, -1);
28
+ }
29
+ // Don't overwrite existing env vars
30
+ if (!(key in process.env)) {
31
+ process.env[key] = value;
32
+ }
33
+ }
34
+ } catch {
35
+ // Silently ignore read errors
36
+ }
37
+ }
38
+
7
39
  export async function runStartCommand(args: string[]): Promise<void> {
40
+ // Load .env from HIVEMIND_HOME before anything else
41
+ const hivemindHome = process.env.HIVEMIND_HOME || resolve(homedir(), "hivemind");
42
+ loadEnvFile(hivemindHome);
43
+
8
44
  let configPath = DEFAULT_CONFIG;
9
45
 
10
46
  // Parse args
@@ -12,7 +12,7 @@
12
12
  "test": "echo \"No tests yet\""
13
13
  },
14
14
  "dependencies": {
15
- "@iarna/toml": "^2.2.5",
15
+ "smol-toml": "^1.3.1",
16
16
  "ws": "^8.18.0"
17
17
  },
18
18
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  import { readFileSync, existsSync } from "fs";
2
2
  import { resolve, dirname } from "path";
3
- import { parse } from "@iarna/toml";
3
+ import { parse } from "smol-toml";
4
4
 
5
5
  export interface AgentConfig {
6
6
  name: string;
@@ -42,7 +42,7 @@ cp "$ROOT/README.md" "$OUT/"
42
42
  cat > "$OUT/package.json" <<'EOF'
43
43
  {
44
44
  "name": "@sesamespace/hivemind",
45
- "version": "0.1.0",
45
+ "version": "0.4.3",
46
46
  "description": "Cognitive architecture for AI agents with multi-layered memory",
47
47
  "type": "module",
48
48
  "bin": {
@@ -59,8 +59,6 @@ cat > "$OUT/package.json" <<'EOF'
59
59
  "node": ">=20.0.0"
60
60
  },
61
61
  "dependencies": {
62
- "@iarna/toml": "^2.2.5",
63
- "@sesamespace/sdk": "^0.1.6",
64
62
  "ws": "^8.18.0"
65
63
  },
66
64
  "keywords": [
package/tsup.config.ts CHANGED
@@ -23,5 +23,5 @@ export default defineConfig({
23
23
  external: [
24
24
  "ws",
25
25
  ],
26
- noExternal: ["@hivemind/runtime", "@iarna/toml", "@sesamespace/sdk"],
26
+ noExternal: ["@hivemind/runtime", "smol-toml", "@sesamespace/sdk"],
27
27
  });
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/cli/src/commands/init.ts"],"sourcesContent":["import { resolve, dirname } from \"path\";\nimport { existsSync, writeFileSync, mkdirSync, readFileSync } from \"fs\";\nimport { createInterface } from \"readline\";\nimport { SesameClient } from \"@sesamespace/sdk\";\n\nconst HIVEMIND_DIR = resolve(process.env.HIVEMIND_HOME || \".\");\nconst CONFIG_DIR = resolve(HIVEMIND_DIR, \"config\");\nconst WORKSPACE_DIR = resolve(HIVEMIND_DIR, \"workspace\");\nconst ENV_FILE = resolve(HIVEMIND_DIR, \".env\");\nconst LOCAL_TOML = resolve(CONFIG_DIR, \"local.toml\");\n\nconst VAULT_CONFIG_NAME = \"hivemind-config\";\n\ninterface ProvisioningConfig {\n agentName: string;\n agentHandle: string;\n agentId: string;\n personality?: string;\n llmApiKey?: string;\n llmBaseUrl?: string;\n llmModel?: string;\n fleetRole?: string;\n channels: Array<{ id: string; name: string | null; kind: string }>;\n}\n\nasync function prompt(question: string): Promise<string> {\n const rl = createInterface({ input: process.stdin, output: process.stdout });\n return new Promise((resolve) => {\n rl.question(question, (answer) => {\n rl.close();\n resolve(answer.trim());\n });\n });\n}\n\nexport async function runInitCommand(args: string[]): Promise<void> {\n const nonInteractive = args.includes(\"--yes\") || args.includes(\"-y\") || args.includes(\"--non-interactive\");\n const filteredArgs = args.filter((a) => ![\"--yes\", \"-y\", \"--non-interactive\", \"--help\", \"-h\"].includes(a));\n let sesameApiKey = filteredArgs[0];\n\n if (args.includes(\"--help\") || args.includes(\"-h\")) {\n printHelp();\n return;\n }\n\n console.log(`\n ╦ ╦╦╦ ╦╔═╗╔╦╗╦╔╗╔╔╦╗\n ╠═╣║╚╗╔╝║╣ ║║║║║║║ ║║\n ╩ ╩╩ ╚╝ ╚═╝╩ ╩╩╝╚╝═╩╝\n Agent Initialization\n`);\n\n // --- Step 1: Get Sesame API key ---\n if (!sesameApiKey) {\n sesameApiKey = await prompt(\" Sesame API key: \");\n }\n if (!sesameApiKey) {\n console.error(\"Error: Sesame API key is required\");\n process.exit(1);\n }\n\n // --- Step 2: Connect to Sesame and fetch manifest ---\n console.log(\"\\n→ Connecting to Sesame...\");\n const sdk = new SesameClient({\n apiUrl: \"https://api.sesame.space\",\n wsUrl: \"wss://ws.sesame.space\",\n apiKey: sesameApiKey,\n });\n\n let config: ProvisioningConfig;\n try {\n const manifest = await sdk.getManifest();\n console.log(` ✓ Authenticated as ${manifest.agent.handle} (${manifest.agent.id})`);\n console.log(` ✓ Workspace: ${manifest.workspace.name}`);\n console.log(` ✓ Channels: ${manifest.channels.length}`);\n for (const ch of manifest.channels) {\n console.log(` - ${ch.name || ch.id} (${ch.kind})`);\n }\n\n config = {\n agentName: manifest.agent.handle,\n agentHandle: manifest.agent.handle,\n agentId: manifest.agent.id,\n channels: manifest.channels.map((ch) => ({\n id: ch.id,\n name: ch.name,\n kind: ch.kind,\n })),\n };\n\n // --- Step 3: Check vault for config ---\n console.log(\"\\n→ Checking vault for provisioning config...\");\n try {\n const vaultResp = await sdk.listVaultItems() as any;\n const items = vaultResp.items || vaultResp.data || [];\n const configItem = items.find((i: any) => i.name === VAULT_CONFIG_NAME);\n\n if (configItem) {\n console.log(` ✓ Found ${VAULT_CONFIG_NAME} vault item`);\n const revealResp = await sdk.revealItem(configItem.id) as any;\n const fields = revealResp.fields || revealResp.data || {};\n\n config.llmApiKey = fields.llm_api_key || fields.openrouter_api_key;\n config.llmBaseUrl = fields.llm_base_url;\n config.llmModel = fields.llm_model;\n config.personality = fields.agent_personality || fields.personality;\n config.fleetRole = fields.fleet_role;\n\n if (config.llmApiKey) console.log(\" ✓ LLM API key loaded from vault\");\n if (config.personality) console.log(` ✓ Personality: ${config.personality.slice(0, 60)}...`);\n if (config.fleetRole) console.log(` ✓ Fleet role: ${config.fleetRole}`);\n } else {\n console.log(\" ! No hivemind-config vault item found\");\n console.log(\" ! Will prompt for LLM API key instead\");\n }\n } catch (err) {\n console.log(` ! Could not read vault: ${(err as Error).message}`);\n }\n } catch (err) {\n console.error(`\\n ✗ Failed to connect to Sesame: ${(err as Error).message}`);\n console.error(\" Check your API key and try again.\");\n process.exit(1);\n } finally {\n sdk.disconnect();\n }\n\n // --- Step 4: Prompt for anything missing (skip in non-interactive mode) ---\n if (!config.llmApiKey && !nonInteractive) {\n config.llmApiKey = await prompt(\"\\n OpenRouter API key: \");\n } else if (!config.llmApiKey) {\n console.log(\" ! No LLM API key found in vault — set LLM_API_KEY in .env after init\");\n }\n\n if (!nonInteractive) {\n const nameOverride = await prompt(` Agent name [${config.agentName}]: `);\n if (nameOverride) config.agentName = nameOverride;\n }\n\n // --- Step 5: Write config files ---\n console.log(\"\\n→ Writing configuration...\");\n\n mkdirSync(CONFIG_DIR, { recursive: true });\n mkdirSync(WORKSPACE_DIR, { recursive: true });\n\n // Write workspace identity files\n const soulPath = resolve(WORKSPACE_DIR, \"SOUL.md\");\n if (!existsSync(soulPath)) {\n const personality = config.personality || \"A helpful, capable agent.\";\n writeFileSync(soulPath, `# SOUL.md — Who You Are\n\n${personality}\n\n---\n\n_This file defines your personality and values. Edit it to evolve who you are._\n`);\n console.log(` ✓ ${soulPath}`);\n }\n\n const identityPath = resolve(WORKSPACE_DIR, \"IDENTITY.md\");\n if (!existsSync(identityPath)) {\n writeFileSync(identityPath, `# IDENTITY.md\n\n- **Name:** ${config.agentName}\n- **Handle:** ${config.agentHandle}\n- **Agent ID:** ${config.agentId}\n`);\n console.log(` ✓ ${identityPath}`);\n }\n\n // Write local.toml (overrides)\n const localToml = `# Generated by hivemind init — ${new Date().toISOString()}\n# Overrides config/default.toml with agent-specific settings\n\n[agent]\nname = \"${config.agentName}\"\n${config.personality ? `personality = \"${config.personality.replace(/\"/g, '\\\\\"')}\"` : \"# personality = (using default)\"}\nworkspace = \"workspace\"\n\n${config.llmModel ? `[llm]\\nmodel = \"${config.llmModel}\"` : \"# [llm] using defaults\"}\n${config.llmBaseUrl ? `# base_url = \"${config.llmBaseUrl}\"` : \"\"}\n`;\n\n writeFileSync(LOCAL_TOML, localToml);\n console.log(` ✓ ${LOCAL_TOML}`);\n\n // Write .env\n const envContent = `# Hivemind Agent — ${config.agentName}\n# Generated by hivemind init — ${new Date().toISOString()}\nSESAME_API_KEY=${sesameApiKey}\nLLM_API_KEY=${config.llmApiKey || \"\"}\nAGENT_NAME=${config.agentName}\n`;\n\n writeFileSync(ENV_FILE, envContent, { mode: 0o600 });\n console.log(` ✓ ${ENV_FILE} (chmod 600)`);\n\n // --- Done ---\n console.log(`\n ✓ Hivemind initialized for ${config.agentName}!\n\n To start the agent:\n ./start.sh\n\n To start in background:\n nohup ./start.sh > /tmp/hivemind.log 2>&1 &\n\n Agent ID: ${config.agentId}\n Channels: ${config.channels.map((c) => c.name || c.id).join(\", \")}\n Fleet role: ${config.fleetRole || \"standalone\"}\n`);\n}\n\nfunction printHelp(): void {\n console.log(`hivemind init — Initialize a Hivemind agent from Sesame\n\nUsage: hivemind init [sesame-api-key]\n\nThe API key can also be passed as the first argument.\n\nWhat it does:\n 1. Connects to Sesame and fetches agent identity\n 2. Reads provisioning config from Sesame vault (if available)\n 3. Prompts for any missing configuration\n 4. Writes config/local.toml and .env\n\nOptions:\n -h, --help Show this help\n`);\n}\n"],"mappings":";;;;;AAAA,SAAS,eAAwB;AACjC,SAAS,YAAY,eAAe,iBAA+B;AACnE,SAAS,uBAAuB;AAGhC,IAAM,eAAe,QAAQ,QAAQ,IAAI,iBAAiB,GAAG;AAC7D,IAAM,aAAa,QAAQ,cAAc,QAAQ;AACjD,IAAM,gBAAgB,QAAQ,cAAc,WAAW;AACvD,IAAM,WAAW,QAAQ,cAAc,MAAM;AAC7C,IAAM,aAAa,QAAQ,YAAY,YAAY;AAEnD,IAAM,oBAAoB;AAc1B,eAAe,OAAO,UAAmC;AACvD,QAAM,KAAK,gBAAgB,EAAE,OAAO,QAAQ,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAC3E,SAAO,IAAI,QAAQ,CAACA,aAAY;AAC9B,OAAG,SAAS,UAAU,CAAC,WAAW;AAChC,SAAG,MAAM;AACT,MAAAA,SAAQ,OAAO,KAAK,CAAC;AAAA,IACvB,CAAC;AAAA,EACH,CAAC;AACH;AAEA,eAAsB,eAAe,MAA+B;AAClE,QAAM,iBAAiB,KAAK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SAAS;AAAA;AAG3B,gBAAc,UAAU,YAAY,EAAE,MAAM,IAAM,CAAC;AACnD,UAAQ,IAAI,YAAO,QAAQ,cAAc;AAGzC,UAAQ,IAAI;AAAA,oCACiB,OAAO,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAQ/B,OAAO,OAAO;AAAA,gBACd,OAAO,SAAS,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;AAAA,gBACrD,OAAO,aAAa,YAAY;AAAA,CAC/C;AACD;AAEA,SAAS,YAAkB;AACzB,UAAQ,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAcb;AACD;","names":["resolve"]}
@@ -1,38 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
- mod
31
- ));
32
-
33
- export {
34
- __require,
35
- __commonJS,
36
- __toESM
37
- };
38
- //# sourceMappingURL=chunk-7D4SUZUM.js.map