@ours.network/install 1.2.1-nightly.50 → 1.2.1-nightly.52

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/GATEWAY_SETUP.md CHANGED
@@ -11,7 +11,7 @@ control local processes; they do not carry server management requests.
11
11
 
12
12
  The nightly manifest selects one published dependency graph: SDK
13
13
  `3.8.1-nightly.18`, CLI `2.8.1-nightly.16`, daemon `3.8.1-nightly.10`,
14
- Fleet `1.2.0-nightly.65`, MCP/Codex/Claude Code `1.2.0-nightly.14`,
14
+ Fleet `1.2.0-nightly.67`, MCP/Codex/Claude Code `1.2.0-nightly.14`,
15
15
  Telegram `1.0.1-nightly.12`, Messenger `1.0.31-nightly.19`, Notifications
16
16
  `0.3.1-nightly.4`, and Cowork `1.3.4-nightly.20261013.e8a690f`. Exact archive checksums are retained in
17
17
  `releases/nightly.json`; the host CLI uses the same SDK/CLI pair.
package/README.md CHANGED
@@ -739,7 +739,7 @@ Existing installation records keep their ports and identities. A listener acquir
739
739
  by another process after preflight still causes startup to fail safely; no foreign
740
740
  process is stopped and no retained installation is silently moved.
741
741
 
742
- Workspace setup pins Fleet `1.2.0-nightly.65` with its recorded registry integrity. This release includes first-time Fleet setup through the host API for the account App, direct App access to the workspace services with the device credential, v2 positional one-use grants and automatic QR/connection-code output from `ours-fleet setup-tunnel`, optional private file/stdin inputs for legacy v1 payloads, a separate `ours-fleet link-device` command for additional devices, host prerequisite checks before the one-time workspace proof (`setup-tunnel --check`), `setup-tunnel --resume` to finish a setup that stopped after the host saved its private pending setup record (not when the proof's answer was lost, or after the setup window expired with an unconfirmed non-default port), and persists the available Fleet loopback port used by the workspace tunnel. It also accepts a setup-generated configuration left behind after the host enrollment state was removed, runs the host Codex when it is at least as new as the packaged one, offers only the Codex models the signed-in account can use, and removes the temporary setup contact after confirmation. Fleet serves no pages and opens no browser: every screen is in the App. Fleet also serves the workspace notification routes, produces notifications through the server gateway with the imported producer credential, accepts the App's device credential on the notification presence socket so an open App receives no push, and defaults agent wakes to `monitor.interrupt: after_tool` (Hermes: no interrupt; role snapshots saved before this default keep no interrupt). Existing installation identities and configured ports remain retained; a retained-port collision fails safely.
742
+ Workspace setup pins Fleet `1.2.0-nightly.67` with its recorded registry integrity. This release includes first-time Fleet setup through the host API for the account App, direct App access to the workspace services with the device credential, v2 positional one-use grants and automatic QR/connection-code output from `ours-fleet setup-tunnel`, optional private file/stdin inputs for legacy v1 payloads, a separate `ours-fleet link-device` command for additional devices, host prerequisite checks before the one-time workspace proof (`setup-tunnel --check`), `setup-tunnel --resume` to finish a setup that stopped after the host saved its private pending setup record (not when the proof's answer was lost, or after the setup window expired with an unconfirmed non-default port), and persists the available Fleet loopback port used by the workspace tunnel. It also accepts a setup-generated configuration left behind after the host enrollment state was removed, runs the host Codex when it is at least as new as the packaged one, offers only the Codex models the signed-in account can use, and removes the temporary setup contact after confirmation. Fleet serves no pages and opens no browser: every screen is in the App. Fleet also serves the workspace notification routes, produces notifications through the server gateway with the imported producer credential, accepts the App's device credential on the notification presence socket so an open App receives no push, and defaults agent wakes to `monitor.interrupt: after_tool` (Hermes: no interrupt; role snapshots saved before this default keep no interrupt). Existing installation identities and configured ports remain retained; a retained-port collision fails safely.
743
743
 
744
744
  ### App tunnel setup prerelease sequencing
745
745
 
@@ -756,7 +756,7 @@ connection code automatically; the App checks readiness and opens the code field
756
756
  Private `--file`/`--stdin` transports remain optional and are the only transports
757
757
  for legacy v1 payloads with long-lived credentials.
758
758
 
759
- The nightly installer release manifest selects published Fleet `1.2.0-nightly.65`
759
+ The nightly installer release manifest selects published Fleet `1.2.0-nightly.67`
760
760
  and its actual registry integrity through the normal release manifest/source-policy
761
761
  generators. This release includes v2 argument and private-input support. The former
762
762
  nightly.41 selection predates this capability. Merge and publish the repinned
@@ -13,7 +13,7 @@
13
13
  "@ours.network/codex": "1.2.0-nightly.14",
14
14
  "@ours.network/cowork": "1.3.4-nightly.20261013.e8a690f",
15
15
  "@ours.network/daemon": "3.8.1-nightly.10",
16
- "@ours.network/fleet": "1.2.0-nightly.65",
16
+ "@ours.network/fleet": "1.2.0-nightly.67",
17
17
  "@ours.network/mcp": "1.2.0-nightly.14",
18
18
  "@ours.network/messenger-server": "1.0.31-nightly.19",
19
19
  "@ours.network/notifications": "0.3.1-nightly.4",
@@ -1030,9 +1030,9 @@
1030
1030
  }
1031
1031
  },
1032
1032
  "node_modules/@ours.network/fleet": {
1033
- "version": "1.2.0-nightly.65",
1034
- "resolved": "https://registry.npmjs.org/@ours.network/fleet/-/fleet-1.2.0-nightly.65.tgz",
1035
- "integrity": "sha512-zoAQ7H6a/Q/DXLRsEK2BM0GYnzkdRBuSP/Bh/lEUVC/PcaVXDe9ngrZ7y9Mp8hVZM8L552mM2Usk6gGxut45Yw==",
1033
+ "version": "1.2.0-nightly.67",
1034
+ "resolved": "https://registry.npmjs.org/@ours.network/fleet/-/fleet-1.2.0-nightly.67.tgz",
1035
+ "integrity": "sha512-kWsslhAbZ2juI8eehRxcJWB6fzLvbHe8dCxXyGLh7jx/V9khZnMhKX3mrfaSsOo494Y8utvzXYRykcUZ3Uf5IA==",
1036
1036
  "license": "FSL-1.1-Apache-2.0",
1037
1037
  "dependencies": {
1038
1038
  "@agentclientprotocol/sdk": "^1.3.0",
@@ -1045,7 +1045,8 @@
1045
1045
  "qrcode": "1.5.4",
1046
1046
  "secure-json-parse": "^4.1.0",
1047
1047
  "ws": "^8.18.3",
1048
- "yaml": "^2.5.0"
1048
+ "yaml": "^2.5.0",
1049
+ "zod": "^4.4.3"
1049
1050
  },
1050
1051
  "bin": {
1051
1052
  "ours-fleet": "dist/cli.js"
@@ -1058,6 +1059,15 @@
1058
1059
  "@agentclientprotocol/codex-acp": "1.10.0"
1059
1060
  }
1060
1061
  },
1062
+ "node_modules/@ours.network/fleet/node_modules/zod": {
1063
+ "version": "4.6.7",
1064
+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
1065
+ "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
1066
+ "license": "MIT",
1067
+ "funding": {
1068
+ "url": "https://github.com/sponsors/colinhacks"
1069
+ }
1070
+ },
1061
1071
  "node_modules/@ours.network/mcp": {
1062
1072
  "version": "1.2.0-nightly.14",
1063
1073
  "resolved": "https://registry.npmjs.org/@ours.network/mcp/-/mcp-1.2.0-nightly.14.tgz",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "channel": "nightly",
4
- "installerVersion": "1.2.1-nightly.50",
4
+ "installerVersion": "1.2.1-nightly.52",
5
5
  "packages": {
6
6
  "@ours.network/sdk": {
7
7
  "version": "3.8.1-nightly.18",
@@ -28,8 +28,8 @@
28
28
  "integrity": "sha512-z2n4MKigIsDNvOBgJ6rhyWMHT+lfAFNT8bL9mna1IR0ysSz4diAHZSvdc18KE5AdXEXr4YypH9Rmx7frMPG6rA=="
29
29
  },
30
30
  "@ours.network/fleet": {
31
- "version": "1.2.0-nightly.65",
32
- "integrity": "sha512-zoAQ7H6a/Q/DXLRsEK2BM0GYnzkdRBuSP/Bh/lEUVC/PcaVXDe9ngrZ7y9Mp8hVZM8L552mM2Usk6gGxut45Yw=="
31
+ "version": "1.2.0-nightly.67",
32
+ "integrity": "sha512-kWsslhAbZ2juI8eehRxcJWB6fzLvbHe8dCxXyGLh7jx/V9khZnMhKX3mrfaSsOo494Y8utvzXYRykcUZ3Uf5IA=="
33
33
  },
34
34
  "@ours.network/mcp": {
35
35
  "version": "1.2.0-nightly.14",
@@ -2,7 +2,7 @@
2
2
  "release": {
3
3
  "schema": 1,
4
4
  "channel": "nightly",
5
- "installerVersion": "1.2.1-nightly.50",
5
+ "installerVersion": "1.2.1-nightly.52",
6
6
  "packages": {
7
7
  "@ours.network/sdk": {
8
8
  "version": "3.8.1-nightly.18",
@@ -29,8 +29,8 @@
29
29
  "integrity": "sha512-z2n4MKigIsDNvOBgJ6rhyWMHT+lfAFNT8bL9mna1IR0ysSz4diAHZSvdc18KE5AdXEXr4YypH9Rmx7frMPG6rA=="
30
30
  },
31
31
  "@ours.network/fleet": {
32
- "version": "1.2.0-nightly.65",
33
- "integrity": "sha512-zoAQ7H6a/Q/DXLRsEK2BM0GYnzkdRBuSP/Bh/lEUVC/PcaVXDe9ngrZ7y9Mp8hVZM8L552mM2Usk6gGxut45Yw=="
32
+ "version": "1.2.0-nightly.67",
33
+ "integrity": "sha512-kWsslhAbZ2juI8eehRxcJWB6fzLvbHe8dCxXyGLh7jx/V9khZnMhKX3mrfaSsOo494Y8utvzXYRykcUZ3Uf5IA=="
34
34
  },
35
35
  "@ours.network/mcp": {
36
36
  "version": "1.2.0-nightly.14",
@@ -87,7 +87,7 @@
87
87
  },
88
88
  "@ours.network/fleet": {
89
89
  "type": "npm",
90
- "version": "1.2.0-nightly.65"
90
+ "version": "1.2.0-nightly.67"
91
91
  },
92
92
  "@ours.network/mcp": {
93
93
  "type": "npm",
package/lib/effects.mjs CHANGED
@@ -25,7 +25,7 @@ import { dirname, join, resolve } from 'node:path';
25
25
  import { connect as netConnect } from 'node:net';
26
26
  import { clientPackageNames, maintenanceServices, installationPaths, validateInstallation, consumerServiceState, unitNameForStateDir, launchdLabelForStateDir, messengerServicePlan, selectSourcePackages, resolveSourcePolicy, SERVER_SERVICES } from './plan.mjs';
27
27
  import { validateHostProfile, validateGatewayClientProfile } from './target.mjs';
28
- import { serverBase, validateGatewayDiscovery, gatewayCompose, gatewayNginx, gatewayAddress } from './gateway.mjs';
28
+ import { serverBase, validateGatewayDiscovery, gatewayCompose, gatewayNginx, gatewayAddress, gatewayReadinessScript, describeGatewayReadiness } from './gateway.mjs';
29
29
  import { createServerOnboarding, retainedCredentialRefused } from './server-onboarding.mjs';
30
30
  import { atomicWriteConfig, snapshotConfig, restoreConfig } from './config.mjs';
31
31
  import { select as selectOnTty, multiselect as multiselectOnTty, askLine as askLineOnTty } from './prompt.mjs';
@@ -855,28 +855,11 @@ export function networkEffects(effects) {
855
855
  async removeGatewayContainer(record) { await compose(record, ['rm', '-f', 'gateway']); },
856
856
  async verifyGateway(record) {
857
857
  const { prefix } = gatewayAddress(record);
858
- const script = `const fs=require('node:fs');let stage='selection';(async()=>{
859
- const base=${JSON.stringify('http://gateway:8080' + prefix)};
860
- const get=async(path,options={})=>{const r=await fetch(base+path,{...options,redirect:'error',signal:AbortSignal.timeout(5000)});if(!r.ok)throw Error('Gateway readiness HTTP '+r.status);return r.json();};
861
- const selection=await get('/daemon/selection');
862
- if(selection.instanceId!==${JSON.stringify(record.instanceId)})throw Error('Gateway daemon instance mismatch');
863
- stage='unauthenticated-management';
864
- const denied=await fetch(base+'/cowork/management/rpc',{method:'POST',redirect:'error',signal:AbortSignal.timeout(5000),headers:{'content-type':'application/json'},body:'{}'});
865
- await denied.body?.cancel();if(denied.status!==401)throw Error('Gateway management does not reject unauthenticated requests');
866
- stage='credential';
867
- const token=fs.readFileSync('/var/lib/ours/daemon-token','utf8').trim();
868
- const headers={'x-ours-api-token':token,'content-type':'application/json'};
869
- stage='authenticated-daemon';
870
- const identities=await get('/daemon/identities',{headers});
871
- if(!Array.isArray(identities.identities))throw Error('Gateway daemon API invalid');
872
- stage='authenticated-management';
873
- const result=await get('/cowork/management/rpc',{method:'POST',headers,body:JSON.stringify({version:1,id:'installer-readiness',method:'room.list',params:{}})});
874
- if(result.version!==1||result.id!=='installer-readiness'||!Array.isArray(result.result)||result.error)throw Error('Gateway Cowork management unavailable');
875
- })().catch(error=>{const code=error.cause?.code;process.stdout.write('gateway-readiness:'+stage+':'+(['EAI_AGAIN','ENOTFOUND','ECONNREFUSED','ETIMEDOUT'].includes(code)?code:'CHECK_FAILED'));process.exitCode=1;});`;
858
+ const script = gatewayReadinessScript({ base: 'http://gateway:8080' + prefix, instanceId: record.instanceId });
876
859
  const result = await compose(record, ['exec', '-T', 'daemon', 'node', '-e', script], { sensitive: true, allowCodes: [1] });
877
860
  if (result.code === 1) {
878
- const match = /^gateway-readiness:(selection|unauthenticated-management|credential|authenticated-daemon|authenticated-management):(EAI_AGAIN|ENOTFOUND|ECONNREFUSED|ETIMEDOUT|CHECK_FAILED)$/.exec(result.stdout.trim());
879
- const detail = match ? ` (${match[1]}, ${match[2]})` : '';
861
+ const described = describeGatewayReadiness(result.stdout);
862
+ const detail = described ? ` (${described})` : '';
880
863
  throw new Error(`Gateway readiness failed${detail}. Keep installation state intact; check the managed gateway startup and network connection, then retry setup.`);
881
864
  }
882
865
  },
package/lib/gateway.mjs CHANGED
@@ -157,3 +157,71 @@ http {
157
157
  }
158
158
  `;
159
159
  }
160
+
161
+ /** How long the gateway readiness probe keeps retrying a dependency that is still starting. */
162
+ export const GATEWAY_READINESS_WAIT_MS = 60_000;
163
+ const GATEWAY_READINESS_RETRY_MS = 1_000;
164
+ const READINESS_KIND = /^(EAI_AGAIN|ENOTFOUND|ECONNREFUSED|ECONNRESET|ETIMEDOUT|EPIPE|UND_ERR_SOCKET|UND_ERR_CONNECT_TIMEOUT|TIMEOUT|HTTP_[1-5][0-9][0-9]|INVALID|RPC_ERROR|CHECK_FAILED)$/;
165
+
166
+ /**
167
+ * Node script the installer runs inside the daemon container to prove the
168
+ * gateway serves the daemon and Cowork management with the installation's
169
+ * credential. Services restored by an update may still be starting, so a
170
+ * transient result (a 502/503/504 without an RPC error body, a request
171
+ * timeout, a refused, reset or dropped connection — including one dropped
172
+ * while the body is read — or a name not yet resolvable) is
173
+ * retried until one total `deadlineMs` across every stage and attempt; each
174
+ * request is capped to the time left. Anything else — a wrong instance,
175
+ * 401/403, a well-formed RPC error under any status, any other status or an
176
+ * invalid body — fails at once. The probe only reads; nothing else is retried. Output carries stage and a fixed kind only,
177
+ * never the token or a response body.
178
+ */
179
+ export function gatewayReadinessScript({ base, instanceId, tokenPath = '/var/lib/ours/daemon-token',
180
+ deadlineMs = GATEWAY_READINESS_WAIT_MS, retryMs = GATEWAY_READINESS_RETRY_MS }) {
181
+ return `const fs=require('node:fs');const base=${JSON.stringify(base)};const instanceId=${JSON.stringify(instanceId)};
182
+ const tokenPath=${JSON.stringify(tokenPath)};const deadline=Date.now()+${Number(deadlineMs)};const retryMs=${Number(retryMs)};
183
+ const NET=['EAI_AGAIN','ENOTFOUND','ECONNREFUSED','ECONNRESET','ETIMEDOUT','EPIPE','UND_ERR_SOCKET','UND_ERR_CONNECT_TIMEOUT'];
184
+ class Check extends Error{constructor(kind,transient){super(kind);this.kind=kind;this.transient=transient;}}
185
+ const status=s=>new Check('HTTP_'+s,s===502||s===503||s===504);
186
+ const request=async(path,options)=>{const left=Math.max(1,Math.min(5000,deadline-Date.now()));
187
+ try{return await fetch(base+path,{...options,redirect:'error',signal:AbortSignal.timeout(left)});}
188
+ catch(e){const code=e?.cause?.code;if(NET.includes(code))throw new Check(code,true);if(e?.name==='TimeoutError'||e?.cause?.name==='TimeoutError')throw new Check('TIMEOUT',true);throw new Check('CHECK_FAILED',false);}};
189
+ const json=async(path,options={})=>{const r=await request(path,options);
190
+ if(!r.ok){let body;try{body=await r.json();}catch{}
191
+ // A well-formed RPC error is the service's answer, whatever the status: never retried.
192
+ if(body&&typeof body==='object'&&body.version===1&&body.error)throw new Check('RPC_ERROR',false);throw status(r.status);}
193
+ // The request signal also bounds the body: a stalled body is a timeout, not an invalid answer.
194
+ // A connection dropped mid-body is transport, not content; only a parse failure is invalid.
195
+ try{return await r.json();}catch(e){if(e?.name==='TimeoutError'||e?.name==='AbortError')throw new Check('TIMEOUT',true);
196
+ const code=e?.cause?.code;if(NET.includes(code))throw new Check(code,true);throw new Check('INVALID',false);}};
197
+ let stage='selection';
198
+ const attempt=async()=>{
199
+ stage='selection';const selection=await json('/daemon/selection');
200
+ if(selection?.instanceId!==instanceId)throw new Check('INVALID',false);
201
+ stage='unauthenticated-management';
202
+ const denied=await request('/cowork/management/rpc',{method:'POST',headers:{'content-type':'application/json'},body:'{}'});
203
+ await denied.body?.cancel();if(denied.status!==401)throw status(denied.status);
204
+ stage='credential';let token;try{token=fs.readFileSync(tokenPath,'utf8').trim();}catch{throw new Check('CHECK_FAILED',false);}
205
+ const headers={'x-ours-api-token':token,'content-type':'application/json'};
206
+ stage='authenticated-daemon';const identities=await json('/daemon/identities',{headers});
207
+ if(!Array.isArray(identities?.identities))throw new Check('INVALID',false);
208
+ stage='authenticated-management';
209
+ const result=await json('/cowork/management/rpc',{method:'POST',headers,body:JSON.stringify({version:1,id:'installer-readiness',method:'room.list',params:{}})});
210
+ if(result?.version!==1||result.id!=='installer-readiness'||!Array.isArray(result.result)||result.error)throw new Check('INVALID',false);
211
+ };
212
+ (async()=>{let attempts=0;for(;;){attempts++;try{await attempt();return;}catch(e){
213
+ const c=e instanceof Check?e:new Check('CHECK_FAILED',false);
214
+ if(!c.transient||Date.now()+retryMs>=deadline){process.stdout.write('gateway-readiness:'+stage+':'+c.kind+':'+attempts+(c.transient?':transient':''));process.exitCode=1;return;}
215
+ await new Promise(r=>setTimeout(r,retryMs));}}})();`;
216
+ }
217
+
218
+ /** Operator text for a failed readiness probe; `undefined` when the output is not the probe's. */
219
+ export function describeGatewayReadiness(stdout) {
220
+ const match = /^gateway-readiness:(selection|unauthenticated-management|credential|authenticated-daemon|authenticated-management):([A-Z0-9_]+):([0-9]{1,6})(:transient)?$/.exec(String(stdout).trim());
221
+ if (!match || !READINESS_KIND.test(match[2])) return undefined;
222
+ const [, stage, kind, attempts, transient] = match;
223
+ const what = kind.startsWith('HTTP_') ? `HTTP ${kind.slice(5)}` : kind;
224
+ return transient
225
+ ? `${stage}, ${what}; still not ready after ${attempts} attempts over ${GATEWAY_READINESS_WAIT_MS / 1000}s`
226
+ : `${stage}, ${what}`;
227
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/install",
3
- "version": "1.2.1-nightly.50",
3
+ "version": "1.2.1-nightly.52",
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",