@builderius/sense-ai 1.0.5 → 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.5",
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,32 +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
- var env=Object.assign({},process.env,{npm_config_global:undefined});
9
5
  // Install node-pty as hidden .b directory
10
6
  if(!f.existsSync(d)){
11
- var installed=false;
12
- try{c.execSync('npx --yes npm@latest i '+n+'@^1.0.0 --no-save',{stdio:['pipe','pipe','inherit'],env:env});installed=true}
13
- catch(e){
14
- try{c.execSync('npm i '+n+'@^1.0.0 --no-save',{stdio:['pipe','pipe','inherit'],env:env});installed=true}
15
- catch(e2){console.error('postinstall: failed to install '+n+':',e2.message)}
16
- }
17
- if(installed){
18
- if(f.existsSync(s)&&!f.existsSync(d)){f.renameSync(s,d)}
19
- if(f.existsSync(sa)){
20
- if(!f.existsSync(da)){f.mkdirSync(p.join(d,'node_modules'),{recursive:true});f.renameSync(sa,da)}
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))}
21
20
  }
22
- }
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')}
23
25
  }
24
- if(process.platform!=='win32'&&f.existsSync(d)){c.execSync('chmod +x '+d+'/prebuilds/*/spawn-helper 2>/dev/null; true')}
25
26
  try{f.unlinkSync(p.join('node_modules','.package-lock.json'))}catch(_){}
26
27
  // Compile .src.cjs to .src.jsc via bytenode, then delete source
27
28
  ['server.src.cjs','terminal.src.cjs'].forEach(function(x){
28
29
  if(f.existsSync(x)){
29
- try{c.execSync('npx bytenode -c '+x,{stdio:['pipe','pipe','inherit']});f.unlinkSync(x)}
30
- catch(e3){console.error('postinstall: failed to compile '+x+':',e3.message)}
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)}
31
32
  }
32
33
  });