eminiar 0.10.1 → 0.12.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.
- package/.claude-plugin/plugin.json +1 -1
- package/.cursor-plugin/mcp.json +11 -0
- package/.cursor-plugin/plugin.json +23 -0
- package/README.md +62 -16
- package/bin/em-hook +75 -2
- package/dist/cli.js +3674 -557
- package/dist/hook.js +6986 -4104
- package/dist/server.js +5020 -1703
- package/dist/ui/app.global.js +67 -60
- package/dist/ui/styles.css +1014 -0
- package/hooks/cursor.json +36 -0
- package/hooks/hooks.json +9 -1
- package/package.json +7 -4
- package/rules/eminiar.mdc +15 -0
- package/skills/em-swarm/SKILL.md +100 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"hooks": {
|
|
4
|
+
"sessionStart": [
|
|
5
|
+
{ "command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor", "timeout": 10 }
|
|
6
|
+
],
|
|
7
|
+
"beforeSubmitPrompt": [
|
|
8
|
+
{ "command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor", "timeout": 5 }
|
|
9
|
+
],
|
|
10
|
+
"preToolUse": [
|
|
11
|
+
{
|
|
12
|
+
"command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor",
|
|
13
|
+
"timeout": 5,
|
|
14
|
+
"matcher": "Shell|Read|Write|Edit|Grep|Glob|WebFetch|WebSearch|Task"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"postToolUse": [
|
|
18
|
+
{ "command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor", "timeout": 10 }
|
|
19
|
+
],
|
|
20
|
+
"postToolUseFailure": [
|
|
21
|
+
{ "command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor", "timeout": 5 }
|
|
22
|
+
],
|
|
23
|
+
"subagentStop": [
|
|
24
|
+
{ "command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor", "timeout": 5 }
|
|
25
|
+
],
|
|
26
|
+
"preCompact": [
|
|
27
|
+
{ "command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor", "timeout": 15 }
|
|
28
|
+
],
|
|
29
|
+
"afterAgentResponse": [
|
|
30
|
+
{ "command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor", "timeout": 5 }
|
|
31
|
+
],
|
|
32
|
+
"sessionEnd": [
|
|
33
|
+
{ "command": "\"${CURSOR_PLUGIN_ROOT}/bin/em-hook\" --client cursor", "timeout": 5 }
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
package/hooks/hooks.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"PreToolUse": [
|
|
18
18
|
{
|
|
19
|
-
"matcher": "Bash|Read|Edit|MultiEdit|Write|Grep|Glob|WebFetch|WebSearch|Agent|Task",
|
|
19
|
+
"matcher": "^(Bash|Read|Edit|MultiEdit|Write|Grep|Glob|WebFetch|WebSearch|Agent|Task|mcp__.*__em_swarm)$",
|
|
20
20
|
"hooks": [
|
|
21
21
|
{ "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}/bin/em-hook\"", "timeout": 5 }
|
|
22
22
|
]
|
|
@@ -41,6 +41,14 @@
|
|
|
41
41
|
]
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
|
+
"SubagentStart": [
|
|
45
|
+
{
|
|
46
|
+
"matcher": "^swarm-",
|
|
47
|
+
"hooks": [
|
|
48
|
+
{ "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}/bin/em-hook\"", "timeout": 10 }
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
],
|
|
44
52
|
"SubagentStop": [
|
|
45
53
|
{
|
|
46
54
|
"hooks": [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eminiar",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Local-first context, memory and knowledge-graph plugin for Claude Code. Sandboxed execution, FTS5 + vector search, session continuity, and a code graph — nothing leaves your machine.",
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"description": "Local-first context, memory and knowledge-graph plugin for Claude Code and Cursor. Sandboxed execution, FTS5 + vector search, session continuity, and a code graph — nothing leaves your machine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Ryan Dick",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"sqlite-vec",
|
|
23
23
|
"knowledge-graph",
|
|
24
24
|
"tree-sitter",
|
|
25
|
-
"sandbox"
|
|
25
|
+
"sandbox",
|
|
26
|
+
"cursor"
|
|
26
27
|
],
|
|
27
28
|
"engines": {
|
|
28
29
|
"node": ">=22.12"
|
|
@@ -40,6 +41,8 @@
|
|
|
40
41
|
"hooks",
|
|
41
42
|
"skills",
|
|
42
43
|
".claude-plugin",
|
|
44
|
+
".cursor-plugin",
|
|
45
|
+
"rules",
|
|
43
46
|
"vendor",
|
|
44
47
|
"eminiar.config.schema.json",
|
|
45
48
|
"README.md",
|
|
@@ -56,7 +59,7 @@
|
|
|
56
59
|
"lint:fix": "biome check --write .",
|
|
57
60
|
"validate": "claude plugin validate .",
|
|
58
61
|
"prepack": "npm run build",
|
|
59
|
-
"version": "node scripts/sync-plugin-version.mjs && git add .claude-plugin/plugin.json",
|
|
62
|
+
"version": "node scripts/sync-plugin-version.mjs && git add .claude-plugin/plugin.json .cursor-plugin/plugin.json",
|
|
60
63
|
"build:ui": "tsup --config tsup.web.config.ts",
|
|
61
64
|
"dev:ui": "tsup --config tsup.web.config.ts --watch",
|
|
62
65
|
"screenshots": "node scripts/capture-screenshots.mjs"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: eminiar is installed. Use its em_* tools to keep raw output out of context and to check project memory before deciding.
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
eminiar is active. Keep raw tool output out of the context window and check project knowledge before deciding:
|
|
7
|
+
|
|
8
|
+
- Before starting a task or changing a design: `em_recall {query}` for past decisions, constraints and fixed errors; `em_remember {content, kind}` when you settle something durable.
|
|
9
|
+
- For any library, service or API the project uses: `em_docs {action:"lookup", query}` before web search.
|
|
10
|
+
- Commands that print a lot (tests, logs, git log/diff, dependency trees): `em_execute {language, code, intent}` or `em_batch_execute`; only the sections matching `intent` come back.
|
|
11
|
+
- Large files: `em_execute_file {path, code}`; web pages and docs: `em_fetch_and_index {url, queries}`.
|
|
12
|
+
- Code questions: `em_architecture`, `em_symbols {name_path}`, `em_graph_impact {node}`, `em_search {queries, source:"code"}` instead of grepping.
|
|
13
|
+
- Git history: `em_history {action: overview | file | risk | commit | branch}` instead of git log/blame/show.
|
|
14
|
+
|
|
15
|
+
Plain Shell/Read/Grep remain right for short fixed output and files you are about to edit.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: em-swarm
|
|
3
|
+
description: Coordinate an eminiar agent swarm from the main session — start a run of a swarm defined in .eminiar/swarm.yaml, plan small tasks, fan out worker subagents (swarm-<swarm>-<role>) in parallel, watch the task board, review the results and finish the run with a memory. Use when the user asks to run a swarm, use the X swarm, fan out workers, or parallelise a review across roles.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
argument-hint: <swarm> <goal>
|
|
6
|
+
allowed-tools: mcp__plugin_eminiar_eminiar__em_swarm, mcp__plugin_eminiar_eminiar__em_recall, mcp__plugin_eminiar_eminiar__em_history, mcp__plugin_eminiar_eminiar__em_graph_impact, mcp__plugin_eminiar_eminiar__em_architecture, mcp__plugin_eminiar_eminiar__em_symbols, mcp__plugin_eminiar_eminiar__em_remember, Agent
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Arguments: $ARGUMENTS (first word: the swarm; the rest: the goal)
|
|
10
|
+
|
|
11
|
+
You are the **coordinator**. Subagents cannot spawn subagents, so only you plan, spawn and
|
|
12
|
+
review; workers are leaves that claim tasks and report back through `em_swarm`.
|
|
13
|
+
|
|
14
|
+
**Use a swarm when** the goal splits into 3 or more pieces of work that can run independently
|
|
15
|
+
(separate files or modules), or when you want several reviewers to look at the same change
|
|
16
|
+
from different angles at once.
|
|
17
|
+
|
|
18
|
+
**Skip it when** the change is a single-file edit, a quick fix, or tightly coupled sequential
|
|
19
|
+
work where each step needs the previous step's exact output. Do the work directly instead.
|
|
20
|
+
|
|
21
|
+
## 0. Check the swarm exists
|
|
22
|
+
|
|
23
|
+
Call `em_swarm {action:"list"}`. If it says swarms are opt-in or disabled, stop and tell the user
|
|
24
|
+
how to opt in: `eminiar swarm init` (starter `.eminiar/swarm.yaml` plus generated agents), the
|
|
25
|
+
"Create starter swarm.yaml" button on the dashboard's Swarms tab (`eminiar ui`), or writing the
|
|
26
|
+
file by hand (https://github.com/rydn/eminiar/blob/main/docs/swarms.md). Do not improvise a swarm with ad-hoc subagents. If the file has
|
|
27
|
+
validation errors, show them and stop. If it says the call was not stamped by eminiar's hook,
|
|
28
|
+
stop and tell the user to run `eminiar upgrade` (or `eminiar install`) and check `/hooks`:
|
|
29
|
+
without the stamp every change is refused. If no swarm was named, pick the one whose description
|
|
30
|
+
fits the goal and say which.
|
|
31
|
+
|
|
32
|
+
## 1. Start the run
|
|
33
|
+
|
|
34
|
+
`em_swarm {action:"start", swarm, goal}` returns your brief: the topology's rules, the roles with
|
|
35
|
+
their `subagent_type`, model and `count`, the capacity (`max_agents`), the swarm's own
|
|
36
|
+
instructions, and what eminiar knows (memories, bug-prone files, hot files, project brief).
|
|
37
|
+
Read it before planning. Check `em_recall` / `em_architecture` / `em_graph_impact` for anything
|
|
38
|
+
the brief leaves open.
|
|
39
|
+
|
|
40
|
+
If it warns that the swarm already has an active run in this session, either finish the old run
|
|
41
|
+
(`em_swarm {action:"finish", run, status:"cancelled"}`) or pass `run` on every later call: while
|
|
42
|
+
several runs are active, calls without `run` are refused with the list of runs.
|
|
43
|
+
|
|
44
|
+
## 2. Plan small tasks
|
|
45
|
+
|
|
46
|
+
`em_swarm {action:"plan", tasks:[{key, title, detail, role, deps, files}]}`
|
|
47
|
+
|
|
48
|
+
- One task = what one worker can finish in one go. Name the files it touches in `files`.
|
|
49
|
+
- Only those six keys; put anything else in `detail` (other keys are refused).
|
|
50
|
+
- `role` must be a role of the swarm. `deps` take task ids or the `key` of an earlier task in the
|
|
51
|
+
same call. Avoid two parallel tasks editing the same file.
|
|
52
|
+
- Hierarchical: you assign every task to a role. Mesh: seed tasks; workers claim any.
|
|
53
|
+
Pipeline: a stage opens only when every task of the earlier stages is done. In every topology
|
|
54
|
+
workers may plan follow-up tasks (a reviewer adds fixes for the coder).
|
|
55
|
+
|
|
56
|
+
## 3. Spawn workers
|
|
57
|
+
|
|
58
|
+
For each claimable task (the plan reply lists them), call the **Agent** tool with
|
|
59
|
+
`subagent_type: "swarm-<swarm>-<role>"` and a prompt that names the task as **"task #N"** plus
|
|
60
|
+
anything the worker needs beyond the task text. The worker claims that task itself as its first
|
|
61
|
+
step; eminiar briefs it with the project knowledge when it starts and with the task when it
|
|
62
|
+
claims.
|
|
63
|
+
|
|
64
|
+
- Use `run_in_background: true` to run independent tasks in parallel.
|
|
65
|
+
- `max_agents` caps the swarm's running workers across all its runs, and `count` caps each role.
|
|
66
|
+
eminiar denies spawns over capacity; if that happens, wait for a worker to finish or release a
|
|
67
|
+
stuck one (step 4).
|
|
68
|
+
- Spawn a task only once its deps are done.
|
|
69
|
+
|
|
70
|
+
## 4. Watch
|
|
71
|
+
|
|
72
|
+
`em_swarm {action:"status"}` starts with the next step, then shows tasks by status, workers,
|
|
73
|
+
blackboard keys and recent events. For long runs, run `eminiar swarm watch` under the
|
|
74
|
+
**Monitor** tool. Its first line is `swarm.snapshot` (or `swarm.finished` if the run is already
|
|
75
|
+
closed); after that it prints one JSON line per change: `swarm.changed` while work is in flight,
|
|
76
|
+
`swarm.idle` when no worker is running and no task is active except ones held by quiet workers
|
|
77
|
+
(`stale_held`), which means it is your turn, and `swarm.finished` at the end. Workers' tool calls
|
|
78
|
+
never produce a line. Read shared findings with `em_swarm {action:"read"}`. Spawn the next
|
|
79
|
+
workers as deps complete.
|
|
80
|
+
|
|
81
|
+
A task line flagged **holder quiet Nm** belongs to a worker silent for 15 minutes or more,
|
|
82
|
+
usually one that crashed. Free it with `em_swarm {action:"release", agent}` (with no `agent`,
|
|
83
|
+
every quiet worker is released); the task goes back to pending, so spawn a new worker for it.
|
|
84
|
+
|
|
85
|
+
## 5. Review
|
|
86
|
+
|
|
87
|
+
- Read every result. A task flagged **auto-closed** was closed from the worker's last message
|
|
88
|
+
because it never reported: check that the work is really done.
|
|
89
|
+
- Reopen unfinished work with `em_swarm {action:"update", task, status:"pending"}` or plan
|
|
90
|
+
follow-up tasks; `blocked` tasks need an answer or a re-plan.
|
|
91
|
+
- If the swarm has a reviewer role, run it **last**, on the full diff, as an adversarial
|
|
92
|
+
review. Turn each confirmed finding into a task and repeat until none are left.
|
|
93
|
+
- Run the tests yourself before you call the goal met.
|
|
94
|
+
|
|
95
|
+
## 6. Finish
|
|
96
|
+
|
|
97
|
+
`em_swarm {action:"finish", status:"done"|"failed"|"cancelled", summary, remember:true}` closes
|
|
98
|
+
the run and its running workers, and writes the outcome as a memory (`swarm/run-<date>-<slug>`). Record durable decisions
|
|
99
|
+
and constraints the run produced with `em_remember`. Then report to the user: what changed,
|
|
100
|
+
which files, what was verified, and anything left open.
|