@getmarrow/mcp 2.3.3 → 2.3.5

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/client.js ADDED
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+ /**
3
+ * Marrow API client — thin HTTP wrapper
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MarrowClient = void 0;
7
+ const DEFAULT_BASE_URL = 'https://api.getmarrow.ai';
8
+ const SESSION_START_HINT = 'Tip: log plans, decisions, and outcomes to Marrow so your agent improves over time.';
9
+ const POST_ORIENT_NUDGE = 'You have not logged any decisions yet this session. Before acting, call marrow_think.';
10
+ const PRE_EXIT_REMINDER = 'Before ending the session, log the outcome to Marrow so the loop closes cleanly.';
11
+ function nowIso() {
12
+ return new Date().toISOString();
13
+ }
14
+ class MarrowClient {
15
+ apiKey;
16
+ baseUrl;
17
+ currentDecisionId = null;
18
+ loopState = {
19
+ orientedAt: null,
20
+ lastThinkAt: null,
21
+ lastOutcomeAt: null,
22
+ hasIntentLog: false,
23
+ hasOutcomeLog: false,
24
+ actionCountSinceLastThink: 0,
25
+ externalActionCountSinceLastThink: 0,
26
+ lastDecisionId: null,
27
+ pendingDecisionId: null,
28
+ recommendedNext: 'orient',
29
+ loopState: 'idle',
30
+ message: SESSION_START_HINT,
31
+ hints: [SESSION_START_HINT],
32
+ };
33
+ constructor() {
34
+ const key = process.env.MARROW_API_KEY;
35
+ if (!key) {
36
+ throw new Error('MARROW_API_KEY environment variable is required');
37
+ }
38
+ this.apiKey = key;
39
+ this.baseUrl = process.env.MARROW_BASE_URL || DEFAULT_BASE_URL;
40
+ }
41
+ check() {
42
+ if (!this.loopState.orientedAt) {
43
+ this.loopState.recommendedNext = 'orient';
44
+ this.loopState.loopState = 'idle';
45
+ this.loopState.message = SESSION_START_HINT;
46
+ this.loopState.hints = [SESSION_START_HINT];
47
+ }
48
+ else if (this.loopState.hasOutcomeLog) {
49
+ this.loopState.recommendedNext = 'done';
50
+ this.loopState.loopState = 'outcome_logged';
51
+ this.loopState.message = 'Loop closed. Ready for the next task.';
52
+ this.loopState.hints = ['Loop closed. Ready for the next task.'];
53
+ }
54
+ else if (!this.loopState.hasIntentLog) {
55
+ this.loopState.recommendedNext = 'think';
56
+ this.loopState.loopState = 'oriented';
57
+ this.loopState.message = POST_ORIENT_NUDGE;
58
+ this.loopState.hints = [SESSION_START_HINT, POST_ORIENT_NUDGE];
59
+ }
60
+ else if (!this.loopState.hasOutcomeLog && this.loopState.actionCountSinceLastThink > 0) {
61
+ this.loopState.recommendedNext = 'commit';
62
+ this.loopState.loopState = 'acting';
63
+ this.loopState.message = PRE_EXIT_REMINDER;
64
+ this.loopState.hints = [PRE_EXIT_REMINDER];
65
+ }
66
+ else if (!this.loopState.hasOutcomeLog) {
67
+ this.loopState.recommendedNext = 'act';
68
+ this.loopState.loopState = 'intent_logged';
69
+ this.loopState.message = 'Intent logged. Act, then log the outcome.';
70
+ this.loopState.hints = ['Intent logged. Act, then log the outcome.'];
71
+ }
72
+ else {
73
+ this.loopState.recommendedNext = 'done';
74
+ this.loopState.loopState = 'outcome_logged';
75
+ this.loopState.message = 'Loop closed. Ready for the next task.';
76
+ this.loopState.hints = ['Loop closed. Ready for the next task.'];
77
+ }
78
+ return {
79
+ ok: true,
80
+ recommendedNext: this.loopState.recommendedNext,
81
+ state: { ...this.loopState, hints: [...this.loopState.hints] },
82
+ warnings: [...this.loopState.hints],
83
+ };
84
+ }
85
+ async orient(params) {
86
+ const patterns = await this.get(`/v1/agent/patterns${params?.task_type ? `?type=${encodeURIComponent(params.task_type)}` : ''}`);
87
+ let lessons = [];
88
+ try {
89
+ const lessonRes = await this.get('/v1/agent/think/history?type=lesson&limit=5');
90
+ lessons = (lessonRes.data
91
+ || lessonRes.items
92
+ || lessonRes.decisions
93
+ || []);
94
+ }
95
+ catch {
96
+ lessons = [];
97
+ }
98
+ this.loopState.orientedAt = nowIso();
99
+ const loop = this.check();
100
+ const failurePatterns = (patterns.data?.failure_patterns
101
+ || patterns.failure_patterns
102
+ || []);
103
+ return {
104
+ session_start_hint: SESSION_START_HINT,
105
+ nudge: this.loopState.hasIntentLog ? null : POST_ORIENT_NUDGE,
106
+ recommended_next: loop.recommendedNext,
107
+ loop: loop.state,
108
+ warnings: failurePatterns
109
+ .filter((item) => Number(item.failureRate || item.failure_rate || 0) > 0.15)
110
+ .map((item) => ({
111
+ type: String(item.decisionType || item.decision_type || 'general'),
112
+ failure_rate: Number(item.failureRate || item.failure_rate || 0),
113
+ message: `${String(item.decisionType || item.decision_type || 'general')} has ${Math.round(Number(item.failureRate || item.failure_rate || 0) * 100)}% failure rate over ${Number(item.count || 0)} decisions — check lessons before proceeding`,
114
+ })),
115
+ lessons: lessons.map((lesson) => ({
116
+ summary: String(lesson.action || lesson.summary || ''),
117
+ severity: 'info',
118
+ })),
119
+ text: [SESSION_START_HINT, POST_ORIENT_NUDGE, `Recommended next step: ${loop.recommendedNext}.`].join(' '),
120
+ };
121
+ }
122
+ async think(params) {
123
+ if (params.previous_decision_id !== undefined && !params.previous_decision_id.trim()) {
124
+ throw new Error('decision_id must be a non-empty string');
125
+ }
126
+ const result = await this.post('/v1/agent/think', params);
127
+ const data = result.data || result;
128
+ const intelligence = data.intelligence || {};
129
+ const decisionId = typeof data.decision_id === 'string' && data.decision_id.trim()
130
+ ? data.decision_id
131
+ : null;
132
+ this.loopState.orientedAt = this.loopState.orientedAt || nowIso();
133
+ this.loopState.lastThinkAt = nowIso();
134
+ this.loopState.hasIntentLog = true;
135
+ this.loopState.hasOutcomeLog = false;
136
+ this.loopState.actionCountSinceLastThink = 0;
137
+ this.loopState.externalActionCountSinceLastThink = 0;
138
+ this.currentDecisionId = decisionId;
139
+ this.loopState.pendingDecisionId = decisionId;
140
+ this.loopState.lastDecisionId = decisionId;
141
+ const loop = this.check();
142
+ return {
143
+ ...result,
144
+ data: {
145
+ ...data,
146
+ accepted_as: 'intent',
147
+ warnings: loop.warnings,
148
+ recommended_next: loop.recommendedNext,
149
+ loop: loop.state,
150
+ summary: [
151
+ 'Intent logged to Marrow.',
152
+ intelligence.insight ? `Pattern hint: ${String(intelligence.insight)}` : null,
153
+ `Recommended next step: ${loop.recommendedNext}.`,
154
+ ].filter(Boolean).join(' '),
155
+ },
156
+ };
157
+ }
158
+ async commit(params) {
159
+ const decisionId = params.decision_id.trim();
160
+ if (!decisionId) {
161
+ throw new Error('decision_id must be a non-empty string');
162
+ }
163
+ if (!this.currentDecisionId) {
164
+ throw new Error('No active decision. Call marrow_think first.');
165
+ }
166
+ if (decisionId !== this.currentDecisionId) {
167
+ throw new Error(`decision_id mismatch: expected ${this.currentDecisionId}`);
168
+ }
169
+ const result = await this.post('/v1/agent/commit', {
170
+ ...params,
171
+ decision_id: decisionId,
172
+ });
173
+ const data = result.data || result;
174
+ this.loopState.lastOutcomeAt = nowIso();
175
+ this.loopState.hasIntentLog = false;
176
+ this.loopState.hasOutcomeLog = true;
177
+ this.loopState.actionCountSinceLastThink = 0;
178
+ this.loopState.externalActionCountSinceLastThink = 0;
179
+ this.loopState.pendingDecisionId = null;
180
+ this.loopState.lastDecisionId = decisionId;
181
+ this.currentDecisionId = null;
182
+ const loop = this.check();
183
+ return {
184
+ ...result,
185
+ data: {
186
+ ...data,
187
+ accepted_as: 'outcome',
188
+ recommended_next: loop.recommendedNext,
189
+ loop: loop.state,
190
+ summary: 'Outcome logged to Marrow. Loop closed.',
191
+ },
192
+ };
193
+ }
194
+ recordAction(meta) {
195
+ this.loopState.actionCountSinceLastThink += 1;
196
+ if (meta?.external)
197
+ this.loopState.externalActionCountSinceLastThink += 1;
198
+ return this.check();
199
+ }
200
+ async patterns() {
201
+ const res = await this.get('/v1/patterns');
202
+ return res?.data || [];
203
+ }
204
+ async post(path, body) {
205
+ const res = await fetch(`${this.baseUrl}${path}`, {
206
+ method: 'POST',
207
+ headers: {
208
+ 'Authorization': `Bearer ${this.apiKey}`,
209
+ 'Content-Type': 'application/json',
210
+ },
211
+ body: JSON.stringify(body),
212
+ });
213
+ if (!res.ok) {
214
+ const text = (await res.text()).slice(0, 200);
215
+ throw new Error(`Marrow API error (${res.status}): ${text}`);
216
+ }
217
+ return res.json();
218
+ }
219
+ async get(path) {
220
+ const res = await fetch(`${this.baseUrl}${path}`, {
221
+ method: 'GET',
222
+ headers: {
223
+ 'Authorization': `Bearer ${this.apiKey}`,
224
+ },
225
+ });
226
+ if (!res.ok) {
227
+ const text = (await res.text()).slice(0, 200);
228
+ throw new Error(`Marrow API error (${res.status}): ${text}`);
229
+ }
230
+ return res.json();
231
+ }
232
+ }
233
+ exports.MarrowClient = MarrowClient;
package/dist/index.d.ts CHANGED
@@ -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
- }): 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
- }): 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
- }): Promise<AgentPatternsResult>;
98
- export declare function marrowOrient(apiKey: string, baseUrl: string, params?: {
99
- taskType?: string;
100
- }): 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): Promise<StatusResult>;
109
- //# sourceMappingURL=index.d.ts.map
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js CHANGED
@@ -1,87 +1,129 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.marrowStatus = exports.marrowOrient = exports.marrowAgentPatterns = exports.marrowCommit = exports.marrowThink = void 0;
4
- async function marrowThink(apiKey, baseUrl, params) {
5
- const body = {
6
- action: params.action,
7
- type: params.type || 'general',
8
- };
9
- if (params.context)
10
- body.context = params.context;
11
- if (params.previous_decision_id) {
12
- body.previous_decision_id = params.previous_decision_id;
13
- body.previous_success = params.previous_success ?? true;
14
- body.previous_outcome = params.previous_outcome ?? '';
15
- }
16
- const res = await fetch(`${baseUrl}/v1/agent/think`, {
17
- method: 'POST',
18
- headers: {
19
- 'Authorization': `Bearer ${apiKey}`,
20
- 'Content-Type': 'application/json',
21
- },
22
- body: JSON.stringify(body),
23
- });
24
- const json = await res.json();
25
- if (json.error)
26
- throw new Error(json.error);
27
- return json.data;
4
+ /**
5
+ * Marrow MCP Server — decision intelligence for AI agents
6
+ * Protocol: MCP 1.0 (JSON-RPC over stdio)
7
+ */
8
+ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
9
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
10
+ const client_js_1 = require("./client.js");
11
+ const think_js_1 = require("./tools/think.js");
12
+ const commit_js_1 = require("./tools/commit.js");
13
+ const patterns_js_1 = require("./tools/patterns.js");
14
+ const orient_js_1 = require("./tools/orient.js");
15
+ const check_js_1 = require("./tools/check.js");
16
+ const zod_1 = require("zod");
17
+ const server = new mcp_js_1.McpServer({
18
+ name: 'marrow',
19
+ version: '1.1.0',
20
+ });
21
+ let client;
22
+ try {
23
+ client = new client_js_1.MarrowClient();
28
24
  }
29
- exports.marrowThink = marrowThink;
30
- async function marrowCommit(apiKey, baseUrl, params) {
31
- const res = await fetch(`${baseUrl}/v1/agent/commit`, {
32
- method: 'POST',
33
- headers: {
34
- 'Authorization': `Bearer ${apiKey}`,
35
- 'Content-Type': 'application/json',
36
- },
37
- body: JSON.stringify(params),
38
- });
39
- const json = await res.json();
40
- if (json.error)
41
- throw new Error(json.error);
42
- return json.data;
25
+ catch (e) {
26
+ console.error(e instanceof Error ? e.message : 'Failed to initialize Marrow client');
27
+ process.exit(1);
43
28
  }
44
- exports.marrowCommit = marrowCommit;
45
- async function marrowAgentPatterns(apiKey, baseUrl, params) {
46
- const qs = new URLSearchParams();
47
- if (params?.type)
48
- qs.set('type', params.type);
49
- if (params?.limit)
50
- qs.set('limit', String(params.limit));
51
- const url = `${baseUrl}/v1/agent/patterns${qs.toString() ? '?' + qs.toString() : ''}`;
52
- const res = await fetch(url, { headers: { 'Authorization': `Bearer ${apiKey}` } });
53
- const json = await res.json();
54
- if (json.error)
55
- throw new Error(json.error);
56
- return json.data;
57
- }
58
- exports.marrowAgentPatterns = marrowAgentPatterns;
59
- // Session orientation — MUST be called first at every session/task start.
60
- // Returns failure warnings + lessons so agent avoids known mistakes before acting.
61
- // This closes the write-only gap: orient() makes Marrow compound instead of just log.
62
- async function marrowOrient(apiKey, baseUrl, params) {
63
- const patterns = await marrowAgentPatterns(apiKey, baseUrl, params?.taskType ? { type: params.taskType } : undefined);
64
- const warnings = patterns.failure_patterns
65
- .filter((p) => p.failure_rate > 0.15)
66
- .map((p) => ({
67
- type: p.decision_type,
68
- failureRate: p.failure_rate,
69
- message: `${p.decision_type} has ${Math.round(p.failure_rate * 100)}% failure rate over ${p.count} decisions review lessons before acting`,
70
- }));
71
- return {
72
- warnings,
73
- shouldPause: warnings.some((w) => w.failureRate > 0.4),
74
- };
75
- }
76
- exports.marrowOrient = marrowOrient;
77
- async function marrowStatus(apiKey, baseUrl) {
78
- const res = await fetch(`${baseUrl}/v1/health`, {
79
- headers: { 'Authorization': `Bearer ${apiKey}` },
80
- });
81
- const json = await res.json();
82
- if (json.error)
83
- throw new Error(json.error);
84
- return json.data;
85
- }
86
- exports.marrowStatus = marrowStatus;
87
- //# sourceMappingURL=index.js.map
29
+ server.tool(orient_js_1.orientTool.name, orient_js_1.orientTool.description, {
30
+ task_type: zod_1.z.string().optional().describe('Optional task type: implementation, security, process, architecture, deployment'),
31
+ }, async (args) => {
32
+ try {
33
+ return await (0, orient_js_1.handleOrient)(client, args);
34
+ }
35
+ catch (e) {
36
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
37
+ }
38
+ });
39
+ server.tool(orient_js_1.orientAliasTool.name, orient_js_1.orientAliasTool.description, {
40
+ task_type: zod_1.z.string().optional().describe('Optional task type: implementation, security, process, architecture, deployment'),
41
+ }, async (args) => {
42
+ try {
43
+ return await (0, orient_js_1.handleOrient)(client, args);
44
+ }
45
+ catch (e) {
46
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
47
+ }
48
+ });
49
+ server.tool(think_js_1.thinkTool.name, think_js_1.thinkTool.description, {
50
+ action: zod_1.z.string().describe('What you are about to do or just did'),
51
+ type: zod_1.z.string().describe('Decision type: implementation, security, process, architecture, deployment'),
52
+ previous_decision_id: zod_1.z.string().optional().describe('ID from previous think() call'),
53
+ previous_success: zod_1.z.boolean().optional().describe('Did the previous action succeed?'),
54
+ previous_outcome: zod_1.z.string().optional().describe('One line outcome of previous action (max 2000 chars)'),
55
+ }, async (args) => {
56
+ try {
57
+ return await (0, think_js_1.handleThink)(client, args);
58
+ }
59
+ catch (e) {
60
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
61
+ }
62
+ });
63
+ server.tool(think_js_1.thinkAliasTool.name, think_js_1.thinkAliasTool.description, {
64
+ action: zod_1.z.string().describe('What you are about to do or just did'),
65
+ type: zod_1.z.string().describe('Decision type: implementation, security, process, architecture, deployment'),
66
+ previous_decision_id: zod_1.z.string().optional().describe('ID from previous think() call'),
67
+ previous_success: zod_1.z.boolean().optional().describe('Did the previous action succeed?'),
68
+ previous_outcome: zod_1.z.string().optional().describe('One line outcome of previous action (max 2000 chars)'),
69
+ }, async (args) => {
70
+ try {
71
+ return await (0, think_js_1.handleThink)(client, args);
72
+ }
73
+ catch (e) {
74
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
75
+ }
76
+ });
77
+ server.tool(commit_js_1.commitTool.name, commit_js_1.commitTool.description, {
78
+ decision_id: zod_1.z.string().describe('ID from think() call'),
79
+ success: zod_1.z.boolean().describe('Did the task succeed?'),
80
+ outcome: zod_1.z.string().describe('One line outcome summary (max 2000 chars)'),
81
+ }, async (args) => {
82
+ try {
83
+ return await (0, commit_js_1.handleCommit)(client, args);
84
+ }
85
+ catch (e) {
86
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
87
+ }
88
+ });
89
+ server.tool(commit_js_1.commitAliasTool.name, commit_js_1.commitAliasTool.description, {
90
+ decision_id: zod_1.z.string().describe('ID from think() call'),
91
+ success: zod_1.z.boolean().describe('Did the task succeed?'),
92
+ outcome: zod_1.z.string().describe('One line outcome summary (max 2000 chars)'),
93
+ }, async (args) => {
94
+ try {
95
+ return await (0, commit_js_1.handleCommit)(client, args);
96
+ }
97
+ catch (e) {
98
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
99
+ }
100
+ });
101
+ server.tool(check_js_1.checkTool.name, check_js_1.checkTool.description, {}, async () => {
102
+ try {
103
+ return await (0, check_js_1.handleCheck)(client);
104
+ }
105
+ catch (e) {
106
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
107
+ }
108
+ });
109
+ server.tool(check_js_1.checkAliasTool.name, check_js_1.checkAliasTool.description, {}, async () => {
110
+ try {
111
+ return await (0, check_js_1.handleCheck)(client);
112
+ }
113
+ catch (e) {
114
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
115
+ }
116
+ });
117
+ server.tool(patterns_js_1.patternsTool.name, patterns_js_1.patternsTool.description, {}, async () => {
118
+ try {
119
+ return await (0, patterns_js_1.handlePatterns)(client);
120
+ }
121
+ catch (e) {
122
+ return { isError: true, content: [{ type: 'text', text: e instanceof Error ? e.message : 'Unknown error' }] };
123
+ }
124
+ });
125
+ const transport = new stdio_js_1.StdioServerTransport();
126
+ server.connect(transport).catch((e) => {
127
+ console.error('Failed to start MCP server:', e);
128
+ process.exit(1);
129
+ });
@@ -0,0 +1,23 @@
1
+ import { MarrowClient } from '../client.js';
2
+ export declare const checkTool: {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {};
8
+ };
9
+ };
10
+ export declare const checkAliasTool: {
11
+ name: string;
12
+ description: string;
13
+ inputSchema: {
14
+ type: "object";
15
+ properties: {};
16
+ };
17
+ };
18
+ export declare function handleCheck(client: MarrowClient): Promise<{
19
+ content: {
20
+ type: "text";
21
+ text: string;
22
+ }[];
23
+ }>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkAliasTool = exports.checkTool = void 0;
4
+ exports.handleCheck = handleCheck;
5
+ exports.checkTool = {
6
+ name: 'marrow_check',
7
+ description: 'Inspect Marrow loop state for this MCP session: orientation, intent log, outcome log, and recommended next step.',
8
+ inputSchema: {
9
+ type: 'object',
10
+ properties: {},
11
+ },
12
+ };
13
+ exports.checkAliasTool = {
14
+ name: 'check',
15
+ description: exports.checkTool.description,
16
+ inputSchema: exports.checkTool.inputSchema,
17
+ };
18
+ async function handleCheck(client) {
19
+ const result = client.check();
20
+ return {
21
+ content: [{
22
+ type: 'text',
23
+ text: JSON.stringify(result, null, 2),
24
+ }],
25
+ };
26
+ }
@@ -0,0 +1,51 @@
1
+ import { MarrowClient } from '../client.js';
2
+ export declare const commitTool: {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {
8
+ decision_id: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ success: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ outcome: {
17
+ type: string;
18
+ description: string;
19
+ };
20
+ };
21
+ required: string[];
22
+ };
23
+ };
24
+ export declare const commitAliasTool: {
25
+ name: string;
26
+ description: string;
27
+ inputSchema: {
28
+ type: "object";
29
+ properties: {
30
+ decision_id: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ success: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ outcome: {
39
+ type: string;
40
+ description: string;
41
+ };
42
+ };
43
+ required: string[];
44
+ };
45
+ };
46
+ export declare function handleCommit(client: MarrowClient, args: Record<string, unknown>): Promise<{
47
+ content: {
48
+ type: "text";
49
+ text: string;
50
+ }[];
51
+ }>;