@sesamespace/hivemind 0.10.0 → 0.11.1

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 (52) hide show
  1. package/.pnpmrc.json +1 -0
  2. package/AUTO-DEBUG-DESIGN.md +267 -0
  3. package/AUTOMATIC-MEMORY-MANAGEMENT.md +109 -0
  4. package/DASHBOARD-PLAN.md +206 -0
  5. package/MEMORY-ENHANCEMENT-PLAN.md +211 -0
  6. package/TOOL-USE-DESIGN.md +173 -0
  7. package/dist/{chunk-FBQBBAPZ.js → chunk-4C6B2AMB.js} +2 -2
  8. package/dist/{chunk-FK6WYXRM.js → chunk-4YXOQGQC.js} +2 -2
  9. package/dist/{chunk-IXBIAX76.js → chunk-K6KL2VD6.js} +2 -2
  10. package/dist/{chunk-IJRAVHQC.js → chunk-LWJCKTQP.js} +51 -11
  11. package/dist/chunk-LWJCKTQP.js.map +1 -0
  12. package/dist/{chunk-BHCDOHSK.js → chunk-LYL5GG2F.js} +3 -3
  13. package/dist/{chunk-M3A2WRXM.js → chunk-OB6OXLPC.js} +430 -2
  14. package/dist/chunk-OB6OXLPC.js.map +1 -0
  15. package/dist/{chunk-DPLCEMEC.js → chunk-ZA4NWNS6.js} +2 -2
  16. package/dist/commands/fleet.js +3 -3
  17. package/dist/commands/init.js +3 -3
  18. package/dist/commands/service.js +1 -1
  19. package/dist/commands/start.js +3 -3
  20. package/dist/commands/watchdog.js +3 -3
  21. package/dist/dashboard.html +100 -60
  22. package/dist/index.js +2 -2
  23. package/dist/main.js +7 -7
  24. package/dist/start.js +1 -1
  25. package/docs/TOOL-PARITY-PLAN.md +191 -0
  26. package/package.json +23 -24
  27. package/src/memory/dashboard-integration.ts +295 -0
  28. package/src/memory/index.ts +187 -0
  29. package/src/memory/performance-test.ts +208 -0
  30. package/src/memory/processors/agent-sync.ts +312 -0
  31. package/src/memory/processors/command-learner.ts +298 -0
  32. package/src/memory/processors/memory-api-client.ts +105 -0
  33. package/src/memory/processors/message-flow-integration.ts +168 -0
  34. package/src/memory/processors/research-digester.ts +204 -0
  35. package/test-caitlin-access.md +11 -0
  36. package/dist/chunk-IJRAVHQC.js.map +0 -1
  37. package/dist/chunk-M3A2WRXM.js.map +0 -1
  38. package/install.sh +0 -162
  39. package/packages/memory/Cargo.lock +0 -6480
  40. package/packages/memory/Cargo.toml +0 -21
  41. package/packages/memory/src/src/context.rs +0 -179
  42. package/packages/memory/src/src/embeddings.rs +0 -51
  43. package/packages/memory/src/src/main.rs +0 -887
  44. package/packages/memory/src/src/promotion.rs +0 -808
  45. package/packages/memory/src/src/scoring.rs +0 -142
  46. package/packages/memory/src/src/store.rs +0 -460
  47. package/packages/memory/src/src/tasks.rs +0 -321
  48. /package/dist/{chunk-FBQBBAPZ.js.map → chunk-4C6B2AMB.js.map} +0 -0
  49. /package/dist/{chunk-FK6WYXRM.js.map → chunk-4YXOQGQC.js.map} +0 -0
  50. /package/dist/{chunk-IXBIAX76.js.map → chunk-K6KL2VD6.js.map} +0 -0
  51. /package/dist/{chunk-BHCDOHSK.js.map → chunk-LYL5GG2F.js.map} +0 -0
  52. /package/dist/{chunk-DPLCEMEC.js.map → chunk-ZA4NWNS6.js.map} +0 -0
@@ -0,0 +1,211 @@
1
+ # Memory Enhancement Plan — Automatic Context Management
2
+
3
+ ## Vision
4
+ Transform Hivemind's memory system from passive storage to active context management. Background processes continuously organize, index, and surface relevant information without agent intervention.
5
+
6
+ ## Core Enhancements
7
+
8
+ ### 1. Code Context Tracking
9
+ **Background Process:** `code-indexer`
10
+ - Monitors file access patterns (which files the agent reads/writes)
11
+ - Extracts key structures: functions, classes, interfaces, schemas
12
+ - Maintains a "working set" of active code elements
13
+ - Updates git commit context automatically
14
+ - Indexes by: project, language, purpose, last-accessed
15
+
16
+ **Data Structure:**
17
+ ```json
18
+ {
19
+ "type": "code_context",
20
+ "project": "hivemind",
21
+ "file": "packages/runtime/src/agent.ts",
22
+ "elements": [
23
+ {
24
+ "name": "processMessage",
25
+ "type": "function",
26
+ "signature": "(msg: Message): Promise<Response>",
27
+ "purpose": "Core message processing loop",
28
+ "dependencies": ["memory-client", "router"]
29
+ }
30
+ ],
31
+ "last_accessed": "2024-01-15T10:30:00Z",
32
+ "access_count": 15,
33
+ "git_context": {
34
+ "branch": "feature/memory-enhancement",
35
+ "last_commit": "abc123",
36
+ "modified": true
37
+ }
38
+ }
39
+ ```
40
+
41
+ ### 2. Web Research Digestion
42
+ **Background Process:** `research-digester`
43
+ - Monitors web fetch/browse operations
44
+ - Extracts key concepts, APIs, solutions
45
+ - Links research to active tasks/projects
46
+ - Builds knowledge graph of related concepts
47
+ - Identifies patterns across multiple sources
48
+
49
+ **Data Structure:**
50
+ ```json
51
+ {
52
+ "type": "research_insight",
53
+ "url": "https://docs.example.com/api",
54
+ "project": "sesame-integration",
55
+ "extracted": {
56
+ "key_concepts": ["OAuth flow", "webhook endpoints"],
57
+ "code_examples": ["const auth = await getToken()..."],
58
+ "warnings": ["Rate limit: 100 req/min"],
59
+ "related_to": ["auth-implementation", "rate-limiting"]
60
+ },
61
+ "timestamp": "2024-01-15T09:00:00Z",
62
+ "referenced_count": 3
63
+ }
64
+ ```
65
+
66
+ ### 3. Task State Management
67
+ **Background Process:** `task-tracker`
68
+ - Monitors agent actions and maps to task progress
69
+ - Detects task transitions (started, blocked, completed)
70
+ - Tracks dependencies and blockers
71
+ - Identifies patterns in task completion
72
+ - Surfaces relevant context when returning to a task
73
+
74
+ **Data Structure:**
75
+ ```json
76
+ {
77
+ "type": "task_state",
78
+ "id": "implement-dashboard",
79
+ "project": "hivemind",
80
+ "status": "in_progress",
81
+ "progress": {
82
+ "completed": ["setup routes", "basic UI"],
83
+ "current": "implement request filtering",
84
+ "next": ["add export functionality", "write tests"]
85
+ },
86
+ "context": {
87
+ "key_files": ["src/dashboard/server.js", "src/dashboard/index.html"],
88
+ "recent_decisions": ["use server-sent events for real-time updates"],
89
+ "blockers": [],
90
+ "time_spent": "3.5 hours"
91
+ },
92
+ "last_updated": "2024-01-15T11:00:00Z"
93
+ }
94
+ ```
95
+
96
+ ### 4. Tool Usage Patterns
97
+ **Background Process:** `command-learner`
98
+ - Tracks successful command sequences
99
+ - Identifies common patterns and workflows
100
+ - Builds "recipes" for common tasks
101
+ - Learns from failures and corrections
102
+ - Suggests optimizations
103
+
104
+ **Data Structure:**
105
+ ```json
106
+ {
107
+ "type": "tool_pattern",
108
+ "name": "github-push-workflow",
109
+ "triggers": ["git push", "push changes"],
110
+ "sequence": [
111
+ {"tool": "git_status", "check": "has_changes"},
112
+ {"tool": "git_add", "params": {"files": "."}}
113
+ {"tool": "git_commit", "params": {"message": "<generated>"}},
114
+ {"tool": "git_push", "params": {"remote": "origin"}}
115
+ ],
116
+ "success_rate": 0.95,
117
+ "last_used": "2024-01-15T10:00:00Z",
118
+ "variations": ["with-specific-files", "force-push"]
119
+ }
120
+ ```
121
+
122
+ ### 5. Cross-Agent Awareness
123
+ **Background Process:** `agent-sync`
124
+ - Monitors Sesame channels for other agent activity
125
+ - Extracts "public knowledge" from agent interactions
126
+ - Tracks handoff points and collaboration patterns
127
+ - Maintains agent capability registry
128
+ - Identifies complementary skills
129
+
130
+ **Data Structure:**
131
+ ```json
132
+ {
133
+ "type": "agent_knowledge",
134
+ "agent": "bailey",
135
+ "capabilities": ["rust development", "system architecture"],
136
+ "current_focus": ["hivemind dashboard", "memory optimization"],
137
+ "collaboration_points": [
138
+ {
139
+ "task": "dashboard-implementation",
140
+ "status": "bailey-implementing",
141
+ "handoff_ready": "2024-01-16"
142
+ }
143
+ ],
144
+ "last_seen": "2024-01-15T11:30:00Z"
145
+ }
146
+ ```
147
+
148
+ ## Implementation Architecture
149
+
150
+ ### Background Process Framework
151
+ ```typescript
152
+ interface BackgroundProcess {
153
+ name: string;
154
+ interval: number; // milliseconds
155
+ async run(context: ProcessContext): Promise<void>;
156
+ async shouldRun(context: ProcessContext): Promise<boolean>;
157
+ }
158
+
159
+ class ProcessManager {
160
+ private processes: Map<string, BackgroundProcess>;
161
+ private memory: MemoryClient;
162
+
163
+ async start() {
164
+ for (const [name, process] of this.processes) {
165
+ setInterval(async () => {
166
+ if (await process.shouldRun(this.context)) {
167
+ await process.run(this.context);
168
+ }
169
+ }, process.interval);
170
+ }
171
+ }
172
+ }
173
+ ```
174
+
175
+ ### Memory Indexing Strategy
176
+ 1. **Write-through cache**: All observations written immediately to L2
177
+ 2. **Background indexing**: Processes run every 30s-5min depending on type
178
+ 3. **Smart batching**: Group related updates to minimize memory churn
179
+ 4. **Relevance scoring**: Continuously update scores based on access patterns
180
+ 5. **Compression**: Older entries compressed/summarized, recent kept detailed
181
+
182
+ ### Context Injection
183
+ When building LLM prompts, the system will:
184
+ 1. Query active task state
185
+ 2. Include relevant code context (files, functions being worked on)
186
+ 3. Add recent research/documentation insights
187
+ 4. Include tool patterns for likely next actions
188
+ 5. Add cross-agent awareness if collaborating
189
+
190
+ ### Local Processing Power Usage
191
+ - **Embedding generation**: Ollama with local models (no API calls)
192
+ - **Pattern matching**: Rust-based processors for speed
193
+ - **Index management**: LanceDB for vector operations
194
+ - **File watching**: Native OS APIs for efficiency
195
+ - **Git operations**: libgit2 bindings for speed
196
+
197
+ ## Benefits
198
+ 1. **Zero cognitive load**: Agents don't think about memory management
199
+ 2. **Rich context**: Every request includes highly relevant information
200
+ 3. **Learning system**: Gets better at predicting needed context over time
201
+ 4. **Collaborative**: Agents automatically aware of each other's work
202
+ 5. **Efficient**: Background processing keeps LLM calls focused
203
+
204
+ ## Next Steps
205
+ 1. Implement the background process framework in TypeScript
206
+ 2. Create the first processor: `code-indexer`
207
+ 3. Test with real agent workflows
208
+ 4. Add remaining processors incrementally
209
+ 5. Optimize based on dashboard metrics
210
+
211
+ This system will make every Hivemind agent dramatically more capable without any changes to their prompts or behavior.
@@ -0,0 +1,173 @@
1
+ # Hivemind Tool Use — Architecture Design
2
+
3
+ ## Current State
4
+
5
+ The LLM client does simple chat completions: `messages[] → response.content`. No tool/function calling.
6
+
7
+ ## Goal
8
+
9
+ Full agentic tool-use loop matching OpenClaw capabilities, with Hivemind's memory system as a differentiator.
10
+
11
+ ## Architecture
12
+
13
+ ### 1. Tool Calling Protocol (OpenAI-compatible, works with OpenRouter)
14
+
15
+ The OpenAI chat completions API supports `tools` (function definitions) and `tool_choice`. When the model wants to use a tool, it returns a `tool_calls` array instead of (or alongside) content. We then execute the tool, append the result as a `tool` role message, and call the model again.
16
+
17
+ ```
18
+ User message
19
+
20
+ LLM (with tools defined)
21
+
22
+ If tool_calls → execute tools → append results → call LLM again (loop)
23
+ If content only → return response
24
+ ```
25
+
26
+ This is a **while loop**, not a single call. The model may chain multiple tool calls before producing a final text response.
27
+
28
+ ### 2. Key Data Structures
29
+
30
+ ```typescript
31
+ interface ToolDefinition {
32
+ name: string;
33
+ description: string;
34
+ parameters: JSONSchema; // JSON Schema for function params
35
+ }
36
+
37
+ interface ToolCall {
38
+ id: string;
39
+ type: "function";
40
+ function: { name: string; arguments: string }; // arguments is JSON string
41
+ }
42
+
43
+ interface ToolResult {
44
+ tool_call_id: string;
45
+ role: "tool";
46
+ content: string; // result as string
47
+ }
48
+
49
+ // Extended message types
50
+ interface AssistantMessage {
51
+ role: "assistant";
52
+ content: string | null;
53
+ tool_calls?: ToolCall[];
54
+ }
55
+
56
+ interface ToolMessage {
57
+ role: "tool";
58
+ tool_call_id: string;
59
+ content: string;
60
+ }
61
+ ```
62
+
63
+ ### 3. Tool Registry
64
+
65
+ A simple registry where tools are registered with:
66
+ - Name
67
+ - Description (for the LLM)
68
+ - JSON Schema for parameters
69
+ - Executor function: `(params: any) => Promise<string>`
70
+
71
+ ```typescript
72
+ class ToolRegistry {
73
+ private tools: Map<string, { def: ToolDefinition; exec: (params: any) => Promise<string> }>;
74
+
75
+ register(name, description, schema, executor): void;
76
+ getDefinitions(): ToolDefinition[]; // For LLM API call
77
+ execute(name: string, params: any): Promise<string>; // Run a tool
78
+ }
79
+ ```
80
+
81
+ ### 4. The Agentic Loop (in Agent.processMessage)
82
+
83
+ ```
84
+ 1. Build messages (system + history + user)
85
+ 2. Call LLM with tools
86
+ 3. While response has tool_calls:
87
+ a. For each tool_call: execute, collect result
88
+ b. Append assistant message (with tool_calls) to messages
89
+ c. Append tool result messages
90
+ d. Call LLM again with updated messages
91
+ 4. Return final text content
92
+ 5. Store in memory (include tool usage summary)
93
+ ```
94
+
95
+ **Safety limits:**
96
+ - Max iterations per turn (e.g., 25)
97
+ - Max total tokens per turn
98
+ - Tool execution timeout (per tool)
99
+ - Dangerous command confirmation (optional)
100
+
101
+ ### 5. Phase 1 Tools
102
+
103
+ #### `shell` (exec)
104
+ - Run a shell command, return stdout/stderr
105
+ - Working directory: `~/hivemind/workspace`
106
+ - Timeout: 30s default, configurable
107
+ - Safety: no `rm -rf /` etc.
108
+
109
+ #### `read_file`
110
+ - Read file contents (with optional offset/limit for large files)
111
+ - Returns text content or error
112
+
113
+ #### `write_file`
114
+ - Write content to a file (creates dirs if needed)
115
+ - Returns success/failure
116
+
117
+ #### `edit_file`
118
+ - Find and replace exact text in a file
119
+ - oldText → newText pattern (surgical edits)
120
+
121
+ #### `web_search`
122
+ - Search via Brave API
123
+ - Returns titles, URLs, snippets
124
+
125
+ #### `web_fetch`
126
+ - Fetch URL, extract markdown
127
+ - Returns readable content
128
+
129
+ ### 6. Memory Integration
130
+
131
+ Tool calls and results should be stored in memory, but summarized:
132
+ - Don't store full file contents in L2 episodes
133
+ - Store: "Used shell to run `git status`, found 3 modified files"
134
+ - L3 promotion can learn patterns: "For git operations, agent uses shell tool"
135
+
136
+ ### 7. Config
137
+
138
+ ```toml
139
+ [tools]
140
+ enabled = true
141
+ max_iterations = 25
142
+ shell_timeout_s = 30
143
+ workspace = "workspace"
144
+
145
+ [tools.web_search]
146
+ api_key = "" # or from vault
147
+ ```
148
+
149
+ ### 8. Implementation Order
150
+
151
+ 1. **ToolRegistry class** — registration, definitions, execution
152
+ 2. **LLMClient.chatWithTools()** — extended chat that handles tool_calls
153
+ 3. **Agentic loop in Agent** — the while loop with safety limits
154
+ 4. **shell tool** — most impactful, enables everything
155
+ 5. **File tools** — read/write/edit
156
+ 6. **Web tools** — search/fetch
157
+ 7. **Memory integration** — summarize tool usage in episodes
158
+
159
+ ### 9. OpenRouter Compatibility
160
+
161
+ OpenRouter passes through tool definitions to the underlying model. Most models support tools:
162
+ - Claude: Native tool_use
163
+ - GPT-4: Native function_calling
164
+ - Gemini: Native function declarations
165
+
166
+ The OpenAI-compatible format works for all of them through OpenRouter.
167
+
168
+ ### 10. Safety Considerations
169
+
170
+ - **Sandbox**: Tools run on the agent's machine. File access should be scoped to workspace.
171
+ - **Confirmation**: Optionally require human approval for destructive operations.
172
+ - **Logging**: All tool calls logged to request logger for debugging.
173
+ - **Rate limiting**: Prevent runaway tool loops.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FleetManager
3
- } from "./chunk-IXBIAX76.js";
3
+ } from "./chunk-K6KL2VD6.js";
4
4
 
5
5
  // packages/cli/src/commands/fleet.ts
6
6
  function formatUptime(seconds) {
@@ -183,4 +183,4 @@ Commands:
183
183
  export {
184
184
  runFleetCommand
185
185
  };
186
- //# sourceMappingURL=chunk-FBQBBAPZ.js.map
186
+ //# sourceMappingURL=chunk-4C6B2AMB.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SesameClient,
3
3
  getClaudeCodeOAuthToken
4
- } from "./chunk-M3A2WRXM.js";
4
+ } from "./chunk-OB6OXLPC.js";
5
5
 
6
6
  // packages/cli/src/commands/init.ts
7
7
  import { resolve, dirname } from "path";
@@ -436,4 +436,4 @@ Options:
436
436
  export {
437
437
  runInitCommand
438
438
  };
439
- //# sourceMappingURL=chunk-FK6WYXRM.js.map
439
+ //# sourceMappingURL=chunk-4YXOQGQC.js.map
@@ -7,7 +7,7 @@ import {
7
7
  SesameClient2 as SesameClient,
8
8
  WORKER_ROUTES,
9
9
  createLogger
10
- } from "./chunk-M3A2WRXM.js";
10
+ } from "./chunk-OB6OXLPC.js";
11
11
 
12
12
  // packages/runtime/src/watchdog.ts
13
13
  import { execSync } from "child_process";
@@ -1095,4 +1095,4 @@ export {
1095
1095
  WorkerMemorySync,
1096
1096
  PrimaryMemorySync
1097
1097
  };
1098
- //# sourceMappingURL=chunk-IXBIAX76.js.map
1098
+ //# sourceMappingURL=chunk-K6KL2VD6.js.map
@@ -1,6 +1,6 @@
1
1
  // packages/cli/src/commands/service.ts
2
2
  import { resolve } from "path";
3
- import { writeFileSync, existsSync, unlinkSync, mkdirSync } from "fs";
3
+ import { writeFileSync, existsSync, unlinkSync, mkdirSync, readFileSync } from "fs";
4
4
  import { execSync } from "child_process";
5
5
  import { homedir } from "os";
6
6
  var LAUNCH_AGENTS_DIR = resolve(homedir(), "Library/LaunchAgents");
@@ -22,6 +22,14 @@ function getHivemindBin() {
22
22
  function generateMemoryPlist(hivemindHome) {
23
23
  const memoryBin = resolve(hivemindHome, "bin", "hivemind-memory");
24
24
  const dbPath = resolve(hivemindHome, "data", "lancedb");
25
+ const pidFile = `/tmp/hivemind-memory.pid`;
26
+ const wrapperScript = resolve(hivemindHome, "bin", "memory-wrapper.sh");
27
+ const wrapperContent = `#!/bin/bash
28
+ echo $ > ${pidFile}
29
+ exec "${memoryBin}" "$@"
30
+ `;
31
+ writeFileSync(wrapperScript, wrapperContent);
32
+ execSync(`chmod +x "${wrapperScript}"`);
25
33
  return `<?xml version="1.0" encoding="UTF-8"?>
26
34
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
27
35
  <plist version="1.0">
@@ -30,7 +38,7 @@ function generateMemoryPlist(hivemindHome) {
30
38
  <string>${MEMORY_LABEL}</string>
31
39
  <key>ProgramArguments</key>
32
40
  <array>
33
- <string>${memoryBin}</string>
41
+ <string>${wrapperScript}</string>
34
42
  </array>
35
43
  <key>WorkingDirectory</key>
36
44
  <string>${hivemindHome}</string>
@@ -59,6 +67,14 @@ function generateMemoryPlist(hivemindHome) {
59
67
  </plist>`;
60
68
  }
61
69
  function generateWatchdogPlist(hivemindHome, hivemindBin) {
70
+ const pidFile = `/tmp/hivemind-watchdog.pid`;
71
+ const wrapperScript = resolve(hivemindHome, "bin", "watchdog-wrapper.sh");
72
+ const wrapperContent = `#!/bin/bash
73
+ echo $ > ${pidFile}
74
+ exec "${hivemindBin}" watchdog "$@"
75
+ `;
76
+ writeFileSync(wrapperScript, wrapperContent);
77
+ execSync(`chmod +x "${wrapperScript}"`);
62
78
  return `<?xml version="1.0" encoding="UTF-8"?>
63
79
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
64
80
  <plist version="1.0">
@@ -67,8 +83,7 @@ function generateWatchdogPlist(hivemindHome, hivemindBin) {
67
83
  <string>${WATCHDOG_LABEL}</string>
68
84
  <key>ProgramArguments</key>
69
85
  <array>
70
- <string>${hivemindBin}</string>
71
- <string>watchdog</string>
86
+ <string>${wrapperScript}</string>
72
87
  </array>
73
88
  <key>WorkingDirectory</key>
74
89
  <string>${hivemindHome}</string>
@@ -93,6 +108,14 @@ function generateWatchdogPlist(hivemindHome, hivemindBin) {
93
108
  </plist>`;
94
109
  }
95
110
  function generatePlist(hivemindHome, hivemindBin) {
111
+ const pidFile = `/tmp/hivemind-agent.pid`;
112
+ const wrapperScript = resolve(hivemindHome, "bin", "agent-wrapper.sh");
113
+ const wrapperContent = `#!/bin/bash
114
+ echo $ > ${pidFile}
115
+ exec "${hivemindBin}" start "$@"
116
+ `;
117
+ writeFileSync(wrapperScript, wrapperContent);
118
+ execSync(`chmod +x "${wrapperScript}"`);
96
119
  return `<?xml version="1.0" encoding="UTF-8"?>
97
120
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
98
121
  <plist version="1.0">
@@ -101,8 +124,7 @@ function generatePlist(hivemindHome, hivemindBin) {
101
124
  <string>${AGENT_LABEL}</string>
102
125
  <key>ProgramArguments</key>
103
126
  <array>
104
- <string>${hivemindBin}</string>
105
- <string>start</string>
127
+ <string>${wrapperScript}</string>
106
128
  </array>
107
129
  <key>WorkingDirectory</key>
108
130
  <string>${hivemindHome}</string>
@@ -269,12 +291,30 @@ function startService() {
269
291
  }
270
292
  function showStatus() {
271
293
  console.log("\n\u2192 Service status\n");
294
+ const pidFiles = {
295
+ [AGENT_LABEL]: "/tmp/hivemind-agent.pid",
296
+ [WATCHDOG_LABEL]: "/tmp/hivemind-watchdog.pid",
297
+ [MEMORY_LABEL]: "/tmp/hivemind-memory.pid"
298
+ };
272
299
  for (const label of [AGENT_LABEL, WATCHDOG_LABEL, MEMORY_LABEL]) {
273
300
  try {
274
- const out = execSync(`launchctl list ${label} 2>/dev/null`, { encoding: "utf-8" });
275
- const pidMatch = out.match(/"PID"\s*=\s*(\d+)/);
276
- const pid = pidMatch ? pidMatch[1] : "unknown";
277
- console.log(` \u2713 ${label}: running (PID ${pid})`);
301
+ execSync(`launchctl list ${label} 2>/dev/null`, { encoding: "utf-8" });
302
+ let pid = "unknown";
303
+ const pidFile = pidFiles[label];
304
+ if (existsSync(pidFile)) {
305
+ const filePid = readFileSync(pidFile, "utf-8").trim();
306
+ try {
307
+ execSync(`ps -p ${filePid} > /dev/null 2>&1`);
308
+ pid = filePid;
309
+ } catch {
310
+ pid = "stale";
311
+ }
312
+ }
313
+ if (pid === "stale") {
314
+ console.log(` ! ${label}: loaded but not running (stale PID file)`);
315
+ } else {
316
+ console.log(` \u2713 ${label}: running (PID ${pid})`);
317
+ }
278
318
  } catch {
279
319
  console.log(` - ${label}: not running`);
280
320
  }
@@ -324,4 +364,4 @@ Services:
324
364
  export {
325
365
  runServiceCommand
326
366
  };
327
- //# sourceMappingURL=chunk-IJRAVHQC.js.map
367
+ //# sourceMappingURL=chunk-LWJCKTQP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../packages/cli/src/commands/service.ts"],"sourcesContent":["import { resolve } from \"path\";\nimport { writeFileSync, existsSync, unlinkSync, mkdirSync, readFileSync } from \"fs\";\nimport { execSync } from \"child_process\";\nimport { homedir } from \"os\";\n\nconst LAUNCH_AGENTS_DIR = resolve(homedir(), \"Library/LaunchAgents\");\nconst AGENT_LABEL = \"com.hivemind.agent\";\nconst WATCHDOG_LABEL = \"com.hivemind.watchdog\";\nconst MEMORY_LABEL = \"com.hivemind.memory\";\nconst STOP_FLAG_FILE = \"/tmp/hivemind-agent.stopped\";\n\nfunction getHivemindHome(): string {\n return process.env.HIVEMIND_HOME || resolve(homedir(), \"hivemind\");\n}\n\nfunction getHivemindBin(): string {\n // Try to find the hivemind binary\n try {\n const which = execSync(\"which hivemind\", { encoding: \"utf-8\" }).trim();\n if (which) return which;\n } catch {}\n // Fallback to process.argv[1] (the script being run)\n return process.argv[1] || \"hivemind\";\n}\n\nfunction generateMemoryPlist(hivemindHome: string): string {\n const memoryBin = resolve(hivemindHome, \"bin\", \"hivemind-memory\");\n const dbPath = resolve(hivemindHome, \"data\", \"lancedb\");\n const pidFile = `/tmp/hivemind-memory.pid`;\n \n // Create a wrapper script that writes PID\n const wrapperScript = resolve(hivemindHome, \"bin\", \"memory-wrapper.sh\");\n const wrapperContent = `#!/bin/bash\necho $ > ${pidFile}\nexec \"${memoryBin}\" \"$@\"\n`;\n writeFileSync(wrapperScript, wrapperContent);\n execSync(`chmod +x \"${wrapperScript}\"`);\n \n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>Label</key>\n <string>${MEMORY_LABEL}</string>\n <key>ProgramArguments</key>\n <array>\n <string>${wrapperScript}</string>\n </array>\n <key>WorkingDirectory</key>\n <string>${hivemindHome}</string>\n <key>EnvironmentVariables</key>\n <dict>\n <key>PORT</key>\n <string>3434</string>\n <key>DB_PATH</key>\n <string>${dbPath}</string>\n <key>OLLAMA_URL</key>\n <string>http://localhost:11434</string>\n <key>EMBEDDING_MODEL</key>\n <string>nomic-embed-text</string>\n </dict>\n <key>RunAtLoad</key>\n <true/>\n <key>KeepAlive</key>\n <true/>\n <key>StandardOutPath</key>\n <string>/tmp/hivemind-memory.log</string>\n <key>StandardErrorPath</key>\n <string>/tmp/hivemind-memory-error.log</string>\n <key>ThrottleInterval</key>\n <integer>5</integer>\n</dict>\n</plist>`;\n}\n\nfunction generateWatchdogPlist(hivemindHome: string, hivemindBin: string): string {\n const pidFile = `/tmp/hivemind-watchdog.pid`;\n \n // Create a wrapper script that writes PID\n const wrapperScript = resolve(hivemindHome, \"bin\", \"watchdog-wrapper.sh\");\n const wrapperContent = `#!/bin/bash\necho $ > ${pidFile}\nexec \"${hivemindBin}\" watchdog \"$@\"\n`;\n writeFileSync(wrapperScript, wrapperContent);\n execSync(`chmod +x \"${wrapperScript}\"`);\n \n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>Label</key>\n <string>${WATCHDOG_LABEL}</string>\n <key>ProgramArguments</key>\n <array>\n <string>${wrapperScript}</string>\n </array>\n <key>WorkingDirectory</key>\n <string>${hivemindHome}</string>\n <key>EnvironmentVariables</key>\n <dict>\n <key>PATH</key>\n <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>\n <key>HIVEMIND_HOME</key>\n <string>${hivemindHome}</string>\n </dict>\n <key>RunAtLoad</key>\n <true/>\n <key>KeepAlive</key>\n <true/>\n <key>StandardOutPath</key>\n <string>/tmp/hivemind-watchdog.log</string>\n <key>StandardErrorPath</key>\n <string>/tmp/hivemind-watchdog-error.log</string>\n <key>ThrottleInterval</key>\n <integer>5</integer>\n</dict>\n</plist>`;\n}\n\nfunction generatePlist(hivemindHome: string, hivemindBin: string): string {\n const pidFile = `/tmp/hivemind-agent.pid`;\n \n // Create a wrapper script that writes PID\n const wrapperScript = resolve(hivemindHome, \"bin\", \"agent-wrapper.sh\");\n const wrapperContent = `#!/bin/bash\necho $ > ${pidFile}\nexec \"${hivemindBin}\" start \"$@\"\n`;\n writeFileSync(wrapperScript, wrapperContent);\n execSync(`chmod +x \"${wrapperScript}\"`);\n \n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>Label</key>\n <string>${AGENT_LABEL}</string>\n <key>ProgramArguments</key>\n <array>\n <string>${wrapperScript}</string>\n </array>\n <key>WorkingDirectory</key>\n <string>${hivemindHome}</string>\n <key>EnvironmentVariables</key>\n <dict>\n <key>PATH</key>\n <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>\n <key>HIVEMIND_HOME</key>\n <string>${hivemindHome}</string>\n </dict>\n <key>RunAtLoad</key>\n <true/>\n <key>KeepAlive</key>\n <false/>\n <key>StandardOutPath</key>\n <string>/tmp/hivemind-agent.log</string>\n <key>StandardErrorPath</key>\n <string>/tmp/hivemind-error.log</string>\n <key>ThrottleInterval</key>\n <integer>5</integer>\n</dict>\n</plist>`;\n}\n\nexport async function runServiceCommand(args: string[]): Promise<void> {\n const subcommand = args[0];\n\n switch (subcommand) {\n case \"install\":\n await installService();\n break;\n case \"uninstall\":\n await uninstallService();\n break;\n case \"stop\":\n stopService();\n break;\n case \"start\":\n startService();\n break;\n case \"status\":\n showStatus();\n break;\n case \"logs\":\n showLogs(args[1]);\n break;\n default:\n printHelp();\n if (subcommand) {\n console.error(`Unknown subcommand: ${subcommand}`);\n process.exit(1);\n }\n break;\n }\n}\n\nasync function installService(): Promise<void> {\n const hivemindHome = getHivemindHome();\n const hivemindBin = getHivemindBin();\n const memoryBin = resolve(hivemindHome, \"bin\", \"hivemind-memory\");\n\n console.log(`\\n→ Installing launchd services for ${hivemindHome}\\n`);\n console.log(` Agent binary: ${hivemindBin}`);\n console.log(` Memory binary: ${memoryBin}`);\n\n mkdirSync(LAUNCH_AGENTS_DIR, { recursive: true });\n\n // --- Memory daemon service ---\n if (existsSync(memoryBin)) {\n const memoryPlist = generateMemoryPlist(hivemindHome);\n const memoryDest = resolve(LAUNCH_AGENTS_DIR, `${MEMORY_LABEL}.plist`);\n try { execSync(`launchctl unload ${memoryDest} 2>/dev/null`); } catch {}\n writeFileSync(memoryDest, memoryPlist);\n execSync(`launchctl load ${memoryDest}`);\n console.log(` ✓ ${MEMORY_LABEL} installed and started`);\n } else {\n console.log(` ! Memory daemon not found at ${memoryBin} — skipping`);\n console.log(` ! Run 'hivemind init' to download it`);\n }\n\n // --- Ollama service (ensure running) ---\n try {\n execSync(\"curl -sf http://localhost:11434/api/tags > /dev/null\", { stdio: \"ignore\" });\n console.log(\" ✓ Ollama already running\");\n } catch {\n try {\n execSync(\"brew services start ollama 2>/dev/null\", { stdio: \"ignore\" });\n console.log(\" ✓ Ollama started via brew services\");\n } catch {\n console.log(\" ! Ollama not running — start manually: ollama serve\");\n }\n }\n\n // --- Watchdog service ---\n const watchdogPlist = generateWatchdogPlist(hivemindHome, hivemindBin);\n const watchdogDest = resolve(LAUNCH_AGENTS_DIR, `${WATCHDOG_LABEL}.plist`);\n try { execSync(`launchctl unload ${watchdogDest} 2>/dev/null`); } catch {}\n writeFileSync(watchdogDest, watchdogPlist);\n execSync(`launchctl load ${watchdogDest}`);\n console.log(` ✓ ${WATCHDOG_LABEL} installed and started`);\n\n // --- Agent service (KeepAlive: false — watchdog manages restarts) ---\n const plistContent = generatePlist(hivemindHome, hivemindBin);\n const destPath = resolve(LAUNCH_AGENTS_DIR, `${AGENT_LABEL}.plist`);\n try { execSync(`launchctl unload ${destPath} 2>/dev/null`); } catch {}\n writeFileSync(destPath, plistContent);\n execSync(`launchctl load ${destPath}`);\n console.log(` ✓ ${AGENT_LABEL} installed and started`);\n\n console.log(\"\\n Services will auto-start on boot.\");\n console.log(\" Logs:\");\n console.log(\" Agent: /tmp/hivemind-agent.log\");\n console.log(\" Watchdog: /tmp/hivemind-watchdog.log\");\n console.log(\" Memory: /tmp/hivemind-memory.log\\n\");\n}\n\nasync function uninstallService(): Promise<void> {\n console.log(\"\\n→ Uninstalling launchd services\\n\");\n\n for (const label of [AGENT_LABEL, WATCHDOG_LABEL, MEMORY_LABEL]) {\n const plistPath = resolve(LAUNCH_AGENTS_DIR, `${label}.plist`);\n if (existsSync(plistPath)) {\n try { execSync(`launchctl unload ${plistPath} 2>/dev/null`); } catch {}\n unlinkSync(plistPath);\n console.log(` ✓ ${label} uninstalled`);\n } else {\n console.log(` - ${label} not installed`);\n }\n }\n\n // Clean up stop flag if present\n try { unlinkSync(STOP_FLAG_FILE); } catch {}\n console.log(\"\");\n}\n\nfunction stopService(): void {\n console.log(\"\\n→ Stopping agent\\n\");\n\n // Write stop flag so watchdog doesn't restart\n writeFileSync(STOP_FLAG_FILE, String(Date.now()));\n console.log(` ✓ Stop flag written (${STOP_FLAG_FILE})`);\n\n // Stop agent via launchctl\n try {\n const uid = execSync(\"id -u\", { encoding: \"utf-8\" }).trim();\n execSync(`launchctl kill SIGTERM gui/${uid}/${AGENT_LABEL} 2>/dev/null`);\n console.log(` ✓ ${AGENT_LABEL} stopped`);\n } catch {\n console.log(` - ${AGENT_LABEL} was not running`);\n }\n\n console.log(\" Watchdog will NOT restart the agent while stop flag exists.\");\n console.log(\" Use 'hivemind service start' to resume.\\n\");\n}\n\nfunction startService(): void {\n console.log(\"\\n→ Starting agent\\n\");\n\n // Remove stop flag\n try {\n unlinkSync(STOP_FLAG_FILE);\n console.log(` ✓ Stop flag removed (${STOP_FLAG_FILE})`);\n } catch {\n console.log(\" - No stop flag present\");\n }\n\n // Start agent via launchctl\n try {\n const uid = execSync(\"id -u\", { encoding: \"utf-8\" }).trim();\n execSync(`launchctl kickstart gui/${uid}/${AGENT_LABEL}`);\n console.log(` ✓ ${AGENT_LABEL} started`);\n } catch (err) {\n console.error(` ! Failed to start agent: ${(err as Error).message}`);\n }\n console.log(\"\");\n}\n\nfunction showStatus(): void {\n console.log(\"\\n→ Service status\\n\");\n \n const pidFiles: Record<string, string> = {\n [AGENT_LABEL]: \"/tmp/hivemind-agent.pid\",\n [WATCHDOG_LABEL]: \"/tmp/hivemind-watchdog.pid\",\n [MEMORY_LABEL]: \"/tmp/hivemind-memory.pid\"\n };\n \n for (const label of [AGENT_LABEL, WATCHDOG_LABEL, MEMORY_LABEL]) {\n try {\n // First check if service is loaded in launchctl\n execSync(`launchctl list ${label} 2>/dev/null`, { encoding: \"utf-8\" });\n \n // Then try to get PID from file\n let pid = \"unknown\";\n const pidFile = pidFiles[label];\n if (existsSync(pidFile)) {\n const filePid = readFileSync(pidFile, \"utf-8\").trim();\n // Verify the process is actually running\n try {\n execSync(`ps -p ${filePid} > /dev/null 2>&1`);\n pid = filePid;\n } catch {\n // PID file exists but process is dead\n pid = \"stale\";\n }\n }\n \n if (pid === \"stale\") {\n console.log(` ! ${label}: loaded but not running (stale PID file)`);\n } else {\n console.log(` ✓ ${label}: running (PID ${pid})`);\n }\n } catch {\n console.log(` - ${label}: not running`);\n }\n }\n\n // Check Ollama\n try {\n execSync(\"curl -sf http://localhost:11434/api/tags > /dev/null\", { stdio: \"ignore\" });\n console.log(\" ✓ ollama: running\");\n } catch {\n console.log(\" - ollama: not running\");\n }\n console.log(\"\");\n}\n\nfunction showLogs(which?: string): void {\n const logMap: Record<string, string> = {\n agent: \"/tmp/hivemind-agent.log\",\n error: \"/tmp/hivemind-error.log\",\n watchdog: \"/tmp/hivemind-watchdog.log\",\n memory: \"/tmp/hivemind-memory.log\",\n };\n const logFile = logMap[which || \"agent\"] || logMap.agent;\n try {\n execSync(`tail -30 ${logFile}`, { stdio: \"inherit\" });\n } catch {\n console.error(`No log file at ${logFile}`);\n }\n}\n\nfunction printHelp(): void {\n console.log(`hivemind service — Manage launchd services\n\nUsage: hivemind service <subcommand>\n\nSubcommands:\n install Install and start all launchd services (survives reboots)\n uninstall Stop and remove all launchd services\n stop Stop agent (watchdog will not restart it)\n start Start agent (removes stop flag)\n status Show service status\n logs [agent|watchdog|memory|error] Show recent logs\n\nServices:\n com.hivemind.watchdog — Watchdog daemon (health monitoring, restart/upgrade orchestration)\n com.hivemind.agent — Agent runtime (Node.js, Sesame) — managed by watchdog\n com.hivemind.memory — Memory daemon (LanceDB + Ollama embeddings)\n`);\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,eAAe,YAAY,YAAY,WAAW,oBAAoB;AAC/E,SAAS,gBAAgB;AACzB,SAAS,eAAe;AAExB,IAAM,oBAAoB,QAAQ,QAAQ,GAAG,sBAAsB;AACnE,IAAM,cAAc;AACpB,IAAM,iBAAiB;AACvB,IAAM,eAAe;AACrB,IAAM,iBAAiB;AAEvB,SAAS,kBAA0B;AACjC,SAAO,QAAQ,IAAI,iBAAiB,QAAQ,QAAQ,GAAG,UAAU;AACnE;AAEA,SAAS,iBAAyB;AAEhC,MAAI;AACF,UAAM,QAAQ,SAAS,kBAAkB,EAAE,UAAU,QAAQ,CAAC,EAAE,KAAK;AACrE,QAAI,MAAO,QAAO;AAAA,EACpB,QAAQ;AAAA,EAAC;AAET,SAAO,QAAQ,KAAK,CAAC,KAAK;AAC5B;AAEA,SAAS,oBAAoB,cAA8B;AACzD,QAAM,YAAY,QAAQ,cAAc,OAAO,iBAAiB;AAChE,QAAM,SAAS,QAAQ,cAAc,QAAQ,SAAS;AACtD,QAAM,UAAU;AAGhB,QAAM,gBAAgB,QAAQ,cAAc,OAAO,mBAAmB;AACtE,QAAM,iBAAiB;AAAA,WACd,OAAO;AAAA,QACV,SAAS;AAAA;AAEf,gBAAc,eAAe,cAAc;AAC3C,WAAS,aAAa,aAAa,GAAG;AAEtC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,YAKG,YAAY;AAAA;AAAA;AAAA,cAGV,aA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9B,UAAI,WAAW,OAAO,GAAG;AACvB,cAAM,UAAU,aAAa,SAAS,OAAO,EAAE,KAAK;AAEpD,YAAI;AACF,mBAAS,SAAS,OAAO,mBAAmB;AAC5C,gBAAM;AAAA,QACR,QAAQ;AAEN,gBAAM;AAAA,QACR;AAAA,MACF;AAEA,UAAI,QAAQ,SAAS;AACnB,gBAAQ,IAAI,OAAO,KAAK,2CAA2C;AAAA,MACrE,OAAO;AACL,gBAAQ,IAAI,YAAO,KAAK,kBAAkB,GAAG,GAAG;AAAA,MAClD;AAAA,IACF,QAAQ;AACN,cAAQ,IAAI,OAAO,KAAK,eAAe;AAAA,IACzC;AAAA,EACF;AAGA,MAAI;AACF,aAAS,wDAAwD,EAAE,OAAO,SAAS,CAAC;AACpF,YAAQ,IAAI,0BAAqB;AAAA,EACnC,QAAQ;AACN,YAAQ,IAAI,yBAAyB;AAAA,EACvC;AACA,UAAQ,IAAI,EAAE;AAChB;AAEA,SAAS,SAAS,OAAsB;AACtC,QAAM,SAAiC;AAAA,IACrC,OAAO;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AACA,QAAM,UAAU,OAAO,SAAS,OAAO,KAAK,OAAO;AACnD,MAAI;AACF,aAAS,YAAY,OAAO,IAAI,EAAE,OAAO,UAAU,CAAC;AAAA,EACtD,QAAQ;AACN,YAAQ,MAAM,kBAAkB,OAAO,EAAE;AAAA,EAC3C;AACF;AAEA,SAAS,YAAkB;AACzB,UAAQ,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAgBb;AACD;","names":[]}
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Watchdog
3
- } from "./chunk-IXBIAX76.js";
3
+ } from "./chunk-K6KL2VD6.js";
4
4
  import {
5
5
  defaultSentinelConfig,
6
6
  loadConfig
7
- } from "./chunk-M3A2WRXM.js";
7
+ } from "./chunk-OB6OXLPC.js";
8
8
 
9
9
  // packages/cli/src/commands/watchdog.ts
10
10
  import { resolve } from "path";
@@ -76,4 +76,4 @@ Options:
76
76
  export {
77
77
  runWatchdogCommand
78
78
  };
79
- //# sourceMappingURL=chunk-BHCDOHSK.js.map
79
+ //# sourceMappingURL=chunk-LYL5GG2F.js.map