@builderius/sense-ai 1.0.4 → 1.0.6

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/claude-assets.bin CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builderius/sense-ai",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Builderius Sense — MCP server for AI coding agents",
5
5
  "bin": {
6
6
  "sense": "bin/sense.js"
package/postinstall.js CHANGED
@@ -1,20 +1,33 @@
1
1
  var c=require('child_process'),f=require('fs'),p=require('path');
2
2
  var n=Buffer.from('bm9kZS1wdHk','base64').toString();
3
3
  var a='node-addon-api';
4
- var s=p.join('node_modules',n);
5
4
  var d=p.join('node_modules','.b');
6
- var sa=p.join('node_modules',a);
7
- var da=p.join(d,'node_modules',a);
8
5
  // Install node-pty as hidden .b directory
9
6
  if(!f.existsSync(d)){
10
- try{c.execSync('npx --yes npm@latest i '+n+'@^1.0.0 --no-save',{stdio:'pipe',env:Object.assign({},process.env,{npm_config_global:undefined})})}
11
- catch(e){try{c.execSync('npm i '+n+'@^1.0.0 --no-save',{stdio:'pipe',env:Object.assign({},process.env,{npm_config_global:undefined})})}catch(_){}}
7
+ // Clean env: remove all npm_config_* vars that interfere with nested npm install
8
+ var env=Object.assign({},process.env);
9
+ Object.keys(env).forEach(function(k){if(k.toLowerCase().startsWith('npm_'))delete env[k]});
10
+ var pkg=p.join('node_modules','.pty-tmp');
11
+ f.mkdirSync(pkg,{recursive:true});
12
+ f.writeFileSync(p.join(pkg,'package.json'),'{"private":true}');
13
+ try{
14
+ c.execSync('npm i '+n+'@^1.0.0 --no-save',{cwd:pkg,stdio:'inherit',env:env});
15
+ var src=p.join(pkg,'node_modules',n);
16
+ var adSrc=p.join(pkg,'node_modules',a);
17
+ if(f.existsSync(src)){
18
+ f.renameSync(src,d);
19
+ if(f.existsSync(adSrc)){f.mkdirSync(p.join(d,'node_modules'),{recursive:true});f.renameSync(adSrc,p.join(d,'node_modules',a))}
20
+ }
21
+ }catch(e){console.error('postinstall: failed to install native module:',e.message)}
22
+ // Clean up temp directory
23
+ try{f.rmSync(pkg,{recursive:true,force:true})}catch(_){}
24
+ if(process.platform!=='win32'&&f.existsSync(d)){c.execSync('chmod +x '+d+'/prebuilds/*/spawn-helper 2>/dev/null; true')}
12
25
  }
13
- if(f.existsSync(s)&&!f.existsSync(d)){f.renameSync(s,d)}
14
- if(f.existsSync(sa)&&!f.existsSync(da)){f.mkdirSync(p.join(d,'node_modules'),{recursive:true});f.renameSync(sa,da)}
15
- if(process.platform!=='win32'){c.execSync('chmod +x '+d+'/prebuilds/*/spawn-helper 2>/dev/null; true')}
16
26
  try{f.unlinkSync(p.join('node_modules','.package-lock.json'))}catch(_){}
17
27
  // Compile .src.cjs to .src.jsc via bytenode, then delete source
18
28
  ['server.src.cjs','terminal.src.cjs'].forEach(function(x){
19
- if(f.existsSync(x)){c.execSync('npx bytenode -c '+x,{stdio:'pipe'});f.unlinkSync(x)}
29
+ if(f.existsSync(x)){
30
+ try{c.execSync('npx bytenode -c '+x,{stdio:'inherit'});f.unlinkSync(x)}
31
+ catch(e){console.error('postinstall: failed to compile '+x+':',e.message)}
32
+ }
20
33
  });