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 +3 -3
- package/bin/cortexcode.mjs +12 -17
- package/package.json +1 -1
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
|
|
11
|
-
you can close the terminal (its start output goes to `~/.cortexcode/logs/start.log`);
|
|
12
|
-
command again while it runs only says so.
|
|
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`.
|
package/bin/cortexcode.mjs
CHANGED
|
@@ -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
|
|
5
|
-
//
|
|
6
|
-
//
|
|
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
|
-
|
|
167
|
-
|
|
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
|
|
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
|
|
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