pushary 1.9.45 → 1.9.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/bin/pushary-bell-hook.js +25 -25
  3. package/dist/bin/pushary-bell.js +9 -9
  4. package/dist/bin/pushary-claude.js +24 -24
  5. package/dist/bin/pushary-clean.js +142 -76
  6. package/dist/bin/pushary-codex-bridge.js +18 -18
  7. package/dist/bin/pushary-codex-hook.js +30 -30
  8. package/dist/bin/pushary-codex-session.js +22 -18
  9. package/dist/bin/pushary-codex.js +12 -12
  10. package/dist/bin/pushary-connect.js +24 -24
  11. package/dist/bin/pushary-cowork.js +5 -5
  12. package/dist/bin/pushary-daemon.js +32 -32
  13. package/dist/bin/pushary-disconnect.js +37 -30
  14. package/dist/bin/pushary-doctor.js +34 -34
  15. package/dist/bin/pushary-elicitation-hook.js +25 -25
  16. package/dist/bin/pushary-gemini-bridge.js +13 -13
  17. package/dist/bin/pushary-gemini-hook.js +27 -27
  18. package/dist/bin/pushary-hook.js +29 -29
  19. package/dist/bin/pushary-login.js +12 -12
  20. package/dist/bin/pushary-logout.js +24 -24
  21. package/dist/bin/pushary-mcp.js +9 -9
  22. package/dist/bin/pushary-mode.js +12 -12
  23. package/dist/bin/pushary-notification-hook.js +24 -24
  24. package/dist/bin/pushary-opencode-hook.js +26 -26
  25. package/dist/bin/pushary-permission-denied-hook.js +29 -29
  26. package/dist/bin/pushary-permission-hook.js +28 -28
  27. package/dist/bin/pushary-post-hook.js +24 -24
  28. package/dist/bin/pushary-prompt-hook.js +24 -24
  29. package/dist/bin/pushary-session-end-hook.js +24 -24
  30. package/dist/bin/pushary-session-start-hook.js +28 -28
  31. package/dist/bin/pushary-setup.js +36 -36
  32. package/dist/bin/pushary-stats.js +5 -5
  33. package/dist/bin/pushary-status.js +26 -26
  34. package/dist/bin/pushary-stop-hook.js +24 -24
  35. package/dist/bin/pushary-stopfailure-hook.js +24 -24
  36. package/dist/bin/pushary-suggestions.js +12 -12
  37. package/dist/bin/pushary-transcript-register.js +17 -17
  38. package/dist/bin/pushary-transcripts.js +7 -7
  39. package/dist/bin/pushary-upgrade.js +30 -30
  40. package/dist/bin/pushary-wait.js +12 -12
  41. package/dist/bin/pushary.js +6 -6
  42. package/dist/{chunk-YXGWG5PO.js → chunk-3F3JHJPS.js} +5 -5
  43. package/dist/{chunk-OHFC3GJY.js → chunk-3KSN65VJ.js} +1 -1
  44. package/dist/{chunk-R7ZQHAVL.js → chunk-3RAWTKWW.js} +2 -2
  45. package/dist/{chunk-7SGYCU5C.js → chunk-4MJ46JA7.js} +1 -1
  46. package/dist/{chunk-SFQSOBLM.js → chunk-6VFP72GX.js} +3 -3
  47. package/dist/{chunk-HHX6IRSH.js → chunk-6W64IVG3.js} +1 -1
  48. package/dist/{chunk-YWIFK2UB.js → chunk-6WFJCUWO.js} +2 -2
  49. package/dist/{chunk-ZSY6BWUD.js → chunk-7JUISFZ7.js} +2 -2
  50. package/dist/{chunk-335ZDJ7R.js → chunk-7VLY6RHG.js} +1 -1
  51. package/dist/{chunk-CFMCV6Z7.js → chunk-ADKWE35P.js} +2 -2
  52. package/dist/{chunk-WM76AN4X.js → chunk-AIDH46DC.js} +10 -10
  53. package/dist/{chunk-S6EGJBI5.js → chunk-BS457P5Z.js} +1 -1
  54. package/dist/{chunk-3PM62C2R.js → chunk-CVCOZWSB.js} +8 -8
  55. package/dist/{chunk-U45OINYS.js → chunk-DDS472RO.js} +1 -1
  56. package/dist/{chunk-DSGB5JLG.js → chunk-DPF6WDCX.js} +4 -4
  57. package/dist/{chunk-SIN7NJD7.js → chunk-DRQVZHWE.js} +1 -1
  58. package/dist/{chunk-K7EGWMDU.js → chunk-DY5PQSQB.js} +116 -31
  59. package/dist/{chunk-ASK2MSD2.js → chunk-FDDZEYGM.js} +5 -5
  60. package/dist/{chunk-FOUK4CBO.js → chunk-FWQ2O5BI.js} +4 -4
  61. package/dist/{chunk-6TYKZ4DN.js → chunk-FY6ZTTDQ.js} +3 -3
  62. package/dist/{chunk-CDERSTBO.js → chunk-GLVPA4EK.js} +5 -5
  63. package/dist/{chunk-KS7NA5CK.js → chunk-GOTCSFLS.js} +7 -7
  64. package/dist/{chunk-2FUHSKXH.js → chunk-J3CYUXGX.js} +4 -4
  65. package/dist/{chunk-N2K3BSCA.js → chunk-K2KGB7TK.js} +5 -5
  66. package/dist/{chunk-WDIX4XZH.js → chunk-K2YVKKYV.js} +2 -2
  67. package/dist/{chunk-PWUIPQ2I.js → chunk-KQDHOQRG.js} +3 -3
  68. package/dist/{chunk-46F4BRUQ.js → chunk-LFMC5AE2.js} +1 -1
  69. package/dist/{chunk-QQXP3CQA.js → chunk-LQRPQXAG.js} +1 -1
  70. package/dist/{chunk-WPPKXVV3.js → chunk-M47U54AO.js} +2 -2
  71. package/dist/{chunk-IOVJVGIT.js → chunk-MCL5IS6A.js} +4 -4
  72. package/dist/{chunk-7URSJMAB.js → chunk-MM472M4O.js} +1 -1
  73. package/dist/{chunk-EH5ZDG6V.js → chunk-MZQ5M6F6.js} +4 -4
  74. package/dist/{chunk-XFHISCJM.js → chunk-N6JNKOKJ.js} +5 -5
  75. package/dist/{chunk-VO6XI6AX.js → chunk-OL7QCMQK.js} +3 -3
  76. package/dist/{chunk-H4ODQD3Y.js → chunk-P4RKBBHE.js} +2 -2
  77. package/dist/{chunk-5DCZL3BC.js → chunk-PHKISQPB.js} +3 -3
  78. package/dist/{chunk-EWC4P4ZL.js → chunk-PRQMACC7.js} +1 -1
  79. package/dist/{chunk-ECFEYB6Z.js → chunk-R7AMICLS.js} +1 -1
  80. package/dist/{chunk-AUOSFZJ3.js → chunk-RDVDW3WK.js} +5 -5
  81. package/dist/{chunk-GQ5KCVGK.js → chunk-ROQSYB3T.js} +6 -6
  82. package/dist/{chunk-YK7FGPYS.js → chunk-S3657KK2.js} +3 -3
  83. package/dist/{chunk-RFQWB5ZV.js → chunk-T3QKLW3M.js} +1 -1
  84. package/dist/{chunk-RBJWPUI6.js → chunk-TP5SLM2I.js} +8 -4
  85. package/dist/{chunk-U6Z56IQS.js → chunk-TSI25WVW.js} +2 -2
  86. package/dist/{chunk-BT57FUMT.js → chunk-UFTPB3LZ.js} +2 -2
  87. package/dist/{chunk-EKGQEDQ4.js → chunk-UIPZSSBC.js} +2 -2
  88. package/dist/{chunk-57M4ERJK.js → chunk-VE4LQ23C.js} +1 -1
  89. package/dist/{chunk-4A6VUVXV.js → chunk-VQZ4FP6Z.js} +1 -1
  90. package/dist/{chunk-2DORVRDB.js → chunk-VVJUH4SV.js} +2 -2
  91. package/dist/{chunk-6JPDAUFP.js → chunk-WHHNQA4C.js} +19 -10
  92. package/dist/{chunk-NJN5NRHZ.js → chunk-WOE46HSM.js} +4 -4
  93. package/dist/{chunk-P2F3JUFX.js → chunk-X6ILS4XE.js} +4 -4
  94. package/dist/{chunk-IKYI63RF.js → chunk-YCKGZOKV.js} +6 -6
  95. package/dist/{chunk-IFT3GU7Y.js → chunk-YENJWLN4.js} +2 -2
  96. package/dist/{chunk-2SXXH6JY.js → chunk-ZHZTFA76.js} +5 -5
  97. package/dist/{chunk-GZSSAY6N.js → chunk-ZR2EPWW4.js} +9 -9
  98. package/dist/{global-upgrade-U6NWZA5W.js → global-upgrade-KHP36X27.js} +6 -6
  99. package/dist/{paths-IQTB3ZZI.js → paths-63XAPFWJ.js} +2 -2
  100. package/dist/{reapply-LILGWJO3.js → reapply-Y2EXWAWE.js} +20 -20
  101. package/dist/src/index.js +19 -19
  102. package/dist/{upgrade-lock-2BVFIDU4.js → upgrade-lock-RF3LR2HC.js} +3 -3
  103. package/package.json +1 -1
@@ -9,13 +9,13 @@ import {
9
9
  planCliKeyRevocations,
10
10
  readCliHeldKeys,
11
11
  revokeCliKeys
12
- } from "../chunk-N2K3BSCA.js";
13
- import "../chunk-P2F3JUFX.js";
12
+ } from "../chunk-K2KGB7TK.js";
13
+ import "../chunk-X6ILS4XE.js";
14
14
  import {
15
15
  isCursorPluginLeftover,
16
16
  releaseSoleGate,
17
17
  withoutPusharyCursorHooks
18
- } from "../chunk-DSGB5JLG.js";
18
+ } from "../chunk-DPF6WDCX.js";
19
19
  import {
20
20
  HERMES_PIP_PACKAGE,
21
21
  readHermesStatus,
@@ -24,20 +24,20 @@ import {
24
24
  shortenHome,
25
25
  unregisterPluginLocation,
26
26
  vscodeSettingsTargets
27
- } from "../chunk-NJN5NRHZ.js";
27
+ } from "../chunk-WOE46HSM.js";
28
28
  import {
29
29
  macAppKeepsMcpEntry,
30
30
  mcpServerBearer,
31
31
  pusharyKey,
32
32
  readMacAppAgentKey,
33
33
  setupReceiptKey
34
- } from "../chunk-FOUK4CBO.js";
35
- import "../chunk-YWIFK2UB.js";
34
+ } from "../chunk-FWQ2O5BI.js";
35
+ import "../chunk-6WFJCUWO.js";
36
36
  import {
37
37
  planFxRemoval,
38
38
  removeInstructionBlock
39
- } from "../chunk-XFHISCJM.js";
40
- import "../chunk-BT57FUMT.js";
39
+ } from "../chunk-N6JNKOKJ.js";
40
+ import "../chunk-UFTPB3LZ.js";
41
41
  import {
42
42
  OPENCODE_PLUGIN_SIBLING,
43
43
  OPENCODE_PLUGIN_SIBLING_CONTENTS,
@@ -49,7 +49,7 @@ import {
49
49
  openCodePluginDir,
50
50
  openCodePluginFile,
51
51
  removeOpenCodeMcpServer
52
- } from "../chunk-YXGWG5PO.js";
52
+ } from "../chunk-3F3JHJPS.js";
53
53
  import {
54
54
  ansiPainter,
55
55
  useColor
@@ -61,6 +61,7 @@ import {
61
61
  compatibleMcpFile,
62
62
  compatiblePermissionRuleFile,
63
63
  isClaudeMcpSnapshot,
64
+ isEmptiedPusharyOwnedDocument,
64
65
  readConfigDocument,
65
66
  removeClaudeMcpServers,
66
67
  removeCompatibleHooks,
@@ -69,10 +70,10 @@ import {
69
70
  removePusharyToolPermissions,
70
71
  restoreClaudeMcpServer,
71
72
  serializeConfigDocument
72
- } from "../chunk-RBJWPUI6.js";
73
+ } from "../chunk-TP5SLM2I.js";
73
74
  import {
74
75
  disableDaemonService
75
- } from "../chunk-AUOSFZJ3.js";
76
+ } from "../chunk-RDVDW3WK.js";
76
77
  import {
77
78
  hookOwnerOf,
78
79
  isHookTakeoverReceipt,
@@ -80,12 +81,12 @@ import {
80
81
  resolveBridgeStub,
81
82
  restoreHookTakeover,
82
83
  restoreMcpServer
83
- } from "../chunk-ASK2MSD2.js";
84
+ } from "../chunk-FDDZEYGM.js";
84
85
  import {
85
86
  removeGeminiSettings
86
- } from "../chunk-5DCZL3BC.js";
87
- import "../chunk-OHFC3GJY.js";
88
- import "../chunk-U45OINYS.js";
87
+ } from "../chunk-PHKISQPB.js";
88
+ import "../chunk-3KSN65VJ.js";
89
+ import "../chunk-DDS472RO.js";
89
90
  import {
90
91
  rejectUnknownFlags
91
92
  } from "../chunk-GMXKITVA.js";
@@ -94,21 +95,21 @@ import {
94
95
  isDisabledExport,
95
96
  removeClaudeAlias,
96
97
  shellProfileCandidates
97
- } from "../chunk-YK7FGPYS.js";
98
+ } from "../chunk-S3657KK2.js";
98
99
  import {
99
100
  exitOnHelpFlag
100
- } from "../chunk-ZSY6BWUD.js";
101
+ } from "../chunk-7JUISFZ7.js";
101
102
  import "../chunk-XHKBHWLX.js";
102
103
  import "../chunk-6ICPEJY5.js";
103
- import "../chunk-GZSSAY6N.js";
104
- import "../chunk-HHX6IRSH.js";
105
- import "../chunk-CFMCV6Z7.js";
106
- import "../chunk-CDERSTBO.js";
104
+ import "../chunk-ZR2EPWW4.js";
105
+ import "../chunk-6W64IVG3.js";
106
+ import "../chunk-ADKWE35P.js";
107
+ import "../chunk-GLVPA4EK.js";
107
108
  import "../chunk-POFBE6ZY.js";
108
- import "../chunk-SFQSOBLM.js";
109
- import "../chunk-PWUIPQ2I.js";
110
- import "../chunk-6TYKZ4DN.js";
111
- import "../chunk-4A6VUVXV.js";
109
+ import "../chunk-6VFP72GX.js";
110
+ import "../chunk-KQDHOQRG.js";
111
+ import "../chunk-FY6ZTTDQ.js";
112
+ import "../chunk-VQZ4FP6Z.js";
112
113
  import "../chunk-7QLSKOSU.js";
113
114
  import {
114
115
  EXIT
@@ -149,14 +150,14 @@ import {
149
150
  restoreCodexHookTrust,
150
151
  vscodePluginDir,
151
152
  vscodePluginMcp
152
- } from "../chunk-IOVJVGIT.js";
153
+ } from "../chunk-MCL5IS6A.js";
153
154
  import "../chunk-AQFEP65J.js";
154
155
  import {
155
156
  getBaseUrl
156
- } from "../chunk-EWC4P4ZL.js";
157
+ } from "../chunk-PRQMACC7.js";
157
158
  import {
158
159
  NPX_LATEST_COMMAND
159
- } from "../chunk-57M4ERJK.js";
160
+ } from "../chunk-VE4LQ23C.js";
160
161
  import {
161
162
  CLI_PACKAGE_NAMES,
162
163
  HOOK_COMPATIBLE_PROFILES,
@@ -168,10 +169,10 @@ import {
168
169
  globalRootFor,
169
170
  isValidApiKey,
170
171
  redactSecrets
171
- } from "../chunk-K7EGWMDU.js";
172
+ } from "../chunk-DY5PQSQB.js";
172
173
 
173
174
  // bin/pushary-clean.ts
174
- import { existsSync as existsSync6, readFileSync as readFileSync4, copyFileSync, readdirSync as readdirSync4 } from "fs";
175
+ import { existsSync as existsSync6, readFileSync as readFileSync4, copyFileSync, readdirSync as readdirSync5 } from "fs";
175
176
  import { dirname, join as join6 } from "path";
176
177
  import { homedir as homedir5, tmpdir } from "os";
177
178
  import { confirm } from "@inquirer/prompts";
@@ -179,10 +180,11 @@ import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
179
180
 
180
181
  // src/cli/mac-leftovers.ts
181
182
  import { execSync, execFileSync } from "child_process";
182
- import { existsSync } from "fs";
183
+ import { existsSync, readdirSync } from "fs";
183
184
  import { homedir } from "os";
184
- import { join } from "path";
185
+ import { isAbsolute, join } from "path";
185
186
  var MAC_APP_BUNDLE = "/Applications/Pushary.app";
187
+ var MAC_APP_BUNDLE_ID = "com.pushary.app";
186
188
  var installedPusharyBundles = (home = homedir()) => [MAC_APP_BUNDLE, join(home, "Applications", "Pushary.app")];
187
189
  var LSREGISTER = "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";
188
190
  var TEST_DEFAULTS_PREFIXES = [
@@ -190,28 +192,45 @@ var TEST_DEFAULTS_PREFIXES = [
190
192
  "com.pushary.tests.",
191
193
  "pushary.tests.",
192
194
  "pushary.quiet-mode-test.",
193
- "pushary-optin-"
195
+ "pushary.drafts.test.",
196
+ "pushary-optin-",
197
+ "pushary-completion-test-",
198
+ "pushary-updates-only-"
194
199
  ];
195
- var isTestDefaultsDomain = (domain) => TEST_DEFAULTS_PREFIXES.some((prefix) => domain.startsWith(prefix));
196
- var leakedTestDefaultsDomains = () => {
200
+ var UUID = "[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}";
201
+ var UNPREFIXED_TEST_DEFAULTS_DOMAIN = new RegExp(`^(?:owner-mode|fx-model)-${UUID}$`);
202
+ var DEVELOPER_BUILD_DEFAULTS_DOMAIN = "PusharyMac";
203
+ var isDeveloperDefaultsDomain = (domain) => domain === DEVELOPER_BUILD_DEFAULTS_DOMAIN || UNPREFIXED_TEST_DEFAULTS_DOMAIN.test(domain) || TEST_DEFAULTS_PREFIXES.some((prefix) => domain.startsWith(prefix));
204
+ var PREFERENCES_FILE_EXTENSION = ".plist";
205
+ var preferencesDirectory = (home) => join(home, "Library", "Preferences");
206
+ var preferencesFile = (home, domain) => join(preferencesDirectory(home), `${domain}${PREFERENCES_FILE_EXTENSION}`);
207
+ var namesIn = (directory) => {
197
208
  try {
198
- return execSync("defaults domains", { encoding: "utf-8", timeout: 2e4 }).split(",").map((entry) => entry.trim()).filter(isTestDefaultsDomain).filter(liveMacStatePresence.defaultsDomain);
209
+ return readdirSync(directory);
199
210
  } catch {
200
211
  return [];
201
212
  }
202
213
  };
214
+ 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) }));
203
215
  var BUNDLE_NAME = "Pushary.app";
204
- var DUMP_PATH_LINE = /^\s*path:\s+(.+?)(?: \(0x[0-9a-f]+\))?\s*$/;
216
+ var DUMP_RECORD_SEPARATOR = /^-{20,}$/m;
217
+ var DUMP_PATH_LINES = /^[ \t]*path:[ \t]+(.+?)(?: \(0x[0-9a-f]+\))?[ \t]*$/gm;
218
+ var DUMP_IDENTIFIER_LINES = /^[ \t]*identifier:[ \t]+(\S+)/gm;
219
+ var capturedIn = (text, lines) => [...text.matchAll(lines)].flatMap((match) => match[1] === void 0 ? [] : [match[1]]);
220
+ var appCopyNamedByRecord = (record) => {
221
+ const paths = capturedIn(record, DUMP_PATH_LINES);
222
+ const identifiers = capturedIn(record, DUMP_IDENTIFIER_LINES);
223
+ const namesOneAppCopy = paths.length === 1 && identifiers.length === 1 && identifiers[0] === MAC_APP_BUNDLE_ID;
224
+ return namesOneAppCopy ? paths : [];
225
+ };
226
+ var isAtOrInside = (path, bundle) => path === bundle || path.startsWith(`${bundle}/`);
227
+ var isUnderBundleNamedPushary = (path) => path.split("/").includes(BUNDLE_NAME);
205
228
  var bundlesInLaunchServicesDump = (dump) => {
206
- const found = /* @__PURE__ */ new Set();
207
- for (const line of dump.split("\n")) {
208
- const path = DUMP_PATH_LINE.exec(line)?.[1];
209
- const bundle = path?.indexOf(`/${BUNDLE_NAME}`);
210
- if (path === void 0 || bundle === void 0 || bundle === -1) continue;
211
- found.add(path.slice(0, bundle + BUNDLE_NAME.length + 1));
212
- }
213
- return [...found];
229
+ const appCopies = dump.split(DUMP_RECORD_SEPARATOR).flatMap(appCopyNamedByRecord);
230
+ const isOurs = (path) => isUnderBundleNamedPushary(path) || appCopies.some((copy) => isAtOrInside(path, copy));
231
+ return [...new Set(capturedIn(dump, DUMP_PATH_LINES).filter(isOurs))];
214
232
  };
233
+ var outsideInstalledBundles = (registered, installed) => registered.filter((path) => !installed.some((bundle) => isAtOrInside(path, bundle)));
215
234
  var registeredPusharyBundles = (installed = installedPusharyBundles()) => {
216
235
  if (!existsSync(LSREGISTER)) return [];
217
236
  try {
@@ -220,7 +239,7 @@ var registeredPusharyBundles = (installed = installedPusharyBundles()) => {
220
239
  timeout: 6e4,
221
240
  maxBuffer: 256 * 1024 * 1024
222
241
  });
223
- return bundlesInLaunchServicesDump(dump).filter((path) => !installed.includes(path));
242
+ return outsideInstalledBundles(bundlesInLaunchServicesDump(dump), installed);
224
243
  } catch {
225
244
  return [];
226
245
  }
@@ -269,7 +288,35 @@ var macLibraryState = (home = homedir()) => [
269
288
  join(home, "Library", "Caches", "pushary-bridge"),
270
289
  join(home, "Library", "HTTPStorages", "com.pushary.app"),
271
290
  join(home, "Library", "HTTPStorages", "com.pushary.app.binarycookies"),
272
- join(home, "Library", "HTTPStorages", "pushary-bridge")
291
+ join(home, "Library", "HTTPStorages", "pushary-bridge"),
292
+ ...MAC_DEFAULTS_DOMAINS.map((domain) => preferencesFile(home, domain))
293
+ ];
294
+ var USER_CACHE_ENTRIES = [MAC_APP_BUNDLE_ID, "pushary-bridge", "PusharyBridge"];
295
+ var macUserCacheState = (reportedUserCacheDirectory) => {
296
+ const directory = reportedUserCacheDirectory.trim();
297
+ return isAbsolute(directory) ? USER_CACHE_ENTRIES.map((entry) => join(directory, entry)) : [];
298
+ };
299
+ var UNKNOWN_USER_CACHE_DIRECTORY = "";
300
+ var reportedDarwinUserCacheDirectory = () => {
301
+ try {
302
+ return execFileSync("getconf", ["DARWIN_USER_CACHE_DIR"], {
303
+ encoding: "utf-8",
304
+ timeout: PRESENCE_PROBE_TIMEOUT_MS,
305
+ stdio: ["ignore", "pipe", "ignore"]
306
+ });
307
+ } catch {
308
+ return UNKNOWN_USER_CACHE_DIRECTORY;
309
+ }
310
+ };
311
+ var CRASH_REPORTER_ENTRY = new RegExp(`^(?:Pushary|PusharyMac|pushary-bridge)_${UUID}\\.plist$`);
312
+ var crashReporterEntries = (home = homedir()) => {
313
+ const directory = join(home, "Library", "Application Support", "CrashReporter");
314
+ return namesIn(directory).filter((name) => CRASH_REPORTER_ENTRY.test(name)).map((name) => join(directory, name));
315
+ };
316
+ var storedMacAppState = (home = homedir()) => [
317
+ ...macLibraryState(home),
318
+ ...macUserCacheState(reportedDarwinUserCacheDirectory()),
319
+ ...crashReporterEntries(home)
273
320
  ];
274
321
  var DUMP_SERVICE_LINE = /^\s*"svce"<blob>="(.+)"\s*$/;
275
322
  var pusharyKeychainServices = (dump) => {
@@ -290,7 +337,6 @@ var storedPusharyKeychainServices = () => {
290
337
  const stored = pusharyKeychainServices(dump);
291
338
  return stored.includes(MAC_KEYCHAIN_SERVICE) ? stored : [MAC_KEYCHAIN_SERVICE, ...stored];
292
339
  };
293
- var MAC_APP_BUNDLE_ID = "com.pushary.app";
294
340
  var runningMacAppPIDs = () => {
295
341
  if (process.platform !== "darwin") return [];
296
342
  try {
@@ -314,17 +360,26 @@ var waitForMacAppExit = (attempts = 20, everyMs = 250) => {
314
360
 
315
361
  // src/cli/clean-mac.ts
316
362
  import { existsSync as existsSync2 } from "fs";
317
- var removeDeveloperLeftovers = (guards2, domains, bundles) => {
363
+ var deleteDefaultsDomain = (guards2, domain) => {
364
+ try {
365
+ guards2.execFile("defaults", ["delete", domain], { stdio: "ignore", timeout: 1e4 }, `delete preferences ${domain}`);
366
+ return true;
367
+ } catch {
368
+ return false;
369
+ }
370
+ };
371
+ var removeDeveloperLeftovers = (guards2, leftovers) => {
318
372
  let removed = 0;
319
- for (const domain of domains) {
373
+ for (const stored of leftovers.defaults) {
374
+ deleteDefaultsDomain(guards2, stored.domain);
320
375
  try {
321
- guards2.execFile("defaults", ["delete", domain], { stdio: "ignore", timeout: 1e4 }, `delete preferences ${domain}`);
376
+ guards2.remove(stored.file, { force: true });
322
377
  removed++;
323
378
  } catch {
324
379
  continue;
325
380
  }
326
381
  }
327
- for (const bundle of bundles) {
382
+ for (const bundle of leftovers.registrations) {
328
383
  try {
329
384
  guards2.execFile(LSREGISTER, ["-u", bundle], { stdio: "ignore", timeout: 2e4 }, `unregister ${bundle}`);
330
385
  removed++;
@@ -334,14 +389,16 @@ var removeDeveloperLeftovers = (guards2, domains, bundles) => {
334
389
  }
335
390
  return removed;
336
391
  };
337
- var removeMacAppState = (guards2, readServices, home, present) => {
392
+ var NO_MAC_APP_STATE = { removed: 0, failed: 0, unremovable: [] };
393
+ var removeMacAppState = (guards2, readServices, statePaths, present) => {
338
394
  let removed = 0;
339
395
  let failed = 0;
396
+ const unremovable = [];
340
397
  let services;
341
398
  try {
342
399
  services = readServices();
343
400
  } catch {
344
- return { removed, failed: 1 };
401
+ return { removed, failed: 1, unremovable };
345
402
  }
346
403
  for (const service of services) {
347
404
  for (const account of MAC_KEYCHAIN_ACCOUNTS.filter((account2) => present.keychainItem(service, account2))) {
@@ -359,19 +416,18 @@ var removeMacAppState = (guards2, readServices, home, present) => {
359
416
  }
360
417
  }
361
418
  for (const domain of MAC_DEFAULTS_DOMAINS.filter(present.defaultsDomain)) {
419
+ if (deleteDefaultsDomain(guards2, domain)) removed++;
420
+ }
421
+ for (const path of statePaths) {
422
+ if (!existsSync2(path)) continue;
362
423
  try {
363
- guards2.execFile("defaults", ["delete", domain], { stdio: "ignore", timeout: 1e4 }, `delete preferences ${domain}`);
424
+ guards2.remove(path, { force: true });
364
425
  removed++;
365
426
  } catch {
366
- continue;
427
+ unremovable.push(path);
367
428
  }
368
429
  }
369
- for (const path of macLibraryState(home)) {
370
- if (!existsSync2(path)) continue;
371
- guards2.remove(path, { force: true });
372
- removed++;
373
- }
374
- return { removed, failed };
430
+ return { removed, failed, unremovable };
375
431
  };
376
432
  var quitMacApp = (guards2, state) => {
377
433
  if (state.platform !== "darwin" || state.running().length === 0) return "not-running";
@@ -388,7 +444,7 @@ var quitMacApp = (guards2, state) => {
388
444
  };
389
445
 
390
446
  // src/cli/editor-extension.ts
391
- import { existsSync as existsSync3, readFileSync, readdirSync } from "fs";
447
+ import { existsSync as existsSync3, readFileSync, readdirSync as readdirSync2 } from "fs";
392
448
  import { homedir as homedir2 } from "os";
393
449
  import { join as join2 } from "path";
394
450
  var EDITOR_EXTENSION_ID = "pushary.pushary";
@@ -416,7 +472,7 @@ var recordWithoutUs = (directory) => {
416
472
  }
417
473
  };
418
474
  var editorExtensionRemovals = (home = homedir2()) => EDITOR_EXTENSION_DIRS.map((relative) => join2(home, relative)).filter(existsSync3).map((directory) => {
419
- const folders = readdirSync(directory).filter((name) => name.startsWith(`${EDITOR_EXTENSION_ID}-`)).map((name) => join2(directory, name));
475
+ const folders = readdirSync2(directory).filter((name) => name.startsWith(`${EDITOR_EXTENSION_ID}-`)).map((name) => join2(directory, name));
420
476
  return { directory, folders, record: recordWithoutUs(directory) };
421
477
  }).filter((removal) => removal.folders.length > 0 || removal.record !== void 0);
422
478
 
@@ -452,14 +508,14 @@ var skillsStoreRemoval = (home = homedir3()) => {
452
508
  };
453
509
 
454
510
  // src/cli/claude-backups.ts
455
- import { existsSync as existsSync5, readFileSync as readFileSync3, readdirSync as readdirSync2 } from "fs";
511
+ import { existsSync as existsSync5, readFileSync as readFileSync3, readdirSync as readdirSync3 } from "fs";
456
512
  import { homedir as homedir4 } from "os";
457
513
  import { join as join4 } from "path";
458
514
  var BACKUP_PREFIX = ".claude.json.backup";
459
515
  var claudeJsonBackups = (home = homedir4()) => {
460
516
  const rollingDir = join4(home, ".claude", "backups");
461
517
  const legacy = join4(home, BACKUP_PREFIX);
462
- const rolling = existsSync5(rollingDir) ? readdirSync2(rollingDir).filter((name) => name.startsWith(BACKUP_PREFIX)).sort().map((name) => join4(rollingDir, name)) : [];
518
+ const rolling = existsSync5(rollingDir) ? readdirSync3(rollingDir).filter((name) => name.startsWith(BACKUP_PREFIX)).sort().map((name) => join4(rollingDir, name)) : [];
463
519
  return existsSync5(legacy) ? [...rolling, legacy] : rolling;
464
520
  };
465
521
  var parsed = (path) => {
@@ -516,7 +572,7 @@ var removeGlobalCliPackages = (guards2, request) => {
516
572
  };
517
573
 
518
574
  // src/cli/config-temp-leftovers.ts
519
- import { lstatSync, readdirSync as readdirSync3 } from "fs";
575
+ import { lstatSync, readdirSync as readdirSync4 } from "fs";
520
576
  import { join as join5 } from "path";
521
577
  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}$/;
522
578
  var PID_STAMPED_WRITE_TEMP = /^\.\d+-[^/]+\.pushary-tmp$/;
@@ -525,7 +581,7 @@ var isLeakedConfigTempName = (name) => MAC_APP_WRITE_TEMP.test(name) || PID_STAM
525
581
  var leakedConfigTemps = (entries, nowMs) => entries.filter((entry) => entry.isFile && isLeakedConfigTempName(entry.name) && nowMs - entry.modifiedAtMs >= CONFIG_TEMP_MIN_AGE_MS).map((entry) => entry.name);
526
582
  var directoryEntries = (directory) => {
527
583
  try {
528
- return readdirSync3(directory).flatMap((name) => {
584
+ return readdirSync4(directory).flatMap((name) => {
529
585
  const stats = lstatSync(join5(directory, name), { throwIfNoEntry: false });
530
586
  return stats ? [{ name, isFile: stats.isFile(), modifiedAtMs: stats.mtimeMs }] : [];
531
587
  });
@@ -587,7 +643,12 @@ var cleanCompatibleAgent = (profile, scope, io, home) => {
587
643
  const document = readConfigDocument(path, file.format, io.files);
588
644
  if (document.kind === "missing") return [{ path, outcome: "not_found" }];
589
645
  if (document.kind === "unreadable") return [{ path, outcome: "unreadable" }];
590
- if (!edits.reduce((changed, remove) => remove(document.value) || changed, false)) return [{ path, outcome: "unchanged" }];
646
+ const hadPusharyEntries = edits.reduce((changed, remove) => remove(document.value) || changed, false);
647
+ if (isEmptiedPusharyOwnedDocument(file, document.value)) {
648
+ io.files.remove(path);
649
+ return [{ path, outcome: "removed" }];
650
+ }
651
+ if (!hadPusharyEntries) return [{ path, outcome: "unchanged" }];
591
652
  io.files.write(path, serializeConfigDocument(document.value, file.format));
592
653
  return [{ path, outcome: "cleaned" }];
593
654
  });
@@ -666,7 +727,7 @@ var guardedRemove = (path, options) => guards.remove(path, options);
666
727
  var cursorPluginLeftovers = () => {
667
728
  const parent = dirname(CURSOR_PLUGIN_DIR);
668
729
  try {
669
- return readdirSync4(parent).filter(isCursorPluginLeftover).map((name) => join6(parent, name));
730
+ return readdirSync5(parent).filter(isCursorPluginLeftover).map((name) => join6(parent, name));
670
731
  } catch {
671
732
  return [];
672
733
  }
@@ -1114,6 +1175,7 @@ var main = async () => {
1114
1175
  if (file.outcome === "not_found") console.log(` ${skip} ${label2} ${dim("(not found)")}`);
1115
1176
  else if (file.outcome === "unreadable") console.log(` ${skip} ${label2} ${yellow("(could not read configuration; left unchanged)")}`);
1116
1177
  else if (file.outcome === "cleaned") console.log(` ${check} ${label2} ${dim(did("cleaned"))}`);
1178
+ else if (file.outcome === "removed") console.log(` ${check} ${label2} ${dim(did("removed"))}`);
1117
1179
  else console.log(` ${skip} ${label2} ${dim(keepShared ? "(nothing the CLI wrote)" : "(no pushary entries)")}`);
1118
1180
  }
1119
1181
  if (report.mcpKeptForApp) console.log(` ${skip} ${profile.label} MCP server ${dim("(kept: the Mac app uses it)")}`);
@@ -1161,7 +1223,7 @@ var main = async () => {
1161
1223
  const sibling = join6(openCodePluginDir(), OPENCODE_PLUGIN_SIBLING);
1162
1224
  const remaining = (() => {
1163
1225
  try {
1164
- return readdirSync4(openCodePluginDir()).filter((name) => name !== OPENCODE_PLUGIN_SIBLING);
1226
+ return readdirSync5(openCodePluginDir()).filter((name) => name !== OPENCODE_PLUGIN_SIBLING);
1165
1227
  } catch {
1166
1228
  return [];
1167
1229
  }
@@ -1271,7 +1333,7 @@ var main = async () => {
1271
1333
  if (existsSync6(PUSHARY_DIR)) {
1272
1334
  let removed = 0;
1273
1335
  const kept = [];
1274
- for (const entry of readdirSync4(PUSHARY_DIR)) {
1336
+ for (const entry of readdirSync5(PUSHARY_DIR)) {
1275
1337
  if (keepShared && isAppOwned(entry) || entry === "setup" && (keepShared || incompleteClean)) {
1276
1338
  kept.push(entry);
1277
1339
  continue;
@@ -1293,7 +1355,7 @@ var main = async () => {
1293
1355
  }
1294
1356
  try {
1295
1357
  let swept = 0;
1296
- for (const f of readdirSync4(tmpdir())) {
1358
+ for (const f of readdirSync5(tmpdir())) {
1297
1359
  if (!f.startsWith("pushary-")) continue;
1298
1360
  try {
1299
1361
  guardedRemove(join6(tmpdir(), f), { force: true });
@@ -1311,18 +1373,22 @@ var main = async () => {
1311
1373
  if (store.skillDir || store.lock) {
1312
1374
  console.log(` ${check} skills.sh registration ${dim(did("removed"))} ${dim("(~/.agents)")}`);
1313
1375
  }
1314
- const leftovers = process.platform === "darwin" ? removeDeveloperLeftovers(guards, leakedTestDefaultsDomains(), registeredPusharyBundles()) : 0;
1376
+ const leftovers = process.platform === "darwin" ? removeDeveloperLeftovers(guards, { defaults: developerDefaults(), registrations: registeredPusharyBundles() }) : 0;
1315
1377
  if (leftovers > 0) {
1316
1378
  console.log(` ${check} Developer leftovers ${dim(did("removed"))} ${dim(`(${leftovers} leaked test preferences and stale app registrations)`)}`);
1317
1379
  }
1318
- const { removed, failed } = process.platform === "darwin" ? removeMacAppState(guards, storedPusharyKeychainServices, homedir5(), liveMacStatePresence) : { removed: 0, failed: 0 };
1380
+ const { removed, failed, unremovable } = process.platform === "darwin" ? removeMacAppState(guards, storedPusharyKeychainServices, storedMacAppState(), liveMacStatePresence) : NO_MAC_APP_STATE;
1319
1381
  if (failed > 0) {
1320
1382
  incompleteClean = true;
1321
1383
  console.log(` ${cross} Mac keychain ${dim(`(${failed} operations failed; unlock your keychain and re-run)`)}`);
1322
1384
  }
1385
+ if (unremovable.length > 0) {
1386
+ incompleteClean = true;
1387
+ console.log(` ${cross} Mac app state ${dim(`(could not remove ${unremovable.map((path) => shortenHome(path)).join(", ")})`)}`);
1388
+ }
1323
1389
  if (removed > 0) {
1324
1390
  console.log(` ${check} Mac app state ${dim(did("removed"))} ${dim(`(${removed} across the keychain, preferences and caches)`)}`);
1325
- } else if (failed === 0) {
1391
+ } else if (failed === 0 && unremovable.length === 0) {
1326
1392
  console.log(` ${skip} Mac app state ${dim("(nothing of ours in the keychain, preferences or caches)")}`);
1327
1393
  }
1328
1394
  }
@@ -1,42 +1,42 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  transcriptsEnabled
4
- } from "../chunk-7SGYCU5C.js";
5
- import "../chunk-YK7FGPYS.js";
4
+ } from "../chunk-4MJ46JA7.js";
5
+ import "../chunk-S3657KK2.js";
6
6
  import {
7
7
  runCodexBridge
8
- } from "../chunk-6JPDAUFP.js";
9
- import "../chunk-EKGQEDQ4.js";
8
+ } from "../chunk-WHHNQA4C.js";
9
+ import "../chunk-UIPZSSBC.js";
10
10
  import {
11
11
  resolveProviderBinary
12
- } from "../chunk-WPPKXVV3.js";
12
+ } from "../chunk-M47U54AO.js";
13
13
  import "../chunk-RIVNNBEK.js";
14
14
  import {
15
15
  withSpawnProcessOwnership
16
- } from "../chunk-H4ODQD3Y.js";
17
- import "../chunk-SIN7NJD7.js";
18
- import "../chunk-RFQWB5ZV.js";
16
+ } from "../chunk-P4RKBBHE.js";
17
+ import "../chunk-DRQVZHWE.js";
18
+ import "../chunk-T3QKLW3M.js";
19
19
  import "../chunk-XHKBHWLX.js";
20
20
  import "../chunk-6ICPEJY5.js";
21
- import "../chunk-CFMCV6Z7.js";
22
- import "../chunk-CDERSTBO.js";
21
+ import "../chunk-ADKWE35P.js";
22
+ import "../chunk-GLVPA4EK.js";
23
23
  import "../chunk-POFBE6ZY.js";
24
- import "../chunk-SFQSOBLM.js";
25
- import "../chunk-PWUIPQ2I.js";
26
- import "../chunk-6TYKZ4DN.js";
24
+ import "../chunk-6VFP72GX.js";
25
+ import "../chunk-KQDHOQRG.js";
26
+ import "../chunk-FY6ZTTDQ.js";
27
27
  import {
28
28
  getMachineId
29
- } from "../chunk-4A6VUVXV.js";
29
+ } from "../chunk-VQZ4FP6Z.js";
30
30
  import "../chunk-7QLSKOSU.js";
31
31
  import "../chunk-KZERVKTD.js";
32
- import "../chunk-IOVJVGIT.js";
32
+ import "../chunk-MCL5IS6A.js";
33
33
  import "../chunk-AQFEP65J.js";
34
34
  import {
35
35
  getApiKey,
36
36
  getBaseUrl
37
- } from "../chunk-EWC4P4ZL.js";
38
- import "../chunk-57M4ERJK.js";
39
- import "../chunk-K7EGWMDU.js";
37
+ } from "../chunk-PRQMACC7.js";
38
+ import "../chunk-VE4LQ23C.js";
39
+ import "../chunk-DY5PQSQB.js";
40
40
 
41
41
  // bin/pushary-codex-bridge.ts
42
42
  import { existsSync } from "fs";
@@ -1,39 +1,39 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  takeHookHoldBudget
4
- } from "../chunk-7URSJMAB.js";
4
+ } from "../chunk-MM472M4O.js";
5
5
  import {
6
6
  askAgentQuestions,
7
7
  defersToNativeMode,
8
8
  reportMachineDenial
9
- } from "../chunk-IKYI63RF.js";
9
+ } from "../chunk-YCKGZOKV.js";
10
10
  import {
11
11
  isGatingMoment,
12
12
  recordKeylessMoment
13
- } from "../chunk-46F4BRUQ.js";
13
+ } from "../chunk-LFMC5AE2.js";
14
14
  import {
15
15
  triggerAutoUpdate
16
- } from "../chunk-IFT3GU7Y.js";
16
+ } from "../chunk-YENJWLN4.js";
17
17
  import {
18
18
  readHookInput
19
- } from "../chunk-EH5ZDG6V.js";
19
+ } from "../chunk-MZQ5M6F6.js";
20
20
  import {
21
21
  announceSubscriptionRequired,
22
22
  isDeferAnswer
23
- } from "../chunk-ECFEYB6Z.js";
24
- import "../chunk-3PM62C2R.js";
23
+ } from "../chunk-R7AMICLS.js";
24
+ import "../chunk-CVCOZWSB.js";
25
25
  import "../chunk-DWQYCOPI.js";
26
- import "../chunk-RBJWPUI6.js";
27
- import "../chunk-AUOSFZJ3.js";
28
- import "../chunk-ASK2MSD2.js";
29
- import "../chunk-5DCZL3BC.js";
30
- import "../chunk-OHFC3GJY.js";
31
- import "../chunk-U45OINYS.js";
26
+ import "../chunk-TP5SLM2I.js";
27
+ import "../chunk-RDVDW3WK.js";
28
+ import "../chunk-FDDZEYGM.js";
29
+ import "../chunk-PHKISQPB.js";
30
+ import "../chunk-3KSN65VJ.js";
31
+ import "../chunk-DDS472RO.js";
32
32
  import "../chunk-GMXKITVA.js";
33
- import "../chunk-7SGYCU5C.js";
34
- import "../chunk-YK7FGPYS.js";
35
- import "../chunk-SIN7NJD7.js";
36
- import "../chunk-RFQWB5ZV.js";
33
+ import "../chunk-4MJ46JA7.js";
34
+ import "../chunk-S3657KK2.js";
35
+ import "../chunk-DRQVZHWE.js";
36
+ import "../chunk-T3QKLW3M.js";
37
37
  import "../chunk-XHKBHWLX.js";
38
38
  import "../chunk-6ICPEJY5.js";
39
39
  import {
@@ -78,9 +78,9 @@ import {
78
78
  toPolicyLookup,
79
79
  toPolicyLookups,
80
80
  userScope
81
- } from "../chunk-GZSSAY6N.js";
82
- import "../chunk-HHX6IRSH.js";
83
- import "../chunk-CFMCV6Z7.js";
81
+ } from "../chunk-ZR2EPWW4.js";
82
+ import "../chunk-6W64IVG3.js";
83
+ import "../chunk-ADKWE35P.js";
84
84
  import {
85
85
  askUser,
86
86
  cancelQuestion,
@@ -95,30 +95,30 @@ import {
95
95
  sendNotification,
96
96
  unavailableQuestionUnlessSubscriptionRequired,
97
97
  waitForQuestion
98
- } from "../chunk-CDERSTBO.js";
98
+ } from "../chunk-GLVPA4EK.js";
99
99
  import "../chunk-POFBE6ZY.js";
100
100
  import {
101
101
  SubscriptionRequiredError
102
- } from "../chunk-SFQSOBLM.js";
103
- import "../chunk-PWUIPQ2I.js";
104
- import "../chunk-6TYKZ4DN.js";
102
+ } from "../chunk-6VFP72GX.js";
103
+ import "../chunk-KQDHOQRG.js";
104
+ import "../chunk-FY6ZTTDQ.js";
105
105
  import {
106
106
  getMachineId
107
- } from "../chunk-4A6VUVXV.js";
107
+ } from "../chunk-VQZ4FP6Z.js";
108
108
  import "../chunk-7QLSKOSU.js";
109
109
  import {
110
110
  EXIT
111
111
  } from "../chunk-KZERVKTD.js";
112
112
  import {
113
113
  canonicalJson
114
- } from "../chunk-IOVJVGIT.js";
114
+ } from "../chunk-MCL5IS6A.js";
115
115
  import {
116
116
  writeFileAtomic
117
117
  } from "../chunk-AQFEP65J.js";
118
118
  import {
119
119
  getApiKey
120
- } from "../chunk-EWC4P4ZL.js";
121
- import "../chunk-57M4ERJK.js";
120
+ } from "../chunk-PRQMACC7.js";
121
+ import "../chunk-VE4LQ23C.js";
122
122
  import {
123
123
  CODEX_RESCUE_TOOL_NAME,
124
124
  DECISION_STOP_REASON,
@@ -146,7 +146,7 @@ import {
146
146
  resolveGate,
147
147
  scopeBreachReasonOf,
148
148
  unapprovedScopeReason
149
- } from "../chunk-K7EGWMDU.js";
149
+ } from "../chunk-DY5PQSQB.js";
150
150
 
151
151
  // bin/pushary-codex-hook.ts
152
152
  import { basename } from "path";
@@ -795,7 +795,7 @@ var decidePreToolUse = async (input) => {
795
795
  };
796
796
  var repairCodexHoldsQuietly = async () => {
797
797
  try {
798
- const { repairCodexHolds } = await import("../reapply-LILGWJO3.js");
798
+ const { repairCodexHolds } = await import("../reapply-Y2EXWAWE.js");
799
799
  repairCodexHolds();
800
800
  } catch {
801
801
  return;