@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
@@ -199,7 +199,7 @@ class VercelLLMService {
199
199
  const parts = typeof content === "string" ? [{ type: "text", text: content }] : content;
200
200
  await this.contextManager.addUserMessage(parts);
201
201
  const executor = this.createTurnExecutor(options?.signal);
202
- const contributorContext = { mcpManager: this.toolManager.getMcpManager() };
202
+ const contributorContext = await this.toolManager.buildContributorContext();
203
203
  const result = await executor.execute(contributorContext, true);
204
204
  return {
205
205
  text: result.text ?? ""
@@ -136,7 +136,7 @@ class VercelLLMService {
136
136
  const parts = typeof content === "string" ? [{ type: "text", text: content }] : content;
137
137
  await this.contextManager.addUserMessage(parts);
138
138
  const executor = this.createTurnExecutor(options?.signal);
139
- const contributorContext = { mcpManager: this.toolManager.getMcpManager() };
139
+ const contributorContext = await this.toolManager.buildContributorContext();
140
140
  const result = await executor.execute(contributorContext, true);
141
141
  return {
142
142
  text: result.text ?? ""
@@ -27,13 +27,13 @@ export declare const DefaultLoggerFactoryConfigSchema: z.ZodObject<{
27
27
  }, "strict", z.ZodTypeAny, {
28
28
  path: string;
29
29
  type: "file";
30
- maxSize: number;
31
30
  maxFiles: number;
31
+ maxSize: number;
32
32
  }, {
33
33
  path: string;
34
34
  type: "file";
35
- maxSize?: number | undefined;
36
35
  maxFiles?: number | undefined;
36
+ maxSize?: number | undefined;
37
37
  }>, z.ZodObject<{
38
38
  type: z.ZodLiteral<"upstash">;
39
39
  url: z.ZodString;
@@ -66,8 +66,8 @@ export declare const DefaultLoggerFactoryConfigSchema: z.ZodObject<{
66
66
  } | {
67
67
  path: string;
68
68
  type: "file";
69
- maxSize: number;
70
69
  maxFiles: number;
70
+ maxSize: number;
71
71
  } | {
72
72
  token: string;
73
73
  type: "upstash";
@@ -86,8 +86,8 @@ export declare const DefaultLoggerFactoryConfigSchema: z.ZodObject<{
86
86
  } | {
87
87
  path: string;
88
88
  type: "file";
89
- maxSize?: number | undefined;
90
89
  maxFiles?: number | undefined;
90
+ maxSize?: number | undefined;
91
91
  } | {
92
92
  token: string;
93
93
  type: "upstash";
@@ -108,8 +108,8 @@ export declare const DefaultLoggerFactoryConfigSchema: z.ZodObject<{
108
108
  } | {
109
109
  path: string;
110
110
  type: "file";
111
- maxSize: number;
112
111
  maxFiles: number;
112
+ maxSize: number;
113
113
  } | {
114
114
  token: string;
115
115
  type: "upstash";
@@ -131,8 +131,8 @@ export declare const DefaultLoggerFactoryConfigSchema: z.ZodObject<{
131
131
  } | {
132
132
  path: string;
133
133
  type: "file";
134
- maxSize?: number | undefined;
135
134
  maxFiles?: number | undefined;
135
+ maxSize?: number | undefined;
136
136
  } | {
137
137
  token: string;
138
138
  type: "upstash";
@@ -179,13 +179,13 @@ export declare const defaultLoggerFactory: {
179
179
  }, "strict", z.ZodTypeAny, {
180
180
  path: string;
181
181
  type: "file";
182
- maxSize: number;
183
182
  maxFiles: number;
183
+ maxSize: number;
184
184
  }, {
185
185
  path: string;
186
186
  type: "file";
187
- maxSize?: number | undefined;
188
187
  maxFiles?: number | undefined;
188
+ maxSize?: number | undefined;
189
189
  }>, z.ZodObject<{
190
190
  type: z.ZodLiteral<"upstash">;
191
191
  url: z.ZodString;
@@ -218,8 +218,8 @@ export declare const defaultLoggerFactory: {
218
218
  } | {
219
219
  path: string;
220
220
  type: "file";
221
- maxSize: number;
222
221
  maxFiles: number;
222
+ maxSize: number;
223
223
  } | {
224
224
  token: string;
225
225
  type: "upstash";
@@ -238,8 +238,8 @@ export declare const defaultLoggerFactory: {
238
238
  } | {
239
239
  path: string;
240
240
  type: "file";
241
- maxSize?: number | undefined;
242
241
  maxFiles?: number | undefined;
242
+ maxSize?: number | undefined;
243
243
  } | {
244
244
  token: string;
245
245
  type: "upstash";
@@ -260,8 +260,8 @@ export declare const defaultLoggerFactory: {
260
260
  } | {
261
261
  path: string;
262
262
  type: "file";
263
- maxSize: number;
264
263
  maxFiles: number;
264
+ maxSize: number;
265
265
  } | {
266
266
  token: string;
267
267
  type: "upstash";
@@ -283,8 +283,8 @@ export declare const defaultLoggerFactory: {
283
283
  } | {
284
284
  path: string;
285
285
  type: "file";
286
- maxSize?: number | undefined;
287
286
  maxFiles?: number | undefined;
287
+ maxSize?: number | undefined;
288
288
  } | {
289
289
  token: string;
290
290
  type: "upstash";
@@ -152,6 +152,41 @@ class DextoLogger {
152
152
  // Share the same level reference
153
153
  });
154
154
  }
155
+ /**
156
+ * Create a new logger that shares the same level reference but allows overriding
157
+ * component/agent/session/transports.
158
+ *
159
+ * This is useful for session-scoped file logging in interactive CLI where the base
160
+ * logger is silent (no console), but we still want runtime log level changes to apply
161
+ * to the file logger.
162
+ */
163
+ createScopedLogger(options) {
164
+ return new DextoLogger({
165
+ level: this.levelRef.value,
166
+ component: options.component,
167
+ agentId: options.agentId ?? this.agentId,
168
+ ...options.sessionId !== void 0 && { sessionId: options.sessionId },
169
+ transports: options.transports ?? this.transports,
170
+ _levelRef: this.levelRef
171
+ });
172
+ }
173
+ /**
174
+ * Create a child logger that only logs to file (no console).
175
+ * Useful for sub-agents where console output should be suppressed.
176
+ */
177
+ createFileOnlyChild(component) {
178
+ const fileTransports = this.transports.filter(
179
+ (transport) => "getFilePath" in transport && typeof transport.getFilePath === "function"
180
+ );
181
+ return new DextoLogger({
182
+ level: this.levelRef.value,
183
+ component,
184
+ agentId: this.agentId,
185
+ ...this.sessionId !== void 0 && { sessionId: this.sessionId },
186
+ transports: fileTransports,
187
+ _levelRef: this.levelRef
188
+ });
189
+ }
155
190
  /**
156
191
  * Cleanup all transports
157
192
  */
@@ -67,6 +67,25 @@ export declare class DextoLogger implements Logger {
67
67
  * Shares the same transports and level reference but uses different component identifier
68
68
  */
69
69
  createChild(component: DextoLogComponent): DextoLogger;
70
+ /**
71
+ * Create a new logger that shares the same level reference but allows overriding
72
+ * component/agent/session/transports.
73
+ *
74
+ * This is useful for session-scoped file logging in interactive CLI where the base
75
+ * logger is silent (no console), but we still want runtime log level changes to apply
76
+ * to the file logger.
77
+ */
78
+ createScopedLogger(options: {
79
+ component: DextoLogComponent;
80
+ agentId?: string;
81
+ sessionId?: string;
82
+ transports?: LoggerTransport[];
83
+ }): DextoLogger;
84
+ /**
85
+ * Create a child logger that only logs to file (no console).
86
+ * Useful for sub-agents where console output should be suppressed.
87
+ */
88
+ createFileOnlyChild(component: DextoLogComponent): DextoLogger;
70
89
  /**
71
90
  * Cleanup all transports
72
91
  */
@@ -1 +1 @@
1
- {"version":3,"file":"dexto-logger.d.ts","sourceRoot":"","sources":["../../../src/logger/v2/dexto-logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAY,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEjG,MAAM,WAAW,iBAAiB;IAC9B,kCAAkC;IAClC,KAAK,EAAE,QAAQ,CAAC;IAChB,2BAA2B;IAC3B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,oFAAoF;IACpF,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAA;KAAE,CAAC;CACnC;AAED;;GAEG;AACH,qBAAa,WAAY,YAAW,MAAM;IACtC,sFAAsF;IACtF,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,UAAU,CAAoB;IAKtC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAM5B;gBAEU,MAAM,EAAE,iBAAiB;IASrC,KAAK,CAAC,OAAO,EAAE,MAAM,EAA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OAAO,CAAC,GAAG,IAAI;IASrE;;OAEG;IACH,OAAO,CAAC,GAAG;IA4BX;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAIjB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI/B;;OAEG;IACH,QAAQ,IAAI,QAAQ;IAIpB;;OAEG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAU/B;;;OAGG;IACH,WAAW,CAAC,SAAS,EAAE,iBAAiB,GAAG,WAAW;IAWtD;;;;;;;OAOG;IACH,kBAAkB,CAAC,OAAO,EAAE;QACxB,SAAS,EAAE,iBAAiB,CAAC;QAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;KAClC,GAAG,WAAW;IAWf;;;OAGG;IACH,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,GAAG,WAAW;IAe9D;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAWjC"}
@@ -130,6 +130,41 @@ class DextoLogger {
130
130
  // Share the same level reference
131
131
  });
132
132
  }
133
+ /**
134
+ * Create a new logger that shares the same level reference but allows overriding
135
+ * component/agent/session/transports.
136
+ *
137
+ * This is useful for session-scoped file logging in interactive CLI where the base
138
+ * logger is silent (no console), but we still want runtime log level changes to apply
139
+ * to the file logger.
140
+ */
141
+ createScopedLogger(options) {
142
+ return new DextoLogger({
143
+ level: this.levelRef.value,
144
+ component: options.component,
145
+ agentId: options.agentId ?? this.agentId,
146
+ ...options.sessionId !== void 0 && { sessionId: options.sessionId },
147
+ transports: options.transports ?? this.transports,
148
+ _levelRef: this.levelRef
149
+ });
150
+ }
151
+ /**
152
+ * Create a child logger that only logs to file (no console).
153
+ * Useful for sub-agents where console output should be suppressed.
154
+ */
155
+ createFileOnlyChild(component) {
156
+ const fileTransports = this.transports.filter(
157
+ (transport) => "getFilePath" in transport && typeof transport.getFilePath === "function"
158
+ );
159
+ return new DextoLogger({
160
+ level: this.levelRef.value,
161
+ component,
162
+ agentId: this.agentId,
163
+ ...this.sessionId !== void 0 && { sessionId: this.sessionId },
164
+ transports: fileTransports,
165
+ _levelRef: this.levelRef
166
+ });
167
+ }
133
168
  /**
134
169
  * Cleanup all transports
135
170
  */
@@ -31,13 +31,13 @@ export declare const LoggerTransportSchema: z.ZodDiscriminatedUnion<"type", [z.Z
31
31
  }, "strict", z.ZodTypeAny, {
32
32
  path: string;
33
33
  type: "file";
34
- maxSize: number;
35
34
  maxFiles: number;
35
+ maxSize: number;
36
36
  }, {
37
37
  path: string;
38
38
  type: "file";
39
- maxSize?: number | undefined;
40
39
  maxFiles?: number | undefined;
40
+ maxSize?: number | undefined;
41
41
  }>, z.ZodObject<{
42
42
  type: z.ZodLiteral<"upstash">;
43
43
  url: z.ZodString;
@@ -89,13 +89,13 @@ export declare const LoggerConfigSchema: z.ZodObject<{
89
89
  }, "strict", z.ZodTypeAny, {
90
90
  path: string;
91
91
  type: "file";
92
- maxSize: number;
93
92
  maxFiles: number;
93
+ maxSize: number;
94
94
  }, {
95
95
  path: string;
96
96
  type: "file";
97
- maxSize?: number | undefined;
98
97
  maxFiles?: number | undefined;
98
+ maxSize?: number | undefined;
99
99
  }>, z.ZodObject<{
100
100
  type: z.ZodLiteral<"upstash">;
101
101
  url: z.ZodString;
@@ -128,8 +128,8 @@ export declare const LoggerConfigSchema: z.ZodObject<{
128
128
  } | {
129
129
  path: string;
130
130
  type: "file";
131
- maxSize: number;
132
131
  maxFiles: number;
132
+ maxSize: number;
133
133
  } | {
134
134
  token: string;
135
135
  type: "upstash";
@@ -148,8 +148,8 @@ export declare const LoggerConfigSchema: z.ZodObject<{
148
148
  } | {
149
149
  path: string;
150
150
  type: "file";
151
- maxSize?: number | undefined;
152
151
  maxFiles?: number | undefined;
152
+ maxSize?: number | undefined;
153
153
  } | {
154
154
  token: string;
155
155
  type: "upstash";
@@ -32,6 +32,7 @@ function createMockLogger() {
32
32
  error: import_vitest.vi.fn(),
33
33
  trackException: import_vitest.vi.fn(),
34
34
  createChild: import_vitest.vi.fn(() => mockLogger),
35
+ createFileOnlyChild: import_vitest.vi.fn(() => mockLogger),
35
36
  destroy: import_vitest.vi.fn(),
36
37
  setLevel: import_vitest.vi.fn(),
37
38
  getLevel: import_vitest.vi.fn(() => "info"),
@@ -54,6 +55,7 @@ function createSilentMockLogger() {
54
55
  trackException: () => {
55
56
  },
56
57
  createChild: () => mockLogger,
58
+ createFileOnlyChild: () => mockLogger,
57
59
  destroy: async () => {
58
60
  },
59
61
  setLevel: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/logger/v2/test-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,YAAY,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAezC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAe/C"}
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/logger/v2/test-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,YAAY,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAgBzC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAgB/C"}
@@ -9,6 +9,7 @@ function createMockLogger() {
9
9
  error: vi.fn(),
10
10
  trackException: vi.fn(),
11
11
  createChild: vi.fn(() => mockLogger),
12
+ createFileOnlyChild: vi.fn(() => mockLogger),
12
13
  destroy: vi.fn(),
13
14
  setLevel: vi.fn(),
14
15
  getLevel: vi.fn(() => "info"),
@@ -31,6 +32,7 @@ function createSilentMockLogger() {
31
32
  trackException: () => {
32
33
  },
33
34
  createChild: () => mockLogger,
35
+ createFileOnlyChild: () => mockLogger,
34
36
  destroy: async () => {
35
37
  },
36
38
  setLevel: () => {
@@ -66,11 +66,24 @@ export type Logger = {
66
66
  */
67
67
  debug(message: string, context?: Record<string, unknown>): void;
68
68
  /**
69
- * Log silly message (most verbose, for detailed debugging like full JSON dumps)
69
+ * Log silly/trivial message
70
70
  * @param message Log message
71
71
  * @param context Optional structured context
72
72
  */
73
73
  silly(message: string, context?: Record<string, unknown>): void;
74
+ /**
75
+ * Shares the same transports, agentId, and level but uses a different component identifier
76
+ * @param component Component identifier for the child logger
77
+ * @returns New logger instance with specified component
78
+ */
79
+ createChild(component: DextoLogComponent): Logger;
80
+ /**
81
+ * Create a child logger that only logs to file (no console).
82
+ * Useful for sub-agents where console output should be suppressed.
83
+ * @param component Component identifier for the child logger
84
+ * @returns New logger instance with file-only transports
85
+ */
86
+ createFileOnlyChild(component: DextoLogComponent): Logger;
74
87
  /**
75
88
  * Log info message
76
89
  * @param message Log message
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/logger/v2/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAErE;;;GAGG;AACH,oBAAY,iBAAiB;IAEzB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,QAAQ,aAAa;IAGrB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,SAAS,cAAc;IACvB,QAAQ,aAAa;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,QA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M,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAEtE;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAElD;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEhC;;;OAGG;IACH,QAAQ,IAAI,QAAQ,CAAC;IAErB;;;OAGG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC,CAAC"}
@@ -28,17 +28,17 @@ export declare const StdioServerConfigSchema: z.ZodObject<{
28
28
  }, "strict", z.ZodTypeAny, {
29
29
  timeout: number;
30
30
  type: "stdio";
31
- enabled: boolean;
32
- command: string;
33
31
  args: string[];
32
+ command: string;
33
+ enabled: boolean;
34
34
  env: Record<string, string>;
35
35
  connectionMode: "strict" | "lenient";
36
36
  }, {
37
37
  type: "stdio";
38
38
  command: string;
39
39
  timeout?: number | undefined;
40
- enabled?: boolean | undefined;
41
40
  args?: string[] | undefined;
41
+ enabled?: boolean | undefined;
42
42
  env?: Record<string, string> | undefined;
43
43
  connectionMode?: "strict" | "lenient" | undefined;
44
44
  }>;
@@ -103,17 +103,17 @@ export declare const McpServerConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodDiscr
103
103
  }, "strict", z.ZodTypeAny, {
104
104
  timeout: number;
105
105
  type: "stdio";
106
- enabled: boolean;
107
- command: string;
108
106
  args: string[];
107
+ command: string;
108
+ enabled: boolean;
109
109
  env: Record<string, string>;
110
110
  connectionMode: "strict" | "lenient";
111
111
  }, {
112
112
  type: "stdio";
113
113
  command: string;
114
114
  timeout?: number | undefined;
115
- enabled?: boolean | undefined;
116
115
  args?: string[] | undefined;
116
+ enabled?: boolean | undefined;
117
117
  env?: Record<string, string> | undefined;
118
118
  connectionMode?: "strict" | "lenient" | undefined;
119
119
  }>, z.ZodObject<{
@@ -161,9 +161,9 @@ export declare const McpServerConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodDiscr
161
161
  }>]>, {
162
162
  timeout: number;
163
163
  type: "stdio";
164
- enabled: boolean;
165
- command: string;
166
164
  args: string[];
165
+ command: string;
166
+ enabled: boolean;
167
167
  env: Record<string, string>;
168
168
  connectionMode: "strict" | "lenient";
169
169
  } | {
@@ -184,8 +184,8 @@ export declare const McpServerConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodDiscr
184
184
  type: "stdio";
185
185
  command: string;
186
186
  timeout?: number | undefined;
187
- enabled?: boolean | undefined;
188
187
  args?: string[] | undefined;
188
+ enabled?: boolean | undefined;
189
189
  env?: Record<string, string> | undefined;
190
190
  connectionMode?: "strict" | "lenient" | undefined;
191
191
  } | {
@@ -216,17 +216,17 @@ export declare const ServersConfigSchema: z.ZodBranded<z.ZodRecord<z.ZodString,
216
216
  }, "strict", z.ZodTypeAny, {
217
217
  timeout: number;
218
218
  type: "stdio";
219
- enabled: boolean;
220
- command: string;
221
219
  args: string[];
220
+ command: string;
221
+ enabled: boolean;
222
222
  env: Record<string, string>;
223
223
  connectionMode: "strict" | "lenient";
224
224
  }, {
225
225
  type: "stdio";
226
226
  command: string;
227
227
  timeout?: number | undefined;
228
- enabled?: boolean | undefined;
229
228
  args?: string[] | undefined;
229
+ enabled?: boolean | undefined;
230
230
  env?: Record<string, string> | undefined;
231
231
  connectionMode?: "strict" | "lenient" | undefined;
232
232
  }>, z.ZodObject<{
@@ -274,9 +274,9 @@ export declare const ServersConfigSchema: z.ZodBranded<z.ZodRecord<z.ZodString,
274
274
  }>]>, {
275
275
  timeout: number;
276
276
  type: "stdio";
277
- enabled: boolean;
278
- command: string;
279
277
  args: string[];
278
+ command: string;
279
+ enabled: boolean;
280
280
  env: Record<string, string>;
281
281
  connectionMode: "strict" | "lenient";
282
282
  } | {
@@ -297,8 +297,8 @@ export declare const ServersConfigSchema: z.ZodBranded<z.ZodRecord<z.ZodString,
297
297
  type: "stdio";
298
298
  command: string;
299
299
  timeout?: number | undefined;
300
- enabled?: boolean | undefined;
301
300
  args?: string[] | undefined;
301
+ enabled?: boolean | undefined;
302
302
  env?: Record<string, string> | undefined;
303
303
  connectionMode?: "strict" | "lenient" | undefined;
304
304
  } | {
@@ -28,8 +28,8 @@ export declare const MemorySchema: z.ZodObject<{
28
28
  }, z.ZodTypeAny, "passthrough">>>;
29
29
  }, "strict", z.ZodTypeAny, {
30
30
  content: string;
31
- id: string;
32
31
  createdAt: number;
32
+ id: string;
33
33
  updatedAt: number;
34
34
  metadata?: z.objectOutputType<{
35
35
  source: z.ZodOptional<z.ZodEnum<["user", "system"]>>;
@@ -38,8 +38,8 @@ export declare const MemorySchema: z.ZodObject<{
38
38
  tags?: string[] | undefined;
39
39
  }, {
40
40
  content: string;
41
- id: string;
42
41
  createdAt: number;
42
+ id: string;
43
43
  updatedAt: number;
44
44
  metadata?: z.objectInputType<{
45
45
  source: z.ZodOptional<z.ZodEnum<["user", "system"]>>;
@@ -89,18 +89,18 @@ export declare const UpdateMemoryInputSchema: z.ZodObject<{
89
89
  pinned: z.ZodOptional<z.ZodBoolean>;
90
90
  }, z.ZodTypeAny, "passthrough">>>;
91
91
  }, "strict", z.ZodTypeAny, {
92
- content?: string | undefined;
93
92
  metadata?: z.objectOutputType<{
94
93
  source: z.ZodOptional<z.ZodEnum<["user", "system"]>>;
95
94
  pinned: z.ZodOptional<z.ZodBoolean>;
96
95
  }, z.ZodTypeAny, "passthrough"> | undefined;
96
+ content?: string | undefined;
97
97
  tags?: string[] | undefined;
98
98
  }, {
99
- content?: string | undefined;
100
99
  metadata?: z.objectInputType<{
101
100
  source: z.ZodOptional<z.ZodEnum<["user", "system"]>>;
102
101
  pinned: z.ZodOptional<z.ZodBoolean>;
103
102
  }, z.ZodTypeAny, "passthrough"> | undefined;
103
+ content?: string | undefined;
104
104
  tags?: string[] | undefined;
105
105
  }>;
106
106
  export declare const ListMemoriesOptionsSchema: z.ZodObject<{
@@ -38,8 +38,8 @@ export declare const InlinePromptSchema: z.ZodObject<{
38
38
  'disable-model-invocation': boolean;
39
39
  'user-invocable': boolean;
40
40
  agent?: string | undefined;
41
- model?: string | undefined;
42
41
  title?: string | undefined;
42
+ model?: string | undefined;
43
43
  'allowed-tools'?: string[] | undefined;
44
44
  }, {
45
45
  prompt: string;
@@ -48,9 +48,9 @@ export declare const InlinePromptSchema: z.ZodObject<{
48
48
  agent?: string | undefined;
49
49
  context?: "inline" | "fork" | undefined;
50
50
  description?: string | undefined;
51
+ title?: string | undefined;
51
52
  model?: string | undefined;
52
53
  priority?: number | undefined;
53
- title?: string | undefined;
54
54
  category?: string | undefined;
55
55
  showInStarters?: boolean | undefined;
56
56
  'disable-model-invocation'?: boolean | undefined;
@@ -125,8 +125,8 @@ export declare const PromptsSchema: z.ZodDefault<z.ZodEffects<z.ZodEffects<z.Zod
125
125
  'disable-model-invocation': boolean;
126
126
  'user-invocable': boolean;
127
127
  agent?: string | undefined;
128
- model?: string | undefined;
129
128
  title?: string | undefined;
129
+ model?: string | undefined;
130
130
  'allowed-tools'?: string[] | undefined;
131
131
  }, {
132
132
  prompt: string;
@@ -135,9 +135,9 @@ export declare const PromptsSchema: z.ZodDefault<z.ZodEffects<z.ZodEffects<z.Zod
135
135
  agent?: string | undefined;
136
136
  context?: "inline" | "fork" | undefined;
137
137
  description?: string | undefined;
138
+ title?: string | undefined;
138
139
  model?: string | undefined;
139
140
  priority?: number | undefined;
140
- title?: string | undefined;
141
141
  category?: string | undefined;
142
142
  showInStarters?: boolean | undefined;
143
143
  'disable-model-invocation'?: boolean | undefined;
@@ -188,8 +188,8 @@ export declare const PromptsSchema: z.ZodDefault<z.ZodEffects<z.ZodEffects<z.Zod
188
188
  'disable-model-invocation': boolean;
189
189
  'user-invocable': boolean;
190
190
  agent?: string | undefined;
191
- model?: string | undefined;
192
191
  title?: string | undefined;
192
+ model?: string | undefined;
193
193
  'allowed-tools'?: string[] | undefined;
194
194
  } | {
195
195
  file: string;
@@ -209,9 +209,9 @@ export declare const PromptsSchema: z.ZodDefault<z.ZodEffects<z.ZodEffects<z.Zod
209
209
  agent?: string | undefined;
210
210
  context?: "inline" | "fork" | undefined;
211
211
  description?: string | undefined;
212
+ title?: string | undefined;
212
213
  model?: string | undefined;
213
214
  priority?: number | undefined;
214
- title?: string | undefined;
215
215
  category?: string | undefined;
216
216
  showInStarters?: boolean | undefined;
217
217
  'disable-model-invocation'?: boolean | undefined;
@@ -261,9 +261,9 @@ export declare const PromptsSchema: z.ZodDefault<z.ZodEffects<z.ZodEffects<z.Zod
261
261
  agent?: string | undefined;
262
262
  context?: "inline" | "fork" | undefined;
263
263
  description?: string | undefined;
264
+ title?: string | undefined;
264
265
  model?: string | undefined;
265
266
  priority?: number | undefined;
266
- title?: string | undefined;
267
267
  category?: string | undefined;
268
268
  showInStarters?: boolean | undefined;
269
269
  'disable-model-invocation'?: boolean | undefined;
@@ -37,7 +37,7 @@ async function getCurrentDate(_context) {
37
37
  const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
38
38
  return `<date>Current date: ${date}</date>`;
39
39
  }
40
- async function getEnvironmentInfo(_context) {
40
+ async function getEnvironmentInfo(context) {
41
41
  if (typeof process === "undefined" || !process.cwd) {
42
42
  return "<environment>Environment info not available in browser context</environment>";
43
43
  }
@@ -47,10 +47,10 @@ async function getEnvironmentInfo(_context) {
47
47
  import("os"),
48
48
  import("path")
49
49
  ]);
50
- const cwd = process.cwd();
51
- const os = platform();
52
- const isGitRepo = existsSync(join(cwd, ".git"));
53
- const shell = process.env.SHELL || (os === "win32" ? "cmd.exe" : "/bin/sh");
50
+ const cwd = context.environment?.cwd || context.workspace?.path || process.cwd();
51
+ const os = context.environment?.platform || platform();
52
+ const isGitRepo = context.environment?.isGitRepo ?? existsSync(join(cwd, ".git"));
53
+ const shell = context.environment?.shell || process.env.SHELL || (os === "win32" ? "cmd.exe" : "/bin/sh");
54
54
  return `<environment>
55
55
  <cwd>${cwd}</cwd>
56
56
  <platform>${os}</platform>
@@ -29,6 +29,6 @@ export declare function getCurrentDate(_context: DynamicContributorContext): Pro
29
29
  * Note: This function uses dynamic imports for Node.js modules to maintain browser compatibility.
30
30
  * In browser environments, it returns a placeholder message.
31
31
  */
32
- export declare function getEnvironmentInfo(_context: DynamicContributorContext): Promise<string>;
32
+ export declare function getEnvironmentInfo(context: DynamicContributorContext): Promise<string>;
33
33
  export declare function getResourceData(context: DynamicContributorContext): Promise<string>;
34
34
  //# sourceMappingURL=in-built-prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"in-built-prompts.d.ts","sourceRoot":"","sources":["../../src/systemPrompt/in-built-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAGzF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4B7F;AAGD,wBAAsB,eAAe,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiCzF"}
1
+ {"version":3,"file":"in-built-prompts.d.ts","sourceRoot":"","sources":["../../src/systemPrompt/in-built-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAGzF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+B5F;AAGD,wBAAsB,eAAe,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiCzF"}
@@ -3,7 +3,7 @@ async function getCurrentDate(_context) {
3
3
  const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
4
4
  return `<date>Current date: ${date}</date>`;
5
5
  }
6
- async function getEnvironmentInfo(_context) {
6
+ async function getEnvironmentInfo(context) {
7
7
  if (typeof process === "undefined" || !process.cwd) {
8
8
  return "<environment>Environment info not available in browser context</environment>";
9
9
  }
@@ -13,10 +13,10 @@ async function getEnvironmentInfo(_context) {
13
13
  import("os"),
14
14
  import("path")
15
15
  ]);
16
- const cwd = process.cwd();
17
- const os = platform();
18
- const isGitRepo = existsSync(join(cwd, ".git"));
19
- const shell = process.env.SHELL || (os === "win32" ? "cmd.exe" : "/bin/sh");
16
+ const cwd = context.environment?.cwd || context.workspace?.path || process.cwd();
17
+ const os = context.environment?.platform || platform();
18
+ const isGitRepo = context.environment?.isGitRepo ?? existsSync(join(cwd, ".git"));
19
+ const shell = context.environment?.shell || process.env.SHELL || (os === "win32" ? "cmd.exe" : "/bin/sh");
20
20
  return `<environment>
21
21
  <cwd>${cwd}</cwd>
22
22
  <platform>${os}</platform>