@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.
Files changed (78) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +115 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/jsonl-store.d.ts +184 -0
  6. package/dist/jsonl-store.d.ts.map +1 -0
  7. package/dist/jsonl-store.js +393 -0
  8. package/dist/jsonl-store.js.map +1 -0
  9. package/dist/prompts/index.d.ts +3 -0
  10. package/dist/prompts/index.d.ts.map +1 -0
  11. package/dist/prompts/index.js +229 -0
  12. package/dist/prompts/index.js.map +1 -0
  13. package/dist/resources/index.d.ts +3 -0
  14. package/dist/resources/index.d.ts.map +1 -0
  15. package/dist/resources/index.js +252 -0
  16. package/dist/resources/index.js.map +1 -0
  17. package/dist/store.d.ts +15 -0
  18. package/dist/store.d.ts.map +1 -0
  19. package/dist/store.js +16 -0
  20. package/dist/store.js.map +1 -0
  21. package/dist/tools/ceremony-lifecycle.d.ts +10 -0
  22. package/dist/tools/ceremony-lifecycle.d.ts.map +1 -0
  23. package/dist/tools/ceremony-lifecycle.js +275 -0
  24. package/dist/tools/ceremony-lifecycle.js.map +1 -0
  25. package/dist/tools/coordination.d.ts +10 -0
  26. package/dist/tools/coordination.d.ts.map +1 -0
  27. package/dist/tools/coordination.js +136 -0
  28. package/dist/tools/coordination.js.map +1 -0
  29. package/dist/tools/discovery.d.ts +11 -0
  30. package/dist/tools/discovery.d.ts.map +1 -0
  31. package/dist/tools/discovery.js +552 -0
  32. package/dist/tools/discovery.js.map +1 -0
  33. package/dist/tools/east.d.ts +3 -0
  34. package/dist/tools/east.d.ts.map +1 -0
  35. package/dist/tools/east.js +271 -0
  36. package/dist/tools/east.js.map +1 -0
  37. package/dist/tools/epistemic.d.ts +10 -0
  38. package/dist/tools/epistemic.d.ts.map +1 -0
  39. package/dist/tools/epistemic.js +159 -0
  40. package/dist/tools/epistemic.js.map +1 -0
  41. package/dist/tools/governance-transformation.d.ts +10 -0
  42. package/dist/tools/governance-transformation.d.ts.map +1 -0
  43. package/dist/tools/governance-transformation.js +181 -0
  44. package/dist/tools/governance-transformation.js.map +1 -0
  45. package/dist/tools/integrations.d.ts +9 -0
  46. package/dist/tools/integrations.d.ts.map +1 -0
  47. package/dist/tools/integrations.js +643 -0
  48. package/dist/tools/integrations.js.map +1 -0
  49. package/dist/tools/north.d.ts +3 -0
  50. package/dist/tools/north.d.ts.map +1 -0
  51. package/dist/tools/north.js +436 -0
  52. package/dist/tools/north.js.map +1 -0
  53. package/dist/tools/reasoning-observability.d.ts +10 -0
  54. package/dist/tools/reasoning-observability.d.ts.map +1 -0
  55. package/dist/tools/reasoning-observability.js +90 -0
  56. package/dist/tools/reasoning-observability.js.map +1 -0
  57. package/dist/tools/south.d.ts +3 -0
  58. package/dist/tools/south.d.ts.map +1 -0
  59. package/dist/tools/south.js +295 -0
  60. package/dist/tools/south.js.map +1 -0
  61. package/dist/tools/structural-tension.d.ts +15 -0
  62. package/dist/tools/structural-tension.d.ts.map +1 -0
  63. package/dist/tools/structural-tension.js +695 -0
  64. package/dist/tools/structural-tension.js.map +1 -0
  65. package/dist/tools/west.d.ts +3 -0
  66. package/dist/tools/west.d.ts.map +1 -0
  67. package/dist/tools/west.js +313 -0
  68. package/dist/tools/west.js.map +1 -0
  69. package/dist/types.d.ts +28 -0
  70. package/dist/types.d.ts.map +1 -0
  71. package/dist/types.js +9 -0
  72. package/dist/types.js.map +1 -0
  73. package/dist/validators/index.d.ts +3 -0
  74. package/dist/validators/index.d.ts.map +1 -0
  75. package/dist/validators/index.js +388 -0
  76. package/dist/validators/index.js.map +1 -0
  77. package/package.json +48 -0
  78. package/tsconfig.json +20 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"governance-transformation.js","sourceRoot":"","sources":["../../src/tools/governance-transformation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,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EAAkE;gBAClE,MAAM,GAAG,GAAG;oBACV,EAAE,EAAE,SAAS,eAAe,EAAE;oBAC9B,eAAe;oBACf,SAAS,EAAE,EAAE;oBACb,WAAW,EAAE,EAAE;oBACf,gBAAgB,EAAE,EAAE;oBACpB,gBAAgB,EAAE,EAAE;oBACpB,iBAAiB,EAAE,EAAE;oBACrB,oBAAoB,EAAE,CAAC;oBACvB,qBAAqB,EAAE,CAAC;iBAClB,CAAC;gBAET,MAAM,QAAQ,GAAG;oBACf,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBACnC,SAAS;oBACT,aAAa;oBACb,aAAa;oBACb,cAAc,EAAE,CAAC,EAAE,yDAAyD;oBAC5E,eAAe,EAAE,GAAG;oBACpB,WAAW;oBACX,aAAa;iBACd,CAAC;gBAEF,MAAM,UAAU,GAAG,qBAAqB,CAAC,GAAG,EAAE,QAAe,CAAC,CAAC;gBAC/D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;gBAEjD,OAAO;oBACL,MAAM,EAAE,gBAAgB;oBACxB,eAAe,EAAE,QAAQ;oBACzB,aAAa,EAAE,QAAQ,CAAC,YAAY;oBACpC,KAAK,EAAE,QAAQ,CAAC,KAAK;oBACrB,eAAe,EAAE,QAAQ,CAAC,eAAe;oBACzC,QAAQ,EAAE,4DAA4D;iBACvE,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACrD,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Integration Tools — Create and manage relational nodes, edges, ceremonies,
3
+ * narrative beats, cycles, and seven-generations archiving.
4
+ *
5
+ * Adapted to use in-memory store instead of Redis/NCP/GitHub.
6
+ */
7
+ import type { Tool } from "../types.js";
8
+ export declare const integrationTools: Tool[];
9
+ //# sourceMappingURL=integrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAipBlC,CAAC"}
@@ -0,0 +1,643 @@
1
+ /**
2
+ * Integration Tools — Create and manage relational nodes, edges, ceremonies,
3
+ * narrative beats, cycles, and seven-generations archiving.
4
+ *
5
+ * Adapted to use in-memory store instead of Redis/NCP/GitHub.
6
+ */
7
+ import { store } from "../store.js";
8
+ export const integrationTools = [
9
+ {
10
+ name: "create_relational_node",
11
+ description: "Create a relational node in the medicine wheel memory graph (human, land, spirit, ancestor, future, knowledge). Persistent across sessions.",
12
+ inputSchema: {
13
+ type: "object",
14
+ properties: {
15
+ name: {
16
+ type: "string",
17
+ description: "Name of the relation (person, place, ancestor, teaching)",
18
+ },
19
+ type: {
20
+ type: "string",
21
+ enum: ["human", "land", "spirit", "ancestor", "future", "knowledge"],
22
+ description: "Type of relational node",
23
+ },
24
+ description: {
25
+ type: "string",
26
+ description: "Description of this relation and their role",
27
+ },
28
+ direction: {
29
+ type: "string",
30
+ enum: ["east", "south", "west", "north"],
31
+ description: "Associated medicine wheel direction (optional)",
32
+ },
33
+ metadata: {
34
+ type: "object",
35
+ description: "Additional metadata (optional)",
36
+ },
37
+ },
38
+ required: ["name", "type", "description"],
39
+ },
40
+ handler: async (args) => {
41
+ try {
42
+ const { name, type, description, direction, metadata = {} } = args;
43
+ const node = {
44
+ id: `node:${type}:${Date.now()}:${Math.random().toString(36).substring(7)}`,
45
+ type,
46
+ name,
47
+ description,
48
+ direction,
49
+ metadata,
50
+ created_at: new Date().toISOString(),
51
+ updated_at: new Date().toISOString(),
52
+ };
53
+ store.createNode(node);
54
+ return {
55
+ status: "created",
56
+ node_id: node.id,
57
+ message: `Relational node created: ${name} (${type})`,
58
+ node: node,
59
+ teaching: "Once in relationship, you are responsible for that relationship's wellbeing",
60
+ };
61
+ }
62
+ catch (error) {
63
+ const errorMsg = error instanceof Error ? error.message : String(error);
64
+ return {
65
+ status: "error",
66
+ message: `Failed to create relational node: ${errorMsg}`,
67
+ error: errorMsg,
68
+ };
69
+ }
70
+ },
71
+ },
72
+ {
73
+ name: "create_relational_edge",
74
+ description: "Create relationship between two nodes. Defines obligations and tracks if ceremony has honored this relationship.",
75
+ inputSchema: {
76
+ type: "object",
77
+ properties: {
78
+ from_node_id: {
79
+ type: "string",
80
+ description: "ID of the source node",
81
+ },
82
+ to_node_id: {
83
+ type: "string",
84
+ description: "ID of the target node",
85
+ },
86
+ relationship_type: {
87
+ type: "string",
88
+ description: "Type of relationship (e.g., 'mentor', 'co-investigator', 'knowledge-holder', 'ancestor-of')",
89
+ },
90
+ strength: {
91
+ type: "number",
92
+ description: "Strength of relationship 0-1",
93
+ minimum: 0,
94
+ maximum: 1,
95
+ },
96
+ obligations: {
97
+ type: "array",
98
+ items: { type: "string" },
99
+ description: "Relational obligations for this connection",
100
+ },
101
+ },
102
+ required: ["from_node_id", "to_node_id", "relationship_type"],
103
+ },
104
+ handler: async (args) => {
105
+ try {
106
+ const { from_node_id, to_node_id, relationship_type, strength = 0.5, obligations = [] } = args;
107
+ const edge = {
108
+ from_id: from_node_id,
109
+ to_id: to_node_id,
110
+ relationship_type,
111
+ strength,
112
+ ceremony_honored: false,
113
+ obligations,
114
+ created_at: new Date().toISOString(),
115
+ };
116
+ store.createEdge(edge);
117
+ return {
118
+ status: "created",
119
+ message: `Relationship created: ${relationship_type}`,
120
+ edge: edge,
121
+ reminder: "Ceremony should be conducted to honor this relationship",
122
+ };
123
+ }
124
+ catch (error) {
125
+ const errorMsg = error instanceof Error ? error.message : String(error);
126
+ return {
127
+ status: "error",
128
+ message: `Failed to create relational edge: ${errorMsg}`,
129
+ error: errorMsg,
130
+ };
131
+ }
132
+ },
133
+ },
134
+ {
135
+ name: "get_relational_web",
136
+ description: "Get the full relational web around a node (all connected relations up to specified depth). Visualizes the network of accountability.",
137
+ inputSchema: {
138
+ type: "object",
139
+ properties: {
140
+ node_id: {
141
+ type: "string",
142
+ description: "Center node ID",
143
+ },
144
+ depth: {
145
+ type: "number",
146
+ description: "How many relationship hops to traverse (default: 2)",
147
+ minimum: 1,
148
+ maximum: 5,
149
+ },
150
+ },
151
+ required: ["node_id"],
152
+ },
153
+ handler: async (args) => {
154
+ try {
155
+ const { node_id, depth = 2 } = args;
156
+ const web = store.getRelationalWeb(node_id, depth);
157
+ return {
158
+ center_node_id: node_id,
159
+ depth,
160
+ nodes_count: web.nodes.length,
161
+ edges_count: web.edges.length,
162
+ nodes: web.nodes,
163
+ edges: web.edges,
164
+ teaching: "Reality is relational; everything interconnected",
165
+ };
166
+ }
167
+ catch (error) {
168
+ const errorMsg = error instanceof Error ? error.message : String(error);
169
+ return {
170
+ status: "error",
171
+ message: `Failed to get relational web: ${errorMsg}`,
172
+ error: errorMsg,
173
+ };
174
+ }
175
+ },
176
+ },
177
+ {
178
+ name: "log_ceremony_with_memory",
179
+ description: "Log ceremony to relational memory. Creates permanent record with community visibility.",
180
+ inputSchema: {
181
+ type: "object",
182
+ properties: {
183
+ type: {
184
+ type: "string",
185
+ enum: ["smudging", "talking_circle", "spirit_feeding", "opening", "closing"],
186
+ description: "Type of ceremony",
187
+ },
188
+ direction: {
189
+ type: "string",
190
+ enum: ["east", "south", "west", "north"],
191
+ description: "Medicine wheel direction",
192
+ },
193
+ participants: {
194
+ type: "array",
195
+ items: { type: "string" },
196
+ description: "Participant names or node IDs",
197
+ },
198
+ medicines_used: {
199
+ type: "array",
200
+ items: { type: "string" },
201
+ description: "Medicines used (tobacco, cedar, sage, strawberry)",
202
+ },
203
+ intentions: {
204
+ type: "array",
205
+ items: { type: "string" },
206
+ description: "Ceremony intentions",
207
+ },
208
+ research_context: {
209
+ type: "string",
210
+ description: "Research context (optional)",
211
+ },
212
+ relations_honored: {
213
+ type: "array",
214
+ items: { type: "string" },
215
+ description: "Node IDs of relations honored in ceremony",
216
+ },
217
+ },
218
+ required: ["type", "direction", "participants", "medicines_used", "intentions"],
219
+ },
220
+ handler: async (args) => {
221
+ try {
222
+ const ceremonyId = `ceremony:${Date.now()}:${Math.random().toString(36).substring(7)}`;
223
+ const ceremonyLog = {
224
+ id: ceremonyId,
225
+ type: args.type,
226
+ direction: args.direction,
227
+ participants: args.participants,
228
+ medicines_used: args.medicines_used,
229
+ intentions: args.intentions,
230
+ timestamp: new Date().toISOString(),
231
+ research_context: args.research_context,
232
+ };
233
+ store.logCeremony(ceremonyLog);
234
+ // Update relationship edges as ceremony-honored
235
+ if (args.relations_honored) {
236
+ for (const nodeId of args.relations_honored) {
237
+ const related = store.getRelatedNodeIds(nodeId);
238
+ for (const relatedId of related) {
239
+ store.updateEdgeCeremony(nodeId, relatedId, ceremonyId);
240
+ }
241
+ }
242
+ }
243
+ return {
244
+ ceremony_id: ceremonyId,
245
+ logged_to_memory: true,
246
+ ceremony: ceremonyLog,
247
+ teaching: "Research is ceremony. This act has been witnessed and honored.",
248
+ };
249
+ }
250
+ catch (error) {
251
+ const errorMsg = error instanceof Error ? error.message : String(error);
252
+ return {
253
+ status: "error",
254
+ message: `Failed to log ceremony: ${errorMsg}`,
255
+ error: errorMsg,
256
+ };
257
+ }
258
+ },
259
+ },
260
+ {
261
+ name: "create_narrative_beat",
262
+ description: "Create narrative beat for medicine wheel journey. Links ceremonies, learnings, and relations to direction-specific story.",
263
+ inputSchema: {
264
+ type: "object",
265
+ properties: {
266
+ direction: {
267
+ type: "string",
268
+ enum: ["east", "south", "west", "north"],
269
+ description: "Which direction this beat belongs to",
270
+ },
271
+ title: {
272
+ type: "string",
273
+ description: "Title of this narrative beat",
274
+ },
275
+ description: {
276
+ type: "string",
277
+ description: "What happened in this beat",
278
+ },
279
+ learnings: {
280
+ type: "array",
281
+ items: { type: "string" },
282
+ description: "Key learnings from this beat",
283
+ },
284
+ ceremony_ids: {
285
+ type: "array",
286
+ items: { type: "string" },
287
+ description: "Ceremony IDs associated with this beat",
288
+ },
289
+ relations_honored: {
290
+ type: "array",
291
+ items: { type: "string" },
292
+ description: "Node IDs of relations honored",
293
+ },
294
+ },
295
+ required: ["direction", "title", "description", "learnings"],
296
+ },
297
+ handler: async (args) => {
298
+ try {
299
+ const actMap = { east: 1, south: 2, west: 3, north: 4 };
300
+ const beat = {
301
+ id: `beat:${args.direction}:${Date.now()}`,
302
+ direction: args.direction,
303
+ title: args.title,
304
+ description: args.description,
305
+ ceremonies: args.ceremony_ids || [],
306
+ learnings: args.learnings,
307
+ timestamp: new Date().toISOString(),
308
+ act: actMap[args.direction] || 1,
309
+ relations_honored: args.relations_honored || [],
310
+ };
311
+ store.createBeat(beat);
312
+ return {
313
+ beat_id: beat.id,
314
+ direction: args.direction,
315
+ act: beat.act,
316
+ message: `Narrative beat created for ${args.direction.toUpperCase()} direction`,
317
+ beat: beat,
318
+ };
319
+ }
320
+ catch (error) {
321
+ const errorMsg = error instanceof Error ? error.message : String(error);
322
+ return {
323
+ status: "error",
324
+ message: `Failed to create narrative beat: ${errorMsg}`,
325
+ error: errorMsg,
326
+ };
327
+ }
328
+ },
329
+ },
330
+ {
331
+ name: "create_research_cycle",
332
+ description: "Create a new medicine wheel research cycle. Each cycle is a complete turn of the wheel around a research question. Starts in the East (vision) and progresses through South (growth), West (reflection), North (wisdom).",
333
+ inputSchema: {
334
+ type: "object",
335
+ properties: {
336
+ research_question: {
337
+ type: "string",
338
+ description: "The research question driving this cycle",
339
+ },
340
+ current_direction: {
341
+ type: "string",
342
+ enum: ["east", "south", "west", "north"],
343
+ description: "Starting direction (default: east)",
344
+ },
345
+ },
346
+ required: ["research_question"],
347
+ },
348
+ handler: async (args) => {
349
+ try {
350
+ const { research_question, current_direction = 'east' } = args;
351
+ const cycle = {
352
+ id: `cycle-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
353
+ research_question,
354
+ current_direction,
355
+ start_date: new Date().toISOString(),
356
+ ceremonies_conducted: 0,
357
+ relations_mapped: 0,
358
+ wilson_alignment: 0,
359
+ ocap_compliant: false,
360
+ archived: false,
361
+ };
362
+ store.createCycle(cycle);
363
+ return {
364
+ cycle_id: cycle.id,
365
+ research_question: cycle.research_question,
366
+ current_direction: cycle.current_direction,
367
+ start_date: cycle.start_date,
368
+ cycle: cycle,
369
+ teaching: "A cycle is a complete turn of the wheel. Each research question deserves its full journey through all four directions.",
370
+ };
371
+ }
372
+ catch (error) {
373
+ const errorMsg = error instanceof Error ? error.message : String(error);
374
+ return {
375
+ status: "error",
376
+ message: `Failed to create research cycle: ${errorMsg}`,
377
+ error: errorMsg,
378
+ };
379
+ }
380
+ },
381
+ },
382
+ {
383
+ name: "get_narrative_arc",
384
+ description: "Get complete narrative arc across all four directions for a medicine wheel cycle. Shows full research journey.",
385
+ inputSchema: {
386
+ type: "object",
387
+ properties: {
388
+ cycle_id: {
389
+ type: "string",
390
+ description: "Medicine wheel cycle ID",
391
+ },
392
+ },
393
+ required: ["cycle_id"],
394
+ },
395
+ handler: async (args) => {
396
+ try {
397
+ const cycle = store.getCycle(args.cycle_id);
398
+ if (!cycle) {
399
+ return {
400
+ status: "not_found",
401
+ message: `Cycle ${args.cycle_id} not found`,
402
+ };
403
+ }
404
+ const allBeats = store.getAllBeats(200);
405
+ const eastBeats = allBeats.filter(b => b.direction === 'east');
406
+ const southBeats = allBeats.filter(b => b.direction === 'south');
407
+ const westBeats = allBeats.filter(b => b.direction === 'west');
408
+ const northBeats = allBeats.filter(b => b.direction === 'north');
409
+ const totalCeremonies = new Set(allBeats.flatMap(b => b.ceremonies)).size;
410
+ const journeySummary = `Research cycle "${cycle.research_question}" — ` +
411
+ `${eastBeats.length} East beats, ${southBeats.length} South beats, ` +
412
+ `${westBeats.length} West beats, ${northBeats.length} North beats. ` +
413
+ `${totalCeremonies} ceremonies conducted.`;
414
+ return {
415
+ cycle_id: args.cycle_id,
416
+ research_question: cycle.research_question,
417
+ current_direction: cycle.current_direction,
418
+ east_beats: eastBeats.length,
419
+ south_beats: southBeats.length,
420
+ west_beats: westBeats.length,
421
+ north_beats: northBeats.length,
422
+ total_ceremonies: totalCeremonies,
423
+ wilson_alignment: cycle.wilson_alignment,
424
+ ocap_compliant: cycle.ocap_compliant,
425
+ journey_summary: journeySummary,
426
+ full_arc: {
427
+ cycle,
428
+ east_beats: eastBeats,
429
+ south_beats: southBeats,
430
+ west_beats: westBeats,
431
+ north_beats: northBeats,
432
+ total_ceremonies: totalCeremonies,
433
+ journey_summary: journeySummary,
434
+ },
435
+ };
436
+ }
437
+ catch (error) {
438
+ const errorMsg = error instanceof Error ? error.message : String(error);
439
+ return {
440
+ status: "error",
441
+ message: `Failed to get narrative arc: ${errorMsg}`,
442
+ error: errorMsg,
443
+ };
444
+ }
445
+ },
446
+ },
447
+ {
448
+ name: "archive_for_seven_generations",
449
+ description: "Archive medicine wheel cycle for seven generations with OCAP® compliance. Requires Elder approval and community verification.",
450
+ inputSchema: {
451
+ type: "object",
452
+ properties: {
453
+ cycle_id: {
454
+ type: "string",
455
+ description: "Medicine wheel cycle ID to archive",
456
+ },
457
+ consent_level: {
458
+ type: "string",
459
+ enum: ["public", "community_only", "restricted", "sacred_private"],
460
+ description: "Access level for archive",
461
+ },
462
+ community_verified: {
463
+ type: "boolean",
464
+ description: "Has community verified and approved?",
465
+ },
466
+ elder_approved: {
467
+ type: "boolean",
468
+ description: "Has Elder approved archiving?",
469
+ },
470
+ },
471
+ required: ["cycle_id", "consent_level", "community_verified", "elder_approved"],
472
+ },
473
+ handler: async (args) => {
474
+ try {
475
+ const cycle = store.getCycle(args.cycle_id);
476
+ if (!cycle) {
477
+ return {
478
+ status: "not_found",
479
+ message: `Cycle ${args.cycle_id} not found`,
480
+ };
481
+ }
482
+ const archiveId = `archive:${args.cycle_id}:${Date.now()}`;
483
+ const ocapCompliance = {
484
+ ownership: true,
485
+ control: args.community_verified,
486
+ access: args.consent_level !== 'public',
487
+ possession: true,
488
+ on_premise: true,
489
+ };
490
+ let status;
491
+ let location;
492
+ if (args.community_verified && args.elder_approved) {
493
+ store.archiveCycle(args.cycle_id);
494
+ status = 'archived';
495
+ location = 'in-memory (community-controlled)';
496
+ }
497
+ else if (args.community_verified || args.elder_approved) {
498
+ status = 'pending_approval';
499
+ location = 'pending';
500
+ }
501
+ else {
502
+ status = 'rejected';
503
+ location = 'not archived';
504
+ }
505
+ return {
506
+ archive_id: archiveId,
507
+ status,
508
+ location,
509
+ ocap_compliance: ocapCompliance,
510
+ message: status === 'archived'
511
+ ? "Story archived for seven generations with community ownership"
512
+ : status === 'pending_approval'
513
+ ? "Archive created but pending Elder/community approval"
514
+ : "Archive rejected - OCAP® compliance requirements not met",
515
+ teaching: "Knowledge belongs to community; seven generations will inherit this story",
516
+ };
517
+ }
518
+ catch (error) {
519
+ const errorMsg = error instanceof Error ? error.message : String(error);
520
+ return {
521
+ status: "error",
522
+ message: `Failed to archive for seven generations: ${errorMsg}`,
523
+ error: errorMsg,
524
+ };
525
+ }
526
+ },
527
+ },
528
+ {
529
+ name: "update_cycle_direction",
530
+ description: "Advance a medicine wheel research cycle to a new direction. The wheel turns: east → south → west → north.",
531
+ inputSchema: {
532
+ type: "object",
533
+ properties: {
534
+ cycle_id: {
535
+ type: "string",
536
+ description: "The ID of the cycle to update",
537
+ },
538
+ new_direction: {
539
+ type: "string",
540
+ enum: ["east", "south", "west", "north"],
541
+ description: "The new current direction for the cycle",
542
+ },
543
+ },
544
+ required: ["cycle_id", "new_direction"],
545
+ },
546
+ handler: async (args) => {
547
+ try {
548
+ const { cycle_id, new_direction } = args;
549
+ const cycle = store.getCycle(cycle_id);
550
+ if (!cycle) {
551
+ return {
552
+ status: "not_found",
553
+ message: `Cycle ${cycle_id} not found`,
554
+ };
555
+ }
556
+ const previousDirection = cycle.current_direction;
557
+ const updated = {
558
+ ...cycle,
559
+ current_direction: new_direction,
560
+ };
561
+ store.createCycle(updated);
562
+ return {
563
+ status: "updated",
564
+ cycle_id,
565
+ previous_direction: previousDirection,
566
+ new_direction,
567
+ cycle: updated,
568
+ teaching: "The wheel turns. Each direction holds its own medicine.",
569
+ };
570
+ }
571
+ catch (error) {
572
+ const errorMsg = error instanceof Error ? error.message : String(error);
573
+ return {
574
+ status: "error",
575
+ message: `Failed to update cycle direction: ${errorMsg}`,
576
+ error: errorMsg,
577
+ };
578
+ }
579
+ },
580
+ },
581
+ {
582
+ name: "update_relational_node",
583
+ description: "Update a relational node's description, metadata, or direction. Preserves existing fields not specified in the update.",
584
+ inputSchema: {
585
+ type: "object",
586
+ properties: {
587
+ node_id: {
588
+ type: "string",
589
+ description: "The ID of the relational node to update",
590
+ },
591
+ description: {
592
+ type: "string",
593
+ description: "New description for the node (optional)",
594
+ },
595
+ metadata: {
596
+ type: "object",
597
+ description: "Metadata to merge into existing metadata (optional)",
598
+ },
599
+ direction: {
600
+ type: "string",
601
+ enum: ["east", "south", "west", "north"],
602
+ description: "New medicine wheel direction (optional)",
603
+ },
604
+ },
605
+ required: ["node_id"],
606
+ },
607
+ handler: async (args) => {
608
+ try {
609
+ const { node_id, description, metadata, direction } = args;
610
+ const node = store.getNode(node_id);
611
+ if (!node) {
612
+ return {
613
+ status: "not_found",
614
+ message: `Relational node ${node_id} not found`,
615
+ };
616
+ }
617
+ const updated = {
618
+ ...node,
619
+ ...(description !== undefined && { description }),
620
+ ...(direction !== undefined && { direction }),
621
+ metadata: { ...(node.metadata || {}), ...(metadata || {}) },
622
+ updated_at: new Date().toISOString(),
623
+ };
624
+ store.createNode(updated);
625
+ return {
626
+ status: "updated",
627
+ node_id,
628
+ node: updated,
629
+ teaching: "Relations grow and change. Updating a node honours that living reality.",
630
+ };
631
+ }
632
+ catch (error) {
633
+ const errorMsg = error instanceof Error ? error.message : String(error);
634
+ return {
635
+ status: "error",
636
+ message: `Failed to update relational node: ${errorMsg}`,
637
+ error: errorMsg,
638
+ };
639
+ }
640
+ },
641
+ },
642
+ ];
643
+ //# sourceMappingURL=integrations.js.map