@getmarrow/mcp 2.3.5 → 2.5.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.
- package/README.md +76 -1
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +373 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +109 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -125
- package/dist/index.js.map +1 -0
- package/package.json +8 -22
- package/dist/client.d.ts +0 -86
- package/dist/client.js +0 -233
- package/dist/tools/check.d.ts +0 -23
- package/dist/tools/check.js +0 -26
- package/dist/tools/commit.d.ts +0 -51
- package/dist/tools/commit.js +0 -46
- package/dist/tools/orient.d.ts +0 -33
- package/dist/tools/orient.js +0 -30
- package/dist/tools/patterns.d.ts +0 -15
- package/dist/tools/patterns.js +0 -21
- package/dist/tools/think.d.ts +0 -67
- package/dist/tools/think.js +0 -57
package/README.md
CHANGED
|
@@ -10,6 +10,15 @@ With `@getmarrow/mcp`, any MCP-compatible client can log intent before acting, i
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## What's New in v2.5.0
|
|
14
|
+
|
|
15
|
+
- **`marrow_run` tool** — single-call memory logging. Pass description + success + outcome. Marrow handles orient → think → commit internally.
|
|
16
|
+
- **`MARROW_SESSION_ID` env var** — tag all requests with a session identifier
|
|
17
|
+
- **Auto-commit on session close** — if session ends with an open loop, Marrow commits automatically
|
|
18
|
+
- **Orient warnings in think response** — startup warnings now surface in `marrow_think` intelligence, not just stderr
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
13
22
|
## What's New in v2.3.4
|
|
14
23
|
|
|
15
24
|
### Loop enforcement is now part of the MCP workflow
|
|
@@ -174,7 +183,7 @@ Returns:
|
|
|
174
183
|
|
|
175
184
|
Typical use:
|
|
176
185
|
- before handoff
|
|
177
|
-
- before
|
|
186
|
+
- before "done"
|
|
178
187
|
- before outbound updates after meaningful work
|
|
179
188
|
|
|
180
189
|
### `marrow_commit` / `commit`
|
|
@@ -190,6 +199,24 @@ Typical use:
|
|
|
190
199
|
- after a deploy / publish / send / write succeeds or fails
|
|
191
200
|
- before a clean handoff or completion
|
|
192
201
|
|
|
202
|
+
### `marrow_run` — Zero-ceremony wrapper
|
|
203
|
+
|
|
204
|
+
Single call. Handles orient → think → commit automatically.
|
|
205
|
+
|
|
206
|
+
Input:
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"description": "What the agent did",
|
|
210
|
+
"success": true,
|
|
211
|
+
"outcome": "One-line summary of what happened",
|
|
212
|
+
"type": "implementation"
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Returns: `{ decision_id, success_rate, insight, intelligence }`
|
|
217
|
+
|
|
218
|
+
Use this when you want memory logging without managing the loop manually.
|
|
219
|
+
|
|
193
220
|
### `patterns`
|
|
194
221
|
Inspect accumulated decision patterns.
|
|
195
222
|
|
|
@@ -200,6 +227,36 @@ Typical use:
|
|
|
200
227
|
|
|
201
228
|
---
|
|
202
229
|
|
|
230
|
+
## Zero-Ceremony Mode
|
|
231
|
+
|
|
232
|
+
Use `marrow_run` instead of chaining `marrow_think` + `marrow_commit`:
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"tool": "marrow_run",
|
|
237
|
+
"input": {
|
|
238
|
+
"description": "Refactored auth service to add retry logic",
|
|
239
|
+
"success": true,
|
|
240
|
+
"outcome": "Auth refactored. Exponential backoff added. Tests passing.",
|
|
241
|
+
"type": "implementation"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Marrow handles the full loop internally.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Environment Variables
|
|
251
|
+
|
|
252
|
+
| Variable | Required | Description |
|
|
253
|
+
|----------|----------|-------------|
|
|
254
|
+
| `MARROW_API_KEY` | Yes | Your Marrow API key (starts with `mrw_`) |
|
|
255
|
+
| `MARROW_BASE_URL` | No | Override API base URL (default: `https://api.getmarrow.ai`) |
|
|
256
|
+
| `MARROW_SESSION_ID` | No | Session identifier — sent as `X-Marrow-Session-Id` on all requests |
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
203
260
|
## Example Workflow
|
|
204
261
|
|
|
205
262
|
### Example: deployment task
|
|
@@ -255,6 +312,24 @@ With Marrow MCP:
|
|
|
255
312
|
|
|
256
313
|
---
|
|
257
314
|
|
|
315
|
+
## Privacy, Sanitization, and Data Ownership
|
|
316
|
+
|
|
317
|
+
Marrow should make agents smarter **without turning user sessions into careless raw-data collection**.
|
|
318
|
+
|
|
319
|
+
Key trust properties:
|
|
320
|
+
- sensitive inputs can be sanitized before storage when possible
|
|
321
|
+
- privacy-preserving learning matters more than retaining raw personal data forever
|
|
322
|
+
- MCP hosts should pass API keys through environment variables, not embed them in source or config blobs committed to git
|
|
323
|
+
- the product direction is anonymized pattern learning, not exposing private user context across the hive
|
|
324
|
+
- users should be able to export and own their memory data instead of being trapped in a closed system
|
|
325
|
+
|
|
326
|
+
In short:
|
|
327
|
+
- better agent memory
|
|
328
|
+
- stronger privacy posture
|
|
329
|
+
- clearer user ownership
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
258
333
|
## Session Hint
|
|
259
334
|
|
|
260
335
|
At session start, Marrow nudges clients with the canonical reminder:
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Marrow MCP stdio server — collective memory for Claude and MCP agents.
|
|
5
|
+
* Exposes: marrow_orient (call first!), marrow_think, marrow_commit, marrow_status
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
24
|
+
if (mod && mod.__esModule) return mod;
|
|
25
|
+
var result = {};
|
|
26
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
27
|
+
__setModuleDefault(result, mod);
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
const readline = __importStar(require("readline"));
|
|
32
|
+
const index_1 = require("./index");
|
|
33
|
+
const API_KEY = process.env.MARROW_API_KEY || '';
|
|
34
|
+
const BASE_URL = process.env.MARROW_BASE_URL || 'https://api.getmarrow.ai';
|
|
35
|
+
const SESSION_ID = process.env.MARROW_SESSION_ID || undefined;
|
|
36
|
+
if (!API_KEY) {
|
|
37
|
+
process.stderr.write('Error: MARROW_API_KEY environment variable is required\n');
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
// Auto-orient on startup — cache warnings, inject into first marrow_think response
|
|
41
|
+
let cachedOrientWarnings = [];
|
|
42
|
+
(0, index_1.marrowOrient)(API_KEY, BASE_URL, undefined, SESSION_ID).then(r => {
|
|
43
|
+
cachedOrientWarnings = r.warnings;
|
|
44
|
+
if (r.shouldPause) {
|
|
45
|
+
process.stderr.write(`[marrow] ⚠️ High failure rate detected on startup — call marrow_orient for details before acting\n`);
|
|
46
|
+
}
|
|
47
|
+
}).catch(() => { });
|
|
48
|
+
// Auto-commit tracking for session close
|
|
49
|
+
let lastDecisionId = null;
|
|
50
|
+
let lastCommitted = false;
|
|
51
|
+
async function autoCommitOnClose() {
|
|
52
|
+
if (lastDecisionId && !lastCommitted) {
|
|
53
|
+
try {
|
|
54
|
+
const controller = new AbortController();
|
|
55
|
+
const timeout = setTimeout(() => controller.abort(), 3000);
|
|
56
|
+
await (0, index_1.marrowCommit)(API_KEY, BASE_URL, {
|
|
57
|
+
decision_id: lastDecisionId,
|
|
58
|
+
success: true,
|
|
59
|
+
outcome: 'Session ended',
|
|
60
|
+
}, SESSION_ID);
|
|
61
|
+
clearTimeout(timeout);
|
|
62
|
+
}
|
|
63
|
+
catch { }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
process.on('SIGTERM', async () => {
|
|
67
|
+
const forceExit = setTimeout(() => process.exit(0), 5000);
|
|
68
|
+
forceExit.unref();
|
|
69
|
+
await autoCommitOnClose();
|
|
70
|
+
process.exit(0);
|
|
71
|
+
});
|
|
72
|
+
process.stdin.on('end', async () => { await autoCommitOnClose(); });
|
|
73
|
+
function send(response) {
|
|
74
|
+
process.stdout.write(JSON.stringify(response) + '\n');
|
|
75
|
+
}
|
|
76
|
+
function success(id, result) {
|
|
77
|
+
send({ jsonrpc: '2.0', id, result });
|
|
78
|
+
}
|
|
79
|
+
function error(id, code, message) {
|
|
80
|
+
send({ jsonrpc: '2.0', id, error: { code, message } });
|
|
81
|
+
}
|
|
82
|
+
// Tool definitions
|
|
83
|
+
const TOOLS = [
|
|
84
|
+
{
|
|
85
|
+
name: 'marrow_orient',
|
|
86
|
+
description: '⚡ CALL THIS FIRST at the start of every session or task — before marrow_think, before any action. ' +
|
|
87
|
+
'Returns failure warnings from your hive history so you avoid known mistakes immediately. ' +
|
|
88
|
+
'If shouldPause=true, query for lessons before proceeding. ' +
|
|
89
|
+
'This is what makes Marrow compound — orient() reads, think() writes. Both are required.',
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {
|
|
93
|
+
taskType: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
enum: ['implementation', 'security', 'architecture', 'process', 'general'],
|
|
96
|
+
description: 'Optional: filter warnings to a specific task type you are about to perform',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: [],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'marrow_think',
|
|
104
|
+
description: 'Get collective intelligence from the Marrow hive before acting. ' +
|
|
105
|
+
'Returns pattern insights, failure detection, workflow gaps, and semantic clustering. ' +
|
|
106
|
+
'Call this before every significant action. Pass previous_outcome ' +
|
|
107
|
+
'to auto-commit your last action and open a new memory session. ' +
|
|
108
|
+
'Response includes: decision_id, insight (string), insights[] (ActionableInsight[]), cluster_id.',
|
|
109
|
+
inputSchema: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
action: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
description: 'What the agent is about to do',
|
|
115
|
+
},
|
|
116
|
+
type: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
enum: ['implementation', 'security', 'architecture', 'process', 'general'],
|
|
119
|
+
description: 'Type of action (default: general)',
|
|
120
|
+
},
|
|
121
|
+
context: {
|
|
122
|
+
type: 'object',
|
|
123
|
+
description: 'Optional metadata about the current situation',
|
|
124
|
+
},
|
|
125
|
+
previous_decision_id: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
description: 'decision_id from previous think() call — auto-commits that session',
|
|
128
|
+
},
|
|
129
|
+
previous_success: {
|
|
130
|
+
type: 'boolean',
|
|
131
|
+
description: 'Did the previous action succeed?',
|
|
132
|
+
},
|
|
133
|
+
previous_outcome: {
|
|
134
|
+
type: 'string',
|
|
135
|
+
description: 'What happened in the previous action (required if previous_decision_id provided)',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
required: ['action'],
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'marrow_commit',
|
|
143
|
+
description: 'Explicitly commit the result of an action to Marrow. ' +
|
|
144
|
+
'Optional — marrow_think() auto-commits if you pass previous_outcome. ' +
|
|
145
|
+
'Use when you need explicit control over commit timing.',
|
|
146
|
+
inputSchema: {
|
|
147
|
+
type: 'object',
|
|
148
|
+
properties: {
|
|
149
|
+
decision_id: {
|
|
150
|
+
type: 'string',
|
|
151
|
+
description: 'decision_id from the marrow_think call',
|
|
152
|
+
},
|
|
153
|
+
success: {
|
|
154
|
+
type: 'boolean',
|
|
155
|
+
description: 'Did the action succeed?',
|
|
156
|
+
},
|
|
157
|
+
outcome: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
description: 'What happened — be specific, this trains the hive',
|
|
160
|
+
},
|
|
161
|
+
caused_by: {
|
|
162
|
+
type: 'string',
|
|
163
|
+
description: 'Optional: what caused this action',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
required: ['decision_id', 'success', 'outcome'],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'marrow_run',
|
|
171
|
+
description: 'Single-call task wrapper. Automatically handles orient → think → commit. ' +
|
|
172
|
+
'Use instead of chaining marrow_think + marrow_commit separately.',
|
|
173
|
+
inputSchema: {
|
|
174
|
+
type: 'object',
|
|
175
|
+
properties: {
|
|
176
|
+
description: {
|
|
177
|
+
type: 'string',
|
|
178
|
+
description: 'What the agent did',
|
|
179
|
+
},
|
|
180
|
+
success: {
|
|
181
|
+
type: 'boolean',
|
|
182
|
+
description: 'Whether it succeeded',
|
|
183
|
+
},
|
|
184
|
+
outcome: {
|
|
185
|
+
type: 'string',
|
|
186
|
+
description: 'One-line summary of what happened',
|
|
187
|
+
},
|
|
188
|
+
type: {
|
|
189
|
+
type: 'string',
|
|
190
|
+
enum: ['implementation', 'security', 'architecture', 'process', 'general'],
|
|
191
|
+
description: 'Type of action (default: general)',
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
required: ['description', 'success', 'outcome'],
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'marrow_status',
|
|
199
|
+
description: 'Check Marrow platform health and status.',
|
|
200
|
+
inputSchema: {
|
|
201
|
+
type: 'object',
|
|
202
|
+
properties: {},
|
|
203
|
+
required: [],
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
];
|
|
207
|
+
// Request handler
|
|
208
|
+
async function handleRequest(req) {
|
|
209
|
+
const { id, method, params } = req;
|
|
210
|
+
try {
|
|
211
|
+
if (method === 'initialize') {
|
|
212
|
+
success(id, {
|
|
213
|
+
protocolVersion: '2024-11-05',
|
|
214
|
+
capabilities: { tools: {} },
|
|
215
|
+
serverInfo: { name: 'marrow', version: '2.5.0' },
|
|
216
|
+
});
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (method === 'tools/list') {
|
|
220
|
+
success(id, { tools: TOOLS });
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (method === 'tools/call') {
|
|
224
|
+
const toolName = params?.name;
|
|
225
|
+
const args = (params?.arguments || {});
|
|
226
|
+
if (toolName === 'marrow_orient') {
|
|
227
|
+
const result = await (0, index_1.marrowOrient)(API_KEY, BASE_URL, {
|
|
228
|
+
taskType: args.taskType,
|
|
229
|
+
}, SESSION_ID);
|
|
230
|
+
success(id, {
|
|
231
|
+
content: [
|
|
232
|
+
{
|
|
233
|
+
type: 'text',
|
|
234
|
+
text: JSON.stringify(result, null, 2),
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
});
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
if (toolName === 'marrow_think') {
|
|
241
|
+
const result = await (0, index_1.marrowThink)(API_KEY, BASE_URL, {
|
|
242
|
+
action: args.action,
|
|
243
|
+
type: args.type,
|
|
244
|
+
context: args.context,
|
|
245
|
+
previous_decision_id: args.previous_decision_id,
|
|
246
|
+
previous_success: args.previous_success,
|
|
247
|
+
previous_outcome: args.previous_outcome,
|
|
248
|
+
}, SESSION_ID);
|
|
249
|
+
// Inject startup orient warnings into first think() response
|
|
250
|
+
if (cachedOrientWarnings.length > 0) {
|
|
251
|
+
const intel = result.intelligence;
|
|
252
|
+
const existing = intel.insights || [];
|
|
253
|
+
intel.insights = [
|
|
254
|
+
...cachedOrientWarnings.map(w => ({
|
|
255
|
+
type: 'failure_pattern',
|
|
256
|
+
summary: w.message,
|
|
257
|
+
action: `Review past ${w.type} failures before proceeding`,
|
|
258
|
+
severity: w.failureRate > 0.4 ? 'critical' : 'warning',
|
|
259
|
+
count: 0,
|
|
260
|
+
})),
|
|
261
|
+
...existing,
|
|
262
|
+
];
|
|
263
|
+
cachedOrientWarnings = []; // clear after first injection
|
|
264
|
+
}
|
|
265
|
+
// Track for auto-commit on session close
|
|
266
|
+
lastDecisionId = result.decision_id;
|
|
267
|
+
lastCommitted = false;
|
|
268
|
+
success(id, {
|
|
269
|
+
content: [
|
|
270
|
+
{
|
|
271
|
+
type: 'text',
|
|
272
|
+
text: JSON.stringify(result, null, 2),
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
});
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (toolName === 'marrow_commit') {
|
|
279
|
+
const result = await (0, index_1.marrowCommit)(API_KEY, BASE_URL, {
|
|
280
|
+
decision_id: args.decision_id,
|
|
281
|
+
success: args.success,
|
|
282
|
+
outcome: args.outcome,
|
|
283
|
+
caused_by: args.caused_by,
|
|
284
|
+
}, SESSION_ID);
|
|
285
|
+
lastCommitted = true;
|
|
286
|
+
success(id, {
|
|
287
|
+
content: [
|
|
288
|
+
{
|
|
289
|
+
type: 'text',
|
|
290
|
+
text: JSON.stringify(result, null, 2),
|
|
291
|
+
},
|
|
292
|
+
],
|
|
293
|
+
});
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (toolName === 'marrow_run') {
|
|
297
|
+
const description = args.description;
|
|
298
|
+
const type = args.type || 'general';
|
|
299
|
+
const runSuccess = args.success;
|
|
300
|
+
const outcome = args.outcome;
|
|
301
|
+
const thinkResult = await (0, index_1.marrowThink)(API_KEY, BASE_URL, {
|
|
302
|
+
action: description,
|
|
303
|
+
type,
|
|
304
|
+
}, SESSION_ID);
|
|
305
|
+
const commitResult = await (0, index_1.marrowCommit)(API_KEY, BASE_URL, {
|
|
306
|
+
decision_id: thinkResult.decision_id,
|
|
307
|
+
success: runSuccess,
|
|
308
|
+
outcome,
|
|
309
|
+
}, SESSION_ID);
|
|
310
|
+
lastCommitted = true;
|
|
311
|
+
lastDecisionId = thinkResult.decision_id;
|
|
312
|
+
success(id, {
|
|
313
|
+
content: [
|
|
314
|
+
{
|
|
315
|
+
type: 'text',
|
|
316
|
+
text: JSON.stringify({
|
|
317
|
+
decision_id: thinkResult.decision_id,
|
|
318
|
+
success_rate: commitResult.success_rate,
|
|
319
|
+
insight: commitResult.insight,
|
|
320
|
+
intelligence: thinkResult.intelligence,
|
|
321
|
+
}, null, 2),
|
|
322
|
+
},
|
|
323
|
+
],
|
|
324
|
+
});
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
if (toolName === 'marrow_status') {
|
|
328
|
+
const result = await (0, index_1.marrowStatus)(API_KEY, BASE_URL, SESSION_ID);
|
|
329
|
+
success(id, {
|
|
330
|
+
content: [
|
|
331
|
+
{
|
|
332
|
+
type: 'text',
|
|
333
|
+
text: JSON.stringify(result, null, 2),
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
});
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
error(id, -32601, `Unknown tool: ${toolName}`);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
// Unknown method
|
|
343
|
+
error(id, -32601, `Method not found: ${method}`);
|
|
344
|
+
}
|
|
345
|
+
catch (err) {
|
|
346
|
+
const msg = err instanceof Error ? err.message.slice(0, 200) : 'Internal error';
|
|
347
|
+
error(id, -32603, msg);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
// stdio server
|
|
351
|
+
const rl = readline.createInterface({
|
|
352
|
+
input: process.stdin,
|
|
353
|
+
output: process.stdout,
|
|
354
|
+
terminal: false,
|
|
355
|
+
});
|
|
356
|
+
rl.on('line', (line) => {
|
|
357
|
+
const trimmed = line.trim();
|
|
358
|
+
if (!trimmed)
|
|
359
|
+
return;
|
|
360
|
+
try {
|
|
361
|
+
const req = JSON.parse(trimmed);
|
|
362
|
+
handleRequest(req).catch((err) => {
|
|
363
|
+
process.stderr.write(`Unhandled error: ${err}\n`);
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
catch {
|
|
367
|
+
process.stderr.write(`Failed to parse request: ${trimmed}\n`);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
rl.on('close', () => {
|
|
371
|
+
process.exit(0);
|
|
372
|
+
});
|
|
373
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAEA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AACrC,mCAAgF;AAEhF,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;AACjD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,0BAA0B,CAAC;AAC3E,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,S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AAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,OAAO,IAAI,CAAC,CAAC;IAChE,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;IAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface ActionableInsight {
|
|
2
|
+
type: 'frequency' | 'failure_pattern' | 'workflow_gap' | 'hive_trend';
|
|
3
|
+
summary: string;
|
|
4
|
+
action: string;
|
|
5
|
+
severity: 'info' | 'warning' | 'critical';
|
|
6
|
+
count: number;
|
|
7
|
+
}
|
|
8
|
+
export interface MarrowIntelligence {
|
|
9
|
+
similar: Array<{
|
|
10
|
+
outcome: string;
|
|
11
|
+
confidence: number;
|
|
12
|
+
}>;
|
|
13
|
+
similar_count: number;
|
|
14
|
+
patterns: Array<{
|
|
15
|
+
pattern_id: string;
|
|
16
|
+
decision_type: string;
|
|
17
|
+
frequency: number;
|
|
18
|
+
confidence: number;
|
|
19
|
+
}>;
|
|
20
|
+
patterns_count: number;
|
|
21
|
+
templates: Array<{
|
|
22
|
+
steps: unknown[];
|
|
23
|
+
success_rate: number;
|
|
24
|
+
}>;
|
|
25
|
+
shared: Array<{
|
|
26
|
+
outcome: string;
|
|
27
|
+
}>;
|
|
28
|
+
causal_chain: unknown | null;
|
|
29
|
+
success_rate: number;
|
|
30
|
+
priority_score: number;
|
|
31
|
+
insight: string | null;
|
|
32
|
+
insights: ActionableInsight[];
|
|
33
|
+
cluster_id: string | null;
|
|
34
|
+
}
|
|
35
|
+
export interface ThinkResult {
|
|
36
|
+
decision_id: string;
|
|
37
|
+
intelligence: MarrowIntelligence;
|
|
38
|
+
stream_url: string;
|
|
39
|
+
previous_committed?: boolean;
|
|
40
|
+
sanitized?: boolean;
|
|
41
|
+
upgrade_hint?: {
|
|
42
|
+
message: string;
|
|
43
|
+
tier: string;
|
|
44
|
+
url: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface CommitResult {
|
|
48
|
+
committed: boolean;
|
|
49
|
+
success_rate: number;
|
|
50
|
+
insight: string | null;
|
|
51
|
+
}
|
|
52
|
+
export interface StatusResult {
|
|
53
|
+
status: string;
|
|
54
|
+
version: string;
|
|
55
|
+
tiers: number;
|
|
56
|
+
uptime_ms: number;
|
|
57
|
+
}
|
|
58
|
+
export declare function marrowThink(apiKey: string, baseUrl: string, params: {
|
|
59
|
+
action: string;
|
|
60
|
+
type?: string;
|
|
61
|
+
context?: Record<string, unknown>;
|
|
62
|
+
previous_decision_id?: string;
|
|
63
|
+
previous_success?: boolean;
|
|
64
|
+
previous_outcome?: string;
|
|
65
|
+
}, sessionId?: string): Promise<ThinkResult>;
|
|
66
|
+
export declare function marrowCommit(apiKey: string, baseUrl: string, params: {
|
|
67
|
+
decision_id: string;
|
|
68
|
+
success: boolean;
|
|
69
|
+
outcome: string;
|
|
70
|
+
caused_by?: string;
|
|
71
|
+
}, sessionId?: string): Promise<CommitResult>;
|
|
72
|
+
export interface AgentPatternsResult {
|
|
73
|
+
failure_patterns: Array<{
|
|
74
|
+
decision_type: string;
|
|
75
|
+
failure_rate: number;
|
|
76
|
+
count: number;
|
|
77
|
+
last_seen: string;
|
|
78
|
+
}>;
|
|
79
|
+
recurring_decisions: Array<{
|
|
80
|
+
decision_type: string;
|
|
81
|
+
frequency: number;
|
|
82
|
+
avg_confidence: number;
|
|
83
|
+
trend: string;
|
|
84
|
+
}>;
|
|
85
|
+
behavioral_drift: {
|
|
86
|
+
success_rate_7d: number;
|
|
87
|
+
success_rate_30d: number;
|
|
88
|
+
drift: string;
|
|
89
|
+
direction: string;
|
|
90
|
+
};
|
|
91
|
+
top_failure_types: string[];
|
|
92
|
+
generated_at: string;
|
|
93
|
+
}
|
|
94
|
+
export declare function marrowAgentPatterns(apiKey: string, baseUrl: string, params?: {
|
|
95
|
+
type?: string;
|
|
96
|
+
limit?: number;
|
|
97
|
+
}, sessionId?: string): Promise<AgentPatternsResult>;
|
|
98
|
+
export declare function marrowOrient(apiKey: string, baseUrl: string, params?: {
|
|
99
|
+
taskType?: string;
|
|
100
|
+
}, sessionId?: string): Promise<{
|
|
101
|
+
warnings: Array<{
|
|
102
|
+
type: string;
|
|
103
|
+
failureRate: number;
|
|
104
|
+
message: string;
|
|
105
|
+
}>;
|
|
106
|
+
shouldPause: boolean;
|
|
107
|
+
}>;
|
|
108
|
+
export declare function marrowStatus(apiKey: string, baseUrl: string, sessionId?: string): Promise<StatusResult>;
|
|
109
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,cAAc,GAAG,YAAY,CAAC;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,M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