@agenticmail/claudecode 0.1.12 → 0.1.13
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/{chunk-6SCQVJBL.js → chunk-D2GHBPXZ.js} +1 -1
- package/dist/{chunk-DI3DIMUQ.js → chunk-G2CF37UQ.js} +1 -1
- package/dist/{chunk-5H46YKCX.js → chunk-GZR3Z53N.js} +2 -2
- package/dist/{chunk-3ZIHOOA4.js → chunk-Q3PCM4MO.js} +20 -15
- package/dist/cli.js +3 -3
- package/dist/http-routes.js +4 -4
- package/dist/index.js +4 -4
- package/dist/install.js +2 -2
- package/dist/uninstall.js +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, renameSync } from "fs";
|
|
3
3
|
import { dirname } from "path";
|
|
4
4
|
var AGENTICMAIL_HOOK_MARKER = "agenticmail-mail-hook";
|
|
5
|
-
var
|
|
5
|
+
var HOOK_EVENTS_TO_REGISTER = ["UserPromptSubmit"];
|
|
6
|
+
var HOOK_EVENTS_TO_REMOVE = ["UserPromptSubmit", "PreToolUse"];
|
|
6
7
|
function readSettings(path) {
|
|
7
8
|
if (!existsSync(path)) return {};
|
|
8
9
|
const raw = readFileSync(path, "utf-8");
|
|
@@ -29,12 +30,27 @@ function upsertMailHook(path, command) {
|
|
|
29
30
|
const settings = readSettings(path);
|
|
30
31
|
if (!settings.hooks) settings.hooks = {};
|
|
31
32
|
let changed = false;
|
|
32
|
-
for (const event of
|
|
33
|
+
for (const event of HOOK_EVENTS_TO_REGISTER) {
|
|
33
34
|
if (upsertOneEvent(settings.hooks, event, command)) changed = true;
|
|
34
35
|
}
|
|
36
|
+
for (const event of HOOK_EVENTS_TO_REMOVE) {
|
|
37
|
+
if (HOOK_EVENTS_TO_REGISTER.includes(event)) continue;
|
|
38
|
+
if (removeOneEvent(settings.hooks, event)) changed = true;
|
|
39
|
+
}
|
|
35
40
|
if (changed) writeSettings(path, settings);
|
|
36
41
|
return changed;
|
|
37
42
|
}
|
|
43
|
+
function removeOneEvent(hooks, event) {
|
|
44
|
+
const list = hooks[event] ?? [];
|
|
45
|
+
if (list.length === 0) return false;
|
|
46
|
+
const filtered = list.filter(
|
|
47
|
+
(rule) => !rule.hooks?.some((h) => typeof h.command === "string" && h.command.includes(AGENTICMAIL_HOOK_MARKER))
|
|
48
|
+
);
|
|
49
|
+
if (filtered.length === list.length) return false;
|
|
50
|
+
if (filtered.length === 0) delete hooks[event];
|
|
51
|
+
else hooks[event] = filtered;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
38
54
|
function upsertOneEvent(hooks, event, command) {
|
|
39
55
|
const list = hooks[event] ?? [];
|
|
40
56
|
const isOurs = (rule) => rule.hooks?.some((h) => typeof h.command === "string" && h.command.includes(AGENTICMAIL_HOOK_MARKER)) ?? false;
|
|
@@ -61,19 +77,8 @@ function removeMailHook(path) {
|
|
|
61
77
|
const settings = readSettings(path);
|
|
62
78
|
if (!settings.hooks) return false;
|
|
63
79
|
let changed = false;
|
|
64
|
-
for (const event of
|
|
65
|
-
|
|
66
|
-
if (list.length === 0) continue;
|
|
67
|
-
const filtered = list.filter(
|
|
68
|
-
(rule) => !rule.hooks?.some((h) => typeof h.command === "string" && h.command.includes(AGENTICMAIL_HOOK_MARKER))
|
|
69
|
-
);
|
|
70
|
-
if (filtered.length === list.length) continue;
|
|
71
|
-
if (filtered.length === 0) {
|
|
72
|
-
delete settings.hooks[event];
|
|
73
|
-
} else {
|
|
74
|
-
settings.hooks[event] = filtered;
|
|
75
|
-
}
|
|
76
|
-
changed = true;
|
|
80
|
+
for (const event of HOOK_EVENTS_TO_REMOVE) {
|
|
81
|
+
if (removeOneEvent(settings.hooks, event)) changed = true;
|
|
77
82
|
}
|
|
78
83
|
if (settings.hooks && Object.keys(settings.hooks).length === 0) {
|
|
79
84
|
delete settings.hooks;
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
uninstall
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-D2GHBPXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
install
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-G2CF37UQ.js";
|
|
8
|
+
import "./chunk-Q3PCM4MO.js";
|
|
9
9
|
import {
|
|
10
10
|
status
|
|
11
11
|
} from "./chunk-O4H76K3B.js";
|
package/dist/http-routes.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIntegrationRoutes
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-GZR3Z53N.js";
|
|
4
|
+
import "./chunk-D2GHBPXZ.js";
|
|
5
|
+
import "./chunk-G2CF37UQ.js";
|
|
6
|
+
import "./chunk-Q3PCM4MO.js";
|
|
7
7
|
import "./chunk-O4H76K3B.js";
|
|
8
8
|
import "./chunk-US5FT2UB.js";
|
|
9
9
|
import "./chunk-SBP7MJP2.js";
|
package/dist/index.js
CHANGED
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-YWUZKKQ5.js";
|
|
5
5
|
import {
|
|
6
6
|
createIntegrationRoutes
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GZR3Z53N.js";
|
|
8
8
|
import {
|
|
9
9
|
uninstall
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-D2GHBPXZ.js";
|
|
11
11
|
import {
|
|
12
12
|
install
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-G2CF37UQ.js";
|
|
14
|
+
import "./chunk-Q3PCM4MO.js";
|
|
15
15
|
import {
|
|
16
16
|
status
|
|
17
17
|
} from "./chunk-O4H76K3B.js";
|
package/dist/install.js
CHANGED
package/dist/uninstall.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticmail/claudecode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Claude Code integration for AgenticMail — surfaces every AgenticMail agent as a native Claude Code subagent so any Claude Code session can delegate to them with the Agent tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|