vzcode 2.34.0 → 2.36.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 (52) hide show
  1. package/dist/assets/buildWorker-BZlya278.js +687 -0
  2. package/dist/assets/index-Cj-ERpBu.css +1 -0
  3. package/dist/assets/index-DD7vzp4U.js +364 -0
  4. package/dist/assets/{worker-D8p1JlHW.js → worker-1oQYaz-F.js} +251 -251
  5. package/dist/assets/worker-BfgPD8zR.js +125 -0
  6. package/dist/assets/{worker-k7HZ3t-V.js → worker-CoJaqtpi.js} +12 -12
  7. package/dist/index.html +2 -2
  8. package/dist/ot.js +180 -2
  9. package/dist/server/createServer.js +281 -0
  10. package/dist/server/index.js +6 -269
  11. package/package.json +14 -3
  12. package/src/client/CodeEditor/getOrCreateEditor.tsx +0 -14
  13. package/src/client/VZCodeContext/chatSessionHelpers.ts +17 -0
  14. package/src/client/VZCodeContext/useAIChatSession.ts +325 -0
  15. package/src/client/VZCodeContext/useVZCodeState.ts +23 -279
  16. package/src/client/VZSidebar/AIChatWrapper.tsx +85 -0
  17. package/src/client/VZSidebar/VisualEditor/VisualEditor.tsx +95 -208
  18. package/src/client/VZSidebar/VisualEditor/colorUtils.ts +39 -0
  19. package/src/client/VZSidebar/VisualEditor/status.ts +2 -40
  20. package/src/client/VZSidebar/VisualEditor/updateConfig.ts +10 -1
  21. package/src/client/VZSidebar/VisualEditor/utils.ts +49 -65
  22. package/src/client/VZSidebar/index.tsx +2 -2
  23. package/src/client/definitionJumpListeners.ts +47 -0
  24. package/src/client/useKeyboardShortcuts.ts +23 -28
  25. package/src/client/useOpenDirectories.ts +0 -1
  26. package/src/llm-streaming-server/README.md +5 -3
  27. package/src/llm-streaming-ui/README.md +44 -42
  28. package/src/llm-streaming-ui/components/ChatInput.tsx +6 -19
  29. package/src/llm-streaming-ui/components/DiffView.tsx +6 -24
  30. package/src/llm-streaming-ui/components/FileEditingIndicator.tsx +1 -1
  31. package/src/llm-streaming-ui/components/Message.tsx +11 -27
  32. package/src/llm-streaming-ui/components/MessageList.tsx +15 -29
  33. package/src/llm-streaming-ui/components/Spinner.scss +37 -0
  34. package/src/llm-streaming-ui/components/Spinner.tsx +59 -0
  35. package/src/llm-streaming-ui/components/bootstrap.ts +16 -0
  36. package/src/llm-streaming-ui/components/icons.tsx +68 -0
  37. package/src/llm-streaming-ui/components/index.tsx +34 -30
  38. package/src/llm-streaming-ui/index.ts +13 -0
  39. package/src/llm-streaming-ui/props.ts +137 -0
  40. package/src/ot.ts +221 -4
  41. package/src/server/createServer.ts +413 -0
  42. package/src/server/index.ts +8 -333
  43. package/dist/assets/buildWorker-DylWm2VX.js +0 -687
  44. package/dist/assets/index-Dyt9tpmu.css +0 -1
  45. package/dist/assets/index-nL6to42p.js +0 -364
  46. package/dist/assets/worker-b9bkZkXK.js +0 -116
  47. package/src/client/AIAssist/AIAssistCodeMirrorKeyMap.ts +0 -42
  48. package/src/client/AIAssist/generateFilesContext.ts +0 -25
  49. package/src/client/AIAssist/index.ts +0 -2
  50. package/src/client/CodeEditor/InteractiveWidgets/highlightWidgets.ts +0 -79
  51. /package/src/{client → llm-streaming-ui}/hooks/useAutoScroll.ts +0 -0
  52. /package/src/{client → llm-streaming-ui}/utils/scrollUtils.ts +0 -0
@@ -1,42 +0,0 @@
1
- import { EditorView, keymap } from '@codemirror/view';
2
- import { ShareDBDoc, TabState } from '../../types';
3
- import { VizContent } from '@vizhub/viz-types';
4
-
5
- export const AIAssistCodeMirrorKeyMap = ({
6
- shareDBDoc: _shareDBDoc,
7
- fileId: _fileId,
8
- tabList: _tabList,
9
- }: {
10
- shareDBDoc: ShareDBDoc<VizContent>;
11
- fileId: string;
12
- tabList: Array<TabState>;
13
- }) =>
14
- keymap.of([
15
- {
16
- key: 'control-m',
17
- run: (_view: EditorView) => {
18
- // if (
19
- // shareDBDoc.data.aiStreams === undefined ||
20
- // shareDBDoc.data.aiStreams[mostRecentStreamId] ===
21
- // null ||
22
- // shareDBDoc.data.aiStreams[mostRecentStreamId]
23
- // ?.AIStreamStatus.serverIsRunning !== true
24
- // ) {
25
-
26
- // TODO handle starting it
27
- // startAIAssist({
28
- // view,
29
- // shareDBDoc,
30
- // fileId,
31
- // tabList,
32
- // });
33
-
34
- // TODO handle stopping it
35
- // } else {
36
- // haltAIAssist(shareDBDoc);
37
- // }
38
-
39
- return true;
40
- },
41
- },
42
- ]);
@@ -1,25 +0,0 @@
1
- // import { File } from '../../types';
2
-
3
- // const maxFileNameLength = 100;
4
- // const maxFileTextLength = 2000;
5
-
6
- // export const generateFilesContext = (
7
- // goodFiles: Array<File>,
8
- // ): string => {
9
- // const input = goodFiles
10
- // .map((file) => {
11
- // const nameSubstring = file.name
12
- // ?.substring(0, maxFileNameLength)
13
- // .trim();
14
-
15
- // const textSubstring = file.text
16
- // ?.substring(0, maxFileTextLength)
17
- // .trim();
18
-
19
- // // Generate Markdown that AI will understand.
20
- // return `File \`${nameSubstring}\`:\n\`\`\`${textSubstring}\`\`\``;
21
- // })
22
- // .join('\n\n');
23
-
24
- // return input;
25
- // };
@@ -1,2 +0,0 @@
1
- export { AIAssistWidget } from './AIAssistWidget';
2
- export { AIAssistCodeMirrorKeyMap } from './AIAssistCodeMirrorKeyMap';
@@ -1,79 +0,0 @@
1
- // TODO - This file is not being used.
2
- // It was an attempt to highlight the interactive widgets in the editor.
3
- // It is a good idea to keep this file for future reference, as it's
4
- // pretty close to what we need to implement. It suffers from the following
5
- // issues:
6
- // - Hardcoded regexes for interactive widgets - we can pull from the various modules
7
- // - The highlight is not working properly - it's not un-highlighting
8
- // when the Alt key is released. This is likely due to the fact that the
9
- // plugin is not being updated when the key is released.
10
-
11
- // export const highlightWidgets = ViewPlugin.fromClass(
12
- // class {
13
- // showHighlight: boolean;
14
- // view: EditorView;
15
- // constructor(view: EditorView) {
16
- // this.showHighlight = false;
17
- // this.view = view;
18
- // }
19
- // },
20
- // {
21
- // decorations: (v) => {
22
- // if (!v.showHighlight) {
23
- // return Decoration.none;
24
- // }
25
-
26
- // const interactOpportunities = [];
27
- // const lines = v.view.state.doc.iter();
28
- // let line = lines.next();
29
-
30
- // //Offset is the number of characters before the regex so the highlighting can be placed properly.
31
- // let offset = 0;
32
- // while (!line.done) {
33
- // if (line.value === '\n') {
34
- // offset++;
35
- // line = lines.next();
36
- // continue;
37
- // }
38
- // const interactiveOccurances = line.value.matchAll(
39
- // //The below line contains all of the Regexes for all of the interactive widgets.
40
- // /\"\#([0-9]|[A-F]|[a-f]){6}\"|rotate\(-?\d*\.?\d*\)|https?:\/\/[^ "]+|vec2\(-?\b\d+\.?\d*\b\s*(,\s*-?\b\d+\.?\d*\b)?\)|true|false|(?<!\#)-?\b\d+\.?\d*\b|rgb\(.*\)/dg,
41
- // );
42
- // let interactOccurance =
43
- // interactiveOccurances.next();
44
- // while (!interactOccurance.done) {
45
- // const offsetInteract = interactOccurance.value;
46
- // offsetInteract.indices[0][0] += offset;
47
- // offsetInteract.indices[0][1] += offset;
48
- // interactOpportunities.push(offsetInteract);
49
- // interactOccurance = interactiveOccurances.next();
50
- // }
51
- // offset += line.value.length;
52
- // line = lines.next();
53
- // }
54
- // return Decoration.set(
55
- // interactOpportunities.map((opportunity) => {
56
- // return {
57
- // from: opportunity.indices[0][0],
58
- // to: opportunity.indices[0][1],
59
- // value: Decoration.mark({
60
- // class: 'cm-interact ',
61
- // }),
62
- // };
63
- // }),
64
- // );
65
- // },
66
- // eventHandlers: {
67
- // keydown(event, view) {
68
- // if (event.key == 'Alt') {
69
- // this.showHighlight = true;
70
- // }
71
- // },
72
- // keyup(event, view) {
73
- // if (event.key == 'Alt') {
74
- // this.showHighlight = false;
75
- // }
76
- // },
77
- // },
78
- // },
79
- // );