@hivemindai/mcp-server 0.3.7 → 0.3.8
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAiDA,wBAAsB,IAAI,kBA6BzB"}
|
|
@@ -3,57 +3,46 @@ import { join } from "node:path";
|
|
|
3
3
|
const HIVEMIND_SECTION_START = "<!-- hivemind:start -->";
|
|
4
4
|
const HIVEMIND_SECTION_END = "<!-- hivemind:end -->";
|
|
5
5
|
const HIVEMIND_CLAUDE_MD = `${HIVEMIND_SECTION_START}
|
|
6
|
-
## Hivemind
|
|
6
|
+
## Hivemind — MANDATORY agent coordination
|
|
7
7
|
|
|
8
|
-
This project uses Hivemind for multi-agent coordination
|
|
8
|
+
This project uses Hivemind for multi-agent coordination. You MUST follow ALL of these rules. They are not optional.
|
|
9
9
|
|
|
10
|
-
###
|
|
10
|
+
### Rule 1: Announce your task IMMEDIATELY
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
3. **Edit the file**: Make your changes.
|
|
19
|
-
|
|
20
|
-
4. **Release the lock**: Call \`hivemind_lock(action: "release", resource: "<file_path>")\` when done editing.
|
|
21
|
-
|
|
22
|
-
Skipping these steps will cause merge conflicts and lost work when multiple agents are active.
|
|
23
|
-
|
|
24
|
-
### When to publish events
|
|
25
|
-
|
|
26
|
-
Publish to Hivemind automatically at these moments — do NOT wait for the user to ask:
|
|
27
|
-
|
|
28
|
-
- **Task started**: When beginning significant work, publish a \`task.created\` event so other agents know what's in progress.
|
|
29
|
-
- **Task completed**: After finishing a meaningful unit of work (feature, bug fix, refactor), publish a \`task.completed\` event with what was done, which files changed, and the approach taken.
|
|
30
|
-
- **Decision made**: When you choose between approaches (e.g., "chose JWT over sessions"), publish a \`decision.made\` event with the decision, rationale, and alternatives considered.
|
|
31
|
-
- **Blocker encountered**: When you're stuck or waiting on something, publish a \`task.blocked\` event describing the blocker.
|
|
32
|
-
- **Bug found**: When you discover a bug, publish a \`bug.found\` event with description, severity, and location.
|
|
33
|
-
|
|
34
|
-
### When NOT to publish
|
|
35
|
-
|
|
36
|
-
Do not publish routine activity — file reads, intermediate reasoning, retry attempts, lint fixes, or "still working on it" updates. Publish **outcomes and decisions**, not process.
|
|
12
|
+
As your FIRST action when starting any task, BEFORE reading files or planning, call:
|
|
13
|
+
\`\`\`
|
|
14
|
+
hivemind_publish(channel: "general", event_type: "task.created", data: {"description": "<what you are about to do>"})
|
|
15
|
+
\`\`\`
|
|
16
|
+
Also call \`hivemind_status()\` to see what other agents are working on.
|
|
37
17
|
|
|
38
|
-
###
|
|
18
|
+
### Rule 2: Lock before editing, release after
|
|
39
19
|
|
|
40
|
-
|
|
41
|
-
|
|
20
|
+
BEFORE every file edit, you MUST acquire a lock. AFTER every file edit, you MUST release it.
|
|
21
|
+
\`\`\`
|
|
22
|
+
hivemind_lock(action: "acquire", resource: "<file_path>")
|
|
23
|
+
# If locked: false → STOP, another agent has this file. Work on something else.
|
|
24
|
+
# If locked: true → proceed with your edit.
|
|
25
|
+
hivemind_lock(action: "release", resource: "<file_path>")
|
|
26
|
+
\`\`\`
|
|
27
|
+
NEVER skip this. NEVER edit a file without acquiring its lock first.
|
|
42
28
|
|
|
43
|
-
###
|
|
29
|
+
### Rule 3: Check policies before editing
|
|
44
30
|
|
|
45
|
-
|
|
31
|
+
BEFORE editing any file, call:
|
|
32
|
+
\`\`\`
|
|
33
|
+
hivemind_approvals(action: "check-policies", resource: "<file_path>")
|
|
34
|
+
\`\`\`
|
|
35
|
+
If a policy matches: call \`hivemind_approvals(action: "request", channel: "general", description: "...")\`, then poll \`hivemind_approvals(action: "check", correlation_id: "...")\` until approved. Do NOT edit the file until approved.
|
|
46
36
|
|
|
47
|
-
###
|
|
37
|
+
### Rule 4: Publish outcomes
|
|
48
38
|
|
|
49
|
-
After
|
|
39
|
+
After completing work, publish what you did:
|
|
50
40
|
\`\`\`
|
|
51
|
-
hivemind_publish(
|
|
52
|
-
channel: "backend",
|
|
53
|
-
event_type: "task.completed",
|
|
54
|
-
data: {"description": "Implemented JWT authentication", "files_changed": ["src/auth.ts", "src/middleware.ts"], "approach": "RS256 signing with refresh tokens", "tests_passing": true}
|
|
55
|
-
)
|
|
41
|
+
hivemind_publish(channel: "general", event_type: "task.completed", data: {"description": "<what you did>", "files_changed": ["file1.ts", "file2.ts"]})
|
|
56
42
|
\`\`\`
|
|
43
|
+
Also publish \`decision.made\` when choosing between approaches, \`task.blocked\` when stuck, and \`bug.found\` when discovering bugs.
|
|
44
|
+
|
|
45
|
+
Do NOT publish routine activity (file reads, retries, lint fixes). Only publish outcomes and decisions.
|
|
57
46
|
${HIVEMIND_SECTION_END}`;
|
|
58
47
|
export async function init() {
|
|
59
48
|
const cwd = process.cwd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AACzD,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAErD,MAAM,kBAAkB,GAAG,GAAG,sBAAsB
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAA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