@myrialabs/clopen 0.1.3 → 0.1.4

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.
@@ -146,9 +146,10 @@
146
146
  return;
147
147
  }
148
148
 
149
- // Cancel active stream if running
149
+ // Reset frontend state without killing the backend stream
150
+ // The old session's stream continues running in the background
150
151
  if (appState.isLoading) {
151
- chatService.cancelRequest();
152
+ chatService.resetForSessionSwitch();
152
153
  }
153
154
 
154
155
  // Clear server input state and prevent stale restore on ChatInput remount
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrialabs/clopen",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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",
@@ -1,142 +0,0 @@
1
- #!/bin/bash
2
-
3
- ##############################################
4
- # Pre-Publish Validation
5
- #
6
- # Run this before publishing to npm:
7
- # bash scripts/pre-publish-check.sh
8
- #
9
- # Validates:
10
- # - On main/dev branch
11
- # - No uncommitted changes
12
- # - Type check passes
13
- # - Lint passes
14
- # - Build succeeds
15
- ##############################################
16
-
17
- echo ""
18
- echo "┌─────────────────────────────────────────────┐"
19
- echo "│ │"
20
- echo "│ 🔍 Pre-Publish Validation │"
21
- echo "│ │"
22
- echo "└─────────────────────────────────────────────┘"
23
- echo ""
24
-
25
- # ============================================
26
- # CHECK 1: Current Branch
27
- # ============================================
28
- echo "1️⃣ Checking branch..."
29
-
30
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
31
-
32
- if [ "$BRANCH" != "main" ] && [ "$BRANCH" != "dev" ]; then
33
- echo " ❌ Must publish from main or dev branch"
34
- echo " Current: $BRANCH"
35
- echo ""
36
- exit 1
37
- fi
38
-
39
- echo " ✅ Branch: $BRANCH"
40
- echo ""
41
-
42
- # ============================================
43
- # CHECK 2: Uncommitted Changes
44
- # ============================================
45
- echo "2️⃣ Checking for uncommitted changes..."
46
-
47
- if ! git diff-index --quiet HEAD --; then
48
- echo " ❌ You have uncommitted changes"
49
- echo ""
50
- git status --short
51
- echo ""
52
- echo " Commit or stash changes first"
53
- echo ""
54
- exit 1
55
- fi
56
-
57
- if [ -n "$(git status --porcelain)" ]; then
58
- echo " ❌ Working directory not clean"
59
- echo ""
60
- git status --short
61
- echo ""
62
- exit 1
63
- fi
64
-
65
- echo " ✅ No uncommitted changes"
66
- echo ""
67
-
68
- # ============================================
69
- # CHECK 3: Type Check
70
- # ============================================
71
- echo "3️⃣ Running type check..."
72
-
73
- bun run check > /dev/null 2>&1
74
-
75
- if [ $? -ne 0 ]; then
76
- echo " ❌ Type check failed"
77
- echo ""
78
- bun run check
79
- echo ""
80
- exit 1
81
- fi
82
-
83
- echo " ✅ Type check passed"
84
- echo ""
85
-
86
- # ============================================
87
- # CHECK 4: Lint
88
- # ============================================
89
- echo "4️⃣ Running lint..."
90
-
91
- bun run lint > /dev/null 2>&1
92
-
93
- if [ $? -ne 0 ]; then
94
- echo " ❌ Lint failed"
95
- echo ""
96
- bun run lint
97
- echo ""
98
- exit 1
99
- fi
100
-
101
- echo " ✅ Lint passed"
102
- echo ""
103
-
104
- # ============================================
105
- # CHECK 5: Build
106
- # ============================================
107
- echo "5️⃣ Testing build..."
108
-
109
- bun run build > /dev/null 2>&1
110
-
111
- if [ $? -ne 0 ]; then
112
- echo " ❌ Build failed"
113
- echo ""
114
- bun run build
115
- echo ""
116
- exit 1
117
- fi
118
-
119
- # Verify dist exists
120
- if [ ! -d "dist" ]; then
121
- echo " ❌ dist/ directory not found"
122
- echo ""
123
- exit 1
124
- fi
125
-
126
- echo " ✅ Build successful"
127
- echo ""
128
-
129
- # ============================================
130
- # All Checks Passed!
131
- # ============================================
132
- echo "┌─────────────────────────────────────────────┐"
133
- echo "│ │"
134
- echo "│ ✅ All Checks Passed! │"
135
- echo "│ │"
136
- echo "└─────────────────────────────────────────────┘"
137
- echo ""
138
- echo "Ready to publish:"
139
- echo ""
140
- echo " bun publish --dry-run # Preview what will be published"
141
- echo " bun publish # Publish to npm"
142
- echo ""
@@ -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