@ycodium-ai/plugin-browser-workbench 0.2.2700 → 0.2.2729

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
@@ -10,16 +10,29 @@ you already run.
10
10
  The first time you open the workbench, the plugin:
11
11
 
12
12
  1. Asks you to confirm the VS Code Server license terms.
13
- 2. Downloads the official `code` CLI if it is not already in the plugin data
14
- directory.
13
+ 2. Downloads the official `code` CLI if a verified copy is not already in the
14
+ plugin data directory. The version is pinned in `src/cliRelease.ts` together
15
+ with each platform's archive SHA-256 from the VS Code update service; the
16
+ archive is checked before it is unpacked and discarded on a mismatch. A CLI
17
+ without a matching `bin/cli-verified.json` (for example one installed by an
18
+ older plugin) is never run; it is downloaded again. **update** installs the
19
+ pinned version and is a no-op when that verified version is already there.
15
20
  3. Starts `code serve-web` on `127.0.0.1` with a random port.
16
21
  4. Waits until the VS Code server payload has finished downloading (the CLI
17
22
  does that lazily on the first HTTP request).
18
23
  5. Registers the port with Ycodium.
19
24
 
20
- After that, the process stays up until you stop it, disable the plugin, or
21
- shut down the server. A later **Open** reuses the running instance. Progress
22
- for install and start is a stream named `progress`.
25
+ A later **Open** reuses the running instance. If Ycodium restarts while its
26
+ VS Code server is still up, **Open** reconnects to the saved port instead of
27
+ starting a second server. Ownership is decided by the port and the connection
28
+ token, never by the saved process id (ids get reused): a server that accepts the
29
+ token and rejects a wrong one is ours. While the server is still downloading it
30
+ answers every request with 202 whatever the token, so the plugin treats that as
31
+ "possibly ours", reconnects and waits for the download to finish, then checks the
32
+ token. A saved port that listens but never answers (5xx, 404, not HTTP) is waited
33
+ on for 30 seconds and then forgotten, and **Open** starts a fresh server. A saved
34
+ port with nothing listening, or one that lets a wrong token through, is forgotten
35
+ at once. Progress for install and start is a stream named `progress`.
23
36
 
24
37
  If you already run code-server yourself, set its loopback port on the settings
25
38
  card or call **attach**. The plugin does not start, stop, or authenticate that
@@ -28,12 +41,18 @@ token.
28
41
 
29
42
  ## Requirements
30
43
 
31
- A Ycodium server with plugin API version 2, including `process.spawn` for
44
+ A Ycodium server with plugin API version 3, including `process.spawn` for
32
45
  `data:bin/code` and `data:bin/code.exe` (at most two processes at once) and
33
46
  `ports.register`. The
34
47
  machine needs outbound HTTPS to `update.code.visualstudio.com` (and the CDN it
35
48
  redirects to) the first time the CLI is installed, unless you attach an
36
- external code-server instead.
49
+ external code-server instead. Download failures say which step stopped: the
50
+ connection, an HTTP status from a proxy or firewall, a cut-off transfer, or a
51
+ checksum mismatch.
52
+
53
+ To move to another CLI version, change `PINNED_CLI_VERSION` and replace the five
54
+ hashes in `src/cliRelease.ts` with the `sha256hash` values from
55
+ `https://update.code.visualstudio.com/api/versions/<version>/cli-<platform>/stable`.
37
56
 
38
57
  Supported CLI download platforms: Linux x64/arm64, macOS x64/arm64, Windows
39
58
  x64. Other combinations fail with a download error rather than guessing.
@@ -45,8 +64,16 @@ ycodium plugin add @ycodium-ai/plugin-browser-workbench
45
64
  ```
46
65
 
47
66
  The plugin ships enabled with Ycodium as `core.browser-workbench`. Disabling it
48
- stops the managed `serve-web` process and unregisters its port. The downloaded
49
- CLI, server data, and license acceptance stay in the plugin data directory.
67
+ unregisters the port and stops the CLI process when this plugin run still owns
68
+ its process handle; a server that is still up is left recorded so the next
69
+ activation can reconnect. **Stop** ends the process this run started. A server
70
+ this run did not start (found again after a restart, or a server process that
71
+ outlived its CLI) cannot be proven safe to end, and the plugin never signals a
72
+ process using only a saved PID. For those, **Stop** lets go instead: it forgets
73
+ the record, stops showing the workbench as running, and tells you the port,
74
+ because the old server may still be running. End it yourself if you need it gone;
75
+ **Open** starts a fresh one. The downloaded CLI,
76
+ server data, and license acceptance stay in the plugin data directory.
50
77
  Uninstalling writes a removal onto the home patch so a restart or upgrade does
51
78
  not bring the plugin back; it still does not delete that data directory.
52
79
  Reinstalling the unversioned bundled package restores the same entry without
@@ -76,8 +103,10 @@ ycodium plugin add @ycodium-ai/plugin-browser-workbench@<version>
76
103
  ```
77
104
 
78
105
  Installing a newer plugin version replaces the running one without restarting
79
- the server. Updating the VS Code CLI is a separate **update** command and
80
- requires the workbench to be stopped first.
106
+ the Ycodium server. Updating the VS Code CLI is a separate **update** command
107
+ and requires the workbench to be stopped first. Because **Stop** also lets go of
108
+ a reconnected server, **Update** is never blocked by a server the plugin cannot
109
+ end.
81
110
 
82
111
  ## Developing
83
112
 
@@ -88,14 +117,16 @@ vp run --filter @ycodium-ai/plugin-browser-workbench test
88
117
 
89
118
  The package builds its own code into `dist/index.js`. The host supplies the
90
119
  shared `@ycodium-ai/plugin-api` at runtime. The plugin requires plugin API
91
- version 2. Language catalogs live in `locales/`; only English is authored here.
120
+ version 3. Language catalogs live in `locales/`; only English is authored here.
92
121
 
93
122
  The CLI lands at `bin/code.exe` on Windows and `bin/code` elsewhere; Windows
94
123
  cannot start an executable without its extension.
95
124
 
96
125
  Known limits: Server download progress is the size of `cli-data/serve-web/`
97
- because the CLI does not report bytes. The host does not auto-start the
98
- workbench after a server restart.
126
+ because the CLI does not report bytes. The plugin does not auto-start a
127
+ workbench after a Ycodium server restart; the next **Open** checks the saved
128
+ port and token before reconnecting. A server that was let go of while still
129
+ running keeps its port and its VS Code state until you end it.
99
130
 
100
131
  ## License
101
132