@dexto/core 1.6.0 → 1.6.1

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 (79) hide show
  1. package/dist/agent/DextoAgent.cjs +25 -5
  2. package/dist/agent/DextoAgent.d.ts +12 -1
  3. package/dist/agent/DextoAgent.d.ts.map +1 -1
  4. package/dist/agent/DextoAgent.js +25 -5
  5. package/dist/agent/schemas.d.ts +18 -18
  6. package/dist/approval/manager.cjs +87 -27
  7. package/dist/approval/manager.d.ts +10 -1
  8. package/dist/approval/manager.d.ts.map +1 -1
  9. package/dist/approval/manager.js +87 -27
  10. package/dist/approval/schemas.cjs +22 -8
  11. package/dist/approval/schemas.d.ts +276 -102
  12. package/dist/approval/schemas.d.ts.map +1 -1
  13. package/dist/approval/schemas.js +22 -8
  14. package/dist/context/manager.cjs +2 -2
  15. package/dist/context/manager.d.ts +2 -1
  16. package/dist/context/manager.d.ts.map +1 -1
  17. package/dist/context/manager.js +2 -2
  18. package/dist/context/types.d.ts +3 -2
  19. package/dist/context/types.d.ts.map +1 -1
  20. package/dist/events/index.d.ts +17 -12
  21. package/dist/events/index.d.ts.map +1 -1
  22. package/dist/hooks/index.d.ts +1 -1
  23. package/dist/hooks/index.d.ts.map +1 -1
  24. package/dist/hooks/types.d.ts +1 -22
  25. package/dist/hooks/types.d.ts.map +1 -1
  26. package/dist/llm/executor/stream-processor.cjs +3 -3
  27. package/dist/llm/executor/stream-processor.d.ts +3 -2
  28. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  29. package/dist/llm/executor/stream-processor.js +3 -3
  30. package/dist/llm/executor/turn-executor.cjs +3 -3
  31. package/dist/llm/executor/turn-executor.d.ts +1 -1
  32. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  33. package/dist/llm/executor/turn-executor.js +3 -3
  34. package/dist/llm/providers/local/schemas.d.ts +2 -2
  35. package/dist/llm/schemas.d.ts +4 -4
  36. package/dist/llm/services/vercel.cjs +1 -1
  37. package/dist/llm/services/vercel.js +1 -1
  38. package/dist/logger/default-logger-factory.d.ts +12 -12
  39. package/dist/logger/v2/dexto-logger.cjs +35 -0
  40. package/dist/logger/v2/dexto-logger.d.ts +19 -0
  41. package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
  42. package/dist/logger/v2/dexto-logger.js +35 -0
  43. package/dist/logger/v2/schemas.d.ts +6 -6
  44. package/dist/logger/v2/test-utils.cjs +2 -0
  45. package/dist/logger/v2/test-utils.d.ts.map +1 -1
  46. package/dist/logger/v2/test-utils.js +2 -0
  47. package/dist/logger/v2/types.d.ts +14 -1
  48. package/dist/logger/v2/types.d.ts.map +1 -1
  49. package/dist/mcp/schemas.d.ts +15 -15
  50. package/dist/memory/schemas.d.ts +4 -4
  51. package/dist/prompts/schemas.d.ts +7 -7
  52. package/dist/systemPrompt/in-built-prompts.cjs +5 -5
  53. package/dist/systemPrompt/in-built-prompts.d.ts +1 -1
  54. package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
  55. package/dist/systemPrompt/in-built-prompts.js +5 -5
  56. package/dist/systemPrompt/schemas.d.ts +5 -5
  57. package/dist/systemPrompt/types.d.ts +11 -0
  58. package/dist/systemPrompt/types.d.ts.map +1 -1
  59. package/dist/tools/display-types.d.ts +10 -0
  60. package/dist/tools/display-types.d.ts.map +1 -1
  61. package/dist/tools/index.cjs +3 -1
  62. package/dist/tools/index.d.ts +1 -0
  63. package/dist/tools/index.d.ts.map +1 -1
  64. package/dist/tools/index.js +1 -0
  65. package/dist/tools/presentation.cjs +49 -0
  66. package/dist/tools/presentation.d.ts +11 -0
  67. package/dist/tools/presentation.d.ts.map +1 -0
  68. package/dist/tools/presentation.js +24 -0
  69. package/dist/tools/tool-manager.cjs +322 -155
  70. package/dist/tools/tool-manager.d.ts +23 -25
  71. package/dist/tools/tool-manager.d.ts.map +1 -1
  72. package/dist/tools/tool-manager.js +322 -155
  73. package/dist/tools/types.d.ts +134 -55
  74. package/dist/tools/types.d.ts.map +1 -1
  75. package/dist/utils/path.cjs +10 -1
  76. package/dist/utils/path.d.ts +5 -2
  77. package/dist/utils/path.d.ts.map +1 -1
  78. package/dist/utils/path.js +10 -1
  79. package/package.json +2 -2
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import type { JSONSchema7 } from 'json-schema';
3
3
  import { ApprovalType, ApprovalStatus, DenialReason } from './types.js';
4
4
  import type { ToolDisplayData } from '../tools/display-types.js';
5
+ import type { ToolPresentationSnapshotV1 } from '../tools/types.js';
5
6
  /**
6
7
  * Schema for approval types
7
8
  */
@@ -14,32 +15,80 @@ export declare const ApprovalStatusSchema: z.ZodNativeEnum<typeof ApprovalStatus
14
15
  * Schema for denial/cancellation reasons
15
16
  */
16
17
  export declare const DenialReasonSchema: z.ZodNativeEnum<typeof DenialReason>;
18
+ /**
19
+ * Directory access metadata schema
20
+ * Used when a tool tries to access files outside the working directory
21
+ */
22
+ export declare const DirectoryAccessMetadataSchema: z.ZodObject<{
23
+ path: z.ZodString;
24
+ parentDir: z.ZodString;
25
+ operation: z.ZodEnum<["read", "write", "edit"]>;
26
+ toolName: z.ZodString;
27
+ }, "strict", z.ZodTypeAny, {
28
+ path: string;
29
+ parentDir: string;
30
+ operation: "read" | "write" | "edit";
31
+ toolName: string;
32
+ }, {
33
+ path: string;
34
+ parentDir: string;
35
+ operation: "read" | "write" | "edit";
36
+ toolName: string;
37
+ }>;
17
38
  /**
18
39
  * Tool approval metadata schema
19
40
  */
20
41
  export declare const ToolApprovalMetadataSchema: z.ZodObject<{
21
42
  toolName: z.ZodString;
22
- toolDisplayName: z.ZodOptional<z.ZodString>;
43
+ presentationSnapshot: z.ZodOptional<z.ZodType<ToolPresentationSnapshotV1, z.ZodTypeDef, ToolPresentationSnapshotV1>>;
23
44
  toolCallId: z.ZodString;
24
45
  args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
25
46
  description: z.ZodOptional<z.ZodString>;
26
47
  displayPreview: z.ZodOptional<z.ZodType<ToolDisplayData, z.ZodTypeDef, ToolDisplayData>>;
48
+ directoryAccess: z.ZodOptional<z.ZodObject<{
49
+ path: z.ZodString;
50
+ parentDir: z.ZodString;
51
+ operation: z.ZodEnum<["read", "write", "edit"]>;
52
+ toolName: z.ZodString;
53
+ }, "strict", z.ZodTypeAny, {
54
+ path: string;
55
+ parentDir: string;
56
+ operation: "read" | "write" | "edit";
57
+ toolName: string;
58
+ }, {
59
+ path: string;
60
+ parentDir: string;
61
+ operation: "read" | "write" | "edit";
62
+ toolName: string;
63
+ }>>;
27
64
  suggestedPatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
28
65
  }, "strict", z.ZodTypeAny, {
66
+ toolName: string;
29
67
  toolCallId: string;
30
68
  args: Record<string, unknown>;
31
- toolName: string;
32
69
  description?: string | undefined;
33
- toolDisplayName?: string | undefined;
70
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
34
71
  displayPreview?: ToolDisplayData | undefined;
72
+ directoryAccess?: {
73
+ path: string;
74
+ parentDir: string;
75
+ operation: "read" | "write" | "edit";
76
+ toolName: string;
77
+ } | undefined;
35
78
  suggestedPatterns?: string[] | undefined;
36
79
  }, {
80
+ toolName: string;
37
81
  toolCallId: string;
38
82
  args: Record<string, unknown>;
39
- toolName: string;
40
83
  description?: string | undefined;
41
- toolDisplayName?: string | undefined;
84
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
42
85
  displayPreview?: ToolDisplayData | undefined;
86
+ directoryAccess?: {
87
+ path: string;
88
+ parentDir: string;
89
+ operation: "read" | "write" | "edit";
90
+ toolName: string;
91
+ } | undefined;
43
92
  suggestedPatterns?: string[] | undefined;
44
93
  }>;
45
94
  /**
@@ -51,12 +100,12 @@ export declare const CommandConfirmationMetadataSchema: z.ZodObject<{
51
100
  command: z.ZodString;
52
101
  originalCommand: z.ZodOptional<z.ZodString>;
53
102
  }, "strict", z.ZodTypeAny, {
54
- command: string;
55
103
  toolName: string;
104
+ command: string;
56
105
  originalCommand?: string | undefined;
57
106
  }, {
58
- command: string;
59
107
  toolName: string;
108
+ command: string;
60
109
  originalCommand?: string | undefined;
61
110
  }>;
62
111
  /**
@@ -82,26 +131,6 @@ export declare const ElicitationMetadataSchema: z.ZodObject<{
82
131
  * Custom approval metadata schema - flexible
83
132
  */
84
133
  export declare const CustomApprovalMetadataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
85
- /**
86
- * Directory access metadata schema
87
- * Used when a tool tries to access files outside the working directory
88
- */
89
- export declare const DirectoryAccessMetadataSchema: z.ZodObject<{
90
- path: z.ZodString;
91
- parentDir: z.ZodString;
92
- operation: z.ZodEnum<["read", "write", "edit"]>;
93
- toolName: z.ZodString;
94
- }, "strict", z.ZodTypeAny, {
95
- path: string;
96
- toolName: string;
97
- parentDir: string;
98
- operation: "read" | "write" | "edit";
99
- }, {
100
- path: string;
101
- toolName: string;
102
- parentDir: string;
103
- operation: "read" | "write" | "edit";
104
- }>;
105
134
  /**
106
135
  * Base approval request schema
107
136
  */
@@ -136,27 +165,55 @@ export declare const ToolApprovalRequestSchema: z.ZodObject<{
136
165
  type: z.ZodLiteral<ApprovalType.TOOL_APPROVAL>;
137
166
  metadata: z.ZodObject<{
138
167
  toolName: z.ZodString;
139
- toolDisplayName: z.ZodOptional<z.ZodString>;
168
+ presentationSnapshot: z.ZodOptional<z.ZodType<ToolPresentationSnapshotV1, z.ZodTypeDef, ToolPresentationSnapshotV1>>;
140
169
  toolCallId: z.ZodString;
141
170
  args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
142
171
  description: z.ZodOptional<z.ZodString>;
143
172
  displayPreview: z.ZodOptional<z.ZodType<ToolDisplayData, z.ZodTypeDef, ToolDisplayData>>;
173
+ directoryAccess: z.ZodOptional<z.ZodObject<{
174
+ path: z.ZodString;
175
+ parentDir: z.ZodString;
176
+ operation: z.ZodEnum<["read", "write", "edit"]>;
177
+ toolName: z.ZodString;
178
+ }, "strict", z.ZodTypeAny, {
179
+ path: string;
180
+ parentDir: string;
181
+ operation: "read" | "write" | "edit";
182
+ toolName: string;
183
+ }, {
184
+ path: string;
185
+ parentDir: string;
186
+ operation: "read" | "write" | "edit";
187
+ toolName: string;
188
+ }>>;
144
189
  suggestedPatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
145
190
  }, "strict", z.ZodTypeAny, {
191
+ toolName: string;
146
192
  toolCallId: string;
147
193
  args: Record<string, unknown>;
148
- toolName: string;
149
194
  description?: string | undefined;
150
- toolDisplayName?: string | undefined;
195
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
151
196
  displayPreview?: ToolDisplayData | undefined;
197
+ directoryAccess?: {
198
+ path: string;
199
+ parentDir: string;
200
+ operation: "read" | "write" | "edit";
201
+ toolName: string;
202
+ } | undefined;
152
203
  suggestedPatterns?: string[] | undefined;
153
204
  }, {
205
+ toolName: string;
154
206
  toolCallId: string;
155
207
  args: Record<string, unknown>;
156
- toolName: string;
157
208
  description?: string | undefined;
158
- toolDisplayName?: string | undefined;
209
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
159
210
  displayPreview?: ToolDisplayData | undefined;
211
+ directoryAccess?: {
212
+ path: string;
213
+ parentDir: string;
214
+ operation: "read" | "write" | "edit";
215
+ toolName: string;
216
+ } | undefined;
160
217
  suggestedPatterns?: string[] | undefined;
161
218
  }>;
162
219
  }, "strict", z.ZodTypeAny, {
@@ -164,12 +221,18 @@ export declare const ToolApprovalRequestSchema: z.ZodObject<{
164
221
  approvalId: string;
165
222
  timestamp: Date;
166
223
  metadata: {
224
+ toolName: string;
167
225
  toolCallId: string;
168
226
  args: Record<string, unknown>;
169
- toolName: string;
170
227
  description?: string | undefined;
171
- toolDisplayName?: string | undefined;
228
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
172
229
  displayPreview?: ToolDisplayData | undefined;
230
+ directoryAccess?: {
231
+ path: string;
232
+ parentDir: string;
233
+ operation: "read" | "write" | "edit";
234
+ toolName: string;
235
+ } | undefined;
173
236
  suggestedPatterns?: string[] | undefined;
174
237
  };
175
238
  timeout?: number | undefined;
@@ -179,12 +242,18 @@ export declare const ToolApprovalRequestSchema: z.ZodObject<{
179
242
  approvalId: string;
180
243
  timestamp: Date;
181
244
  metadata: {
245
+ toolName: string;
182
246
  toolCallId: string;
183
247
  args: Record<string, unknown>;
184
- toolName: string;
185
248
  description?: string | undefined;
186
- toolDisplayName?: string | undefined;
249
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
187
250
  displayPreview?: ToolDisplayData | undefined;
251
+ directoryAccess?: {
252
+ path: string;
253
+ parentDir: string;
254
+ operation: "read" | "write" | "edit";
255
+ toolName: string;
256
+ } | undefined;
188
257
  suggestedPatterns?: string[] | undefined;
189
258
  };
190
259
  timeout?: number | undefined;
@@ -205,12 +274,12 @@ export declare const CommandConfirmationRequestSchema: z.ZodObject<{
205
274
  command: z.ZodString;
206
275
  originalCommand: z.ZodOptional<z.ZodString>;
207
276
  }, "strict", z.ZodTypeAny, {
208
- command: string;
209
277
  toolName: string;
278
+ command: string;
210
279
  originalCommand?: string | undefined;
211
280
  }, {
212
- command: string;
213
281
  toolName: string;
282
+ command: string;
214
283
  originalCommand?: string | undefined;
215
284
  }>;
216
285
  }, "strict", z.ZodTypeAny, {
@@ -218,8 +287,8 @@ export declare const CommandConfirmationRequestSchema: z.ZodObject<{
218
287
  approvalId: string;
219
288
  timestamp: Date;
220
289
  metadata: {
221
- command: string;
222
290
  toolName: string;
291
+ command: string;
223
292
  originalCommand?: string | undefined;
224
293
  };
225
294
  timeout?: number | undefined;
@@ -229,8 +298,8 @@ export declare const CommandConfirmationRequestSchema: z.ZodObject<{
229
298
  approvalId: string;
230
299
  timestamp: Date;
231
300
  metadata: {
232
- command: string;
233
301
  toolName: string;
302
+ command: string;
234
303
  originalCommand?: string | undefined;
235
304
  };
236
305
  timeout?: number | undefined;
@@ -330,14 +399,14 @@ export declare const DirectoryAccessRequestSchema: z.ZodObject<{
330
399
  toolName: z.ZodString;
331
400
  }, "strict", z.ZodTypeAny, {
332
401
  path: string;
333
- toolName: string;
334
402
  parentDir: string;
335
403
  operation: "read" | "write" | "edit";
404
+ toolName: string;
336
405
  }, {
337
406
  path: string;
338
- toolName: string;
339
407
  parentDir: string;
340
408
  operation: "read" | "write" | "edit";
409
+ toolName: string;
341
410
  }>;
342
411
  }, "strict", z.ZodTypeAny, {
343
412
  type: ApprovalType.DIRECTORY_ACCESS;
@@ -345,9 +414,9 @@ export declare const DirectoryAccessRequestSchema: z.ZodObject<{
345
414
  timestamp: Date;
346
415
  metadata: {
347
416
  path: string;
348
- toolName: string;
349
417
  parentDir: string;
350
418
  operation: "read" | "write" | "edit";
419
+ toolName: string;
351
420
  };
352
421
  timeout?: number | undefined;
353
422
  sessionId?: string | undefined;
@@ -357,9 +426,9 @@ export declare const DirectoryAccessRequestSchema: z.ZodObject<{
357
426
  timestamp: Date;
358
427
  metadata: {
359
428
  path: string;
360
- toolName: string;
361
429
  parentDir: string;
362
430
  operation: "read" | "write" | "edit";
431
+ toolName: string;
363
432
  };
364
433
  timeout?: number | undefined;
365
434
  sessionId?: string | undefined;
@@ -376,27 +445,55 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
376
445
  type: z.ZodLiteral<ApprovalType.TOOL_APPROVAL>;
377
446
  metadata: z.ZodObject<{
378
447
  toolName: z.ZodString;
379
- toolDisplayName: z.ZodOptional<z.ZodString>;
448
+ presentationSnapshot: z.ZodOptional<z.ZodType<ToolPresentationSnapshotV1, z.ZodTypeDef, ToolPresentationSnapshotV1>>;
380
449
  toolCallId: z.ZodString;
381
450
  args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
382
451
  description: z.ZodOptional<z.ZodString>;
383
452
  displayPreview: z.ZodOptional<z.ZodType<ToolDisplayData, z.ZodTypeDef, ToolDisplayData>>;
453
+ directoryAccess: z.ZodOptional<z.ZodObject<{
454
+ path: z.ZodString;
455
+ parentDir: z.ZodString;
456
+ operation: z.ZodEnum<["read", "write", "edit"]>;
457
+ toolName: z.ZodString;
458
+ }, "strict", z.ZodTypeAny, {
459
+ path: string;
460
+ parentDir: string;
461
+ operation: "read" | "write" | "edit";
462
+ toolName: string;
463
+ }, {
464
+ path: string;
465
+ parentDir: string;
466
+ operation: "read" | "write" | "edit";
467
+ toolName: string;
468
+ }>>;
384
469
  suggestedPatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
385
470
  }, "strict", z.ZodTypeAny, {
471
+ toolName: string;
386
472
  toolCallId: string;
387
473
  args: Record<string, unknown>;
388
- toolName: string;
389
474
  description?: string | undefined;
390
- toolDisplayName?: string | undefined;
475
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
391
476
  displayPreview?: ToolDisplayData | undefined;
477
+ directoryAccess?: {
478
+ path: string;
479
+ parentDir: string;
480
+ operation: "read" | "write" | "edit";
481
+ toolName: string;
482
+ } | undefined;
392
483
  suggestedPatterns?: string[] | undefined;
393
484
  }, {
485
+ toolName: string;
394
486
  toolCallId: string;
395
487
  args: Record<string, unknown>;
396
- toolName: string;
397
488
  description?: string | undefined;
398
- toolDisplayName?: string | undefined;
489
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
399
490
  displayPreview?: ToolDisplayData | undefined;
491
+ directoryAccess?: {
492
+ path: string;
493
+ parentDir: string;
494
+ operation: "read" | "write" | "edit";
495
+ toolName: string;
496
+ } | undefined;
400
497
  suggestedPatterns?: string[] | undefined;
401
498
  }>;
402
499
  }, "strict", z.ZodTypeAny, {
@@ -404,12 +501,18 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
404
501
  approvalId: string;
405
502
  timestamp: Date;
406
503
  metadata: {
504
+ toolName: string;
407
505
  toolCallId: string;
408
506
  args: Record<string, unknown>;
409
- toolName: string;
410
507
  description?: string | undefined;
411
- toolDisplayName?: string | undefined;
508
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
412
509
  displayPreview?: ToolDisplayData | undefined;
510
+ directoryAccess?: {
511
+ path: string;
512
+ parentDir: string;
513
+ operation: "read" | "write" | "edit";
514
+ toolName: string;
515
+ } | undefined;
413
516
  suggestedPatterns?: string[] | undefined;
414
517
  };
415
518
  timeout?: number | undefined;
@@ -419,12 +522,18 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
419
522
  approvalId: string;
420
523
  timestamp: Date;
421
524
  metadata: {
525
+ toolName: string;
422
526
  toolCallId: string;
423
527
  args: Record<string, unknown>;
424
- toolName: string;
425
528
  description?: string | undefined;
426
- toolDisplayName?: string | undefined;
529
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
427
530
  displayPreview?: ToolDisplayData | undefined;
531
+ directoryAccess?: {
532
+ path: string;
533
+ parentDir: string;
534
+ operation: "read" | "write" | "edit";
535
+ toolName: string;
536
+ } | undefined;
428
537
  suggestedPatterns?: string[] | undefined;
429
538
  };
430
539
  timeout?: number | undefined;
@@ -441,12 +550,12 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
441
550
  command: z.ZodString;
442
551
  originalCommand: z.ZodOptional<z.ZodString>;
443
552
  }, "strict", z.ZodTypeAny, {
444
- command: string;
445
553
  toolName: string;
554
+ command: string;
446
555
  originalCommand?: string | undefined;
447
556
  }, {
448
- command: string;
449
557
  toolName: string;
558
+ command: string;
450
559
  originalCommand?: string | undefined;
451
560
  }>;
452
561
  }, "strict", z.ZodTypeAny, {
@@ -454,8 +563,8 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
454
563
  approvalId: string;
455
564
  timestamp: Date;
456
565
  metadata: {
457
- command: string;
458
566
  toolName: string;
567
+ command: string;
459
568
  originalCommand?: string | undefined;
460
569
  };
461
570
  timeout?: number | undefined;
@@ -465,8 +574,8 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
465
574
  approvalId: string;
466
575
  timestamp: Date;
467
576
  metadata: {
468
- command: string;
469
577
  toolName: string;
578
+ command: string;
470
579
  originalCommand?: string | undefined;
471
580
  };
472
581
  timeout?: number | undefined;
@@ -554,14 +663,14 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
554
663
  toolName: z.ZodString;
555
664
  }, "strict", z.ZodTypeAny, {
556
665
  path: string;
557
- toolName: string;
558
666
  parentDir: string;
559
667
  operation: "read" | "write" | "edit";
668
+ toolName: string;
560
669
  }, {
561
670
  path: string;
562
- toolName: string;
563
671
  parentDir: string;
564
672
  operation: "read" | "write" | "edit";
673
+ toolName: string;
565
674
  }>;
566
675
  }, "strict", z.ZodTypeAny, {
567
676
  type: ApprovalType.DIRECTORY_ACCESS;
@@ -569,9 +678,9 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
569
678
  timestamp: Date;
570
679
  metadata: {
571
680
  path: string;
572
- toolName: string;
573
681
  parentDir: string;
574
682
  operation: "read" | "write" | "edit";
683
+ toolName: string;
575
684
  };
576
685
  timeout?: number | undefined;
577
686
  sessionId?: string | undefined;
@@ -581,9 +690,9 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
581
690
  timestamp: Date;
582
691
  metadata: {
583
692
  path: string;
584
- toolName: string;
585
693
  parentDir: string;
586
694
  operation: "read" | "write" | "edit";
695
+ toolName: string;
587
696
  };
588
697
  timeout?: number | undefined;
589
698
  sessionId?: string | undefined;
@@ -594,12 +703,15 @@ export declare const ApprovalRequestSchema: z.ZodDiscriminatedUnion<"type", [z.Z
594
703
  export declare const ToolApprovalResponseDataSchema: z.ZodObject<{
595
704
  rememberChoice: z.ZodOptional<z.ZodBoolean>;
596
705
  rememberPattern: z.ZodOptional<z.ZodString>;
706
+ rememberDirectory: z.ZodOptional<z.ZodBoolean>;
597
707
  }, "strict", z.ZodTypeAny, {
598
708
  rememberChoice?: boolean | undefined;
599
709
  rememberPattern?: string | undefined;
710
+ rememberDirectory?: boolean | undefined;
600
711
  }, {
601
712
  rememberChoice?: boolean | undefined;
602
713
  rememberPattern?: string | undefined;
714
+ rememberDirectory?: boolean | undefined;
603
715
  }>;
604
716
  /**
605
717
  * Command confirmation response data schema
@@ -668,12 +780,15 @@ export declare const ToolApprovalResponseSchema: z.ZodObject<{
668
780
  data: z.ZodOptional<z.ZodObject<{
669
781
  rememberChoice: z.ZodOptional<z.ZodBoolean>;
670
782
  rememberPattern: z.ZodOptional<z.ZodString>;
783
+ rememberDirectory: z.ZodOptional<z.ZodBoolean>;
671
784
  }, "strict", z.ZodTypeAny, {
672
785
  rememberChoice?: boolean | undefined;
673
786
  rememberPattern?: string | undefined;
787
+ rememberDirectory?: boolean | undefined;
674
788
  }, {
675
789
  rememberChoice?: boolean | undefined;
676
790
  rememberPattern?: string | undefined;
791
+ rememberDirectory?: boolean | undefined;
677
792
  }>>;
678
793
  }, "strict", z.ZodTypeAny, {
679
794
  status: ApprovalStatus;
@@ -681,6 +796,7 @@ export declare const ToolApprovalResponseSchema: z.ZodObject<{
681
796
  data?: {
682
797
  rememberChoice?: boolean | undefined;
683
798
  rememberPattern?: string | undefined;
799
+ rememberDirectory?: boolean | undefined;
684
800
  } | undefined;
685
801
  message?: string | undefined;
686
802
  sessionId?: string | undefined;
@@ -692,6 +808,7 @@ export declare const ToolApprovalResponseSchema: z.ZodObject<{
692
808
  data?: {
693
809
  rememberChoice?: boolean | undefined;
694
810
  rememberPattern?: string | undefined;
811
+ rememberDirectory?: boolean | undefined;
695
812
  } | undefined;
696
813
  message?: string | undefined;
697
814
  sessionId?: string | undefined;
@@ -848,12 +965,15 @@ export declare const ApprovalResponseSchema: z.ZodUnion<[z.ZodObject<{
848
965
  data: z.ZodOptional<z.ZodObject<{
849
966
  rememberChoice: z.ZodOptional<z.ZodBoolean>;
850
967
  rememberPattern: z.ZodOptional<z.ZodString>;
968
+ rememberDirectory: z.ZodOptional<z.ZodBoolean>;
851
969
  }, "strict", z.ZodTypeAny, {
852
970
  rememberChoice?: boolean | undefined;
853
971
  rememberPattern?: string | undefined;
972
+ rememberDirectory?: boolean | undefined;
854
973
  }, {
855
974
  rememberChoice?: boolean | undefined;
856
975
  rememberPattern?: string | undefined;
976
+ rememberDirectory?: boolean | undefined;
857
977
  }>>;
858
978
  }, "strict", z.ZodTypeAny, {
859
979
  status: ApprovalStatus;
@@ -861,6 +981,7 @@ export declare const ApprovalResponseSchema: z.ZodUnion<[z.ZodObject<{
861
981
  data?: {
862
982
  rememberChoice?: boolean | undefined;
863
983
  rememberPattern?: string | undefined;
984
+ rememberDirectory?: boolean | undefined;
864
985
  } | undefined;
865
986
  message?: string | undefined;
866
987
  sessionId?: string | undefined;
@@ -872,6 +993,7 @@ export declare const ApprovalResponseSchema: z.ZodUnion<[z.ZodObject<{
872
993
  data?: {
873
994
  rememberChoice?: boolean | undefined;
874
995
  rememberPattern?: string | undefined;
996
+ rememberDirectory?: boolean | undefined;
875
997
  } | undefined;
876
998
  message?: string | undefined;
877
999
  sessionId?: string | undefined;
@@ -1007,39 +1129,67 @@ export declare const ApprovalRequestDetailsSchema: z.ZodEffects<z.ZodObject<{
1007
1129
  timeout: z.ZodOptional<z.ZodNumber>;
1008
1130
  metadata: z.ZodUnion<[z.ZodObject<{
1009
1131
  toolName: z.ZodString;
1010
- toolDisplayName: z.ZodOptional<z.ZodString>;
1132
+ presentationSnapshot: z.ZodOptional<z.ZodType<ToolPresentationSnapshotV1, z.ZodTypeDef, ToolPresentationSnapshotV1>>;
1011
1133
  toolCallId: z.ZodString;
1012
1134
  args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1013
1135
  description: z.ZodOptional<z.ZodString>;
1014
1136
  displayPreview: z.ZodOptional<z.ZodType<ToolDisplayData, z.ZodTypeDef, ToolDisplayData>>;
1137
+ directoryAccess: z.ZodOptional<z.ZodObject<{
1138
+ path: z.ZodString;
1139
+ parentDir: z.ZodString;
1140
+ operation: z.ZodEnum<["read", "write", "edit"]>;
1141
+ toolName: z.ZodString;
1142
+ }, "strict", z.ZodTypeAny, {
1143
+ path: string;
1144
+ parentDir: string;
1145
+ operation: "read" | "write" | "edit";
1146
+ toolName: string;
1147
+ }, {
1148
+ path: string;
1149
+ parentDir: string;
1150
+ operation: "read" | "write" | "edit";
1151
+ toolName: string;
1152
+ }>>;
1015
1153
  suggestedPatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1016
1154
  }, "strict", z.ZodTypeAny, {
1155
+ toolName: string;
1017
1156
  toolCallId: string;
1018
1157
  args: Record<string, unknown>;
1019
- toolName: string;
1020
1158
  description?: string | undefined;
1021
- toolDisplayName?: string | undefined;
1159
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
1022
1160
  displayPreview?: ToolDisplayData | undefined;
1161
+ directoryAccess?: {
1162
+ path: string;
1163
+ parentDir: string;
1164
+ operation: "read" | "write" | "edit";
1165
+ toolName: string;
1166
+ } | undefined;
1023
1167
  suggestedPatterns?: string[] | undefined;
1024
1168
  }, {
1169
+ toolName: string;
1025
1170
  toolCallId: string;
1026
1171
  args: Record<string, unknown>;
1027
- toolName: string;
1028
1172
  description?: string | undefined;
1029
- toolDisplayName?: string | undefined;
1173
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
1030
1174
  displayPreview?: ToolDisplayData | undefined;
1175
+ directoryAccess?: {
1176
+ path: string;
1177
+ parentDir: string;
1178
+ operation: "read" | "write" | "edit";
1179
+ toolName: string;
1180
+ } | undefined;
1031
1181
  suggestedPatterns?: string[] | undefined;
1032
1182
  }>, z.ZodObject<{
1033
1183
  toolName: z.ZodString;
1034
1184
  command: z.ZodString;
1035
1185
  originalCommand: z.ZodOptional<z.ZodString>;
1036
1186
  }, "strict", z.ZodTypeAny, {
1037
- command: string;
1038
1187
  toolName: string;
1188
+ command: string;
1039
1189
  originalCommand?: string | undefined;
1040
1190
  }, {
1041
- command: string;
1042
1191
  toolName: string;
1192
+ command: string;
1043
1193
  originalCommand?: string | undefined;
1044
1194
  }>, z.ZodObject<{
1045
1195
  schema: z.ZodType<JSONSchema7, z.ZodTypeDef, JSONSchema7>;
@@ -1063,120 +1213,144 @@ export declare const ApprovalRequestDetailsSchema: z.ZodEffects<z.ZodObject<{
1063
1213
  toolName: z.ZodString;
1064
1214
  }, "strict", z.ZodTypeAny, {
1065
1215
  path: string;
1066
- toolName: string;
1067
1216
  parentDir: string;
1068
1217
  operation: "read" | "write" | "edit";
1218
+ toolName: string;
1069
1219
  }, {
1070
1220
  path: string;
1071
- toolName: string;
1072
1221
  parentDir: string;
1073
1222
  operation: "read" | "write" | "edit";
1223
+ toolName: string;
1074
1224
  }>]>;
1075
1225
  }, "strip", z.ZodTypeAny, {
1076
1226
  type: ApprovalType;
1077
1227
  metadata: Record<string, unknown> | {
1228
+ path: string;
1229
+ parentDir: string;
1230
+ operation: "read" | "write" | "edit";
1231
+ toolName: string;
1232
+ } | {
1233
+ toolName: string;
1078
1234
  toolCallId: string;
1079
1235
  args: Record<string, unknown>;
1080
- toolName: string;
1081
1236
  description?: string | undefined;
1082
- toolDisplayName?: string | undefined;
1237
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
1083
1238
  displayPreview?: ToolDisplayData | undefined;
1239
+ directoryAccess?: {
1240
+ path: string;
1241
+ parentDir: string;
1242
+ operation: "read" | "write" | "edit";
1243
+ toolName: string;
1244
+ } | undefined;
1084
1245
  suggestedPatterns?: string[] | undefined;
1085
1246
  } | {
1086
- command: string;
1087
1247
  toolName: string;
1248
+ command: string;
1088
1249
  originalCommand?: string | undefined;
1089
1250
  } | {
1090
1251
  prompt: string;
1091
1252
  schema: JSONSchema7;
1092
1253
  serverName: string;
1093
1254
  context?: Record<string, unknown> | undefined;
1094
- } | {
1095
- path: string;
1096
- toolName: string;
1097
- parentDir: string;
1098
- operation: "read" | "write" | "edit";
1099
1255
  };
1100
1256
  timeout?: number | undefined;
1101
1257
  sessionId?: string | undefined;
1102
1258
  }, {
1103
1259
  type: ApprovalType;
1104
1260
  metadata: Record<string, unknown> | {
1261
+ path: string;
1262
+ parentDir: string;
1263
+ operation: "read" | "write" | "edit";
1264
+ toolName: string;
1265
+ } | {
1266
+ toolName: string;
1105
1267
  toolCallId: string;
1106
1268
  args: Record<string, unknown>;
1107
- toolName: string;
1108
1269
  description?: string | undefined;
1109
- toolDisplayName?: string | undefined;
1270
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
1110
1271
  displayPreview?: ToolDisplayData | undefined;
1272
+ directoryAccess?: {
1273
+ path: string;
1274
+ parentDir: string;
1275
+ operation: "read" | "write" | "edit";
1276
+ toolName: string;
1277
+ } | undefined;
1111
1278
  suggestedPatterns?: string[] | undefined;
1112
1279
  } | {
1113
- command: string;
1114
1280
  toolName: string;
1281
+ command: string;
1115
1282
  originalCommand?: string | undefined;
1116
1283
  } | {
1117
1284
  prompt: string;
1118
1285
  schema: JSONSchema7;
1119
1286
  serverName: string;
1120
1287
  context?: Record<string, unknown> | undefined;
1121
- } | {
1122
- path: string;
1123
- toolName: string;
1124
- parentDir: string;
1125
- operation: "read" | "write" | "edit";
1126
1288
  };
1127
1289
  timeout?: number | undefined;
1128
1290
  sessionId?: string | undefined;
1129
1291
  }>, {
1130
1292
  type: ApprovalType;
1131
1293
  metadata: Record<string, unknown> | {
1294
+ path: string;
1295
+ parentDir: string;
1296
+ operation: "read" | "write" | "edit";
1297
+ toolName: string;
1298
+ } | {
1299
+ toolName: string;
1132
1300
  toolCallId: string;
1133
1301
  args: Record<string, unknown>;
1134
- toolName: string;
1135
1302
  description?: string | undefined;
1136
- toolDisplayName?: string | undefined;
1303
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
1137
1304
  displayPreview?: ToolDisplayData | undefined;
1305
+ directoryAccess?: {
1306
+ path: string;
1307
+ parentDir: string;
1308
+ operation: "read" | "write" | "edit";
1309
+ toolName: string;
1310
+ } | undefined;
1138
1311
  suggestedPatterns?: string[] | undefined;
1139
1312
  } | {
1140
- command: string;
1141
1313
  toolName: string;
1314
+ command: string;
1142
1315
  originalCommand?: string | undefined;
1143
1316
  } | {
1144
1317
  prompt: string;
1145
1318
  schema: JSONSchema7;
1146
1319
  serverName: string;
1147
1320
  context?: Record<string, unknown> | undefined;
1148
- } | {
1149
- path: string;
1150
- toolName: string;
1151
- parentDir: string;
1152
- operation: "read" | "write" | "edit";
1153
1321
  };
1154
1322
  timeout?: number | undefined;
1155
1323
  sessionId?: string | undefined;
1156
1324
  }, {
1157
1325
  type: ApprovalType;
1158
1326
  metadata: Record<string, unknown> | {
1327
+ path: string;
1328
+ parentDir: string;
1329
+ operation: "read" | "write" | "edit";
1330
+ toolName: string;
1331
+ } | {
1332
+ toolName: string;
1159
1333
  toolCallId: string;
1160
1334
  args: Record<string, unknown>;
1161
- toolName: string;
1162
1335
  description?: string | undefined;
1163
- toolDisplayName?: string | undefined;
1336
+ presentationSnapshot?: ToolPresentationSnapshotV1 | undefined;
1164
1337
  displayPreview?: ToolDisplayData | undefined;
1338
+ directoryAccess?: {
1339
+ path: string;
1340
+ parentDir: string;
1341
+ operation: "read" | "write" | "edit";
1342
+ toolName: string;
1343
+ } | undefined;
1165
1344
  suggestedPatterns?: string[] | undefined;
1166
1345
  } | {
1167
- command: string;
1168
1346
  toolName: string;
1347
+ command: string;
1169
1348
  originalCommand?: string | undefined;
1170
1349
  } | {
1171
1350
  prompt: string;
1172
1351
  schema: JSONSchema7;
1173
1352
  serverName: string;
1174
1353
  context?: Record<string, unknown> | undefined;
1175
- } | {
1176
- path: string;
1177
- toolName: string;
1178
- parentDir: string;
1179
- operation: "read" | "write" | "edit";
1180
1354
  };
1181
1355
  timeout?: number | undefined;
1182
1356
  sessionId?: string | undefined;