@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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  removeUserPromptSubmitHook
3
- } from "./chunk-3ZIHOOA4.js";
3
+ } from "./chunk-Q3PCM4MO.js";
4
4
  import {
5
5
  removeMcpServer,
6
6
  stopDispatcher
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  upsertUserPromptSubmitHook
3
- } from "./chunk-3ZIHOOA4.js";
3
+ } from "./chunk-Q3PCM4MO.js";
4
4
  import {
5
5
  startDispatcher,
6
6
  upsertMcpServer
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  uninstall
3
- } from "./chunk-6SCQVJBL.js";
3
+ } from "./chunk-D2GHBPXZ.js";
4
4
  import {
5
5
  install
6
- } from "./chunk-DI3DIMUQ.js";
6
+ } from "./chunk-G2CF37UQ.js";
7
7
  import {
8
8
  status
9
9
  } from "./chunk-O4H76K3B.js";
@@ -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 HOOK_EVENTS = ["UserPromptSubmit", "PreToolUse"];
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 HOOK_EVENTS) {
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 HOOK_EVENTS) {
65
- const list = settings.hooks[event] ?? [];
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-6SCQVJBL.js";
4
+ } from "./chunk-D2GHBPXZ.js";
5
5
  import {
6
6
  install
7
- } from "./chunk-DI3DIMUQ.js";
8
- import "./chunk-3ZIHOOA4.js";
7
+ } from "./chunk-G2CF37UQ.js";
8
+ import "./chunk-Q3PCM4MO.js";
9
9
  import {
10
10
  status
11
11
  } from "./chunk-O4H76K3B.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createIntegrationRoutes
3
- } from "./chunk-5H46YKCX.js";
4
- import "./chunk-6SCQVJBL.js";
5
- import "./chunk-DI3DIMUQ.js";
6
- import "./chunk-3ZIHOOA4.js";
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-5H46YKCX.js";
7
+ } from "./chunk-GZR3Z53N.js";
8
8
  import {
9
9
  uninstall
10
- } from "./chunk-6SCQVJBL.js";
10
+ } from "./chunk-D2GHBPXZ.js";
11
11
  import {
12
12
  install
13
- } from "./chunk-DI3DIMUQ.js";
14
- import "./chunk-3ZIHOOA4.js";
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
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  install,
3
3
  selectExposableAgents
4
- } from "./chunk-DI3DIMUQ.js";
5
- import "./chunk-3ZIHOOA4.js";
4
+ } from "./chunk-G2CF37UQ.js";
5
+ import "./chunk-Q3PCM4MO.js";
6
6
  import "./chunk-US5FT2UB.js";
7
7
  import "./chunk-SBP7MJP2.js";
8
8
  export {
package/dist/uninstall.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  uninstall
3
- } from "./chunk-6SCQVJBL.js";
4
- import "./chunk-3ZIHOOA4.js";
3
+ } from "./chunk-D2GHBPXZ.js";
4
+ import "./chunk-Q3PCM4MO.js";
5
5
  import "./chunk-US5FT2UB.js";
6
6
  import "./chunk-SBP7MJP2.js";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/claudecode",
3
- "version": "0.1.12",
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",