more-compute 0.1.4__py3-none-any.whl → 0.2.0__py3-none-any.whl
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.
- frontend/app/globals.css +322 -77
- frontend/app/layout.tsx +98 -82
- frontend/components/Cell.tsx +234 -95
- frontend/components/Notebook.tsx +430 -199
- frontend/components/{AddCellButton.tsx → cell/AddCellButton.tsx} +0 -2
- frontend/components/cell/MonacoCell.tsx +726 -0
- frontend/components/layout/ConnectionBanner.tsx +41 -0
- frontend/components/{Sidebar.tsx → layout/Sidebar.tsx} +16 -11
- frontend/components/modals/ConfirmModal.tsx +154 -0
- frontend/components/modals/SuccessModal.tsx +140 -0
- frontend/components/output/MarkdownRenderer.tsx +116 -0
- frontend/components/popups/ComputePopup.tsx +674 -365
- frontend/components/popups/MetricsPopup.tsx +11 -7
- frontend/components/popups/SettingsPopup.tsx +11 -13
- frontend/contexts/PodWebSocketContext.tsx +247 -0
- frontend/eslint.config.mjs +11 -0
- frontend/lib/monaco-themes.ts +160 -0
- frontend/lib/settings.ts +128 -26
- frontend/lib/themes.json +9973 -0
- frontend/lib/websocket-native.ts +19 -8
- frontend/lib/websocket.ts +59 -11
- frontend/next.config.ts +8 -0
- frontend/package-lock.json +1705 -3
- frontend/package.json +8 -1
- frontend/styling_README.md +18 -0
- kernel_run.py +159 -42
- more_compute-0.2.0.dist-info/METADATA +126 -0
- more_compute-0.2.0.dist-info/RECORD +100 -0
- morecompute/__version__.py +1 -1
- morecompute/execution/executor.py +31 -20
- morecompute/execution/worker.py +68 -7
- morecompute/models/__init__.py +31 -0
- morecompute/models/api_models.py +197 -0
- morecompute/notebook.py +50 -7
- morecompute/server.py +574 -94
- morecompute/services/data_manager.py +379 -0
- morecompute/services/lsp_service.py +335 -0
- morecompute/services/pod_manager.py +122 -20
- morecompute/services/pod_monitor.py +138 -0
- morecompute/services/prime_intellect.py +87 -63
- morecompute/utils/config_util.py +59 -0
- morecompute/utils/special_commands.py +11 -5
- morecompute/utils/zmq_util.py +51 -0
- frontend/components/MarkdownRenderer.tsx +0 -84
- frontend/components/popups/PythonPopup.tsx +0 -292
- more_compute-0.1.4.dist-info/METADATA +0 -173
- more_compute-0.1.4.dist-info/RECORD +0 -86
- /frontend/components/{CellButton.tsx → cell/CellButton.tsx} +0 -0
- /frontend/components/{ErrorModal.tsx → modals/ErrorModal.tsx} +0 -0
- /frontend/components/{CellOutput.tsx → output/CellOutput.tsx} +0 -0
- /frontend/components/{ErrorDisplay.tsx → output/ErrorDisplay.tsx} +0 -0
- {more_compute-0.1.4.dist-info → more_compute-0.2.0.dist-info}/WHEEL +0 -0
- {more_compute-0.1.4.dist-info → more_compute-0.2.0.dist-info}/entry_points.txt +0 -0
- {more_compute-0.1.4.dist-info → more_compute-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {more_compute-0.1.4.dist-info → more_compute-0.2.0.dist-info}/top_level.txt +0 -0
frontend/lib/settings.ts
CHANGED
|
@@ -1,47 +1,117 @@
|
|
|
1
|
+
import { getAvailableThemes, getThemeColors } from './monaco-themes';
|
|
2
|
+
|
|
1
3
|
export type ThemeDefinition = {
|
|
4
|
+
// Core colors
|
|
2
5
|
background: string;
|
|
3
6
|
cellBackground: string;
|
|
4
7
|
textColor: string;
|
|
5
8
|
markdownColor: string;
|
|
6
9
|
lineNumberColor: string;
|
|
10
|
+
|
|
11
|
+
// Primary/Secondary colors for UI elements
|
|
12
|
+
primary: string;
|
|
13
|
+
primaryHover: string;
|
|
14
|
+
secondary: string;
|
|
15
|
+
secondaryHover: string;
|
|
16
|
+
|
|
17
|
+
// UI element colors
|
|
18
|
+
border: string;
|
|
19
|
+
borderHover: string;
|
|
20
|
+
sidebarBackground: string;
|
|
21
|
+
sidebarForeground: string;
|
|
22
|
+
buttonBackground: string;
|
|
23
|
+
buttonForeground: string;
|
|
24
|
+
inputBackground: string;
|
|
25
|
+
inputBorder: string;
|
|
26
|
+
|
|
27
|
+
// Headings and emphasis
|
|
28
|
+
headingColor: string;
|
|
29
|
+
paragraphColor: string;
|
|
30
|
+
|
|
31
|
+
// Output colors
|
|
32
|
+
outputBackground: string;
|
|
33
|
+
outputTextColor: string;
|
|
34
|
+
outputBorder: string;
|
|
7
35
|
};
|
|
8
36
|
|
|
9
|
-
|
|
37
|
+
// Built-in simple themes
|
|
38
|
+
const BUILTIN_THEMES: Record<string, ThemeDefinition> = {
|
|
10
39
|
light: {
|
|
11
|
-
background: '#
|
|
40
|
+
background: '#f3f3f3',
|
|
12
41
|
cellBackground: '#ffffff',
|
|
13
|
-
textColor: '#
|
|
14
|
-
markdownColor: '#
|
|
15
|
-
lineNumberColor: '#
|
|
42
|
+
textColor: '#000000',
|
|
43
|
+
markdownColor: '#000000',
|
|
44
|
+
lineNumberColor: '#237893',
|
|
45
|
+
primary: '#005fb8',
|
|
46
|
+
primaryHover: '#004a8f',
|
|
47
|
+
secondary: '#e5e5e5',
|
|
48
|
+
secondaryHover: '#d1d1d1',
|
|
49
|
+
border: '#e5e5e5',
|
|
50
|
+
borderHover: '#d1d1d1',
|
|
51
|
+
sidebarBackground: '#f3f3f3',
|
|
52
|
+
sidebarForeground: '#424242',
|
|
53
|
+
buttonBackground: '#005fb8',
|
|
54
|
+
buttonForeground: '#ffffff',
|
|
55
|
+
inputBackground: '#ffffff',
|
|
56
|
+
inputBorder: '#cecece',
|
|
57
|
+
headingColor: '#000000',
|
|
58
|
+
paragraphColor: '#000000',
|
|
59
|
+
outputBackground: '#f8f8f8',
|
|
60
|
+
outputTextColor: '#000000',
|
|
61
|
+
outputBorder: '#e5e5e5',
|
|
16
62
|
},
|
|
17
63
|
dark: {
|
|
18
|
-
background: '#
|
|
19
|
-
cellBackground: '#
|
|
20
|
-
textColor: '#
|
|
21
|
-
markdownColor: '#
|
|
22
|
-
lineNumberColor: '#
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
64
|
+
background: '#1e1e1e',
|
|
65
|
+
cellBackground: '#252526',
|
|
66
|
+
textColor: '#cccccc',
|
|
67
|
+
markdownColor: '#cccccc',
|
|
68
|
+
lineNumberColor: '#858585',
|
|
69
|
+
primary: '#007acc',
|
|
70
|
+
primaryHover: '#1088cc',
|
|
71
|
+
secondary: '#3e3e42',
|
|
72
|
+
secondaryHover: '#505050',
|
|
73
|
+
border: '#3e3e42',
|
|
74
|
+
borderHover: '#505050',
|
|
75
|
+
sidebarBackground: '#252526',
|
|
76
|
+
sidebarForeground: '#cccccc',
|
|
77
|
+
buttonBackground: '#007acc',
|
|
78
|
+
buttonForeground: '#ffffff',
|
|
79
|
+
inputBackground: '#3c3c3c',
|
|
80
|
+
inputBorder: '#3e3e42',
|
|
81
|
+
headingColor: '#e5e5e5',
|
|
82
|
+
paragraphColor: '#cccccc',
|
|
83
|
+
outputBackground: '#1e1e1e',
|
|
84
|
+
outputTextColor: '#cccccc',
|
|
85
|
+
outputBorder: '#3e3e42',
|
|
30
86
|
},
|
|
31
87
|
};
|
|
32
88
|
|
|
89
|
+
// Dynamically build THEMES object by combining built-in and Monaco themes
|
|
90
|
+
export const THEMES: Record<string, ThemeDefinition> = (() => {
|
|
91
|
+
const themes: Record<string, ThemeDefinition> = { ...BUILTIN_THEMES };
|
|
92
|
+
|
|
93
|
+
// Add Monaco themes
|
|
94
|
+
try {
|
|
95
|
+
const monacoThemes = getAvailableThemes();
|
|
96
|
+
monacoThemes.forEach(({ name }) => {
|
|
97
|
+
const colors = getThemeColors(name);
|
|
98
|
+
if (colors) {
|
|
99
|
+
themes[name] = colors;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
} catch (e) {
|
|
103
|
+
console.warn('Failed to load Monaco themes:', e);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return themes;
|
|
107
|
+
})();
|
|
108
|
+
|
|
33
109
|
export type NotebookSettings = {
|
|
34
110
|
theme: keyof typeof THEMES;
|
|
35
|
-
auto_save: boolean;
|
|
36
|
-
font_size: number;
|
|
37
|
-
font_family: string;
|
|
38
111
|
};
|
|
39
112
|
|
|
40
113
|
export const DEFAULT_SETTINGS: NotebookSettings = {
|
|
41
114
|
theme: 'light',
|
|
42
|
-
auto_save: true,
|
|
43
|
-
font_size: 14,
|
|
44
|
-
font_family: 'SF Mono',
|
|
45
115
|
};
|
|
46
116
|
|
|
47
117
|
const STORAGE_KEY = 'morecompute-settings';
|
|
@@ -53,11 +123,16 @@ export function loadSettings(): NotebookSettings {
|
|
|
53
123
|
if (!raw) return DEFAULT_SETTINGS;
|
|
54
124
|
const parsed = JSON.parse(raw);
|
|
55
125
|
const theme = parsed.theme && THEMES[parsed.theme] ? parsed.theme : DEFAULT_SETTINGS.theme;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
126
|
+
|
|
127
|
+
// Return only valid settings fields (remove old auto_save, font_size, font_family, etc.)
|
|
128
|
+
const cleanSettings: NotebookSettings = {
|
|
59
129
|
theme,
|
|
60
130
|
};
|
|
131
|
+
|
|
132
|
+
// Save cleaned settings back to localStorage
|
|
133
|
+
saveSettings(cleanSettings);
|
|
134
|
+
|
|
135
|
+
return cleanSettings;
|
|
61
136
|
} catch (error) {
|
|
62
137
|
console.warn('Failed to load settings; defaulting', error);
|
|
63
138
|
return DEFAULT_SETTINGS;
|
|
@@ -73,11 +148,38 @@ export function applyTheme(themeName: keyof typeof THEMES) {
|
|
|
73
148
|
if (typeof document === 'undefined') return;
|
|
74
149
|
const root = document.documentElement;
|
|
75
150
|
const theme = THEMES[themeName] ?? THEMES.light;
|
|
151
|
+
|
|
152
|
+
// Core colors
|
|
76
153
|
root.style.setProperty('--mc-background', theme.background);
|
|
77
154
|
root.style.setProperty('--mc-cell-background', theme.cellBackground);
|
|
78
155
|
root.style.setProperty('--mc-text-color', theme.textColor);
|
|
79
156
|
root.style.setProperty('--mc-markdown-color', theme.markdownColor);
|
|
80
157
|
root.style.setProperty('--mc-line-number-color', theme.lineNumberColor);
|
|
158
|
+
|
|
159
|
+
// Primary/Secondary colors
|
|
160
|
+
root.style.setProperty('--mc-primary', theme.primary);
|
|
161
|
+
root.style.setProperty('--mc-primary-hover', theme.primaryHover);
|
|
162
|
+
root.style.setProperty('--mc-secondary', theme.secondary);
|
|
163
|
+
root.style.setProperty('--mc-secondary-hover', theme.secondaryHover);
|
|
164
|
+
|
|
165
|
+
// UI element colors
|
|
166
|
+
root.style.setProperty('--mc-border', theme.border);
|
|
167
|
+
root.style.setProperty('--mc-border-hover', theme.borderHover);
|
|
168
|
+
root.style.setProperty('--mc-sidebar-background', theme.sidebarBackground);
|
|
169
|
+
root.style.setProperty('--mc-sidebar-foreground', theme.sidebarForeground);
|
|
170
|
+
root.style.setProperty('--mc-button-background', theme.buttonBackground);
|
|
171
|
+
root.style.setProperty('--mc-button-foreground', theme.buttonForeground);
|
|
172
|
+
root.style.setProperty('--mc-input-background', theme.inputBackground);
|
|
173
|
+
root.style.setProperty('--mc-input-border', theme.inputBorder);
|
|
174
|
+
|
|
175
|
+
// Headings and emphasis
|
|
176
|
+
root.style.setProperty('--mc-markdown-heading-color', theme.headingColor);
|
|
177
|
+
root.style.setProperty('--mc-markdown-paragraph-color', theme.paragraphColor);
|
|
178
|
+
|
|
179
|
+
// Output colors
|
|
180
|
+
root.style.setProperty('--mc-output-background', theme.outputBackground);
|
|
181
|
+
root.style.setProperty('--mc-output-text-color', theme.outputTextColor);
|
|
182
|
+
root.style.setProperty('--mc-output-border', theme.outputBorder);
|
|
81
183
|
}
|
|
82
184
|
|
|
83
185
|
export function resetSettings() {
|