@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,313 +1 @@
1
- import { readFile, writeFile, mkdir, unlink } from 'fs/promises';
2
- import { join, dirname } from 'path';
3
- import { existsSync } from 'fs';
4
- import { tmpdir } from 'os';
5
- import { randomUUID } from 'crypto';
6
- import { decrypt } from './crypto.js';
7
- import { getToken } from './keychain.js';
8
- import { getRangerDir } from './rangerRoot.js';
9
- /**
10
- * Get the directory path for an environment, checking ci/, local/, and legacy root level.
11
- * For existing environments, returns the path where it exists.
12
- * For new environments, defaults to local/.
13
- */
14
- export function getEnvDir(env) {
15
- const rangerDir = getRangerDir();
16
- const ciDir = join(rangerDir, 'ci', env);
17
- const localDir = join(rangerDir, 'local', env);
18
- const legacyDir = join(rangerDir, env); // Legacy: .ranger/<env>/
19
- const legacyLocalDir = join(rangerDir, 'local');
20
- const legacyCiDir = join(rangerDir, 'ci');
21
- if (existsSync(ciDir))
22
- return ciDir;
23
- if (existsSync(localDir))
24
- return localDir;
25
- if (existsSync(legacyDir) &&
26
- (legacyDir !== legacyLocalDir && legacyDir !== legacyCiDir
27
- ? true
28
- : hasLegacyProfileFiles(legacyDir))) {
29
- return legacyDir; // Backward compatibility
30
- }
31
- return localDir; // Default for new envs
32
- }
33
- /**
34
- * Check if an environment name already exists in any location (ci, local, or legacy root).
35
- * Optionally filter by specific locations.
36
- * Returns the path where it exists and its location, or null if not found.
37
- */
38
- export function findExistingEnv(envName, options) {
39
- const rangerDir = getRangerDir();
40
- const locations = options?.locations ?? ['ci', 'local', 'legacy'];
41
- const legacyLocalDir = join(rangerDir, 'local');
42
- const legacyCiDir = join(rangerDir, 'ci');
43
- const dirs = [
44
- { location: 'ci', path: join(rangerDir, 'ci', envName) },
45
- { location: 'local', path: join(rangerDir, 'local', envName) },
46
- { location: 'legacy', path: join(rangerDir, envName) },
47
- ];
48
- for (const dir of dirs) {
49
- if (locations.includes(dir.location) && existsSync(dir.path)) {
50
- if (dir.location === 'legacy' &&
51
- (dir.path === legacyLocalDir || dir.path === legacyCiDir) &&
52
- !hasLegacyProfileFiles(dir.path)) {
53
- continue;
54
- }
55
- return { path: dir.path, location: dir.location };
56
- }
57
- }
58
- return null;
59
- }
60
- function hasLegacyProfileFiles(legacyDir) {
61
- return (existsSync(join(legacyDir, 'settings.json')) ||
62
- existsSync(join(legacyDir, 'auth.json')) ||
63
- existsSync(join(legacyDir, 'auth.json.enc')));
64
- }
65
- /**
66
- * Check if an environment is a CI environment (stored in ci/ directory)
67
- */
68
- export function isEnvCi(env) {
69
- return existsSync(join(getRangerDir(), 'ci', env));
70
- }
71
- /**
72
- * Clean up temporary files created during config building
73
- * Ignores ENOENT errors (file already deleted)
74
- */
75
- export async function cleanupTempFiles(result) {
76
- const filesToClean = [result.tempAuthPath, result.configPath].filter(Boolean);
77
- await Promise.all(filesToClean.map((filePath) => unlink(filePath).catch((err) => {
78
- // Ignore ENOENT (file doesn't exist), re-throw others
79
- if (err.code !== 'ENOENT') {
80
- console.warn(`Failed to clean up temp file ${filePath}:`, err.message);
81
- }
82
- })));
83
- }
84
- /**
85
- * Get the path to the settings.json file for an environment
86
- */
87
- export function getSettingsPath(env) {
88
- return join(getEnvDir(env), 'settings.json');
89
- }
90
- /**
91
- * Load settings.json for an environment
92
- */
93
- export async function loadSettings(env) {
94
- const settingsPath = getSettingsPath(env);
95
- if (!existsSync(settingsPath)) {
96
- return {};
97
- }
98
- try {
99
- const content = await readFile(settingsPath, 'utf-8');
100
- return JSON.parse(content);
101
- }
102
- catch {
103
- return {};
104
- }
105
- }
106
- /**
107
- * Save settings.json for an environment
108
- */
109
- export async function saveSettings(env, settings) {
110
- const settingsPath = getSettingsPath(env);
111
- const envDir = dirname(settingsPath);
112
- if (!existsSync(envDir)) {
113
- await mkdir(envDir, { recursive: true });
114
- }
115
- await writeFile(settingsPath, JSON.stringify(settings, null, 2));
116
- }
117
- /**
118
- * Replace ${VAR_NAME} patterns with environment variable values
119
- */
120
- export function resolveEnvVars(obj) {
121
- if (typeof obj === 'string') {
122
- return obj.replace(/\$\{(\w+)\}/g, (_, varName) => {
123
- const value = process.env[varName];
124
- if (value === undefined) {
125
- throw new Error(`Environment variable ${varName} is not set`);
126
- }
127
- return value;
128
- });
129
- }
130
- if (Array.isArray(obj)) {
131
- return obj.map(resolveEnvVars);
132
- }
133
- if (obj && typeof obj === 'object') {
134
- return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, resolveEnvVars(v)]));
135
- }
136
- return obj;
137
- }
138
- /**
139
- * Build a full Playwright config from settings and write it to a temp file
140
- * Returns paths to created temp files that should be cleaned up after use
141
- */
142
- export async function buildPlaywrightConfig(settings, env, sessionId, headed) {
143
- const envDir = getEnvDir(env);
144
- // Auto-detect auth file (encrypted takes priority)
145
- const encryptedAuthPath = join(envDir, 'auth.json.enc');
146
- const plaintextAuthPath = join(envDir, 'auth.json');
147
- let storageStatePath;
148
- let tempAuthPath;
149
- if (existsSync(encryptedAuthPath)) {
150
- // Decrypt to temp file
151
- try {
152
- const token = await getToken();
153
- if (!token) {
154
- throw new Error('No API token found. Run: ranger setup [token]');
155
- }
156
- const encrypted = await readFile(encryptedAuthPath);
157
- const decrypted = decrypt(encrypted, token);
158
- tempAuthPath = join(tmpdir(), `ranger-auth-${Date.now()}.json`);
159
- await writeFile(tempAuthPath, decrypted);
160
- storageStatePath = tempAuthPath;
161
- }
162
- catch (error) {
163
- const message = error instanceof Error ? error.message : String(error);
164
- throw new Error(`Failed to decrypt auth state: ${message}`);
165
- }
166
- }
167
- else if (existsSync(plaintextAuthPath)) {
168
- // Use plaintext for local dev (not a temp file, don't track for cleanup)
169
- storageStatePath = plaintextAuthPath;
170
- }
171
- // Build the full Playwright config
172
- const effectiveSessionId = sessionId || randomUUID();
173
- const outputDir = join(getRangerDir(), 'sessions', effectiveSessionId);
174
- const config = {
175
- name: env,
176
- browser: {
177
- isolated: true,
178
- browserName: 'chromium',
179
- launchOptions: {
180
- headless: headed ? false : (settings.headless ?? true),
181
- ...(process.getuid?.() === 0 && {
182
- args: ['--no-sandbox', '--disable-setuid-sandbox'],
183
- }),
184
- },
185
- contextOptions: {
186
- permissions: ['clipboard-read', 'clipboard-write'],
187
- userAgent: settings.userAgent || undefined,
188
- extraHTTPHeaders: settings.headers || {},
189
- storageState: storageStatePath,
190
- viewport: { width: 1280, height: 720 },
191
- },
192
- },
193
- capabilities: ['core', 'tabs', 'install', 'pdf', 'vision'],
194
- imageResponses: 'allow',
195
- saveTrace: true,
196
- saveVideo: { width: 1280, height: 720 },
197
- outputDir,
198
- };
199
- // Clean up undefined values from contextOptions
200
- const contextOptions = config.browser;
201
- const ctxOpts = contextOptions
202
- .contextOptions;
203
- if (ctxOpts.userAgent === undefined)
204
- delete ctxOpts.userAgent;
205
- if (ctxOpts.storageState === undefined)
206
- delete ctxOpts.storageState;
207
- // Write to temp file
208
- const tempDir = join(tmpdir(), 'ranger-config');
209
- if (!existsSync(tempDir)) {
210
- await mkdir(tempDir, { recursive: true });
211
- }
212
- const tempConfigPath = join(tempDir, `${env}-${Date.now()}.json`);
213
- await writeFile(tempConfigPath, JSON.stringify(config, null, 2));
214
- return {
215
- configPath: tempConfigPath,
216
- tempAuthPath,
217
- };
218
- }
219
- /**
220
- * Get a nested value from an object using dot notation
221
- * e.g., getNestedValue({ headers: { "X-Test": "1" } }, "headers.X-Test") => "1"
222
- */
223
- export function getNestedValue(obj, key) {
224
- const parts = parseKeyPath(key);
225
- let current = obj;
226
- for (const part of parts) {
227
- if (current === null ||
228
- current === undefined ||
229
- typeof current !== 'object') {
230
- return undefined;
231
- }
232
- current = current[part];
233
- }
234
- return current;
235
- }
236
- /**
237
- * Set a nested value in an object using dot notation
238
- * e.g., setNestedValue({}, "headers.X-Test", "1") => { headers: { "X-Test": "1" } }
239
- */
240
- export function setNestedValue(obj, key, value) {
241
- const parts = parseKeyPath(key);
242
- let current = obj;
243
- for (let i = 0; i < parts.length - 1; i++) {
244
- const part = parts[i];
245
- if (!(part in current) || typeof current[part] !== 'object') {
246
- current[part] = {};
247
- }
248
- current = current[part];
249
- }
250
- current[parts[parts.length - 1]] = value;
251
- }
252
- /**
253
- * Delete a nested value from an object using dot notation
254
- * e.g., deleteNestedValue({ headers: { "X-Test": "1" } }, "headers.X-Test")
255
- */
256
- export function deleteNestedValue(obj, key) {
257
- const parts = parseKeyPath(key);
258
- let current = obj;
259
- for (let i = 0; i < parts.length - 1; i++) {
260
- if (current === null ||
261
- current === undefined ||
262
- typeof current !== 'object') {
263
- return false;
264
- }
265
- current = current[parts[i]];
266
- }
267
- if (current === null ||
268
- current === undefined ||
269
- typeof current !== 'object') {
270
- return false;
271
- }
272
- const lastPart = parts[parts.length - 1];
273
- if (lastPart in current) {
274
- delete current[lastPart];
275
- return true;
276
- }
277
- return false;
278
- }
279
- /**
280
- * Parse a key path, handling dot notation
281
- * "header.X-Test-Mode" => ["header", "X-Test-Mode"]
282
- * Special case: "header.X-Test" becomes ["headers", "X-Test"]
283
- */
284
- function parseKeyPath(key) {
285
- const parts = key.split('.');
286
- // Handle "header.X-Key" => "headers.X-Key"
287
- if (parts[0] === 'header') {
288
- parts[0] = 'headers';
289
- }
290
- return parts;
291
- }
292
- /**
293
- * Format settings for display
294
- */
295
- export function formatSettings(settings, indent = 0) {
296
- const lines = [];
297
- const prefix = ' '.repeat(indent);
298
- for (const [key, value] of Object.entries(settings)) {
299
- if (value === undefined)
300
- continue;
301
- if (typeof value === 'object' && value !== null) {
302
- lines.push(`${prefix}${key}:`);
303
- for (const [subKey, subValue] of Object.entries(value)) {
304
- lines.push(`${prefix} ${subKey}: ${subValue}`);
305
- }
306
- }
307
- else {
308
- lines.push(`${prefix}${key}: ${value}`);
309
- }
310
- }
311
- return lines.join('\n');
312
- }
313
- //# sourceMappingURL=settings.js.map
1
+ (function(_0x1fc5a9,_0x58d0ff){const _0x49e5a4=_0x4336,_0xcc84c5=_0x1fc5a9();while(!![]){try{const _0x53387a=-parseInt(_0x49e5a4(0xc4))/0x1+-parseInt(_0x49e5a4(0xf3))/0x2*(-parseInt(_0x49e5a4(0xef))/0x3)+-parseInt(_0x49e5a4(0xc2))/0x4*(parseInt(_0x49e5a4(0xcb))/0x5)+-parseInt(_0x49e5a4(0x111))/0x6+parseInt(_0x49e5a4(0xda))/0x7*(-parseInt(_0x49e5a4(0xf1))/0x8)+-parseInt(_0x49e5a4(0xfe))/0x9+parseInt(_0x49e5a4(0x110))/0xa;if(_0x53387a===_0x58d0ff)break;else _0xcc84c5['push'](_0xcc84c5['shift']());}catch(_0x14109f){_0xcc84c5['push'](_0xcc84c5['shift']());}}}(_0x23fe,0x9f538));import{readFile,writeFile,mkdir,unlink}from'fs/promises';import{join,dirname}from'path';import{existsSync}from'fs';import{tmpdir}from'os';function _0x4336(_0x4edd07,_0x3330c2){_0x4edd07=_0x4edd07-0xc0;const _0x23fe37=_0x23fe();let _0x433642=_0x23fe37[_0x4edd07];return _0x433642;}import{randomUUID}from'crypto';import{decrypt}from'./crypto.js';import{getToken}from'./keychain.js';import{getRangerDir}from'./rangerRoot.js';function _0x23fe(){const _0x581a5a=['jErHt','QdmLh','32052950nEWwyn','1906428hLBoIv','push','local','includes','3092oppnTm','join','926773thlMou','FFAGm','--disable-setuid-sandbox','auth.json','lxnQe','tdESD','location','2545hjIgdR','yuTKR','ranger-auth-','warn','replace','kepiq','legacy','length','getuid','filter','now','install','catch','DRnzF','xndIf','315DEXujL','vEADL','split','eBRTs','map','hPZwM','sessions','isArray','SJJgq','XduoZ','ENOENT','entries','pqHVA','FdjQU','settings.json','env','kwTxa','WySSA','XpSNA','cdpEndpoint','fromEntries','3UtQfbh','gjavw','131232wHJkAP','path','1626896iSJGEw','ranger-config','string','JmNkO','UGVEt','TgMol','object','headers','jkpAE','KzAVL','utf-8','8909955zFLgvu','abHkJ','pUEzW','auth.json.enc','userAgent','PMpzc','clipboard-read','vision','erbTw','KJbOW','WQfGm','AHOiH','suoNG','iJmaa','PBjFV','eHIsJ'];_0x23fe=function(){return _0x581a5a;};return _0x23fe();}export function getEnvDir(_0x30888f){const _0xd5d5cb=_0x4336,_0x49f282={'FFAGm':function(_0x159456,_0x52728d,_0x4fe7be,_0x2bef0f){return _0x159456(_0x52728d,_0x4fe7be,_0x2bef0f);},'QbAPT':function(_0xce4146,_0x187f10,_0x4beb21){return _0xce4146(_0x187f10,_0x4beb21);},'hPZwM':function(_0x45835c,_0x15e968,_0x125609){return _0x45835c(_0x15e968,_0x125609);},'iMxhM':function(_0x4daa43,_0x547209){return _0x4daa43(_0x547209);},'QdmLh':function(_0x1078a7,_0x56bb1d){return _0x1078a7(_0x56bb1d);},'PMpzc':function(_0x20b79c,_0x3ad3dd){return _0x20b79c!==_0x3ad3dd;},'gSaeT':function(_0x3372bf,_0x538c10){return _0x3372bf(_0x538c10);}},_0x37223e=getRangerDir(),_0x391e79=_0x49f282[_0xd5d5cb(0xc5)](join,_0x37223e,'ci',_0x30888f),_0x280bc1=_0x49f282[_0xd5d5cb(0xc5)](join,_0x37223e,_0xd5d5cb(0xc0),_0x30888f),_0x39d7c6=_0x49f282['QbAPT'](join,_0x37223e,_0x30888f),_0x152d05=join(_0x37223e,'local'),_0x4b20fc=_0x49f282[_0xd5d5cb(0xdf)](join,_0x37223e,'ci');if(_0x49f282['iMxhM'](existsSync,_0x391e79))return _0x391e79;if(_0x49f282[_0xd5d5cb(0x10f)](existsSync,_0x280bc1))return _0x280bc1;if(existsSync(_0x39d7c6)&&(_0x39d7c6!==_0x152d05&&_0x49f282[_0xd5d5cb(0x103)](_0x39d7c6,_0x4b20fc)?!![]:_0x49f282['gSaeT'](hasLegacyProfileFiles,_0x39d7c6)))return _0x39d7c6;return _0x280bc1;}export function findExistingEnv(_0x6b1792,_0x21ba83){const _0x440ea3=_0x4336,_0x26c246={'eHIsJ':function(_0x3ee460){return _0x3ee460();},'KzAVL':'local','vEADL':_0x440ea3(0xd1),'abHkJ':function(_0x46effc,_0x4f6708,_0x5a92cc){return _0x46effc(_0x4f6708,_0x5a92cc);},'eBRTs':function(_0x495964,_0x26d293,_0x1965d2){return _0x495964(_0x26d293,_0x1965d2);},'kepiq':function(_0x411a08,_0x2a0abe,_0xe8e3b7,_0x4ab5f2){return _0x411a08(_0x2a0abe,_0xe8e3b7,_0x4ab5f2);},'QvUWh':function(_0x9c10ae,_0x73294a,_0x5f0d2a){return _0x9c10ae(_0x73294a,_0x5f0d2a);},'GuPUy':function(_0x5b8ef8,_0x4dbc5f){return _0x5b8ef8(_0x4dbc5f);}},_0x1a39c2=_0x26c246[_0x440ea3(0x10d)](getRangerDir),_0x12ef83=_0x21ba83?.['locations']??['ci',_0x26c246['KzAVL'],_0x26c246[_0x440ea3(0xdb)]],_0x5692ee=_0x26c246[_0x440ea3(0xff)](join,_0x1a39c2,'local'),_0x2a4892=_0x26c246[_0x440ea3(0xdd)](join,_0x1a39c2,'ci'),_0x406b82=[{'location':'ci','path':_0x26c246[_0x440ea3(0xd0)](join,_0x1a39c2,'ci',_0x6b1792)},{'location':_0x26c246[_0x440ea3(0xfc)],'path':_0x26c246['kepiq'](join,_0x1a39c2,_0x440ea3(0xc0),_0x6b1792)},{'location':_0x26c246['vEADL'],'path':_0x26c246['QvUWh'](join,_0x1a39c2,_0x6b1792)}];for(const _0x4e92d4 of _0x406b82){if(_0x12ef83[_0x440ea3(0xc1)](_0x4e92d4[_0x440ea3(0xca)])&&_0x26c246['GuPUy'](existsSync,_0x4e92d4[_0x440ea3(0xf2)])){if(_0x4e92d4['location']===_0x26c246['vEADL']&&(_0x4e92d4['path']===_0x5692ee||_0x4e92d4['path']===_0x2a4892)&&!hasLegacyProfileFiles(_0x4e92d4['path']))continue;return{'path':_0x4e92d4[_0x440ea3(0xf2)],'location':_0x4e92d4['location']};}}return null;}function hasLegacyProfileFiles(_0x21926c){const _0x2c0088=_0x4336,_0xe74e49={'KJbOW':function(_0x1b6397,_0x16fa6c,_0x21abb5){return _0x1b6397(_0x16fa6c,_0x21abb5);},'pqHVA':function(_0xb0032c,_0x41227b){return _0xb0032c(_0x41227b);},'UGVEt':function(_0x32fd39,_0x4e49e2){return _0x32fd39(_0x4e49e2);},'xndIf':function(_0x662a18,_0xb2f1a5,_0x4d4fc1){return _0x662a18(_0xb2f1a5,_0x4d4fc1);}};return existsSync(_0xe74e49[_0x2c0088(0x107)](join,_0x21926c,_0x2c0088(0xe8)))||_0xe74e49[_0x2c0088(0xe6)](existsSync,_0xe74e49['KJbOW'](join,_0x21926c,_0x2c0088(0xc7)))||_0xe74e49[_0x2c0088(0xf7)](existsSync,_0xe74e49[_0x2c0088(0xd9)](join,_0x21926c,_0x2c0088(0x101)));}export function isEnvCi(_0x4ee0b3){const _0x5e457d={'kElqA':function(_0x5c7523){return _0x5c7523();}};return existsSync(join(_0x5e457d['kElqA'](getRangerDir),'ci',_0x4ee0b3));}export async function cleanupTempFiles(_0x259ebc){const _0x5d1cf1=_0x4336,_0xa1ee7={'hpnOZ':function(_0x2ce949,_0x5ab4fa){return _0x2ce949!==_0x5ab4fa;},'WQfGm':_0x5d1cf1(0xe4)},_0x5dec02=[_0x259ebc['tempAuthPath'],_0x259ebc['configPath']][_0x5d1cf1(0xd4)](Boolean);await Promise['all'](_0x5dec02[_0x5d1cf1(0xde)](_0x3bc88a=>unlink(_0x3bc88a)[_0x5d1cf1(0xd7)](_0x205b5b=>{const _0x5c94fd=_0x5d1cf1;_0xa1ee7['hpnOZ'](_0x205b5b['code'],_0xa1ee7[_0x5c94fd(0x108)])&&console[_0x5c94fd(0xce)]('Failed\x20to\x20clean\x20up\x20temp\x20file\x20'+_0x3bc88a+':',_0x205b5b['message']);})));}export function getSettingsPath(_0x16033f){return join(getEnvDir(_0x16033f),'settings.json');}export async function loadSettings(_0x825152){const _0x98b3ea=_0x4336,_0x3f65ef={'iJmaa':function(_0x52db69,_0x52ec64,_0x597e15){return _0x52db69(_0x52ec64,_0x597e15);}},_0x10e98f=getSettingsPath(_0x825152);if(!existsSync(_0x10e98f))return{};try{const _0x3eceb2=await _0x3f65ef[_0x98b3ea(0x10b)](readFile,_0x10e98f,_0x98b3ea(0xfd));return JSON['parse'](_0x3eceb2);}catch{return{};}}export async function saveSettings(_0x4211ae,_0x350f78){const _0x46872e={'yAKSC':function(_0x3efe95,_0x50b137){return _0x3efe95(_0x50b137);},'fDVpJ':function(_0x2e6bc4,_0x5786f7){return _0x2e6bc4(_0x5786f7);},'sOevV':function(_0x1560d7,_0x151ce3,_0x49f55e){return _0x1560d7(_0x151ce3,_0x49f55e);}},_0x2a73c2=_0x46872e['yAKSC'](getSettingsPath,_0x4211ae),_0x150d99=_0x46872e['fDVpJ'](dirname,_0x2a73c2);!existsSync(_0x150d99)&&await mkdir(_0x150d99,{'recursive':!![]}),await _0x46872e['sOevV'](writeFile,_0x2a73c2,JSON['stringify'](_0x350f78,null,0x2));}export function resolveEnvVars(_0xfc9fa9){const _0x2a327e=_0x4336,_0x5ba50b={'TgMol':function(_0x2fbd89,_0x40e9a3){return _0x2fbd89===_0x40e9a3;},'SJJgq':'object'};if(typeof _0xfc9fa9===_0x2a327e(0xf5))return _0xfc9fa9[_0x2a327e(0xcf)](/\$\{(\w+)\}/g,(_0x4b8ac0,_0x20b441)=>{const _0x31cc2c=_0x2a327e,_0x2507c1=process[_0x31cc2c(0xe9)][_0x20b441];if(_0x2507c1===undefined)throw new Error('Environment\x20variable\x20'+_0x20b441+'\x20is\x20not\x20set');return _0x2507c1;});if(Array[_0x2a327e(0xe1)](_0xfc9fa9))return _0xfc9fa9[_0x2a327e(0xde)](resolveEnvVars);if(_0xfc9fa9&&_0x5ba50b[_0x2a327e(0xf8)](typeof _0xfc9fa9,_0x5ba50b[_0x2a327e(0xe2)]))return Object[_0x2a327e(0xee)](Object[_0x2a327e(0xe5)](_0xfc9fa9)['map'](([_0x3ae2a0,_0x243611])=>[_0x3ae2a0,resolveEnvVars(_0x243611)]));return _0xfc9fa9;}export async function buildPlaywrightConfig(_0x31d559,_0x3239fb,_0x5b2eea,_0x4e4c5e){const _0x18626e=_0x4336,_0x11c63c={'uUIUM':function(_0x223ad4,_0x1f7797){return _0x223ad4(_0x1f7797);},'JmNkO':function(_0x202c32,_0x44a7cc,_0x1289cc){return _0x202c32(_0x44a7cc,_0x1289cc);},'suoNG':_0x18626e(0xc7),'erbTw':function(_0x2fc3f5){return _0x2fc3f5();},'ySeaT':function(_0x2efe46,_0x365c36){return _0x2efe46 instanceof _0x365c36;},'pUEzW':function(_0x56d897,_0x4a92b1){return _0x56d897(_0x4a92b1);},'jkpAE':function(_0x129c06,_0x3fe605){return _0x129c06(_0x3fe605);},'HDikE':_0x18626e(0xe0),'icvCF':'chromium','sBYCV':'--no-sandbox','FdjQU':_0x18626e(0xc6),'lxnQe':'clipboard-write','trocq':'pdf','dlEbD':'allow','CoPym':function(_0xb5c4bc,_0x596604){return _0xb5c4bc===_0x596604;},'DRnzF':function(_0x46b09f,_0x40cd3d){return _0x46b09f(_0x40cd3d);},'ZUWSI':function(_0x542df3,_0x209e96,_0x545957){return _0x542df3(_0x209e96,_0x545957);}},_0x1380dd=_0x11c63c['uUIUM'](getEnvDir,_0x3239fb),_0x24e51a=_0x11c63c['JmNkO'](join,_0x1380dd,'auth.json.enc'),_0x4d1479=join(_0x1380dd,_0x11c63c[_0x18626e(0x10a)]);let _0x41056a,_0x2b7e77;if(_0x11c63c['uUIUM'](existsSync,_0x24e51a))try{const _0x436b43=await _0x11c63c[_0x18626e(0x106)](getToken);if(!_0x436b43)throw new Error('No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3b6341=await readFile(_0x24e51a),_0xa16a5=decrypt(_0x3b6341,_0x436b43);_0x2b7e77=_0x11c63c[_0x18626e(0xf6)](join,tmpdir(),_0x18626e(0xcd)+Date['now']()+'.json'),await writeFile(_0x2b7e77,_0xa16a5),_0x41056a=_0x2b7e77;}catch(_0x29eaff){const _0x487fd2=_0x11c63c['ySeaT'](_0x29eaff,Error)?_0x29eaff['message']:_0x11c63c[_0x18626e(0x100)](String,_0x29eaff);throw new Error('Failed\x20to\x20decrypt\x20auth\x20state:\x20'+_0x487fd2);}else _0x11c63c[_0x18626e(0xfb)](existsSync,_0x4d1479)&&(_0x41056a=_0x4d1479);const _0x2e6c66=_0x5b2eea||_0x11c63c[_0x18626e(0x106)](randomUUID),_0x160967=join(getRangerDir(),_0x11c63c['HDikE'],_0x2e6c66),_0x17c9a3=Boolean(_0x31d559[_0x18626e(0xed)]),_0x48046d=_0x17c9a3?{'browserName':_0x11c63c['icvCF'],'cdpEndpoint':_0x31d559[_0x18626e(0xed)]}:{'isolated':!![],'browserName':'chromium','launchOptions':{'headless':_0x4e4c5e?![]:_0x31d559['headless']??!![],...process[_0x18626e(0xd3)]?.()===0x0&&{'args':[_0x11c63c['sBYCV'],_0x11c63c[_0x18626e(0xe7)]]}},'contextOptions':{'permissions':[_0x18626e(0x104),_0x11c63c[_0x18626e(0xc8)]],'userAgent':_0x31d559['userAgent']||undefined,'extraHTTPHeaders':_0x31d559[_0x18626e(0xfa)]||{},'storageState':_0x41056a,'viewport':{'width':0x500,'height':0x2d0}}},_0x4c12cc={'name':_0x3239fb,'browser':_0x48046d,'capabilities':['core','tabs',_0x18626e(0xd6),_0x11c63c['trocq'],_0x18626e(0x105)],'imageResponses':_0x11c63c['dlEbD'],'saveTrace':!![],'saveVideo':{'width':0x500,'height':0x2d0},'outputDir':_0x160967};if(!_0x17c9a3){const _0x27535a=_0x4c12cc['browser'],_0x2d4eda=_0x27535a['contextOptions'];if(_0x11c63c['CoPym'](_0x2d4eda[_0x18626e(0x102)],undefined))delete _0x2d4eda[_0x18626e(0x102)];if(_0x11c63c['CoPym'](_0x2d4eda['storageState'],undefined))delete _0x2d4eda['storageState'];}const _0xf77d0c=_0x11c63c[_0x18626e(0xf6)](join,tmpdir(),_0x18626e(0xf4));!_0x11c63c[_0x18626e(0xd8)](existsSync,_0xf77d0c)&&await _0x11c63c['ZUWSI'](mkdir,_0xf77d0c,{'recursive':!![]});const _0x3a0082=_0x11c63c[_0x18626e(0xf6)](join,_0xf77d0c,_0x3239fb+'-'+Date[_0x18626e(0xd5)]()+'.json');return await _0x11c63c['JmNkO'](writeFile,_0x3a0082,JSON['stringify'](_0x4c12cc,null,0x2)),{'configPath':_0x3a0082,'tempAuthPath':_0x2b7e77};}export function getNestedValue(_0x326498,_0x14dd39){const _0x11fa1e=_0x4336,_0x4f36b4={'HPtwQ':function(_0x4c6597,_0x5dc37a){return _0x4c6597(_0x5dc37a);},'XduoZ':function(_0x1866c5,_0xb7717e){return _0x1866c5!==_0xb7717e;},'tdESD':_0x11fa1e(0xf9)},_0x1dcb81=_0x4f36b4['HPtwQ'](parseKeyPath,_0x14dd39);let _0x21c7db=_0x326498;for(const _0x1175c3 of _0x1dcb81){if(_0x21c7db===null||_0x21c7db===undefined||_0x4f36b4[_0x11fa1e(0xe3)](typeof _0x21c7db,_0x4f36b4[_0x11fa1e(0xc9)]))return undefined;_0x21c7db=_0x21c7db[_0x1175c3];}return _0x21c7db;}export function setNestedValue(_0x5faa70,_0x308fa5,_0x760317){const _0x6c46ea=_0x4336,_0x30948c={'lsVMm':function(_0x4a6ec8,_0x5e6a80){return _0x4a6ec8(_0x5e6a80);},'haYsc':function(_0x593f4c,_0x269f10){return _0x593f4c<_0x269f10;},'jErHt':function(_0x358b93,_0x310aee){return _0x358b93 in _0x310aee;},'kwTxa':function(_0x1746b7,_0x53f06a){return _0x1746b7!==_0x53f06a;},'yuTKR':function(_0x36a356,_0x5965bd){return _0x36a356-_0x5965bd;}},_0x1150c5=_0x30948c['lsVMm'](parseKeyPath,_0x308fa5);let _0x2c30e3=_0x5faa70;for(let _0x4ba33=0x0;_0x30948c['haYsc'](_0x4ba33,_0x1150c5[_0x6c46ea(0xd2)]-0x1);_0x4ba33++){const _0x50af9d=_0x1150c5[_0x4ba33];(!_0x30948c[_0x6c46ea(0x10e)](_0x50af9d,_0x2c30e3)||_0x30948c[_0x6c46ea(0xea)](typeof _0x2c30e3[_0x50af9d],'object'))&&(_0x2c30e3[_0x50af9d]={}),_0x2c30e3=_0x2c30e3[_0x50af9d];}_0x2c30e3[_0x1150c5[_0x30948c[_0x6c46ea(0xcc)](_0x1150c5['length'],0x1)]]=_0x760317;}export function deleteNestedValue(_0x51e20b,_0x50324f){const _0x2169c6=_0x4336,_0x11d6d3={'bdhFw':function(_0x555e4f,_0x11032d){return _0x555e4f(_0x11032d);},'enjDD':function(_0x2f0345,_0x295868){return _0x2f0345<_0x295868;},'uzNZH':function(_0x38e310,_0x262d41){return _0x38e310===_0x262d41;},'jFUoB':function(_0x1de5ce,_0x1de9d2){return _0x1de5ce!==_0x1de9d2;},'WySSA':'object','gjavw':function(_0x4078ed,_0x1f267b){return _0x4078ed in _0x1f267b;}},_0x79dfd0=_0x11d6d3['bdhFw'](parseKeyPath,_0x50324f);let _0x7d48a4=_0x51e20b;for(let _0x5f363a=0x0;_0x11d6d3['enjDD'](_0x5f363a,_0x79dfd0['length']-0x1);_0x5f363a++){if(_0x11d6d3['uzNZH'](_0x7d48a4,null)||_0x7d48a4===undefined||_0x11d6d3['jFUoB'](typeof _0x7d48a4,_0x2169c6(0xf9)))return![];_0x7d48a4=_0x7d48a4[_0x79dfd0[_0x5f363a]];}if(_0x11d6d3['uzNZH'](_0x7d48a4,null)||_0x7d48a4===undefined||typeof _0x7d48a4!==_0x11d6d3[_0x2169c6(0xeb)])return![];const _0x31a601=_0x79dfd0[_0x79dfd0['length']-0x1];if(_0x11d6d3[_0x2169c6(0xf0)](_0x31a601,_0x7d48a4))return delete _0x7d48a4[_0x31a601],!![];return![];}function parseKeyPath(_0x4fc4b4){const _0x1011f9=_0x4336,_0xa0ccd3={'PBjFV':'headers'},_0x36f2be=_0x4fc4b4[_0x1011f9(0xdc)]('.');return _0x36f2be[0x0]==='header'&&(_0x36f2be[0x0]=_0xa0ccd3[_0x1011f9(0x10c)]),_0x36f2be;}export function formatSettings(_0x47c1c0,_0x352d69=0x0){const _0x25d508=_0x4336,_0xf84476={'XpSNA':function(_0x48deeb,_0x358d44){return _0x48deeb===_0x358d44;},'gpkuA':function(_0x6daa1e,_0x256700){return _0x6daa1e===_0x256700;},'AHOiH':function(_0x5d6bef,_0x4d5e68){return _0x5d6bef!==_0x4d5e68;}},_0x576089=[],_0x59a5a9='\x20\x20'['repeat'](_0x352d69);for(const [_0x45ad3d,_0x10389d]of Object[_0x25d508(0xe5)](_0x47c1c0)){if(_0xf84476[_0x25d508(0xec)](_0x10389d,undefined))continue;if(_0xf84476['gpkuA'](typeof _0x10389d,_0x25d508(0xf9))&&_0xf84476[_0x25d508(0x109)](_0x10389d,null)){_0x576089[_0x25d508(0x112)](''+_0x59a5a9+_0x45ad3d+':');for(const [_0x279180,_0xd15add]of Object['entries'](_0x10389d)){_0x576089['push'](_0x59a5a9+'\x20\x20'+_0x279180+':\x20'+_0xd15add);}}else _0x576089[_0x25d508(0x112)](''+_0x59a5a9+_0x45ad3d+':\x20'+_0x10389d);}return _0x576089[_0x25d508(0xc3)]('\x0a');}
@@ -1,28 +1 @@
1
- import { readFileSync } from 'fs';
2
- import { dirname, join } from 'path';
3
- import { fileURLToPath } from 'url';
4
- const __filename = fileURLToPath(import.meta.url);
5
- const __dirname = dirname(__filename);
6
- /**
7
- * Read skill content from the skills directory.
8
- * Skills are copied to build/skills/ during build via `cp -r src/skills build/`.
9
- * When installed via npm, skills are at node_modules/@ranger-testing/ranger-cli/build/skills/
10
- */
11
- export function readSkillContent(skillPath) {
12
- // Navigate from build/commands/utils/ to build/skills/
13
- const skillsDir = join(__dirname, '..', '..', 'skills');
14
- const fullPath = join(skillsDir, skillPath);
15
- try {
16
- return readFileSync(fullPath, 'utf-8');
17
- }
18
- catch {
19
- return '';
20
- }
21
- }
22
- /**
23
- * Get the ranger SKILL.md content
24
- */
25
- export function getRangerSkillContent() {
26
- return readSkillContent('ranger/SKILL.md');
27
- }
28
- //# sourceMappingURL=skillContent.js.map
1
+ (function(_0x4485c4,_0x5a933d){const _0x43c894=_0x5616,_0x5b64ce=_0x4485c4();while(!![]){try{const _0xdc5d95=parseInt(_0x43c894(0xca))/0x1+-parseInt(_0x43c894(0xcf))/0x2*(parseInt(_0x43c894(0xc4))/0x3)+-parseInt(_0x43c894(0xc9))/0x4+-parseInt(_0x43c894(0xd0))/0x5+parseInt(_0x43c894(0xcb))/0x6+parseInt(_0x43c894(0xcd))/0x7*(-parseInt(_0x43c894(0xc7))/0x8)+parseInt(_0x43c894(0xc5))/0x9;if(_0xdc5d95===_0x5a933d)break;else _0x5b64ce['push'](_0x5b64ce['shift']());}catch(_0xcb9bcf){_0x5b64ce['push'](_0x5b64ce['shift']());}}}(_0x409f,0xf3517));import{readFileSync}from'fs';function _0x409f(){const _0x1f7114=['5924349GKMxTk','47334726lbJSDY','pxjFt','44024SLtKTO','HbURV','4605532uJHgfy','1239396BsyyKS','2684946iLRLge','utf-8','1267XQAXEJ','FaREB','2ELhkWd','9137305jJvrkv','UwXfp'];_0x409f=function(){return _0x1f7114;};return _0x409f();}import{dirname,join}from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);export function readSkillContent(_0x190bb6){const _0x36d3e2=_0x5616,_0x3a5c85={'FaREB':function(_0x67dda4,_0x44b2b3,_0x3da4fe,_0x2b49a6,_0x5ea624){return _0x67dda4(_0x44b2b3,_0x3da4fe,_0x2b49a6,_0x5ea624);},'pxjFt':'skills','UwXfp':function(_0x2391cd,_0x408453,_0xa26952){return _0x2391cd(_0x408453,_0xa26952);}},_0x29ff8a=_0x3a5c85[_0x36d3e2(0xce)](join,__dirname,'..','..',_0x3a5c85[_0x36d3e2(0xc6)]),_0x2968fd=join(_0x29ff8a,_0x190bb6);try{return _0x3a5c85[_0x36d3e2(0xd1)](readFileSync,_0x2968fd,_0x36d3e2(0xcc));}catch{return'';}}function _0x5616(_0x46a53b,_0x1c3c11){_0x46a53b=_0x46a53b-0xc4;const _0x409f51=_0x409f();let _0x5616ba=_0x409f51[_0x46a53b];return _0x5616ba;}export function getRangerSkillContent(){const _0x1fcf87=_0x5616,_0x298580={'HbURV':'ranger/SKILL.md'};return readSkillContent(_0x298580[_0x1fcf87(0xc8)]);}
@@ -1 +1 @@
1
- const _0x34456e=_0x273a;(function(_0x391b90,_0x4c13b4){const _0x523c6b=_0x273a,_0x5a7c3e=_0x391b90();while(!![]){try{const _0x58d533=-parseInt(_0x523c6b(0xcf))/0x1*(-parseInt(_0x523c6b(0xbb))/0x2)+parseInt(_0x523c6b(0xce))/0x3+-parseInt(_0x523c6b(0xb6))/0x4*(-parseInt(_0x523c6b(0xae))/0x5)+parseInt(_0x523c6b(0xc5))/0x6+parseInt(_0x523c6b(0xc7))/0x7+-parseInt(_0x523c6b(0xc8))/0x8+-parseInt(_0x523c6b(0xb9))/0x9;if(_0x58d533===_0x4c13b4)break;else _0x5a7c3e['push'](_0x5a7c3e['shift']());}catch(_0x27a78f){_0x5a7c3e['push'](_0x5a7c3e['shift']());}}}(_0x2f00,0x62044));import{readFile,writeFile,mkdir,readdir,copyFile,rm}from'fs/promises';import{join,dirname}from'path';import{existsSync,statSync}from'fs';import{fileURLToPath}from'url';import{logLocalAgentInstallation}from'./localAgentInstallationsApi.js';import{getSkillsDir}from'./claudeConfig.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);export const RANGER_MANAGED_SKILLS=['ranger'];export const DEPRECATED_SKILLS=[_0x34456e(0xc6),'bug-bash',_0x34456e(0xcb)];export async function installSkill(_0x4ffe78,_0x3f2748={}){const _0x1620c8=_0x34456e,_0x42131d={'LsaBf':'project','RgZHN':function(_0x3565c3){return _0x3565c3();},'yMhOV':function(_0x1d4836,_0x12453c,_0x884b1b){return _0x1d4836(_0x12453c,_0x884b1b);},'DgKIZ':function(_0x120365,_0x3c5d5c){return _0x120365(_0x3c5d5c);},'iNMGd':function(_0x285abb,_0x3b9308){return _0x285abb(_0x3b9308);},'rKVMk':function(_0x18a372,_0x15d206){return _0x18a372&&_0x15d206;},'eIwBX':function(_0x254c4c,_0x25ef2d){return _0x254c4c(_0x25ef2d);},'RMNPl':'utf-8','soPMO':function(_0x254352,_0x1dfa80,_0x4070c7){return _0x254352(_0x1dfa80,_0x4070c7);},'LvOMs':_0x1620c8(0xb8),'XkdTy':function(_0x38d579,_0x4fd578){return _0x38d579>_0x4fd578;},'BLpzt':function(_0x1a69e6,_0x16480d,_0x222dd1,_0x3b69bc){return _0x1a69e6(_0x16480d,_0x222dd1,_0x3b69bc);}},{level:level=_0x42131d['LsaBf'],cliVersion:_0x57f2b4}=_0x3f2748,_0x583562=_0x42131d[_0x1620c8(0xaf)](getSourceSkillsDir),_0x3693d6=join(_0x583562,_0x4ffe78),_0x34e72d=_0x42131d[_0x1620c8(0xbc)](join,_0x583562,_0x4ffe78+_0x1620c8(0xb0)),_0x4bde9f=existsSync(_0x3693d6)&&_0x42131d['DgKIZ'](statSync,_0x3693d6)[_0x1620c8(0xca)]()&&existsSync(join(_0x3693d6,_0x1620c8(0xb8))),_0x3ecfe4=_0x42131d[_0x1620c8(0xc2)](existsSync,_0x34e72d);if(_0x42131d['rKVMk'](!_0x4bde9f,!_0x3ecfe4))return console[_0x1620c8(0xc9)]('\x20\x20Skill\x20not\x20found:\x20'+_0x4ffe78),![];const _0xc07639=_0x42131d[_0x1620c8(0xc4)](getSkillsDir,level),_0x30217f=join(_0xc07639,_0x4ffe78);await _0x42131d['yMhOV'](mkdir,_0x30217f,{'recursive':!![]});let _0x4a5b45,_0x538271=[];if(_0x4bde9f){const _0x360936=await _0x42131d[_0x1620c8(0xc4)](readdir,_0x3693d6),_0x44cd2b=_0x360936[_0x1620c8(0xc0)](_0x480add=>_0x480add[_0x1620c8(0xc3)]('.md'));for(const _0x482032 of _0x44cd2b){const _0x400e89=_0x42131d[_0x1620c8(0xbc)](join,_0x3693d6,_0x482032),_0xdd20b4=_0x42131d['yMhOV'](join,_0x30217f,_0x482032);await _0x42131d[_0x1620c8(0xbc)](copyFile,_0x400e89,_0xdd20b4),_0x538271['push'](_0x482032);}_0x4a5b45=await _0x42131d['yMhOV'](readFile,join(_0x3693d6,_0x1620c8(0xb8)),'utf-8');}else{_0x4a5b45=await readFile(_0x34e72d,_0x42131d[_0x1620c8(0xb1)]);const _0x31e845=_0x42131d['soPMO'](join,_0x30217f,_0x42131d[_0x1620c8(0xb2)]);await writeFile(_0x31e845,_0x4a5b45,'utf-8'),_0x538271[_0x1620c8(0xbf)](_0x42131d['LvOMs']);}const {name:_0x1c1c44}=parseFrontmatter(_0x4a5b45);return console[_0x1620c8(0xcd)]('\x20\x20Installed\x20skill:\x20'+_0x1c1c44),console[_0x1620c8(0xcd)]('\x20\x20Location:\x20'+_0x30217f),_0x42131d[_0x1620c8(0xb5)](_0x538271[_0x1620c8(0xbd)],0x1)&&console[_0x1620c8(0xcd)](_0x1620c8(0xbe)+_0x538271['join'](',\x20')),_0x42131d['BLpzt'](logLocalAgentInstallation,_0x4ffe78,{'skillDisplayName':_0x1c1c44,'installLevel':level},_0x57f2b4)[_0x1620c8(0xc1)](()=>{}),!![];}function _0x273a(_0x40a654,_0x500798){_0x40a654=_0x40a654-0xae;const _0x2f00e4=_0x2f00();let _0x273a33=_0x2f00e4[_0x40a654];return _0x273a33;}function getSourceSkillsDir(){const _0x29e81b=_0x34456e,_0x184c13={'OlTMo':function(_0x4b05e0,_0x4464c2,_0x13bd4e,_0x1900f1,_0x1bbeae){return _0x4b05e0(_0x4464c2,_0x13bd4e,_0x1900f1,_0x1bbeae);},'qLZlp':_0x29e81b(0xb7),'XqMxk':function(_0x197f32,_0x4489a2,_0x2a0879,_0x41c6fd,_0x3a611f,_0x4002a6){return _0x197f32(_0x4489a2,_0x2a0879,_0x41c6fd,_0x3a611f,_0x4002a6);}},_0x3ded75=[_0x184c13['OlTMo'](join,__dirname,'..','..',_0x184c13[_0x29e81b(0xcc)]),_0x184c13[_0x29e81b(0xb3)](join,__dirname,'..','..','..',_0x29e81b(0xb7))];for(const _0x2daf67 of _0x3ded75){if(existsSync(_0x2daf67))return _0x2daf67;}return _0x3ded75[0x0];}function parseFrontmatter(_0x4d83e){const _0x421710=_0x34456e,_0x55aa8b=_0x4d83e[_0x421710(0xb4)](/^---\n([\s\S]+?)\n---/);if(!_0x55aa8b)throw new Error('Invalid\x20skill\x20frontmatter');const _0x2ca8cb=_0x55aa8b[0x1],_0x2dcc66=_0x2ca8cb['match'](/name:\s*(.+)/),_0x2aa37e=_0x2ca8cb[_0x421710(0xb4)](/description:\s*"?(.+?)"?\n/);return{'name':_0x2dcc66?.[0x1]['trim']()||'','description':_0x2aa37e?.[0x1][_0x421710(0xba)]()||''};}function _0x2f00(){const _0x3f0200=['eIwBX','4638486WlMRpT','e2e-test-recommender','3481408THPXQN','1990920KZKLLu','warn','isDirectory','feature-tracker','qLZlp','log','753528Nkybed','1228PqyVrH','12790vAgQJH','RgZHN','.md','RMNPl','LvOMs','XqMxk','match','XkdTy','456ubzaFd','skills','SKILL.md','16312356iYQSng','trim','1058aeXNlc','yMhOV','length','\x20\x20Files:\x20','push','filter','catch','iNMGd','endsWith'];_0x2f00=function(){return _0x3f0200;};return _0x2f00();}export async function removeSkill(_0x1a8a86,_0x1c999e){const _0x5f4189={'hkxjI':function(_0xef6cef,_0x3d70e6){return _0xef6cef(_0x3d70e6);}},_0x75f122=_0x5f4189['hkxjI'](getSkillsDir,_0x1c999e),_0x17cdc3=join(_0x75f122,_0x1a8a86);if(!existsSync(_0x17cdc3))return![];try{return await rm(_0x17cdc3,{'recursive':!![]}),console['log']('\x20\x20Removed\x20deprecated\x20skill:\x20'+_0x1a8a86),!![];}catch{return console['warn']('\x20\x20Failed\x20to\x20remove\x20deprecated\x20skill:\x20'+_0x1a8a86),![];}}
1
+ const _0x4985c9=_0x3bc1;(function(_0x93c667,_0x1b556d){const _0x2d0280=_0x3bc1,_0x2e30d6=_0x93c667();while(!![]){try{const _0x4cb0df=parseInt(_0x2d0280(0x14d))/0x1+parseInt(_0x2d0280(0x162))/0x2+-parseInt(_0x2d0280(0x154))/0x3+parseInt(_0x2d0280(0x14f))/0x4*(-parseInt(_0x2d0280(0x147))/0x5)+parseInt(_0x2d0280(0x14a))/0x6+-parseInt(_0x2d0280(0x164))/0x7*(-parseInt(_0x2d0280(0x15e))/0x8)+-parseInt(_0x2d0280(0x15f))/0x9;if(_0x4cb0df===_0x1b556d)break;else _0x2e30d6['push'](_0x2e30d6['shift']());}catch(_0x3d86c7){_0x2e30d6['push'](_0x2e30d6['shift']());}}}(_0x1801,0x75150));import{readFile,writeFile,mkdir,readdir,copyFile,rm}from'fs/promises';import{join,dirname}from'path';import{existsSync,statSync}from'fs';function _0x3bc1(_0x522d2f,_0x4f453b){_0x522d2f=_0x522d2f-0x145;const _0x180189=_0x1801();let _0x3bc106=_0x180189[_0x522d2f];return _0x3bc106;}import{fileURLToPath}from'url';import{logLocalAgentInstallation}from'./localAgentInstallationsApi.js';import{getSkillsDir}from'./claudeConfig.js';function _0x1801(){const _0x26e5ef=['e2e-test-recommender','264089DMmGyu','catch','DpeeS','join','YGlaF','5WLMqQJ','CTgdH','log','2526888iExWLP','warn','SKILL.md','80790QXTJVF','Wylhg','227828nZfZim','REkwa','XcPRe','JzSfC','.md','476250arxbyd','wXVqo','push','endsWith','Cjfqo','trim','skills','zmshP','\x20\x20Location:\x20','icmOK','192jVhWhc','8332731ufBXZr','Invalid\x20skill\x20frontmatter','wjkJY','427496PajXnv'];_0x1801=function(){return _0x26e5ef;};return _0x1801();}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);export const RANGER_MANAGED_SKILLS=['ranger'];export const DEPRECATED_SKILLS=[_0x4985c9(0x163),'bug-bash','feature-tracker'];export async function installSkill(_0x424be7,_0x2357db={}){const _0x126917=_0x4985c9,_0x417e06={'XcPRe':function(_0x275eec,_0x11f334,_0xf686dd){return _0x275eec(_0x11f334,_0xf686dd);},'DpeeS':function(_0x4afb1e,_0x2718dd){return _0x4afb1e(_0x2718dd);},'YGlaF':function(_0x7d7940,_0x4ff5c0,_0x498691){return _0x7d7940(_0x4ff5c0,_0x498691);},'icmOK':function(_0x5ed685,_0x24e360,_0x474699){return _0x5ed685(_0x24e360,_0x474699);},'Cjfqo':'utf-8','gmxev':function(_0x119d4b,_0x2f771d,_0x5dc405){return _0x119d4b(_0x2f771d,_0x5dc405);},'wXVqo':'SKILL.md','REkwa':function(_0x7021af,_0x2e0746,_0x10afd2,_0x2ffbe8){return _0x7021af(_0x2e0746,_0x10afd2,_0x2ffbe8);},'CTgdH':function(_0x2edf4d,_0x2c5c37){return _0x2edf4d(_0x2c5c37);},'ZiJOC':function(_0x320b30,_0x1bff79){return _0x320b30>_0x1bff79;}},{level:level='project',cliVersion:_0x5bfda4}=_0x2357db,_0x3ea12e=getSourceSkillsDir(),_0x3c62dc=_0x417e06[_0x126917(0x151)](join,_0x3ea12e,_0x424be7),_0x131ba9=join(_0x3ea12e,_0x424be7+_0x126917(0x153)),_0x2fd338=_0x417e06['DpeeS'](existsSync,_0x3c62dc)&&statSync(_0x3c62dc)['isDirectory']()&&existsSync(join(_0x3c62dc,'SKILL.md')),_0x3f94a6=_0x417e06[_0x126917(0x166)](existsSync,_0x131ba9);if(!_0x2fd338&&!_0x3f94a6)return console[_0x126917(0x14b)]('\x20\x20Skill\x20not\x20found:\x20'+_0x424be7),![];const _0x1a6bc1=getSkillsDir(level),_0x1e8eaa=join(_0x1a6bc1,_0x424be7);await _0x417e06[_0x126917(0x151)](mkdir,_0x1e8eaa,{'recursive':!![]});let _0x31ee04,_0x4ce643=[];if(_0x2fd338){const _0x37d60b=await readdir(_0x3c62dc),_0x5536e9=_0x37d60b['filter'](_0x2a77ac=>_0x2a77ac[_0x126917(0x157)]('.md'));for(const _0x4d8e76 of _0x5536e9){const _0x5a9785=join(_0x3c62dc,_0x4d8e76),_0x4de804=_0x417e06[_0x126917(0x146)](join,_0x1e8eaa,_0x4d8e76);await copyFile(_0x5a9785,_0x4de804),_0x4ce643[_0x126917(0x156)](_0x4d8e76);}_0x31ee04=await readFile(_0x417e06[_0x126917(0x15d)](join,_0x3c62dc,_0x126917(0x14c)),_0x417e06[_0x126917(0x158)]);}else{_0x31ee04=await _0x417e06['gmxev'](readFile,_0x131ba9,'utf-8');const _0x5ac1a7=join(_0x1e8eaa,_0x417e06['wXVqo']);await _0x417e06[_0x126917(0x150)](writeFile,_0x5ac1a7,_0x31ee04,_0x417e06[_0x126917(0x158)]),_0x4ce643[_0x126917(0x156)](_0x417e06[_0x126917(0x155)]);}const {name:_0x206ed1}=_0x417e06[_0x126917(0x148)](parseFrontmatter,_0x31ee04);return console[_0x126917(0x149)]('\x20\x20Installed\x20skill:\x20'+_0x206ed1),console[_0x126917(0x149)](_0x126917(0x15c)+_0x1e8eaa),_0x417e06['ZiJOC'](_0x4ce643['length'],0x1)&&console[_0x126917(0x149)]('\x20\x20Files:\x20'+_0x4ce643[_0x126917(0x145)](',\x20')),logLocalAgentInstallation(_0x424be7,{'skillDisplayName':_0x206ed1,'installLevel':level},_0x5bfda4)[_0x126917(0x165)](()=>{}),!![];}function getSourceSkillsDir(){const _0x423b28=_0x4985c9,_0x55143e={'JzSfC':function(_0x101526,_0x5b1ab4,_0x36bc37,_0x39aa37,_0xa4a4fa){return _0x101526(_0x5b1ab4,_0x36bc37,_0x39aa37,_0xa4a4fa);},'zmshP':_0x423b28(0x15a),'rpxHt':function(_0x47706a,_0x19b7c3,_0x4ee335,_0x2fc054,_0x390293,_0x2904d9){return _0x47706a(_0x19b7c3,_0x4ee335,_0x2fc054,_0x390293,_0x2904d9);}},_0x1db070=[_0x55143e[_0x423b28(0x152)](join,__dirname,'..','..',_0x55143e[_0x423b28(0x15b)]),_0x55143e['rpxHt'](join,__dirname,'..','..','..','skills')];for(const _0x17ae5c of _0x1db070){if(existsSync(_0x17ae5c))return _0x17ae5c;}return _0x1db070[0x0];}function parseFrontmatter(_0x362afb){const _0x3a9924=_0x4985c9,_0x5df2fc={'Wylhg':_0x3a9924(0x160)},_0x4a5fe8=_0x362afb['match'](/^---\n([\s\S]+?)\n---/);if(!_0x4a5fe8)throw new Error(_0x5df2fc[_0x3a9924(0x14e)]);const _0x4f22e3=_0x4a5fe8[0x1],_0x37c273=_0x4f22e3['match'](/name:\s*(.+)/),_0x1f2db6=_0x4f22e3['match'](/description:\s*"?(.+?)"?\n/);return{'name':_0x37c273?.[0x1][_0x3a9924(0x159)]()||'','description':_0x1f2db6?.[0x1]['trim']()||''};}export async function removeSkill(_0x3297eb,_0x1a770c){const _0x2f3c51=_0x4985c9,_0x251b9d={'wjkJY':function(_0x1b7794,_0x3bd2d7){return _0x1b7794(_0x3bd2d7);},'nDWIW':function(_0xdfd98f,_0x9f1e5b,_0x3fe24d){return _0xdfd98f(_0x9f1e5b,_0x3fe24d);}},_0x488b15=getSkillsDir(_0x1a770c),_0xaef3c7=join(_0x488b15,_0x3297eb);if(!_0x251b9d[_0x2f3c51(0x161)](existsSync,_0xaef3c7))return![];try{return await _0x251b9d['nDWIW'](rm,_0xaef3c7,{'recursive':!![]}),console[_0x2f3c51(0x149)]('\x20\x20Removed\x20deprecated\x20skill:\x20'+_0x3297eb),!![];}catch{return console['warn']('\x20\x20Failed\x20to\x20remove\x20deprecated\x20skill:\x20'+_0x3297eb),![];}}