wiggum-cli 0.5.3 → 0.6.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 +57 -12
- package/dist/ai/conversation/conversation-manager.d.ts +84 -0
- package/dist/ai/conversation/conversation-manager.d.ts.map +1 -0
- package/dist/ai/conversation/conversation-manager.js +159 -0
- package/dist/ai/conversation/conversation-manager.js.map +1 -0
- package/dist/ai/conversation/index.d.ts +8 -0
- package/dist/ai/conversation/index.d.ts.map +1 -0
- package/dist/ai/conversation/index.js +8 -0
- package/dist/ai/conversation/index.js.map +1 -0
- package/dist/ai/conversation/spec-generator.d.ts +62 -0
- package/dist/ai/conversation/spec-generator.d.ts.map +1 -0
- package/dist/ai/conversation/spec-generator.js +267 -0
- package/dist/ai/conversation/spec-generator.js.map +1 -0
- package/dist/ai/conversation/url-fetcher.d.ts +26 -0
- package/dist/ai/conversation/url-fetcher.d.ts.map +1 -0
- package/dist/ai/conversation/url-fetcher.js +145 -0
- package/dist/ai/conversation/url-fetcher.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +44 -34
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +50 -23
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/new.d.ts +11 -1
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +102 -43
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/run.js +3 -3
- package/dist/commands/run.js.map +1 -1
- package/dist/generator/config.d.ts.map +1 -1
- package/dist/generator/config.js +2 -0
- package/dist/generator/config.js.map +1 -1
- package/dist/repl/command-parser.d.ts +79 -0
- package/dist/repl/command-parser.d.ts.map +1 -0
- package/dist/repl/command-parser.js +107 -0
- package/dist/repl/command-parser.js.map +1 -0
- package/dist/repl/index.d.ts +8 -0
- package/dist/repl/index.d.ts.map +1 -0
- package/dist/repl/index.js +8 -0
- package/dist/repl/index.js.map +1 -0
- package/dist/repl/repl-loop.d.ts +30 -0
- package/dist/repl/repl-loop.d.ts.map +1 -0
- package/dist/repl/repl-loop.js +201 -0
- package/dist/repl/repl-loop.js.map +1 -0
- package/dist/repl/session-state.d.ts +35 -0
- package/dist/repl/session-state.d.ts.map +1 -0
- package/dist/repl/session-state.js +25 -0
- package/dist/repl/session-state.js.map +1 -0
- package/package.json +1 -1
- package/src/ai/conversation/conversation-manager.ts +230 -0
- package/src/ai/conversation/index.ts +23 -0
- package/src/ai/conversation/spec-generator.ts +327 -0
- package/src/ai/conversation/url-fetcher.ts +180 -0
- package/src/cli.ts +47 -34
- package/src/commands/init.ts +59 -23
- package/src/commands/new.ts +121 -44
- package/src/commands/run.ts +3 -3
- package/src/generator/config.ts +2 -0
- package/src/repl/command-parser.ts +149 -0
- package/src/repl/index.ts +23 -0
- package/src/repl/repl-loop.ts +269 -0
- package/src/repl/session-state.ts +59 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session State Management
|
|
3
|
+
* Maintains state for the interactive REPL session
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AIProvider } from '../ai/providers.js';
|
|
7
|
+
import type { ScanResult } from '../scanner/types.js';
|
|
8
|
+
import type { RalphConfig } from '../utils/config.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Session state for the REPL
|
|
12
|
+
*/
|
|
13
|
+
export interface SessionState {
|
|
14
|
+
/** Root directory of the project */
|
|
15
|
+
projectRoot: string;
|
|
16
|
+
/** Loaded Ralph configuration */
|
|
17
|
+
config: RalphConfig | null;
|
|
18
|
+
/** AI provider being used */
|
|
19
|
+
provider: AIProvider;
|
|
20
|
+
/** Model to use for AI operations */
|
|
21
|
+
model: string;
|
|
22
|
+
/** Cached scan result from init */
|
|
23
|
+
scanResult?: ScanResult;
|
|
24
|
+
/** Whether we're in a conversation mode (e.g., spec generation) */
|
|
25
|
+
conversationMode: boolean;
|
|
26
|
+
/** Current conversation context (e.g., 'spec-generation') */
|
|
27
|
+
conversationContext?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create a new session state
|
|
32
|
+
*/
|
|
33
|
+
export function createSessionState(
|
|
34
|
+
projectRoot: string,
|
|
35
|
+
provider: AIProvider,
|
|
36
|
+
model: string,
|
|
37
|
+
scanResult?: ScanResult,
|
|
38
|
+
config?: RalphConfig | null
|
|
39
|
+
): SessionState {
|
|
40
|
+
return {
|
|
41
|
+
projectRoot,
|
|
42
|
+
config: config ?? null,
|
|
43
|
+
provider,
|
|
44
|
+
model,
|
|
45
|
+
scanResult,
|
|
46
|
+
conversationMode: false,
|
|
47
|
+
conversationContext: undefined,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Update session state immutably
|
|
53
|
+
*/
|
|
54
|
+
export function updateSessionState(
|
|
55
|
+
state: SessionState,
|
|
56
|
+
updates: Partial<SessionState>
|
|
57
|
+
): SessionState {
|
|
58
|
+
return { ...state, ...updates };
|
|
59
|
+
}
|