@pushary/agent-hooks 0.57.0 → 0.58.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-claude.js +1 -1
- package/dist/bin/pushary-codex-hook.js +1 -1
- package/dist/bin/pushary-codex.js +1 -1
- package/dist/bin/pushary-gemini-hook.js +1 -1
- package/dist/bin/pushary-hook.js +2 -2
- package/dist/bin/pushary-notification-hook.js +1 -1
- package/dist/bin/pushary-permission-denied-hook.js +2 -2
- package/dist/bin/pushary-permission-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-session-end-hook.js +1 -1
- package/dist/bin/pushary-session-start-hook.js +1 -1
- package/dist/bin/pushary-setup.js +1 -1
- package/dist/bin/pushary-stop-hook.js +1 -1
- package/dist/bin/pushary-stopfailure-hook.js +1 -1
- package/dist/{chunk-NPYANTRC.js → chunk-Q7VUYLH4.js} +1 -1
- package/dist/{chunk-LEWSYLHL.js → chunk-XG3C4DZA.js} +15 -2
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +2 -2
- package/package.json +1 -1
package/dist/bin/pushary-hook.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePreToolUse
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-Q7VUYLH4.js";
|
|
5
5
|
import "../chunk-QYQO6RHJ.js";
|
|
6
6
|
import "../chunk-YHG74UFF.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-XG3C4DZA.js";
|
|
8
8
|
import "../chunk-RN3NOEJF.js";
|
|
9
9
|
import "../chunk-5TECIV6T.js";
|
|
10
10
|
import "../chunk-DWED7BS3.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionDenied
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-Q7VUYLH4.js";
|
|
5
5
|
import "../chunk-QYQO6RHJ.js";
|
|
6
6
|
import "../chunk-YHG74UFF.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-XG3C4DZA.js";
|
|
8
8
|
import "../chunk-RN3NOEJF.js";
|
|
9
9
|
import "../chunk-5TECIV6T.js";
|
|
10
10
|
import "../chunk-DWED7BS3.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionRequest
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-Q7VUYLH4.js";
|
|
5
5
|
import "../chunk-QYQO6RHJ.js";
|
|
6
6
|
import "../chunk-YHG74UFF.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-XG3C4DZA.js";
|
|
8
8
|
import "../chunk-RN3NOEJF.js";
|
|
9
9
|
import "../chunk-5TECIV6T.js";
|
|
10
10
|
import "../chunk-DWED7BS3.js";
|
|
@@ -295,13 +295,26 @@ var deriveReceiptCommandHead = (command) => {
|
|
|
295
295
|
return head ? head.slice(0, TOOL_TARGET_MAX_LENGTH) : void 0;
|
|
296
296
|
};
|
|
297
297
|
var RECEIPT_TARGET_MAX_LENGTH = 256;
|
|
298
|
+
var EXIT_CODE_FAILURE = /^Error: Exit code \d+/;
|
|
298
299
|
var isToolResultError = (toolResult) => {
|
|
299
300
|
try {
|
|
300
|
-
|
|
301
|
+
if (typeof toolResult === "string") return EXIT_CODE_FAILURE.test(toolResult);
|
|
302
|
+
if (!toolResult || typeof toolResult !== "object") return false;
|
|
303
|
+
return "error" in toolResult || "is_error" in toolResult;
|
|
301
304
|
} catch {
|
|
302
305
|
return false;
|
|
303
306
|
}
|
|
304
307
|
};
|
|
308
|
+
var toolResultErrorText = (toolResult) => {
|
|
309
|
+
try {
|
|
310
|
+
const raw = typeof toolResult === "string" ? toolResult : toolResult && typeof toolResult === "object" ? String(
|
|
311
|
+
toolResult.error ?? toolResult.stderr ?? ""
|
|
312
|
+
) : "";
|
|
313
|
+
return redactSecrets(raw);
|
|
314
|
+
} catch {
|
|
315
|
+
return "";
|
|
316
|
+
}
|
|
317
|
+
};
|
|
305
318
|
var relativizeReceiptPath = (filePath, cwd) => {
|
|
306
319
|
if (!cwd || !isAbsolute(filePath)) return filePath;
|
|
307
320
|
return relative(cwd, filePath);
|
|
@@ -962,7 +975,7 @@ var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
962
975
|
agentName: `${agent.label} - ${projectName}`,
|
|
963
976
|
action,
|
|
964
977
|
sessionId: input.session_id,
|
|
965
|
-
error: isError ?
|
|
978
|
+
error: isError ? toolResultErrorText(toolResult).slice(0, 500) : void 0,
|
|
966
979
|
decisionSource,
|
|
967
980
|
...beacon ? { decisionOrigin: beacon.decisionOrigin, toolName: beacon.toolName, toolTarget: beacon.toolTarget } : {},
|
|
968
981
|
meta: receiptsEnabled ? deriveReceiptMeta(lookup.tool, lookup.input, toolResult, input.cwd ?? process.cwd()) : void 0,
|
package/dist/src/index.d.ts
CHANGED
|
@@ -81,8 +81,8 @@ declare const reportEvent: (event: AgentEvent, options?: ReportEventOptions) =>
|
|
|
81
81
|
declare const handlePostToolUse: (input: {
|
|
82
82
|
tool_name: string;
|
|
83
83
|
tool_input: Record<string, unknown>;
|
|
84
|
-
tool_response?:
|
|
85
|
-
tool_result?:
|
|
84
|
+
tool_response?: unknown;
|
|
85
|
+
tool_result?: unknown;
|
|
86
86
|
cwd?: string;
|
|
87
87
|
session_id?: string;
|
|
88
88
|
transcript_path?: string;
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-Q7VUYLH4.js";
|
|
4
4
|
import "../chunk-QYQO6RHJ.js";
|
|
5
5
|
import "../chunk-YHG74UFF.js";
|
|
6
6
|
import {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
reportEvent,
|
|
16
16
|
resolvePolicy,
|
|
17
17
|
waitForAnswer
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-XG3C4DZA.js";
|
|
19
19
|
import "../chunk-RN3NOEJF.js";
|
|
20
20
|
import "../chunk-5TECIV6T.js";
|
|
21
21
|
import "../chunk-DWED7BS3.js";
|