@goondocks/myco 0.3.7 → 0.4.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.
Files changed (121) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +9 -4
  4. package/commands/init.md +63 -39
  5. package/commands/setup-llm.md +69 -44
  6. package/commands/status.md +28 -10
  7. package/dist/{chunk-YFG2O5HR.js → chunk-2GJFTIWX.js} +2 -2
  8. package/dist/chunk-4FCFRJIQ.js +147 -0
  9. package/dist/chunk-4FCFRJIQ.js.map +1 -0
  10. package/dist/{chunk-PA3VMINE.js → chunk-AK6GNLPV.js} +6 -1
  11. package/dist/chunk-AK6GNLPV.js.map +1 -0
  12. package/dist/{chunk-JKOALBZC.js → chunk-BNIYWCST.js} +2 -2
  13. package/dist/{chunk-ISCT2SI6.js → chunk-G6ZMTQMJ.js} +7357 -60
  14. package/dist/chunk-G6ZMTQMJ.js.map +1 -0
  15. package/dist/{chunk-7WNE22W7.js → chunk-IVS5MYBL.js} +3 -3
  16. package/dist/{chunk-7WNE22W7.js.map → chunk-IVS5MYBL.js.map} +1 -1
  17. package/dist/{chunk-7VPJK56U.js → chunk-JBD5KP5G.js} +31 -16
  18. package/dist/chunk-JBD5KP5G.js.map +1 -0
  19. package/dist/chunk-NUA7UTIY.js +37 -0
  20. package/dist/chunk-NUA7UTIY.js.map +1 -0
  21. package/dist/{chunk-NYAWCMRZ.js → chunk-OUFSLZTX.js} +4 -4
  22. package/dist/chunk-P7RNAYU7.js +242 -0
  23. package/dist/chunk-P7RNAYU7.js.map +1 -0
  24. package/dist/chunk-QQ36XEJP.js +38 -0
  25. package/dist/chunk-QQ36XEJP.js.map +1 -0
  26. package/dist/chunk-RDXTQ436.js +49 -0
  27. package/dist/chunk-RDXTQ436.js.map +1 -0
  28. package/dist/{chunk-AWF3M57N.js → chunk-S7EIHYE7.js} +8 -8
  29. package/dist/{chunk-AWF3M57N.js.map → chunk-S7EIHYE7.js.map} +1 -1
  30. package/dist/{chunk-QWU7QLZI.js → chunk-TZDDXRHG.js} +10 -10
  31. package/dist/chunk-TZDDXRHG.js.map +1 -0
  32. package/dist/chunk-VYV5IFD6.js +99 -0
  33. package/dist/chunk-VYV5IFD6.js.map +1 -0
  34. package/dist/{chunk-LR7RQCOB.js → chunk-XCPQHC4X.js} +2 -2
  35. package/dist/{chunk-CCIV47S4.js → chunk-XHWIIU5D.js} +8 -9
  36. package/dist/chunk-XHWIIU5D.js.map +1 -0
  37. package/dist/{chunk-FFQNE6CT.js → chunk-YZO22BBI.js} +45 -31
  38. package/dist/chunk-YZO22BBI.js.map +1 -0
  39. package/dist/{chunk-ZBNT6E22.js → chunk-ZCBL5HER.js} +2 -2
  40. package/dist/{cli-3WQSDSW6.js → cli-ZN6VBA7V.js} +23 -17
  41. package/dist/cli-ZN6VBA7V.js.map +1 -0
  42. package/dist/{client-5T4M42UQ.js → client-5SUO2UYH.js} +5 -5
  43. package/dist/{config-MD4XMLUS.js → config-4GGMWGAF.js} +4 -4
  44. package/dist/{detect-providers-LNOLBICR.js → detect-providers-5FU3BN5Q.js} +3 -3
  45. package/dist/{init-RALMQKOQ.js → init-7UXGDOFS.js} +51 -60
  46. package/dist/init-7UXGDOFS.js.map +1 -0
  47. package/dist/{main-S3WSUF5T.js → main-6UPAIDGS.js} +648 -228
  48. package/dist/main-6UPAIDGS.js.map +1 -0
  49. package/dist/{rebuild-JW6BCHHZ.js → rebuild-QDSYYCS7.js} +10 -10
  50. package/dist/rebuild-QDSYYCS7.js.map +1 -0
  51. package/dist/{reprocess-SNXFNKBN.js → reprocess-ZNUQCIS3.js} +18 -18
  52. package/dist/reprocess-ZNUQCIS3.js.map +1 -0
  53. package/dist/{restart-YE2IGOYT.js → restart-5UY2KV54.js} +6 -6
  54. package/dist/{search-2HMG3ON7.js → search-2VEN3XIG.js} +9 -9
  55. package/dist/{server-JM3TM7D2.js → server-OR5B4B7K.js} +77 -54
  56. package/dist/{server-JM3TM7D2.js.map → server-OR5B4B7K.js.map} +1 -1
  57. package/dist/{session-5GI2YU6R.js → session-QF6MILAC.js} +2 -2
  58. package/dist/{session-start-2UEEEO52.js → session-start-TUITIUMB.js} +29 -28
  59. package/dist/session-start-TUITIUMB.js.map +1 -0
  60. package/dist/setup-digest-ETCZAUIU.js +15 -0
  61. package/dist/setup-llm-DWEJE3JE.js +15 -0
  62. package/dist/setup-llm-DWEJE3JE.js.map +1 -0
  63. package/dist/src/cli.js +4 -4
  64. package/dist/src/daemon/main.js +4 -4
  65. package/dist/src/hooks/post-tool-use.js +5 -5
  66. package/dist/src/hooks/session-end.js +5 -5
  67. package/dist/src/hooks/session-start.js +4 -4
  68. package/dist/src/hooks/stop.js +7 -7
  69. package/dist/src/hooks/user-prompt-submit.js +5 -5
  70. package/dist/src/hooks/user-prompt-submit.js.map +1 -1
  71. package/dist/src/mcp/server.js +4 -4
  72. package/dist/src/prompts/classification.md +1 -0
  73. package/dist/src/prompts/digest-10000.md +74 -0
  74. package/dist/src/prompts/digest-1500.md +25 -0
  75. package/dist/src/prompts/digest-3000.md +32 -0
  76. package/dist/src/prompts/digest-5000.md +43 -0
  77. package/dist/src/prompts/digest-system.md +32 -0
  78. package/dist/src/prompts/extraction.md +11 -10
  79. package/dist/src/prompts/summary.md +11 -1
  80. package/dist/src/prompts/title.md +1 -1
  81. package/dist/{stats-IOWXG576.js → stats-IVIXIKTS.js} +12 -12
  82. package/dist/stats-IVIXIKTS.js.map +1 -0
  83. package/dist/{verify-7MWOV72E.js → verify-4H6CEE5T.js} +6 -6
  84. package/dist/{version-S7MHLD5P.js → version-5B2TWXQJ.js} +4 -4
  85. package/dist/version-5B2TWXQJ.js.map +1 -0
  86. package/package.json +1 -1
  87. package/skills/myco/SKILL.md +20 -20
  88. package/skills/myco/references/wisdom.md +14 -14
  89. package/skills/rules/SKILL.md +4 -4
  90. package/dist/chunk-7VPJK56U.js.map +0 -1
  91. package/dist/chunk-BA23DROX.js +0 -160
  92. package/dist/chunk-BA23DROX.js.map +0 -1
  93. package/dist/chunk-CCIV47S4.js.map +0 -1
  94. package/dist/chunk-EF4JVH24.js +0 -7299
  95. package/dist/chunk-EF4JVH24.js.map +0 -1
  96. package/dist/chunk-FFQNE6CT.js.map +0 -1
  97. package/dist/chunk-ISCT2SI6.js.map +0 -1
  98. package/dist/chunk-PA3VMINE.js.map +0 -1
  99. package/dist/chunk-QWU7QLZI.js.map +0 -1
  100. package/dist/chunk-YMYJ7FNH.js +0 -19
  101. package/dist/chunk-YMYJ7FNH.js.map +0 -1
  102. package/dist/cli-3WQSDSW6.js.map +0 -1
  103. package/dist/init-RALMQKOQ.js.map +0 -1
  104. package/dist/main-S3WSUF5T.js.map +0 -1
  105. package/dist/rebuild-JW6BCHHZ.js.map +0 -1
  106. package/dist/reprocess-SNXFNKBN.js.map +0 -1
  107. package/dist/session-start-2UEEEO52.js.map +0 -1
  108. package/dist/stats-IOWXG576.js.map +0 -1
  109. /package/dist/{chunk-YFG2O5HR.js.map → chunk-2GJFTIWX.js.map} +0 -0
  110. /package/dist/{chunk-JKOALBZC.js.map → chunk-BNIYWCST.js.map} +0 -0
  111. /package/dist/{chunk-NYAWCMRZ.js.map → chunk-OUFSLZTX.js.map} +0 -0
  112. /package/dist/{chunk-LR7RQCOB.js.map → chunk-XCPQHC4X.js.map} +0 -0
  113. /package/dist/{chunk-ZBNT6E22.js.map → chunk-ZCBL5HER.js.map} +0 -0
  114. /package/dist/{client-5T4M42UQ.js.map → client-5SUO2UYH.js.map} +0 -0
  115. /package/dist/{config-MD4XMLUS.js.map → config-4GGMWGAF.js.map} +0 -0
  116. /package/dist/{detect-providers-LNOLBICR.js.map → detect-providers-5FU3BN5Q.js.map} +0 -0
  117. /package/dist/{restart-YE2IGOYT.js.map → restart-5UY2KV54.js.map} +0 -0
  118. /package/dist/{search-2HMG3ON7.js.map → search-2VEN3XIG.js.map} +0 -0
  119. /package/dist/{session-5GI2YU6R.js.map → session-QF6MILAC.js.map} +0 -0
  120. /package/dist/{version-S7MHLD5P.js.map → setup-digest-ETCZAUIU.js.map} +0 -0
  121. /package/dist/{verify-7MWOV72E.js.map → verify-4H6CEE5T.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  BufferProcessor,
4
4
  TranscriptMiner,
5
5
  writeObservationNotes
6
- } from "./chunk-FFQNE6CT.js";
6
+ } from "./chunk-YZO22BBI.js";
7
7
  import {
8
8
  EMBEDDING_BATCH_CONCURRENCY,
9
9
  LLM_BATCH_CONCURRENCY,
@@ -13,43 +13,43 @@ import {
13
13
  VaultWriter,
14
14
  bareSessionId,
15
15
  sessionNoteId
16
- } from "./chunk-QWU7QLZI.js";
16
+ } from "./chunk-TZDDXRHG.js";
17
17
  import {
18
18
  indexNote,
19
19
  require_gray_matter
20
- } from "./chunk-AWF3M57N.js";
20
+ } from "./chunk-S7EIHYE7.js";
21
21
  import {
22
22
  generateEmbedding
23
23
  } from "./chunk-RGVBGTD6.js";
24
+ import {
25
+ createEmbeddingProvider,
26
+ createLlmProvider
27
+ } from "./chunk-IVS5MYBL.js";
24
28
  import {
25
29
  VectorIndex
26
30
  } from "./chunk-XQXXF6MU.js";
27
- import "./chunk-CCIV47S4.js";
28
- import {
29
- parseStringFlag
30
- } from "./chunk-SAKJMNSR.js";
31
31
  import {
32
32
  initFts
33
33
  } from "./chunk-6FQISQNA.js";
34
34
  import {
35
35
  MycoIndex
36
- } from "./chunk-PA3VMINE.js";
36
+ } from "./chunk-AK6GNLPV.js";
37
+ import "./chunk-XHWIIU5D.js";
37
38
  import {
38
- createEmbeddingProvider,
39
- createLlmProvider
40
- } from "./chunk-7WNE22W7.js";
41
- import "./chunk-BA23DROX.js";
39
+ parseStringFlag
40
+ } from "./chunk-SAKJMNSR.js";
41
+ import "./chunk-P7RNAYU7.js";
42
42
  import {
43
43
  loadConfig
44
- } from "./chunk-ISCT2SI6.js";
45
- import "./chunk-EF4JVH24.js";
44
+ } from "./chunk-QQ36XEJP.js";
45
+ import "./chunk-G6ZMTQMJ.js";
46
46
  import {
47
47
  claudeCodeAdapter,
48
48
  createPerProjectAdapter
49
- } from "./chunk-JKOALBZC.js";
49
+ } from "./chunk-BNIYWCST.js";
50
50
  import {
51
51
  EMBEDDING_INPUT_LIMIT
52
- } from "./chunk-7VPJK56U.js";
52
+ } from "./chunk-JBD5KP5G.js";
53
53
  import {
54
54
  __toESM
55
55
  } from "./chunk-PZUWP5VK.js";
@@ -141,7 +141,7 @@ async function run(args, vaultDir) {
141
141
  id: `${o.type}-${task.bare.slice(-6)}-${Date.now()}`,
142
142
  text: `${o.title}
143
143
  ${o.content}`.slice(0, EMBEDDING_INPUT_LIMIT),
144
- metadata: { type: "memory", session_id: task.bare }
144
+ metadata: { type: "spore", session_id: task.bare }
145
145
  });
146
146
  }
147
147
  }
@@ -196,4 +196,4 @@ Done: ${tasks.length} sessions reprocessed, ${totalObservations} observations ex
196
196
  export {
197
197
  run
198
198
  };
199
- //# sourceMappingURL=reprocess-SNXFNKBN.js.map
199
+ //# sourceMappingURL=reprocess-ZNUQCIS3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/reprocess.ts"],"sourcesContent":["/**\n * myco reprocess — re-run the observation extraction and summarization pipeline\n * for existing sessions. Useful after bugs or when the LLM backend changes.\n *\n * Reads transcripts (the source of truth), re-extracts observations, regenerates\n * summaries, and re-indexes everything. Existing spore files from those sessions\n * are preserved — new observations are additive.\n */\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { MycoIndex } from '../index/sqlite.js';\nimport { VectorIndex } from '../index/vectors.js';\nimport { initFts } from '../index/fts.js';\nimport { indexNote } from '../index/rebuild.js';\nimport { loadConfig } from '../config/loader.js';\nimport { createLlmProvider, createEmbeddingProvider } from '../intelligence/llm.js';\nimport { generateEmbedding } from '../intelligence/embeddings.js';\nimport { batchExecute, LLM_BATCH_CONCURRENCY, EMBEDDING_BATCH_CONCURRENCY } from '../intelligence/batch.js';\nimport { BufferProcessor } from '../daemon/processor.js';\nimport { TranscriptMiner } from '../capture/transcript-miner.js';\nimport { VaultWriter } from '../vault/writer.js';\nimport { writeObservationNotes } from '../vault/observations.js';\nimport { createPerProjectAdapter } from '../agents/adapter.js';\nimport { claudeCodeAdapter } from '../agents/claude-code.js';\nimport { sessionNoteId, bareSessionId } from '../vault/session-id.js';\nimport { EMBEDDING_INPUT_LIMIT } from '../constants.js';\nimport { parseStringFlag } from './shared.js';\nimport matter from 'gray-matter';\n\ninterface EmbedJob {\n id: string;\n text: string;\n metadata: Record<string, string>;\n}\n\ninterface SessionTask {\n relativePath: string;\n sessionId: string;\n bare: string;\n frontmatter: Record<string, unknown>;\n batchEvents: Array<Record<string, unknown>> | null;\n turnCount: number;\n}\n\nexport async function run(args: string[], vaultDir: string): Promise<void> {\n const sessionFilter = parseStringFlag(args, '--session');\n const skipLlm = args.includes('--index-only');\n\n const config = loadConfig(vaultDir);\n const index = new MycoIndex(path.join(vaultDir, 'index.db'));\n initFts(index);\n\n const llmProvider = skipLlm ? null : createLlmProvider(config.intelligence.llm);\n const embeddingProvider = createEmbeddingProvider(config.intelligence.embedding);\n\n let vectorIndex: VectorIndex | null = null;\n try {\n const testEmbed = await embeddingProvider.embed('test');\n vectorIndex = new VectorIndex(path.join(vaultDir, 'vectors.db'), testEmbed.dimensions);\n } catch (e) {\n console.log(`Vector index unavailable: ${(e as Error).message}`);\n }\n\n const processor = llmProvider\n ? new BufferProcessor(llmProvider, config.intelligence.llm.context_window)\n : null;\n const writer = new VaultWriter(vaultDir);\n const miner = new TranscriptMiner({\n additionalAdapters: config.capture.transcript_paths.map((p: string) =>\n createPerProjectAdapter(p, claudeCodeAdapter.parseTurns),\n ),\n });\n\n // Find sessions to reprocess\n const sessionsDir = path.join(vaultDir, 'sessions');\n if (!fs.existsSync(sessionsDir)) {\n console.log('No sessions directory found.');\n index.close();\n vectorIndex?.close();\n return;\n }\n\n const sessionFiles: Array<{ relativePath: string; sessionId: string }> = [];\n for (const dateDir of fs.readdirSync(sessionsDir)) {\n const datePath = path.join(sessionsDir, dateDir);\n if (!fs.statSync(datePath).isDirectory()) continue;\n for (const file of fs.readdirSync(datePath)) {\n if (!file.startsWith('session-') || !file.endsWith('.md')) continue;\n const sessionId = file.replace('session-', '').replace('.md', '');\n if (sessionFilter && !sessionId.includes(sessionFilter)) continue;\n sessionFiles.push({\n relativePath: path.join('sessions', dateDir, file),\n sessionId,\n });\n }\n }\n\n if (sessionFiles.length === 0) {\n console.log(sessionFilter ? `No sessions matching \"${sessionFilter}\" found.` : 'No sessions found.');\n index.close();\n vectorIndex?.close();\n return;\n }\n\n // Prepare tasks: read transcripts, build extraction inputs\n const tasks: SessionTask[] = sessionFiles.map(({ relativePath, sessionId }) => {\n const raw = fs.readFileSync(path.join(vaultDir, relativePath), 'utf-8');\n const { data: frontmatter } = matter(raw);\n const bare = bareSessionId(sessionId);\n const turnsResult = miner.getAllTurnsWithSource(bare);\n\n const batchEvents = turnsResult && turnsResult.turns.length > 0\n ? turnsResult.turns.map((t) => ({\n type: 'turn' as const,\n prompt: t.prompt,\n tool_count: t.toolCount,\n response: t.aiResponse ?? '',\n timestamp: t.timestamp,\n }))\n : null;\n\n return { relativePath, sessionId, bare, frontmatter, batchEvents, turnCount: turnsResult?.turns.length ?? 0 };\n });\n\n console.log(`Reprocessing ${tasks.length} session(s)...\\n`);\n\n // Phase 1: LLM extraction (concurrency-limited) + FTS re-indexing\n const embedJobs: EmbedJob[] = [];\n let totalObservations = 0;\n\n const extractionResult = await batchExecute(\n tasks,\n async (task) => {\n let obs = 0;\n process.stdout.write(` ${task.sessionId.slice(0, 12)}... ${task.turnCount} turns`);\n\n if (processor && task.batchEvents) {\n const result = await processor.process(task.batchEvents, task.bare);\n if (result.observations.length > 0) {\n writeObservationNotes(result.observations, task.bare, writer, index, vaultDir);\n obs = result.observations.length;\n process.stdout.write(` → ${obs} observations`);\n\n for (const o of result.observations) {\n embedJobs.push({\n id: `${o.type}-${task.bare.slice(-6)}-${Date.now()}`,\n text: `${o.title}\\n${o.content}`.slice(0, EMBEDDING_INPUT_LIMIT),\n metadata: { type: 'spore', session_id: task.bare },\n });\n }\n }\n }\n\n // FTS re-index (fast, no LLM)\n indexNote(index, vaultDir, task.relativePath);\n\n // Queue session embedding\n const embText = `${task.frontmatter.title ?? ''}\\n${task.frontmatter.summary ?? ''}`.slice(0, EMBEDDING_INPUT_LIMIT);\n if (embText.trim()) {\n embedJobs.push({\n id: sessionNoteId(task.bare),\n text: embText,\n metadata: { type: 'session', session_id: task.bare },\n });\n }\n\n process.stdout.write('\\n');\n return obs;\n },\n {\n concurrency: LLM_BATCH_CONCURRENCY,\n onProgress: (done, total) => {\n if (done === total) console.log(`\\nExtraction complete: ${done} sessions processed.`);\n },\n },\n );\n\n for (const r of extractionResult.results) {\n if (r.status === 'fulfilled') totalObservations += r.value;\n }\n\n // Phase 2: Parallel embeddings\n if (vectorIndex && embedJobs.length > 0) {\n console.log(`Embedding ${embedJobs.length} notes (concurrency: ${EMBEDDING_BATCH_CONCURRENCY})...`);\n\n const embResult = await batchExecute(\n embedJobs,\n async (job) => {\n const emb = await generateEmbedding(embeddingProvider, job.text);\n vectorIndex!.upsert(job.id, emb.embedding, job.metadata);\n },\n {\n concurrency: EMBEDDING_BATCH_CONCURRENCY,\n onProgress: (done, total) => process.stdout.write(`\\r Embedded ${done}/${total}`),\n },\n );\n\n process.stdout.write('\\n');\n if (embResult.failed > 0) {\n console.log(` ${embResult.failed} embedding(s) failed.`);\n }\n }\n\n console.log(`\\nDone: ${tasks.length} sessions reprocessed, ${totalObservations} observations extracted.`);\n\n index.close();\n vectorIndex?.close();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,OAAO,QAAQ;AACf,OAAO,UAAU;AAkBjB,yBAAmB;AAiBnB,eAAsB,IAAI,MAAgB,UAAiC;AACzE,QAAM,gBAAgB,gBAAgB,MAAM,WAAW;AACv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AAG;AACvC,YAAQ,IAAI,aAAa,UAAU,MAAM,wBAAwB,2BAA2B,MAAM;AAElG,UAAM,YAAY,MAAM;AAAA,MACtB;AAAA,MACA,OAAO,QAAQ;AACb,cAAM,MAAM,MAAM,kBAAkB,mBAAmB,IAAI,IAAI;AAC/D,oBAAa,OAAO,IAAI,IAAI,IAAI,WAAW,IAAI,QAAQ;AAAA,MACzD;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,YAAY,CAAC,MAAM,UAAU,QAAQ,OAAO,MAAM,gBAAgB,IAAI,IAAI,KAAK,EAAE;AAAA,MACnF;AAAA,IACF;AAEA,YAAQ,OAAO,MAAM,IAAI;AACzB,QAAI,UAAU,SAAS,GAAG;AACxB,cAAQ,IAAI,KAAK,UAAU,MAAM,uBAAuB;AAAA,IAC1D;AAAA,EACF;AAEA,UAAQ,IAAI;AAAA,QAAW,MAAM,MAAM,0BAA0B,iBAAiB,0BAA0B;AAExG,QAAM,MAAM;AACZ,eAAa,MAAM;AACrB;","names":["matter"]}
@@ -1,11 +1,11 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
2
  import {
3
3
  isProcessAlive
4
- } from "./chunk-CCIV47S4.js";
4
+ } from "./chunk-XHWIIU5D.js";
5
5
  import "./chunk-SAKJMNSR.js";
6
- import "./chunk-BA23DROX.js";
7
- import "./chunk-JKOALBZC.js";
8
- import "./chunk-7VPJK56U.js";
6
+ import "./chunk-P7RNAYU7.js";
7
+ import "./chunk-BNIYWCST.js";
8
+ import "./chunk-JBD5KP5G.js";
9
9
  import "./chunk-PZUWP5VK.js";
10
10
 
11
11
  // src/cli/restart.ts
@@ -29,7 +29,7 @@ async function run(_args, vaultDir) {
29
29
  } catch {
30
30
  }
31
31
  }
32
- const { DaemonClient } = await import("./client-5T4M42UQ.js");
32
+ const { DaemonClient } = await import("./client-5SUO2UYH.js");
33
33
  const client = new DaemonClient(vaultDir);
34
34
  console.log("Waiting for health check...");
35
35
  const healthy = await client.ensureRunning();
@@ -47,4 +47,4 @@ async function run(_args, vaultDir) {
47
47
  export {
48
48
  run
49
49
  };
50
- //# sourceMappingURL=restart-YE2IGOYT.js.map
50
+ //# sourceMappingURL=restart-5UY2KV54.js.map
@@ -2,6 +2,9 @@ import { createRequire as __cr } from 'node:module'; const require = __cr(import
2
2
  import {
3
3
  generateEmbedding
4
4
  } from "./chunk-RGVBGTD6.js";
5
+ import {
6
+ createEmbeddingProvider
7
+ } from "./chunk-IVS5MYBL.js";
5
8
  import {
6
9
  VectorIndex
7
10
  } from "./chunk-XQXXF6MU.js";
@@ -10,16 +13,13 @@ import {
10
13
  } from "./chunk-6FQISQNA.js";
11
14
  import {
12
15
  MycoIndex
13
- } from "./chunk-PA3VMINE.js";
14
- import {
15
- createEmbeddingProvider
16
- } from "./chunk-7WNE22W7.js";
17
- import "./chunk-BA23DROX.js";
16
+ } from "./chunk-AK6GNLPV.js";
17
+ import "./chunk-P7RNAYU7.js";
18
18
  import {
19
19
  loadConfig
20
- } from "./chunk-ISCT2SI6.js";
21
- import "./chunk-EF4JVH24.js";
22
- import "./chunk-7VPJK56U.js";
20
+ } from "./chunk-QQ36XEJP.js";
21
+ import "./chunk-G6ZMTQMJ.js";
22
+ import "./chunk-JBD5KP5G.js";
23
23
  import "./chunk-PZUWP5VK.js";
24
24
 
25
25
  // src/cli/search.ts
@@ -117,4 +117,4 @@ export {
117
117
  run,
118
118
  runVectors
119
119
  };
120
- //# sourceMappingURL=search-2HMG3ON7.js.map
120
+ //# sourceMappingURL=search-2VEN3XIG.js.map
@@ -1,38 +1,44 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
+ import {
3
+ queryLogs
4
+ } from "./chunk-BMJX2IDQ.js";
5
+ import {
6
+ handleMycoContext
7
+ } from "./chunk-RDXTQ436.js";
8
+ import "./chunk-5EZ7QF6J.js";
2
9
  import {
3
10
  VaultWriter
4
- } from "./chunk-QWU7QLZI.js";
11
+ } from "./chunk-TZDDXRHG.js";
5
12
  import {
6
13
  OBSERVATION_TYPES,
7
14
  PLAN_STATUSES,
8
15
  indexNote
9
- } from "./chunk-AWF3M57N.js";
16
+ } from "./chunk-S7EIHYE7.js";
10
17
  import {
11
18
  generateEmbedding
12
19
  } from "./chunk-RGVBGTD6.js";
20
+ import {
21
+ createEmbeddingProvider
22
+ } from "./chunk-IVS5MYBL.js";
13
23
  import {
14
24
  VectorIndex
15
25
  } from "./chunk-XQXXF6MU.js";
16
26
  import {
17
- queryLogs
18
- } from "./chunk-BMJX2IDQ.js";
19
- import "./chunk-5EZ7QF6J.js";
20
- import {
21
- memoryFm,
22
27
  planFm,
23
- sessionFm
24
- } from "./chunk-YMYJ7FNH.js";
28
+ sessionFm,
29
+ sporeFm
30
+ } from "./chunk-NUA7UTIY.js";
25
31
  import {
26
32
  initFts,
27
33
  searchFts
28
34
  } from "./chunk-6FQISQNA.js";
29
35
  import {
30
36
  MycoIndex
31
- } from "./chunk-PA3VMINE.js";
37
+ } from "./chunk-AK6GNLPV.js";
38
+ import "./chunk-P7RNAYU7.js";
32
39
  import {
33
- createEmbeddingProvider
34
- } from "./chunk-7WNE22W7.js";
35
- import "./chunk-BA23DROX.js";
40
+ loadConfig
41
+ } from "./chunk-QQ36XEJP.js";
36
42
  import {
37
43
  _enum,
38
44
  _null,
@@ -43,7 +49,6 @@ import {
43
49
  intersection,
44
50
  iso_exports,
45
51
  literal,
46
- loadConfig,
47
52
  looseObject,
48
53
  number,
49
54
  object,
@@ -54,18 +59,17 @@ import {
54
59
  string,
55
60
  union,
56
61
  unknown
57
- } from "./chunk-ISCT2SI6.js";
58
- import "./chunk-EF4JVH24.js";
62
+ } from "./chunk-G6ZMTQMJ.js";
59
63
  import {
60
64
  resolveSessionFromBuffer
61
65
  } from "./chunk-HIN3UVOG.js";
62
66
  import {
63
67
  getPluginVersion
64
- } from "./chunk-YFG2O5HR.js";
68
+ } from "./chunk-2GJFTIWX.js";
65
69
  import {
66
70
  resolveVaultDir
67
71
  } from "./chunk-N33KUCFP.js";
68
- import "./chunk-JKOALBZC.js";
72
+ import "./chunk-BNIYWCST.js";
69
73
  import {
70
74
  CONTENT_SNIPPET_CHARS,
71
75
  EMBEDDING_INPUT_LIMIT,
@@ -74,7 +78,7 @@ import {
74
78
  MCP_SESSIONS_DEFAULT_LIMIT,
75
79
  RECALL_SUMMARY_PREVIEW_CHARS,
76
80
  SESSION_SUMMARY_PREVIEW_CHARS
77
- } from "./chunk-7VPJK56U.js";
81
+ } from "./chunk-JBD5KP5G.js";
78
82
  import {
79
83
  __commonJS,
80
84
  __toESM
@@ -14124,7 +14128,7 @@ async function handleMycoRecall(index, input) {
14124
14128
  if (input.branch) {
14125
14129
  sessions = sessions.filter((s) => sessionFm(s).branch === input.branch);
14126
14130
  }
14127
- const memories = index.query({ type: "memory", limit: 5 }).filter((m) => memoryFm(m).status !== "superseded" && memoryFm(m).status !== "archived");
14131
+ const spores = index.query({ type: "spore", limit: 5 }).filter((m) => sporeFm(m).status !== "superseded" && sporeFm(m).status !== "archived");
14128
14132
  return {
14129
14133
  active_plans: activePlans.map((p) => ({
14130
14134
  id: p.id,
@@ -14136,10 +14140,10 @@ async function handleMycoRecall(index, input) {
14136
14140
  title: s.title,
14137
14141
  summary: s.content.slice(0, RECALL_SUMMARY_PREVIEW_CHARS)
14138
14142
  })),
14139
- relevant_memories: memories.map((m) => ({
14143
+ relevant_spores: spores.map((m) => ({
14140
14144
  id: m.id,
14141
14145
  title: m.title,
14142
- type: memoryFm(m).observation_type ?? "discovery"
14146
+ type: sporeFm(m).observation_type ?? "discovery"
14143
14147
  })),
14144
14148
  team_activity: []
14145
14149
  };
@@ -14152,7 +14156,7 @@ async function handleMycoRemember(vaultDir, index, input) {
14152
14156
  const writer = new VaultWriter(vaultDir);
14153
14157
  const id = `${input.type}-${randomBytes(4).toString("hex")}`;
14154
14158
  const session = input.session ?? resolveSessionFromBuffer(path.join(vaultDir, "buffer"));
14155
- const notePath = writer.writeMemory({
14159
+ const notePath = writer.writeSpore({
14156
14160
  id,
14157
14161
  observation_type: input.type,
14158
14162
  session,
@@ -14394,14 +14398,14 @@ import fs from "fs";
14394
14398
  import path3 from "path";
14395
14399
  async function handleMycoSupersede(vaultDir, index, input) {
14396
14400
  const writer = new VaultWriter(vaultDir);
14397
- const oldNotes = index.queryByIds([input.old_memory_id]);
14401
+ const oldNotes = index.queryByIds([input.old_spore_id]);
14398
14402
  if (oldNotes.length === 0) {
14399
- return { old_memory: input.old_memory_id, new_memory: input.new_memory_id, status: "not_found" };
14403
+ return { old_spore: input.old_spore_id, new_spore: input.new_spore_id, status: "not_found" };
14400
14404
  }
14401
14405
  const oldNote = oldNotes[0];
14402
14406
  writer.updateNoteFrontmatter(oldNote.path, {
14403
14407
  status: "superseded",
14404
- superseded_by: input.new_memory_id
14408
+ superseded_by: input.new_spore_id
14405
14409
  }, true);
14406
14410
  const fullPath = path3.join(vaultDir, oldNote.path);
14407
14411
  const content = fs.readFileSync(fullPath, "utf-8");
@@ -14411,13 +14415,13 @@ async function handleMycoSupersede(vaultDir, index, input) {
14411
14415
  > [!warning] Superseded
14412
14416
  > This observation has been superseded.
14413
14417
 
14414
- Superseded by:: [[${input.new_memory_id}]]`;
14418
+ Superseded by:: [[${input.new_spore_id}]]`;
14415
14419
  const reasonLine = input.reason ? `
14416
14420
  Reason:: ${input.reason}` : "";
14417
14421
  fs.writeFileSync(fullPath, content.trimEnd() + notice + reasonLine + "\n", "utf-8");
14418
14422
  }
14419
14423
  indexNote(index, vaultDir, oldNote.path);
14420
- return { old_memory: input.old_memory_id, new_memory: input.new_memory_id, status: "superseded" };
14424
+ return { old_spore: input.old_spore_id, new_spore: input.new_spore_id, status: "superseded" };
14421
14425
  }
14422
14426
 
14423
14427
  // src/mcp/tools/consolidate.ts
@@ -14427,24 +14431,24 @@ import path4 from "path";
14427
14431
  async function handleMycoConsolidate(vaultDir, index, input) {
14428
14432
  const writer = new VaultWriter(vaultDir);
14429
14433
  const wisdomId = `${input.observation_type}-wisdom-${randomBytes2(4).toString("hex")}`;
14430
- const sourceLinks = input.source_memory_ids.map((id) => `- [[${id}]]`).join("\n");
14434
+ const sourceLinks = input.source_spore_ids.map((id) => `- [[${id}]]`).join("\n");
14431
14435
  const fullContent = `${input.consolidated_content}
14432
14436
 
14433
14437
  ## Sources
14434
14438
 
14435
14439
  Consolidated from:
14436
14440
  ${sourceLinks}`;
14437
- const wisdomPath = writer.writeMemory({
14441
+ const wisdomPath = writer.writeSpore({
14438
14442
  id: wisdomId,
14439
14443
  observation_type: input.observation_type,
14440
14444
  tags: [...input.tags ?? [], "wisdom", "consolidated"],
14441
14445
  content: fullContent
14442
14446
  });
14443
14447
  writer.updateNoteFrontmatter(wisdomPath, {
14444
- consolidated_from: input.source_memory_ids
14448
+ consolidated_from: input.source_spore_ids
14445
14449
  }, true);
14446
14450
  let archived = 0;
14447
- for (const sourceId of input.source_memory_ids) {
14451
+ for (const sourceId of input.source_spore_ids) {
14448
14452
  const notes = index.queryByIds([sourceId]);
14449
14453
  if (notes.length > 0) {
14450
14454
  const notePath = notes[0].path;
@@ -14484,6 +14488,7 @@ var TOOL_ORPHANS = "myco_orphans";
14484
14488
  var TOOL_LOGS = "myco_logs";
14485
14489
  var TOOL_SUPERSEDE = "myco_supersede";
14486
14490
  var TOOL_CONSOLIDATE = "myco_consolidate";
14491
+ var TOOL_CONTEXT = "myco_context";
14487
14492
  var PROP_BRANCH = "Git branch name to find related sessions and plans";
14488
14493
  var PROP_SINCE = "ISO timestamp \u2014 entries after this date";
14489
14494
  var PROP_TAGS = "Tags for discoverability \u2014 component names, technologies, concepts";
@@ -14495,7 +14500,7 @@ var TOOL_DEFINITIONS = [
14495
14500
  type: "object",
14496
14501
  properties: {
14497
14502
  query: { type: "string", description: "Natural language search query \u2014 describe what you are looking for" },
14498
- type: { type: "string", enum: ["session", "plan", "memory", "all"], description: "Filter by note type (default: all)" },
14503
+ type: { type: "string", enum: ["session", "plan", "spore", "all"], description: "Filter by note type (default: all)" },
14499
14504
  limit: { type: "number", description: `Max results (default: ${MCP_SEARCH_DEFAULT_LIMIT})` }
14500
14505
  },
14501
14506
  required: ["query"]
@@ -14503,18 +14508,18 @@ var TOOL_DEFINITIONS = [
14503
14508
  },
14504
14509
  {
14505
14510
  name: TOOL_RECALL,
14506
- description: "Get context relevant to your current work \u2014 memories, sessions, and plans related to the branch and files you are working on. Use at the start of a task or when you need background on a component.",
14511
+ description: "Get context relevant to your current work \u2014 spores, sessions, and plans related to the branch and files you are working on. Use at the start of a task or when you need background on a component.",
14507
14512
  inputSchema: {
14508
14513
  type: "object",
14509
14514
  properties: {
14510
14515
  branch: { type: "string", description: PROP_BRANCH },
14511
- files: { type: "array", items: { type: "string" }, description: "File paths you are working on \u2014 finds memories tagged with these files" }
14516
+ files: { type: "array", items: { type: "string" }, description: "File paths you are working on \u2014 finds spores tagged with these files" }
14512
14517
  }
14513
14518
  }
14514
14519
  },
14515
14520
  {
14516
14521
  name: TOOL_REMEMBER,
14517
- description: "Save a decision, gotcha, bug fix, discovery, or trade-off as a permanent memory. Use after making a key decision, fixing a tricky bug, discovering something non-obvious, or encountering a gotcha.",
14522
+ description: "Save a decision, gotcha, bug fix, discovery, or trade-off as a permanent spore. Use after making a key decision, fixing a tricky bug, discovering something non-obvious, or encountering a gotcha.",
14518
14523
  inputSchema: {
14519
14524
  type: "object",
14520
14525
  properties: {
@@ -14540,7 +14545,7 @@ var TOOL_DEFINITIONS = [
14540
14545
  },
14541
14546
  {
14542
14547
  name: TOOL_SESSIONS,
14543
- description: "Browse past coding sessions with summaries, tools used, and linked memories. Use to understand what work has been done on a feature or branch.",
14548
+ description: "Browse past coding sessions with summaries, tools used, and linked spores. Use to understand what work has been done on a feature or branch.",
14544
14549
  inputSchema: {
14545
14550
  type: "object",
14546
14551
  properties: {
@@ -14566,7 +14571,7 @@ var TOOL_DEFINITIONS = [
14566
14571
  },
14567
14572
  {
14568
14573
  name: TOOL_GRAPH,
14569
- description: "Traverse connections between vault notes via wikilinks \u2014 explore how sessions, memories, and plans relate to each other.",
14574
+ description: "Traverse connections between vault notes via wikilinks \u2014 explore how sessions, spores, and plans relate to each other.",
14570
14575
  inputSchema: {
14571
14576
  type: "object",
14572
14577
  properties: {
@@ -14601,29 +14606,43 @@ var TOOL_DEFINITIONS = [
14601
14606
  },
14602
14607
  {
14603
14608
  name: TOOL_SUPERSEDE,
14604
- description: "Mark a memory as outdated and replaced by a newer one. Use when a decision was reversed, a gotcha was fixed, a discovery was wrong, or the codebase changed and an observation no longer applies. The old memory is preserved but marked superseded.",
14609
+ description: "Mark a spore as outdated and replaced by a newer one. Use when a decision was reversed, a gotcha was fixed, a discovery was wrong, or the codebase changed and an observation no longer applies. The old spore is preserved but marked superseded.",
14605
14610
  inputSchema: {
14606
14611
  type: "object",
14607
14612
  properties: {
14608
- old_memory_id: { type: "string", description: 'ID of the outdated memory (e.g., "decision-abc123")' },
14609
- new_memory_id: { type: "string", description: "ID of the replacement memory" },
14610
- reason: { type: "string", description: "Why the old memory is being superseded" }
14613
+ old_spore_id: { type: "string", description: 'ID of the outdated spore (e.g., "decision-abc123")' },
14614
+ new_spore_id: { type: "string", description: "ID of the replacement spore" },
14615
+ reason: { type: "string", description: "Why the old spore is being superseded" }
14611
14616
  },
14612
- required: ["old_memory_id", "new_memory_id"]
14617
+ required: ["old_spore_id", "new_spore_id"]
14613
14618
  }
14614
14619
  },
14615
14620
  {
14616
14621
  name: TOOL_CONSOLIDATE,
14617
- description: "Merge 3+ related memories into a single comprehensive wisdom note. Use when multiple observations describe aspects of the same insight, share a root cause, or would be more useful as one reference. Source memories are marked superseded.",
14622
+ description: "Merge 3+ related spores into a single comprehensive wisdom note. Use when multiple observations describe aspects of the same insight, share a root cause, or would be more useful as one reference. Source spores are marked superseded.",
14618
14623
  inputSchema: {
14619
14624
  type: "object",
14620
14625
  properties: {
14621
- source_memory_ids: { type: "array", items: { type: "string" }, description: "IDs of the memories to merge (minimum 2)" },
14626
+ source_spore_ids: { type: "array", items: { type: "string" }, description: "IDs of the spores to merge (minimum 2)" },
14622
14627
  consolidated_content: { type: "string", description: "The merged, comprehensive content \u2014 synthesize, do not just concatenate" },
14623
14628
  observation_type: { type: "string", enum: OBSERVATION_TYPES, description: `Type for the consolidated wisdom note: ${OBSERVATION_TYPES.join(", ")}` },
14624
14629
  tags: { type: "array", items: { type: "string" }, description: PROP_TAGS }
14625
14630
  },
14626
- required: ["source_memory_ids", "consolidated_content", "observation_type"]
14631
+ required: ["source_spore_ids", "consolidated_content", "observation_type"]
14632
+ }
14633
+ },
14634
+ {
14635
+ name: TOOL_CONTEXT,
14636
+ description: "Retrieve Myco's synthesized understanding of this project. Returns a pre-computed context extract at the requested token tier. Available tiers: 1500 (executive briefing), 3000 (team standup), 5000 (deep onboarding), 10000 (institutional knowledge). This is a rich, always-current synthesis of project history, decisions, patterns, and active work \u2014 not a search result.",
14637
+ inputSchema: {
14638
+ type: "object",
14639
+ properties: {
14640
+ tier: {
14641
+ type: "number",
14642
+ enum: [1500, 3e3, 5e3, 1e4],
14643
+ description: "Token budget tier. Larger tiers include more detail. Default: 3000."
14644
+ }
14645
+ }
14627
14646
  }
14628
14647
  }
14629
14648
  ];
@@ -14671,7 +14690,7 @@ function createMycoServer(config2) {
14671
14690
  return { content: [{ type: "text", text: JSON.stringify(await handleMycoRecall(idx, input)) }] };
14672
14691
  case TOOL_REMEMBER: {
14673
14692
  const result = await handleMycoRemember(config2.vaultDir, idx, input);
14674
- embedNote(result.id, String(input.content), { type: "memory", observation_type: String(input.type ?? ""), importance: "high" });
14693
+ embedNote(result.id, String(input.content), { type: "spore", observation_type: String(input.type ?? ""), importance: "high" });
14675
14694
  logActivity(TOOL_REMEMBER, { id: result.id, observation_type: input.type, path: result.note_path });
14676
14695
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
14677
14696
  }
@@ -14690,22 +14709,26 @@ function createMycoServer(config2) {
14690
14709
  case TOOL_SUPERSEDE: {
14691
14710
  const result = await handleMycoSupersede(config2.vaultDir, idx, input);
14692
14711
  if (result.status === "superseded" && config2.vectorIndex) {
14693
- config2.vectorIndex.delete(result.old_memory);
14712
+ config2.vectorIndex.delete(result.old_spore);
14694
14713
  }
14695
- logActivity(TOOL_SUPERSEDE, { old: result.old_memory, new: result.new_memory, status: result.status });
14714
+ logActivity(TOOL_SUPERSEDE, { old: result.old_spore, new: result.new_spore, status: result.status });
14696
14715
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
14697
14716
  }
14698
14717
  case TOOL_CONSOLIDATE: {
14699
14718
  const result = await handleMycoConsolidate(config2.vaultDir, idx, input);
14700
- embedNote(result.wisdom_id, String(input.consolidated_content), { type: "memory", observation_type: String(input.observation_type ?? ""), importance: "high" });
14701
- if (config2.vectorIndex && Array.isArray(input.source_memory_ids)) {
14702
- for (const id of input.source_memory_ids) {
14719
+ embedNote(result.wisdom_id, String(input.consolidated_content), { type: "spore", observation_type: String(input.observation_type ?? ""), importance: "high" });
14720
+ if (config2.vectorIndex && Array.isArray(input.source_spore_ids)) {
14721
+ for (const id of input.source_spore_ids) {
14703
14722
  config2.vectorIndex.delete(id);
14704
14723
  }
14705
14724
  }
14706
- logActivity(TOOL_CONSOLIDATE, { wisdom_id: result.wisdom_id, sources: input.source_memory_ids, archived: result.sources_archived });
14725
+ logActivity(TOOL_CONSOLIDATE, { wisdom_id: result.wisdom_id, sources: input.source_spore_ids, archived: result.sources_archived });
14707
14726
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
14708
14727
  }
14728
+ case TOOL_CONTEXT: {
14729
+ const result = handleMycoContext(config2.vaultDir, args);
14730
+ return { content: [{ type: "text", text: result.content }] };
14731
+ }
14709
14732
  default:
14710
14733
  throw new Error(`Unknown tool: ${name}`);
14711
14734
  }
@@ -14746,4 +14769,4 @@ export {
14746
14769
  createMycoServer,
14747
14770
  main
14748
14771
  };
14749
- //# sourceMappingURL=server-JM3TM7D2.js.map
14772
+ //# sourceMappingURL=server-OR5B4B7K.js.map