@myrialabs/clopen 0.4.42 → 0.4.44
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/chat/stream-manager.ts +6 -5
- package/backend/db-client/env/detect.ts +2 -1
- package/backend/engine/adapters/claude/message-converter.ts +6 -2
- package/backend/engine/adapters/claude/models.ts +147 -18
- package/backend/engine/adapters/claude/stream.ts +9 -7
- package/backend/engine/adapters/codex/models.ts +13 -9
- package/backend/engine/adapters/qwen/message-converter.ts +2 -2
- package/backend/engine/docs/lessons-learned.md +118 -0
- package/backend/env-files/discovery.ts +2 -1
- package/backend/files/file-reading.ts +4 -3
- package/backend/files/path-browsing.ts +2 -1
- package/backend/git/git-service.ts +2 -1
- package/backend/snapshot/turn-changes.ts +3 -2
- package/backend/ssh/sftp.ts +2 -1
- package/backend/worktrees/merge.ts +2 -1
- package/dist/assets/{index-DLoJsmNQ.js → index-BWyhqUi5.js} +1 -1
- package/dist/assets/{index-BynqyvF4.js → index-DX5OwLOc.js} +1 -1
- package/dist/assets/{main-CUyZAmqt.js → main-DOkwqXRU.js} +571 -570
- package/dist/assets/main-DzCY0n-j.css +1 -0
- package/dist/index.html +2 -2
- package/package.json +5 -5
- package/shared/types/unified/index.ts +2 -0
- package/shared/types/unified/stream.ts +38 -1
- package/shared/utils/compare.test.ts +46 -0
- package/shared/utils/compare.ts +21 -0
- package/dist/assets/main-DVCW3cfr.css +0 -1
package/dist/index.html
CHANGED
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
}
|
|
64
64
|
})();
|
|
65
65
|
</script>
|
|
66
|
-
<script type="module" crossorigin src="/assets/main-
|
|
67
|
-
<link rel="stylesheet" crossorigin href="/assets/main-
|
|
66
|
+
<script type="module" crossorigin src="/assets/main-DOkwqXRU.js"></script>
|
|
67
|
+
<link rel="stylesheet" crossorigin href="/assets/main-DzCY0n-j.css">
|
|
68
68
|
</head>
|
|
69
69
|
<body
|
|
70
70
|
class="min-h-dvh bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100 transition-colors duration-200"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrialabs/clopen",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.44",
|
|
4
4
|
"description": "All-in-one web workspace for AI coding agents — Claude Code, OpenCode, Codex, Copilot, Qwen Code, Pi, Cline, and Cursor — with chat, terminal, git, browser preview, database client, checkpoints, and real-time collaboration",
|
|
5
5
|
"author": "Myria Labs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"prepublishOnly": "bun run build"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
81
|
-
"@anthropic-ai/sdk": "0.
|
|
80
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.284",
|
|
81
|
+
"@anthropic-ai/sdk": "0.129.0",
|
|
82
82
|
"@cline/agents": "0.0.74",
|
|
83
83
|
"@cline/sdk": "0.0.74",
|
|
84
84
|
"@cursor/sdk": "1.0.27",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"@huggingface/tokenizers": "0.1.3",
|
|
118
118
|
"@iconify-json/lucide": "1.2.96",
|
|
119
119
|
"@iconify-json/material-icon-theme": "1.2.55",
|
|
120
|
-
"@modelcontextprotocol/sdk": "1.
|
|
120
|
+
"@modelcontextprotocol/sdk": "1.31.0",
|
|
121
121
|
"@monaco-editor/loader": "1.7.0",
|
|
122
122
|
"@myrialabs/ptykit": "0.0.7",
|
|
123
123
|
"@myrialabs/tunnelkit": "0.0.15",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"ssh2": "1.17.0",
|
|
147
147
|
"systeminformation": "5.33.1",
|
|
148
148
|
"typebox": "1.1.38",
|
|
149
|
-
"zod": "4.
|
|
149
|
+
"zod": "4.6.5"
|
|
150
150
|
},
|
|
151
151
|
"trustedDependencies": [
|
|
152
152
|
"puppeteer",
|
|
@@ -80,9 +80,46 @@ export interface SystemInitEvent {
|
|
|
80
80
|
mcpServers: McpServerStatus[];
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* MCP connection state as the engine reported it at session init.
|
|
85
|
+
*
|
|
86
|
+
* The vocabulary is the Claude Agent SDK's, which is the widest any adapter
|
|
87
|
+
* feeds in; `disconnected` is Clopen's own fallback for a producer that sent no
|
|
88
|
+
* status at all (Qwen types the field as a bare `string`). Two of these are not
|
|
89
|
+
* failures and must not raise a toast: `needs-auth` means the server wants
|
|
90
|
+
* credentials configured in Settings → MCP, and `pending` means still
|
|
91
|
+
* connecting — routine since claude-agent-sdk 0.3.282 made MCP servers connect
|
|
92
|
+
* in the background so a slow server no longer delays session start. See the
|
|
93
|
+
* `system_init` arm of stream-manager.ts.
|
|
94
|
+
*/
|
|
83
95
|
export interface McpServerStatus {
|
|
84
96
|
name: string;
|
|
85
|
-
status: 'connected' | '
|
|
97
|
+
status: 'connected' | 'pending' | 'needs-auth' | 'failed' | 'disabled' | 'disconnected';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const MCP_SERVER_STATUSES = new Set<McpServerStatus['status']>([
|
|
101
|
+
'connected', 'pending', 'needs-auth', 'failed', 'disabled', 'disconnected'
|
|
102
|
+
]);
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Narrow an engine-reported MCP status string into the union above.
|
|
106
|
+
*
|
|
107
|
+
* Every SDK that carries this field types it as a bare `string` — the Claude
|
|
108
|
+
* Agent SDK included, whose own richer `McpServerStatus` belongs to a different
|
|
109
|
+
* API surface than the `system:init` payload. So the value has to be checked,
|
|
110
|
+
* not asserted, and the check lives here rather than beside each call site: a
|
|
111
|
+
* per-adapter copy of the vocabulary is how one of them goes stale while
|
|
112
|
+
* type-checking clean.
|
|
113
|
+
*
|
|
114
|
+
* Anything unrecognised or absent becomes `disconnected`, which reads as
|
|
115
|
+
* "reported nothing usable" and raises a toast. Do not fold it into a soft
|
|
116
|
+
* status to quiet the toast: a genuinely unreachable server would then be
|
|
117
|
+
* indistinguishable from one that is still connecting.
|
|
118
|
+
*/
|
|
119
|
+
export function toMcpServerStatus(status: string | undefined): McpServerStatus['status'] {
|
|
120
|
+
return MCP_SERVER_STATUSES.has(status as McpServerStatus['status'])
|
|
121
|
+
? (status as McpServerStatus['status'])
|
|
122
|
+
: 'disconnected';
|
|
86
123
|
}
|
|
87
124
|
|
|
88
125
|
export type RateLimitType =
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import { naturalCompare } from './compare';
|
|
3
|
+
|
|
4
|
+
const sort = (names: string[]) => [...names].sort(naturalCompare);
|
|
5
|
+
|
|
6
|
+
describe('naturalCompare', () => {
|
|
7
|
+
test('orders digit runs by value, not lexicographically', () => {
|
|
8
|
+
expect(sort(['issue-109.ts', 'issue-36.ts'])).toEqual(['issue-36.ts', 'issue-109.ts']);
|
|
9
|
+
expect(sort(['file10.ts', 'file2.ts'])).toEqual(['file2.ts', 'file10.ts']);
|
|
10
|
+
expect(sort(['a10b', 'a9b'])).toEqual(['a9b', 'a10b']);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('still sorts plain names alphabetically', () => {
|
|
14
|
+
expect(sort(['src', 'assets', 'docs'])).toEqual(['assets', 'docs', 'src']);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('groups case and diacritic variants, then orders them deterministically', () => {
|
|
18
|
+
expect(naturalCompare('README.md', 'readme.md')).toBeLessThan(0);
|
|
19
|
+
expect(naturalCompare('cafe.md', 'café.md')).toBeLessThan(0);
|
|
20
|
+
expect(naturalCompare('apple.md', 'äpple.md')).toBeLessThan(0);
|
|
21
|
+
expect(naturalCompare('a', 'a')).toBe(0);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('gives the same order regardless of input order (no readdir fallback)', () => {
|
|
25
|
+
expect(sort(['readme.md', 'README.md'])).toEqual(sort(['README.md', 'readme.md']));
|
|
26
|
+
expect(sort(['café.md', 'cafe.md', 'Cafe.md'])).toEqual(sort(['Cafe.md', 'café.md', 'cafe.md']));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('is independent of the ambient locale', () => {
|
|
30
|
+
// `cs` sorts "ch" after "h" and `sv` sorts "ä" last — a browser in
|
|
31
|
+
// either locale must not re-order what the backend already sorted.
|
|
32
|
+
expect(naturalCompare('changelog.md', 'horse.md')).toBeLessThan(0);
|
|
33
|
+
expect(naturalCompare('apple.md', 'äpple.md')).toBeLessThan(0);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('is antisymmetric and reflexive', () => {
|
|
37
|
+
const names = ['issue-10.ts', 'issue-2.ts', 'README.md', 'readme.md', 'cafe.md', 'äpple.md', 'a', 'A', ''];
|
|
38
|
+
for (const left of names) {
|
|
39
|
+
expect(naturalCompare(left, left)).toBe(0);
|
|
40
|
+
for (const right of names) {
|
|
41
|
+
// Equal and opposite signs — both zero only when the strings match.
|
|
42
|
+
expect(Math.sign(naturalCompare(left, right)) + Math.sign(naturalCompare(right, left))).toBe(0);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Natural-order comparator for human-facing file, path, and name lists.
|
|
3
|
+
*
|
|
4
|
+
* The collator is pinned to `en` so every runtime and platform agrees on one
|
|
5
|
+
* order: the Bun backend and the browser frontend both sort the same lists, and
|
|
6
|
+
* their ambient locales differ (a Czech or Swedish browser, a container with no
|
|
7
|
+
* LANG). `localeCompare(x, undefined, …)` follows the ambient locale instead,
|
|
8
|
+
* so it can re-order a list the other side already sorted.
|
|
9
|
+
*
|
|
10
|
+
* `sensitivity: 'base'` keeps case and diacritics out of the ordering, which
|
|
11
|
+
* makes names like `README.md` and `readme.md` compare equal — the code-unit
|
|
12
|
+
* tie-break then decides that pair deterministically, because leaving it to
|
|
13
|
+
* sort stability would fall back to readdir order, which differs per filesystem.
|
|
14
|
+
*/
|
|
15
|
+
const naturalCollator = new Intl.Collator('en', { numeric: true, sensitivity: 'base' });
|
|
16
|
+
|
|
17
|
+
export function naturalCompare(a: string, b: string): number {
|
|
18
|
+
const result = naturalCollator.compare(a, b);
|
|
19
|
+
if (result !== 0) return result;
|
|
20
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
21
|
+
}
|