gipity 1.0.416 → 1.0.417

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.
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import { Command } from 'commander';
12
12
  import { existsSync, rmSync, unlinkSync, readFileSync, writeFileSync } from 'fs';
13
- import { homedir } from 'os';
13
+ import { homedir, platform as osPlatform } from 'os';
14
14
  import { join, resolve } from 'path';
15
15
  import { spawnSyncCommand } from '../platform.js';
16
16
  import { post } from '../api.js';
@@ -52,6 +52,45 @@ function removeGipityPluginConfig() {
52
52
  writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
53
53
  return changed;
54
54
  }
55
+ /** The install.sh / install.ps1 launcher appends a line to the user's shell rc
56
+ * files putting ~/.gipity/launcher/bin on PATH. Once ~/.gipity is deleted that
57
+ * line points at nothing, so strip it back out - matched by the installer's own
58
+ * marker comment and the launcher bin path. Unix shells only; on Windows the
59
+ * installer edits the user PATH env var, which we leave untouched. Returns the
60
+ * rc files we actually changed. */
61
+ function removeInstallerPathLines() {
62
+ if (osPlatform() === 'win32')
63
+ return [];
64
+ const marker = '# Added by the Gipity installer';
65
+ const touched = [];
66
+ for (const name of ['.bashrc', '.zshrc', '.profile']) {
67
+ const rc = join(homedir(), name);
68
+ if (!existsSync(rc))
69
+ continue;
70
+ let text;
71
+ try {
72
+ text = readFileSync(rc, 'utf-8');
73
+ }
74
+ catch {
75
+ continue;
76
+ }
77
+ const lines = text.split('\n');
78
+ const kept = lines.filter((line) => line.trim() !== marker && !line.includes('.gipity/launcher/bin'));
79
+ if (kept.length === lines.length)
80
+ continue;
81
+ try {
82
+ writeFileSync(rc, kept.join('\n'));
83
+ touched.push(rc);
84
+ }
85
+ catch { /* ignore */ }
86
+ }
87
+ return touched;
88
+ }
89
+ /** Render an absolute path under $HOME back to ~ for display. */
90
+ function tildify(p) {
91
+ const home = homedir();
92
+ return p === home || p.startsWith(home + '/') ? '~' + p.slice(home.length) : p;
93
+ }
55
94
  function resolveCliPath() {
56
95
  return resolve(process.argv[1] ?? 'gipity');
57
96
  }
@@ -129,14 +168,28 @@ export const uninstallCommand = new Command('uninstall')
129
168
  .action(async (opts) => {
130
169
  const autoYes = opts.yes || getAutoConfirm();
131
170
  const gipityDir = join(homedir(), '.gipity');
171
+ // Installs from install.sh / install.ps1 keep the launcher binary itself
172
+ // under ~/.gipity/launcher/bin, so wiping ~/.gipity removes the binary too -
173
+ // the only leftover is the PATH line the installer added to the shell rc
174
+ // files (cleaned up below). An npm-global install instead leaves the binary
175
+ // in npm's bin dir, which the user removes with `npm uninstall -g gipity`.
176
+ const launcherBin = join(gipityDir, 'launcher', 'bin', 'gipity');
177
+ const installedViaLauncher = existsSync(launcherBin);
132
178
  console.log(`${bold('Gipity uninstall')} - this will:`);
133
179
  console.log(`• Stop the running relay daemon (if any)`);
134
180
  console.log(`• Remove the OS autostart service (launchd / systemd / Task Scheduler)`);
135
181
  console.log(`• Revoke this device on the server (best-effort)`);
136
182
  console.log(`• Remove the Gipity Claude Code plugin enablement (all Gipity hooks)`);
137
- console.log(`• Delete ${gipityDir}/`);
183
+ console.log(`• Delete ${gipityDir}/${installedViaLauncher ? dim(' (includes the gipity launcher binary itself)') : ''}`);
184
+ if (installedViaLauncher)
185
+ console.log(`• Remove the launcher PATH line from your shell startup files`);
138
186
  console.log('');
139
- console.log(`${dim('It will NOT remove the `gipity` binary. Run `npm uninstall -g gipity` afterward if you want that too.')}`);
187
+ if (installedViaLauncher) {
188
+ console.log(`${dim('The `gipity` launcher lives under ~/.gipity, so this removes the binary too - no separate `npm uninstall` needed.')}`);
189
+ }
190
+ else {
191
+ console.log(`${dim('It will NOT remove the `gipity` binary. Run `npm uninstall -g gipity` afterward if you want that too.')}`);
192
+ }
140
193
  console.log('');
141
194
  if (!autoYes) {
142
195
  const ok = await confirm('Proceed?');
@@ -179,8 +232,23 @@ export const uninstallCommand = new Command('uninstall')
179
232
  else {
180
233
  console.log(`${muted(`${gipityDir}/ already gone.`)}`);
181
234
  }
235
+ // 6. Strip the launcher PATH line the installer added to shell rc files, so
236
+ // we don't leave a dangling entry pointing at the dir we just deleted.
237
+ const touchedRc = removeInstallerPathLines();
238
+ if (touchedRc.length) {
239
+ console.log(`${success('Removed the launcher PATH line from')} ${dim(touchedRc.map(tildify).join(', '))}`);
240
+ }
182
241
  console.log('');
183
- console.log(`${success('Uninstall complete.')} ${dim('Run')} ${brand('npm uninstall -g gipity')} ${dim('to remove the binary too.')}`);
184
- console.log(`${dim('Then run')} ${brand('hash -r')} ${dim('(or open a new shell) - your shell caches the old binary path, and a reinstall may place it elsewhere.')}`);
242
+ console.log(`${success('Uninstall complete.')}`);
243
+ if (installedViaLauncher) {
244
+ console.log(`${dim('The launcher binary was under ~/.gipity and is now gone - nothing left to remove.')}`);
245
+ }
246
+ else {
247
+ console.log(`${dim('Run')} ${brand('npm uninstall -g gipity')} ${dim('to remove the `gipity` binary too.')}`);
248
+ }
249
+ // The current shell caches the removed binary's path in its command hash, so
250
+ // the next `gipity` here reports "No such file or directory" until it's
251
+ // cleared. A new terminal always fixes it; `hash -r` fixes this one.
252
+ console.log(`${dim('Open a new terminal - or run')} ${brand('hash -r')} ${dim('in this one - so your shell forgets the removed binary’s path.')}`);
185
253
  });
186
254
  //# sourceMappingURL=uninstall.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gipity",
3
- "version": "1.0.416",
3
+ "version": "1.0.417",
4
4
  "description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
5
5
  "bin": {
6
6
  "gipity": "dist/updater/shim.js",