@medicine-wheel/mcp 4.14.4 → 4.15.1
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/all-tools.d.ts.map +1 -1
- package/dist/all-tools.js +2 -0
- package/dist/all-tools.js.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/tools/honcho.d.ts +16 -0
- package/dist/tools/honcho.d.ts.map +1 -0
- package/dist/tools/honcho.js +187 -0
- package/dist/tools/honcho.js.map +1 -0
- package/dist/validate-args.d.ts +17 -0
- package/dist/validate-args.d.ts.map +1 -0
- package/dist/validate-args.js +22 -0
- package/dist/validate-args.js.map +1 -0
- package/package.json +19 -18
package/dist/all-tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-tools.d.ts","sourceRoot":"","sources":["../src/all-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"all-tools.d.ts","sourceRoot":"","sources":["../src/all-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAuBvC,eAAO,MAAM,QAAQ,EAAE,IAAI,EAmB1B,CAAC"}
|
package/dist/all-tools.js
CHANGED
|
@@ -15,6 +15,7 @@ import { reasoningObservabilityTools } from "./tools/reasoning-observability.js"
|
|
|
15
15
|
import { inquiryWeaveTools } from "./tools/inquiry-weaves.js";
|
|
16
16
|
import { planPerspectiveTools } from "./tools/plan-perspectives.js";
|
|
17
17
|
import { infrastructureTools } from "./tools/infrastructure.js";
|
|
18
|
+
import { honchoTools } from "./tools/honcho.js";
|
|
18
19
|
// Orientation first: list order is scan order, and the routing question
|
|
19
20
|
// belongs before the instruments it routes to.
|
|
20
21
|
export const allTools = [
|
|
@@ -35,5 +36,6 @@ export const allTools = [
|
|
|
35
36
|
...inquiryWeaveTools,
|
|
36
37
|
...planPerspectiveTools,
|
|
37
38
|
...infrastructureTools,
|
|
39
|
+
...honchoTools,
|
|
38
40
|
];
|
|
39
41
|
//# sourceMappingURL=all-tools.js.map
|
package/dist/all-tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-tools.js","sourceRoot":"","sources":["../src/all-tools.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"all-tools.js","sourceRoot":"","sources":["../src/all-tools.ts"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IACjB,GAAG,iBAAiB;IACpB,GAAG,6BAA6B;IAChC,GAAG,2BAA2B;IAC9B,GAAG,iBAAiB;IACpB,GAAG,oBAAoB;IACvB,GAAG,mBAAmB;IACtB,GAAG,WAAW;CACf,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSche
|
|
|
6
6
|
import { allTools } from "./all-tools.js";
|
|
7
7
|
import { resources } from "./resources/index.js";
|
|
8
8
|
import { prompts } from "./prompts/index.js";
|
|
9
|
+
import { getJsonlStore } from "./jsonl-store.js";
|
|
10
|
+
import { missingRequired } from "./validate-args.js";
|
|
9
11
|
// Single source of truth: derive name/version from package.json so the
|
|
10
12
|
// serverInfo advertised over MCP never drifts from the published version.
|
|
11
13
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
@@ -32,8 +34,20 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
32
34
|
const tool = allTools.find((t) => t.name === request.params.name);
|
|
33
35
|
if (!tool)
|
|
34
36
|
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
37
|
+
const args = (request.params.arguments || {});
|
|
38
|
+
const missing = missingRequired(tool.inputSchema, args);
|
|
39
|
+
if (missing.length) {
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
42
|
+
status: "error",
|
|
43
|
+
error: `${tool.name} requires ${missing.join(", ")}`,
|
|
44
|
+
missing,
|
|
45
|
+
}, null, 2) }],
|
|
46
|
+
isError: true,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
35
49
|
try {
|
|
36
|
-
const result = await tool.handler(
|
|
50
|
+
const result = await tool.handler(args);
|
|
37
51
|
return {
|
|
38
52
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
39
53
|
};
|
|
@@ -78,7 +92,14 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
|
78
92
|
});
|
|
79
93
|
async function main() {
|
|
80
94
|
console.error(`🌿 ${pkg.name} server v${pkg.version} initializing...`);
|
|
81
|
-
|
|
95
|
+
// `createStore` already named the backend it chose — an HTTP store prints the
|
|
96
|
+
// URL its writes leave for. A second, unconditional line claiming the local
|
|
97
|
+
// JSONL store contradicted it, and an operator who believed it thought writes
|
|
98
|
+
// were staying on disk while they were reaching a server. Say it once, here,
|
|
99
|
+
// and only when nothing else did.
|
|
100
|
+
if (!process.env.MW_API_URL?.trim()) {
|
|
101
|
+
console.error(`📂 Using JSONL file-backed store (${getJsonlStore().dataDir})`);
|
|
102
|
+
}
|
|
82
103
|
const transport = new StdioServerTransport();
|
|
83
104
|
await server.connect(transport);
|
|
84
105
|
console.error("Medicine Wheel MCP Server running on stdio");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,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AC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAC5D,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;IACzD,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;AACvC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Honcho tools — the wheel's projection into memory that reasons.
|
|
3
|
+
*
|
|
4
|
+
* The wheel is canonical; Honcho holds what the history has come to mean about
|
|
5
|
+
* each peer. Three moves, mirroring `@medicine-wheel/honcho`: project a beat or
|
|
6
|
+
* ceremony (wheel → Honcho), recall a peer (Honcho → agent), project a derived
|
|
7
|
+
* conclusion back (Honcho → wheel, as a `knowledge` node with
|
|
8
|
+
* `metadata.kind: "memory_projection"`).
|
|
9
|
+
*
|
|
10
|
+
* Configured by HONCHO_URL, HONCHO_WORKSPACE_ID, HONCHO_API_KEY. Without a URL
|
|
11
|
+
* every tool answers with status 'unconfigured' and names the variable, rather
|
|
12
|
+
* than reporting a projection that never left the process.
|
|
13
|
+
*/
|
|
14
|
+
import type { Tool } from "../types.js";
|
|
15
|
+
export declare const honchoTools: Tool[];
|
|
16
|
+
//# sourceMappingURL=honcho.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"honcho.d.ts","sourceRoot":"","sources":["../../src/tools/honcho.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAqCxC,eAAO,MAAM,WAAW,EAAE,IAAI,EAgJ7B,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Honcho tools — the wheel's projection into memory that reasons.
|
|
3
|
+
*
|
|
4
|
+
* The wheel is canonical; Honcho holds what the history has come to mean about
|
|
5
|
+
* each peer. Three moves, mirroring `@medicine-wheel/honcho`: project a beat or
|
|
6
|
+
* ceremony (wheel → Honcho), recall a peer (Honcho → agent), project a derived
|
|
7
|
+
* conclusion back (Honcho → wheel, as a `knowledge` node with
|
|
8
|
+
* `metadata.kind: "memory_projection"`).
|
|
9
|
+
*
|
|
10
|
+
* Configured by HONCHO_URL, HONCHO_WORKSPACE_ID, HONCHO_API_KEY. Without a URL
|
|
11
|
+
* every tool answers with status 'unconfigured' and names the variable, rather
|
|
12
|
+
* than reporting a projection that never left the process.
|
|
13
|
+
*/
|
|
14
|
+
import { store } from "../store.js";
|
|
15
|
+
import { createHonchoClient, honchoFromEnv, honchoIdFor, memoryProjectionNode, project, projectBeat, projectCeremony, } from "@medicine-wheel/honcho";
|
|
16
|
+
function client() {
|
|
17
|
+
const cfg = honchoFromEnv();
|
|
18
|
+
if (!cfg) {
|
|
19
|
+
return {
|
|
20
|
+
status: "unconfigured",
|
|
21
|
+
message: "HONCHO_URL is not set. Point it at a Honcho /v3 API (http://localhost:8133 on eury, https://honcho.<tailnet>.ts.net on the tailnet); HONCHO_WORKSPACE_ID defaults to 'medicine-wheel'.",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return createHonchoClient(cfg);
|
|
25
|
+
}
|
|
26
|
+
const isClient = (c) => !("status" in c);
|
|
27
|
+
function failure(what, error) {
|
|
28
|
+
const err = error;
|
|
29
|
+
return {
|
|
30
|
+
status: "error",
|
|
31
|
+
message: `${what}: ${err?.message ?? String(error)}`,
|
|
32
|
+
...(err?.status !== undefined ? { http_status: err.status } : {}),
|
|
33
|
+
...(err?.body ? { body: err.body } : {}),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export const honchoTools = [
|
|
37
|
+
{
|
|
38
|
+
name: "honcho_status",
|
|
39
|
+
description: "Is Honcho reachable, and where. Reports the configured URL and workspace and Honcho's /health. " +
|
|
40
|
+
"Honcho is the wheel's memory that reasons: the wheel keeps what was recorded; Honcho keeps what " +
|
|
41
|
+
"it has come to mean about each peer, revised as new beats and ceremonies are projected.",
|
|
42
|
+
inputSchema: { type: "object", properties: {} },
|
|
43
|
+
handler: async () => {
|
|
44
|
+
const c = client();
|
|
45
|
+
if (!isClient(c))
|
|
46
|
+
return c;
|
|
47
|
+
try {
|
|
48
|
+
return { status: "ok", url: c.baseUrl, workspace: c.workspace, health: await c.health() };
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
return { ...failure("honcho unreachable", error), url: c.baseUrl, workspace: c.workspace };
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "honcho_project",
|
|
57
|
+
description: "Project a wheel record into Honcho: a beat becomes one message from its speaker (witnesses seated) " +
|
|
58
|
+
"in the session of its ceremony; a ceremony log becomes one message from the wheel in its own session, " +
|
|
59
|
+
"every participant seated. Peers, session and workspace are created if missing; ids are mapped with " +
|
|
60
|
+
"honchoIdFor and the wheel id travels as metadata.wheel_id. Nothing is filtered: what you name is projected.",
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: "object",
|
|
63
|
+
properties: {
|
|
64
|
+
beat_id: { type: "string", description: "A beat id on this wheel" },
|
|
65
|
+
ceremony_id: { type: "string", description: "A ceremony id on this wheel" },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
handler: async (args) => {
|
|
69
|
+
const c = client();
|
|
70
|
+
if (!isClient(c))
|
|
71
|
+
return c;
|
|
72
|
+
const { beat_id, ceremony_id } = args ?? {};
|
|
73
|
+
if (!beat_id && !ceremony_id)
|
|
74
|
+
return { status: "error", message: "Name a beat_id or a ceremony_id." };
|
|
75
|
+
try {
|
|
76
|
+
const projections = [];
|
|
77
|
+
if (ceremony_id) {
|
|
78
|
+
const ceremony = await store.getCeremony(ceremony_id);
|
|
79
|
+
if (!ceremony)
|
|
80
|
+
return { status: "error", message: `No ceremony ${ceremony_id} on this wheel.` };
|
|
81
|
+
projections.push({ record: "ceremony", id: ceremony_id, ...(await project(c, projectCeremony(ceremony))) });
|
|
82
|
+
}
|
|
83
|
+
if (beat_id) {
|
|
84
|
+
const beat = await store.getBeat(beat_id);
|
|
85
|
+
if (!beat)
|
|
86
|
+
return { status: "error", message: `No beat ${beat_id} on this wheel.` };
|
|
87
|
+
projections.push({ record: "beat", id: beat_id, ...(await project(c, projectBeat(beat))) });
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
status: "projected",
|
|
91
|
+
workspace: c.workspace,
|
|
92
|
+
projections,
|
|
93
|
+
teaching: "Honcho reasons in the background. Do not wait on it; the representation is richer next time you recall.",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
return failure("projection failed", error);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "honcho_recall",
|
|
103
|
+
description: "What Honcho has come to understand about a peer. Give a wheel node id or name (mapped with honchoIdFor) " +
|
|
104
|
+
"or a Honcho peer id. Without a question: the representation, a fast read. With a question: the " +
|
|
105
|
+
"dialectic answers from accumulated memory — seconds, not milliseconds, so ask when a read will not do.",
|
|
106
|
+
inputSchema: {
|
|
107
|
+
type: "object",
|
|
108
|
+
properties: {
|
|
109
|
+
peer: { type: "string", description: "Wheel node id, name, or Honcho peer id" },
|
|
110
|
+
question: { type: "string", description: "Ask the dialectic instead of reading the representation" },
|
|
111
|
+
session_id: { type: "string", description: "Scope to one Honcho session (a ceremony id is mapped)" },
|
|
112
|
+
reasoning_level: { type: "string", enum: ["minimal", "low", "medium", "high", "max"], description: "For a question; pick the lowest that answers" },
|
|
113
|
+
},
|
|
114
|
+
required: ["peer"],
|
|
115
|
+
},
|
|
116
|
+
handler: async (args) => {
|
|
117
|
+
const c = client();
|
|
118
|
+
if (!isClient(c))
|
|
119
|
+
return c;
|
|
120
|
+
const peer = honchoIdFor(String(args.peer));
|
|
121
|
+
const session_id = args.session_id ? honchoIdFor(String(args.session_id)) : undefined;
|
|
122
|
+
try {
|
|
123
|
+
if (args.question) {
|
|
124
|
+
const answer = await c.peers.chat(peer, String(args.question), { session_id, reasoning_level: args.reasoning_level });
|
|
125
|
+
return { status: "ok", peer, question: args.question, answer };
|
|
126
|
+
}
|
|
127
|
+
const representation = await c.peers.representation(peer, { session_id });
|
|
128
|
+
return {
|
|
129
|
+
status: "ok",
|
|
130
|
+
peer,
|
|
131
|
+
representation,
|
|
132
|
+
...(representation ? {} : { note: "Empty: Honcho has not observed this peer yet, or has not finished reasoning. Project their beats and recall later." }),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
return failure("recall failed", error);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "honcho_project_back",
|
|
142
|
+
description: "Return a conclusion derived in Honcho to the wheel as a `knowledge` node with metadata.kind " +
|
|
143
|
+
"'memory_projection' — the peer, the source event ids, the status (inferred | confirmed | rejected), " +
|
|
144
|
+
"when and by whom it was derived. The wheel stays inspectable: a derived pattern is never stored as a bare fact.",
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
// `peer` is the name honcho_recall uses. Both are accepted here because
|
|
149
|
+
// one concept under two names is a trap a caller falls into once and
|
|
150
|
+
// pays for silently.
|
|
151
|
+
peer: { type: "string", description: "The Honcho peer (or wheel node id) the conclusion is about. Same argument as honcho_recall's `peer`" },
|
|
152
|
+
peer_id: { type: "string", description: "Alias of `peer`, kept for callers written against the first release" },
|
|
153
|
+
content: { type: "string", description: "The conclusion, in words" },
|
|
154
|
+
kind: { type: "string", enum: ["pattern", "summary", "open_question", "preference"] },
|
|
155
|
+
status: { type: "string", enum: ["inferred", "confirmed", "rejected"], description: "Default 'inferred'" },
|
|
156
|
+
source_event_ids: { type: "array", items: { type: "string" }, description: "Wheel ids or Honcho message ids it rests on" },
|
|
157
|
+
derived_by: { type: "string", description: "The model or agent that derived it" },
|
|
158
|
+
},
|
|
159
|
+
required: ["content", "kind"],
|
|
160
|
+
},
|
|
161
|
+
handler: async (args) => {
|
|
162
|
+
const named = args.peer ?? args.peer_id;
|
|
163
|
+
if (typeof named !== "string" || !named.trim()) {
|
|
164
|
+
return { status: "error", message: "Name the peer the conclusion is about (`peer`, or its alias `peer_id`)." };
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
const projection = {
|
|
168
|
+
source: "honcho",
|
|
169
|
+
peerId: honchoIdFor(named.trim()),
|
|
170
|
+
content: String(args.content),
|
|
171
|
+
kind: args.kind,
|
|
172
|
+
status: args.status ?? "inferred",
|
|
173
|
+
sourceEventIds: Array.isArray(args.source_event_ids) ? args.source_event_ids.map(String) : [],
|
|
174
|
+
generatedAt: new Date().toISOString(),
|
|
175
|
+
...(args.derived_by ? { derivedBy: String(args.derived_by) } : {}),
|
|
176
|
+
};
|
|
177
|
+
const node = memoryProjectionNode(projection);
|
|
178
|
+
await store.createNode(node);
|
|
179
|
+
return { status: "created", node_id: node.id, node };
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
return failure("projection back failed", error);
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
//# sourceMappingURL=honcho.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"honcho.js","sourceRoot":"","sources":["../../src/tools/honcho.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,eAAe,GAGhB,MA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;QACH,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `required` names a tool's own schema declares, checked before its handler
|
|
3
|
+
* runs.
|
|
4
|
+
*
|
|
5
|
+
* Nothing used to check them. A handler reading `String(args.peer_id)` on a call
|
|
6
|
+
* that omitted `peer_id` produced the *string* `"undefined"` and stored it —
|
|
7
|
+
* `honcho_project_back` wrote a knowledge node with `peer_id: "undefined"` and
|
|
8
|
+
* that word inside its id, and answered `created`. A missing required argument
|
|
9
|
+
* is the caller's error and must be answered as one, never persisted as a
|
|
10
|
+
* record.
|
|
11
|
+
*
|
|
12
|
+
* A schema with no `required` array constrains nothing, which is not the same
|
|
13
|
+
* as a call being valid — a tool that accepts either of two arguments still
|
|
14
|
+
* checks that in its handler.
|
|
15
|
+
*/
|
|
16
|
+
export declare function missingRequired(inputSchema: unknown, args: Record<string, unknown>): string[];
|
|
17
|
+
//# sourceMappingURL=validate-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-args.d.ts","sourceRoot":"","sources":["../src/validate-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,OAAO,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,EAAE,CAOV"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `required` names a tool's own schema declares, checked before its handler
|
|
3
|
+
* runs.
|
|
4
|
+
*
|
|
5
|
+
* Nothing used to check them. A handler reading `String(args.peer_id)` on a call
|
|
6
|
+
* that omitted `peer_id` produced the *string* `"undefined"` and stored it —
|
|
7
|
+
* `honcho_project_back` wrote a knowledge node with `peer_id: "undefined"` and
|
|
8
|
+
* that word inside its id, and answered `created`. A missing required argument
|
|
9
|
+
* is the caller's error and must be answered as one, never persisted as a
|
|
10
|
+
* record.
|
|
11
|
+
*
|
|
12
|
+
* A schema with no `required` array constrains nothing, which is not the same
|
|
13
|
+
* as a call being valid — a tool that accepts either of two arguments still
|
|
14
|
+
* checks that in its handler.
|
|
15
|
+
*/
|
|
16
|
+
export function missingRequired(inputSchema, args) {
|
|
17
|
+
const required = inputSchema?.required;
|
|
18
|
+
if (!Array.isArray(required))
|
|
19
|
+
return [];
|
|
20
|
+
return required.filter((name) => typeof name === "string" && (args[name] === undefined || args[name] === null));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=validate-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-args.js","sourceRoot":"","sources":["../src/validate-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAC7B,WAAoB,EACpB,IAA6B;IAE7B,MAAM,QAAQ,GAAI,WAAyD,EAAE,QAAQ,CAAC;IACtF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IACxC,OAAO,QAAQ,CAAC,MAAM,CACpB,CAAC,IAAI,EAAkB,EAAE,CACvB,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAChF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicine-wheel/mcp",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.1",
|
|
4
4
|
"description": "Medicine Wheel MCP Server — Integrated Indigenous Paradigm Research Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,23 +36,24 @@
|
|
|
36
36
|
"ceremony"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@medicine-wheel/ceremony-protocol": "^0.
|
|
40
|
-
"@medicine-wheel/community-review": "^0.
|
|
41
|
-
"@medicine-wheel/consent-lifecycle": "^0.
|
|
42
|
-
"@medicine-wheel/creative-orientation": "^0.
|
|
43
|
-
"@medicine-wheel/fire-keeper": "^0.
|
|
44
|
-
"@medicine-wheel/gap-analysis": "^0.
|
|
45
|
-
"@medicine-wheel/graph-viz": "^0.
|
|
46
|
-
"@medicine-wheel/
|
|
47
|
-
"@medicine-wheel/
|
|
48
|
-
"@medicine-wheel/
|
|
49
|
-
"@medicine-wheel/
|
|
50
|
-
"@medicine-wheel/
|
|
51
|
-
"@medicine-wheel/
|
|
52
|
-
"@medicine-wheel/relational-
|
|
53
|
-
"@medicine-wheel/
|
|
54
|
-
"@medicine-wheel/
|
|
55
|
-
"@medicine-wheel/
|
|
39
|
+
"@medicine-wheel/ceremony-protocol": "^0.15.1",
|
|
40
|
+
"@medicine-wheel/community-review": "^0.15.1",
|
|
41
|
+
"@medicine-wheel/consent-lifecycle": "^0.15.1",
|
|
42
|
+
"@medicine-wheel/creative-orientation": "^0.15.1",
|
|
43
|
+
"@medicine-wheel/fire-keeper": "^0.15.1",
|
|
44
|
+
"@medicine-wheel/gap-analysis": "^0.15.1",
|
|
45
|
+
"@medicine-wheel/graph-viz": "^0.15.1",
|
|
46
|
+
"@medicine-wheel/honcho": "^0.15.1",
|
|
47
|
+
"@medicine-wheel/importance-unit": "^0.15.1",
|
|
48
|
+
"@medicine-wheel/infra": "^0.15.1",
|
|
49
|
+
"@medicine-wheel/narrative-engine": "^0.15.1",
|
|
50
|
+
"@medicine-wheel/ontology-core": "^0.15.1",
|
|
51
|
+
"@medicine-wheel/prompt-decomposition": "^0.15.1",
|
|
52
|
+
"@medicine-wheel/relational-index": "^0.15.1",
|
|
53
|
+
"@medicine-wheel/relational-query": "^0.15.1",
|
|
54
|
+
"@medicine-wheel/session-reader": "^0.15.1",
|
|
55
|
+
"@medicine-wheel/transformation-tracker": "^0.15.1",
|
|
56
|
+
"@medicine-wheel/ui-components": "^0.15.1",
|
|
56
57
|
"@modelcontextprotocol/sdk": "^1.12.1"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|