@pushary/agent-hooks 0.62.1 → 0.62.3

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 (43) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/bin/pushary-claude.js +5 -2
  3. package/dist/bin/pushary-clean.js +3 -2
  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 +14 -12
  7. package/dist/bin/pushary-daemon.js +5 -4
  8. package/dist/bin/pushary-doctor.js +18 -13
  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 +13 -10
  12. package/dist/bin/pushary-logout.js +9 -8
  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 +33 -20
  22. package/dist/bin/pushary-stats.js +3 -2
  23. package/dist/bin/pushary-status.js +20 -7
  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 +6 -12
  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-IIZZYUWK.js → chunk-674M3JQF.js} +4 -2
  32. package/dist/{chunk-HNTKTK5B.js → chunk-BSZYIAZL.js} +4 -0
  33. package/dist/{chunk-YJ7YZRVV.js → chunk-G4TARJAY.js} +8 -54
  34. package/dist/{chunk-N4DA4CJB.js → chunk-GMXKITVA.js} +13 -0
  35. package/dist/{chunk-SP7OZXCQ.js → chunk-KVUBLB6K.js} +9 -13
  36. package/dist/chunk-KZERVKTD.js +16 -0
  37. package/dist/{chunk-3O27ZSRE.js → chunk-NGZMVCXN.js} +1 -1
  38. package/dist/chunk-SAF6HGAA.js +57 -0
  39. package/dist/{chunk-5SO3CEGJ.js → chunk-SDXF5I46.js} +1 -1
  40. package/dist/{chunk-ONVEYEVR.js → chunk-SR52774M.js} +2 -2
  41. package/dist/{chunk-QHOVJXOT.js → chunk-Z3Z4VK5F.js} +2 -1
  42. package/dist/src/index.js +6 -3
  43. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ import {
2
+ NetworkError
3
+ } from "./chunk-7QLSKOSU.js";
4
+
5
+ // src/cli/net.ts
6
+ import { createRequire } from "module";
7
+ var requireCjs = createRequire(import.meta.url);
8
+ var PROXY_VARS = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy"];
9
+ var proxyFromEnv = () => {
10
+ for (const name of PROXY_VARS) {
11
+ const value = process.env[name]?.trim();
12
+ if (value) return value;
13
+ }
14
+ return void 0;
15
+ };
16
+ var installed = false;
17
+ var installProxyDispatcher = () => {
18
+ if (installed) return;
19
+ installed = true;
20
+ if (!proxyFromEnv()) return;
21
+ try {
22
+ const { EnvHttpProxyAgent, setGlobalDispatcher } = requireCjs("undici");
23
+ setGlobalDispatcher(new EnvHttpProxyAgent());
24
+ } catch {
25
+ }
26
+ };
27
+ var isNetworkFailure = (err) => {
28
+ if (!(err instanceof Error)) return false;
29
+ const code = err.code;
30
+ if (code && ["ENOTFOUND", "ECONNREFUSED", "ECONNRESET", "ETIMEDOUT", "EAI_AGAIN", "EPROTO", "CERT_HAS_EXPIRED", "UNABLE_TO_VERIFY_LEAF_SIGNATURE"].includes(code)) {
31
+ return true;
32
+ }
33
+ return err.name === "AbortError" || err.name === "TimeoutError" || /fetch failed/i.test(err.message);
34
+ };
35
+ var DEFAULT_TIMEOUT_MS = 15e3;
36
+ var pusharyFetch = async (url, init = {}) => {
37
+ installProxyDispatcher();
38
+ const { timeoutMs = DEFAULT_TIMEOUT_MS, signal, ...rest } = init;
39
+ try {
40
+ return await fetch(url, {
41
+ ...rest,
42
+ signal: signal ?? AbortSignal.timeout(timeoutMs)
43
+ });
44
+ } catch (err) {
45
+ if (isNetworkFailure(err)) {
46
+ const proxy = proxyFromEnv();
47
+ const via = proxy ? ` (via proxy ${proxy})` : "";
48
+ throw new NetworkError(`Could not reach ${new URL(url).host}${via}: ${err instanceof Error ? err.message : String(err)}`);
49
+ }
50
+ throw err;
51
+ }
52
+ };
53
+
54
+ export {
55
+ installProxyDispatcher,
56
+ pusharyFetch
57
+ };
@@ -25,7 +25,7 @@ import {
25
25
  sendNotification,
26
26
  throttlePass,
27
27
  waitForAnswer
28
- } from "./chunk-HIIBSYFJ.js";
28
+ } from "./chunk-5ZDYDU2Q.js";
29
29
  import {
30
30
  isGatingMoment,
31
31
  recordKeylessMoment
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  describeKeyCheck,
3
3
  keyCheckFromResponse
4
- } from "./chunk-YJ7YZRVV.js";
4
+ } from "./chunk-G4TARJAY.js";
5
5
  import {
6
6
  createIo
7
7
  } from "./chunk-TX7KBKT7.js";
8
8
  import {
9
9
  EXIT
10
- } from "./chunk-SP7OZXCQ.js";
10
+ } from "./chunk-KZERVKTD.js";
11
11
 
12
12
  // src/cli/report-key.ts
13
13
  var { dim, yellow } = createIo();
@@ -227,7 +227,8 @@ var runBrowserLogin = async (ui, options, deps = {}) => {
227
227
  } else if (state2.kind === "payment-required") {
228
228
  ui.say(` ${ui.yellow("!")} A plan is needed before a key can be issued. Nothing was created yet.`);
229
229
  ui.say(` ${ui.dim("Choose one at")} ${ui.cyan(state2.checkoutUrl)}`);
230
- ui.say(` ${ui.dim("This terminal keeps the same code and finishes on its own once the plan is active.")}`);
230
+ ui.say(` ${ui.dim("Keep the browser tab open and this finishes on its own once the plan is active.")}`);
231
+ ui.say(` ${ui.dim("If you closed it, reopen the page and enter the same code again.")}`);
231
232
  if (!options.noBrowser && canOpenBrowser()) openInBrowser(state2.checkoutUrl);
232
233
  } else if (state2.kind === "unreachable") {
233
234
  ui.say(` ${ui.yellow("!")} Still trying. pushary.com is not answering ${ui.dim(`(${state2.detail})`)}`);
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-5SO3CEGJ.js";
3
+ } from "../chunk-SDXF5I46.js";
4
4
  import "../chunk-CAJZAFVS.js";
5
5
  import "../chunk-YHG74UFF.js";
6
6
  import {
@@ -15,15 +15,18 @@ import {
15
15
  reportEvent,
16
16
  resolvePolicy,
17
17
  waitForAnswer
18
- } from "../chunk-HIIBSYFJ.js";
18
+ } from "../chunk-5ZDYDU2Q.js";
19
19
  import "../chunk-WLGEY4UX.js";
20
- import "../chunk-HNTKTK5B.js";
20
+ import "../chunk-BSZYIAZL.js";
21
+ import "../chunk-SAF6HGAA.js";
22
+ import "../chunk-7QLSKOSU.js";
21
23
  import "../chunk-DQAN3JQP.js";
22
24
  import "../chunk-RN3NOEJF.js";
23
25
  import {
24
26
  getApiKey,
25
27
  getBaseUrl
26
28
  } from "../chunk-2UMNXADU.js";
29
+ import "../chunk-KZERVKTD.js";
27
30
  export {
28
31
  askUser,
29
32
  cancelQuestion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.62.1",
3
+ "version": "0.62.3",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",