create-merlin-brain 1.1.5 → 2.0.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/bin/{install.js → install.cjs} +39 -72
- package/bin/{merlin-cli.js → merlin-cli.cjs} +0 -0
- package/bin/serve.js +21 -0
- package/dist/server/api/client.d.ts +227 -0
- package/dist/server/api/client.d.ts.map +1 -0
- package/dist/server/api/client.js +350 -0
- package/dist/server/api/client.js.map +1 -0
- package/dist/server/api/types.d.ts +131 -0
- package/dist/server/api/types.d.ts.map +1 -0
- package/dist/server/api/types.js +5 -0
- package/dist/server/api/types.js.map +1 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +685 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/server.d.ts +11 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/server.js +1972 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/stats.d.ts +101 -0
- package/dist/server/stats.d.ts.map +1 -0
- package/dist/server/stats.js +254 -0
- package/dist/server/stats.js.map +1 -0
- package/dist/server/tools/context.d.ts +7 -0
- package/dist/server/tools/context.d.ts.map +1 -0
- package/dist/server/tools/context.js +371 -0
- package/dist/server/tools/context.js.map +1 -0
- package/dist/server/tools/index.d.ts +9 -0
- package/dist/server/tools/index.d.ts.map +1 -0
- package/dist/server/tools/index.js +8 -0
- package/dist/server/tools/index.js.map +1 -0
- package/dist/server/tools/project.d.ts +12 -0
- package/dist/server/tools/project.d.ts.map +1 -0
- package/dist/server/tools/project.js +586 -0
- package/dist/server/tools/project.js.map +1 -0
- package/dist/server/tools/types.d.ts +25 -0
- package/dist/server/tools/types.d.ts.map +1 -0
- package/dist/server/tools/types.js +5 -0
- package/dist/server/tools/types.js.map +1 -0
- package/dist/server/utils/git.d.ts +33 -0
- package/dist/server/utils/git.d.ts.map +1 -0
- package/dist/server/utils/git.js +109 -0
- package/dist/server/utils/git.js.map +1 -0
- package/dist/server/version.d.ts +6 -0
- package/dist/server/version.d.ts.map +1 -0
- package/dist/server/version.js +6 -0
- package/dist/server/version.js.map +1 -0
- package/files/loop/merlin-loop.sh +57 -0
- package/package.json +30 -9
- package/index.js +0 -15
|
@@ -151,78 +151,15 @@ function setupShellIntegration() {
|
|
|
151
151
|
return false;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
//
|
|
154
|
+
// Simple Merlin shell integration - just wrap claude with merlin agent
|
|
155
155
|
const merlinBlock = `
|
|
156
156
|
# ══════════════════════════════════════════════════════════════
|
|
157
157
|
# Merlin Brain - The AI Brain for Claude Code
|
|
158
158
|
# https://merlin.build
|
|
159
159
|
# ══════════════════════════════════════════════════════════════
|
|
160
160
|
|
|
161
|
-
#
|
|
162
|
-
_merlin_check_update() {
|
|
163
|
-
local version_file="$HOME/.claude/merlin/VERSION"
|
|
164
|
-
local check_file="$HOME/.claude/merlin/.last_update_check"
|
|
165
|
-
local now=$(date +%s)
|
|
166
|
-
|
|
167
|
-
# Only check once per day
|
|
168
|
-
if [ -f "$check_file" ]; then
|
|
169
|
-
local last_check=$(cat "$check_file" 2>/dev/null || echo 0)
|
|
170
|
-
local diff=$((now - last_check))
|
|
171
|
-
[ $diff -lt 86400 ] && return
|
|
172
|
-
fi
|
|
173
|
-
|
|
174
|
-
echo "$now" > "$check_file"
|
|
175
|
-
|
|
176
|
-
# Fetch latest version (silent)
|
|
177
|
-
local latest=$(curl -sfL "https://api.github.com/repos/sandman66666/merlin-brain/releases/latest" 2>/dev/null | grep -o '"tag_name": *"[^"]*"' | head -1 | sed 's/.*"v\\{0,1\\}\\([^"]*\\)".*/\\1/')
|
|
178
|
-
[ -z "$latest" ] && return
|
|
179
|
-
|
|
180
|
-
local current=$(cat "$version_file" 2>/dev/null || echo "0.0.0")
|
|
181
|
-
|
|
182
|
-
if [ "$latest" != "$current" ]; then
|
|
183
|
-
echo -e "\\033[35m[Merlin]\\033[0m Update available: v$current → v$latest"
|
|
184
|
-
echo -e " Run: \\033[36mcurl -fsSL https://merlin.build/install.sh | sh\\033[0m"
|
|
185
|
-
fi
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
# Main claude wrapper with Merlin branding and Sights pre-check
|
|
161
|
+
# Simple claude wrapper - run with merlin agent
|
|
189
162
|
claude() {
|
|
190
|
-
# Check for updates in background (silent, non-blocking)
|
|
191
|
-
(_merlin_check_update &) 2>/dev/null
|
|
192
|
-
|
|
193
|
-
# Pre-flight: Check Sights connection (enforced at terminal level)
|
|
194
|
-
local status_output=$(merlin status 2>/dev/null)
|
|
195
|
-
local status_code=$(echo "$status_output" | head -1)
|
|
196
|
-
|
|
197
|
-
case "$status_code" in
|
|
198
|
-
CONNECTED)
|
|
199
|
-
local repo_name=$(echo "$status_output" | sed -n '2p')
|
|
200
|
-
echo -e "\\033[35m🔮 Merlin Sights:\\033[0m \\033[32mCONNECTED\\033[0m ✓"
|
|
201
|
-
echo -e " Repository: $repo_name"
|
|
202
|
-
;;
|
|
203
|
-
NOT_CONNECTED)
|
|
204
|
-
local repo_url=$(echo "$status_output" | sed -n '2p')
|
|
205
|
-
echo -e "\\033[35m🔮 Merlin Sights:\\033[0m \\033[33mNOT CONNECTED\\033[0m"
|
|
206
|
-
echo ""
|
|
207
|
-
echo " This repo isn't in Sights yet: $repo_url"
|
|
208
|
-
echo ""
|
|
209
|
-
echo -e " \\033[36m[1]\\033[0m Connect now (analysis takes 2-5 min)"
|
|
210
|
-
echo -e " \\033[36m[2]\\033[0m Skip - work without Sights"
|
|
211
|
-
echo ""
|
|
212
|
-
echo -n " Choice [1/2]: "
|
|
213
|
-
read -r choice
|
|
214
|
-
if [ "$choice" = "1" ]; then
|
|
215
|
-
merlin connect
|
|
216
|
-
echo ""
|
|
217
|
-
fi
|
|
218
|
-
;;
|
|
219
|
-
*)
|
|
220
|
-
# Not in git repo or CLI not available - just show branding
|
|
221
|
-
echo -e "\\033[35m✦ Merlin\\033[0m"
|
|
222
|
-
;;
|
|
223
|
-
esac
|
|
224
|
-
|
|
225
|
-
# Run claude with Merlin agent
|
|
226
163
|
command claude --agent merlin "$@"
|
|
227
164
|
}
|
|
228
165
|
|
|
@@ -377,7 +314,7 @@ function cleanupLegacy() {
|
|
|
377
314
|
if (apiKey) {
|
|
378
315
|
config.mcpServers.merlin = {
|
|
379
316
|
command: 'npx',
|
|
380
|
-
args: ['merlin-
|
|
317
|
+
args: ['create-merlin-brain@latest', 'serve'],
|
|
381
318
|
env: { MERLIN_API_KEY: apiKey }
|
|
382
319
|
};
|
|
383
320
|
}
|
|
@@ -388,7 +325,7 @@ function cleanupLegacy() {
|
|
|
388
325
|
if (config.mcpServers?.merlin) {
|
|
389
326
|
const args = config.mcpServers.merlin.args;
|
|
390
327
|
if (args && (args[0] === 'create-merlin-brain' || args[0] === 'ccwiki-mcp')) {
|
|
391
|
-
config.mcpServers.merlin.args = ['merlin-
|
|
328
|
+
config.mcpServers.merlin.args = ['create-merlin-brain@latest', 'serve'];
|
|
392
329
|
modified = true;
|
|
393
330
|
}
|
|
394
331
|
if (config.mcpServers.merlin.env?.CCWIKI_API_KEY) {
|
|
@@ -420,7 +357,7 @@ function cleanupLegacy() {
|
|
|
420
357
|
if (apiKey) {
|
|
421
358
|
config.mcpServers.merlin = {
|
|
422
359
|
command: 'npx',
|
|
423
|
-
args: ['merlin-
|
|
360
|
+
args: ['create-merlin-brain@latest', 'serve'],
|
|
424
361
|
env: { MERLIN_API_KEY: apiKey }
|
|
425
362
|
};
|
|
426
363
|
}
|
|
@@ -430,7 +367,7 @@ function cleanupLegacy() {
|
|
|
430
367
|
if (config.mcpServers?.merlin) {
|
|
431
368
|
const args = config.mcpServers.merlin.args;
|
|
432
369
|
if (args && (args[0] === 'create-merlin-brain' || args[0] === 'ccwiki-mcp')) {
|
|
433
|
-
config.mcpServers.merlin.args = ['merlin-
|
|
370
|
+
config.mcpServers.merlin.args = ['create-merlin-brain@latest', 'serve'];
|
|
434
371
|
modified = true;
|
|
435
372
|
}
|
|
436
373
|
if (config.mcpServers.merlin.env?.CCWIKI_API_KEY) {
|
|
@@ -556,12 +493,42 @@ function cleanupLegacy() {
|
|
|
556
493
|
modified = true;
|
|
557
494
|
}
|
|
558
495
|
|
|
559
|
-
// Remove old ccwiki shell integrations
|
|
560
|
-
if (content.includes('
|
|
496
|
+
// Remove old ccwiki shell integrations and alias
|
|
497
|
+
if (content.includes('ccwiki')) {
|
|
561
498
|
content = content.replace(/\n# ccwiki[\s\S]*?ccwiki.*\n?/g, '');
|
|
499
|
+
content = content.replace(/\n?alias merlin="npx ccwiki-mcp"\n?/g, '\n');
|
|
500
|
+
content = content.replace(/\n?# Merlin Brain - AI Memory for Claude Code\n?/g, '\n');
|
|
562
501
|
modified = true;
|
|
563
502
|
}
|
|
564
503
|
|
|
504
|
+
// Remove old standalone alias lines (before Merlin block)
|
|
505
|
+
if (content.includes("alias cc='claude --agent orchestrator'")) {
|
|
506
|
+
content = content.replace(/\n?alias cc='claude --agent orchestrator'\n?/g, '\n');
|
|
507
|
+
content = content.replace(/\n?alias ccr='claude --agent orchestrator-retrofit'\n?/g, '\n');
|
|
508
|
+
modified = true;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// Remove duplicate merlin-loop functions (keep only one in Merlin block)
|
|
512
|
+
const merlinLoopPattern = /# Merlin Loop - autonomous development orchestrator\nmerlin-loop\(\) \{[\s\S]*?\n\}/g;
|
|
513
|
+
const matches = content.match(merlinLoopPattern);
|
|
514
|
+
if (matches && matches.length > 1) {
|
|
515
|
+
// Remove all but leave for fresh install
|
|
516
|
+
for (let i = 0; i < matches.length; i++) {
|
|
517
|
+
content = content.replace(matches[i] + '\n\n', '');
|
|
518
|
+
}
|
|
519
|
+
modified = true;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// Remove old complex Merlin blocks with _merlin_check_update
|
|
523
|
+
if (content.includes('_merlin_check_update')) {
|
|
524
|
+
// This is the old complex block - remove it entirely
|
|
525
|
+
content = content.replace(/# ═+\n# Merlin Brain - The AI Brain[\s\S]*?merlin-loop\(\) \{[\s\S]*?\n\}\n?/g, '');
|
|
526
|
+
modified = true;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// Clean up multiple blank lines
|
|
530
|
+
content = content.replace(/\n{3,}/g, '\n\n');
|
|
531
|
+
|
|
565
532
|
if (modified) {
|
|
566
533
|
fs.writeFileSync(rcFile, content);
|
|
567
534
|
cleaned.push(rcFile.replace(os.homedir(), '~') + ' (removed old integrations)');
|
|
@@ -693,7 +660,7 @@ async function install() {
|
|
|
693
660
|
config.mcpServers = config.mcpServers || {};
|
|
694
661
|
config.mcpServers.merlin = {
|
|
695
662
|
command: 'npx',
|
|
696
|
-
args: ['merlin-
|
|
663
|
+
args: ['create-merlin-brain@latest', 'serve'],
|
|
697
664
|
env: {
|
|
698
665
|
MERLIN_API_KEY: apiKey
|
|
699
666
|
}
|
|
File without changes
|
package/bin/serve.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Merlin Brain - MCP Server
|
|
5
|
+
*
|
|
6
|
+
* This is the entry point for the Merlin MCP server.
|
|
7
|
+
* It provides codebase intelligence to Claude Code via the Model Context Protocol.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* npx create-merlin-brain serve
|
|
11
|
+
* merlin-brain (if installed globally)
|
|
12
|
+
*
|
|
13
|
+
* Configuration:
|
|
14
|
+
* Set MERLIN_API_KEY environment variable with your API key from https://merlin.build
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import('../dist/server/index.js').catch((err) => {
|
|
18
|
+
console.error('Failed to start Merlin MCP server:', err.message);
|
|
19
|
+
console.error('Make sure the package is built: npm run build');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
});
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* merlin API Client
|
|
3
|
+
* Handles all HTTP requests to the merlin API with caching and error handling
|
|
4
|
+
*/
|
|
5
|
+
import type { Repository, AgentManifest, ConventionsResponse, FilesResponse } from './types.js';
|
|
6
|
+
/** API client configuration */
|
|
7
|
+
interface ClientConfig {
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Merlin API Client */
|
|
12
|
+
export declare class MerlinClient {
|
|
13
|
+
private config;
|
|
14
|
+
private cache;
|
|
15
|
+
private static MANIFEST_TTL;
|
|
16
|
+
private static CONVENTIONS_TTL;
|
|
17
|
+
private static REPOS_TTL;
|
|
18
|
+
private static FILES_TTL;
|
|
19
|
+
private static HOWTO_TTL;
|
|
20
|
+
constructor(config?: Partial<ClientConfig>);
|
|
21
|
+
/** Make an authenticated request to the API */
|
|
22
|
+
private fetch;
|
|
23
|
+
/** Get list of user's repositories */
|
|
24
|
+
getRepositories(): Promise<Repository[]>;
|
|
25
|
+
/** Connect a new repository to Merlin Sights */
|
|
26
|
+
connectRepo(repoUrl: string, options?: {
|
|
27
|
+
branch?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
}): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
repository?: Repository;
|
|
32
|
+
status?: string;
|
|
33
|
+
error?: string;
|
|
34
|
+
}>;
|
|
35
|
+
/** Find repository by GitHub URL */
|
|
36
|
+
findRepoByUrl(githubUrl: string): Promise<Repository | null>;
|
|
37
|
+
/** Get full manifest for a repository */
|
|
38
|
+
getManifest(repoId: string): Promise<AgentManifest>;
|
|
39
|
+
/** Get quickstart guide (text format) */
|
|
40
|
+
getQuickstart(repoId: string): Promise<string>;
|
|
41
|
+
/** Get main overview (text format) */
|
|
42
|
+
getOverview(repoId: string): Promise<string>;
|
|
43
|
+
/** Get conventions and anti-patterns */
|
|
44
|
+
getConventions(repoId: string): Promise<ConventionsResponse>;
|
|
45
|
+
/** Get files, optionally filtered by layer or purpose */
|
|
46
|
+
getFiles(repoId: string, options?: {
|
|
47
|
+
layer?: string;
|
|
48
|
+
purpose?: string;
|
|
49
|
+
}): Promise<FilesResponse>;
|
|
50
|
+
/** Find files by purpose (text format) */
|
|
51
|
+
findFiles(repoId: string, what: string): Promise<string>;
|
|
52
|
+
/** Search documentation */
|
|
53
|
+
search(repoId: string, query: string): Promise<string>;
|
|
54
|
+
/** Get how-to guide for a task */
|
|
55
|
+
getHowTo(repoId: string, task: string): Promise<string>;
|
|
56
|
+
/** Get impact analysis for a file - what depends on it */
|
|
57
|
+
getImpactAnalysis(repoId: string, filePath: string): Promise<string>;
|
|
58
|
+
/** Find similar code implementations */
|
|
59
|
+
getSimilarCode(repoId: string, description: string): Promise<string>;
|
|
60
|
+
/** Get code examples for common tasks */
|
|
61
|
+
getCodeExamples(repoId: string, task?: string): Promise<string>;
|
|
62
|
+
/** Clear all cached data */
|
|
63
|
+
clearCache(): void;
|
|
64
|
+
/** Write state to a key */
|
|
65
|
+
writeState(repoId: string, key: string, value: any, options?: {
|
|
66
|
+
agentId?: string;
|
|
67
|
+
version?: number;
|
|
68
|
+
}): Promise<{
|
|
69
|
+
success: boolean;
|
|
70
|
+
state?: any;
|
|
71
|
+
error?: string;
|
|
72
|
+
}>;
|
|
73
|
+
/** Read state from a key */
|
|
74
|
+
readState(repoId: string, key: string): Promise<any | null>;
|
|
75
|
+
/** List all state keys */
|
|
76
|
+
listStateKeys(repoId: string): Promise<{
|
|
77
|
+
keys: any[];
|
|
78
|
+
count: number;
|
|
79
|
+
}>;
|
|
80
|
+
/** Log an activity event */
|
|
81
|
+
logActivity(repoId: string, eventType: string, data: {
|
|
82
|
+
agentId: string;
|
|
83
|
+
sessionId?: string;
|
|
84
|
+
eventData?: any;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
success: boolean;
|
|
87
|
+
event?: any;
|
|
88
|
+
}>;
|
|
89
|
+
/** Get activity log */
|
|
90
|
+
getActivityLog(repoId: string, options?: {
|
|
91
|
+
sessionId?: string;
|
|
92
|
+
eventType?: string;
|
|
93
|
+
limit?: number;
|
|
94
|
+
since?: string;
|
|
95
|
+
}): Promise<{
|
|
96
|
+
events: any[];
|
|
97
|
+
count: number;
|
|
98
|
+
}>;
|
|
99
|
+
/** Sync a task */
|
|
100
|
+
syncTask(repoId: string, task: {
|
|
101
|
+
externalId?: string;
|
|
102
|
+
title: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
status?: 'pending' | 'in_progress' | 'completed' | 'blocked' | 'skipped';
|
|
105
|
+
ownerAgent?: string;
|
|
106
|
+
phase?: string;
|
|
107
|
+
phaseName?: string;
|
|
108
|
+
plan?: string;
|
|
109
|
+
planName?: string;
|
|
110
|
+
taskNumber?: number;
|
|
111
|
+
wave?: number;
|
|
112
|
+
priority?: number;
|
|
113
|
+
blockedBy?: string[];
|
|
114
|
+
blocks?: string[];
|
|
115
|
+
metadata?: any;
|
|
116
|
+
commitSha?: string;
|
|
117
|
+
filesChanged?: string[];
|
|
118
|
+
}): Promise<{
|
|
119
|
+
success: boolean;
|
|
120
|
+
task?: any;
|
|
121
|
+
}>;
|
|
122
|
+
/** Get tasks */
|
|
123
|
+
getTasks(repoId: string, options?: {
|
|
124
|
+
status?: string;
|
|
125
|
+
phase?: string;
|
|
126
|
+
plan?: string;
|
|
127
|
+
ownerAgent?: string;
|
|
128
|
+
}): Promise<{
|
|
129
|
+
tasks: any[];
|
|
130
|
+
count: number;
|
|
131
|
+
byStatus: Record<string, number>;
|
|
132
|
+
}>;
|
|
133
|
+
/** Report a blocker */
|
|
134
|
+
reportBlocker(repoId: string, blocker: {
|
|
135
|
+
agentId: string;
|
|
136
|
+
taskId?: string;
|
|
137
|
+
blockerType: 'human_verify' | 'auth_required' | 'clarification' | 'decision_point' | 'external' | 'error' | 'other';
|
|
138
|
+
severity?: 'low' | 'medium' | 'high' | 'critical';
|
|
139
|
+
title: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
context?: any;
|
|
142
|
+
}): Promise<{
|
|
143
|
+
success: boolean;
|
|
144
|
+
blocker?: any;
|
|
145
|
+
}>;
|
|
146
|
+
/** Get blockers */
|
|
147
|
+
getBlockers(repoId: string, status?: string): Promise<{
|
|
148
|
+
blockers: any[];
|
|
149
|
+
count: number;
|
|
150
|
+
}>;
|
|
151
|
+
/** Create a checkpoint */
|
|
152
|
+
createCheckpoint(repoId: string, checkpoint: {
|
|
153
|
+
agentId: string;
|
|
154
|
+
sessionId?: string;
|
|
155
|
+
taskId?: string;
|
|
156
|
+
checkpointType: 'human_verify' | 'auth_gate' | 'decision_point' | 'approval' | 'review';
|
|
157
|
+
title: string;
|
|
158
|
+
description?: string;
|
|
159
|
+
completedTasks?: any[];
|
|
160
|
+
whatWasBuilt?: string;
|
|
161
|
+
filesChanged?: string[];
|
|
162
|
+
commits?: string[];
|
|
163
|
+
verificationItems?: string[];
|
|
164
|
+
options?: any;
|
|
165
|
+
resumeContext?: any;
|
|
166
|
+
}): Promise<{
|
|
167
|
+
success: boolean;
|
|
168
|
+
checkpoint?: any;
|
|
169
|
+
}>;
|
|
170
|
+
/** Get pending checkpoints */
|
|
171
|
+
getCheckpoints(repoId: string, options?: {
|
|
172
|
+
status?: string;
|
|
173
|
+
sessionId?: string;
|
|
174
|
+
}): Promise<{
|
|
175
|
+
checkpoints: any[];
|
|
176
|
+
count: number;
|
|
177
|
+
}>;
|
|
178
|
+
/** Update session */
|
|
179
|
+
updateSession(repoId: string, session: {
|
|
180
|
+
sessionId: string;
|
|
181
|
+
agentId: string;
|
|
182
|
+
status?: 'active' | 'paused' | 'completed' | 'abandoned';
|
|
183
|
+
currentPhase?: string;
|
|
184
|
+
currentPlan?: string;
|
|
185
|
+
currentTask?: string;
|
|
186
|
+
tasksCompleted?: number;
|
|
187
|
+
tasksTotal?: number;
|
|
188
|
+
pauseReason?: string;
|
|
189
|
+
resumeContext?: any;
|
|
190
|
+
}): Promise<{
|
|
191
|
+
success: boolean;
|
|
192
|
+
session?: any;
|
|
193
|
+
}>;
|
|
194
|
+
/** Get team state - consolidated view of all agent activity */
|
|
195
|
+
getTeamState(repoId: string): Promise<{
|
|
196
|
+
state: Record<string, any>;
|
|
197
|
+
activeSessions: any[];
|
|
198
|
+
pendingCheckpoints: any[];
|
|
199
|
+
openBlockers: any[];
|
|
200
|
+
taskSummary: {
|
|
201
|
+
total: number;
|
|
202
|
+
pending?: number;
|
|
203
|
+
in_progress?: number;
|
|
204
|
+
completed?: number;
|
|
205
|
+
};
|
|
206
|
+
recentActivity: any[];
|
|
207
|
+
}>;
|
|
208
|
+
/** Ask a question about the codebase using AI */
|
|
209
|
+
ask(repoId: string, question: string, options?: {
|
|
210
|
+
quick?: boolean;
|
|
211
|
+
}): Promise<{
|
|
212
|
+
answer: string;
|
|
213
|
+
sources?: Array<{
|
|
214
|
+
name: string;
|
|
215
|
+
path: string | null;
|
|
216
|
+
type: string;
|
|
217
|
+
relevance: string;
|
|
218
|
+
}>;
|
|
219
|
+
searchMethod?: string;
|
|
220
|
+
confidence?: string;
|
|
221
|
+
quick?: boolean;
|
|
222
|
+
}>;
|
|
223
|
+
}
|
|
224
|
+
/** Get or create the API client instance */
|
|
225
|
+
export declare function getClient(): MerlinClient;
|
|
226
|
+
export {};
|
|
227
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/server/api/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,aAAa,EACd,MAAM,YAAY,CAAC;AAQpB,+BAA+B;AAC/B,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4BD,wBAAwB;AACxB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,KAAK,CAAe;IAG5B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAa;IACxC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAiB;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