@ranger-testing/ranger-cli 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) 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/git.js +1 -44
  42. package/build/commands/utils/keychain.js +1 -1
  43. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  44. package/build/commands/utils/profileMessages.js +1 -8
  45. package/build/commands/utils/profileSetupBanner.js +1 -167
  46. package/build/commands/utils/rangerRoot.js +1 -60
  47. package/build/commands/utils/reportGenerator.js +1 -130
  48. package/build/commands/utils/retry.js +1 -25
  49. package/build/commands/utils/sessionCache.js +1 -299
  50. package/build/commands/utils/settings.js +1 -313
  51. package/build/commands/utils/skillContent.js +1 -28
  52. package/build/commands/utils/skills.js +1 -1
  53. package/build/commands/utils/telemetry.js +1 -254
  54. package/build/commands/utils/userApi.js +1 -32
  55. package/build/commands/utils/version.js +1 -62
  56. package/build/commands/verifyFeature.js +1 -1343
  57. package/build/commands/verifyInBrowser.js +1 -1
  58. package/package.json +1 -1
  59. package/build/cli.js.map +0 -1
  60. package/build/commands/addEnv.js.map +0 -1
  61. package/build/commands/authEncrypt.js.map +0 -1
  62. package/build/commands/clean.js.map +0 -1
  63. package/build/commands/config.js.map +0 -1
  64. package/build/commands/env.js.map +0 -1
  65. package/build/commands/feature.js.map +0 -1
  66. package/build/commands/hook.js.map +0 -1
  67. package/build/commands/hooks/autoPrompt.js.map +0 -1
  68. package/build/commands/hooks/disable.js.map +0 -1
  69. package/build/commands/hooks/enable.js.map +0 -1
  70. package/build/commands/hooks/exitPlanMode.js.map +0 -1
  71. package/build/commands/hooks/index.js.map +0 -1
  72. package/build/commands/hooks/output.js.map +0 -1
  73. package/build/commands/hooks/planReminder.js.map +0 -1
  74. package/build/commands/hooks/planStart.js.map +0 -1
  75. package/build/commands/hooks/postEdit.js.map +0 -1
  76. package/build/commands/hooks/preCompact.js.map +0 -1
  77. package/build/commands/hooks/sessionEnd.js.map +0 -1
  78. package/build/commands/hooks/sessionStart.js.map +0 -1
  79. package/build/commands/hooks/stopHook.js.map +0 -1
  80. package/build/commands/index.js.map +0 -1
  81. package/build/commands/login.js.map +0 -1
  82. package/build/commands/setupCi.js.map +0 -1
  83. package/build/commands/skillup.js.map +0 -1
  84. package/build/commands/start.js.map +0 -1
  85. package/build/commands/status.js.map +0 -1
  86. package/build/commands/update.js.map +0 -1
  87. package/build/commands/updateEnv.js.map +0 -1
  88. package/build/commands/useEnv.js.map +0 -1
  89. package/build/commands/utils/activeProfile.js.map +0 -1
  90. package/build/commands/utils/browserSessionsApi.js.map +0 -1
  91. package/build/commands/utils/claudeConfig.js.map +0 -1
  92. package/build/commands/utils/claudePlugin.js.map +0 -1
  93. package/build/commands/utils/crypto.js.map +0 -1
  94. package/build/commands/utils/desirePathLog.js.map +0 -1
  95. package/build/commands/utils/deviceAuth.js.map +0 -1
  96. package/build/commands/utils/environment.js.map +0 -1
  97. package/build/commands/utils/featureApi.js.map +0 -1
  98. package/build/commands/utils/featureReportGenerator.js.map +0 -1
  99. package/build/commands/utils/git.js.map +0 -1
  100. package/build/commands/utils/keychain.js.map +0 -1
  101. package/build/commands/utils/localAgentInstallationsApi.js.map +0 -1
  102. package/build/commands/utils/profileMessages.js.map +0 -1
  103. package/build/commands/utils/profileSetupBanner.js.map +0 -1
  104. package/build/commands/utils/rangerRoot.js.map +0 -1
  105. package/build/commands/utils/reportGenerator.js.map +0 -1
  106. package/build/commands/utils/retry.js.map +0 -1
  107. package/build/commands/utils/sessionCache.js.map +0 -1
  108. package/build/commands/utils/settings.js.map +0 -1
  109. package/build/commands/utils/skillContent.js.map +0 -1
  110. package/build/commands/utils/skills.js.map +0 -1
  111. package/build/commands/utils/telemetry.js.map +0 -1
  112. package/build/commands/utils/userApi.js.map +0 -1
  113. package/build/commands/utils/version.js.map +0 -1
  114. package/build/commands/verifyFeature.js.map +0 -1
  115. package/build/commands/verifyInBrowser.js.map +0 -1
@@ -1,155 +1 @@
1
- import { open } from 'fs/promises';
2
- import { getToken } from '../utils/keychain.js';
3
- import { getFeature, concludeSession } from '../utils/featureApi.js';
4
- import { getSessionEntry } from '../utils/sessionCache.js';
5
- import { getEnabledHookContext } from './output.js';
6
- import { createTelemetryCollector } from '../utils/telemetry.js';
7
- /**
8
- * Stop hook handler
9
- *
10
- * Attempts to conclude the feature review session before allowing stop.
11
- * Block conditions are temporarily disabled — the skill prompt now handles
12
- * instructing the agent to share the dashboard link on session end.
13
- */
14
- export async function stopHook(sessionIdOverride) {
15
- const context = await getEnabledHookContext(sessionIdOverride);
16
- const sessionId = context?.sessionId ?? null;
17
- const stopHookActive = Boolean(context?.input?.stop_hook_active);
18
- const transcriptPath = typeof context?.input?.transcript_path === 'string'
19
- ? context.input.transcript_path
20
- : null;
21
- let stopAllowed = true;
22
- if (!sessionId) {
23
- await trackStop(sessionId, false, stopAllowed);
24
- return;
25
- }
26
- try {
27
- // Check if this Claude session is registered with a Ranger feature review
28
- const sessionEntry = getSessionEntry(sessionId);
29
- if (!sessionEntry) {
30
- // Not a Ranger session - allow stop
31
- await trackStop(sessionId, true, stopAllowed);
32
- return;
33
- }
34
- const dashboardUrl = `https://dashboard.ranger.net/features/${sessionEntry.featureId}`;
35
- const skipToken = 'RANGER_SKIP_VERIFICATION';
36
- const token = await getToken();
37
- const shouldRemind = !stopHookActive;
38
- let featureName = null;
39
- let currentSessionId = null;
40
- const skipRequested = stopHookActive &&
41
- (await transcriptHasToken(transcriptPath, skipToken));
42
- const linkIncluded = await transcriptHasToken(transcriptPath, dashboardUrl);
43
- if (token) {
44
- try {
45
- const feature = await getFeature(sessionEntry.featureId);
46
- featureName = feature.name ?? null;
47
- currentSessionId = feature.currentSessionId ?? null;
48
- }
49
- catch {
50
- // Fail open for feature lookup
51
- }
52
- }
53
- // --- Block conditions temporarily disabled (handled by skill prompt instead) ---
54
- // if (skipRequested && !linkIncluded) {
55
- // stopAllowed = false;
56
- // const output = {
57
- // decision: 'block',
58
- // reason: `Before ending, include a final message with the feature review link (${dashboardUrl}) and direct the user to visit it. If you are skipping verification, keep \`${skipToken}\` in that final message, then run /exit again.`,
59
- // };
60
- // console.log(JSON.stringify(output));
61
- // await trackStop(sessionId, true, stopAllowed);
62
- // return;
63
- // }
64
- // Try to conclude the session if we have one
65
- if (token && currentSessionId) {
66
- try {
67
- await concludeSession(sessionEntry.featureId, currentSessionId);
68
- }
69
- catch (err) {
70
- // if (skipRequested && linkIncluded) {
71
- // await trackStop(sessionId, true, stopAllowed);
72
- // return;
73
- // }
74
- if (skipRequested) {
75
- await trackStop(sessionId, true, stopAllowed);
76
- return;
77
- }
78
- // Failed to conclude - block with error message
79
- stopAllowed = false;
80
- const errorMessage = err instanceof Error ? err.message : String(err);
81
- const output = {
82
- decision: 'block',
83
- reason: `Failed to conclude Ranger feature review session${featureName ? ` for "${featureName}"` : ''}:\n\n${errorMessage}\n\nThis is most likely due to pending scenarios that need to be verified. Please resolve the issue or resume later with:\n ranger resume\n\nIf you are extremely sure this is the user's requirement and want to skip verification for now, send a final message that includes the feature review link (${dashboardUrl}) and the token \`${skipToken}\`, then run /exit again.`,
84
- };
85
- console.log(JSON.stringify(output));
86
- await trackStop(sessionId, true, stopAllowed);
87
- return;
88
- }
89
- }
90
- // if (shouldRemind && !linkIncluded) {
91
- // stopAllowed = false;
92
- // const output = {
93
- // decision: 'block',
94
- // reason: `Before ending, include a final message with the feature review link (${dashboardUrl}) and direct the user to visit it.`,
95
- // };
96
- // console.log(JSON.stringify(output));
97
- // await trackStop(sessionId, true, stopAllowed);
98
- // return;
99
- // }
100
- // --- End disabled block conditions ---
101
- await trackStop(sessionId, true, stopAllowed);
102
- return;
103
- }
104
- catch {
105
- // On any error fetching feature, allow stop (fail open)
106
- await trackStop(sessionId, true, stopAllowed);
107
- return;
108
- }
109
- }
110
- async function trackStop(sessionId, hooksEnabled, stopAllowed) {
111
- try {
112
- const telemetry = createTelemetryCollector('hook:stop');
113
- await telemetry.trackCommandStart({
114
- sessionId: sessionId ?? undefined,
115
- hooksEnabled,
116
- stopAllowed,
117
- });
118
- await telemetry.trackCommandEnd('success');
119
- }
120
- catch {
121
- // Telemetry must never throw
122
- }
123
- }
124
- async function transcriptHasToken(transcriptPath, token) {
125
- if (!transcriptPath)
126
- return false;
127
- const tail = await readTranscriptTail(transcriptPath, 200_000);
128
- return tail ? tail.includes(token) : false;
129
- }
130
- async function readTranscriptTail(transcriptPath, maxBytes) {
131
- let handle = null;
132
- try {
133
- handle = await open(transcriptPath, 'r');
134
- const stats = await handle.stat();
135
- const length = Math.min(stats.size, maxBytes);
136
- if (length <= 0) {
137
- return '';
138
- }
139
- const buffer = Buffer.alloc(length);
140
- await handle.read(buffer, 0, length, stats.size - length);
141
- return buffer.toString('utf8');
142
- }
143
- catch {
144
- return null;
145
- }
146
- finally {
147
- try {
148
- await handle?.close();
149
- }
150
- catch {
151
- // Ignore close errors
152
- }
153
- }
154
- }
155
- //# sourceMappingURL=stopHook.js.map
1
+ (function(_0x368359,_0x2035f1){const _0x1eaffe=_0x3a50,_0x2f1c86=_0x368359();while(!![]){try{const _0x2c35e9=-parseInt(_0x1eaffe(0xde))/0x1*(-parseInt(_0x1eaffe(0xd7))/0x2)+parseInt(_0x1eaffe(0xea))/0x3+-parseInt(_0x1eaffe(0xe8))/0x4+parseInt(_0x1eaffe(0xef))/0x5+parseInt(_0x1eaffe(0xec))/0x6+parseInt(_0x1eaffe(0xf2))/0x7*(parseInt(_0x1eaffe(0xd8))/0x8)+-parseInt(_0x1eaffe(0xf7))/0x9;if(_0x2c35e9===_0x2035f1)break;else _0x2f1c86['push'](_0x2f1c86['shift']());}catch(_0x552c25){_0x2f1c86['push'](_0x2f1c86['shift']());}}}(_0x2b1d,0xcaf07));import{open}from'fs/promises';function _0x2b1d(){const _0x5394fc=['sessionId','17848323yvEGjE','input','toString','CKDTe','transcript_path','10CEUVCr','11289912SqFHBr','ZfhmK','close','https://dashboard.ranger.net/features/','RANGER_SKIP_VERIFICATION','featureId','311567MGLvWJ',')\x20and\x20the\x20token\x20`','log','stop_hook_active','size','read','JHOVA','\x20for\x20\x22','rHOfA','alloc','3688568vpThUR','block','512439fLnCSz','success','3291612owtujA',':\x0a\x0a','message','240195wLytpI','dSdnq','hook:stop','7QAryop','lHiBE','MEdYZ','dOcbW'];_0x2b1d=function(){return _0x5394fc;};return _0x2b1d();}import{getToken}from'../utils/keychain.js';import{getFeature,concludeSession}from'../utils/featureApi.js';import{getSessionEntry}from'../utils/sessionCache.js';import{getEnabledHookContext}from'./output.js';import{createTelemetryCollector}from'../utils/telemetry.js';function _0x3a50(_0x283517,_0xadc13d){_0x283517=_0x283517-0xd5;const _0x2b1d5d=_0x2b1d();let _0x3a50d4=_0x2b1d5d[_0x283517];return _0x3a50d4;}export async function stopHook(_0x1be30e){const _0x3db12f=_0x3a50,_0x52976c={'ZfhmK':function(_0x16a14f,_0x2f2aac){return _0x16a14f(_0x2f2aac);},'eChbS':function(_0x3f30e8,_0x371979){return _0x3f30e8===_0x371979;},'CKDTe':'string','dOcbW':function(_0x3ff15e,_0x27e9a6,_0x2b4d3a,_0x5adfb2){return _0x3ff15e(_0x27e9a6,_0x2b4d3a,_0x5adfb2);},'yqnuJ':function(_0x2447bb){return _0x2447bb();},'rHOfA':function(_0x31cc11,_0x35184d,_0x3d4bba){return _0x31cc11(_0x35184d,_0x3d4bba);},'cOJJh':function(_0x18739b,_0x3cc12d,_0x237710,_0xe34182){return _0x18739b(_0x3cc12d,_0x237710,_0xe34182);},'JHOVA':function(_0x232fbd,_0x22a6ac){return _0x232fbd instanceof _0x22a6ac;},'dSdnq':_0x3db12f(0xe9)},_0x2e22a8=await getEnabledHookContext(_0x1be30e),_0x756418=_0x2e22a8?.[_0x3db12f(0xf6)]??null,_0x28fbbc=_0x52976c[_0x3db12f(0xd9)](Boolean,_0x2e22a8?.[_0x3db12f(0xf8)]?.[_0x3db12f(0xe1)]),_0x29c72b=_0x52976c['eChbS'](typeof _0x2e22a8?.['input']?.[_0x3db12f(0xd6)],_0x52976c[_0x3db12f(0xd5)])?_0x2e22a8[_0x3db12f(0xf8)][_0x3db12f(0xd6)]:null;let _0x5831f1=!![];if(!_0x756418){await _0x52976c[_0x3db12f(0xf5)](trackStop,_0x756418,![],_0x5831f1);return;}try{const _0x111012=_0x52976c[_0x3db12f(0xd9)](getSessionEntry,_0x756418);if(!_0x111012){await trackStop(_0x756418,!![],_0x5831f1);return;}const _0x343615=_0x3db12f(0xdb)+_0x111012[_0x3db12f(0xdd)],_0x5c20bd=_0x3db12f(0xdc),_0x277656=await _0x52976c['yqnuJ'](getToken),_0x355f6b=!_0x28fbbc;let _0x5b86a6=null,_0x2f913f=null;const _0x4f048c=_0x28fbbc&&await _0x52976c[_0x3db12f(0xe6)](transcriptHasToken,_0x29c72b,_0x5c20bd),_0x379063=await _0x52976c[_0x3db12f(0xe6)](transcriptHasToken,_0x29c72b,_0x343615);if(_0x277656)try{const _0x14937c=await _0x52976c['ZfhmK'](getFeature,_0x111012['featureId']);_0x5b86a6=_0x14937c['name']??null,_0x2f913f=_0x14937c['currentSessionId']??null;}catch{}if(_0x277656&&_0x2f913f)try{await concludeSession(_0x111012[_0x3db12f(0xdd)],_0x2f913f);}catch(_0x39913d){if(_0x4f048c){await _0x52976c['cOJJh'](trackStop,_0x756418,!![],_0x5831f1);return;}_0x5831f1=![];const _0x3564c8=_0x52976c[_0x3db12f(0xe4)](_0x39913d,Error)?_0x39913d[_0x3db12f(0xee)]:String(_0x39913d),_0x1473e7={'decision':_0x52976c[_0x3db12f(0xf0)],'reason':'Failed\x20to\x20conclude\x20Ranger\x20feature\x20review\x20session'+(_0x5b86a6?_0x3db12f(0xe5)+_0x5b86a6+'\x22':'')+_0x3db12f(0xed)+_0x3564c8+'\x0a\x0aThis\x20is\x20most\x20likely\x20due\x20to\x20pending\x20scenarios\x20that\x20need\x20to\x20be\x20verified.\x20Please\x20resolve\x20the\x20issue\x20or\x20resume\x20later\x20with:\x0a\x20\x20ranger\x20resume\x0a\x0aIf\x20you\x20are\x20extremely\x20sure\x20this\x20is\x20the\x20user\x27s\x20requirement\x20and\x20want\x20to\x20skip\x20verification\x20for\x20now,\x20send\x20a\x20final\x20message\x20that\x20includes\x20the\x20feature\x20review\x20link\x20('+_0x343615+_0x3db12f(0xdf)+_0x5c20bd+'`,\x20then\x20run\x20/exit\x20again.'};console[_0x3db12f(0xe0)](JSON['stringify'](_0x1473e7)),await _0x52976c[_0x3db12f(0xf5)](trackStop,_0x756418,!![],_0x5831f1);return;}await _0x52976c[_0x3db12f(0xf5)](trackStop,_0x756418,!![],_0x5831f1);return;}catch{await _0x52976c[_0x3db12f(0xf5)](trackStop,_0x756418,!![],_0x5831f1);return;}}async function trackStop(_0x27b227,_0xe9e1df,_0x1945f0){const _0x53473b=_0x3a50;try{const _0x137e92=createTelemetryCollector(_0x53473b(0xf1));await _0x137e92['trackCommandStart']({'sessionId':_0x27b227??undefined,'hooksEnabled':_0xe9e1df,'stopAllowed':_0x1945f0}),await _0x137e92['trackCommandEnd'](_0x53473b(0xeb));}catch{}}async function transcriptHasToken(_0x2eed5e,_0x4ade15){const _0x1247d6=_0x3a50,_0x4c438e={'MEdYZ':function(_0x1075fb,_0x50f168,_0x2b0ff7){return _0x1075fb(_0x50f168,_0x2b0ff7);}};if(!_0x2eed5e)return![];const _0x468d9a=await _0x4c438e[_0x1247d6(0xf4)](readTranscriptTail,_0x2eed5e,0x30d40);return _0x468d9a?_0x468d9a['includes'](_0x4ade15):![];}async function readTranscriptTail(_0x5166ad,_0x31761e){const _0x531585=_0x3a50,_0x5e60ae={'OddSK':function(_0x259ce8,_0x380345){return _0x259ce8<=_0x380345;},'lHiBE':function(_0x1a962e,_0x2675f2){return _0x1a962e-_0x2675f2;}};let _0x376d5b=null;try{_0x376d5b=await open(_0x5166ad,'r');const _0xa508b0=await _0x376d5b['stat'](),_0x121ec9=Math['min'](_0xa508b0[_0x531585(0xe2)],_0x31761e);if(_0x5e60ae['OddSK'](_0x121ec9,0x0))return'';const _0x34aec8=Buffer[_0x531585(0xe7)](_0x121ec9);return await _0x376d5b[_0x531585(0xe3)](_0x34aec8,0x0,_0x121ec9,_0x5e60ae[_0x531585(0xf3)](_0xa508b0[_0x531585(0xe2)],_0x121ec9)),_0x34aec8[_0x531585(0xf9)]('utf8');}catch{return null;}finally{try{await _0x376d5b?.[_0x531585(0xda)]();}catch{}}}
@@ -1,12 +1 @@
1
- export { addEnv } from './addEnv.js';
2
- export { clean } from './clean.js';
3
- export { login } from './login.js';
4
- export { start } from './start.js';
5
- export { useEnv } from './useEnv.js';
6
- export { updateEnv } from './updateEnv.js';
7
- export { update } from './update.js';
8
- export { skillup } from './skillup.js';
9
- export { envList } from './env.js';
10
- export { hook } from './hook.js';
11
- export { setupCi } from './setupCi.js';
12
- //# sourceMappingURL=index.js.map
1
+ (function(_0x399b5b,_0x42d08d){var _0x2862c6=_0x17f0,_0xe0e50b=_0x399b5b();while(!![]){try{var _0x26982b=parseInt(_0x2862c6(0xd3))/0x1*(parseInt(_0x2862c6(0xd9))/0x2)+-parseInt(_0x2862c6(0xdb))/0x3*(-parseInt(_0x2862c6(0xd4))/0x4)+parseInt(_0x2862c6(0xd7))/0x5*(-parseInt(_0x2862c6(0xdc))/0x6)+-parseInt(_0x2862c6(0xd8))/0x7*(-parseInt(_0x2862c6(0xdd))/0x8)+-parseInt(_0x2862c6(0xda))/0x9+-parseInt(_0x2862c6(0xd6))/0xa+parseInt(_0x2862c6(0xd5))/0xb;if(_0x26982b===_0x42d08d)break;else _0xe0e50b['push'](_0xe0e50b['shift']());}catch(_0x2cccb2){_0xe0e50b['push'](_0xe0e50b['shift']());}}}(_0x2d91,0xc1920));export{addEnv}from'./addEnv.js';export{clean}from'./clean.js';export{login}from'./login.js';export{start}from'./start.js';export{useEnv}from'./useEnv.js';export{updateEnv}from'./updateEnv.js';export{update}from'./update.js';export{skillup}from'./skillup.js';function _0x17f0(_0x47698d,_0x57622e){_0x47698d=_0x47698d-0xd3;var _0x2d9177=_0x2d91();var _0x17f0bf=_0x2d9177[_0x47698d];return _0x17f0bf;}export{envList}from'./env.js';export{hook}from'./hook.js';function _0x2d91(){var _0x1e9871=['15232aQuGMO','6jNNWmM','7246908cxYhAO','1285305hmEXCU','84HQyinQ','4136TRdKHe','433518aoyFQQ','4szPTBr','8451388HrkpOF','6735490pMeBLm','482380wEUUFa'];_0x2d91=function(){return _0x1e9871;};return _0x2d91();}export{setupCi}from'./setupCi.js';
@@ -1,26 +1 @@
1
- import { runDeviceAuthFlow } from './utils/deviceAuth.js';
2
- import { getCurrentUser } from './utils/userApi.js';
3
- /**
4
- * Standalone login command — runs device auth + key provisioning
5
- * without the full `start` setup (Chromium, plugins, etc.).
6
- */
7
- export async function login() {
8
- const isInteractive = process.stdin.isTTY && process.stdout.isTTY;
9
- if (!isInteractive) {
10
- throw new Error('Login requires an interactive terminal. In CI, use: ranger setup [token] or set RANGER_CLI_TOKEN.');
11
- }
12
- try {
13
- const token = await runDeviceAuthFlow();
14
- const result = await getCurrentUser(token);
15
- if (result.success) {
16
- console.log(`\n✅ Logged in to ${result.user.organizationName}`);
17
- }
18
- else {
19
- console.log('\n✅ API key stored successfully');
20
- }
21
- }
22
- catch (error) {
23
- throw new Error(`Login failed: ${error instanceof Error ? error.message : error}`);
24
- }
25
- }
26
- //# sourceMappingURL=login.js.map
1
+ (function(_0x4009ec,_0x51706c){const _0x5ea0e3=_0x50f7,_0x2ff861=_0x4009ec();while(!![]){try{const _0x42a686=parseInt(_0x5ea0e3(0xd6))/0x1+parseInt(_0x5ea0e3(0xca))/0x2+parseInt(_0x5ea0e3(0xcc))/0x3+parseInt(_0x5ea0e3(0xd4))/0x4*(-parseInt(_0x5ea0e3(0xc9))/0x5)+parseInt(_0x5ea0e3(0xd0))/0x6+parseInt(_0x5ea0e3(0xcf))/0x7*(-parseInt(_0x5ea0e3(0xd1))/0x8)+-parseInt(_0x5ea0e3(0xcd))/0x9;if(_0x42a686===_0x51706c)break;else _0x2ff861['push'](_0x2ff861['shift']());}catch(_0x38df64){_0x2ff861['push'](_0x2ff861['shift']());}}}(_0x4210,0x3cdbe));function _0x4210(){const _0x3d09fd=['1794224zncgtd','stdin','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','839824wcWLBQ','log','195813QxXoxz','stdout','uyJHk','success','5DHyRXQ','120794rXUMfJ','TmmKQ','1082844lQFXcZ','3800214hrhCQB','user','7pxbvVi','2931600uDXxJs'];_0x4210=function(){return _0x3d09fd;};return _0x4210();}function _0x50f7(_0x2ace1e,_0xadab09){_0x2ace1e=_0x2ace1e-0xc7;const _0x4210a6=_0x4210();let _0x50f7db=_0x4210a6[_0x2ace1e];return _0x50f7db;}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';export async function login(){const _0x251a71=_0x50f7,_0x401703={'uyJHk':_0x251a71(0xd3),'qxZdu':function(_0x102233,_0x403c0d){return _0x102233(_0x403c0d);},'TmmKQ':function(_0x3cbdd0,_0xcd2835){return _0x3cbdd0 instanceof _0xcd2835;}},_0x108b17=process[_0x251a71(0xd2)]['isTTY']&&process[_0x251a71(0xd7)]['isTTY'];if(!_0x108b17)throw new Error(_0x401703[_0x251a71(0xc7)]);try{const _0x15c5bb=await runDeviceAuthFlow(),_0x4a3a1d=await _0x401703['qxZdu'](getCurrentUser,_0x15c5bb);_0x4a3a1d[_0x251a71(0xc8)]?console[_0x251a71(0xd5)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x4a3a1d[_0x251a71(0xce)]['organizationName']):console[_0x251a71(0xd5)]('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0xd4a9d4){throw new Error('Login\x20failed:\x20'+(_0x401703[_0x251a71(0xcb)](_0xd4a9d4,Error)?_0xd4a9d4['message']:_0xd4a9d4));}}
@@ -1,189 +1 @@
1
- import { mkdir, readFile, readdir } from 'fs/promises';
2
- import { join } from 'path';
3
- import { existsSync } from 'fs';
4
- import { authenticate, ensureRangerDir, ensureChromium, writeRangerGitignore, } from './start.js';
5
- import { skillup } from './skillup.js';
6
- import { getRangerDir } from './utils/rangerRoot.js';
7
- import { writeActiveProfileName } from './utils/activeProfile.js';
8
- import { saveSettings } from './utils/settings.js';
9
- import { decrypt } from './utils/crypto.js';
10
- import { getToken } from './utils/keychain.js';
11
- import { runClaudeCommand, isMarketplaceAdded, isPluginInstalled, } from './utils/claudePlugin.js';
12
- /**
13
- * Find a CI profile to activate.
14
- * If profileName is specified, use it. Otherwise auto-detect from .ranger/ci/.
15
- */
16
- async function findCiProfile(profileName) {
17
- const rangerDir = getRangerDir();
18
- const ciDir = join(rangerDir, 'ci');
19
- if (profileName) {
20
- const profilePath = join(ciDir, profileName);
21
- // Profile may not exist yet if --base-url will create it
22
- return { name: profileName, path: profilePath };
23
- }
24
- // Auto-detect: scan .ranger/ci/ for directories
25
- if (!existsSync(ciDir)) {
26
- throw new Error('No CI profiles found. Create one first with: ranger profile add <name> --ci\n' +
27
- 'Or specify a profile name with --profile and --base-url to create one.');
28
- }
29
- const entries = await readdir(ciDir, { withFileTypes: true });
30
- const profiles = entries.filter((e) => e.isDirectory()).map((e) => e.name);
31
- if (profiles.length === 0) {
32
- throw new Error('No CI profiles found in .ranger/ci/. Create one first with: ranger profile add <name> --ci\n' +
33
- 'Or specify a profile name with --profile and --base-url to create one.');
34
- }
35
- if (profiles.length === 1) {
36
- const name = profiles[0];
37
- console.log(`Auto-detected CI profile: ${name}`);
38
- return { name, path: join(ciDir, name) };
39
- }
40
- // Multiple profiles — require --profile flag
41
- throw new Error(`Multiple CI profiles found: ${profiles.join(', ')}. Use --profile to specify which one.`);
42
- }
43
- /**
44
- * Install Claude Code plugin at project scope (non-interactive).
45
- */
46
- async function installPluginNonInteractive() {
47
- const alreadyInstalled = await isPluginInstalled('ranger@trailhead');
48
- if (alreadyInstalled) {
49
- console.log('✓ Claude Code plugin already installed');
50
- return false;
51
- }
52
- console.log('Installing Claude Code plugin (project level)...');
53
- const marketplaceAlreadyAdded = await isMarketplaceAdded('trailhead');
54
- let marketplaceReady = marketplaceAlreadyAdded;
55
- if (marketplaceAlreadyAdded) {
56
- console.log('✓ Marketplace already added');
57
- }
58
- else {
59
- const result = await runClaudeCommand([
60
- 'plugin',
61
- 'marketplace',
62
- 'add',
63
- 'ranger-testing/trailhead',
64
- ]);
65
- if (!result.success) {
66
- console.error('Failed to add marketplace:', result.error);
67
- console.log('You can install manually: claude plugin marketplace add ranger-testing/trailhead');
68
- }
69
- else {
70
- marketplaceReady = true;
71
- }
72
- }
73
- if (marketplaceReady) {
74
- const result = await runClaudeCommand([
75
- 'plugin',
76
- 'install',
77
- 'ranger@trailhead',
78
- '--scope',
79
- 'project',
80
- ]);
81
- if (!result.success) {
82
- console.error('Failed to install plugin:', result.error);
83
- console.log('You can install manually: claude plugin install ranger@trailhead --scope project');
84
- }
85
- else {
86
- console.log('✓ Claude Code plugin installed');
87
- }
88
- }
89
- return true;
90
- }
91
- /**
92
- * Non-interactive CI setup. Authenticates, installs Chromium, activates a CI profile,
93
- * installs plugin and skills — all without prompts.
94
- */
95
- export async function setupCi(token, options, telemetry) {
96
- console.log('\n🔧 Ranger CI Setup\n');
97
- // Phase 1: Auth
98
- telemetry?.trackPhaseStart('auth');
99
- await authenticate(token);
100
- telemetry?.trackPhaseEnd('auth');
101
- // Phase 2: .ranger/ directory
102
- telemetry?.trackPhaseStart('dir_setup');
103
- const { path: rangerDir, installed: dirCreated } = await ensureRangerDir();
104
- await writeRangerGitignore(rangerDir);
105
- // Ensure sessions directory exists
106
- const sessionsDir = join(rangerDir, 'sessions');
107
- if (!existsSync(sessionsDir)) {
108
- await mkdir(sessionsDir, { recursive: true });
109
- }
110
- telemetry?.trackPhaseEnd('dir_setup', { installed: dirCreated });
111
- // Phase 3: Chromium
112
- telemetry?.trackPhaseStart('chromium');
113
- let chromiumInstalled = false;
114
- if (options?.skipChromium) {
115
- console.log('✓ Skipping Chromium check (--skip-chromium)');
116
- }
117
- else {
118
- chromiumInstalled = await ensureChromium();
119
- }
120
- telemetry?.trackPhaseEnd('chromium', {
121
- installed: chromiumInstalled,
122
- skipped: !!options?.skipChromium,
123
- });
124
- // Phase 4: Profile activation
125
- telemetry?.trackPhaseStart('profile_activate');
126
- const profile = await findCiProfile(options?.profile);
127
- // Create/update settings if --base-url provided
128
- let createdSettings = false;
129
- if (options?.baseUrl) {
130
- await mkdir(profile.path, { recursive: true });
131
- await saveSettings(profile.name, {
132
- baseUrl: options.baseUrl,
133
- headless: true,
134
- });
135
- console.log(`✓ Created profile settings: baseUrl=${options.baseUrl}`);
136
- createdSettings = true;
137
- }
138
- // Verify profile has settings
139
- const settingsPath = join(profile.path, 'settings.json');
140
- if (!existsSync(settingsPath) && !createdSettings) {
141
- throw new Error(`CI profile "${profile.name}" has no settings.json. Use --base-url to configure it.`);
142
- }
143
- // Check auth state
144
- const authPath = join(profile.path, 'auth.json');
145
- const encryptedAuthPath = join(profile.path, 'auth.json.enc');
146
- const hasAuth = existsSync(authPath);
147
- const hasEncryptedAuth = existsSync(encryptedAuthPath);
148
- if (hasEncryptedAuth) {
149
- // Verify we can decrypt it
150
- try {
151
- const apiToken = await getToken();
152
- if (!apiToken) {
153
- throw new Error('No API token available for decryption');
154
- }
155
- const encrypted = await readFile(encryptedAuthPath);
156
- decrypt(encrypted, apiToken);
157
- console.log('✓ Encrypted auth verified (will decrypt at runtime)');
158
- }
159
- catch (error) {
160
- const msg = error instanceof Error ? error.message : String(error);
161
- throw new Error(`Failed to verify encrypted auth for profile "${profile.name}": ${msg}`);
162
- }
163
- }
164
- else if (hasAuth) {
165
- console.log('✓ Auth state found');
166
- }
167
- else {
168
- console.log(' No auth state found (app may not require authentication)');
169
- }
170
- // Set as active profile
171
- await writeActiveProfileName(profile.name);
172
- console.log(`✓ Active profile: ${profile.name}`);
173
- telemetry?.trackPhaseEnd('profile_activate', {
174
- profileName: profile.name,
175
- hasAuth,
176
- hasEncryptedAuth,
177
- createdSettings,
178
- });
179
- // Phase 5: Plugin
180
- telemetry?.trackPhaseStart('plugin');
181
- const pluginInstalled = await installPluginNonInteractive();
182
- telemetry?.trackPhaseEnd('plugin', { installed: pluginInstalled });
183
- // Phase 6: Skills
184
- telemetry?.trackPhaseStart('skills');
185
- await skillup({ autoInstall: 'project' });
186
- telemetry?.trackPhaseEnd('skills');
187
- console.log('\n✅ Ranger CI setup complete!\n');
188
- }
189
- //# sourceMappingURL=setupCi.js.map
1
+ (function(_0x406149,_0x3c7526){const _0x2597a1=_0x359a,_0x3fd382=_0x406149();while(!![]){try{const _0x55ea0e=-parseInt(_0x2597a1(0xa9))/0x1*(parseInt(_0x2597a1(0x9d))/0x2)+parseInt(_0x2597a1(0xa1))/0x3+parseInt(_0x2597a1(0x9e))/0x4*(-parseInt(_0x2597a1(0x83))/0x5)+parseInt(_0x2597a1(0xb8))/0x6+-parseInt(_0x2597a1(0xb3))/0x7*(parseInt(_0x2597a1(0x8f))/0x8)+-parseInt(_0x2597a1(0x90))/0x9*(-parseInt(_0x2597a1(0xa5))/0xa)+parseInt(_0x2597a1(0xa8))/0xb;if(_0x55ea0e===_0x3c7526)break;else _0x3fd382['push'](_0x3fd382['shift']());}catch(_0x21b3f5){_0x3fd382['push'](_0x3fd382['shift']());}}}(_0x1a3f,0x5daef));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';function _0x359a(_0x5aef0b,_0xa709d3){_0x5aef0b=_0x5aef0b-0x83;const _0x1a3f8f=_0x1a3f();let _0x359a6c=_0x1a3f8f[_0x5aef0b];return _0x359a6c;}import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x45d57e){const _0x3d1709=_0x359a,_0x292e1d={'yDISF':function(_0x14b886){return _0x14b886();},'CfExN':function(_0x2ea2f7,_0x17d65c,_0x5d2479){return _0x2ea2f7(_0x17d65c,_0x5d2479);},'jLjgl':function(_0x39a3b8,_0x4586cd,_0x4628d4){return _0x39a3b8(_0x4586cd,_0x4628d4);},'ATeuY':function(_0x6987ed,_0x28ef7e){return _0x6987ed+_0x28ef7e;},'Mcqwi':'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','ZwkWD':function(_0x282952,_0x25254c,_0x20e6c7){return _0x282952(_0x25254c,_0x20e6c7);},'kQpOT':'No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','ZOckT':function(_0x490abc,_0x5eb8a5,_0x37fae5){return _0x490abc(_0x5eb8a5,_0x37fae5);}},_0x281c7e=_0x292e1d['yDISF'](getRangerDir),_0x5c90f9=_0x292e1d['CfExN'](join,_0x281c7e,'ci');if(_0x45d57e){const _0x4dbb36=_0x292e1d[_0x3d1709(0xb9)](join,_0x5c90f9,_0x45d57e);return{'name':_0x45d57e,'path':_0x4dbb36};}if(!existsSync(_0x5c90f9))throw new Error(_0x292e1d['ATeuY']('No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a',_0x292e1d['Mcqwi']));const _0x4b8f9a=await _0x292e1d['ZwkWD'](readdir,_0x5c90f9,{'withFileTypes':!![]}),_0x1d2e09=_0x4b8f9a['filter'](_0x13f97f=>_0x13f97f['isDirectory']())[_0x3d1709(0x97)](_0x53dd2e=>_0x53dd2e['name']);if(_0x1d2e09[_0x3d1709(0xa7)]===0x0)throw new Error(_0x292e1d['kQpOT']+_0x3d1709(0x98));if(_0x1d2e09[_0x3d1709(0xa7)]===0x1){const _0x311b7e=_0x1d2e09[0x0];return console[_0x3d1709(0xad)](_0x3d1709(0x9a)+_0x311b7e),{'name':_0x311b7e,'path':_0x292e1d[_0x3d1709(0xb6)](join,_0x5c90f9,_0x311b7e)};}throw new Error('Multiple\x20CI\x20profiles\x20found:\x20'+_0x1d2e09[_0x3d1709(0x8d)](',\x20')+_0x3d1709(0x93));}function _0x1a3f(){const _0x12528f=['GbVUh','name','5213930UZslyv','trackPhaseStart','length','1195414dCxGOF','4943mtwWpl','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','plugin','Fqbai','log','ZTtNs','oLhcw','trailhead','skills','CrnEE','613466PUpVal','chromium','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','ZOckT','kpooc','944556JRsVbe','jLjgl','qoMiX','215030ShMSaa','\x22:\x20','error','install','ranger@trailhead','✓\x20Auth\x20state\x20found','Xbtkh','path','Kevkm','✓\x20Marketplace\x20already\x20added','join','baseUrl','64eqbITm','9vPnrck','trackPhaseEnd','bMlIZ','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','VRzBS','message','rhBub','map','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','--scope','Auto-detected\x20CI\x20profile:\x20','Failed\x20to\x20install\x20plugin:','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','56NwErId','4RppVAo','QyzFE','CI\x20profile\x20\x22','1436244CSPvJt','project'];_0x1a3f=function(){return _0x12528f;};return _0x1a3f();}async function installPluginNonInteractive(){const _0x5b7a64=_0x359a,_0x90ee6b={'oLhcw':function(_0x240a1a,_0x832de0){return _0x240a1a(_0x832de0);},'uQuyV':'Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','KaKSZ':_0x5b7a64(0xb0),'Kevkm':_0x5b7a64(0xab),'kpooc':'ranger@trailhead','Fqbai':_0x5b7a64(0x9c),'jCJPN':'✓\x20Claude\x20Code\x20plugin\x20installed'},_0x42adca=await _0x90ee6b['oLhcw'](isPluginInstalled,_0x5b7a64(0x87));if(_0x42adca)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];console['log'](_0x90ee6b['uQuyV']);const _0x593de7=await isMarketplaceAdded(_0x90ee6b['KaKSZ']);let _0x57b2eb=_0x593de7;if(_0x593de7)console['log'](_0x5b7a64(0x8c));else{const _0x2a7996=await runClaudeCommand([_0x90ee6b[_0x5b7a64(0x8b)],'marketplace','add','ranger-testing/trailhead']);!_0x2a7996['success']?(console[_0x5b7a64(0x85)]('Failed\x20to\x20add\x20marketplace:',_0x2a7996['error']),console[_0x5b7a64(0xad)]('You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead')):_0x57b2eb=!![];}if(_0x57b2eb){const _0x4d579a=await _0x90ee6b[_0x5b7a64(0xaf)](runClaudeCommand,['plugin',_0x5b7a64(0x86),_0x90ee6b[_0x5b7a64(0xb7)],_0x5b7a64(0x99),_0x5b7a64(0xa2)]);!_0x4d579a['success']?(console['error'](_0x5b7a64(0x9b),_0x4d579a[_0x5b7a64(0x85)]),console['log'](_0x90ee6b[_0x5b7a64(0xac)])):console[_0x5b7a64(0xad)](_0x90ee6b['jCJPN']);}return!![];}export async function setupCi(_0x2861ba,_0x3bd431,_0x40c9bc){const _0x480172=_0x359a,_0x5a53e2={'zexxd':'\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','GcCMe':'auth','VRzBS':function(_0x3a57c9,_0x4115d8){return _0x3a57c9(_0x4115d8);},'emaQa':'dir_setup','QyzFE':function(_0x53f43d,_0x3e84fb){return _0x53f43d(_0x3e84fb);},'CrnEE':function(_0x58c784,_0x2d57de,_0x304c9e){return _0x58c784(_0x2d57de,_0x304c9e);},'pZBYm':'sessions','DLQSY':function(_0x559623,_0x127b92){return _0x559623(_0x127b92);},'DLRrF':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','Zjqrl':function(_0x32187b,_0x259aa7,_0x26dab0){return _0x32187b(_0x259aa7,_0x26dab0);},'bMlIZ':'settings.json','rhBub':'auth.json','qoMiX':'auth.json.enc','ZTtNs':function(_0x19c5e5,_0x466ae9){return _0x19c5e5 instanceof _0x466ae9;},'GbVUh':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','jUrhL':_0x480172(0xb1),'Xbtkh':'\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a'};console['log'](_0x5a53e2['zexxd']),_0x40c9bc?.[_0x480172(0xa6)](_0x5a53e2['GcCMe']),await _0x5a53e2['VRzBS'](authenticate,_0x2861ba),_0x40c9bc?.['trackPhaseEnd']('auth'),_0x40c9bc?.[_0x480172(0xa6)](_0x5a53e2['emaQa']);const {path:_0x42089b,installed:_0x3456fa}=await ensureRangerDir();await _0x5a53e2['QyzFE'](writeRangerGitignore,_0x42089b);const _0x2038a5=_0x5a53e2['CrnEE'](join,_0x42089b,_0x5a53e2['pZBYm']);!_0x5a53e2['DLQSY'](existsSync,_0x2038a5)&&await mkdir(_0x2038a5,{'recursive':!![]});_0x40c9bc?.[_0x480172(0x91)](_0x5a53e2['emaQa'],{'installed':_0x3456fa}),_0x40c9bc?.[_0x480172(0xa6)](_0x480172(0xb4));let _0x3e13a=![];_0x3bd431?.['skipChromium']?console[_0x480172(0xad)](_0x5a53e2['DLRrF']):_0x3e13a=await ensureChromium();_0x40c9bc?.[_0x480172(0x91)](_0x480172(0xb4),{'installed':_0x3e13a,'skipped':!!_0x3bd431?.['skipChromium']}),_0x40c9bc?.['trackPhaseStart']('profile_activate');const _0x2bd328=await findCiProfile(_0x3bd431?.['profile']);let _0xea0e32=![];_0x3bd431?.['baseUrl']&&(await _0x5a53e2['Zjqrl'](mkdir,_0x2bd328['path'],{'recursive':!![]}),await _0x5a53e2['CrnEE'](saveSettings,_0x2bd328[_0x480172(0xa4)],{'baseUrl':_0x3bd431[_0x480172(0x8e)],'headless':!![]}),console['log']('✓\x20Created\x20profile\x20settings:\x20baseUrl='+_0x3bd431[_0x480172(0x8e)]),_0xea0e32=!![]);const _0x339922=join(_0x2bd328[_0x480172(0x8a)],_0x5a53e2[_0x480172(0x92)]);if(!_0x5a53e2[_0x480172(0x9f)](existsSync,_0x339922)&&!_0xea0e32)throw new Error(_0x480172(0xa0)+_0x2bd328[_0x480172(0xa4)]+'\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.');const _0x3f9c40=join(_0x2bd328['path'],_0x5a53e2[_0x480172(0x96)]),_0x4d0181=_0x5a53e2[_0x480172(0xb2)](join,_0x2bd328[_0x480172(0x8a)],_0x5a53e2[_0x480172(0xba)]),_0x417e41=existsSync(_0x3f9c40),_0xdc0e93=_0x5a53e2[_0x480172(0x9f)](existsSync,_0x4d0181);if(_0xdc0e93)try{const _0x1c6d40=await getToken();if(!_0x1c6d40)throw new Error('No\x20API\x20token\x20available\x20for\x20decryption');const _0x2ba048=await readFile(_0x4d0181);decrypt(_0x2ba048,_0x1c6d40),console[_0x480172(0xad)](_0x480172(0xaa));}catch(_0x1a39bc){const _0x317eca=_0x5a53e2[_0x480172(0xae)](_0x1a39bc,Error)?_0x1a39bc[_0x480172(0x95)]:_0x5a53e2[_0x480172(0x9f)](String,_0x1a39bc);throw new Error(_0x480172(0xb5)+_0x2bd328['name']+_0x480172(0x84)+_0x317eca);}else _0x417e41?console[_0x480172(0xad)](_0x480172(0x88)):console[_0x480172(0xad)](_0x5a53e2[_0x480172(0xa3)]);await writeActiveProfileName(_0x2bd328['name']),console[_0x480172(0xad)]('✓\x20Active\x20profile:\x20'+_0x2bd328[_0x480172(0xa4)]),_0x40c9bc?.[_0x480172(0x91)]('profile_activate',{'profileName':_0x2bd328[_0x480172(0xa4)],'hasAuth':_0x417e41,'hasEncryptedAuth':_0xdc0e93,'createdSettings':_0xea0e32}),_0x40c9bc?.[_0x480172(0xa6)](_0x480172(0xab));const _0x1510cc=await installPluginNonInteractive();_0x40c9bc?.['trackPhaseEnd'](_0x480172(0xab),{'installed':_0x1510cc}),_0x40c9bc?.['trackPhaseStart'](_0x5a53e2['jUrhL']),await _0x5a53e2[_0x480172(0x94)](skillup,{'autoInstall':_0x480172(0xa2)}),_0x40c9bc?.['trackPhaseEnd']('skills'),console[_0x480172(0xad)](_0x5a53e2[_0x480172(0x89)]);}
@@ -1,80 +1 @@
1
- import { basename } from 'path';
2
- import inquirer from 'inquirer';
3
- import { getToken } from './utils/keychain.js';
4
- import { installSkill } from './utils/skills.js';
5
- import { getCurrentVersion } from './utils/version.js';
6
- import { getClaudeConfigDir, getProjectRoot, } from './utils/claudeConfig.js';
7
- export async function skillup(options = {}) {
8
- console.log('\n🎯 Ranger Skill Setup\n');
9
- const token = await getToken();
10
- if (!token) {
11
- console.log('❌ No Ranger API token found.\n');
12
- console.log('To get started:');
13
- console.log(' 1. Get your API token from https://dashboard.ranger.net/cli');
14
- console.log(' 2. Run: ranger setup <your-api-token>');
15
- console.log(' 3. Run: ranger skillup\n');
16
- return;
17
- }
18
- console.log('✓ Found API token');
19
- const projectRoot = getProjectRoot();
20
- const projectName = basename(projectRoot);
21
- // Determine install level
22
- const isInteractive = process.stdin.isTTY && process.stdout.isTTY;
23
- let installLevel;
24
- if (options.autoInstall) {
25
- installLevel = options.autoInstall;
26
- }
27
- else if (isInteractive) {
28
- const response = await inquirer.prompt([
29
- {
30
- type: 'list',
31
- name: 'installLevel',
32
- message: 'Where should skills be installed?',
33
- choices: [
34
- {
35
- name: `All projects (${getClaudeConfigDir()}/skills/)`,
36
- value: 'user',
37
- },
38
- {
39
- name: `This project only (${projectName}/.claude/skills/)`,
40
- value: 'project',
41
- },
42
- ],
43
- },
44
- ]);
45
- installLevel = response.installLevel;
46
- }
47
- else {
48
- // Non-interactive mode: default to project-level installation
49
- installLevel = 'project';
50
- console.log(`Non-interactive mode: Installing skills at project level (${projectName}/.claude/skills/)`);
51
- }
52
- let installedCount = 0;
53
- const cliVersion = getCurrentVersion();
54
- console.log('\n📦 Installing skills...\n');
55
- // Install ranger (requires API token)
56
- try {
57
- const featureTrackerInstalled = await installSkill('ranger', {
58
- cliVersion,
59
- level: installLevel,
60
- });
61
- if (featureTrackerInstalled) {
62
- installedCount++;
63
- }
64
- }
65
- catch (error) {
66
- console.warn(' Failed to install ranger skill:', error instanceof Error ? error.message : error);
67
- }
68
- if (installedCount > 0) {
69
- const levelDesc = installLevel === 'user' ? 'user-level' : 'project-level';
70
- console.log(`\n✅ Installed ${installedCount} ${levelDesc} skill${installedCount > 1 ? 's' : ''} successfully!\n`);
71
- if (!options.suppressUsage) {
72
- console.log('To use:');
73
- console.log(` - Open Claude Code in plan mode and run /ranger:enable. Plan out a UI feature with Ranger and watch Ranger test it for you!`);
74
- }
75
- }
76
- else {
77
- console.log('\n⚠️ No skills were installed.\n');
78
- }
79
- }
80
- //# sourceMappingURL=skillup.js.map
1
+ (function(_0x3fc66e,_0x292e92){const _0x24fd72=_0x2d4b,_0x3a8493=_0x3fc66e();while(!![]){try{const _0x5a7b48=parseInt(_0x24fd72(0xdf))/0x1*(-parseInt(_0x24fd72(0xda))/0x2)+-parseInt(_0x24fd72(0xeb))/0x3*(-parseInt(_0x24fd72(0xe2))/0x4)+parseInt(_0x24fd72(0xd6))/0x5+-parseInt(_0x24fd72(0xf1))/0x6*(parseInt(_0x24fd72(0xf8))/0x7)+parseInt(_0x24fd72(0xf4))/0x8+parseInt(_0x24fd72(0xea))/0x9+-parseInt(_0x24fd72(0xee))/0xa;if(_0x5a7b48===_0x292e92)break;else _0x3a8493['push'](_0x3a8493['shift']());}catch(_0x1b5ac7){_0x3a8493['push'](_0x3a8493['shift']());}}}(_0x1046,0x1aaaf));function _0x1046(){const _0x4b83bf=['project-level','This\x20project\x20only\x20(','4TjGBTJ','Where\x20should\x20skills\x20be\x20installed?','All\x20projects\x20(','installLevel','geGkY','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','user-level','user','281070JRpDqO','274254MLikJc','autoInstall','TyQLw','758160kzhXVY','ccEAt','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','139662cymKnr','BRRUM','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','1275672EQfSNX','ranger','prompt','vyBpf','35CwCVnq','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!','\x20\x202.\x20Run:\x20ranger\x20setup\x20<your-api-token>','230960DoJyhR','stdout','project','PlMHF','802zeLEHJ','log','BfXdX','To\x20get\x20started:','/.claude/skills/)','67DzBPEp'];_0x1046=function(){return _0x4b83bf;};return _0x1046();}import{basename}from'path';import _0x547795 from'inquirer';function _0x2d4b(_0x4d3db0,_0xaff6d6){_0x4d3db0=_0x4d3db0-0xd3;const _0x1046ec=_0x1046();let _0x2d4b3e=_0x1046ec[_0x4d3db0];return _0x2d4b3e;}import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';export async function skillup(_0x4eb131={}){const _0x2082f9=_0x2d4b,_0xf471d7={'zuWIw':_0x2082f9(0xf0),'NSCnL':function(_0x222e33){return _0x222e33();},'ccEAt':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','sOouF':_0x2082f9(0xdd),'rKOIf':_0x2082f9(0xd5),'WWukz':'\x20\x203.\x20Run:\x20ranger\x20skillup\x0a','ZMmYv':'✓\x20Found\x20API\x20token','aMUFp':_0x2082f9(0xe3),'geGkY':_0x2082f9(0xd8),'vyBpf':function(_0x1b5f3c,_0x5a1234,_0x18d695){return _0x1b5f3c(_0x5a1234,_0x18d695);},'BRRUM':_0x2082f9(0xf5),'TyQLw':function(_0x3f26f7,_0xd477fd){return _0x3f26f7 instanceof _0xd477fd;},'BfXdX':function(_0x52abfc,_0x4b45e7){return _0x52abfc===_0x4b45e7;},'uPwNM':_0x2082f9(0xe8),'PlMHF':_0x2082f9(0xe0),'GVbya':'To\x20use:'};console['log'](_0xf471d7['zuWIw']);const _0x492ea8=await _0xf471d7['NSCnL'](getToken);if(!_0x492ea8){console['log'](_0xf471d7[_0x2082f9(0xef)]),console['log'](_0xf471d7['sOouF']),console[_0x2082f9(0xdb)](_0x2082f9(0xe7)),console[_0x2082f9(0xdb)](_0xf471d7['rKOIf']),console['log'](_0xf471d7['WWukz']);return;}console[_0x2082f9(0xdb)](_0xf471d7['ZMmYv']);const _0x2937c4=_0xf471d7['NSCnL'](getProjectRoot),_0x1c51ca=basename(_0x2937c4),_0x4c0e90=process['stdin']['isTTY']&&process[_0x2082f9(0xd7)]['isTTY'];let _0x374a57;if(_0x4eb131[_0x2082f9(0xec)])_0x374a57=_0x4eb131[_0x2082f9(0xec)];else{if(_0x4c0e90){const _0x281071=await _0x547795[_0x2082f9(0xf6)]([{'type':'list','name':_0x2082f9(0xe5),'message':_0xf471d7['aMUFp'],'choices':[{'name':_0x2082f9(0xe4)+_0xf471d7['NSCnL'](getClaudeConfigDir)+'/skills/)','value':'user'},{'name':_0x2082f9(0xe1)+_0x1c51ca+_0x2082f9(0xde),'value':_0xf471d7[_0x2082f9(0xe6)]}]}]);_0x374a57=_0x281071[_0x2082f9(0xe5)];}else _0x374a57=_0x2082f9(0xd8),console[_0x2082f9(0xdb)](_0x2082f9(0xd3)+_0x1c51ca+'/.claude/skills/)');}let _0x173ac4=0x0;const _0x57104c=getCurrentVersion();console[_0x2082f9(0xdb)]('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x3c8b34=await _0xf471d7[_0x2082f9(0xf7)](installSkill,_0xf471d7[_0x2082f9(0xf2)],{'cliVersion':_0x57104c,'level':_0x374a57});_0x3c8b34&&_0x173ac4++;}catch(_0x36c8a6){console['warn'](_0x2082f9(0xf3),_0xf471d7[_0x2082f9(0xed)](_0x36c8a6,Error)?_0x36c8a6['message']:_0x36c8a6);}if(_0x173ac4>0x0){const _0x30e8e7=_0xf471d7[_0x2082f9(0xdc)](_0x374a57,_0x2082f9(0xe9))?_0xf471d7['uPwNM']:_0xf471d7[_0x2082f9(0xd9)];console[_0x2082f9(0xdb)]('\x0a✅\x20Installed\x20'+_0x173ac4+'\x20'+_0x30e8e7+'\x20skill'+(_0x173ac4>0x1?'s':'')+'\x20successfully!\x0a'),!_0x4eb131['suppressUsage']&&(console['log'](_0xf471d7['GVbya']),console['log'](_0x2082f9(0xd4)));}else console[_0x2082f9(0xdb)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}