webhelm 1.0.43 → 1.0.44
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 -1
- package/package.json +1 -1
- package/runtime/auto-update.mjs +4 -3
- package/runtime/cli.mjs +3 -2
- package/runtime/extension/manifest.json +1 -1
- package/runtime/login-guard.mjs +19 -0
package/README.md
CHANGED
|
@@ -64,7 +64,9 @@ Neo Master uses `WEBHELM_SOURCE_MODE=1` and runs its linked Git checkout, not
|
|
|
64
64
|
a published npm package. Automatic npm updates are deliberately disabled
|
|
65
65
|
there; updating a development checkout is a separate, reviewed Git operation.
|
|
66
66
|
Existing npm installations need to run `webhelm setup` once after receiving
|
|
67
|
-
this release to register the updater LaunchAgent.
|
|
67
|
+
this release to register the updater LaunchAgent. The setup and updater also
|
|
68
|
+
migrate only legacy global CLI symlinks that target an owned immutable
|
|
69
|
+
`runtime-VERSION/bin/webhelm.mjs` into the stable Runtime link.
|
|
68
70
|
|
|
69
71
|
## WebHelm Chrome Extension control panel
|
|
70
72
|
|
package/package.json
CHANGED
package/runtime/auto-update.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import {execFileSync} from 'node:child_process';
|
|
5
5
|
import {fileURLToPath} from 'node:url';
|
|
6
6
|
import {request} from './node-daemon.mjs';
|
|
7
|
-
import {activateRuntime,currentRuntimePath,installLoginGuard,installRuntimeUpdate,stageRuntimeForLoginGuard} from './login-guard.mjs';
|
|
7
|
+
import {activateRuntime,currentRuntimePath,installLoginGuard,installRuntimeUpdate,migrateLegacyRuntimeCli,stageRuntimeForLoginGuard} from './login-guard.mjs';
|
|
8
8
|
|
|
9
9
|
const REGISTRY='https://registry.npmjs.org';
|
|
10
10
|
const SOURCE=fileURLToPath(new URL('../',import.meta.url));
|
|
@@ -100,7 +100,7 @@ export async function upgradeRuntime({home=os.homedir(),source=SOURCE,nodePath=p
|
|
|
100
100
|
const upToDate=daemon?.version===target && currentTarget &&
|
|
101
101
|
fs.existsSync(path.join(currentTarget,'package.json')) &&
|
|
102
102
|
JSON.parse(fs.readFileSync(path.join(currentTarget,'package.json'),'utf8')).version===target;
|
|
103
|
-
if(upToDate)return {status:'current',upgraded:false,version:target};
|
|
103
|
+
if(upToDate)return {status:'current',upgraded:false,version:target,global_cli:migrateLegacyRuntimeCli({home})};
|
|
104
104
|
// Stage before requesting the daemon to drain; download may take time.
|
|
105
105
|
const staged=compareVersions(target,local)>0
|
|
106
106
|
? await download(target,{home}) : stageRuntimeForLoginGuard({home,source});
|
|
@@ -113,6 +113,7 @@ export async function upgradeRuntime({home=os.homedir(),source=SOURCE,nodePath=p
|
|
|
113
113
|
}
|
|
114
114
|
prior=currentTarget;
|
|
115
115
|
activate(staged.path,{home});switched=true;
|
|
116
|
+
const global_cli=migrateLegacyRuntimeCli({home});
|
|
116
117
|
const cliPath=path.join(current,'bin/webhelm.mjs');
|
|
117
118
|
const guard=installGuard({home,cliPath,nodePath,apply});
|
|
118
119
|
const poller=installPoller({home,cliPath,nodePath,apply});
|
|
@@ -136,7 +137,7 @@ export async function upgradeRuntime({home=os.homedir(),source=SOURCE,nodePath=p
|
|
|
136
137
|
const state=await run();
|
|
137
138
|
if(state.version!==target)throw Error(`Cutover verification failed: ${state.version} !== ${target}`);
|
|
138
139
|
return {status:'upgraded',upgraded:true,from:daemon?.version||null,to:target,
|
|
139
|
-
daemon_pid:state.daemon?.pid||null,guard:guard.status,auto_update:poller.status};
|
|
140
|
+
daemon_pid:state.daemon?.pid||null,global_cli,guard:guard.status,auto_update:poller.status};
|
|
140
141
|
}catch(error){
|
|
141
142
|
// Never point new clients at an old Runtime after a committed daemon
|
|
142
143
|
// cutover: the new daemon may already be serving requests.
|
package/runtime/cli.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
7
7
|
import { ensureDaemon, request, SOCKET } from './node-daemon.mjs';
|
|
8
8
|
import { PLATFORMS, listPlatforms, platformProfile, actionPath, validateConfig } from './platforms.mjs';
|
|
9
9
|
import { ACTIONS_DIR, ensureActions, syncActions, publishActions } from './actions-repo.mjs';
|
|
10
|
-
import { activateRuntime, currentRuntimePath, installLoginGuard, installRuntimeUpdate, stageRuntimeForLoginGuard } from './login-guard.mjs';
|
|
10
|
+
import { activateRuntime, currentRuntimePath, installLoginGuard, installRuntimeUpdate, migrateLegacyRuntimeCli, stageRuntimeForLoginGuard } from './login-guard.mjs';
|
|
11
11
|
import { upgradeRuntime } from './auto-update.mjs';
|
|
12
12
|
import { cliHelp } from './cli-help.mjs';
|
|
13
13
|
|
|
@@ -113,9 +113,10 @@ async function main(args = process.argv.slice(2)) {
|
|
|
113
113
|
const cliPath=sourceMode
|
|
114
114
|
? fileURLToPath(new URL('../bin/webhelm.mjs',import.meta.url))
|
|
115
115
|
: path.join(currentRuntimePath(),'bin/webhelm.mjs');
|
|
116
|
+
const global_cli=sourceMode?{status:'source_checkout'}:migrateLegacyRuntimeCli();
|
|
116
117
|
const login_guard=installLoginGuard({cliPath,nodePath:process.execPath,sourceMode});
|
|
117
118
|
const auto_update=installRuntimeUpdate({cliPath,nodePath:process.execPath,sourceMode});
|
|
118
|
-
return emit({status:'ready',...repo,daemon_pid:chrome.pid,managed_chrome:chrome.managed_chrome,login_guard,auto_update});
|
|
119
|
+
return emit({status:'ready',...repo,daemon_pid:chrome.pid,managed_chrome:chrome.managed_chrome,global_cli,login_guard,auto_update});
|
|
119
120
|
}
|
|
120
121
|
if (group === 'upgrade') return emit(await upgradeRuntime());
|
|
121
122
|
if (group === 'ensure') {
|
package/runtime/login-guard.mjs
CHANGED
|
@@ -140,3 +140,22 @@ export function activateRuntime(stagedPath,{home=os.homedir()}={}) {
|
|
|
140
140
|
try{fs.renameSync(temp,current);}finally{if(fs.existsSync(temp))fs.unlinkSync(temp);}
|
|
141
141
|
return {path:current,updated:true};
|
|
142
142
|
}
|
|
143
|
+
|
|
144
|
+
// Pre-updater installations may have pointed ~/.local/bin/webhelm directly
|
|
145
|
+
// at an immutable runtime-VERSION snapshot. Migrate ONLY this owned pattern;
|
|
146
|
+
// preserve Skill launchers, unmanaged binaries and other symlinks.
|
|
147
|
+
export function migrateLegacyRuntimeCli({home=os.homedir()}={}) {
|
|
148
|
+
const link=path.join(home,'.local/bin/webhelm');
|
|
149
|
+
const stable=path.join(currentRuntimePath(home),'bin/webhelm.mjs');
|
|
150
|
+
if(!fs.existsSync(stable))return {status:'skipped',reason:'stable_runtime_missing'};
|
|
151
|
+
try{if(!fs.lstatSync(link).isSymbolicLink())return {status:'preserved',reason:'unmanaged_cli'};}
|
|
152
|
+
catch(error){if(error.code==='ENOENT')return {status:'skipped',reason:'no_existing_cli'};throw error;}
|
|
153
|
+
const resolved=path.resolve(path.dirname(link),fs.readlinkSync(link));
|
|
154
|
+
const relative=path.relative(path.join(home,'.local/share/webhelm'),resolved).split(path.sep).join('/');
|
|
155
|
+
if(!/^runtime-\d+\.\d+\.\d+\/bin\/webhelm\.mjs$/.test(relative))
|
|
156
|
+
return {status:'preserved',reason:'not_a_versioned_runtime_link'};
|
|
157
|
+
const tmp=`${link}.${process.pid}.${Date.now()}.tmp`;
|
|
158
|
+
fs.symlinkSync(stable,tmp);
|
|
159
|
+
try{fs.renameSync(tmp,link);}finally{if(fs.existsSync(tmp))fs.unlinkSync(tmp);}
|
|
160
|
+
return {status:'migrated',path:link,target:stable};
|
|
161
|
+
}
|