@goondocks/myco 0.19.3 → 0.19.5
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/{agent-run-MCVZOJWA.js → agent-run-3IQXE5PI.js} +9 -5
- package/dist/{agent-run-MCVZOJWA.js.map → agent-run-3IQXE5PI.js.map} +1 -1
- package/dist/{agent-tasks-I4S35M2E.js → agent-tasks-5DIA3CE5.js} +9 -5
- package/dist/{agent-tasks-I4S35M2E.js.map → agent-tasks-5DIA3CE5.js.map} +1 -1
- package/dist/{chunk-WYOE4IAX.js → chunk-27ZDDWIA.js} +81 -8
- package/dist/chunk-27ZDDWIA.js.map +1 -0
- package/dist/{chunk-JRKTIOXA.js → chunk-2QJCV3UL.js} +2 -2
- package/dist/{chunk-THZKOZ4M.js → chunk-5OXBT5MD.js} +71 -16
- package/dist/chunk-5OXBT5MD.js.map +1 -0
- package/dist/{chunk-SELPXOJ7.js → chunk-5WPTS6A4.js} +3 -3
- package/dist/{chunk-XE5HDAYZ.js → chunk-IQ5LQTV7.js} +2 -2
- package/dist/{chunk-R2PT7XMQ.js → chunk-K2QX43GC.js} +3 -3
- package/dist/{chunk-PLYWR5D7.js → chunk-KABTXALI.js} +2 -2
- package/dist/{chunk-3C4LT4BW.js → chunk-UTSCRMJE.js} +2 -1
- package/dist/chunk-UTSCRMJE.js.map +1 -0
- package/dist/{chunk-NFXXQCO2.js → chunk-VH7XYQFL.js} +2 -2
- package/dist/{cli-ZCHAHP66.js → cli-RTUSGLTM.js} +41 -37
- package/dist/{cli-ZCHAHP66.js.map → cli-RTUSGLTM.js.map} +1 -1
- package/dist/{client-JSV6QAZA.js → client-YWE5YJB7.js} +3 -3
- package/dist/{config-2KQ45OC5.js → config-I5MJ6RXI.js} +2 -2
- package/dist/{doctor-2RTWDLZO.js → doctor-FIG7VEYV.js} +11 -7
- package/dist/{doctor-2RTWDLZO.js.map → doctor-FIG7VEYV.js.map} +1 -1
- package/dist/{executor-EYNL4NVR.js → executor-2TMGOVEA.js} +18 -10
- package/dist/executor-2TMGOVEA.js.map +1 -0
- package/dist/{init-WAPYF4BJ.js → init-3536BYDC.js} +9 -9
- package/dist/{installer-BWJED3ED.js → installer-YH3WQISI.js} +8 -2
- package/dist/{loader-JG5OBPB6.js → loader-K4WF4EEJ.js} +2 -2
- package/dist/{main-XBKU4RCF.js → main-R5ZD5OIZ.js} +149 -97
- package/dist/main-R5ZD5OIZ.js.map +1 -0
- package/dist/{open-JEFE5TGE.js → open-5UD5JQIM.js} +9 -5
- package/dist/{open-JEFE5TGE.js.map → open-5UD5JQIM.js.map} +1 -1
- package/dist/{post-compact-OONI54PN.js → post-compact-ZJFE66O3.js} +4 -4
- package/dist/{post-tool-use-EQO3KWOY.js → post-tool-use-CAR2USJP.js} +3 -3
- package/dist/{post-tool-use-failure-SJL47FL4.js → post-tool-use-failure-OMIKVEVR.js} +4 -4
- package/dist/{pre-compact-GWELYS3R.js → pre-compact-6SXYI5CD.js} +4 -4
- package/dist/{remove-Y3556MDU.js → remove-NJSFVZXW.js} +6 -6
- package/dist/{restart-SFLYAFOS.js → restart-U5ZGJON7.js} +10 -6
- package/dist/{restart-SFLYAFOS.js.map → restart-U5ZGJON7.js.map} +1 -1
- package/dist/{search-3JZ3KAK6.js → search-HO7CXV6H.js} +9 -5
- package/dist/{search-3JZ3KAK6.js.map → search-HO7CXV6H.js.map} +1 -1
- package/dist/{server-L7OOWT34.js → server-BUSZIUZV.js} +3 -3
- package/dist/{session-PLMQL7I6.js → session-RVT2QELH.js} +9 -5
- package/dist/{session-PLMQL7I6.js.map → session-RVT2QELH.js.map} +1 -1
- package/dist/{session-end-RPRVFGUD.js → session-end-4W6SZVGH.js} +3 -3
- package/dist/{session-start-P7K2ACLN.js → session-start-PMPKAST4.js} +4 -4
- package/dist/{setup-llm-MK3HLT4I.js → setup-llm-6UAJUHQE.js} +6 -6
- package/dist/src/agent/definitions/tasks/skill-generate.yaml +9 -0
- package/dist/src/agent/definitions/tasks/skill-survey.yaml +1 -1
- package/dist/src/cli.js +1 -1
- package/dist/src/daemon/main.js +1 -1
- package/dist/src/hooks/post-tool-use.js +1 -1
- package/dist/src/hooks/session-end.js +1 -1
- package/dist/src/hooks/session-start.js +1 -1
- package/dist/src/hooks/stop.js +1 -1
- package/dist/src/hooks/user-prompt-submit.js +1 -1
- package/dist/src/mcp/server.js +1 -1
- package/dist/{stats-I23UJGHJ.js → stats-W47FF6RD.js} +7 -7
- package/dist/{stop-7SCG645G.js → stop-6TAO2UU2.js} +3 -3
- package/dist/{stop-failure-7FDDU2M3.js → stop-failure-R76SULCV.js} +4 -4
- package/dist/{subagent-start-L5EYRGIA.js → subagent-start-TJMUZLP2.js} +4 -4
- package/dist/{subagent-stop-IJ4RCOWX.js → subagent-stop-M3DAFJWQ.js} +4 -4
- package/dist/{task-completed-XLTUWCH6.js → task-completed-2KVR5JV6.js} +4 -4
- package/dist/{team-M6TC4TFC.js → team-2IAT6MKD.js} +3 -3
- package/dist/ui/assets/{index-CwPuGRsJ.js → index-C-6W8e3m.js} +28 -28
- package/dist/ui/index.html +1 -1
- package/dist/{update-UCEI2JIV.js → update-TB34JEB7.js} +6 -6
- package/dist/update-TB34JEB7.js.map +1 -0
- package/dist/{user-prompt-submit-MUDVYQIT.js → user-prompt-submit-O4TP7NJ6.js} +3 -3
- package/dist/{verify-CJHF23QH.js → verify-SESZXGVY.js} +2 -2
- package/dist/{version-MMF4SWQ3.js → version-QBORV23E.js} +2 -2
- package/package.json +1 -1
- package/skills/rules/SKILL.md +6 -0
- package/dist/chunk-3C4LT4BW.js.map +0 -1
- package/dist/chunk-THZKOZ4M.js.map +0 -1
- package/dist/chunk-WYOE4IAX.js.map +0 -1
- package/dist/executor-EYNL4NVR.js.map +0 -1
- package/dist/main-XBKU4RCF.js.map +0 -1
- package/dist/update-UCEI2JIV.js.map +0 -1
- /package/dist/{chunk-JRKTIOXA.js.map → chunk-2QJCV3UL.js.map} +0 -0
- /package/dist/{chunk-SELPXOJ7.js.map → chunk-5WPTS6A4.js.map} +0 -0
- /package/dist/{chunk-XE5HDAYZ.js.map → chunk-IQ5LQTV7.js.map} +0 -0
- /package/dist/{chunk-R2PT7XMQ.js.map → chunk-K2QX43GC.js.map} +0 -0
- /package/dist/{chunk-PLYWR5D7.js.map → chunk-KABTXALI.js.map} +0 -0
- /package/dist/{chunk-NFXXQCO2.js.map → chunk-VH7XYQFL.js.map} +0 -0
- /package/dist/{client-JSV6QAZA.js.map → client-YWE5YJB7.js.map} +0 -0
- /package/dist/{config-2KQ45OC5.js.map → config-I5MJ6RXI.js.map} +0 -0
- /package/dist/{init-WAPYF4BJ.js.map → init-3536BYDC.js.map} +0 -0
- /package/dist/{installer-BWJED3ED.js.map → installer-YH3WQISI.js.map} +0 -0
- /package/dist/{loader-JG5OBPB6.js.map → loader-K4WF4EEJ.js.map} +0 -0
- /package/dist/{post-compact-OONI54PN.js.map → post-compact-ZJFE66O3.js.map} +0 -0
- /package/dist/{post-tool-use-EQO3KWOY.js.map → post-tool-use-CAR2USJP.js.map} +0 -0
- /package/dist/{post-tool-use-failure-SJL47FL4.js.map → post-tool-use-failure-OMIKVEVR.js.map} +0 -0
- /package/dist/{pre-compact-GWELYS3R.js.map → pre-compact-6SXYI5CD.js.map} +0 -0
- /package/dist/{remove-Y3556MDU.js.map → remove-NJSFVZXW.js.map} +0 -0
- /package/dist/{server-L7OOWT34.js.map → server-BUSZIUZV.js.map} +0 -0
- /package/dist/{session-end-RPRVFGUD.js.map → session-end-4W6SZVGH.js.map} +0 -0
- /package/dist/{session-start-P7K2ACLN.js.map → session-start-PMPKAST4.js.map} +0 -0
- /package/dist/{setup-llm-MK3HLT4I.js.map → setup-llm-6UAJUHQE.js.map} +0 -0
- /package/dist/{stats-I23UJGHJ.js.map → stats-W47FF6RD.js.map} +0 -0
- /package/dist/{stop-7SCG645G.js.map → stop-6TAO2UU2.js.map} +0 -0
- /package/dist/{stop-failure-7FDDU2M3.js.map → stop-failure-R76SULCV.js.map} +0 -0
- /package/dist/{subagent-start-L5EYRGIA.js.map → subagent-start-TJMUZLP2.js.map} +0 -0
- /package/dist/{subagent-stop-IJ4RCOWX.js.map → subagent-stop-M3DAFJWQ.js.map} +0 -0
- /package/dist/{task-completed-XLTUWCH6.js.map → task-completed-2KVR5JV6.js.map} +0 -0
- /package/dist/{team-M6TC4TFC.js.map → team-2IAT6MKD.js.map} +0 -0
- /package/dist/{user-prompt-submit-MUDVYQIT.js.map → user-prompt-submit-O4TP7NJ6.js.map} +0 -0
- /package/dist/{verify-CJHF23QH.js.map → verify-SESZXGVY.js.map} +0 -0
- /package/dist/{version-MMF4SWQ3.js.map → version-QBORV23E.js.map} +0 -0
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getEmbeddingQueueDepth,
|
|
16
16
|
getUnembedded,
|
|
17
17
|
markEmbedded
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-K2QX43GC.js";
|
|
19
19
|
import {
|
|
20
20
|
getTeamPackageVersion,
|
|
21
21
|
loadSecrets,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
readSecrets,
|
|
24
24
|
resolveVaultConfigPath,
|
|
25
25
|
writeSecret
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-KABTXALI.js";
|
|
27
27
|
import {
|
|
28
28
|
buildTaskInstruction,
|
|
29
29
|
closeOpenBatches,
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
setResponseSummary,
|
|
72
72
|
updateCandidate,
|
|
73
73
|
updateNotificationStatus
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-5OXBT5MD.js";
|
|
75
75
|
import {
|
|
76
76
|
fullTextSearch,
|
|
77
77
|
hydrateSearchResults
|
|
@@ -109,9 +109,11 @@ import {
|
|
|
109
109
|
listBufferSessionIds
|
|
110
110
|
} from "./chunk-V7XG6V6C.js";
|
|
111
111
|
import "./chunk-POEPHBQK.js";
|
|
112
|
-
import "./chunk-
|
|
112
|
+
import "./chunk-5WPTS6A4.js";
|
|
113
113
|
import "./chunk-SAKJMNSR.js";
|
|
114
|
-
import
|
|
114
|
+
import {
|
|
115
|
+
SymbiontInstaller
|
|
116
|
+
} from "./chunk-27ZDDWIA.js";
|
|
115
117
|
import {
|
|
116
118
|
checkLocalProvider
|
|
117
119
|
} from "./chunk-6ZDJXSEO.js";
|
|
@@ -168,7 +170,7 @@ import {
|
|
|
168
170
|
updateBackupConfig,
|
|
169
171
|
updateConfig,
|
|
170
172
|
updateTeamConfig
|
|
171
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-UTSCRMJE.js";
|
|
172
174
|
import {
|
|
173
175
|
closeDatabase,
|
|
174
176
|
getDatabase,
|
|
@@ -177,12 +179,13 @@ import {
|
|
|
177
179
|
} from "./chunk-MYX5NCRH.js";
|
|
178
180
|
import {
|
|
179
181
|
resolveCliEntryPath
|
|
180
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-2QJCV3UL.js";
|
|
181
183
|
import {
|
|
182
184
|
getPluginVersion
|
|
183
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-VH7XYQFL.js";
|
|
184
186
|
import {
|
|
185
|
-
loadManifests
|
|
187
|
+
loadManifests,
|
|
188
|
+
resolvePackageRoot
|
|
186
189
|
} from "./chunk-UVKQ62II.js";
|
|
187
190
|
import {
|
|
188
191
|
findPackageRoot
|
|
@@ -1406,10 +1409,12 @@ async function handlePutConfig(vaultDir, body) {
|
|
|
1406
1409
|
function createPlanDirHandlers(deps) {
|
|
1407
1410
|
const { vaultDir, symbiontPlanDirsByAgent, symbiontPlanDirs } = deps;
|
|
1408
1411
|
async function handleGetPlanDirs(_req) {
|
|
1412
|
+
const config = loadConfig(vaultDir);
|
|
1409
1413
|
return {
|
|
1410
1414
|
body: {
|
|
1411
1415
|
symbiont: symbiontPlanDirsByAgent,
|
|
1412
|
-
custom: deps.planWatchConfig.watchDirs.filter((d) => !symbiontPlanDirs.includes(d))
|
|
1416
|
+
custom: deps.planWatchConfig.watchDirs.filter((d) => !symbiontPlanDirs.includes(d)),
|
|
1417
|
+
ignore_plan_dirs_in_git: config.capture.ignore_plan_dirs_in_git
|
|
1413
1418
|
}
|
|
1414
1419
|
};
|
|
1415
1420
|
}
|
|
@@ -1418,15 +1423,28 @@ function createPlanDirHandlers(deps) {
|
|
|
1418
1423
|
if (!Array.isArray(body.plan_dirs)) {
|
|
1419
1424
|
return { status: 400, body: { error: "plan_dirs must be an array" } };
|
|
1420
1425
|
}
|
|
1426
|
+
if (body.ignore_plan_dirs_in_git !== void 0 && typeof body.ignore_plan_dirs_in_git !== "boolean") {
|
|
1427
|
+
return { status: 400, body: { error: "ignore_plan_dirs_in_git must be a boolean" } };
|
|
1428
|
+
}
|
|
1421
1429
|
const updated = updateConfig(vaultDir, (cfg) => ({
|
|
1422
1430
|
...cfg,
|
|
1423
|
-
capture: {
|
|
1431
|
+
capture: {
|
|
1432
|
+
...cfg.capture,
|
|
1433
|
+
plan_dirs: body.plan_dirs,
|
|
1434
|
+
ignore_plan_dirs_in_git: body.ignore_plan_dirs_in_git ?? cfg.capture.ignore_plan_dirs_in_git
|
|
1435
|
+
}
|
|
1424
1436
|
}));
|
|
1425
1437
|
deps.setPlanWatchConfig({
|
|
1426
1438
|
...deps.planWatchConfig,
|
|
1427
1439
|
watchDirs: [.../* @__PURE__ */ new Set([...symbiontPlanDirs, ...body.plan_dirs])]
|
|
1428
1440
|
});
|
|
1429
|
-
|
|
1441
|
+
deps.reconcileProjectFiles?.();
|
|
1442
|
+
return {
|
|
1443
|
+
body: {
|
|
1444
|
+
custom: updated.capture.plan_dirs,
|
|
1445
|
+
ignore_plan_dirs_in_git: updated.capture.ignore_plan_dirs_in_git
|
|
1446
|
+
}
|
|
1447
|
+
};
|
|
1430
1448
|
}
|
|
1431
1449
|
return { handleGetPlanDirs, handleUpdatePlanDirs };
|
|
1432
1450
|
}
|
|
@@ -2200,9 +2218,33 @@ function createUpdateHandlers(deps) {
|
|
|
2200
2218
|
};
|
|
2201
2219
|
}
|
|
2202
2220
|
|
|
2203
|
-
// src/
|
|
2221
|
+
// src/symbionts/reconcile.ts
|
|
2204
2222
|
import fs12 from "fs";
|
|
2205
2223
|
import path12 from "path";
|
|
2224
|
+
function getConfiguredManifests(projectRoot, config) {
|
|
2225
|
+
const allManifests = loadManifests();
|
|
2226
|
+
const enabledNames = getEnabledSymbiontNames(config);
|
|
2227
|
+
if (enabledNames) {
|
|
2228
|
+
return allManifests.filter((manifest) => enabledNames.has(manifest.name));
|
|
2229
|
+
}
|
|
2230
|
+
return allManifests.filter((manifest) => fs12.existsSync(path12.join(projectRoot, manifest.configDir)));
|
|
2231
|
+
}
|
|
2232
|
+
function reconcileConfiguredSymbionts(projectRoot, vaultDir = path12.join(projectRoot, ".myco")) {
|
|
2233
|
+
const config = loadConfig(vaultDir);
|
|
2234
|
+
const manifests = getConfiguredManifests(projectRoot, config);
|
|
2235
|
+
const packageRoot = resolvePackageRoot();
|
|
2236
|
+
let updatedCount = 0;
|
|
2237
|
+
for (const manifest of manifests) {
|
|
2238
|
+
const installer = new SymbiontInstaller(manifest, projectRoot, packageRoot);
|
|
2239
|
+
installer.install();
|
|
2240
|
+
updatedCount++;
|
|
2241
|
+
}
|
|
2242
|
+
return updatedCount;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
// src/daemon/backup.ts
|
|
2246
|
+
import fs13 from "fs";
|
|
2247
|
+
import path13 from "path";
|
|
2206
2248
|
var BACKUP_TABLES = [
|
|
2207
2249
|
"sessions",
|
|
2208
2250
|
"prompt_batches",
|
|
@@ -2229,7 +2271,7 @@ function toSqlLiteral(value) {
|
|
|
2229
2271
|
return `'${escapeSql(String(value))}'`;
|
|
2230
2272
|
}
|
|
2231
2273
|
function createBackup(db, backupDir, machineId) {
|
|
2232
|
-
|
|
2274
|
+
fs13.mkdirSync(backupDir, { recursive: true });
|
|
2233
2275
|
const lines = [];
|
|
2234
2276
|
const timestamp = epochSeconds();
|
|
2235
2277
|
lines.push(`${BACKUP_HEADER_TEMPLATE}: machine_id=${machineId}, created_at=${timestamp}`);
|
|
@@ -2247,22 +2289,22 @@ function createBackup(db, backupDir, machineId) {
|
|
|
2247
2289
|
}
|
|
2248
2290
|
lines.push("");
|
|
2249
2291
|
}
|
|
2250
|
-
const filePath =
|
|
2251
|
-
|
|
2292
|
+
const filePath = path13.join(backupDir, `${machineId}${BACKUP_EXTENSION}`);
|
|
2293
|
+
fs13.writeFileSync(filePath, lines.join("\n"), "utf-8");
|
|
2252
2294
|
return filePath;
|
|
2253
2295
|
}
|
|
2254
2296
|
function listBackups(backupDir) {
|
|
2255
2297
|
let entries;
|
|
2256
2298
|
try {
|
|
2257
|
-
entries =
|
|
2299
|
+
entries = fs13.readdirSync(backupDir);
|
|
2258
2300
|
} catch {
|
|
2259
2301
|
return [];
|
|
2260
2302
|
}
|
|
2261
2303
|
const backups = [];
|
|
2262
2304
|
for (const entry of entries) {
|
|
2263
2305
|
if (!BACKUP_FILENAME_PATTERN.test(entry)) continue;
|
|
2264
|
-
const filePath =
|
|
2265
|
-
const stat =
|
|
2306
|
+
const filePath = path13.join(backupDir, entry);
|
|
2307
|
+
const stat = fs13.statSync(filePath);
|
|
2266
2308
|
backups.push({
|
|
2267
2309
|
machine_id: entry.slice(0, -BACKUP_EXTENSION.length),
|
|
2268
2310
|
file_name: entry,
|
|
@@ -2274,7 +2316,7 @@ function listBackups(backupDir) {
|
|
|
2274
2316
|
}
|
|
2275
2317
|
var INSERT_REGEX = /^INSERT OR IGNORE INTO (\w+)\s+\(([^)]+)\)\s+VALUES\s+\((.+)\);$/;
|
|
2276
2318
|
function parseBackupFile(backupPath) {
|
|
2277
|
-
const content =
|
|
2319
|
+
const content = fs13.readFileSync(backupPath, "utf-8");
|
|
2278
2320
|
const inserts = [];
|
|
2279
2321
|
for (const line of content.split("\n")) {
|
|
2280
2322
|
const match = INSERT_REGEX.exec(line);
|
|
@@ -2358,7 +2400,7 @@ function restoreBackup(db, backupPath) {
|
|
|
2358
2400
|
}
|
|
2359
2401
|
|
|
2360
2402
|
// src/daemon/api/backup.ts
|
|
2361
|
-
import
|
|
2403
|
+
import path14 from "path";
|
|
2362
2404
|
function createBackupHandlers(deps) {
|
|
2363
2405
|
async function handleCreateBackup(_req) {
|
|
2364
2406
|
const filePath = createBackup(deps.db, deps.backupDir, deps.machineId);
|
|
@@ -2417,7 +2459,7 @@ function createBackupConfigHandlers(deps) {
|
|
|
2417
2459
|
const { vaultDir } = deps;
|
|
2418
2460
|
async function handleGetBackupConfig() {
|
|
2419
2461
|
const cfg = loadConfig(vaultDir);
|
|
2420
|
-
return { body: { dir: cfg.backup.dir ?? null, default_dir:
|
|
2462
|
+
return { body: { dir: cfg.backup.dir ?? null, default_dir: path14.resolve(vaultDir, "backups") } };
|
|
2421
2463
|
}
|
|
2422
2464
|
async function handlePutBackupConfig(req) {
|
|
2423
2465
|
const { dir } = req.body;
|
|
@@ -2587,15 +2629,15 @@ var TeamSyncClient = class _TeamSyncClient {
|
|
|
2587
2629
|
"Content-Type": "application/json"
|
|
2588
2630
|
};
|
|
2589
2631
|
}
|
|
2590
|
-
async request(method,
|
|
2591
|
-
const res = await this.fetchFn(`${this.workerUrl}${
|
|
2632
|
+
async request(method, path23, body) {
|
|
2633
|
+
const res = await this.fetchFn(`${this.workerUrl}${path23}`, {
|
|
2592
2634
|
method,
|
|
2593
2635
|
headers: this.headers(),
|
|
2594
2636
|
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
2595
2637
|
});
|
|
2596
2638
|
if (!res.ok) {
|
|
2597
2639
|
const text = await res.text().catch(() => "");
|
|
2598
|
-
throw new Error(`Team sync request ${method} ${
|
|
2640
|
+
throw new Error(`Team sync request ${method} ${path23} failed: ${res.status} ${text}`);
|
|
2599
2641
|
}
|
|
2600
2642
|
return res.json();
|
|
2601
2643
|
}
|
|
@@ -2730,7 +2772,7 @@ function createTeamHandlers(deps) {
|
|
|
2730
2772
|
return { body: { retried: count } };
|
|
2731
2773
|
}
|
|
2732
2774
|
async function handleUpgradeWorker(_req) {
|
|
2733
|
-
const { upgradeWorker } = await import("./team-
|
|
2775
|
+
const { upgradeWorker } = await import("./team-2IAT6MKD.js");
|
|
2734
2776
|
logger.info("team-sync.upgrade.start", "Starting worker upgrade");
|
|
2735
2777
|
const result = upgradeWorker(vaultDir);
|
|
2736
2778
|
if (!result.success) {
|
|
@@ -2946,8 +2988,8 @@ function createSessionLifecycleHandlers(deps) {
|
|
|
2946
2988
|
}
|
|
2947
2989
|
|
|
2948
2990
|
// src/daemon/api/skills.ts
|
|
2949
|
-
import
|
|
2950
|
-
import
|
|
2991
|
+
import fs14 from "fs";
|
|
2992
|
+
import path15 from "path";
|
|
2951
2993
|
|
|
2952
2994
|
// src/db/queries/skill-usage.ts
|
|
2953
2995
|
var USAGE_COLUMNS = [
|
|
@@ -3114,15 +3156,15 @@ function createSkillRecordDeleteHandler(deps) {
|
|
|
3114
3156
|
if (result.body?.deleted) {
|
|
3115
3157
|
const record = result.body;
|
|
3116
3158
|
if (record.name) {
|
|
3117
|
-
const projectRoot =
|
|
3118
|
-
const skillDir =
|
|
3159
|
+
const projectRoot = path15.resolve(vaultDir, "..");
|
|
3160
|
+
const skillDir = path15.resolve(projectRoot, ".agents", "skills", record.name);
|
|
3119
3161
|
try {
|
|
3120
|
-
|
|
3162
|
+
fs14.rmSync(skillDir, { recursive: true, force: true });
|
|
3121
3163
|
} catch (err) {
|
|
3122
3164
|
logger.warn(LOG_KINDS.PROCESSOR_BATCH, "Failed to remove skill directory", { name: record.name, error: String(err) });
|
|
3123
3165
|
}
|
|
3124
3166
|
try {
|
|
3125
|
-
const { syncSkillSymlinks } = await import("./installer-
|
|
3167
|
+
const { syncSkillSymlinks } = await import("./installer-YH3WQISI.js");
|
|
3126
3168
|
syncSkillSymlinks(projectRoot, record.name, { remove: true });
|
|
3127
3169
|
} catch (err) {
|
|
3128
3170
|
logger.warn(LOG_KINDS.PROCESSOR_BATCH, "Failed to remove skill symlinks", { name: record.name, error: String(err) });
|
|
@@ -3375,12 +3417,12 @@ async function handleGetModels(req) {
|
|
|
3375
3417
|
|
|
3376
3418
|
// src/daemon/api/stats.ts
|
|
3377
3419
|
import { createHash as createHash2 } from "crypto";
|
|
3378
|
-
import
|
|
3379
|
-
import
|
|
3420
|
+
import fs15 from "fs";
|
|
3421
|
+
import path16 from "path";
|
|
3380
3422
|
function computeConfigHash(vaultDir) {
|
|
3381
3423
|
try {
|
|
3382
|
-
const configPath =
|
|
3383
|
-
const raw =
|
|
3424
|
+
const configPath = path16.join(vaultDir, CONFIG_FILENAME);
|
|
3425
|
+
const raw = fs15.readFileSync(configPath, "utf-8");
|
|
3384
3426
|
return createHash2("md5").update(raw).digest("hex");
|
|
3385
3427
|
} catch {
|
|
3386
3428
|
return "";
|
|
@@ -3746,7 +3788,7 @@ async function triggerTitleSummary(sessionId, deps) {
|
|
|
3746
3788
|
if (config.agent.summary_batch_interval <= 0) return;
|
|
3747
3789
|
if (config.agent.event_tasks_enabled === false) return;
|
|
3748
3790
|
try {
|
|
3749
|
-
const { runAgent } = await import("./executor-
|
|
3791
|
+
const { runAgent } = await import("./executor-2TMGOVEA.js");
|
|
3750
3792
|
runAgent(vaultDir, {
|
|
3751
3793
|
task: "title-summary",
|
|
3752
3794
|
instruction: `Process session ${sessionId} only`,
|
|
@@ -5433,17 +5475,17 @@ var SqliteRecordSource = class {
|
|
|
5433
5475
|
};
|
|
5434
5476
|
|
|
5435
5477
|
// src/daemon/database/manager.ts
|
|
5436
|
-
import
|
|
5478
|
+
import fs17 from "fs";
|
|
5437
5479
|
|
|
5438
5480
|
// src/db/queries/database.ts
|
|
5439
|
-
import
|
|
5481
|
+
import fs16 from "fs";
|
|
5440
5482
|
function pragmaScalar(name) {
|
|
5441
5483
|
const db = getDatabase();
|
|
5442
5484
|
return db.pragma(name, { simple: true });
|
|
5443
5485
|
}
|
|
5444
5486
|
function safeFileSize(filePath) {
|
|
5445
5487
|
try {
|
|
5446
|
-
return
|
|
5488
|
+
return fs16.statSync(filePath).size;
|
|
5447
5489
|
} catch (err) {
|
|
5448
5490
|
if (err.code === "ENOENT") return 0;
|
|
5449
5491
|
throw err;
|
|
@@ -5715,7 +5757,7 @@ var DatabaseMaintenanceManager = class {
|
|
|
5715
5757
|
}
|
|
5716
5758
|
async vacuum() {
|
|
5717
5759
|
const size_before = this.fileSize();
|
|
5718
|
-
const stats = await
|
|
5760
|
+
const stats = await fs17.promises.statfs(this.vaultDir);
|
|
5719
5761
|
const free_bytes = Number(stats.bavail) * Number(stats.bsize);
|
|
5720
5762
|
const required_bytes = size_before * VACUUM_FREE_SPACE_MULTIPLIER;
|
|
5721
5763
|
if (free_bytes < required_bytes) {
|
|
@@ -5763,7 +5805,7 @@ var DatabaseMaintenanceManager = class {
|
|
|
5763
5805
|
}
|
|
5764
5806
|
fileSize() {
|
|
5765
5807
|
try {
|
|
5766
|
-
return
|
|
5808
|
+
return fs17.statSync(this.dbPath).size;
|
|
5767
5809
|
} catch {
|
|
5768
5810
|
return 0;
|
|
5769
5811
|
}
|
|
@@ -6242,7 +6284,7 @@ async function registerScheduledTasks(powerManager, deps) {
|
|
|
6242
6284
|
else runningTasks.delete(name);
|
|
6243
6285
|
},
|
|
6244
6286
|
runTask: async (taskName) => {
|
|
6245
|
-
const { runAgent } = await import("./executor-
|
|
6287
|
+
const { runAgent } = await import("./executor-2TMGOVEA.js");
|
|
6246
6288
|
const taskConfig = config.agent.tasks?.[taskName];
|
|
6247
6289
|
const projectRoot = resolve(vaultDir, "..");
|
|
6248
6290
|
const built = buildTaskInstruction(taskName, taskConfig?.params, taskAgentMap.get(taskName), projectRoot, embeddingManager);
|
|
@@ -6546,7 +6588,7 @@ function createAgentRunHandlers(deps) {
|
|
|
6546
6588
|
};
|
|
6547
6589
|
}
|
|
6548
6590
|
}
|
|
6549
|
-
const { runAgent } = await import("./executor-
|
|
6591
|
+
const { runAgent } = await import("./executor-2TMGOVEA.js");
|
|
6550
6592
|
const resultPromise = runAgent(vaultDir, {
|
|
6551
6593
|
task,
|
|
6552
6594
|
instruction,
|
|
@@ -6615,8 +6657,8 @@ function createAgentRunHandlers(deps) {
|
|
|
6615
6657
|
}
|
|
6616
6658
|
|
|
6617
6659
|
// src/daemon/api/attachments.ts
|
|
6618
|
-
import
|
|
6619
|
-
import
|
|
6660
|
+
import fs18 from "fs";
|
|
6661
|
+
import path17 from "path";
|
|
6620
6662
|
var ATTACHMENT_MEDIA_TYPES = {
|
|
6621
6663
|
png: "image/png",
|
|
6622
6664
|
jpg: "image/jpeg",
|
|
@@ -6636,14 +6678,14 @@ function createAttachmentHandler(deps) {
|
|
|
6636
6678
|
const contentType2 = att.media_type ?? "application/octet-stream";
|
|
6637
6679
|
return { status: 200, headers: { "Content-Type": contentType2 }, body: att.data };
|
|
6638
6680
|
}
|
|
6639
|
-
const filePath =
|
|
6681
|
+
const filePath = path17.join(vaultDir, "attachments", filename);
|
|
6640
6682
|
let diskData;
|
|
6641
6683
|
try {
|
|
6642
|
-
diskData =
|
|
6684
|
+
diskData = fs18.readFileSync(filePath);
|
|
6643
6685
|
} catch {
|
|
6644
6686
|
return { status: 404, body: { error: "not_found" } };
|
|
6645
6687
|
}
|
|
6646
|
-
const ext =
|
|
6688
|
+
const ext = path17.extname(filename).slice(1).toLowerCase();
|
|
6647
6689
|
const contentType = ATTACHMENT_MEDIA_TYPES[ext] ?? "application/octet-stream";
|
|
6648
6690
|
return { status: 200, headers: { "Content-Type": contentType }, body: diskData };
|
|
6649
6691
|
}
|
|
@@ -6651,19 +6693,19 @@ function createAttachmentHandler(deps) {
|
|
|
6651
6693
|
}
|
|
6652
6694
|
|
|
6653
6695
|
// src/daemon/log-reconcile.ts
|
|
6654
|
-
import
|
|
6655
|
-
import
|
|
6696
|
+
import fs19 from "fs";
|
|
6697
|
+
import path18 from "path";
|
|
6656
6698
|
function reconcileLogBuffer(logDir, sinceTimestamp) {
|
|
6657
6699
|
let replayed = 0;
|
|
6658
6700
|
const files = [];
|
|
6659
6701
|
for (let i = 3; i >= 1; i--) {
|
|
6660
|
-
const rotated =
|
|
6661
|
-
if (
|
|
6702
|
+
const rotated = path18.join(logDir, `daemon.${i}.log`);
|
|
6703
|
+
if (fs19.existsSync(rotated)) files.push(rotated);
|
|
6662
6704
|
}
|
|
6663
|
-
const current =
|
|
6664
|
-
if (
|
|
6705
|
+
const current = path18.join(logDir, "daemon.log");
|
|
6706
|
+
if (fs19.existsSync(current)) files.push(current);
|
|
6665
6707
|
for (const file of files) {
|
|
6666
|
-
const content =
|
|
6708
|
+
const content = fs19.readFileSync(file, "utf-8");
|
|
6667
6709
|
for (const line of content.split("\n")) {
|
|
6668
6710
|
if (!line.trim()) continue;
|
|
6669
6711
|
try {
|
|
@@ -6940,8 +6982,8 @@ function registerPowerJobs(powerManager, deps) {
|
|
|
6940
6982
|
}
|
|
6941
6983
|
|
|
6942
6984
|
// src/daemon/reconciliation.ts
|
|
6943
|
-
import
|
|
6944
|
-
import
|
|
6985
|
+
import fs20 from "fs";
|
|
6986
|
+
import path19 from "path";
|
|
6945
6987
|
|
|
6946
6988
|
// src/daemon/event-handlers.ts
|
|
6947
6989
|
var TOOL_INPUT_STORE_LIMIT = 4e3;
|
|
@@ -7110,10 +7152,10 @@ function createReconciler({ bufferDir, logger }) {
|
|
|
7110
7152
|
function reconcileSession(sessionId) {
|
|
7111
7153
|
if (reconciledSessions.has(sessionId)) return;
|
|
7112
7154
|
reconciledSessions.add(sessionId);
|
|
7113
|
-
const bufferPath =
|
|
7155
|
+
const bufferPath = path19.join(bufferDir, `${sessionId}.jsonl`);
|
|
7114
7156
|
let content;
|
|
7115
7157
|
try {
|
|
7116
|
-
content =
|
|
7158
|
+
content = fs20.readFileSync(bufferPath, "utf-8").trim();
|
|
7117
7159
|
} catch {
|
|
7118
7160
|
return;
|
|
7119
7161
|
}
|
|
@@ -7182,7 +7224,7 @@ function createReconciler({ bufferDir, logger }) {
|
|
|
7182
7224
|
}
|
|
7183
7225
|
|
|
7184
7226
|
// src/daemon/stop-processing.ts
|
|
7185
|
-
import
|
|
7227
|
+
import fs21 from "fs";
|
|
7186
7228
|
|
|
7187
7229
|
// src/daemon/capture-images.ts
|
|
7188
7230
|
var SESSION_SHORT_LEN = 6;
|
|
@@ -7222,7 +7264,7 @@ function captureBatchImages(input) {
|
|
|
7222
7264
|
// src/daemon/plan-capture.ts
|
|
7223
7265
|
import { createHash as createHash4 } from "crypto";
|
|
7224
7266
|
import os7 from "os";
|
|
7225
|
-
import
|
|
7267
|
+
import path20 from "path";
|
|
7226
7268
|
function extractTaggedPlans(text, tags) {
|
|
7227
7269
|
const results = [];
|
|
7228
7270
|
for (const tag of tags) {
|
|
@@ -7248,11 +7290,11 @@ var FILE_WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
|
7248
7290
|
var HEADING_REGEX = /^#\s+(.+)$/m;
|
|
7249
7291
|
var PLAN_ID_HASH_LENGTH = 16;
|
|
7250
7292
|
function isInPlanDirectory(filePath, watchDirs, projectRoot) {
|
|
7251
|
-
const abs =
|
|
7293
|
+
const abs = path20.isAbsolute(filePath) ? filePath : path20.resolve(projectRoot, filePath);
|
|
7252
7294
|
return watchDirs.some((dir) => {
|
|
7253
|
-
const expanded = dir.startsWith("~/") ?
|
|
7254
|
-
const absDir =
|
|
7255
|
-
const prefix = absDir.endsWith(
|
|
7295
|
+
const expanded = dir.startsWith("~/") ? path20.join(os7.homedir(), dir.slice(2)) : dir;
|
|
7296
|
+
const absDir = path20.isAbsolute(expanded) ? expanded : path20.resolve(projectRoot, expanded);
|
|
7297
|
+
const prefix = absDir.endsWith(path20.sep) ? absDir : absDir + path20.sep;
|
|
7256
7298
|
return abs === absDir || abs.startsWith(prefix);
|
|
7257
7299
|
});
|
|
7258
7300
|
}
|
|
@@ -7262,7 +7304,7 @@ function isPlanWriteEvent(toolName, toolInput, config) {
|
|
|
7262
7304
|
if (typeof filePath !== "string") return null;
|
|
7263
7305
|
if (!isInPlanDirectory(filePath, config.watchDirs, config.projectRoot)) return null;
|
|
7264
7306
|
if (config.extensions?.length) {
|
|
7265
|
-
const ext =
|
|
7307
|
+
const ext = path20.extname(filePath).toLowerCase();
|
|
7266
7308
|
if (!config.extensions.includes(ext)) return null;
|
|
7267
7309
|
}
|
|
7268
7310
|
return filePath;
|
|
@@ -7276,7 +7318,7 @@ function capturePlan(input) {
|
|
|
7276
7318
|
const now = Math.floor(Date.now() / 1e3);
|
|
7277
7319
|
const contentHash = createHash4(CONTENT_HASH_ALGORITHM).update(input.content).digest("hex");
|
|
7278
7320
|
const id = createHash4("md5").update(input.sourcePath).digest("hex").slice(0, PLAN_ID_HASH_LENGTH);
|
|
7279
|
-
const title = parsePlanTitle(input.content,
|
|
7321
|
+
const title = parsePlanTitle(input.content, path20.basename(input.sourcePath));
|
|
7280
7322
|
return upsertPlan({
|
|
7281
7323
|
id,
|
|
7282
7324
|
title,
|
|
@@ -7445,7 +7487,7 @@ function createStopProcessor(deps) {
|
|
|
7445
7487
|
let transcriptText = null;
|
|
7446
7488
|
if (hookTranscriptPath) {
|
|
7447
7489
|
try {
|
|
7448
|
-
transcriptText =
|
|
7490
|
+
transcriptText = fs21.readFileSync(hookTranscriptPath, "utf-8");
|
|
7449
7491
|
} catch {
|
|
7450
7492
|
}
|
|
7451
7493
|
}
|
|
@@ -7581,8 +7623,8 @@ function createStopProcessor(deps) {
|
|
|
7581
7623
|
}
|
|
7582
7624
|
|
|
7583
7625
|
// src/daemon/event-dispatch.ts
|
|
7584
|
-
import
|
|
7585
|
-
import
|
|
7626
|
+
import fs22 from "fs";
|
|
7627
|
+
import path21 from "path";
|
|
7586
7628
|
var EventBody = external_exports.object({ type: external_exports.string(), session_id: external_exports.string() }).passthrough();
|
|
7587
7629
|
function createEventDispatcher(deps) {
|
|
7588
7630
|
const {
|
|
@@ -7621,7 +7663,7 @@ function createEventDispatcher(deps) {
|
|
|
7621
7663
|
reconcileSession(event.session_id);
|
|
7622
7664
|
}
|
|
7623
7665
|
if (!sessionBuffers.has(event.session_id)) {
|
|
7624
|
-
const bufferDir =
|
|
7666
|
+
const bufferDir = path21.join(vaultDir, "buffer");
|
|
7625
7667
|
sessionBuffers.set(event.session_id, new EventBuffer(bufferDir, event.session_id));
|
|
7626
7668
|
}
|
|
7627
7669
|
sessionBuffers.get(event.session_id).append(event);
|
|
@@ -7680,10 +7722,10 @@ function createEventDispatcher(deps) {
|
|
|
7680
7722
|
);
|
|
7681
7723
|
if (planFilePath) {
|
|
7682
7724
|
const captureSessionId = event.session_id;
|
|
7683
|
-
|
|
7725
|
+
fs22.promises.readFile(planFilePath, "utf-8").then((planContent) => {
|
|
7684
7726
|
const latestBatch = getLatestBatch(captureSessionId);
|
|
7685
7727
|
capturePlan({
|
|
7686
|
-
sourcePath:
|
|
7728
|
+
sourcePath: path21.relative(projectRoot, planFilePath),
|
|
7687
7729
|
content: planContent,
|
|
7688
7730
|
sessionId: captureSessionId,
|
|
7689
7731
|
promptBatchId: latestBatch?.id ?? null
|
|
@@ -7825,14 +7867,14 @@ function createEventDispatcher(deps) {
|
|
|
7825
7867
|
}
|
|
7826
7868
|
|
|
7827
7869
|
// src/daemon/main.ts
|
|
7828
|
-
import
|
|
7870
|
+
import fs23 from "fs";
|
|
7829
7871
|
import os8 from "os";
|
|
7830
|
-
import
|
|
7872
|
+
import path22 from "path";
|
|
7831
7873
|
function killStaleDaemon(vaultDir, logger) {
|
|
7832
|
-
const daemonJsonPath =
|
|
7874
|
+
const daemonJsonPath = path22.join(vaultDir, "daemon.json");
|
|
7833
7875
|
try {
|
|
7834
|
-
if (!
|
|
7835
|
-
const info = JSON.parse(
|
|
7876
|
+
if (!fs23.existsSync(daemonJsonPath)) return;
|
|
7877
|
+
const info = JSON.parse(fs23.readFileSync(daemonJsonPath, "utf-8"));
|
|
7836
7878
|
if (!info.pid) return;
|
|
7837
7879
|
if (info.pid === process.pid) return;
|
|
7838
7880
|
try {
|
|
@@ -7841,7 +7883,7 @@ function killStaleDaemon(vaultDir, logger) {
|
|
|
7841
7883
|
logger.info(LOG_KINDS.DAEMON_START, "Killed stale daemon", { pid: info.pid });
|
|
7842
7884
|
} catch {
|
|
7843
7885
|
}
|
|
7844
|
-
|
|
7886
|
+
fs23.unlinkSync(daemonJsonPath);
|
|
7845
7887
|
} catch {
|
|
7846
7888
|
}
|
|
7847
7889
|
}
|
|
@@ -7851,7 +7893,7 @@ async function main() {
|
|
|
7851
7893
|
process.stderr.write("Usage: mycod --vault <path>\n");
|
|
7852
7894
|
process.exit(1);
|
|
7853
7895
|
}
|
|
7854
|
-
const vaultDir =
|
|
7896
|
+
const vaultDir = path22.resolve(vaultArg);
|
|
7855
7897
|
loadSecrets(vaultDir);
|
|
7856
7898
|
const config = loadConfig(vaultDir);
|
|
7857
7899
|
const manifests = loadManifests();
|
|
@@ -7863,7 +7905,7 @@ async function main() {
|
|
|
7863
7905
|
projectRoot,
|
|
7864
7906
|
extensions: config.capture.artifact_extensions
|
|
7865
7907
|
};
|
|
7866
|
-
const logger = new DaemonLogger(
|
|
7908
|
+
const logger = new DaemonLogger(path22.join(vaultDir, "logs"), {
|
|
7867
7909
|
level: config.daemon.log_level
|
|
7868
7910
|
});
|
|
7869
7911
|
if (config.daemon.log_level === "debug") {
|
|
@@ -7892,7 +7934,7 @@ async function main() {
|
|
|
7892
7934
|
const devCliEntry = detectDevBuild(
|
|
7893
7935
|
globalPrefix,
|
|
7894
7936
|
process.argv[1],
|
|
7895
|
-
|
|
7937
|
+
fs23.realpathSync
|
|
7896
7938
|
);
|
|
7897
7939
|
if (devCliEntry) {
|
|
7898
7940
|
setDevBuildCliEntry(devCliEntry);
|
|
@@ -7906,11 +7948,11 @@ async function main() {
|
|
|
7906
7948
|
registerBuiltinDomains();
|
|
7907
7949
|
logger.info(LOG_KINDS.DAEMON_START, "SQLite initialized", { vault: vaultDir });
|
|
7908
7950
|
{
|
|
7909
|
-
const reasonPath =
|
|
7951
|
+
const reasonPath = path22.join(vaultDir, RESTART_REASON_FILENAME);
|
|
7910
7952
|
try {
|
|
7911
|
-
if (
|
|
7912
|
-
const raw = JSON.parse(
|
|
7913
|
-
|
|
7953
|
+
if (fs23.existsSync(reasonPath)) {
|
|
7954
|
+
const raw = JSON.parse(fs23.readFileSync(reasonPath, "utf-8"));
|
|
7955
|
+
fs23.unlinkSync(reasonPath);
|
|
7914
7956
|
if (raw.reason === "version_sync" && raw.to_version) {
|
|
7915
7957
|
const message = raw.local_update_ran ? "Restarted and updated local project hooks." : "Restarted to pick up the latest version.";
|
|
7916
7958
|
notify(vaultDir, {
|
|
@@ -7952,13 +7994,13 @@ async function main() {
|
|
|
7952
7994
|
});
|
|
7953
7995
|
const lastLogTimestamp = getMaxTimestamp();
|
|
7954
7996
|
if (lastLogTimestamp) {
|
|
7955
|
-
const logDir =
|
|
7997
|
+
const logDir = path22.join(vaultDir, "logs");
|
|
7956
7998
|
const replayedCount = reconcileLogBuffer(logDir, lastLogTimestamp);
|
|
7957
7999
|
if (replayedCount > 0) {
|
|
7958
8000
|
logger.info(LOG_KINDS.DAEMON_RECONCILE, `Replayed ${replayedCount} log entries from buffer`, { replayed: replayedCount });
|
|
7959
8001
|
}
|
|
7960
8002
|
}
|
|
7961
|
-
const vectorsDbPath =
|
|
8003
|
+
const vectorsDbPath = path22.join(vaultDir, "vectors.db");
|
|
7962
8004
|
const vectorStore = new SqliteVecVectorStore(vectorsDbPath);
|
|
7963
8005
|
const llmProvider = createEmbeddingProvider(config.embedding);
|
|
7964
8006
|
const embeddingProvider = new EmbeddingProviderAdapter(llmProvider, config.embedding);
|
|
@@ -7994,10 +8036,10 @@ async function main() {
|
|
|
7994
8036
|
}
|
|
7995
8037
|
let uiDir = null;
|
|
7996
8038
|
{
|
|
7997
|
-
const root = findPackageRoot(
|
|
8039
|
+
const root = findPackageRoot(path22.dirname(new URL(import.meta.url).pathname));
|
|
7998
8040
|
if (root) {
|
|
7999
|
-
const candidate =
|
|
8000
|
-
if (
|
|
8041
|
+
const candidate = path22.join(root, "dist", "ui");
|
|
8042
|
+
if (fs23.existsSync(candidate)) uiDir = candidate;
|
|
8001
8043
|
}
|
|
8002
8044
|
}
|
|
8003
8045
|
if (uiDir) {
|
|
@@ -8030,7 +8072,7 @@ async function main() {
|
|
|
8030
8072
|
(p) => createPerProjectAdapter(p, claudeCodeAdapter.parseTurns)
|
|
8031
8073
|
)
|
|
8032
8074
|
});
|
|
8033
|
-
const bufferDir =
|
|
8075
|
+
const bufferDir = path22.join(vaultDir, "buffer");
|
|
8034
8076
|
const sessionBuffers = /* @__PURE__ */ new Map();
|
|
8035
8077
|
const reconciler = createReconciler({ bufferDir, logger });
|
|
8036
8078
|
reconciler.runStartupReconciliation();
|
|
@@ -8083,6 +8125,7 @@ async function main() {
|
|
|
8083
8125
|
server.registerRoute("PUT", "/api/config", async (req) => {
|
|
8084
8126
|
const result = await handlePutConfig(vaultDir, req.body);
|
|
8085
8127
|
if (!result.status || result.status < 400) {
|
|
8128
|
+
reconcileConfiguredSymbionts(path22.dirname(vaultDir), vaultDir);
|
|
8086
8129
|
configHash = computeConfigHash(vaultDir);
|
|
8087
8130
|
}
|
|
8088
8131
|
return result;
|
|
@@ -8099,10 +8142,19 @@ async function main() {
|
|
|
8099
8142
|
planWatchConfig,
|
|
8100
8143
|
setPlanWatchConfig: (cfg) => {
|
|
8101
8144
|
planWatchConfig = cfg;
|
|
8145
|
+
},
|
|
8146
|
+
reconcileProjectFiles: () => {
|
|
8147
|
+
reconcileConfiguredSymbionts(path22.dirname(vaultDir), vaultDir);
|
|
8102
8148
|
}
|
|
8103
8149
|
});
|
|
8104
8150
|
server.registerRoute("GET", "/api/config/plan-dirs", planDirHandlers.handleGetPlanDirs);
|
|
8105
|
-
server.registerRoute("POST", "/api/config/plan-dirs",
|
|
8151
|
+
server.registerRoute("POST", "/api/config/plan-dirs", async (req) => {
|
|
8152
|
+
const result = await planDirHandlers.handleUpdatePlanDirs(req);
|
|
8153
|
+
if (!result.status || result.status < 400) {
|
|
8154
|
+
configHash = computeConfigHash(vaultDir);
|
|
8155
|
+
}
|
|
8156
|
+
return result;
|
|
8157
|
+
});
|
|
8106
8158
|
const configHashRef = { get: () => configHash };
|
|
8107
8159
|
server.registerRoute("GET", "/api/stats", createLiveStatsHandler({
|
|
8108
8160
|
vaultDir,
|
|
@@ -8117,7 +8169,7 @@ async function main() {
|
|
|
8117
8169
|
server.registerRoute("POST", "/api/log", createLogIngestionHandler(logger));
|
|
8118
8170
|
server.registerRoute("GET", "/api/models", async (req) => handleGetModels(req));
|
|
8119
8171
|
server.registerRoute("POST", "/api/restart", async (req) => handleRestart({ vaultDir, progressTracker }, req.body));
|
|
8120
|
-
const updateProjectRoot =
|
|
8172
|
+
const updateProjectRoot = path22.dirname(vaultDir);
|
|
8121
8173
|
const updateHandlers = createUpdateHandlers({
|
|
8122
8174
|
vaultDir,
|
|
8123
8175
|
projectRoot: updateProjectRoot,
|
|
@@ -8183,7 +8235,7 @@ async function main() {
|
|
|
8183
8235
|
server.registerRoute("GET", "/api/mcp/sessions", mcpProxy.handleSessions);
|
|
8184
8236
|
server.registerRoute("GET", "/api/mcp/team", mcpProxy.handleTeam);
|
|
8185
8237
|
const rawBackupDir = config.backup.dir;
|
|
8186
|
-
const backupDir = rawBackupDir ?
|
|
8238
|
+
const backupDir = rawBackupDir ? path22.resolve(rawBackupDir.startsWith("~/") ? path22.join(os8.homedir(), rawBackupDir.slice(2)) : rawBackupDir) : path22.resolve(vaultDir, "backups");
|
|
8187
8239
|
const backupHandlers = createBackupHandlers({ db, backupDir, machineId });
|
|
8188
8240
|
server.registerRoute("POST", "/api/backup", backupHandlers.handleCreateBackup);
|
|
8189
8241
|
server.registerRoute("GET", "/api/backups", backupHandlers.handleListBackups);
|
|
@@ -8287,4 +8339,4 @@ export {
|
|
|
8287
8339
|
handleUserPrompt,
|
|
8288
8340
|
main
|
|
8289
8341
|
};
|
|
8290
|
-
//# sourceMappingURL=main-
|
|
8342
|
+
//# sourceMappingURL=main-R5ZD5OIZ.js.map
|