@pushary/agent-hooks 1.9.68 → 1.9.70
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 +14 -1
- package/dist/{api-6Q7XIB67.js → api-KUJYE5YZ.js} +7 -7
- package/dist/bin/pushary-bell-hook.js +18 -18
- package/dist/bin/pushary-bell.js +5 -5
- package/dist/bin/pushary-claude.js +19 -19
- package/dist/bin/pushary-clean.js +26 -26
- package/dist/bin/pushary-codex-bridge.js +14 -14
- package/dist/bin/pushary-codex-hook.js +21 -21
- package/dist/bin/pushary-codex-session.js +6 -6
- package/dist/bin/pushary-codex.js +8 -8
- package/dist/bin/pushary-connect.js +19 -19
- package/dist/bin/pushary-daemon.js +30 -30
- package/dist/bin/pushary-disconnect.js +18 -18
- package/dist/bin/pushary-doctor.js +36 -36
- package/dist/bin/pushary-elicitation-hook.js +18 -18
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +19 -19
- package/dist/bin/pushary-hook.js +20 -20
- package/dist/bin/pushary-login.js +13 -13
- package/dist/bin/pushary-logout.js +16 -16
- package/dist/bin/pushary-mcp.js +8 -8
- package/dist/bin/pushary-mode.js +9 -9
- package/dist/bin/pushary-notification-hook.js +17 -17
- package/dist/bin/pushary-opencode-hook.js +18 -18
- package/dist/bin/pushary-permission-denied-hook.js +20 -20
- package/dist/bin/pushary-permission-hook.js +20 -20
- package/dist/bin/pushary-post-hook.js +17 -17
- package/dist/bin/pushary-prompt-hook.js +17 -17
- package/dist/bin/pushary-session-end-hook.js +19 -19
- package/dist/bin/pushary-session-start-hook.js +27 -27
- package/dist/bin/pushary-setup.js +36 -36
- package/dist/bin/pushary-status.js +23 -23
- package/dist/bin/pushary-stop-hook.js +17 -17
- package/dist/bin/pushary-stopfailure-hook.js +17 -17
- package/dist/bin/pushary-suggestions.js +9 -9
- package/dist/bin/pushary-transcript-register.js +10 -10
- package/dist/bin/pushary-transcripts.js +13 -13
- package/dist/bin/pushary-upgrade.js +37 -38
- package/dist/bin/pushary-wait.js +9 -9
- package/dist/bin/pushary.js +4 -4
- package/dist/{chunk-LQAAOXYJ.js → chunk-274CV7IW.js} +12 -6
- package/dist/{chunk-ORHVVRVL.js → chunk-2LI3DF7Q.js} +2 -2
- package/dist/{chunk-I5FFSOCV.js → chunk-2REVIFLS.js} +2 -2
- package/dist/{chunk-RWXDWOQQ.js → chunk-3HWDWR42.js} +8 -8
- package/dist/{chunk-7S7NTMDJ.js → chunk-4BXI6WJI.js} +2 -2
- package/dist/{chunk-53Q4LRBU.js → chunk-54O76CMR.js} +2 -2
- package/dist/{chunk-K4TSXWVX.js → chunk-5LQCADHK.js} +4 -4
- package/dist/{chunk-YZHJQG6W.js → chunk-5UIA5GLL.js} +5 -5
- package/dist/{chunk-CB4U6WRP.js → chunk-72ILLFCY.js} +4 -4
- package/dist/{chunk-7SKGS7QN.js → chunk-7CW63ZK3.js} +2 -2
- package/dist/{chunk-E5PEOVUJ.js → chunk-7FWZNWIO.js} +5 -5
- package/dist/{chunk-REQO3WWO.js → chunk-7XS44DQX.js} +3 -3
- package/dist/{chunk-6VFZVL65.js → chunk-A7GTEZGH.js} +23 -17
- package/dist/{chunk-BSMHSN3Y.js → chunk-AQA63ZWO.js} +1 -1
- package/dist/{chunk-O655YCOG.js → chunk-AUYMNTUX.js} +3 -3
- package/dist/{chunk-LF2NSOAQ.js → chunk-AVKD5QS4.js} +4 -4
- package/dist/{chunk-AJIT4SCL.js → chunk-BRWU4NT4.js} +3 -3
- package/dist/{chunk-77QP22FL.js → chunk-CJ3W7XRU.js} +1 -1
- package/dist/{chunk-NKPSJOHJ.js → chunk-CPYVVEJP.js} +3 -3
- package/dist/{chunk-53RH3ZIK.js → chunk-D5G2HSQ6.js} +1 -1
- package/dist/{chunk-TVVJ6OYG.js → chunk-DJPNVVJQ.js} +3 -3
- package/dist/{chunk-MUDUWF74.js → chunk-DTENGECG.js} +1 -1
- package/dist/{chunk-VRFFMTIG.js → chunk-EAJUFO7Q.js} +3 -3
- package/dist/{chunk-QYTOYNV2.js → chunk-FD6KOIT2.js} +3 -3
- package/dist/{chunk-NLDEC4Y7.js → chunk-FULXDMAP.js} +3 -3
- package/dist/{chunk-2VYQG2HG.js → chunk-FZ2SHXUE.js} +2 -2
- package/dist/{chunk-PBEW5CJK.js → chunk-GZHQQP7J.js} +1 -1
- package/dist/{chunk-WPOXZPEH.js → chunk-HGXWC4WT.js} +1 -1
- package/dist/{chunk-6IFEYELN.js → chunk-HZNZJTGH.js} +5 -5
- package/dist/{chunk-XQKB4LEK.js → chunk-JQMERLQS.js} +2 -2
- package/dist/{chunk-MCNHNIRC.js → chunk-JWRDCANS.js} +2 -2
- package/dist/{chunk-MHC34X5A.js → chunk-KHOWMC57.js} +1 -1
- package/dist/{chunk-D6W7QDQE.js → chunk-KLDUATG5.js} +37 -47
- package/dist/{chunk-UETS2WEA.js → chunk-KVXX5M5A.js} +4 -4
- package/dist/{chunk-LGCVAE52.js → chunk-LWFSXSRG.js} +1 -1
- package/dist/{chunk-ODAAK2RZ.js → chunk-N2FDORN6.js} +1 -1
- package/dist/{chunk-Q6JXE3PD.js → chunk-N2WAXSJY.js} +7 -7
- package/dist/{chunk-73DHP3JX.js → chunk-NFWZVY25.js} +2 -2
- package/dist/{chunk-MMTA7UKA.js → chunk-NSR6IFA6.js} +1 -1
- package/dist/{chunk-NAQCWM4U.js → chunk-OXOYS3UG.js} +3 -3
- package/dist/{chunk-JPVV27O2.js → chunk-OYFGZARB.js} +2 -2
- package/dist/{chunk-EOWHEZHD.js → chunk-PIGBU7D3.js} +4 -4
- package/dist/{chunk-PEPRUUGM.js → chunk-PK6WI4HH.js} +4 -4
- package/dist/{chunk-P4XZX7CL.js → chunk-QE22XDUK.js} +1 -1
- package/dist/{chunk-4TIN3T2A.js → chunk-QZPRCMPV.js} +1 -1
- package/dist/{chunk-2HMKZYF5.js → chunk-SKTZKAGH.js} +1 -1
- package/dist/{chunk-SL7CIZCL.js → chunk-SSJDAX4E.js} +46 -17
- package/dist/{chunk-EUU5PDUI.js → chunk-TXRV7AOA.js} +4 -4
- package/dist/{chunk-PZZKXX6Q.js → chunk-VIQ5OS5E.js} +2 -2
- package/dist/{chunk-PGOPIIOQ.js → chunk-WOJW23ZD.js} +6 -6
- package/dist/{chunk-7V63A4AI.js → chunk-XLKO2XEG.js} +1 -1
- package/dist/{chunk-MFWHANKG.js → chunk-YAA6MT6O.js} +2 -2
- package/dist/{chunk-JAKWPQ2L.js → chunk-YSOZVBFW.js} +1 -1
- package/dist/{codex-app-cards-switch-VZ4XIDJO.js → codex-app-cards-switch-GBTS3OQW.js} +7 -7
- package/dist/{codex-desktop-launch-CX2IE5BI.js → codex-desktop-launch-S6OULJDZ.js} +1 -1
- package/dist/{codex-session-launch-WUIM6ZGA.js → codex-session-launch-K2KE3AD5.js} +12 -12
- package/dist/{global-upgrade-XZ5L7LDB.js → global-upgrade-ZMWRPO5G.js} +8 -8
- package/dist/{identity-TGQPFIE4.js → identity-OLRKDYFR.js} +3 -3
- package/dist/{live-capabilities-JHESROAP.js → live-capabilities-LZECCGFQ.js} +4 -4
- package/dist/{paths-EOMNC4QM.js → paths-YUF2TFTA.js} +2 -2
- package/dist/{reapply-J5HHUUBE.js → reapply-TRR4XB6N.js} +21 -21
- package/dist/src/index.js +20 -20
- package/dist/{upgrade-lock-VQORI6G5.js → upgrade-lock-MSBKXUKM.js} +3 -3
- package/package.json +1 -1
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-54O76CMR.js";
|
|
4
4
|
import {
|
|
5
5
|
hermesReceiptPaths,
|
|
6
6
|
hermesSetupPredatesThePluginFolder,
|
|
7
7
|
installHermesPlugin,
|
|
8
8
|
refreshHermesPluginFiles,
|
|
9
9
|
shippedHermesPlugin
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KLDUATG5.js";
|
|
11
11
|
import {
|
|
12
12
|
fxIgnoresInstructionsFile,
|
|
13
13
|
fxInstructionsBody,
|
|
14
14
|
fxServerHolder,
|
|
15
|
-
inspectFxPusharyHttpWiring,
|
|
16
15
|
installedCliFxBridgeEntry,
|
|
17
16
|
macAppFxBridge,
|
|
18
17
|
refreshClineKey,
|
|
19
18
|
switchFxHttpEntryToBridge
|
|
20
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SSJDAX4E.js";
|
|
21
20
|
import {
|
|
22
21
|
OPENCODE_HOOK_BINARY,
|
|
23
22
|
agentHookOwner,
|
|
@@ -29,16 +28,16 @@ import {
|
|
|
29
28
|
openCodePluginDir,
|
|
30
29
|
openCodeWired,
|
|
31
30
|
withOpenCodeAskRules
|
|
32
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-72ILLFCY.js";
|
|
33
32
|
import {
|
|
34
33
|
detectClaudeVersion
|
|
35
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-YAA6MT6O.js";
|
|
36
35
|
import {
|
|
37
36
|
addCompatibleHooks,
|
|
38
37
|
compatibleConfigFile,
|
|
39
38
|
compatibleInstructionsFile,
|
|
40
39
|
hasCompatibleHooks
|
|
41
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-DJPNVVJQ.js";
|
|
42
41
|
import {
|
|
43
42
|
GEMINI_HOOK_BINARY,
|
|
44
43
|
addGeminiHooks,
|
|
@@ -50,7 +49,7 @@ import {
|
|
|
50
49
|
geminiWired,
|
|
51
50
|
hasGeminiHooks,
|
|
52
51
|
planHooks
|
|
53
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-NFWZVY25.js";
|
|
54
53
|
import {
|
|
55
54
|
CLAUDE_HOOK_BINARY,
|
|
56
55
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -95,7 +94,7 @@ import {
|
|
|
95
94
|
renderAgentInstructions,
|
|
96
95
|
supportedClaudeEvents,
|
|
97
96
|
vscodePluginMcp
|
|
98
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-274CV7IW.js";
|
|
99
98
|
import {
|
|
100
99
|
formatVersion,
|
|
101
100
|
readJsonSafe,
|
|
@@ -103,7 +102,7 @@ import {
|
|
|
103
102
|
resolveGlobalBinary,
|
|
104
103
|
writeFileAtomic,
|
|
105
104
|
writeJsonAtomic
|
|
106
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-OXOYS3UG.js";
|
|
107
106
|
import {
|
|
108
107
|
HOOK_COMPATIBLE_PROFILES,
|
|
109
108
|
isCompatibleAgentType,
|
|
@@ -406,16 +405,23 @@ var reapplyCompatibleHooks = (profile, paths = {}) => {
|
|
|
406
405
|
var CONFIGURED_AND_UNCHANGED = { configured: true, reapplied: false, hooks: false, mcp: false };
|
|
407
406
|
var fxHolder = () => fxServerHolder(fxMcpProfile(), macAppFxBridge(pusharyDir()));
|
|
408
407
|
var FX_SWITCHED_TO_BRIDGE = { configured: true, reapplied: true, hooks: false, mcp: false, fxBridge: true };
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
408
|
+
var fxSwitchResultOf = (outcome) => {
|
|
409
|
+
switch (outcome.kind) {
|
|
410
|
+
case "switched":
|
|
411
|
+
return FX_SWITCHED_TO_BRIDGE;
|
|
412
|
+
case "not-http":
|
|
413
|
+
return NOT_CONFIGURED;
|
|
414
|
+
case "kept":
|
|
415
|
+
return { ...CONFIGURED_AND_UNCHANGED, fxHttpKept: outcome.reason };
|
|
416
|
+
}
|
|
413
417
|
};
|
|
414
418
|
var reapplyFxWiring = (apiKey) => {
|
|
415
419
|
if (fxHolder() === "cli") return CONFIGURED_AND_UNCHANGED;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
420
|
+
return fxSwitchResultOf(switchFxHttpEntryToBridge(fxMcpProfile(), {
|
|
421
|
+
machineKey: apiKey || void 0,
|
|
422
|
+
env: process.env,
|
|
423
|
+
findBridgeEntry: installedCliFxBridgeEntry
|
|
424
|
+
}));
|
|
419
425
|
};
|
|
420
426
|
var REFRESHED_MCP = { configured: true, reapplied: true, hooks: false, mcp: true };
|
|
421
427
|
var CLINE_REAPPLY_RESULTS = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DJPNVVJQ.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NFWZVY25.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-274CV7IW.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
14
|
} from "./chunk-RQOT6QL3.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-72ILLFCY.js";
|
|
4
4
|
import {
|
|
5
5
|
nativeClaudeInstallPath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YSOZVBFW.js";
|
|
7
7
|
import {
|
|
8
8
|
grokHome
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DJPNVVJQ.js";
|
|
10
10
|
import {
|
|
11
11
|
claudeConfigDir,
|
|
12
12
|
clineDataDirectory,
|
|
13
13
|
codexHomeFrom
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-274CV7IW.js";
|
|
15
15
|
import {
|
|
16
16
|
HOOK_COMPATIBLE_PROFILES
|
|
17
17
|
} from "./chunk-RQOT6QL3.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_RULES_PATH,
|
|
3
3
|
canChangeApprovalSettings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XLKO2XEG.js";
|
|
5
5
|
import {
|
|
6
6
|
callMcpTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VIQ5OS5E.js";
|
|
8
8
|
import {
|
|
9
9
|
absoluteUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AQA63ZWO.js";
|
|
11
11
|
import {
|
|
12
12
|
getBaseUrl
|
|
13
13
|
} from "./chunk-32OSSYGZ.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
describeIdleWindow,
|
|
11
11
|
idleDeadlinePassed,
|
|
12
12
|
startProcessOwnership
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JWRDCANS.js";
|
|
14
14
|
import {
|
|
15
15
|
spawnClaude
|
|
16
16
|
} from "./chunk-XHKBHWLX.js";
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
isWaitForAnswerResponse,
|
|
24
24
|
withdrawQuestion,
|
|
25
25
|
writeDegraded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FD6KOIT2.js";
|
|
27
27
|
import {
|
|
28
28
|
callMcpTool,
|
|
29
29
|
isRetryable
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VIQ5OS5E.js";
|
|
31
31
|
import {
|
|
32
32
|
AGENT_QUESTION_DESCRIPTION_MAX,
|
|
33
33
|
AGENT_QUESTION_HEADER_MAX,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addGeminiMcpServer,
|
|
3
3
|
removeGeminiMcpServer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NFWZVY25.js";
|
|
5
5
|
import {
|
|
6
6
|
CLAUDE_CODE_AGENT,
|
|
7
7
|
compatibleToolLookup
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HZNZJTGH.js";
|
|
9
9
|
import {
|
|
10
10
|
CLAUDE_HOOK_EVENTS,
|
|
11
11
|
PUSHARY_MCP_URL,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
isPusharyHook,
|
|
18
18
|
registerHookEntry,
|
|
19
19
|
removeClaudeMcpServers
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-274CV7IW.js";
|
|
21
21
|
import {
|
|
22
22
|
HOOK_COMPATIBLE_PROFILES,
|
|
23
23
|
PHONE_ANSWERED_TOOLS,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YAA6MT6O.js";
|
|
4
4
|
import {
|
|
5
5
|
findNativeClaudeInstall
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YSOZVBFW.js";
|
|
7
7
|
import {
|
|
8
8
|
readGlobalPrefixAsync,
|
|
9
9
|
resolveGlobalBinary,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolvePackageVersionFromBinary,
|
|
14
14
|
resolvePathBinary,
|
|
15
15
|
resolvePathBinaryAsync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OXOYS3UG.js";
|
|
17
17
|
import {
|
|
18
18
|
MANAGED_PROVIDERS
|
|
19
19
|
} from "./chunk-RQOT6QL3.js";
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
McpToolError,
|
|
7
7
|
SubscriptionRequiredError,
|
|
8
8
|
callMcpTool
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VIQ5OS5E.js";
|
|
10
10
|
import {
|
|
11
11
|
installNetworkDefaults,
|
|
12
12
|
isNetworkFailure
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KHOWMC57.js";
|
|
14
14
|
import {
|
|
15
15
|
clientReportClaims
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-274CV7IW.js";
|
|
17
17
|
import {
|
|
18
18
|
getApiKey,
|
|
19
19
|
getBaseUrl
|
|
@@ -8,20 +8,20 @@ import {
|
|
|
8
8
|
everyProgramFileIsThere,
|
|
9
9
|
installedCodexApp,
|
|
10
10
|
shellQuoted
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2LI3DF7Q.js";
|
|
12
12
|
import {
|
|
13
13
|
writeHuman
|
|
14
14
|
} from "./chunk-QCGNGEGE.js";
|
|
15
15
|
import {
|
|
16
16
|
xml
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TXRV7AOA.js";
|
|
18
18
|
import {
|
|
19
19
|
CODEX_APP_LAUNCH_AT_LOGIN_VERB,
|
|
20
20
|
CODEX_APP_LAUNCH_VARIABLE
|
|
21
21
|
} from "./chunk-E46NE7FB.js";
|
|
22
22
|
import {
|
|
23
23
|
writeFileAtomic
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-OXOYS3UG.js";
|
|
25
25
|
|
|
26
26
|
// src/codex-app-cards-switch.ts
|
|
27
27
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
reportClientError,
|
|
9
9
|
sendNotification,
|
|
10
10
|
waitForAnswer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FD6KOIT2.js";
|
|
12
12
|
import {
|
|
13
13
|
withRetry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VIQ5OS5E.js";
|
|
15
15
|
import {
|
|
16
16
|
getMachineId
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FZ2SHXUE.js";
|
|
18
18
|
import {
|
|
19
19
|
reportedInstallSource
|
|
20
20
|
} from "./chunk-METUT7V4.js";
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
NOTIFICATION_PUSH_TYPES,
|
|
24
24
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS,
|
|
25
25
|
canonicalJson
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-274CV7IW.js";
|
|
27
27
|
import {
|
|
28
28
|
writeFileAtomic
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-OXOYS3UG.js";
|
|
30
30
|
import {
|
|
31
31
|
getApiKey,
|
|
32
32
|
getBaseUrl
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
hermesAppWiringRecord,
|
|
6
6
|
hermesConfigReceipt,
|
|
7
7
|
hermesSetupReceipt
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-274CV7IW.js";
|
|
9
9
|
import {
|
|
10
10
|
readJsonSafe,
|
|
11
11
|
resolvePathBinary,
|
|
12
12
|
writeJsonAtomic
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OXOYS3UG.js";
|
|
14
14
|
import {
|
|
15
15
|
isNewerVersion,
|
|
16
16
|
isReleaseVersion
|
|
@@ -34,7 +34,9 @@ from . import api, approval, host, identity, installation, schemas, tools
|
|
|
34
34
|
|
|
35
35
|
logger = logging.getLogger(__name__)
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
FAILED_TURN_WITHOUT_REASON = "no reason given"
|
|
38
|
+
REDACTION_UNAVAILABLE = "[redaction unavailable]"
|
|
39
|
+
FAILED_TURN_REASON_MAX_LENGTH = 200
|
|
38
40
|
SYSTEM_PROMPT_SECTION_ID = "pushary.reach-the-human"
|
|
39
41
|
HERMES_QUESTION_TOOL = "clarify"
|
|
40
42
|
QUESTION_ROUTING_PROMPT = (
|
|
@@ -82,7 +84,7 @@ TOOL_REGISTRATIONS = (
|
|
|
82
84
|
"Ask one of your own end-users and block on a fail-closed answer (Partner plan)"),
|
|
83
85
|
)
|
|
84
86
|
|
|
85
|
-
_session_totals = {"tools": 0, "errors": 0
|
|
87
|
+
_session_totals = {"tools": 0, "errors": 0}
|
|
86
88
|
_last_turn = {"completed": False, "interrupted": False}
|
|
87
89
|
_plugin_activity = {"attempted": False}
|
|
88
90
|
_plugin_activity_lock = threading.Lock()
|
|
@@ -173,7 +175,7 @@ def _redact_outbound_text(text: str) -> str:
|
|
|
173
175
|
return redact_for_egress(redacted) if redact_for_egress else redacted
|
|
174
176
|
except Exception:
|
|
175
177
|
logger.warning("[pushary] host redaction unavailable; omitting outbound detail")
|
|
176
|
-
return
|
|
178
|
+
return REDACTION_UNAVAILABLE
|
|
177
179
|
|
|
178
180
|
|
|
179
181
|
def _summarize_args(args):
|
|
@@ -312,52 +314,25 @@ def _on_pre_tool_call(tool_name=None, args=None, session_id=None, **kwargs):
|
|
|
312
314
|
return _block_unapproved(tool_name)
|
|
313
315
|
|
|
314
316
|
|
|
315
|
-
def
|
|
317
|
+
def _tool_failed(result, status):
|
|
316
318
|
if status is not None:
|
|
317
|
-
return
|
|
319
|
+
return status == "error"
|
|
318
320
|
try:
|
|
319
321
|
parsed = json.loads(result) if isinstance(result, str) else result
|
|
320
322
|
except (json.JSONDecodeError, TypeError):
|
|
321
|
-
return
|
|
322
|
-
|
|
323
|
-
return str(parsed["error"])
|
|
324
|
-
return None
|
|
323
|
+
return False
|
|
324
|
+
return isinstance(parsed, dict) and bool(parsed.get("error"))
|
|
325
325
|
|
|
326
326
|
|
|
327
|
-
def _on_post_tool_call(tool_name, args, result, duration_ms=0, status=None,
|
|
328
|
-
error_message=None, **kwargs):
|
|
327
|
+
def _on_post_tool_call(tool_name, args, result, duration_ms=0, status=None, **kwargs):
|
|
329
328
|
_session_totals["tools"] += 1
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
if failure is None:
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
_session_totals["errors"] += 1
|
|
336
|
-
if not api.is_configured():
|
|
337
|
-
return
|
|
338
|
-
if _session_totals["notified"] >= MAX_ERROR_NOTIFICATIONS:
|
|
339
|
-
return
|
|
340
|
-
_session_totals["notified"] += 1
|
|
341
|
-
|
|
342
|
-
try:
|
|
343
|
-
failure = _redact_outbound_text(str(failure))
|
|
344
|
-
api.send_notification(
|
|
345
|
-
title="Tool error in Hermes",
|
|
346
|
-
body=f"{tool_name} failed: {failure[:150]}",
|
|
347
|
-
agent_name=identity.agent_name(),
|
|
348
|
-
context={
|
|
349
|
-
"type": "error",
|
|
350
|
-
"errorMessage": failure[:500],
|
|
351
|
-
"summary": f"Tool '{tool_name}' returned an error after {duration_ms}ms",
|
|
352
|
-
},
|
|
353
|
-
)
|
|
354
|
-
except Exception:
|
|
355
|
-
pass
|
|
329
|
+
if _tool_failed(result, status):
|
|
330
|
+
_session_totals["errors"] += 1
|
|
356
331
|
|
|
357
332
|
|
|
358
333
|
def _on_session_start(session_id=None, **kwargs):
|
|
359
334
|
identity.remember_session(session_id)
|
|
360
|
-
_session_totals.update(tools=0, errors=0
|
|
335
|
+
_session_totals.update(tools=0, errors=0)
|
|
361
336
|
_last_turn.update(completed=False, interrupted=False)
|
|
362
337
|
_report_session_event("session_start", session_id, can_drain=True)
|
|
363
338
|
_report_plugin_active_once(session_id)
|
|
@@ -397,26 +372,40 @@ def _on_pre_llm_call(session_id=None, **kwargs):
|
|
|
397
372
|
}
|
|
398
373
|
|
|
399
374
|
|
|
400
|
-
def _report_session_event(event, session_id, can_drain=False):
|
|
375
|
+
def _report_session_event(event, session_id, can_drain=False, error=None):
|
|
401
376
|
if not api.is_configured() or not session_id:
|
|
402
377
|
return
|
|
403
378
|
try:
|
|
404
|
-
api.agent_event(event, session_id, can_drain=can_drain)
|
|
379
|
+
api.agent_event(event, session_id, can_drain=can_drain, error=error)
|
|
405
380
|
except Exception:
|
|
406
381
|
pass
|
|
407
382
|
|
|
408
383
|
|
|
409
|
-
def
|
|
384
|
+
def _turn_failure_reason(failed, interrupted, turn_exit_reason):
|
|
385
|
+
if failed is not True or interrupted:
|
|
386
|
+
return None
|
|
387
|
+
reason = _redact_outbound_text(str(turn_exit_reason or "").strip())
|
|
388
|
+
if not reason or reason == REDACTION_UNAVAILABLE:
|
|
389
|
+
return FAILED_TURN_WITHOUT_REASON
|
|
390
|
+
return reason[:FAILED_TURN_REASON_MAX_LENGTH]
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def _on_session_end(session_id=None, completed=False, interrupted=False, failed=False,
|
|
394
|
+
turn_exit_reason=None, **kwargs):
|
|
410
395
|
identity.remember_session(session_id)
|
|
411
396
|
_last_turn.update(completed=bool(completed), interrupted=bool(interrupted))
|
|
412
|
-
_report_session_event(
|
|
397
|
+
_report_session_event(
|
|
398
|
+
"session_end",
|
|
399
|
+
session_id or identity.session_id(),
|
|
400
|
+
error=_turn_failure_reason(failed, interrupted, turn_exit_reason),
|
|
401
|
+
)
|
|
413
402
|
|
|
414
403
|
|
|
415
404
|
def _on_session_finalize(session_id=None, **kwargs):
|
|
416
405
|
_report_session_event("session_closed", session_id or identity.session_id())
|
|
417
406
|
tool_count = _session_totals["tools"]
|
|
418
407
|
error_count = _session_totals["errors"]
|
|
419
|
-
_session_totals.update(tools=0, errors=0
|
|
408
|
+
_session_totals.update(tools=0, errors=0)
|
|
420
409
|
|
|
421
410
|
if not os.environ.get("PUSHARY_AUTO_NOTIFY_SESSION_END"):
|
|
422
411
|
identity.forget_session()
|
|
@@ -635,7 +624,7 @@ def report_plugin_active(session_id):
|
|
|
635
624
|
return False
|
|
636
625
|
|
|
637
626
|
|
|
638
|
-
def agent_event(event, session_id, can_drain=False):
|
|
627
|
+
def agent_event(event, session_id, can_drain=False, error=None):
|
|
639
628
|
"""Report a Hermes session and pick up a queued notch instruction."""
|
|
640
629
|
try:
|
|
641
630
|
pending = _read_pending(session_id) if can_drain else None
|
|
@@ -647,6 +636,7 @@ def agent_event(event, session_id, can_drain=False):
|
|
|
647
636
|
"canDrainCommand": can_drain and pending is None,
|
|
648
637
|
"ackMode": can_drain and pending is None,
|
|
649
638
|
"skipCommandDrain": pending is not None,
|
|
639
|
+
**({"error": error} if error else {}),
|
|
650
640
|
})
|
|
651
641
|
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
652
642
|
raw = resp.read().decode("utf-8")
|
|
@@ -1073,7 +1063,7 @@ def record_plugin_load(approval_transport_registered, home=None, pid=None, now=N
|
|
|
1073
1063
|
logger.debug("[pushary] could not record the plugin load: %s", exc)
|
|
1074
1064
|
return None
|
|
1075
1065
|
` },
|
|
1076
|
-
{ path: "plugin.yaml", contents: "name: pushary\nversion: 0.8.
|
|
1066
|
+
{ path: "plugin.yaml", contents: "name: pushary\nversion: 0.8.1\ndescription: Push notifications and human-in-the-loop for Hermes Agent via Pushary\nauthor: RalphNex OU\nrequires_env:\n - name: PUSHARY_API_KEY\n description: Your Pushary API key\n url: https://pushary.com/sign-up?from=hermes\n secret: true\nprovides_tools:\n - pushary_remind\n - pushary_notify\n - pushary_ask\n - pushary_wait\n - pushary_cancel\n - pushary_propose_scope\n - pushary_enroll\n - pushary_ask_end_user\nprovides_hooks:\n - pre_llm_call\n - pre_tool_call\n - post_tool_call\n - on_session_start\n - on_session_end\n - on_session_finalize\nprovides_approval_transports:\n - pushary\n" },
|
|
1077
1067
|
{ path: "schemas.py", contents: `PUSHARY_REMIND = {
|
|
1078
1068
|
"name": "pushary_remind",
|
|
1079
1069
|
"description": "Schedule a one-time personal reminder on Pushary, even after Hermes exits. Use body plus in_minutes or at (ISO timestamp with explicit UTC offset, within 30 days). Never guess the user's timezone. Confirm the returned time. No arguments lists pending reminders; cancel_reminder_id cancels a scheduled one. Use Hermes cron for agent work; use this for reminding the operator.",
|
|
@@ -2,22 +2,22 @@ import {
|
|
|
2
2
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
3
3
|
describeSignedOutKey,
|
|
4
4
|
readSignedOutDiagnosis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QE22XDUK.js";
|
|
6
6
|
import {
|
|
7
7
|
APPROVAL_RULES_PATH
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XLKO2XEG.js";
|
|
9
9
|
import {
|
|
10
10
|
createIo
|
|
11
11
|
} from "./chunk-FO3MDD26.js";
|
|
12
12
|
import {
|
|
13
13
|
readKeySource
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GZHQQP7J.js";
|
|
15
15
|
import {
|
|
16
16
|
absoluteUrl,
|
|
17
17
|
checkApiKey,
|
|
18
18
|
describeKeyCheck,
|
|
19
19
|
keyCheckFromResponse
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AQA63ZWO.js";
|
|
21
21
|
import {
|
|
22
22
|
EXIT
|
|
23
23
|
} from "./chunk-KZERVKTD.js";
|