agent-recall-mcp 3.3.2 → 3.3.4
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/index.js +6 -13
- package/dist/index.js.map +1 -1
- package/dist/resources/journal-resources.d.ts.map +1 -1
- package/dist/resources/journal-resources.js +5 -29
- package/dist/resources/journal-resources.js.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/alignment-check.d.ts.map +1 -1
- package/dist/tools/alignment-check.js +3 -54
- package/dist/tools/alignment-check.js.map +1 -1
- package/dist/tools/awareness-update.d.ts +2 -8
- package/dist/tools/awareness-update.d.ts.map +1 -1
- package/dist/tools/awareness-update.js +3 -66
- package/dist/tools/awareness-update.js.map +1 -1
- package/dist/tools/context-synthesize.d.ts.map +1 -1
- package/dist/tools/context-synthesize.js +6 -187
- package/dist/tools/context-synthesize.js.map +1 -1
- package/dist/tools/journal-archive.d.ts.map +1 -1
- package/dist/tools/journal-archive.js +3 -48
- package/dist/tools/journal-archive.js.map +1 -1
- package/dist/tools/journal-capture.d.ts.map +1 -1
- package/dist/tools/journal-capture.js +3 -60
- package/dist/tools/journal-capture.js.map +1 -1
- package/dist/tools/journal-cold-start.d.ts.map +1 -1
- package/dist/tools/journal-cold-start.js +10 -52
- package/dist/tools/journal-cold-start.js.map +1 -1
- package/dist/tools/journal-list.d.ts.map +1 -1
- package/dist/tools/journal-list.js +3 -23
- package/dist/tools/journal-list.js.map +1 -1
- package/dist/tools/journal-projects.d.ts.map +1 -1
- package/dist/tools/journal-projects.js +3 -16
- package/dist/tools/journal-projects.js.map +1 -1
- package/dist/tools/journal-read.d.ts.map +1 -1
- package/dist/tools/journal-read.js +5 -45
- package/dist/tools/journal-read.js.map +1 -1
- package/dist/tools/journal-rollup.d.ts +3 -0
- package/dist/tools/journal-rollup.d.ts.map +1 -0
- package/dist/tools/journal-rollup.js +21 -0
- package/dist/tools/journal-rollup.js.map +1 -0
- package/dist/tools/journal-search.d.ts.map +1 -1
- package/dist/tools/journal-search.js +3 -91
- package/dist/tools/journal-search.js.map +1 -1
- package/dist/tools/journal-state.d.ts +0 -3
- package/dist/tools/journal-state.d.ts.map +1 -1
- package/dist/tools/journal-state.js +5 -93
- package/dist/tools/journal-state.js.map +1 -1
- package/dist/tools/journal-write.d.ts.map +1 -1
- package/dist/tools/journal-write.js +3 -62
- package/dist/tools/journal-write.js.map +1 -1
- package/dist/tools/knowledge-read.d.ts.map +1 -1
- package/dist/tools/knowledge-read.js +3 -100
- package/dist/tools/knowledge-read.js.map +1 -1
- package/dist/tools/knowledge-write.d.ts.map +1 -1
- package/dist/tools/knowledge-write.js +3 -66
- package/dist/tools/knowledge-write.js.map +1 -1
- package/dist/tools/nudge.d.ts.map +1 -1
- package/dist/tools/nudge.js +3 -25
- package/dist/tools/nudge.js.map +1 -1
- package/dist/tools/palace-lint.d.ts +2 -6
- package/dist/tools/palace-lint.d.ts.map +1 -1
- package/dist/tools/palace-lint.js +3 -135
- package/dist/tools/palace-lint.js.map +1 -1
- package/dist/tools/palace-read.d.ts +2 -5
- package/dist/tools/palace-read.d.ts.map +1 -1
- package/dist/tools/palace-read.js +5 -62
- package/dist/tools/palace-read.js.map +1 -1
- package/dist/tools/palace-search.d.ts +2 -5
- package/dist/tools/palace-search.d.ts.map +1 -1
- package/dist/tools/palace-search.js +3 -66
- package/dist/tools/palace-search.js.map +1 -1
- package/dist/tools/palace-walk.d.ts +2 -11
- package/dist/tools/palace-walk.d.ts.map +1 -1
- package/dist/tools/palace-walk.js +3 -149
- package/dist/tools/palace-walk.js.map +1 -1
- package/dist/tools/palace-write.d.ts +2 -5
- package/dist/tools/palace-write.d.ts.map +1 -1
- package/dist/tools/palace-write.js +3 -90
- package/dist/tools/palace-write.js.map +1 -1
- package/dist/tools/recall-insight.d.ts +2 -8
- package/dist/tools/recall-insight.d.ts.map +1 -1
- package/dist/tools/recall-insight.js +3 -35
- package/dist/tools/recall-insight.js.map +1 -1
- package/package.json +9 -46
- package/README.md +0 -435
- package/dist/helpers/journal-files.d.ts +0 -30
- package/dist/helpers/journal-files.d.ts.map +0 -1
- package/dist/helpers/journal-files.js +0 -96
- package/dist/helpers/journal-files.js.map +0 -1
- package/dist/helpers/sections.d.ts +0 -12
- package/dist/helpers/sections.d.ts.map +0 -1
- package/dist/helpers/sections.js +0 -84
- package/dist/helpers/sections.js.map +0 -1
- package/dist/palace/awareness.d.ts +0 -67
- package/dist/palace/awareness.d.ts.map +0 -1
- package/dist/palace/awareness.js +0 -231
- package/dist/palace/awareness.js.map +0 -1
- package/dist/palace/consolidate.d.ts +0 -28
- package/dist/palace/consolidate.d.ts.map +0 -1
- package/dist/palace/consolidate.js +0 -129
- package/dist/palace/consolidate.js.map +0 -1
- package/dist/palace/fan-out.d.ts +0 -15
- package/dist/palace/fan-out.d.ts.map +0 -1
- package/dist/palace/fan-out.js +0 -78
- package/dist/palace/fan-out.js.map +0 -1
- package/dist/palace/graph.d.ts +0 -11
- package/dist/palace/graph.d.ts.map +0 -1
- package/dist/palace/graph.js +0 -59
- package/dist/palace/graph.js.map +0 -1
- package/dist/palace/identity.d.ts +0 -6
- package/dist/palace/identity.d.ts.map +0 -1
- package/dist/palace/identity.js +0 -18
- package/dist/palace/identity.js.map +0 -1
- package/dist/palace/index-manager.d.ts +0 -7
- package/dist/palace/index-manager.d.ts.map +0 -1
- package/dist/palace/index-manager.js +0 -46
- package/dist/palace/index-manager.js.map +0 -1
- package/dist/palace/insights-index.d.ts +0 -39
- package/dist/palace/insights-index.d.ts.map +0 -1
- package/dist/palace/insights-index.js +0 -101
- package/dist/palace/insights-index.js.map +0 -1
- package/dist/palace/log.d.ts +0 -9
- package/dist/palace/log.d.ts.map +0 -1
- package/dist/palace/log.js +0 -28
- package/dist/palace/log.js.map +0 -1
- package/dist/palace/obsidian.d.ts +0 -12
- package/dist/palace/obsidian.d.ts.map +0 -1
- package/dist/palace/obsidian.js +0 -76
- package/dist/palace/obsidian.js.map +0 -1
- package/dist/palace/rooms.d.ts +0 -14
- package/dist/palace/rooms.d.ts.map +0 -1
- package/dist/palace/rooms.js +0 -117
- package/dist/palace/rooms.js.map +0 -1
- package/dist/palace/salience.d.ts +0 -15
- package/dist/palace/salience.d.ts.map +0 -1
- package/dist/palace/salience.js +0 -33
- package/dist/palace/salience.js.map +0 -1
- package/dist/storage/fs-utils.d.ts +0 -8
- package/dist/storage/fs-utils.d.ts.map +0 -1
- package/dist/storage/fs-utils.js +0 -28
- package/dist/storage/fs-utils.js.map +0 -1
- package/dist/storage/paths.d.ts +0 -21
- package/dist/storage/paths.d.ts.map +0 -1
- package/dist/storage/paths.js +0 -59
- package/dist/storage/paths.js.map +0 -1
- package/dist/storage/project.d.ts +0 -17
- package/dist/storage/project.d.ts.map +0 -1
- package/dist/storage/project.js +0 -130
- package/dist/storage/project.js.map +0 -1
- package/dist/types.d.ts +0 -112
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -31
- package/dist/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journal-search.js","sourceRoot":"","sources":["../../src/tools/journal-search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"journal-search.js","sourceRoot":"","sources":["../../src/tools/journal-search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,UAAU,QAAQ,CAAC,MAAiB;IACxC,MAAM,CAAC,YAAY,CAAC,gBAAgB,EAAE;QACpC,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,4DAA4D;QACzE,WAAW,EAAE;YACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;YACxE,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,OAAO,CAAC,MAAM,CAAC;iBACf,QAAQ,CAAC,wCAAwC,CAAC;YACrD,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,0CAA0C,CAAC;YACvD,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;iBACvC,QAAQ,CAAC,0DAA0D,CAAC;SACxE;KACF,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE;QACvD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;QAChF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
import type { SessionState } from "../types.js";
|
|
3
|
-
export declare function stateFilePath(project: string, date: string): string;
|
|
4
|
-
export declare function readState(project: string, date: string): SessionState | null;
|
|
5
2
|
export declare function register(server: McpServer): void;
|
|
6
3
|
//# sourceMappingURL=journal-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journal-state.d.ts","sourceRoot":"","sources":["../../src/tools/journal-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"journal-state.d.ts","sourceRoot":"","sources":["../../src/tools/journal-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoBhD"}
|
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import { resolveProject } from "../storage/project.js";
|
|
5
|
-
import { journalDir } from "../storage/paths.js";
|
|
6
|
-
import { ensureDir, todayISO } from "../storage/fs-utils.js";
|
|
7
|
-
import { VERSION } from "../types.js";
|
|
8
|
-
export function stateFilePath(project, date) {
|
|
9
|
-
return path.join(journalDir(project), `${date}.state.json`);
|
|
10
|
-
}
|
|
11
|
-
export function readState(project, date) {
|
|
12
|
-
const fp = stateFilePath(project, date);
|
|
13
|
-
if (!fs.existsSync(fp))
|
|
14
|
-
return null;
|
|
15
|
-
try {
|
|
16
|
-
return JSON.parse(fs.readFileSync(fp, "utf-8"));
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
2
|
+
import { journalState } from "agent-recall-core";
|
|
22
3
|
export function register(server) {
|
|
23
4
|
server.registerTool("journal_state", {
|
|
24
5
|
title: "Read/Write Session State (JSON)",
|
|
@@ -32,80 +13,11 @@ export function register(server) {
|
|
|
32
13
|
project: z.string().default("auto"),
|
|
33
14
|
},
|
|
34
15
|
}, async ({ action, data, date, project }) => {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const dir = journalDir(slug);
|
|
39
|
-
if (fs.existsSync(dir)) {
|
|
40
|
-
const files = fs.readdirSync(dir)
|
|
41
|
-
.filter(f => f.endsWith(".state.json"))
|
|
42
|
-
.sort()
|
|
43
|
-
.reverse();
|
|
44
|
-
targetDate = files.length > 0 ? files[0].replace(".state.json", "") : todayISO();
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
targetDate = todayISO();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (action === "read") {
|
|
51
|
-
const state = readState(slug, targetDate);
|
|
52
|
-
return {
|
|
53
|
-
content: [{
|
|
54
|
-
type: "text",
|
|
55
|
-
text: JSON.stringify(state ?? { empty: true, date: targetDate, project: slug }),
|
|
56
|
-
}],
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
// Write: merge into existing state
|
|
60
|
-
const existing = readState(slug, todayISO()) ?? {
|
|
61
|
-
version: VERSION,
|
|
62
|
-
date: todayISO(),
|
|
63
|
-
project: slug,
|
|
64
|
-
timestamp: new Date().toISOString(),
|
|
65
|
-
completed: [],
|
|
66
|
-
failures: [],
|
|
67
|
-
state: {},
|
|
68
|
-
next_actions: [],
|
|
69
|
-
insights: [],
|
|
70
|
-
counts: {},
|
|
71
|
-
};
|
|
72
|
-
if (data) {
|
|
73
|
-
try {
|
|
74
|
-
const incoming = JSON.parse(data);
|
|
75
|
-
if (incoming.completed)
|
|
76
|
-
existing.completed.push(...incoming.completed);
|
|
77
|
-
if (incoming.failures)
|
|
78
|
-
existing.failures.push(...incoming.failures);
|
|
79
|
-
if (incoming.next_actions)
|
|
80
|
-
existing.next_actions = incoming.next_actions;
|
|
81
|
-
if (incoming.insights)
|
|
82
|
-
existing.insights.push(...incoming.insights);
|
|
83
|
-
if (incoming.state)
|
|
84
|
-
Object.assign(existing.state, incoming.state);
|
|
85
|
-
if (incoming.counts)
|
|
86
|
-
Object.assign(existing.counts, incoming.counts);
|
|
87
|
-
existing.timestamp = new Date().toISOString();
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
return {
|
|
91
|
-
content: [{ type: "text", text: JSON.stringify({ error: `Invalid JSON: ${e}` }) }],
|
|
92
|
-
isError: true,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
16
|
+
const result = await journalState({ action, data, date, project });
|
|
17
|
+
if ("error" in result) {
|
|
18
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }], isError: true };
|
|
95
19
|
}
|
|
96
|
-
|
|
97
|
-
ensureDir(path.dirname(fp));
|
|
98
|
-
fs.writeFileSync(fp, JSON.stringify(existing, null, 2), "utf-8");
|
|
99
|
-
return {
|
|
100
|
-
content: [{
|
|
101
|
-
type: "text",
|
|
102
|
-
text: JSON.stringify({ success: true, date: todayISO(), entries: {
|
|
103
|
-
completed: existing.completed.length,
|
|
104
|
-
failures: existing.failures.length,
|
|
105
|
-
insights: existing.insights.length,
|
|
106
|
-
} }),
|
|
107
|
-
}],
|
|
108
|
-
};
|
|
20
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
109
21
|
});
|
|
110
22
|
}
|
|
111
23
|
//# sourceMappingURL=journal-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journal-state.js","sourceRoot":"","sources":["../../src/tools/journal-state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"journal-state.js","sourceRoot":"","sources":["../../src/tools/journal-state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,UAAU,QAAQ,CAAC,MAAiB;IACxC,MAAM,CAAC,YAAY,CAAC,eAAe,EAAE;QACnC,KAAK,EAAE,iCAAiC;QACxC,WAAW,EACT,+EAA+E;YAC/E,oFAAoF;YACpF,iEAAiE;QACnE,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;YAC3F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;YACzF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;YACnE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;SACpC;KACF,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACnE,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;YACtB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC/F,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journal-write.d.ts","sourceRoot":"","sources":["../../src/tools/journal-write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"journal-write.d.ts","sourceRoot":"","sources":["../../src/tools/journal-write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4BhD"}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import { resolveProject } from "../storage/project.js";
|
|
5
|
-
import { journalDir } from "../storage/paths.js";
|
|
6
|
-
import { ensureDir, todayISO } from "../storage/fs-utils.js";
|
|
7
|
-
import { appendToSection } from "../helpers/sections.js";
|
|
8
|
-
import { updateIndex } from "../helpers/journal-files.js";
|
|
9
|
-
import { ensurePalaceInitialized, roomExists, createRoom } from "../palace/rooms.js";
|
|
10
|
-
import { fanOut } from "../palace/fan-out.js";
|
|
11
|
-
import { palaceDir } from "../storage/paths.js";
|
|
12
|
-
import { generateFrontmatter } from "../palace/obsidian.js";
|
|
13
|
-
import { updatePalaceIndex } from "../palace/index-manager.js";
|
|
2
|
+
import { journalWrite } from "agent-recall-core";
|
|
14
3
|
export function register(server) {
|
|
15
4
|
server.registerTool("journal_write", {
|
|
16
5
|
title: "Write Journal Entry",
|
|
@@ -33,56 +22,8 @@ export function register(server) {
|
|
|
33
22
|
.describe("Project slug. Defaults to auto-detect."),
|
|
34
23
|
},
|
|
35
24
|
}, async ({ content, section, palace_room, project }) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const dir = journalDir(slug);
|
|
39
|
-
ensureDir(dir);
|
|
40
|
-
const filePath = path.join(dir, `${date}.md`);
|
|
41
|
-
let existing = "";
|
|
42
|
-
if (fs.existsSync(filePath)) {
|
|
43
|
-
existing = fs.readFileSync(filePath, "utf-8");
|
|
44
|
-
}
|
|
45
|
-
else if (!section || section !== "replace_all") {
|
|
46
|
-
existing = `# ${date} — ${slug}\n`;
|
|
47
|
-
}
|
|
48
|
-
const sectionArg = section ?? null;
|
|
49
|
-
const updated = appendToSection(existing, content, sectionArg);
|
|
50
|
-
fs.writeFileSync(filePath, updated, "utf-8");
|
|
51
|
-
updateIndex(slug);
|
|
52
|
-
// Palace integration: also write to palace room if specified
|
|
53
|
-
let palaceResult = null;
|
|
54
|
-
if (palace_room) {
|
|
55
|
-
ensurePalaceInitialized(slug);
|
|
56
|
-
if (!roomExists(slug, palace_room)) {
|
|
57
|
-
createRoom(slug, palace_room, palace_room.charAt(0).toUpperCase() + palace_room.slice(1), `Auto-created from journal_write`, []);
|
|
58
|
-
}
|
|
59
|
-
const pd = palaceDir(slug);
|
|
60
|
-
const topicFile = section && section !== "replace_all" ? section : "journal";
|
|
61
|
-
const targetPath = path.join(pd, "rooms", palace_room, `${topicFile}.md`);
|
|
62
|
-
ensureDir(path.dirname(targetPath));
|
|
63
|
-
const timestamp = new Date().toISOString();
|
|
64
|
-
const entry = `\n### ${date} (from journal)\n\n${content}\n`;
|
|
65
|
-
if (fs.existsSync(targetPath)) {
|
|
66
|
-
fs.appendFileSync(targetPath, entry, "utf-8");
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
const fm = generateFrontmatter({ room: palace_room, topic: topicFile, created: timestamp, source: "journal_write" });
|
|
70
|
-
fs.writeFileSync(targetPath, `${fm}# ${palace_room} / ${topicFile}\n${entry}`, "utf-8");
|
|
71
|
-
}
|
|
72
|
-
const fanOutResult = fanOut(slug, palace_room, topicFile, content, [], "medium");
|
|
73
|
-
updatePalaceIndex(slug);
|
|
74
|
-
palaceResult = {
|
|
75
|
-
room: palace_room,
|
|
76
|
-
topic: topicFile,
|
|
77
|
-
fan_out: fanOutResult.updatedRooms,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
content: [{
|
|
82
|
-
type: "text",
|
|
83
|
-
text: JSON.stringify({ success: true, date, file: filePath, palace: palaceResult }),
|
|
84
|
-
}],
|
|
85
|
-
};
|
|
25
|
+
const result = await journalWrite({ content, section, palace_room, project });
|
|
26
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
86
27
|
});
|
|
87
28
|
}
|
|
88
29
|
//# sourceMappingURL=journal-write.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journal-write.js","sourceRoot":"","sources":["../../src/tools/journal-write.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"journal-write.js","sourceRoot":"","sources":["../../src/tools/journal-write.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,UAAU,QAAQ,CAAC,MAAiB;IACxC,MAAM,CAAC,YAAY,CAAC,eAAe,EAAE;QACnC,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACT,gFAAgF;YAChF,gFAAgF;QAClF,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;YACpE,OAAO,EAAE,CAAC;iBACP,IAAI,CAAC;gBACJ,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW;gBAClD,cAAc,EAAE,aAAa;aAC9B,CAAC;iBACD,QAAQ,EAAE;iBACV,QAAQ,CACP,2FAA2F,CAC5F;YACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;iBAC/B,QAAQ,CAAC,sFAAsF,CAAC;YACnG,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,OAAO,CAAC,MAAM,CAAC;iBACf,QAAQ,CAAC,wCAAwC,CAAC;SACtD;KACF,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE;QACtD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;QAC9E,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-read.d.ts","sourceRoot":"","sources":["../../src/tools/knowledge-read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"knowledge-read.d.ts","sourceRoot":"","sources":["../../src/tools/knowledge-read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkBhD"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import * as os from "node:os";
|
|
2
|
+
import { knowledgeRead } from "agent-recall-core";
|
|
5
3
|
export function register(server) {
|
|
6
4
|
server.registerTool("knowledge_read", {
|
|
7
5
|
title: "Read Knowledge Lessons",
|
|
@@ -16,103 +14,8 @@ export function register(server) {
|
|
|
16
14
|
query: z.string().optional().describe("Search term to filter lessons (case-insensitive)"),
|
|
17
15
|
},
|
|
18
16
|
}, async ({ project, category, query }) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
let projectDirs = [];
|
|
22
|
-
if (project) {
|
|
23
|
-
const safe = project.replace(/[^a-zA-Z0-9_\-\.]/g, "-");
|
|
24
|
-
const dir = path.join(projectsDir, safe, "knowledge");
|
|
25
|
-
if (fs.existsSync(dir)) {
|
|
26
|
-
projectDirs.push({ slug: safe, dir });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
if (fs.existsSync(projectsDir)) {
|
|
31
|
-
try {
|
|
32
|
-
const entries = fs.readdirSync(projectsDir);
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const dir = path.join(projectsDir, entry, "knowledge");
|
|
35
|
-
if (fs.existsSync(dir)) {
|
|
36
|
-
projectDirs.push({ slug: entry, dir });
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
// ignore
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (projectDirs.length === 0) {
|
|
46
|
-
return {
|
|
47
|
-
content: [{
|
|
48
|
-
type: "text",
|
|
49
|
-
text: "No knowledge entries found. Start logging lessons with knowledge_write.",
|
|
50
|
-
}],
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const categories = category
|
|
54
|
-
? [`${category}.md`]
|
|
55
|
-
: ["extraction.md", "build.md", "verification.md", "tools.md", "general.md"];
|
|
56
|
-
let combined = "";
|
|
57
|
-
for (const pd of projectDirs) {
|
|
58
|
-
for (const catFile of categories) {
|
|
59
|
-
const filePath = path.join(pd.dir, catFile);
|
|
60
|
-
if (!fs.existsSync(filePath))
|
|
61
|
-
continue;
|
|
62
|
-
const content = fs.readFileSync(filePath, "utf-8");
|
|
63
|
-
if (query) {
|
|
64
|
-
const queryLower = query.toLowerCase();
|
|
65
|
-
const lines = content.split("\n");
|
|
66
|
-
const matchedEntries = [];
|
|
67
|
-
let currentEntry = [];
|
|
68
|
-
for (const line of lines) {
|
|
69
|
-
if (line.startsWith("### ")) {
|
|
70
|
-
if (currentEntry.length > 0) {
|
|
71
|
-
const entryText = currentEntry.join("\n");
|
|
72
|
-
if (entryText.toLowerCase().includes(queryLower)) {
|
|
73
|
-
matchedEntries.push(entryText);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
currentEntry = [line];
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
currentEntry.push(line);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (currentEntry.length > 0) {
|
|
83
|
-
const entryText = currentEntry.join("\n");
|
|
84
|
-
if (entryText.toLowerCase().includes(queryLower)) {
|
|
85
|
-
matchedEntries.push(entryText);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (matchedEntries.length > 0) {
|
|
89
|
-
combined += `\n## ${pd.slug} / ${catFile.replace(".md", "")}\n\n`;
|
|
90
|
-
combined += matchedEntries.join("\n") + "\n";
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
combined += `\n## ${pd.slug} / ${catFile.replace(".md", "")}\n\n`;
|
|
95
|
-
combined += content + "\n";
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (!combined.trim()) {
|
|
100
|
-
return {
|
|
101
|
-
content: [{
|
|
102
|
-
type: "text",
|
|
103
|
-
text: "No knowledge entries found. Start logging lessons with knowledge_write.",
|
|
104
|
-
}],
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
if (combined.length > 5000) {
|
|
108
|
-
combined = combined.slice(0, 5000) + "\n\n...(truncated, narrow your query for more)";
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
content: [{
|
|
112
|
-
type: "text",
|
|
113
|
-
text: combined,
|
|
114
|
-
}],
|
|
115
|
-
};
|
|
17
|
+
const result = await knowledgeRead({ project, category, query });
|
|
18
|
+
return { content: [{ type: "text", text: result }] };
|
|
116
19
|
});
|
|
117
20
|
}
|
|
118
21
|
//# sourceMappingURL=knowledge-read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-read.js","sourceRoot":"","sources":["../../src/tools/knowledge-read.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"knowledge-read.js","sourceRoot":"","sources":["../../src/tools/knowledge-read.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,UAAU,QAAQ,CAAC,MAAiB;IACxC,MAAM,CAAC,YAAY,CAAC,gBAAgB,EAAE;QACpC,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,4FAA4F;YAC5F,oDAAoD;QACtD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;YACrF,QAAQ,EAAE,CAAC;iBACR,IAAI,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;iBACjE,QAAQ,EAAE;iBACV,QAAQ,CAAC,+CAA+C,CAAC;YAC5D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;SAC1F;KACF,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QACjE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-write.d.ts","sourceRoot":"","sources":["../../src/tools/knowledge-write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"knowledge-write.d.ts","sourceRoot":"","sources":["../../src/tools/knowledge-write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAuBhD"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import * as os from "node:os";
|
|
5
|
-
import { ensureDir, todayISO } from "../storage/fs-utils.js";
|
|
6
|
-
import { resolveProject } from "../storage/project.js";
|
|
7
|
-
import { palaceDir } from "../storage/paths.js";
|
|
8
|
-
import { ensurePalaceInitialized, roomExists, createRoom } from "../palace/rooms.js";
|
|
9
|
-
import { fanOut } from "../palace/fan-out.js";
|
|
10
|
-
import { updatePalaceIndex } from "../palace/index-manager.js";
|
|
2
|
+
import { knowledgeWrite } from "agent-recall-core";
|
|
11
3
|
export function register(server) {
|
|
12
4
|
server.registerTool("knowledge_write", {
|
|
13
5
|
title: "Write Knowledge Lesson",
|
|
@@ -27,63 +19,8 @@ export function register(server) {
|
|
|
27
19
|
.describe("Severity level of the lesson"),
|
|
28
20
|
},
|
|
29
21
|
}, async ({ project, category, title, what_happened, root_cause, fix, severity }) => {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const safeCategory = category.replace(/[^a-zA-Z0-9_\-]/g, "-").toLowerCase();
|
|
33
|
-
const date = todayISO();
|
|
34
|
-
let entry = `### ${title} (${slug}, ${date})\n`;
|
|
35
|
-
entry += `- **What happened:** ${what_happened}\n`;
|
|
36
|
-
entry += `- **Root cause:** ${root_cause}\n`;
|
|
37
|
-
entry += `- **Fix:** ${fix}\n`;
|
|
38
|
-
entry += `- **Severity:** ${severity}\n\n`;
|
|
39
|
-
// Legacy: write to knowledge/ dir
|
|
40
|
-
const baseDir = process.env.AGENT_RECALL_ROOT || path.join(os.homedir(), ".agent-recall");
|
|
41
|
-
const knowledgeDir = path.join(baseDir, "projects", safe, "knowledge");
|
|
42
|
-
ensureDir(knowledgeDir);
|
|
43
|
-
const legacyPath = path.join(knowledgeDir, `${safeCategory}.md`);
|
|
44
|
-
if (!fs.existsSync(legacyPath)) {
|
|
45
|
-
fs.writeFileSync(legacyPath, `# Knowledge — ${category}\n\n${entry}`, "utf-8");
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
fs.appendFileSync(legacyPath, entry, "utf-8");
|
|
49
|
-
}
|
|
50
|
-
// Palace: write to knowledge room
|
|
51
|
-
let palaceResult = null;
|
|
52
|
-
try {
|
|
53
|
-
ensurePalaceInitialized(slug);
|
|
54
|
-
if (!roomExists(slug, "knowledge")) {
|
|
55
|
-
createRoom(slug, "knowledge", "Knowledge", "Learned lessons by category", ["learning"]);
|
|
56
|
-
}
|
|
57
|
-
const pd = palaceDir(slug);
|
|
58
|
-
const topicPath = path.join(pd, "rooms", "knowledge", `${safeCategory}.md`);
|
|
59
|
-
ensureDir(path.dirname(topicPath));
|
|
60
|
-
if (!fs.existsSync(topicPath)) {
|
|
61
|
-
fs.writeFileSync(topicPath, `# knowledge / ${category}\n\n${entry}`, "utf-8");
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
fs.appendFileSync(topicPath, entry, "utf-8");
|
|
65
|
-
}
|
|
66
|
-
fanOut(slug, "knowledge", safeCategory, `${title}: ${what_happened}`, [], severity === "critical" ? "high" : "medium");
|
|
67
|
-
updatePalaceIndex(slug);
|
|
68
|
-
palaceResult = { room: "knowledge", topic: safeCategory };
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
// Palace integration is optional
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
content: [{
|
|
75
|
-
type: "text",
|
|
76
|
-
text: JSON.stringify({
|
|
77
|
-
success: true,
|
|
78
|
-
project: slug,
|
|
79
|
-
category: safeCategory,
|
|
80
|
-
title,
|
|
81
|
-
severity,
|
|
82
|
-
file: legacyPath,
|
|
83
|
-
palace: palaceResult,
|
|
84
|
-
}),
|
|
85
|
-
}],
|
|
86
|
-
};
|
|
22
|
+
const result = await knowledgeWrite({ project, category, title, what_happened, root_cause, fix, severity });
|
|
23
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
87
24
|
});
|
|
88
25
|
}
|
|
89
26
|
//# sourceMappingURL=knowledge-write.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-write.js","sourceRoot":"","sources":["../../src/tools/knowledge-write.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"knowledge-write.js","sourceRoot":"","sources":["../../src/tools/knowledge-write.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,UAAU,QAAQ,CAAC,MAAiB;IACxC,MAAM,CAAC,YAAY,CAAC,iBAAiB,EAAE;QACrC,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,0DAA0D;YAC1D,mFAAmF;YACnF,kEAAkE;QACpE,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YACxE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;YAC7G,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YACvD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YAC9D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAClD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YACjD,QAAQ,EAAE,CAAC;iBACR,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;iBACxC,OAAO,CAAC,WAAW,CAAC;iBACpB,QAAQ,CAAC,8BAA8B,CAAC;SAC5C;KACF,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;QAClF,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5G,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nudge.d.ts","sourceRoot":"","sources":["../../src/tools/nudge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"nudge.d.ts","sourceRoot":"","sources":["../../src/tools/nudge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgBhD"}
|
package/dist/tools/nudge.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import { resolveProject } from "../storage/project.js";
|
|
5
|
-
import { journalDir } from "../storage/paths.js";
|
|
6
|
-
import { ensureDir, todayISO } from "../storage/fs-utils.js";
|
|
2
|
+
import { nudge } from "agent-recall-core";
|
|
7
3
|
export function register(server) {
|
|
8
4
|
server.registerTool("nudge", {
|
|
9
5
|
title: "Nudge",
|
|
@@ -16,26 +12,8 @@ export function register(server) {
|
|
|
16
12
|
project: z.string().default("auto"),
|
|
17
13
|
},
|
|
18
14
|
}, async ({ past_statement, current_statement, question, category, project }) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const dir = journalDir(slug);
|
|
22
|
-
ensureDir(dir);
|
|
23
|
-
const time = new Date().toISOString().slice(11, 19);
|
|
24
|
-
let entry = `### Nudge (${time})\n`;
|
|
25
|
-
entry += `**Past**: ${past_statement}\n`;
|
|
26
|
-
entry += `**Now**: ${current_statement}\n`;
|
|
27
|
-
entry += `**Question**: ${question}\n`;
|
|
28
|
-
entry += `**Category**: ${category}\n\n`;
|
|
29
|
-
const logPath = path.join(dir, `${date}-alignment.md`);
|
|
30
|
-
if (!fs.existsSync(logPath)) {
|
|
31
|
-
fs.writeFileSync(logPath, `# ${date} — Alignment Records\n\n---\n\n${entry}`, "utf-8");
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
fs.appendFileSync(logPath, entry, "utf-8");
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
content: [{ type: "text", text: JSON.stringify({ success: true, date, category, file: logPath }) }],
|
|
38
|
-
};
|
|
15
|
+
const result = await nudge({ past_statement, current_statement, question, category, project });
|
|
16
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
39
17
|
});
|
|
40
18
|
}
|
|
41
19
|
//# sourceMappingURL=nudge.js.map
|
package/dist/tools/nudge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nudge.js","sourceRoot":"","sources":["../../src/tools/nudge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"nudge.js","sourceRoot":"","sources":["../../src/tools/nudge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,MAAM,UAAU,QAAQ,CAAC,MAAiB;IACxC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE;QAC3B,KAAK,EAAE,OAAO;QACd,WAAW,EACT,uIAAuI;QACzI,WAAW,EAAE;YACX,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;YAC9F,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;YACtE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;YAC/D,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;YACzF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;SACpC;KACF,EAAE,KAAK,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC9E,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAC/F,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Detects contradictions, stale memories, orphan rooms, missing cross-refs.
|
|
4
|
-
*/
|
|
5
|
-
import type { ServerType } from "../server.js";
|
|
6
|
-
export declare function register(server: ServerType): void;
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
export declare function register(server: McpServer): void;
|
|
7
3
|
//# sourceMappingURL=palace-lint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palace-lint.d.ts","sourceRoot":"","sources":["../../src/tools/palace-lint.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"palace-lint.d.ts","sourceRoot":"","sources":["../../src/tools/palace-lint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAchD"}
|