@pushary/agent-hooks 1.6.3 → 1.7.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/CHANGELOG.md +13 -0
- package/README.md +3 -2
- package/dist/bin/pushary-bell-hook.js +24 -22
- package/dist/bin/pushary-bell.js +11 -12
- package/dist/bin/pushary-claude.js +29 -28
- package/dist/bin/pushary-clean.js +99 -40
- package/dist/bin/pushary-codex-bridge.js +25 -25
- package/dist/bin/pushary-codex-hook.js +39 -34
- package/dist/bin/pushary-codex.js +13 -12
- package/dist/bin/pushary-connect.js +13 -12
- package/dist/bin/pushary-cowork.js +5 -6
- package/dist/bin/pushary-daemon.js +31 -32
- package/dist/bin/pushary-disconnect.js +22 -21
- package/dist/bin/pushary-doctor.js +98 -61
- package/dist/bin/pushary-elicitation-hook.js +26 -25
- package/dist/bin/pushary-gemini-bridge.js +12 -13
- package/dist/bin/pushary-gemini-hook.js +35 -30
- package/dist/bin/pushary-hook.js +38 -33
- package/dist/bin/pushary-login.js +13 -15
- package/dist/bin/pushary-logout.js +12 -13
- package/dist/bin/pushary-mcp.d.ts +1 -0
- package/dist/bin/pushary-mcp.js +56 -0
- package/dist/bin/pushary-mode.js +10 -8
- package/dist/bin/pushary-notification-hook.js +28 -27
- package/dist/bin/pushary-opencode-hook.js +34 -29
- package/dist/bin/pushary-permission-denied-hook.js +32 -31
- package/dist/bin/pushary-permission-hook.js +31 -30
- package/dist/bin/pushary-post-hook.js +28 -27
- package/dist/bin/pushary-prompt-hook.js +28 -27
- package/dist/bin/pushary-session-end-hook.js +28 -27
- package/dist/bin/pushary-session-start-hook.js +32 -31
- package/dist/bin/pushary-setup.js +222 -110
- package/dist/bin/pushary-stats.js +5 -6
- package/dist/bin/pushary-status.js +15 -16
- package/dist/bin/pushary-stop-hook.js +28 -27
- package/dist/bin/pushary-stopfailure-hook.js +28 -27
- package/dist/bin/pushary-suggestions.js +4 -4
- package/dist/bin/pushary-transcript-register.js +19 -20
- package/dist/bin/pushary-transcripts.js +7 -8
- package/dist/bin/pushary-upgrade.js +28 -28
- package/dist/bin/pushary-wait.js +10 -8
- package/dist/bin/pushary.js +9 -5
- package/dist/{chunk-4KSTLHWY.js → chunk-2C7CCWVX.js} +1 -1
- package/dist/{chunk-P4BNYJ5Q.js → chunk-2PS6QWDW.js} +2 -2
- package/dist/{chunk-ILGL4L3J.js → chunk-4F46VIEE.js} +8 -8
- package/dist/{chunk-UAV5MNKY.js → chunk-52NVBNJT.js} +3 -3
- package/dist/{chunk-GQPCPEG2.js → chunk-5HLTWFJ6.js} +1 -1
- package/dist/{chunk-EJ7ADMNM.js → chunk-6ADZQFVW.js} +1 -1
- package/dist/{chunk-QKOVVL7I.js → chunk-73T6MSU5.js} +7 -7
- package/dist/{chunk-YOCXPNQ5.js → chunk-7OS4IHGI.js} +2 -2
- package/dist/{chunk-BY2CRWBO.js → chunk-B234346F.js} +1 -1
- package/dist/{chunk-EA3IELHP.js → chunk-B3UXMSMW.js} +6 -2
- package/dist/{chunk-STOMNX4S.js → chunk-B3YQANFN.js} +1 -1
- package/dist/{chunk-JBU7XKY2.js → chunk-B76WVEDX.js} +1 -1
- package/dist/{chunk-WA7SQX6S.js → chunk-BBKNJJVX.js} +6 -6
- package/dist/{chunk-KNIIFNNQ.js → chunk-BH2SKSSK.js} +1 -1
- package/dist/{chunk-CTOK3AYA.js → chunk-BWYJ6AAF.js} +6 -7
- package/dist/{chunk-HCVAMXHT.js → chunk-CVALVGA7.js} +1 -1
- package/dist/{chunk-DX5FOQSO.js → chunk-D6BULEJW.js} +2 -2
- package/dist/{chunk-RJUHSFYE.js → chunk-DANOZVZK.js} +1 -1
- package/dist/{chunk-3BJQYXTL.js → chunk-DNJUSFBL.js} +13 -5
- package/dist/{chunk-57YDFAPP.js → chunk-DVQDPI3T.js} +8 -8
- package/dist/{chunk-BEHGVU4W.js → chunk-DZURML2D.js} +1 -1
- package/dist/{chunk-LDS4ERW4.js → chunk-EAQMWJPG.js} +10 -10
- package/dist/{chunk-LVHGSD5E.js → chunk-EGKXSQCY.js} +13 -7
- package/dist/{chunk-HHYVBHHC.js → chunk-HDRNWNVP.js} +6 -6
- package/dist/{chunk-JBXUKGZS.js → chunk-IJ6ECPA6.js} +15 -9
- package/dist/{chunk-NMRH3VX4.js → chunk-J2355HR7.js} +1 -1
- package/dist/{chunk-HETOKNIL.js → chunk-JNXVOU6Y.js} +10 -6
- package/dist/{chunk-COGHCL6K.js → chunk-JXUAXO74.js} +2 -2
- package/dist/chunk-KW2RRR7D.js +124 -0
- package/dist/{chunk-66H2QQAK.js → chunk-KXMZMZD3.js} +1 -1
- package/dist/{chunk-H3FEVIQD.js → chunk-KYQXUGH7.js} +3 -3
- package/dist/{chunk-P35IUFFR.js → chunk-L4H2Q2S4.js} +276 -19
- package/dist/{chunk-NKR4YDRP.js → chunk-LEZFOTMI.js} +1 -1
- package/dist/{chunk-WD6W7QDI.js → chunk-O2LEPIU6.js} +1 -1
- package/dist/chunk-POFBE6ZY.js +12 -0
- package/dist/{chunk-SND3C2AV.js → chunk-PQ4F64M2.js} +3 -3
- package/dist/{chunk-3UOC3GRO.js → chunk-PUDBG3GM.js} +1 -1
- package/dist/{chunk-YQMFGWBD.js → chunk-QXAK5RFU.js} +1 -1
- package/dist/{chunk-REYWOCQJ.js → chunk-R2XCLT6I.js} +4 -4
- package/dist/{chunk-NPGOQQCV.js → chunk-ROQK7IN3.js} +2 -2
- package/dist/{chunk-GU3EJCVV.js → chunk-S3UD4V6W.js} +39 -0
- package/dist/{chunk-ICGAIM2R.js → chunk-SQRWHALT.js} +2 -2
- package/dist/{chunk-JX67DVMY.js → chunk-UC65FJJT.js} +5 -6
- package/dist/{chunk-CWIARY6F.js → chunk-UOAQ6QMP.js} +2 -2
- package/dist/{chunk-OSJEMXSR.js → chunk-V4AQBAVG.js} +1 -1
- package/dist/chunk-V6QRSU2G.js +142 -0
- package/dist/{chunk-VDMX5EMU.js → chunk-VKVIAZQO.js} +1 -1
- package/dist/{chunk-BG6OCZ4N.js → chunk-WUNZAE7I.js} +5 -5
- package/dist/{chunk-TZ4KUNZG.js → chunk-X6KDKOV5.js} +3 -3
- package/dist/{chunk-LM2IOEDK.js → chunk-XNCMT7YY.js} +3 -1
- package/dist/{chunk-GHOB245Q.js → chunk-YROGUPOZ.js} +132 -30
- package/dist/chunk-YYINL576.js +120 -0
- package/dist/{chunk-57DDP4TB.js → chunk-ZQ7IDOKY.js} +3 -3
- package/dist/{reapply-IB7YE7BU.js → reapply-6PH3FMPX.js} +9 -10
- package/dist/src/index.js +20 -19
- package/package.json +2 -1
- package/dist/chunk-HWJW3CPO.js +0 -65
- package/dist/chunk-SAF6HGAA.js +0 -57
package/dist/src/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-DVQDPI3T.js";
|
|
4
|
+
import "../chunk-WUNZAE7I.js";
|
|
5
|
+
import "../chunk-KYQXUGH7.js";
|
|
6
|
+
import "../chunk-52NVBNJT.js";
|
|
7
|
+
import "../chunk-2C7CCWVX.js";
|
|
8
8
|
import "../chunk-YHG74UFF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-ZQ7IDOKY.js";
|
|
10
10
|
import {
|
|
11
11
|
fetchAccountPublicKey
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-KXMZMZD3.js";
|
|
13
13
|
import {
|
|
14
14
|
fetchModeOverride,
|
|
15
15
|
fetchModeState,
|
|
@@ -18,30 +18,31 @@ import {
|
|
|
18
18
|
handlePostToolUse,
|
|
19
19
|
handleStop,
|
|
20
20
|
reportEvent
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-IJ6ECPA6.js";
|
|
22
|
+
import "../chunk-DZURML2D.js";
|
|
23
23
|
import {
|
|
24
24
|
askUser,
|
|
25
25
|
cancelQuestion,
|
|
26
26
|
waitForAnswer
|
|
27
|
-
} from "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
27
|
+
} from "../chunk-EGKXSQCY.js";
|
|
28
|
+
import "../chunk-V6QRSU2G.js";
|
|
29
|
+
import "../chunk-POFBE6ZY.js";
|
|
30
|
+
import "../chunk-JNXVOU6Y.js";
|
|
31
|
+
import "../chunk-KW2RRR7D.js";
|
|
32
|
+
import "../chunk-XNCMT7YY.js";
|
|
32
33
|
import "../chunk-7QLSKOSU.js";
|
|
33
34
|
import "../chunk-KZERVKTD.js";
|
|
34
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-ROQK7IN3.js";
|
|
36
|
+
import "../chunk-DNJUSFBL.js";
|
|
35
37
|
import "../chunk-T7E75EKA.js";
|
|
36
38
|
import {
|
|
37
39
|
getApiKey,
|
|
38
40
|
getBaseUrl
|
|
39
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-V4AQBAVG.js";
|
|
42
|
+
import "../chunk-B3UXMSMW.js";
|
|
40
43
|
import {
|
|
41
44
|
resolvePolicy
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-EA3IELHP.js";
|
|
44
|
-
import "../chunk-HWJW3CPO.js";
|
|
45
|
+
} from "../chunk-YROGUPOZ.js";
|
|
45
46
|
export {
|
|
46
47
|
askUser,
|
|
47
48
|
cancelQuestion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushary/agent-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pushary",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"pushary-connect": "./dist/bin/pushary-connect.js",
|
|
68
68
|
"pushary-doctor": "./dist/bin/pushary-doctor.js",
|
|
69
69
|
"pushary-mode": "./dist/bin/pushary-mode.js",
|
|
70
|
+
"pushary-mcp": "./dist/bin/pushary-mcp.js",
|
|
70
71
|
"pushary-wait": "./dist/bin/pushary-wait.js",
|
|
71
72
|
"pushary-stats": "./dist/bin/pushary-stats.js",
|
|
72
73
|
"pushary-suggestions": "./dist/bin/pushary-suggestions.js",
|
package/dist/chunk-HWJW3CPO.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// src/cli/version.ts
|
|
2
|
-
import { readFileSync } from "fs";
|
|
3
|
-
import { dirname, join, parse } from "path";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
5
|
-
var PACKAGE_NAME = "@pushary/agent-hooks";
|
|
6
|
-
var UNKNOWN_VERSION = "0.0.0";
|
|
7
|
-
var findOwnPackageJson = (start) => {
|
|
8
|
-
const { root } = parse(start);
|
|
9
|
-
let dir = start;
|
|
10
|
-
while (true) {
|
|
11
|
-
const candidate = join(dir, "package.json");
|
|
12
|
-
try {
|
|
13
|
-
const pkg = JSON.parse(readFileSync(candidate, "utf-8"));
|
|
14
|
-
if (pkg.name === PACKAGE_NAME) return candidate;
|
|
15
|
-
} catch {
|
|
16
|
-
}
|
|
17
|
-
if (dir === root) return void 0;
|
|
18
|
-
const parent = dirname(dir);
|
|
19
|
-
if (parent === dir) return void 0;
|
|
20
|
-
dir = parent;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var getPackageVersion = () => {
|
|
24
|
-
const root = ownPackageRoot();
|
|
25
|
-
return (root === void 0 ? void 0 : packageVersionAt(root)) ?? UNKNOWN_VERSION;
|
|
26
|
-
};
|
|
27
|
-
var ownPackageRoot = () => {
|
|
28
|
-
try {
|
|
29
|
-
const found = findOwnPackageJson(dirname(fileURLToPath(import.meta.url)));
|
|
30
|
-
return found ? dirname(found) : void 0;
|
|
31
|
-
} catch {
|
|
32
|
-
return void 0;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var packageVersionAt = (packageRoot) => {
|
|
36
|
-
try {
|
|
37
|
-
const manifest = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf-8"));
|
|
38
|
-
const version = manifest && typeof manifest === "object" && "version" in manifest ? manifest.version : void 0;
|
|
39
|
-
return typeof version === "string" ? version : void 0;
|
|
40
|
-
} catch {
|
|
41
|
-
return void 0;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var isNewerVersion = (candidate, current) => {
|
|
45
|
-
const a = candidate.split(".").map((part) => parseInt(part, 10) || 0);
|
|
46
|
-
const b = current.split(".").map((part) => parseInt(part, 10) || 0);
|
|
47
|
-
for (let i = 0; i < 3; i++) {
|
|
48
|
-
if ((a[i] ?? 0) > (b[i] ?? 0)) return true;
|
|
49
|
-
if ((a[i] ?? 0) < (b[i] ?? 0)) return false;
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
};
|
|
53
|
-
var RELEASE_VERSION = /^\d+\.\d+\.\d+$/;
|
|
54
|
-
var isReleaseVersion = (value) => RELEASE_VERSION.test(value);
|
|
55
|
-
var majorOf = (version) => parseInt(version.split(".")[0] ?? "", 10) || 0;
|
|
56
|
-
var isSameMajorVersion = (candidate, current) => majorOf(candidate) === majorOf(current);
|
|
57
|
-
|
|
58
|
-
export {
|
|
59
|
-
getPackageVersion,
|
|
60
|
-
ownPackageRoot,
|
|
61
|
-
packageVersionAt,
|
|
62
|
-
isNewerVersion,
|
|
63
|
-
isReleaseVersion,
|
|
64
|
-
isSameMajorVersion
|
|
65
|
-
};
|
package/dist/chunk-SAF6HGAA.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
};
|