@pushary/agent-hooks 1.1.0 → 1.2.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 +24 -0
- package/dist/bin/pushary-bell-hook.js +18 -18
- package/dist/bin/pushary-bell.js +6 -6
- package/dist/bin/pushary-claude.js +18 -18
- package/dist/bin/pushary-clean.js +19 -19
- package/dist/bin/pushary-codex-bridge.js +10 -10
- package/dist/bin/pushary-codex-hook.js +22 -22
- package/dist/bin/pushary-codex.js +6 -6
- package/dist/bin/pushary-connect.js +6 -6
- package/dist/bin/pushary-cowork.js +3 -3
- package/dist/bin/pushary-daemon.js +22 -22
- package/dist/bin/pushary-disconnect.js +10 -10
- package/dist/bin/pushary-doctor.js +23 -23
- package/dist/bin/pushary-elicitation-hook.js +17 -17
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +19 -19
- package/dist/bin/pushary-hook.js +26 -26
- package/dist/bin/pushary-login.js +7 -7
- package/dist/bin/pushary-logout.js +4 -4
- package/dist/bin/pushary-mode.js +3 -3
- package/dist/bin/pushary-notification-hook.js +20 -20
- package/dist/bin/pushary-opencode-hook.js +19 -19
- package/dist/bin/pushary-permission-denied-hook.js +24 -24
- package/dist/bin/pushary-permission-hook.js +25 -25
- package/dist/bin/pushary-post-hook.js +20 -20
- package/dist/bin/pushary-prompt-hook.js +20 -20
- package/dist/bin/pushary-session-end-hook.js +20 -20
- package/dist/bin/pushary-session-start-hook.js +22 -22
- package/dist/bin/pushary-setup.js +26 -26
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +10 -10
- package/dist/bin/pushary-stop-hook.js +20 -20
- package/dist/bin/pushary-stopfailure-hook.js +20 -20
- package/dist/bin/pushary-transcript-register.js +16 -16
- package/dist/bin/pushary-transcripts.js +4 -4
- package/dist/bin/pushary-upgrade.js +14 -14
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/{chunk-VACFOGF3.js → chunk-2DT7STR5.js} +1 -1
- package/dist/{chunk-LQ3BHPPZ.js → chunk-4UT44NRP.js} +5 -1
- package/dist/{chunk-WTT24AUA.js → chunk-5AATCXJN.js} +29 -5
- package/dist/{chunk-BBUZD7MU.js → chunk-6QCN5XQE.js} +1 -1
- package/dist/{chunk-VQYARC2K.js → chunk-7DQVIIHX.js} +96 -16
- package/dist/{chunk-XIHKSZHL.js → chunk-7ERWAYVV.js} +1 -1
- package/dist/{chunk-MR2PWE62.js → chunk-7GH3D6YG.js} +7 -8
- package/dist/{chunk-UP7NZXJU.js → chunk-7TDQ7KDY.js} +1 -1
- package/dist/{chunk-IH7YUPFN.js → chunk-BXLFUTSD.js} +3 -3
- package/dist/{chunk-AH5OO2YZ.js → chunk-C3WH44MH.js} +3 -3
- package/dist/{chunk-MZUXTN7X.js → chunk-CG4ZUQ5O.js} +2 -2
- package/dist/{chunk-6JUCFMSF.js → chunk-CVCSUAXI.js} +3 -3
- package/dist/{chunk-EZ3GX3NS.js → chunk-DRAATYTY.js} +5 -5
- package/dist/{chunk-YM4G6CFN.js → chunk-ERP7FOFQ.js} +3 -3
- package/dist/{chunk-PUDQJ772.js → chunk-JOTV75GX.js} +1 -1
- package/dist/{chunk-IPDBFJ2M.js → chunk-JQJB7BZE.js} +1 -1
- package/dist/{chunk-ISELLVBP.js → chunk-KEVJ2WW6.js} +1 -1
- package/dist/{chunk-2MOQUNFL.js → chunk-KHTBSSY5.js} +1 -1
- package/dist/{chunk-DKTFZCLQ.js → chunk-KODKICKJ.js} +6 -6
- package/dist/{chunk-J7PJALS2.js → chunk-KZPUARCU.js} +1 -1
- package/dist/{chunk-RZTH4MIY.js → chunk-LAXU5U75.js} +2 -2
- package/dist/{chunk-PQG6NTPT.js → chunk-LGO7U23Z.js} +1 -1
- package/dist/{chunk-S2BNTXP6.js → chunk-LWKVEMVK.js} +1 -1
- package/dist/{chunk-FO4HHPMO.js → chunk-OGSRCIOD.js} +1 -1
- package/dist/{chunk-PWIMJP4U.js → chunk-PCT2MYG5.js} +6 -6
- package/dist/{chunk-EWQZISYV.js → chunk-PX53RT6Q.js} +1 -1
- package/dist/{chunk-6T4OINZB.js → chunk-PX54KULQ.js} +3 -3
- package/dist/{chunk-LUYYB6V2.js → chunk-RN6ZWIAC.js} +1 -1
- package/dist/{chunk-SLEWDZOA.js → chunk-U42ES5U3.js} +1 -1
- package/dist/{chunk-INBTKFT6.js → chunk-UWP66NDF.js} +1 -1
- package/dist/{chunk-SA6UB3GD.js → chunk-VDOKRCWM.js} +1 -1
- package/dist/{chunk-76ZCJZBK.js → chunk-VE2ZWUML.js} +1 -1
- package/dist/{chunk-PHJOSAXW.js → chunk-VIQ7CCWW.js} +2 -2
- package/dist/{chunk-DZYIAMKR.js → chunk-W6XVHP4U.js} +4 -4
- package/dist/{chunk-OYYQHJAO.js → chunk-WC5PYFDK.js} +1 -1
- package/dist/{chunk-QACXZYDA.js → chunk-YK3OU4E2.js} +4 -4
- package/dist/{chunk-SM54HHVY.js → chunk-YT6H7BB5.js} +21 -14
- package/dist/{chunk-E3WQMDCE.js → chunk-ZFQPSGPO.js} +1 -1
- package/dist/{reapply-STSGYPF2.js → reapply-47AMVIXN.js} +8 -8
- package/dist/src/index.js +12 -12
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7DQVIIHX.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-EYRGBYZG.js";
|
|
16
16
|
import {
|
|
17
17
|
reportedInstallSource
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZFQPSGPO.js";
|
|
19
19
|
import {
|
|
20
20
|
isAnswerSource
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7DQVIIHX.js";
|
|
22
22
|
|
|
23
23
|
// src/reach.ts
|
|
24
24
|
var reachVerdict = (channels) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_CHOICES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WC5PYFDK.js";
|
|
4
4
|
import {
|
|
5
5
|
isBridgeLocator
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-U42ES5U3.js";
|
|
7
7
|
import {
|
|
8
8
|
pusharyHookExecutable
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-C3WH44MH.js";
|
|
10
10
|
import {
|
|
11
11
|
BELL_HOOK_BINARY
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VDOKRCWM.js";
|
|
13
13
|
|
|
14
14
|
// src/setup/hook-ownership.ts
|
|
15
15
|
var commandsIn = (value) => {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
COMPATIBLE_AGENT_TYPES,
|
|
9
9
|
isValidApiKey
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7DQVIIHX.js";
|
|
11
11
|
|
|
12
12
|
// src/setup/options.ts
|
|
13
13
|
var AGENT_CHOICES = ["claude_code", "codex", "gemini_cli", "hermes", "cursor", "vscode", "opencode", ...COMPATIBLE_AGENT_TYPES, "custom"];
|
|
@@ -2,24 +2,24 @@ import {
|
|
|
2
2
|
detectProviderLiveCapabilities,
|
|
3
3
|
hasSpawnProvider,
|
|
4
4
|
resolveControlPolicy
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CG4ZUQ5O.js";
|
|
6
6
|
import {
|
|
7
7
|
daemonHasRemoteProof,
|
|
8
8
|
daemonServiceManagerAvailable,
|
|
9
9
|
hasDaemonServiceDefinition,
|
|
10
10
|
readDaemonNeedsLogin,
|
|
11
11
|
readDaemonStatus
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CVCSUAXI.js";
|
|
13
13
|
import {
|
|
14
14
|
getMachineId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-KZPUARCU.js";
|
|
16
16
|
import {
|
|
17
17
|
getPackageVersion
|
|
18
18
|
} from "./chunk-DINDL2CF.js";
|
|
19
19
|
import {
|
|
20
20
|
readControlMode,
|
|
21
21
|
readKeySource
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7TDQ7KDY.js";
|
|
23
23
|
import {
|
|
24
24
|
getBaseUrl
|
|
25
25
|
} from "./chunk-2UMNXADU.js";
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
addPusharyToolPermissions,
|
|
4
4
|
isPusharyHook,
|
|
5
5
|
removeClaudeMcpServers
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PX54KULQ.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_HOOK_EVENTS,
|
|
9
9
|
addGeminiMcpServer,
|
|
10
10
|
removeGeminiMcpServer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ERP7FOFQ.js";
|
|
12
12
|
import {
|
|
13
13
|
CLAUDE_CODE_AGENT,
|
|
14
14
|
parseApplyPatchFiles
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5AATCXJN.js";
|
|
16
16
|
import {
|
|
17
17
|
guardBinary,
|
|
18
18
|
holdBudgetOf,
|
|
19
19
|
registerHookEntry
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PX53RT6Q.js";
|
|
21
21
|
import {
|
|
22
22
|
PHONE_ANSWERED_TOOLS,
|
|
23
23
|
hookCompatibleProfile,
|
|
24
24
|
toToolLookup,
|
|
25
25
|
withHookHoldBudget
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-7DQVIIHX.js";
|
|
27
27
|
|
|
28
28
|
// src/compatible-config.ts
|
|
29
29
|
import { homedir } from "os";
|
|
@@ -31,33 +31,40 @@ import { isAbsolute, join, resolve } from "path";
|
|
|
31
31
|
var AGENT_FLAG = "--agent";
|
|
32
32
|
var agentArgument = (profile) => `${AGENT_FLAG}=${profile.agentType}`;
|
|
33
33
|
var profileFromArgv = (argv) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
return named ? hookCompatibleProfile(named.slice(prefix.length)) : void 0;
|
|
34
|
+
const named = namedAgent(argv);
|
|
35
|
+
return named ? hookCompatibleProfile(named) : void 0;
|
|
37
36
|
};
|
|
38
37
|
var activeIdentity = (argv) => {
|
|
39
38
|
const profile = profileFromArgv(argv);
|
|
40
39
|
return profile ? { type: profile.agentType, label: profile.label } : CLAUDE_CODE_AGENT;
|
|
41
40
|
};
|
|
42
|
-
var
|
|
41
|
+
var namedAgent = (argv) => {
|
|
42
|
+
const prefix = `${AGENT_FLAG}=`;
|
|
43
|
+
return argv.find((argument) => argument.startsWith(prefix))?.slice(prefix.length);
|
|
44
|
+
};
|
|
45
|
+
var activeHookSource = (argv) => {
|
|
46
|
+
const named = namedAgent(argv);
|
|
47
|
+
if (named === void 0) return "claude";
|
|
48
|
+
return hookCompatibleProfile(named)?.source ?? null;
|
|
49
|
+
};
|
|
43
50
|
var PATCH_INPUT_KEYS = ["command", "patch", "input"];
|
|
44
51
|
var patchedFiles = (toolInput) => [...new Set(PATCH_INPUT_KEYS.flatMap((key) => parseApplyPatchFiles(toolInput[key])))];
|
|
45
52
|
var lookupFor = (profile, input) => {
|
|
46
53
|
const absolute = (path) => input.cwd && !isAbsolute(path) ? resolve(input.cwd, path) : path;
|
|
47
54
|
const toolInput = input.tool_input ?? {};
|
|
48
55
|
const lookup = toToolLookup(profile, input.tool_name ?? "", toolInput, absolute);
|
|
49
|
-
if (!lookup.
|
|
56
|
+
if (!lookup.unreadable) return lookup;
|
|
50
57
|
const files = patchedFiles(toolInput);
|
|
51
|
-
return files.length === 1 ? { ...lookup, input: { ...lookup.input, file_path: absolute(files[0]) },
|
|
58
|
+
return files.length === 1 ? { ...lookup, input: { ...lookup.input, file_path: absolute(files[0]) }, unreadable: false } : lookup;
|
|
52
59
|
};
|
|
53
60
|
var normalizeToolCall = (profile, input) => {
|
|
54
61
|
if (!profile || !input.tool_name) return input;
|
|
55
62
|
const lookup = lookupFor(profile, input);
|
|
56
63
|
return { ...input, tool_name: lookup.tool, tool_input: lookup.input };
|
|
57
64
|
};
|
|
58
|
-
var
|
|
65
|
+
var unreadableTool = (profile, input) => {
|
|
59
66
|
if (!profile || !input.tool_name) return void 0;
|
|
60
|
-
return lookupFor(profile, input).
|
|
67
|
+
return lookupFor(profile, input).unreadable ? input.tool_name : void 0;
|
|
61
68
|
};
|
|
62
69
|
var underHome = (segments, home = homedir()) => join(home, ...segments);
|
|
63
70
|
var compatibleConfigFile = (profile, home) => underHome(profile.configFile, home);
|
|
@@ -208,7 +215,7 @@ export {
|
|
|
208
215
|
activeIdentity,
|
|
209
216
|
activeHookSource,
|
|
210
217
|
normalizeToolCall,
|
|
211
|
-
|
|
218
|
+
unreadableTool,
|
|
212
219
|
compatibleConfigFile,
|
|
213
220
|
compatibleMcpFile,
|
|
214
221
|
compatibleInstructionsFile,
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
reapplyGeminiSettings,
|
|
9
9
|
reapplyVsCodePlugin,
|
|
10
10
|
repairCodexHolds
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-DRAATYTY.js";
|
|
12
|
+
import "./chunk-JQJB7BZE.js";
|
|
13
|
+
import "./chunk-PX54KULQ.js";
|
|
14
|
+
import "./chunk-C3WH44MH.js";
|
|
15
|
+
import "./chunk-ERP7FOFQ.js";
|
|
16
|
+
import "./chunk-UWP66NDF.js";
|
|
17
|
+
import "./chunk-PX53RT6Q.js";
|
|
18
18
|
import "./chunk-4LL6LG5X.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-7DQVIIHX.js";
|
|
20
20
|
export {
|
|
21
21
|
inspectConfiguredManagedProviders,
|
|
22
22
|
reapplyAllAgents,
|
package/dist/src/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-KODKICKJ.js";
|
|
4
|
+
import "../chunk-YT6H7BB5.js";
|
|
5
|
+
import "../chunk-PX54KULQ.js";
|
|
6
|
+
import "../chunk-BXLFUTSD.js";
|
|
7
|
+
import "../chunk-2DT7STR5.js";
|
|
8
8
|
import "../chunk-YHG74UFF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-ERP7FOFQ.js";
|
|
10
10
|
import {
|
|
11
11
|
fetchAccountPublicKey
|
|
12
12
|
} from "../chunk-EQRS3SGM.js";
|
|
@@ -18,20 +18,20 @@ import {
|
|
|
18
18
|
handlePostToolUse,
|
|
19
19
|
handleStop,
|
|
20
20
|
reportEvent
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-5AATCXJN.js";
|
|
22
|
+
import "../chunk-UWP66NDF.js";
|
|
23
23
|
import {
|
|
24
24
|
askUser,
|
|
25
25
|
cancelQuestion,
|
|
26
26
|
waitForAnswer
|
|
27
27
|
} from "../chunk-LGXUGYUH.js";
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-KZPUARCU.js";
|
|
29
|
+
import "../chunk-PX53RT6Q.js";
|
|
30
30
|
import "../chunk-EYRGBYZG.js";
|
|
31
31
|
import "../chunk-SAF6HGAA.js";
|
|
32
32
|
import "../chunk-7QLSKOSU.js";
|
|
33
33
|
import "../chunk-KZERVKTD.js";
|
|
34
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-ZFQPSGPO.js";
|
|
35
35
|
import "../chunk-4LL6LG5X.js";
|
|
36
36
|
import {
|
|
37
37
|
getApiKey,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from "../chunk-2UMNXADU.js";
|
|
40
40
|
import {
|
|
41
41
|
resolvePolicy
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-7DQVIIHX.js";
|
|
43
43
|
export {
|
|
44
44
|
askUser,
|
|
45
45
|
cancelQuestion,
|