@rubytech/create-maxy-lite 0.1.7 → 0.1.9

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/index.mjs CHANGED
@@ -136,9 +136,27 @@ const installDeps = async () => {
136
136
  // built artifact directly to recover the actual dlopen error, and carry THAT into
137
137
  // err= — the true reason (ABI/NODE_MODULE_VERSION/symbol/ELF), not the swallowed miss.
138
138
  if (runIn(ptyLoadCommand()).code !== 0) {
139
+ // proot emits `can't sanitize binding /proc/self/fd/*` lines on every
140
+ // non-interactive login; they are noise that buries the real error. Strip them.
141
+ const clean = (s) =>
142
+ String(s || '')
143
+ .split('\n')
144
+ .filter((l) => !/proot warning: can't sanitize binding/.test(l))
145
+ .join(' ')
146
+ .replace(/\s+/g, ' ')
147
+ .trim()
139
148
  const direct = runIn(ptyDirectLoadCommand())
140
- const cause = direct.stderr.replace(/\s+/g, ' ').trim() || `no stderr; ${PTY_NODE}`
141
- throw new Error(`node-pty native module did not load after build: ${cause}`)
149
+ const cause = clean(direct.stderr) || `no stderr; ${PTY_NODE}`
150
+ // The load error is a libc-link failure (`libc.so: cannot open shared object
151
+ // file`). Capture which libraries pty.node actually needs (ldd) and any leaked
152
+ // Termux linker env (LD_*/LIBRARY_PATH) so the next run names the exact cause
153
+ // and we fix from certainty, not a guess.
154
+ const diag = runIn(
155
+ `ldd ${PTY_NODE} 2>&1; echo '|env:'; env | grep -iE 'LD_PRELOAD|LD_LIBRARY_PATH|LIBRARY_PATH' || echo '(no LD_* env)'`,
156
+ )
157
+ throw new Error(
158
+ `node-pty native module did not load after build: ${cause} || ldd+env: ${clean(diag.stdout + ' ' + diag.stderr)}`,
159
+ )
142
160
  }
143
161
  }
144
162
 
package/lib/paths.mjs CHANGED
@@ -66,12 +66,15 @@ export function ptyDirectLoadCommand({ ptyNode = PTY_NODE } = {}) {
66
66
  * was the divergence from Q2. The toolchain step guarantees python3/make/g++.
67
67
  */
68
68
  export function webchatInstallCommand({ webchatDir = WEBCHAT_DIR } = {}) {
69
- // Reproduce the spike's exact working command (`npm install node-pty` in the
70
- // Ubuntu layer, scripts on) verbatim that built a loadable pty.node. `npm
71
- // install node-pty` also resolves the rest of package.json (ws), so it covers
72
- // the webchat's deps too. The env prefix forces scripts on to match the spike's
73
- // environment regardless of any ambient ignore-scripts in the Ubuntu image.
74
- return `cd ${webchatDir} && npm_config_ignore_scripts=false npm install node-pty`
69
+ // Reproduce the spike's working condition VERBATIM, including its freshness: the
70
+ // spike ran `npm install node-pty` in an EMPTY dir (`mkdir ~/pty`), which forced a
71
+ // real source build of pty.node that loaded. On a re-installed device the webchat
72
+ // node_modules already holds a prior (broken) pty.node, so a plain `npm install`
73
+ // reports "up to date" and rebuilds nothing — leaving the bad binary. So clean
74
+ // node_modules first, then install: that recreates the spike's empty-dir build.
75
+ // `npm install node-pty` also resolves package.json (ws). The env prefix forces
76
+ // scripts on to match the spike's environment regardless of ambient ignore-scripts.
77
+ return `cd ${webchatDir} && rm -rf node_modules package-lock.json && npm_config_ignore_scripts=false npm install node-pty`
75
78
  }
76
79
 
77
80
  // The shipped skills, as bundled into the app dir, and the path the on-device
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/create-maxy-lite",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Install maxy-lite on an Android phone: orchestrates proot-distro Ubuntu, glibc Node, claude, the web-chat relay, the vault and its bind-mount — run via npx in bare Termux.",
5
5
  "type": "module",
6
6
  "engines": {