cortexcode 0.1.0 → 0.1.1

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
@@ -7,8 +7,8 @@ npx cortexcode
7
7
  Starts [CortexCode](https://github.com/agentbusiness/CortexCode), a local coding agent. The first
8
8
  run downloads the app for this machine (Apple Silicon Macs; Linux x64 and arm64) from the official
9
9
  releases, checks it against the checksum in the release catalog and unpacks it into `~/.cortexcode/app/`.
10
- Later runs start it at once and fetch a newer app when one is released. The app runs on its own:
11
- you can close the terminal (its start output goes to `~/.cortexcode/logs/start.log`); running the
12
- command again while it runs only says so. Plugin and frame updates come through the app itself.
10
+ Later runs start the installed app at once; the app updates its frame and plugins itself. The app
11
+ runs on its own: you can close the terminal (its start output goes to `~/.cortexcode/logs/start.log`);
12
+ running the command again while it runs only says so.
13
13
 
14
14
  Arguments go to the app: `npx cortexcode --headless`, `npx cortexcode --safe`.
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  // `npx cortexcode`: start CortexCode. The first run downloads the app for this machine from the
3
3
  // official releases (the catalog), checks its checksum and unpacks it into ~/.cortexcode/app/<version>/;
4
- // later runs start it at once and fetch a newer app when the catalog names one. The app runs on its
5
- // own: closing the terminal does not quit it (its start output goes to ~/.cortexcode/logs/start.log).
6
- // Plugin and frame updates come through the app itself. Arguments go to the app (`--headless`, `--safe`).
4
+ // later runs start the installed app at once, without looking at the catalog: the app updates its
5
+ // frame and plugins itself, so a newer app release is only for machines that have none. The app runs
6
+ // on its own: closing the terminal does not quit it (its start output goes to ~/.cortexcode/logs/start.log).
7
+ // Arguments go to the app (`--headless`, `--safe`).
7
8
 
8
9
  import { spawn } from 'node:child_process';
9
10
  import { createHash } from 'node:crypto';
@@ -163,24 +164,18 @@ async function main() {
163
164
  return 0;
164
165
  }
165
166
  const key = platform();
166
- let wanted = null;
167
- try {
168
- const listed = await catalog();
169
- const files = listed.app?.files?.[key];
170
- if (listed.app && files?.archive) wanted = { app: listed.app, asset: files.archive };
171
- else say(`no CortexCode app is released for ${key} yet`);
172
- } catch (error) {
173
- say(`cannot look for a new version (${error.message})`);
174
- }
175
- if (wanted && !installed().includes(wanted.app.version)) {
167
+ // The installed app updates itself (frame and plugins): only a machine without one downloads.
168
+ if (installed().length === 0) {
176
169
  try {
177
- await install(wanted.app, wanted.asset);
170
+ const listed = await catalog();
171
+ const files = listed.app?.files?.[key];
172
+ if (listed.app && files?.archive) await install(listed.app, files.archive);
173
+ else say(`no CortexCode app is released for ${key} yet`);
178
174
  } catch (error) {
179
- say(error.message);
175
+ say(`cannot download CortexCode (${error.message})`);
180
176
  }
181
177
  }
182
- const versions = installed();
183
- const chosen = wanted && versions.includes(wanted.app.version) ? wanted.app.version : versions[0];
178
+ const chosen = installed()[0];
184
179
  if (!chosen) {
185
180
  say('CortexCode is not installed and could not be downloaded');
186
181
  return 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortexcode",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "CortexCode, a local coding agent: npx cortexcode downloads the app for this machine from the official releases and starts it.",
5
5
  "type": "module",
6
6
  "bin": {