@pushary/agent-hooks 0.62.0 → 0.62.2

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 (45) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/bin/pushary-claude.js +5 -2
  3. package/dist/bin/pushary-clean.js +24 -6
  4. package/dist/bin/pushary-codex-hook.js +5 -2
  5. package/dist/bin/pushary-codex.js +5 -2
  6. package/dist/bin/pushary-connect.js +16 -13
  7. package/dist/bin/pushary-daemon.js +5 -4
  8. package/dist/bin/pushary-doctor.js +20 -14
  9. package/dist/bin/pushary-gemini-hook.js +5 -2
  10. package/dist/bin/pushary-hook.js +8 -5
  11. package/dist/bin/pushary-login.js +15 -11
  12. package/dist/bin/pushary-logout.js +11 -9
  13. package/dist/bin/pushary-mode.js +29 -6
  14. package/dist/bin/pushary-notification-hook.js +5 -2
  15. package/dist/bin/pushary-permission-denied-hook.js +6 -3
  16. package/dist/bin/pushary-permission-hook.js +6 -3
  17. package/dist/bin/pushary-post-hook.js +5 -2
  18. package/dist/bin/pushary-prompt-hook.js +5 -2
  19. package/dist/bin/pushary-session-end-hook.js +5 -2
  20. package/dist/bin/pushary-session-start-hook.js +5 -2
  21. package/dist/bin/pushary-setup.js +21 -16
  22. package/dist/bin/pushary-stats.js +3 -2
  23. package/dist/bin/pushary-status.js +22 -8
  24. package/dist/bin/pushary-stop-hook.js +5 -2
  25. package/dist/bin/pushary-stopfailure-hook.js +5 -2
  26. package/dist/bin/pushary-suggestions.js +27 -2
  27. package/dist/bin/pushary-upgrade.js +16 -9
  28. package/dist/bin/pushary-wait.js +29 -6
  29. package/dist/bin/pushary.js +9 -2
  30. package/dist/{chunk-HIIBSYFJ.js → chunk-5ZDYDU2Q.js} +5 -1
  31. package/dist/chunk-6MTNS63X.js +55 -0
  32. package/dist/{chunk-SP7OZXCQ.js → chunk-7OXIC7E3.js} +1 -15
  33. package/dist/{chunk-HNTKTK5B.js → chunk-BSZYIAZL.js} +4 -0
  34. package/dist/{chunk-247C4RE5.js → chunk-COC6NPWG.js} +12 -59
  35. package/dist/{chunk-YJ7YZRVV.js → chunk-G4TARJAY.js} +8 -54
  36. package/dist/{chunk-N4DA4CJB.js → chunk-GMXKITVA.js} +13 -0
  37. package/dist/chunk-KZERVKTD.js +16 -0
  38. package/dist/{chunk-3O27ZSRE.js → chunk-NGZMVCXN.js} +1 -1
  39. package/dist/chunk-SAF6HGAA.js +57 -0
  40. package/dist/{chunk-5SO3CEGJ.js → chunk-SDXF5I46.js} +1 -1
  41. package/dist/{chunk-ONVEYEVR.js → chunk-SR52774M.js} +2 -2
  42. package/dist/{chunk-IIZZYUWK.js → chunk-WXFEK7KD.js} +4 -2
  43. package/dist/{chunk-QHOVJXOT.js → chunk-Z3Z4VK5F.js} +2 -1
  44. package/dist/src/index.js +6 -3
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,67 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.62.2
4
+
5
+ ### An ignored `--dry-run` made real changes
6
+
7
+ `mode`, `wait`, `suggestions` and `status` read their arguments positionally and
8
+ silently discarded any flag they did not recognise. So `pushary mode push_only
9
+ --dry-run` dropped the flag and changed the mode for real. Those four now reject
10
+ an unknown flag and exit `2`, and they do it before looking for your API key, so
11
+ a typo is reported as a typo rather than as a missing key.
12
+
13
+ ### The proxy support was never switched on
14
+
15
+ `HTTP_PROXY` and `HTTPS_PROXY` handling was written but never called from
16
+ anywhere, and Node's fetch ignores both without it. Behind a corporate proxy,
17
+ setup verified your key through the one code path that used it, reported
18
+ everything healthy, and every approval afterwards failed. It is now installed by
19
+ the shared HTTP layer, the MCP transport and the command dispatcher.
20
+
21
+ ### `doctor --json` woke your phone on every run
22
+
23
+ The test push was skipped only for `--no-push`. Running `pushary doctor --json`
24
+ on a schedule sent a real notification each time. It is now opt-out for a person
25
+ at a terminal and off by default for `--json` or a non-TTY. Pass `--roundtrip` to
26
+ send one deliberately.
27
+
28
+ ### Browser login could stall on the plan step
29
+
30
+ Choosing a plan navigated the same tab away from the authorize page, and that
31
+ page was the only thing that could finish the login once the plan activated, so
32
+ the terminal waited on a promise nothing was going to keep. Checkout now opens in
33
+ a new tab and the page completes the login by itself. The CLI no longer claims it
34
+ finishes on its own without saying the tab has to stay open.
35
+
36
+
37
+ ## 0.62.1
38
+
39
+ ### `pushary clean --dry-run` was not a dry run
40
+
41
+ In 0.62.0 the flag ran four real operations while printing "would":
42
+
43
+ - uninstalled the global `@pushary/agent-hooks` package
44
+ - rewrote your shell profile to remove the `claude` alias
45
+ - stripped the Pushary block from `~/.codex/AGENTS.md`
46
+ - stripped it from `~/.gemini/GEMINI.md`
47
+
48
+ If you ran `pushary clean --dry-run` on 0.62.0 and the CLI then seemed to
49
+ disappear, that is why. Reinstall with `npm i -g @pushary/agent-hooks`, and check
50
+ your shell profile and those two files against version control if you keep them
51
+ there.
52
+
53
+ ### `pushary upgrade` could destroy `~/.claude.json`
54
+
55
+ `upgrade` treated an unparseable config as an empty one and wrote it back, so a
56
+ truncated `~/.claude.json` was replaced with nothing but the Pushary MCP entry,
57
+ losing every project, MCP server and permission rule in it. A half-written
58
+ `~/.claude.json` is what an interrupted write leaves behind, so this needed only
59
+ one earlier crash to line up.
60
+
61
+ A config that cannot be parsed is now left untouched, and the other agent files
62
+ are still refreshed around it.
63
+
64
+
3
65
  ## 0.62.0
4
66
 
5
67
  ### `pushary clean` could leave your API key on disk
@@ -17,8 +17,10 @@ import {
17
17
  reportEvent,
18
18
  resolvePolicy,
19
19
  waitForAnswer
20
- } from "../chunk-HIIBSYFJ.js";
21
- import "../chunk-HNTKTK5B.js";
20
+ } from "../chunk-5ZDYDU2Q.js";
21
+ import "../chunk-BSZYIAZL.js";
22
+ import "../chunk-SAF6HGAA.js";
23
+ import "../chunk-7QLSKOSU.js";
22
24
  import {
23
25
  redactSecrets
24
26
  } from "../chunk-DQAN3JQP.js";
@@ -29,6 +31,7 @@ import {
29
31
  getApiKey,
30
32
  getBaseUrl
31
33
  } from "../chunk-2UMNXADU.js";
34
+ import "../chunk-KZERVKTD.js";
32
35
 
33
36
  // src/wrapper/claudeBinary.ts
34
37
  import { statSync } from "fs";
@@ -24,9 +24,10 @@ import {
24
24
  } from "../chunk-MUEW424A.js";
25
25
  import {
26
26
  exitOnHelpFlag
27
- } from "../chunk-IIZZYUWK.js";
28
- import "../chunk-SP7OZXCQ.js";
27
+ } from "../chunk-WXFEK7KD.js";
28
+ import "../chunk-7OXIC7E3.js";
29
29
  import "../chunk-DQAN3JQP.js";
30
+ import "../chunk-KZERVKTD.js";
30
31
 
31
32
  // bin/pushary-clean.ts
32
33
  import { existsSync, readFileSync, writeFileSync, copyFileSync, rmSync, readdirSync } from "fs";
@@ -91,6 +92,19 @@ var guardedExec = (command, options, describe) => {
91
92
  if (dryRun) return wouldNote("run ", describe);
92
93
  execSync(command, options);
93
94
  };
95
+ var guardedInstructionBlockRemoval = (path) => {
96
+ if (!dryRun) return removeInstructionBlock(path);
97
+ if (!existsSync(path)) return false;
98
+ const hasBlock = readFileSync(path, "utf-8").includes("pushary");
99
+ if (hasBlock) wouldNote("rewrite", path);
100
+ return hasBlock;
101
+ };
102
+ var guardedAliasRemoval = () => {
103
+ if (!dryRun) return removeClaudeAlias();
104
+ const shells = [".zshrc", ".bashrc", ".bash_profile", ".profile"].map((name) => join(homedir(), name)).filter((path) => existsSync(path) && readFileSync(path, "utf-8").includes("pushary claude"));
105
+ for (const path of shells) wouldNote("rewrite", path);
106
+ return shells;
107
+ };
94
108
  var writeJson = (path, data) => {
95
109
  guardedWrite(path, JSON.stringify(data, null, 2) + "\n");
96
110
  };
@@ -219,7 +233,7 @@ var main = async () => {
219
233
  console.log(` ${skip} Codex hooks ${dim("(not found)")}`);
220
234
  }
221
235
  const codexAgentsMd2 = codexAgentsMd();
222
- if (removeInstructionBlock(codexAgentsMd2)) {
236
+ if (guardedInstructionBlockRemoval(codexAgentsMd2)) {
223
237
  console.log(` ${check} Codex AGENTS.md ${dim("(removed Pushary block)")}`);
224
238
  } else {
225
239
  console.log(` ${skip} Codex AGENTS.md ${dim("(no pushary block)")}`);
@@ -244,7 +258,7 @@ var main = async () => {
244
258
  console.log(` ${skip} Gemini CLI settings ${dim("(not found)")}`);
245
259
  }
246
260
  const geminiMd = join(homedir(), ".gemini", "GEMINI.md");
247
- if (removeInstructionBlock(geminiMd)) {
261
+ if (guardedInstructionBlockRemoval(geminiMd)) {
248
262
  console.log(` ${check} Gemini GEMINI.md ${dim("(removed Pushary block)")}`);
249
263
  } else {
250
264
  console.log(` ${skip} Gemini GEMINI.md ${dim("(no pushary block)")}`);
@@ -288,7 +302,7 @@ var main = async () => {
288
302
  } catch {
289
303
  }
290
304
  }
291
- const aliasRemovedFrom = removeClaudeAlias();
305
+ const aliasRemovedFrom = guardedAliasRemoval();
292
306
  if (aliasRemovedFrom.length > 0) {
293
307
  console.log(` ${check} claude alias ${dim(`(removed from ${aliasRemovedFrom.map((p) => p.split("/").pop()).join(", ")})`)}`);
294
308
  } else {
@@ -314,7 +328,11 @@ var main = async () => {
314
328
  } catch {
315
329
  }
316
330
  try {
317
- execNpm("uninstall -g --no-workspaces @pushary/agent-hooks", { stdio: "ignore", timeout: 3e4 });
331
+ if (dryRun) {
332
+ wouldNote("run ", "npm uninstall -g @pushary/agent-hooks");
333
+ } else {
334
+ execNpm("uninstall -g --no-workspaces @pushary/agent-hooks", { stdio: "ignore", timeout: 3e4 });
335
+ }
318
336
  console.log(` ${check} Global package ${dim(did("uninstalled"))}`);
319
337
  } catch {
320
338
  console.log(` ${skip} Global package ${dim("(not installed)")}`);
@@ -31,12 +31,14 @@ import {
31
31
  toCodexWire,
32
32
  toPolicyLookup,
33
33
  waitForAnswer
34
- } from "../chunk-HIIBSYFJ.js";
34
+ } from "../chunk-5ZDYDU2Q.js";
35
35
  import {
36
36
  isGatingMoment,
37
37
  recordKeylessMoment
38
38
  } from "../chunk-WLGEY4UX.js";
39
- import "../chunk-HNTKTK5B.js";
39
+ import "../chunk-BSZYIAZL.js";
40
+ import "../chunk-SAF6HGAA.js";
41
+ import "../chunk-7QLSKOSU.js";
40
42
  import {
41
43
  DECISION_LINE_MAX,
42
44
  effectiveWaitSeconds,
@@ -49,6 +51,7 @@ import {
49
51
  import {
50
52
  getApiKey
51
53
  } from "../chunk-2UMNXADU.js";
54
+ import "../chunk-KZERVKTD.js";
52
55
 
53
56
  // bin/pushary-codex-hook.ts
54
57
  import { basename, join } from "path";
@@ -3,8 +3,10 @@ import {
3
3
  askUser,
4
4
  reportEvent,
5
5
  waitForAnswer
6
- } from "../chunk-HIIBSYFJ.js";
7
- import "../chunk-HNTKTK5B.js";
6
+ } from "../chunk-5ZDYDU2Q.js";
7
+ import "../chunk-BSZYIAZL.js";
8
+ import "../chunk-SAF6HGAA.js";
9
+ import "../chunk-7QLSKOSU.js";
8
10
  import "../chunk-DQAN3JQP.js";
9
11
  import {
10
12
  getMachineId
@@ -12,6 +14,7 @@ import {
12
14
  import {
13
15
  getApiKey
14
16
  } from "../chunk-2UMNXADU.js";
17
+ import "../chunk-KZERVKTD.js";
15
18
 
16
19
  // bin/pushary-codex.ts
17
20
  import { basename } from "path";
@@ -1,38 +1,41 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  printKeyCheck
4
- } from "../chunk-ONVEYEVR.js";
4
+ } from "../chunk-SR52774M.js";
5
5
  import {
6
6
  confirmAppConnection,
7
7
  connectDevice,
8
8
  printConnectInstructions
9
- } from "../chunk-3O27ZSRE.js";
9
+ } from "../chunk-NGZMVCXN.js";
10
10
  import "../chunk-3EGEA4KH.js";
11
- import {
12
- parseFlags
13
- } from "../chunk-N4DA4CJB.js";
14
11
  import {
15
12
  readKeySource
16
- } from "../chunk-247C4RE5.js";
13
+ } from "../chunk-COC6NPWG.js";
14
+ import "../chunk-6MTNS63X.js";
17
15
  import {
18
16
  checkApiKey
19
- } from "../chunk-YJ7YZRVV.js";
17
+ } from "../chunk-G4TARJAY.js";
20
18
  import {
21
19
  createIo
22
20
  } from "../chunk-TX7KBKT7.js";
23
21
  import {
24
- UsageError
25
- } from "../chunk-7QLSKOSU.js";
22
+ parseFlags
23
+ } from "../chunk-GMXKITVA.js";
26
24
  import "../chunk-BC3VCZ3E.js";
27
25
  import {
28
26
  exitOnHelpFlag
29
- } from "../chunk-IIZZYUWK.js";
27
+ } from "../chunk-WXFEK7KD.js";
28
+ import "../chunk-7OXIC7E3.js";
29
+ import "../chunk-BSZYIAZL.js";
30
+ import "../chunk-SAF6HGAA.js";
30
31
  import {
31
- EXIT
32
- } from "../chunk-SP7OZXCQ.js";
33
- import "../chunk-HNTKTK5B.js";
32
+ UsageError
33
+ } from "../chunk-7QLSKOSU.js";
34
34
  import "../chunk-DQAN3JQP.js";
35
35
  import "../chunk-2UMNXADU.js";
36
+ import {
37
+ EXIT
38
+ } from "../chunk-KZERVKTD.js";
36
39
 
37
40
  // bin/pushary-connect.ts
38
41
  exitOnHelpFlag("connect");
@@ -7,10 +7,8 @@ import {
7
7
  } from "../chunk-MUEW424A.js";
8
8
  import {
9
9
  exitOnHelpFlag
10
- } from "../chunk-IIZZYUWK.js";
11
- import {
12
- EXIT
13
- } from "../chunk-SP7OZXCQ.js";
10
+ } from "../chunk-WXFEK7KD.js";
11
+ import "../chunk-7OXIC7E3.js";
14
12
  import {
15
13
  getMachineId
16
14
  } from "../chunk-RN3NOEJF.js";
@@ -18,6 +16,9 @@ import {
18
16
  getApiKey,
19
17
  getBaseUrl
20
18
  } from "../chunk-2UMNXADU.js";
19
+ import {
20
+ EXIT
21
+ } from "../chunk-KZERVKTD.js";
21
22
 
22
23
  // src/spawn-daemon.ts
23
24
  import { spawn } from "child_process";
@@ -27,43 +27,44 @@ import {
27
27
  describeReach,
28
28
  fetchChannels,
29
29
  reachVerdict
30
- } from "../chunk-3O27ZSRE.js";
30
+ } from "../chunk-NGZMVCXN.js";
31
31
  import "../chunk-3EGEA4KH.js";
32
- import {
33
- parseFlags
34
- } from "../chunk-N4DA4CJB.js";
35
32
  import {
36
33
  keyPrefix,
37
34
  readKeySource
38
- } from "../chunk-247C4RE5.js";
35
+ } from "../chunk-COC6NPWG.js";
36
+ import "../chunk-6MTNS63X.js";
39
37
  import {
40
38
  checkApiKey,
41
39
  describeKeyCheck
42
- } from "../chunk-YJ7YZRVV.js";
40
+ } from "../chunk-G4TARJAY.js";
43
41
  import {
44
42
  createIo
45
43
  } from "../chunk-TX7KBKT7.js";
46
44
  import {
47
- UsageError
48
- } from "../chunk-7QLSKOSU.js";
45
+ parseFlags
46
+ } from "../chunk-GMXKITVA.js";
49
47
  import "../chunk-BC3VCZ3E.js";
50
48
  import {
51
49
  execNpm
52
50
  } from "../chunk-MUEW424A.js";
53
51
  import {
54
52
  exitOnHelpFlag
55
- } from "../chunk-IIZZYUWK.js";
53
+ } from "../chunk-WXFEK7KD.js";
56
54
  import {
57
- EXIT,
58
55
  getPackageVersion
59
- } from "../chunk-SP7OZXCQ.js";
56
+ } from "../chunk-7OXIC7E3.js";
60
57
  import {
61
58
  readLedgerSummary
62
59
  } from "../chunk-WLGEY4UX.js";
63
60
  import {
64
61
  callMcpTool,
65
62
  sendMcpRequest
66
- } from "../chunk-HNTKTK5B.js";
63
+ } from "../chunk-BSZYIAZL.js";
64
+ import "../chunk-SAF6HGAA.js";
65
+ import {
66
+ UsageError
67
+ } from "../chunk-7QLSKOSU.js";
67
68
  import "../chunk-DQAN3JQP.js";
68
69
  import {
69
70
  getMachineId
@@ -71,6 +72,9 @@ import {
71
72
  import {
72
73
  getBaseUrl
73
74
  } from "../chunk-2UMNXADU.js";
75
+ import {
76
+ EXIT
77
+ } from "../chunk-KZERVKTD.js";
74
78
 
75
79
  // bin/pushary-doctor.ts
76
80
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -572,8 +576,10 @@ var main = async () => {
572
576
  const verdict = reachVerdict(channels);
573
577
  check(verdict.kind === "yours", "Phone reachable", verdict.kind === "yours" ? describeReach(channels) : verdict.kind === "nobody" ? "nothing connected, run pushary connect or get the app at https://pushary.com/download" : `${describeReach(channels)}; run pushary connect to add your own`);
574
578
  }
575
- if (options.noPush) {
576
- console.log(` ${dim("\u2013")} Test push skipped ${dim("(--no-push)")}`);
579
+ const pushSuppressed = !options.roundtrip && (options.noPush || options.json || !process.stdout.isTTY);
580
+ if (pushSuppressed) {
581
+ const why = options.noPush ? "--no-push" : options.json ? "--json" : "not a terminal";
582
+ console.log(` ${dim("\u2013")} Test push skipped ${dim(`(${why}; pass --roundtrip to send one)`)}`);
577
583
  } else try {
578
584
  const result = await callMcpTool(apiKey, "send_notification", {
579
585
  title: "Pushary Doctor",
@@ -23,12 +23,14 @@ import {
23
23
  savePendingQuestion,
24
24
  sendNotification,
25
25
  waitForAnswer
26
- } from "../chunk-HIIBSYFJ.js";
26
+ } from "../chunk-5ZDYDU2Q.js";
27
27
  import {
28
28
  isGatingMoment,
29
29
  recordKeylessMoment
30
30
  } from "../chunk-WLGEY4UX.js";
31
- import "../chunk-HNTKTK5B.js";
31
+ import "../chunk-BSZYIAZL.js";
32
+ import "../chunk-SAF6HGAA.js";
33
+ import "../chunk-7QLSKOSU.js";
32
34
  import {
33
35
  DECISION_LINE_MAX,
34
36
  effectiveWaitSeconds,
@@ -41,6 +43,7 @@ import {
41
43
  import {
42
44
  getApiKey
43
45
  } from "../chunk-2UMNXADU.js";
46
+ import "../chunk-KZERVKTD.js";
44
47
 
45
48
  // bin/pushary-gemini-hook.ts
46
49
  import { basename } from "path";
@@ -1,19 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePreToolUse
4
- } from "../chunk-5SO3CEGJ.js";
4
+ } from "../chunk-SDXF5I46.js";
5
5
  import "../chunk-CAJZAFVS.js";
6
6
  import {
7
7
  exitOnHelpFlag
8
- } from "../chunk-IIZZYUWK.js";
9
- import "../chunk-SP7OZXCQ.js";
8
+ } from "../chunk-WXFEK7KD.js";
9
+ import "../chunk-7OXIC7E3.js";
10
10
  import "../chunk-YHG74UFF.js";
11
- import "../chunk-HIIBSYFJ.js";
11
+ import "../chunk-5ZDYDU2Q.js";
12
12
  import "../chunk-WLGEY4UX.js";
13
- import "../chunk-HNTKTK5B.js";
13
+ import "../chunk-BSZYIAZL.js";
14
+ import "../chunk-SAF6HGAA.js";
15
+ import "../chunk-7QLSKOSU.js";
14
16
  import "../chunk-DQAN3JQP.js";
15
17
  import "../chunk-RN3NOEJF.js";
16
18
  import "../chunk-2UMNXADU.js";
19
+ import "../chunk-KZERVKTD.js";
17
20
 
18
21
  // bin/pushary-hook.ts
19
22
  exitOnHelpFlag("hook");
@@ -1,37 +1,41 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runBrowserLogin
4
- } from "../chunk-QHOVJXOT.js";
4
+ } from "../chunk-Z3Z4VK5F.js";
5
5
  import "../chunk-3EGEA4KH.js";
6
- import {
7
- parseFlags
8
- } from "../chunk-N4DA4CJB.js";
9
6
  import {
10
7
  readKeySource,
11
8
  writeKey
12
- } from "../chunk-247C4RE5.js";
9
+ } from "../chunk-COC6NPWG.js";
10
+ import "../chunk-6MTNS63X.js";
13
11
  import {
14
12
  checkApiKey,
15
13
  describeKeyCheck
16
- } from "../chunk-YJ7YZRVV.js";
14
+ } from "../chunk-G4TARJAY.js";
17
15
  import {
18
16
  createIo
19
17
  } from "../chunk-TX7KBKT7.js";
20
18
  import {
21
- UsageError
22
- } from "../chunk-7QLSKOSU.js";
19
+ parseFlags
20
+ } from "../chunk-GMXKITVA.js";
23
21
  import "../chunk-BC3VCZ3E.js";
24
22
  import {
25
23
  exitOnHelpFlag
26
- } from "../chunk-IIZZYUWK.js";
24
+ } from "../chunk-WXFEK7KD.js";
27
25
  import {
28
- EXIT,
29
26
  getPackageVersion
30
- } from "../chunk-SP7OZXCQ.js";
27
+ } from "../chunk-7OXIC7E3.js";
28
+ import "../chunk-SAF6HGAA.js";
29
+ import {
30
+ UsageError
31
+ } from "../chunk-7QLSKOSU.js";
31
32
  import {
32
33
  isValidApiKey
33
34
  } from "../chunk-DQAN3JQP.js";
34
35
  import "../chunk-2UMNXADU.js";
36
+ import {
37
+ EXIT
38
+ } from "../chunk-KZERVKTD.js";
35
39
 
36
40
  // bin/pushary-login.ts
37
41
  exitOnHelpFlag("login");
@@ -2,30 +2,32 @@
2
2
  import {
3
3
  codexConfigToml
4
4
  } from "../chunk-ER657KRJ.js";
5
- import {
6
- parseFlags
7
- } from "../chunk-N4DA4CJB.js";
8
5
  import {
9
6
  clearKey,
10
7
  readKeySource
11
- } from "../chunk-247C4RE5.js";
8
+ } from "../chunk-COC6NPWG.js";
9
+ import "../chunk-6MTNS63X.js";
12
10
  import {
13
11
  createIo
14
12
  } from "../chunk-TX7KBKT7.js";
15
13
  import {
16
- UsageError
17
- } from "../chunk-7QLSKOSU.js";
14
+ parseFlags
15
+ } from "../chunk-GMXKITVA.js";
18
16
  import "../chunk-BC3VCZ3E.js";
19
17
  import {
20
18
  exitOnHelpFlag
21
- } from "../chunk-IIZZYUWK.js";
19
+ } from "../chunk-WXFEK7KD.js";
20
+ import "../chunk-7OXIC7E3.js";
22
21
  import {
23
- EXIT
24
- } from "../chunk-SP7OZXCQ.js";
22
+ UsageError
23
+ } from "../chunk-7QLSKOSU.js";
25
24
  import "../chunk-DQAN3JQP.js";
26
25
  import {
27
26
  getBaseUrl
28
27
  } from "../chunk-2UMNXADU.js";
28
+ import {
29
+ EXIT
30
+ } from "../chunk-KZERVKTD.js";
29
31
 
30
32
  // bin/pushary-logout.ts
31
33
  import { existsSync } from "fs";
@@ -1,23 +1,30 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  exitOnFailedResponse
4
- } from "../chunk-ONVEYEVR.js";
5
- import "../chunk-YJ7YZRVV.js";
4
+ } from "../chunk-SR52774M.js";
5
+ import "../chunk-G4TARJAY.js";
6
6
  import {
7
7
  createIo
8
8
  } from "../chunk-TX7KBKT7.js";
9
- import "../chunk-7QLSKOSU.js";
9
+ import {
10
+ rejectUnknownFlags
11
+ } from "../chunk-GMXKITVA.js";
10
12
  import {
11
13
  exitOnHelpFlag
12
- } from "../chunk-IIZZYUWK.js";
14
+ } from "../chunk-WXFEK7KD.js";
15
+ import "../chunk-7OXIC7E3.js";
16
+ import "../chunk-SAF6HGAA.js";
13
17
  import {
14
- EXIT
15
- } from "../chunk-SP7OZXCQ.js";
18
+ UsageError
19
+ } from "../chunk-7QLSKOSU.js";
16
20
  import "../chunk-DQAN3JQP.js";
17
21
  import {
18
22
  getApiKey,
19
23
  getBaseUrl
20
24
  } from "../chunk-2UMNXADU.js";
25
+ import {
26
+ EXIT
27
+ } from "../chunk-KZERVKTD.js";
21
28
 
22
29
  // bin/pushary-mode.ts
23
30
  exitOnHelpFlag("mode");
@@ -29,6 +36,17 @@ var parseDuration = (value) => {
29
36
  const num = Number(match[1]);
30
37
  return match[2] === "h" ? num * 3600 : num * 60;
31
38
  };
39
+ {
40
+ const raw = process.argv.slice(2);
41
+ const positional = raw[0] === "mode" ? raw.slice(1) : raw;
42
+ try {
43
+ rejectUnknownFlags(positional, ["--for"]);
44
+ } catch (err) {
45
+ process.stderr.write(` ! ${err instanceof Error ? err.message : String(err)}
46
+ `);
47
+ process.exit(EXIT.USAGE);
48
+ }
49
+ }
32
50
  var main = async () => {
33
51
  const apiKey = getApiKey();
34
52
  const baseUrl = getBaseUrl();
@@ -92,6 +110,11 @@ var main = async () => {
92
110
  }
93
111
  };
94
112
  main().catch((err) => {
113
+ if (err instanceof UsageError) {
114
+ process.stderr.write(` ! ${err.message}
115
+ `);
116
+ process.exit(EXIT.USAGE);
117
+ }
95
118
  console.error(` ${yellow("!")} ${err instanceof Error ? err.message : err}`);
96
119
  process.exit(1);
97
120
  });
@@ -1,11 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handleNotification
4
- } from "../chunk-HIIBSYFJ.js";
5
- import "../chunk-HNTKTK5B.js";
4
+ } from "../chunk-5ZDYDU2Q.js";
5
+ import "../chunk-BSZYIAZL.js";
6
+ import "../chunk-SAF6HGAA.js";
7
+ import "../chunk-7QLSKOSU.js";
6
8
  import "../chunk-DQAN3JQP.js";
7
9
  import "../chunk-RN3NOEJF.js";
8
10
  import "../chunk-2UMNXADU.js";
11
+ import "../chunk-KZERVKTD.js";
9
12
 
10
13
  // bin/pushary-notification-hook.ts
11
14
  var main = async () => {
@@ -1,15 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePermissionDenied
4
- } from "../chunk-5SO3CEGJ.js";
4
+ } from "../chunk-SDXF5I46.js";
5
5
  import "../chunk-CAJZAFVS.js";
6
6
  import "../chunk-YHG74UFF.js";
7
- import "../chunk-HIIBSYFJ.js";
7
+ import "../chunk-5ZDYDU2Q.js";
8
8
  import "../chunk-WLGEY4UX.js";
9
- import "../chunk-HNTKTK5B.js";
9
+ import "../chunk-BSZYIAZL.js";
10
+ import "../chunk-SAF6HGAA.js";
11
+ import "../chunk-7QLSKOSU.js";
10
12
  import "../chunk-DQAN3JQP.js";
11
13
  import "../chunk-RN3NOEJF.js";
12
14
  import "../chunk-2UMNXADU.js";
15
+ import "../chunk-KZERVKTD.js";
13
16
 
14
17
  // bin/pushary-permission-denied-hook.ts
15
18
  var main = async () => {
@@ -1,15 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePermissionRequest
4
- } from "../chunk-5SO3CEGJ.js";
4
+ } from "../chunk-SDXF5I46.js";
5
5
  import "../chunk-CAJZAFVS.js";
6
6
  import "../chunk-YHG74UFF.js";
7
- import "../chunk-HIIBSYFJ.js";
7
+ import "../chunk-5ZDYDU2Q.js";
8
8
  import "../chunk-WLGEY4UX.js";
9
- import "../chunk-HNTKTK5B.js";
9
+ import "../chunk-BSZYIAZL.js";
10
+ import "../chunk-SAF6HGAA.js";
11
+ import "../chunk-7QLSKOSU.js";
10
12
  import "../chunk-DQAN3JQP.js";
11
13
  import "../chunk-RN3NOEJF.js";
12
14
  import "../chunk-2UMNXADU.js";
15
+ import "../chunk-KZERVKTD.js";
13
16
 
14
17
  // bin/pushary-permission-hook.ts
15
18
  var main = async () => {
@@ -1,11 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePostToolUse
4
- } from "../chunk-HIIBSYFJ.js";
5
- import "../chunk-HNTKTK5B.js";
4
+ } from "../chunk-5ZDYDU2Q.js";
5
+ import "../chunk-BSZYIAZL.js";
6
+ import "../chunk-SAF6HGAA.js";
7
+ import "../chunk-7QLSKOSU.js";
6
8
  import "../chunk-DQAN3JQP.js";
7
9
  import "../chunk-RN3NOEJF.js";
8
10
  import "../chunk-2UMNXADU.js";
11
+ import "../chunk-KZERVKTD.js";
9
12
 
10
13
  // bin/pushary-post-hook.ts
11
14
  var main = async () => {