@getmarrow/mcp 2.3.6 → 2.6.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 +70 -1
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +427 -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
|
|
@@ -115,6 +124,18 @@ If your MCP host supports command-based servers, point it at:
|
|
|
115
124
|
|
|
116
125
|
---
|
|
117
126
|
|
|
127
|
+
## Automatic Prompts (Zero-Config)
|
|
128
|
+
|
|
129
|
+
When added to a compatible MCP client, Marrow automatically exposes a `marrow-always-on` prompt that instructs your agent to use the memory loop without any manual setup.
|
|
130
|
+
|
|
131
|
+
In Claude Desktop — the prompt appears in the prompt picker. Select it once and your agent orients, thinks, and commits automatically every session.
|
|
132
|
+
|
|
133
|
+
In compatible clients — the prompt can be auto-injected into the system context so the loop fires without the user doing anything.
|
|
134
|
+
|
|
135
|
+
This is how Marrow works right after install with zero user instruction.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
118
139
|
## When to Use MCP vs SDK
|
|
119
140
|
|
|
120
141
|
Use **`@getmarrow/mcp`** when:
|
|
@@ -174,7 +195,7 @@ Returns:
|
|
|
174
195
|
|
|
175
196
|
Typical use:
|
|
176
197
|
- before handoff
|
|
177
|
-
- before
|
|
198
|
+
- before "done"
|
|
178
199
|
- before outbound updates after meaningful work
|
|
179
200
|
|
|
180
201
|
### `marrow_commit` / `commit`
|
|
@@ -190,6 +211,24 @@ Typical use:
|
|
|
190
211
|
- after a deploy / publish / send / write succeeds or fails
|
|
191
212
|
- before a clean handoff or completion
|
|
192
213
|
|
|
214
|
+
### `marrow_run` — Zero-ceremony wrapper
|
|
215
|
+
|
|
216
|
+
Single call. Handles orient → think → commit automatically.
|
|
217
|
+
|
|
218
|
+
Input:
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"description": "What the agent did",
|
|
222
|
+
"success": true,
|
|
223
|
+
"outcome": "One-line summary of what happened",
|
|
224
|
+
"type": "implementation"
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Returns: `{ decision_id, success_rate, insight, intelligence }`
|
|
229
|
+
|
|
230
|
+
Use this when you want memory logging without managing the loop manually.
|
|
231
|
+
|
|
193
232
|
### `patterns`
|
|
194
233
|
Inspect accumulated decision patterns.
|
|
195
234
|
|
|
@@ -200,6 +239,36 @@ Typical use:
|
|
|
200
239
|
|
|
201
240
|
---
|
|
202
241
|
|
|
242
|
+
## Zero-Ceremony Mode
|
|
243
|
+
|
|
244
|
+
Use `marrow_run` instead of chaining `marrow_think` + `marrow_commit`:
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"tool": "marrow_run",
|
|
249
|
+
"input": {
|
|
250
|
+
"description": "Refactored auth service to add retry logic",
|
|
251
|
+
"success": true,
|
|
252
|
+
"outcome": "Auth refactored. Exponential backoff added. Tests passing.",
|
|
253
|
+
"type": "implementation"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Marrow handles the full loop internally.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Environment Variables
|
|
263
|
+
|
|
264
|
+
| Variable | Required | Description |
|
|
265
|
+
|----------|----------|-------------|
|
|
266
|
+
| `MARROW_API_KEY` | Yes | Your Marrow API key (starts with `mrw_`) |
|
|
267
|
+
| `MARROW_BASE_URL` | No | Override API base URL (default: `https://api.getmarrow.ai`) |
|
|
268
|
+
| `MARROW_SESSION_ID` | No | Session identifier — sent as `X-Marrow-Session-Id` on all requests |
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
203
272
|
## Example Workflow
|
|
204
273
|
|
|
205
274
|
### Example: deployment task
|
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,427 @@
|
|
|
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 — every session, before any other tool. ' +
|
|
87
|
+
'Returns failure warnings from your history so you avoid known mistakes immediately. ' +
|
|
88
|
+
'If shouldPause=true, review lessons before acting. ' +
|
|
89
|
+
'orient() reads from the hive. think() writes to it. Both are required — this is what makes Marrow compound.',
|
|
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: 'Log intent and get collective intelligence before acting. ' +
|
|
105
|
+
'Call this before every meaningful action. ' +
|
|
106
|
+
'Returns pattern insights, similar past decisions, failure detection, and a recommendedNext field — follow it. ' +
|
|
107
|
+
'Pass previous_outcome to auto-commit the last decision and open a new one.',
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: {
|
|
111
|
+
action: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
description: 'What the agent is about to do',
|
|
114
|
+
},
|
|
115
|
+
type: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
enum: ['implementation', 'security', 'architecture', 'process', 'general'],
|
|
118
|
+
description: 'Type of action (default: general)',
|
|
119
|
+
},
|
|
120
|
+
context: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
description: 'Optional metadata about the current situation',
|
|
123
|
+
},
|
|
124
|
+
previous_decision_id: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
description: 'decision_id from previous think() call — auto-commits that session',
|
|
127
|
+
},
|
|
128
|
+
previous_success: {
|
|
129
|
+
type: 'boolean',
|
|
130
|
+
description: 'Did the previous action succeed?',
|
|
131
|
+
},
|
|
132
|
+
previous_outcome: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
description: 'What happened in the previous action (required if previous_decision_id provided)',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
required: ['action'],
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'marrow_commit',
|
|
142
|
+
description: 'Explicitly commit the result of an action to Marrow. ' +
|
|
143
|
+
'Optional — marrow_think() auto-commits if you pass previous_outcome. ' +
|
|
144
|
+
'Use when you need explicit control over commit timing.',
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
decision_id: {
|
|
149
|
+
type: 'string',
|
|
150
|
+
description: 'decision_id from the marrow_think call',
|
|
151
|
+
},
|
|
152
|
+
success: {
|
|
153
|
+
type: 'boolean',
|
|
154
|
+
description: 'Did the action succeed?',
|
|
155
|
+
},
|
|
156
|
+
outcome: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
description: 'What happened — be specific, this trains the hive',
|
|
159
|
+
},
|
|
160
|
+
caused_by: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
description: 'Optional: what caused this action',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
required: ['decision_id', 'success', 'outcome'],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'marrow_run',
|
|
170
|
+
description: 'Zero-ceremony memory logging. Single call handles orient → think → commit automatically. ' +
|
|
171
|
+
'Use this instead of chaining marrow_think + marrow_commit when you want Marrow to just work without managing the loop yourself.',
|
|
172
|
+
inputSchema: {
|
|
173
|
+
type: 'object',
|
|
174
|
+
properties: {
|
|
175
|
+
description: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
description: 'What the agent did',
|
|
178
|
+
},
|
|
179
|
+
success: {
|
|
180
|
+
type: 'boolean',
|
|
181
|
+
description: 'Whether it succeeded',
|
|
182
|
+
},
|
|
183
|
+
outcome: {
|
|
184
|
+
type: 'string',
|
|
185
|
+
description: 'One-line summary of what happened',
|
|
186
|
+
},
|
|
187
|
+
type: {
|
|
188
|
+
type: 'string',
|
|
189
|
+
enum: ['implementation', 'security', 'architecture', 'process', 'general'],
|
|
190
|
+
description: 'Type of action (default: general)',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
required: ['description', 'success', 'outcome'],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: 'marrow_status',
|
|
198
|
+
description: 'Check Marrow platform health and status.',
|
|
199
|
+
inputSchema: {
|
|
200
|
+
type: 'object',
|
|
201
|
+
properties: {},
|
|
202
|
+
required: [],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
];
|
|
206
|
+
// Request handler
|
|
207
|
+
async function handleRequest(req) {
|
|
208
|
+
const { id, method, params } = req;
|
|
209
|
+
try {
|
|
210
|
+
if (method === 'initialize') {
|
|
211
|
+
success(id, {
|
|
212
|
+
protocolVersion: '2024-11-05',
|
|
213
|
+
capabilities: { tools: {}, prompts: {} },
|
|
214
|
+
serverInfo: { name: 'marrow', version: '2.6.0' },
|
|
215
|
+
});
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (method === 'prompts/list') {
|
|
219
|
+
success(id, {
|
|
220
|
+
prompts: [
|
|
221
|
+
{
|
|
222
|
+
name: 'marrow-always-on',
|
|
223
|
+
description: 'Always-on Marrow memory loop. Instructs the agent to orient at session start, log intent before meaningful actions, and commit outcomes after completion. Install once — works automatically.',
|
|
224
|
+
arguments: []
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
});
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (method === 'prompts/get') {
|
|
231
|
+
const promptName = params?.name;
|
|
232
|
+
if (promptName !== 'marrow-always-on') {
|
|
233
|
+
error(id, -32602, 'Unknown prompt');
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
success(id, {
|
|
237
|
+
description: 'Always-on Marrow memory loop',
|
|
238
|
+
messages: [
|
|
239
|
+
{
|
|
240
|
+
role: 'user',
|
|
241
|
+
content: {
|
|
242
|
+
type: 'text',
|
|
243
|
+
text: `You have access to Marrow — a memory system that makes you smarter over time by logging decisions and learning from patterns across agent runs.
|
|
244
|
+
|
|
245
|
+
## How to use Marrow (automatic — no user instruction needed)
|
|
246
|
+
|
|
247
|
+
**At the start of every session:**
|
|
248
|
+
Call marrow_orient first, before anything else. It surfaces failure warnings from your history so you avoid known mistakes.
|
|
249
|
+
|
|
250
|
+
**Before every meaningful action** (deploy, publish, send, write, create, delete, any external action):
|
|
251
|
+
Call marrow_think with what you are about to do. You will get back pattern intelligence from the hive — what worked, what failed, what to watch for. The response includes a recommendedNext field — follow it.
|
|
252
|
+
|
|
253
|
+
**After completing a task:**
|
|
254
|
+
Use marrow_run (single call — handles everything) or call marrow_commit to close the loop. This records the outcome so the next session starts smarter.
|
|
255
|
+
|
|
256
|
+
## The loop
|
|
257
|
+
orient → think → act → commit
|
|
258
|
+
|
|
259
|
+
## Shortcut
|
|
260
|
+
marrow_run handles the full loop in one call. Use it when you want zero ceremony:
|
|
261
|
+
- description: what you did
|
|
262
|
+
- success: true or false
|
|
263
|
+
- outcome: one line of what happened
|
|
264
|
+
|
|
265
|
+
## Why this matters
|
|
266
|
+
Every session you log compounds into the hive. Patterns emerge. Failure rates drop. You stop repeating the same mistakes. This is what makes Marrow compound instead of just log.`
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
});
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (method === 'tools/list') {
|
|
274
|
+
success(id, { tools: TOOLS });
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (method === 'tools/call') {
|
|
278
|
+
const toolName = params?.name;
|
|
279
|
+
const args = (params?.arguments || {});
|
|
280
|
+
if (toolName === 'marrow_orient') {
|
|
281
|
+
const result = await (0, index_1.marrowOrient)(API_KEY, BASE_URL, {
|
|
282
|
+
taskType: args.taskType,
|
|
283
|
+
}, SESSION_ID);
|
|
284
|
+
success(id, {
|
|
285
|
+
content: [
|
|
286
|
+
{
|
|
287
|
+
type: 'text',
|
|
288
|
+
text: JSON.stringify(result, null, 2),
|
|
289
|
+
},
|
|
290
|
+
],
|
|
291
|
+
});
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (toolName === 'marrow_think') {
|
|
295
|
+
const result = await (0, index_1.marrowThink)(API_KEY, BASE_URL, {
|
|
296
|
+
action: args.action,
|
|
297
|
+
type: args.type,
|
|
298
|
+
context: args.context,
|
|
299
|
+
previous_decision_id: args.previous_decision_id,
|
|
300
|
+
previous_success: args.previous_success,
|
|
301
|
+
previous_outcome: args.previous_outcome,
|
|
302
|
+
}, SESSION_ID);
|
|
303
|
+
// Inject startup orient warnings into first think() response
|
|
304
|
+
if (cachedOrientWarnings.length > 0) {
|
|
305
|
+
const intel = result.intelligence;
|
|
306
|
+
const existing = intel.insights || [];
|
|
307
|
+
intel.insights = [
|
|
308
|
+
...cachedOrientWarnings.map(w => ({
|
|
309
|
+
type: 'failure_pattern',
|
|
310
|
+
summary: w.message,
|
|
311
|
+
action: `Review past ${w.type} failures before proceeding`,
|
|
312
|
+
severity: w.failureRate > 0.4 ? 'critical' : 'warning',
|
|
313
|
+
count: 0,
|
|
314
|
+
})),
|
|
315
|
+
...existing,
|
|
316
|
+
];
|
|
317
|
+
cachedOrientWarnings = []; // clear after first injection
|
|
318
|
+
}
|
|
319
|
+
// Track for auto-commit on session close
|
|
320
|
+
lastDecisionId = result.decision_id;
|
|
321
|
+
lastCommitted = false;
|
|
322
|
+
success(id, {
|
|
323
|
+
content: [
|
|
324
|
+
{
|
|
325
|
+
type: 'text',
|
|
326
|
+
text: JSON.stringify(result, null, 2),
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
});
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
if (toolName === 'marrow_commit') {
|
|
333
|
+
const result = await (0, index_1.marrowCommit)(API_KEY, BASE_URL, {
|
|
334
|
+
decision_id: args.decision_id,
|
|
335
|
+
success: args.success,
|
|
336
|
+
outcome: args.outcome,
|
|
337
|
+
caused_by: args.caused_by,
|
|
338
|
+
}, SESSION_ID);
|
|
339
|
+
lastCommitted = true;
|
|
340
|
+
success(id, {
|
|
341
|
+
content: [
|
|
342
|
+
{
|
|
343
|
+
type: 'text',
|
|
344
|
+
text: JSON.stringify(result, null, 2),
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
});
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
if (toolName === 'marrow_run') {
|
|
351
|
+
const description = args.description;
|
|
352
|
+
const type = args.type || 'general';
|
|
353
|
+
const runSuccess = args.success;
|
|
354
|
+
const outcome = args.outcome;
|
|
355
|
+
const thinkResult = await (0, index_1.marrowThink)(API_KEY, BASE_URL, {
|
|
356
|
+
action: description,
|
|
357
|
+
type,
|
|
358
|
+
}, SESSION_ID);
|
|
359
|
+
const commitResult = await (0, index_1.marrowCommit)(API_KEY, BASE_URL, {
|
|
360
|
+
decision_id: thinkResult.decision_id,
|
|
361
|
+
success: runSuccess,
|
|
362
|
+
outcome,
|
|
363
|
+
}, SESSION_ID);
|
|
364
|
+
lastCommitted = true;
|
|
365
|
+
lastDecisionId = thinkResult.decision_id;
|
|
366
|
+
success(id, {
|
|
367
|
+
content: [
|
|
368
|
+
{
|
|
369
|
+
type: 'text',
|
|
370
|
+
text: JSON.stringify({
|
|
371
|
+
decision_id: thinkResult.decision_id,
|
|
372
|
+
success_rate: commitResult.success_rate,
|
|
373
|
+
insight: commitResult.insight,
|
|
374
|
+
intelligence: thinkResult.intelligence,
|
|
375
|
+
}, null, 2),
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
});
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
if (toolName === 'marrow_status') {
|
|
382
|
+
const result = await (0, index_1.marrowStatus)(API_KEY, BASE_URL, SESSION_ID);
|
|
383
|
+
success(id, {
|
|
384
|
+
content: [
|
|
385
|
+
{
|
|
386
|
+
type: 'text',
|
|
387
|
+
text: JSON.stringify(result, null, 2),
|
|
388
|
+
},
|
|
389
|
+
],
|
|
390
|
+
});
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
error(id, -32601, `Unknown tool: ${toolName}`);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
// Unknown method
|
|
397
|
+
error(id, -32601, `Method not found: ${method}`);
|
|
398
|
+
}
|
|
399
|
+
catch (err) {
|
|
400
|
+
const msg = err instanceof Error ? err.message.slice(0, 200) : 'Internal error';
|
|
401
|
+
error(id, -32603, msg);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
// stdio server
|
|
405
|
+
const rl = readline.createInterface({
|
|
406
|
+
input: process.stdin,
|
|
407
|
+
output: process.stdout,
|
|
408
|
+
terminal: false,
|
|
409
|
+
});
|
|
410
|
+
rl.on('line', (line) => {
|
|
411
|
+
const trimmed = line.trim();
|
|
412
|
+
if (!trimmed)
|
|
413
|
+
return;
|
|
414
|
+
try {
|
|
415
|
+
const req = JSON.parse(trimmed);
|
|
416
|
+
handleRequest(req).catch((err) => {
|
|
417
|
+
process.stderr.write(`Unhandled error: ${err}\n`);
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
catch {
|
|
421
|
+
process.stderr.write(`Failed to parse request: ${trimmed}\n`);
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
rl.on('close', () => {
|
|
425
|
+
process.exit(0);
|
|
426
|
+
});
|
|
427
|
+
//# 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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AC,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,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtG,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,MAAM,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnC,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CA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