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.
Files changed (63) hide show
  1. package/README.md +57 -12
  2. package/dist/ai/conversation/conversation-manager.d.ts +84 -0
  3. package/dist/ai/conversation/conversation-manager.d.ts.map +1 -0
  4. package/dist/ai/conversation/conversation-manager.js +159 -0
  5. package/dist/ai/conversation/conversation-manager.js.map +1 -0
  6. package/dist/ai/conversation/index.d.ts +8 -0
  7. package/dist/ai/conversation/index.d.ts.map +1 -0
  8. package/dist/ai/conversation/index.js +8 -0
  9. package/dist/ai/conversation/index.js.map +1 -0
  10. package/dist/ai/conversation/spec-generator.d.ts +62 -0
  11. package/dist/ai/conversation/spec-generator.d.ts.map +1 -0
  12. package/dist/ai/conversation/spec-generator.js +267 -0
  13. package/dist/ai/conversation/spec-generator.js.map +1 -0
  14. package/dist/ai/conversation/url-fetcher.d.ts +26 -0
  15. package/dist/ai/conversation/url-fetcher.d.ts.map +1 -0
  16. package/dist/ai/conversation/url-fetcher.js +145 -0
  17. package/dist/ai/conversation/url-fetcher.js.map +1 -0
  18. package/dist/cli.d.ts.map +1 -1
  19. package/dist/cli.js +44 -34
  20. package/dist/cli.js.map +1 -1
  21. package/dist/commands/init.d.ts +1 -0
  22. package/dist/commands/init.d.ts.map +1 -1
  23. package/dist/commands/init.js +50 -23
  24. package/dist/commands/init.js.map +1 -1
  25. package/dist/commands/new.d.ts +11 -1
  26. package/dist/commands/new.d.ts.map +1 -1
  27. package/dist/commands/new.js +102 -43
  28. package/dist/commands/new.js.map +1 -1
  29. package/dist/commands/run.js +3 -3
  30. package/dist/commands/run.js.map +1 -1
  31. package/dist/generator/config.d.ts.map +1 -1
  32. package/dist/generator/config.js +2 -0
  33. package/dist/generator/config.js.map +1 -1
  34. package/dist/repl/command-parser.d.ts +79 -0
  35. package/dist/repl/command-parser.d.ts.map +1 -0
  36. package/dist/repl/command-parser.js +107 -0
  37. package/dist/repl/command-parser.js.map +1 -0
  38. package/dist/repl/index.d.ts +8 -0
  39. package/dist/repl/index.d.ts.map +1 -0
  40. package/dist/repl/index.js +8 -0
  41. package/dist/repl/index.js.map +1 -0
  42. package/dist/repl/repl-loop.d.ts +30 -0
  43. package/dist/repl/repl-loop.d.ts.map +1 -0
  44. package/dist/repl/repl-loop.js +201 -0
  45. package/dist/repl/repl-loop.js.map +1 -0
  46. package/dist/repl/session-state.d.ts +35 -0
  47. package/dist/repl/session-state.d.ts.map +1 -0
  48. package/dist/repl/session-state.js +25 -0
  49. package/dist/repl/session-state.js.map +1 -0
  50. package/package.json +1 -1
  51. package/src/ai/conversation/conversation-manager.ts +230 -0
  52. package/src/ai/conversation/index.ts +23 -0
  53. package/src/ai/conversation/spec-generator.ts +327 -0
  54. package/src/ai/conversation/url-fetcher.ts +180 -0
  55. package/src/cli.ts +47 -34
  56. package/src/commands/init.ts +59 -23
  57. package/src/commands/new.ts +121 -44
  58. package/src/commands/run.ts +3 -3
  59. package/src/generator/config.ts +2 -0
  60. package/src/repl/command-parser.ts +149 -0
  61. package/src/repl/index.ts +23 -0
  62. package/src/repl/repl-loop.ts +269 -0
  63. 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
+ }