@pushary/agent-hooks 0.28.1 → 0.28.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 (97) hide show
  1. package/package.json +1 -1
  2. package/dist/chunk-22CV7V7A.js +0 -38
  3. package/dist/chunk-2BE2IPMO.js +0 -315
  4. package/dist/chunk-2CRLBMOX.js +0 -244
  5. package/dist/chunk-2HMNOZPY.js +0 -109
  6. package/dist/chunk-2I6DLXJN.js +0 -219
  7. package/dist/chunk-2Q6XPZ4Q.js +0 -395
  8. package/dist/chunk-3LC4YUMA.js +0 -194
  9. package/dist/chunk-3MIR7ODJ.js +0 -112
  10. package/dist/chunk-3QZESA66.js +0 -222
  11. package/dist/chunk-4Z4MB37G.js +0 -96
  12. package/dist/chunk-5GFUI5N6.js +0 -132
  13. package/dist/chunk-5JEDLXEC.js +0 -99
  14. package/dist/chunk-5LTQNC7R.js +0 -824
  15. package/dist/chunk-5MA3CPZB.js +0 -141
  16. package/dist/chunk-5QHQVXWN.js +0 -174
  17. package/dist/chunk-5V3XJ2ES.js +0 -357
  18. package/dist/chunk-6A3WCJO2.js +0 -416
  19. package/dist/chunk-6QWFMVCD.js +0 -328
  20. package/dist/chunk-6SRXMZAN.js +0 -99
  21. package/dist/chunk-7OXL2QQ4.js +0 -357
  22. package/dist/chunk-7PTU7TGE.js +0 -96
  23. package/dist/chunk-AB4KX4XT.js +0 -109
  24. package/dist/chunk-AC4UYAGX.js +0 -136
  25. package/dist/chunk-ACE77TKQ.js +0 -328
  26. package/dist/chunk-BHAMEPOP.js +0 -323
  27. package/dist/chunk-BYNYYZWW.js +0 -412
  28. package/dist/chunk-C4BMEVK7.js +0 -208
  29. package/dist/chunk-C5TFTNHG.js +0 -244
  30. package/dist/chunk-CH53PBQN.js +0 -265
  31. package/dist/chunk-DF3BM6BF.js +0 -195
  32. package/dist/chunk-DKZVKEOW.js +0 -175
  33. package/dist/chunk-EMPL27ZV.js +0 -96
  34. package/dist/chunk-EQJXMEIR.js +0 -175
  35. package/dist/chunk-FB3N633T.js +0 -145
  36. package/dist/chunk-FGZZRCOG.js +0 -194
  37. package/dist/chunk-FXYTRZHC.js +0 -177
  38. package/dist/chunk-GTJGZBTQ.js +0 -328
  39. package/dist/chunk-GYPPVD3P.js +0 -1047
  40. package/dist/chunk-HJMFYDWY.js +0 -222
  41. package/dist/chunk-HRQEECB6.js +0 -315
  42. package/dist/chunk-HWEMAAOY.js +0 -370
  43. package/dist/chunk-I4GMPUYN.js +0 -231
  44. package/dist/chunk-IBWCHA5M.js +0 -10
  45. package/dist/chunk-JPRRYC5X.js +0 -328
  46. package/dist/chunk-KTM4ZQ3W.js +0 -96
  47. package/dist/chunk-KTP2EPVB.js +0 -27
  48. package/dist/chunk-KYARP7KP.js +0 -97
  49. package/dist/chunk-LXUHXG2X.js +0 -937
  50. package/dist/chunk-M2N5DYWN.js +0 -247
  51. package/dist/chunk-M4GDBGXF.js +0 -824
  52. package/dist/chunk-M5F2L4KF.js +0 -177
  53. package/dist/chunk-M6S3M6E3.js +0 -244
  54. package/dist/chunk-N7VXDBQU.js +0 -6
  55. package/dist/chunk-O2QL6U6G.js +0 -194
  56. package/dist/chunk-O6A5RHWY.js +0 -122
  57. package/dist/chunk-ODUXELPM.js +0 -219
  58. package/dist/chunk-OF5WIOYS.js +0 -129
  59. package/dist/chunk-OP4QAN23.js +0 -99
  60. package/dist/chunk-P4JH2Q7Z.js +0 -102
  61. package/dist/chunk-PMD5JSV3.js +0 -242
  62. package/dist/chunk-PSSHNBEL.js +0 -177
  63. package/dist/chunk-PZO7RZ5W.js +0 -145
  64. package/dist/chunk-QEPRH7JB.js +0 -315
  65. package/dist/chunk-QRXWPZKN.js +0 -308
  66. package/dist/chunk-QY4L6XHN.js +0 -384
  67. package/dist/chunk-RNWPCELY.js +0 -176
  68. package/dist/chunk-RSHN2AQ7.js +0 -29
  69. package/dist/chunk-RZLVE57X.js +0 -38
  70. package/dist/chunk-SDCIKREA.js +0 -241
  71. package/dist/chunk-SDREQWNI.js +0 -175
  72. package/dist/chunk-SH26ZOHU.js +0 -159
  73. package/dist/chunk-SJ5MC36D.js +0 -882
  74. package/dist/chunk-TRLBBLSS.js +0 -176
  75. package/dist/chunk-U6OXZPYC.js +0 -384
  76. package/dist/chunk-UDQZNO5H.js +0 -231
  77. package/dist/chunk-UIBTFZUD.js +0 -314
  78. package/dist/chunk-USUCPCUC.js +0 -156
  79. package/dist/chunk-UTK3TJC4.js +0 -882
  80. package/dist/chunk-V4GLWPD7.js +0 -174
  81. package/dist/chunk-VC6U3QGF.js +0 -142
  82. package/dist/chunk-VIST7ACL.js +0 -88
  83. package/dist/chunk-VUNL35KE.js +0 -16
  84. package/dist/chunk-VWBNI4SC.js +0 -174
  85. package/dist/chunk-W5KRWUNE.js +0 -262
  86. package/dist/chunk-WCGKLHCL.js +0 -154
  87. package/dist/chunk-WNXGIEX7.js +0 -219
  88. package/dist/chunk-WPVL6VIT.js +0 -160
  89. package/dist/chunk-X6LV22NZ.js +0 -229
  90. package/dist/chunk-XHTZ2DWC.js +0 -206
  91. package/dist/chunk-XPVSZIA3.js +0 -315
  92. package/dist/chunk-Y633ZIJF.js +0 -384
  93. package/dist/chunk-YCL4GUFR.js +0 -222
  94. package/dist/chunk-YTMKB44I.js +0 -220
  95. package/dist/chunk-ZWBS3T7Q.js +0 -244
  96. package/dist/pushary-mode-T7XOPI6Z.js +0 -83
  97. package/dist/pushary-wait-4BUC6ZM6.js +0 -93
@@ -1,83 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- getApiKey,
4
- getBaseUrl
5
- } from "./chunk-VUNL35KE.js";
6
-
7
- // bin/pushary-mode.ts
8
- var VALID_MODES = ["push_only", "push_first", "terminal_only", "notify_only"];
9
- var dim = (s) => `\x1B[2m${s}\x1B[0m`;
10
- var green = (s) => `\x1B[32m${s}\x1B[0m`;
11
- var cyan = (s) => `\x1B[36m${s}\x1B[0m`;
12
- var yellow = (s) => `\x1B[33m${s}\x1B[0m`;
13
- var parseDuration = (value) => {
14
- const match = value.match(/^(\d+)(m|h)$/);
15
- if (!match) return null;
16
- const num = Number(match[1]);
17
- return match[2] === "h" ? num * 3600 : num * 60;
18
- };
19
- var main = async () => {
20
- const apiKey = getApiKey();
21
- const baseUrl = getBaseUrl();
22
- const mode = process.argv[2];
23
- const forFlag = process.argv[3];
24
- const forValue = process.argv[4];
25
- const headers = {
26
- "Authorization": `Bearer ${apiKey}`,
27
- "Content-Type": "application/json"
28
- };
29
- if (!mode || mode === "status") {
30
- const res2 = await fetch(`${baseUrl}/api/mcp/mode`, { headers });
31
- const data2 = await res2.json();
32
- if (!data2.override) {
33
- console.log(` Mode: ${cyan("default")} ${dim("(using per-tool policies)")}`);
34
- } else {
35
- console.log(` Mode: ${green(data2.override.mode)}`);
36
- if (data2.override.expiresAt) {
37
- console.log(` Expires: ${new Date(data2.override.expiresAt).toLocaleString()}`);
38
- } else {
39
- console.log(` ${dim("Sticky (no expiry)")}`);
40
- }
41
- }
42
- return;
43
- }
44
- if (mode === "clear" || mode === "reset") {
45
- await fetch(`${baseUrl}/api/mcp/mode`, { method: "DELETE", headers });
46
- console.log(` ${green("\u2713")} Mode override cleared \u2014 using per-tool policies`);
47
- return;
48
- }
49
- if (!VALID_MODES.includes(mode)) {
50
- console.log(` ${yellow("!")} Invalid mode: ${mode}`);
51
- console.log(` Valid modes: ${VALID_MODES.join(", ")}`);
52
- console.log(` ${dim("Usage: pushary mode <mode> [--for <duration>]")}`);
53
- console.log(` ${dim("Example: pushary mode push_only --for 30m")}`);
54
- return;
55
- }
56
- let ttlSeconds;
57
- if (forFlag === "--for" && forValue) {
58
- ttlSeconds = parseDuration(forValue);
59
- if (!ttlSeconds) {
60
- console.log(` ${yellow("!")} Invalid duration: ${forValue} ${dim("(use e.g. 30m, 1h)")}`);
61
- return;
62
- }
63
- }
64
- const res = await fetch(`${baseUrl}/api/mcp/mode`, {
65
- method: "PUT",
66
- headers,
67
- body: JSON.stringify({ mode, ttlSeconds })
68
- });
69
- if (!res.ok) {
70
- const err = await res.json();
71
- console.log(` ${yellow("!")} Failed: ${err.error ?? res.statusText}`);
72
- return;
73
- }
74
- const data = await res.json();
75
- console.log(` ${green("\u2713")} Mode set to ${cyan(data.override.mode)}`);
76
- if (data.override.expiresAt) {
77
- console.log(` Expires: ${new Date(data.override.expiresAt).toLocaleString()}`);
78
- }
79
- };
80
- main().catch((err) => {
81
- console.error(` ${yellow("!")} ${err instanceof Error ? err.message : err}`);
82
- process.exit(1);
83
- });
@@ -1,93 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- getApiKey,
4
- getBaseUrl
5
- } from "./chunk-NKXSILEW.js";
6
-
7
- // bin/pushary-wait.ts
8
- var dim = (s) => `\x1B[2m${s}\x1B[0m`;
9
- var bold = (s) => `\x1B[1m${s}\x1B[0m`;
10
- var green = (s) => `\x1B[32m${s}\x1B[0m`;
11
- var cyan = (s) => `\x1B[36m${s}\x1B[0m`;
12
- var yellow = (s) => `\x1B[33m${s}\x1B[0m`;
13
- var MAX_WINDOW = 300;
14
- var describeLadder = (p) => {
15
- if (p.mode === "terminal_only") return "decide in the terminal, no push";
16
- if (p.mode === "notify_only") return "send a heads-up, the terminal decides";
17
- if (p.mode === "push_only") {
18
- const tail = p.timeoutAction === "approve" ? "then auto-approve" : p.timeoutAction === "deny" ? "then auto-deny" : p.timeoutAction === "wait" ? "holding for your phone, then ask in the terminal" : "then ask in the terminal";
19
- if (p.timeoutAction === "wait") return `wait for your phone, ${tail}`;
20
- return `wait for your phone up to ${p.timeoutSeconds}s, ${tail}`;
21
- }
22
- return `ping your phone ${p.pushFirstSeconds}s, then ask in the terminal`;
23
- };
24
- var printLadder = (data) => {
25
- console.log();
26
- console.log(` ${bold("Wait ladder")} ${dim("(what happens when you don't answer)")}`);
27
- console.log();
28
- console.log(` Default push window: ${cyan(`${data.defaultPushFirstSeconds}s`)} ${dim("(catch-all tools)")}`);
29
- if (data.modeOverride) {
30
- console.log(` ${yellow("!")} Active mode override: ${cyan(data.modeOverride)} ${dim("(pushary mode status)")}`);
31
- }
32
- console.log();
33
- const rows = [...data.policies].sort((a, b) => a.tool === "*" ? -1 : b.tool === "*" ? 1 : a.tool.localeCompare(b.tool));
34
- const width = Math.max(...rows.map((p) => p.tool.length), 4);
35
- for (const p of rows) {
36
- const label = p.tool === "*" ? "default (*)" : p.tool;
37
- console.log(` ${label.padEnd(width + 2)} ${dim("\xB7")} ${describeLadder(p)}`);
38
- }
39
- console.log();
40
- console.log(` ${dim("Set the default window:")} ${cyan("pushary wait <seconds>")}`);
41
- console.log(` ${dim("Reset it:")} ${cyan("pushary wait clear")}`);
42
- console.log(` ${dim("Per-tool rules live in the dashboard under Agent \u2192 Policies.")}`);
43
- };
44
- var fetchPolicy = async (baseUrl, headers) => {
45
- const res = await fetch(`${baseUrl}/api/mcp/policy`, { headers });
46
- if (!res.ok) throw new Error(`policy fetch failed (${res.status})`);
47
- return res.json();
48
- };
49
- var setWindow = async (baseUrl, headers, seconds) => {
50
- const res = await fetch(`${baseUrl}/api/mcp/policy`, {
51
- method: "PATCH",
52
- headers,
53
- body: JSON.stringify({ defaultPushFirstSeconds: seconds })
54
- });
55
- if (!res.ok) {
56
- const err = await res.json().catch(() => ({}));
57
- throw new Error(err.error ?? res.statusText);
58
- }
59
- const data = await res.json();
60
- return data.defaultPushFirstSeconds;
61
- };
62
- var main = async () => {
63
- const apiKey = getApiKey();
64
- const baseUrl = getBaseUrl();
65
- const headers = {
66
- "Authorization": `Bearer ${apiKey}`,
67
- "Content-Type": "application/json"
68
- };
69
- const rest = process.argv.slice(2);
70
- const args = rest[0] === "wait" ? rest.slice(1) : rest;
71
- const arg = args[0];
72
- if (!arg || arg === "status") {
73
- printLadder(await fetchPolicy(baseUrl, headers));
74
- return;
75
- }
76
- if (arg === "clear" || arg === "reset") {
77
- const value2 = await setWindow(baseUrl, headers, 20);
78
- console.log(` ${green("\u2713")} Default push window reset to ${cyan(`${value2}s`)}`);
79
- return;
80
- }
81
- const seconds = Number(arg);
82
- if (!Number.isFinite(seconds) || seconds < 0 || seconds > MAX_WINDOW) {
83
- console.log(` ${yellow("!")} Invalid window: ${arg} ${dim(`(use 0-${MAX_WINDOW} seconds, or "status" / "clear")`)}`);
84
- console.log(` ${dim("Usage: pushary wait <seconds> | status | clear")}`);
85
- return;
86
- }
87
- const value = await setWindow(baseUrl, headers, Math.trunc(seconds));
88
- console.log(` ${green("\u2713")} Default push window set to ${cyan(`${value}s`)} ${dim("\u2014 ping your phone that long, then the terminal takes over")}`);
89
- };
90
- main().catch((err) => {
91
- console.error(` ${yellow("!")} ${err instanceof Error ? err.message : err}`);
92
- process.exit(1);
93
- });