@limo-labs/limo-cli 0.1.0-alpha.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 +238 -0
- package/dist/agents/analyst.d.ts +24 -0
- package/dist/agents/analyst.js +128 -0
- package/dist/agents/editor.d.ts +26 -0
- package/dist/agents/editor.js +157 -0
- package/dist/agents/planner-validator.d.ts +7 -0
- package/dist/agents/planner-validator.js +125 -0
- package/dist/agents/planner.d.ts +56 -0
- package/dist/agents/planner.js +186 -0
- package/dist/agents/writer.d.ts +25 -0
- package/dist/agents/writer.js +164 -0
- package/dist/commands/analyze.d.ts +14 -0
- package/dist/commands/analyze.js +562 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +41 -0
- package/dist/report/diagrams.d.ts +27 -0
- package/dist/report/diagrams.js +74 -0
- package/dist/report/graphCompiler.d.ts +37 -0
- package/dist/report/graphCompiler.js +277 -0
- package/dist/report/markdownGenerator.d.ts +71 -0
- package/dist/report/markdownGenerator.js +148 -0
- package/dist/tools/additional.d.ts +116 -0
- package/dist/tools/additional.js +349 -0
- package/dist/tools/extended.d.ts +101 -0
- package/dist/tools/extended.js +586 -0
- package/dist/tools/index.d.ts +86 -0
- package/dist/tools/index.js +362 -0
- package/dist/types/agents.types.d.ts +139 -0
- package/dist/types/agents.types.js +6 -0
- package/dist/types/graphSemantics.d.ts +99 -0
- package/dist/types/graphSemantics.js +104 -0
- package/dist/utils/debug.d.ts +28 -0
- package/dist/utils/debug.js +125 -0
- package/dist/utils/limoConfigParser.d.ts +21 -0
- package/dist/utils/limoConfigParser.js +274 -0
- package/dist/utils/reviewMonitor.d.ts +20 -0
- package/dist/utils/reviewMonitor.js +121 -0
- package/package.json +62 -0
- package/prompts/analyst.md +343 -0
- package/prompts/editor.md +196 -0
- package/prompts/planner.md +388 -0
- package/prompts/writer.md +218 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additional tool implementations for Limo CLI
|
|
3
|
+
* UI operations and code analysis tools
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { Tool } from '@limo-labs/deity';
|
|
7
|
+
import type { ToolContext } from './index.js';
|
|
8
|
+
declare const AddFindingsInputSchema: z.ZodObject<{
|
|
9
|
+
findings: z.ZodArray<z.ZodAny>;
|
|
10
|
+
recommendations: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
11
|
+
code_snippets: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
12
|
+
executive_summary: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare function createAddFindingsTool(_context: ToolContext): Tool<z.infer<typeof AddFindingsInputSchema>, any>;
|
|
15
|
+
declare const FinishCurrentStepInputSchema: z.ZodObject<{
|
|
16
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare function createFinishCurrentStepTool(_context: ToolContext): Tool<z.infer<typeof FinishCurrentStepInputSchema>, any>;
|
|
19
|
+
declare const SidebarUpdateStepInputSchema: z.ZodObject<{
|
|
20
|
+
step_id: z.ZodString;
|
|
21
|
+
title: z.ZodString;
|
|
22
|
+
description: z.ZodString;
|
|
23
|
+
phase: z.ZodEnum<{
|
|
24
|
+
discovery: "discovery";
|
|
25
|
+
analysis: "analysis";
|
|
26
|
+
assessment: "assessment";
|
|
27
|
+
reporting: "reporting";
|
|
28
|
+
}>;
|
|
29
|
+
status: z.ZodEnum<{
|
|
30
|
+
in_progress: "in_progress";
|
|
31
|
+
completed: "completed";
|
|
32
|
+
skipped: "skipped";
|
|
33
|
+
blocked: "blocked";
|
|
34
|
+
}>;
|
|
35
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
36
|
+
error: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare function createSidebarUpdateStepTool(_context: ToolContext): Tool<z.infer<typeof SidebarUpdateStepInputSchema>, any>;
|
|
39
|
+
declare const WebviewUpdateContentInputSchema: z.ZodObject<{
|
|
40
|
+
step_id: z.ZodString;
|
|
41
|
+
content: z.ZodAny;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare function createWebviewUpdateContentTool(_context: ToolContext): Tool<z.infer<typeof WebviewUpdateContentInputSchema>, any>;
|
|
44
|
+
declare const UserNotifyInputSchema: z.ZodObject<{
|
|
45
|
+
message: z.ZodString;
|
|
46
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
error: "error";
|
|
48
|
+
info: "info";
|
|
49
|
+
warning: "warning";
|
|
50
|
+
}>>;
|
|
51
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export declare function createUserNotifyTool(_context: ToolContext): Tool<z.infer<typeof UserNotifyInputSchema>, any>;
|
|
54
|
+
declare const UserAskInputSchema: z.ZodObject<{
|
|
55
|
+
prompt: z.ZodString;
|
|
56
|
+
options: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
57
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
58
|
+
can_pick_many: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export declare function createUserAskTool(_context: ToolContext): Tool<z.infer<typeof UserAskInputSchema>, any>;
|
|
61
|
+
declare const ReportAddAssetInputSchema: z.ZodObject<{
|
|
62
|
+
asset_id: z.ZodString;
|
|
63
|
+
type: z.ZodEnum<{
|
|
64
|
+
chart: "chart";
|
|
65
|
+
table: "table";
|
|
66
|
+
}>;
|
|
67
|
+
title: z.ZodString;
|
|
68
|
+
data: z.ZodAny;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export declare function createReportAddAssetTool(context: ToolContext): Tool<z.infer<typeof ReportAddAssetInputSchema>, any>;
|
|
71
|
+
declare const LimoConfigReadInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
72
|
+
export declare function createLimoConfigReadTool(context: ToolContext): Tool<z.infer<typeof LimoConfigReadInputSchema>, any>;
|
|
73
|
+
declare const MemoryPromoteToCoreInputSchema: z.ZodObject<{
|
|
74
|
+
key: z.ZodString;
|
|
75
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
export declare function createMemoryPromoteToCoreTool(context: ToolContext): Tool<z.infer<typeof MemoryPromoteToCoreInputSchema>, any>;
|
|
78
|
+
declare const MemoryDemoteFromCoreInputSchema: z.ZodObject<{
|
|
79
|
+
key: z.ZodString;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export declare function createMemoryDemoteFromCoreTool(context: ToolContext): Tool<z.infer<typeof MemoryDemoteFromCoreInputSchema>, any>;
|
|
82
|
+
declare const MemoryHealthCheckInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
83
|
+
export declare function createMemoryHealthCheckTool(context: ToolContext): Tool<z.infer<typeof MemoryHealthCheckInputSchema>, any>;
|
|
84
|
+
declare const CodeAnalyzeDeadInputSchema: z.ZodObject<{
|
|
85
|
+
scope: z.ZodEnum<{
|
|
86
|
+
file: "file";
|
|
87
|
+
workspace: "workspace";
|
|
88
|
+
folder: "folder";
|
|
89
|
+
}>;
|
|
90
|
+
target: z.ZodOptional<z.ZodString>;
|
|
91
|
+
filePattern: z.ZodOptional<z.ZodString>;
|
|
92
|
+
excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
+
analysisDepth: z.ZodEnum<{
|
|
94
|
+
quick: "quick";
|
|
95
|
+
thorough: "thorough";
|
|
96
|
+
}>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export declare function createCodeAnalyzeDeadTool(_context: ToolContext): Tool<z.infer<typeof CodeAnalyzeDeadInputSchema>, any>;
|
|
99
|
+
declare const CodeCheckReferencesInputSchema: z.ZodObject<{
|
|
100
|
+
file: z.ZodString;
|
|
101
|
+
line: z.ZodNumber;
|
|
102
|
+
column: z.ZodNumber;
|
|
103
|
+
symbolName: z.ZodString;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export declare function createCodeCheckReferencesTool(_context: ToolContext): Tool<z.infer<typeof CodeCheckReferencesInputSchema>, any>;
|
|
106
|
+
declare const CodeAnalyzeCallGraphInputSchema: z.ZodObject<{
|
|
107
|
+
entryPoint: z.ZodString;
|
|
108
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
format: z.ZodEnum<{
|
|
110
|
+
dot: "dot";
|
|
111
|
+
json: "json";
|
|
112
|
+
}>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
export declare function createCodeAnalyzeCallGraphTool(_context: ToolContext): Tool<z.infer<typeof CodeAnalyzeCallGraphInputSchema>, any>;
|
|
115
|
+
export declare function createAdditionalTools(context: ToolContext): Tool[];
|
|
116
|
+
export {};
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additional tool implementations for Limo CLI
|
|
3
|
+
* UI operations and code analysis tools
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from 'fs/promises';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
// ===== UI OPERATIONS (CLI Stubs) =====
|
|
8
|
+
const AddFindingsInputSchema = z.object({
|
|
9
|
+
findings: z.array(z.any()).describe('Array of findings'),
|
|
10
|
+
recommendations: z.array(z.any()).optional().describe('Array of recommendations'),
|
|
11
|
+
code_snippets: z.array(z.any()).optional().describe('Array of code snippets'),
|
|
12
|
+
executive_summary: z.string().optional().describe('Executive summary')
|
|
13
|
+
});
|
|
14
|
+
export function createAddFindingsTool(_context) {
|
|
15
|
+
return {
|
|
16
|
+
name: 'add_findings',
|
|
17
|
+
description: 'Add findings to current analysis step (CLI stub)',
|
|
18
|
+
inputSchema: AddFindingsInputSchema,
|
|
19
|
+
execute: async (params) => {
|
|
20
|
+
console.log(`[FINDINGS] Added ${params.findings.length} findings`);
|
|
21
|
+
return {
|
|
22
|
+
success: true,
|
|
23
|
+
data: { message: 'Findings recorded (CLI mode)' }
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const FinishCurrentStepInputSchema = z.object({
|
|
29
|
+
summary: z.string().optional().describe('Final summary')
|
|
30
|
+
});
|
|
31
|
+
export function createFinishCurrentStepTool(_context) {
|
|
32
|
+
return {
|
|
33
|
+
name: 'finish_current_step',
|
|
34
|
+
description: 'Finish current analysis step (CLI stub)',
|
|
35
|
+
inputSchema: FinishCurrentStepInputSchema,
|
|
36
|
+
execute: async (params) => {
|
|
37
|
+
if (params.summary) {
|
|
38
|
+
console.log(`[SUMMARY] ${params.summary}`);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
success: true,
|
|
42
|
+
data: { message: 'Step finished (CLI mode)' }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const SidebarUpdateStepInputSchema = z.object({
|
|
48
|
+
step_id: z.string().describe('Step ID'),
|
|
49
|
+
title: z.string().describe('Step title'),
|
|
50
|
+
description: z.string().describe('Step description'),
|
|
51
|
+
phase: z.enum(['discovery', 'analysis', 'assessment', 'reporting']).describe('Analysis phase'),
|
|
52
|
+
status: z.enum(['in_progress', 'completed', 'blocked', 'skipped']).describe('Step status'),
|
|
53
|
+
details: z.any().optional().describe('Additional details'),
|
|
54
|
+
error: z.string().optional().describe('Error message')
|
|
55
|
+
});
|
|
56
|
+
export function createSidebarUpdateStepTool(_context) {
|
|
57
|
+
return {
|
|
58
|
+
name: 'sidebar_update_step',
|
|
59
|
+
description: 'Update sidebar step (CLI stub)',
|
|
60
|
+
inputSchema: SidebarUpdateStepInputSchema,
|
|
61
|
+
execute: async (params) => {
|
|
62
|
+
console.log(`[SIDEBAR] ${params.step_id}: ${params.status}`);
|
|
63
|
+
return {
|
|
64
|
+
success: true,
|
|
65
|
+
data: { message: 'Sidebar updated (CLI mode)' }
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const WebviewUpdateContentInputSchema = z.object({
|
|
71
|
+
step_id: z.string().describe('Step ID'),
|
|
72
|
+
content: z.any().describe('Content object')
|
|
73
|
+
});
|
|
74
|
+
export function createWebviewUpdateContentTool(_context) {
|
|
75
|
+
return {
|
|
76
|
+
name: 'webview_update_content',
|
|
77
|
+
description: 'Update webview content (CLI stub)',
|
|
78
|
+
inputSchema: WebviewUpdateContentInputSchema,
|
|
79
|
+
execute: async (params) => {
|
|
80
|
+
console.log(`[WEBVIEW] Updated content for ${params.step_id}`);
|
|
81
|
+
return {
|
|
82
|
+
success: true,
|
|
83
|
+
data: { message: 'Webview updated (CLI mode)' }
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const UserNotifyInputSchema = z.object({
|
|
89
|
+
message: z.string().describe('Notification message'),
|
|
90
|
+
type: z.enum(['info', 'warning', 'error']).optional().describe('Notification type'),
|
|
91
|
+
actions: z.array(z.any()).optional().describe('Action buttons')
|
|
92
|
+
});
|
|
93
|
+
export function createUserNotifyTool(_context) {
|
|
94
|
+
return {
|
|
95
|
+
name: 'user_notify',
|
|
96
|
+
description: 'Show notification to user',
|
|
97
|
+
inputSchema: UserNotifyInputSchema,
|
|
98
|
+
execute: async (params) => {
|
|
99
|
+
const type = params.type || 'info';
|
|
100
|
+
console.log(`[${type.toUpperCase()}] ${params.message}`);
|
|
101
|
+
return {
|
|
102
|
+
success: true,
|
|
103
|
+
data: { message: 'Notification sent (CLI mode)' }
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
const UserAskInputSchema = z.object({
|
|
109
|
+
prompt: z.string().describe('Question prompt'),
|
|
110
|
+
options: z.array(z.any()).optional().describe('Options for quick pick'),
|
|
111
|
+
placeholder: z.string().optional().describe('Placeholder text'),
|
|
112
|
+
can_pick_many: z.boolean().optional().describe('Allow multiple selections')
|
|
113
|
+
});
|
|
114
|
+
export function createUserAskTool(_context) {
|
|
115
|
+
return {
|
|
116
|
+
name: 'user_ask',
|
|
117
|
+
description: 'Ask user a question (CLI stub - returns default)',
|
|
118
|
+
inputSchema: UserAskInputSchema,
|
|
119
|
+
execute: async (params) => {
|
|
120
|
+
console.log(`[QUESTION] ${params.prompt}`);
|
|
121
|
+
return {
|
|
122
|
+
success: true,
|
|
123
|
+
data: {
|
|
124
|
+
response: params.options?.[0] || 'yes',
|
|
125
|
+
message: 'Auto-answered (CLI mode)'
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
// ===== REPORT OPERATIONS (Additional) =====
|
|
132
|
+
const ReportAddAssetInputSchema = z.object({
|
|
133
|
+
asset_id: z.string().describe('Asset ID'),
|
|
134
|
+
type: z.enum(['chart', 'table']).describe('Asset type'),
|
|
135
|
+
title: z.string().describe('Asset title'),
|
|
136
|
+
data: z.any().describe('Asset data')
|
|
137
|
+
});
|
|
138
|
+
export function createReportAddAssetTool(context) {
|
|
139
|
+
return {
|
|
140
|
+
name: 'report_add_asset',
|
|
141
|
+
description: 'Add an asset (chart, table) to the report',
|
|
142
|
+
inputSchema: ReportAddAssetInputSchema,
|
|
143
|
+
execute: async (params) => {
|
|
144
|
+
// Store asset data
|
|
145
|
+
context.diagrams.set(params.asset_id, {
|
|
146
|
+
type: params.type,
|
|
147
|
+
title: params.title,
|
|
148
|
+
data: params.data
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
success: true,
|
|
152
|
+
data: { asset_id: params.asset_id }
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
// ===== CONFIGURATION =====
|
|
158
|
+
const LimoConfigReadInputSchema = z.object({});
|
|
159
|
+
export function createLimoConfigReadTool(context) {
|
|
160
|
+
return {
|
|
161
|
+
name: 'config_read',
|
|
162
|
+
description: 'Read LIMO.md configuration file',
|
|
163
|
+
inputSchema: LimoConfigReadInputSchema,
|
|
164
|
+
execute: async () => {
|
|
165
|
+
try {
|
|
166
|
+
const configPath = `${context.workspaceRoot}/LIMO.md`;
|
|
167
|
+
const content = await fs.readFile(configPath, 'utf-8');
|
|
168
|
+
return {
|
|
169
|
+
success: true,
|
|
170
|
+
data: {
|
|
171
|
+
exists: true,
|
|
172
|
+
content
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
return {
|
|
178
|
+
success: true,
|
|
179
|
+
data: {
|
|
180
|
+
exists: false,
|
|
181
|
+
message: 'No LIMO.md configuration file found'
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
// ===== MEMORY OPERATIONS (Additional) =====
|
|
189
|
+
const MemoryPromoteToCoreInputSchema = z.object({
|
|
190
|
+
key: z.string().describe('Memory key to promote'),
|
|
191
|
+
reason: z.string().optional().describe('Reason for promotion')
|
|
192
|
+
});
|
|
193
|
+
export function createMemoryPromoteToCoreTool(context) {
|
|
194
|
+
return {
|
|
195
|
+
name: 'memory_promote_to_core',
|
|
196
|
+
description: 'Promote memory to core memory (higher priority)',
|
|
197
|
+
inputSchema: MemoryPromoteToCoreInputSchema,
|
|
198
|
+
execute: async (params) => {
|
|
199
|
+
const memory = context.memory.get(params.key);
|
|
200
|
+
if (!memory) {
|
|
201
|
+
return {
|
|
202
|
+
success: false,
|
|
203
|
+
error: `Memory key not found: ${params.key}`
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
// Increase importance to mark as core
|
|
207
|
+
memory.importance = Math.max(memory.importance, 8);
|
|
208
|
+
memory.core = true;
|
|
209
|
+
context.memory.set(params.key, memory);
|
|
210
|
+
return {
|
|
211
|
+
success: true,
|
|
212
|
+
data: {
|
|
213
|
+
key: params.key,
|
|
214
|
+
reason: params.reason
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const MemoryDemoteFromCoreInputSchema = z.object({
|
|
221
|
+
key: z.string().describe('Memory key to demote')
|
|
222
|
+
});
|
|
223
|
+
export function createMemoryDemoteFromCoreTool(context) {
|
|
224
|
+
return {
|
|
225
|
+
name: 'memory_demote_from_core',
|
|
226
|
+
description: 'Demote memory from core memory',
|
|
227
|
+
inputSchema: MemoryDemoteFromCoreInputSchema,
|
|
228
|
+
execute: async (params) => {
|
|
229
|
+
const memory = context.memory.get(params.key);
|
|
230
|
+
if (!memory) {
|
|
231
|
+
return {
|
|
232
|
+
success: false,
|
|
233
|
+
error: `Memory key not found: ${params.key}`
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
memory.core = false;
|
|
237
|
+
context.memory.set(params.key, memory);
|
|
238
|
+
return {
|
|
239
|
+
success: true,
|
|
240
|
+
data: { key: params.key }
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
const MemoryHealthCheckInputSchema = z.object({});
|
|
246
|
+
export function createMemoryHealthCheckTool(context) {
|
|
247
|
+
return {
|
|
248
|
+
name: 'memory_health_check',
|
|
249
|
+
description: 'Check memory system health',
|
|
250
|
+
inputSchema: MemoryHealthCheckInputSchema,
|
|
251
|
+
execute: async () => {
|
|
252
|
+
const memories = Array.from(context.memory.values());
|
|
253
|
+
const totalSize = memories.reduce((sum, m) => sum + m.content.length, 0);
|
|
254
|
+
const coreMemories = memories.filter(m => m.core || m.importance >= 8);
|
|
255
|
+
return {
|
|
256
|
+
success: true,
|
|
257
|
+
data: {
|
|
258
|
+
total_memories: memories.length,
|
|
259
|
+
core_memories: coreMemories.length,
|
|
260
|
+
total_size_bytes: totalSize,
|
|
261
|
+
average_importance: memories.reduce((sum, m) => sum + m.importance, 0) / memories.length || 0,
|
|
262
|
+
health_status: 'good'
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
// ===== CODE ANALYSIS OPERATIONS (Stubs) =====
|
|
269
|
+
const CodeAnalyzeDeadInputSchema = z.object({
|
|
270
|
+
scope: z.enum(['workspace', 'folder', 'file']).describe('Analysis scope'),
|
|
271
|
+
target: z.string().optional().describe('Target folder or file'),
|
|
272
|
+
filePattern: z.string().optional().describe('File pattern to analyze'),
|
|
273
|
+
excludePatterns: z.array(z.string()).optional().describe('Patterns to exclude'),
|
|
274
|
+
analysisDepth: z.enum(['quick', 'thorough']).describe('Analysis depth')
|
|
275
|
+
});
|
|
276
|
+
export function createCodeAnalyzeDeadTool(_context) {
|
|
277
|
+
return {
|
|
278
|
+
name: 'code_analyze_dead',
|
|
279
|
+
description: 'Analyze dead code (requires VSCode extension with ts-morph)',
|
|
280
|
+
inputSchema: CodeAnalyzeDeadInputSchema,
|
|
281
|
+
execute: async (params) => {
|
|
282
|
+
return {
|
|
283
|
+
success: false,
|
|
284
|
+
error: 'Dead code analysis requires VSCode extension. This is a CLI stub.',
|
|
285
|
+
data: {
|
|
286
|
+
message: 'Please use VSCode extension for code analysis features'
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
const CodeCheckReferencesInputSchema = z.object({
|
|
293
|
+
file: z.string().describe('File containing symbol'),
|
|
294
|
+
line: z.number().describe('Line number'),
|
|
295
|
+
column: z.number().describe('Column number'),
|
|
296
|
+
symbolName: z.string().describe('Symbol name')
|
|
297
|
+
});
|
|
298
|
+
export function createCodeCheckReferencesTool(_context) {
|
|
299
|
+
return {
|
|
300
|
+
name: 'code_check_references',
|
|
301
|
+
description: 'Find references to a symbol (requires VSCode extension)',
|
|
302
|
+
inputSchema: CodeCheckReferencesInputSchema,
|
|
303
|
+
execute: async (params) => {
|
|
304
|
+
return {
|
|
305
|
+
success: false,
|
|
306
|
+
error: 'Reference checking requires VSCode extension. This is a CLI stub.'
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
const CodeAnalyzeCallGraphInputSchema = z.object({
|
|
312
|
+
entryPoint: z.string().describe('Entry point file'),
|
|
313
|
+
maxDepth: z.number().optional().describe('Maximum depth'),
|
|
314
|
+
format: z.enum(['dot', 'json']).describe('Output format')
|
|
315
|
+
});
|
|
316
|
+
export function createCodeAnalyzeCallGraphTool(_context) {
|
|
317
|
+
return {
|
|
318
|
+
name: 'code_analyze_call_graph',
|
|
319
|
+
description: 'Generate call graph (requires VSCode extension)',
|
|
320
|
+
inputSchema: CodeAnalyzeCallGraphInputSchema,
|
|
321
|
+
execute: async (params) => {
|
|
322
|
+
return {
|
|
323
|
+
success: false,
|
|
324
|
+
error: 'Call graph analysis requires VSCode extension. This is a CLI stub.'
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
// Export all additional tools
|
|
330
|
+
export function createAdditionalTools(context) {
|
|
331
|
+
return [
|
|
332
|
+
// UI operations
|
|
333
|
+
createAddFindingsTool(context),
|
|
334
|
+
createFinishCurrentStepTool(context),
|
|
335
|
+
createSidebarUpdateStepTool(context),
|
|
336
|
+
createWebviewUpdateContentTool(context),
|
|
337
|
+
createUserNotifyTool(context),
|
|
338
|
+
createUserAskTool(context),
|
|
339
|
+
// Report operations
|
|
340
|
+
createReportAddAssetTool(context),
|
|
341
|
+
// Configuration
|
|
342
|
+
createLimoConfigReadTool(context),
|
|
343
|
+
// Memory operations - REMOVED: Now handled by Deity's built-in memory tools
|
|
344
|
+
// Code analysis (stubs)
|
|
345
|
+
createCodeAnalyzeDeadTool(context),
|
|
346
|
+
createCodeCheckReferencesTool(context),
|
|
347
|
+
createCodeAnalyzeCallGraphTool(context)
|
|
348
|
+
];
|
|
349
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended tool implementations for Limo CLI
|
|
3
|
+
* Implements all missing tools from VSCode extension
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { Tool } from '@limo-labs/deity';
|
|
7
|
+
import type { ToolContext } from './index.js';
|
|
8
|
+
declare const FileSearchContentInputSchema: z.ZodObject<{
|
|
9
|
+
root_path: z.ZodString;
|
|
10
|
+
pattern: z.ZodString;
|
|
11
|
+
file_pattern: z.ZodOptional<z.ZodString>;
|
|
12
|
+
exclude_pattern: z.ZodOptional<z.ZodString>;
|
|
13
|
+
max_results: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare function createFileSearchContentTool(context: ToolContext): Tool<z.infer<typeof FileSearchContentInputSchema>, any>;
|
|
16
|
+
declare const TerminalExecuteInputSchema: z.ZodObject<{
|
|
17
|
+
command: z.ZodString;
|
|
18
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare function createTerminalExecuteTool(context: ToolContext): Tool<z.infer<typeof TerminalExecuteInputSchema>, any>;
|
|
22
|
+
declare const MemoryListInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
23
|
+
export declare function createMemoryListTool(context: ToolContext): Tool<z.infer<typeof MemoryListInputSchema>, any>;
|
|
24
|
+
declare const MemorySearchInputSchema: z.ZodObject<{
|
|
25
|
+
query: z.ZodOptional<z.ZodString>;
|
|
26
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
min_importance: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
max_results: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export declare function createMemorySearchTool(context: ToolContext): Tool<z.infer<typeof MemorySearchInputSchema>, any>;
|
|
32
|
+
declare const MemoryUpdateInputSchema: z.ZodObject<{
|
|
33
|
+
key: z.ZodString;
|
|
34
|
+
content: z.ZodString;
|
|
35
|
+
importance: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
merge_mode: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
replace: "replace";
|
|
38
|
+
append: "append";
|
|
39
|
+
}>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export declare function createMemoryUpdateTool(context: ToolContext): Tool<z.infer<typeof MemoryUpdateInputSchema>, any>;
|
|
42
|
+
declare const WebSearchInputSchema: z.ZodObject<{
|
|
43
|
+
query: z.ZodString;
|
|
44
|
+
max_results: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export declare function createWebSearchTool(_context: ToolContext): Tool<z.infer<typeof WebSearchInputSchema>, any>;
|
|
47
|
+
declare const WebFetchInputSchema: z.ZodObject<{
|
|
48
|
+
url: z.ZodString;
|
|
49
|
+
parse_html: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export declare function createWebFetchTool(_context: ToolContext): Tool<z.infer<typeof WebFetchInputSchema>, any>;
|
|
52
|
+
declare const ContextResetInputSchema: z.ZodObject<{
|
|
53
|
+
reason: z.ZodString;
|
|
54
|
+
memories_stored: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export declare function createContextResetTool(_context: ToolContext): Tool<z.infer<typeof ContextResetInputSchema>, any>;
|
|
57
|
+
declare const ContextStatsInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
58
|
+
export declare function createContextStatsTool(_context: ToolContext): Tool<z.infer<typeof ContextStatsInputSchema>, any>;
|
|
59
|
+
declare const SubtaskCreatePlanInputSchema: z.ZodObject<{
|
|
60
|
+
parent_task_id: z.ZodString;
|
|
61
|
+
subtasks: z.ZodArray<z.ZodObject<{
|
|
62
|
+
title: z.ZodString;
|
|
63
|
+
description: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare function createSubtaskCreatePlanTool(context: ToolContext): Tool<z.infer<typeof SubtaskCreatePlanInputSchema>, any>;
|
|
67
|
+
declare const SubtaskGetCurrentInputSchema: z.ZodObject<{
|
|
68
|
+
parent_task_id: z.ZodString;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export declare function createSubtaskGetCurrentTool(context: ToolContext): Tool<z.infer<typeof SubtaskGetCurrentInputSchema>, any>;
|
|
71
|
+
declare const SubtaskCompleteInputSchema: z.ZodObject<{
|
|
72
|
+
parent_task_id: z.ZodString;
|
|
73
|
+
result: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export declare function createSubtaskCompleteTool(context: ToolContext): Tool<z.infer<typeof SubtaskCompleteInputSchema>, any>;
|
|
76
|
+
declare const SubtaskSkipInputSchema: z.ZodObject<{
|
|
77
|
+
parent_task_id: z.ZodString;
|
|
78
|
+
reason: z.ZodString;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export declare function createSubtaskSkipTool(context: ToolContext): Tool<z.infer<typeof SubtaskSkipInputSchema>, any>;
|
|
81
|
+
declare const TaskGetCurrentInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
82
|
+
export declare function createTaskGetCurrentTool(context: ToolContext): Tool<z.infer<typeof TaskGetCurrentInputSchema>, any>;
|
|
83
|
+
declare const TaskExecuteNextInputSchema: z.ZodObject<{
|
|
84
|
+
current_task_id: z.ZodString;
|
|
85
|
+
outputs_generated: z.ZodObject<{}, z.core.$strip>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export declare function createTaskExecuteNextTool(context: ToolContext): Tool<z.infer<typeof TaskExecuteNextInputSchema>, any>;
|
|
88
|
+
declare const StartAnalysisStepInputSchema: z.ZodObject<{
|
|
89
|
+
module: z.ZodString;
|
|
90
|
+
title: z.ZodString;
|
|
91
|
+
description: z.ZodString;
|
|
92
|
+
phase: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
discovery: "discovery";
|
|
94
|
+
analysis: "analysis";
|
|
95
|
+
assessment: "assessment";
|
|
96
|
+
reporting: "reporting";
|
|
97
|
+
}>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export declare function createStartAnalysisStepTool(_context: ToolContext): Tool<z.infer<typeof StartAnalysisStepInputSchema>, any>;
|
|
100
|
+
export declare function createExtendedTools(context: ToolContext): Tool[];
|
|
101
|
+
export {};
|