@maxkle1nz/m1nd 0.9.0-beta.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/EXAMPLES.md +711 -0
- package/LICENSE +21 -0
- package/README.md +361 -0
- package/docs/AGENT-FIRST-DEMO.md +79 -0
- package/docs/AGENT-PACKS.md +107 -0
- package/docs/IDE-INTEGRATIONS.md +136 -0
- package/docs/MCP-HOST-REFRESH.md +123 -0
- package/docs/README.md +36 -0
- package/npm/bin/m1nd.js +9 -0
- package/npm/lib/cli.js +346 -0
- package/npm/test/cli.test.js +49 -0
- package/package.json +47 -0
- package/skills/README.md +26 -0
- package/skills/m1nd-first/SKILL.md +117 -0
- package/skills/m1nd-operator/SKILL.md +166 -0
- package/skills/m1nd-operator/references/l1ght-and-docs.md +164 -0
- package/skills/m1nd-operator/references/routing-playbooks.md +172 -0
- package/skills/m1nd-operator/references/runtime-and-refresh.md +135 -0
- package/skills/m1nd-operator/references/tool-families.md +168 -0
- package/skills/m1nd-operator/scripts/probe_m1nd.py +189 -0
- package/skills/m1nd-universal-agent-pack.md +81 -0
package/EXAMPLES.md
ADDED
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
# m1nd Examples
|
|
2
|
+
|
|
3
|
+
These examples are meant to show when `m1nd` is practically useful, not just what tools exist.
|
|
4
|
+
|
|
5
|
+
All payloads below use the canonical MCP tool names from the live registry, without the optional client transport prefix.
|
|
6
|
+
|
|
7
|
+
## 0. One-minute agent demo
|
|
8
|
+
|
|
9
|
+
Install the agent pack first when you are setting up a new host:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g .
|
|
13
|
+
m1nd install-skills codex
|
|
14
|
+
m1nd doctor
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Run the real agent trust path before reading examples by hand:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cargo build -p m1nd-mcp
|
|
21
|
+
python3 scripts/m1nd_agent_demo.py --repo . --transport stdio
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
That command checks `trust_selftest`, ingests the repo, runs retrieval, asks for
|
|
25
|
+
tool guidance, calls `doctor`, and verifies that empty retrieval returns a
|
|
26
|
+
recovery path. Use `--json` when a client or CI job should consume the summary.
|
|
27
|
+
|
|
28
|
+
## 1. First ingest
|
|
29
|
+
|
|
30
|
+
```jsonc
|
|
31
|
+
{"method":"tools/call","params":{"name":"ingest","arguments":{
|
|
32
|
+
"agent_id":"dev",
|
|
33
|
+
"path":"/project/backend"
|
|
34
|
+
}}}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Illustrative response shape:
|
|
38
|
+
|
|
39
|
+
```jsonc
|
|
40
|
+
{
|
|
41
|
+
"files_processed": 335,
|
|
42
|
+
"nodes_created": 9767,
|
|
43
|
+
"edges_created": 26557,
|
|
44
|
+
"languages": {"python": 335},
|
|
45
|
+
"elapsed_ms": 910
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Use this once before asking structural questions about the repo.
|
|
50
|
+
|
|
51
|
+
## 2. Search vs glob vs seek
|
|
52
|
+
|
|
53
|
+
Use the right entry point for the question.
|
|
54
|
+
|
|
55
|
+
### Exact text or regex: `search`
|
|
56
|
+
|
|
57
|
+
```jsonc
|
|
58
|
+
{"method":"tools/call","params":{"name":"search","arguments":{
|
|
59
|
+
"agent_id":"dev",
|
|
60
|
+
"query":"SessionPool",
|
|
61
|
+
"mode":"literal",
|
|
62
|
+
"top_k":10
|
|
63
|
+
}}}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use this when you already know the string you want.
|
|
67
|
+
|
|
68
|
+
### Filename or path pattern: `glob`
|
|
69
|
+
|
|
70
|
+
```jsonc
|
|
71
|
+
{"method":"tools/call","params":{"name":"glob","arguments":{
|
|
72
|
+
"agent_id":"dev",
|
|
73
|
+
"pattern":"**/*session*.py",
|
|
74
|
+
"top_k":20
|
|
75
|
+
}}}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use this when you are looking for file names, not meaning.
|
|
79
|
+
|
|
80
|
+
### Intent or topic: `seek`
|
|
81
|
+
|
|
82
|
+
```jsonc
|
|
83
|
+
{"method":"tools/call","params":{"name":"seek","arguments":{
|
|
84
|
+
"agent_id":"dev",
|
|
85
|
+
"query":"where retry backoff is decided before outbound requests",
|
|
86
|
+
"top_k":8
|
|
87
|
+
}}}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Use this when you know the job, but not the symbol or file name.
|
|
91
|
+
|
|
92
|
+
Another good `seek` prompt is:
|
|
93
|
+
|
|
94
|
+
```jsonc
|
|
95
|
+
{"method":"tools/call","params":{"name":"seek","arguments":{
|
|
96
|
+
"agent_id":"dev",
|
|
97
|
+
"query":"which helper canonicalizes alias tool names into dispatch status values",
|
|
98
|
+
"top_k":5
|
|
99
|
+
}}}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
This is the kind of question where plain grep often needs several reformulations before it converges on the right helper.
|
|
103
|
+
|
|
104
|
+
### Unsure which tool fits: `help`
|
|
105
|
+
|
|
106
|
+
```jsonc
|
|
107
|
+
{"method":"tools/call","params":{"name":"help","arguments":{
|
|
108
|
+
"agent_id":"dev",
|
|
109
|
+
"tool_name":"validate_plan"
|
|
110
|
+
}}}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Use this when the agent is stuck between tools or needs a compact recovery path after a bad call.
|
|
114
|
+
|
|
115
|
+
The useful public behavior is:
|
|
116
|
+
|
|
117
|
+
- `WHEN TO USE` for the tool's best-fit question
|
|
118
|
+
- `AVOID WHEN` so the agent does not force the wrong surface
|
|
119
|
+
- `WORKFLOWS` for the likely next move
|
|
120
|
+
- recovery guidance so retry loops stay short
|
|
121
|
+
|
|
122
|
+
## 3. Connected neighborhood around a topic
|
|
123
|
+
|
|
124
|
+
```jsonc
|
|
125
|
+
{"method":"tools/call","params":{"name":"activate","arguments":{
|
|
126
|
+
"agent_id":"dev",
|
|
127
|
+
"query":"session pool timeout cleanup",
|
|
128
|
+
"top_k":8
|
|
129
|
+
}}}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Typical use:
|
|
133
|
+
|
|
134
|
+
- you know the topic
|
|
135
|
+
- you do not yet know the right file
|
|
136
|
+
- you want nearby code, not just exact matches
|
|
137
|
+
|
|
138
|
+
This is usually where m1nd saves the first big chunk of file reads.
|
|
139
|
+
|
|
140
|
+
## Error recovery pattern
|
|
141
|
+
|
|
142
|
+
When a tool fails, do not treat that as the end of the workflow.
|
|
143
|
+
|
|
144
|
+
Use the returned guidance like this:
|
|
145
|
+
|
|
146
|
+
- `hint`: what was wrong with the current call
|
|
147
|
+
- `example`: the smallest valid retry shape
|
|
148
|
+
- `next_step_hint`: whether to retry, inspect, or switch tools
|
|
149
|
+
|
|
150
|
+
Operational rule for agents:
|
|
151
|
+
|
|
152
|
+
- wrong tool -> reroute
|
|
153
|
+
- weak proof -> follow the suggested next seam
|
|
154
|
+
- stale continuity -> resume from hints, not from zero
|
|
155
|
+
|
|
156
|
+
Concrete example:
|
|
157
|
+
|
|
158
|
+
```jsonc
|
|
159
|
+
{"method":"tools/call","params":{"name":"search","arguments":{
|
|
160
|
+
"agent_id":"dev",
|
|
161
|
+
"query":"(",
|
|
162
|
+
"mode":"regex"
|
|
163
|
+
}}}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
If that fails, the useful behavior is not just "invalid regex". The useful behavior is:
|
|
167
|
+
|
|
168
|
+
- tell the agent to switch to `mode="literal"` if exact text was intended
|
|
169
|
+
- keep the retry payload small
|
|
170
|
+
- avoid falling back to shell grep unless the repair hint also fails
|
|
171
|
+
|
|
172
|
+
Another concrete recovery loop is `edit_commit` when the preview is valid but the guard rail was not lifted:
|
|
173
|
+
|
|
174
|
+
```jsonc
|
|
175
|
+
{"method":"tools/call","params":{"name":"edit_commit","arguments":{
|
|
176
|
+
"agent_id":"dev",
|
|
177
|
+
"preview_id":"preview-123",
|
|
178
|
+
"confirm":false
|
|
179
|
+
}}}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
The useful behavior is:
|
|
183
|
+
|
|
184
|
+
- do not force the agent to rediscover the write path
|
|
185
|
+
- explain that the same `preview_id` can be reused with `confirm=true`
|
|
186
|
+
- only rerun `edit_preview` when the preview is stale or expired
|
|
187
|
+
|
|
188
|
+
## 4. Stacktrace triage
|
|
189
|
+
|
|
190
|
+
If you already have failure output, use `trace` instead of manually walking top frames.
|
|
191
|
+
|
|
192
|
+
```jsonc
|
|
193
|
+
{"method":"tools/call","params":{"name":"trace","arguments":{
|
|
194
|
+
"agent_id":"dev",
|
|
195
|
+
"error_text":"Traceback (most recent call last): ... RuntimeError: worker pool closed during submit"
|
|
196
|
+
}}}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Use this to get from:
|
|
200
|
+
|
|
201
|
+
- crash site
|
|
202
|
+
|
|
203
|
+
to:
|
|
204
|
+
|
|
205
|
+
- likely root cause files
|
|
206
|
+
- structurally connected suspects
|
|
207
|
+
- a `proof_state` that tells you whether the run is still triaging or already strong enough for edit prep
|
|
208
|
+
|
|
209
|
+
faster than repeated grep and caller chasing.
|
|
210
|
+
|
|
211
|
+
## 5. What breaks if I touch this file?
|
|
212
|
+
|
|
213
|
+
Use `impact` before editing a central file.
|
|
214
|
+
|
|
215
|
+
```jsonc
|
|
216
|
+
{"method":"tools/call","params":{"name":"impact","arguments":{
|
|
217
|
+
"agent_id":"dev",
|
|
218
|
+
"node_id":"file::chat_handler.py"
|
|
219
|
+
}}}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Illustrative response shape:
|
|
223
|
+
|
|
224
|
+
```jsonc
|
|
225
|
+
{
|
|
226
|
+
"blast_radius": ["file::session_store.py", "file::router.py"],
|
|
227
|
+
"causal_chains": ["chat_handler.py -> session_store.py"],
|
|
228
|
+
"proof_state": "proving",
|
|
229
|
+
"next_suggested_tool": "view",
|
|
230
|
+
"next_suggested_target": "file::session_store.py",
|
|
231
|
+
"next_step_hint": "Open the strongest downstream seam before editing the root file."
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
This is the right tool when the question is “should I be careful?” rather than “where is the string?”
|
|
236
|
+
|
|
237
|
+
Recent behavior:
|
|
238
|
+
|
|
239
|
+
- `impact` can now suggest the strongest downstream file to open next and expose `proof_state` so the agent can tell blast triage from stronger proof
|
|
240
|
+
- this makes blast-radius work better as a guided handoff instead of a raw blast set
|
|
241
|
+
|
|
242
|
+
## 6. Test a structural claim
|
|
243
|
+
|
|
244
|
+
Use `hypothesize` when you want to test whether a dependency or path likely exists.
|
|
245
|
+
|
|
246
|
+
```jsonc
|
|
247
|
+
{"method":"tools/call","params":{"name":"hypothesize","arguments":{
|
|
248
|
+
"agent_id":"dev",
|
|
249
|
+
"claim":"worker_pool depends on whatsapp_manager at runtime"
|
|
250
|
+
}}}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
This is useful for questions like:
|
|
254
|
+
|
|
255
|
+
- does auth bypass rate limiting here?
|
|
256
|
+
- does this worker path touch billing?
|
|
257
|
+
- is there a runtime edge between these subsystems?
|
|
258
|
+
|
|
259
|
+
Recent behavior:
|
|
260
|
+
|
|
261
|
+
- `hypothesize` can now return both a `next_suggested_target` and a `proof_state`
|
|
262
|
+
- strong runs land in `ready_to_edit`, while partial or inconclusive runs stay in `proving`
|
|
263
|
+
|
|
264
|
+
## 7. Ask what is missing
|
|
265
|
+
|
|
266
|
+
Use `missing` when the problem smells like an absence:
|
|
267
|
+
|
|
268
|
+
- missing validation
|
|
269
|
+
- missing pool abstraction
|
|
270
|
+
- missing cleanup
|
|
271
|
+
- missing lock
|
|
272
|
+
|
|
273
|
+
```jsonc
|
|
274
|
+
{"method":"tools/call","params":{"name":"missing","arguments":{
|
|
275
|
+
"agent_id":"dev",
|
|
276
|
+
"query":"database connection pooling"
|
|
277
|
+
}}}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
This is one of the places where m1nd often beats plain grep, because grep can find present code, but not always the shape of what should have been there.
|
|
281
|
+
|
|
282
|
+
## 8. Prepare a multi-file edit
|
|
283
|
+
|
|
284
|
+
Use `validate_plan` before a risky change.
|
|
285
|
+
|
|
286
|
+
```jsonc
|
|
287
|
+
{"method":"tools/call","params":{"name":"validate_plan","arguments":{
|
|
288
|
+
"agent_id":"dev",
|
|
289
|
+
"include_risk_score":true,
|
|
290
|
+
"include_test_impact":true,
|
|
291
|
+
"actions":[
|
|
292
|
+
{"action_type":"modify","file_path":"src/auth.py","description":"tighten token validation"},
|
|
293
|
+
{"action_type":"modify","file_path":"src/session.py","description":"align refresh path"}
|
|
294
|
+
]
|
|
295
|
+
}}}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Then pull the primary file plus connected sources in one pass:
|
|
299
|
+
|
|
300
|
+
```jsonc
|
|
301
|
+
{"method":"tools/call","params":{"name":"surgical_context_v2","arguments":{
|
|
302
|
+
"agent_id":"dev",
|
|
303
|
+
"file_path":"src/auth.py",
|
|
304
|
+
"include_tests":true,
|
|
305
|
+
"radius":2,
|
|
306
|
+
"max_connected_files":8
|
|
307
|
+
}}}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
What this saves:
|
|
311
|
+
|
|
312
|
+
- fewer manual caller/callee reads
|
|
313
|
+
- fewer missed neighboring files
|
|
314
|
+
- better pre-edit risk awareness
|
|
315
|
+
|
|
316
|
+
Recent behavior:
|
|
317
|
+
|
|
318
|
+
- `validate_plan` now exposes `proof_state`
|
|
319
|
+
- `surgical_context_v2` now also exposes `proof_state`, which makes proof-focused edit prep explicit instead of implicit
|
|
320
|
+
- that makes it easier for an agent to tell whether it still needs more proof or can move on to edit prep
|
|
321
|
+
|
|
322
|
+
If either tool returns guidance that the plan is still unresolved, treat that as a compact repair loop:
|
|
323
|
+
|
|
324
|
+
- read `proof_hint`
|
|
325
|
+
- follow `next_suggested_tool`
|
|
326
|
+
- inspect `next_suggested_target`
|
|
327
|
+
- retry only after the missing seam is grounded
|
|
328
|
+
|
|
329
|
+
## 9. Explain why something looks risky
|
|
330
|
+
|
|
331
|
+
Use `heuristics_surface` when ranking or risk feels opaque and you want the reason, not just the result.
|
|
332
|
+
|
|
333
|
+
```jsonc
|
|
334
|
+
{"method":"tools/call","params":{"name":"heuristics_surface","arguments":{
|
|
335
|
+
"agent_id":"dev",
|
|
336
|
+
"file_path":"src/auth.py"
|
|
337
|
+
}}}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
This is especially useful after:
|
|
341
|
+
|
|
342
|
+
- `validate_plan`
|
|
343
|
+
- `predict`
|
|
344
|
+
- `surgical_context`
|
|
345
|
+
- `surgical_context_v2`
|
|
346
|
+
|
|
347
|
+
## 10. Write multiple files and verify
|
|
348
|
+
|
|
349
|
+
```jsonc
|
|
350
|
+
{"method":"tools/call","params":{"name":"apply_batch","arguments":{
|
|
351
|
+
"agent_id":"dev",
|
|
352
|
+
"verify":true,
|
|
353
|
+
"edits":[
|
|
354
|
+
{"file_path":"/project/src/auth.py","new_content":"..."},
|
|
355
|
+
{"file_path":"/project/src/session.py","new_content":"..."}
|
|
356
|
+
]
|
|
357
|
+
}}}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
This is the “I already know the edit, now keep me honest” path.
|
|
361
|
+
|
|
362
|
+
It is useful when you want:
|
|
363
|
+
|
|
364
|
+
- one atomic multi-file write
|
|
365
|
+
- one re-ingest pass
|
|
366
|
+
- one post-write verdict
|
|
367
|
+
|
|
368
|
+
Recent behavior:
|
|
369
|
+
|
|
370
|
+
- `apply_batch` now returns `batch_id` so clients can correlate the final output with progress events
|
|
371
|
+
- `apply_batch` now returns `proof_state` plus `next_suggested_tool`, `next_suggested_target`, and `next_step_hint`
|
|
372
|
+
- `apply_batch` now returns a human-readable `status_message`
|
|
373
|
+
- it also returns coarse progress fields like `active_phase`, `completed_phase_count`, `phase_count`, `remaining_phase_count`, `progress_pct`, and `next_phase`
|
|
374
|
+
- it also returns structured `phases` for `validate`, `write`, `reingest`, `verify`, and `done`, with per-phase `progress_pct` and `next_phase`
|
|
375
|
+
- it also returns `progress_events`, which mirrors the same lifecycle in a streaming-friendly shape
|
|
376
|
+
- each phase now includes `phase_index` and, when useful, `current_file`
|
|
377
|
+
- on the HTTP/UI transport, those progress events are also emitted live onto the SSE bus as `apply_batch_progress`
|
|
378
|
+
- this makes long-running batch writes easier to surface in shells and UI clients
|
|
379
|
+
|
|
380
|
+
## 11. Persist small operating state
|
|
381
|
+
|
|
382
|
+
Use `boot_memory` for lightweight, canonical state that should stay hot in runtime memory.
|
|
383
|
+
|
|
384
|
+
```jsonc
|
|
385
|
+
{"method":"tools/call","params":{"name":"boot_memory","arguments":{
|
|
386
|
+
"agent_id":"dev",
|
|
387
|
+
"action":"set",
|
|
388
|
+
"key":"current_auth_focus",
|
|
389
|
+
"value":"refresh-token-rotation rollout in progress"
|
|
390
|
+
}}}
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Read it back:
|
|
394
|
+
|
|
395
|
+
```jsonc
|
|
396
|
+
{"method":"tools/call","params":{"name":"boot_memory","arguments":{
|
|
397
|
+
"agent_id":"dev",
|
|
398
|
+
"action":"get",
|
|
399
|
+
"key":"current_auth_focus"
|
|
400
|
+
}}}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
Use this for compact operating doctrine or live task state, not for whole investigations.
|
|
404
|
+
|
|
405
|
+
## 12. Save and resume an investigation
|
|
406
|
+
|
|
407
|
+
Use trails for larger, graph-grounded investigations.
|
|
408
|
+
|
|
409
|
+
```jsonc
|
|
410
|
+
{"method":"tools/call","params":{"name":"trail_save","arguments":{
|
|
411
|
+
"agent_id":"dev",
|
|
412
|
+
"label":"auth-leak-investigation",
|
|
413
|
+
"hypotheses":[
|
|
414
|
+
{"statement":"auth tokens leak through session pool","confidence":0.7,"status":"investigating"},
|
|
415
|
+
{"statement":"rate limiter missing from auth chain","confidence":0.9,"status":"confirmed"}
|
|
416
|
+
]
|
|
417
|
+
}}}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Later:
|
|
421
|
+
|
|
422
|
+
```jsonc
|
|
423
|
+
{"method":"tools/call","params":{"name":"trail_resume","arguments":{
|
|
424
|
+
"agent_id":"dev",
|
|
425
|
+
"trail_id":"trail-abc123",
|
|
426
|
+
"max_reactivated_nodes":3,
|
|
427
|
+
"max_resume_hints":2
|
|
428
|
+
}}}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
Illustrative response shape:
|
|
432
|
+
|
|
433
|
+
```jsonc
|
|
434
|
+
{
|
|
435
|
+
"trail_id":"trail-abc123",
|
|
436
|
+
"reactivated_node_ids":[
|
|
437
|
+
"file::src/auth/session.rs",
|
|
438
|
+
"fn::src/auth/session.rs::rotate_refresh_token"
|
|
439
|
+
],
|
|
440
|
+
"resume_hints":[
|
|
441
|
+
"Re-open the refresh token rotation path before editing auth session storage.",
|
|
442
|
+
"The previous investigation left an open question about recent churn in the rotation helper."
|
|
443
|
+
],
|
|
444
|
+
"next_focus_node_id":"fn::src/auth/session.rs::rotate_refresh_token",
|
|
445
|
+
"next_open_question":"What changed recently in refresh token rotation and which callers moved with it?",
|
|
446
|
+
"next_suggested_tool":"timeline"
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
Use trails when you want continuity across sessions or across agents. The compact limits help when you want just the next move instead of a big resume payload.
|
|
451
|
+
|
|
452
|
+
If the trail is stale but still worth using, the recovery path should stay compact too:
|
|
453
|
+
|
|
454
|
+
```jsonc
|
|
455
|
+
{"method":"tools/call","params":{"name":"trail_resume","arguments":{
|
|
456
|
+
"agent_id":"dev",
|
|
457
|
+
"trail_id":"trail-abc123",
|
|
458
|
+
"force":true,
|
|
459
|
+
"max_reactivated_nodes":2,
|
|
460
|
+
"max_resume_hints":2
|
|
461
|
+
}}}
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
Use this only when degraded continuity is still better than restarting from zero.
|
|
465
|
+
|
|
466
|
+
## 13. Follow a resumed trail with `timeline`
|
|
467
|
+
|
|
468
|
+
If the carried-forward question is temporal, `trail_resume` may point you to `timeline` next.
|
|
469
|
+
|
|
470
|
+
```jsonc
|
|
471
|
+
{"method":"tools/call","params":{"name":"timeline","arguments":{
|
|
472
|
+
"agent_id":"dev",
|
|
473
|
+
"node":"file::src/auth/session.rs",
|
|
474
|
+
"depth":"30d",
|
|
475
|
+
"include_co_changes":true,
|
|
476
|
+
"include_churn":true
|
|
477
|
+
}}}
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Illustrative response shape:
|
|
481
|
+
|
|
482
|
+
```jsonc
|
|
483
|
+
{
|
|
484
|
+
"node":"file::src/auth/session.rs",
|
|
485
|
+
"changes":[
|
|
486
|
+
{
|
|
487
|
+
"commit":"0b2e172",
|
|
488
|
+
"subject":"route temporal resume questions to timeline",
|
|
489
|
+
"timestamp":"2026-03-24T10:41:00Z",
|
|
490
|
+
"lines_added":18,
|
|
491
|
+
"lines_deleted":2
|
|
492
|
+
}
|
|
493
|
+
],
|
|
494
|
+
"total_churn":{"added":42,"deleted":11},
|
|
495
|
+
"co_changes":[
|
|
496
|
+
{"node":"file::m1nd-mcp/src/layer_handlers.rs","score":0.84}
|
|
497
|
+
]
|
|
498
|
+
}
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
This is the quickest way to turn “what were we doing here?” into recent commit proof plus likely co-changed files.
|
|
502
|
+
|
|
503
|
+
## 14. Ingest code and docs together
|
|
504
|
+
|
|
505
|
+
### Memory adapter
|
|
506
|
+
|
|
507
|
+
```jsonc
|
|
508
|
+
{"method":"tools/call","params":{"name":"ingest","arguments":{
|
|
509
|
+
"agent_id":"dev",
|
|
510
|
+
"path":"/project/docs",
|
|
511
|
+
"adapter":"memory",
|
|
512
|
+
"namespace":"docs",
|
|
513
|
+
"mode":"merge"
|
|
514
|
+
}}}
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### JSON adapter
|
|
518
|
+
|
|
519
|
+
```jsonc
|
|
520
|
+
{"method":"tools/call","params":{"name":"ingest","arguments":{
|
|
521
|
+
"agent_id":"dev",
|
|
522
|
+
"path":"/project/domain.json",
|
|
523
|
+
"adapter":"json"
|
|
524
|
+
}}}
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### L1GHT adapter
|
|
528
|
+
|
|
529
|
+
```jsonc
|
|
530
|
+
{"method":"tools/call","params":{"name":"ingest","arguments":{
|
|
531
|
+
"agent_id":"dev",
|
|
532
|
+
"path":"/project/specs",
|
|
533
|
+
"adapter":"light",
|
|
534
|
+
"mode":"merge"
|
|
535
|
+
}}}
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
This is useful when the right answer lives across implementation and docs, not only in code.
|
|
539
|
+
|
|
540
|
+
## 15. Honest boundary: when not to use m1nd
|
|
541
|
+
|
|
542
|
+
If you already have the exact file and exact line, `view` or your editor is cheaper than a broader structural workflow.
|
|
543
|
+
|
|
544
|
+
If the question is a compiler error with an exact span, the compiler and test runner still outrank the graph.
|
|
545
|
+
|
|
546
|
+
If the question is “where did this spec land in code?” or “which docs got stale after this edit?”, that is where the new document surfaces matter.
|
|
547
|
+
|
|
548
|
+
## 16. Ingest a document through the universal lane
|
|
549
|
+
|
|
550
|
+
Use the universal lane when the source is not authored in `L1GHT` but you still want it inside the graph.
|
|
551
|
+
|
|
552
|
+
```jsonc
|
|
553
|
+
{"method":"tools/call","params":{"name":"ingest","arguments":{
|
|
554
|
+
"agent_id":"dev",
|
|
555
|
+
"path":"/project/specs/session-contract.md",
|
|
556
|
+
"adapter":"universal",
|
|
557
|
+
"mode":"merge"
|
|
558
|
+
}}}
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
This writes canonical local artifacts for the document and merges the resulting document graph into the current graph.
|
|
562
|
+
|
|
563
|
+
Typical outputs to expect from the resulting cache entry:
|
|
564
|
+
|
|
565
|
+
- original source copy
|
|
566
|
+
- `canonical.md`
|
|
567
|
+
- `canonical.json`
|
|
568
|
+
- `claims.json`
|
|
569
|
+
- `metadata.json`
|
|
570
|
+
|
|
571
|
+
## 17. Resolve canonical document artifacts
|
|
572
|
+
|
|
573
|
+
```jsonc
|
|
574
|
+
{"method":"tools/call","params":{"name":"document_resolve","arguments":{
|
|
575
|
+
"agent_id":"dev",
|
|
576
|
+
"path":"session-contract.md"
|
|
577
|
+
}}}
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
Illustrative response shape:
|
|
581
|
+
|
|
582
|
+
```jsonc
|
|
583
|
+
{
|
|
584
|
+
"source_path":"session-contract.md",
|
|
585
|
+
"canonical_markdown_path":"/tmp/m1nd-runtime/l1ght-cache/sources/abcd/canonical.md",
|
|
586
|
+
"canonical_json_path":"/tmp/m1nd-runtime/l1ght-cache/sources/abcd/canonical.json",
|
|
587
|
+
"claims_path":"/tmp/m1nd-runtime/l1ght-cache/sources/abcd/claims.json",
|
|
588
|
+
"producer":"universal:internal",
|
|
589
|
+
"section_count":4,
|
|
590
|
+
"entity_count":6,
|
|
591
|
+
"claim_count":3,
|
|
592
|
+
"citation_count":1,
|
|
593
|
+
"binding_count":2
|
|
594
|
+
}
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
Use this when an agent needs the durable local artifact path instead of re-fetching or re-parsing the source.
|
|
598
|
+
|
|
599
|
+
## 18. Ask which code a document points to
|
|
600
|
+
|
|
601
|
+
```jsonc
|
|
602
|
+
{"method":"tools/call","params":{"name":"document_bindings","arguments":{
|
|
603
|
+
"agent_id":"dev",
|
|
604
|
+
"path":"session-contract.md",
|
|
605
|
+
"top_k":5
|
|
606
|
+
}}}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
Illustrative response shape:
|
|
610
|
+
|
|
611
|
+
```jsonc
|
|
612
|
+
{
|
|
613
|
+
"source_path":"session-contract.md",
|
|
614
|
+
"bindings":[
|
|
615
|
+
{
|
|
616
|
+
"target_node_id":"file::src/session_pool.rs",
|
|
617
|
+
"target_label":"SessionPool",
|
|
618
|
+
"relation":"mentions_symbol",
|
|
619
|
+
"score":0.92,
|
|
620
|
+
"confidence":"parsed",
|
|
621
|
+
"reason":"exact label match"
|
|
622
|
+
}
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
This is the right surface when the question is:
|
|
628
|
+
|
|
629
|
+
- which file likely implements this spec?
|
|
630
|
+
- which symbol does this note refer to?
|
|
631
|
+
- what should I inspect before editing code to match the doc?
|
|
632
|
+
|
|
633
|
+
## 19. Detect stale document/code links
|
|
634
|
+
|
|
635
|
+
```jsonc
|
|
636
|
+
{"method":"tools/call","params":{"name":"document_drift","arguments":{
|
|
637
|
+
"agent_id":"dev",
|
|
638
|
+
"path":"session-contract.md"
|
|
639
|
+
}}}
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
Look here for:
|
|
643
|
+
|
|
644
|
+
- missing bindings
|
|
645
|
+
- ambiguous bindings
|
|
646
|
+
- moved targets
|
|
647
|
+
- code changes that happened after the document snapshot
|
|
648
|
+
- unbacked claims
|
|
649
|
+
|
|
650
|
+
This is especially useful after refactors or repo moves.
|
|
651
|
+
|
|
652
|
+
## 20. Inspect provider health before relying on richer extraction
|
|
653
|
+
|
|
654
|
+
```jsonc
|
|
655
|
+
{"method":"tools/call","params":{"name":"document_provider_health","arguments":{
|
|
656
|
+
"agent_id":"dev"
|
|
657
|
+
}}}
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
This tells you:
|
|
661
|
+
|
|
662
|
+
- which optional providers are currently available
|
|
663
|
+
- which mode each provider serves
|
|
664
|
+
- endpoint/config detail where relevant
|
|
665
|
+
- install hints for missing providers
|
|
666
|
+
|
|
667
|
+
Use it before expecting richer HTML/PDF/office extraction in an automated workflow.
|
|
668
|
+
|
|
669
|
+
## 21. Keep docs roots watched locally
|
|
670
|
+
|
|
671
|
+
```jsonc
|
|
672
|
+
{"method":"tools/call","params":{"name":"auto_ingest_start","arguments":{
|
|
673
|
+
"agent_id":"dev",
|
|
674
|
+
"roots":["/project/specs","/project/wiki"],
|
|
675
|
+
"formats":["universal","light","article","bibtex","crossref","rfc","patent"],
|
|
676
|
+
"debounce_ms":200
|
|
677
|
+
}}}
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
Check status:
|
|
681
|
+
|
|
682
|
+
```jsonc
|
|
683
|
+
{"method":"tools/call","params":{"name":"auto_ingest_status","arguments":{
|
|
684
|
+
"agent_id":"dev"
|
|
685
|
+
}}}
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
Force a drain:
|
|
689
|
+
|
|
690
|
+
```jsonc
|
|
691
|
+
{"method":"tools/call","params":{"name":"auto_ingest_tick","arguments":{
|
|
692
|
+
"agent_id":"dev"
|
|
693
|
+
}}}
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
This is the local-first loop for keeping documents and document-derived graph state current while you work.
|
|
697
|
+
|
|
698
|
+
Use plain tools when:
|
|
699
|
+
|
|
700
|
+
- you already know the one file to edit
|
|
701
|
+
- you need an exact-text replacement
|
|
702
|
+
- the compiler or test runner is the source of truth
|
|
703
|
+
- the task is runtime-log driven
|
|
704
|
+
|
|
705
|
+
Examples:
|
|
706
|
+
|
|
707
|
+
- rename a string across markdown files with `rg` and `sed`
|
|
708
|
+
- fix a single typo in a known file
|
|
709
|
+
- inspect a failing test with `cargo test`, `pytest`, or logs
|
|
710
|
+
|
|
711
|
+
m1nd is most useful when structure, connected context, or blast radius is what you are missing.
|