@pixelbyte-software/pixcode 1.50.8 → 1.50.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelbyte-software/pixcode",
3
- "version": "1.50.8",
3
+ "version": "1.50.9",
4
4
  "description": "Self-hosted AI coding agent control room for Claude Code, Cursor CLI, OpenAI Codex, Gemini CLI, Qwen Code, and OpenCode with chat, files, shell, Git, orchestration, API keys, Telegram, MCP, plugins, themes, and desktop/server deployment.",
5
5
  "type": "module",
6
6
  "main": "dist-server/server/index.js",
@@ -124,6 +124,7 @@
124
124
  "gray-matter": "^4.0.3",
125
125
  "jsonwebtoken": "^9.0.2",
126
126
  "mime-types": "^3.0.1",
127
+ "monaco-editor": "^0.55.1",
127
128
  "multer": "^2.0.1",
128
129
  "node-fetch": "^2.7.0",
129
130
  "node-pty": "^1.2.0-beta.12",
@@ -186,7 +187,6 @@
186
187
  "katex": "^0.16.25",
187
188
  "lint-staged": "^16.3.2",
188
189
  "lucide-react": "^0.515.0",
189
- "monaco-editor": "^0.55.1",
190
190
  "node-gyp": "^12.0.0",
191
191
  "postcss": "^8.4.32",
192
192
  "qrcode": "^1.5.4",
@@ -6,6 +6,7 @@ const read = (path) => fs.readFileSync(path, 'utf8');
6
6
  const packageJson = JSON.parse(read('package.json'));
7
7
  const surface = read('src/components/code-editor/view/subcomponents/CodeEditorSurface.tsx');
8
8
  const editor = read('src/components/code-editor/view/CodeEditor.tsx');
9
+ const localMonaco = read('src/components/code-editor/utils/localMonaco.ts');
9
10
 
10
11
  const allDeps = {
11
12
  ...(packageJson.dependencies ?? {}),
@@ -21,6 +22,36 @@ assert.match(
21
22
  'Normal file editing should lazy-load Monaco instead of keeping a CodeMirror-only surface.',
22
23
  );
23
24
 
25
+ assert.match(
26
+ surface,
27
+ /ensureLocalMonaco\(\)/,
28
+ 'Monaco should be configured before mount so Linux/self-hosted installs do not depend on the CDN loader.',
29
+ );
30
+
31
+ assert.match(
32
+ localMonaco,
33
+ /LOCAL_MONACO_BASE_PATH\s*=\s*['"]\/vendor\/monaco-editor\/min\/vs['"]/,
34
+ "Code editor should load Monaco from Pixcode's same-origin vendor route.",
35
+ );
36
+
37
+ assert.match(
38
+ localMonaco,
39
+ /loader\.config\(\{\s*paths:\s*\{\s*vs:\s*LOCAL_MONACO_BASE_PATH/s,
40
+ 'Code editor should point @monaco-editor/react at the local Monaco loader path.',
41
+ );
42
+
43
+ assert.doesNotMatch(
44
+ localMonaco,
45
+ /https:\/\/cdn\.jsdelivr\.net|unpkg\.com|from ['"]monaco-editor/,
46
+ 'Local Monaco setup should not use a remote CDN or import the full monaco-editor barrel.',
47
+ );
48
+
49
+ assert.match(
50
+ read('server/index.js'),
51
+ /\/vendor\/monaco-editor\/min\/vs[\s\S]*express\.static/,
52
+ 'Server should serve Monaco loader and workers from the same-origin vendor route.',
53
+ );
54
+
24
55
  assert.match(
25
56
  surface,
26
57
  /onMount=\{handleMonacoMount\}/,
package/server/index.js CHANGED
@@ -7,6 +7,7 @@ import path from 'path';
7
7
  import os from 'os';
8
8
  import http from 'http';
9
9
  import net from 'node:net';
10
+ import { createRequire } from 'node:module';
10
11
  import { spawn } from 'child_process';
11
12
 
12
13
  import express from 'express';
@@ -23,6 +24,8 @@ const __dirname = getModuleDir(import.meta.url);
23
24
  // The server source runs from /server, while the compiled output runs from /dist-server/server.
24
25
  // Resolving the app root once keeps every repo-level lookup below aligned across both layouts.
25
26
  const APP_ROOT = findAppRoot(__dirname);
27
+ const require = createRequire(import.meta.url);
28
+ const MONACO_ASSETS_ROUTE = '/vendor/monaco-editor/min/vs';
26
29
  const installMode = fs.existsSync(path.join(APP_ROOT, '.git')) ? 'git' : 'npm';
27
30
  const SERVER_VERSION = (() => {
28
31
  try {
@@ -38,6 +41,23 @@ const DAEMON_COMMAND_CONTEXT = {
38
41
  nodeExecPath: process.execPath,
39
42
  };
40
43
 
44
+ function resolveMonacoAssetsPath() {
45
+ const candidates = [
46
+ path.join(APP_ROOT, 'node_modules', 'monaco-editor', 'min', 'vs'),
47
+ ];
48
+
49
+ try {
50
+ const monacoPackagePath = require.resolve('monaco-editor/package.json', {
51
+ paths: [APP_ROOT, __dirname],
52
+ });
53
+ candidates.push(path.join(path.dirname(monacoPackagePath), 'min', 'vs'));
54
+ } catch {
55
+ // The editor will show its normal load failure if the dependency is unavailable.
56
+ }
57
+
58
+ return candidates.find((candidate) => fs.existsSync(path.join(candidate, 'loader.js'))) || null;
59
+ }
60
+
41
61
  import { c } from './utils/colors.js';
42
62
 
43
63
  console.log('SERVER_PORT from env:', process.env.SERVER_PORT);
@@ -888,6 +908,18 @@ app.use('/api/agent', agentRoutes);
888
908
  // Static app files served after API routes. Keep dist before public so
889
909
  // / and /index.html always resolve to the Pixcode app, not the GitHub Pages
890
910
  // landing page that also lives in public/index.html.
911
+ const monacoAssetsPath = resolveMonacoAssetsPath();
912
+ if (monacoAssetsPath) {
913
+ app.use(MONACO_ASSETS_ROUTE, express.static(monacoAssetsPath, {
914
+ index: false,
915
+ setHeaders: (res) => {
916
+ res.setHeader('Cache-Control', 'public, max-age=31536000, immutable');
917
+ },
918
+ }));
919
+ } else {
920
+ console.warn('[monaco] Local Monaco assets not found; code editor loader may fail.');
921
+ }
922
+
891
923
  app.use(express.static(path.join(APP_ROOT, 'dist'), {
892
924
  setHeaders: (res, filePath) => {
893
925
  if (filePath.endsWith('.html')) {