vzcode 2.0.0 → 2.3.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 (218) hide show
  1. package/dist/assets/{buildWorker-Dsx6rOdK.js → buildWorker-wLkQ0yz1.js} +64 -64
  2. package/dist/assets/{index-BM8tDh6M.css → index-BoFeK4GL.css} +1 -1
  3. package/dist/assets/{index-BgqNq-ww.js → index-DuUjtrt6.js} +107 -107
  4. package/dist/assets/{worker-BeBZGG1n.js → worker-DHxSPM7N.js} +78 -78
  5. package/dist/cli.js +113 -0
  6. package/dist/index.html +2 -2
  7. package/{src/ot.ts → dist/ot.js} +2 -14
  8. package/{src/randomId.ts → dist/randomId.js} +5 -6
  9. package/dist/runCode.js +20 -0
  10. package/dist/server/aiChatHandler/aiEditing.js +89 -0
  11. package/dist/server/aiChatHandler/chatOperations.js +360 -0
  12. package/dist/server/aiChatHandler/errorHandling.js +49 -0
  13. package/dist/server/aiChatHandler/index.js +112 -0
  14. package/dist/server/aiChatHandler/llmStreaming.js +284 -0
  15. package/dist/server/aiChatHandler/validation.js +19 -0
  16. package/dist/server/computeInitialDocument.js +146 -0
  17. package/{src/server/config.ts → dist/server/config.js} +4 -7
  18. package/{src/server/featureFlags.ts → dist/server/featureFlags.js} +0 -3
  19. package/dist/server/generateAIResponse.js +129 -0
  20. package/dist/server/handleAIAssist.js +39 -0
  21. package/dist/server/handleAICopilot.js +81 -0
  22. package/dist/server/index.js +297 -0
  23. package/dist/server/livekit.js +17 -0
  24. package/dist/server/prettier.js +90 -0
  25. package/{src/server/setupEnv.ts → dist/server/setupEnv.js} +1 -2
  26. package/dist/submitOperation.js +14 -0
  27. package/dist/types.js +1 -0
  28. package/dist/utils/fileDiff.js +66 -0
  29. package/package.json +23 -22
  30. package/src/client/AIAssist/AIAssistCodeMirrorKeyMap.ts +0 -42
  31. package/src/client/AIAssist/AIAssistWidget/index.tsx +0 -135
  32. package/src/client/AIAssist/AIAssistWidget/style.scss +0 -47
  33. package/src/client/AIAssist/Spinner.jsx +0 -76
  34. package/src/client/AIAssist/formatFile.ts +0 -27
  35. package/src/client/AIAssist/generateFilesContext.ts +0 -25
  36. package/src/client/AIAssist/index.ts +0 -2
  37. package/src/client/AIAssist/startAIAssist.ts +0 -95
  38. package/src/client/App/index.tsx +0 -153
  39. package/src/client/App/style.scss +0 -82
  40. package/src/client/App/usePending.ts +0 -51
  41. package/src/client/App/useShareDB.ts +0 -161
  42. package/src/client/CodeEditor/Copilot/index.ts +0 -74
  43. package/src/client/CodeEditor/InteractiveWidgets/boolToggler.ts +0 -12
  44. package/src/client/CodeEditor/InteractiveWidgets/colorPicker.ts +0 -68
  45. package/src/client/CodeEditor/InteractiveWidgets/colorsInTextPlugin.ts +0 -174
  46. package/src/client/CodeEditor/InteractiveWidgets/highlightWidgets.ts +0 -79
  47. package/src/client/CodeEditor/InteractiveWidgets/index.ts +0 -44
  48. package/src/client/CodeEditor/InteractiveWidgets/markdownCheckboxToggler.ts +0 -12
  49. package/src/client/CodeEditor/InteractiveWidgets/numberDragger.ts +0 -20
  50. package/src/client/CodeEditor/InteractiveWidgets/rotateWidget.ts +0 -143
  51. package/src/client/CodeEditor/InteractiveWidgets/urlClicker.test.ts +0 -48
  52. package/src/client/CodeEditor/InteractiveWidgets/urlClicker.ts +0 -12
  53. package/src/client/CodeEditor/InteractiveWidgets/vec2Slider.ts +0 -25
  54. package/src/client/CodeEditor/basicSetup.ts +0 -73
  55. package/src/client/CodeEditor/getOrCreateEditor.tsx +0 -615
  56. package/src/client/CodeEditor/index.tsx +0 -202
  57. package/src/client/CodeEditor/json1PresenceBroadcast.ts +0 -41
  58. package/src/client/CodeEditor/json1PresenceDisplay.ts +0 -350
  59. package/src/client/CodeEditor/rainbowBrackets.ts +0 -122
  60. package/src/client/CodeEditor/style.scss +0 -156
  61. package/src/client/CodeEditor/typescriptExtension/worker.ts +0 -32
  62. package/src/client/CodeErrorOverlay/index.tsx +0 -77
  63. package/src/client/CodeErrorOverlay/style.scss +0 -33
  64. package/src/client/Fonts/fonts.ts +0 -8
  65. package/src/client/Icons/AdjustmentSVG.tsx +0 -19
  66. package/src/client/Icons/BugSVG.tsx +0 -20
  67. package/src/client/Icons/CloseSVG.tsx +0 -19
  68. package/src/client/Icons/CssSVG.tsx +0 -16
  69. package/src/client/Icons/DirectoryArrowSVG.tsx +0 -19
  70. package/src/client/Icons/EditSVG.tsx +0 -19
  71. package/src/client/Icons/FileSVG.tsx +0 -19
  72. package/src/client/Icons/FolderSVG.tsx +0 -20
  73. package/src/client/Icons/GearSVG.tsx +0 -16
  74. package/src/client/Icons/HtmlSVG.tsx +0 -16
  75. package/src/client/Icons/JavaScriptSVG.tsx +0 -16
  76. package/src/client/Icons/JsonSVG.tsx +0 -16
  77. package/src/client/Icons/MarkdownSVG.tsx +0 -16
  78. package/src/client/Icons/MicSVG.tsx +0 -25
  79. package/src/client/Icons/NewSVG.tsx +0 -19
  80. package/src/client/Icons/PinSVG.tsx +0 -14
  81. package/src/client/Icons/PlaySVG.tsx +0 -16
  82. package/src/client/Icons/QuestionMarkSVG.tsx +0 -18
  83. package/src/client/Icons/ReactSVG.tsx +0 -16
  84. package/src/client/Icons/SearchSVG.tsx +0 -20
  85. package/src/client/Icons/SparklesSVG.tsx +0 -23
  86. package/src/client/Icons/SplitEditorSVG.tsx +0 -34
  87. package/src/client/Icons/StopSVG.tsx +0 -15
  88. package/src/client/Icons/SvelteSVG.tsx +0 -16
  89. package/src/client/Icons/TrashSVG.tsx +0 -19
  90. package/src/client/Icons/TypeScriptSVG.tsx +0 -16
  91. package/src/client/Icons/index.tsx +0 -24
  92. package/src/client/ImageViewer/index.tsx +0 -91
  93. package/src/client/ImageViewer/style.scss +0 -41
  94. package/src/client/PresenceNotifications/PresenceNotifications.test.ts +0 -134
  95. package/src/client/PresenceNotifications/index.tsx +0 -158
  96. package/src/client/PresenceNotifications/style.scss +0 -17
  97. package/src/client/RunCodeWidget/index.tsx +0 -117
  98. package/src/client/RunCodeWidget/style.scss +0 -24
  99. package/src/client/SplitPaneResizeContext.tsx +0 -159
  100. package/src/client/TabList/Tab.tsx +0 -73
  101. package/src/client/TabList/index.tsx +0 -35
  102. package/src/client/TabList/style.scss +0 -51
  103. package/src/client/VZCodeContext/index.tsx +0 -29
  104. package/src/client/VZCodeContext/types.ts +0 -249
  105. package/src/client/VZCodeContext/useVZCodeState.ts +0 -584
  106. package/src/client/VZKeyboardShortcutsDoc.tsx +0 -148
  107. package/src/client/VZLeft.tsx +0 -28
  108. package/src/client/VZMiddle.tsx +0 -172
  109. package/src/client/VZResizer/index.tsx +0 -128
  110. package/src/client/VZResizer/styles.scss +0 -33
  111. package/src/client/VZRight.tsx +0 -113
  112. package/src/client/VZSettings.tsx +0 -275
  113. package/src/client/VZSidebar/AIChat/ChatInput.tsx +0 -196
  114. package/src/client/VZSidebar/AIChat/DiffView.scss +0 -136
  115. package/src/client/VZSidebar/AIChat/DiffView.tsx +0 -176
  116. package/src/client/VZSidebar/AIChat/Message.tsx +0 -143
  117. package/src/client/VZSidebar/AIChat/MessageList.tsx +0 -205
  118. package/src/client/VZSidebar/AIChat/StreamingMessage.tsx +0 -35
  119. package/src/client/VZSidebar/AIChat/ThinkingScratchpad.tsx +0 -156
  120. package/src/client/VZSidebar/AIChat/TypingIndicator.tsx +0 -19
  121. package/src/client/VZSidebar/AIChat/index.tsx +0 -273
  122. package/src/client/VZSidebar/AIChat/styles.scss +0 -627
  123. package/src/client/VZSidebar/CreateDirModal.tsx +0 -111
  124. package/src/client/VZSidebar/CreateFileModal.tsx +0 -111
  125. package/src/client/VZSidebar/DeleteConfirmationModal.tsx +0 -76
  126. package/src/client/VZSidebar/DirectoryListing.tsx +0 -89
  127. package/src/client/VZSidebar/EmptyState.tsx +0 -11
  128. package/src/client/VZSidebar/FileListing.tsx +0 -91
  129. package/src/client/VZSidebar/FileTypeIcon.tsx +0 -49
  130. package/src/client/VZSidebar/Item.tsx +0 -237
  131. package/src/client/VZSidebar/Listing.tsx +0 -47
  132. package/src/client/VZSidebar/Search.tsx +0 -527
  133. package/src/client/VZSidebar/VisualEditor.tsx +0 -295
  134. package/src/client/VZSidebar/VoiceChatModal.tsx +0 -121
  135. package/src/client/VZSidebar/aiCopyPaste.ts +0 -199
  136. package/src/client/VZSidebar/index.tsx +0 -728
  137. package/src/client/VZSidebar/styles.scss +0 -612
  138. package/src/client/VZSidebar/useDragAndDrop.tsx +0 -408
  139. package/src/client/bootstrap.ts +0 -26
  140. package/src/client/buildWorker.ts +0 -3
  141. package/src/client/featureFlags.ts +0 -8
  142. package/src/client/generateRequestId.ts +0 -6
  143. package/src/client/getFileTree.ts +0 -53
  144. package/src/client/index.ts +0 -19
  145. package/src/client/main.jsx +0 -10
  146. package/src/client/presenceColor.ts +0 -8
  147. package/src/client/shouldTriggerRun.ts +0 -31
  148. package/src/client/sortFileTree.ts +0 -21
  149. package/src/client/tabsSearchParameters.test.ts +0 -79
  150. package/src/client/tabsSearchParameters.ts +0 -137
  151. package/src/client/themes/index.ts +0 -7
  152. package/src/client/themes/themes.ts +0 -77
  153. package/src/client/themes/uiwImports.ts +0 -32
  154. package/src/client/themes/useDynamicTheme.ts +0 -29
  155. package/src/client/themes/vizhubTheme/colors.ts +0 -80
  156. package/src/client/themes/vizhubTheme/index.ts +0 -193
  157. package/src/client/useActions.ts +0 -288
  158. package/src/client/useESLint/index.ts +0 -72
  159. package/src/client/useESLint/worker.ts +0 -113
  160. package/src/client/useEditorCache.ts +0 -35
  161. package/src/client/useFileCRUD.ts +0 -228
  162. package/src/client/useKeyboardShortcuts.ts +0 -451
  163. package/src/client/useOpenDirectories.ts +0 -99
  164. package/src/client/usePresenceAutoFollow.ts +0 -85
  165. package/src/client/usePrettier/index.ts +0 -178
  166. package/src/client/usePrettier/worker.ts +0 -109
  167. package/src/client/useRunCode.tsx +0 -15
  168. package/src/client/useRuntimeError.ts +0 -32
  169. package/src/client/useSubmitOperation.ts +0 -15
  170. package/src/client/useURLSync.ts +0 -137
  171. package/src/client/usernameLocalStorage.ts +0 -43
  172. package/src/client/utils/fileExtension.ts +0 -10
  173. package/src/client/utils/isImageFile.ts +0 -12
  174. package/src/client/vzReducer/aiChatReducer.ts +0 -44
  175. package/src/client/vzReducer/closeTabReducer.test.ts +0 -205
  176. package/src/client/vzReducer/closeTabsReducer.ts +0 -96
  177. package/src/client/vzReducer/createInitialState.ts +0 -38
  178. package/src/client/vzReducer/editorNoLongerWantsFocusReducer.ts +0 -9
  179. package/src/client/vzReducer/findPane.ts +0 -19
  180. package/src/client/vzReducer/index.ts +0 -250
  181. package/src/client/vzReducer/openTabReducer.test.ts +0 -127
  182. package/src/client/vzReducer/openTabReducer.ts +0 -74
  183. package/src/client/vzReducer/searchReducer.test.ts +0 -292
  184. package/src/client/vzReducer/searchReducer.ts +0 -181
  185. package/src/client/vzReducer/setActiveFileIdReducer.ts +0 -28
  186. package/src/client/vzReducer/setActiveFileLeftRightReducer.ts +0 -76
  187. package/src/client/vzReducer/setIsDocOpenReducer.ts +0 -9
  188. package/src/client/vzReducer/setIsSettingsOpenReducer.ts +0 -9
  189. package/src/client/vzReducer/setThemeReducer.ts +0 -9
  190. package/src/client/vzReducer/setUsernameReducer.ts +0 -9
  191. package/src/client/vzReducer/splitCurrentPaneReducer.ts +0 -66
  192. package/src/client/vzReducer/toggleAutoFollowReducer.ts +0 -12
  193. package/src/client/vzReducer/updatePane.ts +0 -40
  194. package/src/client/vzReducer/updatePresenceIndicatorReducer.ts +0 -30
  195. package/src/client/vzReducer/visualEditorReducer.ts +0 -9
  196. package/src/reactRouterExports.ts +0 -15
  197. package/src/runCode.ts +0 -27
  198. package/src/server/aiChatHandler/aiEditing.ts +0 -152
  199. package/src/server/aiChatHandler/chatOperations.ts +0 -510
  200. package/src/server/aiChatHandler/errorHandling.ts +0 -66
  201. package/src/server/aiChatHandler/index.ts +0 -200
  202. package/src/server/aiChatHandler/llmStreaming.ts +0 -419
  203. package/src/server/aiChatHandler/undoHandler.ts +0 -97
  204. package/src/server/aiChatHandler/validation.ts +0 -24
  205. package/src/server/computeInitialDocument.ts +0 -220
  206. package/src/server/generateAIResponse.ts +0 -188
  207. package/src/server/handleAIAssist.ts +0 -53
  208. package/src/server/handleAIChatUndo.ts +0 -2
  209. package/src/server/handleAICopilot.ts +0 -97
  210. package/src/server/index.ts +0 -388
  211. package/src/server/livekit.ts +0 -24
  212. package/src/server/prettier.ts +0 -115
  213. package/src/submitOperation.ts +0 -25
  214. package/src/types.ts +0 -205
  215. package/src/utils/fileDiff.ts +0 -117
  216. package/src/vite-env.d.ts +0 -10
  217. /package/{src/server/handleAIChatMessage.ts → dist/server/handleAIChatMessage.js} +0 -0
  218. /package/{src/server/isDirectory.ts → dist/server/isDirectory.js} +0 -0
package/src/types.ts DELETED
@@ -1,205 +0,0 @@
1
- import { VizContent, VizFileId } from '@vizhub/viz-types';
2
-
3
- // ItemId
4
- // * A unique ID for an item in the sidebar.
5
- // * This could be either a file ID or a directory path.
6
- export type ItemId = VizFileId | FileTreePath;
7
-
8
- // FileTreePath
9
- // * The path to the directory, e.g. "src/components", OR
10
- // * The path to the file e.g. "src/components/HelloWorld.js".
11
- export type FileTreePath = string;
12
-
13
- // FileTree
14
- // * A tree of files.
15
- // * Each node in the tree is either a directory or a file.
16
- // * Each directory has a `children` array.
17
- // * Each file has a `file` object.
18
- // * Each file has a `fileId` string.
19
- // * Each directory has a `name` string.
20
- // * Each directory has a `path` string.
21
- export interface FileTree {
22
- name: string;
23
- path?: FileTreePath;
24
- children?: Array<FileTree | FileTreeFile>;
25
- }
26
-
27
- // FileTreeFile
28
- // * A file in a file tree.
29
- // * Each file has a `name` string.
30
- // * Each file has a `file` object.
31
- // * Each file has a `fileId` string.
32
- export interface FileTreeFile {
33
- name: string;
34
- file: File;
35
- fileId: VizFileId;
36
- }
37
- export type SearchMatch = Array<{
38
- line: number;
39
- index: number;
40
- text: string;
41
- }>;
42
- export type SearchFileVisibility =
43
- | 'open'
44
- | 'flattened'
45
- | 'closed';
46
- export type SearchResult = { [id: string]: SearchFile };
47
-
48
- export interface SearchFile {
49
- name: string;
50
- matches: SearchMatch;
51
- visibility: SearchFileVisibility;
52
- }
53
- export interface SearchResults {
54
- pattern: string;
55
- results: SearchResult;
56
- focusedIndex: number | null;
57
- focusedChildIndex: number | null;
58
- focused: boolean;
59
- }
60
-
61
- // Representation of an open tab.
62
- export type TabState = {
63
- // `fileId`
64
- // The ID of the file that the tab represents.
65
- fileId: VizFileId;
66
-
67
- // `isTransient`
68
- // Represents whether the tab is temporary or persistent.
69
- // * `true` if the tab is temporary, meaning its text
70
- // appears as italic, and it will be automatically
71
- // closed when the user switches to another file.
72
- // If `true` and the tab is opened, the editor will not focus.
73
- // * `false` or `undefined` if the tab is persistent, meaning its text
74
- // appears as normal, and it will not be automatically
75
- // closed when the user switches to another file.
76
- // If `false` and the tab is opened, the editor will focus.
77
- isTransient?: boolean;
78
- };
79
-
80
- // PaneId
81
- // * A unique ID for a pane.
82
- // * This is a random string.
83
- export type PaneId = string;
84
-
85
- // The leaf node of the tree data structure
86
- export type LeafPane = {
87
- type: 'leafPane';
88
- // The list of tabs
89
- // Mutually exclusive with `children`.
90
- tabList: Array<TabState>;
91
-
92
- // The ID of the file that is currently active
93
- // within this leaf pane.
94
- // Invariant: `activeFileId` is always in `tabList`.
95
- activeFileId: VizFileId | null;
96
- };
97
-
98
- // Internal node of the tree data structure
99
- export type SplitPane = {
100
- type: 'splitPane';
101
-
102
- // Which orientation is it? Vertical split or horizontal split?
103
- // Applies only to `children`
104
- orientation: 'vertical' | 'horizontal';
105
-
106
- // The children panels
107
- // Mutually exclusive with `tabList`.
108
- children: Array<Pane>;
109
- };
110
-
111
- // The node data structure of the split pane tree
112
- export type Pane = {
113
- // Every pane gets a unique ID,
114
- // so we can refer to it in actions.
115
- id: PaneId;
116
-
117
- // The type of the pane
118
- // Either a leaf pane or a split pane.
119
- type: 'leafPane' | 'splitPane';
120
- } & (LeafPane | SplitPane);
121
-
122
- export type JSONOp = any;
123
-
124
- // `ShareDBDoc`
125
- // A ShareDB Document.
126
- // TODO better types? Integrate with upstream how?
127
- // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/sharedb/lib/sharedb.d.ts#L110
128
- export type ShareDBDoc<T> = {
129
- data: T;
130
- ingestSnapshot: (snapshot: any, callback) => void;
131
- subscribe: (callback) => void;
132
- on: (
133
- event: string,
134
- callback: (op: JSONOp, source: boolean) => void,
135
- ) => void;
136
- off: (
137
- event: string,
138
- callback: (op: JSONOp, source: boolean) => void,
139
- ) => void;
140
- removeListener: (
141
- event: string,
142
- callback: (op: JSONOp, source: boolean) => void,
143
- ) => void;
144
- submitOp: (
145
- op: JSONOp,
146
- options?: any,
147
- callback?: () => void,
148
- ) => void;
149
- whenNothingPending: (callback: () => void) => void;
150
- };
151
-
152
- // Example Presence object, from ShareDB:
153
- // {
154
- // "start": [
155
- // "files",
156
- // "71898298",
157
- // "text",
158
- // 415
159
- // ],
160
- // "end": [
161
- // "files",
162
- // "71898298",
163
- // "text",
164
- // 415
165
- // ],
166
- // "username": "Tim"
167
- // }
168
- export type Presence = {
169
- start: Array<string | number>;
170
- end: Array<string | number>;
171
- username: Username;
172
- };
173
-
174
- // An item in the list of sidebar presence indicators.
175
- // It needs to know:
176
- // * What user the presence is associated with
177
- // * What file the presence is associated with
178
- export type PresenceIndicator = {
179
- username: Username;
180
- fileId: VizFileId;
181
- };
182
-
183
- // An id used for presence.
184
- export type PresenceId = string;
185
-
186
- // A user name for display in presence.
187
- export type Username = string;
188
-
189
- // The type of a convenience function called `submitOperation`,
190
- // to submit an operation to ShareDB.
191
- export type SubmitOperation = (
192
- next: (content: VizContent) => VizContent,
193
- ) => void;
194
-
195
- // A value that has the capacity to be changed in the visual editor
196
- export type VisualEditorConfigEntry =
197
- | {
198
- type: 'number';
199
- property: string;
200
- label: string;
201
- min: number;
202
- max: number;
203
- value: number;
204
- }
205
- | { type: 'boolean' };
@@ -1,117 +0,0 @@
1
- import { createTwoFilesPatch } from 'diff';
2
- import { VizFiles, VizFileId } from '@vizhub/viz-types';
3
-
4
- export interface UnifiedFilesDiff {
5
- [fileId: VizFileId]: string; // Unified diff string
6
- }
7
-
8
- /**
9
- * Generate a unified diff for a single file using the diff library
10
- */
11
- export function generateFileUnifiedDiff(
12
- fileId: VizFileId,
13
- fileName: string,
14
- beforeContent: string,
15
- afterContent: string,
16
- ): string {
17
- // Only generate diff if there are actual changes
18
- if (beforeContent === afterContent) {
19
- return '';
20
- }
21
-
22
- // Use the diff library's createTwoFilesPatch function to generate unified diff
23
- const unifiedDiff = createTwoFilesPatch(
24
- fileName,
25
- fileName,
26
- beforeContent,
27
- afterContent,
28
- '',
29
- '',
30
- { context: 3 },
31
- );
32
-
33
- return unifiedDiff;
34
- }
35
-
36
- /**
37
- * Generate unified diffs for multiple files
38
- */
39
- export function generateFilesUnifiedDiff(
40
- beforeFiles: VizFiles,
41
- afterFiles: VizFiles,
42
- ): UnifiedFilesDiff {
43
- const result: UnifiedFilesDiff = {};
44
- const allFileIds = new Set([
45
- ...Object.keys(beforeFiles),
46
- ...Object.keys(afterFiles),
47
- ]);
48
-
49
- for (const fileId of allFileIds) {
50
- const beforeFile = beforeFiles[fileId];
51
- const afterFile = afterFiles[fileId];
52
-
53
- const beforeContent = beforeFile?.text || '';
54
- const afterContent = afterFile?.text || '';
55
- const fileName =
56
- afterFile?.name || beforeFile?.name || fileId;
57
-
58
- const unifiedDiff = generateFileUnifiedDiff(
59
- fileId,
60
- fileName,
61
- beforeContent,
62
- afterContent,
63
- );
64
-
65
- // Only include files that have changes
66
- if (unifiedDiff) {
67
- result[fileId] = unifiedDiff;
68
- }
69
- }
70
-
71
- return result;
72
- }
73
-
74
- /**
75
- * Create a snapshot of current files for diff comparison
76
- */
77
- export function createFilesSnapshot(
78
- files: VizFiles,
79
- ): VizFiles {
80
- return JSON.parse(JSON.stringify(files));
81
- }
82
-
83
- /**
84
- * Parse unified diff to extract basic statistics
85
- */
86
- export function parseUnifiedDiffStats(
87
- unifiedDiff: string,
88
- ): {
89
- additions: number;
90
- deletions: number;
91
- } {
92
- const lines = unifiedDiff.split('\n');
93
- let additions = 0;
94
- let deletions = 0;
95
-
96
- for (const line of lines) {
97
- if (line.startsWith('+') && !line.startsWith('+++')) {
98
- additions++;
99
- } else if (
100
- line.startsWith('-') &&
101
- !line.startsWith('---')
102
- ) {
103
- deletions++;
104
- }
105
- }
106
-
107
- return { additions, deletions };
108
- }
109
-
110
- /**
111
- * Combine multiple unified diffs into a single diff string
112
- */
113
- export function combineUnifiedDiffs(
114
- unifiedDiffs: UnifiedFilesDiff,
115
- ): string {
116
- return Object.values(unifiedDiffs).join('\n');
117
- }
package/src/vite-env.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMetaEnv {
4
- readonly VITE_ENABLE_LIVEKIT: string;
5
- // Add other environment variables here as needed
6
- }
7
-
8
- interface ImportMeta {
9
- readonly env: ImportMetaEnv;
10
- }