@zenera/cli 1.1.57 → 1.1.58
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/dist/tui/links.js +28 -5
- package/package.json +4 -4
package/dist/tui/links.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { statSync } from 'node:fs';
|
|
1
|
+
import { realpathSync, statSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname, join, sep } from 'node:path';
|
|
2
3
|
import { pathToFileURL } from 'node:url';
|
|
3
4
|
/** Exactly the trees the file tools reach, under the same containment rule. */
|
|
4
5
|
export function mountsOf(files) {
|
|
5
6
|
const names = [...(files.mount ? [files.mount] : []), ...files.mounts.map((m) => m.at)];
|
|
7
|
+
// A link is drawn while the text is, so this answers synchronously — the
|
|
8
|
+
// terminal is on this machine, so its disk can be asked directly — and a
|
|
9
|
+
// symlink out of a tree is no more a link than it is a file the tools reach.
|
|
10
|
+
const trees = [files.root, ...files.mounts.map((m) => m.host)].map(real);
|
|
6
11
|
const resolve = (path) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
12
|
+
const host = files.hostOf(path);
|
|
13
|
+
if (!host) {
|
|
11
14
|
return undefined;
|
|
12
15
|
}
|
|
16
|
+
const at = real(host);
|
|
17
|
+
return trees.some((t) => at === t || at.startsWith(t + sep)) ? at : undefined;
|
|
13
18
|
};
|
|
14
19
|
return {
|
|
15
20
|
names: names.sort((a, b) => b.length - a.length),
|
|
@@ -20,6 +25,24 @@ export function mountsOf(files) {
|
|
|
20
25
|
},
|
|
21
26
|
};
|
|
22
27
|
}
|
|
28
|
+
/** The path with the symlinks in its existing part resolved, the rest appended. */
|
|
29
|
+
function real(path) {
|
|
30
|
+
const missing = [];
|
|
31
|
+
let at = path;
|
|
32
|
+
for (;;) {
|
|
33
|
+
try {
|
|
34
|
+
return join(realpathSync(at), ...missing.reverse());
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
const up = dirname(at);
|
|
38
|
+
if (up === at) {
|
|
39
|
+
return path;
|
|
40
|
+
}
|
|
41
|
+
missing.push(basename(at));
|
|
42
|
+
at = up;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
23
46
|
const FILE = 'file://';
|
|
24
47
|
/** Prose punctuation that ends a sentence, not a path. */
|
|
25
48
|
const TRAILING = /[.,;:!?'"]+$/;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenera/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.58",
|
|
4
4
|
"description": "Command-line front end for @zenera/neo: agentic projects you can run, share and commit.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"@google/genai": "^2.30.0",
|
|
55
55
|
"@inkjs/ui": "^2.0.0",
|
|
56
56
|
"@openrouter/sdk": "^1.4.25",
|
|
57
|
-
"@zenera/engine": "^1.1.
|
|
58
|
-
"@zenera/neo": "^1.1.
|
|
59
|
-
"@zenera/view": "^1.1.
|
|
57
|
+
"@zenera/engine": "^1.1.58",
|
|
58
|
+
"@zenera/neo": "^1.1.58",
|
|
59
|
+
"@zenera/view": "^1.1.58",
|
|
60
60
|
"google-auth-library": "^10.0.0",
|
|
61
61
|
"ink": "^7.1.1",
|
|
62
62
|
"openai": "^6.0.0",
|