@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.
- package/LICENSE +75 -9
- package/dist/index.cjs +92668 -215103
- package/dist/postinstall.cjs +907 -2529
- package/dist/preuninstall.cjs +224 -350
- package/package.json +2 -2
package/dist/preuninstall.cjs
CHANGED
|
@@ -1,363 +1,237 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
-
|
|
361
|
-
} catch (
|
|
362
|
-
|
|
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.
|
|
3
|
+
"version": "0.0.253",
|
|
4
4
|
"description": "GAL CLI - Command-line tool for managing AI agent configurations across your organization",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Elastic-2.0",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.cjs",
|