@spilno/herald-mcp 1.0.0 → 1.1.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 (2) hide show
  1. package/dist/index.js +86 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -85,7 +85,7 @@ const tools = [
85
85
  },
86
86
  {
87
87
  name: "herald_predict",
88
- description: "Generate non-deterministic structure prediction from signal",
88
+ description: "Generate non-deterministic structure prediction from signal. Returns sessionId for multi-turn conversations.",
89
89
  inputSchema: {
90
90
  type: "object",
91
91
  properties: {
@@ -93,26 +93,62 @@ const tools = [
93
93
  type: "string",
94
94
  description: "Natural language input (e.g., 'create safety assessment module')",
95
95
  },
96
- context_id: {
97
- type: "string",
98
- description: "Context identifier (user/company)",
99
- },
100
96
  context: {
101
97
  type: "string",
102
98
  description: "Additional context for better prediction",
103
99
  },
104
100
  session_id: {
105
101
  type: "string",
106
- description: "Optional session for continuity",
102
+ description: "Session ID for multi-turn conversations (returned from previous predict/refine)",
107
103
  },
108
- domain: {
104
+ participant: {
109
105
  type: "string",
110
- description: "Optional domain filter (e.g., 'hse')",
106
+ description: "Participant name (e.g., 'user', 'architect', 'compliance')",
111
107
  },
112
108
  },
113
109
  required: ["signal"],
114
110
  },
115
111
  },
112
+ {
113
+ name: "herald_refine",
114
+ description: "Refine an existing prediction with additional requirements. Use session_id from previous predict call.",
115
+ inputSchema: {
116
+ type: "object",
117
+ properties: {
118
+ session_id: {
119
+ type: "string",
120
+ description: "Session ID from previous predict or refine call",
121
+ },
122
+ refinement: {
123
+ type: "string",
124
+ description: "Refinement instruction (e.g., 'make it OSHA compliant', 'add corrective actions section')",
125
+ },
126
+ context: {
127
+ type: "string",
128
+ description: "Additional context for refinement",
129
+ },
130
+ participant: {
131
+ type: "string",
132
+ description: "Participant name (e.g., 'user', 'architect', 'compliance')",
133
+ },
134
+ },
135
+ required: ["session_id", "refinement"],
136
+ },
137
+ },
138
+ {
139
+ name: "herald_session",
140
+ description: "Get session information including history of all predictions and refinements",
141
+ inputSchema: {
142
+ type: "object",
143
+ properties: {
144
+ session_id: {
145
+ type: "string",
146
+ description: "Session ID to retrieve",
147
+ },
148
+ },
149
+ required: ["session_id"],
150
+ },
151
+ },
116
152
  {
117
153
  name: "herald_observe",
118
154
  description: "Record prediction outcome for learning",
@@ -180,8 +216,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
180
216
  }
181
217
  ] : [];
182
218
  const result = await callCedaAPI("/api/predict", "POST", {
183
- input: params.signal, // CEDA uses 'input' not 'signal'
219
+ input: params.signal,
184
220
  context,
221
+ sessionId: params.session_id,
222
+ participant: params.participant,
185
223
  config: {
186
224
  enableAutoFix: true,
187
225
  maxAutoFixAttempts: 3,
@@ -196,6 +234,45 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
196
234
  ],
197
235
  };
198
236
  }
237
+ case "herald_refine": {
238
+ // Maps to: POST /api/refine
239
+ const params = args;
240
+ // Build context array if additional context provided
241
+ const context = params.context ? [
242
+ {
243
+ type: "refinement_context",
244
+ value: params.context,
245
+ source: "herald_mcp",
246
+ }
247
+ ] : [];
248
+ const result = await callCedaAPI("/api/refine", "POST", {
249
+ sessionId: params.session_id,
250
+ refinement: params.refinement,
251
+ context,
252
+ participant: params.participant,
253
+ });
254
+ return {
255
+ content: [
256
+ {
257
+ type: "text",
258
+ text: JSON.stringify(result, null, 2),
259
+ },
260
+ ],
261
+ };
262
+ }
263
+ case "herald_session": {
264
+ // Maps to: GET /api/session/:id
265
+ const params = args;
266
+ const result = await callCedaAPI(`/api/session/${params.session_id}`);
267
+ return {
268
+ content: [
269
+ {
270
+ type: "text",
271
+ text: JSON.stringify(result, null, 2),
272
+ },
273
+ ],
274
+ };
275
+ }
199
276
  case "herald_observe": {
200
277
  // Maps to: POST /api/feedback
201
278
  const params = args;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spilno/herald-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Herald MCP - Diplomatic interface to CEDA (Cognitive Event-Driven Architecture)",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",