auto-mode 2.0.1 → 3.0.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.
@@ -19,58 +19,58 @@ export function register(on: ModOn, options: ModOptions): void {
19
19
 
20
20
  let prompts: PromptContext = buildPromptContext(null, { source: 'reload' });
21
21
 
22
- on('classic.SessionStart', (_api, e, next) => {
23
- if (e.agent_id === undefined) {
24
- const isCompact = e.source === 'compact' && sessionID === e.session_id;
22
+ on('classic.SessionStart', (_api, event, next) => {
23
+ if (event.agent_id === undefined) {
24
+ const isCompact = event.source === 'compact' && sessionID === event.session_id;
25
25
 
26
- sessionID = e.session_id;
26
+ sessionID = event.session_id;
27
27
 
28
28
  const previousPrompts = isCompact ? prompts : null;
29
29
 
30
- prompts = buildPromptContext(previousPrompts, { source: e.source ?? 'unknown' });
30
+ prompts = buildPromptContext(previousPrompts, { source: event.source ?? 'unknown' });
31
31
 
32
32
  if (!isCompact) {
33
33
  delegatedTasks.clear();
34
34
  }
35
35
  }
36
36
 
37
- return next(e);
37
+ return next(event);
38
38
  });
39
39
 
40
- on('classic.UserPromptSubmit', (_api, e, next) => {
41
- if (e.agent_id === undefined) {
42
- sessionID = e.session_id;
40
+ on('classic.UserPromptSubmit', (_api, event, next) => {
41
+ if (event.agent_id === undefined) {
42
+ sessionID = event.session_id;
43
43
  }
44
44
 
45
- return next(e);
45
+ return next(event);
46
46
  });
47
47
 
48
- on('prompt.submit', (_api, e, next) => {
49
- prompts = buildPromptContext(prompts, e);
48
+ on('prompt.submit', (_api, event, next) => {
49
+ prompts = buildPromptContext(prompts, event);
50
50
 
51
- return next(e);
51
+ return next(event);
52
52
  });
53
53
 
54
- on('agent.spawn', async (_api, e, next) => {
55
- const result = await next(e);
54
+ on('agent.spawn', async (_api, event, next) => {
55
+ const result = await next(event);
56
56
 
57
57
  if (result.agentId !== undefined && !delegatedTasks.has(result.agentId)) {
58
- delegatedTasks.set(result.agentId, e.prompt);
58
+ delegatedTasks.set(result.agentId, event.prompt);
59
59
  }
60
60
 
61
61
  return result;
62
62
  });
63
63
 
64
- on('tool.call', async ($, e, next) => {
65
- if (e.tool_use_id === undefined) {
66
- return next(e);
64
+ on('tool.call', async ($, event, next) => {
65
+ if (event.tool_use_id === undefined) {
66
+ return next(event);
67
67
  }
68
68
 
69
- activeCalls.set(e.tool_use_id, e.agentId ?? null);
69
+ activeCalls.set(event.tool_use_id, event.agentId ?? null);
70
70
 
71
71
  const command =
72
- e.tool === 'Bash' && typeof e.command === 'string' && isScopeCommand(e.command)
73
- ? e.command
72
+ event.tool === 'Bash' && typeof event.command === 'string' && isScopeCommand(event.command)
73
+ ? event.command
74
74
  : null;
75
75
 
76
76
  const startedAt = Date.now();
@@ -78,9 +78,9 @@ export function register(on: ModOn, options: ModOptions): void {
78
78
  let result;
79
79
 
80
80
  try {
81
- result = await next(e);
81
+ result = await next(event);
82
82
  } finally {
83
- activeCalls.delete(e.tool_use_id);
83
+ activeCalls.delete(event.tool_use_id);
84
84
  }
85
85
 
86
86
  if (command !== null && cwd !== null && sessionID !== null && result.deny === undefined) {
@@ -107,12 +107,12 @@ export function register(on: ModOn, options: ModOptions): void {
107
107
  return result;
108
108
  });
109
109
 
110
- on('tool.check', async ($, e, next) => {
111
- const decided = await next(e);
110
+ on('tool.check', async ($, event, next) => {
111
+ const decided = await next(event);
112
112
 
113
113
  const actionID =
114
- e.tool_use_id !== undefined && /^call_[\da-f]{24,32}$/u.test(e.tool_use_id)
115
- ? e.tool_use_id
114
+ event.tool_use_id !== undefined && /^call_[\da-f]{24,32}$/u.test(event.tool_use_id)
115
+ ? event.tool_use_id
116
116
  : 'unavailable';
117
117
 
118
118
  const logPrefix = `auto-mode action ${actionID}:`;
@@ -138,7 +138,7 @@ export function register(on: ModOn, options: ModOptions): void {
138
138
  try {
139
139
  const cwd = await $.session.cwd();
140
140
 
141
- const agentID = e.tool_use_id === undefined ? null : activeCalls.get(e.tool_use_id);
141
+ const agentID = event.tool_use_id === undefined ? null : activeCalls.get(event.tool_use_id);
142
142
 
143
143
  if (agentID === undefined) {
144
144
  $.ui.log(`${logPrefix} evaluation skipped; untracked tool call`, { to: 'debug' });
@@ -146,7 +146,7 @@ export function register(on: ModOn, options: ModOptions): void {
146
146
  return decided;
147
147
  }
148
148
 
149
- if (!isToolInput(e.input)) {
149
+ if (!isToolInput(event.input)) {
150
150
  $.ui.log(`${logPrefix} evaluation skipped; tool input is not an object`, { to: 'debug' });
151
151
 
152
152
  return decided;
@@ -160,10 +160,10 @@ export function register(on: ModOn, options: ModOptions): void {
160
160
 
161
161
  const request = buildActionRequest({
162
162
  sessionID,
163
- toolUseID: e.tool_use_id,
163
+ toolUseID: event.tool_use_id,
164
164
  cwd,
165
- toolName: e.tool,
166
- toolInput: e.input,
165
+ toolName: event.tool,
166
+ toolInput: event.input,
167
167
  agentID,
168
168
  delegatedText: agentID === null ? undefined : delegatedTasks.get(agentID),
169
169
  prompts,
@@ -57,10 +57,10 @@ declare module 'claude-code/testing' {
57
57
 
58
58
  interface MockClock {
59
59
  readonly now: () => number;
60
- readonly advance: (ms: number) => Promise<void>;
61
- readonly set: (ms: number) => Promise<void>;
60
+ readonly advance: (durationMs: number) => Promise<void>;
61
+ readonly set: (epochMs: number) => Promise<void>;
62
62
  readonly settle: () => Promise<void>;
63
- readonly sleep: (ms: number) => Promise<void>;
63
+ readonly sleep: (durationMs: number) => Promise<void>;
64
64
  }
65
65
 
66
66
  interface MockClockOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-mode",
3
- "version": "2.0.1",
3
+ "version": "3.0.0",
4
4
  "description": "A permission classifier library and Claude Code mod, so agents that are not Claude can run unattended",
5
5
  "keywords": [
6
6
  "agent",
@@ -53,7 +53,6 @@
53
53
  "eval:relay-consent": "bun --no-env-file --conditions=auto-mode-eval evals/runners/run-relay-consent-evaluation.ts",
54
54
  "eval:second-judge": "bun --no-env-file --conditions=auto-mode-eval evals/runners/run-second-judge-evaluation.ts",
55
55
  "eval:stale-consent": "bun --no-env-file --conditions=auto-mode-eval evals/runners/run-stale-consent-evaluation.ts",
56
- "first-publish": "scripts/first-publish.sh",
57
56
  "format": "oxfmt . && format-codemod --quiet .",
58
57
  "format:check": "oxfmt --check . && format-codemod --check --quiet .",
59
58
  "lint": "oxlint",
@@ -73,37 +72,38 @@
73
72
  "test:related": "bun scripts/run-related-tests.ts"
74
73
  },
75
74
  "devDependencies": {
76
- "@anthropic-ai/claude-agent-sdk": "0.3.295",
77
- "@commitlint/cli": "21.2.2",
75
+ "@anthropic-ai/claude-agent-sdk": "0.3.296",
76
+ "@commitlint/cli": "21.2.3",
78
77
  "@faker-js/faker": "10.6.0",
79
78
  "@stylistic/eslint-plugin": "5.10.0",
80
79
  "@tsconfig/strictest": "2.0.8",
81
- "@types/bun": "1.3.14",
82
- "@types/node": "26.5.1",
83
- "@zgeoff/bun-test-extended": "0.2.0",
84
- "@zgeoff/format-codemod": "0.1.0",
85
- "@zgeoff/oxlint-config": "0.2.4",
80
+ "@types/bun": "1.4.2",
81
+ "@types/node": "26.6.5",
82
+ "@zgeoff/bun-test-extended": "0.2.1",
83
+ "@zgeoff/format-codemod": "0.3.0",
84
+ "@zgeoff/oxlint-config": "0.6.1",
85
+ "@zgeoff/skill-gate": "0.2.2",
86
86
  "gunshi": "1.0.0-rc.1",
87
- "knip": "6.35.1",
88
- "lefthook": "2.1.12",
87
+ "knip": "6.41.0",
88
+ "lefthook": "2.2.1",
89
89
  "mitata": "1.0.34",
90
90
  "msw": "2.15.0",
91
- "oxfmt": "0.67.0",
92
- "oxlint": "1.82.0",
93
- "oxlint-tsgolint": "7.0.2001",
94
- "publint": "0.3.24",
91
+ "oxfmt": "0.72.0",
92
+ "oxlint": "1.87.0",
93
+ "oxlint-tsgolint": "7.0.2004",
94
+ "publint": "0.3.25",
95
95
  "re2js": "2.8.6",
96
96
  "tiny-invariant": "1.3.3",
97
97
  "ts-pattern": "5.9.0",
98
- "tsdown": "0.23.0",
98
+ "tsdown": "0.23.1",
99
99
  "typescript": "7.0.2",
100
- "zod": "4.6.2"
100
+ "zod": "4.6.6"
101
101
  },
102
102
  "overrides": {
103
- "smol-toml": "1.9.0"
103
+ "smol-toml": "1.9.1"
104
104
  },
105
105
  "engines": {
106
106
  "node": ">=24"
107
107
  },
108
- "packageManager": "bun@1.3.10"
108
+ "packageManager": "bun@1.4.3"
109
109
  }
@@ -1,2 +0,0 @@
1
- import { t as startJudgeSession } from "./start-judge-session-DjPX0007.js";
2
- export { startJudgeSession };