@pushary/agent-hooks 1.9.9 → 1.9.10

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 (94) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/bin/pushary-bell-hook.js +17 -17
  3. package/dist/bin/pushary-bell.js +8 -8
  4. package/dist/bin/pushary-claude.js +20 -20
  5. package/dist/bin/pushary-clean.js +100 -24
  6. package/dist/bin/pushary-codex-bridge.js +16 -16
  7. package/dist/bin/pushary-codex-hook.js +23 -23
  8. package/dist/bin/pushary-codex.js +11 -11
  9. package/dist/bin/pushary-connect.js +24 -24
  10. package/dist/bin/pushary-cowork.js +3 -3
  11. package/dist/bin/pushary-daemon.js +28 -28
  12. package/dist/bin/pushary-disconnect.js +22 -22
  13. package/dist/bin/pushary-doctor.js +51 -39
  14. package/dist/bin/pushary-elicitation-hook.js +19 -19
  15. package/dist/bin/pushary-gemini-bridge.js +11 -11
  16. package/dist/bin/pushary-gemini-hook.js +21 -21
  17. package/dist/bin/pushary-hook.js +24 -24
  18. package/dist/bin/pushary-login.js +11 -11
  19. package/dist/bin/pushary-logout.js +17 -77
  20. package/dist/bin/pushary-mcp.js +8 -8
  21. package/dist/bin/pushary-mode.js +11 -11
  22. package/dist/bin/pushary-notification-hook.js +21 -21
  23. package/dist/bin/pushary-opencode-hook.js +20 -20
  24. package/dist/bin/pushary-permission-denied-hook.js +23 -23
  25. package/dist/bin/pushary-permission-hook.js +23 -23
  26. package/dist/bin/pushary-post-hook.js +21 -21
  27. package/dist/bin/pushary-prompt-hook.js +21 -21
  28. package/dist/bin/pushary-session-end-hook.js +21 -21
  29. package/dist/bin/pushary-session-start-hook.js +25 -25
  30. package/dist/bin/pushary-setup.js +48 -35
  31. package/dist/bin/pushary-stats.js +3 -3
  32. package/dist/bin/pushary-status.js +27 -27
  33. package/dist/bin/pushary-stop-hook.js +21 -21
  34. package/dist/bin/pushary-stopfailure-hook.js +21 -21
  35. package/dist/bin/pushary-suggestions.js +11 -11
  36. package/dist/bin/pushary-transcript-register.js +13 -13
  37. package/dist/bin/pushary-transcripts.js +6 -6
  38. package/dist/bin/pushary-upgrade.js +28 -28
  39. package/dist/bin/pushary-wait.js +11 -11
  40. package/dist/bin/pushary.js +5 -5
  41. package/dist/{chunk-TO3PS646.js → chunk-2HFSKYLN.js} +1 -1
  42. package/dist/{chunk-6W5M3MSE.js → chunk-2HXG2QDI.js} +4 -4
  43. package/dist/{chunk-IRHABAQT.js → chunk-2M52CFVO.js} +1 -1
  44. package/dist/{chunk-NUVGDBZC.js → chunk-2S34OPHS.js} +1 -1
  45. package/dist/{chunk-AI7RMFVV.js → chunk-5MQYA3YL.js} +8 -8
  46. package/dist/{chunk-DCCSULXK.js → chunk-6KNC6KLL.js} +3 -3
  47. package/dist/{chunk-UF6RBP5V.js → chunk-7HGR5GNY.js} +3 -3
  48. package/dist/{chunk-HBWYMRR5.js → chunk-AKPHYSEL.js} +5 -4
  49. package/dist/{chunk-E5HOHIUV.js → chunk-BOSXFI7L.js} +3 -3
  50. package/dist/{chunk-RQ32ADJP.js → chunk-BTFUSQFB.js} +1 -1
  51. package/dist/{chunk-QTIUJZRX.js → chunk-BVPPYR7B.js} +1 -1
  52. package/dist/{chunk-LENBKYRB.js → chunk-BVSIM4EF.js} +2 -2
  53. package/dist/{chunk-EIAEUG7G.js → chunk-C6QTMWJZ.js} +1 -1
  54. package/dist/{chunk-B5NMSP3V.js → chunk-CJYM4ZHV.js} +1 -1
  55. package/dist/{chunk-DP3WX7FW.js → chunk-DAOQT4WK.js} +2 -2
  56. package/dist/{chunk-AZOKPWVI.js → chunk-DL6QHS7V.js} +1 -1
  57. package/dist/{chunk-COQ64C4F.js → chunk-DWO4RLYK.js} +7 -7
  58. package/dist/{chunk-F7R3SZ4Q.js → chunk-EVC765EO.js} +1 -1
  59. package/dist/{chunk-MLGIVVSG.js → chunk-GQYX24UC.js} +1 -1
  60. package/dist/{chunk-REU2VQPH.js → chunk-GTZ4HIHU.js} +15 -13
  61. package/dist/{chunk-KOWFRUIT.js → chunk-H4F5O3RE.js} +1 -1
  62. package/dist/{chunk-6AYSKVLL.js → chunk-I3W7GJ5R.js} +3 -3
  63. package/dist/{chunk-KQFTBQ66.js → chunk-LDQGURCF.js} +7 -7
  64. package/dist/{chunk-Q6C6ILUS.js → chunk-LXA236ZQ.js} +2 -2
  65. package/dist/{chunk-462EQA6K.js → chunk-MISUKJGW.js} +1 -1
  66. package/dist/{chunk-UPIZSCYD.js → chunk-NQ67AF3V.js} +3 -3
  67. package/dist/{chunk-H5T27W7M.js → chunk-OL2Z7WI4.js} +2 -2
  68. package/dist/{chunk-6EBGOHDJ.js → chunk-PNC5ZQFS.js} +6 -6
  69. package/dist/{chunk-M3STIAGU.js → chunk-PR2VDVCP.js} +1 -1
  70. package/dist/{chunk-BNSKVIAW.js → chunk-Q3UMWSE4.js} +1 -1
  71. package/dist/{chunk-BZLHTMT6.js → chunk-QAGWWDXQ.js} +11 -9
  72. package/dist/{chunk-VIIHC42X.js → chunk-QGRENWJL.js} +1 -1
  73. package/dist/{chunk-SZ4Q6ZVS.js → chunk-RPQLZLKC.js} +4 -4
  74. package/dist/{chunk-UAP5DS6P.js → chunk-S2DAKKQQ.js} +2 -2
  75. package/dist/chunk-SB2GN6OP.js +71 -0
  76. package/dist/{chunk-BYLKCZ2G.js → chunk-SIHYBIEN.js} +12 -12
  77. package/dist/{chunk-VHPFNLRS.js → chunk-SJDMULE7.js} +4 -4
  78. package/dist/{chunk-G7RIDXAT.js → chunk-SMVMLWCD.js} +1 -1
  79. package/dist/{chunk-5DCDQ5VW.js → chunk-TCXL5FQQ.js} +1 -1
  80. package/dist/{chunk-K545B734.js → chunk-U5FP5JIS.js} +1 -1
  81. package/dist/{chunk-Z23ZBYDW.js → chunk-UJZ7AGSC.js} +3 -3
  82. package/dist/{chunk-5N5L6DNN.js → chunk-UM5WXBKN.js} +2 -2
  83. package/dist/{chunk-QIOIO7VN.js → chunk-XKMGHVXW.js} +5 -5
  84. package/dist/{chunk-QRXPWW3M.js → chunk-XXLCYKVS.js} +2 -2
  85. package/dist/{chunk-NGKUXZID.js → chunk-Y7JM47CI.js} +1 -1
  86. package/dist/{chunk-OAYWO5NP.js → chunk-YUQHUGTH.js} +1 -1
  87. package/dist/{chunk-R5RIVOPL.js → chunk-Z2Q2VH43.js} +2 -2
  88. package/dist/{chunk-WRPYCIV2.js → chunk-ZSGJYSF2.js} +4 -4
  89. package/dist/{global-upgrade-H272QOGD.js → global-upgrade-PUM44JUH.js} +5 -5
  90. package/dist/{paths-HMVOTFUN.js → paths-U2MJGNBT.js} +1 -1
  91. package/dist/{reapply-Q5NHDTVU.js → reapply-PRKV4EO7.js} +18 -18
  92. package/dist/src/index.js +16 -16
  93. package/dist/{upgrade-lock-L3GHFIRW.js → upgrade-lock-QZSVLEM7.js} +2 -2
  94. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.10
4
+
5
+ - `pushary setup` no longer reports Qwen Code, CodeBuddy, Qoder, Droid and Devin as an account mismatch when the Pushary Mac app connected them and the CLI's key is in the same account. Setup compares the account of the key in their MCP entry for Qwen Code, CodeBuddy and Qoder, and the account of the Mac app's own key for Droid and Devin, whose hooks run through the app. They are kept and listed as kept for the Mac app. If the app is in a different account, setup reports it and changes nothing. The CLI does not copy or save the app's key.
6
+ - `pushary doctor` no longer fails "Global package installed" on a computer the Pushary Mac app connects, for example when run with npx. The app runs the hooks there, so doctor prints that the global package is not installed and not needed. It still fails when the CLI has its own key or owns any agent's hooks, because those hooks run the global package.
7
+ - `pushary clean --everything` revokes the keys the CLI wrote on pushary.com before removing them: the key in `~/.pushary/config.json`, and a different key in the `export PUSHARY_API_KEY=...` line setup writes to your shell profile. It says whether each key was revoked. A key that is only in the `PUSHARY_API_KEY` environment variable is left alone and named, because Pushary did not write it and it may be a server key you use elsewhere. If pushary.com cannot be reached, the clean still finishes and tells you where to revoke the key. `--dry-run` revokes nothing and lists the keys it would revoke. The Mac app's key is never revoked, and a plain `clean`, `disconnect` and `sign-out` without `--revoke` behave as before.
8
+ - `pushary setup --take-over-hooks` takes over Droid's hooks from the Pushary Mac app. It used to fail with "no Mac app wiring was found", because Droid keeps its hooks at the top of `~/.factory/hooks.json`.
9
+
3
10
  ## 1.9.9
4
11
 
5
12
  - The VS Code hooks setup writes now run the gate through the same shell guard as every other agent. Before, a missing Node or a deleted plugin folder made the VS Code hooks fail on every tool call; now they stay silent and VS Code carries on as if Pushary were not installed. Run setup again for VS Code to get the guarded hooks.
@@ -1,36 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handleBell
4
- } from "../chunk-G7RIDXAT.js";
4
+ } from "../chunk-SMVMLWCD.js";
5
5
  import {
6
6
  readHookInput
7
- } from "../chunk-R5RIVOPL.js";
8
- import "../chunk-COQ64C4F.js";
7
+ } from "../chunk-Z2Q2VH43.js";
8
+ import "../chunk-DWO4RLYK.js";
9
9
  import "../chunk-SGZJ5LYH.js";
10
- import "../chunk-SZ4Q6ZVS.js";
10
+ import "../chunk-RPQLZLKC.js";
11
11
  import "../chunk-APP43AW7.js";
12
- import "../chunk-462EQA6K.js";
13
- import "../chunk-VIIHC42X.js";
12
+ import "../chunk-MISUKJGW.js";
13
+ import "../chunk-QGRENWJL.js";
14
14
  import "../chunk-XHKBHWLX.js";
15
- import "../chunk-BYLKCZ2G.js";
16
- import "../chunk-M3STIAGU.js";
15
+ import "../chunk-SIHYBIEN.js";
16
+ import "../chunk-PR2VDVCP.js";
17
17
  import "../chunk-ZGADIZDS.js";
18
- import "../chunk-MLGIVVSG.js";
18
+ import "../chunk-GQYX24UC.js";
19
19
  import "../chunk-GMXKITVA.js";
20
20
  import "../chunk-6ICPEJY5.js";
21
- import "../chunk-REU2VQPH.js";
21
+ import "../chunk-GTZ4HIHU.js";
22
22
  import "../chunk-MD4SVNT6.js";
23
- import "../chunk-UPIZSCYD.js";
23
+ import "../chunk-NQ67AF3V.js";
24
24
  import "../chunk-POFBE6ZY.js";
25
- import "../chunk-5N5L6DNN.js";
26
- import "../chunk-KOWFRUIT.js";
25
+ import "../chunk-UM5WXBKN.js";
26
+ import "../chunk-H4F5O3RE.js";
27
27
  import "../chunk-7QLSKOSU.js";
28
28
  import "../chunk-KZERVKTD.js";
29
- import "../chunk-BNSKVIAW.js";
30
- import "../chunk-Z23ZBYDW.js";
29
+ import "../chunk-Q3UMWSE4.js";
30
+ import "../chunk-UJZ7AGSC.js";
31
31
  import "../chunk-T7E75EKA.js";
32
- import "../chunk-IRHABAQT.js";
33
- import "../chunk-5DCDQ5VW.js";
32
+ import "../chunk-2M52CFVO.js";
33
+ import "../chunk-TCXL5FQQ.js";
34
34
  import "../chunk-5RGA636G.js";
35
35
 
36
36
  // bin/pushary-bell-hook.ts
@@ -5,36 +5,36 @@ import {
5
5
  liveAgentCount,
6
6
  ring,
7
7
  upgradeThreshold
8
- } from "../chunk-G7RIDXAT.js";
8
+ } from "../chunk-SMVMLWCD.js";
9
9
  import {
10
10
  createIo
11
11
  } from "../chunk-U4TMAANR.js";
12
12
  import {
13
13
  exitOnHelpFlag
14
- } from "../chunk-TO3PS646.js";
14
+ } from "../chunk-2HFSKYLN.js";
15
15
  import {
16
16
  addBellHooks,
17
17
  bellInstalled,
18
18
  removeBellHooks
19
- } from "../chunk-MLGIVVSG.js";
19
+ } from "../chunk-GQYX24UC.js";
20
20
  import {
21
21
  parseFlags
22
22
  } from "../chunk-GMXKITVA.js";
23
- import "../chunk-REU2VQPH.js";
23
+ import "../chunk-GTZ4HIHU.js";
24
24
  import "../chunk-7QLSKOSU.js";
25
25
  import {
26
26
  EXIT
27
27
  } from "../chunk-KZERVKTD.js";
28
- import "../chunk-BNSKVIAW.js";
28
+ import "../chunk-Q3UMWSE4.js";
29
29
  import {
30
30
  claudeSettings
31
- } from "../chunk-Z23ZBYDW.js";
31
+ } from "../chunk-UJZ7AGSC.js";
32
32
  import {
33
33
  readJsonSafe,
34
34
  writeJsonAtomic
35
35
  } from "../chunk-T7E75EKA.js";
36
- import "../chunk-IRHABAQT.js";
37
- import "../chunk-5DCDQ5VW.js";
36
+ import "../chunk-2M52CFVO.js";
37
+ import "../chunk-TCXL5FQQ.js";
38
38
  import "../chunk-5RGA636G.js";
39
39
 
40
40
  // bin/pushary-bell.ts
@@ -8,7 +8,7 @@ import {
8
8
  describeIdleWindow,
9
9
  startProcessOwnership,
10
10
  withSpawnProcessOwnership
11
- } from "../chunk-NUVGDBZC.js";
11
+ } from "../chunk-2S34OPHS.js";
12
12
  import {
13
13
  announceSubscriptionRequired,
14
14
  isDeferAnswer
@@ -18,29 +18,29 @@ import {
18
18
  loadSessionKey,
19
19
  registerTranscript,
20
20
  registeredTranscriptEnabled
21
- } from "../chunk-COQ64C4F.js";
21
+ } from "../chunk-DWO4RLYK.js";
22
22
  import "../chunk-SGZJ5LYH.js";
23
23
  import {
24
24
  ensureDaemonRunning
25
- } from "../chunk-SZ4Q6ZVS.js";
25
+ } from "../chunk-RPQLZLKC.js";
26
26
  import {
27
27
  encryptRecord
28
28
  } from "../chunk-APP43AW7.js";
29
- import "../chunk-462EQA6K.js";
29
+ import "../chunk-MISUKJGW.js";
30
30
  import {
31
31
  transcriptsEnabled
32
- } from "../chunk-VIIHC42X.js";
32
+ } from "../chunk-QGRENWJL.js";
33
33
  import {
34
34
  needsShell,
35
35
  spawnClaude
36
36
  } from "../chunk-XHKBHWLX.js";
37
- import "../chunk-BYLKCZ2G.js";
38
- import "../chunk-M3STIAGU.js";
37
+ import "../chunk-SIHYBIEN.js";
38
+ import "../chunk-PR2VDVCP.js";
39
39
  import "../chunk-ZGADIZDS.js";
40
- import "../chunk-MLGIVVSG.js";
40
+ import "../chunk-GQYX24UC.js";
41
41
  import "../chunk-GMXKITVA.js";
42
42
  import "../chunk-6ICPEJY5.js";
43
- import "../chunk-REU2VQPH.js";
43
+ import "../chunk-GTZ4HIHU.js";
44
44
  import {
45
45
  UNNAMED_ACTION,
46
46
  deriveToolTarget,
@@ -51,7 +51,7 @@ import {
51
51
  repoKeyFor,
52
52
  reportEvent,
53
53
  scopePathFor
54
- } from "../chunk-KQFTBQ66.js";
54
+ } from "../chunk-LDQGURCF.js";
55
55
  import {
56
56
  DEFAULT_SESSION,
57
57
  markPendingCommandDelivered,
@@ -70,29 +70,29 @@ import {
70
70
  nextLongPollMs,
71
71
  waitForAnswer,
72
72
  withdrawQuestion
73
- } from "../chunk-WRPYCIV2.js";
73
+ } from "../chunk-ZSGJYSF2.js";
74
74
  import {
75
75
  SubscriptionRequiredError
76
- } from "../chunk-6AYSKVLL.js";
77
- import "../chunk-QRXPWW3M.js";
78
- import "../chunk-UPIZSCYD.js";
76
+ } from "../chunk-I3W7GJ5R.js";
77
+ import "../chunk-XXLCYKVS.js";
78
+ import "../chunk-NQ67AF3V.js";
79
79
  import "../chunk-POFBE6ZY.js";
80
- import "../chunk-5N5L6DNN.js";
80
+ import "../chunk-UM5WXBKN.js";
81
81
  import {
82
82
  getMachineId
83
- } from "../chunk-KOWFRUIT.js";
83
+ } from "../chunk-H4F5O3RE.js";
84
84
  import "../chunk-7QLSKOSU.js";
85
85
  import "../chunk-KZERVKTD.js";
86
- import "../chunk-BNSKVIAW.js";
87
- import "../chunk-Z23ZBYDW.js";
86
+ import "../chunk-Q3UMWSE4.js";
87
+ import "../chunk-UJZ7AGSC.js";
88
88
  import "../chunk-T7E75EKA.js";
89
89
  import {
90
90
  getApiKey,
91
91
  getBaseUrl
92
- } from "../chunk-IRHABAQT.js";
92
+ } from "../chunk-2M52CFVO.js";
93
93
  import {
94
94
  NPX_LATEST_COMMAND
95
- } from "../chunk-5DCDQ5VW.js";
95
+ } from "../chunk-TCXL5FQQ.js";
96
96
  import {
97
97
  DECISION_STOP_REASON,
98
98
  KILL_REASON,
@@ -4,10 +4,15 @@ import {
4
4
  PUSHARY_SKILL_SOURCE,
5
5
  createGuards
6
6
  } from "../chunk-EUW7JL2K.js";
7
+ import {
8
+ describeRevokeAttempt,
9
+ keyNoLongerAccepted,
10
+ revokeOwnKey
11
+ } from "../chunk-SB2GN6OP.js";
7
12
  import {
8
13
  isCursorPluginLeftover,
9
14
  withoutPusharyCursorHooks
10
- } from "../chunk-LENBKYRB.js";
15
+ } from "../chunk-BVSIM4EF.js";
11
16
  import {
12
17
  HERMES_PIP_PACKAGE,
13
18
  readHermesStatus,
@@ -16,23 +21,27 @@ import {
16
21
  shortenHome,
17
22
  unregisterPluginLocation,
18
23
  vscodeSettingsTargets
19
- } from "../chunk-UAP5DS6P.js";
24
+ } from "../chunk-S2DAKKQQ.js";
20
25
  import {
21
26
  planFxRemoval,
22
27
  removeInstructionBlock
23
- } from "../chunk-6W5M3MSE.js";
24
- import "../chunk-H5T27W7M.js";
28
+ } from "../chunk-2HXG2QDI.js";
29
+ import "../chunk-OL2Z7WI4.js";
25
30
  import {
26
31
  disableDaemonService
27
- } from "../chunk-SZ4Q6ZVS.js";
32
+ } from "../chunk-RPQLZLKC.js";
28
33
  import "../chunk-XHKBHWLX.js";
34
+ import {
35
+ APPROVAL_SETTINGS_PATH
36
+ } from "../chunk-AKPHYSEL.js";
29
37
  import {
30
38
  macAppKeepsMcpEntry,
31
39
  mcpServerBearer,
32
40
  pusharyKey,
33
41
  readMacAppAgentKey,
34
42
  setupReceiptKey
35
- } from "../chunk-E5HOHIUV.js";
43
+ } from "../chunk-BOSXFI7L.js";
44
+ import "../chunk-LXA236ZQ.js";
36
45
  import {
37
46
  OPENCODE_PLUGIN_SIBLING,
38
47
  OPENCODE_PLUGIN_SIBLING_CONTENTS,
@@ -44,7 +53,7 @@ import {
44
53
  openCodePluginDir,
45
54
  openCodePluginFile,
46
55
  removeOpenCodeMcpServer
47
- } from "../chunk-BZLHTMT6.js";
56
+ } from "../chunk-QAGWWDXQ.js";
48
57
  import {
49
58
  compatibleConfigFile,
50
59
  compatibleInstructionsFile,
@@ -57,14 +66,14 @@ import {
57
66
  removePusharySettings,
58
67
  removePusharyToolPermissions,
59
68
  restoreClaudeMcpServer
60
- } from "../chunk-UF6RBP5V.js";
69
+ } from "../chunk-7HGR5GNY.js";
61
70
  import {
62
71
  ansiPainter,
63
72
  useColor
64
73
  } from "../chunk-U4TMAANR.js";
65
74
  import {
66
75
  exitOnHelpFlag
67
- } from "../chunk-TO3PS646.js";
76
+ } from "../chunk-2HFSKYLN.js";
68
77
  import {
69
78
  hookOwnerOf,
70
79
  isHookTakeoverReceipt,
@@ -72,36 +81,42 @@ import {
72
81
  resolveBridgeStub,
73
82
  restoreHookTakeover,
74
83
  restoreMcpServer
75
- } from "../chunk-BYLKCZ2G.js";
84
+ } from "../chunk-SIHYBIEN.js";
76
85
  import {
77
86
  removeGeminiSettings
78
- } from "../chunk-M3STIAGU.js";
87
+ } from "../chunk-PR2VDVCP.js";
79
88
  import "../chunk-ZGADIZDS.js";
80
- import "../chunk-MLGIVVSG.js";
89
+ import "../chunk-GQYX24UC.js";
81
90
  import {
82
91
  rejectUnknownFlags
83
92
  } from "../chunk-GMXKITVA.js";
84
93
  import "../chunk-6ICPEJY5.js";
85
94
  import {
86
95
  CANDIDATE_RCS,
96
+ findExportedKeyLines,
87
97
  isDisabledExport,
98
+ keyPrefix,
99
+ readConfigFileKey,
100
+ readMacAppKeyPrefix,
88
101
  removeClaudeAlias
89
- } from "../chunk-REU2VQPH.js";
90
- import "../chunk-KQFTBQ66.js";
102
+ } from "../chunk-GTZ4HIHU.js";
103
+ import "../chunk-LDQGURCF.js";
91
104
  import "../chunk-N6IOSZOE.js";
92
105
  import "../chunk-MD4SVNT6.js";
93
- import "../chunk-WRPYCIV2.js";
94
- import "../chunk-6AYSKVLL.js";
95
- import "../chunk-QRXPWW3M.js";
96
- import "../chunk-UPIZSCYD.js";
106
+ import "../chunk-ZSGJYSF2.js";
107
+ import "../chunk-I3W7GJ5R.js";
108
+ import {
109
+ absoluteUrl
110
+ } from "../chunk-XXLCYKVS.js";
111
+ import "../chunk-NQ67AF3V.js";
97
112
  import "../chunk-POFBE6ZY.js";
98
- import "../chunk-5N5L6DNN.js";
99
- import "../chunk-KOWFRUIT.js";
113
+ import "../chunk-UM5WXBKN.js";
114
+ import "../chunk-H4F5O3RE.js";
100
115
  import "../chunk-7QLSKOSU.js";
101
116
  import {
102
117
  EXIT
103
118
  } from "../chunk-KZERVKTD.js";
104
- import "../chunk-BNSKVIAW.js";
119
+ import "../chunk-Q3UMWSE4.js";
105
120
  import {
106
121
  claudeJson,
107
122
  claudeMcpReceipt,
@@ -138,12 +153,14 @@ import {
138
153
  restoreCodexHookTrust,
139
154
  vscodePluginDir,
140
155
  vscodePluginMcp
141
- } from "../chunk-Z23ZBYDW.js";
156
+ } from "../chunk-UJZ7AGSC.js";
142
157
  import "../chunk-T7E75EKA.js";
143
- import "../chunk-IRHABAQT.js";
158
+ import {
159
+ getBaseUrl
160
+ } from "../chunk-2M52CFVO.js";
144
161
  import {
145
162
  NPX_LATEST_COMMAND
146
- } from "../chunk-5DCDQ5VW.js";
163
+ } from "../chunk-TCXL5FQQ.js";
147
164
  import {
148
165
  CLI_PACKAGE_NAMES,
149
166
  HOOK_COMPATIBLE_PROFILES,
@@ -575,6 +592,43 @@ var cleanCompatibleAgent = (profile, scope, io, home) => {
575
592
  return { profile, files, mcpKeptForApp, instructions: cleanInstructions(profile, scope, io, home) };
576
593
  };
577
594
 
595
+ // src/cli/clean-key-revocation.ts
596
+ var isMacAppKey = (key, keys) => key === keys.macAppKey || keyPrefix(key) === keys.macAppKeyPrefix;
597
+ var revocationFor = (keys) => (key) => isMacAppKey(key, keys) ? { kind: "mac_app_key", keyPrefix: keyPrefix(key) } : { kind: "revoke", key };
598
+ var validKeys = (keys) => [...new Set(keys)].filter((key) => key !== null && isValidApiKey(key));
599
+ var environmentOnlyKey = (keys, written) => validKeys([keys.envKey]).filter((key) => !written.includes(key)).map((key) => ({ kind: "environment_only", keyPrefix: keyPrefix(key) }));
600
+ var planCliKeyRevocations = (keys) => {
601
+ const written = validKeys([keys.configKey, ...keys.profileKeys]);
602
+ return [...written.map(revocationFor(keys)), ...environmentOnlyKey(keys, written)];
603
+ };
604
+ var runRevocation = async (revocation, run) => {
605
+ if (revocation.kind !== "revoke") return revocation;
606
+ if (run.dryRun) return { kind: "would_revoke", keyPrefix: keyPrefix(revocation.key) };
607
+ return { kind: "attempted", keyPrefix: keyPrefix(revocation.key), attempt: await revokeOwnKey(revocation.key, run.baseUrl) };
608
+ };
609
+ var revokeCliKeys = async (revocations, run) => {
610
+ const outcomes = [];
611
+ for (const revocation of revocations) outcomes.push(await runRevocation(revocation, run));
612
+ return outcomes;
613
+ };
614
+ var describeCliKeyRevocation = (outcome, baseUrl) => {
615
+ const label = `API key ${outcome.keyPrefix}`;
616
+ switch (outcome.kind) {
617
+ case "would_revoke":
618
+ return { tone: "skipped", line: `${label} (would revoke it on pushary.com)`, next: null };
619
+ case "mac_app_key":
620
+ return { tone: "skipped", line: `${label} (not revoked: it is the Pushary Mac app's key)`, next: null };
621
+ case "environment_only":
622
+ return { tone: "skipped", line: `${label} in PUSHARY_API_KEY (left alone: Pushary did not write it)`, next: null };
623
+ case "attempted":
624
+ return keyNoLongerAccepted(outcome.attempt) ? { tone: "done", line: `${label}: ${describeRevokeAttempt(outcome.attempt)}`, next: null } : {
625
+ tone: "warning",
626
+ line: `${label}: ${describeRevokeAttempt(outcome.attempt)}`,
627
+ next: `It may still be valid. Revoke it at ${absoluteUrl(baseUrl, APPROVAL_SETTINGS_PATH)}`
628
+ };
629
+ }
630
+ };
631
+
578
632
  // bin/pushary-clean.ts
579
633
  exitOnHelpFlag("clean");
580
634
  var paint = ansiPainter(() => useColor());
@@ -793,6 +847,27 @@ var restoreTakeoverReceipts = () => {
793
847
  }
794
848
  }
795
849
  };
850
+ var KEY_REVOCATION_ICONS = {
851
+ done: check,
852
+ skipped: skip,
853
+ warning: yellow("!")
854
+ };
855
+ var printKeyRevocation = (report) => {
856
+ console.log(` ${KEY_REVOCATION_ICONS[report.tone]} ${report.line}`);
857
+ if (report.next) console.log(` ${dim(report.next)}`);
858
+ };
859
+ var revokeKeysThisCliHolds = async () => {
860
+ const baseUrl = getBaseUrl();
861
+ const revocations = planCliKeyRevocations({
862
+ configKey: readConfigFileKey(),
863
+ profileKeys: findExportedKeyLines().map((line) => line.key),
864
+ envKey: process.env.PUSHARY_API_KEY?.trim() || null,
865
+ macAppKey: readMacAppAgentKey(),
866
+ macAppKeyPrefix: readMacAppKeyPrefix()
867
+ });
868
+ const outcomes = await revokeCliKeys(revocations, { dryRun, baseUrl });
869
+ for (const outcome of outcomes) printKeyRevocation(describeCliKeyRevocation(outcome, baseUrl));
870
+ };
796
871
  var main = async () => {
797
872
  console.log();
798
873
  console.log(` ${bold("Pushary Clean")}`);
@@ -871,6 +946,7 @@ var main = async () => {
871
946
  process.exit(EXIT.FAILED);
872
947
  }
873
948
  console.log(` ${check} Background service ${dim(did("uninstalled"))}`);
949
+ if (everything) await revokeKeysThisCliHolds();
874
950
  const claudeJson2 = readJson(CLAUDE_JSON);
875
951
  const keepClaudeMcp = macAppKeeps("claude_code", mcpServerBearer(claudeJson2?.mcpServers));
876
952
  const claudeHasPusharyEntry = () => Boolean(claudeJson2?.mcpServers?.pushary);
@@ -5,10 +5,10 @@ import {
5
5
  postLiveSession,
6
6
  postLiveSessionUntilAccepted,
7
7
  startLiveSessionHeartbeat
8
- } from "../chunk-RQ32ADJP.js";
8
+ } from "../chunk-BTFUSQFB.js";
9
9
  import {
10
10
  resolveProviderBinary
11
- } from "../chunk-F7R3SZ4Q.js";
11
+ } from "../chunk-EVC765EO.js";
12
12
  import "../chunk-RIVNNBEK.js";
13
13
  import {
14
14
  SESSION_IDLE_TIMEOUT_MS,
@@ -16,45 +16,45 @@ import {
16
16
  idleDeadlinePassed,
17
17
  startProcessOwnership,
18
18
  withSpawnProcessOwnership
19
- } from "../chunk-NUVGDBZC.js";
19
+ } from "../chunk-2S34OPHS.js";
20
20
  import "../chunk-APP43AW7.js";
21
- import "../chunk-462EQA6K.js";
21
+ import "../chunk-MISUKJGW.js";
22
22
  import {
23
23
  transcriptsEnabled
24
- } from "../chunk-VIIHC42X.js";
24
+ } from "../chunk-QGRENWJL.js";
25
25
  import {
26
26
  spawnClaude
27
27
  } from "../chunk-XHKBHWLX.js";
28
28
  import "../chunk-6ICPEJY5.js";
29
- import "../chunk-REU2VQPH.js";
29
+ import "../chunk-GTZ4HIHU.js";
30
30
  import {
31
31
  isAskUserResponse,
32
32
  isDecisionStopped,
33
33
  isWaitForAnswerResponse,
34
34
  withdrawQuestion
35
- } from "../chunk-WRPYCIV2.js";
35
+ } from "../chunk-ZSGJYSF2.js";
36
36
  import {
37
37
  callMcpTool
38
- } from "../chunk-6AYSKVLL.js";
39
- import "../chunk-QRXPWW3M.js";
38
+ } from "../chunk-I3W7GJ5R.js";
39
+ import "../chunk-XXLCYKVS.js";
40
40
  import {
41
41
  writeDegraded
42
- } from "../chunk-UPIZSCYD.js";
42
+ } from "../chunk-NQ67AF3V.js";
43
43
  import "../chunk-POFBE6ZY.js";
44
- import "../chunk-5N5L6DNN.js";
44
+ import "../chunk-UM5WXBKN.js";
45
45
  import {
46
46
  getMachineId
47
- } from "../chunk-KOWFRUIT.js";
47
+ } from "../chunk-H4F5O3RE.js";
48
48
  import "../chunk-7QLSKOSU.js";
49
49
  import "../chunk-KZERVKTD.js";
50
- import "../chunk-BNSKVIAW.js";
51
- import "../chunk-Z23ZBYDW.js";
50
+ import "../chunk-Q3UMWSE4.js";
51
+ import "../chunk-UJZ7AGSC.js";
52
52
  import "../chunk-T7E75EKA.js";
53
53
  import {
54
54
  getApiKey,
55
55
  getBaseUrl
56
- } from "../chunk-IRHABAQT.js";
57
- import "../chunk-5DCDQ5VW.js";
56
+ } from "../chunk-2M52CFVO.js";
57
+ import "../chunk-TCXL5FQQ.js";
58
58
  import {
59
59
  elicitationContent,
60
60
  parseAgentQuestion,
@@ -5,36 +5,36 @@ import {
5
5
  import {
6
6
  defersToNativeMode,
7
7
  reportMachineDenial
8
- } from "../chunk-B5NMSP3V.js";
8
+ } from "../chunk-CJYM4ZHV.js";
9
9
  import {
10
10
  triggerAutoUpdate
11
- } from "../chunk-K545B734.js";
11
+ } from "../chunk-U5FP5JIS.js";
12
12
  import {
13
13
  isGatingMoment,
14
14
  recordKeylessMoment
15
15
  } from "../chunk-IIVZZMSO.js";
16
16
  import {
17
17
  readHookInput
18
- } from "../chunk-R5RIVOPL.js";
18
+ } from "../chunk-Z2Q2VH43.js";
19
19
  import {
20
20
  announceSubscriptionRequired,
21
21
  denyReasonFrom,
22
22
  isDeferAnswer
23
23
  } from "../chunk-5OP5MQI7.js";
24
- import "../chunk-COQ64C4F.js";
24
+ import "../chunk-DWO4RLYK.js";
25
25
  import "../chunk-SGZJ5LYH.js";
26
- import "../chunk-SZ4Q6ZVS.js";
26
+ import "../chunk-RPQLZLKC.js";
27
27
  import "../chunk-APP43AW7.js";
28
- import "../chunk-462EQA6K.js";
29
- import "../chunk-VIIHC42X.js";
28
+ import "../chunk-MISUKJGW.js";
29
+ import "../chunk-QGRENWJL.js";
30
30
  import "../chunk-XHKBHWLX.js";
31
- import "../chunk-BYLKCZ2G.js";
32
- import "../chunk-M3STIAGU.js";
31
+ import "../chunk-SIHYBIEN.js";
32
+ import "../chunk-PR2VDVCP.js";
33
33
  import "../chunk-ZGADIZDS.js";
34
- import "../chunk-MLGIVVSG.js";
34
+ import "../chunk-GQYX24UC.js";
35
35
  import "../chunk-GMXKITVA.js";
36
36
  import "../chunk-6ICPEJY5.js";
37
- import "../chunk-REU2VQPH.js";
37
+ import "../chunk-GTZ4HIHU.js";
38
38
  import {
39
39
  CODEX_AGENT,
40
40
  UNNAMED_ACTION,
@@ -77,7 +77,7 @@ import {
77
77
  toPolicyLookup,
78
78
  toPolicyLookups,
79
79
  userScope
80
- } from "../chunk-KQFTBQ66.js";
80
+ } from "../chunk-LDQGURCF.js";
81
81
  import {
82
82
  DEFAULT_SESSION
83
83
  } from "../chunk-N6IOSZOE.js";
@@ -93,34 +93,34 @@ import {
93
93
  sendNotification,
94
94
  unavailableQuestionUnlessSubscriptionRequired,
95
95
  waitForQuestion
96
- } from "../chunk-WRPYCIV2.js";
96
+ } from "../chunk-ZSGJYSF2.js";
97
97
  import {
98
98
  SubscriptionRequiredError
99
- } from "../chunk-6AYSKVLL.js";
100
- import "../chunk-QRXPWW3M.js";
99
+ } from "../chunk-I3W7GJ5R.js";
100
+ import "../chunk-XXLCYKVS.js";
101
101
  import {
102
102
  exitAfterClientReports
103
- } from "../chunk-UPIZSCYD.js";
103
+ } from "../chunk-NQ67AF3V.js";
104
104
  import "../chunk-POFBE6ZY.js";
105
- import "../chunk-5N5L6DNN.js";
105
+ import "../chunk-UM5WXBKN.js";
106
106
  import {
107
107
  getMachineId
108
- } from "../chunk-KOWFRUIT.js";
108
+ } from "../chunk-H4F5O3RE.js";
109
109
  import "../chunk-7QLSKOSU.js";
110
110
  import {
111
111
  EXIT
112
112
  } from "../chunk-KZERVKTD.js";
113
- import "../chunk-BNSKVIAW.js";
113
+ import "../chunk-Q3UMWSE4.js";
114
114
  import {
115
115
  canonicalJson
116
- } from "../chunk-Z23ZBYDW.js";
116
+ } from "../chunk-UJZ7AGSC.js";
117
117
  import {
118
118
  writeFileAtomic
119
119
  } from "../chunk-T7E75EKA.js";
120
120
  import {
121
121
  getApiKey
122
- } from "../chunk-IRHABAQT.js";
123
- import "../chunk-5DCDQ5VW.js";
122
+ } from "../chunk-2M52CFVO.js";
123
+ import "../chunk-TCXL5FQQ.js";
124
124
  import {
125
125
  CODEX_RESCUE_TOOL_NAME,
126
126
  DECISION_STOP_REASON,
@@ -762,7 +762,7 @@ var decidePreToolUse = async (input) => {
762
762
  };
763
763
  var repairCodexHoldsQuietly = async () => {
764
764
  try {
765
- const { repairCodexHolds } = await import("../reapply-Q5NHDTVU.js");
765
+ const { repairCodexHolds } = await import("../reapply-PRKV4EO7.js");
766
766
  repairCodexHolds();
767
767
  } catch {
768
768
  return;
@@ -1,33 +1,33 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  reportEvent
4
- } from "../chunk-KQFTBQ66.js";
4
+ } from "../chunk-LDQGURCF.js";
5
5
  import "../chunk-N6IOSZOE.js";
6
6
  import "../chunk-MD4SVNT6.js";
7
7
  import {
8
8
  askUser,
9
9
  isDecisionStopped,
10
10
  waitForAnswer
11
- } from "../chunk-WRPYCIV2.js";
12
- import "../chunk-6AYSKVLL.js";
13
- import "../chunk-QRXPWW3M.js";
14
- import "../chunk-UPIZSCYD.js";
11
+ } from "../chunk-ZSGJYSF2.js";
12
+ import "../chunk-I3W7GJ5R.js";
13
+ import "../chunk-XXLCYKVS.js";
14
+ import "../chunk-NQ67AF3V.js";
15
15
  import "../chunk-POFBE6ZY.js";
16
- import "../chunk-5N5L6DNN.js";
16
+ import "../chunk-UM5WXBKN.js";
17
17
  import {
18
18
  getMachineId
19
- } from "../chunk-KOWFRUIT.js";
19
+ } from "../chunk-H4F5O3RE.js";
20
20
  import "../chunk-7QLSKOSU.js";
21
21
  import "../chunk-KZERVKTD.js";
22
- import "../chunk-BNSKVIAW.js";
23
- import "../chunk-Z23ZBYDW.js";
22
+ import "../chunk-Q3UMWSE4.js";
23
+ import "../chunk-UJZ7AGSC.js";
24
24
  import "../chunk-T7E75EKA.js";
25
25
  import {
26
26
  getApiKey
27
- } from "../chunk-IRHABAQT.js";
27
+ } from "../chunk-2M52CFVO.js";
28
28
  import {
29
29
  NPX_LATEST_COMMAND
30
- } from "../chunk-5DCDQ5VW.js";
30
+ } from "../chunk-TCXL5FQQ.js";
31
31
  import "../chunk-5RGA636G.js";
32
32
 
33
33
  // bin/pushary-codex.ts