@scheduler-systems/gal-run 0.0.248 → 0.0.253

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.
@@ -1,363 +1,237 @@
1
1
  #!/usr/bin/env node
2
- const _0x342cfb = _0x3abe;
3
- (function (_0x28c328, _0x4d6d75) {
4
- const _0x4e5d32 = {
5
- _0x4899a9: 0x18b,
6
- _0xbfacff: 0x177,
7
- _0x276e67: 0x1a8,
8
- _0x3e4081: 0x192,
9
- _0x5d251f: 0x156,
10
- _0x5add83: 0x193,
11
- _0x1a0daf: 0x1a3,
12
- _0x440599: 0x17d,
13
- _0x508047: 0x14a,
14
- _0x530f0f: 0x1a4,
15
- _0x188ef4: 0x17b,
16
- _0x576a33: 0x15e
17
- }, _0x5b2aab = _0x3abe, _0x3ec6f6 = _0x28c328();
18
- while (!![]) {
19
- try {
20
- const _0x1dc5d7 = -parseInt(_0x5b2aab(_0x4e5d32._0x4899a9)) / 0x1 * (parseInt(_0x5b2aab(_0x4e5d32._0xbfacff)) / 0x2) + parseInt(_0x5b2aab(_0x4e5d32._0x276e67)) / 0x3 + parseInt(_0x5b2aab(_0x4e5d32._0x3e4081)) / 0x4 * (-parseInt(_0x5b2aab(_0x4e5d32._0x5d251f)) / 0x5) + parseInt(_0x5b2aab(_0x4e5d32._0x5add83)) / 0x6 * (-parseInt(_0x5b2aab(_0x4e5d32._0x1a0daf)) / 0x7) + -parseInt(_0x5b2aab(_0x4e5d32._0x440599)) / 0x8 * (-parseInt(_0x5b2aab(_0x4e5d32._0x508047)) / 0x9) + -parseInt(_0x5b2aab(_0x4e5d32._0x530f0f)) / 0xa + parseInt(_0x5b2aab(_0x4e5d32._0x188ef4)) / 0xb * (-parseInt(_0x5b2aab(_0x4e5d32._0x576a33)) / 0xc);
21
- if (_0x1dc5d7 === _0x4d6d75)
22
- break;
23
- else
24
- _0x3ec6f6['push'](_0x3ec6f6['shift']());
25
- } catch (_0x46adad) {
26
- _0x3ec6f6['push'](_0x3ec6f6['shift']());
27
- }
2
+ /**
3
+ * GAL CLI Preuninstall Script
4
+ *
5
+ * Automatically cleans up GAL-installed files when the CLI is uninstalled via pnpm.
6
+ * This script runs as a package lifecycle hook before package removal.
7
+ *
8
+ * What it cleans:
9
+ * 1. Hook files → ~/.claude/hooks/gal-*.js
10
+ * 2. Status line script → ~/.claude/status_lines/gal-sync-status.py
11
+ * 3. Rules file → ~/.claude/rules/gal-cli.md
12
+ * 4. Hook entries in ~/.claude/settings.json (preserves file and other hooks)
13
+ * 5. GAL config directory → ~/.gal/ (auth tokens, sync state, telemetry queue)
14
+ *
15
+ * Cleanup scope:
16
+ * - User-level files only (not project-level .gal directories)
17
+ * - GAL-specific entries only (preserves user's other Claude configs)
18
+ * - Silent fail strategy (won't prevent uninstall on errors)
19
+ *
20
+ * When it runs:
21
+ * - Automatically during `pnpm rm -g @scheduler-systems/gal-run`
22
+ * - Before package files are removed from node_modules
23
+ * - Can be manually triggered via `pnpm run preuninstall` in the CLI package directory
24
+ *
25
+ * Prerequisites:
26
+ * - Node.js 18+ (CommonJS module)
27
+ * - Runs with user's file system permissions
28
+ *
29
+ * Related files:
30
+ * - apps/cli/scripts/postinstall.cjs - Installation script
31
+ * - apps/cli/package.json - package lifecycle hooks configuration
32
+ */
33
+
34
+ const fs = require('fs');
35
+ const path = require('path');
36
+ const os = require('os');
37
+
38
+ // =============================================================================
39
+ // Cleanup Functions - settings.json
40
+ // =============================================================================
41
+
42
+ /**
43
+ * Remove GAL hook entries from settings.json without deleting the file.
44
+ *
45
+ * This function surgically removes only GAL-specific hook entries while
46
+ * preserving the user's other hooks and settings. It handles:
47
+ * - Filtering GAL hooks from UserPromptSubmit array
48
+ * - Filtering GAL hooks from SessionStart array (v2.x)
49
+ * - Removing empty hook arrays after filtering
50
+ * - Preserving the settings.json file structure
51
+ *
52
+ * @param {string} settingsPath - Full path to ~/.claude/settings.json
53
+ * @returns {boolean} True if any GAL entries were removed, false otherwise
54
+ */
55
+ function removeGalHookEntries(settingsPath) {
56
+ try {
57
+ if (!fs.existsSync(settingsPath)) {
58
+ return false;
28
59
  }
29
- }(_0xeec6, 0x59dfb));
30
- const fs = require('fs'), path = require(_0x342cfb(0x170)), os = require('os');
31
- function _0x3abe(_0x77d2a0, _0x424039) {
32
- _0x77d2a0 = _0x77d2a0 - 0x149;
33
- const _0xeec635 = _0xeec6();
34
- let _0x3abe29 = _0xeec635[_0x77d2a0];
35
- if (_0x3abe['zudSGE'] === undefined) {
36
- var _0x30822b = function (_0x543ae0) {
37
- const _0x2c6489 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';
38
- let _0x1bdeaf = '', _0x18e34e = '';
39
- for (let _0x7198ae = 0x0, _0x4b2885, _0x1dc999, _0x5d1a8e = 0x0; _0x1dc999 = _0x543ae0['charAt'](_0x5d1a8e++); ~_0x1dc999 && (_0x4b2885 = _0x7198ae % 0x4 ? _0x4b2885 * 0x40 + _0x1dc999 : _0x1dc999, _0x7198ae++ % 0x4) ? _0x1bdeaf += String['fromCharCode'](0xff & _0x4b2885 >> (-0x2 * _0x7198ae & 0x6)) : 0x0) {
40
- _0x1dc999 = _0x2c6489['indexOf'](_0x1dc999);
41
- }
42
- for (let _0x7e48e = 0x0, _0x3cb4f8 = _0x1bdeaf['length']; _0x7e48e < _0x3cb4f8; _0x7e48e++) {
43
- _0x18e34e += '%' + ('00' + _0x1bdeaf['charCodeAt'](_0x7e48e)['toString'](0x10))['slice'](-0x2);
44
- }
45
- return decodeURIComponent(_0x18e34e);
46
- };
47
- _0x3abe['QukwVf'] = _0x30822b, _0x3abe['yHOuIq'] = {}, _0x3abe['zudSGE'] = !![];
60
+
61
+ const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
62
+
63
+ if (!settings.hooks?.UserPromptSubmit) {
64
+ return false;
48
65
  }
49
- const _0x31354c = _0xeec635[0x0], _0x408a2b = _0x77d2a0 + _0x31354c, _0x166117 = _0x3abe['yHOuIq'][_0x408a2b];
50
- return !_0x166117 ? (_0x3abe29 = _0x3abe['QukwVf'](_0x3abe29), _0x3abe['yHOuIq'][_0x408a2b] = _0x3abe29) : _0x3abe29 = _0x166117, _0x3abe29;
51
- }
52
- function removeGalHookEntries(_0x1bdeaf) {
53
- const _0x1bd0c4 = {
54
- _0x3555d5: 0x164,
55
- _0x2b26f6: 0x162,
56
- _0x4463bf: 0x14e,
57
- _0x5e36ff: 0x194,
58
- _0x4c99d6: 0x159,
59
- _0x30c859: 0x14f,
60
- _0x113d68: 0x18d,
61
- _0x4b0d3b: 0x195,
62
- _0x5a7186: 0x178,
63
- _0xcee749: 0x1a1,
64
- _0x33931b: 0x18d,
65
- _0x539e2e: 0x1a1,
66
- _0x4e26de: 0x19b,
67
- _0x429740: 0x195,
68
- _0x56f7b1: 0x1a1,
69
- _0x3a4295: 0x18d,
70
- _0x3d42c7: 0x195,
71
- _0xae0e6b: 0x178,
72
- _0x1b8aea: 0x1a1,
73
- _0x76440: 0x189,
74
- _0x5c9fb1: 0x1a1,
75
- _0x4d565a: 0x19b,
76
- _0x231d3c: 0x195,
77
- _0x14b11b: 0x174,
78
- _0x40d83d: 0x18d,
79
- _0x47083a: 0x18d,
80
- _0x1dd423: 0x19d,
81
- _0x14beec: 0x168,
82
- _0x4129ec: 0x152,
83
- _0x5d602f: 0x172,
84
- _0x16bc14: 0x17a
85
- }, _0x15d95a = {
86
- _0xc5fa85: 0x18d,
87
- _0x579650: 0x189,
88
- _0x5a75ce: 0x19b
89
- }, _0x124d9c = _0x3abe;
90
- try {
91
- if (!fs[_0x124d9c(_0x1bd0c4._0x3555d5) + _0x124d9c(_0x1bd0c4._0x2b26f6)](_0x1bdeaf))
92
- return ![];
93
- const _0x18e34e = JSON[_0x124d9c(_0x1bd0c4._0x4463bf)](fs[_0x124d9c(_0x1bd0c4._0x5e36ff) + _0x124d9c(_0x1bd0c4._0x4c99d6) + 'nc'](_0x1bdeaf, _0x124d9c(_0x1bd0c4._0x30c859)));
94
- if (!_0x18e34e[_0x124d9c(_0x1bd0c4._0x113d68)]?.[_0x124d9c(_0x1bd0c4._0x4b0d3b) + _0x124d9c(_0x1bd0c4._0x5a7186) + _0x124d9c(_0x1bd0c4._0xcee749) + 't'])
95
- return ![];
96
- const _0x7198ae = _0x18e34e[_0x124d9c(_0x1bd0c4._0x33931b)][_0x124d9c(_0x1bd0c4._0x4b0d3b) + _0x124d9c(_0x1bd0c4._0x5a7186) + _0x124d9c(_0x1bd0c4._0x539e2e) + 't'][_0x124d9c(_0x1bd0c4._0x4e26de) + 'h'];
97
- _0x18e34e[_0x124d9c(_0x1bd0c4._0x33931b)][_0x124d9c(_0x1bd0c4._0x429740) + _0x124d9c(_0x1bd0c4._0x5a7186) + _0x124d9c(_0x1bd0c4._0x56f7b1) + 't'] = _0x18e34e[_0x124d9c(_0x1bd0c4._0x3a4295)][_0x124d9c(_0x1bd0c4._0x3d42c7) + _0x124d9c(_0x1bd0c4._0xae0e6b) + _0x124d9c(_0x1bd0c4._0x1b8aea) + 't'][_0x124d9c(_0x1bd0c4._0x76440) + 'r'](_0x4b2885 => {
98
- const _0x5a3cfd = _0x3abe;
99
- if (!_0x4b2885[_0x5a3cfd(_0x15d95a._0xc5fa85)])
100
- return !![];
101
- return _0x4b2885[_0x5a3cfd(_0x15d95a._0xc5fa85)] = _0x4b2885[_0x5a3cfd(_0x15d95a._0xc5fa85)][_0x5a3cfd(_0x15d95a._0x579650) + 'r'](_0x1dc999 => !_0x1dc999[_0x5a3cfd(0x157) + 'nd']?.[_0x5a3cfd(0x190) + _0x5a3cfd(0x171)](_0x5a3cfd(0x155)) && !_0x1dc999[_0x5a3cfd(0x157) + 'nd']?.[_0x5a3cfd(0x190) + _0x5a3cfd(0x171)](_0x5a3cfd(0x196))), _0x4b2885[_0x5a3cfd(_0x15d95a._0xc5fa85)][_0x5a3cfd(_0x15d95a._0x5a75ce) + 'h'] > 0x0;
102
- });
103
- _0x18e34e[_0x124d9c(_0x1bd0c4._0x33931b)][_0x124d9c(_0x1bd0c4._0x429740) + _0x124d9c(_0x1bd0c4._0x5a7186) + _0x124d9c(_0x1bd0c4._0x5c9fb1) + 't'][_0x124d9c(_0x1bd0c4._0x4d565a) + 'h'] === 0x0 && delete _0x18e34e[_0x124d9c(_0x1bd0c4._0x3a4295)][_0x124d9c(_0x1bd0c4._0x231d3c) + _0x124d9c(_0x1bd0c4._0x5a7186) + _0x124d9c(_0x1bd0c4._0xcee749) + 't'];
104
- Object[_0x124d9c(_0x1bd0c4._0x14b11b)](_0x18e34e[_0x124d9c(_0x1bd0c4._0x40d83d)])[_0x124d9c(_0x1bd0c4._0x4d565a) + 'h'] === 0x0 && delete _0x18e34e[_0x124d9c(_0x1bd0c4._0x40d83d)];
105
- if (_0x18e34e[_0x124d9c(_0x1bd0c4._0x47083a)]?.[_0x124d9c(_0x1bd0c4._0x231d3c) + _0x124d9c(_0x1bd0c4._0xae0e6b) + _0x124d9c(_0x1bd0c4._0x56f7b1) + 't']?.[_0x124d9c(_0x1bd0c4._0x4d565a) + 'h'] !== _0x7198ae)
106
- return fs[_0x124d9c(_0x1bd0c4._0x1dd423) + _0x124d9c(_0x1bd0c4._0x14beec) + _0x124d9c(_0x1bd0c4._0x4129ec)](_0x1bdeaf, JSON[_0x124d9c(_0x1bd0c4._0x5d602f) + _0x124d9c(_0x1bd0c4._0x16bc14)](_0x18e34e, null, 0x2)), !![];
107
- return ![];
108
- } catch {
109
- return ![];
66
+
67
+ // Filter out GAL hooks while preserving user's other hooks
68
+ const originalLength = settings.hooks.UserPromptSubmit.length;
69
+ settings.hooks.UserPromptSubmit = settings.hooks.UserPromptSubmit.filter((entry) => {
70
+ if (!entry.hooks) return true;
71
+ // Keep entry only if it has non-GAL hooks
72
+ entry.hooks = entry.hooks.filter((hook) =>
73
+ !hook.command?.includes('gal-') && !hook.command?.includes('/gal/')
74
+ );
75
+ return entry.hooks.length > 0;
76
+ });
77
+
78
+ // Remove empty hooks array
79
+ if (settings.hooks.UserPromptSubmit.length === 0) {
80
+ delete settings.hooks.UserPromptSubmit;
81
+ }
82
+
83
+ // Remove empty hooks object
84
+ if (Object.keys(settings.hooks).length === 0) {
85
+ delete settings.hooks;
110
86
  }
87
+
88
+ if (settings.hooks?.UserPromptSubmit?.length !== originalLength) {
89
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
90
+ return true;
91
+ }
92
+
93
+ return false;
94
+ } catch {
95
+ // Silent fail - don't prevent uninstall if settings.json is corrupted
96
+ return false;
97
+ }
111
98
  }
99
+
100
+ // =============================================================================
101
+ // Cleanup Functions - User-Level Files
102
+ // =============================================================================
103
+
104
+ /**
105
+ * Clean up GAL-installed files from user's home directory.
106
+ *
107
+ * Removes:
108
+ * - Hook files: ~/.claude/hooks/gal-*.js
109
+ * - Status line script: ~/.claude/status_lines/gal-sync-status.py
110
+ * - Rules file: ~/.claude/rules/gal-cli.md
111
+ * - Hook entries from settings.json
112
+ *
113
+ * Uses silent fail strategy - logs removed files but doesn't throw errors.
114
+ * This ensures uninstall proceeds even if individual files are missing or
115
+ * have permission issues.
116
+ *
117
+ * @returns {string[]} Array of paths to files that were successfully removed
118
+ */
112
119
  function cleanupUserLevel() {
113
- const _0xa3be0a = {
114
- _0x40f302: 0x150,
115
- _0x194fa6: 0x16e,
116
- _0x2670de: 0x16d,
117
- _0x4aed46: 0x150,
118
- _0x1ce15d: 0x18d,
119
- _0x3e3fb7: 0x150,
120
- _0x5a7718: 0x17c,
121
- _0x10d71b: 0x175,
122
- _0x18b188: 0x186,
123
- _0x1bfab1: 0x164,
124
- _0x4db7e1: 0x162,
125
- _0x328624: 0x176,
126
- _0xf0dd7f: 0x166,
127
- _0x457fc0: 0x167,
128
- _0x7721a9: 0x14c,
129
- _0x308efb: 0x155,
130
- _0x30a128: 0x150,
131
- _0x11f46d: 0x14d,
132
- _0x4a8c0e: 0x1aa,
133
- _0x3630d7: 0x185,
134
- _0x30d569: 0x19a,
135
- _0x145525: 0x19c,
136
- _0xf6967d: 0x1ac,
137
- _0x59a0c2: 0x198
138
- }, _0x29244f = _0x3abe, _0x5d1a8e = path[_0x29244f(_0xa3be0a._0x40f302)](os[_0x29244f(_0xa3be0a._0x194fa6) + 'ir'](), _0x29244f(_0xa3be0a._0x2670de) + 'de'), _0x7e48e = path[_0x29244f(_0xa3be0a._0x4aed46)](_0x5d1a8e, _0x29244f(_0xa3be0a._0x1ce15d)), _0x3cb4f8 = path[_0x29244f(_0xa3be0a._0x3e3fb7)](_0x5d1a8e, _0x29244f(_0xa3be0a._0x5a7718) + _0x29244f(_0xa3be0a._0x10d71b) + _0x29244f(_0xa3be0a._0x18b188));
139
- let _0x1b2b07 = [];
140
- if (fs[_0x29244f(_0xa3be0a._0x1bfab1) + _0x29244f(_0xa3be0a._0x4db7e1)](_0x7e48e))
141
- try {
142
- const _0x29a697 = fs[_0x29244f(_0xa3be0a._0x328624) + _0x29244f(_0xa3be0a._0xf0dd7f) + 'c'](_0x7e48e);
143
- for (const _0x2164a2 of _0x29a697) {
144
- if (_0x2164a2[_0x29244f(_0xa3be0a._0x457fc0) + _0x29244f(_0xa3be0a._0x7721a9)](_0x29244f(_0xa3be0a._0x308efb))) {
145
- const _0x56bf57 = path[_0x29244f(_0xa3be0a._0x30a128)](_0x7e48e, _0x2164a2);
146
- try {
147
- fs[_0x29244f(_0xa3be0a._0x11f46d) + _0x29244f(_0xa3be0a._0x4a8c0e)](_0x56bf57), _0x1b2b07[_0x29244f(_0xa3be0a._0x3630d7)](_0x56bf57);
148
- } catch (_0x3ac093) {
149
- }
150
- }
151
- }
152
- } catch (_0x36f926) {
120
+ const claudeDir = path.join(os.homedir(), '.claude');
121
+ const hooksDir = path.join(claudeDir, 'hooks');
122
+ const settingsPath = path.join(claudeDir, 'settings.json');
123
+
124
+ let removed = [];
125
+
126
+ // Remove GAL hook files
127
+ if (fs.existsSync(hooksDir)) {
128
+ try {
129
+ const files = fs.readdirSync(hooksDir);
130
+ for (const file of files) {
131
+ if (file.startsWith('gal-')) {
132
+ const hookPath = path.join(hooksDir, file);
133
+ try {
134
+ fs.unlinkSync(hookPath);
135
+ removed.push(hookPath);
136
+ } catch (err) {
137
+ // Silent fail
138
+ }
153
139
  }
154
- return removeGalHookEntries(_0x3cb4f8) && _0x1b2b07[_0x29244f(_0xa3be0a._0x3630d7)](_0x3cb4f8 + (_0x29244f(_0xa3be0a._0x30d569) + _0x29244f(_0xa3be0a._0x145525) + _0x29244f(_0xa3be0a._0xf6967d) + _0x29244f(_0xa3be0a._0x59a0c2))), _0x1b2b07;
140
+ }
141
+ } catch (err) {
142
+ // Silent fail
143
+ }
144
+ }
145
+
146
+ // Remove GAL hook entries from settings.json
147
+ if (removeGalHookEntries(settingsPath)) {
148
+ removed.push(`${settingsPath} (GAL hooks removed)`);
149
+ }
150
+
151
+ return removed;
155
152
  }
153
+
154
+ // =============================================================================
155
+ // Cleanup Functions - GAL Config Directory
156
+ // =============================================================================
157
+
158
+ /**
159
+ * Clean up GAL config directory from user's home directory.
160
+ *
161
+ * Removes entire ~/.gal directory, including:
162
+ * - config.json (auth token, default org)
163
+ * - telemetry-pending-events.json (queued telemetry events)
164
+ * - Any other GAL-specific cache or state files
165
+ *
166
+ * Note: Does NOT remove project-level .gal directories (those belong to repos)
167
+ *
168
+ * Uses silent fail strategy to ensure uninstall proceeds even if directory
169
+ * is missing or has permission issues.
170
+ *
171
+ * @returns {string[]} Array containing the removed directory path, or empty array
172
+ */
156
173
  function cleanupGalConfig() {
157
- const _0x437437 = {
158
- _0x4703e7: 0x150,
159
- _0x32f730: 0x16e,
160
- _0x2f0621: 0x173,
161
- _0x4e942f: 0x164,
162
- _0x1966f0: 0x162,
163
- _0x4bf372: 0x19e
164
- }, _0x260367 = _0x3abe, _0x4769c6 = path[_0x260367(_0x437437._0x4703e7)](os[_0x260367(_0x437437._0x32f730) + 'ir'](), _0x260367(_0x437437._0x2f0621));
165
- if (fs[_0x260367(_0x437437._0x4e942f) + _0x260367(_0x437437._0x1966f0)](_0x4769c6))
166
- try {
167
- return fs[_0x260367(_0x437437._0x4bf372) + 'c'](_0x4769c6, {
168
- 'recursive': !![],
169
- 'force': !![]
170
- }), [_0x4769c6];
171
- } catch (_0x3896c9) {
172
- return [];
173
- }
174
- return [];
175
- }
176
- function _0xeec6() {
177
- const _0x57049a = [
178
- 'Ag9Tzwq',
179
- '4PYtienSzq',
180
- 'Cgf0Aa',
181
- 'zgvZ',
182
- 'C3rYAw4',
183
- 'lMDHBa',
184
- 'A2v5CW',
185
- 'BMDZlMO',
186
- 'CMvHzgq',
187
- 'mZm0otzVquvgAxy',
188
- 'CM9TChq',
189
- 'iebZy2G',
190
- 'z2LMEq',
191
- 'mJjJDMXAAwm',
192
- 'C2v0DgK',
193
- 'mteYteXptgfd',
194
- 'BgWGChi',
195
- '4Pwq4Pwq4Pwq4Pwq4Pwq',
196
- 'q2XLyw4',
197
- 'vg8GCMu',
198
- 'cUkvKokvKokvKokvKa',
199
- 'icbhquW',
200
- 'B3iSigi',
201
- 'ChvZAa',
202
- 'C29U',
203
- 'BgW6iha',
204
- 'BgvHBNu',
205
- 'zMLSDgu',
206
- 'BgWGD2K',
207
- 'nwvMqKHLyq',
208
- 'B2nLzwq',
209
- 'Ag9VA3m',
210
- 'BIbLCNi',
211
- 'yw4GDxa',
212
- 'Aw5JBhu',
213
- 'vw5PBNm',
214
- 'ngTzzgzWwa',
215
- 'mJmXnZHqzLv3q3G',
216
- 'CMvHzey',
217
- 'vxnLCLa',
218
- 'l2DHBc8',
219
- 'tcbMAwW',
220
- 'B3zLzcK',
221
- 'AgfZigi',
222
- 'icHhquW',
223
- 'BgvUz3q',
224
- 'igHVB2S',
225
- 'D3jPDgu',
226
- 'CM1tEw4',
227
- 'Dw5Kihq',
228
- 'CMvKige',
229
- 'u3vIBwK',
230
- 'BMLUC3q',
231
- 'ndq4AwnSz2D2',
232
- 'mJy2ntq1mgX3rxDfyG',
233
- 'B3vUDgu',
234
- 'BYbJBgu',
235
- 'CI1ZExm',
236
- 'mtK0mteZnw9ZvNjIqq',
237
- 'tM8Gr0e',
238
- 'A1n5BMm',
239
- 'Dw4k',
240
- 'CYbYzw0',
241
- 'yw5Lzca',
242
- 'Bg9N',
243
- 'mZK3odi3t3joEw52',
244
- 'DgfSBca',
245
- 'C1DPDgG',
246
- 'Dw5SAw4',
247
- 'CgfYC2u',
248
- 'DxrMltG',
249
- 'AM9PBG',
250
- 'DgvTCY8',
251
- 'Ew5J',
252
- 'ienmssa',
253
- 'z2fSlxi',
254
- 'z2fSlq',
255
- 'odK5ota1EuTlD0TZ',
256
- 'y29TBwe',
257
- 'zwr1Bgu',
258
- 'AwXLu3K',
259
- 'DxaGr0e',
260
- 'zxm6',
261
- 'zxjYB3i',
262
- 'ywXSzwq',
263
- 'nZiXntK2rfHIrfLR',
264
- 'DxqGDw4',
265
- 'Aw5ZDge',
266
- 'r0fmigm',
267
- 'C1n5BMm',
268
- 'zxmGzM8',
269
- 'zxHPC3q',
270
- 'CcbLBMm',
271
- 'AxjtEw4',
272
- 'C3rHCNq',
273
- 'rMLSzvm',
274
- 'zwvUihu',
275
- 'icaTia',
276
- 'zgqGlwC',
277
- 'BNbTige',
278
- 'lMnSyxu'
279
- ];
280
- _0xeec6 = function () {
281
- return _0x57049a;
282
- };
283
- return _0xeec6();
174
+ const galConfigDir = path.join(os.homedir(), '.gal');
175
+
176
+ if (fs.existsSync(galConfigDir)) {
177
+ try {
178
+ fs.rmSync(galConfigDir, { recursive: true, force: true });
179
+ return [galConfigDir];
180
+ } catch (err) {
181
+ // Silent fail
182
+ return [];
183
+ }
184
+ }
185
+
186
+ return [];
284
187
  }
188
+
189
+ // =============================================================================
190
+ // Main Cleanup Orchestration
191
+ // =============================================================================
192
+
193
+ /**
194
+ * Main cleanup orchestration function.
195
+ *
196
+ * Coordinates all cleanup operations and provides user feedback.
197
+ * Runs both user-level and config directory cleanups, then reports results.
198
+ *
199
+ * @returns {void}
200
+ */
285
201
  function cleanup() {
286
- const _0x1b60f8 = {
287
- _0x7dbf4a: 0x149,
288
- _0x5908f0: 0x182,
289
- _0x521115: 0x17f,
290
- _0x58a304: 0x17f,
291
- _0x35e8ce: 0x17f,
292
- _0x15c87b: 0x17f,
293
- _0x4e6f51: 0x17f,
294
- _0x32aae0: 0x17f,
295
- _0x31d40f: 0x183,
296
- _0x409b5e: 0x153,
297
- _0x495da2: 0x191,
298
- _0x2db4e4: 0x14b,
299
- _0x1b308d: 0x180,
300
- _0x4cc78e: 0x149,
301
- _0xfc3265: 0x17f,
302
- _0x86a881: 0x17f,
303
- _0x4843f2: 0x17f,
304
- _0x508ca1: 0x19b,
305
- _0x1a6e4a: 0x16f,
306
- _0x2c95a7: 0x1ad,
307
- _0x370682: 0x15a,
308
- _0x1000b3: 0x197,
309
- _0x258a43: 0x15b,
310
- _0x2c35ed: 0x16a,
311
- _0x123360: 0x149,
312
- _0x4b1904: 0x1a9,
313
- _0x4e1eb9: 0x163,
314
- _0x11b64d: 0x19f,
315
- _0x16334f: 0x1a6,
316
- _0x545084: 0x18f,
317
- _0x449ca2: 0x182,
318
- _0x2825ff: 0x17f,
319
- _0x35d020: 0x17f,
320
- _0x558e5f: 0x149,
321
- _0x5f27a6: 0x183,
322
- _0x5f33dc: 0x153,
323
- _0x18bc0f: 0x199,
324
- _0x2848bd: 0x169,
325
- _0x18ca7f: 0x1a2,
326
- _0x5e900e: 0x15d,
327
- _0x31b485: 0x17f,
328
- _0x269568: 0x17f,
329
- _0x487941: 0x17f,
330
- _0x5a6ad9: 0x17f,
331
- _0x40c8bc: 0x17f,
332
- _0xa1750b: 0x17f,
333
- _0x56306c: 0x181,
334
- _0x1e5118: 0x160,
335
- _0x4f310a: 0x187,
336
- _0x5c660d: 0x16c,
337
- _0x46fba6: 0x16b,
338
- _0x1ff76b: 0x179,
339
- _0x465ac5: 0x158,
340
- _0x359e6f: 0x1a7,
341
- _0x1e2993: 0x151,
342
- _0xb71ce3: 0x154,
343
- _0x435b65: 0x1ab
344
- }, _0x3160be = _0x3abe;
345
- console[_0x3160be(_0x1b60f8._0x7dbf4a)](_0x3160be(_0x1b60f8._0x5908f0) + _0x3160be(_0x1b60f8._0x521115) + _0x3160be(_0x1b60f8._0x521115) + _0x3160be(_0x1b60f8._0x521115) + _0x3160be(_0x1b60f8._0x58a304) + _0x3160be(_0x1b60f8._0x35e8ce) + _0x3160be(_0x1b60f8._0x15c87b) + _0x3160be(_0x1b60f8._0x4e6f51) + _0x3160be(_0x1b60f8._0x32aae0) + _0x3160be(_0x1b60f8._0x15c87b) + '══'), console[_0x3160be(_0x1b60f8._0x7dbf4a)](_0x3160be(_0x1b60f8._0x31d40f) + _0x3160be(_0x1b60f8._0x409b5e) + _0x3160be(_0x1b60f8._0x495da2) + _0x3160be(_0x1b60f8._0x2db4e4) + _0x3160be(_0x1b60f8._0x1b308d) + 'up'), console[_0x3160be(_0x1b60f8._0x4cc78e)](_0x3160be(_0x1b60f8._0x4e6f51) + _0x3160be(_0x1b60f8._0x521115) + _0x3160be(_0x1b60f8._0x35e8ce) + _0x3160be(_0x1b60f8._0x15c87b) + _0x3160be(_0x1b60f8._0x32aae0) + _0x3160be(_0x1b60f8._0xfc3265) + _0x3160be(_0x1b60f8._0x86a881) + _0x3160be(_0x1b60f8._0x521115) + _0x3160be(_0x1b60f8._0x521115) + _0x3160be(_0x1b60f8._0x4843f2) + '═\x0a');
346
- const _0x26521b = cleanupUserLevel(), _0x5ba83e = cleanupGalConfig(), _0x16f1c1 = [
347
- ..._0x26521b,
348
- ..._0x5ba83e
349
- ];
350
- if (_0x16f1c1[_0x3160be(_0x1b60f8._0x508ca1) + 'h'] > 0x0) {
351
- console[_0x3160be(_0x1b60f8._0x4cc78e)](_0x3160be(_0x1b60f8._0x1a6e4a) + _0x3160be(_0x1b60f8._0x2c95a7) + _0x3160be(_0x1b60f8._0x370682) + _0x3160be(_0x1b60f8._0x1000b3) + _0x3160be(_0x1b60f8._0x258a43));
352
- for (const _0x45bd40 of _0x16f1c1) {
353
- console[_0x3160be(_0x1b60f8._0x7dbf4a)](_0x3160be(_0x1b60f8._0x2c35ed) + _0x45bd40);
354
- }
355
- } else
356
- console[_0x3160be(_0x1b60f8._0x123360)](_0x3160be(_0x1b60f8._0x4b1904) + _0x3160be(_0x1b60f8._0x1000b3) + _0x3160be(_0x1b60f8._0x4e1eb9) + _0x3160be(_0x1b60f8._0x11b64d) + _0x3160be(_0x1b60f8._0x16334f) + _0x3160be(_0x1b60f8._0x545084) + '.');
357
- console[_0x3160be(_0x1b60f8._0x123360)](_0x3160be(_0x1b60f8._0x449ca2) + _0x3160be(_0x1b60f8._0x2825ff) + _0x3160be(_0x1b60f8._0x15c87b) + _0x3160be(_0x1b60f8._0x35d020) + _0x3160be(_0x1b60f8._0x86a881) + _0x3160be(_0x1b60f8._0x521115) + _0x3160be(_0x1b60f8._0x58a304) + _0x3160be(_0x1b60f8._0x35e8ce) + _0x3160be(_0x1b60f8._0xfc3265) + _0x3160be(_0x1b60f8._0x86a881) + '══'), console[_0x3160be(_0x1b60f8._0x558e5f)](_0x3160be(_0x1b60f8._0x5f27a6) + _0x3160be(_0x1b60f8._0x5f33dc) + _0x3160be(_0x1b60f8._0x18bc0f) + _0x3160be(_0x1b60f8._0x2848bd) + _0x3160be(_0x1b60f8._0x18ca7f) + _0x3160be(_0x1b60f8._0x5e900e)), console[_0x3160be(_0x1b60f8._0x123360)](_0x3160be(_0x1b60f8._0x31b485) + _0x3160be(_0x1b60f8._0x269568) + _0x3160be(_0x1b60f8._0x487941) + _0x3160be(_0x1b60f8._0x5a6ad9) + _0x3160be(_0x1b60f8._0x40c8bc) + _0x3160be(_0x1b60f8._0x58a304) + _0x3160be(_0x1b60f8._0x15c87b) + _0x3160be(_0x1b60f8._0x521115) + _0x3160be(_0x1b60f8._0xa1750b) + _0x3160be(_0x1b60f8._0x58a304) + '═\x0a'), console[_0x3160be(_0x1b60f8._0x123360)](_0x3160be(_0x1b60f8._0x56306c) + _0x3160be(_0x1b60f8._0x1e5118) + _0x3160be(_0x1b60f8._0x4f310a) + _0x3160be(_0x1b60f8._0x5c660d) + _0x3160be(_0x1b60f8._0x46fba6) + _0x3160be(_0x1b60f8._0x1ff76b) + _0x3160be(_0x1b60f8._0x465ac5) + _0x3160be(_0x1b60f8._0x359e6f) + _0x3160be(_0x1b60f8._0x1e2993) + _0x3160be(_0x1b60f8._0xb71ce3) + _0x3160be(_0x1b60f8._0x435b65));
202
+ console.log('\n═══════════════════════════════════════════════════');
203
+ console.log(' GAL CLI Uninstall Cleanup');
204
+ console.log('═══════════════════════════════════════════════════\n');
205
+
206
+ const userLevelFiles = cleanupUserLevel();
207
+ const galConfigFiles = cleanupGalConfig();
208
+ const allRemoved = [...userLevelFiles, ...galConfigFiles];
209
+
210
+ if (allRemoved.length > 0) {
211
+ console.log('✓ Cleaned up GAL files:');
212
+ for (const file of allRemoved) {
213
+ console.log(` - ${file}`);
214
+ }
215
+ } else {
216
+ console.log('No GAL files found to clean up.');
217
+ }
218
+
219
+ console.log('\n═══════════════════════════════════════════════════');
220
+ console.log(' GAL CLI has been uninstalled');
221
+ console.log('═══════════════════════════════════════════════════\n');
222
+ console.log('To reinstall: pnpm add -g @scheduler-systems/gal-run\n');
358
223
  }
224
+
225
+ // =============================================================================
226
+ // Entry Point
227
+ // =============================================================================
228
+
229
+ // Run cleanup with silent fail strategy
230
+ // Even if cleanup fails, we don't prevent npm uninstall from proceeding
359
231
  try {
360
- cleanup();
361
- } catch (_0x24959e) {
362
- console[_0x342cfb(0x15c)](_0x342cfb(0x161) + _0x342cfb(0x188) + _0x342cfb(0x165) + _0x342cfb(0x1a5) + _0x342cfb(0x1a0) + _0x342cfb(0x18e) + _0x342cfb(0x184) + _0x342cfb(0x15f) + _0x342cfb(0x160) + _0x342cfb(0x18a) + _0x342cfb(0x17e) + _0x342cfb(0x18c) + '.');
363
- }
232
+ cleanup();
233
+ } catch (error) {
234
+ // Log error but allow uninstall to continue
235
+ console.error('GAL cleanup encountered an error, but uninstall will proceed.');
236
+ // Note: We don't process.exit(1) here - uninstall should always succeed
237
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@scheduler-systems/gal-run",
3
- "version": "0.0.248",
3
+ "version": "0.0.253",
4
4
  "description": "GAL CLI - Command-line tool for managing AI agent configurations across your organization",
5
- "license": "SEE LICENSE IN LICENSE.md",
5
+ "license": "Elastic-2.0",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "./dist/index.cjs",