@pushary/agent-hooks 0.69.0 → 0.71.0

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 (42) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +3 -2
  3. package/data/cursor-plugin/scripts/pushary-gate.mjs +34 -5
  4. package/data/vscode-plugin/scripts/pushary-gate.mjs +27 -2
  5. package/dist/bin/pushary-claude.js +2 -2
  6. package/dist/bin/pushary-clean.js +2 -2
  7. package/dist/bin/pushary-codex-hook.js +2 -2
  8. package/dist/bin/pushary-codex.js +1 -1
  9. package/dist/bin/pushary-connect.js +6 -4
  10. package/dist/bin/pushary-daemon.js +3 -3
  11. package/dist/bin/pushary-doctor.js +8 -29
  12. package/dist/bin/pushary-gemini-hook.js +2 -2
  13. package/dist/bin/pushary-hook.js +5 -5
  14. package/dist/bin/pushary-login.js +2 -2
  15. package/dist/bin/pushary-logout.js +2 -2
  16. package/dist/bin/pushary-mode.js +2 -2
  17. package/dist/bin/pushary-notification-hook.js +1 -1
  18. package/dist/bin/pushary-permission-denied-hook.js +3 -3
  19. package/dist/bin/pushary-permission-hook.js +3 -3
  20. package/dist/bin/pushary-post-hook.js +1 -1
  21. package/dist/bin/pushary-prompt-hook.js +1 -1
  22. package/dist/bin/pushary-session-end-hook.js +1 -1
  23. package/dist/bin/pushary-session-start-hook.js +1 -1
  24. package/dist/bin/pushary-setup.js +175 -34
  25. package/dist/bin/pushary-stats.js +2 -2
  26. package/dist/bin/pushary-status.js +4 -4
  27. package/dist/bin/pushary-stop-hook.js +1 -1
  28. package/dist/bin/pushary-stopfailure-hook.js +1 -1
  29. package/dist/bin/pushary-suggestions.js +2 -2
  30. package/dist/bin/pushary-upgrade.js +2 -2
  31. package/dist/bin/pushary-wait.js +2 -2
  32. package/dist/bin/pushary.js +1 -1
  33. package/dist/{chunk-JGH37QRB.js → chunk-7OYGFJYZ.js} +1 -1
  34. package/dist/chunk-B7R4YSAB.js +38 -0
  35. package/dist/{chunk-ATP6UQPH.js → chunk-BBK3TTU2.js} +1 -1
  36. package/dist/{chunk-H46LSQRT.js → chunk-FZIQSDTQ.js} +27 -12
  37. package/dist/{chunk-3USMXNVB.js → chunk-GD275GEX.js} +5 -3
  38. package/dist/{chunk-C5I2RAMT.js → chunk-HU43EZ5Q.js} +2 -2
  39. package/dist/{chunk-P7VBAYQO.js → chunk-MGFZXUUR.js} +32 -4
  40. package/dist/{chunk-YZT2CBC3.js → chunk-NQTRA7H5.js} +1 -1
  41. package/dist/src/index.js +3 -3
  42. package/package.json +1 -1
@@ -45,6 +45,27 @@ var describeReach = (channels) => {
45
45
  if (verdict.kind === "unattributable") return `${summary}, and no way to tell whose`;
46
46
  return summary;
47
47
  };
48
+ var describeAppRepair = (verdict) => {
49
+ switch (verdict.kind) {
50
+ case "yours":
51
+ return null;
52
+ case "nobody":
53
+ return [
54
+ "Open the Pushary app, sign in, and allow notifications.",
55
+ "If this terminal was never paired with your phone, run: npx @pushary/agent-hooks@latest setup --connect app"
56
+ ];
57
+ case "others":
58
+ return [
59
+ `Reachable devices belong to other members of this workspace (${verdict.otherMembers}).`,
60
+ "Sign in on the Pushary app with your own account so approvals can reach you."
61
+ ];
62
+ case "unattributable":
63
+ return [
64
+ "Something is reachable here, but not identifiably yours.",
65
+ "Sign in on the Pushary app so your approvals are routed to your device."
66
+ ];
67
+ }
68
+ };
48
69
 
49
70
  // src/cli/human.ts
50
71
  var stream = process.stdout;
@@ -324,7 +345,12 @@ var printQr = (url) => new Promise((resolve, reject) => {
324
345
  reject(err);
325
346
  }
326
347
  });
327
- var phoneFailure = (detail) => ({ reachesYou: false, outcome: null, detail });
348
+ var phoneFailure = (detail, repair) => ({
349
+ reachesYou: false,
350
+ outcome: null,
351
+ detail,
352
+ ...repair ? { repair } : {}
353
+ });
328
354
  var waitForDevice = async (apiKey, baseline) => {
329
355
  const deadline = Date.now() + CONNECT_TIMEOUT_MS;
330
356
  let consecutiveFailures = 0;
@@ -469,9 +495,11 @@ var confirmAppConnection = async (apiKey) => {
469
495
  const channels = probe.status;
470
496
  const ownedApp = channels.yours?.appDevices ?? channels.appDevices;
471
497
  if (channels.precise && ownedApp === 0) {
472
- console.log(` ${yellow("!")} Paired, but the app hasn't registered for notifications yet.`);
473
- console.log(` ${dim("Open the Pushary app and allow notifications, then run")} ${cyan("pushary doctor")}${dim(".")}`);
474
- return phoneFailure("app_not_registered");
498
+ const repair = describeAppRepair(reachVerdict(channels)) ?? [];
499
+ console.log(` ${yellow("!")} No device of yours is registered for notifications yet.`);
500
+ for (const line of repair) console.log(` ${dim(line)}`);
501
+ console.log(` ${dim("Then run")} ${cyan("pushary doctor")}${dim(".")}`);
502
+ return phoneFailure("app_not_registered", repair);
475
503
  }
476
504
  return sendAndConfirm(apiKey, channels);
477
505
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getPackageVersion
3
- } from "./chunk-JGH37QRB.js";
3
+ } from "./chunk-7OYGFJYZ.js";
4
4
  import {
5
5
  getMachineId
6
6
  } from "./chunk-RN3NOEJF.js";
package/dist/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-C5I2RAMT.js";
3
+ } from "../chunk-HU43EZ5Q.js";
4
4
  import "../chunk-CAJZAFVS.js";
5
- import "../chunk-3USMXNVB.js";
5
+ import "../chunk-GD275GEX.js";
6
6
  import {
7
7
  askUser,
8
8
  cancelQuestion,
@@ -15,7 +15,7 @@ import {
15
15
  reportEvent,
16
16
  resolvePolicy,
17
17
  waitForAnswer
18
- } from "../chunk-H46LSQRT.js";
18
+ } from "../chunk-FZIQSDTQ.js";
19
19
  import "../chunk-WLGEY4UX.js";
20
20
  import "../chunk-BSZYIAZL.js";
21
21
  import "../chunk-SAF6HGAA.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.69.0",
3
+ "version": "0.71.0",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",