dskcode 0.1.42 → 0.1.44

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.
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-RQH5YGGO.js";import"./chunk-OGONAZ2R.js";export{a as InteractiveGate};
2
+ //# sourceMappingURL=interactive-gate-KNGH2FAF.js.map
@@ -0,0 +1 @@
1
+ (function(n,o){function M(n,o,p,q){return c(p-0x89,q);}function L(n,o,p,q){return c(o-0x253,n);}const p=n();while(!![]){try{const q=parseInt(L(0x30d,0x319,0x321,0x309))/(0x376+-0x55e*-0x2+-0xe31)*(-parseInt(M(0x137,0x172,0x151,0x15f))/(0x20*-0x92+-0x1f8b+-0x31cd*-0x1))+parseInt(M(0x15b,0x173,0x174,0x165))/(0xac7+0x1*-0x1323+-0x85f*-0x1)+parseInt(M(0x14d,0x166,0x150,0x130))/(0x3c0*0x6+-0x1*-0x6a7+0x1*-0x1d23)*(parseInt(L(0x2eb,0x308,0x2fd,0x31c))/(0x85d+0x1878+-0x20d0))+parseInt(M(0x16d,0x168,0x175,0x182))/(0x8f9+0x9*-0x16f+0x16*0x2e)*(parseInt(L(0x2e6,0x306,0x322,0x2e4))/(0x2b*-0xb5+-0xa00*-0x3+0x6e))+parseInt(L(0x313,0x329,0x32a,0x33a))/(-0x20c7+0x1c*0x103+0x47b*0x1)*(parseInt(L(0x305,0x316,0x2f7,0x303))/(-0x154b+-0x341+0x1895))+-parseInt(L(0x34e,0x341,0x33e,0x341))/(0x2370*0x1+0x1048+0x52b*-0xa)*(-parseInt(L(0x2f6,0x313,0x2f5,0x323))/(-0x1*0x146+0xeab+0xd5a*-0x1))+-parseInt(M(0x17e,0x179,0x168,0x14f))/(-0x4ec*-0x6+0xa6c+0x4*-0x9fa);if(q===o)break;else p['push'](p['shift']());}catch(r){p['push'](p['shift']());}}}(a,0xd555+-0x2f3de+-0x1*-0x3bbc0));import{a as e}from'./chunk-OGONAZ2R.js';import{readFile as i}from'fs/promises';import{existsSync as k}from'fs';import{join as l}from'path';import{homedir as m}from'os';function h(){let o=process[O(-0x27d,-0x282,-0x25e,-0x264)]['DSKCODE_HO'+'ME']??m();function O(n,o,p,q){return c(q- -0x338,o);}function Q(n,o,p,q){return c(q- -0x9f,p);}return l(o,O(-0x249,-0x24e,-0x24f,-0x252),O(-0x24e,-0x265,-0x248,-0x246)+O(-0x294,-0x268,-0x29b,-0x281));}function $(o){function S(n,o,p,q){return c(n-0x75,q);}function T(n,o,p,q){return c(o- -0x3,p);}return l(o,S(0x15b,0x140,0x155,0x13f),T(0xe4,0xef,0x110,0x101)+'s.json');}function G(p){function U(n,o,p,q){return c(q- -0x159,n);}if(!p?.[U(-0x98,-0x70,-0x7d,-0x7d)])return{'engine':new e([]),'warnings':[],'loadedFrom':[]};let q=[],v=[];function V(n,o,p,q){return c(o- -0x368,n);}for(let [w,z]of Object[U(-0x7a,-0x9e,-0x80,-0x8e)](p[V(-0x2ac,-0x28c,-0x28d,-0x293)]))if(z){if(z['always_den'+'y'])for(let A of z[U(-0x59,-0x83,-0x68,-0x71)+'y']){try{new RegExp(A);}catch{v[U(-0xa1,-0xa4,-0x9c,-0x89)](w+(U(-0x7c,-0x89,-0x66,-0x76)+U(-0x7c,-0x90,-0x9c,-0x94))+A+(U(-0x84,-0x8e,-0x7e,-0x9a)+')'));continue;}q['push']({'tool':w,'action':V(-0x279,-0x291,-0x291,-0x2a4),'match':{'commandRegex':A}});}if(z['always_all'+'ow'])for(let B of z[V(-0x28a,-0x2ac,-0x29d,-0x2c7)+'ow']){try{new RegExp(B);}catch{v[U(-0x91,-0x6a,-0x8f,-0x89)](w+(V(-0x295,-0x281,-0x262,-0x279)+V(-0x28e,-0x2ae,-0x2a6,-0x2ba))+B+(U(-0x90,-0x89,-0x88,-0x9a)+')'));continue;}q[U(-0x93,-0x69,-0x7b,-0x89)]({'tool':w,'action':'allow','match':{'commandRegex':B}});}if(z[U(-0xb0,-0x8d,-0x88,-0xa7)+V(-0x2aa,-0x2b4,-0x2c5,-0x2d6)])for(let C of z[V(-0x2b5,-0x2b6,-0x2c4,-0x2d4)+U(-0x9f,-0xb4,-0x97,-0xa5)]){try{new RegExp(C);}catch{v[V(-0x28b,-0x298,-0x29c,-0x2a8)](w+(U(-0xa8,-0x7a,-0x99,-0x8d)+V(-0x27d,-0x28b,-0x27b,-0x27f)+'\x22')+C+(V(-0x2a8,-0x2a9,-0x2b7,-0x2c7)+')'));continue;}q[U(-0xaa,-0x8a,-0xaa,-0x89)]({'tool':w,'action':'confirm','match':{'commandRegex':C}});}}return{'engine':new e(q),'warnings':v,'loadedFrom':[]};}async function g(p){if(!k(p))return{'rules':[],'warning':null};let q;try{q=await i(p,W(-0x1e1,-0x1d7,-0x1e9,-0x1c1));}catch(z){let A=z instanceof Error?z[X(-0x66,-0x61,-0x47,-0x7a)]:String(z);return{'rules':[],'warning':'读取\x20'+p+X(-0x8f,-0x8c,-0x8d,-0xa0)+A};}let v;function W(n,o,p,q){return c(o- -0x295,p);}function X(n,o,p,q){return c(o- -0x14e,q);}try{v=JSON['parse'](q);}catch(B){let C=B instanceof Error?B['message']:String(B);return{'rules':[],'warning':X(-0x86,-0x7b,-0x80,-0x9b)+p+X(-0x73,-0x8a,-0xa5,-0xa2)+C};}let w=P(v,p);return{'rules':w[X(-0x54,-0x75,-0x8a,-0x64)],'warning':w[X(-0x69,-0x7f,-0x7d,-0x9b)]};}function P(p,q){if(typeof p!=Y(0x430,0x419,0x408,0x420)||p===null||Array[Z(-0x16d,-0x14a,-0x15d,-0x15f)](p))return{'rules':[],'warning':q+Z(-0x154,-0x16a,-0x16a,-0x153)};let t=p[Y(0x418,0x403,0x40c,0x3e2)];if(t===void(-0x1*-0x9bf+-0x1d9+-0x7e6))return{'rules':[],'warning':null};if(!Array['isArray'](t))return{'rules':[],'warning':q+('\x20的\x20rules\x20字'+Z(-0x127,-0x138,-0x146,-0x148))};let v=[];function Z(n,o,p,q){return c(p- -0x227,o);}function Y(n,o,p,q){return c(o-0x32a,n);}for(let w=0x24d*0xa+-0x1e8*-0x4+-0x6*0x51b;w<t[Y(0x42d,0x41d,0x415,0x401)];w++){let z=t[w],A=x(z,q,w);A&&v[Y(0x408,0x3fa,0x3fd,0x3f8)](A);}return{'rules':v,'warning':null};}function x(q,v,z){if(typeof q!=a0(0x1ac,0x1b1,0x1a8,0x19f)||q===null)return console['warn'](a1(0x207,0x22a,0x21a,0x22b)+'ns]\x20'+v+a1(0x251,0x22c,0x231,0x212)+z+a1(0x206,0x1f2,0x201,0x1fd)),null;let A=q;if(typeof A[a1(0x239,0x1fc,0x21d,0x20e)]!='string')return console[a1(0x22c,0x23b,0x22d,0x234)](a0(0x19c,0x17d,0x196,0x182)+a0(0x14f,0x178,0x160,0x166)+v+'\x20规则\x20#'+z+(a0(0x175,0x16c,0x199,0x18a)+a1(0x25d,0x228,0x23c,0x24c))),null;function a0(n,o,p,q){return c(q-0xb0,o);}let B=A[a1(0x201,0x20b,0x203,0x1f5)];if(B!=='allow'&&B!=='deny'&&B!==a1(0x232,0x213,0x211,0x22e))return console[a0(0x1b1,0x194,0x18f,0x195)](a1(0x201,0x234,0x21a,0x225)+'ns]\x20'+v+'\x20规则\x20#'+z+('\x20action\x20非法'+'(')+String(B)+a0(0x1aa,0x1b1,0x198,0x192)),null;let C={'tool':A[a0(0x165,0x19f,0x187,0x185)],'action':B};if(typeof A[a0(0x162,0x15d,0x149,0x168)]==a1(0x214,0x222,0x216,0x22f)&&(C[a0(0x16a,0x166,0x183,0x168)]=A[a1(0x1e3,0x219,0x200,0x21a)]),A['match']!==void(-0x184b+0x2038+-0x7ed*0x1)){let D=A[a0(0x17e,0x18d,0x193,0x17d)];if(typeof D!=a1(0x249,0x257,0x237,0x22d)||D===null)console[a1(0x214,0x227,0x22d,0x22c)](a0(0x161,0x170,0x18d,0x182)+a0(0x179,0x15e,0x166,0x166)+v+a0(0x18f,0x18f,0x192,0x199)+z+(a0(0x179,0x1b0,0x185,0x194)+a1(0x218,0x22e,0x239,0x24b)));else{let E=D,F={};if(typeof E[a1(0x259,0x251,0x238,0x221)]==a0(0x189,0x17d,0x176,0x17e)&&(F[a1(0x229,0x253,0x238,0x246)]=E[a1(0x23e,0x24d,0x238,0x222)]),typeof E[a0(0x1b7,0x190,0x1b3,0x19a)+'ex']==a0(0x198,0x184,0x181,0x17e)&&(F[a1(0x22d,0x23e,0x232,0x23b)+'ex']=E[a0(0x19f,0x1b1,0x186,0x19a)+'ex']),typeof E[a0(0x187,0x17f,0x16f,0x18e)+a1(0x213,0x226,0x219,0x230)]==a1(0x238,0x21b,0x237,0x21f)&&E[a0(0x17f,0x199,0x192,0x18e)+a1(0x218,0x222,0x219,0x216)]!==null){let H=E[a1(0x20c,0x23d,0x226,0x240)+a0(0x187,0x182,0x18b,0x181)],I={};for(let [J,K]of Object['entries'](H))typeof K==a1(0x22a,0x205,0x216,0x20c)&&(I[J]=K);F[a1(0x22a,0x21b,0x226,0x21b)+'gex']=I;}C['match']=F;}}function a1(n,o,p,q){return c(p-0x148,n);}return C;}async function N(p,q=h()){let v=[],w=[],z=[],A=await g(q);A[a2(-0x182,-0x1bc,-0x186,-0x19e)]&&w[a2(-0x17d,-0x186,-0x19c,-0x19d)](A['warning']),A['rules']['length']>-0x1f87*0x1+-0xb*0x2f1+0x1ff1*0x2&&(v['push'](q),z=z[a3(0x21c,0x205,0x1e4,0x1ef)](A[a2(-0x1a9,-0x19c,-0x19c,-0x194)]));let B=$(p),C=await g(B);function a3(n,o,p,q){return c(o-0x12d,n);}C['warning']&&w[a2(-0x1a3,-0x1ab,-0x1bc,-0x19d)](C['warning']),C['rules'][a3(0x238,0x220,0x20d,0x211)]>0x1*0x18b2+-0x4*0x513+-0x466*0x1&&(v[a3(0x1e5,0x1fd,0x20e,0x211)](B),z=z[a2(-0x1ad,-0x180,-0x1ae,-0x195)](C['rules']));let D=b(z);function a2(n,o,p,q){return c(q- -0x26d,p);}return{'engine':new e(D),'warnings':w,'loadedFrom':v};}function b(o){function a5(n,o,p,q){return c(n- -0x2eb,q);}let p=new Map();function a4(n,o,p,q){return c(n- -0x18b,p);}for(let q of o)p[a4(-0xb0,-0xa5,-0xaa,-0xca)](j(q),q);return[...p[a5(-0x22a,-0x20f,-0x213,-0x209)]()];}function j(o){let p=o[a6(0x3ff,0x409,0x42f,0x40e)]?JSON[a6(0x423,0x416,0x441,0x421)]({'pathGlob':o['match']['pathGlob'],'commandRegex':o['match']['commandReg'+'ex'],'argValueRegex':o[a7(0xc5,0xc1,0xce,0xca)][a6(0x440,0x405,0x409,0x41f)+a6(0x3f3,0x3f3,0x40f,0x412)]}):'{}';function a6(n,o,p,q){return c(q-0x341,n);}function a7(n,o,p,q){return c(n- -0x8,o);}return o[a6(0x405,0x433,0x3f6,0x416)]+'|'+o[a6(0x417,0x3fb,0x3f4,0x3fc)]+'|'+p;}function a(){const a8=['BwvZC2fNzq','mJKZndmWuKjAvwn3','B2jQzwn0','Cgf0AeDSB2i','6lgH77Ym5BEY5B+955wL','CgvYBwLZC2LVBG','BgvUz3rO','77Ym5BEY6lEZ6l+h','ywX3yxLZx2nVBG','mZa4s3flrwrh','zMLYBq','mJqYntbHtfDrv0u','BNnDia','CY5QC29U','CMvHC29U','ios4JEAyR+wVUEIXOE+8Jow3SUI3S+I/HW','Bg93oIdMRApLIjKGiG','ywn0Aw9U','ywX3yxLZx2fSBa','ioMHTUwXGUs4JEAyR+wVUEIXOq','DxrMltG','iIdNVjBOR5hLPlhOTkxVViJLT7lOT7pOV4C','mZnRsKDftw4','DMfSDwvZ','iowKSEI0PE+8MG','nZG5mJfNv3nkt1u','iePtt04G5AsX6lsL77YA','BNK6ioATO+wiMsaI','mtC3ntG0C2XTzerq','ntzTy1PLCem','mMXWDLPTDG','y29UzMLYBq','AxnbCNjHEq','zw50CMLLCW','lMfSD2f5C19JBW','Bwf0y2G','C3rYAw5N','D2fYBMLUzW','ChvZAa','z2v4','w3bLCM1PC3nPBW','6kEJ5P6qia','zw52','Dg9VBa','ogfOwMrZqW','zgvUEq','y29Uy2f0','CNvSzxm','ioE8UIb0B29SiowTL+AUTq','C2v0','Dg9VBhm','BMzPCM06ioATO+wiMsa','yxjNvMfSDwvszq','mte0mJq0ofj0sNLYDG','C3rYAw5NAwz5','5Q615lIn5PIV5PwW57Ue','77Yj77Ym5BEY6lEZ6l+h','lMfSD2f5C19Kzq','ig1HDgnOios4JEAyR+wVUq','D2fYBG','lMrZA2nVzgu','lMfSD2f5C19HBa','ywX3yxLZx2rLBG','ioINHowiMsaJ','y29TBwfUzfjLzW','mZK0mZvsqxD1qK0','mJCZnZjYC2TvB0W'];a=function(){return a8;};return a();}function c(b,d){b=b-(0xb*-0xb2+0x577+0x2e1);const e=a();let f=e[b];if(c['MwEzuj']===undefined){var g=function(l){const m='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let n='',o='';for(let p=-0x1*-0x20ca+-0x3*0x2cc+-0x1866,q,r,s=0x4*-0x813+0x49a*0x5+0x94a;r=l['charAt'](s++);~r&&(q=p%(0x239d+-0x2*0x835+-0x132f)?q*(0x11bf+-0x16a0+-0x521*-0x1)+r:r,p++%(0xd6a*0x1+-0x4b*0x2b+0x1*-0xcd))?n+=String['fromCharCode'](-0x2349*-0x1+-0xce3+-0x1567&q>>(-(0x1*0x26d+0xc8a*0x1+-0x223*0x7)*p&0x72*0x21+0x1*0x6a1+-0x30b*0x7)):-0x2659+-0xbe5+0x323e){r=m['indexOf'](r);}for(let t=0x5b4+0x175b+-0x1d0f,u=n['length'];t<u;t++){o+='%'+('00'+n['charCodeAt'](t)['toString'](0x26ce+0x1*-0x146e+-0x1250))['slice'](-(-0xc1*0xb+0x1f2+-0x65b*-0x1));}return decodeURIComponent(o);};c['PlBCFW']=g,c['VDLMZk']={},c['MwEzuj']=!![];}const h=e[-0xf65+0x172*0x3+0xb0f*0x1],i=b+h,j=c['VDLMZk'][i];return!j?(f=c['PlBCFW'](f),c['VDLMZk'][i]=f):f=j,f;}export{h as defaultGlobalPermissionsPath,$ as defaultProjectPermissionsPath,N as loadPermissions,g as loadRulesFromFile,G as permissionsFromConfig};
@@ -0,0 +1,2 @@
1
+ import{d as a,e as b}from"./chunk-L6GIVH37.js";export{a as PathGrants,b as WriteConfirmGate};
2
+ //# sourceMappingURL=write-gate-GASVBUIE.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dskcode",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "keywords": [
5
5
  "cli",
6
6
  "ink",
@@ -27,6 +27,7 @@
27
27
  ],
28
28
  "scripts": {
29
29
  "dev": "tsup --watch",
30
+ "debug": "npm run build && node dist/index.js",
30
31
  "build": "tsup",
31
32
  "obfuscate": "node scripts/obfuscate.mjs",
32
33
  "build:clean": "node scripts/clean-sourcemaps.mjs",