@medicine-wheel/mcp 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -0
- package/dist/jsonl-store.d.ts +184 -0
- package/dist/jsonl-store.d.ts.map +1 -0
- package/dist/jsonl-store.js +393 -0
- package/dist/jsonl-store.js.map +1 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +229 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +252 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/store.d.ts +15 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +16 -0
- package/dist/store.js.map +1 -0
- package/dist/tools/ceremony-lifecycle.d.ts +10 -0
- package/dist/tools/ceremony-lifecycle.d.ts.map +1 -0
- package/dist/tools/ceremony-lifecycle.js +275 -0
- package/dist/tools/ceremony-lifecycle.js.map +1 -0
- package/dist/tools/coordination.d.ts +10 -0
- package/dist/tools/coordination.d.ts.map +1 -0
- package/dist/tools/coordination.js +136 -0
- package/dist/tools/coordination.js.map +1 -0
- package/dist/tools/discovery.d.ts +11 -0
- package/dist/tools/discovery.d.ts.map +1 -0
- package/dist/tools/discovery.js +552 -0
- package/dist/tools/discovery.js.map +1 -0
- package/dist/tools/east.d.ts +3 -0
- package/dist/tools/east.d.ts.map +1 -0
- package/dist/tools/east.js +271 -0
- package/dist/tools/east.js.map +1 -0
- package/dist/tools/epistemic.d.ts +10 -0
- package/dist/tools/epistemic.d.ts.map +1 -0
- package/dist/tools/epistemic.js +159 -0
- package/dist/tools/epistemic.js.map +1 -0
- package/dist/tools/governance-transformation.d.ts +10 -0
- package/dist/tools/governance-transformation.d.ts.map +1 -0
- package/dist/tools/governance-transformation.js +181 -0
- package/dist/tools/governance-transformation.js.map +1 -0
- package/dist/tools/integrations.d.ts +9 -0
- package/dist/tools/integrations.d.ts.map +1 -0
- package/dist/tools/integrations.js +643 -0
- package/dist/tools/integrations.js.map +1 -0
- package/dist/tools/north.d.ts +3 -0
- package/dist/tools/north.d.ts.map +1 -0
- package/dist/tools/north.js +436 -0
- package/dist/tools/north.js.map +1 -0
- package/dist/tools/reasoning-observability.d.ts +10 -0
- package/dist/tools/reasoning-observability.d.ts.map +1 -0
- package/dist/tools/reasoning-observability.js +90 -0
- package/dist/tools/reasoning-observability.js.map +1 -0
- package/dist/tools/south.d.ts +3 -0
- package/dist/tools/south.d.ts.map +1 -0
- package/dist/tools/south.js +295 -0
- package/dist/tools/south.js.map +1 -0
- package/dist/tools/structural-tension.d.ts +15 -0
- package/dist/tools/structural-tension.d.ts.map +1 -0
- package/dist/tools/structural-tension.js +695 -0
- package/dist/tools/structural-tension.js.map +1 -0
- package/dist/tools/west.d.ts +3 -0
- package/dist/tools/west.d.ts.map +1 -0
- package/dist/tools/west.js +313 -0
- package/dist/tools/west.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/validators/index.d.ts +3 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/index.js +388 -0
- package/dist/validators/index.js.map +1 -0
- package/package.json +48 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSONL File-Based Persistence for Medicine Wheel MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Mirror of lib/jsonl-store.ts adapted for the MCP server process.
|
|
5
|
+
* Both the Web UI and MCP server read/write the same .mw/store/ JSONL files,
|
|
6
|
+
* enabling data created in either interface to be visible across both.
|
|
7
|
+
*
|
|
8
|
+
* Improvements over initial version (PR #27 Copilot review):
|
|
9
|
+
* - readJsonl() throws on real FS errors instead of silently returning []
|
|
10
|
+
* - EdgeCollection uses upsert keyed by from_id:to_id — no duplicate edges
|
|
11
|
+
* - flush() uses file lock + read-modify-write — concurrent writes merge
|
|
12
|
+
*
|
|
13
|
+
* @see https://github.com/jgwill/medicine-wheel/issues/26
|
|
14
|
+
*/
|
|
15
|
+
import * as fs from 'fs';
|
|
16
|
+
import * as path from 'path';
|
|
17
|
+
// ── File Lock ──
|
|
18
|
+
function withWriteLock(filePath, fn) {
|
|
19
|
+
const lockPath = filePath + '.lock';
|
|
20
|
+
let locked = false;
|
|
21
|
+
// Stale lock recovery: if a previous process crashed while holding the lock,
|
|
22
|
+
// the .lock file persists forever. Remove it if older than 30 seconds.
|
|
23
|
+
try {
|
|
24
|
+
const stat = fs.statSync(lockPath);
|
|
25
|
+
if (Date.now() - stat.mtimeMs > 30_000) {
|
|
26
|
+
console.error(`[jsonl-store] Removing stale lock: ${lockPath} (age: ${Math.round((Date.now() - stat.mtimeMs) / 1000)}s)`);
|
|
27
|
+
fs.unlinkSync(lockPath);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch { /* lock file doesn't exist — normal */ }
|
|
31
|
+
for (let attempt = 0; attempt < 20; attempt++) {
|
|
32
|
+
try {
|
|
33
|
+
const fd = fs.openSync(lockPath, 'wx'); // O_EXCL — atomic on POSIX
|
|
34
|
+
fs.closeSync(fd);
|
|
35
|
+
locked = true;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
const delayMs = Math.min(25 * (attempt + 1), 250);
|
|
40
|
+
const deadline = Date.now() + delayMs;
|
|
41
|
+
while (Date.now() < deadline) { /* spin */ }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (!locked) {
|
|
45
|
+
throw new Error(`[jsonl-store] Failed to acquire write lock after 20 attempts: ${lockPath}`);
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
return fn();
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
try {
|
|
52
|
+
fs.unlinkSync(lockPath);
|
|
53
|
+
}
|
|
54
|
+
catch { /* best effort */ }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// ── JSONL File Helpers ──
|
|
58
|
+
/**
|
|
59
|
+
* Read all records from a JSONL file.
|
|
60
|
+
* Returns [] if the file does not exist (normal for first run).
|
|
61
|
+
* Throws on permission errors or other real FS failures.
|
|
62
|
+
*/
|
|
63
|
+
function readJsonl(filePath) {
|
|
64
|
+
if (!fs.existsSync(filePath))
|
|
65
|
+
return [];
|
|
66
|
+
let content;
|
|
67
|
+
try {
|
|
68
|
+
content = fs.readFileSync(filePath, 'utf-8');
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
72
|
+
throw new Error(`Failed to read JSONL store at ${filePath}: ${message}`);
|
|
73
|
+
}
|
|
74
|
+
const records = [];
|
|
75
|
+
for (const line of content.split('\n')) {
|
|
76
|
+
const trimmed = line.trim();
|
|
77
|
+
if (!trimmed)
|
|
78
|
+
continue;
|
|
79
|
+
try {
|
|
80
|
+
records.push(JSON.parse(trimmed));
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
84
|
+
console.error(`[mcp/jsonl-store] Skipping malformed line in ${filePath}: ${message}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return records;
|
|
88
|
+
}
|
|
89
|
+
/** Write records atomically (temp + rename). Must be called inside withWriteLock(). */
|
|
90
|
+
function writeJsonl(filePath, records) {
|
|
91
|
+
const dir = path.dirname(filePath);
|
|
92
|
+
if (!fs.existsSync(dir)) {
|
|
93
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
94
|
+
}
|
|
95
|
+
const tmpPath = `${filePath}.tmp.${process.pid}`;
|
|
96
|
+
const content = records.map(r => JSON.stringify(r)).join('\n') + (records.length > 0 ? '\n' : '');
|
|
97
|
+
fs.writeFileSync(tmpPath, content, 'utf-8');
|
|
98
|
+
fs.renameSync(tmpPath, filePath);
|
|
99
|
+
}
|
|
100
|
+
function getMtime(filePath) {
|
|
101
|
+
try {
|
|
102
|
+
return fs.statSync(filePath).mtimeMs;
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// ── JsonlCollection<T> ──
|
|
109
|
+
class JsonlCollection {
|
|
110
|
+
items = new Map();
|
|
111
|
+
filePath;
|
|
112
|
+
lastMtime = 0;
|
|
113
|
+
loaded = false;
|
|
114
|
+
constructor(filePath) {
|
|
115
|
+
this.filePath = filePath;
|
|
116
|
+
}
|
|
117
|
+
sync() {
|
|
118
|
+
const currentMtime = getMtime(this.filePath);
|
|
119
|
+
if (!this.loaded || currentMtime !== this.lastMtime) {
|
|
120
|
+
const records = readJsonl(this.filePath);
|
|
121
|
+
this.items = new Map();
|
|
122
|
+
for (const record of records) {
|
|
123
|
+
const id = record.id;
|
|
124
|
+
if (id)
|
|
125
|
+
this.items.set(id, record);
|
|
126
|
+
}
|
|
127
|
+
this.lastMtime = currentMtime;
|
|
128
|
+
this.loaded = true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Read-modify-write inside a file lock so concurrent writers merge
|
|
133
|
+
* instead of clobbering each other.
|
|
134
|
+
*/
|
|
135
|
+
flush() {
|
|
136
|
+
withWriteLock(this.filePath, () => {
|
|
137
|
+
const diskRecords = readJsonl(this.filePath);
|
|
138
|
+
const merged = new Map();
|
|
139
|
+
for (const r of diskRecords) {
|
|
140
|
+
const id = r.id;
|
|
141
|
+
if (id)
|
|
142
|
+
merged.set(id, r);
|
|
143
|
+
}
|
|
144
|
+
for (const [id, item] of this.items) {
|
|
145
|
+
merged.set(id, item);
|
|
146
|
+
}
|
|
147
|
+
writeJsonl(this.filePath, Array.from(merged.values()));
|
|
148
|
+
this.items = merged;
|
|
149
|
+
this.lastMtime = getMtime(this.filePath);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
get(id) { this.sync(); return this.items.get(id); }
|
|
153
|
+
getAll() { this.sync(); return Array.from(this.items.values()); }
|
|
154
|
+
has(id) { this.sync(); return this.items.has(id); }
|
|
155
|
+
size() { this.sync(); return this.items.size; }
|
|
156
|
+
set(id, item) {
|
|
157
|
+
this.sync();
|
|
158
|
+
this.items.set(id, item);
|
|
159
|
+
this.flush();
|
|
160
|
+
}
|
|
161
|
+
filter(predicate) {
|
|
162
|
+
this.sync();
|
|
163
|
+
return Array.from(this.items.values()).filter(predicate);
|
|
164
|
+
}
|
|
165
|
+
search(query, fields) {
|
|
166
|
+
this.sync();
|
|
167
|
+
const q = query.toLowerCase();
|
|
168
|
+
return Array.from(this.items.values()).filter(item => fields.some(f => {
|
|
169
|
+
const val = item[f];
|
|
170
|
+
return typeof val === 'string' && val.toLowerCase().includes(q);
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// ── EdgeCollection ──
|
|
175
|
+
// Keyed by `${from_id}:${to_id}` — upsert semantics, no duplicates.
|
|
176
|
+
class EdgeCollection {
|
|
177
|
+
items = new Map();
|
|
178
|
+
filePath;
|
|
179
|
+
lastMtime = 0;
|
|
180
|
+
loaded = false;
|
|
181
|
+
constructor(filePath) {
|
|
182
|
+
this.filePath = filePath;
|
|
183
|
+
}
|
|
184
|
+
edgeKey(edge) {
|
|
185
|
+
return edge.id || `${edge.from_id}:${edge.to_id}`;
|
|
186
|
+
}
|
|
187
|
+
sync() {
|
|
188
|
+
const currentMtime = getMtime(this.filePath);
|
|
189
|
+
if (!this.loaded || currentMtime !== this.lastMtime) {
|
|
190
|
+
const records = readJsonl(this.filePath);
|
|
191
|
+
this.items = new Map();
|
|
192
|
+
for (const r of records)
|
|
193
|
+
this.items.set(this.edgeKey(r), r);
|
|
194
|
+
this.lastMtime = currentMtime;
|
|
195
|
+
this.loaded = true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
flush() {
|
|
199
|
+
withWriteLock(this.filePath, () => {
|
|
200
|
+
const diskRecords = readJsonl(this.filePath);
|
|
201
|
+
const merged = new Map();
|
|
202
|
+
for (const r of diskRecords)
|
|
203
|
+
merged.set(this.edgeKey(r), r);
|
|
204
|
+
for (const [key, edge] of this.items)
|
|
205
|
+
merged.set(key, edge);
|
|
206
|
+
writeJsonl(this.filePath, Array.from(merged.values()));
|
|
207
|
+
this.items = merged;
|
|
208
|
+
this.lastMtime = getMtime(this.filePath);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/** Upsert: replaces any existing edge with the same endpoints. */
|
|
212
|
+
add(edge) {
|
|
213
|
+
this.sync();
|
|
214
|
+
this.items.set(this.edgeKey(edge), edge);
|
|
215
|
+
this.flush();
|
|
216
|
+
}
|
|
217
|
+
getAll() { this.sync(); return Array.from(this.items.values()); }
|
|
218
|
+
getForNode(nodeId) {
|
|
219
|
+
this.sync();
|
|
220
|
+
return Array.from(this.items.values()).filter(e => e.from_id === nodeId || e.to_id === nodeId);
|
|
221
|
+
}
|
|
222
|
+
getRelatedNodeIds(nodeId) {
|
|
223
|
+
this.sync();
|
|
224
|
+
const ids = new Set();
|
|
225
|
+
for (const e of this.items.values()) {
|
|
226
|
+
if (e.from_id === nodeId)
|
|
227
|
+
ids.add(e.to_id);
|
|
228
|
+
if (e.to_id === nodeId)
|
|
229
|
+
ids.add(e.from_id);
|
|
230
|
+
}
|
|
231
|
+
return Array.from(ids);
|
|
232
|
+
}
|
|
233
|
+
updateCeremony(fromId, toId, ceremonyId) {
|
|
234
|
+
this.sync();
|
|
235
|
+
for (const [key, edge] of this.items) {
|
|
236
|
+
if ((edge.from_id === fromId && edge.to_id === toId) ||
|
|
237
|
+
(edge.from_id === toId && edge.to_id === fromId)) {
|
|
238
|
+
this.items.set(key, { ...edge, ceremony_honored: true, ceremony_id: ceremonyId });
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
this.flush();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
// ── JsonlStore ──
|
|
245
|
+
export class JsonlStore {
|
|
246
|
+
dataDir;
|
|
247
|
+
nodes;
|
|
248
|
+
edges;
|
|
249
|
+
ceremonies;
|
|
250
|
+
beats;
|
|
251
|
+
cycles;
|
|
252
|
+
charts;
|
|
253
|
+
mmots;
|
|
254
|
+
constructor(dataDir) {
|
|
255
|
+
this.dataDir = dataDir || process.env.MW_DATA_DIR || resolveProjectDataDir();
|
|
256
|
+
if (!fs.existsSync(this.dataDir)) {
|
|
257
|
+
fs.mkdirSync(this.dataDir, { recursive: true });
|
|
258
|
+
}
|
|
259
|
+
this.nodes = new JsonlCollection(path.join(this.dataDir, 'nodes.jsonl'));
|
|
260
|
+
this.edges = new EdgeCollection(path.join(this.dataDir, 'edges.jsonl'));
|
|
261
|
+
this.ceremonies = new JsonlCollection(path.join(this.dataDir, 'ceremonies.jsonl'));
|
|
262
|
+
this.beats = new JsonlCollection(path.join(this.dataDir, 'beats.jsonl'));
|
|
263
|
+
this.cycles = new JsonlCollection(path.join(this.dataDir, 'cycles.jsonl'));
|
|
264
|
+
this.charts = new JsonlCollection(path.join(this.dataDir, 'charts.jsonl'));
|
|
265
|
+
this.mmots = new JsonlCollection(path.join(this.dataDir, 'mmots.jsonl'));
|
|
266
|
+
}
|
|
267
|
+
// === Nodes ===
|
|
268
|
+
createNode(node) { this.nodes.set(node.id, node); }
|
|
269
|
+
getNode(id) { return this.nodes.get(id); }
|
|
270
|
+
getAllNodes(limit) {
|
|
271
|
+
const all = this.nodes.getAll();
|
|
272
|
+
return limit !== undefined ? all.slice(0, limit) : all;
|
|
273
|
+
}
|
|
274
|
+
getNodesByType(type) { return this.nodes.filter(n => n.type === type); }
|
|
275
|
+
getNodesByDirection(direction) { return this.nodes.filter(n => n.direction === direction); }
|
|
276
|
+
searchNodes(query, opts = {}) {
|
|
277
|
+
let results = this.nodes.search(query, ['name', 'description']);
|
|
278
|
+
if (opts.type)
|
|
279
|
+
results = results.filter(n => n.type === opts.type);
|
|
280
|
+
if (opts.direction)
|
|
281
|
+
results = results.filter(n => n.direction === opts.direction);
|
|
282
|
+
return opts.limit !== undefined ? results.slice(0, opts.limit) : results;
|
|
283
|
+
}
|
|
284
|
+
// === Edges ===
|
|
285
|
+
createEdge(edge) { this.edges.add(edge); }
|
|
286
|
+
getEdgesForNode(nodeId) { return this.edges.getForNode(nodeId); }
|
|
287
|
+
getRelatedNodeIds(nodeId) { return this.edges.getRelatedNodeIds(nodeId); }
|
|
288
|
+
updateEdgeCeremony(fromId, toId, ceremonyId) {
|
|
289
|
+
this.edges.updateCeremony(fromId, toId, ceremonyId);
|
|
290
|
+
}
|
|
291
|
+
getRelationalWeb(nodeId, depth = 2) {
|
|
292
|
+
const visited = new Set();
|
|
293
|
+
const resultNodes = [];
|
|
294
|
+
const resultEdges = [];
|
|
295
|
+
const queue = [{ id: nodeId, d: 0 }];
|
|
296
|
+
while (queue.length > 0) {
|
|
297
|
+
const { id, d } = queue.shift();
|
|
298
|
+
if (visited.has(id) || d > depth)
|
|
299
|
+
continue;
|
|
300
|
+
visited.add(id);
|
|
301
|
+
const node = this.nodes.get(id);
|
|
302
|
+
if (node)
|
|
303
|
+
resultNodes.push(node);
|
|
304
|
+
for (const edge of this.edges.getForNode(id)) {
|
|
305
|
+
if (!resultEdges.includes(edge))
|
|
306
|
+
resultEdges.push(edge);
|
|
307
|
+
const otherId = edge.from_id === id ? edge.to_id : edge.from_id;
|
|
308
|
+
if (!visited.has(otherId))
|
|
309
|
+
queue.push({ id: otherId, d: d + 1 });
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return { nodes: resultNodes, edges: resultEdges };
|
|
313
|
+
}
|
|
314
|
+
// === Ceremonies ===
|
|
315
|
+
logCeremony(ceremony) { this.ceremonies.set(ceremony.id, ceremony); }
|
|
316
|
+
getCeremony(id) { return this.ceremonies.get(id); }
|
|
317
|
+
getAllCeremonies(limit) {
|
|
318
|
+
const sorted = this.ceremonies.getAll()
|
|
319
|
+
.sort((a, b) => Date.parse(b.timestamp) - Date.parse(a.timestamp));
|
|
320
|
+
return limit !== undefined ? sorted.slice(0, limit) : sorted;
|
|
321
|
+
}
|
|
322
|
+
getCeremoniesByDirection(direction) { return this.ceremonies.filter(c => c.direction === direction); }
|
|
323
|
+
getCeremoniesByType(type) { return this.ceremonies.filter(c => c.type === type); }
|
|
324
|
+
// === Beats ===
|
|
325
|
+
createBeat(beat) { this.beats.set(beat.id, beat); }
|
|
326
|
+
getBeat(id) { return this.beats.get(id); }
|
|
327
|
+
getAllBeats(limit) {
|
|
328
|
+
const all = this.beats.getAll();
|
|
329
|
+
return limit !== undefined ? all.slice(0, limit) : all;
|
|
330
|
+
}
|
|
331
|
+
getBeatsByDirection(direction) { return this.beats.filter(b => b.direction === direction); }
|
|
332
|
+
// === Cycles ===
|
|
333
|
+
createCycle(cycle) { this.cycles.set(cycle.id, cycle); }
|
|
334
|
+
getCycle(id) { return this.cycles.get(id); }
|
|
335
|
+
getAllCycles() {
|
|
336
|
+
const all = this.cycles.getAll();
|
|
337
|
+
return { active: all.filter(c => !c.archived), archived: all.filter(c => c.archived) };
|
|
338
|
+
}
|
|
339
|
+
archiveCycle(id) {
|
|
340
|
+
const cycle = this.cycles.get(id);
|
|
341
|
+
if (cycle)
|
|
342
|
+
this.cycles.set(id, { ...cycle, archived: true });
|
|
343
|
+
}
|
|
344
|
+
// === Charts ===
|
|
345
|
+
saveChart(chart) { this.charts.set(chart.id, chart); }
|
|
346
|
+
getChart(id) { return this.charts.get(id); }
|
|
347
|
+
getAllCharts(direction) {
|
|
348
|
+
let charts = this.charts.getAll();
|
|
349
|
+
if (direction)
|
|
350
|
+
charts = charts.filter(c => c.direction === direction);
|
|
351
|
+
return charts.sort((a, b) => Date.parse(b.updated_at) - Date.parse(a.updated_at));
|
|
352
|
+
}
|
|
353
|
+
// === MMOT ===
|
|
354
|
+
saveMmot(mmot) { this.mmots.set(mmot.id, mmot); }
|
|
355
|
+
getMmotsByChart(chartId) { return this.mmots.filter(m => m.chart_id === chartId); }
|
|
356
|
+
}
|
|
357
|
+
// ── Path Resolution ──
|
|
358
|
+
function resolveProjectDataDir() {
|
|
359
|
+
if (process.env.MW_DATA_DIR)
|
|
360
|
+
return process.env.MW_DATA_DIR;
|
|
361
|
+
const cwd = process.cwd();
|
|
362
|
+
if (cwd.endsWith('/mcp') || cwd.endsWith('\\mcp')) {
|
|
363
|
+
return path.join(path.dirname(cwd), '.mw', 'store');
|
|
364
|
+
}
|
|
365
|
+
// Walk up to find the medicine-wheel project root
|
|
366
|
+
let dir = cwd;
|
|
367
|
+
for (let i = 0; i < 5; i++) {
|
|
368
|
+
const pkgPath = path.join(dir, 'package.json');
|
|
369
|
+
if (fs.existsSync(pkgPath)) {
|
|
370
|
+
try {
|
|
371
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
372
|
+
if (pkg.name === 'medicine-wheel')
|
|
373
|
+
return path.join(dir, '.mw', 'store');
|
|
374
|
+
}
|
|
375
|
+
catch { /* continue */ }
|
|
376
|
+
}
|
|
377
|
+
const parent = path.dirname(dir);
|
|
378
|
+
if (parent === dir)
|
|
379
|
+
break;
|
|
380
|
+
dir = parent;
|
|
381
|
+
}
|
|
382
|
+
return path.join(cwd, '.mw', 'store');
|
|
383
|
+
}
|
|
384
|
+
// ── Singleton ──
|
|
385
|
+
let _instance = null;
|
|
386
|
+
export function getJsonlStore(dataDir) {
|
|
387
|
+
if (!_instance) {
|
|
388
|
+
_instance = new JsonlStore(dataDir);
|
|
389
|
+
console.error(`📂 Medicine Wheel JSONL store: ${_instance.dataDir}`);
|
|
390
|
+
}
|
|
391
|
+
return _instance;
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=jsonl-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl-store.js","sourceRoot":"","sources":["../src/jsonl-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;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AC"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
export const prompts = [
|
|
2
|
+
{
|
|
3
|
+
name: "direction_inquiry",
|
|
4
|
+
description: "Invoke a specific medicine wheel direction for research guidance",
|
|
5
|
+
arguments: [
|
|
6
|
+
{
|
|
7
|
+
name: "direction",
|
|
8
|
+
description: "Which direction to invoke (east, south, west, north)",
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: "research_context",
|
|
13
|
+
description: "Brief context about your research",
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
handler: async (args) => {
|
|
18
|
+
const { direction = "east", research_context = "" } = args;
|
|
19
|
+
const prompts = {
|
|
20
|
+
east: {
|
|
21
|
+
role: "user",
|
|
22
|
+
content: {
|
|
23
|
+
type: "text",
|
|
24
|
+
text: `You are beginning research within an Indigenous paradigm. Invoke the EAST direction (Waabinong - Spring - Yellow - Tobacco) for guidance.
|
|
25
|
+
|
|
26
|
+
Research Context: ${research_context}
|
|
27
|
+
|
|
28
|
+
Call the east_vision_inquiry tool to:
|
|
29
|
+
1. Map relational obligations (human, land, spirit, ancestors, future)
|
|
30
|
+
2. Receive ceremony guidance for opening
|
|
31
|
+
3. Identify Elder co-investigators and community advisory board
|
|
32
|
+
4. Plan tobacco offerings and gratitude practices
|
|
33
|
+
|
|
34
|
+
Remember: Research is ceremony. This is a sacred beginning.`,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
south: {
|
|
38
|
+
role: "user",
|
|
39
|
+
content: {
|
|
40
|
+
type: "text",
|
|
41
|
+
text: `You are in the growth phase of research. Invoke the SOUTH direction (Zhaawanong - Summer - Red - Cedar) for embodiment guidance.
|
|
42
|
+
|
|
43
|
+
Research Context: ${research_context}
|
|
44
|
+
|
|
45
|
+
Call the south_growth_practice tool to:
|
|
46
|
+
1. Design land-based data collection
|
|
47
|
+
2. Create youth mentorship protocols
|
|
48
|
+
3. Integrate cedar medicine for cleansing and renewal
|
|
49
|
+
4. Honor embodied ways of knowing
|
|
50
|
+
|
|
51
|
+
Remember: Knowledge lives in body, land, and spirit - not just mind.`,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
west: {
|
|
55
|
+
role: "user",
|
|
56
|
+
content: {
|
|
57
|
+
type: "text",
|
|
58
|
+
text: `You are in the reflection phase. Invoke the WEST direction (Epangishmok - Fall - Black - Sage & Strawberry) for emotional processing and truth-speaking.
|
|
59
|
+
|
|
60
|
+
Research Context: ${research_context}
|
|
61
|
+
|
|
62
|
+
Call the west_reflection_ceremony tool to:
|
|
63
|
+
1. Design talking circles for collective reflection
|
|
64
|
+
2. Process difficult emotions (trauma, grief, anger, shame)
|
|
65
|
+
3. Apply strawberry teaching for forgiveness
|
|
66
|
+
4. Integrate sage for mental/emotional cleansing
|
|
67
|
+
|
|
68
|
+
Remember: Heart (not head) leads to peace. Death is transformation, not ending.`,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
north: {
|
|
72
|
+
role: "user",
|
|
73
|
+
content: {
|
|
74
|
+
type: "text",
|
|
75
|
+
text: `You are ready for wisdom synthesis and closing. Invoke the NORTH direction (Kiiwedinong - Winter - White - Cedar & Stories) for Elder guidance.
|
|
76
|
+
|
|
77
|
+
Research Context: ${research_context}
|
|
78
|
+
|
|
79
|
+
Call the north_wisdom_synthesis tool to:
|
|
80
|
+
1. Integrate learnings from all four directions
|
|
81
|
+
2. Convene Elder council for validation
|
|
82
|
+
3. Plan spirit feeding ceremony for ancestors
|
|
83
|
+
4. Archive stories with community ownership (OCAP®)
|
|
84
|
+
|
|
85
|
+
Remember: Wisdom serves seven generations. Feed the ancestors; they are hungry for connection.`,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
return [prompts[direction.toLowerCase()] || prompts.east];
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "accountability_audit",
|
|
94
|
+
description: "Comprehensive relational accountability audit for research plans",
|
|
95
|
+
arguments: [
|
|
96
|
+
{
|
|
97
|
+
name: "research_plan",
|
|
98
|
+
description: "Your research plan (as JSON object or description)",
|
|
99
|
+
required: true,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
handler: async (args) => {
|
|
103
|
+
return [
|
|
104
|
+
{
|
|
105
|
+
role: "user",
|
|
106
|
+
content: {
|
|
107
|
+
type: "text",
|
|
108
|
+
text: `Conduct a comprehensive relational accountability audit using Indigenous paradigm validators.
|
|
109
|
+
|
|
110
|
+
Research Plan: ${JSON.stringify(args.research_plan, null, 2)}
|
|
111
|
+
|
|
112
|
+
Please call these tools in sequence:
|
|
113
|
+
1. accountability_validator - Check Wilson's paradigm alignment
|
|
114
|
+
2. ocap_compliance_checker - Verify data sovereignty
|
|
115
|
+
3. wilson_paradigm_checker - Assess ontology/epistemology/axiology
|
|
116
|
+
|
|
117
|
+
After audits, synthesize findings and recommend next steps. Be honest about gaps - this serves community protection.`,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "research_planning",
|
|
125
|
+
description: "Plan Indigenous paradigm research from beginning to end",
|
|
126
|
+
arguments: [
|
|
127
|
+
{
|
|
128
|
+
name: "research_question",
|
|
129
|
+
description: "Your research question or topic",
|
|
130
|
+
required: true,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "community",
|
|
134
|
+
description: "Community or territory involved",
|
|
135
|
+
required: true,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
handler: async (args) => {
|
|
139
|
+
const { research_question, community } = args;
|
|
140
|
+
return [
|
|
141
|
+
{
|
|
142
|
+
role: "user",
|
|
143
|
+
content: {
|
|
144
|
+
type: "text",
|
|
145
|
+
text: `Plan Indigenous paradigm research that honors the Medicine Wheel's four directions.
|
|
146
|
+
|
|
147
|
+
Research Question: ${research_question}
|
|
148
|
+
Community: ${community}
|
|
149
|
+
|
|
150
|
+
Phase 1 - EAST (Pre-Research: Months 1-3)
|
|
151
|
+
Call east_vision_inquiry and east_new_relation_mapper to:
|
|
152
|
+
- Identify all relational obligations
|
|
153
|
+
- Plan opening ceremonies (tobacco, smudging)
|
|
154
|
+
- Recruit Elder co-investigators
|
|
155
|
+
- Form community advisory board
|
|
156
|
+
- Establish OCAP® data governance agreement
|
|
157
|
+
|
|
158
|
+
Phase 2 - SOUTH (Data Collection: Months 4-6)
|
|
159
|
+
Call south_growth_practice and south_embodied_data_collection to:
|
|
160
|
+
- Design land-based methods
|
|
161
|
+
- Create youth engagement protocols
|
|
162
|
+
- Integrate cedar medicine
|
|
163
|
+
- Document through embodied participation
|
|
164
|
+
|
|
165
|
+
Phase 3 - WEST (Reflection: Months 7-9)
|
|
166
|
+
Call west_reflection_ceremony and west_emotional_processing to:
|
|
167
|
+
- Hold talking circles
|
|
168
|
+
- Process emotions (trauma, grief, etc.)
|
|
169
|
+
- Apply forgiveness frameworks
|
|
170
|
+
- Synthesize themes from heart
|
|
171
|
+
|
|
172
|
+
Phase 4 - NORTH (Wisdom & Closing: Months 10-12)
|
|
173
|
+
Call north_wisdom_synthesis and north_story_archiving to:
|
|
174
|
+
- Convene Elder council for validation
|
|
175
|
+
- Spirit feeding ceremony
|
|
176
|
+
- Archive stories (OCAP®)
|
|
177
|
+
- Deliver reciprocal benefits to community
|
|
178
|
+
|
|
179
|
+
Throughout: Regular accountability audits to ensure relational integrity.
|
|
180
|
+
|
|
181
|
+
All my relations. 🌿`,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
];
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "ceremony_invocation",
|
|
189
|
+
description: "Guidance for conducting specific ceremonies",
|
|
190
|
+
arguments: [
|
|
191
|
+
{
|
|
192
|
+
name: "ceremony_type",
|
|
193
|
+
description: "Type of ceremony (smudging, talking_circle, spirit_feeding, etc.)",
|
|
194
|
+
required: true,
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
handler: async (args) => {
|
|
198
|
+
const { ceremony_type } = args;
|
|
199
|
+
const ceremonies = {
|
|
200
|
+
smudging: "Call east_spirit_invocation for smudging protocols with tobacco, sage, or cedar",
|
|
201
|
+
talking_circle: "Call west_reflection_ceremony with ceremony_format='talking_circle' for protocols",
|
|
202
|
+
spirit_feeding: "Call north_spirit_feeding_ceremony for ancestor honoring protocols",
|
|
203
|
+
opening: "Call east_spirit_invocation with ceremony_type='research_opening'",
|
|
204
|
+
closing: "Call north_elder_council_invocation with purpose='ceremonial_closing'",
|
|
205
|
+
};
|
|
206
|
+
return [
|
|
207
|
+
{
|
|
208
|
+
role: "user",
|
|
209
|
+
content: {
|
|
210
|
+
type: "text",
|
|
211
|
+
text: `Ceremony Guidance Request: ${ceremony_type}
|
|
212
|
+
|
|
213
|
+
${ceremonies[ceremony_type.toLowerCase()] || "Consult with Elders for specific ceremony protocols"}
|
|
214
|
+
|
|
215
|
+
Remember:
|
|
216
|
+
- Elder guidance is essential
|
|
217
|
+
- Proper medicines and offerings required
|
|
218
|
+
- Sacred space must be prepared
|
|
219
|
+
- Participants informed of protocols
|
|
220
|
+
- Ceremony is not performance; it is sacred relationship
|
|
221
|
+
|
|
222
|
+
Research is ceremony. Approach with humility and respect.`,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
];
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
];
|
|
229
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAa;IAC/B;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,kEAAkE;QAC/E,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,sDAAsD;gBACnE,QAAQ,EAAE,I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