@sashabogi/argus-mcp 1.2.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.
@@ -0,0 +1,241 @@
1
+ /**
2
+ * Argus Onboarding Module
3
+ *
4
+ * Interactive setup wizard that adapts to user experience level.
5
+ * - Beginner: Automatic setup with sensible defaults
6
+ * - Intermediate: Smart detection with confirmation
7
+ * - Expert: Full control over all settings
8
+ */
9
+ type ExperienceLevel = 'beginner' | 'intermediate' | 'expert';
10
+ interface OnboardingConfig {
11
+ experienceLevel: ExperienceLevel;
12
+ globalKeyPatterns: string[];
13
+ autoBehaviors: {
14
+ refreshStaleSnapshots: boolean;
15
+ contextRestoreOnCompact: boolean;
16
+ trackNewKeyFiles: 'auto' | 'ask' | 'manual';
17
+ };
18
+ projects: Record<string, ProjectOnboardingConfig>;
19
+ }
20
+ interface ProjectOnboardingConfig {
21
+ keyFiles: string[];
22
+ customPatterns: string[];
23
+ lastScanDate?: string;
24
+ }
25
+
26
+ /**
27
+ * Argus Configuration Management
28
+ *
29
+ * Handles loading, saving, and validating configuration for Argus.
30
+ * Configuration is stored in ~/.argus/config.json
31
+ */
32
+
33
+ type ProviderType = 'zai' | 'anthropic' | 'openai' | 'deepseek' | 'ollama';
34
+
35
+ interface ProviderConfig {
36
+ apiKey?: string;
37
+ baseUrl?: string;
38
+ model: string;
39
+ options?: Record<string, unknown>;
40
+ }
41
+ interface ArgusConfig {
42
+ provider: ProviderType;
43
+ providers: {
44
+ zai?: ProviderConfig;
45
+ anthropic?: ProviderConfig;
46
+ openai?: ProviderConfig;
47
+ deepseek?: ProviderConfig;
48
+ ollama?: ProviderConfig;
49
+ };
50
+ defaults: {
51
+ maxTurns: number;
52
+ turnTimeoutMs: number;
53
+ snapshotExtensions: string[];
54
+ excludePatterns: string[];
55
+ };
56
+ onboarding?: OnboardingConfig;
57
+ onboardingComplete?: boolean;
58
+ }
59
+ declare function getConfigPath(): string;
60
+ declare function ensureConfigDir(): void;
61
+ declare function loadConfig(): ArgusConfig;
62
+ declare function saveConfig(config: ArgusConfig): void;
63
+ declare function getProviderConfig(config: ArgusConfig): ProviderConfig;
64
+ declare function validateConfig(config: ArgusConfig): string[];
65
+ declare const PROVIDER_DEFAULTS: Record<ProviderType, Partial<ProviderConfig>>;
66
+
67
+ /**
68
+ * Argus Snapshot Generator
69
+ *
70
+ * Creates optimized text snapshots of codebases for analysis.
71
+ * Handles file filtering, exclusion patterns, and formatting.
72
+ */
73
+ interface SnapshotOptions {
74
+ extensions?: string[];
75
+ excludePatterns?: string[];
76
+ maxFileSize?: number;
77
+ includeHidden?: boolean;
78
+ }
79
+ interface SnapshotResult {
80
+ outputPath: string;
81
+ fileCount: number;
82
+ totalLines: number;
83
+ totalSize: number;
84
+ files: string[];
85
+ }
86
+ declare function createSnapshot(projectPath: string, outputPath: string, options?: SnapshotOptions): SnapshotResult;
87
+ declare function getSnapshotStats(snapshotPath: string): {
88
+ fileCount: number;
89
+ totalLines: number;
90
+ totalSize: number;
91
+ };
92
+
93
+ /**
94
+ * Argus AI Provider Interface
95
+ *
96
+ * Defines the contract for AI providers used by the RLM engine.
97
+ */
98
+
99
+ interface Message {
100
+ role: 'system' | 'user' | 'assistant';
101
+ content: string;
102
+ }
103
+ interface CompletionOptions {
104
+ temperature?: number;
105
+ maxTokens?: number;
106
+ stopSequences?: string[];
107
+ }
108
+ interface CompletionResult {
109
+ content: string;
110
+ finishReason: 'stop' | 'length' | 'error';
111
+ usage?: {
112
+ promptTokens: number;
113
+ completionTokens: number;
114
+ totalTokens: number;
115
+ };
116
+ }
117
+ interface AIProvider {
118
+ name: string;
119
+ /**
120
+ * Generate a completion from the AI model
121
+ */
122
+ complete(messages: Message[], options?: CompletionOptions): Promise<CompletionResult>;
123
+ /**
124
+ * Check if the provider is properly configured and reachable
125
+ */
126
+ healthCheck(): Promise<boolean>;
127
+ }
128
+
129
+ /**
130
+ * Argus RLM Engine
131
+ *
132
+ * Recursive Language Model engine for document analysis.
133
+ * Based on the Matryoshka RLM approach by Dmitri Sotnikov.
134
+ *
135
+ * The engine uses an LLM to generate Nucleus DSL commands that are
136
+ * executed against documents, enabling analysis of content far
137
+ * exceeding typical context limits.
138
+ */
139
+
140
+ interface AnalysisOptions {
141
+ maxTurns?: number;
142
+ turnTimeoutMs?: number;
143
+ verbose?: boolean;
144
+ onProgress?: (turn: number, command: string, result: unknown) => void;
145
+ }
146
+ interface AnalysisResult {
147
+ answer: string;
148
+ turns: number;
149
+ commands: string[];
150
+ success: boolean;
151
+ error?: string;
152
+ }
153
+ interface GrepMatch {
154
+ match: string;
155
+ line: string;
156
+ lineNum: number;
157
+ index: number;
158
+ groups: string[];
159
+ }
160
+ /**
161
+ * Run RLM analysis on a document
162
+ */
163
+ declare function analyze(provider: AIProvider, documentPath: string, query: string, options?: AnalysisOptions): Promise<AnalysisResult>;
164
+ /**
165
+ * Fast grep search without AI
166
+ */
167
+ declare function searchDocument(documentPath: string, pattern: string, options?: {
168
+ caseInsensitive?: boolean;
169
+ maxResults?: number;
170
+ }): GrepMatch[];
171
+
172
+ /**
173
+ * OpenAI-Compatible Provider
174
+ *
175
+ * Works with OpenAI, ZAI (GLM), DeepSeek, and any OpenAI-compatible API.
176
+ */
177
+
178
+ /**
179
+ * Create a provider for ZAI GLM models
180
+ */
181
+ declare function createZAIProvider(config: ProviderConfig): AIProvider;
182
+ /**
183
+ * Create a provider for OpenAI models
184
+ */
185
+ declare function createOpenAIProvider(config: ProviderConfig): AIProvider;
186
+ /**
187
+ * Create a provider for DeepSeek models
188
+ */
189
+ declare function createDeepSeekProvider(config: ProviderConfig): AIProvider;
190
+
191
+ /**
192
+ * Ollama Provider
193
+ *
194
+ * Provider for local Ollama models.
195
+ */
196
+
197
+ declare class OllamaProvider implements AIProvider {
198
+ name: string;
199
+ private config;
200
+ constructor(config: ProviderConfig);
201
+ complete(messages: Message[], options?: CompletionOptions): Promise<CompletionResult>;
202
+ healthCheck(): Promise<boolean>;
203
+ /**
204
+ * List available models
205
+ */
206
+ listModels(): Promise<string[]>;
207
+ }
208
+ declare function createOllamaProvider(config: ProviderConfig): OllamaProvider;
209
+
210
+ /**
211
+ * Anthropic Provider
212
+ *
213
+ * Provider for Claude models via the Anthropic API.
214
+ */
215
+
216
+ declare function createAnthropicProvider(config: ProviderConfig): AIProvider;
217
+
218
+ /**
219
+ * Argus AI Providers
220
+ *
221
+ * Factory for creating AI providers based on configuration.
222
+ */
223
+
224
+ /**
225
+ * Create an AI provider from Argus configuration
226
+ */
227
+ declare function createProvider(config: ArgusConfig): AIProvider;
228
+ /**
229
+ * Create an AI provider by type and config
230
+ */
231
+ declare function createProviderByType(type: ProviderType, config: ProviderConfig): AIProvider;
232
+ /**
233
+ * Get a human-readable name for a provider
234
+ */
235
+ declare function getProviderDisplayName(type: ProviderType): string;
236
+ /**
237
+ * List all available provider types
238
+ */
239
+ declare function listProviderTypes(): ProviderType[];
240
+
241
+ export { type AIProvider, type ProviderConfig as AIProviderConfig, type AnalysisOptions, type AnalysisResult, type ArgusConfig, type CompletionOptions, type CompletionResult, type ProviderConfig as CoreProviderConfig, type Message, PROVIDER_DEFAULTS, type ProviderType, type SnapshotOptions, type SnapshotResult, analyze, createAnthropicProvider, createDeepSeekProvider, createOllamaProvider, createOpenAIProvider, createProvider, createProviderByType, createSnapshot, createZAIProvider, ensureConfigDir, getConfigPath, getProviderConfig, getProviderDisplayName, getSnapshotStats, listProviderTypes, loadConfig, saveConfig, searchDocument, validateConfig };