@myrialabs/clopen 0.0.4 → 0.0.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.
@@ -1,17 +1,17 @@
1
- name: Release & Publish
1
+ name: CI & Release
2
2
 
3
3
  on:
4
4
  push:
5
+ branches: [main, dev]
5
6
  tags:
6
7
  - 'v*.*.*'
8
+ pull_request:
9
+ branches: [main]
7
10
 
8
11
  jobs:
9
- release:
10
- name: Release Package
12
+ ci:
13
+ name: Test & Build
11
14
  runs-on: ubuntu-latest
12
- permissions:
13
- contents: write
14
- id-token: write
15
15
 
16
16
  steps:
17
17
  - name: Checkout
@@ -22,12 +22,6 @@ jobs:
22
22
  with:
23
23
  bun-version: latest
24
24
 
25
- - name: Setup Node.js
26
- uses: actions/setup-node@v4
27
- with:
28
- node-version: '22'
29
- registry-url: 'https://registry.npmjs.org'
30
-
31
25
  - name: Install
32
26
  run: bun install
33
27
 
@@ -47,8 +41,40 @@ jobs:
47
41
  exit 1
48
42
  fi
49
43
 
44
+ publish:
45
+ name: Publish & Release
46
+ needs: ci
47
+ if: startsWith(github.ref, 'refs/tags/v')
48
+ runs-on: ubuntu-latest
49
+ permissions:
50
+ contents: write
51
+ id-token: write
52
+
53
+ steps:
54
+ - name: Checkout
55
+ uses: actions/checkout@v4
56
+
57
+ - name: Setup Bun
58
+ uses: oven-sh/setup-bun@v1
59
+ with:
60
+ bun-version: latest
61
+
62
+ - name: Setup Node.js
63
+ uses: actions/setup-node@v4
64
+ with:
65
+ node-version: '22'
66
+ registry-url: 'https://registry.npmjs.org'
67
+
68
+ - name: Install
69
+ run: bun install
70
+
71
+ - name: Build
72
+ run: bun run build
73
+
50
74
  - name: Publish to npm
51
75
  run: npm publish --provenance --access public
76
+ env:
77
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52
78
 
53
79
  - name: Create GitHub release
54
80
  uses: softprops/action-gh-release@v2
package/backend/index.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env bun
2
2
  import { Elysia } from 'elysia';
3
- import { staticPlugin } from '@elysiajs/static';
4
3
  import { corsMiddleware } from './middleware/cors';
5
4
  import { errorHandlerMiddleware } from './middleware/error-handler';
6
5
  import { loggerMiddleware } from './middleware/logger';
@@ -11,6 +10,8 @@ import { disposeAllEngines } from './lib/engine';
11
10
  import { debug } from '$shared/utils/logger';
12
11
  import { isPortInUse } from './lib/shared/port-utils';
13
12
  import { networkInterfaces } from 'os';
13
+ import { resolve } from 'node:path';
14
+ import { statSync } from 'node:fs';
14
15
 
15
16
  // Import WebSocket router
16
17
  import { wsRouter } from './ws';
@@ -66,18 +67,26 @@ if (isDevelopment) {
66
67
  // Store cleanup function for graceful shutdown
67
68
  (globalThis as any).__closeViteDev = closeViteDev;
68
69
  } else {
69
- // Production: Serve static frontend files
70
- app.use(
71
- staticPlugin({
72
- assets: './dist',
73
- prefix: '/'
74
- })
75
- );
76
-
77
- // SPA fallback: serve index.html for all non-file routes
78
- // Pass BunFile directly (not .stream()) so Bun sets Content-Length automatically
79
- app.all('/*', async () => {
80
- return new Response(Bun.file('./dist/index.html'), {
70
+ // Production: Read index.html once at startup as a string so Content-Length
71
+ // is always correct. Bun.file() streaming can hang on some platforms.
72
+ const distDir = resolve(process.cwd(), 'dist');
73
+ const indexHtml = await Bun.file(resolve(distDir, 'index.html')).text();
74
+
75
+ app.all('/*', ({ path }) => {
76
+ // Serve static files from dist/
77
+ if (path !== '/' && !path.includes('..')) {
78
+ const filePath = resolve(distDir, path.slice(1));
79
+ if (filePath.startsWith(distDir)) {
80
+ try {
81
+ if (statSync(filePath).isFile()) {
82
+ return new Response(Bun.file(filePath));
83
+ }
84
+ } catch {}
85
+ }
86
+ }
87
+
88
+ // SPA fallback: serve cached index.html
89
+ return new Response(indexHtml, {
81
90
  headers: { 'Content-Type': 'text/html; charset=utf-8' }
82
91
  });
83
92
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrialabs/clopen",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
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",
@@ -3,19 +3,6 @@
3
3
  *
4
4
  * Provides filtered logging capabilities with label-based categorization.
5
5
  * All logs can be filtered by label, method type, and text content.
6
- *
7
- * Label Categories (22 total):
8
- * - Communication & Real-time: WebSocket, MCP operations
9
- * - File Operations: File I/O operations
10
- * - Chat & Notifications: Messages and notifications
11
- * - Terminal: Shell/PTY operations
12
- * - Preview: Browser preview and video encoding
13
- * - Data Persistence: Database, migrations, snapshots, checkpoints
14
- * - Engine & Processing: Engine operations
15
- * - User & Session: User and session management
16
- * - Configuration & Settings: Settings
17
- * - Infrastructure & Utilities: Server, git, project ops
18
- * - Frontend/UI State: Workspace and checkpoint UI state
19
6
  */
20
7
 
21
8
  export type LogLabel =
@@ -71,8 +58,7 @@ interface LoggerConfig {
71
58
  // enabled = true in development, false in production
72
59
  const config: LoggerConfig = {
73
60
  enabled: process.env.NODE_ENV !== 'production',
74
- filterLabels: ['snapshot', 'checkpoint', 'chat'],
75
- // filterLabels: ['file'],
61
+ filterLabels: null,
76
62
  filterMethods: null,
77
63
  filterText: null
78
64
  };
@@ -1,40 +0,0 @@
1
- name: Test & Build
2
-
3
- on:
4
- push:
5
- branches: [main, dev]
6
- pull_request:
7
- branches: [main]
8
-
9
- jobs:
10
- test:
11
- name: Run Tests
12
- runs-on: ubuntu-latest
13
-
14
- steps:
15
- - name: Checkout
16
- uses: actions/checkout@v4
17
-
18
- - name: Setup Bun
19
- uses: oven-sh/setup-bun@v1
20
- with:
21
- bun-version: latest
22
-
23
- - name: Install
24
- run: bun install
25
-
26
- - name: Type check
27
- run: bun run check
28
-
29
- - name: Lint
30
- run: bun run lint
31
-
32
- - name: Build
33
- run: bun run build
34
-
35
- - name: Verify build
36
- run: |
37
- if [ ! -d "dist" ]; then
38
- echo "Build failed - dist directory not found"
39
- exit 1
40
- fi