kylon-cli 0.3.9 → 0.3.10-next.696

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 CHANGED
@@ -67,16 +67,20 @@ hosted install script in `~/.kylon/server-url`, then production.
67
67
  `agent link` authenticates only the link operation with its embedded
68
68
  credential; it never creates a human CLI session. Linking mints or reuses an
69
69
  installation credential stored locally with mode `0600` and starts the local
70
- agent runtime. In release builds on supported environments a user-level
71
- `launchd` / `systemd --user` service is installed so the daemon survives
72
- terminal exit, reboot, and sleep/wake; otherwise the daemon runs in the
73
- foreground until `Ctrl+C`.
70
+ agent runtime. In release builds a user-level service is installed so the
71
+ daemon survives terminal exit, reboot, and sleep/wake: `launchd` on macOS,
72
+ `systemd --user` on Linux, and on Windows a logon-triggered Scheduled Task
73
+ named `Kylon Gateway` that runs `kylon gateway supervise`, a small loop that
74
+ restarts `gateway run` after a crash and after a drained upgrade. When no
75
+ service can be installed (a source build, or a Windows machine whose policy
76
+ blocks scheduled tasks) the daemon runs in the foreground until `Ctrl+C`, and
77
+ `connect` says so.
74
78
 
75
79
  The dist-tag tracks the environment: production uses `@latest`, dev uses
76
80
  `@next` (newest prerelease). To pin a specific build, use `kylon-cli@X.Y.Z`.
77
81
 
78
- Requirements: Linux / macOS only (Windows operators should use WSL). The
79
- hosted script needs no preinstalled Node.js; the `npx` spellings need
82
+ Requirements: macOS, Linux, or Windows. The hosted `install.sh` needs no
83
+ preinstalled Node.js; the Windows `install.ps1` and the `npx` spellings need
80
84
  Node.js 22.15.0+ (npm ships with Node).
81
85
 
82
86
  ### One managed `kylon` for humans and agents
@@ -117,20 +121,50 @@ The setting controls future automatic requests only. Turning it off does not
117
121
  cancel an upgrade whose drain has already started, and manual upgrades remain
118
122
  available.
119
123
 
120
- To upgrade manually:
124
+ To update manually, rerun the hosted install script — the same command that
125
+ installed Kylon:
121
126
 
122
127
  ```bash
123
- npx --yes kylon-cli@latest gateway service upgrade
128
+ curl -fsSL https://api.kylon.io/install.sh | sh
129
+ ```
130
+
131
+ (`https://api.purework.ai/install.sh` on dev; Windows:
132
+ `powershell -c "irm https://api.kylon.io/install.ps1 | iex"`.) On a machine
133
+ that already has Kylon the script never overwrites the managed bundle. It
134
+ repairs the environment around it — a vanished Node.js gets the private
135
+ runtime, the launcher and PATH snippet are rewritten, the serving deployment
136
+ is re-recorded — and then asks the installed CLI to update itself with
137
+ `kylon upgrade`. This is the command the CLI's update notice, `kylon gateway
138
+ status`, the unknown-command hint, and the workspace's update surfaces all
139
+ print; each spells it for the deployment the machine was set up against.
140
+
141
+ `kylon upgrade` is the engine underneath the script, and can be run on its
142
+ own when the environment is known to be healthy. It resolves the newest build
143
+ on the channel this installation tracks (`latest` in production, `next` on
144
+ dev), compares it with the **installed** bundle's recorded version, and picks
145
+ the owner for the host's layout: on a gateway host the drained service
146
+ upgrade described below, on a credential-only host the daemon-guarded
147
+ self-pin, and on a host with only an npm global the `npm install -g` hint
148
+ (that copy stays the operator's own). When it is already the resolved target
149
+ — `npx --yes kylon-cli@latest upgrade` runs the newest copy — it installs
150
+ in-process rather than downloading itself a second time. `--force` skips the
151
+ drain (see the interrupts below).
152
+
153
+ The mechanism underneath is `gateway service upgrade`:
154
+
155
+ ```bash
156
+ npx --yes kylon-cli@<exact version> gateway service upgrade
124
157
  ```
125
158
 
126
- (`@next` on dev.) The daemon and the pinned agent `kylon` both run the
127
- installed bundle under `~/.kylon/bin`, which only this command (or a fresh
128
- `agent link`) refreshes: the freshly-resolved CLI installs its own bundle and
129
- drain-restarts the running daemon onto it, moving both in lockstep.
130
- `npm install -g` alone updates the operator's terminal binary and leaves the
131
- runtime service on the old build. The update notice the CLI prints for local
132
- runtimes uses exactly this command; `kylon gateway service repair` is the same
133
- reconciliation under its recovery-oriented name.
159
+ It installs the running copy's *own* bundle under `~/.kylon/bin` and
160
+ drain-restarts the daemon onto it, moving the daemon and the pinned agent
161
+ `kylon` in lockstep so it must be run by the target version, which is why
162
+ it is spelled through `npx` with an exact version. Reach for it directly only
163
+ when an exact version matters; the workspace's update notice, the remote
164
+ upgrade button, and automatic updates all resolve to it with the exact version
165
+ they want. `npm install -g` alone updates the operator's terminal binary and
166
+ leaves the runtime service on the old build. `kylon gateway service repair`
167
+ is the same reconciliation under its recovery-oriented name.
134
168
 
135
169
  `repair` goes one step further than `upgrade`: after reconciling the Kylon
136
170
  side it installs any provider CLI this machine's placements need but do not
@@ -152,8 +186,8 @@ The drain waits up to five minutes for in-flight agent work, and a drain that
152
186
  exhausts its window rolls the upgrade back — so a persistently busy host would
153
187
  never upgrade without an operator interrupt. Two are available:
154
188
 
155
- - `kylon gateway service upgrade --force` skips the drain, or escalates one
156
- already in progress: in-flight assignments are aborted with the same
189
+ - `kylon upgrade --force` (or `kylon gateway service upgrade --force`) skips
190
+ the drain, or escalates one already in progress: in-flight assignments are aborted with the same
157
191
  recovery semantics as a daemon crash (the durable inbox re-drives
158
192
  interrupted work on the restarted daemon), and the new version activates
159
193
  immediately.
@@ -289,7 +323,8 @@ workspace; sign in again to replace one with the per-installation flow.
289
323
 
290
324
  `gateway run` starts the local runtime service from this environment's saved
291
325
  connection. It is the command the installed `launchd` / `systemd --user`
292
- service execs; run it manually to keep connected agents available in the foreground.
326
+ service execs, and the child the Windows `gateway supervise` loop keeps
327
+ running; run it manually to keep connected agents available in the foreground.
293
328
 
294
329
  ```bash
295
330
  kylon gateway run
@@ -653,7 +688,9 @@ npm dist-tag add kylon-cli@<last-good> latest # move the channel back
653
688
  npm deprecate kylon-cli@<bad> "Broken release — use <last-good>."
654
689
  ```
655
690
 
656
- Operators on `@latest` pick up the re-pointed version the next time they run
657
- `npx --yes kylon-cli@latest gateway service upgrade` (the command the update
658
- notice prints for local runtimes); in-flight daemons keep their current pinned
659
- bundle until that drain-restart. Do not `npm unpublish`.
691
+ Re-pointing the tag stops the bad build from spreading: hosts that have not
692
+ upgraded yet resolve `<last-good>` on their next `kylon upgrade` or automatic
693
+ update. It does not walk a host back that already runs `<bad>` — the install's
694
+ direction guard keeps a newer installed bundle over an older invoked copy, and
695
+ `kylon upgrade` reports such a host as already current — so the way back for
696
+ those hosts is publishing a fixed, higher version. Do not `npm unpublish`.
@@ -0,0 +1,5 @@
1
+ {
2
+ "version": "0.3.10-next.696",
3
+ "fingerprint": "9e15eb570382d949de77ec450b683579429f9d78cacfccac94285036f925ee22",
4
+ "source_commit": "89f378fab1a052a76a902c6054c74a7fe9307d01"
5
+ }