zerogterm 0.7.0-alpha2 → 0.7.0-alpha3
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/LICENSE +21 -21
- package/README.md +238 -20
- package/bin/zerogterm.cjs +23 -23
- package/dist/main/main/ai-protocol.js +225 -0
- package/dist/main/main/ai-service.js +148 -0
- package/dist/main/main/command-history-store.js +231 -0
- package/dist/main/main/main.js +156 -5
- package/dist/main/main/port-forward-protocol.js +161 -0
- package/dist/main/main/port-forward-service.js +230 -0
- package/dist/main/main/port-forward-store.js +133 -0
- package/dist/main/main/preload.cjs +30 -1
- package/dist/main/main/secret-store.js +156 -0
- package/dist/main/main/session-service.js +22 -4
- package/dist/main/main/shell-catalog.js +63 -2
- package/dist/main/main/ssh-inventory.js +11 -0
- package/dist/main/main/workspace-store.js +213 -0
- package/dist/main/main/wsl-home.js +62 -0
- package/dist/main/shared/endpoints.js +73 -0
- package/dist/main/shared/version.js +32 -0
- package/dist/renderer/assets/index-C2vLQpCh.js +85 -0
- package/dist/renderer/assets/index-Qi5a1Xc8.css +1 -0
- package/dist/renderer/index.html +7 -4
- package/package.json +1 -1
- package/dist/renderer/assets/index-BjXtNztF.css +0 -1
- package/dist/renderer/assets/index-Ogyjvi0e.js +0 -19
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// How the running version is shown.
|
|
2
|
+
//
|
|
3
|
+
// The version comes from Electron's own reading of package.json, so what the
|
|
4
|
+
// title bar says is what is actually running — including in a packaged build,
|
|
5
|
+
// where a string compiled in from the repo could be a release behind. Nothing
|
|
6
|
+
// here invents or shortens a version: the point of reading it from the app is
|
|
7
|
+
// that it cannot drift, and a prettified form would be a second version string
|
|
8
|
+
// to keep in step.
|
|
9
|
+
/** How long a version string may plausibly be before it is not one. */
|
|
10
|
+
const MAX_LENGTH = 40;
|
|
11
|
+
/**
|
|
12
|
+
* The version as the title bar shows it, or null when there is nothing to show.
|
|
13
|
+
*
|
|
14
|
+
* Null rather than a placeholder: an older preload with no version channel, or a
|
|
15
|
+
* main process that answered oddly, should leave the title as it was rather than
|
|
16
|
+
* putting "vunknown" beside the name.
|
|
17
|
+
*/
|
|
18
|
+
export function formatVersion(raw) {
|
|
19
|
+
if (typeof raw !== 'string')
|
|
20
|
+
return null;
|
|
21
|
+
const trimmed = raw.trim();
|
|
22
|
+
if (!trimmed || trimmed.length > MAX_LENGTH)
|
|
23
|
+
return null;
|
|
24
|
+
// A leading `v` is presentation, so it is added if package.json omitted it and
|
|
25
|
+
// not doubled if it did not.
|
|
26
|
+
return trimmed.startsWith('v') || trimmed.startsWith('V') ? trimmed : `v${trimmed}`;
|
|
27
|
+
}
|
|
28
|
+
/** The full name and version, for the tooltip on the wordmark. */
|
|
29
|
+
export function versionLabel(raw) {
|
|
30
|
+
const version = formatVersion(raw);
|
|
31
|
+
return version ? `ZeroG Terminal ${version}` : 'ZeroG Terminal';
|
|
32
|
+
}
|