@myrialabs/clopen 0.4.42 → 0.4.43
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/db-client/env/detect.ts +2 -1
- package/backend/engine/adapters/claude/models.ts +147 -18
- package/backend/engine/adapters/codex/models.ts +13 -9
- 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-BynqyvF4.js → index-B6u8cait.js} +1 -1
- package/dist/assets/{index-DLoJsmNQ.js → index-BeUKiRiY.js} +1 -1
- package/dist/assets/{main-CUyZAmqt.js → main-CMRXlv2f.js} +569 -568
- package/dist/assets/main-DzCY0n-j.css +1 -0
- package/dist/index.html +2 -2
- package/package.json +1 -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-CMRXlv2f.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.43",
|
|
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",
|
|
@@ -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
|
+
}
|