@pushary/agent-hooks 0.25.0 → 0.26.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.
- package/dist/bin/pushary-clean.js +1 -1
- package/dist/bin/pushary-codex-hook.js +1 -1
- package/dist/bin/pushary-codex.js +1 -1
- package/dist/bin/pushary-doctor.js +21 -9
- package/dist/bin/pushary-gemini-hook.js +1 -1
- package/dist/bin/pushary-hook.js +2 -2
- package/dist/bin/pushary-post-hook.js +1 -1
- package/dist/bin/pushary-prompt-hook.js +1 -1
- package/dist/bin/pushary-setup.js +7 -19
- package/dist/bin/pushary-stop-hook.js +1 -1
- package/dist/{chunk-GYPPVD3P.js → chunk-A7DQCA2N.js} +1 -1
- package/dist/{chunk-O2QL6U6G.js → chunk-SA4BDS7T.js} +1 -1
- package/dist/{chunk-JPRRYC5X.js → chunk-SLX4AONG.js} +25 -0
- package/dist/src/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-22CV7V7A.js +0 -38
- package/dist/chunk-2BE2IPMO.js +0 -315
- package/dist/chunk-2CRLBMOX.js +0 -244
- package/dist/chunk-2HMNOZPY.js +0 -109
- package/dist/chunk-2I6DLXJN.js +0 -219
- package/dist/chunk-2Q6XPZ4Q.js +0 -395
- package/dist/chunk-3LC4YUMA.js +0 -194
- package/dist/chunk-3MIR7ODJ.js +0 -112
- package/dist/chunk-3QZESA66.js +0 -222
- package/dist/chunk-4Z4MB37G.js +0 -96
- package/dist/chunk-5GFUI5N6.js +0 -132
- package/dist/chunk-5JEDLXEC.js +0 -99
- package/dist/chunk-5LTQNC7R.js +0 -824
- package/dist/chunk-5QHQVXWN.js +0 -174
- package/dist/chunk-6A3WCJO2.js +0 -416
- package/dist/chunk-6QWFMVCD.js +0 -328
- package/dist/chunk-6SRXMZAN.js +0 -99
- package/dist/chunk-7PTU7TGE.js +0 -96
- package/dist/chunk-AB4KX4XT.js +0 -109
- package/dist/chunk-AC4UYAGX.js +0 -136
- package/dist/chunk-ACE77TKQ.js +0 -328
- package/dist/chunk-BHAMEPOP.js +0 -323
- package/dist/chunk-BYNYYZWW.js +0 -412
- package/dist/chunk-C5TFTNHG.js +0 -244
- package/dist/chunk-CH53PBQN.js +0 -265
- package/dist/chunk-DF3BM6BF.js +0 -195
- package/dist/chunk-DKZVKEOW.js +0 -175
- package/dist/chunk-EMPL27ZV.js +0 -96
- package/dist/chunk-EQJXMEIR.js +0 -175
- package/dist/chunk-FGZZRCOG.js +0 -194
- package/dist/chunk-FXYTRZHC.js +0 -177
- package/dist/chunk-GTJGZBTQ.js +0 -328
- package/dist/chunk-HJMFYDWY.js +0 -222
- package/dist/chunk-HRQEECB6.js +0 -315
- package/dist/chunk-HWEMAAOY.js +0 -370
- package/dist/chunk-IBWCHA5M.js +0 -10
- package/dist/chunk-KTM4ZQ3W.js +0 -96
- package/dist/chunk-KTP2EPVB.js +0 -27
- package/dist/chunk-KYARP7KP.js +0 -97
- package/dist/chunk-M2N5DYWN.js +0 -247
- package/dist/chunk-M4GDBGXF.js +0 -824
- package/dist/chunk-M5F2L4KF.js +0 -177
- package/dist/chunk-M6S3M6E3.js +0 -244
- package/dist/chunk-N7VXDBQU.js +0 -6
- package/dist/chunk-O6A5RHWY.js +0 -122
- package/dist/chunk-ODUXELPM.js +0 -219
- package/dist/chunk-OF5WIOYS.js +0 -129
- package/dist/chunk-OP4QAN23.js +0 -99
- package/dist/chunk-P4JH2Q7Z.js +0 -102
- package/dist/chunk-PMD5JSV3.js +0 -242
- package/dist/chunk-PSSHNBEL.js +0 -177
- package/dist/chunk-QEPRH7JB.js +0 -315
- package/dist/chunk-QRXWPZKN.js +0 -308
- package/dist/chunk-QY4L6XHN.js +0 -384
- package/dist/chunk-RNWPCELY.js +0 -176
- package/dist/chunk-RSHN2AQ7.js +0 -29
- package/dist/chunk-RZLVE57X.js +0 -38
- package/dist/chunk-SDCIKREA.js +0 -241
- package/dist/chunk-SDREQWNI.js +0 -175
- package/dist/chunk-SH26ZOHU.js +0 -159
- package/dist/chunk-TRLBBLSS.js +0 -176
- package/dist/chunk-U6OXZPYC.js +0 -384
- package/dist/chunk-UIBTFZUD.js +0 -314
- package/dist/chunk-USUCPCUC.js +0 -156
- package/dist/chunk-V4GLWPD7.js +0 -174
- package/dist/chunk-VC6U3QGF.js +0 -142
- package/dist/chunk-VIST7ACL.js +0 -88
- package/dist/chunk-VUNL35KE.js +0 -16
- package/dist/chunk-VWBNI4SC.js +0 -174
- package/dist/chunk-W5KRWUNE.js +0 -262
- package/dist/chunk-WCGKLHCL.js +0 -154
- package/dist/chunk-WNXGIEX7.js +0 -219
- package/dist/chunk-WPVL6VIT.js +0 -160
- package/dist/chunk-XPVSZIA3.js +0 -315
- package/dist/chunk-Y633ZIJF.js +0 -384
- package/dist/chunk-YCL4GUFR.js +0 -222
- package/dist/chunk-YTMKB44I.js +0 -220
- package/dist/chunk-ZWBS3T7Q.js +0 -244
- package/dist/pushary-mode-T7XOPI6Z.js +0 -83
|
@@ -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
|
-
});
|