@myrialabs/clopen 0.2.3 → 0.2.5
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/backend/engine/adapters/claude/stream.ts +107 -0
- package/backend/engine/adapters/opencode/message-converter.ts +37 -2
- package/backend/engine/adapters/opencode/stream.ts +81 -1
- package/backend/engine/types.ts +17 -0
- package/backend/git/git-service.ts +2 -1
- package/backend/ws/git/commit-message.ts +108 -0
- package/backend/ws/git/index.ts +3 -1
- package/backend/ws/system/index.ts +7 -1
- package/backend/ws/system/operations.ts +28 -2
- package/backend/ws/user/crud.ts +6 -3
- package/frontend/App.svelte +3 -0
- package/frontend/components/auth/SetupPage.svelte +2 -2
- package/frontend/components/chat/input/ChatInput.svelte +1 -1
- package/frontend/components/chat/message/ChatMessage.svelte +64 -16
- package/frontend/components/chat/tools/components/FileHeader.svelte +19 -5
- package/frontend/components/chat/widgets/FloatingTodoList.svelte +30 -26
- package/frontend/components/checkpoint/ConflictResolutionModal.svelte +189 -0
- package/frontend/components/checkpoint/TimelineModal.svelte +7 -162
- package/frontend/components/common/feedback/RestartRequiredModal.svelte +53 -0
- package/frontend/components/common/feedback/UpdateBanner.svelte +17 -6
- package/frontend/components/common/media/MediaPreview.svelte +187 -0
- package/frontend/components/files/FileViewer.svelte +11 -143
- package/frontend/components/git/BranchManager.svelte +143 -155
- package/frontend/components/git/CommitForm.svelte +61 -11
- package/frontend/components/git/DiffViewer.svelte +50 -130
- package/frontend/components/git/FileChangeItem.svelte +22 -0
- package/frontend/components/settings/SettingsModal.svelte +1 -1
- package/frontend/components/settings/SettingsView.svelte +1 -1
- package/frontend/components/settings/engines/AIEnginesSettings.svelte +2 -2
- package/frontend/components/settings/general/UpdateSettings.svelte +10 -3
- package/frontend/components/settings/git/GitSettings.svelte +392 -0
- package/frontend/components/settings/model/EngineModelPicker.svelte +275 -0
- package/frontend/components/settings/model/ModelSettings.svelte +172 -289
- package/frontend/components/workspace/DesktopNavigator.svelte +27 -1
- package/frontend/components/workspace/PanelHeader.svelte +1 -3
- package/frontend/components/workspace/WorkspaceLayout.svelte +14 -2
- package/frontend/components/workspace/panels/FilesPanel.svelte +76 -1
- package/frontend/components/workspace/panels/GitPanel.svelte +84 -33
- package/frontend/main.ts +4 -0
- package/frontend/stores/core/files.svelte.ts +15 -1
- package/frontend/stores/features/settings.svelte.ts +13 -2
- package/frontend/stores/ui/settings-modal.svelte.ts +9 -9
- package/frontend/stores/ui/todo-panel.svelte.ts +39 -0
- package/frontend/stores/ui/update.svelte.ts +45 -4
- package/frontend/utils/file-type.ts +68 -0
- package/index.html +1 -0
- package/package.json +1 -1
- package/shared/constants/binary-extensions.ts +40 -0
- package/shared/types/git.ts +15 -0
- package/shared/types/messaging/tool.ts +1 -0
- package/shared/types/stores/settings.ts +12 -0
- package/shared/utils/file-type-detection.ts +9 -1
- package/static/manifest.json +16 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared binary file extension constants.
|
|
3
|
+
* Single source of truth used by both backend (file-type-detection) and frontend (file-type).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Binary extensions that CAN be previewed in the browser (image, audio, video, PDF) */
|
|
7
|
+
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',
|
|
14
|
+
// Documents
|
|
15
|
+
'.pdf',
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
/** Binary extensions that CANNOT be previewed — archives, executables, fonts, databases, etc. */
|
|
19
|
+
export const NON_PREVIEWABLE_BINARY_EXTENSIONS = new Set([
|
|
20
|
+
// Archives
|
|
21
|
+
'.zip', '.tar', '.gz', '.bz2', '.xz', '.7z', '.rar', '.zst', '.lz4',
|
|
22
|
+
// Office documents
|
|
23
|
+
'.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx',
|
|
24
|
+
// Executables & compiled
|
|
25
|
+
'.exe', '.dll', '.com', '.bin', '.dat', '.pak', '.res',
|
|
26
|
+
'.beam', '.pyc', '.pyo', '.class', '.o', '.obj', '.so', '.dylib', '.a',
|
|
27
|
+
'.lib', '.wasm', '.bc', '.pdb', '.dSYM',
|
|
28
|
+
// Fonts
|
|
29
|
+
'.woff', '.woff2', '.ttf', '.eot', '.otf',
|
|
30
|
+
// Databases
|
|
31
|
+
'.sqlite', '.db', '.mdb',
|
|
32
|
+
// Disk images & other
|
|
33
|
+
'.iso', '.dmg', '.img', '.swf', '.swc',
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
/** All known binary extensions (union of previewable + non-previewable) */
|
|
37
|
+
export const ALL_BINARY_EXTENSIONS = new Set([
|
|
38
|
+
...PREVIEWABLE_BINARY_EXTENSIONS,
|
|
39
|
+
...NON_PREVIEWABLE_BINARY_EXTENSIONS,
|
|
40
|
+
]);
|
package/shared/types/git.ts
CHANGED
|
@@ -169,3 +169,18 @@ export interface GitTag {
|
|
|
169
169
|
date: string;
|
|
170
170
|
isAnnotated: boolean;
|
|
171
171
|
}
|
|
172
|
+
|
|
173
|
+
// ============================================
|
|
174
|
+
// Commit Message Generation
|
|
175
|
+
// ============================================
|
|
176
|
+
|
|
177
|
+
/** Format for AI-generated commit messages */
|
|
178
|
+
export type CommitMessageFormat = 'single-line' | 'multi-line';
|
|
179
|
+
|
|
180
|
+
/** Structured commit message output from AI */
|
|
181
|
+
export interface GeneratedCommitMessage {
|
|
182
|
+
type: string;
|
|
183
|
+
scope: string;
|
|
184
|
+
subject: string;
|
|
185
|
+
body: string;
|
|
186
|
+
}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { EngineType } from '$shared/types/engine';
|
|
2
|
+
import type { CommitMessageFormat } from '$shared/types/git';
|
|
3
|
+
|
|
4
|
+
/** AI commit message generator settings */
|
|
5
|
+
export interface CommitGeneratorSettings {
|
|
6
|
+
/** When false, uses the chat model (selectedEngine/selectedModel). When true, uses custom engine/model below. */
|
|
7
|
+
useCustomModel: boolean;
|
|
8
|
+
engine: EngineType;
|
|
9
|
+
model: string;
|
|
10
|
+
format: CommitMessageFormat;
|
|
11
|
+
}
|
|
2
12
|
|
|
3
13
|
/** Per-user settings (stored per user) */
|
|
4
14
|
export interface AppSettings {
|
|
@@ -13,6 +23,8 @@ export interface AppSettings {
|
|
|
13
23
|
layoutPresetVisibility: Record<string, boolean>;
|
|
14
24
|
/** Base font size in pixels (10–20). Default: 13. */
|
|
15
25
|
fontSize: number;
|
|
26
|
+
/** AI commit message generator configuration */
|
|
27
|
+
commitGenerator: CommitGeneratorSettings;
|
|
16
28
|
}
|
|
17
29
|
|
|
18
30
|
/** Authentication mode */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { fileTypeFromBuffer } from 'file-type';
|
|
2
2
|
import isTextPath from 'is-text-path';
|
|
3
3
|
|
|
4
|
+
import { ALL_BINARY_EXTENSIONS } from '$shared/constants/binary-extensions';
|
|
4
5
|
import { debug } from '$shared/utils/logger';
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Simple and reliable text file detection using external libraries
|
|
7
9
|
*/
|
|
@@ -11,7 +13,13 @@ export async function isTextFile(filePath: string): Promise<boolean> {
|
|
|
11
13
|
if (isTextPath(filePath)) {
|
|
12
14
|
return true;
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
// Fast reject: known binary extensions
|
|
18
|
+
const ext = filePath.substring(filePath.lastIndexOf('.')).toLowerCase();
|
|
19
|
+
if (ALL_BINARY_EXTENSIONS.has(ext)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
const file = Bun.file(filePath);
|
|
16
24
|
const buffer = Buffer.from(await file.arrayBuffer());
|
|
17
25
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Clopen",
|
|
3
|
+
"short_name": "Clopen",
|
|
4
|
+
"description": "All-in-one web workspace for Claude Code & OpenCode — chat, terminal, git, browser preview, checkpoints, and real-time collaboration",
|
|
5
|
+
"start_url": "/",
|
|
6
|
+
"display": "standalone",
|
|
7
|
+
"background_color": "#0f172a",
|
|
8
|
+
"theme_color": "#0f172a",
|
|
9
|
+
"icons": [
|
|
10
|
+
{
|
|
11
|
+
"src": "/favicon.svg",
|
|
12
|
+
"sizes": "any",
|
|
13
|
+
"type": "image/svg+xml"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|