@webority/ensemble 0.5.3 → 0.5.5
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/README.md +1 -1
- package/bin/ensemble.js +1 -1
- package/lib/core.js +33 -4
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @webority/ensemble
|
|
2
2
|
|
|
3
|
-
Connect a machine to your [Ensemble](https://ensemble.host)
|
|
3
|
+
Connect a machine to your [Ensemble](https://ensemble.host) Console. Installs the local **agent
|
|
4
4
|
runner** (runs your AI coding sessions, appears in your fleet) and wires **ensemble-bus** into your
|
|
5
5
|
coding CLIs so your sessions message each other — all **scoped to your organization**.
|
|
6
6
|
|
package/bin/ensemble.js
CHANGED
|
@@ -94,7 +94,7 @@ async function status(args) {
|
|
|
94
94
|
|
|
95
95
|
function usage() {
|
|
96
96
|
core.log(
|
|
97
|
-
`ensemble — connect this machine to
|
|
97
|
+
`ensemble — connect this machine to Ensemble
|
|
98
98
|
|
|
99
99
|
ensemble login [--api <url>] [--name <machine>]
|
|
100
100
|
sign in via your browser + set up this machine (downloads the runtime on first run)
|
package/lib/core.js
CHANGED
|
@@ -110,20 +110,49 @@ async function ensureRuntime() {
|
|
|
110
110
|
return ensureBinaries();
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
// The per-platform npm optionalDependency (esbuild model): npm installs only the one matching this
|
|
114
|
+
// OS/arch, with the binaries inside. Returns its directory, or null if it isn't installed (then we
|
|
115
|
+
// fall back to the CDN). require.resolve finds it whether hoisted or nested in node_modules.
|
|
116
|
+
function platformPackageDir() {
|
|
117
|
+
const map = {
|
|
118
|
+
'win-x64': '@webority/ensemble-win-x64',
|
|
119
|
+
'osx-arm64': '@webority/ensemble-darwin-arm64',
|
|
120
|
+
'osx-x64': '@webority/ensemble-darwin-x64',
|
|
121
|
+
'linux-x64': '@webority/ensemble-linux-x64',
|
|
122
|
+
'linux-arm64': '@webority/ensemble-linux-arm64',
|
|
123
|
+
};
|
|
124
|
+
const pkg = map[platform().key];
|
|
125
|
+
if (!pkg) return null;
|
|
126
|
+
try {
|
|
127
|
+
return path.dirname(require.resolve(pkg + '/package.json'));
|
|
128
|
+
} catch (e) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Put the runner + bus in ~/.ensemble (the stable location the daemon, hooks, and autostart use).
|
|
134
|
+
// Source them from the npm-installed platform package (instant copy, no download); only if that
|
|
135
|
+
// package isn't present do we download from the CDN. So `npm i` delivers the binary and `login`
|
|
136
|
+
// just copies + wires it.
|
|
113
137
|
async function ensureBinaries() {
|
|
114
138
|
ensureDirs();
|
|
115
139
|
const pf = platform();
|
|
116
140
|
assertSupported();
|
|
117
141
|
const busPath = path.join(BIN_DIR, 'ensemble-bus' + pf.exe);
|
|
118
142
|
const runnerPath = path.join(RUNNER_DIR, 'Ensemble.Runner' + pf.exe);
|
|
143
|
+
const pkgDir = platformPackageDir();
|
|
119
144
|
const targets = [
|
|
120
|
-
{
|
|
121
|
-
{
|
|
145
|
+
{ src: pkgDir && path.join(pkgDir, 'ensemble-bus' + pf.exe), cdn: 'ensemble-bus-' + pf.key + pf.exe, dest: busPath },
|
|
146
|
+
{ src: pkgDir && path.join(pkgDir, 'Ensemble.Runner' + pf.exe), cdn: 'ensemble-runner-' + pf.key + pf.exe, dest: runnerPath },
|
|
122
147
|
];
|
|
123
148
|
for (const t of targets) {
|
|
124
149
|
if (fs.existsSync(t.dest) && fs.statSync(t.dest).size > 0) continue;
|
|
125
|
-
|
|
126
|
-
|
|
150
|
+
if (t.src && fs.existsSync(t.src) && fs.statSync(t.src).size > 0) {
|
|
151
|
+
fs.copyFileSync(t.src, t.dest); // from the npm platform package — no download
|
|
152
|
+
} else {
|
|
153
|
+
log(' downloading ' + t.cdn + ' …');
|
|
154
|
+
await downloadTo(DL_BASE + '/' + t.cdn, t.dest);
|
|
155
|
+
}
|
|
127
156
|
if (pf.os !== 'windows') {
|
|
128
157
|
fs.chmodSync(t.dest, 0o755);
|
|
129
158
|
// macOS requires at least an ad-hoc signature to run an unsigned binary.
|
package/package.json
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ensemble",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Connect this machine to
|
|
3
|
+
"version": "0.5.5",
|
|
4
|
+
"description": "Connect this machine to Ensemble — runs the local agent runner and wires the ensemble-bus session bus so your coding sessions talk (per-org, isolated).",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ensemble": "bin/ensemble.js"
|
|
7
7
|
},
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
|
+
"optionalDependencies": {
|
|
12
|
+
"@webority/ensemble-darwin-arm64": "0.5.5",
|
|
13
|
+
"@webority/ensemble-darwin-x64": "0.5.5",
|
|
14
|
+
"@webority/ensemble-linux-arm64": "0.5.5",
|
|
15
|
+
"@webority/ensemble-linux-x64": "0.5.5",
|
|
16
|
+
"@webority/ensemble-win-x64": "0.5.5"
|
|
17
|
+
},
|
|
11
18
|
"files": [
|
|
12
19
|
"bin",
|
|
13
20
|
"lib",
|