@pushary/agent-hooks 1.9.53 → 1.9.55

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,15 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CODEX_APP_CARDS_DIRECTORY,
4
+ LSREGISTER,
5
+ MAC_APP_BUNDLE_ID,
6
+ MAC_DEFAULTS_DOMAINS,
7
+ MAC_KEYCHAIN_ACCOUNTS,
4
8
  codexAppCardsFolderStaysOnThisMac,
5
- removeCodexAppCardsFromThisMac
6
- } from "../chunk-SUIB4O3S.js";
9
+ developerDefaults,
10
+ installedPusharyBundles,
11
+ liveMacStatePresence,
12
+ registeredPusharyBundles,
13
+ removeCodexAppCardsFromThisMac,
14
+ runningMacAppPIDs,
15
+ storedMacAppState,
16
+ storedPusharyKeychainServices,
17
+ waitForMacAppExit
18
+ } from "../chunk-ZWOWEXCV.js";
7
19
  import {
8
20
  PUSHARY_SKILL_NAME,
9
21
  PUSHARY_SKILL_SOURCE,
10
22
  createGuards
11
23
  } from "../chunk-EUW7JL2K.js";
12
- import "../chunk-ABGN5RN2.js";
24
+ import "../chunk-T5L5NWT3.js";
13
25
  import "../chunk-XCEN33UP.js";
14
26
  import {
15
27
  describeCliKeyRevocation,
@@ -109,7 +121,7 @@ import {
109
121
  removeClaudeAlias,
110
122
  shellProfileCandidates
111
123
  } from "../chunk-VYBH6D4X.js";
112
- import "../chunk-36NGFHE4.js";
124
+ import "../chunk-E46NE7FB.js";
113
125
  import "../chunk-U2L42GVI.js";
114
126
  import "../chunk-3RPN7AAT.js";
115
127
  import "../chunk-JBT3ZSJS.js";
@@ -186,194 +198,14 @@ import {
186
198
  } from "../chunk-LF3TLC7B.js";
187
199
 
188
200
  // bin/pushary-clean.ts
189
- import { existsSync as existsSync6, readFileSync as readFileSync4, copyFileSync, readdirSync as readdirSync5 } from "fs";
190
- import { dirname, join as join6 } from "path";
191
- import { homedir as homedir5, tmpdir } from "os";
201
+ import { existsSync as existsSync5, readFileSync as readFileSync4, copyFileSync, readdirSync as readdirSync4 } from "fs";
202
+ import { dirname, join as join5 } from "path";
203
+ import { homedir as homedir4, tmpdir } from "os";
192
204
  import { confirm } from "@inquirer/prompts";
193
205
  import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
194
206
 
195
- // src/cli/mac-leftovers.ts
196
- import { execSync, execFileSync } from "child_process";
197
- import { existsSync, readdirSync } from "fs";
198
- import { homedir } from "os";
199
- import { isAbsolute, join } from "path";
200
- var MAC_APP_BUNDLE = "/Applications/Pushary.app";
201
- var MAC_APP_BUNDLE_ID = "com.pushary.app";
202
- var installedPusharyBundles = (home = homedir()) => [MAC_APP_BUNDLE, join(home, "Applications", "Pushary.app")];
203
- var LSREGISTER = "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";
204
- var TEST_DEFAULTS_PREFIXES = [
205
- "com.pushary.mac.tests.",
206
- "com.pushary.tests.",
207
- "pushary.tests.",
208
- "pushary.quiet-mode-test.",
209
- "pushary.drafts.test.",
210
- "pushary-optin-",
211
- "pushary-completion-test-",
212
- "pushary-updates-only-"
213
- ];
214
- var UUID = "[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}";
215
- var UNPREFIXED_TEST_DEFAULTS_DOMAIN = new RegExp(`^(?:owner-mode|fx-model)-${UUID}$`);
216
- var DEVELOPER_BUILD_DEFAULTS_DOMAIN = "PusharyMac";
217
- var isDeveloperDefaultsDomain = (domain) => domain === DEVELOPER_BUILD_DEFAULTS_DOMAIN || UNPREFIXED_TEST_DEFAULTS_DOMAIN.test(domain) || TEST_DEFAULTS_PREFIXES.some((prefix) => domain.startsWith(prefix));
218
- var PREFERENCES_FILE_EXTENSION = ".plist";
219
- var preferencesDirectory = (home) => join(home, "Library", "Preferences");
220
- var preferencesFile = (home, domain) => join(preferencesDirectory(home), `${domain}${PREFERENCES_FILE_EXTENSION}`);
221
- var namesIn = (directory) => {
222
- try {
223
- return readdirSync(directory);
224
- } catch {
225
- return [];
226
- }
227
- };
228
- var developerDefaults = (home = homedir()) => namesIn(preferencesDirectory(home)).filter((name) => name.endsWith(PREFERENCES_FILE_EXTENSION)).map((name) => name.slice(0, -PREFERENCES_FILE_EXTENSION.length)).filter(isDeveloperDefaultsDomain).map((domain) => ({ domain, file: preferencesFile(home, domain) }));
229
- var BUNDLE_NAME = "Pushary.app";
230
- var DUMP_RECORD_SEPARATOR = /^-{20,}$/m;
231
- var DUMP_PATH_LINES = /^[ \t]*path:[ \t]+(.+?)(?: \(0x[0-9a-f]+\))?[ \t]*$/gm;
232
- var DUMP_IDENTIFIER_LINES = /^[ \t]*identifier:[ \t]+(\S+)/gm;
233
- var capturedIn = (text, lines) => [...text.matchAll(lines)].flatMap((match) => match[1] === void 0 ? [] : [match[1]]);
234
- var appCopyNamedByRecord = (record) => {
235
- const paths = capturedIn(record, DUMP_PATH_LINES);
236
- const identifiers = capturedIn(record, DUMP_IDENTIFIER_LINES);
237
- const namesOneAppCopy = paths.length === 1 && identifiers.length === 1 && identifiers[0] === MAC_APP_BUNDLE_ID;
238
- return namesOneAppCopy ? paths : [];
239
- };
240
- var isAtOrInside = (path, bundle) => path === bundle || path.startsWith(`${bundle}/`);
241
- var isUnderBundleNamedPushary = (path) => path.split("/").includes(BUNDLE_NAME);
242
- var bundlesInLaunchServicesDump = (dump) => {
243
- const appCopies = dump.split(DUMP_RECORD_SEPARATOR).flatMap(appCopyNamedByRecord);
244
- const isOurs = (path) => isUnderBundleNamedPushary(path) || appCopies.some((copy) => isAtOrInside(path, copy));
245
- return [...new Set(capturedIn(dump, DUMP_PATH_LINES).filter(isOurs))];
246
- };
247
- var outsideInstalledBundles = (registered, installed) => registered.filter((path) => !installed.some((bundle) => isAtOrInside(path, bundle)));
248
- var registeredPusharyBundles = (installed = installedPusharyBundles()) => {
249
- if (!existsSync(LSREGISTER)) return [];
250
- try {
251
- const dump = execSync(`${LSREGISTER} -dump`, {
252
- encoding: "utf-8",
253
- timeout: 6e4,
254
- maxBuffer: 256 * 1024 * 1024
255
- });
256
- return outsideInstalledBundles(bundlesInLaunchServicesDump(dump), installed);
257
- } catch {
258
- return [];
259
- }
260
- };
261
- var MAC_KEYCHAIN_SERVICE = "com.pushary.app.mac";
262
- var MAC_KEYCHAIN_ACCOUNTS = [
263
- "pushary.site-api-key",
264
- "pushary.site-id",
265
- "pushary.partner-enrollments",
266
- "pushary.partner-device-key",
267
- "clerk.device-token",
268
- "clerk.session-id",
269
- "clerkDeviceToken",
270
- "cachedClient",
271
- "cachedClientServerDate",
272
- "cachedEnvironment"
273
- ];
274
- var MAC_DEFAULTS_DOMAINS = ["com.pushary.app", "pushary-bridge", "pushary.render"];
275
- var PRESENCE_PROBE_TIMEOUT_MS = 1e4;
276
- var commandSucceeds = (file, args) => {
277
- try {
278
- execFileSync(file, args, { stdio: "ignore", timeout: PRESENCE_PROBE_TIMEOUT_MS });
279
- return true;
280
- } catch {
281
- return false;
282
- }
283
- };
284
- var KEYCHAIN_ITEM_NOT_FOUND = 44;
285
- var keychainItemMayExist = (service, account) => {
286
- try {
287
- execFileSync("security", ["find-generic-password", "-s", service, "-a", account], { stdio: "ignore" });
288
- return true;
289
- } catch (error) {
290
- return !(error instanceof Error && "status" in error && error.status === KEYCHAIN_ITEM_NOT_FOUND);
291
- }
292
- };
293
- var liveMacStatePresence = {
294
- keychainItem: keychainItemMayExist,
295
- defaultsDomain: (domain) => commandSucceeds("defaults", ["read", domain])
296
- };
297
- var macLibraryState = (home = homedir()) => [
298
- join(home, "Library", "Application Support", "Pushary"),
299
- join(home, "Library", "Caches", "com.pushary.app"),
300
- join(home, "Library", "Caches", "com.pushary.app.sparkle"),
301
- join(home, "Library", "Saved Application State", "com.pushary.app.savedState"),
302
- join(home, "Library", "Caches", "pushary-bridge"),
303
- join(home, "Library", "HTTPStorages", "com.pushary.app"),
304
- join(home, "Library", "HTTPStorages", "com.pushary.app.binarycookies"),
305
- join(home, "Library", "HTTPStorages", "pushary-bridge"),
306
- ...MAC_DEFAULTS_DOMAINS.map((domain) => preferencesFile(home, domain))
307
- ];
308
- var USER_CACHE_ENTRIES = [MAC_APP_BUNDLE_ID, "pushary-bridge", "PusharyBridge"];
309
- var macUserCacheState = (reportedUserCacheDirectory) => {
310
- const directory = reportedUserCacheDirectory.trim();
311
- return isAbsolute(directory) ? USER_CACHE_ENTRIES.map((entry) => join(directory, entry)) : [];
312
- };
313
- var UNKNOWN_USER_CACHE_DIRECTORY = "";
314
- var reportedDarwinUserCacheDirectory = () => {
315
- try {
316
- return execFileSync("getconf", ["DARWIN_USER_CACHE_DIR"], {
317
- encoding: "utf-8",
318
- timeout: PRESENCE_PROBE_TIMEOUT_MS,
319
- stdio: ["ignore", "pipe", "ignore"]
320
- });
321
- } catch {
322
- return UNKNOWN_USER_CACHE_DIRECTORY;
323
- }
324
- };
325
- var CRASH_REPORTER_ENTRY = new RegExp(`^(?:Pushary|PusharyMac|pushary-bridge)_${UUID}\\.plist$`);
326
- var crashReporterEntries = (home = homedir()) => {
327
- const directory = join(home, "Library", "Application Support", "CrashReporter");
328
- return namesIn(directory).filter((name) => CRASH_REPORTER_ENTRY.test(name)).map((name) => join(directory, name));
329
- };
330
- var storedMacAppState = (home = homedir()) => [
331
- ...macLibraryState(home),
332
- ...macUserCacheState(reportedDarwinUserCacheDirectory()),
333
- ...crashReporterEntries(home)
334
- ];
335
- var DUMP_SERVICE_LINE = /^\s*"svce"<blob>="(.+)"\s*$/;
336
- var pusharyKeychainServices = (dump) => {
337
- const found = /* @__PURE__ */ new Set();
338
- for (const line of dump.split("\n")) {
339
- const service = DUMP_SERVICE_LINE.exec(line)?.[1];
340
- if (service?.startsWith(MAC_KEYCHAIN_SERVICE)) found.add(service);
341
- }
342
- return [...found];
343
- };
344
- var storedPusharyKeychainServices = () => {
345
- const dump = execFileSync("security", ["dump-keychain"], {
346
- encoding: "utf-8",
347
- timeout: 3e4,
348
- maxBuffer: 64 * 1024 * 1024,
349
- stdio: ["ignore", "pipe", "ignore"]
350
- });
351
- const stored = pusharyKeychainServices(dump);
352
- return stored.includes(MAC_KEYCHAIN_SERVICE) ? stored : [MAC_KEYCHAIN_SERVICE, ...stored];
353
- };
354
- var runningMacAppPIDs = () => {
355
- if (process.platform !== "darwin") return [];
356
- try {
357
- return execSync('pgrep -f "Pushary.app/Contents/MacOS/Pushary"', {
358
- encoding: "utf-8",
359
- timeout: 1e4,
360
- stdio: ["ignore", "pipe", "ignore"]
361
- }).split("\n").map((line) => Number(line.trim())).filter((pid) => Number.isInteger(pid) && pid > 0);
362
- } catch {
363
- return [];
364
- }
365
- };
366
- var waitForMacAppExit = (attempts = 20, everyMs = 250) => {
367
- const idle = new Int32Array(new SharedArrayBuffer(4));
368
- for (let attempt = 0; attempt < attempts; attempt++) {
369
- if (runningMacAppPIDs().length === 0) return true;
370
- Atomics.wait(idle, 0, 0, everyMs);
371
- }
372
- return runningMacAppPIDs().length === 0;
373
- };
374
-
375
207
  // src/cli/clean-mac.ts
376
- import { existsSync as existsSync2 } from "fs";
208
+ import { existsSync } from "fs";
377
209
  var deleteDefaultsDomain = (guards2, domain) => {
378
210
  try {
379
211
  guards2.execFile("defaults", ["delete", domain], { stdio: "ignore", timeout: 1e4 }, `delete preferences ${domain}`);
@@ -433,7 +265,7 @@ var removeMacAppState = (guards2, readServices, statePaths, present) => {
433
265
  if (deleteDefaultsDomain(guards2, domain)) removed++;
434
266
  }
435
267
  for (const path of statePaths) {
436
- if (!existsSync2(path)) continue;
268
+ if (!existsSync(path)) continue;
437
269
  try {
438
270
  guards2.remove(path, { force: true });
439
271
  removed++;
@@ -458,13 +290,13 @@ var quitMacApp = (guards2, state) => {
458
290
  };
459
291
 
460
292
  // src/cli/editor-extension.ts
461
- import { existsSync as existsSync3, readFileSync, readdirSync as readdirSync2 } from "fs";
462
- import { homedir as homedir2 } from "os";
463
- import { join as join2 } from "path";
293
+ import { existsSync as existsSync2, readFileSync, readdirSync } from "fs";
294
+ import { homedir } from "os";
295
+ import { join } from "path";
464
296
  var EDITOR_EXTENSION_ID = "pushary.pushary";
465
297
  var EDITOR_EXTENSION_DIRS = [
466
- join2(".cursor", "extensions"),
467
- join2(".vscode", "extensions")
298
+ join(".cursor", "extensions"),
299
+ join(".vscode", "extensions")
468
300
  ];
469
301
  var EXTENSIONS_JSON = "extensions.json";
470
302
  var isOurEntry = (entry) => {
@@ -475,7 +307,7 @@ var isOurEntry = (entry) => {
475
307
  return typeof id === "string" && id.toLowerCase() === EDITOR_EXTENSION_ID;
476
308
  };
477
309
  var recordWithoutUs = (directory) => {
478
- const path = join2(directory, EXTENSIONS_JSON);
310
+ const path = join(directory, EXTENSIONS_JSON);
479
311
  try {
480
312
  const entries = JSON.parse(readFileSync(path, "utf-8"));
481
313
  if (!Array.isArray(entries)) return void 0;
@@ -485,15 +317,15 @@ var recordWithoutUs = (directory) => {
485
317
  return void 0;
486
318
  }
487
319
  };
488
- var editorExtensionRemovals = (home = homedir2()) => EDITOR_EXTENSION_DIRS.map((relative) => join2(home, relative)).filter(existsSync3).map((directory) => {
489
- const folders = readdirSync2(directory).filter((name) => name.startsWith(`${EDITOR_EXTENSION_ID}-`)).map((name) => join2(directory, name));
320
+ var editorExtensionRemovals = (home = homedir()) => EDITOR_EXTENSION_DIRS.map((relative) => join(home, relative)).filter(existsSync2).map((directory) => {
321
+ const folders = readdirSync(directory).filter((name) => name.startsWith(`${EDITOR_EXTENSION_ID}-`)).map((name) => join(directory, name));
490
322
  return { directory, folders, record: recordWithoutUs(directory) };
491
323
  }).filter((removal) => removal.folders.length > 0 || removal.record !== void 0);
492
324
 
493
325
  // src/cli/skills-store.ts
494
- import { existsSync as existsSync4, readFileSync as readFileSync2 } from "fs";
495
- import { homedir as homedir3 } from "os";
496
- import { join as join3 } from "path";
326
+ import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
327
+ import { homedir as homedir2 } from "os";
328
+ import { join as join2 } from "path";
497
329
  var SKILLS_STORE_DIR = ".agents";
498
330
  var LOCK_FILE = ".skill-lock.json";
499
331
  var lockWithoutUs = (path) => {
@@ -511,26 +343,26 @@ var lockWithoutUs = (path) => {
511
343
  return void 0;
512
344
  }
513
345
  };
514
- var skillsStoreRemoval = (home = homedir3()) => {
515
- const store = join3(home, SKILLS_STORE_DIR);
516
- const skillDir = join3(store, "skills", PUSHARY_SKILL_NAME);
517
- const lock = lockWithoutUs(join3(store, LOCK_FILE));
346
+ var skillsStoreRemoval = (home = homedir2()) => {
347
+ const store = join2(home, SKILLS_STORE_DIR);
348
+ const skillDir = join2(store, "skills", PUSHARY_SKILL_NAME);
349
+ const lock = lockWithoutUs(join2(store, LOCK_FILE));
518
350
  return {
519
- skillDir: lock && existsSync4(skillDir) ? skillDir : void 0,
351
+ skillDir: lock && existsSync3(skillDir) ? skillDir : void 0,
520
352
  lock
521
353
  };
522
354
  };
523
355
 
524
356
  // src/cli/claude-backups.ts
525
- import { existsSync as existsSync5, readFileSync as readFileSync3, readdirSync as readdirSync3 } from "fs";
526
- import { homedir as homedir4 } from "os";
527
- import { join as join4 } from "path";
357
+ import { existsSync as existsSync4, readFileSync as readFileSync3, readdirSync as readdirSync2 } from "fs";
358
+ import { homedir as homedir3 } from "os";
359
+ import { join as join3 } from "path";
528
360
  var BACKUP_PREFIX = ".claude.json.backup";
529
- var claudeJsonBackups = (home = homedir4()) => {
530
- const rollingDir = join4(home, ".claude", "backups");
531
- const legacy = join4(home, BACKUP_PREFIX);
532
- const rolling = existsSync5(rollingDir) ? readdirSync3(rollingDir).filter((name) => name.startsWith(BACKUP_PREFIX)).sort().map((name) => join4(rollingDir, name)) : [];
533
- return existsSync5(legacy) ? [...rolling, legacy] : rolling;
361
+ var claudeJsonBackups = (home = homedir3()) => {
362
+ const rollingDir = join3(home, ".claude", "backups");
363
+ const legacy = join3(home, BACKUP_PREFIX);
364
+ const rolling = existsSync4(rollingDir) ? readdirSync2(rollingDir).filter((name) => name.startsWith(BACKUP_PREFIX)).sort().map((name) => join3(rollingDir, name)) : [];
365
+ return existsSync4(legacy) ? [...rolling, legacy] : rolling;
534
366
  };
535
367
  var parsed = (path) => {
536
368
  try {
@@ -540,7 +372,7 @@ var parsed = (path) => {
540
372
  return null;
541
373
  }
542
374
  };
543
- var claudeBackupRewrites = (receipt, home = homedir4()) => claudeJsonBackups(home).flatMap((path) => {
375
+ var claudeBackupRewrites = (receipt, home = homedir3()) => claudeJsonBackups(home).flatMap((path) => {
544
376
  const backup = parsed(path);
545
377
  if (!backup) return [];
546
378
  const changed = receipt ? restoreClaudeMcpServer(backup, receipt) : removeClaudeMcpServers(backup);
@@ -586,8 +418,8 @@ var removeGlobalCliPackages = (guards2, request) => {
586
418
  };
587
419
 
588
420
  // src/cli/config-temp-leftovers.ts
589
- import { lstatSync, readdirSync as readdirSync4 } from "fs";
590
- import { join as join5 } from "path";
421
+ import { lstatSync, readdirSync as readdirSync3 } from "fs";
422
+ import { join as join4 } from "path";
591
423
  var MAC_APP_WRITE_TEMP = /^\..+\.pushary-[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/;
592
424
  var PID_STAMPED_WRITE_TEMP = /^\.\d+-[^/]+\.pushary-tmp$/;
593
425
  var CONFIG_TEMP_MIN_AGE_MS = 6e4;
@@ -595,15 +427,15 @@ var isLeakedConfigTempName = (name) => MAC_APP_WRITE_TEMP.test(name) || PID_STAM
595
427
  var leakedConfigTemps = (entries, nowMs) => entries.filter((entry) => entry.isFile && isLeakedConfigTempName(entry.name) && nowMs - entry.modifiedAtMs >= CONFIG_TEMP_MIN_AGE_MS).map((entry) => entry.name);
596
428
  var directoryEntries = (directory) => {
597
429
  try {
598
- return readdirSync4(directory).flatMap((name) => {
599
- const stats = lstatSync(join5(directory, name), { throwIfNoEntry: false });
430
+ return readdirSync3(directory).flatMap((name) => {
431
+ const stats = lstatSync(join4(directory, name), { throwIfNoEntry: false });
600
432
  return stats ? [{ name, isFile: stats.isFile(), modifiedAtMs: stats.mtimeMs }] : [];
601
433
  });
602
434
  } catch {
603
435
  return [];
604
436
  }
605
437
  };
606
- var configTempLeftovers = (directories, nowMs) => [...new Set(directories)].flatMap((directory) => leakedConfigTemps(directoryEntries(directory), nowMs).map((name) => join5(directory, name)));
438
+ var configTempLeftovers = (directories, nowMs) => [...new Set(directories)].flatMap((directory) => leakedConfigTemps(directoryEntries(directory), nowMs).map((name) => join4(directory, name)));
607
439
 
608
440
  // src/app-owned-paths.ts
609
441
  var APP_OWNED_ENTRIES = [
@@ -700,13 +532,13 @@ var CURSOR_PLUGIN_DIR = cursorPluginDir();
700
532
  var CURSOR_USER_HOOKS = cursorUserHooks();
701
533
  var VSCODE_PLUGIN_DIR = vscodePluginDir();
702
534
  var PUSHARY_DIR = pusharyDir();
703
- var SHELL_FILES = [".zshrc", ".zprofile", ".bashrc", ".bash_profile"].map((f) => join6(homedir5(), f));
535
+ var SHELL_FILES = [".zshrc", ".zprofile", ".bashrc", ".bash_profile"].map((f) => join5(homedir4(), f));
704
536
  var PRESENCE_BY_RESOLUTION = {
705
537
  bundle: "present",
706
538
  missing: "gone",
707
539
  "no-stub": "absent"
708
540
  };
709
- var macAppPresence = () => PRESENCE_BY_RESOLUTION[resolveBridgeStub(join6(PUSHARY_DIR, "bin", HOOK_LOCATOR_BINARY), liveBridgeProbe()).kind];
541
+ var macAppPresence = () => PRESENCE_BY_RESOLUTION[resolveBridgeStub(join5(PUSHARY_DIR, "bin", HOOK_LOCATOR_BINARY), liveBridgeProbe()).kind];
710
542
  var removalScope = (keepMcpServer, keepAppWiring) => ({
711
543
  keepAppWiring,
712
544
  keepMcpServer
@@ -741,7 +573,7 @@ var guardedRemove = (path, options) => guards.remove(path, options);
741
573
  var cursorPluginLeftovers = () => {
742
574
  const parent = dirname(CURSOR_PLUGIN_DIR);
743
575
  try {
744
- return readdirSync5(parent).filter(isCursorPluginLeftover).map((name) => join6(parent, name));
576
+ return readdirSync4(parent).filter(isCursorPluginLeftover).map((name) => join5(parent, name));
745
577
  } catch {
746
578
  return [];
747
579
  }
@@ -755,14 +587,14 @@ var guardedDaemonRemoval = async () => {
755
587
  };
756
588
  var guardedInstructionBlockRemoval = (path) => {
757
589
  if (!dryRun) return removeInstructionBlock(path);
758
- if (!existsSync6(path)) return false;
590
+ if (!existsSync5(path)) return false;
759
591
  const hasBlock = readFileSync4(path, "utf-8").includes("pushary");
760
592
  if (hasBlock) wouldNote("rewrite", path);
761
593
  return hasBlock;
762
594
  };
763
595
  var guardedAliasRemoval = () => {
764
596
  if (!dryRun) return removeClaudeAlias();
765
- const shells = CANDIDATE_RCS.map((name) => join6(homedir5(), name)).filter((path) => existsSync6(path) && readFileSync4(path, "utf-8").includes("pushary claude"));
597
+ const shells = CANDIDATE_RCS.map((name) => join5(homedir4(), name)).filter((path) => existsSync5(path) && readFileSync4(path, "utf-8").includes("pushary claude"));
766
598
  for (const path of shells) wouldNote("rewrite", path);
767
599
  return shells;
768
600
  };
@@ -787,7 +619,7 @@ var removeFxInstructions = () => {
787
619
  }
788
620
  };
789
621
  var removeCursorUserHook = (scope) => {
790
- if (!existsSync6(CURSOR_USER_HOOKS)) return "absent";
622
+ if (!existsSync5(CURSOR_USER_HOOKS)) return "absent";
791
623
  let parsed2;
792
624
  try {
793
625
  parsed2 = JSON.parse(readFileSync4(CURSOR_USER_HOOKS, "utf-8"));
@@ -832,14 +664,14 @@ var cleanSettingsFile = (path, label, scope) => {
832
664
  );
833
665
  };
834
666
  var agentConfigDirectories = () => [
835
- homedir5(),
667
+ homedir4(),
836
668
  dirname(CLAUDE_SETTINGS),
837
669
  dirname(codexConfigToml()),
838
670
  dirname(geminiSettings()),
839
671
  dirname(CURSOR_USER_HOOKS),
840
672
  openCodeConfigDir(),
841
673
  fxConfigDir(),
842
- ...vscodeSettingsTargets(existsSync6).map((settings) => dirname(settings))
674
+ ...vscodeSettingsTargets(existsSync5).map((settings) => dirname(settings))
843
675
  ];
844
676
  var restoreTakeoverReceipts = () => {
845
677
  const targets = [
@@ -847,15 +679,15 @@ var restoreTakeoverReceipts = () => {
847
679
  ["codex", codexHooksJson(), codexConfigToml(), "mcp_servers", "toml"],
848
680
  ["gemini_cli", geminiSettings(), geminiSettings(), "mcpServers", "json"],
849
681
  ["cursor", CURSOR_USER_HOOKS, null, null, null],
850
- ["vscode", join6(VSCODE_PLUGIN_DIR, "hooks", "hooks.json"), vscodePluginMcp(), "mcpServers", "json"]
682
+ ["vscode", join5(VSCODE_PLUGIN_DIR, "hooks", "hooks.json"), vscodePluginMcp(), "mcpServers", "json"]
851
683
  ];
852
684
  for (const [agent, hookFile, mcpFile, mcpKey, mcpFormat] of targets) {
853
685
  const receiptPath = hookTakeoverReceipt(agent);
854
- if (!existsSync6(receiptPath)) continue;
686
+ if (!existsSync5(receiptPath)) continue;
855
687
  try {
856
688
  const receipt = readJson(receiptPath);
857
689
  if (!isHookTakeoverReceipt(receipt) || receipt.agent !== agent) throw new Error("invalid receipt");
858
- const document = existsSync6(hookFile) ? JSON.parse(readFileSync4(hookFile, "utf-8")) : {};
690
+ const document = existsSync5(hookFile) ? JSON.parse(readFileSync4(hookFile, "utf-8")) : {};
859
691
  if (!document || typeof document !== "object" || Array.isArray(document)) throw new Error("invalid hooks file");
860
692
  const appAlreadyOwns = hookOwnerOf(document) === "app";
861
693
  const cliPositions = agent === "codex" ? codexHookPositions(document) : {};
@@ -866,7 +698,7 @@ var restoreTakeoverReceipts = () => {
866
698
  if (mcpFile === hookFile) {
867
699
  mcpDocument = document;
868
700
  } else {
869
- const raw = existsSync6(mcpFile) ? readFileSync4(mcpFile, "utf-8") : "";
701
+ const raw = existsSync5(mcpFile) ? readFileSync4(mcpFile, "utf-8") : "";
870
702
  mcpDocument = raw.trim() ? mcpFormat === "toml" ? parseTOML(raw) : JSON.parse(raw) : {};
871
703
  }
872
704
  mcpChanged = restoreMcpServer(mcpDocument, mcpKey, receipt.mcpServer);
@@ -876,7 +708,7 @@ var restoreTakeoverReceipts = () => {
876
708
  if (!appAlreadyOwns && agent === "codex") {
877
709
  if (!mcpDocument) {
878
710
  const configPath = codexConfigToml();
879
- const raw = existsSync6(configPath) ? readFileSync4(configPath, "utf-8") : "";
711
+ const raw = existsSync5(configPath) ? readFileSync4(configPath, "utf-8") : "";
880
712
  mcpDocument = raw.trim() ? parseTOML(raw) : {};
881
713
  }
882
714
  codexConfig = mcpDocument;
@@ -972,7 +804,7 @@ var main = async () => {
972
804
  }
973
805
  if (presence !== "absent") console.log();
974
806
  const restoredByTakeover = new Set(
975
- ["claude_code", "codex", "gemini_cli"].filter((agent) => existsSync6(hookTakeoverReceipt(agent)))
807
+ ["claude_code", "codex", "gemini_cli"].filter((agent) => existsSync5(hookTakeoverReceipt(agent)))
976
808
  );
977
809
  if (keepShared) restoreTakeoverReceipts();
978
810
  const sharedMcpKeys = {
@@ -998,7 +830,7 @@ var main = async () => {
998
830
  let macAppKeepsCodexAppCards = false;
999
831
  if (uid !== void 0) {
1000
832
  try {
1001
- const removal = { homeDir: homedir5(), uid, keepWhatTheMacAppTurnedOn: keepShared, dryRun };
833
+ const removal = { homeDir: homedir4(), uid, keepWhatTheMacAppTurnedOn: keepShared, dryRun };
1002
834
  const appCards = removeCodexAppCardsFromThisMac(removal);
1003
835
  macAppKeepsCodexAppCards = codexAppCardsFolderStaysOnThisMac(removal);
1004
836
  if (appCards === "removed") console.log(` ${check} Codex app cards ${dim(did("removed"))} ${dim("(quit Codex and open it again)")}`);
@@ -1015,7 +847,7 @@ var main = async () => {
1015
847
  const claudeHadPusharyEntry = claudeHasPusharyEntry();
1016
848
  const rawReceipt = readJson(CLAUDE_MCP_RECEIPT);
1017
849
  const receipt = isClaudeMcpSnapshot(rawReceipt) ? rawReceipt : null;
1018
- const receiptUnreadable = existsSync6(CLAUDE_MCP_RECEIPT) && !receipt;
850
+ const receiptUnreadable = existsSync5(CLAUDE_MCP_RECEIPT) && !receipt;
1019
851
  if (keepClaudeMcp) {
1020
852
  console.log(` ${skip} Claude Code MCP servers ${dim("(kept: the Mac app uses it)")}`);
1021
853
  } else if (claudeJson2) {
@@ -1030,7 +862,7 @@ var main = async () => {
1030
862
  if (receipt && !keepShared) incompleteClean = true;
1031
863
  console.log(` ${skip} Claude Code MCP servers ${dim(receipt ? "(changed after setup; left unchanged)" : "(no pushary entries)")}`);
1032
864
  }
1033
- } else if (existsSync6(CLAUDE_MCP_RECEIPT)) {
865
+ } else if (existsSync5(CLAUDE_MCP_RECEIPT)) {
1034
866
  incompleteClean = true;
1035
867
  console.log(` ${skip} Claude Code MCP servers ${dim("(config missing; setup receipt kept for retry)")}`);
1036
868
  } else {
@@ -1074,7 +906,7 @@ var main = async () => {
1074
906
  }
1075
907
  if (cursorGate === "failed") {
1076
908
  console.log(` ${skip} Cursor plugin ${dim("(kept: removing it now would block matched commands)")}`);
1077
- } else if (existsSync6(CURSOR_PLUGIN_DIR)) {
909
+ } else if (existsSync5(CURSOR_PLUGIN_DIR)) {
1078
910
  guardedRemove(CURSOR_PLUGIN_DIR);
1079
911
  console.log(` ${check} Cursor plugin ${dim("(removed from ~/.cursor/plugins/local)")}`);
1080
912
  } else {
@@ -1090,9 +922,9 @@ var main = async () => {
1090
922
  if (keepShared) {
1091
923
  console.log(` ${skip} VS Code plugin ${dim("(kept: the Mac app writes the same plugin directory)")}`);
1092
924
  }
1093
- for (const settingsPath of keepShared ? [] : vscodeSettingsTargets(existsSync6)) {
925
+ for (const settingsPath of keepShared ? [] : vscodeSettingsTargets(existsSync5)) {
1094
926
  const label = `VS Code plugin ${dim(`(${shortenHome(settingsPath)})`)}`;
1095
- if (!existsSync6(settingsPath)) {
927
+ if (!existsSync5(settingsPath)) {
1096
928
  console.log(` ${skip} ${label} ${dim("(no settings.json)")}`);
1097
929
  continue;
1098
930
  }
@@ -1106,7 +938,7 @@ var main = async () => {
1106
938
  console.log(` ${skip} ${label} ${dim("(no pushary entry)")}`);
1107
939
  }
1108
940
  }
1109
- if (!keepShared && existsSync6(VSCODE_PLUGIN_DIR)) {
941
+ if (!keepShared && existsSync5(VSCODE_PLUGIN_DIR)) {
1110
942
  guardedRemove(VSCODE_PLUGIN_DIR);
1111
943
  console.log(` ${check} VS Code plugin files ${dim(did("removed"))}`);
1112
944
  }
@@ -1125,7 +957,7 @@ var main = async () => {
1125
957
  }
1126
958
  if (keepShared) {
1127
959
  console.log(` ${skip} Skill directory ${dim("(kept: the Mac app uses it)")}`);
1128
- } else if (existsSync6(SKILL_DIR)) {
960
+ } else if (existsSync5(SKILL_DIR)) {
1129
961
  guardedRemove(SKILL_DIR);
1130
962
  console.log(` ${check} Skill directory ${dim(did("removed"))}`);
1131
963
  } else {
@@ -1185,7 +1017,7 @@ var main = async () => {
1185
1017
  const codexSkillDir2 = codexSkillDir();
1186
1018
  if (keepShared) {
1187
1019
  console.log(` ${skip} Codex skill directory ${dim("(kept: the Mac app uses it)")}`);
1188
- } else if (existsSync6(codexSkillDir2)) {
1020
+ } else if (existsSync5(codexSkillDir2)) {
1189
1021
  guardedRemove(codexSkillDir2);
1190
1022
  console.log(` ${check} Codex skill directory ${dim(did("removed"))}`);
1191
1023
  } else {
@@ -1238,7 +1070,7 @@ var main = async () => {
1238
1070
  console.log(` ${skip} Gemini GEMINI.md ${dim("(no pushary block)")}`);
1239
1071
  }
1240
1072
  const openCodePlugin = openCodePluginFile();
1241
- const openCodePluginContents = existsSync6(openCodePlugin) ? readFileSync4(openCodePlugin, "utf-8") : null;
1073
+ const openCodePluginContents = existsSync5(openCodePlugin) ? readFileSync4(openCodePlugin, "utf-8") : null;
1242
1074
  if (openCodePluginContents === null) {
1243
1075
  console.log(` ${skip} OpenCode plugin ${dim("(not installed)")}`);
1244
1076
  } else if (!isOpenCodePluginOurs(openCodePluginContents)) {
@@ -1248,15 +1080,15 @@ var main = async () => {
1248
1080
  } else {
1249
1081
  guardedRemove(openCodePlugin, { force: true });
1250
1082
  console.log(` ${check} OpenCode plugin ${dim(did("removed"))}`);
1251
- const sibling = join6(openCodePluginDir(), OPENCODE_PLUGIN_SIBLING);
1083
+ const sibling = join5(openCodePluginDir(), OPENCODE_PLUGIN_SIBLING);
1252
1084
  const remaining = (() => {
1253
1085
  try {
1254
- return readdirSync5(openCodePluginDir()).filter((name) => name !== OPENCODE_PLUGIN_SIBLING);
1086
+ return readdirSync4(openCodePluginDir()).filter((name) => name !== OPENCODE_PLUGIN_SIBLING);
1255
1087
  } catch {
1256
1088
  return [];
1257
1089
  }
1258
1090
  })();
1259
- const siblingIsOurs = existsSync6(sibling) && readFileSync4(sibling, "utf-8") === OPENCODE_PLUGIN_SIBLING_CONTENTS;
1091
+ const siblingIsOurs = existsSync5(sibling) && readFileSync4(sibling, "utf-8") === OPENCODE_PLUGIN_SIBLING_CONTENTS;
1260
1092
  if (siblingIsOurs && !hasForeignPlugins(remaining)) {
1261
1093
  guardedRemove(sibling, { force: true });
1262
1094
  console.log(` ${check} OpenCode plugin sibling ${dim(did("removed"))}`);
@@ -1309,7 +1141,7 @@ var main = async () => {
1309
1141
  }
1310
1142
  }
1311
1143
  }
1312
- } else if (existsSync6(HERMES_CONFIG_RECEIPT)) {
1144
+ } else if (existsSync5(HERMES_CONFIG_RECEIPT)) {
1313
1145
  incompleteClean = true;
1314
1146
  console.log(` ${skip} Hermes ${dim("(runtime not found; setup receipt kept for retry)")}`);
1315
1147
  } else {
@@ -1358,15 +1190,15 @@ var main = async () => {
1358
1190
  if (leakedTemps.length > 0) {
1359
1191
  console.log(` ${check} Leftover temp files ${dim(`(${dryRun ? "would remove" : "removed"} ${leakedTemps.length} left by an interrupted config write)`)}`);
1360
1192
  }
1361
- if (existsSync6(PUSHARY_DIR)) {
1193
+ if (existsSync5(PUSHARY_DIR)) {
1362
1194
  let removed = 0;
1363
1195
  const kept = [];
1364
- for (const entry of readdirSync5(PUSHARY_DIR)) {
1196
+ for (const entry of readdirSync4(PUSHARY_DIR)) {
1365
1197
  if (keepShared && isAppOwned(entry) || entry === "setup" && (keepShared || incompleteClean) || entry === CODEX_APP_CARDS_DIRECTORY && macAppKeepsCodexAppCards) {
1366
1198
  kept.push(entry);
1367
1199
  continue;
1368
1200
  }
1369
- guardedRemove(join6(PUSHARY_DIR, entry), { force: true });
1201
+ guardedRemove(join5(PUSHARY_DIR, entry), { force: true });
1370
1202
  removed++;
1371
1203
  }
1372
1204
  if (removed > 0) {
@@ -1383,10 +1215,10 @@ var main = async () => {
1383
1215
  }
1384
1216
  try {
1385
1217
  let swept = 0;
1386
- for (const f of readdirSync5(tmpdir())) {
1218
+ for (const f of readdirSync4(tmpdir())) {
1387
1219
  if (!f.startsWith("pushary-")) continue;
1388
1220
  try {
1389
- guardedRemove(join6(tmpdir(), f), { force: true });
1221
+ guardedRemove(join5(tmpdir(), f), { force: true });
1390
1222
  swept++;
1391
1223
  } catch {
1392
1224
  }
@@ -1440,7 +1272,7 @@ var main = async () => {
1440
1272
  console.log(` ${dim("Still stuck? Send this output to")} ${SUPPORT_EMAIL} ${dim("or")} ${SUPPORT_DISCORD}`);
1441
1273
  } else if (everything) {
1442
1274
  console.log(` ${green(bold("Clean complete. Nothing of ours is left in any agent config."))}`);
1443
- const bundle = installedPusharyBundles().find(existsSync6);
1275
+ const bundle = installedPusharyBundles().find(existsSync5);
1444
1276
  if (bundle) {
1445
1277
  console.log(` ${dim("The app itself is still installed. Drag")} ${bundle} ${dim("to the Trash to finish.")}`);
1446
1278
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  letCodexRunWithoutPushary
4
- } from "../chunk-36NGFHE4.js";
4
+ } from "../chunk-E46NE7FB.js";
5
5
 
6
6
  // bin/pushary-codex-session.ts
7
7
  var args = process.argv.slice(2);
@@ -16,7 +16,7 @@ var desktopAccount = async () => {
16
16
  return null;
17
17
  }
18
18
  };
19
- var desktopLaunch = await import("../codex-desktop-launch-I2D6QATK.js").catch(() => null);
19
+ var desktopLaunch = await import("../codex-desktop-launch-RIBIFXSF.js").catch(() => null);
20
20
  if (desktopLaunch === null && appBehindTheProxy !== void 0) {
21
21
  process.exitCode = await letCodexRunWithoutPushary(appBehindTheProxy, args.slice(3));
22
22
  } else {
@@ -24,7 +24,7 @@ if (desktopLaunch === null && appBehindTheProxy !== void 0) {
24
24
  const stop = () => abort.abort();
25
25
  if (!args[0]?.startsWith("--desktop")) for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, stop);
26
26
  try {
27
- const { codexDesktopCommand } = desktopLaunch ?? await import("../codex-desktop-launch-I2D6QATK.js");
27
+ const { codexDesktopCommand } = desktopLaunch ?? await import("../codex-desktop-launch-RIBIFXSF.js");
28
28
  const desktop = await codexDesktopCommand(args, [process.execPath, ...process.execArgv, process.argv[1], "codex"], desktopAccount);
29
29
  if (desktop !== null) process.exitCode = desktop;
30
30
  else {
@@ -3,7 +3,7 @@ import {
3
3
  connectDevice,
4
4
  connectExistingApp,
5
5
  printConnectInstructions
6
- } from "../chunk-XZRLFBEA.js";
6
+ } from "../chunk-LGTF7AZX.js";
7
7
  import "../chunk-3EGEA4KH.js";
8
8
  import {
9
9
  printKeyCheck