@plumpslabs/kuma 2.3.15 → 2.3.17
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/dist/{chunk-3AN4RSN5.js → chunk-AJ7HHUDW.js} +131 -33
- package/dist/index.js +7 -7
- package/dist/{init-RLILMGIK.js → init-BC7FG4C2.js} +1 -1
- package/dist/{kumaCodeScanner-LFJGPJNH.js → kumaCodeScanner-QYQUL4W6.js} +2 -2
- package/dist/{kumaVerifier-KAYJHR5K.js → kumaVerifier-6NTJQU7B.js} +8 -1
- package/dist/{skillGenerator-G4RS74CB.js → skillGenerator-GYEDLFZP.js} +7 -4
- package/package.json +1 -1
|
@@ -76,13 +76,16 @@ var BOOTSTRAP_LINES = [
|
|
|
76
76
|
' 2. `kuma_safety({ action: "guard" })` \u2014 Safety check before work',
|
|
77
77
|
' 3. `kuma_context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
|
|
78
78
|
" 4. *(edit/read using native tools)*",
|
|
79
|
-
' 5. `kuma_memory({ action: "research_save", ... })` \u2014
|
|
80
|
-
' 6. `kuma_memory({ action: "gotcha" })` \u2014
|
|
81
|
-
' 7. `kuma_memory({ action: "arch_flow" })` \u2014
|
|
82
|
-
' 8. `kuma_memory({ action: "decision" })` \u2014
|
|
79
|
+
' 5. `kuma_memory({ action: "research_save", ... })` \u2014 IMMEDIATELY after every read/grep (inline)',
|
|
80
|
+
' 6. `kuma_memory({ action: "gotcha" })` \u2014 IMMEDIATELY when bug/quirks found (inline)',
|
|
81
|
+
' 7. `kuma_memory({ action: "arch_flow" })` \u2014 IMMEDIATELY after tracing each flow hop (inline)',
|
|
82
|
+
' 8. `kuma_memory({ action: "decision" })` \u2014 IMMEDIATELY when choosing between options (inline)',
|
|
83
83
|
' 9. `kuma_safety({ action: "verify", ... })` \u2014 Run tests / confirm nothing broken',
|
|
84
84
|
' 10. `kuma_context({ action: "changes" })` \u2014 Review session activity',
|
|
85
85
|
"",
|
|
86
|
+
"\u{1F504} Record findings INLINE as you work \u2014 not just at steps 5-8. Every read/grep = mini research_save.",
|
|
87
|
+
"\u{1F9E0} Knowledge graph is persistent \u2014 nodes/edges accumulate across sessions, getting richer over time.",
|
|
88
|
+
"",
|
|
86
89
|
"\u26D4 Do NOT skip steps 5-10 after research \u2014 even if no code was changed.",
|
|
87
90
|
"\u{1F4D6} Full rules: `.kuma/init.md`",
|
|
88
91
|
"\u{1F9E0} Tools: `kuma_context` | `kuma_memory` | `kuma_safety`"
|
|
@@ -305,38 +308,49 @@ function generateInitMdContent() {
|
|
|
305
308
|
"",
|
|
306
309
|
"> \u26A0\uFE0F **Research-only sessions included.** Workflow ini wajib meskipun session hanya membaca/riset tanpa code changes.",
|
|
307
310
|
"",
|
|
311
|
+
"> \u{1F9E0} **Graph Philosophy:** Record findings INLINE as you work, not just at the end. Every time you read a",
|
|
312
|
+
"> file, grep a pattern, or trace a flow \u2014 call `research_save` immediately to persist file/func/import nodes.",
|
|
313
|
+
"> The knowledge graph accumulates across sessions. The more you use it, the richer it becomes.",
|
|
314
|
+
"",
|
|
308
315
|
"**AUTO-RECORDED nodes/edges** (Kuma scanner detects these automatically):",
|
|
309
316
|
"- Files, Functions, Classes \u2192 created as graph nodes",
|
|
310
317
|
"- Imports, Calls, Extends \u2192 created as graph edges",
|
|
311
318
|
"- Variables, Components, Routes \u2192 created when detected",
|
|
312
319
|
"",
|
|
313
|
-
"
|
|
320
|
+
"**RECORD INLINE \u2014 Don't wait for steps 5-8:**",
|
|
321
|
+
"- After EVERY `read` that finds new files \u2192 call `research_save` mini (persist file nodes)",
|
|
322
|
+
"- After EVERY `grep` that discovers new functions \u2192 call `research_save` (persist function nodes)",
|
|
323
|
+
"- When you discover a bug/quirk \u2192 call `gotcha` IMMEDIATELY (not at step 6)",
|
|
324
|
+
"- When you trace a data flow hop \u2192 call `arch_flow` IMMEDIATELY (not at step 7)",
|
|
325
|
+
"- When you choose between options \u2192 call `decision` IMMEDIATELY (not at step 8)",
|
|
326
|
+
"",
|
|
327
|
+
"### STEP 5: Save Research (RECORD INLINE \u2014 After Every Read/Grep)",
|
|
314
328
|
"```",
|
|
315
|
-
'kuma_memory({ action: "research_save", scope: "<area>", confidence: 0.8 })',
|
|
329
|
+
'kuma_memory({ action: "research_save", scope: "<file or area>", confidence: 0.8 })',
|
|
316
330
|
"```",
|
|
317
|
-
"**When:**
|
|
318
|
-
"**Why:** Persist findings into knowledge graph + research cache",
|
|
331
|
+
"**When:** After EVERY read/grep that discovers new files, functions, imports, or patterns. Don't wait \u2014 record inline!",
|
|
332
|
+
"**Why:** Persist findings into knowledge graph + research cache. Graph grows richer across sessions.",
|
|
319
333
|
"",
|
|
320
|
-
"### STEP 6: Record Gotchas (
|
|
334
|
+
"### STEP 6: Record Gotchas (RECORD INLINE \u2014 When Bug Found)",
|
|
321
335
|
"```",
|
|
322
336
|
'kuma_memory({ action: "gotcha", filePath: "<file>", description: "...", severity: "medium" })',
|
|
323
337
|
"```",
|
|
324
|
-
"**When:** IMMEDIATELY
|
|
325
|
-
"**Why:** Prevents future agents from hitting the same issues. Every bug = a gotcha.",
|
|
338
|
+
"**When:** IMMEDIATELY when you discover bugs, quirks, unexpected behavior, or workarounds. Record INLINE, don't save for later.",
|
|
339
|
+
"**Why:** Prevents future agents from hitting the same issues. Every bug = a gotcha. Skip now = lost forever.",
|
|
326
340
|
"",
|
|
327
|
-
"### STEP 7: Record Arch Flow (
|
|
341
|
+
"### STEP 7: Record Arch Flow (RECORD INLINE \u2014 When Tracing Flow)",
|
|
328
342
|
"```",
|
|
329
343
|
'kuma_memory({ action: "arch_flow", content: "..." })',
|
|
330
344
|
"```",
|
|
331
|
-
"**When:** IMMEDIATELY after
|
|
332
|
-
"**Why:** Architecture knowledge dissipates fast. Record
|
|
345
|
+
"**When:** IMMEDIATELY after tracing EACH hop in a data/control flow. Record INLINE, then continue tracing the next hop.",
|
|
346
|
+
"**Why:** Architecture knowledge dissipates fast. Record each hop before moving to the next file/task.",
|
|
333
347
|
"",
|
|
334
|
-
"### STEP 8: Record Decision (
|
|
348
|
+
"### STEP 8: Record Decision (RECORD INLINE \u2014 When Choosing)",
|
|
335
349
|
"```",
|
|
336
350
|
'kuma_memory({ action: "decision", decisionAction: "record", title: "...", outcome: "..." })',
|
|
337
351
|
"```",
|
|
338
|
-
"**When:**
|
|
339
|
-
"**Why:** Saves ADR (Architecture Decision Record) \u2014
|
|
352
|
+
"**When:** IMMEDIATELY when you choose between 2+ options, uncover an architecture pattern, or identify a root cause.",
|
|
353
|
+
"**Why:** Saves ADR (Architecture Decision Record). Bukan cuma code changes \u2014 temuan, tradeoffs, root causes juga.",
|
|
340
354
|
"",
|
|
341
355
|
"### STEP 9: Verify (MANDATORY \u2014 After Research/Editing)",
|
|
342
356
|
"```",
|
|
@@ -373,10 +387,10 @@ function generateInitMdContent() {
|
|
|
373
387
|
"",
|
|
374
388
|
"| Action | Description | When to Call |",
|
|
375
389
|
"|--------|-------------|--------------|",
|
|
376
|
-
"| `research_save` | Save research results | STEP 5 \u2014 IMMEDIATELY after
|
|
377
|
-
"| `gotcha` | Record bugs/quirks/workarounds | STEP 6 \u2014 IMMEDIATELY
|
|
378
|
-
"| `arch_flow` | Document architecture flow | STEP 7 \u2014 IMMEDIATELY after
|
|
379
|
-
"| `decision` | ADR-style decision record | STEP 8 \u2014
|
|
390
|
+
"| `research_save` | Save research results | STEP 5 \u2014 IMMEDIATELY after every read/grep (inline) |",
|
|
391
|
+
"| `gotcha` | Record bugs/quirks/workarounds | STEP 6 \u2014 IMMEDIATELY when bug found (inline) |",
|
|
392
|
+
"| `arch_flow` | Document architecture flow | STEP 7 \u2014 IMMEDIATELY after each flow hop (inline) |",
|
|
393
|
+
"| `decision` | ADR-style decision record | STEP 8 \u2014 IMMEDIATELY when choosing (inline) |",
|
|
380
394
|
"| `mine` | Mine decisions from git log | When need historical context |",
|
|
381
395
|
"| `session` | Session summary | End of session |",
|
|
382
396
|
"| `heal` | Self-heal knowledge graph | When graph has errors |",
|
|
@@ -443,13 +457,16 @@ function generateInitMdContent() {
|
|
|
443
457
|
" 2. kuma_safety \u2192 guard \u2014 Safety check",
|
|
444
458
|
" 3. kuma_context \u2192 research \u2014 Research target area",
|
|
445
459
|
" --- EDIT/READ (use native tools) ---",
|
|
446
|
-
" 5. kuma_memory \u2192 research_save \u2014 Save
|
|
447
|
-
" 6. kuma_memory \u2192 gotcha \u2014 Record bugs/quirks found",
|
|
448
|
-
" 7. kuma_memory \u2192 arch_flow \u2014 Record data flow
|
|
449
|
-
" 8. kuma_memory \u2192 decision \u2014 Record key
|
|
460
|
+
" 5. kuma_memory \u2192 research_save \u2014 Save findings (inline after every read/grep)",
|
|
461
|
+
" 6. kuma_memory \u2192 gotcha \u2014 Record bugs/quirks (inline when found)",
|
|
462
|
+
" 7. kuma_memory \u2192 arch_flow \u2014 Record data flow (inline after each hop)",
|
|
463
|
+
" 8. kuma_memory \u2192 decision \u2014 Record key decisions (inline when choosing)",
|
|
450
464
|
" 9. kuma_safety \u2192 verify \u2014 Run tests / confirm nothing broken",
|
|
451
465
|
" 10. kuma_context \u2192 changes \u2014 Review session activity",
|
|
452
466
|
"",
|
|
467
|
+
"\u{1F504} Record INLINE as you work \u2014 not just at steps 5-8. Every read/grep = mini research_save.",
|
|
468
|
+
"\u{1F9E0} Graph is persistent \u2014 nodes/edges accumulate across sessions.",
|
|
469
|
+
"",
|
|
453
470
|
"ON DISCOVERY (When needed):",
|
|
454
471
|
" kuma_memory \u2192 domain_rules \u2014 Business rules (Layer 1)",
|
|
455
472
|
" kuma_memory \u2192 context \u2014 Additional notes",
|
|
@@ -457,6 +474,78 @@ function generateInitMdContent() {
|
|
|
457
474
|
" kuma_memory \u2192 mine \u2014 Historical context",
|
|
458
475
|
"```",
|
|
459
476
|
"",
|
|
477
|
+
"## \u{1F9E0} How the Scanner Works",
|
|
478
|
+
"",
|
|
479
|
+
"Kuma's code scanner (`kumaCodeScanner.ts`) uses **regex-based pattern matching**",
|
|
480
|
+
"to detect code structure. It is NOT a full AST parser (no Babel/TypeScript compiler dependency).",
|
|
481
|
+
"",
|
|
482
|
+
"**What it detects (line-by-line regex):**",
|
|
483
|
+
"- `function` declarations (named + async + generator)",
|
|
484
|
+
"- Arrow function assignments (`const foo = (...) => ...`)",
|
|
485
|
+
"- Typed arrow functions (`const foo: Type = (...) => ...`)",
|
|
486
|
+
"- Class declarations (includes extends/implements)",
|
|
487
|
+
"- React/Vue components (functions returning JSX)",
|
|
488
|
+
"- API route handlers (Express + Hono patterns)",
|
|
489
|
+
"- Import statements (local file imports only)",
|
|
490
|
+
"- Function calls cross-file (`calls` edges)",
|
|
491
|
+
"- Test files (`.test.`, `.spec.`, `__tests__/`)",
|
|
492
|
+
"",
|
|
493
|
+
"**Known limitations:**",
|
|
494
|
+
"- Regex-based = can miss multi-line constructs or non-standard patterns",
|
|
495
|
+
"- Complex generics or deeply nested syntax may not match",
|
|
496
|
+
"- TypeScript advanced types may be partially parsed",
|
|
497
|
+
"- Scanner runs automatically during `kuma_context research` step 3",
|
|
498
|
+
"- If scanner returns 0 structural nodes, the regex patterns didn't match your code style",
|
|
499
|
+
"",
|
|
500
|
+
"**For richer code analysis:**",
|
|
501
|
+
"- Record findings INLINE as you read/grep \u2014 this builds the graph manually",
|
|
502
|
+
"- Call `research_save` after exploring files to persist function/class/import nodes",
|
|
503
|
+
"- The more you use Kuma, the richer the graph becomes (persistent across sessions)",
|
|
504
|
+
"",
|
|
505
|
+
"---",
|
|
506
|
+
"",
|
|
507
|
+
"## \u{1F4BE} How to Read Memory & Search the Graph",
|
|
508
|
+
"",
|
|
509
|
+
"Kuma stores knowledge in two places:",
|
|
510
|
+
"",
|
|
511
|
+
"**1. Knowledge Graph (SQLite - `.kuma/kuma.db`)**",
|
|
512
|
+
"- Nodes: files, functions, classes, components, routes, tests, gotchas, decisions",
|
|
513
|
+
"- Edges: imports, calls, extends, contains, composes, routes",
|
|
514
|
+
'- Query: `kuma_memory({ action: "search", query: "<term>" })`',
|
|
515
|
+
"- Falls back to codebase grep if graph is empty",
|
|
516
|
+
"",
|
|
517
|
+
"**2. Research Cache (SQLite - `.kuma/kuma.db`)**",
|
|
518
|
+
'- Saved via `kuma_memory({ action: "research_save", scope: "<area>", confidence: 0.8 })`',
|
|
519
|
+
'- List: `kuma_context({ action: "researches" })`',
|
|
520
|
+
'- Auto-loaded during `kuma_context({ action: "research", scope: "<area>" })`',
|
|
521
|
+
"",
|
|
522
|
+
"**Quick memory reading tips:**",
|
|
523
|
+
'- `kuma_context({ action: "init" })` \u2014 shows graph stats + recent research + health score',
|
|
524
|
+
'- `kuma_context({ action: "research", scope: "<area>" })` \u2014 deep research with graph query',
|
|
525
|
+
'- `kuma_memory({ action: "search", query: "<term>" })` \u2014 search all memories + graph',
|
|
526
|
+
'- `kuma_context({ action: "visualize" })` \u2014 Mermaid diagram of the graph',
|
|
527
|
+
'- `kuma_context({ action: "drift" })` \u2014 check if memories are stale vs actual code',
|
|
528
|
+
'- `kuma_context({ action: "changes" })` \u2014 view session activity log',
|
|
529
|
+
"",
|
|
530
|
+
"---",
|
|
531
|
+
"",
|
|
532
|
+
"## \u{1F52C} How Verification Works",
|
|
533
|
+
"",
|
|
534
|
+
'`kuma_safety({ action: "verify", scope: "<area>" })` \u2014 STEP 9',
|
|
535
|
+
"",
|
|
536
|
+
"**Auto-detection logic:**",
|
|
537
|
+
"1. Checks `package.json` \u2192 `scripts.test` \u2192 uses npm/pnpm/yarn test",
|
|
538
|
+
"2. If no test script, checks for Makefile with `test:` target",
|
|
539
|
+
"3. Falls back to Python (pytest), Rust (cargo test), Go (go test)",
|
|
540
|
+
"4. Last resort: `npx tsc --noEmit` (TypeScript syntax check) or `node -c`",
|
|
541
|
+
"5. If nothing found: returns informative message instead of failing",
|
|
542
|
+
"",
|
|
543
|
+
"**Important:** Verification is NEVER auto-triggered. You must call it explicitly.",
|
|
544
|
+
"The 5-layer safety guard (concurrency lock, rate limiting, staleness cache,",
|
|
545
|
+
"runaway detection, hard timeout) prevents resource exhaustion.",
|
|
546
|
+
"",
|
|
547
|
+
"---",
|
|
548
|
+
"",
|
|
460
549
|
"## \u{1F6AB} What Kuma Does NOT Do (Use Agent Native Tools)",
|
|
461
550
|
"",
|
|
462
551
|
"| Function | Correct Tool |",
|
|
@@ -509,13 +598,16 @@ function handleOpencodeSecondary(root, results) {
|
|
|
509
598
|
' 2. `kuma_kuma_safety({ action: "guard" })` \u2014 Safety check before work',
|
|
510
599
|
' 3. `kuma_kuma_context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
|
|
511
600
|
" 4. *(edit/read using native tools)*",
|
|
512
|
-
' 5. `kuma_kuma_memory({ action: "research_save", ... })` \u2014 Save
|
|
513
|
-
' 6. `kuma_kuma_memory({ action: "gotcha" })` \u2014 Record bugs/quirks found',
|
|
514
|
-
' 7. `kuma_kuma_memory({ action: "arch_flow" })` \u2014 Record data flow
|
|
515
|
-
' 8. `kuma_kuma_memory({ action: "decision" })` \u2014 Record key
|
|
601
|
+
' 5. `kuma_kuma_memory({ action: "research_save", ... })` \u2014 Save findings (inline after every read/grep)',
|
|
602
|
+
' 6. `kuma_kuma_memory({ action: "gotcha" })` \u2014 Record bugs/quirks (inline when found)',
|
|
603
|
+
' 7. `kuma_kuma_memory({ action: "arch_flow" })` \u2014 Record data flow (inline after each hop)',
|
|
604
|
+
' 8. `kuma_kuma_memory({ action: "decision" })` \u2014 Record key decisions (inline when choosing)',
|
|
516
605
|
' 9. `kuma_kuma_safety({ action: "verify", ... })` \u2014 Run tests / confirm nothing broken',
|
|
517
606
|
' 10. `kuma_kuma_context({ action: "changes" })` \u2014 Review session activity',
|
|
518
607
|
"",
|
|
608
|
+
"\u{1F504} Record findings INLINE as you work \u2014 Every read/grep = mini research_save.",
|
|
609
|
+
"\u{1F9E0} Graph is persistent \u2014 nodes/edges accumulate across sessions.",
|
|
610
|
+
"",
|
|
519
611
|
"\u26A0\uFE0F **OpenCode platform note:** Tool names are prefixed with `kuma_kuma_*`",
|
|
520
612
|
" (server name `kuma` + already-prefixed tool name `kuma_context`).",
|
|
521
613
|
"",
|
|
@@ -644,6 +736,9 @@ function getCombinedAgentsMd(selectedTypes) {
|
|
|
644
736
|
' 9. `[kuma_]safety({ action: "verify", ... })` \u2014 Run tests / confirm nothing broken',
|
|
645
737
|
' 10. `[kuma_]context({ action: "changes" })` \u2014 Review session activity',
|
|
646
738
|
"",
|
|
739
|
+
"\u{1F504} Record findings INLINE as you work \u2014 Every read/grep = mini research_save.",
|
|
740
|
+
"\u{1F9E0} Graph is persistent \u2014 nodes/edges accumulate across sessions.",
|
|
741
|
+
"",
|
|
647
742
|
"\u26D4 Do NOT skip steps 5-10 after research \u2014 even if no code was changed.",
|
|
648
743
|
"",
|
|
649
744
|
"Replace `[kuma_]` with the correct prefix for your platform (see below).",
|
|
@@ -851,13 +946,16 @@ function handleQuickrefGeneration(root, results) {
|
|
|
851
946
|
' 2. `kuma_safety({ action: "guard" })` \u2014 Safety check',
|
|
852
947
|
' 3. `kuma_context({ action: "research", scope: "<area>" })` \u2014 Research',
|
|
853
948
|
" 4. *(edit/read using native tools)*",
|
|
854
|
-
' 5. `kuma_memory({ action: "research_save", ... })` \u2014 Save findings',
|
|
855
|
-
' 6. `kuma_memory({ action: "gotcha" })` \u2014 Gotchas
|
|
856
|
-
' 7. `kuma_memory({ action: "arch_flow" })` \u2014 Arch flow',
|
|
857
|
-
' 8. `kuma_memory({ action: "decision" })` \u2014 Decision',
|
|
949
|
+
' 5. `kuma_memory({ action: "research_save", ... })` \u2014 Save findings (inline after every read)',
|
|
950
|
+
' 6. `kuma_memory({ action: "gotcha" })` \u2014 Gotchas (inline when found)',
|
|
951
|
+
' 7. `kuma_memory({ action: "arch_flow" })` \u2014 Arch flow (inline after each hop)',
|
|
952
|
+
' 8. `kuma_memory({ action: "decision" })` \u2014 Decision (inline when choosing)',
|
|
858
953
|
' 9. `kuma_safety({ action: "verify", ... })` \u2014 Verify',
|
|
859
954
|
' 10. `kuma_context({ action: "changes" })` \u2014 Review changes',
|
|
860
955
|
"",
|
|
956
|
+
"\u{1F504} Record INLINE as you work \u2014 Every read/grep = mini research_save.",
|
|
957
|
+
"\u{1F9E0} Graph is persistent \u2014 accumulates across sessions.",
|
|
958
|
+
"",
|
|
861
959
|
"\u26D4 Steps 5-10 are mandatory even for research-only sessions!",
|
|
862
960
|
"",
|
|
863
961
|
"## Platform Tool Names",
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ALL_CONFIG_TYPES,
|
|
9
9
|
formatInitResults,
|
|
10
10
|
runInit
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AJ7HHUDW.js";
|
|
12
12
|
import {
|
|
13
13
|
formatDecisionTemplate,
|
|
14
14
|
getProactiveMemories,
|
|
@@ -336,7 +336,7 @@ async function handleResearch(params) {
|
|
|
336
336
|
lines.push(" \u26A0\uFE0F Graph query failed");
|
|
337
337
|
}
|
|
338
338
|
try {
|
|
339
|
-
const { scanCodebase } = await import("./kumaCodeScanner-
|
|
339
|
+
const { scanCodebase } = await import("./kumaCodeScanner-QYQUL4W6.js");
|
|
340
340
|
const scanResult = await scanCodebase({ scope, maxFiles: 100 });
|
|
341
341
|
if (scanResult.nodeCount > 0 || scanResult.edgeCount > 0) {
|
|
342
342
|
lines.push(` \u{1F52C} Auto-scanned ${scanResult.filesScanned} files \u2192 ${scanResult.nodeCount} nodes, ${scanResult.edgeCount} edges`);
|
|
@@ -2149,7 +2149,7 @@ async function handleVerify(params) {
|
|
|
2149
2149
|
}
|
|
2150
2150
|
_lastVerifyCall = now;
|
|
2151
2151
|
sessionMemory.recordToolCall("kuma_safety_verify", { scope: params.scope || params.filePath });
|
|
2152
|
-
const { runAutoVerification } = await import("./kumaVerifier-
|
|
2152
|
+
const { runAutoVerification } = await import("./kumaVerifier-6NTJQU7B.js");
|
|
2153
2153
|
return await runAutoVerification({
|
|
2154
2154
|
scope: params.scope || params.filePath,
|
|
2155
2155
|
force: params.force,
|
|
@@ -2190,7 +2190,7 @@ function registerAllTools(server) {
|
|
|
2190
2190
|
);
|
|
2191
2191
|
server.tool(
|
|
2192
2192
|
"kuma_memory",
|
|
2193
|
-
"**Call AFTER research/editing every session** (including research-only).\n\
|
|
2193
|
+
"**Call AFTER research/editing every session** (including research-only). Record INLINE as you work.\n\nRECORD INLINE (call IMMEDIATELY during research):\n\u2022 STEP 5: `research_save` \u2014 every read/grep that finds new files/functions. Don't wait!\n\u2022 STEP 6: `gotcha` \u2014 IMMEDIATELY when you discover bugs/quirks. Record INLINE, not at the end.\n\u2022 STEP 7: `arch_flow` \u2014 IMMEDIATELY after EACH flow hop trace. Record before next task.\n\u2022 STEP 8: `decision` \u2014 IMMEDIATELY when choosing between options or finding architecture patterns.\n\nON DISCOVERY (when you encounter something):\n\u2022 `domain_rules` \u2014 uncovered business rules? Save them!\n\u2022 `context` \u2014 need to inject extra notes? Use this!\n\u2022 `todo` \u2014 create persistent task items\n\u2022 `mine` \u2014 extract historical context from git log\n\nOther actions: session, heal, search, changes, benchmark, layers.",
|
|
2194
2194
|
{
|
|
2195
2195
|
action: z.enum(["decision", "mine", "research_save", "session", "heal", "search", "changes", "todo", "context", "benchmark", "decision_log", "domain_rules", "arch_flow", "gotcha", "layers", "federated", "gen_test", "trajectory", "skills"]).describe("Memory action: decision=ADR, mine=mine git log & comments, research_save=save, session=summary, heal=repair, search=search, changes=log, todo=manage todos, context=inject notes, benchmark=capture/diff, decision_log=manage decisions, domain_rules=Layer 1 business rules (Issue #17), arch_flow=Layer 2 architecture flow (Issue #17), gotcha=Layer 3 known gotchas (Issue #17/#21), layers=all 3 layers summary, federated=resolve federated kuma:// URI (Issue #27), gen_test=generate test from trajectory (Issue #28), trajectory=list trajectories, skills=list distilled skills"),
|
|
2196
2196
|
scope: z.string().optional().describe("Scope for research_save/search/todo/context/mine/federated"),
|
|
@@ -2362,7 +2362,7 @@ async function main() {
|
|
|
2362
2362
|
console.error("");
|
|
2363
2363
|
let killedCount = 0;
|
|
2364
2364
|
try {
|
|
2365
|
-
const { getRunningVerificationPid } = await import("./kumaVerifier-
|
|
2365
|
+
const { getRunningVerificationPid } = await import("./kumaVerifier-6NTJQU7B.js");
|
|
2366
2366
|
const pid = getRunningVerificationPid();
|
|
2367
2367
|
if (pid) {
|
|
2368
2368
|
try {
|
|
@@ -2571,7 +2571,7 @@ async function main() {
|
|
|
2571
2571
|
});
|
|
2572
2572
|
(async () => {
|
|
2573
2573
|
try {
|
|
2574
|
-
const { generateInitMdContent } = await import("./init-
|
|
2574
|
+
const { generateInitMdContent } = await import("./init-BC7FG4C2.js");
|
|
2575
2575
|
const fs7 = await import("fs");
|
|
2576
2576
|
const path7 = await import("path");
|
|
2577
2577
|
const initMdPath = path7.resolve(process.cwd(), ".kuma/init.md");
|
|
@@ -2588,7 +2588,7 @@ async function main() {
|
|
|
2588
2588
|
(async () => {
|
|
2589
2589
|
try {
|
|
2590
2590
|
const { detectAgent, getSkillPath, getAgentLabel } = await import("./agentDetector-YOWQVJFR.js");
|
|
2591
|
-
const { generateSkill, getSecondaryFiles } = await import("./skillGenerator-
|
|
2591
|
+
const { generateSkill, getSecondaryFiles } = await import("./skillGenerator-GYEDLFZP.js");
|
|
2592
2592
|
const fs7 = await import("fs");
|
|
2593
2593
|
const path7 = await import("path");
|
|
2594
2594
|
const detection = detectAgent();
|
|
@@ -21,8 +21,8 @@ function getRoot() {
|
|
|
21
21
|
return _cachedRoot;
|
|
22
22
|
}
|
|
23
23
|
var FUNCTION_DECL_RE = /(?:export\s+)?(?:async\s+)?function\s*(?:\*\s*)?(\w+)\s*\(/g;
|
|
24
|
-
var ARROW_FN_RE = /(?:export\s+)?(?:const|let|var)\s+(\w+)\s
|
|
25
|
-
var TYPED_ARROW_RE = /(?:export\s+)?(?:const|let|var)\s+(\w+)\s*:\s*(?:\w+(?:<[^>]*>)?)?\s*=\s*(?:async\s*)?\(/g;
|
|
24
|
+
var ARROW_FN_RE = /(?:export\s+)?(?:const|let|var)\s+(\w+)\s*[=:]\s*(?:async\s*)?(?:<[^>]+>\s*)?(?:\([\s\S]*?\)|\w+)\s*(?::\s*\w+(?:<[^>]*>)?)?\s*=>/g;
|
|
25
|
+
var TYPED_ARROW_RE = /(?:export\s+)?(?:const|let|var)\s+(\w+)\s*:\s*(?:\w+(?:<[^>]*>)?)?\s*=\s*(?:async\s*)?(?:<[^>]+>\s*)?\(/g;
|
|
26
26
|
var CLASS_RE = /(?:export\s+)?(?:abstract\s+)?class\s+(\w+)(?:\s+extends\s+(\w+))?(?:\s+implements\s+([\w,\s]+))?/g;
|
|
27
27
|
var IMPORT_RE = /import\s+(?:\{([^}]*)\}\s+from\s+)?(?:\w+\s+from\s+)?(?:\*\s+as\s+\w+\s+from\s+)?['"]([^'"]+)['"]/g;
|
|
28
28
|
var JSX_RETURN_RE = /return\s*\(?\s*</;
|
|
@@ -93,7 +93,14 @@ function detectTestRunner(root = process.cwd()) {
|
|
|
93
93
|
if (fs.existsSync(path.join(root, "pytest.ini")) || fs.existsSync(path.join(root, "pyproject.toml"))) return { runner: "pytest", baseCommand: "pytest" };
|
|
94
94
|
if (fs.existsSync(path.join(root, "Cargo.toml"))) return { runner: "cargo", baseCommand: "cargo test" };
|
|
95
95
|
if (fs.existsSync(path.join(root, "go.mod"))) return { runner: "go", baseCommand: "go test ./..." };
|
|
96
|
-
if (fs.existsSync(path.join(root, "Makefile")))
|
|
96
|
+
if (fs.existsSync(path.join(root, "Makefile"))) {
|
|
97
|
+
try {
|
|
98
|
+
const makefileContent = fs.readFileSync(path.join(root, "Makefile"), "utf-8");
|
|
99
|
+
const hasTestTarget = /^test:/m.test(makefileContent) || /^\s+test:/.test(makefileContent);
|
|
100
|
+
if (hasTestTarget) return { runner: "make", baseCommand: "make test" };
|
|
101
|
+
} catch {
|
|
102
|
+
}
|
|
103
|
+
}
|
|
97
104
|
if (fs.existsSync(path.join(root, "package.json"))) {
|
|
98
105
|
try {
|
|
99
106
|
const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf-8"));
|
|
@@ -10,13 +10,16 @@ var BOOTSTRAP = [
|
|
|
10
10
|
' 2. `kuma_safety({ action: "guard" })` \u2014 Safety check before work',
|
|
11
11
|
' 3. `kuma_context({ action: "research", scope: "<area>" })` \u2014 Research before editing',
|
|
12
12
|
" 4. *(edit/read using native tools)*",
|
|
13
|
-
' 5. `kuma_memory({ action: "research_save", ... })` \u2014 Save
|
|
14
|
-
' 6. `kuma_memory({ action: "gotcha" })` \u2014 Record bugs/quirks found',
|
|
15
|
-
' 7. `kuma_memory({ action: "arch_flow" })` \u2014 Record data flow
|
|
16
|
-
' 8. `kuma_memory({ action: "decision" })` \u2014 Record key
|
|
13
|
+
' 5. `kuma_memory({ action: "research_save", ... })` \u2014 Save findings (inline after every read/grep)',
|
|
14
|
+
' 6. `kuma_memory({ action: "gotcha" })` \u2014 Record bugs/quirks (inline when found)',
|
|
15
|
+
' 7. `kuma_memory({ action: "arch_flow" })` \u2014 Record data flow (inline after each hop)',
|
|
16
|
+
' 8. `kuma_memory({ action: "decision" })` \u2014 Record key decisions (inline when choosing)',
|
|
17
17
|
' 9. `kuma_safety({ action: "verify", ... })` \u2014 Run tests / confirm nothing broken',
|
|
18
18
|
' 10. `kuma_context({ action: "changes" })` \u2014 Review session activity',
|
|
19
19
|
"",
|
|
20
|
+
"\u{1F504} Record findings INLINE as you work \u2014 Every read/grep = mini research_save.",
|
|
21
|
+
"\u{1F9E0} Knowledge graph is persistent \u2014 nodes/edges accumulate across sessions, getting richer over time.",
|
|
22
|
+
"",
|
|
20
23
|
"\u26D4 Do NOT skip steps 5-10 after research \u2014 even if no code was changed.",
|
|
21
24
|
"\u{1F4D6} Full rules: `.kuma/init.md`",
|
|
22
25
|
"\u{1F9E0} Tools: `kuma_context` | `kuma_memory` | `kuma_safety`"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumpslabs/kuma",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.17",
|
|
4
4
|
"description": "Safety-first context & orchestration engine for AI coding agents. MCP server with mandatory research pipeline, knowledge graph, impact analysis, decision memory, and safety guard — works with any MCP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|