@goondocks/myco 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CONTRIBUTING.md +4 -5
- package/README.md +1 -1
- package/dist/{chunk-P7RNAYU7.js → chunk-67R6EMYD.js} +61 -9
- package/dist/chunk-67R6EMYD.js.map +1 -0
- package/dist/{chunk-G6ZMTQMJ.js → chunk-6UJWI4IW.js} +3 -1
- package/dist/{chunk-G6ZMTQMJ.js.map → chunk-6UJWI4IW.js.map} +1 -1
- package/dist/{chunk-S7EIHYE7.js → chunk-FPEDTLQ6.js} +3 -3
- package/dist/{chunk-S7EIHYE7.js.map → chunk-FPEDTLQ6.js.map} +1 -1
- package/dist/{chunk-XHWIIU5D.js → chunk-GFBG73P4.js} +2 -2
- package/dist/{chunk-TZDDXRHG.js → chunk-I7PNZEBO.js} +2 -2
- package/dist/{chunk-IVS5MYBL.js → chunk-IYFKPSRP.js} +2 -2
- package/dist/{chunk-NUA7UTIY.js → chunk-MIU3DKLN.js} +2 -2
- package/dist/{chunk-VYV5IFD6.js → chunk-T7OC6GH5.js} +2 -2
- package/dist/chunk-TBRZAJ7W.js +135 -0
- package/dist/chunk-TBRZAJ7W.js.map +1 -0
- package/dist/{chunk-4FCFRJIQ.js → chunk-UKWO26VI.js} +2 -2
- package/dist/{chunk-YZO22BBI.js → chunk-V2OWD2VV.js} +4 -4
- package/dist/{chunk-RDXTQ436.js → chunk-WBT5DWGC.js} +2 -2
- package/dist/{cli-ZN6VBA7V.js → cli-PMOFCZQL.js} +15 -15
- package/dist/{config-4GGMWGAF.js → config-5FGLQGCW.js} +3 -3
- package/dist/{detect-providers-5FU3BN5Q.js → detect-providers-IRL2TTLK.js} +2 -2
- package/dist/{init-7UXGDOFS.js → init-NUF5UBUJ.js} +6 -6
- package/dist/{main-6UPAIDGS.js → main-2XEBVUR6.js} +19 -10
- package/dist/{main-6UPAIDGS.js.map → main-2XEBVUR6.js.map} +1 -1
- package/dist/{rebuild-QDSYYCS7.js → rebuild-E6YFIRYZ.js} +6 -6
- package/dist/{reprocess-ZNUQCIS3.js → reprocess-7G7KQWCN.js} +9 -9
- package/dist/{restart-5UY2KV54.js → restart-ABW4ZK3P.js} +3 -3
- package/dist/{search-2VEN3XIG.js → search-MPD7SFK6.js} +5 -5
- package/dist/{server-OR5B4B7K.js → server-NZLZRITH.js} +9 -9
- package/dist/{session-start-TUITIUMB.js → session-start-YB4A4PZB.js} +4 -4
- package/dist/{setup-digest-ETCZAUIU.js → setup-digest-K732MGOJ.js} +5 -5
- package/dist/{setup-llm-DWEJE3JE.js → setup-llm-XCCH5LYD.js} +5 -5
- package/dist/src/cli.js +1 -1
- package/dist/src/daemon/main.js +1 -1
- package/dist/src/hooks/session-start.js +1 -1
- package/dist/src/hooks/stop.js +2 -2
- package/dist/src/mcp/server.js +1 -1
- package/dist/{stats-IVIXIKTS.js → stats-6G7SN5YZ.js} +3 -3
- package/dist/{verify-4H6CEE5T.js → verify-JFHQH55Z.js} +5 -5
- package/package.json +1 -1
- package/skills/myco/SKILL.md +5 -1
- package/skills/myco/references/cli-usage.md +322 -0
- package/skills/myco/references/vault-status.md +224 -0
- package/skills/setup/SKILL.md +146 -0
- package/skills/setup/references/model-recommendations.md +77 -0
- package/commands/init.md +0 -122
- package/commands/setup-llm.md +0 -114
- package/commands/status.md +0 -130
- package/dist/chunk-P7RNAYU7.js.map +0 -1
- package/dist/chunk-QQ36XEJP.js +0 -38
- package/dist/chunk-QQ36XEJP.js.map +0 -1
- /package/dist/{chunk-XHWIIU5D.js.map → chunk-GFBG73P4.js.map} +0 -0
- /package/dist/{chunk-TZDDXRHG.js.map → chunk-I7PNZEBO.js.map} +0 -0
- /package/dist/{chunk-IVS5MYBL.js.map → chunk-IYFKPSRP.js.map} +0 -0
- /package/dist/{chunk-NUA7UTIY.js.map → chunk-MIU3DKLN.js.map} +0 -0
- /package/dist/{chunk-VYV5IFD6.js.map → chunk-T7OC6GH5.js.map} +0 -0
- /package/dist/{chunk-4FCFRJIQ.js.map → chunk-UKWO26VI.js.map} +0 -0
- /package/dist/{chunk-YZO22BBI.js.map → chunk-V2OWD2VV.js.map} +0 -0
- /package/dist/{chunk-RDXTQ436.js.map → chunk-WBT5DWGC.js.map} +0 -0
- /package/dist/{cli-ZN6VBA7V.js.map → cli-PMOFCZQL.js.map} +0 -0
- /package/dist/{config-4GGMWGAF.js.map → config-5FGLQGCW.js.map} +0 -0
- /package/dist/{detect-providers-5FU3BN5Q.js.map → detect-providers-IRL2TTLK.js.map} +0 -0
- /package/dist/{init-7UXGDOFS.js.map → init-NUF5UBUJ.js.map} +0 -0
- /package/dist/{rebuild-QDSYYCS7.js.map → rebuild-E6YFIRYZ.js.map} +0 -0
- /package/dist/{reprocess-ZNUQCIS3.js.map → reprocess-7G7KQWCN.js.map} +0 -0
- /package/dist/{restart-5UY2KV54.js.map → restart-ABW4ZK3P.js.map} +0 -0
- /package/dist/{search-2VEN3XIG.js.map → search-MPD7SFK6.js.map} +0 -0
- /package/dist/{server-OR5B4B7K.js.map → server-NZLZRITH.js.map} +0 -0
- /package/dist/{session-start-TUITIUMB.js.map → session-start-YB4A4PZB.js.map} +0 -0
- /package/dist/{setup-digest-ETCZAUIU.js.map → setup-digest-K732MGOJ.js.map} +0 -0
- /package/dist/{setup-llm-DWEJE3JE.js.map → setup-llm-XCCH5LYD.js.map} +0 -0
- /package/dist/{stats-IVIXIKTS.js.map → stats-6G7SN5YZ.js.map} +0 -0
- /package/dist/{verify-4H6CEE5T.js.map → verify-JFHQH55Z.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import { createRequire as __cr } from 'node:module'; const require = __cr(import
|
|
|
2
2
|
import {
|
|
3
3
|
LmStudioBackend,
|
|
4
4
|
OllamaBackend
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-67R6EMYD.js";
|
|
6
6
|
import {
|
|
7
7
|
AgentRegistry
|
|
8
8
|
} from "./chunk-BNIYWCST.js";
|
|
@@ -116,4 +116,4 @@ export {
|
|
|
116
116
|
VAULT_GITIGNORE,
|
|
117
117
|
configureVaultEnv
|
|
118
118
|
};
|
|
119
|
-
//# sourceMappingURL=chunk-
|
|
119
|
+
//# sourceMappingURL=chunk-GFBG73P4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_dist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6UJWI4IW.js";
|
|
5
5
|
import {
|
|
6
6
|
__toESM
|
|
7
7
|
} from "./chunk-PZUWP5VK.js";
|
|
@@ -422,4 +422,4 @@ export {
|
|
|
422
422
|
formatSporeBody,
|
|
423
423
|
VaultWriter
|
|
424
424
|
};
|
|
425
|
-
//# sourceMappingURL=chunk-
|
|
425
|
+
//# sourceMappingURL=chunk-I7PNZEBO.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire as __cr } from 'node:module'; const require = __cr(import
|
|
|
2
2
|
import {
|
|
3
3
|
LmStudioBackend,
|
|
4
4
|
OllamaBackend
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-67R6EMYD.js";
|
|
6
6
|
import {
|
|
7
7
|
LLM_REQUEST_TIMEOUT_MS
|
|
8
8
|
} from "./chunk-JBD5KP5G.js";
|
|
@@ -4911,4 +4911,4 @@ export {
|
|
|
4911
4911
|
createLlmProvider,
|
|
4912
4912
|
createEmbeddingProvider
|
|
4913
4913
|
};
|
|
4914
|
-
//# sourceMappingURL=chunk-
|
|
4914
|
+
//# sourceMappingURL=chunk-IYFKPSRP.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_dist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6UJWI4IW.js";
|
|
5
5
|
import {
|
|
6
6
|
__toESM
|
|
7
7
|
} from "./chunk-PZUWP5VK.js";
|
|
@@ -34,4 +34,4 @@ export {
|
|
|
34
34
|
sessionFm,
|
|
35
35
|
sporeFm
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-MIU3DKLN.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
MycoConfigSchema,
|
|
7
7
|
require_dist
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6UJWI4IW.js";
|
|
9
9
|
import {
|
|
10
10
|
__toESM
|
|
11
11
|
} from "./chunk-PZUWP5VK.js";
|
|
@@ -96,4 +96,4 @@ async function run(args, vaultDir) {
|
|
|
96
96
|
export {
|
|
97
97
|
run
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-T7OC6GH5.js.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
MycoConfigSchema,
|
|
4
|
+
require_dist
|
|
5
|
+
} from "./chunk-6UJWI4IW.js";
|
|
6
|
+
import {
|
|
7
|
+
__toESM
|
|
8
|
+
} from "./chunk-PZUWP5VK.js";
|
|
9
|
+
|
|
10
|
+
// src/config/loader.ts
|
|
11
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
12
|
+
import fs2 from "fs";
|
|
13
|
+
import path2 from "path";
|
|
14
|
+
|
|
15
|
+
// src/config/migrations.ts
|
|
16
|
+
import fs from "fs";
|
|
17
|
+
import path from "path";
|
|
18
|
+
var MEMORY_TYPE_PATTERN = /type:\s*["']?memory["']?/g;
|
|
19
|
+
var MIGRATIONS = [
|
|
20
|
+
{
|
|
21
|
+
version: 1,
|
|
22
|
+
name: "rename-memories-to-spores",
|
|
23
|
+
migrate: (doc, vaultDir) => {
|
|
24
|
+
const context = doc.context;
|
|
25
|
+
const layers = context?.layers;
|
|
26
|
+
if (layers && "memories" in layers && !("spores" in layers)) {
|
|
27
|
+
layers.spores = layers.memories;
|
|
28
|
+
delete layers.memories;
|
|
29
|
+
}
|
|
30
|
+
const memoriesDir = path.join(vaultDir, "memories");
|
|
31
|
+
const sporesDir = path.join(vaultDir, "spores");
|
|
32
|
+
if (!fs.existsSync(memoriesDir)) return;
|
|
33
|
+
if (fs.existsSync(sporesDir)) {
|
|
34
|
+
const moveRemaining = (srcDir, destDir) => {
|
|
35
|
+
for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
|
|
36
|
+
const srcPath = path.join(srcDir, entry.name);
|
|
37
|
+
const destPath = path.join(destDir, entry.name);
|
|
38
|
+
if (entry.isDirectory()) {
|
|
39
|
+
if (!fs.existsSync(destPath)) fs.mkdirSync(destPath, { recursive: true });
|
|
40
|
+
moveRemaining(srcPath, destPath);
|
|
41
|
+
} else if (!fs.existsSync(destPath)) {
|
|
42
|
+
fs.renameSync(srcPath, destPath);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
moveRemaining(memoriesDir, sporesDir);
|
|
47
|
+
fs.rmSync(memoriesDir, { recursive: true, force: true });
|
|
48
|
+
} else {
|
|
49
|
+
fs.renameSync(memoriesDir, sporesDir);
|
|
50
|
+
}
|
|
51
|
+
const walkUpdate = (dir) => {
|
|
52
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
53
|
+
const fullPath = path.join(dir, entry.name);
|
|
54
|
+
if (entry.isDirectory()) {
|
|
55
|
+
walkUpdate(fullPath);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (!entry.name.endsWith(".md")) continue;
|
|
59
|
+
const content = fs.readFileSync(fullPath, "utf-8");
|
|
60
|
+
MEMORY_TYPE_PATTERN.lastIndex = 0;
|
|
61
|
+
if (MEMORY_TYPE_PATTERN.test(content)) {
|
|
62
|
+
MEMORY_TYPE_PATTERN.lastIndex = 0;
|
|
63
|
+
fs.writeFileSync(fullPath, content.replace(MEMORY_TYPE_PATTERN, "type: spore"));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
walkUpdate(sporesDir);
|
|
68
|
+
const walkLinks = (dir) => {
|
|
69
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
70
|
+
const fullPath = path.join(dir, entry.name);
|
|
71
|
+
if (entry.isDirectory()) {
|
|
72
|
+
walkLinks(fullPath);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (!entry.name.endsWith(".md")) continue;
|
|
76
|
+
const content = fs.readFileSync(fullPath, "utf-8");
|
|
77
|
+
if (content.includes("memories/")) {
|
|
78
|
+
fs.writeFileSync(fullPath, content.replace(/memories\//g, "spores/"));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
walkLinks(vaultDir);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
];
|
|
86
|
+
var CURRENT_MIGRATION_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
87
|
+
function runMigrations(doc, vaultDir, log) {
|
|
88
|
+
const currentVersion = doc.config_version ?? 0;
|
|
89
|
+
let ran = false;
|
|
90
|
+
for (const migration of MIGRATIONS) {
|
|
91
|
+
if (migration.version <= currentVersion) continue;
|
|
92
|
+
log?.(`Running migration ${migration.version}: ${migration.name}`);
|
|
93
|
+
migration.migrate(doc, vaultDir);
|
|
94
|
+
doc.config_version = migration.version;
|
|
95
|
+
ran = true;
|
|
96
|
+
}
|
|
97
|
+
return ran;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// src/config/loader.ts
|
|
101
|
+
var CONFIG_FILENAME = "myco.yaml";
|
|
102
|
+
function loadConfig(vaultDir) {
|
|
103
|
+
const configPath = path2.join(vaultDir, CONFIG_FILENAME);
|
|
104
|
+
if (!fs2.existsSync(configPath)) {
|
|
105
|
+
throw new Error(`myco.yaml not found in ${vaultDir}`);
|
|
106
|
+
}
|
|
107
|
+
const raw = fs2.readFileSync(configPath, "utf-8");
|
|
108
|
+
const parsed = import_yaml.default.parse(raw);
|
|
109
|
+
if (parsed.version === 1 || parsed.intelligence?.backend) {
|
|
110
|
+
throw new Error(
|
|
111
|
+
"Myco config uses v1 format. Run /myco:setup-llm to reconfigure for v2."
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
const intel = parsed.intelligence;
|
|
115
|
+
const llm = intel?.llm;
|
|
116
|
+
if (llm?.provider === "haiku") {
|
|
117
|
+
llm.provider = "anthropic";
|
|
118
|
+
}
|
|
119
|
+
const migrationsRan = runMigrations(parsed, vaultDir, (msg) => {
|
|
120
|
+
process.stderr.write(`[myco migration] ${msg}
|
|
121
|
+
`);
|
|
122
|
+
});
|
|
123
|
+
const config = MycoConfigSchema.parse(parsed);
|
|
124
|
+
const needsWrite = migrationsRan || (parsed.config_version ?? 0) < CURRENT_MIGRATION_VERSION || !("digest" in parsed);
|
|
125
|
+
if (needsWrite) {
|
|
126
|
+
const fullConfig = JSON.parse(JSON.stringify(config));
|
|
127
|
+
fs2.writeFileSync(configPath, import_yaml.default.stringify(fullConfig), "utf-8");
|
|
128
|
+
}
|
|
129
|
+
return config;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
loadConfig
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=chunk-TBRZAJ7W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config/loader.ts","../src/config/migrations.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport YAML from 'yaml';\nimport { MycoConfigSchema, type MycoConfig } from './schema.js';\nimport { runMigrations, CURRENT_MIGRATION_VERSION } from './migrations.js';\n\nconst CONFIG_FILENAME = 'myco.yaml';\n\nexport function loadConfig(vaultDir: string): MycoConfig {\n const configPath = path.join(vaultDir, CONFIG_FILENAME);\n\n if (!fs.existsSync(configPath)) {\n throw new Error(`myco.yaml not found in ${vaultDir}`);\n }\n\n const raw = fs.readFileSync(configPath, 'utf-8');\n const parsed = YAML.parse(raw) as Record<string, unknown>;\n\n // Detect v1 config and guide migration\n if (parsed.version === 1 || (parsed.intelligence as Record<string, unknown>)?.backend) {\n throw new Error(\n 'Myco config uses v1 format. Run /myco:setup-llm to reconfigure for v2.',\n );\n }\n\n // Auto-map legacy 'haiku' provider name to 'anthropic'\n const intel = parsed.intelligence as Record<string, unknown> | undefined;\n const llm = intel?.llm as Record<string, unknown> | undefined;\n if (llm?.provider === 'haiku') {\n llm.provider = 'anthropic';\n }\n\n // Run numbered migrations\n const migrationsRan = runMigrations(parsed, vaultDir, (msg) => {\n // Log to stderr since this runs during config loading (before logger is available)\n process.stderr.write(`[myco migration] ${msg}\\n`);\n });\n\n // Parse with Zod to fill in defaults for new config sections\n const config = MycoConfigSchema.parse(parsed);\n\n // Write back if migrations ran or new defaults were added\n const needsWrite = migrationsRan\n || (parsed.config_version as number ?? 0) < CURRENT_MIGRATION_VERSION\n || !('digest' in parsed);\n\n if (needsWrite) {\n const fullConfig = JSON.parse(JSON.stringify(config)) as Record<string, unknown>;\n fs.writeFileSync(configPath, YAML.stringify(fullConfig), 'utf-8');\n }\n\n return config;\n}\n\nexport function saveConfig(vaultDir: string, config: MycoConfig): void {\n // Validate before writing — OAK lesson: validate on write, not just read\n const validated = MycoConfigSchema.parse(config);\n\n const configPath = path.join(vaultDir, CONFIG_FILENAME);\n fs.mkdirSync(vaultDir, { recursive: true });\n fs.writeFileSync(configPath, YAML.stringify(validated), 'utf-8');\n}\n","/**\n * Config and vault migrations — run once per version, tracked by config_version.\n *\n * Each migration has a version number, a name, and a function that receives\n * the raw parsed YAML doc and the vault directory. Migrations run in order\n * and are skipped if config_version is already past them.\n *\n * To add a new migration:\n * 1. Add an entry to MIGRATIONS with the next version number\n * 2. Write the migrate function — it receives the mutable doc and vaultDir\n * 3. The framework handles version tracking and writing the config back\n */\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nexport interface Migration {\n version: number;\n name: string;\n migrate: (doc: Record<string, unknown>, vaultDir: string) => void;\n}\n\n/** Regex matching both quoted and unquoted YAML: type: memory, type: \"memory\", type: 'memory' */\nconst MEMORY_TYPE_PATTERN = /type:\\s*[\"']?memory[\"']?/g;\n\nexport const MIGRATIONS: Migration[] = [\n {\n version: 1,\n name: 'rename-memories-to-spores',\n migrate: (doc, vaultDir) => {\n // Config: rename context.layers.memories → context.layers.spores\n const context = doc.context as Record<string, unknown> | undefined;\n const layers = context?.layers as Record<string, unknown> | undefined;\n if (layers && 'memories' in layers && !('spores' in layers)) {\n layers.spores = layers.memories;\n delete layers.memories;\n }\n\n // Vault: rename memories/ directory → spores/\n const memoriesDir = path.join(vaultDir, 'memories');\n const sporesDir = path.join(vaultDir, 'spores');\n\n if (!fs.existsSync(memoriesDir)) return;\n\n if (fs.existsSync(sporesDir)) {\n // Both exist (interrupted migration) — merge remaining files\n const moveRemaining = (srcDir: string, destDir: string): void => {\n for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {\n const srcPath = path.join(srcDir, entry.name);\n const destPath = path.join(destDir, entry.name);\n if (entry.isDirectory()) {\n if (!fs.existsSync(destPath)) fs.mkdirSync(destPath, { recursive: true });\n moveRemaining(srcPath, destPath);\n } else if (!fs.existsSync(destPath)) {\n fs.renameSync(srcPath, destPath);\n }\n }\n };\n moveRemaining(memoriesDir, sporesDir);\n fs.rmSync(memoriesDir, { recursive: true, force: true });\n } else {\n fs.renameSync(memoriesDir, sporesDir);\n }\n\n // Update frontmatter type: memory → type: spore (handles quoted and unquoted)\n const walkUpdate = (dir: string): void => {\n for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) { walkUpdate(fullPath); continue; }\n if (!entry.name.endsWith('.md')) continue;\n const content = fs.readFileSync(fullPath, 'utf-8');\n MEMORY_TYPE_PATTERN.lastIndex = 0;\n if (MEMORY_TYPE_PATTERN.test(content)) {\n MEMORY_TYPE_PATTERN.lastIndex = 0;\n fs.writeFileSync(fullPath, content.replace(MEMORY_TYPE_PATTERN, 'type: spore'));\n }\n }\n };\n walkUpdate(sporesDir);\n\n // Update wikilinks in ALL vault files: [[memories/...]] → [[spores/...]]\n const walkLinks = (dir: string): void => {\n for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) { walkLinks(fullPath); continue; }\n if (!entry.name.endsWith('.md')) continue;\n const content = fs.readFileSync(fullPath, 'utf-8');\n if (content.includes('memories/')) {\n fs.writeFileSync(fullPath, content.replace(/memories\\//g, 'spores/'));\n }\n }\n };\n walkLinks(vaultDir);\n },\n },\n];\n\n/** Current migration version — the highest version in MIGRATIONS. */\nexport const CURRENT_MIGRATION_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;\n\n/**\n * Run all pending migrations on the raw config doc.\n * Returns true if any migrations ran (caller should reindex).\n */\nexport function runMigrations(\n doc: Record<string, unknown>,\n vaultDir: string,\n log?: (message: string) => void,\n): boolean {\n const currentVersion = (doc.config_version as number) ?? 0;\n let ran = false;\n\n for (const migration of MIGRATIONS) {\n if (migration.version <= currentVersion) continue;\n\n log?.(`Running migration ${migration.version}: ${migration.name}`);\n migration.migrate(doc, vaultDir);\n doc.config_version = migration.version;\n ran = true;\n }\n\n return ran;\n}\n"],"mappings":";;;;;;;;;;AAEA,kBAAiB;AAFjB,OAAOA,SAAQ;AACf,OAAOC,WAAU;;;ACYjB,OAAO,QAAQ;AACf,OAAO,UAAU;AASjB,IAAM,sBAAsB;AAErB,IAAM,aAA0B;AAAA,EACrC;AAAA,IACE,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS,CAAC,KAAK,aAAa;AAE1B,YAAM,UAAU,IAAI;AACpB,YAAM,SAAS,SAAS;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AO;AAC/C,QAAM,SAAS,YAAAC,QAAK,MAAM,GAAG;AAG7B,MAAI,OAAO,YAAY,KAAM,OAAO,cAA0C,SAAS;AACrF,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAGA,QAAM,QAAQ,OAAO;AACrB,QAAM,MAAM,OAAO;AACnB,MAAI,KAAK,aAAa,SAAS;AAC7B,QAAI,WAAW;AAAA,EACjB;AAGA,QAAM,gBAAgB,cAAc,QAAQ,UAAU,CAAC,QAAQ;AAE7D,YAAQ,OAAO,MAAM,oBAAoB,GAAG;AAAA,CAAI;AAAA,EAClD,CAAC;AAGD,QAAM,SAAS,iBAAiB,MAAM,MAAM;AAG5C,QAAM,aAAa,kBACb,OAAO,kBAA4B,KAAK,6BACzC,EAAE,YAAY;AAEnB,MAAI,YAAY;AACd,UAAM,aAAa,KAAK,MAAM,KAAK,UAAU,MAAM,CAAC;AACpD,IAAAD,IAAG,cAAc,YAAY,YAAAC,QAAK,UAAU,UAAU,GAAG,OAAO;AAAA,EAClE;AAEA,SAAO;AACT;","names":["fs","path","path","fs","YAML"]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
MycoConfigSchema,
|
|
7
7
|
require_dist
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6UJWI4IW.js";
|
|
9
9
|
import {
|
|
10
10
|
__toESM
|
|
11
11
|
} from "./chunk-PZUWP5VK.js";
|
|
@@ -144,4 +144,4 @@ async function run(args, vaultDir) {
|
|
|
144
144
|
export {
|
|
145
145
|
run
|
|
146
146
|
};
|
|
147
|
-
//# sourceMappingURL=chunk-
|
|
147
|
+
//# sourceMappingURL=chunk-UKWO26VI.js.map
|
|
@@ -2,14 +2,14 @@ import { createRequire as __cr } from 'node:module'; const require = __cr(import
|
|
|
2
2
|
import {
|
|
3
3
|
formatSporeBody,
|
|
4
4
|
sessionNoteId
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-I7PNZEBO.js";
|
|
6
6
|
import {
|
|
7
7
|
ARTIFACT_TYPES,
|
|
8
8
|
indexNote
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FPEDTLQ6.js";
|
|
10
10
|
import {
|
|
11
11
|
external_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6UJWI4IW.js";
|
|
13
13
|
import {
|
|
14
14
|
AgentRegistry
|
|
15
15
|
} from "./chunk-BNIYWCST.js";
|
|
@@ -373,4 +373,4 @@ export {
|
|
|
373
373
|
extractTurnsFromBuffer,
|
|
374
374
|
writeObservationNotes
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=chunk-
|
|
376
|
+
//# sourceMappingURL=chunk-V2OWD2VV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
stripFrontmatter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MIU3DKLN.js";
|
|
5
5
|
import {
|
|
6
6
|
DIGEST_TIERS
|
|
7
7
|
} from "./chunk-JBD5KP5G.js";
|
|
@@ -46,4 +46,4 @@ function handleMycoContext(vaultDir, input) {
|
|
|
46
46
|
export {
|
|
47
47
|
handleMycoContext
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-WBT5DWGC.js.map
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
loadEnv
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GFBG73P4.js";
|
|
6
6
|
import "./chunk-SAKJMNSR.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-67R6EMYD.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveVaultDir
|
|
10
10
|
} from "./chunk-N33KUCFP.js";
|
|
@@ -41,8 +41,8 @@ async function main() {
|
|
|
41
41
|
process.stdout.write(USAGE);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
if (cmd === "init") return (await import("./init-
|
|
45
|
-
if (cmd === "detect-providers") return (await import("./detect-providers-
|
|
44
|
+
if (cmd === "init") return (await import("./init-NUF5UBUJ.js")).run(args);
|
|
45
|
+
if (cmd === "detect-providers") return (await import("./detect-providers-IRL2TTLK.js")).run(args);
|
|
46
46
|
if (cmd === "version" || cmd === "--version" || cmd === "-v") {
|
|
47
47
|
const { getPluginVersion } = await import("./version-5B2TWXQJ.js");
|
|
48
48
|
console.log(getPluginVersion());
|
|
@@ -55,27 +55,27 @@ async function main() {
|
|
|
55
55
|
}
|
|
56
56
|
switch (cmd) {
|
|
57
57
|
case "config":
|
|
58
|
-
return (await import("./config-
|
|
58
|
+
return (await import("./config-5FGLQGCW.js")).run(args, vaultDir);
|
|
59
59
|
case "verify":
|
|
60
|
-
return (await import("./verify-
|
|
60
|
+
return (await import("./verify-JFHQH55Z.js")).run(args, vaultDir);
|
|
61
61
|
case "stats":
|
|
62
|
-
return (await import("./stats-
|
|
62
|
+
return (await import("./stats-6G7SN5YZ.js")).run(args, vaultDir);
|
|
63
63
|
case "search":
|
|
64
|
-
return (await import("./search-
|
|
64
|
+
return (await import("./search-MPD7SFK6.js")).run(args, vaultDir);
|
|
65
65
|
case "vectors":
|
|
66
|
-
return (await import("./search-
|
|
66
|
+
return (await import("./search-MPD7SFK6.js")).runVectors(args, vaultDir);
|
|
67
67
|
case "session":
|
|
68
68
|
return (await import("./session-QF6MILAC.js")).run(args, vaultDir);
|
|
69
69
|
case "setup-llm":
|
|
70
|
-
return (await import("./setup-llm-
|
|
70
|
+
return (await import("./setup-llm-XCCH5LYD.js")).run(args, vaultDir);
|
|
71
71
|
case "setup-digest":
|
|
72
|
-
return (await import("./setup-digest-
|
|
72
|
+
return (await import("./setup-digest-K732MGOJ.js")).run(args, vaultDir);
|
|
73
73
|
case "restart":
|
|
74
|
-
return (await import("./restart-
|
|
74
|
+
return (await import("./restart-ABW4ZK3P.js")).run(args, vaultDir);
|
|
75
75
|
case "rebuild":
|
|
76
|
-
return (await import("./rebuild-
|
|
76
|
+
return (await import("./rebuild-E6YFIRYZ.js")).run(args, vaultDir);
|
|
77
77
|
case "reprocess":
|
|
78
|
-
return (await import("./reprocess-
|
|
78
|
+
return (await import("./reprocess-7G7KQWCN.js")).run(args, vaultDir);
|
|
79
79
|
case "logs":
|
|
80
80
|
return (await import("./logs-BSTBZHDR.js")).run(args, vaultDir);
|
|
81
81
|
default:
|
|
@@ -88,4 +88,4 @@ main().catch((err) => {
|
|
|
88
88
|
console.error(`myco: ${err.message}`);
|
|
89
89
|
process.exit(1);
|
|
90
90
|
});
|
|
91
|
-
//# sourceMappingURL=cli-
|
|
91
|
+
//# sourceMappingURL=cli-PMOFCZQL.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TBRZAJ7W.js";
|
|
5
5
|
import {
|
|
6
6
|
MycoConfigSchema,
|
|
7
7
|
require_dist
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6UJWI4IW.js";
|
|
9
9
|
import {
|
|
10
10
|
__toESM
|
|
11
11
|
} from "./chunk-PZUWP5VK.js";
|
|
@@ -98,4 +98,4 @@ function parseValue(raw) {
|
|
|
98
98
|
export {
|
|
99
99
|
run
|
|
100
100
|
};
|
|
101
|
-
//# sourceMappingURL=config-
|
|
101
|
+
//# sourceMappingURL=config-5FGLQGCW.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire as __cr } from 'node:module'; const require = __cr(import
|
|
|
2
2
|
import {
|
|
3
3
|
LmStudioBackend,
|
|
4
4
|
OllamaBackend
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-67R6EMYD.js";
|
|
6
6
|
import {
|
|
7
7
|
PROVIDER_DETECT_TIMEOUT_MS
|
|
8
8
|
} from "./chunk-JBD5KP5G.js";
|
|
@@ -32,4 +32,4 @@ async function run(_args) {
|
|
|
32
32
|
export {
|
|
33
33
|
run
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=detect-providers-
|
|
35
|
+
//# sourceMappingURL=detect-providers-IRL2TTLK.js.map
|
|
@@ -7,23 +7,23 @@ import {
|
|
|
7
7
|
} from "./chunk-AK6GNLPV.js";
|
|
8
8
|
import {
|
|
9
9
|
run
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-T7OC6GH5.js";
|
|
11
11
|
import {
|
|
12
12
|
run as run2
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UKWO26VI.js";
|
|
14
14
|
import {
|
|
15
15
|
DASHBOARD_CONTENT,
|
|
16
16
|
VAULT_GITIGNORE,
|
|
17
17
|
configureVaultEnv
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GFBG73P4.js";
|
|
19
19
|
import {
|
|
20
20
|
parseStringFlag
|
|
21
21
|
} from "./chunk-SAKJMNSR.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-67R6EMYD.js";
|
|
23
23
|
import {
|
|
24
24
|
MycoConfigSchema,
|
|
25
25
|
require_dist
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6UJWI4IW.js";
|
|
27
27
|
import {
|
|
28
28
|
resolveVaultDir
|
|
29
29
|
} from "./chunk-N33KUCFP.js";
|
|
@@ -108,4 +108,4 @@ async function run3(args) {
|
|
|
108
108
|
export {
|
|
109
109
|
run3 as run
|
|
110
110
|
};
|
|
111
|
-
//# sourceMappingURL=init-
|
|
111
|
+
//# sourceMappingURL=init-NUF5UBUJ.js.map
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
loadPrompt,
|
|
9
9
|
stripReasoningTokens,
|
|
10
10
|
writeObservationNotes
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-V2OWD2VV.js";
|
|
12
12
|
import {
|
|
13
13
|
handleMycoContext
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WBT5DWGC.js";
|
|
15
15
|
import {
|
|
16
16
|
DaemonLogger
|
|
17
17
|
} from "./chunk-5EZ7QF6J.js";
|
|
@@ -22,38 +22,38 @@ import {
|
|
|
22
22
|
sessionNoteId,
|
|
23
23
|
sessionRelativePath,
|
|
24
24
|
sessionWikilink
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-I7PNZEBO.js";
|
|
26
26
|
import {
|
|
27
27
|
indexNote,
|
|
28
28
|
rebuildIndex
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-FPEDTLQ6.js";
|
|
30
30
|
import {
|
|
31
31
|
generateEmbedding
|
|
32
32
|
} from "./chunk-RGVBGTD6.js";
|
|
33
33
|
import {
|
|
34
34
|
createEmbeddingProvider,
|
|
35
35
|
createLlmProvider
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-IYFKPSRP.js";
|
|
37
37
|
import {
|
|
38
38
|
VectorIndex
|
|
39
39
|
} from "./chunk-XQXXF6MU.js";
|
|
40
40
|
import {
|
|
41
41
|
stripFrontmatter
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-MIU3DKLN.js";
|
|
43
43
|
import {
|
|
44
44
|
initFts
|
|
45
45
|
} from "./chunk-6FQISQNA.js";
|
|
46
46
|
import {
|
|
47
47
|
MycoIndex
|
|
48
48
|
} from "./chunk-AK6GNLPV.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-67R6EMYD.js";
|
|
50
50
|
import {
|
|
51
51
|
loadConfig
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-TBRZAJ7W.js";
|
|
53
53
|
import {
|
|
54
54
|
external_exports,
|
|
55
55
|
require_dist
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-6UJWI4IW.js";
|
|
57
57
|
import {
|
|
58
58
|
EventBuffer
|
|
59
59
|
} from "./chunk-HIN3UVOG.js";
|
|
@@ -2775,6 +2775,7 @@ async function main() {
|
|
|
2775
2775
|
}
|
|
2776
2776
|
}
|
|
2777
2777
|
}
|
|
2778
|
+
const needsMigrationReindex = index.query({ type: "memory" }).length > 0;
|
|
2778
2779
|
const migrated = migrateSporeFiles(vaultDir);
|
|
2779
2780
|
if (migrated > 0) {
|
|
2780
2781
|
logger.info("daemon", "Migrated spore files to type subdirectories", { count: migrated });
|
|
@@ -3340,6 +3341,14 @@ ${lines.join("\n")}`;
|
|
|
3340
3341
|
});
|
|
3341
3342
|
await server.start();
|
|
3342
3343
|
logger.info("daemon", "Daemon ready", { vault: vaultDir, port: server.port });
|
|
3344
|
+
if (needsMigrationReindex) {
|
|
3345
|
+
setImmediate(() => {
|
|
3346
|
+
logger.info("daemon", "Rebuilding index after memories\u2192spores migration (background)");
|
|
3347
|
+
initFts(index);
|
|
3348
|
+
rebuildIndex(index, vaultDir);
|
|
3349
|
+
logger.info("daemon", "Migration reindex complete");
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3343
3352
|
const shutdown = async (signal) => {
|
|
3344
3353
|
logger.info("daemon", `${signal} received`);
|
|
3345
3354
|
if (activeStopProcessing) {
|
|
@@ -3367,4 +3376,4 @@ export {
|
|
|
3367
3376
|
chokidar/index.js:
|
|
3368
3377
|
(*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
|
|
3369
3378
|
*/
|
|
3370
|
-
//# sourceMappingURL=main-
|
|
3379
|
+
//# sourceMappingURL=main-2XEBVUR6.js.map
|