@myrialabs/clopen 0.1.3 → 0.1.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.
Files changed (49) hide show
  1. package/CONTRIBUTING.md +40 -355
  2. package/README.md +46 -113
  3. package/backend/lib/chat/stream-manager.ts +8 -0
  4. package/backend/lib/database/migrations/022_add_snapshot_changes_column.ts +35 -0
  5. package/backend/lib/database/migrations/index.ts +7 -0
  6. package/backend/lib/database/queries/snapshot-queries.ts +7 -4
  7. package/backend/lib/files/file-watcher.ts +34 -0
  8. package/backend/lib/mcp/config.ts +7 -3
  9. package/backend/lib/mcp/servers/helper.ts +25 -14
  10. package/backend/lib/mcp/servers/index.ts +7 -2
  11. package/backend/lib/project/status-manager.ts +6 -4
  12. package/backend/lib/snapshot/snapshot-service.ts +471 -316
  13. package/backend/lib/terminal/pty-session-manager.ts +1 -32
  14. package/backend/ws/chat/stream.ts +45 -2
  15. package/backend/ws/snapshot/restore.ts +77 -67
  16. package/frontend/lib/components/chat/ChatInterface.svelte +21 -14
  17. package/frontend/lib/components/chat/input/ChatInput.svelte +2 -2
  18. package/frontend/lib/components/chat/input/components/ChatInputActions.svelte +1 -1
  19. package/frontend/lib/components/chat/input/components/EngineModelPicker.svelte +24 -12
  20. package/frontend/lib/components/chat/input/composables/use-textarea-resize.svelte.ts +12 -2
  21. package/frontend/lib/components/chat/tools/AskUserQuestionTool.svelte +3 -8
  22. package/frontend/lib/components/checkpoint/TimelineModal.svelte +222 -30
  23. package/frontend/lib/components/common/MonacoEditor.svelte +14 -0
  24. package/frontend/lib/components/common/xterm/XTerm.svelte +9 -0
  25. package/frontend/lib/components/common/xterm/xterm-service.ts +9 -0
  26. package/frontend/lib/components/git/DiffViewer.svelte +16 -2
  27. package/frontend/lib/components/history/HistoryModal.svelte +3 -4
  28. package/frontend/lib/components/settings/appearance/AppearanceSettings.svelte +59 -0
  29. package/frontend/lib/components/settings/engines/AIEnginesSettings.svelte +1 -1
  30. package/frontend/lib/components/terminal/Terminal.svelte +1 -7
  31. package/frontend/lib/components/workspace/DesktopNavigator.svelte +11 -19
  32. package/frontend/lib/components/workspace/MobileNavigator.svelte +4 -15
  33. package/frontend/lib/components/workspace/PanelHeader.svelte +623 -616
  34. package/frontend/lib/components/workspace/panels/ChatPanel.svelte +3 -2
  35. package/frontend/lib/components/workspace/panels/FilesPanel.svelte +3 -2
  36. package/frontend/lib/components/workspace/panels/GitPanel.svelte +3 -2
  37. package/frontend/lib/services/notification/global-stream-monitor.ts +56 -16
  38. package/frontend/lib/services/snapshot/snapshot.service.ts +71 -32
  39. package/frontend/lib/stores/core/presence.svelte.ts +63 -1
  40. package/frontend/lib/stores/features/settings.svelte.ts +9 -1
  41. package/frontend/lib/stores/features/terminal.svelte.ts +6 -0
  42. package/frontend/lib/stores/ui/workspace.svelte.ts +4 -3
  43. package/package.json +1 -1
  44. package/shared/types/database/schema.ts +18 -0
  45. package/shared/types/stores/settings.ts +2 -0
  46. package/scripts/pre-publish-check.sh +0 -142
  47. package/scripts/setup-hooks.sh +0 -134
  48. package/scripts/validate-branch-name.sh +0 -47
  49. package/scripts/validate-commit-msg.sh +0 -42
@@ -1,134 +0,0 @@
1
- #!/bin/bash
2
-
3
- ##############################################
4
- # Setup Git Hooks for Clopen
5
- #
6
- # This script installs git hooks to validate:
7
- # - Commit message format
8
- # - Code quality (type check + lint)
9
- # - Branch naming
10
- # - Build success (on main/dev push)
11
- ##############################################
12
-
13
- echo ""
14
- echo "🔧 Installing Git Hooks..."
15
- echo ""
16
-
17
- HOOKS_DIR=".git/hooks"
18
-
19
- # ============================================
20
- # HOOK 1: Validate Commit Message Format
21
- # ============================================
22
- echo "📝 Creating commit-msg hook..."
23
-
24
- cat > "$HOOKS_DIR/commit-msg" << 'EOF'
25
- #!/bin/bash
26
- # Validates commit message follows convention
27
- bash scripts/validate-commit-msg.sh "$1"
28
- exit $?
29
- EOF
30
-
31
- chmod +x "$HOOKS_DIR/commit-msg"
32
- echo " ✅ commit-msg hook created"
33
-
34
- # ============================================
35
- # HOOK 2: Type Check + Lint Before Commit
36
- # ============================================
37
- echo "🔍 Creating pre-commit hook..."
38
-
39
- cat > "$HOOKS_DIR/pre-commit" << 'EOF'
40
- #!/bin/bash
41
- echo ""
42
- echo "🔍 Running pre-commit checks..."
43
-
44
- # Type check with Bun
45
- echo " 📝 Type checking..."
46
- bun run check
47
- if [ $? -ne 0 ]; then
48
- echo ""
49
- echo " ❌ Type check failed"
50
- exit 1
51
- fi
52
-
53
- # Lint with Bun
54
- echo " 🔍 Linting..."
55
- bun run lint
56
- if [ $? -ne 0 ]; then
57
- echo ""
58
- echo " ❌ Lint failed"
59
- exit 1
60
- fi
61
-
62
- echo " ✅ All checks passed"
63
- echo ""
64
- exit 0
65
- EOF
66
-
67
- chmod +x "$HOOKS_DIR/pre-commit"
68
- echo " ✅ pre-commit hook created"
69
-
70
- # ============================================
71
- # HOOK 3: Branch Name + Build Test
72
- # ============================================
73
- echo "🚀 Creating pre-push hook..."
74
-
75
- cat > "$HOOKS_DIR/pre-push" << 'EOF'
76
- #!/bin/bash
77
- echo ""
78
- echo "🚀 Running pre-push checks..."
79
-
80
- # Validate branch name
81
- echo " 🌿 Checking branch name..."
82
- bash scripts/validate-branch-name.sh
83
- if [ $? -ne 0 ]; then
84
- exit 1
85
- fi
86
-
87
- # Get current branch
88
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
89
-
90
- # Build test for protected branches
91
- if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "dev" ]; then
92
- echo " 🔨 Testing build (protected branch)..."
93
- bun run build
94
- if [ $? -ne 0 ]; then
95
- echo ""
96
- echo " ❌ Build failed"
97
- exit 1
98
- fi
99
- fi
100
-
101
- echo " ✅ All checks passed"
102
- echo ""
103
- exit 0
104
- EOF
105
-
106
- chmod +x "$HOOKS_DIR/pre-push"
107
- echo " ✅ pre-push hook created"
108
-
109
- # ============================================
110
- # Make Validation Scripts Executable
111
- # ============================================
112
- chmod +x scripts/validate-commit-msg.sh
113
- chmod +x scripts/validate-branch-name.sh
114
-
115
- # ============================================
116
- # Done!
117
- # ============================================
118
- echo ""
119
- echo "✅ Git hooks installed successfully!"
120
- echo ""
121
- echo "┌─────────────────────────────────────────────┐"
122
- echo "│ Hooks Installed: │"
123
- echo "├─────────────────────────────────────────────┤"
124
- echo "│ • commit-msg → Validate message format │"
125
- echo "│ • pre-commit → Type check + Lint │"
126
- echo "│ • pre-push → Branch name + Build test │"
127
- echo "└─────────────────────────────────────────────┘"
128
- echo ""
129
- echo "📚 See CONTRIBUTING.md for commit/branch conventions"
130
- echo ""
131
- echo "⚠️ To bypass (not recommended):"
132
- echo " git commit --no-verify"
133
- echo " git push --no-verify"
134
- echo ""
@@ -1,47 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Validate branch name format
4
- # Called by pre-push hook
5
-
6
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
7
-
8
- # Allowed branch patterns:
9
- # - main, dev (protected branches)
10
- # - feature/*, fix/*, docs/*, chore/*
11
- PATTERN="^(main|dev|feature|fix|docs|chore)/[a-z0-9-]+$"
12
-
13
- # Allow protected branches
14
- if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "dev" ]; then
15
- exit 0
16
- fi
17
-
18
- # Validate branch name
19
- if ! echo "$BRANCH" | grep -qE "$PATTERN"; then
20
- echo ""
21
- echo "❌ Invalid branch name: $BRANCH"
22
- echo ""
23
- echo "Expected format:"
24
- echo " <type>/<short-description>"
25
- echo ""
26
- echo "Types:"
27
- echo " feature - New feature"
28
- echo " fix - Bug fix"
29
- echo " docs - Documentation"
30
- echo " chore - Other changes"
31
- echo ""
32
- echo "Rules:"
33
- echo " - All lowercase"
34
- echo " - Use hyphens (not spaces or underscores)"
35
- echo " - Short and descriptive"
36
- echo ""
37
- echo "Examples:"
38
- echo " feature/add-git-management"
39
- echo " fix/terminal-crash"
40
- echo " docs/update-readme"
41
- echo " chore/update-deps"
42
- echo ""
43
- echo "See CONTRIBUTING.md for full guidelines"
44
- exit 1
45
- fi
46
-
47
- exit 0
@@ -1,42 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Validate commit message format
4
- # Called by commit-msg hook
5
-
6
- COMMIT_MSG_FILE=$1
7
- COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
8
-
9
- # Regex for conventional commits
10
- # Format: type(scope): subject
11
- # Examples: feat: add feature, fix(api): resolve bug
12
- PATTERN="^(feat|fix|docs|chore|release)(\(.+\))?: .{1,72}"
13
-
14
- if ! echo "$COMMIT_MSG" | grep -qE "$PATTERN"; then
15
- echo ""
16
- echo "❌ Invalid commit message format!"
17
- echo ""
18
- echo "Expected format:"
19
- echo " <type>(<scope>): <subject>"
20
- echo ""
21
- echo "Types:"
22
- echo " feat - New feature"
23
- echo " fix - Bug fix"
24
- echo " docs - Documentation"
25
- echo " chore - Other changes (refactor, test, build, etc)"
26
- echo " release - Version release"
27
- echo ""
28
- echo "Examples:"
29
- echo " feat: add database management"
30
- echo " fix(terminal): resolve crash issue"
31
- echo " docs(readme): update installation guide"
32
- echo " chore: update dependencies"
33
- echo " release: v0.0.2"
34
- echo ""
35
- echo "Your message:"
36
- echo " $COMMIT_MSG"
37
- echo ""
38
- echo "See CONTRIBUTING.md for full guidelines"
39
- exit 1
40
- fi
41
-
42
- exit 0