grov 0.1.2 → 0.2.3
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 +73 -88
- package/dist/cli.js +23 -37
- package/dist/commands/capture.js +1 -1
- package/dist/commands/disable.d.ts +1 -0
- package/dist/commands/disable.js +14 -0
- package/dist/commands/drift-test.js +56 -68
- package/dist/commands/init.js +29 -17
- package/dist/commands/proxy-status.d.ts +1 -0
- package/dist/commands/proxy-status.js +32 -0
- package/dist/commands/unregister.js +7 -1
- package/dist/lib/correction-builder-proxy.d.ts +16 -0
- package/dist/lib/correction-builder-proxy.js +125 -0
- package/dist/lib/correction-builder.js +1 -1
- package/dist/lib/drift-checker-proxy.d.ts +63 -0
- package/dist/lib/drift-checker-proxy.js +373 -0
- package/dist/lib/drift-checker.js +1 -1
- package/dist/lib/hooks.d.ts +11 -0
- package/dist/lib/hooks.js +33 -0
- package/dist/lib/llm-extractor.d.ts +60 -11
- package/dist/lib/llm-extractor.js +431 -98
- package/dist/lib/settings.d.ts +19 -0
- package/dist/lib/settings.js +63 -0
- package/dist/lib/store.d.ts +201 -43
- package/dist/lib/store.js +653 -90
- package/dist/proxy/action-parser.d.ts +58 -0
- package/dist/proxy/action-parser.js +196 -0
- package/dist/proxy/config.d.ts +26 -0
- package/dist/proxy/config.js +67 -0
- package/dist/proxy/forwarder.d.ts +24 -0
- package/dist/proxy/forwarder.js +119 -0
- package/dist/proxy/index.d.ts +1 -0
- package/dist/proxy/index.js +30 -0
- package/dist/proxy/request-processor.d.ts +12 -0
- package/dist/proxy/request-processor.js +120 -0
- package/dist/proxy/response-processor.d.ts +14 -0
- package/dist/proxy/response-processor.js +138 -0
- package/dist/proxy/server.d.ts +9 -0
- package/dist/proxy/server.js +904 -0
- package/package.json +8 -3
package/dist/lib/hooks.js
CHANGED
|
@@ -256,3 +256,36 @@ export function unregisterGrovHooks() {
|
|
|
256
256
|
export function getSettingsPath() {
|
|
257
257
|
return SETTINGS_PATH;
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Set or remove ANTHROPIC_BASE_URL in settings.json env section.
|
|
261
|
+
* This allows users to just type 'claude' instead of setting env var manually.
|
|
262
|
+
*/
|
|
263
|
+
export function setProxyEnv(enable) {
|
|
264
|
+
const settings = readClaudeSettings();
|
|
265
|
+
const PROXY_URL = 'http://127.0.0.1:8080';
|
|
266
|
+
if (enable) {
|
|
267
|
+
// Add env.ANTHROPIC_BASE_URL
|
|
268
|
+
if (!settings.env) {
|
|
269
|
+
settings.env = {};
|
|
270
|
+
}
|
|
271
|
+
if (settings.env.ANTHROPIC_BASE_URL === PROXY_URL) {
|
|
272
|
+
return { action: 'unchanged' };
|
|
273
|
+
}
|
|
274
|
+
settings.env.ANTHROPIC_BASE_URL = PROXY_URL;
|
|
275
|
+
writeClaudeSettings(settings);
|
|
276
|
+
return { action: 'added' };
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
// Remove env.ANTHROPIC_BASE_URL
|
|
280
|
+
if (!settings.env?.ANTHROPIC_BASE_URL) {
|
|
281
|
+
return { action: 'unchanged' };
|
|
282
|
+
}
|
|
283
|
+
delete settings.env.ANTHROPIC_BASE_URL;
|
|
284
|
+
// Clean up empty env object
|
|
285
|
+
if (Object.keys(settings.env).length === 0) {
|
|
286
|
+
delete settings.env;
|
|
287
|
+
}
|
|
288
|
+
writeClaudeSettings(settings);
|
|
289
|
+
return { action: 'removed' };
|
|
290
|
+
}
|
|
291
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ParsedSession } from './jsonl-parser.js';
|
|
2
|
-
import type { TaskStatus } from './store.js';
|
|
2
|
+
import type { TaskStatus, SessionState, StepRecord } from './store.js';
|
|
3
3
|
export interface ExtractedReasoning {
|
|
4
4
|
task: string;
|
|
5
5
|
goal: string;
|
|
@@ -17,6 +17,23 @@ export interface ExtractedReasoning {
|
|
|
17
17
|
* Check if LLM extraction is available (OpenAI API key set)
|
|
18
18
|
*/
|
|
19
19
|
export declare function isLLMAvailable(): boolean;
|
|
20
|
+
export interface ExtractedIntent {
|
|
21
|
+
goal: string;
|
|
22
|
+
expected_scope: string[];
|
|
23
|
+
constraints: string[];
|
|
24
|
+
success_criteria?: string[];
|
|
25
|
+
keywords: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Extract intent from first user prompt using Haiku
|
|
29
|
+
* Called once at session start to populate session_states
|
|
30
|
+
* Falls back to basic extraction if API unavailable (for hook compatibility)
|
|
31
|
+
*/
|
|
32
|
+
export declare function extractIntent(firstPrompt: string): Promise<ExtractedIntent>;
|
|
33
|
+
/**
|
|
34
|
+
* Check if intent extraction is available
|
|
35
|
+
*/
|
|
36
|
+
export declare function isIntentExtractionAvailable(): boolean;
|
|
20
37
|
/**
|
|
21
38
|
* Check if Anthropic API is available (for drift detection)
|
|
22
39
|
*/
|
|
@@ -34,17 +51,49 @@ export declare function extractReasoning(session: ParsedSession): Promise<Extrac
|
|
|
34
51
|
*/
|
|
35
52
|
export declare function classifyTaskStatus(session: ParsedSession): Promise<TaskStatus>;
|
|
36
53
|
/**
|
|
37
|
-
*
|
|
54
|
+
* Check if session summary generation is available
|
|
38
55
|
*/
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
export declare function isSummaryAvailable(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Generate session summary for CLEAR operation
|
|
59
|
+
* Reference: plan_proxy_local.md Section 2.3, 4.5
|
|
60
|
+
*/
|
|
61
|
+
export declare function generateSessionSummary(sessionState: SessionState, steps: StepRecord[]): Promise<string>;
|
|
62
|
+
/**
|
|
63
|
+
* Task analysis result from Haiku
|
|
64
|
+
*/
|
|
65
|
+
export interface TaskAnalysis {
|
|
66
|
+
action: 'continue' | 'new_task' | 'subtask' | 'parallel_task' | 'task_complete' | 'subtask_complete';
|
|
67
|
+
topic_match?: 'YES' | 'NO';
|
|
68
|
+
task_id: string;
|
|
69
|
+
current_goal: string;
|
|
70
|
+
parent_task_id?: string;
|
|
71
|
+
reasoning: string;
|
|
72
|
+
step_reasoning?: string;
|
|
45
73
|
}
|
|
46
74
|
/**
|
|
47
|
-
*
|
|
48
|
-
|
|
75
|
+
* Check if task analysis is available
|
|
76
|
+
*/
|
|
77
|
+
export declare function isTaskAnalysisAvailable(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Analyze task context to determine task status
|
|
80
|
+
* Called after each main model response to orchestrate sessions
|
|
81
|
+
* Also compresses reasoning for steps if assistantResponse > 1000 chars
|
|
82
|
+
*/
|
|
83
|
+
export declare function analyzeTaskContext(currentSession: SessionState | null, latestUserMessage: string, recentSteps: StepRecord[], assistantResponse: string): Promise<TaskAnalysis>;
|
|
84
|
+
export interface ExtractedReasoningAndDecisions {
|
|
85
|
+
reasoning_trace: string[];
|
|
86
|
+
decisions: Array<{
|
|
87
|
+
choice: string;
|
|
88
|
+
reason: string;
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Check if reasoning extraction is available
|
|
93
|
+
*/
|
|
94
|
+
export declare function isReasoningExtractionAvailable(): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Extract reasoning trace and decisions from steps
|
|
97
|
+
* Called at task_complete to populate team memory with rich context
|
|
49
98
|
*/
|
|
50
|
-
export declare function
|
|
99
|
+
export declare function extractReasoningAndDecisions(stepsReasoning: string[], originalGoal: string): Promise<ExtractedReasoningAndDecisions>;
|