diff --git a/aesel/package.json b/aesel/package.json index 261adfc699..ac9630ba46 100644 --- a/aesel/package.json +++ b/aesel/package.json @@ -1,6 +1,6 @@ { "name": "aesel", - "version": "0.8.5", + "version": "0.8.6", "private": true, "type": "module", "scripts": { diff --git a/aesel/phone/shim/absent.mjs b/aesel/phone/shim/absent.mjs index 49ca7cfa0b..74f2f25e9a 100644 --- a/aesel/phone/shim/absent.mjs +++ b/aesel/phone/shim/absent.mjs @@ -22,3 +22,18 @@ export const networkInterfaces = () => ({}); export const platform = () => "webview"; export default { spawn, execFile, execFileSync, createServer, homedir, tmpdir, platform }; + +// Workspace tools and the MCP client (pro sessions only; the phone never runs +// them) import these at module scope. +export const readFile = async () => absent("readFile")(); +export const writeFile = async () => absent("writeFile")(); +export const mkdir = async () => absent("mkdir")(); +export const rename = async () => absent("rename")(); +export const rm = async () => absent("rm")(); +export const stat = async () => absent("stat")(); +export const readdir = async () => absent("readdir")(); +export const copyFile = async () => absent("copyFile")(); +export const access = async () => absent("access")(); +export const unlink = async () => absent("unlink")(); +export const open = async () => absent("open")(); +export const appendFile = async () => absent("appendFile")(); diff --git a/aesel/web/build.mjs b/aesel/web/build.mjs index 8a5c986c09..760e9118e2 100644 --- a/aesel/web/build.mjs +++ b/aesel/web/build.mjs @@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url'; const root=resolve(dirname(fileURLToPath(import.meta.url)),'../..'); const out=resolve(root,process.argv[2] || 'system/public/aesel/try'); await mkdir(out,{recursive:true}); -const shims={'node:events':'events','node:fs':'fs','node:path':'path','node:url':'url','node:crypto':'crypto','node:os':'absent','node:http':'absent','node:child_process':'absent','node:readline':'absent'}; +const shims={'node:fs/promises':'absent','node:events':'events','node:fs':'fs','node:path':'path','node:url':'url','node:crypto':'crypto','node:os':'absent','node:http':'absent','node:child_process':'absent','node:readline':'absent'}; const guides={}; for(const name of ['pieces.md','screen.md','hand.md','kidlisp.md','api.json']) guides[`/easel/context/${name}`]=await readFile(resolve(root,'aesel/context',name),'utf8'); const result=await build({ @@ -19,7 +19,8 @@ const result=await build({ const name=shims[args.path];if(!name) throw new Error(`Unmapped browser dependency: ${args.path}`); return {path:resolve(root,`aesel/phone/shim/${name}.mjs`)}; }); - b.onResolve({filter:/^\/easel\//},args=>({path:resolve(root,args.path.slice(1))})); + // /easel/ is the phone's URL prefix; the tree on disk is aesel/. + b.onResolve({filter:/^\/easel\//},args=>({path:resolve(root,'aesel',args.path.slice('/easel/'.length))})); b.onResolve({filter:/^\.\/(revisions|preview-frame|jev-advisor)\.mjs$/},args=>({path:resolve(root,'aesel/phone/shim',args.path)})); }}], });