@ours.network/install 1.2.1-nightly.5 → 1.2.1-nightly.51

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.
Files changed (64) hide show
  1. package/GATEWAY_SETUP.md +178 -0
  2. package/README.md +548 -9
  3. package/ROOTLESS_PODMAN_VALIDATION.md +210 -0
  4. package/assets/Dockerfile +15 -12
  5. package/assets/Dockerfile.gateway +5 -0
  6. package/assets/docker-compose.yaml +8 -1
  7. package/assets/fleet-settings.example.json +48 -0
  8. package/assets/gateway-entrypoint.sh +37 -0
  9. package/assets/release-lock.json +1227 -4522
  10. package/assets/release.json +37 -19
  11. package/assets/scripts/build/build-common.mjs +10 -1
  12. package/assets/scripts/build/build-sdk.mjs +6 -1
  13. package/assets/scripts/maintenance/build-context.mjs +1 -1
  14. package/assets/scripts/maintenance/daemon-owner.mjs +15 -0
  15. package/assets/scripts/maintenance/docker-layout-conversion.mjs +22 -7
  16. package/assets/scripts/maintenance/recover-notifications.mjs +36 -0
  17. package/assets/scripts/maintenance/release-graph.mjs +18 -1
  18. package/assets/scripts/maintenance/state-operation.mjs +76 -8
  19. package/assets/scripts/runtime/README.md +7 -0
  20. package/assets/scripts/runtime/client-setup.mjs +105 -20
  21. package/assets/scripts/runtime/daemon-client-prefix.mjs +115 -0
  22. package/assets/scripts/runtime/dependency-ready.mjs +13 -0
  23. package/assets/scripts/runtime/diagnostics.mjs +72 -0
  24. package/assets/scripts/runtime/entrypoint.sh +5 -1
  25. package/assets/scripts/runtime/health-messenger.mjs +7 -6
  26. package/assets/scripts/runtime/notifications-gateway.mjs +90 -0
  27. package/assets/scripts/runtime/recover.mjs +165 -0
  28. package/assets/scripts/runtime/start-cowork.sh +5 -0
  29. package/assets/scripts/runtime/start-messenger.sh +29 -4
  30. package/assets/scripts/runtime/start-telegram.sh +5 -0
  31. package/assets/scripts/runtime/supervise.mjs +35 -0
  32. package/assets/sources.json +54 -28
  33. package/install.mjs +7 -2
  34. package/lib/boot-readiness.mjs +96 -0
  35. package/lib/build-transition.mjs +16 -0
  36. package/lib/client-cli.mjs +127 -0
  37. package/lib/container-engine.mjs +127 -0
  38. package/lib/diagnostics.mjs +1 -0
  39. package/lib/docker-conversion-runtime.mjs +7 -4
  40. package/lib/docker-layout-installation.mjs +2 -1
  41. package/lib/docker-recovery.mjs +60 -0
  42. package/lib/docker-runtime-repair.mjs +74 -19
  43. package/lib/effects.mjs +499 -140
  44. package/lib/gateway-transition.mjs +87 -0
  45. package/lib/gateway.mjs +159 -0
  46. package/lib/legacy-migration.mjs +13 -2
  47. package/lib/orchestrate-uninstall.mjs +23 -6
  48. package/lib/orchestrate.mjs +219 -44
  49. package/lib/ownership.mjs +63 -0
  50. package/lib/plan.mjs +37 -11
  51. package/lib/podman-preflight.mjs +40 -0
  52. package/lib/product.mjs +69 -0
  53. package/lib/removal-plan.mjs +437 -0
  54. package/lib/removal.mjs +749 -0
  55. package/lib/server-onboarding.mjs +182 -16
  56. package/lib/server-ports.mjs +17 -0
  57. package/lib/setup-options.mjs +119 -29
  58. package/lib/setup.mjs +83 -22
  59. package/lib/target.mjs +24 -8
  60. package/lib/uninstall.mjs +2 -2
  61. package/lib/usage.mjs +35 -9
  62. package/lib/welcome.mjs +219 -0
  63. package/lib/workspace-setup.mjs +83 -0
  64. package/package.json +4 -2
package/README.md CHANGED
@@ -1,3 +1,116 @@
1
+ ## Start here: choose what you want
2
+
3
+ Run `ours-install` with no options. It asks what you would like to do, in terms of goals:
4
+
5
+ ```
6
+ What would you like to do?
7
+ > (●) Add collaboration tools to my agent apps (Claude Code, Codex or another app)
8
+ ( ) Install the complete Ours workspace
9
+ ( ) Connect my agent apps to an Ours workspace that runs on another computer
10
+ ( ) Other setups (server only, custom ports or packages)
11
+ ```
12
+
13
+ Your existing agent configuration, skills, plugins and custom settings stay as they are. Ours adds its own tools next to them; it does not replace or reconfigure your setup.
14
+
15
+ **Collaboration tools** (`--plugin-only`) give the agent apps you already use their own secure Ours identity, so they can message other agents and people, share files and be woken when mail arrives. They install:
16
+
17
+ - one container: the Ours daemon, published only on `127.0.0.1` (port 3050 by default); nothing else runs;
18
+ - the Ours plugin in each selected app that was found on this computer: Claude Code and/or Codex;
19
+ - the Ours command-line tools and the saved connection in `~/.ours-client`.
20
+
21
+ No Cowork, Messenger, Telegram, Fleet or gateway containers are installed. Clients reach the daemon through a small prefix inside the daemon container that serves only `/daemon/…`, passes requests through unchanged (the daemon still checks every credential) and refuses every other path.
22
+
23
+ ```sh
24
+ ours-install --plugin-only --state-dir ~/.ours-install --identity-name "Your Name" --integrations claude-code,codex
25
+ ```
26
+
27
+ **The complete workspace** adds rooms per task where you invite other agents and people, task and progress tracking, access from your phone through the Ours App, persistent agents that keep working (Fleet), and orchestration of agents from several vendors.
28
+
29
+ **Another agent app.** Choose "Another agent app" in the list. At the end the installer prints exact instructions for the version it installed: the prepared plugin folder, the MCP server command (`node <folder>/bin/proxy.mjs`, stdio), the skill file, and the npm package `@ours.network/claude-code@<version>`. The app must be able to run a local stdio MCP server and must set `CLAUDE_CODE_SESSION_ID` to a value unique to each agent session in that server's environment; without it the Ours tools refuse to act. Apps that cannot run MCP servers cannot use Ours this way. Do not use the public GitHub marketplace `adapt-toolkit/ours-claude-marketplace` with this release: it currently selects an older, incompatible plugin.
30
+
31
+ ### Updating
32
+
33
+ When Ours is already installed, `ours-install` shows the installation and offers:
34
+
35
+ ```
36
+ ◆ Ours is already set up on this computer
37
+ • The complete Ours workspace — folder /home/me/.ours-install, running in Docker
38
+ What would you like to do?
39
+ > (●) Update Ours (recommended)
40
+ ( ) Repair: run setup again with the same choices
41
+ ( ) Remove Ours from this computer
42
+ ( ) Cancel
43
+ ```
44
+
45
+ An update keeps the installation's product (collaboration tools or workspace), runtime, folder, identities, data, connected apps and their settings. It never adds workspace parts to a collaboration-tools installation; to switch, remove it first. An unfinished update or setup is offered as "Finish the earlier update or setup". Running the same setup again is safe: it keeps existing identities, and if the server's access credentials were replaced (`ours-install server access-replace`), it issues a fresh client credential.
46
+
47
+ ### Removing Ours completely
48
+
49
+ ```sh
50
+ ours-install remove # everything Ours created on this computer
51
+ ours-install remove --dry-run # only show the list
52
+ ours-install remove --state-dir ~/.ours-install # one installation
53
+ ```
54
+
55
+ The command lists everything it found, grouped (services and containers; identities, keys, messages and settings; connections in your agent apps; persistent agents; programs and downloads; earlier installations), and what it keeps and why. Then it asks you to type `remove ours`. It runs only in a terminal; identities and their private keys exist nowhere else, so they are never deleted without a person confirming. Make a backup first if you may need them: `ours-install server backup server <label> --state-dir <folder>`.
56
+
57
+ What it removes, and how it proves each item is Ours:
58
+
59
+ | Item | Proof required |
60
+ | --- | --- |
61
+ | Containers | Compose project of the installation **and** a Compose project folder inside the installation folder (containers inherit image labels, so a label alone is not proof), or the installer's own helper names on its own image |
62
+ | Images | the image ID recorded when this installer built it, or the image an owned container was created from; a name alone is never proof; only the name is removed (`docker image rm <tag>`, never by ID or with force) |
63
+ | Volumes, network | the installation's Compose project label |
64
+ | Build cache | only the record whose description is the installer's own npm cache mount (`id=/ours-dist-2-npm`), pruned by its record ID (`docker buildx prune --filter id=…`); kept while another Ours installation uses the engine |
65
+ | Installation and connection folders | their own record (`installation.json` / `profile.json`) still names the installation; the folder is renamed aside, then deleted |
66
+ | Downloaded programs | the owner record of each download folder; a damaged record keeps the folder |
67
+ | Claude Code / Codex | the Ours plugin and plugin source (through their own CLIs), their Ours entries in `settings.json` / `config.toml`, and their cached copy of the Ours plugin, only when the source points into Ours downloads |
68
+ | Ours tool records `~/.ours-mcp` | only the rows and session folders of the removed installation |
69
+ | Persistent agents (Fleet) | services that reference this Ours connection, Fleet configuration and state set up by this client |
70
+ | Earlier installations | old daemon and connector services, verified stopped first; marked plugin sections and old skills |
71
+
72
+ It keeps Docker, Node.js, npm, Claude Code and Codex, your other settings, skills and plugins, shared images such as `node:24`, other build cache records, containers and images it cannot prove, and the temporary session guards in `/tmp/ours-<uid>` that every Ours tool session of your user shares.
73
+
74
+ If something cannot be removed, the summary says exactly what and why, the command exits with status 1 and keeps a small retry record (`~/.ours-removal.json`, identities only). Fix the reason and run `ours-install remove` again; it continues where it stopped:
75
+
76
+ ```
77
+ ◆ Removal summary
78
+ ! Some Ours items could not be removed yet:
79
+ ! - Container images of ours-235c4591528dc8a6 — ours-235c4591528dc8a6:runtime is still used by container user-made, which Ours did not create; remove that container if you no longer need it
80
+ • Fix the reason shown, then run ours-install remove again; it continues from where it stopped.
81
+ ```
82
+
83
+ Running it when nothing is left changes nothing and says so.
84
+
85
+ ## Install first, connect the App afterwards
86
+
87
+ ```sh
88
+ ours-install --username alex --name Alex --surname Taylor --disable-fleet-agents-setup
89
+ ```
90
+
91
+ This permanent command contains no tunnel credentials or enrollment expiry. On a terminal it asks for the remaining installation choices, including Docker, Podman or native packages. The username is local and has no global uniqueness check. A fresh root is named `<username>@<hostname>`; the optional `--hostname` defaults to the machine name. Messenger stores Name and Surname through its supported profile API. Retried setup retains root identities and existing Messenger profiles.
92
+
93
+ `--disable-fleet-agents-setup` installs the Fleet CLI and saves the choice without opening its agent/model wizard or rewriting existing Fleet configuration. Configure agents in the App after device linking. Complete presets still work unattended; partial presets require a terminal and cannot use `OURS_ASSUME_YES`.
94
+
95
+ ### Fleet task commands from a harness command sandbox
96
+
97
+ After Fleet configuration, and again on update, the installer asks the exact Fleet it installed to run `ours-fleet managed-cli setup`. Fleet owns that policy; the installer writes no Codex rule or Claude setting itself, and the step starts no agent session and no model. It runs only when the installed Fleet declares the `managed-cli.setup-v1` capability; the Fleet release this installer pins does. With an earlier Fleet (a retained or development installation) it is skipped (and `--fleet-task-workflow` reports that it was not applied), and it never fails an installation: an unsupported combination is printed with Fleet's reason and left exactly as sandboxed as before.
98
+
99
+ Nothing is prepared unless an Agent declares `managed_cli: [task-workflow]`. To opt agents in from the installer, name them:
100
+
101
+ ```sh
102
+ ours-install client --config /private/profile.json --integrations codex,fleet \
103
+ --fleet-settings /private/fleet-settings.json --fleet-task-workflow FleetCoordinator
104
+ ```
105
+
106
+ `--fleet-task-workflow` takes a comma-separated list of Fleet agent names, requires the Fleet integration and conflicts with `--disable-fleet-agents-setup`. It adds that one key to each named Agent and changes no permission. The prepared scope is the packaged Coordinator task workflow (`task create|start|finish|block|unblock|review|list|show`, `room show|members`, template/plan/help inspection) for one pinned Fleet configuration; `task start` and `task finish` provision and retire rooms and agents, which is real authority, and the installer prints that scope. The result is generated configuration only. It is not evidence that a command reached a supervisor: `ours-fleet managed-cli status` and `ours-fleet doctor` report what running agents actually observed. Fleet's `docs/validation/managed-cli-permissions.md` lists the qualified harnesses and platforms.
107
+
108
+ The separate `ours-fleet setup-tunnel <encoded-v2-grant>` step is supported by the pinned Fleet release. Its private App payload remains scoped, signed-root-bound and expiring. Fleet prints its QR and private single-use connection code immediately after successful setup; scan or paste it into the App. `ours-fleet link-device` remains available for additional devices or expired codes. Do not put the expiring tunnel payload in the permanent installer command.
109
+
110
+ Native packages currently provide server-only installation; full Fleet/App onboarding requires the supported gateway (Docker or Podman). The installer refuses unsupported native full-stack setup before changing anything. This flow does not add a native gateway.
111
+
112
+ See [one-connection setup, localhost:4050 and systemd migration](GATEWAY_SETUP.md) for the gateway-only client workflow.
113
+
1
114
  # @ours.network/install — one installer for the whole stack
2
115
 
3
116
  Requires Node.js 22+ and npm. Install the selected release channel:
@@ -10,8 +123,8 @@ ours-install
10
123
  With no arguments, the wizard explains each step and offers keyboard choices.
11
124
  Use arrow keys and Enter to choose, and Space to select integrations. Recommended
12
125
  settings keep advanced ports and package overrides out of the usual flow. Text
13
- input is used for your name and explicitly customized paths or ports. Linux x64
14
- recommends native mode; macOS and Windows recommend Docker. On Windows run the
126
+ input is used for your name and explicitly customized paths or ports. Docker is recommended for the integrated full-stack gateway on every platform;
127
+ native packages remain available for server-only setup. On Windows run the
15
128
  installer inside WSL with Docker Desktop integration. This recommendation concerns
16
129
  packaging and isolation, not a guarantee that emulated x64 is faster on ARM Macs.
17
130
 
@@ -45,7 +158,7 @@ installers. `--integrations none` explicitly skips client integrations. Use
45
158
  Fleet's own wizard is available only in interactive setup; CLI Fleet setup requires
46
159
  its JSON settings file. Fleet stays stopped until you review and activate it.
47
160
 
48
- The server installs the daemon/SDK/CLI, main MCP, Telegram, Cowork and Messenger.
161
+ The server installs the daemon/SDK/CLI, Telegram, Cowork and Messenger.
49
162
  It starts the daemon, preserves the existing Human identity (or creates it once),
50
163
  then starts its applications. Full-stack setup issues a separate local client
51
164
  credential and configures the selected Codex, Claude Code and Fleet integrations.
@@ -56,6 +169,28 @@ The installer embeds exact component versions and SHA-512 values for its release
56
169
  An existing server's retained release selects matching local clients. Secrets are
57
170
  read from protected files, and client setup never copies the daemon API master.
58
171
 
172
+ ## Runtime and client packages
173
+
174
+ Server selections include `@ours.network/daemon`, whose `ours-daemon` binary owns
175
+ runtime startup and service administration. Docker runs `ours-daemon serve`;
176
+ native installations install its systemd/launchd service. Existing retained
177
+ installations can still stop and restore their older CLI-owned runtime.
178
+
179
+ Client selections contain the thin SDK and CLI, plus MCP when a harness needs
180
+ it. They exclude the daemon and its native database/ADAPT dependencies. Fleet
181
+ runs beside the harnesses on the client machine and calls the daemon HTTP API.
182
+ Client commands report an unavailable server and never start one automatically.
183
+
184
+ The checked-in source policy and packed installer retain the existing server
185
+ release set (SDK `3.8.1-nightly.18`, CLI `2.8.1-nightly.16`, daemon
186
+ `3.8.1-nightly.10`). The isolated host CLI uses published SDK
187
+ `3.8.1-nightly.18` and CLI `2.8.1-nightly.16`, including the shared gateway
188
+ profile resolver. `releases/nightly.json` binds both selections to verified
189
+ SHA512 integrities. Gateway-only Fleet/MCP release adoption is still pending;
190
+ see [GATEWAY_SETUP.md](GATEWAY_SETUP.md). Mixed or unselected nested ours
191
+ versions remain rejected within each selected graph. An explicit `--sources`
192
+ override remains available for development.
193
+
59
194
  ## Migrate an existing global installation
60
195
 
61
196
  The wizard detects the old `~/.ours/config.json` and offers to keep its identities,
@@ -137,8 +272,8 @@ native package acquisition, and reports completion only after service readiness.
137
272
  If a Docker service fails, the error includes its last 50 log lines (bounded in
138
273
  size) and a command to inspect the logs. A failed daemon prevents consumers from
139
274
  starting; a failed consumer does not prevent checks of unrelated consumers.
140
- Server runtime installation selects SDK/CLI, main MCP, Telegram, Cowork and
141
- Messenger. Main MCP is injected into the daemon, not started as a second daemon.
275
+ Server runtime installation selects SDK/CLI, Telegram, Cowork and
276
+ Messenger. MCP runs locally with the Codex and Claude Code plugins and calls the daemon API through the SDK.
142
277
  The daemon starts first; consumers are checked through their owning readiness
143
278
  interfaces. Messenger uses its existing identity prerequisite and never creates an
144
279
  identity. Its failure is reported after attempting unrelated consumers. Package
@@ -195,9 +330,9 @@ relative to the profile file. Select any nonempty subset of integrations; Fleet
195
330
  When Fleet settings are supplied, the installer passes them to Fleet's strict
196
331
  noninteractive `init --settings`; otherwise it opens Fleet's existing wizard.
197
332
  Fleet validates and publishes its own configuration. Client setup verifies the selected
198
- daemon and packaged OURS MCP before registering native integrations. It acquires
333
+ authenticated daemon API before registering native integrations. It acquires
199
334
  only selected integration packages and their actual client dependencies. It does
200
- not install main MCP, administer daemon state or invoke Docker. Exact npm client
335
+ not administer daemon state or invoke Docker. Codex and Claude Code include the local stdio MCP server as a dependency. Exact npm client
201
336
  installation needs no Python; Git source builds use the supplied source recipes
202
337
  and their build prerequisites. Normal native clients need neither Docker nor
203
338
  server maintenance tools.
@@ -213,7 +348,8 @@ an existing override and does not edit shell configuration or running sessions.
213
348
  Repeat with `ours-install client install` to reuse imported inputs and installed
214
349
  package records. Existing settings and Fleet-generated files are preserved. A
215
350
  prepared profile for the same endpoint/instance may supply a valid replacement
216
- issued token; another server is refused without changing the default. Invalid
351
+ issued token; a different server instance is refused without changing the default. A verified
352
+ new gateway address for the same instance updates the shared profile for new clients. Invalid
217
353
  server access is rejected before import. An acquisition or component failure
218
354
  reports incomplete setup and keeps the saved configuration for retry. Selected
219
355
  native integrations whose executable is unavailable are incomplete, not installed.
@@ -224,7 +360,7 @@ Interactive no-argument installation asks for package/Docker server mode, a
224
360
  prepared client profile, or `client`. Client setup offers the saved server when
225
361
  present. On first setup it asks for the server HTTP endpoint, issued-token file,
226
362
  source manifest and integration choices, obtains the instance UUID from
227
- `/selection`, displays it, then checks authenticated daemon and MCP access before
363
+ `/.well-known/ours` at the gateway, displays it, then checks authenticated daemon API access before
228
364
  saving anything. No UUID must be entered manually. The 2.0 HTTP flow assumes the
229
365
  approved trusted same-host deployment; selection metadata is not cryptographic
230
366
  server authentication. Fleet collects missing setup answers through its own wizard.
@@ -262,6 +398,24 @@ build. `server status` reports the pending phase; `server stop` remains availabl
262
398
  Other mutations refuse until activation completes. There is no automatic rollback
263
399
  of application state after publication.
264
400
 
401
+ For Docker updates interrupted by the Notifications provenance omission in older
402
+ installers, use an installer containing the recovery helper and resume with
403
+ `ours-install server update --mode docker --state-dir /path/to/installation --compatible`.
404
+ Retain any original `--sources` input; do not substitute a newer candidate.
405
+ This uses the compatibility attestation saved in the pending update. Passing the
406
+ flag again cannot authorize a transition that did not originally record it.
407
+ The helper requires the four core markers to match the retained candidate and
408
+ Notifications to match its retained previous build, including every recorded
409
+ context, lockfile and dependency-tree byte. It preserves a Notifications-only
410
+ backup with the original provenance, repairs that marker atomically with the
411
+ complete state tree, and resumes preparation and the original running subset.
412
+ It also recognizes a completed state exchange whose journal still says `prepared`;
413
+ untouched source state continues through normal migration. Missing retained
414
+ evidence, arbitrary mixed generations, unsafe files and unclean service exits
415
+ remain errors. Keep the installation, candidate and backups intact on refusal.
416
+ An `all update` requires a running daemon for client verification, so complete
417
+ this server recovery first, then repeat `all update` to refresh clients.
418
+
265
419
 
266
420
  New builds retain `build-context.json` alongside their original lockfile and dependency
267
421
  tree. The context binds the original record bytes to verified vendor tar names,
@@ -295,3 +449,388 @@ deletion is required; repeat the original setup with the updated installer.
295
449
  The repair runs isolated verification containers without state mounts or network
296
450
  access. Other image verification failures stop setup without replacing the image.
297
451
  An interrupted repair can be retried, including after the image tag was replaced.
452
+
453
+ ### Remote clients over HTTPS
454
+
455
+ A client may select an `https://` origin backed by a TLS reverse proxy. Keep the
456
+ daemon listener private and configure the proxy separately with a certificate
457
+ trusted by the client and matching the hostname. Node uses its normal trust
458
+ store; a private CA may be supplied through `NODE_EXTRA_CA_CERTS` before starting
459
+ the client. Certificate verification must remain enabled.
460
+
461
+ The existing issued client credential works over either transport; changing the
462
+ URL scheme does not require a new credential. Keep the server's master on the
463
+ server. Forward `x-ours-api-token` and the `x-ours-*` session headers unchanged,
464
+ and support streamed request/response bodies and long polling. Client requests
465
+ refuse redirects, including HTTPS-to-HTTP redirects: configure the final HTTPS
466
+ origin directly. UUID/capability checks still precede credential-bearing calls.
467
+
468
+ This adds client HTTPS support, not an HTTPS daemon listener, certificate
469
+ provisioning or automatic reverse-proxy configuration. Existing local HTTP and
470
+ SSH-tunnel profiles continue to work.
471
+
472
+ ## One-URL Docker gateway
473
+
474
+ New Docker installations use one loopback-published nginx port (default 3050).
475
+ Clients import one `serverUrl`; their daemon endpoint is `<serverUrl>/daemon` and
476
+ Fleet derives `<serverUrl>/cowork/management/rpc`. Cowork, Messenger and Telegram
477
+ backend ports are internal only. Existing installations retain their prior layout
478
+ on ordinary install/update. Select compatible releases before explicitly migrating:
479
+
480
+ ```sh
481
+ ours-install server gateway-enable --state-dir /private/ours
482
+ ```
483
+
484
+ Migration checks the installed Cowork, Messenger and Telegram capabilities before
485
+ stopping services, verifies authenticated daemon and read-only Cowork management,
486
+ and preserves the existing credential and client integration settings. Failure
487
+ restores routing, client profile and prior service selection. An interrupted
488
+ migration blocks other mutations: repeat `gateway-enable` to finish rollback,
489
+ then run it again to attempt migration. The private `gateway-transition.json`
490
+ retains recovery state until rollback or migration completes. Back up the whole
491
+ installation using the normal server backup procedure before maintenance.
492
+
493
+ For a nested external URL, pass `--server-url https://ours.example/base` during
494
+ Docker install or `gateway-enable`. This sets browser origin and path configuration;
495
+ it does **not** publish a public listener, provide TLS, or install external
496
+ credentials. Configure the authenticated entry first and retain the `/base` path
497
+ when proxying. A compatible release must contain these capabilities:
498
+ `cowork.http-management-v1`, `messenger.gateway-prefix-v1`, and
499
+ `telegram.gateway-listener-v1`. Older releases are rejected without enabling the
500
+ new listener; no package version is silently substituted.
501
+
502
+ ### Notifications
503
+
504
+ When the selected release includes `@ours.network/notifications`, gateway
505
+ installations run it inside the Messenger container, under one supervisor with
506
+ Messenger: a signal stops both, and either one exiting stops the container so
507
+ its normal restart recovers both. It publishes no host port. The gateway routes
508
+ `<serverUrl>/notifications/` to it after the same daemon credential check as
509
+ Telegram, and the service's adapter checks that credential again before acting
510
+ as the installation owner. Browser cookies, origins and fetch metadata are
511
+ removed. Messenger produces message notifications over loopback.
512
+
513
+ `prepare` creates the private configuration once in
514
+ `storage/state/notifications/config.json`: the owner token, separate Fleet and
515
+ Messenger producer tokens, and VAPID keys. Later runs only validate it; rotating
516
+ the owner token or VAPID keys would orphan every browser subscription, so a
517
+ differing configuration is refused rather than rewritten. Back it up with the
518
+ rest of the server state. A local client setup binds the Fleet producer token
519
+ to this server in `~/.ours-client/notifications-producer.json`; Fleet then sends
520
+ agent completions through `<serverUrl>/notifications/`. Remote clients and
521
+ native installations do not produce notifications. The gateway discovery
522
+ document is unchanged, so existing clients keep accepting the server. A
523
+ retained source policy without the package keeps working without notifications.
524
+
525
+ An existing complete installation gains them with its normal update, which
526
+ prepares the credentials after activating the new runtime and hands the Fleet
527
+ producer credential to the local client, then a web-only Fleet restart (agents
528
+ keep running):
529
+
530
+ ```sh
531
+ ours-install all update --mode docker --state-dir /private/ours --identity-name "Your Name" --integrations codex,fleet --fleet-settings /private/fleet.json --compatible
532
+ ours-fleet web restart
533
+ ```
534
+
535
+ ### Authenticated external entry
536
+
537
+ Messenger has no application authentication. Loopback access trusts local users;
538
+ never forward this gateway publicly without authentication. All applications on
539
+ this origin share one trust boundary: scripts or XSS in any application can make
540
+ requests to the others. Cowork's entered server credential grants operator room
541
+ administration and stays in memory until reload. Path prefixes do not isolate
542
+ applications. Only expose this origin to trusted operators.
543
+
544
+ A supported external entry is nginx TLS plus HTTP Basic authentication for browser
545
+ paths, with machine paths left to their existing server-token checks. Create the
546
+ password file using an interactive `htpasswd` prompt and make it readable by the
547
+ proxy worker. Use real certificates and the matching `--server-url`. The inner
548
+ gateway remains bound to `127.0.0.1:3050`; neither backend ports nor the inner
549
+ listener should be externally forwarded. Example for `/base`:
550
+
551
+ ```nginx
552
+ # In http {}:
553
+ map $http_upgrade $ours_connection { default upgrade; '' close; }
554
+ server {
555
+ listen 443 ssl;
556
+ server_name ours.example;
557
+ ssl_certificate /private/tls/fullchain.pem;
558
+ ssl_certificate_key /private/tls/key.pem;
559
+ auth_basic "ours operators";
560
+ auth_basic_user_file /private/ours-users;
561
+ access_log off;
562
+ proxy_set_header Host $http_host;
563
+ proxy_set_header Upgrade $http_upgrade;
564
+ proxy_set_header Connection $ours_connection;
565
+ proxy_http_version 1.1;
566
+ proxy_read_timeout 300s;
567
+ proxy_buffering off;
568
+ location = /base/.well-known/ours { auth_basic off; proxy_pass http://127.0.0.1:3050; }
569
+ location /base/daemon/ { auth_basic off; proxy_pass http://127.0.0.1:3050; }
570
+ location = /base/cowork/management/rpc { auth_basic off; proxy_pass http://127.0.0.1:3050; }
571
+ location /base/tg-connector/ { auth_basic off; proxy_pass http://127.0.0.1:3050; }
572
+ location /base/ { proxy_pass http://127.0.0.1:3050; }
573
+ location / { return 404; }
574
+ }
575
+ ```
576
+
577
+ Browser requests include same-origin proxy credentials. Fleet/SDK use the issued
578
+ `X-Ours-Api-Token`, require no browser login, and reject redirects. An SSH tunnel
579
+ to the loopback gateway is another private transport option, but every client must
580
+ establish its own tunnel and use a URL/origin matching that tunnel; it is not
581
+ automatic remote access. Do not treat a token entered in Cowork as Messenger auth.
582
+
583
+ Publish compatible Cowork, Messenger, Telegram and Fleet artifacts before enabling
584
+ gateway defaults in a qualified installer release. Gateway client setup acquires
585
+ and checks Fleet before activating the managed profile or publishing native
586
+ commands. Migration also checks the installed `ours-fleet version --json`
587
+ capability before stopping services when the selected managed profile includes
588
+ Fleet. Upgrade that executable first. The gate does not inventory differently pinned
589
+ running Fleet instances or remote clients: upgrade every client using this server
590
+ to a compatible Fleet release before cutover.
591
+
592
+ ### Cross-repository gateway qualification
593
+
594
+ Build Cowork, Fleet, Messenger and Telegram checkouts with their locked dependencies.
595
+ The real-service test uses disposable local daemon state, a local test broker,
596
+ nginx Docker containers and Chromium; it never uses installed identities or tokens.
597
+ It requires Linux Docker host networking and `openssl`. Set:
598
+
599
+ ```sh
600
+ OURS_TEST_GATEWAY_SERVICES=1 \
601
+ OURS_TEST_COWORK_ROOT=/checkouts/ours-cowork \
602
+ OURS_TEST_FLEET_ROOT=/checkouts/ours-fleet \
603
+ OURS_TEST_MESSENGER_ROOT=/checkouts/ours-messenger-server \
604
+ OURS_TEST_TELEGRAM_ROOT=/checkouts/ours-tg-connector \
605
+ OURS_TEST_BROWSER=/opt/google/chrome/chrome \
606
+ node --test packages/installer/test/gateway-services.test.mjs
607
+ ```
608
+
609
+ Run `OURS_TEST_DOCKER=1 node --test packages/installer/test/gateway-docker.test.mjs`
610
+ separately for Compose port isolation with a client container. That routing test
611
+ uses echo upstreams; the real-service test covers Fleet room operations, browser
612
+ paths, external authentication and Messenger WebSocket access. Neither test is
613
+ cross-platform Docker Desktop qualification or a live deployment test.
614
+
615
+ ### Rootless Podman (qualification in progress)
616
+
617
+ Container installations can select a local Linux rootless backend explicitly:
618
+
619
+ ```sh
620
+ export PODMAN_COMPOSE_PROVIDER=/absolute/path/to/docker-compose
621
+ ours-install server install --mode docker --container-engine podman \
622
+ --state-dir "$HOME/.ours-server-podman" --identity-name "Your Name"
623
+ ```
624
+
625
+ `mode: docker` remains the legacy container-layout name. `containerEngine` and
626
+ `containerBinding` retain Podman, the invoking UID, native storage paths, socket
627
+ and standalone Compose provider, plus the UID/GID mapping fingerprint. Records without `containerEngine` continue to
628
+ use Docker. Package/client installs reject the engine option. Existing records
629
+ cannot change engines through a flag or ambient connection change; automatic
630
+ Docker-to-Podman data migration is not provided. Legacy local-daemon migration
631
+ (`--migrate-from`) to Podman is also unsupported and is refused before source
632
+ shutdown or managed CLI publication, including migration retries. Use a fresh
633
+ Podman installation, or migrate the legacy daemon with Docker/packages.
634
+
635
+ Podman uses its native build command, with the same resolved Compose build
636
+ context, target, architecture, arguments and secret references, followed by
637
+ Compose `--no-build` startup. It does not require the Docker CLI or daemon.
638
+ The selected standalone Docker Compose provider must be version 2.35 or newer;
639
+ version checks do not replace the behavioral capability probe. `podman-compose`
640
+ is not an interchangeable provider for this implementation. Secrets sourced
641
+ from environment variables use Podman's native build-secret mechanism, never
642
+ build arguments or temporary copies.
643
+
644
+ Prerequisites include a working rootless API socket, sufficient subordinate
645
+ UID/GID mappings, and native volume-subpath isolation. Before setup/start, an
646
+ isolated disposable project tests Compose `!reset`, health waiting, JSON status,
647
+ service DNS, private UID-1000 storage and subpath isolation. A failed check stops
648
+ installation rather than substituting the whole volume. Existing volumes must
649
+ have this installation's project and volume labels. Docker contexts, unrelated
650
+ containers and host directory ownership are not changed.
651
+
652
+ Server boot recovery requires an enabled user `podman.socket`, an enabled
653
+ `podman-restart.service` using `--filter should-start-on-boot=true`, and user
654
+ linger. The standard user-service environment/default socket must select the
655
+ same storage; custom XDG paths and sockets are rejected for server startup.
656
+ The installer diagnoses missing prerequisites and never runs hidden sudo or
657
+ rewrites the vendor unit. Long-running Podman services get `unless-stopped`;
658
+ administration jobs do not. Stop/status remain available when boot prerequisites
659
+ are missing, provided the retained backend is accessible. Runtime-only test
660
+ harnesses may select a separate local socket with `OURS_PODMAN_SOCKET`; its
661
+ storage must match native Podman and the selection cannot change afterward.
662
+
663
+ Gateway images read and validate IPv4/IPv6 nameservers from their container at
664
+ startup. Only the resolver placeholder is replaced; nginx variables and existing
665
+ authentication/routes remain intact. UID 101, read-only rootfs, dropped
666
+ capabilities and tmpfs are retained. Setup and start verify authenticated
667
+ upstream requests in addition to liveness.
668
+
669
+ This change is **not yet a fully qualified server-support release**. Debian's
670
+ Podman 5.4.2 with Compose 5.5.1 failed subpath isolation and has incompatible boot
671
+ recovery semantics. Podman 6.1.2 passed the isolated capability probe on native
672
+ Linux amd64; production and prerelease-source builds, service lifecycle, rebuild and scoped maintenance also passed. See [validation evidence](ROOTLESS_PODMAN_VALIDATION.md). The full public installer/maintenance matrix,
673
+ SELinux Enforcing, logout/reboot, explicit-stop recovery, and Docker regression
674
+ matrix must all be recorded before declaring a supported engine/provider pair.
675
+ The supplied ARM VM results are historical feasibility evidence, not this
676
+ release's qualification.
677
+
678
+ Opt-in gateway fixture (isolated project, only owned resources removed):
679
+
680
+ ```sh
681
+ OURS_TEST_DOCKER=1 node --test test/gateway-docker.test.mjs
682
+ PODMAN_COMPOSE_PROVIDER=/absolute/path/to/docker-compose \
683
+ OURS_TEST_PODMAN=1 node --test test/gateway-docker.test.mjs
684
+ ```
685
+
686
+ ## Account workspace enrollment (task build)
687
+
688
+ The unmerged account onboarding feature requires matching reviewed installer,
689
+ Fleet and Messenger task builds. Do not advertise it as available in `@latest`.
690
+ Use an owned private directory and a 0600 downloaded payload:
691
+
692
+ ```sh
693
+ node /absolute/task-ours-network/packages/installer/install.mjs \
694
+ --setup-workspace-file /absolute/private/workspace.payload \
695
+ --workspace-fleet-bin /absolute/task-ours-fleet/dist/cli.js \
696
+ --sources /absolute/private/task-sources.json
697
+ ```
698
+
699
+ The wrapper defaults fresh hosts to the full Docker stack and retains existing
700
+ Human roots through the installed SDK with exact instance/private credential
701
+ selection. For an existing supported gateway add `--scope client --config` with
702
+ its private profile. It clears competing inherited daemon selectors before Fleet
703
+ initialization and enrollment; it never copies a browser device bearer to the
704
+ account server. A private stdin payload is also accepted by `--setup-workspace -`.
705
+ Encoding is not encryption; command arguments can enter history/process listings.
706
+ Cloudflare management tokens are forbidden in these payloads.
707
+
708
+ Docker and `cloudflared` are required for the fresh workflow. Supply a complete
709
+ `--fleet-settings` JSON for noninteractive Fleet initialization, or answer its
710
+ terminal prompts. Dry-run never initializes or enrolls Fleet. Read the matching
711
+ ours-app `server/DEPLOYMENT.md` for exact task source-policy generation, external
712
+ Google/Cloudflare prerequisites and account-server setup. On uncertain enrollment
713
+ check account status before requesting a new payload; do not reset identities or
714
+ replay a consumed invitation.
715
+
716
+ Workspace setup accepts exactly https://app.ours.network and the controlled test
717
+ account origin https://app.ours-tunnel.com. To move an existing same workspace to
718
+ the other origin, obtain a fresh payload from the moved account server and add
719
+ `--workspace-migrate-app-origin`. Fleet verifies the signed binding receipt before
720
+ changing local origin trust, preserves identities/config/device records, and
721
+ restarts the runtime. An implicit origin change is rejected. Browser account
722
+ cookies/device IndexedDB must be linked anew on the new origin. See the app
723
+ server/DEPLOYMENT.md switching procedure.
724
+
725
+ Workspace setup automatically reuses the saved managed gateway profile (or explicit `--config`/`OURS_CONFIG`), including a host with a non-default server state directory. It does not reinstall server/client state, create a root, or initialize an existing Fleet configuration. It requires Fleet capability `workspace.enroll.preserve-profile-v1` and passes `--preserve-profile`; Fleet requires the matching Messenger capability before posting signed enrollment. Hosts running older Messenger must first update that host service through its supported installer lifecycle; this wrapper never guesses or replaces its server directory. After Owner releases Messenger/Fleet/installer, app bootstrap pins must be updated before removing the preview guard.
726
+
727
+ ### Private-context Docker script permissions
728
+
729
+ Fresh image builds explicitly make non-secret maintenance/runtime scripts readable by the container user even when the host build context was copied under umask077. Host scripts, selected source policy and state retain their private permissions.
730
+
731
+ For a pending installation using an older image, run the corrected installer against the same pending workspace. It recognizes older shipped script COPY instructions combined with private host script modes, updates those image COPY modes and rebuilds the daemon image from the retained source selection. It leaves host data and enrollment state intact and qualifies the rebuilt image before preparing services. A private retry marker retains the rebuild requirement after interruption; it is removed only after verification succeeds. This rebuild resolves third-party transitive dependencies using the existing testing-delivery rules; selected Ours versions and integrity remain release-checked. It is not a byte-identical image permission-layer repair.
732
+
733
+ Fresh server setup checks its loopback daemon, Cowork and Messenger ports before
734
+ writing the installation configuration. Occupied implicit defaults advance to a
735
+ free port, skipping reserved sibling ports; the selected values are saved in the
736
+ installation record and used by native/container services, gateway and client
737
+ profile generation. An explicitly requested occupied port fails with a diagnostic.
738
+ Existing installation records keep their ports and identities. A listener acquired
739
+ by another process after preflight still causes startup to fail safely; no foreign
740
+ process is stopped and no retained installation is silently moved.
741
+
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
+
744
+ ### App tunnel setup prerelease sequencing
745
+
746
+ The simplified App flow shows one copyable `ours-fleet setup-tunnel <encoded-v2-grant>`
747
+ command for the installed host, including an SSH session on a VPS. Its argument
748
+ contains only the existing v2 single-use grant (`version`, `appOrigin`, `code`,
749
+ `expiresAt`), never a connector token or broad provider credential. The command can
750
+ appear in shell history and process listings: keep it private and remove it from
751
+ history after use. Base64 is encoding, not encryption. Server-side expiry and
752
+ one-time redemption remain enforced. Fleet checks prerequisites before HTTPS POST
753
+ redemption; it never prints the grant or puts it in a URL, and retains existing
754
+ signed-root binding and scoped connector token-file controls. It prints the QR and
755
+ connection code automatically; the App checks readiness and opens the code field.
756
+ Private `--file`/`--stdin` transports remain optional and are the only transports
757
+ for legacy v1 payloads with long-lived credentials.
758
+
759
+ The nightly installer release manifest selects published Fleet `1.2.0-nightly.67`
760
+ and its actual registry integrity through the normal release manifest/source-policy
761
+ generators. This release includes v2 argument and private-input support. The former
762
+ nightly.41 selection predates this capability. Merge and publish the repinned
763
+ installer before deploying the App; the pin change alone is not an installer
764
+ publication. Existing v1 private-file enrollment remains compatible. The legacy
765
+ App wrapper refuses an older Fleet before reading or redeeming its grant.
766
+
767
+ The notification gateway permits daemon-authenticated producer selection only on
768
+ POST `/api/v1/send` and `/api/v1/delete-target`. The latter retires a removed
769
+ conversation using the credential's fixed user/source scope. Browser inbox
770
+ `/api/v1/delete` continues to require the user credential. The notification
771
+ service must support the scoped lifecycle route; this change does not repin or
772
+ publish an installer release.
773
+
774
+ ## Boot and failure recovery
775
+
776
+ Docker long-running daemon, Telegram, Cowork, Messenger/Notifications and gateway
777
+ containers use `unless-stopped`. They resume when the selected Docker Engine
778
+ starts, and Docker restarts a failed container with its built-in backoff. A manual
779
+ `docker stop`, `ours-install server stop`, or uninstall stays stopped across
780
+ Engine restarts. Administrative/maintenance jobs have no automatic restart.
781
+ Docker health status alone does not restart a container.
782
+
783
+ The four application containers also supervise their locked entrypoints. After
784
+ 90 seconds of startup grace, probes run every 5 seconds with a 15-second timeout.
785
+ Three consecutive local health failures or a child exit stop its entire process
786
+ group (TERM, then KILL within 20 seconds) before restarting. Cowork's detached
787
+ workers carry an explicit supervisor-PID marker; recovery also kills those
788
+ owned groups and waits for them to stop before launching a replacement. Each container start
789
+ allows three automatic child recovery attempts. Exhaustion leaves the container
790
+ running but unhealthy, with its children stopped and a diagnostic in its logs.
791
+ Correct the cause and use `ours-install server restart --state-dir PATH` to
792
+ reset that circuit; `server start` alone does not reset a running circuit holder.
793
+ Consumers wait for authenticated readiness of their pinned daemon instance and
794
+ do not spend their recovery budget on a daemon outage. The gateway uses Docker
795
+ process recovery only; a gateway hang requires operator restart.
796
+
797
+ Re-run `server install` to deliver recovery to an existing installation without
798
+ changing its retained exact packages, identity, credentials, volumes or config.
799
+ This explicit install starts its selected services, as before. `server update`
800
+ with reviewed storage compatibility delivers the new selected release and
801
+ restores only previously running services. Retained runtime scripts are refreshed
802
+ and rebuilt on install; an interrupted refresh retains a rebuild marker. The
803
+ restart policy overlay also covers retained Compose files. Reconciliation updates
804
+ only this project's recorded long-running containers and does not start or
805
+ recreate a deliberately stopped container. `server start` can reconcile policies
806
+ but does not retrofit health supervision into an old image: run install/update.
807
+ Backup, migration and update still stop writers before maintenance, and a failed
808
+ maintenance operation keeps them stopped. `server uninstall` (also `ours-uninstall --state-dir PATH` for a managed
809
+ schema-2 installation) stops and removes managed services, retaining volumes,
810
+ identity and credentials. It refuses unfinished transitions and data purge.
811
+ Recovery introduces no host watchdog or service.
812
+
813
+ Host boot is a separate prerequisite. On Linux, enable the selected Docker
814
+ Engine system service; rootless Docker additionally needs its user service and
815
+ user linger. The installer reports read-only boot diagnostics and does not enable
816
+ or restart host services. It reads the persistent `docker.service` unit-file
817
+ state, not whether Docker is running now: when Docker is running but not enabled,
818
+ it says that ours components depending on Docker will not start automatically
819
+ after a reboot and prints the optional command (`sudo systemctl enable
820
+ docker.service`, or `systemctl --user enable docker.service` plus
821
+ `sudo loginctl enable-linger USER` for rootless Docker). A masked unit, or a host
822
+ not booted with systemd or with no `docker.service` (WSL with Docker Desktop integration, snap,
823
+ OpenRC and similar), gets the same warning without a systemctl command. A reachable remote Engine or Docker Desktop context
824
+ cannot prove boot recovery on this machine. A custom Unix socket also has an
825
+ unverified boot-service binding; a host unit cannot establish its startup. On macOS/Windows with WSL, enable Docker
826
+ Desktop startup at sign-in; this does not provide pre-login startup. Rootless
827
+ Podman's existing enabled socket/restart-service and linger preflight remains.
828
+ Native package mode retains its package-owned systemd user/launchd services:
829
+ Linux needs user linger for pre-login startup, macOS needs a GUI login session,
830
+ and native hung-process recovery is not supplied by this Docker supervisor.
831
+ Fleet stays on the host with Fleet-owned lifecycle and crash protection. Installing
832
+ the exact Fleet nightly binary does not upgrade or restart an existing supervisor.
833
+ The published no-policy core delivery is a verified recovery omission that
834
+ reproduces the reported symptom. The original incident cause remains unconfirmed:
835
+ actual host Engine availability, installed policies and pre-reboot stopped state
836
+ still require Owner confirmation.