webhelm 1.0.45 → 1.0.47

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
@@ -42,7 +42,10 @@ The Extension is bundled with the npm Runtime and staged by WebHelm Daemon at `~
42
42
  check (`com.lalalic.webhelm.keepalive`, every 30 seconds) and the npm Runtime
43
43
  updater (`com.lalalic.webhelm.runtime-update`, every hour and at login).
44
44
  The updater checks the npm registry and downloads new releases to a temporary
45
- location without running npm lifecycle scripts. It validates that Runtime and
45
+ location without running npm lifecycle scripts. Each check and installation
46
+ uses an isolated, disposable npm cache rather than a potentially stale npx
47
+ cache. If npm release metadata has not propagated yet, it defers safely and
48
+ retries on the next scheduled check. It validates that Runtime and
46
49
  Extension versions match, stages an immutable copy under
47
50
  `~/.local/share/webhelm/runtime-VERSION`, and uses the stable
48
51
  `~/.local/share/webhelm/runtime-current` symlink for subsequent launches.
@@ -73,6 +76,13 @@ this release to register the updater LaunchAgent. The setup and updater also
73
76
  migrate only legacy global CLI symlinks that target an owned immutable
74
77
  `runtime-VERSION/bin/webhelm.mjs` into the stable Runtime link.
75
78
 
79
+ ChatGPT long-turn transport preserves a leading `<top-instructions>` block
80
+ and its `Neo model request: resp_...` ID in the visible composer when the
81
+ complete message must be attached as `prompt.md` (>2,000 characters). This
82
+ avoids hiding the model reporting contract in an unread attachment. The
83
+ original full message is still attached exactly, and ordinary long prompts
84
+ retain the existing short `Read prompt.md` composer text.
85
+
76
86
  ## WebHelm Chrome Extension control panel
77
87
 
78
88
  The daemon-managed Chrome Extension is installed from the npm Runtime and does not require the Chrome Web Store. Click the WebHelm toolbar icon to see daemon connectivity, each configured workspace's available capacity and current Session count. The toolbar badge shows the number of **active daemon Sessions** across all workspaces (including `0` when idle). `!` means the daemon heartbeat is stale and `?` means the Session count is unknown. The popup separately shows pool availability and idle tabs.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webhelm",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "description": "Agent browser automation in a visible managed Chrome with persistent JavaScript sessions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,17 +20,24 @@ export function compareVersions(a,b) {
20
20
  return 0;
21
21
  }
22
22
 
23
- export function npmLatest() {
24
- const value=execFileSync('npm',['view','webhelm','version','--json',`--registry=${REGISTRY}`,'--fetch-retries=0','--fetch-timeout=8000'],
25
- {encoding:'utf8',timeout:15000,stdio:['ignore','pipe','pipe']});
26
- const version=JSON.parse(value);
27
- compareVersions(version,version);
28
- return version;
23
+ // The Skill launcher may use a persistent npx cache with a stale packument.
24
+ // New versions can appear in npm view yet still fail ETARGET at npm install.
25
+ // Always query via an isolated, disposable npm cache.
26
+ export function npmLatest({run=execFileSync}={}) {
27
+ const cache=fs.mkdtempSync(path.join(os.tmpdir(),'webhelm-npm-metadata-'));
28
+ try{
29
+ const value=run('npm',['view','webhelm','version','--json','--registry='+REGISTRY,
30
+ '--cache='+cache,'--prefer-online','--fetch-retries=0','--fetch-timeout=8000'],
31
+ {encoding:'utf8',timeout:15000,stdio:['ignore','pipe','pipe']});
32
+ const version=JSON.parse(value);
33
+ compareVersions(version,version);
34
+ return version;
35
+ }finally{fs.rmSync(cache,{recursive:true,force:true});}
29
36
  }
30
37
 
31
38
  // npm installs into an isolated temporary prefix; lifecycle scripts never run.
32
39
  // The existing offline staging contract (Runtime + yaml) remains unchanged.
33
- export function downloadRuntime(version,{home=os.homedir()}={}) {
40
+ export function downloadRuntime(version,{home=os.homedir(),run=execFileSync}={}) {
34
41
  compareVersions(version,version);
35
42
  const cached=path.join(home,'.local/share/webhelm',`runtime-${version}`);
36
43
  try {
@@ -43,9 +50,10 @@ export function downloadRuntime(version,{home=os.homedir()}={}) {
43
50
  }catch{}
44
51
  const temp=fs.mkdtempSync(path.join(os.tmpdir(),'webhelm-npm-upgrade-'));
45
52
  try {
46
- execFileSync('npm',['install','--prefix',temp,'--no-save','--omit=dev','--ignore-scripts',
53
+ run('npm',['install','--prefix',temp,'--no-save','--omit=dev','--ignore-scripts',
47
54
  '--no-audit','--no-fund','--package-lock=false','--fetch-retries=0',
48
- `--registry=${REGISTRY}`,`webhelm@${version}`],
55
+ '--registry='+REGISTRY,'--cache='+path.join(temp,'.npm-cache'),
56
+ '--prefer-online','webhelm@'+version],
49
57
  {timeout:120000,stdio:['ignore','pipe','pipe']});
50
58
  const source=path.join(temp,'node_modules/webhelm');
51
59
  const manifest=JSON.parse(fs.readFileSync(path.join(source,'package.json'),'utf8'));
@@ -129,8 +137,17 @@ export async function upgradeRuntime({home=os.homedir(),source=SOURCE,nodePath=p
129
137
  JSON.parse(fs.readFileSync(path.join(currentTarget,'package.json'),'utf8')).version===target;
130
138
  if(upToDate&&!force)return {status:'current',upgraded:false,version:target,global_cli:migrateLegacyRuntimeCli({home})};
131
139
  // Stage before requesting the daemon to drain; download may take time.
132
- const staged=compareVersions(target,local)>0
133
- ? await download(target,{home}) : stageRuntimeForLoginGuard({home,source});
140
+ let staged;
141
+ try{
142
+ staged=compareVersions(target,local)>0
143
+ ? await download(target,{home}) : stageRuntimeForLoginGuard({home,source});
144
+ }catch(error){
145
+ const cause=String(error.stderr||'')+' '+String(error.message||'');
146
+ if(/\b(?:ETARGET|ENOVERSIONS|E404)\b/.test(cause))
147
+ return {status:'deferred',upgraded:false,reason:'npm_release_not_yet_resolvable',
148
+ latest:target,detail:'npm registry or cache has not propagated the release; retry later'};
149
+ throw error;
150
+ }
134
151
  if(!force && daemon && compareVersions(daemon.version,target)<0){
135
152
  let gate;
136
153
  try{gate=await ipc({op:'upgrade-prepare'});}
@@ -1,8 +1,23 @@
1
1
  export const PROMPT_FILE_THRESHOLD = 2000;
2
2
  export const PROMPT_FILE_MESSAGE = 'Read prompt.md and execute the task in that file.';
3
3
 
4
+ // When a prompt is attached as prompt.md, retain its leading reporting
5
+ // contract in the visible composer. Otherwise ChatGPT may never read the
6
+ // attachment, leaving the caller waiting for chat_report indefinitely.
7
+ export function inlineTopInstructions(message) {
8
+ const open='<top-instructions>', close='</top-instructions>';
9
+ if (!message.startsWith(open)) return null;
10
+ const end=message.indexOf(close,open.length);
11
+ if (end<=open.length||end>1800) return null;
12
+ const header=message.slice(0,end+close.length);
13
+ const next=message.slice(end+close.length,end+close.length+250);
14
+ const responseId=next.match(/Neo model request: resp_[0-9a-f]{40}/)?.[0]||'';
15
+ const preview=header+(responseId?'\n\n'+responseId:'')+'\n\n'+PROMPT_FILE_MESSAGE;
16
+ return preview.length<=PROMPT_FILE_THRESHOLD?preview:null;
17
+ }
4
18
  export function deliveryMessage(message) {
5
- return message.length > PROMPT_FILE_THRESHOLD ? PROMPT_FILE_MESSAGE : message;
19
+ if (message.length<=PROMPT_FILE_THRESHOLD) return message;
20
+ return inlineTopInstructions(message)??PROMPT_FILE_MESSAGE;
6
21
  }
7
22
 
8
23
  export function targetUrl(projectId, threadId, message) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "WebHelm",
4
- "version": "1.0.45",
4
+ "version": "1.0.47",
5
5
  "description": "Own named Chrome tab-group workspaces and lazy reusable tab pools for browser agents.",
6
6
  "permissions": [
7
7
  "storage",