@ranger-testing/ranger-cli 2.0.5 → 2.0.7

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.
Files changed (116) hide show
  1. package/build/cli.js +1 -914
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -36
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -93
  6. package/build/commands/env.js +1 -98
  7. package/build/commands/feature.js +1 -653
  8. package/build/commands/hook.js +1 -33
  9. package/build/commands/hooks/autoPrompt.js +1 -32
  10. package/build/commands/hooks/disable.js +1 -33
  11. package/build/commands/hooks/enable.js +1 -58
  12. package/build/commands/hooks/exitPlanMode.js +1 -35
  13. package/build/commands/hooks/index.js +1 -12
  14. package/build/commands/hooks/output.js +1 -71
  15. package/build/commands/hooks/planReminder.js +1 -46
  16. package/build/commands/hooks/planStart.js +1 -30
  17. package/build/commands/hooks/postEdit.js +1 -43
  18. package/build/commands/hooks/preCompact.js +1 -30
  19. package/build/commands/hooks/sessionEnd.js +1 -25
  20. package/build/commands/hooks/sessionStart.js +1 -93
  21. package/build/commands/hooks/stopHook.js +1 -155
  22. package/build/commands/index.js +1 -12
  23. package/build/commands/login.js +1 -26
  24. package/build/commands/setupCi.js +1 -189
  25. package/build/commands/skillup.js +1 -80
  26. package/build/commands/start.js +1 -1
  27. package/build/commands/status.js +1 -198
  28. package/build/commands/update.js +1 -182
  29. package/build/commands/updateEnv.js +1 -1
  30. package/build/commands/useEnv.js +1 -1
  31. package/build/commands/utils/activeProfile.js +1 -76
  32. package/build/commands/utils/browserSessionsApi.js +1 -1
  33. package/build/commands/utils/claudeConfig.js +1 -73
  34. package/build/commands/utils/claudePlugin.js +1 -85
  35. package/build/commands/utils/crypto.js +1 -42
  36. package/build/commands/utils/desirePathLog.js +1 -139
  37. package/build/commands/utils/deviceAuth.js +1 -232
  38. package/build/commands/utils/environment.js +1 -65
  39. package/build/commands/utils/featureApi.js +1 -371
  40. package/build/commands/utils/featureReportGenerator.js +1 -204
  41. package/build/commands/utils/fixWebmDuration.js +1 -0
  42. package/build/commands/utils/git.js +1 -44
  43. package/build/commands/utils/keychain.js +1 -1
  44. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  45. package/build/commands/utils/profileMessages.js +1 -8
  46. package/build/commands/utils/profileSetupBanner.js +1 -167
  47. package/build/commands/utils/rangerRoot.js +1 -60
  48. package/build/commands/utils/reportGenerator.js +1 -130
  49. package/build/commands/utils/retry.js +1 -25
  50. package/build/commands/utils/sessionCache.js +1 -299
  51. package/build/commands/utils/settings.js +1 -313
  52. package/build/commands/utils/skillContent.js +1 -28
  53. package/build/commands/utils/skills.js +1 -1
  54. package/build/commands/utils/telemetry.js +1 -254
  55. package/build/commands/utils/userApi.js +1 -32
  56. package/build/commands/utils/version.js +1 -62
  57. package/build/commands/verifyFeature.js +1 -1343
  58. package/build/commands/verifyInBrowser.js +1 -1
  59. package/package.json +4 -1
  60. package/build/cli.js.map +0 -1
  61. package/build/commands/addEnv.js.map +0 -1
  62. package/build/commands/authEncrypt.js.map +0 -1
  63. package/build/commands/clean.js.map +0 -1
  64. package/build/commands/config.js.map +0 -1
  65. package/build/commands/env.js.map +0 -1
  66. package/build/commands/feature.js.map +0 -1
  67. package/build/commands/hook.js.map +0 -1
  68. package/build/commands/hooks/autoPrompt.js.map +0 -1
  69. package/build/commands/hooks/disable.js.map +0 -1
  70. package/build/commands/hooks/enable.js.map +0 -1
  71. package/build/commands/hooks/exitPlanMode.js.map +0 -1
  72. package/build/commands/hooks/index.js.map +0 -1
  73. package/build/commands/hooks/output.js.map +0 -1
  74. package/build/commands/hooks/planReminder.js.map +0 -1
  75. package/build/commands/hooks/planStart.js.map +0 -1
  76. package/build/commands/hooks/postEdit.js.map +0 -1
  77. package/build/commands/hooks/preCompact.js.map +0 -1
  78. package/build/commands/hooks/sessionEnd.js.map +0 -1
  79. package/build/commands/hooks/sessionStart.js.map +0 -1
  80. package/build/commands/hooks/stopHook.js.map +0 -1
  81. package/build/commands/index.js.map +0 -1
  82. package/build/commands/login.js.map +0 -1
  83. package/build/commands/setupCi.js.map +0 -1
  84. package/build/commands/skillup.js.map +0 -1
  85. package/build/commands/start.js.map +0 -1
  86. package/build/commands/status.js.map +0 -1
  87. package/build/commands/update.js.map +0 -1
  88. package/build/commands/updateEnv.js.map +0 -1
  89. package/build/commands/useEnv.js.map +0 -1
  90. package/build/commands/utils/activeProfile.js.map +0 -1
  91. package/build/commands/utils/browserSessionsApi.js.map +0 -1
  92. package/build/commands/utils/claudeConfig.js.map +0 -1
  93. package/build/commands/utils/claudePlugin.js.map +0 -1
  94. package/build/commands/utils/crypto.js.map +0 -1
  95. package/build/commands/utils/desirePathLog.js.map +0 -1
  96. package/build/commands/utils/deviceAuth.js.map +0 -1
  97. package/build/commands/utils/environment.js.map +0 -1
  98. package/build/commands/utils/featureApi.js.map +0 -1
  99. package/build/commands/utils/featureReportGenerator.js.map +0 -1
  100. package/build/commands/utils/git.js.map +0 -1
  101. package/build/commands/utils/keychain.js.map +0 -1
  102. package/build/commands/utils/localAgentInstallationsApi.js.map +0 -1
  103. package/build/commands/utils/profileMessages.js.map +0 -1
  104. package/build/commands/utils/profileSetupBanner.js.map +0 -1
  105. package/build/commands/utils/rangerRoot.js.map +0 -1
  106. package/build/commands/utils/reportGenerator.js.map +0 -1
  107. package/build/commands/utils/retry.js.map +0 -1
  108. package/build/commands/utils/sessionCache.js.map +0 -1
  109. package/build/commands/utils/settings.js.map +0 -1
  110. package/build/commands/utils/skillContent.js.map +0 -1
  111. package/build/commands/utils/skills.js.map +0 -1
  112. package/build/commands/utils/telemetry.js.map +0 -1
  113. package/build/commands/utils/userApi.js.map +0 -1
  114. package/build/commands/utils/version.js.map +0 -1
  115. package/build/commands/verifyFeature.js.map +0 -1
  116. package/build/commands/verifyInBrowser.js.map +0 -1
@@ -1,76 +1 @@
1
- import { existsSync } from 'fs';
2
- import { mkdir, readFile, rename, unlink, writeFile } from 'fs/promises';
3
- import { join } from 'path';
4
- import { getRangerDir } from './rangerRoot.js';
5
- const ACTIVE_PROFILE_FILE = 'active-profile.txt';
6
- const LEGACY_ACTIVE_ENV_FILE = 'active-env.txt';
7
- function getActiveProfilePath() {
8
- return join(getRangerDir(), ACTIVE_PROFILE_FILE);
9
- }
10
- function getLegacyActiveEnvPath() {
11
- return join(getRangerDir(), LEGACY_ACTIVE_ENV_FILE);
12
- }
13
- async function migrateLegacyActiveEnv() {
14
- const legacyPath = getLegacyActiveEnvPath();
15
- if (!existsSync(legacyPath)) {
16
- return null;
17
- }
18
- let value = null;
19
- try {
20
- value = (await readFile(legacyPath, 'utf-8')).trim() || null;
21
- }
22
- catch {
23
- value = null;
24
- }
25
- if (!value) {
26
- return null;
27
- }
28
- const newPath = getActiveProfilePath();
29
- try {
30
- await rename(legacyPath, newPath);
31
- }
32
- catch {
33
- try {
34
- const rangerDir = getRangerDir();
35
- await mkdir(rangerDir, { recursive: true });
36
- await writeFile(newPath, value, 'utf-8');
37
- await unlink(legacyPath);
38
- }
39
- catch {
40
- // Best effort only.
41
- }
42
- }
43
- return value;
44
- }
45
- export async function readActiveProfileName() {
46
- const activeProfilePath = getActiveProfilePath();
47
- if (existsSync(activeProfilePath)) {
48
- try {
49
- return (await readFile(activeProfilePath, 'utf-8')).trim() || null;
50
- }
51
- catch {
52
- return null;
53
- }
54
- }
55
- return await migrateLegacyActiveEnv();
56
- }
57
- export async function writeActiveProfileName(profileName) {
58
- const rangerDir = getRangerDir();
59
- await mkdir(rangerDir, { recursive: true });
60
- const activeProfilePath = getActiveProfilePath();
61
- await writeFile(activeProfilePath, profileName, 'utf-8');
62
- const legacyPath = getLegacyActiveEnvPath();
63
- if (existsSync(legacyPath)) {
64
- try {
65
- await unlink(legacyPath);
66
- }
67
- catch {
68
- // Best effort cleanup.
69
- }
70
- }
71
- }
72
- export async function migrateActiveProfileFile() {
73
- const migrated = await migrateLegacyActiveEnv();
74
- return migrated !== null;
75
- }
76
- //# sourceMappingURL=activeProfile.js.map
1
+ function _0x12f2(){const _0x2fb943=['tXMfI','fWUkz','osvsc','82884svIHqk','bQEyk','bbDqD','ryaXy','207726vyJOzP','1503336waVYEv','63eYHKln','NPoLf','77054YnPiiD','10FVaEUt','hpKbN','70AvyVMr','active-profile.txt','2379861DtQNmT','720459GmqOFt','trim','utf-8','eEmsf','IscSj','153268nXMylS'];_0x12f2=function(){return _0x2fb943;};return _0x12f2();}const _0x499817=_0x3d2b;function _0x3d2b(_0x2b28c1,_0x3ecf6e){_0x2b28c1=_0x2b28c1-0xf1;const _0x12f279=_0x12f2();let _0x3d2bc3=_0x12f279[_0x2b28c1];return _0x3d2bc3;}(function(_0x464915,_0x65d35f){const _0x5497f6=_0x3d2b,_0x306db9=_0x464915();while(!![]){try{const _0x27e6cf=-parseInt(_0x5497f6(0x103))/0x1+parseInt(_0x5497f6(0xf8))/0x2+-parseInt(_0x5497f6(0xfe))/0x3+-parseInt(_0x5497f6(0x107))/0x4*(-parseInt(_0x5497f6(0xfb))/0x5)+parseInt(_0x5497f6(0xf4))/0x6*(parseInt(_0x5497f6(0xf6))/0x7)+parseInt(_0x5497f6(0xf5))/0x8+-parseInt(_0x5497f6(0xfd))/0x9*(parseInt(_0x5497f6(0xf9))/0xa);if(_0x27e6cf===_0x65d35f)break;else _0x306db9['push'](_0x306db9['shift']());}catch(_0x126da1){_0x306db9['push'](_0x306db9['shift']());}}}(_0x12f2,0x29925));import{existsSync}from'fs';import{mkdir,readFile,rename,unlink,writeFile}from'fs/promises';import{join}from'path';import{getRangerDir}from'./rangerRoot.js';const ACTIVE_PROFILE_FILE=_0x499817(0xfc),LEGACY_ACTIVE_ENV_FILE='active-env.txt';function getActiveProfilePath(){return join(getRangerDir(),ACTIVE_PROFILE_FILE);}function getLegacyActiveEnvPath(){const _0x370690=_0x499817,_0x525ff8={'GKDJq':function(_0x5bb2f1,_0x53b1e4,_0x428e9b){return _0x5bb2f1(_0x53b1e4,_0x428e9b);},'bbDqD':function(_0x31306b){return _0x31306b();}};return _0x525ff8['GKDJq'](join,_0x525ff8[_0x370690(0xf2)](getRangerDir),LEGACY_ACTIVE_ENV_FILE);}async function migrateLegacyActiveEnv(){const _0x5aff95=_0x499817,_0x1564af={'NPoLf':function(_0x511938){return _0x511938();},'eEmsf':function(_0x4becd8,_0x274d38){return _0x4becd8(_0x274d38);},'oOxEU':function(_0x192fdd,_0x19f67a,_0x2a3072){return _0x192fdd(_0x19f67a,_0x2a3072);},'cEMDM':_0x5aff95(0x100),'RGJTt':function(_0x49611a,_0x4a802c,_0x4314fd,_0x2fb685){return _0x49611a(_0x4a802c,_0x4314fd,_0x2fb685);}},_0x466d7d=_0x1564af[_0x5aff95(0xf7)](getLegacyActiveEnvPath);if(!_0x1564af[_0x5aff95(0x101)](existsSync,_0x466d7d))return null;let _0x27ede6=null;try{_0x27ede6=(await _0x1564af['oOxEU'](readFile,_0x466d7d,_0x1564af['cEMDM']))['trim']()||null;}catch{_0x27ede6=null;}if(!_0x27ede6)return null;const _0x1767c1=_0x1564af['NPoLf'](getActiveProfilePath);try{await rename(_0x466d7d,_0x1767c1);}catch{try{const _0x3fa428=getRangerDir();await _0x1564af['oOxEU'](mkdir,_0x3fa428,{'recursive':!![]}),await _0x1564af['RGJTt'](writeFile,_0x1767c1,_0x27ede6,'utf-8'),await unlink(_0x466d7d);}catch{}}return _0x27ede6;}export async function readActiveProfileName(){const _0x17263d=_0x499817,_0x3687ff={'tXMfI':function(_0x5ef719,_0x374cc5){return _0x5ef719(_0x374cc5);},'osvsc':_0x17263d(0x100),'mIxgI':function(_0x3b7eaf){return _0x3b7eaf();}},_0x29bb78=getActiveProfilePath();if(_0x3687ff[_0x17263d(0x104)](existsSync,_0x29bb78))try{return(await readFile(_0x29bb78,_0x3687ff[_0x17263d(0x106)]))[_0x17263d(0xff)]()||null;}catch{return null;}return await _0x3687ff['mIxgI'](migrateLegacyActiveEnv);}export async function writeActiveProfileName(_0x48cadd){const _0x45a153=_0x499817,_0x149cb9={'AWfVb':function(_0x4a06d8){return _0x4a06d8();},'bQEyk':function(_0xd683ca,_0xb0f116,_0x1d1279){return _0xd683ca(_0xb0f116,_0x1d1279);},'IscSj':function(_0x1baa4b,_0x55fefd,_0x43fb3e,_0x1f51ca){return _0x1baa4b(_0x55fefd,_0x43fb3e,_0x1f51ca);},'gZwHX':function(_0x401a54){return _0x401a54();},'hpKbN':function(_0x4be058,_0x71b90){return _0x4be058(_0x71b90);}},_0x432014=_0x149cb9['AWfVb'](getRangerDir);await _0x149cb9[_0x45a153(0xf1)](mkdir,_0x432014,{'recursive':!![]});const _0x559bdb=getActiveProfilePath();await _0x149cb9[_0x45a153(0x102)](writeFile,_0x559bdb,_0x48cadd,_0x45a153(0x100));const _0x184877=_0x149cb9['gZwHX'](getLegacyActiveEnvPath);if(existsSync(_0x184877))try{await _0x149cb9[_0x45a153(0xfa)](unlink,_0x184877);}catch{}}export async function migrateActiveProfileFile(){const _0x4914a6=_0x499817,_0x22de69={'fWUkz':function(_0x5842c9){return _0x5842c9();},'ryaXy':function(_0x477386,_0x229288){return _0x477386!==_0x229288;}},_0x359d12=await _0x22de69[_0x4914a6(0x105)](migrateLegacyActiveEnv);return _0x22de69[_0x4914a6(0xf3)](_0x359d12,null);}
@@ -1 +1 @@
1
- (function(_0x4b9dea,_0x364df9){const _0x142393=_0x467e,_0x44c48d=_0x4b9dea();while(!![]){try{const _0x4c1567=parseInt(_0x142393(0x191))/0x1*(parseInt(_0x142393(0x179))/0x2)+-parseInt(_0x142393(0x18b))/0x3+-parseInt(_0x142393(0x13e))/0x4*(parseInt(_0x142393(0x128))/0x5)+-parseInt(_0x142393(0x158))/0x6*(parseInt(_0x142393(0x169))/0x7)+parseInt(_0x142393(0x12b))/0x8*(parseInt(_0x142393(0x126))/0x9)+-parseInt(_0x142393(0x16a))/0xa*(parseInt(_0x142393(0x17d))/0xb)+parseInt(_0x142393(0x13b))/0xc;if(_0x4c1567===_0x364df9)break;else _0x44c48d['push'](_0x44c48d['shift']());}catch(_0xb50f84){_0x44c48d['push'](_0x44c48d['shift']());}}}(_0x5044,0x82c47));const _0xab2321=(function(){const _0x1bc821=_0x467e,_0x4c982e={'AgTiw':_0x1bc821(0x181),'nHOuK':_0x1bc821(0x16b),'CyDXZ':_0x1bc821(0x12d),'lhDog':'base64'};let _0x3a2322=!![];return function(_0x4ce773,_0x512c22){const _0x16d385=_0x1bc821,_0x3fae1c={'tUqMY':_0x4c982e[_0x16d385(0x143)],'DpxTP':_0x4c982e[_0x16d385(0x17c)]},_0x227d67=_0x3a2322?function(){const _0x4a6a21=_0x16d385;if(_0x512c22){if(_0x4c982e[_0x4a6a21(0x18a)]===_0x4c982e[_0x4a6a21(0x176)])return _0x4f6098(_0x3fae1c[_0x4a6a21(0x124)])[_0x4a6a21(0x171)](_0x37bdba)['digest'](_0x3fae1c['DpxTP']);else{const _0x5306a0=_0x512c22[_0x4a6a21(0x16f)](_0x4ce773,arguments);return _0x512c22=null,_0x5306a0;}}}:function(){};return _0x3a2322=![],_0x227d67;};}()),_0xb78100=_0xab2321(this,function(){const _0x2b885d=_0x467e,_0x1c6762={'MBCLJ':'(((.+)+)+)+$'};return _0xb78100[_0x2b885d(0x156)]()[_0x2b885d(0x13c)](_0x1c6762[_0x2b885d(0x12f)])['toString']()['constructor'](_0xb78100)['search'](_0x1c6762[_0x2b885d(0x12f)]);});_0xb78100();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x5e0302){const _0x1c4788=_0x467e,_0x5017f1={'EpOWC':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','pkTrm':function(_0xd15d7c,_0x3cde0b,_0x3f2a86,_0x1ecf58){return _0xd15d7c(_0x3cde0b,_0x3f2a86,_0x1ecf58);},'qKbkh':_0x1c4788(0x19b),'olERO':_0x1c4788(0x152),'rpRBe':function(_0x4f9e1b){return _0x4f9e1b();},'Ugxgd':function(_0x5c060a,_0x23cbba,_0xed7f76){return _0x5c060a(_0x23cbba,_0xed7f76);},'mTxmO':_0x1c4788(0x190),'TlcXE':_0x1c4788(0x14b),'tkmJC':function(_0x33bcd1,_0x22e511){return _0x33bcd1===_0x22e511;},'qSwpt':_0x1c4788(0x157)},_0x34ec9d=await getToken();if(!_0x34ec9d){if(_0x5017f1[_0x1c4788(0x154)]!==_0x5017f1['olERO'])throw new _0x5bde73(_0x5017f1[_0x1c4788(0x182)]);else throw new Error(_0x1c4788(0x147));}const _0x82d0e=_0x5017f1[_0x1c4788(0x15d)](getApiBaseUrl),_0x25a4c2=await _0x5017f1[_0x1c4788(0x132)](fetch,_0x82d0e+_0x1c4788(0x14c),{'method':_0x5017f1[_0x1c4788(0x12e)],'headers':{'Authorization':_0x1c4788(0x15f)+_0x34ec9d,'Content-Type':_0x5017f1[_0x1c4788(0x193)]},'body':JSON[_0x1c4788(0x15b)]({'environmentName':_0x5e0302?.[_0x1c4788(0x167)],'settings':_0x5e0302?.[_0x1c4788(0x184)],'task':_0x5e0302?.[_0x1c4788(0x14a)],'url':_0x5e0302?.[_0x1c4788(0x173)],'featureId':_0x5e0302?.[_0x1c4788(0x18c)],'checklistItemId':_0x5e0302?.[_0x1c4788(0x162)]})});if(!_0x25a4c2['ok']){if(_0x5017f1[_0x1c4788(0x185)](_0x5017f1['qSwpt'],_0x1c4788(0x157))){const _0x5af454=await _0x25a4c2[_0x1c4788(0x140)]();throw new Error(_0x1c4788(0x15c)+_0x5af454);}else return _0x5017f1[_0x1c4788(0x155)](_0x445806,_0x1eb937,_0x112e94,_0x5017f1[_0x1c4788(0x186)]);}return _0x25a4c2[_0x1c4788(0x163)]();}export async function updateBrowserSession(_0x506b4a,_0x54af1c){const _0x11d816=_0x467e,_0x40ff26={'tZjPN':_0x11d816(0x150),'JddtW':function(_0x55359e){return _0x55359e();},'KTbCO':function(_0x231d12,_0x16f64f,_0x14332a){return _0x231d12(_0x16f64f,_0x14332a);},'IWOXI':_0x11d816(0x141),'EGuPP':_0x11d816(0x17b)};return _0x40ff26[_0x11d816(0x15e)](withRetry,async()=>{const _0x2704d4=_0x11d816;if(_0x40ff26[_0x2704d4(0x17a)]===_0x40ff26[_0x2704d4(0x17a)]){const _0x339a30=await _0x40ff26[_0x2704d4(0x149)](getToken);if(!_0x339a30)throw new Error(_0x2704d4(0x147));const _0xbaa980=_0x40ff26[_0x2704d4(0x149)](getApiBaseUrl),_0x39b777=await _0x40ff26['KTbCO'](fetch,_0xbaa980+_0x2704d4(0x139)+_0x506b4a,{'method':_0x40ff26[_0x2704d4(0x131)],'headers':{'Authorization':_0x2704d4(0x15f)+_0x339a30,'Content-Type':'application/json'},'body':JSON['stringify'](_0x54af1c)});if(!_0x39b777['ok']){const _0x15b84e=await _0x39b777['text']();throw new Error('Failed\x20to\x20update\x20browser\x20session:\x20'+_0x15b84e);}return _0x39b777['json']();}else return _0x36a042(_0x18ca38,_0x3869cd,'application/zip');},{'label':_0x40ff26['EGuPP']});}function _0x467e(_0x1be57a,_0x23c2a0){_0x1be57a=_0x1be57a-0x124;const _0x43559e=_0x5044();let _0xb78100=_0x43559e[_0x1be57a];if(_0x467e['GAIosq']===undefined){var _0xab2321=function(_0x1289d4){const _0x120fab='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x23e24f='',_0x3dbee6='',_0x11a57d=_0x23e24f+_0xab2321;for(let _0x14290b=0x0,_0x230d49,_0x423b93,_0x40192f=0x0;_0x423b93=_0x1289d4['charAt'](_0x40192f++);~_0x423b93&&(_0x230d49=_0x14290b%0x4?_0x230d49*0x40+_0x423b93:_0x423b93,_0x14290b++%0x4)?_0x23e24f+=_0x11a57d['charCodeAt'](_0x40192f+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x230d49>>(-0x2*_0x14290b&0x6)):_0x14290b:0x0){_0x423b93=_0x120fab['indexOf'](_0x423b93);}for(let _0x2efc4a=0x0,_0x164731=_0x23e24f['length'];_0x2efc4a<_0x164731;_0x2efc4a++){_0x3dbee6+='%'+('00'+_0x23e24f['charCodeAt'](_0x2efc4a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3dbee6);};_0x467e['srtKBS']=_0xab2321,_0x467e['VaSgXm']={},_0x467e['GAIosq']=!![];}const _0x5044f3=_0x43559e[0x0],_0x467ecc=_0x1be57a+_0x5044f3,_0x234a04=_0x467e['VaSgXm'][_0x467ecc];if(!_0x234a04){const _0x3b8cbe=function(_0x133083){this['NIBeHp']=_0x133083,this['JVrVaL']=[0x1,0x0,0x0],this['VaTmFR']=function(){return'newState';},this['QYoYgX']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['upmJAJ']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x3b8cbe['prototype']['EkkVvl']=function(){const _0x5ce0f3=new RegExp(this['QYoYgX']+this['upmJAJ']),_0xb93358=_0x5ce0f3['test'](this['VaTmFR']['toString']())?--this['JVrVaL'][0x1]:--this['JVrVaL'][0x0];return this['sIBxYt'](_0xb93358);},_0x3b8cbe['prototype']['sIBxYt']=function(_0x1b6a00){if(!Boolean(~_0x1b6a00))return _0x1b6a00;return this['RtPTvo'](this['NIBeHp']);},_0x3b8cbe['prototype']['RtPTvo']=function(_0x15dea9){for(let _0x5e33b4=0x0,_0xfa54db=this['JVrVaL']['length'];_0x5e33b4<_0xfa54db;_0x5e33b4++){this['JVrVaL']['push'](Math['round'](Math['random']())),_0xfa54db=this['JVrVaL']['length'];}return _0x15dea9(this['JVrVaL'][0x0]);},new _0x3b8cbe(_0x467e)['EkkVvl'](),_0xb78100=_0x467e['srtKBS'](_0xb78100),_0x467e['VaSgXm'][_0x467ecc]=_0xb78100;}else _0xb78100=_0x234a04;return _0xb78100;}export async function getBrowserSession(_0x2b5800){const _0x4882aa=_0x467e,_0x5187={'VqZIJ':function(_0x86133b){return _0x86133b();},'fkqoa':function(_0x3637bc,_0x1def66){return _0x3637bc!==_0x1def66;},'zBULf':_0x4882aa(0x13f),'ZxayQ':_0x4882aa(0x147),'RbTxR':function(_0x4fb9fa,_0x491bde,_0x2b7aeb){return _0x4fb9fa(_0x491bde,_0x2b7aeb);},'IOVTw':'GET'},_0x37f3d8=await _0x5187[_0x4882aa(0x198)](getToken);if(!_0x37f3d8){if(_0x5187[_0x4882aa(0x177)](_0x4882aa(0x16d),_0x5187[_0x4882aa(0x160)]))throw new Error(_0x5187[_0x4882aa(0x145)]);else{const _0x2b4e65=_0x296c20[_0x4882aa(0x16f)](_0x3df962,arguments);return _0xfc5b4a=null,_0x2b4e65;}}const _0x115b16=getApiBaseUrl(),_0x35fe8e=await _0x5187['RbTxR'](fetch,_0x115b16+_0x4882aa(0x139)+_0x2b5800,{'method':_0x5187['IOVTw'],'headers':{'Authorization':'Bearer\x20'+_0x37f3d8}});if(!_0x35fe8e['ok']){const _0x8eec40=await _0x35fe8e[_0x4882aa(0x140)]();throw new Error(_0x4882aa(0x168)+_0x8eec40);}return _0x35fe8e[_0x4882aa(0x163)]();}export async function getUploadUrls(_0x3475ea,_0x35afc6,_0x4a10a8,_0x42bab4){const _0x294091=_0x467e,_0x11c91f={'wZxGa':function(_0x27b152){return _0x27b152();},'ZPKPl':function(_0x2cde73,_0x58e45d){return _0x2cde73===_0x58e45d;},'OlXhg':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','xNOVP':function(_0x34d937){return _0x34d937();},'aVhDt':function(_0x107131,_0x2e2a5b,_0x19549e){return _0x107131(_0x2e2a5b,_0x19549e);},'pIDCz':_0x294091(0x190),'ygkmJ':function(_0x455218,_0x25f986){return _0x455218!==_0x25f986;},'SgTQD':function(_0x2c3584,_0x3d99a6){return _0x2c3584!==_0x3d99a6;}},_0x33942d=await _0x11c91f[_0x294091(0x130)](getToken);if(!_0x33942d){if(_0x11c91f[_0x294091(0x188)]('wggXd',_0x294091(0x133)))throw new Error(_0x11c91f[_0x294091(0x12a)]);else{if(_0x13afb8){const _0xc67028=_0x24a3ec[_0x294091(0x16f)](_0x48267a,arguments);return _0x517d4a=null,_0xc67028;}}}const _0x262cf1=_0x11c91f[_0x294091(0x196)](getApiBaseUrl),_0x587265=await _0x11c91f[_0x294091(0x17f)](fetch,_0x262cf1+'/api/v1/mcp/browser-sessions/'+_0x3475ea+_0x294091(0x13d),{'method':_0x11c91f[_0x294091(0x175)],'headers':{'Authorization':_0x294091(0x15f)+_0x33942d,'Content-Type':_0x294091(0x14b)},'body':JSON[_0x294091(0x15b)]({'filename':_0x35afc6,'filetype':_0x4a10a8,..._0x11c91f[_0x294091(0x144)](_0x42bab4?.[_0x294091(0x18f)],undefined)&&{'size':_0x42bab4[_0x294091(0x18f)]},..._0x11c91f[_0x294091(0x144)](_0x42bab4?.['checksum'],undefined)&&{'checksum':_0x42bab4[_0x294091(0x13a)]},..._0x11c91f[_0x294091(0x18e)](_0x42bab4?.[_0x294091(0x142)],undefined)&&{'metadata':_0x42bab4[_0x294091(0x142)]}})});if(!_0x587265['ok']){const _0x23e763=await _0x587265[_0x294091(0x140)]();throw new Error(_0x294091(0x151)+_0x23e763);}return _0x587265[_0x294091(0x163)]();}export async function uploadFile(_0x1ef6cc,_0x39d9a1,_0x1c0d82){const _0x14b932=_0x467e,_0x111970={'PrKIh':_0x14b932(0x147),'oYHWk':function(_0x462eb4,_0x2a63f2,_0x3c7dc5){return _0x462eb4(_0x2a63f2,_0x3c7dc5);},'yBoEA':function(_0x4a0d06,_0x278e0a){return _0x4a0d06!==_0x278e0a;},'ZiKqB':_0x14b932(0x172)},_0x151115=await _0x111970[_0x14b932(0x134)](fetch,_0x1ef6cc,{'method':'PUT','headers':{'Content-Type':_0x1c0d82,'Content-Length':_0x39d9a1[_0x14b932(0x14d)]['toString']()},'body':_0x39d9a1});if(!_0x151115['ok']){if(_0x111970[_0x14b932(0x148)](_0x111970[_0x14b932(0x127)],_0x14b932(0x172)))throw new _0x8d77b2(_0x111970[_0x14b932(0x180)]);else{const _0x189de1=await _0x151115[_0x14b932(0x140)]();throw new Error(_0x14b932(0x170)+_0x189de1);}}}export async function uploadTrace(_0x426ae9,_0x460ef6){const _0x2d2618=_0x467e,_0x543eef={'WHCrW':function(_0x4049c0,_0x16c702,_0x1bea3e,_0x1e2779){return _0x4049c0(_0x16c702,_0x1bea3e,_0x1e2779);}};return _0x543eef[_0x2d2618(0x159)](uploadFile,_0x426ae9,_0x460ef6,_0x2d2618(0x136));}export async function uploadConversation(_0x100704,_0x4dbff4){const _0x40cad3=_0x467e,_0x4d2b1c={'lBBaV':_0x40cad3(0x19b)};return uploadFile(_0x100704,_0x4dbff4,_0x4d2b1c[_0x40cad3(0x165)]);}export async function uploadScreenshot(_0x24529d,_0x25dc31){const _0x50fe7d=_0x467e,_0x2a815a={'aptAu':function(_0xc8dbca,_0x34342e,_0x2dedb0,_0xf63831){return _0xc8dbca(_0x34342e,_0x2dedb0,_0xf63831);}};return _0x2a815a[_0x50fe7d(0x16c)](uploadFile,_0x24529d,_0x25dc31,_0x50fe7d(0x189));}export async function uploadVideo(_0x2a179b,_0x433eca){const _0x565375=_0x467e,_0x33ab56={'mxiAO':'video/webm'};return uploadFile(_0x2a179b,_0x433eca,_0x33ab56[_0x565375(0x161)]);}export function buildTraceViewerUrl(_0x264fdb){const _0x2116b1=_0x467e,_0x5838cd={'LirsI':function(_0x2f99f8,_0x1c4b4a){return _0x2f99f8(_0x1c4b4a);}},_0x360822=_0x5838cd[_0x2116b1(0x194)](encodeURIComponent,_0x264fdb);return _0x2116b1(0x12c)+_0x360822;}export async function getProxySessionToken(){const _0x17d62a=_0x467e,_0x5394c3={'LPANn':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ucuDm':function(_0x1964a6){return _0x1964a6();},'NMYjI':function(_0x4005fc,_0x65013f,_0x367d6b){return _0x4005fc(_0x65013f,_0x367d6b);},'DyMch':_0x17d62a(0x190),'FsYdm':function(_0x294105,_0x11197f){return _0x294105===_0x11197f;},'KaykE':_0x17d62a(0x138)},_0x3c0c9f=await getToken();if(!_0x3c0c9f)throw new Error(_0x5394c3['LPANn']);const _0x1de010=_0x5394c3[_0x17d62a(0x174)](getApiBaseUrl),_0x27335c=await _0x5394c3[_0x17d62a(0x125)](fetch,_0x1de010+_0x17d62a(0x166),{'method':_0x5394c3[_0x17d62a(0x199)],'headers':{'Authorization':_0x17d62a(0x15f)+_0x3c0c9f}});if(!_0x27335c['ok']){if(_0x5394c3[_0x17d62a(0x164)](_0x17d62a(0x138),_0x5394c3['KaykE'])){const _0x5b6f1d=await _0x27335c[_0x17d62a(0x140)]();throw new Error(_0x17d62a(0x153)+_0x5b6f1d);}else throw new _0x22d7cb(_0x5394c3[_0x17d62a(0x137)]);}const _0x16468b=await _0x27335c[_0x17d62a(0x163)]();return _0x16468b['sessionToken'];}export function computeChecksum(_0xdc280a){const _0x3a21a6=_0x467e,_0x1cfe7e={'xBNgT':function(_0xb5ea2e,_0x5b7c07){return _0xb5ea2e(_0x5b7c07);},'RGrxO':_0x3a21a6(0x129)};return _0x1cfe7e[_0x3a21a6(0x183)](createHash,_0x3a21a6(0x12d))[_0x3a21a6(0x171)](_0xdc280a)['digest'](_0x1cfe7e[_0x3a21a6(0x135)]);}function _0x5044(){const _0x1d8504=['uKDYEe8','yxbWBgLJyxrPB24VEMLW','tfbbtM4','vMDlyvK','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','y2HLy2TZDw0','mJq2oda5ndbJuvn2ve4','C2vHCMnO','l3vWBg9Hzc11CMXZ','offJwhnRAG','ExbdAKG','Dgv4Da','uefuq0G','Bwv0ywrHDge','q3LewfO','EwDRBuO','wNHHEve','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','EujVrue','sMrKDfC','DgfZAW','yxbWBgLJyxrPB24VANnVBG','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCW','BgvUz3rO','D3D2r3e','l3n0zxbZlW','BwjMuLu','rMfPBgvKihrVigDLDcb1CgXVywqGvvjmCZOG','tvrgEfu','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','B2XfuK8','CgTuCM0','Dg9tDhjPBMC','D212ugm','mZzcrhnrD1C','v0HdCLC','l3n0zxbZ','C3rYAw5NAwz5','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','CNbsqMu','s1rIq08','qMvHCMvYia','EKjvtgy','BxHPqu8','y2HLy2TSAxn0sxrLBuLK','ANnVBG','rNnzzg0','Bejcyvy','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG','zw52AxjVBM1LBNroyw1L','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','mZGXmtqZt2vlsLLV','mta1mJi0nZbky3PeDxO','rLD5wvy','yxb0qxu','Eu5es04','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','yxbWBhK','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','DxbKyxrL','uxDNv2m','DxjS','Dwn1rg0','CeLeq3O','BKHpDuS','zMTXB2e','BwzdseC','mKzyugLyCG','DfPQue4','DxbKyxrLqNjVD3nLCLnLC3nPB24','BgHeB2C','mtfiAgXTqvq','uM9ACxy','yvzOrhq','uhjlswG','BLHyvw8','rxbpv0m','Eejoz1q','C2v0DgLUz3m','DgTTsKm','CuTIA2G','suXXr20','wLblugW','Aw1Hz2uVCg5N','qwDuAxC','mtaWnJiWnNf2zhL1vW','zMvHDhvYzuLK','ChnLrfK','u2Duuuq','C2L6zq','ue9tva','ntmXotqYEufmt0Hs','wfHlvfm','vgXJweu','tgLYC0K','sfzjr3G','Ee5pvLa','qNfKs1K','vNfAsuO','rhLny2G','AvLJsu0','yxbWBgLJyxrPB24VANnVBMW','DfvXtvK','tK1zAKK','mta1odC2ownHBfHRva','wMLlCui','mte0mdKWnuntvLLMwa','yMfZzty0','t2XyAgC','ohPIr2P3tW','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','Bwq1','Bvr4Bu8','tujdteO','D1P4r2e','svDpweK','vwD4z2q','D2DNwgq','B1Liv2S'];_0x5044=function(){return _0x1d8504;};return _0x5044();}export async function createVerificationStep(_0x2e53ef,_0x48226a){const _0x4f4317=_0x467e,_0x16545b={'XXKTS':_0x4f4317(0x147),'iYcIM':function(_0x19d95b){return _0x19d95b();},'mfCHG':function(_0x21fb6c,_0xab7027,_0x3b1e93){return _0x21fb6c(_0xab7027,_0x3b1e93);},'pseDY':_0x4f4317(0x190),'BqdKY':_0x4f4317(0x14b)},_0x17cfa6=await getToken();if(!_0x17cfa6)throw new Error(_0x16545b[_0x4f4317(0x192)]);const _0x4ecb3d=_0x16545b[_0x4f4317(0x19a)](getApiBaseUrl),_0x400de3=await _0x16545b[_0x4f4317(0x178)](fetch,_0x4ecb3d+_0x4f4317(0x139)+_0x2e53ef+_0x4f4317(0x15a),{'method':_0x16545b[_0x4f4317(0x18d)],'headers':{'Authorization':_0x4f4317(0x15f)+_0x17cfa6,'Content-Type':_0x16545b[_0x4f4317(0x197)]},'body':JSON[_0x4f4317(0x15b)](_0x48226a)});if(!_0x400de3['ok']){const _0x1e6e4d=await _0x400de3[_0x4f4317(0x140)]();throw new Error(_0x4f4317(0x146)+_0x1e6e4d);}return _0x400de3[_0x4f4317(0x163)]();}export async function createStepAsset(_0x294a76,_0x5bfdb3,_0x10d49a){const _0x4a187a=_0x467e,_0x3f4cc1={'ILqGm':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','HVIGx':function(_0x43d5f6){return _0x43d5f6();},'wwvGq':function(_0x3c69d6,_0x3dc0d5,_0x4cef76){return _0x3c69d6(_0x3dc0d5,_0x4cef76);},'IfGZv':'POST','RoZqv':'application/json'},_0x549a5a=await getToken();if(!_0x549a5a)throw new Error(_0x3f4cc1[_0x4a187a(0x187)]);const _0x4b2816=_0x3f4cc1[_0x4a187a(0x195)](getApiBaseUrl),_0x32489c=await _0x3f4cc1[_0x4a187a(0x14e)](fetch,_0x4b2816+_0x4a187a(0x139)+_0x294a76+_0x4a187a(0x14f)+_0x5bfdb3+'/assets',{'method':_0x3f4cc1['IfGZv'],'headers':{'Authorization':_0x4a187a(0x15f)+_0x549a5a,'Content-Type':_0x3f4cc1[_0x4a187a(0x17e)]},'body':JSON['stringify'](_0x10d49a)});if(!_0x32489c['ok']){const _0x2f4b13=await _0x32489c['text']();throw new Error(_0x4a187a(0x16e)+_0x2f4b13);}return _0x32489c[_0x4a187a(0x163)]();}
1
+ (function(_0x1ab43e,_0x5b9e2a){const _0xc98ab0=_0x477c,_0x320aab=_0x1ab43e();while(!![]){try{const _0x3cc0f2=parseInt(_0xc98ab0(0xa5))/0x1+-parseInt(_0xc98ab0(0xb2))/0x2*(parseInt(_0xc98ab0(0xa7))/0x3)+-parseInt(_0xc98ab0(0x6b))/0x4*(parseInt(_0xc98ab0(0x98))/0x5)+-parseInt(_0xc98ab0(0x9d))/0x6*(parseInt(_0xc98ab0(0x9b))/0x7)+parseInt(_0xc98ab0(0xb4))/0x8*(-parseInt(_0xc98ab0(0x70))/0x9)+-parseInt(_0xc98ab0(0xa1))/0xa+parseInt(_0xc98ab0(0x92))/0xb*(parseInt(_0xc98ab0(0x79))/0xc);if(_0x3cc0f2===_0x5b9e2a)break;else _0x320aab['push'](_0x320aab['shift']());}catch(_0x253425){_0x320aab['push'](_0x320aab['shift']());}}}(_0xbf4e,0x3d785));const _0x4f9993=(function(){let _0x4b3c93=!![];return function(_0x565b59,_0x1ae4e1){const _0x1ecaa5=_0x4b3c93?function(){const _0x19a046=_0x477c;if(_0x1ae4e1){const _0x232b6f=_0x1ae4e1[_0x19a046(0xd3)](_0x565b59,arguments);return _0x1ae4e1=null,_0x232b6f;}}:function(){};return _0x4b3c93=![],_0x1ecaa5;};}()),_0x2300ea=_0x4f9993(this,function(){const _0x3f7007=_0x477c,_0x1d125a={'DsZsZ':'(((.+)+)+)+$'};return _0x2300ea['toString']()['search'](_0x1d125a['DsZsZ'])[_0x3f7007(0xdb)]()['constructor'](_0x2300ea)['search'](_0x1d125a['DsZsZ']);});_0x2300ea();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';function _0x477c(_0x24ee3b,_0x8eeac4){_0x24ee3b=_0x24ee3b-0x68;const _0x20ff62=_0xbf4e();let _0x2300ea=_0x20ff62[_0x24ee3b];if(_0x477c['PHxVbK']===undefined){var _0x4f9993=function(_0x37a4b1){const _0x4efde1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4c958e='',_0x2664e2='',_0x80e0ee=_0x4c958e+_0x4f9993;for(let _0x194361=0x0,_0x599342,_0x5d786a,_0x1f9f31=0x0;_0x5d786a=_0x37a4b1['charAt'](_0x1f9f31++);~_0x5d786a&&(_0x599342=_0x194361%0x4?_0x599342*0x40+_0x5d786a:_0x5d786a,_0x194361++%0x4)?_0x4c958e+=_0x80e0ee['charCodeAt'](_0x1f9f31+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x599342>>(-0x2*_0x194361&0x6)):_0x194361:0x0){_0x5d786a=_0x4efde1['indexOf'](_0x5d786a);}for(let _0xc684b1=0x0,_0x317568=_0x4c958e['length'];_0xc684b1<_0x317568;_0xc684b1++){_0x2664e2+='%'+('00'+_0x4c958e['charCodeAt'](_0xc684b1)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2664e2);};_0x477c['hEQezk']=_0x4f9993,_0x477c['KiJegh']={},_0x477c['PHxVbK']=!![];}const _0xbf4e6f=_0x20ff62[0x0],_0x477cfe=_0x24ee3b+_0xbf4e6f,_0x35473f=_0x477c['KiJegh'][_0x477cfe];if(!_0x35473f){const _0x30e182=function(_0x586529){this['rOtWiE']=_0x586529,this['cKHLrH']=[0x1,0x0,0x0],this['OXjrDB']=function(){return'newState';},this['quQhjy']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['JtqAXX']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x30e182['prototype']['ClOTQQ']=function(){const _0x2ac444=new RegExp(this['quQhjy']+this['JtqAXX']),_0x572af8=_0x2ac444['test'](this['OXjrDB']['toString']())?--this['cKHLrH'][0x1]:--this['cKHLrH'][0x0];return this['cwxioN'](_0x572af8);},_0x30e182['prototype']['cwxioN']=function(_0x338594){if(!Boolean(~_0x338594))return _0x338594;return this['ekWdyu'](this['rOtWiE']);},_0x30e182['prototype']['ekWdyu']=function(_0x14ad23){for(let _0x17ffbc=0x0,_0x569195=this['cKHLrH']['length'];_0x17ffbc<_0x569195;_0x17ffbc++){this['cKHLrH']['push'](Math['round'](Math['random']())),_0x569195=this['cKHLrH']['length'];}return _0x14ad23(this['cKHLrH'][0x0]);},new _0x30e182(_0x477c)['ClOTQQ'](),_0x2300ea=_0x477c['hEQezk'](_0x2300ea),_0x477c['KiJegh'][_0x477cfe]=_0x2300ea;}else _0x2300ea=_0x35473f;return _0x2300ea;}import{withRetry}from'./retry.js';export async function createBrowserSession(_0x5bdf48){const _0x38ca11=_0x477c,_0x463205={'dhDeU':function(_0x47428a,_0x5444e5,_0x5c90a5,_0x59f283){return _0x47428a(_0x5444e5,_0x5c90a5,_0x59f283);},'ojhnY':_0x38ca11(0xd6),'QuaYp':function(_0x33e4ee){return _0x33e4ee();},'ishSr':function(_0x2ab40d,_0x2ba16e,_0x123a27){return _0x2ab40d(_0x2ba16e,_0x123a27);},'HhjXd':'POST','WYAmM':function(_0x24ba03,_0x2480a5){return _0x24ba03===_0x2480a5;},'CdRqW':_0x38ca11(0xd4),'tQtLw':_0x38ca11(0xb6)},_0x4296f1=await getToken();if(!_0x4296f1)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2264a5=_0x463205[_0x38ca11(0xa9)](getApiBaseUrl),_0x1aa034=await _0x463205[_0x38ca11(0xb1)](fetch,_0x2264a5+_0x38ca11(0x8f),{'method':_0x463205[_0x38ca11(0xa4)],'headers':{'Authorization':'Bearer\x20'+_0x4296f1,'Content-Type':_0x38ca11(0x91)},'body':JSON[_0x38ca11(0xb8)]({'environmentName':_0x5bdf48?.[_0x38ca11(0x6a)],'settings':_0x5bdf48?.[_0x38ca11(0xbe)],'task':_0x5bdf48?.[_0x38ca11(0xa6)],'url':_0x5bdf48?.['url'],'featureId':_0x5bdf48?.[_0x38ca11(0xae)],'checklistItemId':_0x5bdf48?.[_0x38ca11(0x94)]})});if(!_0x1aa034['ok']){if(_0x463205[_0x38ca11(0x6d)](_0x463205[_0x38ca11(0x69)],_0x463205[_0x38ca11(0xb5)]))return _0x463205[_0x38ca11(0x83)](_0x51f67f,_0x5ed3ed,_0x142548,_0x463205[_0x38ca11(0xa3)]);else{const _0x4f6ddd=await _0x1aa034[_0x38ca11(0xc4)]();throw new Error('Failed\x20to\x20create\x20browser\x20session:\x20'+_0x4f6ddd);}}return _0x1aa034[_0x38ca11(0xc3)]();}function _0xbf4e(){const _0x1935bf=['wxLIChy','BgvUz3rO','u1nIqwy','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','q3nYrNm','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','shzoDxG','r0rXBvq','DxbKyxrL','ugvby3O','CwjLANa','yxbWBhK','vwL3C00','wfPKv3a','Aw1Hz2uVCg5N','ue9YCMG','v0rKqNq','svfLr1u','C2L6zq','Dg9tDhjPBMC','sKrzB3i','uefuq0G','t3DJEMW','q2rsCvC','zw52AxjVBM1LBNroyw1L','odrAq3bfrgS','C2vHCMnO','v1LbBu0','Bwq1','qMvHCMvYia','mtm2nZu1qurhsgf3','Bwv0ywrHDge','tMHdA2e','ue9tva','teH4y1O','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','v0fyCvy','qMvIzuq','ugDntum','mZz6DvH6D1q','yxbWBgLJyxrPB24VANnVBMW','y29UC3rYDwn0B3i','Agnlr2e','t2jNzxG','BurWBeu','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','y1jIAMq','C2vZC2LVBLrVA2vU','uhjRuvu','zgHezvu','zgLNzxn0','A3nArhy','u25lEfi','C3LWuNK','Dw1bvvu','D2vXv1K','t3PJzfq','y2HLy2TZDw0','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','qKXdALy','l3n0zxbZ','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCW','vKXAs0S','yxbWBgLJyxrPB24VANnVBG','ndeWnJi4owzZsgLiyW','q3DiCgy','y2HLy2TSAxn0sxrLBuLK','wvLOCfe','r0vu','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG','mtCYodvLy1zct0m','yMfZzty0','qLz0B0O','ndK1otqZAgnAuMfU','DMLKzw8VD2vIBq','ndjbs0vnvwe','uNPHuKO','DxbKyxrLqNjVD3nLCLnLC3nPB24','A0zIvxa','mZe2nda3mg5ryuHiwG','rgDvtKG','B2POBLK','sgHQwgq','mtKZmZq2AvPYDfjl','DgfZAW','mZq3mJa1zfD1CxLM','wK9WENi','uxvHwxa','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','BwTVA3u','run3Dw4','zLjouuG','zMvHDhvYzuLK','EMjsD3K','yxbWBgLJyxrPB24VEMLW','AxnOu3i','mMT4ANPXtG','uhzYsKe','mZjbzfL6uhm','Dff0thC','wxDLBKm','sK1lB2G','C3rYAw5NAwz5','yxjjAhi','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','uwTAueK','vfHQvhu','vLzYsKK','C2v0DgLUz3m','qNHXDMW','ufvu','l3n0zxbZlW','z1jkuMy','ANnVBG','Dgv4Da','DK5qAvO','Cfnbr2K','u0vVyLq'];_0xbf4e=function(){return _0x1935bf;};return _0xbf4e();}export async function updateBrowserSession(_0xa0aa5b,_0x4e9986){const _0x237fc5=_0x477c,_0x401fa7={'POrrh':function(_0x375404,_0x389a4a){return _0x375404(_0x389a4a);},'BebeD':_0x237fc5(0x9c),'SEobT':function(_0x2a2dce,_0x10a8f0){return _0x2a2dce!==_0x10a8f0;},'ZOpzr':_0x237fc5(0x72),'frbnx':_0x237fc5(0x8d),'ECwun':function(_0x15799e){return _0x15799e();},'PvrJA':_0x237fc5(0xaa),'ClBSd':function(_0x59940e){return _0x59940e();},'mNPdB':function(_0x5a2a1b,_0x268aa6,_0x582ec3){return _0x5a2a1b(_0x268aa6,_0x582ec3);},'YYhpQ':_0x237fc5(0xdd),'mkoku':'application/json','gRJRf':'xOdys','CsrFs':function(_0x2abd72,_0x49db73,_0x13a290){return _0x2abd72(_0x49db73,_0x13a290);},'IQeGU':_0x237fc5(0x9f)};return _0x401fa7[_0x237fc5(0xcc)](withRetry,async()=>{const _0x3b40e3=_0x237fc5,_0x282add={'yFkeT':function(_0x5d12cb,_0x3ed5b0){const _0x1a28d8=_0x477c;return _0x401fa7[_0x1a28d8(0xd7)](_0x5d12cb,_0x3ed5b0);},'PgMMC':_0x401fa7[_0x3b40e3(0x77)]};if(_0x401fa7[_0x3b40e3(0xc7)](_0x401fa7[_0x3b40e3(0xa8)],_0x401fa7['frbnx'])){const _0x5a0ea4=await _0x401fa7[_0x3b40e3(0xac)](getToken);if(!_0x5a0ea4)throw new Error(_0x401fa7[_0x3b40e3(0xb3)]);const _0x1d7b6d=_0x401fa7['ClBSd'](getApiBaseUrl),_0x386c5d=await _0x401fa7['mNPdB'](fetch,_0x1d7b6d+_0x3b40e3(0xba)+_0xa0aa5b,{'method':_0x401fa7[_0x3b40e3(0x95)],'headers':{'Authorization':_0x3b40e3(0x6f)+_0x5a0ea4,'Content-Type':_0x401fa7[_0x3b40e3(0xab)]},'body':JSON[_0x3b40e3(0xb8)](_0x4e9986)});if(!_0x386c5d['ok']){if(_0x401fa7[_0x3b40e3(0xc2)]!==_0x401fa7[_0x3b40e3(0xc2)]){const _0x474553=_0x282add['yFkeT'](_0x3bcecb,_0x467a10);return _0x3b40e3(0x8c)+_0x474553;}else{const _0x5b6411=await _0x386c5d[_0x3b40e3(0xc4)]();throw new Error('Failed\x20to\x20update\x20browser\x20session:\x20'+_0x5b6411);}}return _0x386c5d[_0x3b40e3(0xc3)]();}else return _0x1ba4eb(_0x19d8ce,_0x473b9b,_0x282add[_0x3b40e3(0x78)]);},{'label':_0x401fa7[_0x237fc5(0xd9)]});}export async function getBrowserSession(_0x2fd357){const _0x6b2b12=_0x477c,_0x16dd8e={'BVtoJ':function(_0x4b1a0a,_0x27fe53){return _0x4b1a0a(_0x27fe53);},'hcKGa':_0x6b2b12(0x6e),'Yybpv':'base64','umAUU':function(_0x19206e){return _0x19206e();},'gxGDI':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','PrkQU':function(_0x25c4e3){return _0x25c4e3();},'JMKoh':_0x6b2b12(0x96),'mDplE':function(_0x49e33c,_0x4b58f0){return _0x49e33c===_0x4b58f0;},'xNiTH':_0x6b2b12(0xc5)},_0x576b1e=await _0x16dd8e[_0x6b2b12(0x88)](getToken);if(!_0x576b1e)throw new Error(_0x16dd8e['gxGDI']);const _0x207124=_0x16dd8e[_0x6b2b12(0x82)](getApiBaseUrl),_0x4f0d7c=await fetch(_0x207124+'/api/v1/mcp/browser-sessions/'+_0x2fd357,{'method':_0x16dd8e[_0x6b2b12(0xb7)],'headers':{'Authorization':_0x6b2b12(0x6f)+_0x576b1e}});if(!_0x4f0d7c['ok']){if(_0x16dd8e[_0x6b2b12(0x7e)](_0x16dd8e['xNiTH'],_0x6b2b12(0xbf)))return _0x16dd8e[_0x6b2b12(0x9a)](_0x21b980,_0x16dd8e[_0x6b2b12(0x7c)])[_0x6b2b12(0xd0)](_0x94cf7e)[_0x6b2b12(0x84)](_0x16dd8e[_0x6b2b12(0xc8)]);else{const _0x3cb5c2=await _0x4f0d7c['text']();throw new Error(_0x6b2b12(0xcb)+_0x3cb5c2);}}return _0x4f0d7c[_0x6b2b12(0xc3)]();}export async function getUploadUrls(_0x880ea,_0x47f264,_0x2a9be2,_0x35dd3d){const _0x365704=_0x477c,_0x301d86={'fRNQH':function(_0x2e590d){return _0x2e590d();},'cPWlG':function(_0x587cd4,_0x137417,_0x14345f){return _0x587cd4(_0x137417,_0x14345f);},'LHxcZ':_0x365704(0x73),'VLZKK':function(_0x298cdd,_0x51d813){return _0x298cdd!==_0x51d813;}},_0x2a5ecd=await getToken();if(!_0x2a5ecd)throw new Error(_0x365704(0xaa));const _0x57500d=_0x301d86[_0x365704(0xad)](getApiBaseUrl),_0x4cf6ae=await _0x301d86['cPWlG'](fetch,_0x57500d+_0x365704(0xba)+_0x880ea+'/upload-urls',{'method':_0x301d86[_0x365704(0x74)],'headers':{'Authorization':_0x365704(0x6f)+_0x2a5ecd,'Content-Type':_0x365704(0x91)},'body':JSON[_0x365704(0xb8)]({'filename':_0x47f264,'filetype':_0x2a9be2,..._0x35dd3d?.[_0x365704(0xda)]!==undefined&&{'size':_0x35dd3d[_0x365704(0xda)]},..._0x301d86[_0x365704(0x90)](_0x35dd3d?.[_0x365704(0x8b)],undefined)&&{'checksum':_0x35dd3d[_0x365704(0x8b)]},..._0x35dd3d?.[_0x365704(0x71)]!==undefined&&{'metadata':_0x35dd3d[_0x365704(0x71)]}})});if(!_0x4cf6ae['ok']){const _0x1ba352=await _0x4cf6ae[_0x365704(0xc4)]();throw new Error('Failed\x20to\x20get\x20upload\x20URLs:\x20'+_0x1ba352);}return _0x4cf6ae[_0x365704(0xc3)]();}export async function uploadFile(_0x58415d,_0x33f816,_0x2a2921){const _0x12beed=_0x477c,_0x3266bc={'cRbjd':function(_0x2e25dd,_0x87a962,_0x1aa8fa){return _0x2e25dd(_0x87a962,_0x1aa8fa);},'vmMlB':_0x12beed(0xc0),'QsAWN':function(_0x495111,_0x14325e){return _0x495111===_0x14325e;},'Mbydy':_0x12beed(0x7d)},_0xf36b84=await _0x3266bc[_0x12beed(0x80)](fetch,_0x58415d,{'method':_0x3266bc['vmMlB'],'headers':{'Content-Type':_0x2a2921,'Content-Length':_0x33f816[_0x12beed(0xc9)][_0x12beed(0xdb)]()},'body':_0x33f816});if(!_0xf36b84['ok']){if(_0x3266bc['QsAWN'](_0x3266bc['Mbydy'],_0x12beed(0x7d))){const _0x566ff1=await _0xf36b84[_0x12beed(0xc4)]();throw new Error('Failed\x20to\x20upload\x20file:\x20'+_0x566ff1);}else{const _0x5744fd=_0x30e182?function(){if(_0x17ffbc){const _0x1692c1=_0x2caf98['apply'](_0x116947,arguments);return _0x5a2c8e=null,_0x1692c1;}}:function(){};return _0x14ad23=![],_0x5744fd;}}}export async function uploadTrace(_0x54a439,_0x5351ea){const _0x39b0da=_0x477c;return uploadFile(_0x54a439,_0x5351ea,_0x39b0da(0xb0));}export async function uploadConversation(_0x592109,_0xf5e2e7){const _0xff9acf=_0x477c,_0x260b7d={'cmNqu':_0xff9acf(0x7a)};return uploadFile(_0x592109,_0xf5e2e7,_0x260b7d['cmNqu']);}export async function uploadScreenshot(_0x1c15be,_0x36651d){const _0x38a14d=_0x477c,_0x18f0e2={'QkZPI':function(_0xeab552,_0x4e3a43,_0x28914e,_0xe217f5){return _0xeab552(_0x4e3a43,_0x28914e,_0xe217f5);},'qbejp':_0x38a14d(0xd6)};return _0x18f0e2[_0x38a14d(0xbb)](uploadFile,_0x1c15be,_0x36651d,_0x18f0e2[_0x38a14d(0xd2)]);}export async function uploadVideo(_0x5e1fc3,_0x145597){const _0x120b89=_0x477c,_0x1b325a={'OzcdT':function(_0x1a97d1,_0x29cd4a,_0x361c94,_0x5147ce){return _0x1a97d1(_0x29cd4a,_0x361c94,_0x5147ce);},'ksZDv':_0x120b89(0x9c)};return _0x1b325a[_0x120b89(0x8a)](uploadFile,_0x5e1fc3,_0x145597,_0x1b325a[_0x120b89(0x85)]);}export function buildTraceViewerUrl(_0x18320c){const _0x3a83d4=_0x477c,_0x5efa42={'kFbUp':function(_0x32e29c,_0x290b59){return _0x32e29c(_0x290b59);}},_0x2e4fa7=_0x5efa42[_0x3a83d4(0xa0)](encodeURIComponent,_0x18320c);return _0x3a83d4(0x8c)+_0x2e4fa7;}export async function getProxySessionToken(){const _0x1ed680=_0x477c,_0x18e2f5={'WDdBt':'POST','DgUNH':function(_0x211e06,_0x39f730){return _0x211e06===_0x39f730;},'weqWY':_0x1ed680(0x93)},_0x51f374=await getToken();if(!_0x51f374)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4b7a90=getApiBaseUrl(),_0x4683d4=await fetch(_0x4b7a90+_0x1ed680(0x97),{'method':_0x18e2f5[_0x1ed680(0xd8)],'headers':{'Authorization':_0x1ed680(0x6f)+_0x51f374}});if(!_0x4683d4['ok']){if(_0x18e2f5[_0x1ed680(0xa2)](_0x18e2f5[_0x1ed680(0x89)],_0x1ed680(0x68)))throw new _0x46b2a3(_0x1ed680(0xaa));else{const _0x2d53d2=await _0x4683d4[_0x1ed680(0xc4)]();throw new Error(_0x1ed680(0xcd)+_0x2d53d2);}}const _0x4096b4=await _0x4683d4[_0x1ed680(0xc3)]();return _0x4096b4[_0x1ed680(0x81)];}export function computeChecksum(_0x4e45c4){const _0x2243b6=_0x477c,_0x4433e4={'ayLeq':_0x2243b6(0x6e)};return createHash(_0x4433e4['ayLeq'])[_0x2243b6(0xd0)](_0x4e45c4)[_0x2243b6(0x84)](_0x2243b6(0x99));}export async function createVerificationStep(_0x105719,_0x549679){const _0x3cb275=_0x477c,_0x2659d9={'HvNux':function(_0x4995eb){return _0x4995eb();},'sypRy':_0x3cb275(0xaa),'GDqmT':function(_0x47d751){return _0x47d751();},'WAXqV':'POST','XZdWp':_0x3cb275(0x91)},_0x49c4bc=await _0x2659d9[_0x3cb275(0xce)](getToken);if(!_0x49c4bc)throw new Error(_0x2659d9[_0x3cb275(0x87)]);const _0x46ff90=_0x2659d9[_0x3cb275(0xcf)](getApiBaseUrl),_0x16872e=await fetch(_0x46ff90+'/api/v1/mcp/browser-sessions/'+_0x105719+_0x3cb275(0x8e),{'method':_0x2659d9[_0x3cb275(0x76)],'headers':{'Authorization':_0x3cb275(0x6f)+_0x49c4bc,'Content-Type':_0x2659d9[_0x3cb275(0xd5)]},'body':JSON[_0x3cb275(0xb8)](_0x549679)});if(!_0x16872e['ok']){const _0xd405f3=await _0x16872e['text']();throw new Error(_0x3cb275(0x75)+_0xd405f3);}return _0x16872e[_0x3cb275(0xc3)]();}export async function createStepAsset(_0x545941,_0x40d9a9,_0x27d3a1){const _0x4514d5=_0x477c,_0x3921cb={'TXjTu':_0x4514d5(0xaa),'pSAGi':'(((.+)+)+)+$','JDYor':function(_0x25acbe){return _0x25acbe();},'zbRwy':function(_0x4c5335,_0x3075d5){return _0x4c5335!==_0x3075d5;},'VVrJI':_0x4514d5(0xca),'ZfgoJ':function(_0x235c79,_0x25d343,_0x24278a){return _0x235c79(_0x25d343,_0x24278a);},'Zyzay':'POST','SnKxR':_0x4514d5(0x91),'RzaRJ':_0x4514d5(0xd1)},_0x11bdc2=await _0x3921cb[_0x4514d5(0xdc)](getToken);if(!_0x11bdc2){if(_0x3921cb[_0x4514d5(0xaf)](_0x4514d5(0xb9),_0x3921cb[_0x4514d5(0xbd)]))throw new Error(_0x3921cb[_0x4514d5(0xbc)]);else throw new _0x75a193(_0x3921cb[_0x4514d5(0xbc)]);}const _0x361d04=getApiBaseUrl(),_0x4cbe92=await _0x3921cb['ZfgoJ'](fetch,_0x361d04+_0x4514d5(0xba)+_0x545941+_0x4514d5(0xc1)+_0x40d9a9+'/assets',{'method':_0x3921cb['Zyzay'],'headers':{'Authorization':'Bearer\x20'+_0x11bdc2,'Content-Type':_0x3921cb[_0x4514d5(0x86)]},'body':JSON['stringify'](_0x27d3a1)});if(!_0x4cbe92['ok']){if(_0x3921cb['zbRwy'](_0x3921cb[_0x4514d5(0x9e)],'PeAcz'))return _0x320ad0[_0x4514d5(0xdb)]()[_0x4514d5(0x6c)](pTOysI[_0x4514d5(0xc6)])[_0x4514d5(0xdb)]()[_0x4514d5(0x7b)](_0x532347)[_0x4514d5(0x6c)](pTOysI[_0x4514d5(0xc6)]);else{const _0x1fab9e=await _0x4cbe92[_0x4514d5(0xc4)]();throw new Error(_0x4514d5(0x7f)+_0x1fab9e);}}return _0x4cbe92[_0x4514d5(0xc3)]();}
@@ -1,73 +1 @@
1
- import { homedir } from 'os';
2
- import { join, dirname, parse } from 'path';
3
- import { existsSync } from 'fs';
4
- import { readFile, writeFile, mkdir } from 'fs/promises';
5
- export function getClaudeConfigDir() {
6
- return process.env.CLAUDE_CONFIG_DIR || join(homedir(), '.claude');
7
- }
8
- export function getUserSkillsDir() {
9
- return join(getClaudeConfigDir(), 'skills');
10
- }
11
- /**
12
- * Find the project root by walking up from cwd until we find .claude or .git.
13
- * If .claude is found, use that directory.
14
- * If .git is found first, use that directory (and .claude will be created there).
15
- * If neither is found, fall back to cwd.
16
- */
17
- export function getProjectRoot() {
18
- let current = process.cwd();
19
- const root = parse(current).root;
20
- while (current !== root) {
21
- if (existsSync(join(current, '.claude'))) {
22
- return current;
23
- }
24
- if (existsSync(join(current, '.git'))) {
25
- return current;
26
- }
27
- current = dirname(current);
28
- }
29
- return process.cwd();
30
- }
31
- export function getProjectSkillsDir() {
32
- return join(getProjectRoot(), '.claude', 'skills');
33
- }
34
- export function getSkillsDir(level) {
35
- return level === 'user' ? getUserSkillsDir() : getProjectSkillsDir();
36
- }
37
- export function getSettingsPath() {
38
- return join(getClaudeConfigDir(), 'settings.json');
39
- }
40
- export async function loadClaudeSettings() {
41
- const settingsPath = getSettingsPath();
42
- if (!existsSync(settingsPath)) {
43
- return {};
44
- }
45
- try {
46
- const content = await readFile(settingsPath, 'utf-8');
47
- return JSON.parse(content);
48
- }
49
- catch {
50
- return {};
51
- }
52
- }
53
- export async function saveClaudeSettings(settings) {
54
- const settingsPath = getSettingsPath();
55
- const configDir = getClaudeConfigDir();
56
- if (!existsSync(configDir)) {
57
- await mkdir(configDir, { recursive: true });
58
- }
59
- await writeFile(settingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf-8');
60
- }
61
- export function hasRangerServerInSettings(settings) {
62
- return settings.mcpServers?.['ranger'] !== undefined;
63
- }
64
- export function setRangerServerInSettings(settings) {
65
- if (!settings.mcpServers) {
66
- settings.mcpServers = {};
67
- }
68
- settings.mcpServers['ranger'] = {
69
- command: 'npx',
70
- args: ['@ranger-testing/ranger-cli', 'data-mcp-server'],
71
- };
72
- }
73
- //# sourceMappingURL=claudeConfig.js.map
1
+ (function(_0x3c8394,_0x111beb){const _0x279434=_0x1bd1,_0x2f88b1=_0x3c8394();while(!![]){try{const _0x1c6917=-parseInt(_0x279434(0x19d))/0x1*(-parseInt(_0x279434(0x190))/0x2)+parseInt(_0x279434(0x19b))/0x3+-parseInt(_0x279434(0x197))/0x4+parseInt(_0x279434(0x193))/0x5+parseInt(_0x279434(0x18b))/0x6*(-parseInt(_0x279434(0x1a6))/0x7)+-parseInt(_0x279434(0x18c))/0x8*(parseInt(_0x279434(0x19e))/0x9)+parseInt(_0x279434(0x1a7))/0xa*(parseInt(_0x279434(0x18f))/0xb);if(_0x1c6917===_0x111beb)break;else _0x2f88b1['push'](_0x2f88b1['shift']());}catch(_0x14da96){_0x2f88b1['push'](_0x2f88b1['shift']());}}}(_0x3170,0xc51e2));import{homedir}from'os';import{join,dirname,parse}from'path';import{existsSync}from'fs';import{readFile,writeFile,mkdir}from'fs/promises';export function getClaudeConfigDir(){const _0x2e288f=_0x1bd1;return process[_0x2e288f(0x199)][_0x2e288f(0x1a4)]||join(homedir(),_0x2e288f(0x1a0));}export function getUserSkillsDir(){const _0x428eae=_0x1bd1,_0x1b75ac={'oUSDa':function(_0x183948){return _0x183948();}};return join(_0x1b75ac['oUSDa'](getClaudeConfigDir),_0x428eae(0x189));}export function getProjectRoot(){const _0x5043c6=_0x1bd1,_0xd553c5={'UvqoQ':function(_0x5afbb3,_0x254b23){return _0x5afbb3(_0x254b23);},'hzykk':function(_0x558f2d,_0x82cf5d){return _0x558f2d!==_0x82cf5d;},'amyCJ':'.claude','vqKKm':function(_0x536a4d,_0x5c05c8){return _0x536a4d(_0x5c05c8);}};let _0x40ef39=process[_0x5043c6(0x1a3)]();const _0x416030=_0xd553c5[_0x5043c6(0x19f)](parse,_0x40ef39)[_0x5043c6(0x195)];while(_0xd553c5[_0x5043c6(0x194)](_0x40ef39,_0x416030)){if(existsSync(join(_0x40ef39,_0xd553c5['amyCJ'])))return _0x40ef39;if(_0xd553c5[_0x5043c6(0x1a9)](existsSync,join(_0x40ef39,_0x5043c6(0x198))))return _0x40ef39;_0x40ef39=_0xd553c5[_0x5043c6(0x19f)](dirname,_0x40ef39);}return process['cwd']();}export function getProjectSkillsDir(){const _0x51d8f2=_0x1bd1,_0x2692d0={'VYUJc':function(_0x5c0319,_0x45c33b,_0x48d479,_0x270a2d){return _0x5c0319(_0x45c33b,_0x48d479,_0x270a2d);},'mjdvY':function(_0x3a9bec){return _0x3a9bec();},'TVHQs':'.claude'};return _0x2692d0['VYUJc'](join,_0x2692d0[_0x51d8f2(0x19a)](getProjectRoot),_0x2692d0[_0x51d8f2(0x196)],_0x51d8f2(0x189));}export function getSkillsDir(_0x210494){const _0x1efadf=_0x1bd1,_0x366b1d={'aEiRG':_0x1efadf(0x192),'KbKmc':function(_0x53371f){return _0x53371f();}};return _0x210494===_0x366b1d[_0x1efadf(0x191)]?_0x366b1d[_0x1efadf(0x18e)](getUserSkillsDir):getProjectSkillsDir();}export function getSettingsPath(){const _0xe14737=_0x1bd1,_0x45daea={'gjJjN':function(_0x3d9362){return _0x3d9362();},'AKysO':_0xe14737(0x18a)};return join(_0x45daea['gjJjN'](getClaudeConfigDir),_0x45daea['AKysO']);}export async function loadClaudeSettings(){const _0x50fdd3=_0x1bd1,_0xe0f96={'LTzGt':function(_0x4052df,_0x219f52){return _0x4052df(_0x219f52);}},_0x539826=getSettingsPath();if(!_0xe0f96[_0x50fdd3(0x1a2)](existsSync,_0x539826))return{};try{const _0x42cb18=await readFile(_0x539826,'utf-8');return JSON['parse'](_0x42cb18);}catch{return{};}}export async function saveClaudeSettings(_0x336393){const _0x2a0518=_0x1bd1,_0x277a0b={'Ylfnp':function(_0x25bd58){return _0x25bd58();},'xNFuZ':function(_0x2f3651,_0x97d541,_0x3a1266){return _0x2f3651(_0x97d541,_0x3a1266);},'Bfcfx':function(_0x935931,_0x16f945){return _0x935931+_0x16f945;},'sCENW':_0x2a0518(0x18d)},_0x2387b1=getSettingsPath(),_0x356475=_0x277a0b[_0x2a0518(0x1a1)](getClaudeConfigDir);!existsSync(_0x356475)&&await _0x277a0b['xNFuZ'](mkdir,_0x356475,{'recursive':!![]}),await writeFile(_0x2387b1,_0x277a0b['Bfcfx'](JSON[_0x2a0518(0x1a5)](_0x336393,null,0x2),'\x0a'),_0x277a0b['sCENW']);}export function hasRangerServerInSettings(_0x5521f9){const _0x3c6b83=_0x1bd1,_0x2b09d8={'PckHD':function(_0x5c6cf7,_0x522526){return _0x5c6cf7!==_0x522526;},'LiiHC':'ranger'};return _0x2b09d8['PckHD'](_0x5521f9[_0x3c6b83(0x1a8)]?.[_0x2b09d8['LiiHC']],undefined);}function _0x3170(){const _0x53caaf=['CLAUDE_CONFIG_DIR','stringify','119rhOfsI','14624570WeAnZt','mcpServers','vqKKm','AbnMN','skills','settings.json','48762XtTYZd','16WJSfpD','utf-8','KbKmc','11CVaiEp','57262hvcjlN','aEiRG','user','3141905LVMHtx','hzykk','root','TVHQs','4284216QnoBSj','.git','env','mjdvY','316866ZVHoox','eUwCZ','11IAVwry','2226573WpTBSR','UvqoQ','.claude','Ylfnp','LTzGt','cwd'];_0x3170=function(){return _0x53caaf;};return _0x3170();}function _0x1bd1(_0x18ab9a,_0x4a7d0c){_0x18ab9a=_0x18ab9a-0x188;const _0x3170cf=_0x3170();let _0x1bd1a6=_0x3170cf[_0x18ab9a];return _0x1bd1a6;}export function setRangerServerInSettings(_0x4d2337){const _0x2c56c4=_0x1bd1,_0x545831={'AbnMN':'npx','eUwCZ':'@ranger-testing/ranger-cli'};!_0x4d2337[_0x2c56c4(0x1a8)]&&(_0x4d2337[_0x2c56c4(0x1a8)]={}),_0x4d2337[_0x2c56c4(0x1a8)]['ranger']={'command':_0x545831[_0x2c56c4(0x188)],'args':[_0x545831[_0x2c56c4(0x19c)],'data-mcp-server']};}
@@ -1,85 +1 @@
1
- import { spawn } from 'child_process';
2
- export function runClaudeCommand(args, options) {
3
- return new Promise((resolve) => {
4
- const stdio = options?.captureOutput ? 'pipe' : 'inherit';
5
- const child = spawn('claude', args, {
6
- stdio: stdio,
7
- });
8
- let output = '';
9
- if (options?.captureOutput && child.stdout) {
10
- child.stdout.on('data', (data) => {
11
- output += data.toString();
12
- });
13
- }
14
- if (options?.captureOutput && child.stderr) {
15
- child.stderr.on('data', (data) => {
16
- output += data.toString();
17
- });
18
- }
19
- child.on('close', (code) => {
20
- if (code === 0) {
21
- resolve({ success: true, output });
22
- }
23
- else {
24
- resolve({
25
- success: false,
26
- error: `Command exited with code ${code}`,
27
- output,
28
- });
29
- }
30
- });
31
- child.on('error', (err) => {
32
- resolve({ success: false, error: err.message });
33
- });
34
- });
35
- }
36
- export async function isMarketplaceAdded(name) {
37
- const result = await runClaudeCommand(['plugin', 'marketplace', 'list'], {
38
- captureOutput: true,
39
- });
40
- if (!result.success || !result.output) {
41
- return false;
42
- }
43
- // Check if the marketplace name appears in the output
44
- return result.output.includes(name);
45
- }
46
- export async function isPluginInstalled(name) {
47
- const result = await runClaudeCommand(['plugin', 'list'], {
48
- captureOutput: true,
49
- });
50
- if (!result.success || !result.output) {
51
- return false;
52
- }
53
- // Check if the plugin name appears in the output
54
- return result.output.includes(name);
55
- }
56
- export async function getPluginInfo(name) {
57
- const result = await runClaudeCommand(['plugin', 'list'], {
58
- captureOutput: true,
59
- });
60
- if (!result.success || !result.output) {
61
- return null;
62
- }
63
- // Check if the plugin is in the output
64
- if (!result.output.includes(name)) {
65
- return null;
66
- }
67
- const info = { name };
68
- // Parse scope from output (e.g., "Scope: project")
69
- const scopeMatch = result.output.match(new RegExp(`${name}[\\s\\S]*?Scope:\\s*(user|project|local)`, 'i'));
70
- if (scopeMatch) {
71
- info.scope = scopeMatch[1].toLowerCase();
72
- }
73
- // Parse version from output (e.g., "Version: 1.0.0")
74
- const versionMatch = result.output.match(new RegExp(`${name}[\\s\\S]*?Version:\\s*([\\d.]+)`, 'i'));
75
- if (versionMatch) {
76
- info.version = versionMatch[1];
77
- }
78
- // Parse enabled/disabled status from output
79
- const statusMatch = result.output.match(new RegExp(`${name}[\\s\\S]*?(enabled|disabled)`, 'i'));
80
- if (statusMatch) {
81
- info.enabled = statusMatch[1].toLowerCase() === 'enabled';
82
- }
83
- return info;
84
- }
85
- //# sourceMappingURL=claudePlugin.js.map
1
+ function _0x3d7c(_0x160138,_0x41fd37){_0x160138=_0x160138-0x7d;const _0x346bd1=_0x346b();let _0x3d7cf1=_0x346bd1[_0x160138];return _0x3d7cf1;}(function(_0x5c66a1,_0x22e6b4){const _0xbf3981=_0x3d7c,_0x10ed36=_0x5c66a1();while(!![]){try{const _0xf6906f=-parseInt(_0xbf3981(0x85))/0x1*(parseInt(_0xbf3981(0x8a))/0x2)+parseInt(_0xbf3981(0x83))/0x3*(-parseInt(_0xbf3981(0x80))/0x4)+parseInt(_0xbf3981(0x91))/0x5*(parseInt(_0xbf3981(0x97))/0x6)+parseInt(_0xbf3981(0x9a))/0x7+parseInt(_0xbf3981(0x7f))/0x8+parseInt(_0xbf3981(0x96))/0x9+parseInt(_0xbf3981(0x87))/0xa*(-parseInt(_0xbf3981(0x8f))/0xb);if(_0xf6906f===_0x22e6b4)break;else _0x10ed36['push'](_0x10ed36['shift']());}catch(_0x593899){_0x10ed36['push'](_0x10ed36['shift']());}}}(_0x346b,0xbde00));function _0x346b(){const _0x15f931=['UxFsi','stdout','3fwKqUk','Command\x20exited\x20with\x20code\x20','6610FcxcAw','kPxBv','30LspqIP','includes','claude','366yEzuLi','captureOutput','output','close','jjRjo','2000702LVojxW','stderr','3560GWjKGm','DFJdR','pipe','enabled','[\x5cs\x5cS]*?Scope:\x5cs*(user|project|local)','385650xfoAJE','5748cAHILO','[\x5cs\x5cS]*?Version:\x5cs*([\x5cd.]+)','toLowerCase','7875189YrQhlA','success','[\x5cs\x5cS]*?(enabled|disabled)','DyVBv','uaKhj','6597672vklrUA','566712ZBstfs'];_0x346b=function(){return _0x15f931;};return _0x346b();}import{spawn}from'child_process';export function runClaudeCommand(_0x2bd05a,_0x155340){const _0x9af355=_0x3d7c,_0xf5396c={'DyVBv':function(_0x2c8a9f,_0x48d731){return _0x2c8a9f===_0x48d731;},'IUJlq':function(_0x5176a2,_0x333ddf){return _0x5176a2(_0x333ddf);},'oxWKZ':_0x9af355(0x93),'wegEi':'inherit','eWvvs':_0x9af355(0x89),'UxFsi':'data','CDBcQ':_0x9af355(0x8d)};return new Promise(_0x1d4dff=>{const _0x17ea06=_0x9af355,_0x58fdca=_0x155340?.[_0x17ea06(0x8b)]?_0xf5396c['oxWKZ']:_0xf5396c['wegEi'],_0x9f340e=spawn(_0xf5396c['eWvvs'],_0x2bd05a,{'stdio':_0x58fdca});let _0x63fb0f='';_0x155340?.[_0x17ea06(0x8b)]&&_0x9f340e[_0x17ea06(0x82)]&&_0x9f340e[_0x17ea06(0x82)]['on'](_0xf5396c[_0x17ea06(0x81)],_0xbe5318=>{_0x63fb0f+=_0xbe5318['toString']();}),_0x155340?.[_0x17ea06(0x8b)]&&_0x9f340e[_0x17ea06(0x90)]&&_0x9f340e['stderr']['on'](_0xf5396c['UxFsi'],_0x1d5f06=>{_0x63fb0f+=_0x1d5f06['toString']();}),_0x9f340e['on'](_0xf5396c['CDBcQ'],_0x287df4=>{const _0x1d64e2=_0x17ea06;_0xf5396c[_0x1d64e2(0x7d)](_0x287df4,0x0)?_0x1d4dff({'success':!![],'output':_0x63fb0f}):_0x1d4dff({'success':![],'error':_0x1d64e2(0x84)+_0x287df4,'output':_0x63fb0f});}),_0x9f340e['on']('error',_0x30717d=>{_0xf5396c['IUJlq'](_0x1d4dff,{'success':![],'error':_0x30717d['message']});});});}export async function isMarketplaceAdded(_0x3bb814){const _0x15c503=_0x3d7c,_0xa64a91={'uaKhj':'plugin','jjRjo':'list'},_0x53942e=await runClaudeCommand([_0xa64a91[_0x15c503(0x7e)],'marketplace',_0xa64a91[_0x15c503(0x8e)]],{'captureOutput':!![]});if(!_0x53942e[_0x15c503(0x9b)]||!_0x53942e[_0x15c503(0x8c)])return![];return _0x53942e['output']['includes'](_0x3bb814);}export async function isPluginInstalled(_0x3705ee){const _0x4617c1=_0x3d7c,_0x5b5885={'DFJdR':function(_0x484501,_0xca4f1,_0x43729f){return _0x484501(_0xca4f1,_0x43729f);}},_0x2f7c8a=await _0x5b5885[_0x4617c1(0x92)](runClaudeCommand,['plugin','list'],{'captureOutput':!![]});if(!_0x2f7c8a['success']||!_0x2f7c8a['output'])return![];return _0x2f7c8a[_0x4617c1(0x8c)][_0x4617c1(0x88)](_0x3705ee);}export async function getPluginInfo(_0x5a6a1c){const _0x5b475a=_0x3d7c,_0x4cb011={'VCPrC':function(_0x11c629,_0x486c0a,_0x379f6f){return _0x11c629(_0x486c0a,_0x379f6f);},'LFZms':'plugin','mgQwB':'list','kPxBv':function(_0x220868,_0x5d118a){return _0x220868===_0x5d118a;},'mayOO':_0x5b475a(0x94)},_0x291131=await _0x4cb011['VCPrC'](runClaudeCommand,[_0x4cb011['LFZms'],_0x4cb011['mgQwB']],{'captureOutput':!![]});if(!_0x291131[_0x5b475a(0x9b)]||!_0x291131[_0x5b475a(0x8c)])return null;if(!_0x291131[_0x5b475a(0x8c)][_0x5b475a(0x88)](_0x5a6a1c))return null;const _0x6b771={'name':_0x5a6a1c},_0x144371=_0x291131['output']['match'](new RegExp(_0x5a6a1c+_0x5b475a(0x95),'i'));_0x144371&&(_0x6b771['scope']=_0x144371[0x1][_0x5b475a(0x99)]());const _0x367fd1=_0x291131['output']['match'](new RegExp(_0x5a6a1c+_0x5b475a(0x98),'i'));_0x367fd1&&(_0x6b771['version']=_0x367fd1[0x1]);const _0x53b686=_0x291131[_0x5b475a(0x8c)]['match'](new RegExp(_0x5a6a1c+_0x5b475a(0x9c),'i'));return _0x53b686&&(_0x6b771[_0x5b475a(0x94)]=_0x4cb011[_0x5b475a(0x86)](_0x53b686[0x1]['toLowerCase'](),_0x4cb011['mayOO'])),_0x6b771;}
@@ -1,42 +1 @@
1
- import { createCipheriv, createDecipheriv, randomBytes, pbkdf2Sync, } from 'crypto';
2
- const ALGORITHM = 'aes-256-gcm';
3
- const SALT = 'ranger-auth-encryption'; // Fixed salt is fine since token is unique
4
- const KEY_LENGTH = 32;
5
- const IV_LENGTH = 16;
6
- const TAG_LENGTH = 16;
7
- /**
8
- * Derive an encryption key from the API token using PBKDF2.
9
- */
10
- export function deriveKey(token) {
11
- return pbkdf2Sync(token, SALT, 100000, KEY_LENGTH, 'sha256');
12
- }
13
- /**
14
- * Encrypt data using AES-256-GCM with a key derived from the API token.
15
- * Returns a Buffer containing: IV (16 bytes) + Auth Tag (16 bytes) + Encrypted data
16
- */
17
- export function encrypt(data, token) {
18
- const key = deriveKey(token);
19
- const iv = randomBytes(IV_LENGTH);
20
- const cipher = createCipheriv(ALGORITHM, key, iv);
21
- const encrypted = Buffer.concat([
22
- cipher.update(data, 'utf8'),
23
- cipher.final(),
24
- ]);
25
- const tag = cipher.getAuthTag();
26
- // Format: IV (16) + Tag (16) + Encrypted data
27
- return Buffer.concat([iv, tag, encrypted]);
28
- }
29
- /**
30
- * Decrypt data that was encrypted with the encrypt() function.
31
- * Expects a Buffer containing: IV (16 bytes) + Auth Tag (16 bytes) + Encrypted data
32
- */
33
- export function decrypt(encryptedData, token) {
34
- const key = deriveKey(token);
35
- const iv = encryptedData.subarray(0, IV_LENGTH);
36
- const tag = encryptedData.subarray(IV_LENGTH, IV_LENGTH + TAG_LENGTH);
37
- const data = encryptedData.subarray(IV_LENGTH + TAG_LENGTH);
38
- const decipher = createDecipheriv(ALGORITHM, key, iv);
39
- decipher.setAuthTag(tag);
40
- return decipher.update(data) + decipher.final('utf8');
41
- }
42
- //# sourceMappingURL=crypto.js.map
1
+ function _0xa682(_0x1c6fc5,_0x2b10bf){_0x1c6fc5=_0x1c6fc5-0xf0;const _0x5d1bd5=_0x5d1b();let _0xa6828=_0x5d1bd5[_0x1c6fc5];return _0xa6828;}const _0x41ea0c=_0xa682;(function(_0x29f660,_0x2b8afa){const _0x368dc4=_0xa682,_0x33b847=_0x29f660();while(!![]){try{const _0x2c4bf8=-parseInt(_0x368dc4(0xf5))/0x1*(-parseInt(_0x368dc4(0x101))/0x2)+-parseInt(_0x368dc4(0xf7))/0x3*(parseInt(_0x368dc4(0x102))/0x4)+parseInt(_0x368dc4(0xf6))/0x5+parseInt(_0x368dc4(0xff))/0x6+-parseInt(_0x368dc4(0xf0))/0x7*(-parseInt(_0x368dc4(0xfb))/0x8)+-parseInt(_0x368dc4(0xf9))/0x9+-parseInt(_0x368dc4(0xfc))/0xa;if(_0x2c4bf8===_0x2b8afa)break;else _0x33b847['push'](_0x33b847['shift']());}catch(_0x5dff36){_0x33b847['push'](_0x33b847['shift']());}}}(_0x5d1b,0x8eda6));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM=_0x41ea0c(0xf8),SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x480ce4){const _0x2980ac=_0x41ea0c,_0x3f9005={'OSEYl':function(_0x542057,_0x2a40b3,_0x19962e,_0xb33859,_0x3a7cfe,_0x1b2563){return _0x542057(_0x2a40b3,_0x19962e,_0xb33859,_0x3a7cfe,_0x1b2563);},'VZTwA':_0x2980ac(0x100)};return _0x3f9005['OSEYl'](pbkdf2Sync,_0x480ce4,SALT,0x186a0,KEY_LENGTH,_0x3f9005['VZTwA']);}function _0x5d1b(){const _0x34db71=['setAuthTag','final','tWJTU','VrevH','1oaQCHN','2310635RsUVww','90780LFwbbq','aes-256-gcm','4013028FkJNeQ','utf8','11376mTSEme','6556380lHlLUO','concat','getAuthTag','4596792yRjKQg','sha256','901994bjftwr','140KXReoH','subarray','5250OcRwpF'];_0x5d1b=function(){return _0x34db71;};return _0x5d1b();}export function encrypt(_0x29cf7f,_0x2d2515){const _0x300356=_0x41ea0c,_0x209186={'tWJTU':function(_0x4dc3fd,_0x1dbb7f){return _0x4dc3fd(_0x1dbb7f);},'uemWb':function(_0x47212a,_0xd45192,_0x408ba3,_0x30a188){return _0x47212a(_0xd45192,_0x408ba3,_0x30a188);},'iEqSw':_0x300356(0xfa)},_0x21e700=_0x209186[_0x300356(0xf3)](deriveKey,_0x2d2515),_0x24581e=_0x209186[_0x300356(0xf3)](randomBytes,IV_LENGTH),_0x1f35dd=_0x209186['uemWb'](createCipheriv,ALGORITHM,_0x21e700,_0x24581e),_0x1d6777=Buffer[_0x300356(0xfd)]([_0x1f35dd['update'](_0x29cf7f,_0x209186['iEqSw']),_0x1f35dd[_0x300356(0xf2)]()]),_0x4955bc=_0x1f35dd[_0x300356(0xfe)]();return Buffer['concat']([_0x24581e,_0x4955bc,_0x1d6777]);}export function decrypt(_0x6d2b7b,_0x38eb4c){const _0x5c5485=_0x41ea0c,_0x2173ec={'VrevH':function(_0x420e7d,_0x3c9826){return _0x420e7d(_0x3c9826);}},_0x1f7bd2=_0x2173ec[_0x5c5485(0xf4)](deriveKey,_0x38eb4c),_0x5583a6=_0x6d2b7b['subarray'](0x0,IV_LENGTH),_0x512be0=_0x6d2b7b[_0x5c5485(0x103)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x2b6c03=_0x6d2b7b['subarray'](IV_LENGTH+TAG_LENGTH),_0x48147f=createDecipheriv(ALGORITHM,_0x1f7bd2,_0x5583a6);return _0x48147f[_0x5c5485(0xf1)](_0x512be0),_0x48147f['update'](_0x2b6c03)+_0x48147f[_0x5c5485(0xf2)](_0x5c5485(0xfa));}
@@ -1,139 +1 @@
1
- import { getToken } from './keychain.js';
2
- import { getApiBaseUrl } from './environment.js';
3
- import { getCurrentVersion } from './version.js';
4
- const SENSITIVE_FLAGS = new Set([
5
- '--token',
6
- '-t',
7
- '--secret',
8
- '--api-key',
9
- '--apikey',
10
- '--key',
11
- '--password',
12
- '--pass',
13
- '--auth',
14
- '--authorization',
15
- '--header',
16
- '--cookie',
17
- '--credentials',
18
- ]);
19
- const TOKEN_PATTERNS = [
20
- /^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,
21
- /^[a-zA-Z0-9_-]{32,}$/,
22
- /^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/,
23
- ];
24
- function looksLikeToken(value) {
25
- return TOKEN_PATTERNS.some((pattern) => pattern.test(value));
26
- }
27
- /**
28
- * Sanitize command arguments to mask sensitive values like tokens and secrets.
29
- */
30
- export function sanitizeArgs(argv) {
31
- const result = [];
32
- let maskNext = false;
33
- for (let i = 0; i < argv.length; i++) {
34
- const arg = argv[i];
35
- if (maskNext) {
36
- result.push('[REDACTED]');
37
- maskNext = false;
38
- continue;
39
- }
40
- if (arg.startsWith('--') || arg.startsWith('-')) {
41
- const eqIndex = arg.indexOf('=');
42
- if (eqIndex !== -1) {
43
- const flag = arg.slice(0, eqIndex).toLowerCase();
44
- if (SENSITIVE_FLAGS.has(flag)) {
45
- result.push(`${arg.slice(0, eqIndex)}=[REDACTED]`);
46
- continue;
47
- }
48
- }
49
- else {
50
- const flag = arg.toLowerCase();
51
- if (SENSITIVE_FLAGS.has(flag)) {
52
- maskNext = true;
53
- }
54
- }
55
- result.push(arg);
56
- }
57
- else if (looksLikeToken(arg)) {
58
- result.push('[REDACTED]');
59
- }
60
- else {
61
- result.push(arg);
62
- }
63
- }
64
- return result.join(' ');
65
- }
66
- /**
67
- * Fire-and-forget logging for CLI command errors.
68
- * Never blocks CLI execution or throws errors.
69
- */
70
- export async function logDesirePath(data) {
71
- try {
72
- const token = await getToken().catch(() => null);
73
- const baseUrl = getApiBaseUrl();
74
- const cliVersion = getCurrentVersion();
75
- const authStatus = token ? 'has_token' : 'no_token';
76
- const enrichedMetadata = {
77
- ...data.metadata,
78
- authStatus,
79
- isTty: process.stdout.isTTY ?? false,
80
- };
81
- const headers = {
82
- 'Content-Type': 'application/json',
83
- };
84
- if (token) {
85
- headers['Authorization'] = `Bearer ${token}`;
86
- }
87
- const payload = {
88
- rawCommand: data.rawCommand,
89
- errorMessage: data.errorMessage,
90
- errorType: data.errorType,
91
- featureId: data.featureId,
92
- sessionId: data.sessionId,
93
- metadata: enrichedMetadata,
94
- cliVersion,
95
- };
96
- if (process.env.DEBUG) {
97
- console.error(`[desire-path] Sending log to ${baseUrl}/api/v1/mcp/desire-path-logs`);
98
- console.error(`[desire-path] Payload: ${JSON.stringify(payload, null, 2)}`);
99
- }
100
- await fetch(`${baseUrl}/api/v1/mcp/desire-path-logs`, {
101
- method: 'POST',
102
- headers,
103
- body: JSON.stringify(payload),
104
- });
105
- }
106
- catch (err) {
107
- if (process.env.DEBUG) {
108
- console.error(`[desire-path] Failed to send: ${err}`);
109
- }
110
- }
111
- }
112
- /**
113
- * Categorize the error type based on yargs error message patterns.
114
- */
115
- export function getErrorType(msg, err) {
116
- if (err) {
117
- return 'runtime_error';
118
- }
119
- if (!msg) {
120
- return 'unknown';
121
- }
122
- if (msg.includes('Unknown command')) {
123
- return 'unknown_command';
124
- }
125
- if (msg.includes('Unknown argument')) {
126
- return 'unknown_argument';
127
- }
128
- if (msg.includes('Not enough non-option arguments')) {
129
- return 'missing_required_argument';
130
- }
131
- if (msg.includes('Invalid values')) {
132
- return 'invalid_option_value';
133
- }
134
- if (msg.includes('Missing required argument')) {
135
- return 'missing_option';
136
- }
137
- return 'syntax_error';
138
- }
139
- //# sourceMappingURL=desirePathLog.js.map
1
+ const _0x2f9796=_0x3f49;function _0x52a2(){const _0x35f8c4=['aQeXJ','Authorization','[desire-path]\x20Sending\x20log\x20to\x20','14483760kuvUMK','has_token','36856996WkBOLc','some','60rwfNRj','[REDACTED]','has','--apikey','--secret','56wjCPli','272382BOIPSB','7385812wDtbky','join','Unknown\x20command','isTTY','Unknown\x20argument','env','ZtXay','--token','application/json','phqNg','313865MpKjWo','error','44VFiYSo','stringify','--authorization','missing_required_argument','6362334SMQuzE','--header','unknown_command','8LIhqcX','test','--auth','=[REDACTED]','catch','unknown','includes','slice','fdpKY','Invalid\x20values','ABbkx','--api-key','Bearer\x20','--cookie','38904svhizt','--key','no_token','rawCommand','metadata','indexOf','push','errorMessage'];_0x52a2=function(){return _0x35f8c4;};return _0x52a2();}(function(_0x114bc3,_0x39c2f3){const _0x357bd0=_0x3f49,_0x15ed5c=_0x114bc3();while(!![]){try{const _0x2b1680=-parseInt(_0x357bd0(0x98))/0x1*(parseInt(_0x357bd0(0xbb))/0x2)+parseInt(_0x357bd0(0x99))/0x3*(-parseInt(_0x357bd0(0xa6))/0x4)+-parseInt(_0x357bd0(0xa4))/0x5*(-parseInt(_0x357bd0(0x93))/0x6)+-parseInt(_0x357bd0(0x9a))/0x7*(-parseInt(_0x357bd0(0xad))/0x8)+-parseInt(_0x357bd0(0xaa))/0x9+-parseInt(_0x357bd0(0x8f))/0xa+parseInt(_0x357bd0(0x91))/0xb;if(_0x2b1680===_0x39c2f3)break;else _0x15ed5c['push'](_0x15ed5c['shift']());}catch(_0x4333ec){_0x15ed5c['push'](_0x15ed5c['shift']());}}}(_0x52a2,0xc0e76));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x2f9796(0xa1),'-t',_0x2f9796(0x97),_0x2f9796(0xb8),_0x2f9796(0x96),_0x2f9796(0xbc),'--password','--pass',_0x2f9796(0xaf),_0x2f9796(0xa8),_0x2f9796(0xab),_0x2f9796(0xba),'--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function _0x3f49(_0x2bf562,_0x184650){_0x2bf562=_0x2bf562-0x8b;const _0x52a23e=_0x52a2();let _0x3f494d=_0x52a23e[_0x2bf562];return _0x3f494d;}function looksLikeToken(_0x486837){const _0x230cb3=_0x2f9796;return TOKEN_PATTERNS[_0x230cb3(0x92)](_0x442b9e=>_0x442b9e[_0x230cb3(0xae)](_0x486837));}export function sanitizeArgs(_0x5cad91){const _0x47db55=_0x2f9796,_0x1ed60a={'OLckt':function(_0x4f35c0,_0x3a8f72){return _0x4f35c0<_0x3a8f72;},'aQeXJ':_0x47db55(0x94),'phqNg':function(_0x15b124,_0x90de0c){return _0x15b124!==_0x90de0c;}},_0x4040f1=[];let _0x2c096e=![];for(let _0x4f960f=0x0;_0x1ed60a['OLckt'](_0x4f960f,_0x5cad91['length']);_0x4f960f++){const _0x37fdc9=_0x5cad91[_0x4f960f];if(_0x2c096e){_0x4040f1[_0x47db55(0xc1)](_0x1ed60a[_0x47db55(0x8c)]),_0x2c096e=![];continue;}if(_0x37fdc9['startsWith']('--')||_0x37fdc9['startsWith']('-')){const _0x424eeb=_0x37fdc9[_0x47db55(0xc0)]('=');if(_0x1ed60a[_0x47db55(0xa3)](_0x424eeb,-0x1)){const _0x32254d=_0x37fdc9['slice'](0x0,_0x424eeb)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x32254d)){_0x4040f1['push'](_0x37fdc9[_0x47db55(0xb4)](0x0,_0x424eeb)+_0x47db55(0xb0));continue;}}else{const _0x4e200a=_0x37fdc9['toLowerCase']();SENSITIVE_FLAGS[_0x47db55(0x95)](_0x4e200a)&&(_0x2c096e=!![]);}_0x4040f1[_0x47db55(0xc1)](_0x37fdc9);}else looksLikeToken(_0x37fdc9)?_0x4040f1['push'](_0x47db55(0x94)):_0x4040f1[_0x47db55(0xc1)](_0x37fdc9);}return _0x4040f1[_0x47db55(0x9b)]('\x20');}export async function logDesirePath(_0x5e8f84){const _0x5f2697=_0x2f9796,_0x37f1fb={'OdJxw':function(_0x117296){return _0x117296();},'dLBzZ':_0x5f2697(0x90),'ctEro':_0x5f2697(0xbd),'ABbkx':'POST'};try{const _0x5cff8e=await _0x37f1fb['OdJxw'](getToken)[_0x5f2697(0xb1)](()=>null),_0x548d07=getApiBaseUrl(),_0x53a26c=_0x37f1fb['OdJxw'](getCurrentVersion),_0x1d0069=_0x5cff8e?_0x37f1fb['dLBzZ']:_0x37f1fb['ctEro'],_0x3016db={..._0x5e8f84[_0x5f2697(0xbf)],'authStatus':_0x1d0069,'isTty':process['stdout'][_0x5f2697(0x9d)]??![]},_0x561a06={'Content-Type':_0x5f2697(0xa2)};_0x5cff8e&&(_0x561a06[_0x5f2697(0x8d)]=_0x5f2697(0xb9)+_0x5cff8e);const _0x361da3={'rawCommand':_0x5e8f84[_0x5f2697(0xbe)],'errorMessage':_0x5e8f84[_0x5f2697(0x8b)],'errorType':_0x5e8f84['errorType'],'featureId':_0x5e8f84['featureId'],'sessionId':_0x5e8f84['sessionId'],'metadata':_0x3016db,'cliVersion':_0x53a26c};process['env']['DEBUG']&&(console[_0x5f2697(0xa5)](_0x5f2697(0x8e)+_0x548d07+'/api/v1/mcp/desire-path-logs'),console['error']('[desire-path]\x20Payload:\x20'+JSON['stringify'](_0x361da3,null,0x2))),await fetch(_0x548d07+'/api/v1/mcp/desire-path-logs',{'method':_0x37f1fb[_0x5f2697(0xb7)],'headers':_0x561a06,'body':JSON[_0x5f2697(0xa7)](_0x361da3)});}catch(_0x10dd66){process[_0x5f2697(0x9f)]['DEBUG']&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x10dd66);}}export function getErrorType(_0x481827,_0x2ba797){const _0x23f047=_0x2f9796,_0x4de7f6={'ZtXay':_0x23f047(0xac),'fdpKY':_0x23f047(0x9e),'xnFlS':_0x23f047(0xb6),'krCTy':'missing_option','JfeWT':'syntax_error'};if(_0x2ba797)return'runtime_error';if(!_0x481827)return _0x23f047(0xb2);if(_0x481827['includes'](_0x23f047(0x9c)))return _0x4de7f6[_0x23f047(0xa0)];if(_0x481827[_0x23f047(0xb3)](_0x4de7f6[_0x23f047(0xb5)]))return'unknown_argument';if(_0x481827['includes']('Not\x20enough\x20non-option\x20arguments'))return _0x23f047(0xa9);if(_0x481827['includes'](_0x4de7f6['xnFlS']))return'invalid_option_value';if(_0x481827[_0x23f047(0xb3)]('Missing\x20required\x20argument'))return _0x4de7f6['krCTy'];return _0x4de7f6['JfeWT'];}