hivedesk 1.0.0 → 1.0.1
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/CHANGELOG.md +122 -111
- package/desktop/controller.js +85 -7
- package/desktop/native.js +4 -1
- package/desktop/release-notes/1.0.1.json +12 -0
- package/desktop/scripts/package.mjs +134 -123
- package/desktop/shell.html +5 -2
- package/desktop/workarea.js +440 -0
- package/i18n/de.json +247 -4
- package/i18n/en.json +247 -4
- package/i18n/es.json +247 -4
- package/i18n/fr.json +247 -4
- package/i18n/it.json +247 -4
- package/i18n/ja.json +247 -4
- package/i18n/ko.json +247 -4
- package/i18n/parts/downloads.de.json +29 -0
- package/i18n/parts/downloads.en.json +29 -0
- package/i18n/parts/downloads.es.json +29 -0
- package/i18n/parts/downloads.fr.json +29 -0
- package/i18n/parts/downloads.it.json +29 -0
- package/i18n/parts/downloads.ja.json +29 -0
- package/i18n/parts/downloads.ko.json +29 -0
- package/i18n/parts/downloads.pt-BR.json +29 -0
- package/i18n/parts/downloads.ru.json +29 -0
- package/i18n/parts/downloads.zh-CN.json +29 -0
- package/i18n/parts/office.de.json +184 -0
- package/i18n/parts/office.en.json +184 -0
- package/i18n/parts/office.es.json +184 -0
- package/i18n/parts/office.fr.json +184 -0
- package/i18n/parts/office.it.json +184 -0
- package/i18n/parts/office.ja.json +184 -0
- package/i18n/parts/office.ko.json +184 -0
- package/i18n/parts/office.pt-BR.json +184 -0
- package/i18n/parts/office.ru.json +184 -0
- package/i18n/parts/office.zh-CN.json +184 -0
- package/i18n/pt-BR.json +247 -4
- package/i18n/ru.json +247 -4
- package/i18n/zh-CN.json +247 -4
- package/package.json +3 -2
- package/src/brain/manager.js +23 -7
- package/src/brain/models.js +146 -30
- package/src/brain/runtime.js +61 -13
- package/src/crew/domains/flow.js +2 -1
- package/src/crew/engine.js +172 -22
- package/src/crew/legacy.js +72 -0
- package/src/crew/planner.js +14 -1
- package/src/crew/talk.js +110 -3
- package/src/crew/taskgraph.js +12 -2
- package/src/crew/worker.js +60 -2
- package/src/index.js +4 -1
- package/src/phone/hub.js +15 -3
- package/src/phone/port.js +1 -1
- package/src/replay/reduce.js +1 -0
- package/src/tools/check.js +2 -0
- package/src/voice/index.js +1 -1
- package/src/voice/piper.js +10 -4
- package/src/voice/store.js +2 -1
- package/src/voice/whisper.js +63 -25
- package/ui/city/activity.js +4 -1
- package/ui/city/city.js +5 -5
- package/ui/city/scene.js +2 -1
- package/ui/css/hive.css +20 -0
- package/ui/js/dock.js +2 -2
- package/ui/js/dom.js +23 -18
- package/ui/js/i18n.js +12 -0
- package/ui/js/main.js +43 -3
- package/ui/js/md.js +130 -0
- package/ui/js/net.js +6 -0
- package/ui/js/palette.js +2 -2
- package/ui/js/store.js +20 -2
- package/ui/js/topbar.js +2 -2
- package/ui/js/voice/index.js +3 -2
- package/ui/js/widgets/brief.js +28 -10
- package/ui/js/widgets/chat.js +16 -4
- package/ui/js/widgets/files.js +3 -3
- package/ui/js/widgets/memory.js +3 -3
- package/ui/js/widgets/replay.js +3 -3
- package/ui/js/widgets/settings.js +2 -2
- package/ui/js/widgets/timeline.js +2 -2
- package/ui/js/widgets/worker.js +17 -6
- package/ui/models/index.js +3 -2
- package/ui/models/window.js +2 -2
- package/ui/office/office.js +662 -623
- package/ui/office/popout.js +4 -3
- package/ui/office/scene.js +47 -28
- package/ui/phone/core/client.js +11 -5
- package/ui/phone/desktop.js +2 -1
- package/ui/widget.html +8 -8
- package/ui/widget.js +35 -20
- package/ui/workbench/searchview.js +3 -3
|
@@ -1,123 +1,134 @@
|
|
|
1
|
-
// Builds the folder of one downloadable package. Used by .github/workflows/desktop.yml.
|
|
2
|
-
// node desktop/scripts/package.mjs --target windows-x64|macos-universal|linux-x64 --node <node binary> --out <dir>
|
|
3
|
-
// [--launcher <hivedesk.exe>] (Windows: the compiled launcher)
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
fs.
|
|
74
|
-
fs.
|
|
75
|
-
fs.
|
|
76
|
-
fs.
|
|
77
|
-
fs.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
fs.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
fs.
|
|
91
|
-
fs.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
fs.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
fs.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
fs.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
''
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1
|
+
// Builds the folder of one downloadable package. Used by .github/workflows/desktop.yml.
|
|
2
|
+
// node desktop/scripts/package.mjs --target windows-x64|macos-universal|linux-x64 --node <node binary> --out <dir>
|
|
3
|
+
// [--launcher <hivedesk.exe>] (Windows: the compiled launcher)
|
|
4
|
+
// [--npm <npm folder>] (the npm package of the same Node.js build; found next to --node when left out)
|
|
5
|
+
// The runtime binary comes from the pinned upstream archive and is checked against desktop/platform.js.
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import os from 'node:os';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { RUNTIME, BINARIES } from '../platform.js';
|
|
11
|
+
import { sha256 } from '../runtime.js';
|
|
12
|
+
import { extractEntry } from '../zip.js';
|
|
13
|
+
import { packagedHelperAllowed } from '../native.js';
|
|
14
|
+
|
|
15
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const ROOT = path.resolve(HERE, '..', '..');
|
|
17
|
+
const DESKTOP = path.join(ROOT, 'desktop');
|
|
18
|
+
|
|
19
|
+
const opts = {};
|
|
20
|
+
for (let i = 2; i < process.argv.length; i += 2) opts[process.argv[i].replace(/^--/, '')] = process.argv[i + 1];
|
|
21
|
+
const TARGETS = {
|
|
22
|
+
'windows-x64': { bin: 'win_x64', runtimeName: 'hivedesk-runtime.exe' },
|
|
23
|
+
'macos-universal': { bin: 'mac_universal', runtimeName: 'hivedesk-runtime' },
|
|
24
|
+
'linux-x64': { bin: 'linux_x64', runtimeName: 'hivedesk-runtime' }
|
|
25
|
+
};
|
|
26
|
+
const t = TARGETS[opts.target];
|
|
27
|
+
if (!t || !opts.node || !opts.out) {
|
|
28
|
+
console.error('usage: package.mjs --target windows-x64|macos-universal|linux-x64 --node <node binary> --out <dir> [--launcher <exe>] [--zip <runtime zip>]');
|
|
29
|
+
process.exit(2);
|
|
30
|
+
}
|
|
31
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
|
|
32
|
+
|
|
33
|
+
/** Copies what npm would publish (package.json "files"), always with desktop/. */
|
|
34
|
+
function copyApp(dest) {
|
|
35
|
+
// "!path" entries of package.json files are left out, as npm does.
|
|
36
|
+
const slash = (p) => p.split(path.sep).join('/');
|
|
37
|
+
const excluded = (pkg.files || []).filter((f) => f.startsWith('!')).map((f) => f.slice(1));
|
|
38
|
+
const files = new Set([...(pkg.files || []).filter((f) => !f.startsWith('!')), 'desktop', 'package.json', 'LICENSE']);
|
|
39
|
+
// Only the native helpers desktop/native.js lists (with a pinned hash) go into a package.
|
|
40
|
+
const helperOk = (rel) => !/^desktop[\\/]helpers([\\/]|$)/.test(rel) || packagedHelperAllowed(rel.replace(/^desktop[\\/]/, ''));
|
|
41
|
+
const skip = (rel) => excluded.some((x) => slash(rel) === x || slash(rel).startsWith(`${x}/`)) || !helperOk(rel) || /^desktop[\\/](scripts|launcher|bin)([\\/]|$)/.test(rel) || /^desktop[\\/]icons[\\/].*\.(icns|ico)$/.test(rel) || /(^|[\\/])node_modules([\\/]|$)/.test(rel);
|
|
42
|
+
for (const f of files) {
|
|
43
|
+
const src = path.join(ROOT, f);
|
|
44
|
+
if (!fs.existsSync(src)) continue;
|
|
45
|
+
fs.cpSync(src, path.join(dest, f), { recursive: true, filter: (s) => !skip(path.relative(ROOT, s)) });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function runtimeBinary() {
|
|
50
|
+
let zip;
|
|
51
|
+
if (opts.zip) zip = fs.readFileSync(opts.zip);
|
|
52
|
+
else {
|
|
53
|
+
const res = await fetch(RUNTIME.zip.url, { redirect: 'follow' });
|
|
54
|
+
if (!res.ok) throw new Error(`runtime download: HTTP ${res.status}`);
|
|
55
|
+
zip = Buffer.from(await res.arrayBuffer());
|
|
56
|
+
}
|
|
57
|
+
if (sha256(zip) !== RUNTIME.zip.sha256) throw new Error('runtime archive checksum mismatch');
|
|
58
|
+
const b = BINARIES[t.bin];
|
|
59
|
+
const bin = extractEntry(zip, b.file);
|
|
60
|
+
if (!bin || sha256(bin) !== b.sha256) throw new Error(`${b.file}: checksum mismatch`);
|
|
61
|
+
return bin;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const out = path.resolve(opts.out);
|
|
65
|
+
fs.rmSync(out, { recursive: true, force: true });
|
|
66
|
+
const bin = await runtimeBinary();
|
|
67
|
+
let appDir;
|
|
68
|
+
let nodeDest;
|
|
69
|
+
if (opts.target === 'macos-universal') {
|
|
70
|
+
const contents = path.join(out, 'hivedesk.app', 'Contents');
|
|
71
|
+
appDir = path.join(contents, 'Resources', 'app');
|
|
72
|
+
nodeDest = path.join(contents, 'Resources', 'node', 'bin', 'node');
|
|
73
|
+
fs.mkdirSync(path.join(contents, 'MacOS'), { recursive: true });
|
|
74
|
+
fs.writeFileSync(path.join(contents, 'Info.plist'), fs.readFileSync(path.join(DESKTOP, 'launcher', 'macos', 'Info.plist'), 'utf8').replaceAll('@VERSION@', pkg.version));
|
|
75
|
+
fs.copyFileSync(path.join(DESKTOP, 'launcher', 'macos', 'hivedesk'), path.join(contents, 'MacOS', 'hivedesk'));
|
|
76
|
+
fs.chmodSync(path.join(contents, 'MacOS', 'hivedesk'), 0o755);
|
|
77
|
+
fs.mkdirSync(path.join(contents, 'Resources'), { recursive: true });
|
|
78
|
+
fs.copyFileSync(path.join(DESKTOP, 'icons', 'hivedesk.icns'), path.join(contents, 'Resources', 'hivedesk.icns'));
|
|
79
|
+
} else if (opts.target === 'windows-x64') {
|
|
80
|
+
if (!opts.launcher) throw new Error('--launcher <hivedesk.exe> is needed for Windows');
|
|
81
|
+
appDir = path.join(out, 'hivedesk', 'app');
|
|
82
|
+
nodeDest = path.join(out, 'hivedesk', 'node', 'node.exe');
|
|
83
|
+
fs.mkdirSync(path.join(out, 'hivedesk'), { recursive: true });
|
|
84
|
+
fs.copyFileSync(opts.launcher, path.join(out, 'hivedesk', 'hivedesk.exe'));
|
|
85
|
+
} else {
|
|
86
|
+
const base = path.join(out, 'hivedesk');
|
|
87
|
+
appDir = path.join(base, 'app');
|
|
88
|
+
nodeDest = path.join(base, 'node', 'bin', 'node');
|
|
89
|
+
fs.mkdirSync(base, { recursive: true });
|
|
90
|
+
for (const f of ['hivedesk', 'hivedesk.desktop']) fs.copyFileSync(path.join(DESKTOP, 'launcher', 'linux', f), path.join(base, f));
|
|
91
|
+
fs.chmodSync(path.join(base, 'hivedesk'), 0o755);
|
|
92
|
+
fs.copyFileSync(path.join(DESKTOP, 'icons', 'icon-512.png'), path.join(base, 'hivedesk.png'));
|
|
93
|
+
}
|
|
94
|
+
copyApp(appDir);
|
|
95
|
+
fs.mkdirSync(path.join(appDir, 'desktop', 'bin'), { recursive: true });
|
|
96
|
+
fs.writeFileSync(path.join(appDir, 'desktop', 'bin', t.runtimeName), bin, { mode: 0o755 });
|
|
97
|
+
// Licenses of the bundled runtimes.
|
|
98
|
+
const lic = await fetch(RUNTIME.license);
|
|
99
|
+
if (!lic.ok) throw new Error('runtime license: HTTP ' + lic.status);
|
|
100
|
+
fs.writeFileSync(path.join(appDir, 'desktop', 'bin', 'LICENSE-neutralinojs.txt'), Buffer.from(await lic.arrayBuffer()));
|
|
101
|
+
fs.mkdirSync(path.dirname(nodeDest), { recursive: true });
|
|
102
|
+
const nodeLicense = [path.dirname(opts.node), path.dirname(path.dirname(opts.node))].map((d) => path.join(d, 'LICENSE')).find((f) => fs.existsSync(f));
|
|
103
|
+
if (nodeLicense) fs.copyFileSync(nodeLicense, path.join(path.dirname(nodeDest), 'LICENSE'));
|
|
104
|
+
else console.warn('package: no Node.js LICENSE found next to the node binary');
|
|
105
|
+
fs.copyFileSync(opts.node, nodeDest);
|
|
106
|
+
fs.chmodSync(nodeDest, 0o755);
|
|
107
|
+
// npm goes with the bundled Node.js: the local model runtime (node-llama-cpp) is installed with it on first use,
|
|
108
|
+
// and a PC without Node.js has no other npm. It sits where src/brain/runtime.js looks for it: next to node.exe on
|
|
109
|
+
// Windows, in ../lib/node_modules on macOS and Linux, the layout of the official Node.js archives.
|
|
110
|
+
const npmSrc = opts.npm || [path.join(path.dirname(opts.node), 'node_modules', 'npm'), path.join(path.dirname(path.dirname(opts.node)), 'lib', 'node_modules', 'npm')]
|
|
111
|
+
.find((d) => fs.existsSync(path.join(d, 'bin', 'npm-cli.js')));
|
|
112
|
+
if (!npmSrc || !fs.existsSync(path.join(npmSrc, 'bin', 'npm-cli.js'))) throw new Error('package: npm was not found next to the bundled Node.js; pass --npm <folder>');
|
|
113
|
+
const npmDest = opts.target === 'windows-x64'
|
|
114
|
+
? path.join(path.dirname(nodeDest), 'node_modules', 'npm')
|
|
115
|
+
: path.join(path.dirname(path.dirname(nodeDest)), 'lib', 'node_modules', 'npm');
|
|
116
|
+
fs.cpSync(npmSrc, npmDest, { recursive: true });
|
|
117
|
+
|
|
118
|
+
const readme = [
|
|
119
|
+
`hivedesk ${pkg.version} (${opts.target})`,
|
|
120
|
+
'',
|
|
121
|
+
'Start it:',
|
|
122
|
+
opts.target === 'windows-x64' ? ' double click hivedesk.exe' : opts.target === 'macos-universal' ? ' open hivedesk.app' : ' ./hivedesk (or install hivedesk.desktop in ~/.local/share/applications)',
|
|
123
|
+
'',
|
|
124
|
+
'Inside:',
|
|
125
|
+
' the hivedesk app (the same files as the npm package),',
|
|
126
|
+
` a Node.js runtime (${path.basename(opts.node)}), so nothing else needs to be installed,`,
|
|
127
|
+
` the desktop runtime ${RUNTIME.name} ${RUNTIME.version} (MIT), which shows the app in the system web view.`,
|
|
128
|
+
'',
|
|
129
|
+
'The app is not signed. See https://github.com/kwy404/hivedesk/blob/main/desktop/README.md for the first launch prompts.',
|
|
130
|
+
'Logs: ~/.hivedesk/desktop/launcher.log. Projects default to ~/hivedesk.',
|
|
131
|
+
''
|
|
132
|
+
].join(os.EOL);
|
|
133
|
+
fs.writeFileSync(path.join(opts.target === 'macos-universal' ? out : path.join(out, 'hivedesk'), 'README.txt'), readme);
|
|
134
|
+
console.log(`package: ${opts.target} staged in ${out}`);
|
package/desktop/shell.html
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
iframe { position: fixed; top: var(--bar-h); left: 0; width: 100%; height: calc(100% - var(--bar-h)); border: 0; background: var(--bg); display: block; }
|
|
53
53
|
.edge { position: fixed; z-index: 5; }
|
|
54
54
|
.max .edge, .system .edge { display: none; }
|
|
55
|
+
.ctl .i-res { display: none; } .max:not(.mac) .ctl .i-max { display: none; } .max:not(.mac) .ctl .i-res { display: block; }
|
|
55
56
|
.n { top: 0; left: 8px; right: 8px; height: 4px; cursor: ns-resize; } .s { bottom: 0; left: 8px; right: 8px; height: 5px; cursor: ns-resize; }
|
|
56
57
|
.e { right: 0; top: 8px; bottom: 8px; width: 5px; cursor: ew-resize; } .w { left: 0; top: 8px; bottom: 8px; width: 5px; cursor: ew-resize; }
|
|
57
58
|
.ne, .nw, .se, .sw { width: 9px; height: 9px; } .ne { top: 0; right: 0; cursor: nesw-resize; } .sw { bottom: 0; left: 0; cursor: nesw-resize; }
|
|
@@ -153,7 +154,7 @@
|
|
|
153
154
|
<div class="ctl">
|
|
154
155
|
<button class="menu" id="bMenu" aria-haspopup="true" aria-expanded="false"><svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true"><path d="M2 4h10M2 7h10M2 10h10" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/></svg></button>
|
|
155
156
|
<button class="min" id="bMin"><svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true"><path d="M1 5h8" stroke="currentColor"/></svg></button>
|
|
156
|
-
<button class="max" id="bMax"><svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true"><rect x="1" y="1" width="8" height="8" fill="none" stroke="currentColor"/></svg></button>
|
|
157
|
+
<button class="max" id="bMax"><svg class="i-max" width="10" height="10" viewBox="0 0 10 10" aria-hidden="true"><rect x="1" y="1" width="8" height="8" fill="none" stroke="currentColor"/></svg><svg class="i-res" width="10" height="10" viewBox="0 0 10 10" aria-hidden="true"><path d="M3 2.5V1h6v6H7.5" fill="none" stroke="currentColor"/><rect x="1" y="3" width="6" height="6" fill="none" stroke="currentColor"/></svg></button>
|
|
157
158
|
<button class="x" id="bClose"><svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true"><path d="M1 1l8 8M9 1 1 9" stroke="currentColor"/></svg></button>
|
|
158
159
|
</div>
|
|
159
160
|
</header>
|
|
@@ -337,7 +338,9 @@
|
|
|
337
338
|
detail = { title: d.title, scripts: d.scripts.length, body: d.body ? d.body.children.length : 0 };
|
|
338
339
|
} catch (err) { detail = { error: String(err) }; }
|
|
339
340
|
ui.contentWindow.postMessage({ type: 'hivedesk:desktop:hello', platform: C.platform, native: C.native, ops: BRIDGE }, location.origin);
|
|
340
|
-
|
|
341
|
+
// The screen the window is on, so the controller can bring back a window saved outside every display.
|
|
342
|
+
const scr = { x: screen.availLeft || 0, y: screen.availTop || 0, width: screen.availWidth, height: screen.availHeight };
|
|
343
|
+
api('ready', { frame: true, detail, screen: scr });
|
|
341
344
|
});
|
|
342
345
|
// Updates: the panel under the title bar, the menu items and the About card.
|
|
343
346
|
const U = L.update || {};
|