@deeplake/hivemind 0.7.60 → 0.7.62

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 (34) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/bundle/cli.js +34 -0
  4. package/codex/bundle/capture.js +34 -0
  5. package/codex/bundle/commands/auth-login.js +34 -0
  6. package/codex/bundle/graph-pull-worker.js +34 -0
  7. package/codex/bundle/pre-tool-use.js +34 -0
  8. package/codex/bundle/session-start-setup.js +34 -0
  9. package/codex/bundle/session-start.js +34 -0
  10. package/codex/bundle/shell/deeplake-shell.js +34 -0
  11. package/codex/bundle/stop.js +34 -0
  12. package/cursor/bundle/capture.js +34 -0
  13. package/cursor/bundle/commands/auth-login.js +34 -0
  14. package/cursor/bundle/graph-pull-worker.js +34 -0
  15. package/cursor/bundle/pre-tool-use.js +34 -0
  16. package/cursor/bundle/session-start.js +34 -0
  17. package/cursor/bundle/shell/deeplake-shell.js +34 -0
  18. package/hermes/bundle/capture.js +34 -0
  19. package/hermes/bundle/commands/auth-login.js +34 -0
  20. package/hermes/bundle/graph-pull-worker.js +34 -0
  21. package/hermes/bundle/pre-tool-use.js +34 -0
  22. package/hermes/bundle/session-start.js +34 -0
  23. package/hermes/bundle/shell/deeplake-shell.js +34 -0
  24. package/mcp/bundle/server.js +34 -0
  25. package/openclaw/dist/index.js +29 -1
  26. package/openclaw/openclaw.plugin.json +1 -1
  27. package/openclaw/package.json +1 -1
  28. package/package.json +2 -1
  29. package/scripts/audit-openclaw-bundle.mjs +187 -0
  30. package/scripts/ensure-tree-sitter.mjs +91 -0
  31. package/scripts/pack-check.mjs +29 -0
  32. package/scripts/sync-versions.d.mts +15 -0
  33. package/scripts/sync-versions.mjs +103 -0
  34. package/scripts/verify-install.sh +218 -0
@@ -0,0 +1,218 @@
1
+ #!/usr/bin/env bash
2
+ # Hivemind install verifier — sanity-checks each of the 9 agent integrations.
3
+ #
4
+ # Run this after `npx -y @deeplake/hivemind install`. It checks file
5
+ # placement, config schema, dry-invokes hook scripts, and exercises the
6
+ # MCP server against its initialize handshake. Doesn't require any agent
7
+ # to actually be running — just verifies our installer's footprint.
8
+ #
9
+ # Exits 0 if everything we installed is healthy; 1 if any agent fails.
10
+ # Skips agents whose marker dir doesn't exist (you don't have them).
11
+ #
12
+ # Usage:
13
+ # bash scripts/verify-install.sh
14
+ # curl -sSL https://raw.githubusercontent.com/activeloopai/hivemind/main/scripts/verify-install.sh | bash
15
+
16
+ set -u
17
+
18
+ PASS=0
19
+ FAIL=0
20
+ SKIP=0
21
+
22
+ green() { printf "\033[0;32m%s\033[0m" "$1"; }
23
+ red() { printf "\033[0;31m%s\033[0m" "$1"; }
24
+ gray() { printf "\033[0;90m%s\033[0m" "$1"; }
25
+ yellow(){ printf "\033[0;33m%s\033[0m" "$1"; }
26
+
27
+ ok() { echo " $(green PASS) $1"; PASS=$((PASS+1)); }
28
+ bad() { echo " $(red FAIL) $1${2:+ — $2}"; FAIL=$((FAIL+1)); }
29
+ skip() { echo " $(gray SKIP) $1${2:+ — $2}"; SKIP=$((SKIP+1)); }
30
+
31
+ section() { echo; echo "$(yellow "▎ $1")"; }
32
+
33
+ require_jq() {
34
+ command -v jq >/dev/null 2>&1 || {
35
+ echo "$(red "fatal:") jq not found on PATH (install jq for this script to run)" >&2
36
+ exit 2
37
+ }
38
+ }
39
+ require_jq
40
+
41
+ # ───────────────────────────────────────────────────────────────────────
42
+ # Claude Code — marketplace plugin
43
+ section "Claude Code"
44
+ if [ -d "$HOME/.claude" ]; then
45
+ if command -v claude >/dev/null 2>&1; then
46
+ if claude plugin list 2>/dev/null | grep -q "hivemind@hivemind"; then
47
+ ok "claude plugin list shows hivemind@hivemind"
48
+ if claude plugin list 2>/dev/null | grep -q "✔ enabled"; then
49
+ ok "plugin enabled"
50
+ else
51
+ bad "plugin not enabled" "run: claude plugin enable hivemind@hivemind"
52
+ fi
53
+ else
54
+ bad "claude plugin list does not show hivemind@hivemind" "rerun: hivemind claude install"
55
+ fi
56
+ else
57
+ bad "claude CLI not found on PATH" "Claude Code is not installed correctly"
58
+ fi
59
+ else
60
+ skip "Claude Code" "no ~/.claude"
61
+ fi
62
+
63
+ # ───────────────────────────────────────────────────────────────────────
64
+ # Codex — ~/.codex/hooks.json + bundle
65
+ section "Codex"
66
+ if [ -d "$HOME/.codex" ]; then
67
+ HOOKS="$HOME/.codex/hooks.json"
68
+ if [ -f "$HOOKS" ]; then
69
+ if jq -e '.hooks.SessionStart' "$HOOKS" >/dev/null 2>&1; then
70
+ ok "$HOOKS has SessionStart"
71
+ else
72
+ bad "$HOOKS missing SessionStart"
73
+ fi
74
+ else
75
+ bad "$HOOKS not found" "rerun: hivemind codex install"
76
+ fi
77
+ if [ -x "$HOME/.codex/hivemind/bundle/session-start.js" ]; then
78
+ ok "session-start.js executable"
79
+ else
80
+ bad "session-start.js missing or not executable"
81
+ fi
82
+ else
83
+ skip "Codex" "no ~/.codex"
84
+ fi
85
+
86
+ # ───────────────────────────────────────────────────────────────────────
87
+ # OpenClaw — ~/.openclaw/extensions/hivemind/
88
+ section "OpenClaw"
89
+ if [ -d "$HOME/.openclaw" ]; then
90
+ EXT="$HOME/.openclaw/extensions/hivemind"
91
+ if [ -f "$EXT/openclaw.plugin.json" ]; then
92
+ ok "openclaw.plugin.json present"
93
+ if jq -e '.contracts.tools' "$EXT/openclaw.plugin.json" >/dev/null 2>&1; then
94
+ ok "manifest declares contracts.tools"
95
+ else
96
+ bad "manifest missing contracts.tools (stale install)"
97
+ fi
98
+ else
99
+ bad "$EXT/openclaw.plugin.json not found" "rerun: hivemind claw install"
100
+ fi
101
+ [ -f "$EXT/dist/index.js" ] && ok "dist/index.js present" || bad "dist/index.js not found"
102
+ else
103
+ skip "OpenClaw" "no ~/.openclaw"
104
+ fi
105
+
106
+ # ───────────────────────────────────────────────────────────────────────
107
+ # Cursor — ~/.cursor/hooks.json (1.7+ schema)
108
+ section "Cursor"
109
+ if [ -d "$HOME/.cursor" ]; then
110
+ HOOKS="$HOME/.cursor/hooks.json"
111
+ if [ -f "$HOOKS" ]; then
112
+ for ev in sessionStart beforeSubmitPrompt postToolUse afterAgentResponse stop sessionEnd; do
113
+ if jq -e ".hooks.$ev[0].command" "$HOOKS" >/dev/null 2>&1; then
114
+ ok "hooks.$ev wired"
115
+ else
116
+ bad "hooks.$ev missing" "rerun: hivemind cursor install"
117
+ fi
118
+ done
119
+ # Dry-invoke session-start.js
120
+ payload='{"hook_event_name":"sessionStart","session_id":"verify","conversation_id":"verify","workspace_roots":["/tmp"]}'
121
+ if echo "$payload" | timeout 5 node "$HOME/.cursor/hivemind/bundle/session-start.js" 2>/dev/null | jq -e '.additional_context' >/dev/null 2>&1; then
122
+ ok "session-start.js produces valid additional_context JSON"
123
+ else
124
+ bad "session-start.js dry-invoke did not return additional_context"
125
+ fi
126
+ else
127
+ bad "$HOOKS not found" "rerun: hivemind cursor install"
128
+ fi
129
+ else
130
+ skip "Cursor" "no ~/.cursor"
131
+ fi
132
+
133
+ # ───────────────────────────────────────────────────────────────────────
134
+ # Hermes Agent — skill drop
135
+ section "Hermes Agent"
136
+ if [ -d "$HOME/.hermes" ]; then
137
+ SKILL="$HOME/.hermes/skills/hivemind-memory/SKILL.md"
138
+ if [ -f "$SKILL" ]; then
139
+ ok "SKILL.md present at $SKILL"
140
+ if grep -q "Hivemind Memory" "$SKILL"; then
141
+ ok "skill content looks right"
142
+ else
143
+ bad "skill content missing 'Hivemind Memory' header"
144
+ fi
145
+ else
146
+ bad "$SKILL not found" "rerun: hivemind hermes install"
147
+ fi
148
+ else
149
+ skip "Hermes Agent" "no ~/.hermes"
150
+ fi
151
+
152
+ # ───────────────────────────────────────────────────────────────────────
153
+ # pi — AGENTS.md + extension
154
+ # No per-agent SKILL.md: pi reads skills from both ~/.pi/agent/skills/ AND
155
+ # ~/.agents/skills/ (the agentskills.io shared dir), so dropping a local
156
+ # skill would collide with the codex installer's shared symlink. AGENTS.md
157
+ # (auto-loaded every turn) plus the registered hivemind tools cover the
158
+ # action surface; see install-pi.ts for the rationale.
159
+ section "pi"
160
+ if [ -d "$HOME/.pi" ]; then
161
+ AGENTS="$HOME/.pi/agent/AGENTS.md"
162
+ if [ -f "$AGENTS" ] && grep -q "BEGIN hivemind-memory" "$AGENTS"; then
163
+ ok "AGENTS.md has BEGIN hivemind-memory marker"
164
+ else
165
+ bad "AGENTS.md missing hivemind block" "rerun: hivemind pi install"
166
+ fi
167
+ EXT="$HOME/.pi/agent/extensions/hivemind.ts"
168
+ if [ -f "$EXT" ]; then
169
+ ok "extension installed at $EXT"
170
+ # Sanity-check that key surfaces are wired in the installed extension.
171
+ if grep -q "registerTool" "$EXT" && grep -q "hivemind_search" "$EXT" && \
172
+ grep -q "hivemind_read" "$EXT" && grep -q "hivemind_index" "$EXT"; then
173
+ ok "extension registers hivemind_search / hivemind_read / hivemind_index"
174
+ else
175
+ bad "extension missing one or more hivemind_* tool registrations"
176
+ fi
177
+ if grep -q 'pi.on("tool_result"' "$EXT" && grep -q 'pi.on("input"' "$EXT"; then
178
+ ok "extension subscribes to input + tool_result for autocapture"
179
+ else
180
+ bad "extension missing input/tool_result subscriptions"
181
+ fi
182
+ else
183
+ bad "$EXT not found" "rerun: hivemind pi install"
184
+ fi
185
+ else
186
+ skip "pi" "no ~/.pi"
187
+ fi
188
+
189
+ # ───────────────────────────────────────────────────────────────────────
190
+ # MCP server (used by Hermes; reused by any future MCP-aware client).
191
+ section "Hivemind MCP server"
192
+ SERVER="$HOME/.hivemind/mcp/server.js"
193
+ if [ -f "$SERVER" ]; then
194
+ ok "server.js installed at $SERVER"
195
+ # Initialize + tools/list handshake. Expect "hivemind_search" in response.
196
+ init='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"verify","version":"1.0"}}}'
197
+ inited='{"jsonrpc":"2.0","method":"notifications/initialized"}'
198
+ list='{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
199
+ resp=$( ( printf '%s\n%s\n%s\n' "$init" "$inited" "$list"; sleep 1 ) | timeout 8 node "$SERVER" 2>/dev/null )
200
+ if echo "$resp" | grep -q '"hivemind_search"'; then
201
+ ok "tools/list returns hivemind_search / hivemind_read / hivemind_index"
202
+ else
203
+ bad "MCP server did not list expected tools" "check ~/.deeplake/credentials.json"
204
+ fi
205
+ else
206
+ skip "MCP server" "no ~/.hivemind/mcp/server.js (no MCP-aware agent installed yet)"
207
+ fi
208
+
209
+ # ───────────────────────────────────────────────────────────────────────
210
+ echo
211
+ echo "$(yellow "▎ Summary")"
212
+ echo " $(green PASS): $PASS"
213
+ echo " $(red FAIL): $FAIL"
214
+ echo " $(gray SKIP): $SKIP (agent not present on this machine)"
215
+ echo
216
+
217
+ if [ "$FAIL" -gt 0 ]; then exit 1; fi
218
+ exit 0