@medicine-wheel/app 0.2.3 → 0.2.6

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/README.md CHANGED
@@ -194,8 +194,11 @@ mw directions
194
194
  mw node list
195
195
  ```
196
196
 
197
+ The published app package installs and runs without `@medicine-wheel/mcp`. The `mw`
198
+ CLI uses HTTP against the running server by default; MCP fallback is optional via a
199
+ local `MW_MCP_PATH`.
200
+
197
201
  ## License
198
202
 
199
203
  MIT see [LICENSE](LICENSE)
200
204
 
201
-
@@ -24,9 +24,11 @@ export default function AccountabilityPage() {
24
24
  fetch("/api/edges").then((r) => r.json()),
25
25
  fetch("/api/ceremonies").then((r) => r.json()),
26
26
  fetch("/api/narrative/beats").then((r) => r.json()),
27
- ]).then(([res, n, e, c, b]) => {
27
+ ]).then(([res, nodesResponse, e, c, b]) => {
28
28
  setResources(Array.isArray(res) ? res : []);
29
- setNodes(Array.isArray(n) ? n : []);
29
+ // API returns { nodes: [...], provider: '...', count: N }
30
+ const nodesData = Array.isArray(nodesResponse) ? nodesResponse : (nodesResponse.nodes || []);
31
+ setNodes(nodesData);
30
32
  setEdges(Array.isArray(e) ? e : []);
31
33
  setCeremonies(Array.isArray(c) ? c : []);
32
34
  setBeats(Array.isArray(b) ? b : []);
@@ -1,27 +1,36 @@
1
1
  import { NextResponse } from "next/server";
2
- import { getAllEdges, createEdge } from "@/lib/store";
2
+ import { createProvider, detectProvider } from "@medicine-wheel/storage-provider";
3
3
 
4
4
  export async function GET() {
5
5
  try {
6
- return NextResponse.json(getAllEdges());
7
- } catch (error: any) {
8
- return NextResponse.json({ error: error.message }, { status: 500 });
6
+ const store = await createProvider();
7
+ const edges = await store.getAllEdges();
8
+ return NextResponse.json(edges);
9
+ } catch (error: unknown) {
10
+ const message = error instanceof Error ? error.message : String(error);
11
+ return NextResponse.json({ error: message }, { status: 500 });
9
12
  }
10
13
  }
11
14
 
12
15
  export async function POST(request: Request) {
13
16
  try {
17
+ const store = await createProvider();
14
18
  const body = await request.json();
15
- const edge = createEdge({
19
+
20
+ const edge = {
16
21
  from_id: body.from_id,
17
22
  to_id: body.to_id,
18
23
  relationship_type: body.relationship_type,
19
24
  strength: body.strength ?? 0.5,
20
25
  ceremony_honored: body.ceremony_honored ?? false,
21
26
  obligations: body.obligations ?? [],
22
- });
23
- return NextResponse.json(edge, { status: 201 });
24
- } catch (error: any) {
25
- return NextResponse.json({ error: error.message }, { status: 500 });
27
+ created_at: new Date().toISOString(),
28
+ };
29
+
30
+ await store.createEdge(edge);
31
+ return NextResponse.json({ success: true, edge, provider: detectProvider() }, { status: 201 });
32
+ } catch (error: unknown) {
33
+ const message = error instanceof Error ? error.message : String(error);
34
+ return NextResponse.json({ error: message }, { status: 500 });
26
35
  }
27
36
  }
@@ -31,8 +31,11 @@ export default function GraphPage() {
31
31
  const loadData = useCallback(async () => {
32
32
  try {
33
33
  const [nodesRes, edgesRes] = await Promise.all([fetch("/api/nodes"), fetch("/api/edges")]);
34
- const nodesData: RelationalNode[] = await nodesRes.json();
34
+ const nodesResponse = await nodesRes.json();
35
35
  const edgesData: RelationalEdge[] = await edgesRes.json();
36
+
37
+ // API returns { nodes: [...], provider: '...', count: N }
38
+ const nodesData: RelationalNode[] = Array.isArray(nodesResponse) ? nodesResponse : (nodesResponse.nodes || []);
36
39
 
37
40
  // Position nodes by direction on a circular layout
38
41
  const CX = 350, CY = 300, R = 220;
@@ -38,8 +38,11 @@ export default function NodesPage() {
38
38
  fetch(`/api/nodes?${params.toString()}`),
39
39
  fetch("/api/edges"),
40
40
  ]);
41
- const nodesData: RelationalNode[] = await nodesRes.json();
41
+ const nodesResponse = await nodesRes.json();
42
42
  const edgesData: RelationalEdge[] = edgesRes.ok ? await edgesRes.json() : [];
43
+
44
+ // API returns { nodes: [...], provider: '...', count: N }
45
+ const nodesData: RelationalNode[] = Array.isArray(nodesResponse) ? nodesResponse : (nodesResponse.nodes || []);
43
46
  setNodes(nodesData);
44
47
  setEdges(Array.isArray(edgesData) ? edgesData : []);
45
48
  } catch {
@@ -22,8 +22,11 @@ export default function RelationsPage() {
22
22
  const loadData = useCallback(async () => {
23
23
  try {
24
24
  const [nodesRes, edgesRes] = await Promise.all([fetch("/api/nodes"), fetch("/api/edges")]);
25
- const nodesData: RelationalNode[] = await nodesRes.json();
25
+ const nodesResponse = await nodesRes.json();
26
26
  const edgesData: RelationalEdge[] = await edgesRes.json();
27
+
28
+ // API returns { nodes: [...], provider: '...', count: N }
29
+ const nodesData: RelationalNode[] = Array.isArray(nodesResponse) ? nodesResponse : (nodesResponse.nodes || []);
27
30
 
28
31
  const cx = 400, cy = 300, radius = 220;
29
32
  const graphNodes = nodesData.map((n, i) => {
@@ -32,7 +35,7 @@ export default function RelationsPage() {
32
35
  });
33
36
  setNodes(graphNodes);
34
37
  setEdges(Array.isArray(edgesData) ? edgesData : []);
35
- } catch { console.error("Failed to load"); }
38
+ } catch (err) { console.error("Failed to load relational data:", err); }
36
39
  }, []);
37
40
 
38
41
  useEffect(() => { loadData(); }, [loadData]);
package/dist/cli/mw.js CHANGED
@@ -72,7 +72,7 @@ function resolveMcpPath() {
72
72
  const fromCwd = path.join(process.cwd(), 'mcp', 'dist', 'index.js');
73
73
  if (fs.existsSync(fromCwd))
74
74
  return fromCwd;
75
- // Installed @medicine-wheel/mcp in node_modules
75
+ // Optional installed @medicine-wheel/mcp package, if available.
76
76
  const fromModules = path.join(packageRoot, 'node_modules', '@medicine-wheel', 'mcp', 'dist', 'index.js');
77
77
  if (fs.existsSync(fromModules))
78
78
  return fromModules;
@@ -159,7 +159,7 @@ async function checkApi() {
159
159
  // ── MCP JSON-RPC ──────────────────────────────────────────────────
160
160
  function mcpRaw(rpcMethod, params) {
161
161
  if (!MW_MCP_PATH) {
162
- console.error('Error: MCP server path not found. Set MW_MCP_PATH or ensure @medicine-wheel/mcp is installed.');
162
+ console.error('Error: MCP server path not found. Set MW_MCP_PATH or use the HTTP server via MW_API_URL.');
163
163
  process.exit(1);
164
164
  }
165
165
  const req = JSON.stringify({ jsonrpc: '2.0', method: rpcMethod, params, id: 1 });
@@ -264,7 +264,7 @@ ${C.bold}🌿 mw — Medicine Wheel CLI${C.reset}
264
264
 
265
265
  ENVIRONMENT
266
266
  MW_API_URL API base URL (default: http://localhost:3940)
267
- MW_MCP_PATH MCP server path (auto-detected)
267
+ MW_MCP_PATH Optional MCP server path (auto-detected when locally available)
268
268
  MW_FORMAT Output format: pretty (default), json, quiet
269
269
  `);
270
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medicine-wheel/app",
3
- "version": "0.2.3",
3
+ "version": "0.2.6",
4
4
  "description": "Medicine Wheel — Interactive visual layer for Indigenous relational research with Four Directions, ceremonies, and narrative arcs",
5
5
  "bin": {
6
6
  "mw": "dist/cli/mw.js",
@@ -59,6 +59,7 @@
59
59
  "sync:versions": "node scripts/sync-versions.mjs",
60
60
  "prepublishOnly": "npm run clean:packages && npm run build:packages && npm run build:cli",
61
61
  "publish:packages": "npm run prepublishOnly && node scripts/publish-workspaces.mjs",
62
+ "publish:mcp": "npm publish --workspace mcp --access public",
62
63
  "publish:root": "npm publish --access public",
63
64
  "publish:all": "npm run prepublishOnly && node scripts/publish-workspaces.mjs && npm publish --access public --ignore-scripts",
64
65
  "publish:dry": "npm run prepublishOnly && node scripts/publish-workspaces.mjs --dry-run && npm publish --access public --dry-run --ignore-scripts",
@@ -80,24 +81,23 @@
80
81
  "clsx": "^2.1.1",
81
82
  "tailwind-merge": "^3.0.2",
82
83
  "recharts": "^2.15.4",
83
- "@medicine-wheel/ontology-core": "^0.2.3",
84
- "@medicine-wheel/ceremony-protocol": "^0.2.3",
85
- "@medicine-wheel/narrative-engine": "^0.2.3",
86
- "@medicine-wheel/graph-viz": "^0.2.3",
87
- "@medicine-wheel/relational-query": "^0.2.3",
88
- "@medicine-wheel/prompt-decomposition": "^0.2.3",
89
- "@medicine-wheel/ui-components": "^0.2.3",
90
- "@medicine-wheel/data-store": "^0.2.3",
91
- "@medicine-wheel/session-reader": "^0.2.3",
92
- "@medicine-wheel/fire-keeper": "^0.2.3",
93
- "@medicine-wheel/importance-unit": "^0.2.3",
94
- "@medicine-wheel/relational-index": "^0.2.3",
95
- "@medicine-wheel/transformation-tracker": "^0.2.3",
96
- "@medicine-wheel/storage-provider": "^0.2.3",
97
- "@medicine-wheel/community-review": "^0.2.3",
98
- "@medicine-wheel/consent-lifecycle": "^0.2.3",
99
- "@medicine-wheel/data-store-postgres": "^0.2.3",
100
- "@medicine-wheel/mcp": "^4.0.0",
84
+ "@medicine-wheel/ontology-core": "^0.2.6",
85
+ "@medicine-wheel/ceremony-protocol": "^0.2.6",
86
+ "@medicine-wheel/narrative-engine": "^0.2.6",
87
+ "@medicine-wheel/graph-viz": "^0.2.6",
88
+ "@medicine-wheel/relational-query": "^0.2.6",
89
+ "@medicine-wheel/prompt-decomposition": "^0.2.6",
90
+ "@medicine-wheel/ui-components": "^0.2.6",
91
+ "@medicine-wheel/data-store": "^0.2.6",
92
+ "@medicine-wheel/session-reader": "^0.2.6",
93
+ "@medicine-wheel/fire-keeper": "^0.2.6",
94
+ "@medicine-wheel/importance-unit": "^0.2.6",
95
+ "@medicine-wheel/relational-index": "^0.2.6",
96
+ "@medicine-wheel/transformation-tracker": "^0.2.6",
97
+ "@medicine-wheel/storage-provider": "^0.2.6",
98
+ "@medicine-wheel/community-review": "^0.2.6",
99
+ "@medicine-wheel/consent-lifecycle": "^0.2.6",
100
+ "@medicine-wheel/data-store-postgres": "^0.2.6",
101
101
  "@neondatabase/serverless": "^0.10.0"
102
102
  },
103
103
  "devDependencies": {