@google/gemini-cli 0.1.10-dev.14 → 0.1.10

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 (143) hide show
  1. package/README.md +16 -2
  2. package/dist/google-gemini-cli-0.1.9.tgz +0 -0
  3. package/dist/package.json +7 -7
  4. package/dist/src/config/auth.js +6 -5
  5. package/dist/src/config/auth.js.map +1 -1
  6. package/dist/src/config/config.d.ts +0 -1
  7. package/dist/src/config/config.js +62 -50
  8. package/dist/src/config/config.js.map +1 -1
  9. package/dist/src/config/extension.d.ts +1 -0
  10. package/dist/src/config/extension.js +34 -6
  11. package/dist/src/config/extension.js.map +1 -1
  12. package/dist/src/config/sandboxConfig.d.ts +1 -1
  13. package/dist/src/config/sandboxConfig.js +1 -1
  14. package/dist/src/config/sandboxConfig.js.map +1 -1
  15. package/dist/src/config/settings.d.ts +7 -2
  16. package/dist/src/config/settings.js +101 -3
  17. package/dist/src/config/settings.js.map +1 -1
  18. package/dist/src/gemini.js +30 -21
  19. package/dist/src/gemini.js.map +1 -1
  20. package/dist/src/generated/git-commit.d.ts +1 -1
  21. package/dist/src/generated/git-commit.js +1 -1
  22. package/dist/src/nonInteractiveCli.d.ts +1 -1
  23. package/dist/src/nonInteractiveCli.js +4 -2
  24. package/dist/src/nonInteractiveCli.js.map +1 -1
  25. package/dist/src/services/CommandService.d.ts +13 -0
  26. package/dist/src/services/CommandService.js +30 -0
  27. package/dist/src/services/CommandService.js.map +1 -0
  28. package/dist/src/ui/App.js +71 -12
  29. package/dist/src/ui/App.js.map +1 -1
  30. package/dist/src/ui/commands/clearCommand.d.ts +7 -0
  31. package/dist/src/ui/commands/clearCommand.js +15 -0
  32. package/dist/src/ui/commands/clearCommand.js.map +1 -0
  33. package/dist/src/ui/commands/helpCommand.d.ts +7 -0
  34. package/dist/src/ui/commands/helpCommand.js +18 -0
  35. package/dist/src/ui/commands/helpCommand.js.map +1 -0
  36. package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
  37. package/dist/src/ui/commands/memoryCommand.js +81 -0
  38. package/dist/src/ui/commands/memoryCommand.js.map +1 -0
  39. package/dist/src/ui/commands/types.d.ts +63 -0
  40. package/dist/src/{gemini.test.d.ts → ui/commands/types.js} +1 -0
  41. package/dist/src/ui/commands/types.js.map +1 -0
  42. package/dist/src/ui/components/AuthDialog.js +36 -8
  43. package/dist/src/ui/components/AuthDialog.js.map +1 -1
  44. package/dist/src/ui/components/Help.d.ts +1 -1
  45. package/dist/src/ui/components/Help.js +3 -2
  46. package/dist/src/ui/components/Help.js.map +1 -1
  47. package/dist/src/ui/components/InputPrompt.d.ts +2 -1
  48. package/dist/src/ui/components/InputPrompt.js +106 -157
  49. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  50. package/dist/src/ui/components/LoadingIndicator.js +2 -1
  51. package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
  52. package/dist/src/ui/components/ThemeDialog.js +10 -9
  53. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  54. package/dist/src/ui/components/messages/CompressionMessage.js +1 -1
  55. package/dist/src/ui/components/shared/MaxSizedBox.js +1 -1
  56. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
  57. package/dist/src/ui/components/shared/text-buffer.d.ts +72 -16
  58. package/dist/src/ui/components/shared/text-buffer.js +564 -676
  59. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  60. package/dist/src/ui/contexts/SessionContext.d.ts +4 -1
  61. package/dist/src/ui/contexts/SessionContext.js +12 -2
  62. package/dist/src/ui/contexts/SessionContext.js.map +1 -1
  63. package/dist/src/ui/hooks/atCommandProcessor.js +5 -7
  64. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  65. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +6 -10
  66. package/dist/src/ui/hooks/slashCommandProcessor.js +217 -121
  67. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  68. package/dist/src/ui/hooks/useCompletion.d.ts +2 -2
  69. package/dist/src/ui/hooks/useCompletion.js +106 -56
  70. package/dist/src/ui/hooks/useCompletion.js.map +1 -1
  71. package/dist/src/ui/hooks/useGeminiStream.d.ts +3 -3
  72. package/dist/src/ui/hooks/useGeminiStream.js +45 -28
  73. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  74. package/dist/src/ui/themes/ansi.js +1 -1
  75. package/dist/src/ui/themes/ansi.js.map +1 -1
  76. package/dist/src/ui/types.d.ts +10 -0
  77. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +16 -0
  78. package/dist/src/ui/utils/InlineMarkdownRenderer.js +104 -0
  79. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
  80. package/dist/src/ui/utils/MarkdownDisplay.js +1 -80
  81. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
  82. package/dist/src/ui/utils/TableRenderer.js +50 -32
  83. package/dist/src/ui/utils/TableRenderer.js.map +1 -1
  84. package/dist/src/ui/utils/errorParsing.d.ts +2 -10
  85. package/dist/src/ui/utils/errorParsing.js +34 -23
  86. package/dist/src/ui/utils/errorParsing.js.map +1 -1
  87. package/dist/src/utils/sandbox-macos-permissive-proxied.sb +1 -1
  88. package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +1 -1
  89. package/dist/src/utils/userStartupWarnings.d.ts +6 -0
  90. package/dist/src/utils/userStartupWarnings.js +33 -0
  91. package/dist/src/utils/userStartupWarnings.js.map +1 -0
  92. package/dist/tsconfig.tsbuildinfo +1 -1
  93. package/package.json +8 -8
  94. package/dist/src/gemini.test.js +0 -122
  95. package/dist/src/gemini.test.js.map +0 -1
  96. package/dist/src/ui/App.test.d.ts +0 -6
  97. package/dist/src/ui/App.test.js +0 -299
  98. package/dist/src/ui/App.test.js.map +0 -1
  99. package/dist/src/ui/components/AuthDialog.test.d.ts +0 -6
  100. package/dist/src/ui/components/AuthDialog.test.js +0 -69
  101. package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
  102. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
  103. package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -81
  104. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
  105. package/dist/src/ui/components/InputPrompt.test.d.ts +0 -6
  106. package/dist/src/ui/components/InputPrompt.test.js +0 -154
  107. package/dist/src/ui/components/InputPrompt.test.js.map +0 -1
  108. package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
  109. package/dist/src/ui/components/LoadingIndicator.test.js +0 -141
  110. package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
  111. package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +0 -6
  112. package/dist/src/ui/components/ModelStatsDisplay.test.js +0 -217
  113. package/dist/src/ui/components/ModelStatsDisplay.test.js.map +0 -1
  114. package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +0 -6
  115. package/dist/src/ui/components/SessionSummaryDisplay.test.js +0 -60
  116. package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +0 -1
  117. package/dist/src/ui/components/StatsDisplay.test.d.ts +0 -6
  118. package/dist/src/ui/components/StatsDisplay.test.js +0 -275
  119. package/dist/src/ui/components/StatsDisplay.test.js.map +0 -1
  120. package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +0 -6
  121. package/dist/src/ui/components/ToolStatsDisplay.test.js +0 -160
  122. package/dist/src/ui/components/ToolStatsDisplay.test.js.map +0 -1
  123. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
  124. package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
  125. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
  126. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
  127. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -37
  128. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
  129. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
  130. package/dist/src/ui/components/messages/ToolMessage.test.js +0 -116
  131. package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
  132. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
  133. package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -134
  134. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
  135. package/dist/src/ui/contexts/SessionContext.test.d.ts +0 -6
  136. package/dist/src/ui/contexts/SessionContext.test.js +0 -96
  137. package/dist/src/ui/contexts/SessionContext.test.js.map +0 -1
  138. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +0 -6
  139. package/dist/src/ui/hooks/useGeminiStream.test.js +0 -775
  140. package/dist/src/ui/hooks/useGeminiStream.test.js.map +0 -1
  141. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
  142. package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -176
  143. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
@@ -4,12 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  export type Direction = 'left' | 'right' | 'up' | 'down' | 'wordLeft' | 'wordRight' | 'home' | 'end';
7
- type UpdateOperation = {
8
- type: 'insert';
9
- payload: string;
10
- } | {
11
- type: 'backspace';
12
- };
13
7
  export interface Viewport {
14
8
  height: number;
15
9
  width: number;
@@ -22,9 +16,75 @@ interface UseTextBufferProps {
22
16
  setRawMode?: (mode: boolean) => void;
23
17
  onChange?: (text: string) => void;
24
18
  isValidPath: (path: string) => boolean;
19
+ shellModeActive?: boolean;
20
+ }
21
+ interface UndoHistoryEntry {
22
+ lines: string[];
23
+ cursorRow: number;
24
+ cursorCol: number;
25
25
  }
26
26
  export declare function offsetToLogicalPos(text: string, offset: number): [number, number];
27
- export declare function useTextBuffer({ initialText, initialCursorOffset, viewport, stdin, setRawMode, onChange, isValidPath, }: UseTextBufferProps): TextBuffer;
27
+ interface TextBufferState {
28
+ lines: string[];
29
+ cursorRow: number;
30
+ cursorCol: number;
31
+ preferredCol: number | null;
32
+ undoStack: UndoHistoryEntry[];
33
+ redoStack: UndoHistoryEntry[];
34
+ clipboard: string | null;
35
+ selectionAnchor: [number, number] | null;
36
+ viewportWidth: number;
37
+ }
38
+ type TextBufferAction = {
39
+ type: 'set_text';
40
+ payload: string;
41
+ pushToUndo?: boolean;
42
+ } | {
43
+ type: 'insert';
44
+ payload: string;
45
+ } | {
46
+ type: 'backspace';
47
+ } | {
48
+ type: 'move';
49
+ payload: {
50
+ dir: Direction;
51
+ };
52
+ } | {
53
+ type: 'delete';
54
+ } | {
55
+ type: 'delete_word_left';
56
+ } | {
57
+ type: 'delete_word_right';
58
+ } | {
59
+ type: 'kill_line_right';
60
+ } | {
61
+ type: 'kill_line_left';
62
+ } | {
63
+ type: 'undo';
64
+ } | {
65
+ type: 'redo';
66
+ } | {
67
+ type: 'replace_range';
68
+ payload: {
69
+ startRow: number;
70
+ startCol: number;
71
+ endRow: number;
72
+ endCol: number;
73
+ text: string;
74
+ };
75
+ } | {
76
+ type: 'move_to_offset';
77
+ payload: {
78
+ offset: number;
79
+ };
80
+ } | {
81
+ type: 'create_undo_snapshot';
82
+ } | {
83
+ type: 'set_viewport_width';
84
+ payload: number;
85
+ };
86
+ export declare function textBufferReducer(state: TextBufferState, action: TextBufferAction): TextBufferState;
87
+ export declare function useTextBuffer({ initialText, initialCursorOffset, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive, }: UseTextBufferProps): TextBuffer;
28
88
  export interface TextBuffer {
29
89
  lines: string[];
30
90
  text: string;
@@ -54,8 +114,8 @@ export interface TextBuffer {
54
114
  backspace: () => void;
55
115
  del: () => void;
56
116
  move: (dir: Direction) => void;
57
- undo: () => boolean;
58
- redo: () => boolean;
117
+ undo: () => void;
118
+ redo: () => void;
59
119
  /**
60
120
  * Replaces the text within the specified range with new text.
61
121
  * Handles both single-line and multi-line ranges.
@@ -67,7 +127,7 @@ export interface TextBuffer {
67
127
  * @param text The new text to insert.
68
128
  * @returns True if the buffer was modified, false otherwise.
69
129
  */
70
- replaceRange: (startRow: number, startCol: number, endRow: number, endCol: number, text: string) => boolean;
130
+ replaceRange: (startRow: number, startCol: number, endRow: number, endCol: number, text: string) => void;
71
131
  /**
72
132
  * Delete the word to the *left* of the caret, mirroring common
73
133
  * Ctrl/Alt+Backspace behaviour in editors & terminals. Both the adjacent
@@ -99,7 +159,7 @@ export interface TextBuffer {
99
159
  shift: boolean;
100
160
  paste: boolean;
101
161
  sequence: string;
102
- }) => boolean;
162
+ }) => void;
103
163
  /**
104
164
  * Opens the current buffer contents in the user's preferred terminal text
105
165
  * editor ($VISUAL or $EDITOR, falling back to "vi"). The method blocks
@@ -118,11 +178,7 @@ export interface TextBuffer {
118
178
  openInExternalEditor: (opts?: {
119
179
  editor?: string;
120
180
  }) => Promise<void>;
121
- copy: () => string | null;
122
- paste: () => boolean;
123
- startSelection: () => void;
124
- replaceRangeByOffset: (startOffset: number, endOffset: number, replacementText: string) => boolean;
181
+ replaceRangeByOffset: (startOffset: number, endOffset: number, replacementText: string) => void;
125
182
  moveToOffset(offset: number): void;
126
- applyOperations: (ops: UpdateOperation[]) => void;
127
183
  }
128
184
  export {};