@dexto/core 1.8.11 → 1.9.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.
Files changed (113) hide show
  1. package/dist/approval/manager.cjs +37 -325
  2. package/dist/approval/manager.d.ts +10 -109
  3. package/dist/approval/manager.d.ts.map +1 -1
  4. package/dist/approval/manager.js +37 -316
  5. package/dist/approval/schemas.cjs +8 -51
  6. package/dist/approval/schemas.d.ts +5 -179
  7. package/dist/approval/schemas.d.ts.map +1 -1
  8. package/dist/approval/schemas.js +8 -47
  9. package/dist/approval/types.cjs +0 -6
  10. package/dist/approval/types.d.ts +2 -27
  11. package/dist/approval/types.d.ts.map +1 -1
  12. package/dist/approval/types.js +0 -6
  13. package/dist/context/content-clone.cjs +12 -8
  14. package/dist/context/content-clone.d.ts.map +1 -1
  15. package/dist/context/content-clone.js +12 -8
  16. package/dist/errors/DextoRuntimeError.cjs +3 -1
  17. package/dist/errors/DextoRuntimeError.d.ts +5 -3
  18. package/dist/errors/DextoRuntimeError.d.ts.map +1 -1
  19. package/dist/errors/DextoRuntimeError.js +3 -1
  20. package/dist/errors/index.d.ts +1 -1
  21. package/dist/errors/index.d.ts.map +1 -1
  22. package/dist/errors/types.d.ts +1 -0
  23. package/dist/errors/types.d.ts.map +1 -1
  24. package/dist/events/index.d.ts +2 -2
  25. package/dist/events/index.d.ts.map +1 -1
  26. package/dist/llm/executor/provider-error.cjs +25 -4
  27. package/dist/llm/executor/provider-error.d.ts.map +1 -1
  28. package/dist/llm/executor/provider-error.js +25 -4
  29. package/dist/llm/executor/stream-processor.cjs +61 -0
  30. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  31. package/dist/llm/executor/stream-processor.js +61 -0
  32. package/dist/llm/executor/turn-executor.cjs +93 -26
  33. package/dist/llm/executor/turn-executor.d.ts +2 -0
  34. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  35. package/dist/llm/executor/turn-executor.js +93 -26
  36. package/dist/llm/formatters/vercel.cjs +66 -0
  37. package/dist/llm/formatters/vercel.d.ts.map +1 -1
  38. package/dist/llm/formatters/vercel.js +66 -0
  39. package/dist/llm/services/factory.cjs +3 -2
  40. package/dist/llm/services/factory.d.ts.map +1 -1
  41. package/dist/llm/services/factory.js +3 -2
  42. package/dist/llm/services/types.d.ts +8 -0
  43. package/dist/llm/services/types.d.ts.map +1 -1
  44. package/dist/llm/services/vercel.cjs +6 -1
  45. package/dist/llm/services/vercel.d.ts +3 -2
  46. package/dist/llm/services/vercel.d.ts.map +1 -1
  47. package/dist/llm/services/vercel.js +6 -1
  48. package/dist/session/chat-session.cjs +3 -0
  49. package/dist/session/chat-session.d.ts +2 -1
  50. package/dist/session/chat-session.d.ts.map +1 -1
  51. package/dist/session/chat-session.js +3 -0
  52. package/dist/session/message-queue.cjs +48 -75
  53. package/dist/session/message-queue.d.ts +1 -2
  54. package/dist/session/message-queue.d.ts.map +1 -1
  55. package/dist/session/message-queue.js +48 -75
  56. package/dist/session/session-manager.cjs +14 -32
  57. package/dist/session/session-manager.d.ts +5 -2
  58. package/dist/session/session-manager.d.ts.map +1 -1
  59. package/dist/session/session-manager.js +14 -32
  60. package/dist/storage/approvals/types.cjs +2 -9
  61. package/dist/storage/approvals/types.d.ts +4 -16
  62. package/dist/storage/approvals/types.d.ts.map +1 -1
  63. package/dist/storage/approvals/types.js +2 -8
  64. package/dist/storage/database/types.d.ts +5 -0
  65. package/dist/storage/database/types.d.ts.map +1 -1
  66. package/dist/storage/index.cjs +0 -2
  67. package/dist/storage/index.d.ts +2 -2
  68. package/dist/storage/index.d.ts.map +1 -1
  69. package/dist/storage/index.js +1 -2
  70. package/dist/storage/message-queue/types.d.ts +14 -6
  71. package/dist/storage/message-queue/types.d.ts.map +1 -1
  72. package/dist/storage/stores/backend.cjs +68 -32
  73. package/dist/storage/stores/backend.d.ts +17 -8
  74. package/dist/storage/stores/backend.d.ts.map +1 -1
  75. package/dist/storage/stores/backend.js +69 -33
  76. package/dist/storage/stores/in-memory.cjs +26 -11
  77. package/dist/storage/stores/in-memory.d.ts.map +1 -1
  78. package/dist/storage/stores/in-memory.js +27 -12
  79. package/dist/test-utils/in-memory-storage.cjs +11 -0
  80. package/dist/test-utils/in-memory-storage.js +11 -0
  81. package/dist/test-utils/session-state-stores.cjs +25 -9
  82. package/dist/test-utils/session-state-stores.js +26 -10
  83. package/dist/tools/approval/tool-approval-policy.cjs +87 -0
  84. package/dist/tools/approval/tool-approval-policy.d.ts +34 -0
  85. package/dist/tools/approval/tool-approval-policy.d.ts.map +1 -0
  86. package/dist/tools/approval/tool-approval-policy.js +64 -0
  87. package/dist/tools/error-codes.cjs +0 -1
  88. package/dist/tools/error-codes.d.ts +0 -1
  89. package/dist/tools/error-codes.d.ts.map +1 -1
  90. package/dist/tools/error-codes.js +0 -1
  91. package/dist/tools/errors.cjs +0 -15
  92. package/dist/tools/errors.d.ts +0 -9
  93. package/dist/tools/errors.d.ts.map +1 -1
  94. package/dist/tools/errors.js +0 -15
  95. package/dist/tools/index.cjs +2 -0
  96. package/dist/tools/index.d.ts +1 -1
  97. package/dist/tools/index.d.ts.map +1 -1
  98. package/dist/tools/index.js +5 -1
  99. package/dist/tools/tool-manager.cjs +94 -312
  100. package/dist/tools/tool-manager.d.ts +4 -19
  101. package/dist/tools/tool-manager.d.ts.map +1 -1
  102. package/dist/tools/tool-manager.js +95 -316
  103. package/dist/tools/types.d.ts +10 -9
  104. package/dist/tools/types.d.ts.map +1 -1
  105. package/dist/utils/service-initializer.cjs +3 -0
  106. package/dist/utils/service-initializer.d.ts +2 -1
  107. package/dist/utils/service-initializer.d.ts.map +1 -1
  108. package/dist/utils/service-initializer.js +3 -0
  109. package/package.json +2 -2
  110. package/dist/tools/pattern-utils.cjs +0 -33
  111. package/dist/tools/pattern-utils.d.ts +0 -20
  112. package/dist/tools/pattern-utils.d.ts.map +0 -1
  113. package/dist/tools/pattern-utils.js +0 -10
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,54 +15,19 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var manager_exports = {};
30
20
  __export(manager_exports, {
31
21
  ApprovalManager: () => ApprovalManager
32
22
  });
33
23
  module.exports = __toCommonJS(manager_exports);
34
- var import_node_path = __toESM(require("node:path"), 1);
35
- var import_node_fs = require("node:fs");
36
24
  var import_node_util = require("node:util");
37
25
  var import_types = require("./types.js");
38
26
  var import_schemas = require("./schemas.js");
39
27
  var import_factory = require("./factory.js");
40
28
  var import_types2 = require("../logger/v2/types.js");
41
29
  var import_errors = require("./errors.js");
42
- var import_pattern_utils = require("../tools/pattern-utils.js");
43
30
  const GLOBAL_APPROVAL_SCOPE = "__global__";
44
- function tryRealpathSync(targetPath) {
45
- try {
46
- return (0, import_node_fs.realpathSync)(targetPath);
47
- } catch {
48
- return null;
49
- }
50
- }
51
- function tryRealpathSyncWithExistingParent(resolvedPath) {
52
- const direct = tryRealpathSync(resolvedPath);
53
- if (direct) return direct;
54
- let currentDir = import_node_path.default.dirname(resolvedPath);
55
- while (true) {
56
- const realDir = tryRealpathSync(currentDir);
57
- if (realDir) {
58
- const suffix = import_node_path.default.relative(currentDir, resolvedPath);
59
- return import_node_path.default.join(realDir, suffix);
60
- }
61
- const parent = import_node_path.default.dirname(currentDir);
62
- if (parent === currentDir) {
63
- return null;
64
- }
65
- currentDir = parent;
66
- }
67
- }
68
31
  class ApprovalManager {
69
32
  constructor(config, logger, approvalStore) {
70
33
  this.approvalStore = approvalStore;
@@ -98,8 +61,7 @@ class ApprovalManager {
98
61
  }
99
62
  createEmptyScopeState() {
100
63
  return {
101
- toolPatterns: /* @__PURE__ */ new Map(),
102
- approvedDirectories: /* @__PURE__ */ new Map()
64
+ approvedKeys: /* @__PURE__ */ new Map()
103
65
  };
104
66
  }
105
67
  getOrCreateScope(scopeKey) {
@@ -146,26 +108,13 @@ class ApprovalManager {
146
108
  }
147
109
  }
148
110
  }
149
- snapshotToolPatterns(scopeKey) {
150
- const snapshot = {};
151
- for (const [toolName, patterns] of this.getScope(scopeKey).toolPatterns) {
152
- snapshot[toolName] = Array.from(patterns);
153
- }
154
- return snapshot;
155
- }
156
- snapshotApprovedDirectories(scopeKey) {
157
- return Array.from(this.getScope(scopeKey).approvedDirectories.entries()).map(
158
- ([path2, type]) => ({
159
- path: path2,
160
- type
161
- })
162
- );
111
+ snapshotApprovedKeys(scopeKey) {
112
+ return Object.fromEntries(this.getScope(scopeKey).approvedKeys.entries());
163
113
  }
164
114
  async persistScope(sessionId) {
165
115
  const scopeKey = this.getScopeKey(sessionId);
166
116
  const state = {
167
- toolPatterns: this.snapshotToolPatterns(scopeKey),
168
- approvedDirectories: this.snapshotApprovedDirectories(scopeKey)
117
+ approvedKeys: this.snapshotApprovedKeys(scopeKey)
169
118
  };
170
119
  await this.approvalStore.saveSessionState({
171
120
  ...this.sessionScope(sessionId),
@@ -174,17 +123,12 @@ class ApprovalManager {
174
123
  }
175
124
  hydrateScope(sessionId, state) {
176
125
  const scopeKey = this.getScopeKey(sessionId);
177
- const toolPatterns = /* @__PURE__ */ new Map();
178
- for (const [toolName, patterns] of Object.entries(state.toolPatterns)) {
179
- toolPatterns.set(toolName, new Set(patterns));
180
- }
181
- const approvedDirectories = /* @__PURE__ */ new Map();
182
- for (const entry of state.approvedDirectories) {
183
- approvedDirectories.set(entry.path, entry.type);
126
+ const approvedKeys = /* @__PURE__ */ new Map();
127
+ for (const [key, type] of Object.entries(state.approvedKeys ?? {})) {
128
+ approvedKeys.set(key, type);
184
129
  }
185
130
  this.scopes.set(scopeKey, {
186
- toolPatterns,
187
- approvedDirectories
131
+ approvedKeys
188
132
  });
189
133
  }
190
134
  async restoreSessionState(sessionId) {
@@ -201,8 +145,7 @@ class ApprovalManager {
201
145
  this.loadedScopes.add(scopeKey);
202
146
  this.logger.debug("Restored persisted approval state", {
203
147
  sessionId: this.getScopeLabel(sessionId),
204
- toolCount: Object.keys(state.toolPatterns).length,
205
- directoryCount: state.approvedDirectories.length
148
+ keyCount: Object.keys(state.approvedKeys ?? {}).length
206
149
  });
207
150
  });
208
151
  }
@@ -218,94 +161,37 @@ class ApprovalManager {
218
161
  await this.approvalStore.deleteSessionState(this.sessionScope(sessionId));
219
162
  });
220
163
  }
221
- // ==================== Pattern Methods ====================
222
- getOrCreateToolPatternSet(toolName, scopeKey) {
223
- const scope = this.getOrCreateScope(scopeKey).toolPatterns;
224
- const existing = scope.get(toolName);
225
- if (existing) return existing;
226
- const created = /* @__PURE__ */ new Set();
227
- scope.set(toolName, created);
228
- return created;
229
- }
230
- /**
231
- * Add an approval pattern for a tool.
232
- */
233
- async addPattern(toolName, pattern, sessionId) {
164
+ // ==================== Generic Approval Key Methods ====================
165
+ async addApprovedKey(key, type = "session", sessionId) {
234
166
  await this.restoreSessionState(sessionId);
235
167
  const scopeKey = this.getScopeKey(sessionId);
236
168
  await this.runWithScopeLock(scopeKey, async () => {
237
- this.getOrCreateToolPatternSet(toolName, scopeKey).add(pattern);
169
+ const approvedKeys = this.getOrCreateScope(scopeKey).approvedKeys;
170
+ const existing = approvedKeys.get(key);
171
+ const effectiveType = type === "session" || existing === "session" ? "session" : "once";
172
+ approvedKeys.set(key, effectiveType);
238
173
  await this.persistScope(sessionId);
239
174
  });
240
- this.logger.debug(
241
- `Added pattern for '${toolName}' in '${this.getScopeLabel(sessionId)}': "${pattern}"`
242
- );
243
175
  }
244
- /**
245
- * Check if a pattern key is covered by any approved pattern for a tool.
246
- *
247
- * Note: This expects a pattern key (e.g. "git push *"), not raw arguments.
248
- * Tools are responsible for generating the key via `tool.approval.patternKey()`.
249
- */
250
- matchesPattern(toolName, patternKey, sessionId) {
251
- const scopeKey = this.getScopeKey(sessionId);
252
- const patterns = this.getScope(scopeKey).toolPatterns.get(toolName);
253
- if (!patterns || patterns.size === 0) return false;
254
- for (const storedPattern of patterns) {
255
- if ((0, import_pattern_utils.patternCovers)(storedPattern, patternKey)) {
256
- this.logger.debug(
257
- `Pattern key "${patternKey}" is covered by approved pattern "${storedPattern}" (tool: ${toolName})`
258
- );
259
- return true;
260
- }
261
- }
262
- return false;
176
+ isApprovalKeySessionApproved(key, sessionId) {
177
+ return this.getScope(this.getScopeKey(sessionId)).approvedKeys.get(key) === "session";
263
178
  }
264
- /**
265
- * Clear all patterns for a tool (or all tools when omitted).
266
- */
267
- async clearPatterns(toolName, sessionId) {
179
+ isApprovalKeyApproved(key, sessionId) {
180
+ return this.getScope(this.getScopeKey(sessionId)).approvedKeys.has(key);
181
+ }
182
+ getApprovedKeys(sessionId) {
183
+ return this.getScope(this.getScopeKey(sessionId)).approvedKeys;
184
+ }
185
+ async clearApprovedKeys(sessionId) {
268
186
  await this.restoreSessionState(sessionId);
269
187
  const scopeKey = this.getScopeKey(sessionId);
270
188
  await this.runWithScopeLock(scopeKey, async () => {
271
- const scope = this.getOrCreateScope(scopeKey).toolPatterns;
272
- if (toolName) {
273
- const patterns = scope.get(toolName);
274
- if (!patterns) return;
275
- const count2 = patterns.size;
276
- scope.delete(toolName);
277
- await this.persistScope(sessionId);
278
- if (count2 > 0) {
279
- this.logger.debug(
280
- `Cleared ${count2} pattern(s) for '${toolName}' in '${this.getScopeLabel(sessionId)}'`
281
- );
282
- }
283
- return;
284
- }
285
- const count = Array.from(scope.values()).reduce((sum, set) => sum + set.size, 0);
286
- scope.clear();
189
+ const approvedKeys = this.getOrCreateScope(scopeKey).approvedKeys;
190
+ if (approvedKeys.size === 0) return;
191
+ approvedKeys.clear();
287
192
  await this.persistScope(sessionId);
288
- if (count > 0) {
289
- this.logger.debug(
290
- `Cleared ${count} total tool pattern(s) in '${this.getScopeLabel(sessionId)}'`
291
- );
292
- }
293
193
  });
294
194
  }
295
- /**
296
- * Get patterns for a tool (for debugging/display).
297
- */
298
- getToolPatterns(toolName, sessionId) {
299
- const scopeKey = this.getScopeKey(sessionId);
300
- return this.getScope(scopeKey).toolPatterns.get(toolName) ?? /* @__PURE__ */ new Set();
301
- }
302
- /**
303
- * Get all tool patterns (for debugging/display).
304
- */
305
- getAllToolPatterns(sessionId) {
306
- const scopeKey = this.getScopeKey(sessionId);
307
- return this.getScope(scopeKey).toolPatterns;
308
- }
309
195
  // ==================== Directory Access Methods ====================
310
196
  /**
311
197
  * Resolve a directory path for use as an approval key.
@@ -314,150 +200,8 @@ class ApprovalManager {
314
200
  * continue to work even when other subsystems canonicalize paths via realpath
315
201
  * (e.g. macOS /tmp -> /private/tmp or custom symlinked directories).
316
202
  */
317
- getPathApprovalKeys(targetPath) {
318
- const resolved = import_node_path.default.resolve(targetPath);
319
- const real = tryRealpathSyncWithExistingParent(resolved);
320
- if (real && real !== resolved) {
321
- return [resolved, real];
322
- }
323
- return [resolved];
324
- }
325
- isPathWithinApprovedDirectory(targetPath, sessionId, approvedTypes) {
326
- const scopeKey = this.getScopeKey(sessionId);
327
- const directoryScope = this.getScope(scopeKey).approvedDirectories;
328
- for (const normalized of this.getPathApprovalKeys(targetPath)) {
329
- for (const [approvedDir, type] of directoryScope) {
330
- if (!approvedTypes.has(type)) {
331
- continue;
332
- }
333
- const relative = import_node_path.default.relative(approvedDir, normalized);
334
- if (!relative.startsWith("..") && !import_node_path.default.isAbsolute(relative)) {
335
- this.logger.debug(
336
- `Path "${normalized}" is within approved directory "${approvedDir}" (type: ${type})`
337
- );
338
- return true;
339
- }
340
- }
341
- }
342
- return false;
343
- }
344
- /**
345
- * Initialize the working directory as a session-approved directory.
346
- * This should be called once during setup to ensure the working directory
347
- * never triggers directory access prompts.
348
- *
349
- * @param workingDir The working directory path
350
- */
351
- async initializeWorkingDirectory(workingDir, sessionId) {
352
- await this.addApprovedDirectory(workingDir, "session", sessionId);
353
- }
354
- /**
355
- * Add a directory to the approved list for this session.
356
- * Files within this directory (including subdirectories) will be allowed.
357
- *
358
- * @param directory Absolute path to the directory to approve
359
- * @param type The approval type:
360
- * - 'session': No directory prompt on future accesses, follows tool config
361
- * - 'once': Will prompt again on future accesses, but tool can execute this time
362
- * @example
363
- * ```typescript
364
- * manager.addApprovedDirectory("/external/project", 'session');
365
- * // Now /external/project/src/file.ts is accessible without directory prompt
366
- *
367
- * manager.addApprovedDirectory("/tmp/files", 'once');
368
- * // Tool can access, but will prompt again next time
369
- * ```
370
- */
371
- async addApprovedDirectory(directory, type = "session", sessionId) {
372
- await this.restoreSessionState(sessionId);
373
- const scopeKey = this.getScopeKey(sessionId);
374
- await this.runWithScopeLock(scopeKey, async () => {
375
- const keys = this.getPathApprovalKeys(directory);
376
- const directoryScope = this.getOrCreateScope(scopeKey).approvedDirectories;
377
- const existingTypes = keys.map((key) => directoryScope.get(key)).filter((value) => value !== void 0);
378
- const hasSessionApproval = existingTypes.includes("session");
379
- const effectiveType = type === "session" || hasSessionApproval ? "session" : "once";
380
- for (const key of keys) {
381
- const existing = directoryScope.get(key);
382
- if (existing === "session") {
383
- continue;
384
- }
385
- directoryScope.set(key, effectiveType);
386
- }
387
- await this.persistScope(sessionId);
388
- const resolvedKey = keys[0];
389
- if (effectiveType === "session" && type === "once" && hasSessionApproval) {
390
- this.logger.debug(
391
- `Directory "${resolvedKey}" already approved as 'session', not downgrading to 'once'`
392
- );
393
- return;
394
- }
395
- const realKey = keys.length > 1 ? keys[1] : null;
396
- this.logger.debug(
397
- `Added approved directory in '${this.getScopeLabel(sessionId)}': "${resolvedKey}" (type: ${effectiveType})${realKey ? `, realpath: "${realKey}"` : ""}`
398
- );
399
- });
400
- }
401
203
  /**
402
- * Check if a file path is within any session-approved directory.
403
- * This is used for PROMPTING decisions - only 'session' type directories count.
404
- * Working directory and user session-approved directories return true.
405
- *
406
- * @param filePath The file path to check (can be relative or absolute)
407
- * @returns true if the path is within a session-approved directory
408
- */
409
- isDirectorySessionApproved(filePath, sessionId) {
410
- return this.isPathWithinApprovedDirectory(filePath, sessionId, /* @__PURE__ */ new Set(["session"]));
411
- }
412
- /**
413
- * Check if a file path is within any approved directory (session OR once).
414
- * This is used for EXECUTION decisions - both 'session' and 'once' types count.
415
- * PathValidator uses this to determine if a tool can access the path.
416
- *
417
- * @param filePath The file path to check (can be relative or absolute)
418
- * @returns true if the path is within any approved directory
419
- */
420
- isDirectoryApproved(filePath, sessionId) {
421
- return this.isPathWithinApprovedDirectory(
422
- filePath,
423
- sessionId,
424
- /* @__PURE__ */ new Set(["session", "once"])
425
- );
426
- }
427
- /**
428
- * Clear all approved directories.
429
- * Should be called when session ends.
430
- */
431
- async clearApprovedDirectories(sessionId) {
432
- await this.restoreSessionState(sessionId);
433
- const scopeKey = this.getScopeKey(sessionId);
434
- await this.runWithScopeLock(scopeKey, async () => {
435
- const scope = this.getOrCreateScope(scopeKey).approvedDirectories;
436
- const count = scope.size;
437
- scope.clear();
438
- await this.persistScope(sessionId);
439
- if (count > 0) {
440
- this.logger.debug(
441
- `Cleared ${count} approved directories in '${this.getScopeLabel(sessionId)}'`
442
- );
443
- }
444
- });
445
- }
446
- /**
447
- * Get the current map of approved directories with their types (for debugging/display).
448
- */
449
- getApprovedDirectories(sessionId) {
450
- const scopeKey = this.getScopeKey(sessionId);
451
- return this.getScope(scopeKey).approvedDirectories;
452
- }
453
- /**
454
- * Get just the directory paths that are approved (for debugging/display).
455
- */
456
- getApprovedDirectoryPaths(sessionId) {
457
- return Array.from(this.getApprovedDirectories(sessionId).keys());
458
- }
459
- /**
460
- * Clear all session-scoped approvals (tool patterns and directories).
204
+ * Clear all session-scoped approvals.
461
205
  * Convenience method for clearing all session state at once.
462
206
  */
463
207
  async clearSessionApprovals(sessionId) {
@@ -465,17 +209,12 @@ class ApprovalManager {
465
209
  const scopeKey = this.getScopeKey(sessionId);
466
210
  await this.runWithScopeLock(scopeKey, async () => {
467
211
  const scope = this.getOrCreateScope(scopeKey);
468
- const patternCount = Array.from(scope.toolPatterns.values()).reduce(
469
- (sum, set) => sum + set.size,
470
- 0
471
- );
472
- const directoryCount = scope.approvedDirectories.size;
473
- scope.toolPatterns.clear();
474
- scope.approvedDirectories.clear();
212
+ const keyCount = scope.approvedKeys.size;
213
+ scope.approvedKeys.clear();
475
214
  await this.persistScope(sessionId);
476
- if (patternCount > 0 || directoryCount > 0) {
215
+ if (keyCount > 0) {
477
216
  this.logger.debug(
478
- `Cleared ${patternCount} tool pattern(s) and ${directoryCount} approved director${directoryCount === 1 ? "y" : "ies"} in '${this.getScopeLabel(sessionId)}'`
217
+ `Cleared ${keyCount} approval key(s) in '${this.getScopeLabel(sessionId)}'`
479
218
  );
480
219
  }
481
220
  });
@@ -555,8 +294,6 @@ class ApprovalManager {
555
294
  return import_schemas.ElicitationResponseSchema.parse(response);
556
295
  case import_types.ApprovalType.CUSTOM:
557
296
  return import_schemas.CustomApprovalResponseSchema.parse(response);
558
- case import_types.ApprovalType.DIRECTORY_ACCESS:
559
- return import_schemas.DirectoryAccessResponseSchema.parse(response);
560
297
  }
561
298
  }
562
299
  getElicitationFormData(response) {
@@ -572,33 +309,6 @@ class ApprovalManager {
572
309
  field: "formData"
573
310
  });
574
311
  }
575
- /**
576
- * Request directory access approval.
577
- * Convenience method for directory access requests.
578
- *
579
- * @example
580
- * ```typescript
581
- * const response = await manager.requestDirectoryAccess({
582
- * path: '/external/project/src/file.ts',
583
- * parentDir: '/external/project',
584
- * operation: 'write',
585
- * toolName: 'write_file',
586
- * sessionId: 'session-123'
587
- * });
588
- * ```
589
- */
590
- async requestDirectoryAccess(metadata) {
591
- const { sessionId, hostRuntime, timeout, ...directoryMetadata } = metadata;
592
- return this.requestApproval(
593
- this.createApprovalDetails(
594
- import_types.ApprovalType.DIRECTORY_ACCESS,
595
- directoryMetadata,
596
- sessionId,
597
- hostRuntime,
598
- timeout
599
- )
600
- );
601
- }
602
312
  /**
603
313
  * Request a generic approval
604
314
  */
@@ -850,8 +560,8 @@ class ApprovalManager {
850
560
  }
851
561
  /**
852
562
  * Auto-approve pending requests that match a predicate.
853
- * Used when a pattern is remembered to auto-approve other parallel requests
854
- * that would now match the same pattern.
563
+ * Used when a remembered approval should auto-approve other parallel requests
564
+ * selected by the caller.
855
565
  *
856
566
  * @param predicate Function that returns true for requests that should be auto-approved
857
567
  * @param responseData Optional data to include in the auto-approval response
@@ -860,7 +570,9 @@ class ApprovalManager {
860
570
  autoApprovePendingRequests(predicate, responseData) {
861
571
  const count = this.handler?.autoApprovePending?.(predicate, responseData) ?? 0;
862
572
  if (count > 0) {
863
- this.logger.info(`Auto-approved ${count} pending request(s) due to matching pattern`);
573
+ this.logger.info(
574
+ `Auto-approved ${count} pending request(s) due to remembered approval`
575
+ );
864
576
  }
865
577
  return count;
866
578
  }
@@ -1,4 +1,4 @@
1
- import type { ApprovalHandler, ApprovalRequest, ApprovalResponse, ApprovalRequestDetails, ToolApprovalMetadata, CommandApprovalMetadata, ElicitationMetadata, DirectoryAccessMetadata } from './types.js';
1
+ import type { ApprovalHandler, ApprovalRequest, ApprovalResponse, ApprovalRequestDetails, ToolApprovalMetadata, CommandApprovalMetadata, ElicitationMetadata } from './types.js';
2
2
  import { ApprovalStatus } from './types.js';
3
3
  import type { Logger } from '../logger/v2/types.js';
4
4
  import type { PermissionsMode } from '../tools/schemas.js';
@@ -91,37 +91,17 @@ export declare class ApprovalManager {
91
91
  private getScope;
92
92
  private runWithScopeLock;
93
93
  private runWithApprovalRecordLock;
94
- private snapshotToolPatterns;
95
- private snapshotApprovedDirectories;
94
+ private snapshotApprovedKeys;
96
95
  private persistScope;
97
96
  private hydrateScope;
98
97
  restoreSessionState(sessionId?: string): Promise<void>;
99
98
  evictSessionState(sessionId?: string): void;
100
99
  deleteSessionState(sessionId?: string): Promise<void>;
101
- private getOrCreateToolPatternSet;
102
- /**
103
- * Add an approval pattern for a tool.
104
- */
105
- addPattern(toolName: string, pattern: string, sessionId?: string): Promise<void>;
106
- /**
107
- * Check if a pattern key is covered by any approved pattern for a tool.
108
- *
109
- * Note: This expects a pattern key (e.g. "git push *"), not raw arguments.
110
- * Tools are responsible for generating the key via `tool.approval.patternKey()`.
111
- */
112
- matchesPattern(toolName: string, patternKey: string, sessionId?: string): boolean;
113
- /**
114
- * Clear all patterns for a tool (or all tools when omitted).
115
- */
116
- clearPatterns(toolName?: string, sessionId?: string): Promise<void>;
117
- /**
118
- * Get patterns for a tool (for debugging/display).
119
- */
120
- getToolPatterns(toolName: string, sessionId?: string): ReadonlySet<string>;
121
- /**
122
- * Get all tool patterns (for debugging/display).
123
- */
124
- getAllToolPatterns(sessionId?: string): ReadonlyMap<string, Set<string>>;
100
+ addApprovedKey(key: string, type?: 'session' | 'once', sessionId?: string): Promise<void>;
101
+ isApprovalKeySessionApproved(key: string, sessionId?: string): boolean;
102
+ isApprovalKeyApproved(key: string, sessionId?: string): boolean;
103
+ getApprovedKeys(sessionId?: string): ReadonlyMap<string, 'session' | 'once'>;
104
+ clearApprovedKeys(sessionId?: string): Promise<void>;
125
105
  /**
126
106
  * Resolve a directory path for use as an approval key.
127
107
  *
@@ -129,67 +109,8 @@ export declare class ApprovalManager {
129
109
  * continue to work even when other subsystems canonicalize paths via realpath
130
110
  * (e.g. macOS /tmp -> /private/tmp or custom symlinked directories).
131
111
  */
132
- private getPathApprovalKeys;
133
- private isPathWithinApprovedDirectory;
134
112
  /**
135
- * Initialize the working directory as a session-approved directory.
136
- * This should be called once during setup to ensure the working directory
137
- * never triggers directory access prompts.
138
- *
139
- * @param workingDir The working directory path
140
- */
141
- initializeWorkingDirectory(workingDir: string, sessionId?: string): Promise<void>;
142
- /**
143
- * Add a directory to the approved list for this session.
144
- * Files within this directory (including subdirectories) will be allowed.
145
- *
146
- * @param directory Absolute path to the directory to approve
147
- * @param type The approval type:
148
- * - 'session': No directory prompt on future accesses, follows tool config
149
- * - 'once': Will prompt again on future accesses, but tool can execute this time
150
- * @example
151
- * ```typescript
152
- * manager.addApprovedDirectory("/external/project", 'session');
153
- * // Now /external/project/src/file.ts is accessible without directory prompt
154
- *
155
- * manager.addApprovedDirectory("/tmp/files", 'once');
156
- * // Tool can access, but will prompt again next time
157
- * ```
158
- */
159
- addApprovedDirectory(directory: string, type?: 'session' | 'once', sessionId?: string): Promise<void>;
160
- /**
161
- * Check if a file path is within any session-approved directory.
162
- * This is used for PROMPTING decisions - only 'session' type directories count.
163
- * Working directory and user session-approved directories return true.
164
- *
165
- * @param filePath The file path to check (can be relative or absolute)
166
- * @returns true if the path is within a session-approved directory
167
- */
168
- isDirectorySessionApproved(filePath: string, sessionId?: string): boolean;
169
- /**
170
- * Check if a file path is within any approved directory (session OR once).
171
- * This is used for EXECUTION decisions - both 'session' and 'once' types count.
172
- * PathValidator uses this to determine if a tool can access the path.
173
- *
174
- * @param filePath The file path to check (can be relative or absolute)
175
- * @returns true if the path is within any approved directory
176
- */
177
- isDirectoryApproved(filePath: string, sessionId?: string): boolean;
178
- /**
179
- * Clear all approved directories.
180
- * Should be called when session ends.
181
- */
182
- clearApprovedDirectories(sessionId?: string): Promise<void>;
183
- /**
184
- * Get the current map of approved directories with their types (for debugging/display).
185
- */
186
- getApprovedDirectories(sessionId?: string): ReadonlyMap<string, 'session' | 'once'>;
187
- /**
188
- * Get just the directory paths that are approved (for debugging/display).
189
- */
190
- getApprovedDirectoryPaths(sessionId?: string): string[];
191
- /**
192
- * Clear all session-scoped approvals (tool patterns and directories).
113
+ * Clear all session-scoped approvals.
193
114
  * Convenience method for clearing all session state at once.
194
115
  */
195
116
  clearSessionApprovals(sessionId?: string): Promise<void>;
@@ -200,26 +121,6 @@ export declare class ApprovalManager {
200
121
  private createResponse;
201
122
  private parseResponseForRequest;
202
123
  private getElicitationFormData;
203
- /**
204
- * Request directory access approval.
205
- * Convenience method for directory access requests.
206
- *
207
- * @example
208
- * ```typescript
209
- * const response = await manager.requestDirectoryAccess({
210
- * path: '/external/project/src/file.ts',
211
- * parentDir: '/external/project',
212
- * operation: 'write',
213
- * toolName: 'write_file',
214
- * sessionId: 'session-123'
215
- * });
216
- * ```
217
- */
218
- requestDirectoryAccess(metadata: DirectoryAccessMetadata & {
219
- sessionId?: string;
220
- hostRuntime?: ApprovalRequestDetails['hostRuntime'];
221
- timeout?: number;
222
- }): Promise<ApprovalResponse>;
223
124
  /**
224
125
  * Request a generic approval
225
126
  */
@@ -319,8 +220,8 @@ export declare class ApprovalManager {
319
220
  getPendingApprovalRequests(): ApprovalRequest[];
320
221
  /**
321
222
  * Auto-approve pending requests that match a predicate.
322
- * Used when a pattern is remembered to auto-approve other parallel requests
323
- * that would now match the same pattern.
223
+ * Used when a remembered approval should auto-approve other parallel requests
224
+ * selected by the caller.
324
225
  *
325
226
  * @param predicate Function that returns true for requests that should be auto-approved
326
227
  * @param responseData Optional data to include in the auto-approval response
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/approval/manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAgB,cAAc,EAAE,MAAM,YAAY,CAAC;AAS1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC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