@pushary/agent-hooks 1.7.0 → 1.7.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.
- package/CHANGELOG.md +28 -0
- package/dist/bin/pushary-bell-hook.js +23 -23
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +46 -35
- package/dist/bin/pushary-clean.js +194 -102
- package/dist/bin/pushary-codex-bridge.js +18 -17
- package/dist/bin/pushary-codex-hook.js +53 -39
- package/dist/bin/pushary-codex.js +14 -12
- package/dist/bin/pushary-connect.js +16 -16
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +27 -27
- package/dist/bin/pushary-disconnect.js +19 -17
- package/dist/bin/pushary-doctor.js +99 -43
- package/dist/bin/pushary-elicitation-hook.js +35 -26
- package/dist/bin/pushary-gemini-bridge.js +12 -12
- package/dist/bin/pushary-gemini-hook.js +47 -32
- package/dist/bin/pushary-hook.js +34 -32
- package/dist/bin/pushary-login.js +16 -16
- package/dist/bin/pushary-logout.js +8 -8
- package/dist/bin/pushary-mcp.js +9 -8
- package/dist/bin/pushary-mode.js +10 -10
- package/dist/bin/pushary-notification-hook.js +29 -27
- package/dist/bin/pushary-opencode-hook.js +46 -32
- package/dist/bin/pushary-permission-denied-hook.js +34 -32
- package/dist/bin/pushary-permission-hook.js +33 -31
- package/dist/bin/pushary-post-hook.js +29 -27
- package/dist/bin/pushary-prompt-hook.js +29 -27
- package/dist/bin/pushary-session-end-hook.js +29 -27
- package/dist/bin/pushary-session-start-hook.js +33 -31
- package/dist/bin/pushary-setup.js +143 -105
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +19 -19
- package/dist/bin/pushary-stop-hook.js +29 -27
- package/dist/bin/pushary-stopfailure-hook.js +29 -27
- package/dist/bin/pushary-suggestions.js +5 -5
- package/dist/bin/pushary-transcript-register.js +19 -19
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +20 -20
- package/dist/bin/pushary-wait.js +10 -10
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-IJ6ECPA6.js → chunk-2B4XCMH6.js} +75 -232
- package/dist/{chunk-EGKXSQCY.js → chunk-2XOHXZRC.js} +12 -4
- package/dist/{chunk-D6BULEJW.js → chunk-3NSRL5E7.js} +2 -2
- package/dist/{chunk-UC65FJJT.js → chunk-3RO2UWJQ.js} +2 -2
- package/dist/{chunk-73T6MSU5.js → chunk-4S7CCOXB.js} +5 -5
- package/dist/{chunk-7OS4IHGI.js → chunk-5GIBNUBD.js} +2 -2
- package/dist/chunk-5OP5MQI7.js +45 -0
- package/dist/{chunk-B3UXMSMW.js → chunk-65RN6ZCO.js} +1 -1
- package/dist/{chunk-2PS6QWDW.js → chunk-6NHXKTQU.js} +2 -2
- package/dist/{chunk-V6QRSU2G.js → chunk-6QZK4O36.js} +4 -4
- package/dist/{chunk-ZQ7IDOKY.js → chunk-A6WQF7FQ.js} +3 -3
- package/dist/{chunk-QXAK5RFU.js → chunk-AWZNDM3B.js} +1 -1
- package/dist/{chunk-JNXVOU6Y.js → chunk-D4OGEWLH.js} +19 -2
- package/dist/{chunk-R2XCLT6I.js → chunk-E3PLF7YB.js} +4 -4
- package/dist/{chunk-2C7CCWVX.js → chunk-F6BMJOSW.js} +1 -1
- package/dist/{chunk-XNCMT7YY.js → chunk-HOIGXMI7.js} +1 -1
- package/dist/{chunk-CVALVGA7.js → chunk-I7B2DNVU.js} +1 -1
- package/dist/{chunk-S3UD4V6W.js → chunk-INR3RVQ3.js} +13 -3
- package/dist/{chunk-52NVBNJT.js → chunk-IZVAVXHQ.js} +6 -4
- package/dist/{chunk-5HLTWFJ6.js → chunk-JMSB6CJT.js} +1 -1
- package/dist/{chunk-KYQXUGH7.js → chunk-KAJT6HPI.js} +3 -3
- package/dist/{chunk-VKVIAZQO.js → chunk-KLXYMPTM.js} +1 -1
- package/dist/{chunk-PQ4F64M2.js → chunk-L6IF4JOF.js} +3 -3
- package/dist/{chunk-ROQK7IN3.js → chunk-LI3C2IQY.js} +2 -2
- package/dist/{chunk-B234346F.js → chunk-M2JGLFFS.js} +1 -1
- package/dist/chunk-MY3UZO5U.js +99 -0
- package/dist/chunk-N6IOSZOE.js +185 -0
- package/dist/{chunk-DNJUSFBL.js → chunk-NYBZJ44G.js} +40 -5
- package/dist/{chunk-BBKNJJVX.js → chunk-OJRB5QKN.js} +6 -6
- package/dist/{chunk-PUDBG3GM.js → chunk-OXEF6JHD.js} +4 -4
- package/dist/{chunk-LEZFOTMI.js → chunk-PWNQGITG.js} +1 -1
- package/dist/{chunk-B76WVEDX.js → chunk-Q7CDBJXU.js} +1 -1
- package/dist/{chunk-KXMZMZD3.js → chunk-QSZ37ROP.js} +1 -1
- package/dist/{chunk-BH2SKSSK.js → chunk-R7ZETVNR.js} +1 -1
- package/dist/{chunk-DZURML2D.js → chunk-RLRDPZG4.js} +1 -1
- package/dist/{chunk-J2355HR7.js → chunk-SEIZQZEE.js} +1 -1
- package/dist/{chunk-V4AQBAVG.js → chunk-SJN64NJX.js} +1 -1
- package/dist/{chunk-B3YQANFN.js → chunk-SKEW3TQX.js} +1 -1
- package/dist/{chunk-L4H2Q2S4.js → chunk-SKMWPXGV.js} +500 -46
- package/dist/{chunk-WUNZAE7I.js → chunk-T3PRPFDY.js} +5 -5
- package/dist/{chunk-YYINL576.js → chunk-TVJYGZXB.js} +2 -2
- package/dist/{chunk-O2LEPIU6.js → chunk-U3MS6D5X.js} +1 -1
- package/dist/{chunk-5RUIFDTP.js → chunk-U4TMAANR.js} +33 -2
- package/dist/{chunk-KW2RRR7D.js → chunk-UFNBKYWT.js} +3 -3
- package/dist/{chunk-DVQDPI3T.js → chunk-UUTWHVSV.js} +35 -35
- package/dist/{chunk-X6KDKOV5.js → chunk-VQDJ6KB3.js} +3 -3
- package/dist/{chunk-UOAQ6QMP.js → chunk-VSGKQ3HI.js} +2 -2
- package/dist/{chunk-YROGUPOZ.js → chunk-WWTLAZQA.js} +25 -8
- package/dist/{chunk-SQRWHALT.js → chunk-WXIVUIXA.js} +2 -2
- package/dist/{chunk-HDRNWNVP.js → chunk-YLCSKVQQ.js} +9 -28
- package/dist/{chunk-JXUAXO74.js → chunk-YNJ2H2FD.js} +2 -2
- package/dist/{chunk-BWYJ6AAF.js → chunk-YU4222G2.js} +2 -2
- package/dist/{chunk-4F46VIEE.js → chunk-YU54LNC6.js} +6 -6
- package/dist/{chunk-EAQMWJPG.js → chunk-ZMWX5SDA.js} +8 -8
- package/dist/{chunk-6ADZQFVW.js → chunk-ZUKZJQGR.js} +1 -1
- package/dist/{reapply-6PH3FMPX.js → reapply-D6RSDYCK.js} +9 -9
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +22 -20
- package/package.json +2 -1
- package/dist/chunk-DANOZVZK.js +0 -307
- package/dist/chunk-P32LPT2L.js +0 -6
- package/dist/chunk-YHG74UFF.js +0 -12
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
HOOK_LOCATOR_BINARY,
|
|
4
4
|
isReleaseVersion,
|
|
5
5
|
withHookHoldBudget
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WWTLAZQA.js";
|
|
7
7
|
|
|
8
8
|
// src/npm.ts
|
|
9
9
|
import { execFileSync, execSync } from "child_process";
|
|
@@ -56,6 +56,32 @@ var resolvePathBinary = (name, platform = process.platform) => {
|
|
|
56
56
|
return void 0;
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
+
var NPM_MISSING_MESSAGE = "npm is not on PATH, and the hooks run from a global npm install.";
|
|
60
|
+
var NPM_LOOKUP = process.platform === "win32" ? "where npm" : "command -v npm";
|
|
61
|
+
var npmIsOnPath = () => {
|
|
62
|
+
try {
|
|
63
|
+
execSync(NPM_LOOKUP, { env: cleanNpmEnv(), stdio: "ignore", timeout: 5e3 });
|
|
64
|
+
return true;
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var GLOBAL_LIST_TIMEOUT_MS = 3e4;
|
|
70
|
+
var globalPackageState = (name) => {
|
|
71
|
+
try {
|
|
72
|
+
const listing = JSON.parse(execNpm("list -g --depth=0 --json --no-workspaces", { timeout: GLOBAL_LIST_TIMEOUT_MS }).toString());
|
|
73
|
+
const dependencies = typeof listing === "object" && listing !== null && "dependencies" in listing ? listing.dependencies : void 0;
|
|
74
|
+
return typeof dependencies === "object" && dependencies !== null && name in dependencies ? "installed" : "absent";
|
|
75
|
+
} catch {
|
|
76
|
+
return "unknown";
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var NpmMissingError = class extends Error {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(NPM_MISSING_MESSAGE);
|
|
82
|
+
this.name = "NpmMissingError";
|
|
83
|
+
}
|
|
84
|
+
};
|
|
59
85
|
var resolveBinary = (name) => resolveGlobalBinary(name) ?? resolvePathBinary(name);
|
|
60
86
|
var resolvePackageVersionFromBinary = (binary, packageName) => {
|
|
61
87
|
try {
|
|
@@ -176,6 +202,7 @@ var installGlobally = (options) => {
|
|
|
176
202
|
return installState.then((result) => result === "installed" ? "cached" : result);
|
|
177
203
|
}
|
|
178
204
|
const started = (async () => {
|
|
205
|
+
if (!npmIsOnPath()) throw new NpmMissingError();
|
|
179
206
|
const pinned = process.env.PUSHARY_PIN_GLOBAL_VERSION !== "0";
|
|
180
207
|
if (pinned && !needsGlobalInstall(
|
|
181
208
|
options.version,
|
|
@@ -244,10 +271,6 @@ var guardedArgv = (target, args = [], platform = process.platform) => {
|
|
|
244
271
|
return [shell, ...shellArgs, HOOK_GUARD_SCRIPTS[guardKindOf(target)], path, ...args];
|
|
245
272
|
};
|
|
246
273
|
|
|
247
|
-
// src/removal-scope.ts
|
|
248
|
-
var namesAppLocator = (command) => command.includes(HOOK_LOCATOR_BINARY);
|
|
249
|
-
var isProtectedByScope = (command, scope) => scope?.keepAppWiring === true && namesAppLocator(command);
|
|
250
|
-
|
|
251
274
|
// src/codex-config.ts
|
|
252
275
|
import { createHash } from "crypto";
|
|
253
276
|
import { homedir } from "os";
|
|
@@ -299,6 +322,10 @@ var registerHookEntry = (existing, isOurs, entry) => {
|
|
|
299
322
|
return rewritten;
|
|
300
323
|
};
|
|
301
324
|
|
|
325
|
+
// src/removal-scope.ts
|
|
326
|
+
var namesAppLocator = (command) => command.includes(HOOK_LOCATOR_BINARY);
|
|
327
|
+
var isProtectedByScope = (command, scope) => scope?.keepAppWiring === true && namesAppLocator(command);
|
|
328
|
+
|
|
302
329
|
// src/canonical-json.ts
|
|
303
330
|
var canonicalJson = (value) => {
|
|
304
331
|
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
@@ -625,7 +652,9 @@ var autoUpdateLock = () => join3(pusharyDir(), "auto-update.lock");
|
|
|
625
652
|
var autoUpdateLog = () => join3(pusharyDir(), "logs", "auto-update.log");
|
|
626
653
|
var clientReportClaims = () => join3(pusharyDir(), "client-reports");
|
|
627
654
|
var claudeRegistrationReceipt = () => join3(pusharyDir(), "setup", "claude-registration.json");
|
|
655
|
+
var hermesConfig = () => join3(homedir2(), ".hermes", "config.yaml");
|
|
628
656
|
var hermesConfigReceipt = () => join3(pusharyDir(), "setup", "hermes-config.json");
|
|
657
|
+
var fxQuestionRuleReceipt = () => join3(pusharyDir(), "setup", "fx-question-rule.json");
|
|
629
658
|
var hookTakeoverReceipt = (agent) => join3(pusharyDir(), "setup", `hook-takeover-${agent}.json`);
|
|
630
659
|
var codexSkillDir2 = () => join3(codexHome(), "skills", "pushary");
|
|
631
660
|
var codexAgentsMd2 = () => join3(codexHome(), "AGENTS.md");
|
|
@@ -641,11 +670,15 @@ export {
|
|
|
641
670
|
registeredCommands,
|
|
642
671
|
namesOurBinary,
|
|
643
672
|
registrationHolderOf,
|
|
673
|
+
AGENT_HOOKS_PACKAGE,
|
|
644
674
|
LATEST_TAG,
|
|
645
675
|
npmErrorMessage,
|
|
646
676
|
execNpm,
|
|
647
677
|
resolveGlobalBinary,
|
|
648
678
|
resolvePathBinary,
|
|
679
|
+
npmIsOnPath,
|
|
680
|
+
globalPackageState,
|
|
681
|
+
NpmMissingError,
|
|
649
682
|
resolveBinary,
|
|
650
683
|
resolvePackageVersionFromBinary,
|
|
651
684
|
resolveGlobalPackageVersion,
|
|
@@ -703,7 +736,9 @@ export {
|
|
|
703
736
|
autoUpdateLog,
|
|
704
737
|
clientReportClaims,
|
|
705
738
|
claudeRegistrationReceipt,
|
|
739
|
+
hermesConfig,
|
|
706
740
|
hermesConfigReceipt,
|
|
741
|
+
fxQuestionRuleReceipt,
|
|
707
742
|
hookTakeoverReceipt,
|
|
708
743
|
codexSkillDir2,
|
|
709
744
|
codexAgentsMd2,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
detectClaudeVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U3MS6D5X.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureCodexTrustsPusharyHooks
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5GIBNUBD.js";
|
|
7
7
|
import {
|
|
8
8
|
addClaudeMcpServer,
|
|
9
9
|
addPusharyHooks,
|
|
10
10
|
addPusharyToolPermissions
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KAJT6HPI.js";
|
|
12
12
|
import {
|
|
13
13
|
claudeUnprovenHolds,
|
|
14
14
|
claudeWired,
|
|
15
15
|
codexUnprovenHolds,
|
|
16
16
|
codexWired,
|
|
17
17
|
geminiWired
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-L6IF4JOF.js";
|
|
19
19
|
import {
|
|
20
20
|
CLAUDE_HOOK_BINARY,
|
|
21
21
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
needsReregistration,
|
|
28
28
|
registrationSignatures,
|
|
29
29
|
supportedClaudeEvents
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-A6WQF7FQ.js";
|
|
31
31
|
import {
|
|
32
32
|
CODEX_HOOK_BINARY,
|
|
33
33
|
addCodexHookTrust,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
registrationHolderOf,
|
|
48
48
|
resolveGlobalBinary,
|
|
49
49
|
vscodePluginMcp
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-NYBZJ44G.js";
|
|
51
51
|
import {
|
|
52
52
|
readJsonSafe,
|
|
53
53
|
writeFileAtomic,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createIo
|
|
3
|
+
} from "./chunk-U4TMAANR.js";
|
|
1
4
|
import {
|
|
2
5
|
describeKeyCheck,
|
|
3
6
|
keyCheckFromResponse
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
createIo
|
|
7
|
-
} from "./chunk-5RUIFDTP.js";
|
|
7
|
+
} from "./chunk-VQDJ6KB3.js";
|
|
8
8
|
import {
|
|
9
9
|
EXIT
|
|
10
10
|
} from "./chunk-KZERVKTD.js";
|