@myrialabs/clopen 0.3.16 → 0.3.18

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/dist/index.html CHANGED
@@ -58,8 +58,8 @@
58
58
  }
59
59
  })();
60
60
  </script>
61
- <script type="module" crossorigin src="/assets/main-CYVFcz-a.js"></script>
62
- <link rel="stylesheet" crossorigin href="/assets/main-DrFILAEB.css">
61
+ <script type="module" crossorigin src="/assets/main-CaqEjA6B.js"></script>
62
+ <link rel="stylesheet" crossorigin href="/assets/main-6cCq8H0w.css">
63
63
  </head>
64
64
  <body
65
65
  class="min-h-dvh bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100 transition-colors duration-200"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrialabs/clopen",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "All-in-one web workspace for Claude Code & OpenCode — chat, terminal, git, browser preview, checkpoints, and real-time collaboration",
5
5
  "author": "Myria Labs",
6
6
  "license": "MIT",
@@ -87,17 +87,17 @@
87
87
  "vite": "^7.0.4"
88
88
  },
89
89
  "dependencies": {
90
- "@anthropic-ai/claude-agent-sdk": "^0.3.156",
91
- "@anthropic-ai/sdk": "^0.100.1",
90
+ "@anthropic-ai/claude-agent-sdk": "0.3.158",
91
+ "@anthropic-ai/sdk": "0.100.1",
92
92
  "@elysiajs/cors": "^1.4.0",
93
- "@github/copilot-sdk": "^1.0.0-beta.9",
93
+ "@github/copilot-sdk": "1.0.0-beta.9",
94
94
  "@iconify-json/lucide": "^1.2.57",
95
95
  "@iconify-json/material-icon-theme": "^1.2.16",
96
- "@modelcontextprotocol/sdk": "^1.29.0",
96
+ "@modelcontextprotocol/sdk": "1.29.0",
97
97
  "@monaco-editor/loader": "^1.5.0",
98
- "@openai/codex-sdk": "^0.135.0",
99
- "@opencode-ai/sdk": "^1.15.12",
100
- "@qwen-code/sdk": "^0.1.7",
98
+ "@openai/codex-sdk": "0.135.0",
99
+ "@opencode-ai/sdk": "1.15.12",
100
+ "@qwen-code/sdk": "0.1.7",
101
101
  "@xterm/addon-clipboard": "^0.2.0",
102
102
  "@xterm/addon-fit": "^0.11.0",
103
103
  "@xterm/addon-ligatures": "^0.10.0",
@@ -119,10 +119,12 @@
119
119
  "puppeteer-extra": "^3.3.6",
120
120
  "puppeteer-extra-plugin-stealth": "^2.11.2",
121
121
  "qrcode": "^1.5.4",
122
+ "sharp": "^0.34.5",
122
123
  "ssh2": "^1.17.0",
123
124
  "xz-decompress": "^0.2.3"
124
125
  },
125
126
  "trustedDependencies": [
126
- "puppeteer"
127
+ "puppeteer",
128
+ "sharp"
127
129
  ]
128
130
  }
@@ -3,20 +3,39 @@
3
3
  * Single source of truth used by both backend (file-type-detection) and frontend (file-type).
4
4
  */
5
5
 
6
+ /**
7
+ * Image formats browsers can render directly in an `<img>` tag.
8
+ * Only these are previewed — formats the browser can't decode (TIFF/HEIC/…)
9
+ * are treated as non-previewable binaries to avoid costly server-side transcoding.
10
+ */
11
+ export const IMAGE_EXTENSIONS = new Set([
12
+ '.png', '.jpg', '.jpeg', '.gif', '.webp', '.bmp', '.ico', '.avif', '.apng', '.jfif',
13
+ ]);
14
+
15
+ /** Audio formats rendered via the `<audio>` element. */
16
+ export const AUDIO_EXTENSIONS = new Set([
17
+ '.mp3', '.wav', '.ogg', '.oga', '.flac', '.aac', '.m4a', '.wma', '.opus', '.weba', '.aiff', '.aif',
18
+ ]);
19
+
20
+ /** Video formats rendered via the `<video>` element. */
21
+ export const VIDEO_EXTENSIONS = new Set([
22
+ '.mp4', '.webm', '.ogv', '.mov', '.avi', '.mkv', '.flv', '.wmv', '.m4v',
23
+ '.mpeg', '.mpg', '.3gp', '.3g2', '.m2ts',
24
+ ]);
25
+
6
26
  /** Binary extensions that CAN be previewed in the browser (image, audio, video, PDF) */
7
27
  export const PREVIEWABLE_BINARY_EXTENSIONS = new Set([
8
- // Images
9
- '.png', '.jpg', '.jpeg', '.gif', '.bmp', '.ico', '.webp', '.tiff', '.tif',
10
- // Audio
11
- '.mp3', '.wav', '.ogg', '.flac', '.aac', '.m4a', '.wma', '.opus',
12
- // Video
13
- '.mp4', '.webm', '.avi', '.mkv', '.mov', '.flv', '.wmv', '.m4v', '.ogv',
28
+ ...IMAGE_EXTENSIONS,
29
+ ...AUDIO_EXTENSIONS,
30
+ ...VIDEO_EXTENSIONS,
14
31
  // Documents
15
32
  '.pdf',
16
33
  ]);
17
34
 
18
35
  /** Binary extensions that CANNOT be previewed — archives, executables, fonts, databases, etc. */
19
36
  export const NON_PREVIEWABLE_BINARY_EXTENSIONS = new Set([
37
+ // Images the browser can't render natively (shown as a downloadable binary)
38
+ '.tiff', '.tif', '.heic', '.heif',
20
39
  // Archives
21
40
  '.zip', '.tar', '.gz', '.bz2', '.xz', '.7z', '.rar', '.zst', '.lz4',
22
41
  // Office documents
@@ -1,7 +1,7 @@
1
1
  /** Notification sound presets bundled with the app (served from /audio/<id>.ogg). */
2
2
  export const NOTIFICATION_SOUND_PRESETS = [
3
- { id: 'chime', label: 'Chime' },
4
3
  { id: 'message', label: 'Message' },
4
+ { id: 'chime', label: 'Chime' },
5
5
  { id: 'alert', label: 'Alert' },
6
6
  { id: 'chirp', label: 'Chirp' },
7
7
  { id: 'blip', label: 'Blip' },
@@ -19,4 +19,85 @@ export interface FileChange {
19
19
  type: 'created' | 'modified' | 'deleted';
20
20
  timestamp: string;
21
21
  diff?: string;
22
+ }
23
+
24
+ /** Raster output formats the image editor can encode (round-trippable by sharp). */
25
+ export type ImageEditFormat = 'png' | 'jpeg' | 'webp' | 'gif' | 'avif';
26
+
27
+ /** A freehand annotation stroke, in oriented (post-rotate/flip) source pixels. */
28
+ export interface ImageEditStroke {
29
+ /** Stroke color as a hex string (e.g. "#ef4444"). */
30
+ color: string;
31
+ /** Stroke width in source pixels. */
32
+ size: number;
33
+ /** 0–1 opacity. */
34
+ opacity?: number;
35
+ /** Polyline points in oriented source pixels. */
36
+ points: { x: number; y: number }[];
37
+ }
38
+
39
+ /** A rectangular region to blur or pixelate, in oriented source pixels. */
40
+ export interface ImageEditRegion {
41
+ type: 'blur' | 'pixelate';
42
+ left: number;
43
+ top: number;
44
+ width: number;
45
+ height: number;
46
+ /** 1–100; higher = stronger blur / larger mosaic blocks. */
47
+ strength: number;
48
+ }
49
+
50
+ /**
51
+ * A declarative description of the edits to apply to an image. Produced by the
52
+ * client editor and applied authoritatively on the backend with sharp against
53
+ * the full-resolution original. All geometry is expressed in the source image's
54
+ * pixel space (crop is applied before rotate/flip/resize).
55
+ */
56
+ export interface ImageEditRecipe {
57
+ /** Crop rectangle in source pixels. Omit to keep full frame. */
58
+ crop?: { left: number; top: number; width: number; height: number };
59
+ /** Target dimensions after crop. Omit to keep cropped size. */
60
+ resize?: { width: number; height: number };
61
+ /** Clockwise rotation in degrees (0/90/180/270). */
62
+ rotate?: 0 | 90 | 180 | 270;
63
+ /** Mirror horizontally (flop). */
64
+ flipH?: boolean;
65
+ /** Mirror vertically (flip). */
66
+ flipV?: boolean;
67
+ /** Lightness multiplier — 1 = unchanged. */
68
+ brightness?: number;
69
+ /** Saturation multiplier — 1 = unchanged. */
70
+ saturation?: number;
71
+ /** Contrast slope — 1 = unchanged. */
72
+ contrast?: number;
73
+ /** Hue rotation in degrees (-180..180). 0 = unchanged. */
74
+ hue?: number;
75
+ /** Gaussian blur sigma (px). 0 / omitted = no blur. */
76
+ blur?: number;
77
+ /** Desaturate to grayscale. */
78
+ grayscale?: boolean;
79
+ /** Apply a sepia tone. */
80
+ sepia?: boolean;
81
+ /** Invert colors (photo negative). */
82
+ invert?: boolean;
83
+ /** Flatten transparency onto this hex background (e.g. when exporting JPEG). */
84
+ background?: string;
85
+ /** Blur/pixelate regions, applied in oriented space before cropping. */
86
+ regions?: ImageEditRegion[];
87
+ /** Freehand annotation strokes, composited on top in oriented space. */
88
+ annotations?: ImageEditStroke[];
89
+ /** Output encoding. */
90
+ output: {
91
+ format: ImageEditFormat;
92
+ /**
93
+ * Opt-in compression. When false (default) the image is preserved at
94
+ * original quality — and with no other edits it is copied byte-for-byte.
95
+ * When true, an efficient codec is applied to reduce the file size.
96
+ */
97
+ compress?: boolean;
98
+ /** Quality 1–100 for lossy encoders (jpeg/webp/avif) when compressing. */
99
+ quality?: number;
100
+ /** Force lossless encoding where supported (png/webp). */
101
+ lossless?: boolean;
102
+ };
22
103
  }
@@ -55,7 +55,7 @@ interface LoggerConfig {
55
55
  enabled: boolean; // Global enable/disable based on NODE_ENV (production = disabled)
56
56
  filterLabels: LogLabel[] | null; // null = show all, array = only show specified labels
57
57
  filterMethods: LogMethod[] | null; // null = show all, array = only show specified methods
58
- filterText: string | null; // null = no text filter, string = only show logs containing this text (case-sensitive)
58
+ filterTexts: string[] | null; // null = no text filter, array = only show logs containing any of these texts (case-sensitive)
59
59
  }
60
60
 
61
61
  // Default configuration - null means no filtering
@@ -64,7 +64,7 @@ const config: LoggerConfig = {
64
64
  enabled: process.env.NODE_ENV !== 'production' || process.env.CLOPEN_DEBUG === 'true',
65
65
  filterLabels: null,
66
66
  filterMethods: null,
67
- filterText: null
67
+ filterTexts: null
68
68
  };
69
69
 
70
70
  /**
@@ -87,8 +87,7 @@ function shouldLog(label: LogLabel, method: LogMethod, args: any[]): boolean {
87
87
  }
88
88
 
89
89
  // Filter by text (case-sensitive)
90
- if (config.filterText !== null) {
91
- // Convert all arguments to string for searching
90
+ if (config.filterTexts !== null) {
92
91
  const argsString = args
93
92
  .map((arg) => {
94
93
  if (typeof arg === 'object') {
@@ -102,8 +101,7 @@ function shouldLog(label: LogLabel, method: LogMethod, args: any[]): boolean {
102
101
  })
103
102
  .join(' ');
104
103
 
105
- // Case-sensitive search
106
- if (!argsString.includes(config.filterText)) {
104
+ if (!config.filterTexts.some((text) => argsString.includes(text))) {
107
105
  return false;
108
106
  }
109
107
  }