@yanzc/claude-pro 0.11.0 → 0.13.0
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 +56 -36
- package/package.json +1 -1
- package/src/agent.js +4 -3
- package/src/browser/session.js +21 -1
- package/src/commands.js +198 -33
- package/src/config.js +17 -2
- package/src/gateway.js +33 -0
- package/src/live.js +148 -0
- package/src/main.js +5 -3
- package/src/peers.js +41 -4
- package/src/providers.js +25 -6
- package/src/remote.js +82 -268
- package/src/runtime.js +36 -11
- package/src/selfcheck.js +3 -3
- package/src/session.js +128 -8
- package/src/supervisor.js +1 -1
- package/src/tools/bash.js +21 -12
- package/src/tools/browser.js +14 -8
- package/src/tools/code.js +18 -11
- package/src/tools/restart.js +1 -1
- package/src/ui/dialogs.js +23 -30
- package/src/ui/editor.js +65 -169
- package/src/ui/repl.js +467 -474
- package/src/ui/screen.js +47 -674
- package/src/updater.js +5 -4
- package/src/web/api.js +881 -0
- package/src/web/app.css +530 -0
- package/src/web/app.js +2188 -0
- package/src/web/data.js +436 -0
- package/src/web/host.js +332 -0
- package/src/web/login.html +67 -0
- package/src/web/logo.svg +1 -0
- package/src/web/page.html +44 -0
- package/src/web/remote-access.js +232 -0
- package/src/web/server.js +476 -0
package/src/updater.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Manual update support for `npm i -g claude-pro`: the interactive session checks npm and installs a release only
|
|
2
|
-
// when `/update` asks for it
|
|
2
|
+
// when `/update` or the web console's update button asks for it. Installation is serialized by a lock file and the session loads
|
|
3
3
|
// the new package with a restart (the conversation carries over). A git checkout (the development copy) is never
|
|
4
4
|
// touched.
|
|
5
5
|
|
|
@@ -100,19 +100,20 @@ function runNpm(args, { timeoutMs = 300_000 } = {}) {
|
|
|
100
100
|
|
|
101
101
|
// Look for a newer version on npm. Resolves with {status: 'dev'|'current'|'available'|'installed', version}:
|
|
102
102
|
// 'available' to be installed (installUpdate), 'installed' when it is on disk already (another session installed
|
|
103
|
-
// it: a restart loads it).
|
|
104
|
-
// /update is the only caller.)
|
|
103
|
+
// it: a restart loads it). Checking does not install anything.
|
|
105
104
|
export async function checkForUpdate() {
|
|
106
105
|
if (!installedByNpm()) return { status: 'dev' };
|
|
106
|
+
const disk = installedVersion();
|
|
107
|
+
if (isNewer(disk, VERSION)) return { status: 'installed', version: disk };
|
|
107
108
|
const latest = await latestVersion();
|
|
108
109
|
if (!isNewer(latest, VERSION)) return { status: 'current', version: latest };
|
|
109
|
-
if (!isNewer(latest, installedVersion())) return { status: 'installed', version: installedVersion() };
|
|
110
110
|
return { status: 'available', version: latest };
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// Install `version` with npm. Resolves with {status: 'updated'|'installed'|'locked'|'failed', version, error}:
|
|
114
114
|
// 'locked' while another session of the machine is installing.
|
|
115
115
|
export async function installUpdate(version) {
|
|
116
|
+
if (!/^\d+\.\d+\.\d+$/.test(String(version))) return { status: 'failed', error: 'invalid npm version' };
|
|
116
117
|
if (!takeLock()) return { status: 'locked', version };
|
|
117
118
|
try {
|
|
118
119
|
if (!isNewer(version, installedVersion())) return { status: 'installed', version: installedVersion() };
|