@myrialabs/clopen 0.3.20 → 0.3.22

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 (40) hide show
  1. package/backend/engine/adapters/claude/environment.ts +0 -17
  2. package/backend/engine/adapters/claude/error-handler.ts +0 -4
  3. package/backend/engine/adapters/claude/models.ts +43 -0
  4. package/backend/engine/install-recipes.ts +69 -117
  5. package/backend/engine/version-check.ts +145 -0
  6. package/backend/files/file-operations.test.ts +75 -0
  7. package/backend/files/file-operations.ts +10 -56
  8. package/backend/files/image-processing.test.ts +52 -0
  9. package/backend/files/image-processing.ts +11 -1
  10. package/backend/files/path-browsing.ts +141 -139
  11. package/backend/git/git-parser.ts +11 -0
  12. package/backend/git/git-service.ts +65 -9
  13. package/backend/http/files-upload.test.ts +174 -0
  14. package/backend/http/files-upload.ts +27 -7
  15. package/backend/http/upload-temp-cleanup.ts +53 -0
  16. package/backend/index.ts +31 -12
  17. package/backend/mcp/remote-server.test.ts +150 -0
  18. package/backend/mcp/remote-server.ts +68 -0
  19. package/backend/terminal/pty-session-manager.ts +18 -11
  20. package/backend/ws/chat/stream.ts +17 -6
  21. package/backend/ws/files/index.ts +5 -0
  22. package/backend/ws/files/reveal.ts +61 -0
  23. package/backend/ws/files/search.test.ts +115 -0
  24. package/backend/ws/files/search.ts +77 -26
  25. package/backend/ws/files/write.ts +3 -1
  26. package/backend/ws/git/branch-name.ts +170 -0
  27. package/backend/ws/git/branch.ts +15 -2
  28. package/backend/ws/git/commit-message.ts +8 -2
  29. package/backend/ws/git/index.ts +3 -1
  30. package/backend/ws/system-tools/status.ts +14 -0
  31. package/backend/ws/user/crud.ts +8 -4
  32. package/dist/assets/main-Ba19ADkk.js +377 -0
  33. package/dist/assets/main-CwCZzMVm.css +1 -0
  34. package/dist/index.html +2 -2
  35. package/package.json +3 -1
  36. package/shared/constants/git.ts +5 -0
  37. package/shared/types/git.ts +13 -0
  38. package/shared/types/stores/settings.ts +17 -0
  39. package/dist/assets/main-72Z_L-nD.js +0 -362
  40. package/dist/assets/main-ClADBkFf.css +0 -1
@@ -12,6 +12,7 @@ import { createRouter } from '$shared/utils/ws-server';
12
12
  import { debug } from '$shared/utils/logger';
13
13
  import { getToolStatus, resolveRecipe, type ToolId } from '$backend/engine/install-recipes';
14
14
  import { getActiveSessionForTool } from '$backend/engine/install-runner';
15
+ import { checkToolUpdate } from '$backend/engine/version-check';
15
16
 
16
17
  const TOOL_UNION = t.Union([
17
18
  t.Literal('git'),
@@ -82,6 +83,19 @@ function toRecipeDTO(tool: ToolId, recipe: Awaited<ReturnType<typeof resolveReci
82
83
  }
83
84
 
84
85
  export const systemToolsStatusHandler = createRouter()
86
+ .http('system-tools:check-update', {
87
+ data: t.Object({
88
+ tool: TOOL_UNION,
89
+ installedVersion: t.Union([t.String(), t.Null()])
90
+ }),
91
+ response: t.Object({
92
+ latestVersion: t.Union([t.String(), t.Null()]),
93
+ hasUpdate: t.Union([t.Boolean(), t.Null()])
94
+ })
95
+ }, async ({ data }) => {
96
+ debug.log('path', `system-tools:check-update for ${data.tool}`);
97
+ return checkToolUpdate(data.tool, data.installedVersion);
98
+ })
85
99
  .http('system-tools:status', {
86
100
  data: t.Object({ tool: TOOL_UNION }),
87
101
  response: t.Object({
@@ -110,7 +110,8 @@ export const crudHandler = createRouter()
110
110
  lastView: t.Union([t.String(), t.Null()]),
111
111
  settings: t.Union([t.Any(), t.Null()]),
112
112
  unreadSessions: t.Union([t.Any(), t.Null()]),
113
- todoPanelState: t.Union([t.Any(), t.Null()])
113
+ todoPanelState: t.Union([t.Any(), t.Null()]),
114
+ projectOrder: t.Union([t.Array(t.String()), t.Null()])
114
115
  })
115
116
  }, async ({ conn }) => {
116
117
  const userId = ws.getUserId(conn);
@@ -120,12 +121,14 @@ export const crudHandler = createRouter()
120
121
  const userSettings = getUserState(userId, 'settings');
121
122
  const unreadSessions = getUserState(userId, 'unreadSessions');
122
123
  const todoPanelState = getUserState(userId, 'todoPanelState');
124
+ const projectOrder = getUserState(userId, 'projectOrder');
123
125
 
124
126
  debug.log('user', `Restored state for ${userId}:`, {
125
127
  currentProjectId,
126
128
  lastView,
127
129
  hasSettings: !!userSettings,
128
- unreadSessionsCount: unreadSessions ? Object.keys(unreadSessions).length : 0
130
+ unreadSessionsCount: unreadSessions ? Object.keys(unreadSessions).length : 0,
131
+ projectOrderCount: Array.isArray(projectOrder) ? projectOrder.length : 0
129
132
  });
130
133
 
131
134
  return {
@@ -133,7 +136,8 @@ export const crudHandler = createRouter()
133
136
  lastView: lastView ?? null,
134
137
  settings: userSettings ?? null,
135
138
  unreadSessions: unreadSessions ?? null,
136
- todoPanelState: todoPanelState ?? null
139
+ todoPanelState: todoPanelState ?? null,
140
+ projectOrder: Array.isArray(projectOrder) ? projectOrder : null
137
141
  };
138
142
  })
139
143
 
@@ -150,7 +154,7 @@ export const crudHandler = createRouter()
150
154
  const userId = ws.getUserId(conn);
151
155
 
152
156
  // Validate allowed keys to prevent arbitrary data storage
153
- const allowedKeys = ['currentProjectId', 'lastView', 'settings', 'unreadSessions', 'todoPanelState'];
157
+ const allowedKeys = ['currentProjectId', 'lastView', 'settings', 'unreadSessions', 'todoPanelState', 'projectOrder'];
154
158
  if (!allowedKeys.includes(data.key)) {
155
159
  throw new Error(`Invalid state key: ${data.key}. Allowed: ${allowedKeys.join(', ')}`);
156
160
  }