@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,695 @@
1
+ /**
2
+ * Structural Tension Chart Tools for Medicine Wheel
3
+ *
4
+ * Implements Robert Fritz's structural tension methodology with Four Directions integration.
5
+ * Adapted to use in-memory store instead of Redis.
6
+ *
7
+ * Direction mapping:
8
+ * - EAST: Vision/Desired Outcome (where we want to be)
9
+ * - SOUTH: Growth/Action Steps (embodied practice)
10
+ * - WEST: Reflection/Current Reality assessment (honest truth)
11
+ * - NORTH: Wisdom/Completion (integration)
12
+ */
13
+ import { store } from "../store.js";
14
+ export const structuralTensionTools = [
15
+ {
16
+ name: "create_structural_tension_chart",
17
+ description: "Create a structural tension chart with desired outcome, current reality, and optional action steps. Charts are associated with a medicine wheel direction. REMEMBER: Desired outcome is what you want to CREATE (not solve). Current reality must be factual assessment (never 'ready to begin').",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {
21
+ desired_outcome: {
22
+ type: "string",
23
+ description: "What you want to CREATE (not solve/fix). Focus on positive outcomes, not problems to eliminate. Must be visualizable, specific, quantified where possible.",
24
+ },
25
+ current_reality: {
26
+ type: "string",
27
+ description: "Factual assessment of where you are NOW relative to the desired outcome. NEVER use 'ready to begin' or readiness statements. Just facts.",
28
+ },
29
+ direction: {
30
+ type: "string",
31
+ enum: ["east", "south", "west", "north"],
32
+ description: "Which medicine wheel direction this chart serves (east=vision, south=growth, west=reflection, north=wisdom)",
33
+ },
34
+ due_date: {
35
+ type: "string",
36
+ description: "When you want to achieve this outcome (ISO date string, optional)",
37
+ },
38
+ action_steps: {
39
+ type: "array",
40
+ items: { type: "string" },
41
+ description: "Optional strategic secondary choices (NOT tasks). Each step should support advancement toward the desired outcome.",
42
+ },
43
+ },
44
+ required: ["desired_outcome", "current_reality", "direction"],
45
+ },
46
+ handler: async (args) => {
47
+ try {
48
+ const chartId = `stc:${args.direction}:${Date.now()}`;
49
+ const actionSteps = (args.action_steps || []).map((title, idx) => ({
50
+ id: `${chartId}_action_${idx}`,
51
+ title,
52
+ current_reality: 'Not yet assessed',
53
+ status: 'pending',
54
+ progress: 0,
55
+ ceremonies_honored: [],
56
+ relations_honored: [],
57
+ }));
58
+ const chart = {
59
+ id: chartId,
60
+ desired_outcome: args.desired_outcome,
61
+ current_reality: args.current_reality,
62
+ direction: args.direction,
63
+ action_steps: actionSteps,
64
+ due_date: args.due_date,
65
+ created_at: new Date().toISOString(),
66
+ updated_at: new Date().toISOString(),
67
+ phase: 'germination',
68
+ ceremonies_linked: [],
69
+ };
70
+ store.saveChart(chart);
71
+ return {
72
+ chart_id: chartId,
73
+ direction: args.direction,
74
+ phase: 'germination',
75
+ action_steps_count: actionSteps.length,
76
+ chart: chart,
77
+ teaching: "Structural tension is the generative force. The tension between desired outcome and current reality naturally seeks resolution through advancement.",
78
+ };
79
+ }
80
+ catch (error) {
81
+ const errorMsg = error instanceof Error ? error.message : String(error);
82
+ return { status: "error", message: `Failed to create chart: ${errorMsg}` };
83
+ }
84
+ },
85
+ },
86
+ {
87
+ name: "add_action_step",
88
+ description: "Add a strategic secondary choice (action step) to an existing structural tension chart. Each action step is NOT a task — it's a strategic choice that supports the primary goal. Can be telescoped into its own sub-chart.",
89
+ inputSchema: {
90
+ type: "object",
91
+ properties: {
92
+ chart_id: {
93
+ type: "string",
94
+ description: "ID of the chart to add action step to",
95
+ },
96
+ title: {
97
+ type: "string",
98
+ description: "Title of the action step (strategic secondary choice)",
99
+ },
100
+ current_reality: {
101
+ type: "string",
102
+ description: "Current reality for this specific action step",
103
+ },
104
+ due_date: {
105
+ type: "string",
106
+ description: "Optional due date for this action step",
107
+ },
108
+ },
109
+ required: ["chart_id", "title", "current_reality"],
110
+ },
111
+ handler: async (args) => {
112
+ try {
113
+ const chart = store.getChart(args.chart_id);
114
+ if (!chart) {
115
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
116
+ }
117
+ const actionStep = {
118
+ id: `${args.chart_id}_action_${chart.action_steps.length}`,
119
+ title: args.title,
120
+ current_reality: args.current_reality,
121
+ status: 'pending',
122
+ progress: 0,
123
+ due_date: args.due_date,
124
+ ceremonies_honored: [],
125
+ relations_honored: [],
126
+ };
127
+ chart.action_steps.push(actionStep);
128
+ chart.updated_at = new Date().toISOString();
129
+ store.saveChart(chart);
130
+ return {
131
+ action_step_id: actionStep.id,
132
+ chart_id: args.chart_id,
133
+ total_steps: chart.action_steps.length,
134
+ teaching: "Action steps are strategic secondary choices understood in context of the structural tension, not isolated tasks.",
135
+ };
136
+ }
137
+ catch (error) {
138
+ const errorMsg = error instanceof Error ? error.message : String(error);
139
+ return { status: "error", message: `Failed to add action step: ${errorMsg}` };
140
+ }
141
+ },
142
+ },
143
+ {
144
+ name: "telescope_action_step",
145
+ description: "Expand an action step into its own structural tension chart (sub-chart). The action step title becomes the desired outcome of the new chart. This enables hierarchical planning while maintaining structural tension at each level.",
146
+ inputSchema: {
147
+ type: "object",
148
+ properties: {
149
+ chart_id: {
150
+ type: "string",
151
+ description: "ID of the parent chart",
152
+ },
153
+ action_step_id: {
154
+ type: "string",
155
+ description: "ID of the action step to telescope",
156
+ },
157
+ new_current_reality: {
158
+ type: "string",
159
+ description: "Current reality for the telescoped chart (required, must be factual)",
160
+ },
161
+ initial_action_steps: {
162
+ type: "array",
163
+ items: { type: "string" },
164
+ description: "Optional initial action steps for the sub-chart",
165
+ },
166
+ },
167
+ required: ["chart_id", "action_step_id", "new_current_reality"],
168
+ },
169
+ handler: async (args) => {
170
+ try {
171
+ const parentChart = store.getChart(args.chart_id);
172
+ if (!parentChart) {
173
+ return { status: "not_found", message: `Parent chart ${args.chart_id} not found` };
174
+ }
175
+ const actionStep = parentChart.action_steps.find((s) => s.id === args.action_step_id);
176
+ if (!actionStep) {
177
+ return { status: "not_found", message: `Action step ${args.action_step_id} not found` };
178
+ }
179
+ const subChartId = `stc:${parentChart.direction}:${Date.now()}:sub`;
180
+ const subActionSteps = (args.initial_action_steps || []).map((title, idx) => ({
181
+ id: `${subChartId}_action_${idx}`,
182
+ title,
183
+ current_reality: 'Not yet assessed',
184
+ status: 'pending',
185
+ progress: 0,
186
+ ceremonies_honored: [],
187
+ relations_honored: [],
188
+ }));
189
+ const subChart = {
190
+ id: subChartId,
191
+ desired_outcome: actionStep.title,
192
+ current_reality: args.new_current_reality,
193
+ direction: parentChart.direction,
194
+ action_steps: subActionSteps,
195
+ due_date: actionStep.due_date || parentChart.due_date,
196
+ created_at: new Date().toISOString(),
197
+ updated_at: new Date().toISOString(),
198
+ phase: 'germination',
199
+ ceremonies_linked: [],
200
+ };
201
+ store.saveChart(subChart);
202
+ // Link sub-chart to action step
203
+ actionStep.sub_chart_id = subChartId;
204
+ parentChart.updated_at = new Date().toISOString();
205
+ store.saveChart(parentChart);
206
+ return {
207
+ sub_chart_id: subChartId,
208
+ parent_chart_id: args.chart_id,
209
+ action_step_id: args.action_step_id,
210
+ desired_outcome: actionStep.title,
211
+ sub_action_steps: subActionSteps.length,
212
+ teaching: "Each action step can become its own structural tension chart. The hierarchy maintains tension at every level.",
213
+ };
214
+ }
215
+ catch (error) {
216
+ const errorMsg = error instanceof Error ? error.message : String(error);
217
+ return { status: "error", message: `Failed to telescope action step: ${errorMsg}` };
218
+ }
219
+ },
220
+ },
221
+ {
222
+ name: "update_action_progress",
223
+ description: "Update progress on an action step without marking it complete. Progress can advance while work continues.",
224
+ inputSchema: {
225
+ type: "object",
226
+ properties: {
227
+ chart_id: {
228
+ type: "string",
229
+ description: "ID of the chart",
230
+ },
231
+ action_step_id: {
232
+ type: "string",
233
+ description: "ID of the action step",
234
+ },
235
+ progress: {
236
+ type: "number",
237
+ description: "Progress percentage (0-100)",
238
+ minimum: 0,
239
+ maximum: 100,
240
+ },
241
+ new_current_reality: {
242
+ type: "string",
243
+ description: "Optional updated current reality for this action step",
244
+ },
245
+ },
246
+ required: ["chart_id", "action_step_id", "progress"],
247
+ },
248
+ handler: async (args) => {
249
+ try {
250
+ const chart = store.getChart(args.chart_id);
251
+ if (!chart) {
252
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
253
+ }
254
+ const actionStep = chart.action_steps.find((s) => s.id === args.action_step_id);
255
+ if (!actionStep) {
256
+ return { status: "not_found", message: `Action step ${args.action_step_id} not found` };
257
+ }
258
+ actionStep.progress = args.progress;
259
+ if (args.progress > 0 && actionStep.status === 'pending') {
260
+ actionStep.status = 'in_progress';
261
+ }
262
+ if (args.new_current_reality) {
263
+ actionStep.current_reality = args.new_current_reality;
264
+ }
265
+ chart.updated_at = new Date().toISOString();
266
+ store.saveChart(chart);
267
+ return {
268
+ action_step_id: args.action_step_id,
269
+ progress: args.progress,
270
+ status: actionStep.status,
271
+ teaching: "Progress without completion is honest advancement. The structure continues to seek resolution.",
272
+ };
273
+ }
274
+ catch (error) {
275
+ const errorMsg = error instanceof Error ? error.message : String(error);
276
+ return { status: "error", message: `Failed to update progress: ${errorMsg}` };
277
+ }
278
+ },
279
+ },
280
+ {
281
+ name: "mark_action_complete",
282
+ description: "Mark an action step as complete. Optionally link a ceremony that honored this completion.",
283
+ inputSchema: {
284
+ type: "object",
285
+ properties: {
286
+ chart_id: {
287
+ type: "string",
288
+ description: "ID of the chart",
289
+ },
290
+ action_step_id: {
291
+ type: "string",
292
+ description: "ID of the action step to complete",
293
+ },
294
+ ceremony_id: {
295
+ type: "string",
296
+ description: "Optional ceremony ID that honored this completion",
297
+ },
298
+ },
299
+ required: ["chart_id", "action_step_id"],
300
+ },
301
+ handler: async (args) => {
302
+ try {
303
+ const chart = store.getChart(args.chart_id);
304
+ if (!chart) {
305
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
306
+ }
307
+ const actionStep = chart.action_steps.find((s) => s.id === args.action_step_id);
308
+ if (!actionStep) {
309
+ return { status: "not_found", message: `Action step ${args.action_step_id} not found` };
310
+ }
311
+ actionStep.status = 'completed';
312
+ actionStep.progress = 100;
313
+ actionStep.completed_at = new Date().toISOString();
314
+ if (args.ceremony_id) {
315
+ actionStep.ceremonies_honored.push(args.ceremony_id);
316
+ if (!chart.ceremonies_linked.includes(args.ceremony_id)) {
317
+ chart.ceremonies_linked.push(args.ceremony_id);
318
+ }
319
+ }
320
+ // Update chart phase based on completion
321
+ const completedCount = chart.action_steps.filter((s) => s.status === 'completed').length;
322
+ const totalCount = chart.action_steps.length;
323
+ if (totalCount > 0) {
324
+ if (completedCount === totalCount) {
325
+ chart.phase = 'completion';
326
+ }
327
+ else if (completedCount > 0) {
328
+ chart.phase = 'assimilation';
329
+ }
330
+ }
331
+ chart.updated_at = new Date().toISOString();
332
+ store.saveChart(chart);
333
+ const allComplete = completedCount === totalCount && totalCount > 0;
334
+ return {
335
+ action_step_id: args.action_step_id,
336
+ completed_at: actionStep.completed_at,
337
+ chart_phase: chart.phase,
338
+ completed_count: completedCount,
339
+ total_count: totalCount,
340
+ all_complete: allComplete,
341
+ ceremony_suggestion: allComplete
342
+ ? "All action steps complete. Consider logging a closing ceremony (direction: north) to honor this achievement."
343
+ : undefined,
344
+ teaching: "Completion flows into current reality. Each completed step advances the whole structure.",
345
+ };
346
+ }
347
+ catch (error) {
348
+ const errorMsg = error instanceof Error ? error.message : String(error);
349
+ return { status: "error", message: `Failed to mark complete: ${errorMsg}` };
350
+ }
351
+ },
352
+ },
353
+ {
354
+ name: "update_current_reality",
355
+ description: "Update the current reality assessment of a chart. Current reality should be updated as circumstances change. Always factual, never readiness statements.",
356
+ inputSchema: {
357
+ type: "object",
358
+ properties: {
359
+ chart_id: {
360
+ type: "string",
361
+ description: "ID of the chart",
362
+ },
363
+ new_current_reality: {
364
+ type: "string",
365
+ description: "Updated factual assessment of current reality",
366
+ },
367
+ },
368
+ required: ["chart_id", "new_current_reality"],
369
+ },
370
+ handler: async (args) => {
371
+ try {
372
+ const chart = store.getChart(args.chart_id);
373
+ if (!chart) {
374
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
375
+ }
376
+ const previous = chart.current_reality;
377
+ chart.current_reality = args.new_current_reality;
378
+ chart.updated_at = new Date().toISOString();
379
+ store.saveChart(chart);
380
+ return {
381
+ chart_id: args.chart_id,
382
+ previous_reality: previous,
383
+ current_reality: args.new_current_reality,
384
+ teaching: "Honest assessment of current reality is essential. The tension between reality and vision drives advancement.",
385
+ };
386
+ }
387
+ catch (error) {
388
+ const errorMsg = error instanceof Error ? error.message : String(error);
389
+ return { status: "error", message: `Failed to update current reality: ${errorMsg}` };
390
+ }
391
+ },
392
+ },
393
+ {
394
+ name: "get_chart_progress",
395
+ description: "Get progress report for a structural tension chart. Shows desired outcome, current reality, action step status, and overall phase.",
396
+ inputSchema: {
397
+ type: "object",
398
+ properties: {
399
+ chart_id: {
400
+ type: "string",
401
+ description: "ID of the chart",
402
+ },
403
+ },
404
+ required: ["chart_id"],
405
+ },
406
+ handler: async (args) => {
407
+ try {
408
+ const chart = store.getChart(args.chart_id);
409
+ if (!chart) {
410
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
411
+ }
412
+ const completedSteps = chart.action_steps.filter((s) => s.status === 'completed').length;
413
+ const inProgressSteps = chart.action_steps.filter((s) => s.status === 'in_progress').length;
414
+ const pendingSteps = chart.action_steps.filter((s) => s.status === 'pending').length;
415
+ const avgProgress = chart.action_steps.length > 0
416
+ ? chart.action_steps.reduce((sum, s) => sum + s.progress, 0) / chart.action_steps.length
417
+ : 0;
418
+ return {
419
+ chart_id: chart.id,
420
+ direction: chart.direction,
421
+ phase: chart.phase,
422
+ desired_outcome: chart.desired_outcome,
423
+ current_reality: chart.current_reality,
424
+ due_date: chart.due_date,
425
+ progress: {
426
+ overall_percentage: Math.round(avgProgress),
427
+ completed: completedSteps,
428
+ in_progress: inProgressSteps,
429
+ pending: pendingSteps,
430
+ total: chart.action_steps.length,
431
+ },
432
+ action_steps: chart.action_steps.map((s) => ({
433
+ id: s.id,
434
+ title: s.title,
435
+ status: s.status,
436
+ progress: s.progress,
437
+ has_sub_chart: !!s.sub_chart_id,
438
+ })),
439
+ ceremonies_linked: chart.ceremonies_linked.length,
440
+ teaching: "Progress is not linear. The structure advances through maintained tension, not willpower.",
441
+ };
442
+ }
443
+ catch (error) {
444
+ const errorMsg = error instanceof Error ? error.message : String(error);
445
+ return { status: "error", message: `Failed to get chart progress: ${errorMsg}` };
446
+ }
447
+ },
448
+ },
449
+ {
450
+ name: "list_structural_tension_charts",
451
+ description: "List all active structural tension charts. Filter by medicine wheel direction.",
452
+ inputSchema: {
453
+ type: "object",
454
+ properties: {
455
+ direction: {
456
+ type: "string",
457
+ enum: ["east", "south", "west", "north"],
458
+ description: "Filter by medicine wheel direction (optional)",
459
+ },
460
+ },
461
+ },
462
+ handler: async (args) => {
463
+ try {
464
+ const charts = store.getAllCharts(args.direction);
465
+ return {
466
+ count: charts.length,
467
+ filter: args.direction || 'all',
468
+ charts: charts.map(c => ({
469
+ id: c.id,
470
+ direction: c.direction,
471
+ desired_outcome: c.desired_outcome,
472
+ current_reality: c.current_reality,
473
+ phase: c.phase,
474
+ action_steps_count: c.action_steps.length,
475
+ completed_steps: c.action_steps.filter((s) => s.status === 'completed').length,
476
+ due_date: c.due_date,
477
+ updated_at: c.updated_at,
478
+ })),
479
+ teaching: "Each chart holds structural tension that seeks resolution. Together they form the strategic landscape.",
480
+ };
481
+ }
482
+ catch (error) {
483
+ const errorMsg = error instanceof Error ? error.message : String(error);
484
+ return { status: "error", message: `Failed to list charts: ${errorMsg}` };
485
+ }
486
+ },
487
+ },
488
+ {
489
+ name: "creator_moment_of_truth",
490
+ description: "Four-step review process (MMOT) for a structural tension chart. Acknowledges truth, analyzes how things happened, creates plan for adjustment, and sets up feedback. Aligns with West direction (reflection/truth).",
491
+ inputSchema: {
492
+ type: "object",
493
+ properties: {
494
+ chart_id: {
495
+ type: "string",
496
+ description: "ID of the chart to review",
497
+ },
498
+ expected_outcome: {
499
+ type: "string",
500
+ description: "What was expected to happen",
501
+ },
502
+ actual_outcome: {
503
+ type: "string",
504
+ description: "What actually happened (factual)",
505
+ },
506
+ analysis: {
507
+ type: "string",
508
+ description: "How did this come to pass? Step-by-step tracking, not blame.",
509
+ },
510
+ adjustments: {
511
+ type: "array",
512
+ items: { type: "string" },
513
+ description: "What specific changes will be made based on learnings",
514
+ },
515
+ feedback_system: {
516
+ type: "string",
517
+ description: "How will you track whether changes are being made",
518
+ },
519
+ },
520
+ required: ["chart_id", "expected_outcome", "actual_outcome", "analysis", "adjustments"],
521
+ },
522
+ handler: async (args) => {
523
+ try {
524
+ const chart = store.getChart(args.chart_id);
525
+ if (!chart) {
526
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
527
+ }
528
+ const mmotId = `mmot:${args.chart_id}:${Date.now()}`;
529
+ store.saveMmot({
530
+ id: mmotId,
531
+ chart_id: args.chart_id,
532
+ timestamp: new Date().toISOString(),
533
+ step1_expected: args.expected_outcome,
534
+ step1_actual: args.actual_outcome,
535
+ step2_analysis: args.analysis,
536
+ step3_adjustments: args.adjustments,
537
+ step4_feedback: args.feedback_system || '',
538
+ });
539
+ // Update current reality based on MMOT
540
+ chart.current_reality = args.actual_outcome;
541
+ chart.updated_at = new Date().toISOString();
542
+ store.saveChart(chart);
543
+ return {
544
+ mmot_id: mmotId,
545
+ chart_id: args.chart_id,
546
+ steps: {
547
+ step1_acknowledge: {
548
+ expected: args.expected_outcome,
549
+ actual: args.actual_outcome,
550
+ discrepancy: args.expected_outcome !== args.actual_outcome,
551
+ },
552
+ step2_analyze: args.analysis,
553
+ step3_plan: args.adjustments,
554
+ step4_feedback: args.feedback_system || 'Not specified',
555
+ },
556
+ current_reality_updated: true,
557
+ teaching: "The goal is effectiveness, not perfection. Use discrepancies to learn, not to judge. Truth as a verb.",
558
+ };
559
+ }
560
+ catch (error) {
561
+ const errorMsg = error instanceof Error ? error.message : String(error);
562
+ return { status: "error", message: `Failed to complete MMOT: ${errorMsg}` };
563
+ }
564
+ },
565
+ },
566
+ {
567
+ name: "link_ceremony_to_chart",
568
+ description: "Link a ceremony to a structural tension chart. Ceremonies witness and honor the work of advancing toward desired outcomes.",
569
+ inputSchema: {
570
+ type: "object",
571
+ properties: {
572
+ chart_id: {
573
+ type: "string",
574
+ description: "ID of the chart",
575
+ },
576
+ ceremony_id: {
577
+ type: "string",
578
+ description: "ID of the ceremony to link",
579
+ },
580
+ },
581
+ required: ["chart_id", "ceremony_id"],
582
+ },
583
+ handler: async (args) => {
584
+ try {
585
+ const chart = store.getChart(args.chart_id);
586
+ if (!chart) {
587
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
588
+ }
589
+ if (!chart.ceremonies_linked.includes(args.ceremony_id)) {
590
+ chart.ceremonies_linked.push(args.ceremony_id);
591
+ chart.updated_at = new Date().toISOString();
592
+ store.saveChart(chart);
593
+ }
594
+ return {
595
+ chart_id: args.chart_id,
596
+ ceremony_id: args.ceremony_id,
597
+ total_ceremonies: chart.ceremonies_linked.length,
598
+ teaching: "Ceremony witnesses the work. Strategic advancement is relational practice.",
599
+ };
600
+ }
601
+ catch (error) {
602
+ const errorMsg = error instanceof Error ? error.message : String(error);
603
+ return { status: "error", message: `Failed to link ceremony: ${errorMsg}` };
604
+ }
605
+ },
606
+ },
607
+ {
608
+ name: "link_chart_to_cycle",
609
+ description: "Link a structural tension chart to a medicine wheel research cycle. Charts can belong to cycles for organizational grouping.",
610
+ inputSchema: {
611
+ type: "object",
612
+ properties: {
613
+ chart_id: {
614
+ type: "string",
615
+ description: "ID of the chart",
616
+ },
617
+ cycle_id: {
618
+ type: "string",
619
+ description: "ID of the medicine wheel cycle to link to",
620
+ },
621
+ },
622
+ required: ["chart_id", "cycle_id"],
623
+ },
624
+ handler: async (args) => {
625
+ try {
626
+ const chart = store.getChart(args.chart_id);
627
+ if (!chart) {
628
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
629
+ }
630
+ chart.cycle_id = args.cycle_id;
631
+ chart.updated_at = new Date().toISOString();
632
+ store.saveChart(chart);
633
+ return {
634
+ chart_id: args.chart_id,
635
+ cycle_id: args.cycle_id,
636
+ teaching: "Charts within cycles form the strategic landscape of a research journey.",
637
+ };
638
+ }
639
+ catch (error) {
640
+ const errorMsg = error instanceof Error ? error.message : String(error);
641
+ return { status: "error", message: `Failed to link chart to cycle: ${errorMsg}` };
642
+ }
643
+ },
644
+ },
645
+ {
646
+ name: "honor_relation_in_action_step",
647
+ description: "Honor a relational node in an action step. Links the strategic work to relational accountability.",
648
+ inputSchema: {
649
+ type: "object",
650
+ properties: {
651
+ chart_id: {
652
+ type: "string",
653
+ description: "ID of the chart",
654
+ },
655
+ action_step_id: {
656
+ type: "string",
657
+ description: "ID of the action step",
658
+ },
659
+ node_id: {
660
+ type: "string",
661
+ description: "ID of the relational node to honor",
662
+ },
663
+ },
664
+ required: ["chart_id", "action_step_id", "node_id"],
665
+ },
666
+ handler: async (args) => {
667
+ try {
668
+ const chart = store.getChart(args.chart_id);
669
+ if (!chart) {
670
+ return { status: "not_found", message: `Chart ${args.chart_id} not found` };
671
+ }
672
+ const actionStep = chart.action_steps.find((s) => s.id === args.action_step_id);
673
+ if (!actionStep) {
674
+ return { status: "not_found", message: `Action step ${args.action_step_id} not found` };
675
+ }
676
+ if (!actionStep.relations_honored.includes(args.node_id)) {
677
+ actionStep.relations_honored.push(args.node_id);
678
+ chart.updated_at = new Date().toISOString();
679
+ store.saveChart(chart);
680
+ }
681
+ return {
682
+ action_step_id: args.action_step_id,
683
+ node_id: args.node_id,
684
+ total_relations_honored: actionStep.relations_honored.length,
685
+ teaching: "Strategic action is relational. Honoring relations grounds advancement in accountability.",
686
+ };
687
+ }
688
+ catch (error) {
689
+ const errorMsg = error instanceof Error ? error.message : String(error);
690
+ return { status: "error", message: `Failed to honor relation: ${errorMsg}` };
691
+ }
692
+ },
693
+ },
694
+ ];
695
+ //# sourceMappingURL=structural-tension.js.map