@ours.network/install 2.0.8 → 2.1.0

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.
@@ -1136,6 +1136,27 @@
1136
1136
  "node": ">=22"
1137
1137
  }
1138
1138
  },
1139
+ "node_modules/@ours.network/notifications/node_modules/ws": {
1140
+ "version": "8.22.0",
1141
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz",
1142
+ "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==",
1143
+ "license": "MIT",
1144
+ "engines": {
1145
+ "node": ">=10.0.0"
1146
+ },
1147
+ "peerDependencies": {
1148
+ "bufferutil": "^4.0.1",
1149
+ "utf-8-validate": ">=5.0.2"
1150
+ },
1151
+ "peerDependenciesMeta": {
1152
+ "bufferutil": {
1153
+ "optional": true
1154
+ },
1155
+ "utf-8-validate": {
1156
+ "optional": true
1157
+ }
1158
+ }
1159
+ },
1139
1160
  "node_modules/@ours.network/sdk": {
1140
1161
  "version": "5.2.0",
1141
1162
  "resolved": "https://registry.npmjs.org/@ours.network/sdk/-/sdk-5.2.0.tgz",
@@ -3757,9 +3778,9 @@
3757
3778
  "license": "ISC"
3758
3779
  },
3759
3780
  "node_modules/ws": {
3760
- "version": "8.22.0",
3761
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz",
3762
- "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==",
3781
+ "version": "8.22.1",
3782
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.1.tgz",
3783
+ "integrity": "sha512-oyL6OPYme/CmiFvNuGzeoxCJ4nOrZE2O1FwM9MWM1AsGri6nLXB2pg+lNA8aLeXMSav0J6eIVS1j6vUPzUtK9g==",
3763
3784
  "license": "MIT",
3764
3785
  "engines": {
3765
3786
  "node": ">=10.0.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "channel": "stable",
4
- "installerVersion": "2.0.8",
4
+ "installerVersion": "2.1.0",
5
5
  "packages": {
6
6
  "@ours.network/sdk": {
7
7
  "version": "5.2.0",
@@ -2,7 +2,7 @@
2
2
  "release": {
3
3
  "schema": 1,
4
4
  "channel": "stable",
5
- "installerVersion": "2.0.8",
5
+ "installerVersion": "2.1.0",
6
6
  "packages": {
7
7
  "@ours.network/sdk": {
8
8
  "version": "5.2.0",
package/install.mjs CHANGED
@@ -7,12 +7,15 @@ import { realEffects } from './lib/effects.mjs';
7
7
  import { installerFailure } from './lib/diagnostics.mjs';
8
8
  import { runWorkspaceSetup } from './lib/workspace-setup.mjs';
9
9
  import { runSetup } from './lib/setup.mjs';
10
+ import { runSelfUpdate, selfUpdateTag } from './lib/self-update.mjs';
10
11
  import { closeSync, makeWriter, openTty } from './lib/ui.mjs';
11
12
 
12
13
  if (!isSecureNodeVersion(process.versions.node)) {
13
14
  process.stderr.write(`${nodeVersionError(process.versions.node)}\n`);
14
15
  process.exit(1);
15
16
  }
17
+ const updateTag = selfUpdateTag(process.argv.slice(2));
18
+ if (updateTag) process.exit(runSelfUpdate(updateTag));
16
19
  const version = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version;
17
20
  const ttyFd = openTty();
18
21
 
@@ -0,0 +1,47 @@
1
+ // `ours-install update [--nightly]`: run the newest published installer.
2
+ //
3
+ // A launcher only. The selected release is started with no arguments, so the
4
+ // child shows its normal setup (which offers Update for an existing
5
+ // installation) and never sees `update` again — no recursion. Everything else
6
+ // that starts with `update` keeps its existing preset meaning.
7
+
8
+ import { spawnSync } from 'node:child_process';
9
+ import { join } from 'node:path';
10
+
11
+ export const INSTALLER_PACKAGE = '@ours.network/install';
12
+
13
+ /** The npm tag for `update` / `update --nightly`; null for every other argv. */
14
+ export function selfUpdateTag(argv) {
15
+ if (argv.length === 1 && argv[0] === 'update') return 'latest';
16
+ if (argv.length === 2 && argv[0] === 'update' && argv[1] === '--nightly') return 'nightly';
17
+ return null;
18
+ }
19
+
20
+ /**
21
+ * Prefer `npx --yes <pkg>@<tag>`; npx resolves a tag against the registry, so
22
+ * a cached older release is not reused. Without npx, `npm i -g` the selected tag
23
+ * and start the global bin it just wrote by its absolute path, never a PATH
24
+ * lookup that could select an older copy. Returns the exit status to use.
25
+ */
26
+ export function runSelfUpdate(tag, { env = process.env, spawn = spawnSync, err = line => process.stderr.write(`${line}\n`), kill = signal => process.kill(process.pid, signal) } = {}) {
27
+ const spec = `${INSTALLER_PACKAGE}@${tag}`;
28
+ const npm = env.OURS_NPM?.trim() || 'npm';
29
+ const available = cmd => { const r = spawn(cmd, ['--version'], { stdio: 'ignore', env, timeout: 15_000 }); return !r.error && r.status === 0; };
30
+ const interactive = (cmd, args) => {
31
+ const r = spawn(cmd, args, { stdio: 'inherit', env });
32
+ if (r.error) { err(`ours-install: could not start ${cmd}: ${r.error.message}`); return 1; }
33
+ if (r.signal) { kill(r.signal); return 1; }
34
+ return r.status ?? 1;
35
+ };
36
+ if (available('npx')) return interactive('npx', ['--yes', spec]);
37
+ if (!available(npm)) {
38
+ err(`ours-install: update needs npx or npm on PATH. Install Node.js with npm, then run: npx --yes ${spec}`);
39
+ return 1;
40
+ }
41
+ const installed = interactive(npm, ['i', '-g', spec]);
42
+ if (installed !== 0) return installed;
43
+ const prefix = spawn(npm, ['prefix', '--global'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'inherit'], env });
44
+ const dir = prefix.status === 0 ? prefix.stdout.trim() : '';
45
+ if (!dir.startsWith('/')) { err(`ours-install: installed ${spec} but could not find the npm global prefix; run ours-install from a new shell`); return 1; }
46
+ return interactive(join(dir, 'bin', 'ours-install'), []);
47
+ }
package/lib/usage.mjs CHANGED
@@ -14,6 +14,11 @@ export const USAGE = `ours-install — interactive setup with optional CLI prese
14
14
  Collaboration tools only (one Ours service in Docker, plugins for Claude Code and Codex):
15
15
  ours-install --plugin-only --state-dir ~/.ours-install --identity-name "Your Name" --integrations claude-code,codex
16
16
 
17
+ Run the newest installer release (@latest, or @nightly) without typing npx:
18
+ ours-install update [--nightly]
19
+ Uses npx --yes @ours.network/install@<tag>; without npx, npm i -g installs that
20
+ tag and its ours-install starts. Either way the new installer opens its normal setup.
21
+
17
22
  Remove Ours completely (lists everything first; asks you to type "remove ours"):
18
23
  ours-install remove [--state-dir PATH] [--dry-run]
19
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/install",
3
- "version": "2.0.8",
3
+ "version": "2.1.0",
4
4
  "private": false,
5
5
  "description": "The all-in-one ours.network installer: one shared daemon, MCP, cowork, Telegram, Fleet initialization, harness plugins, Human identity, progress UI, and guided next steps.",
6
6
  "type": "module",