@dexto/core 1.5.1 → 1.5.3

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 (75) hide show
  1. package/dist/agent/DextoAgent.cjs +12 -1
  2. package/dist/agent/DextoAgent.d.ts.map +1 -1
  3. package/dist/agent/DextoAgent.js +12 -1
  4. package/dist/agent/schemas.d.ts +54 -12
  5. package/dist/agent/schemas.d.ts.map +1 -1
  6. package/dist/approval/manager.cjs +16 -0
  7. package/dist/approval/manager.d.ts +10 -0
  8. package/dist/approval/manager.d.ts.map +1 -1
  9. package/dist/approval/manager.js +16 -0
  10. package/dist/approval/types.d.ts +11 -0
  11. package/dist/approval/types.d.ts.map +1 -1
  12. package/dist/context/manager.cjs +4 -0
  13. package/dist/context/manager.d.ts.map +1 -1
  14. package/dist/context/manager.js +4 -0
  15. package/dist/context/types.d.ts +5 -0
  16. package/dist/context/types.d.ts.map +1 -1
  17. package/dist/events/index.cjs +3 -1
  18. package/dist/events/index.d.ts +19 -2
  19. package/dist/events/index.d.ts.map +1 -1
  20. package/dist/events/index.js +3 -1
  21. package/dist/filesystem/filesystem-service.cjs +18 -15
  22. package/dist/filesystem/filesystem-service.d.ts +3 -3
  23. package/dist/filesystem/filesystem-service.d.ts.map +1 -1
  24. package/dist/filesystem/filesystem-service.js +18 -15
  25. package/dist/filesystem/path-validator.cjs +16 -7
  26. package/dist/filesystem/path-validator.d.ts +10 -3
  27. package/dist/filesystem/path-validator.d.ts.map +1 -1
  28. package/dist/filesystem/path-validator.js +16 -7
  29. package/dist/filesystem/types.d.ts +4 -0
  30. package/dist/filesystem/types.d.ts.map +1 -1
  31. package/dist/llm/executor/turn-executor.cjs +2 -1
  32. package/dist/llm/executor/turn-executor.d.ts +1 -1
  33. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  34. package/dist/llm/executor/turn-executor.js +2 -1
  35. package/dist/llm/registry.cjs +1 -1
  36. package/dist/llm/registry.d.ts +1 -1
  37. package/dist/llm/registry.d.ts.map +1 -1
  38. package/dist/llm/registry.js +1 -1
  39. package/dist/llm/schemas.cjs +1 -1
  40. package/dist/llm/schemas.d.ts +11 -11
  41. package/dist/llm/schemas.js +1 -1
  42. package/dist/logger/v2/schemas.cjs +4 -0
  43. package/dist/logger/v2/schemas.d.ts +16 -0
  44. package/dist/logger/v2/schemas.d.ts.map +1 -1
  45. package/dist/logger/v2/schemas.js +4 -0
  46. package/dist/logger/v2/transport-factory.cjs +4 -1
  47. package/dist/logger/v2/transport-factory.d.ts.map +1 -1
  48. package/dist/logger/v2/transport-factory.js +4 -1
  49. package/dist/logger/v2/transports/silent-transport.cjs +33 -0
  50. package/dist/logger/v2/transports/silent-transport.d.ts +15 -0
  51. package/dist/logger/v2/transports/silent-transport.d.ts.map +1 -0
  52. package/dist/logger/v2/transports/silent-transport.js +10 -0
  53. package/dist/tools/error-codes.cjs +1 -0
  54. package/dist/tools/error-codes.d.ts +1 -0
  55. package/dist/tools/error-codes.d.ts.map +1 -1
  56. package/dist/tools/error-codes.js +1 -0
  57. package/dist/tools/errors.cjs +17 -0
  58. package/dist/tools/errors.d.ts +9 -0
  59. package/dist/tools/errors.d.ts.map +1 -1
  60. package/dist/tools/errors.js +17 -0
  61. package/dist/tools/internal-tools/provider.cjs +3 -2
  62. package/dist/tools/internal-tools/provider.d.ts +1 -1
  63. package/dist/tools/internal-tools/provider.d.ts.map +1 -1
  64. package/dist/tools/internal-tools/provider.js +3 -2
  65. package/dist/tools/tool-manager.cjs +78 -5
  66. package/dist/tools/tool-manager.d.ts +18 -0
  67. package/dist/tools/tool-manager.d.ts.map +1 -1
  68. package/dist/tools/tool-manager.js +79 -6
  69. package/dist/tools/types.d.ts +5 -3
  70. package/dist/tools/types.d.ts.map +1 -1
  71. package/dist/utils/safe-stringify.cjs +10 -6
  72. package/dist/utils/safe-stringify.d.ts +5 -2
  73. package/dist/utils/safe-stringify.d.ts.map +1 -1
  74. package/dist/utils/safe-stringify.js +10 -6
  75. package/package.json +1 -1
@@ -1580,7 +1580,7 @@ function getModelDisplayName(model, provider) {
1580
1580
  const modelInfo = providerInfo.models.find((m) => m.name.toLowerCase() === normalizedModel);
1581
1581
  return modelInfo?.displayName ?? model;
1582
1582
  }
1583
- function isReasoningCapableModel(model, provider) {
1583
+ function isReasoningCapableModel(model, _provider) {
1584
1584
  const modelLower = model.toLowerCase();
1585
1585
  if (modelLower.includes("codex")) {
1586
1586
  return true;
@@ -213,7 +213,7 @@ export declare function getModelDisplayName(model: string, provider?: LLMProvide
213
213
  * @param provider Optional provider for context (defaults to detecting from model name).
214
214
  * @returns True if the model supports reasoning effort configuration.
215
215
  */
216
- export declare function isReasoningCapableModel(model: string, provider?: LLMProvider): boolean;
216
+ export declare function isReasoningCapableModel(model: string, _provider?: LLMProvider): boolean;
217
217
  /**
218
218
  * Calculates the cost for a given token usage based on model pricing.
219
219
  *
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/llm/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC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,GAAG,MAAM,CAU9E"}
@@ -1536,7 +1536,7 @@ function getModelDisplayName(model, provider) {
1536
1536
  const modelInfo = providerInfo.models.find((m) => m.name.toLowerCase() === normalizedModel);
1537
1537
  return modelInfo?.displayName ?? model;
1538
1538
  }
1539
- function isReasoningCapableModel(model, provider) {
1539
+ function isReasoningCapableModel(model, _provider) {
1540
1540
  const modelLower = model.toLowerCase();
1541
1541
  if (modelLower.includes("codex")) {
1542
1542
  return true;
@@ -70,7 +70,7 @@ const LLMConfigBaseSchema = import_zod.z.object({
70
70
  // apiKey is optional at schema level - validated based on provider in superRefine
71
71
  apiKey: LLMConfigFields.apiKey,
72
72
  // Apply defaults only for complete config validation
73
- maxIterations: import_zod.z.coerce.number().int().positive().default(50),
73
+ maxIterations: import_zod.z.coerce.number().int().positive().optional(),
74
74
  baseURL: LLMConfigFields.baseURL,
75
75
  maxInputTokens: LLMConfigFields.maxInputTokens,
76
76
  maxOutputTokens: LLMConfigFields.maxOutputTokens,
@@ -24,7 +24,7 @@ export declare const LLMConfigBaseSchema: z.ZodObject<{
24
24
  provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
25
25
  model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
26
26
  apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
27
- maxIterations: z.ZodDefault<z.ZodNumber>;
27
+ maxIterations: z.ZodOptional<z.ZodNumber>;
28
28
  baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
29
29
  maxInputTokens: z.ZodOptional<z.ZodNumber>;
30
30
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
@@ -34,8 +34,8 @@ export declare const LLMConfigBaseSchema: z.ZodObject<{
34
34
  }, "strict", z.ZodTypeAny, {
35
35
  model: string;
36
36
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
37
- maxIterations: number;
38
37
  apiKey?: string | undefined;
38
+ maxIterations?: number | undefined;
39
39
  baseURL?: string | undefined;
40
40
  maxInputTokens?: number | undefined;
41
41
  maxOutputTokens?: number | undefined;
@@ -64,7 +64,7 @@ export declare function createLLMConfigSchema(options?: LLMValidationOptions): z
64
64
  provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
65
65
  model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
66
66
  apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
67
- maxIterations: z.ZodDefault<z.ZodNumber>;
67
+ maxIterations: z.ZodOptional<z.ZodNumber>;
68
68
  baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
69
69
  maxInputTokens: z.ZodOptional<z.ZodNumber>;
70
70
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
@@ -74,8 +74,8 @@ export declare function createLLMConfigSchema(options?: LLMValidationOptions): z
74
74
  }, "strict", z.ZodTypeAny, {
75
75
  model: string;
76
76
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
77
- maxIterations: number;
78
77
  apiKey?: string | undefined;
78
+ maxIterations?: number | undefined;
79
79
  baseURL?: string | undefined;
80
80
  maxInputTokens?: number | undefined;
81
81
  maxOutputTokens?: number | undefined;
@@ -96,8 +96,8 @@ export declare function createLLMConfigSchema(options?: LLMValidationOptions): z
96
96
  }>, {
97
97
  model: string;
98
98
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
99
- maxIterations: number;
100
99
  apiKey?: string | undefined;
100
+ maxIterations?: number | undefined;
101
101
  baseURL?: string | undefined;
102
102
  maxInputTokens?: number | undefined;
103
103
  maxOutputTokens?: number | undefined;
@@ -124,7 +124,7 @@ export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
124
124
  provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
125
125
  model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
126
126
  apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
127
- maxIterations: z.ZodDefault<z.ZodNumber>;
127
+ maxIterations: z.ZodOptional<z.ZodNumber>;
128
128
  baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
129
129
  maxInputTokens: z.ZodOptional<z.ZodNumber>;
130
130
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
@@ -134,8 +134,8 @@ export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
134
134
  }, "strict", z.ZodTypeAny, {
135
135
  model: string;
136
136
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
137
- maxIterations: number;
138
137
  apiKey?: string | undefined;
138
+ maxIterations?: number | undefined;
139
139
  baseURL?: string | undefined;
140
140
  maxInputTokens?: number | undefined;
141
141
  maxOutputTokens?: number | undefined;
@@ -156,8 +156,8 @@ export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
156
156
  }>, {
157
157
  model: string;
158
158
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
159
- maxIterations: number;
160
159
  apiKey?: string | undefined;
160
+ maxIterations?: number | undefined;
161
161
  baseURL?: string | undefined;
162
162
  maxInputTokens?: number | undefined;
163
163
  maxOutputTokens?: number | undefined;
@@ -184,7 +184,7 @@ export declare const LLMConfigSchemaRelaxed: z.ZodBranded<z.ZodEffects<z.ZodObje
184
184
  provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
185
185
  model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
186
186
  apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
187
- maxIterations: z.ZodDefault<z.ZodNumber>;
187
+ maxIterations: z.ZodOptional<z.ZodNumber>;
188
188
  baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
189
189
  maxInputTokens: z.ZodOptional<z.ZodNumber>;
190
190
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
@@ -194,8 +194,8 @@ export declare const LLMConfigSchemaRelaxed: z.ZodBranded<z.ZodEffects<z.ZodObje
194
194
  }, "strict", z.ZodTypeAny, {
195
195
  model: string;
196
196
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
197
- maxIterations: number;
198
197
  apiKey?: string | undefined;
198
+ maxIterations?: number | undefined;
199
199
  baseURL?: string | undefined;
200
200
  maxInputTokens?: number | undefined;
201
201
  maxOutputTokens?: number | undefined;
@@ -216,8 +216,8 @@ export declare const LLMConfigSchemaRelaxed: z.ZodBranded<z.ZodEffects<z.ZodObje
216
216
  }>, {
217
217
  model: string;
218
218
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
219
- maxIterations: number;
220
219
  apiKey?: string | undefined;
220
+ maxIterations?: number | undefined;
221
221
  baseURL?: string | undefined;
222
222
  maxInputTokens?: number | undefined;
223
223
  maxOutputTokens?: number | undefined;
@@ -53,7 +53,7 @@ const LLMConfigBaseSchema = z.object({
53
53
  // apiKey is optional at schema level - validated based on provider in superRefine
54
54
  apiKey: LLMConfigFields.apiKey,
55
55
  // Apply defaults only for complete config validation
56
- maxIterations: z.coerce.number().int().positive().default(50),
56
+ maxIterations: z.coerce.number().int().positive().optional(),
57
57
  baseURL: LLMConfigFields.baseURL,
58
58
  maxInputTokens: LLMConfigFields.maxInputTokens,
59
59
  maxOutputTokens: LLMConfigFields.maxOutputTokens,
@@ -23,6 +23,9 @@ __export(schemas_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(schemas_exports);
25
25
  var import_zod = require("zod");
26
+ const SilentTransportSchema = import_zod.z.object({
27
+ type: import_zod.z.literal("silent")
28
+ }).strict().describe("Silent transport that discards all logs (useful for sub-agents)");
26
29
  const ConsoleTransportSchema = import_zod.z.object({
27
30
  type: import_zod.z.literal("console"),
28
31
  colorize: import_zod.z.boolean().default(true).describe("Enable colored output")
@@ -42,6 +45,7 @@ const UpstashTransportSchema = import_zod.z.object({
42
45
  batchSize: import_zod.z.number().int().positive().default(100).describe("Number of log entries to batch before sending (default: 100)")
43
46
  }).strict().describe("Upstash Redis transport for remote logging");
44
47
  const LoggerTransportSchema = import_zod.z.discriminatedUnion("type", [
48
+ SilentTransportSchema,
45
49
  ConsoleTransportSchema,
46
50
  FileTransportSchema,
47
51
  UpstashTransportSchema
@@ -9,6 +9,12 @@ import { z } from 'zod';
9
9
  * Transport configuration (discriminated union)
10
10
  */
11
11
  export declare const LoggerTransportSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
12
+ type: z.ZodLiteral<"silent">;
13
+ }, "strict", z.ZodTypeAny, {
14
+ type: "silent";
15
+ }, {
16
+ type: "silent";
17
+ }>, z.ZodObject<{
12
18
  type: z.ZodLiteral<"console">;
13
19
  colorize: z.ZodDefault<z.ZodBoolean>;
14
20
  }, "strict", z.ZodTypeAny, {
@@ -61,6 +67,12 @@ export type LoggerTransportConfig = z.output<typeof LoggerTransportSchema>;
61
67
  export declare const LoggerConfigSchema: z.ZodObject<{
62
68
  level: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error", "silly"]>>;
63
69
  transports: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
70
+ type: z.ZodLiteral<"silent">;
71
+ }, "strict", z.ZodTypeAny, {
72
+ type: "silent";
73
+ }, {
74
+ type: "silent";
75
+ }>, z.ZodObject<{
64
76
  type: z.ZodLiteral<"console">;
65
77
  colorize: z.ZodDefault<z.ZodBoolean>;
66
78
  }, "strict", z.ZodTypeAny, {
@@ -109,6 +121,8 @@ export declare const LoggerConfigSchema: z.ZodObject<{
109
121
  }, "strict", z.ZodTypeAny, {
110
122
  level: "debug" | "info" | "warn" | "error" | "silly";
111
123
  transports: ({
124
+ type: "silent";
125
+ } | {
112
126
  type: "console";
113
127
  colorize: boolean;
114
128
  } | {
@@ -127,6 +141,8 @@ export declare const LoggerConfigSchema: z.ZodObject<{
127
141
  }, {
128
142
  level?: "debug" | "info" | "warn" | "error" | "silly" | undefined;
129
143
  transports?: ({
144
+ type: "silent";
145
+ } | {
130
146
  type: "console";
131
147
  colorize?: boolean | undefined;
132
148
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/logger/v2/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4DxB;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIhC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAamC,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/logger/v2/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsExB;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAamC,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import "../../chunk-PTJYTZNU.js";
2
2
  import { z } from "zod";
3
+ const SilentTransportSchema = z.object({
4
+ type: z.literal("silent")
5
+ }).strict().describe("Silent transport that discards all logs (useful for sub-agents)");
3
6
  const ConsoleTransportSchema = z.object({
4
7
  type: z.literal("console"),
5
8
  colorize: z.boolean().default(true).describe("Enable colored output")
@@ -19,6 +22,7 @@ const UpstashTransportSchema = z.object({
19
22
  batchSize: z.number().int().positive().default(100).describe("Number of log entries to batch before sending (default: 100)")
20
23
  }).strict().describe("Upstash Redis transport for remote logging");
21
24
  const LoggerTransportSchema = z.discriminatedUnion("type", [
25
+ SilentTransportSchema,
22
26
  ConsoleTransportSchema,
23
27
  FileTransportSchema,
24
28
  UpstashTransportSchema
@@ -22,11 +22,14 @@ __export(transport_factory_exports, {
22
22
  createTransports: () => createTransports
23
23
  });
24
24
  module.exports = __toCommonJS(transport_factory_exports);
25
+ var import_silent_transport = require("./transports/silent-transport.js");
25
26
  var import_console_transport = require("./transports/console-transport.js");
26
27
  var import_file_transport = require("./transports/file-transport.js");
27
28
  var import_errors = require("./errors.js");
28
29
  function createTransport(config) {
29
30
  switch (config.type) {
31
+ case "silent":
32
+ return new import_silent_transport.SilentTransport();
30
33
  case "console":
31
34
  return new import_console_transport.ConsoleTransport({
32
35
  colorize: config.colorize
@@ -38,7 +41,7 @@ function createTransport(config) {
38
41
  maxFiles: config.maxFiles
39
42
  });
40
43
  case "upstash":
41
- throw import_errors.LoggerError.transportNotImplemented("upstash", ["console", "file"]);
44
+ throw import_errors.LoggerError.transportNotImplemented("upstash", ["silent", "console", "file"]);
42
45
  default:
43
46
  throw import_errors.LoggerError.unknownTransportType(config.type);
44
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transport-factory.d.ts","sourceRoot":"","sources":["../../../src/logger/v2/transport-factory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAK1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,gBAAgB,CAqB/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,EAAE,GAAG,gBAAgB,EAAE,CAErF"}
1
+ {"version":3,"file":"transport-factory.d.ts","sourceRoot":"","sources":["../../../src/logger/v2/transport-factory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAM1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,gBAAgB,CAwB/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,EAAE,GAAG,gBAAgB,EAAE,CAErF"}
@@ -1,9 +1,12 @@
1
1
  import "../../chunk-PTJYTZNU.js";
2
+ import { SilentTransport } from "./transports/silent-transport.js";
2
3
  import { ConsoleTransport } from "./transports/console-transport.js";
3
4
  import { FileTransport } from "./transports/file-transport.js";
4
5
  import { LoggerError } from "./errors.js";
5
6
  function createTransport(config) {
6
7
  switch (config.type) {
8
+ case "silent":
9
+ return new SilentTransport();
7
10
  case "console":
8
11
  return new ConsoleTransport({
9
12
  colorize: config.colorize
@@ -15,7 +18,7 @@ function createTransport(config) {
15
18
  maxFiles: config.maxFiles
16
19
  });
17
20
  case "upstash":
18
- throw LoggerError.transportNotImplemented("upstash", ["console", "file"]);
21
+ throw LoggerError.transportNotImplemented("upstash", ["silent", "console", "file"]);
19
22
  default:
20
23
  throw LoggerError.unknownTransportType(config.type);
21
24
  }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var silent_transport_exports = {};
20
+ __export(silent_transport_exports, {
21
+ SilentTransport: () => SilentTransport
22
+ });
23
+ module.exports = __toCommonJS(silent_transport_exports);
24
+ class SilentTransport {
25
+ write(_entry) {
26
+ }
27
+ destroy() {
28
+ }
29
+ }
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ SilentTransport
33
+ });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Silent Transport
3
+ *
4
+ * A no-op transport that discards all log entries.
5
+ * Used when logging needs to be completely suppressed (e.g., sub-agents).
6
+ */
7
+ import type { ILoggerTransport, LogEntry } from '../types.js';
8
+ /**
9
+ * SilentTransport - Discards all log entries
10
+ */
11
+ export declare class SilentTransport implements ILoggerTransport {
12
+ write(_entry: LogEntry): void;
13
+ destroy(): void;
14
+ }
15
+ //# sourceMappingURL=silent-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"silent-transport.d.ts","sourceRoot":"","sources":["../../../../src/logger/v2/transports/silent-transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D;;GAEG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IACpD,KAAK,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI;IAI7B,OAAO,IAAI,IAAI;CAGlB"}
@@ -0,0 +1,10 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ class SilentTransport {
3
+ write(_entry) {
4
+ }
5
+ destroy() {
6
+ }
7
+ }
8
+ export {
9
+ SilentTransport
10
+ };
@@ -27,6 +27,7 @@ var ToolErrorCode = /* @__PURE__ */ ((ToolErrorCode2) => {
27
27
  ToolErrorCode2["EXECUTION_FAILED"] = "tools_execution_failed";
28
28
  ToolErrorCode2["DIRECTORY_ACCESS_DENIED"] = "tools_directory_access_denied";
29
29
  ToolErrorCode2["VALIDATION_FAILED"] = "tools_validation_failed";
30
+ ToolErrorCode2["FILE_MODIFIED_SINCE_PREVIEW"] = "tools_file_modified_since_preview";
30
31
  ToolErrorCode2["CONFIRMATION_HANDLER_MISSING"] = "tools_confirmation_handler_missing";
31
32
  ToolErrorCode2["CONFIRMATION_TIMEOUT"] = "tools_confirmation_timeout";
32
33
  ToolErrorCode2["CONFIRMATION_CANCELLED"] = "tools_confirmation_cancelled";
@@ -8,6 +8,7 @@ export declare enum ToolErrorCode {
8
8
  EXECUTION_FAILED = "tools_execution_failed",
9
9
  DIRECTORY_ACCESS_DENIED = "tools_directory_access_denied",
10
10
  VALIDATION_FAILED = "tools_validation_failed",
11
+ FILE_MODIFIED_SINCE_PREVIEW = "tools_file_modified_since_preview",
11
12
  CONFIRMATION_HANDLER_MISSING = "tools_confirmation_handler_missing",
12
13
  CONFIRMATION_TIMEOUT = "tools_confirmation_timeout",
13
14
  CONFIRMATION_CANCELLED = "tools_confirmation_cancelled",
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/tools/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,aAAa;IAErB,gBAAgB,2BAA2B;IAC3C,iBAAiB,4BAA4B;IAC7C,gBAAgB,2BAA2B;IAC3C,uBAAuB,kCAAkC;IAGzD,iBAAiB,4BAA4B;IAG7C,4BAA4B,uCAAuC;IACnE,oBAAoB,+BAA+B;IACnD,sBAAsB,iCAAiC;IAGvD,cAAc,yBAAyB;IACvC,iBAAiB,uBAAuB;IACxC,iBAAiB,uBAAuB;IAGxC,cAAc,yBAAyB;IACvC,gBAAgB,2BAA2B;IAG3C,4BAA4B,kCAAkC;IAC9D,uCAAuC,6CAA6C;CACvF"}
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/tools/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,aAAa;IAErB,gBAAgB,2BAA2B;IAC3C,iBAAiB,4BAA4B;IAC7C,gBAAgB,2BAA2B;IAC3C,uBAAuB,kCAAkC;IAGzD,iBAAiB,4BAA4B;IAC7C,2BAA2B,sCAAsC;IAGjE,4BAA4B,uCAAuC;IACnE,oBAAoB,+BAA+B;IACnD,sBAAsB,iCAAiC;IAGvD,cAAc,yBAAyB;IACvC,iBAAiB,uBAAuB;IACxC,iBAAiB,uBAAuB;IAGxC,cAAc,yBAAyB;IACvC,gBAAgB,2BAA2B;IAG3C,4BAA4B,kCAAkC;IAC9D,uCAAuC,6CAA6C;CACvF"}
@@ -5,6 +5,7 @@ var ToolErrorCode = /* @__PURE__ */ ((ToolErrorCode2) => {
5
5
  ToolErrorCode2["EXECUTION_FAILED"] = "tools_execution_failed";
6
6
  ToolErrorCode2["DIRECTORY_ACCESS_DENIED"] = "tools_directory_access_denied";
7
7
  ToolErrorCode2["VALIDATION_FAILED"] = "tools_validation_failed";
8
+ ToolErrorCode2["FILE_MODIFIED_SINCE_PREVIEW"] = "tools_file_modified_since_preview";
8
9
  ToolErrorCode2["CONFIRMATION_HANDLER_MISSING"] = "tools_confirmation_handler_missing";
9
10
  ToolErrorCode2["CONFIRMATION_TIMEOUT"] = "tools_confirmation_timeout";
10
11
  ToolErrorCode2["CONFIRMATION_CANCELLED"] = "tools_confirmation_cancelled";
@@ -103,6 +103,23 @@ class ToolError {
103
103
  { toolName, reason, ...context }
104
104
  );
105
105
  }
106
+ /**
107
+ * File was modified between preview and execute.
108
+ * This is a safety check to prevent corrupting user edits.
109
+ */
110
+ static fileModifiedSincePreview(toolName, filePath) {
111
+ return new import_DextoRuntimeError.DextoRuntimeError(
112
+ import_error_codes.ToolErrorCode.FILE_MODIFIED_SINCE_PREVIEW,
113
+ import_types.ErrorScope.TOOLS,
114
+ import_types.ErrorType.USER,
115
+ `File '${filePath}' was modified since the preview was generated. Please read the file again and retry the operation.`,
116
+ {
117
+ toolName,
118
+ filePath,
119
+ recovery: "Read the file with read_file tool to get current content, then retry the edit."
120
+ }
121
+ );
122
+ }
106
123
  /**
107
124
  * Tool unauthorized access
108
125
  */
@@ -51,6 +51,15 @@ export declare class ToolError {
51
51
  toolName: string;
52
52
  reason: string;
53
53
  }>;
54
+ /**
55
+ * File was modified between preview and execute.
56
+ * This is a safety check to prevent corrupting user edits.
57
+ */
58
+ static fileModifiedSincePreview(toolName: string, filePath: string): DextoRuntimeError<{
59
+ toolName: string;
60
+ filePath: string;
61
+ recovery: string;
62
+ }>;
54
63
  /**
55
64
  * Tool unauthorized access
56
65
  */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/tools/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAItE;;;GAGG;AACH,qBAAa,SAAS;IAClB;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM;;;IAUhC;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;;;;;IAU3E;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;;;;IAU3D;;;;OAIG;IACH,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;;;;IAWlE;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;;;;;IAc/E;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;IAU3F;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;;;;IAUxD;;OAEG;IACH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AE,MAAM,EAChB,eAAe,EAAE,MAAM,EAAE,EACzB,OAAO,EAAE,MAAM,GAChB,iBAAiB,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAcrE;;OAEG;IACH,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,iBAAiB;IAW3F;;OAEG;IACH,MAAM,CAAC,mCAAmC,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB;CAU9E"}
@@ -81,6 +81,23 @@ class ToolError {
81
81
  { toolName, reason, ...context }
82
82
  );
83
83
  }
84
+ /**
85
+ * File was modified between preview and execute.
86
+ * This is a safety check to prevent corrupting user edits.
87
+ */
88
+ static fileModifiedSincePreview(toolName, filePath) {
89
+ return new DextoRuntimeError(
90
+ ToolErrorCode.FILE_MODIFIED_SINCE_PREVIEW,
91
+ ErrorScope.TOOLS,
92
+ ErrorType.USER,
93
+ `File '${filePath}' was modified since the preview was generated. Please read the file again and retry the operation.`,
94
+ {
95
+ toolName,
96
+ filePath,
97
+ recovery: "Read the file with read_file tool to get current content, then retry the edit."
98
+ }
99
+ );
100
+ }
84
101
  /**
85
102
  * Tool unauthorized access
86
103
  */
@@ -201,7 +201,7 @@ class InternalToolsProvider {
201
201
  /**
202
202
  * Execute an internal tool - confirmation is handled by ToolManager
203
203
  */
204
- async executeTool(toolName, args, sessionId, abortSignal) {
204
+ async executeTool(toolName, args, sessionId, abortSignal, toolCallId) {
205
205
  const tool = this.internalTools.get(toolName) || this.customTools.get(toolName);
206
206
  if (!tool) {
207
207
  this.logger.error(`\u274C No tool found: ${toolName}`);
@@ -226,7 +226,8 @@ class InternalToolsProvider {
226
226
  try {
227
227
  const context = {
228
228
  sessionId,
229
- abortSignal
229
+ abortSignal,
230
+ toolCallId
230
231
  };
231
232
  const result = await tool.execute(validationResult.data, context);
232
233
  return result;
@@ -65,7 +65,7 @@ export declare class InternalToolsProvider {
65
65
  /**
66
66
  * Execute an internal tool - confirmation is handled by ToolManager
67
67
  */
68
- executeTool(toolName: string, args: Record<string, unknown>, sessionId?: string, abortSignal?: AbortSignal): Promise<unknown>;
68
+ executeTool(toolName: string, args: Record<string, unknown>, sessionId?: string, abortSignal?: AbortSignal, toolCallId?: string): Promise<unknown>;
69
69
  /**
70
70
  * Get internal tools in ToolSet format (excludes custom tools)
71
71
  */
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/tools/internal-tools/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,EAAE,qBAAqB,EAA0C,MAAM,eAAe,CAAC;AAC9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAK5E;;;;;;;;;;;;;GAaG;AACH,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,aAAa,CAAwC;IAC7D,OAAO,CAAC,WAAW,CAAwC;IAC3D,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,KAAK,CAAC,CAAa;gBAGvB,QAAQ,EAAE,qBAAqB,EAC/B,MAAM,EAAE,mBAAmB,YAAK,EAChC,iBAAiB,EAAE,iBAAiB,YAAK,EACzC,MAAM,EAAE,YAAY;IAYxB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAIjC;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BjC;;OAEG;IACH,OAAO,CAAC,qBA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BAAkB,IAAI,MAAM,EAAE;IAI9B;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,oBAAoB,IAAI,MAAM;IAI9B;;OAEG;IACH,kBAAkB,IAAI,MAAM;CAG/B"}
@@ -179,7 +179,7 @@ class InternalToolsProvider {
179
179
  /**
180
180
  * Execute an internal tool - confirmation is handled by ToolManager
181
181
  */
182
- async executeTool(toolName, args, sessionId, abortSignal) {
182
+ async executeTool(toolName, args, sessionId, abortSignal, toolCallId) {
183
183
  const tool = this.internalTools.get(toolName) || this.customTools.get(toolName);
184
184
  if (!tool) {
185
185
  this.logger.error(`\u274C No tool found: ${toolName}`);
@@ -204,7 +204,8 @@ class InternalToolsProvider {
204
204
  try {
205
205
  const context = {
206
206
  sessionId,
207
- abortSignal
207
+ abortSignal,
208
+ toolCallId
208
209
  };
209
210
  const result = await tool.execute(validationResult.data, context);
210
211
  return result;