@roo-code/types 1.11.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.js DELETED
@@ -1,936 +0,0 @@
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
-
20
- // src/exports/interface.ts
21
- var interface_exports = {};
22
- __export(interface_exports, {
23
- IpcMessageType: () => IpcMessageType,
24
- IpcOrigin: () => IpcOrigin,
25
- RooCodeEventName: () => RooCodeEventName,
26
- TelemetryEventName: () => TelemetryEventName,
27
- providerNames: () => providerNames,
28
- rooCodeTelemetryEventSchema: () => rooCodeTelemetryEventSchema
29
- });
30
- module.exports = __toCommonJS(interface_exports);
31
-
32
- // src/schemas/index.ts
33
- var import_zod = require("zod");
34
- var providerNames = [
35
- "anthropic",
36
- "glama",
37
- "openrouter",
38
- "bedrock",
39
- "vertex",
40
- "openai",
41
- "ollama",
42
- "vscode-lm",
43
- "lmstudio",
44
- "gemini",
45
- "openai-native",
46
- "mistral",
47
- "deepseek",
48
- "unbound",
49
- "requesty",
50
- "human-relay",
51
- "fake-ai",
52
- "xai",
53
- "groq",
54
- "chutes",
55
- "litellm"
56
- ];
57
- var providerNamesSchema = import_zod.z.enum(providerNames);
58
- var toolGroups = ["read", "edit", "browser", "command", "mcp", "modes"];
59
- var toolGroupsSchema = import_zod.z.enum(toolGroups);
60
- var languages = [
61
- "ca",
62
- "de",
63
- "en",
64
- "es",
65
- "fr",
66
- "hi",
67
- "it",
68
- "ja",
69
- "ko",
70
- "nl",
71
- "pl",
72
- "pt-BR",
73
- "ru",
74
- "tr",
75
- "vi",
76
- "zh-CN",
77
- "zh-TW"
78
- ];
79
- var languagesSchema = import_zod.z.enum(languages);
80
- var telemetrySettings = ["unset", "enabled", "disabled"];
81
- var telemetrySettingsSchema = import_zod.z.enum(telemetrySettings);
82
- var reasoningEfforts = ["low", "medium", "high"];
83
- var reasoningEffortsSchema = import_zod.z.enum(reasoningEfforts);
84
- var modelInfoSchema = import_zod.z.object({
85
- maxTokens: import_zod.z.number().nullish(),
86
- maxThinkingTokens: import_zod.z.number().nullish(),
87
- contextWindow: import_zod.z.number(),
88
- supportsImages: import_zod.z.boolean().optional(),
89
- supportsComputerUse: import_zod.z.boolean().optional(),
90
- supportsPromptCache: import_zod.z.boolean(),
91
- inputPrice: import_zod.z.number().optional(),
92
- outputPrice: import_zod.z.number().optional(),
93
- cacheWritesPrice: import_zod.z.number().optional(),
94
- cacheReadsPrice: import_zod.z.number().optional(),
95
- description: import_zod.z.string().optional(),
96
- reasoningEffort: reasoningEffortsSchema.optional(),
97
- thinking: import_zod.z.boolean().optional(),
98
- minTokensPerCachePoint: import_zod.z.number().optional(),
99
- maxCachePoints: import_zod.z.number().optional(),
100
- cachableFields: import_zod.z.array(import_zod.z.string()).optional(),
101
- tiers: import_zod.z.array(
102
- import_zod.z.object({
103
- contextWindow: import_zod.z.number(),
104
- inputPrice: import_zod.z.number().optional(),
105
- outputPrice: import_zod.z.number().optional(),
106
- cacheWritesPrice: import_zod.z.number().optional(),
107
- cacheReadsPrice: import_zod.z.number().optional()
108
- })
109
- ).optional()
110
- });
111
- var historyItemSchema = import_zod.z.object({
112
- id: import_zod.z.string(),
113
- number: import_zod.z.number(),
114
- ts: import_zod.z.number(),
115
- task: import_zod.z.string(),
116
- tokensIn: import_zod.z.number(),
117
- tokensOut: import_zod.z.number(),
118
- cacheWrites: import_zod.z.number().optional(),
119
- cacheReads: import_zod.z.number().optional(),
120
- totalCost: import_zod.z.number(),
121
- size: import_zod.z.number().optional(),
122
- workspace: import_zod.z.string().optional()
123
- });
124
- var groupOptionsSchema = import_zod.z.object({
125
- fileRegex: import_zod.z.string().optional().refine(
126
- (pattern) => {
127
- if (!pattern) {
128
- return true;
129
- }
130
- try {
131
- new RegExp(pattern);
132
- return true;
133
- } catch {
134
- return false;
135
- }
136
- },
137
- { message: "Invalid regular expression pattern" }
138
- ),
139
- description: import_zod.z.string().optional()
140
- });
141
- var groupEntrySchema = import_zod.z.union([toolGroupsSchema, import_zod.z.tuple([toolGroupsSchema, groupOptionsSchema])]);
142
- var groupEntryArraySchema = import_zod.z.array(groupEntrySchema).refine(
143
- (groups) => {
144
- const seen = /* @__PURE__ */ new Set();
145
- return groups.every((group) => {
146
- const groupName = Array.isArray(group) ? group[0] : group;
147
- if (seen.has(groupName)) {
148
- return false;
149
- }
150
- seen.add(groupName);
151
- return true;
152
- });
153
- },
154
- { message: "Duplicate groups are not allowed" }
155
- );
156
- var modeConfigSchema = import_zod.z.object({
157
- slug: import_zod.z.string().regex(/^[a-zA-Z0-9-]+$/, "Slug must contain only letters numbers and dashes"),
158
- name: import_zod.z.string().min(1, "Name is required"),
159
- roleDefinition: import_zod.z.string().min(1, "Role definition is required"),
160
- whenToUse: import_zod.z.string().optional(),
161
- customInstructions: import_zod.z.string().optional(),
162
- groups: groupEntryArraySchema,
163
- source: import_zod.z.enum(["global", "project"]).optional()
164
- });
165
- var customModesSettingsSchema = import_zod.z.object({
166
- customModes: import_zod.z.array(modeConfigSchema).refine(
167
- (modes) => {
168
- const slugs = /* @__PURE__ */ new Set();
169
- return modes.every((mode) => {
170
- if (slugs.has(mode.slug)) {
171
- return false;
172
- }
173
- slugs.add(mode.slug);
174
- return true;
175
- });
176
- },
177
- {
178
- message: "Duplicate mode slugs are not allowed"
179
- }
180
- )
181
- });
182
- var promptComponentSchema = import_zod.z.object({
183
- roleDefinition: import_zod.z.string().optional(),
184
- whenToUse: import_zod.z.string().optional(),
185
- customInstructions: import_zod.z.string().optional()
186
- });
187
- var customModePromptsSchema = import_zod.z.record(import_zod.z.string(), promptComponentSchema.optional());
188
- var customSupportPromptsSchema = import_zod.z.record(import_zod.z.string(), import_zod.z.string().optional());
189
- var commandExecutionStatusSchema = import_zod.z.discriminatedUnion("status", [
190
- import_zod.z.object({
191
- executionId: import_zod.z.string(),
192
- status: import_zod.z.literal("started"),
193
- pid: import_zod.z.number().optional(),
194
- command: import_zod.z.string()
195
- }),
196
- import_zod.z.object({
197
- executionId: import_zod.z.string(),
198
- status: import_zod.z.literal("output"),
199
- output: import_zod.z.string()
200
- }),
201
- import_zod.z.object({
202
- executionId: import_zod.z.string(),
203
- status: import_zod.z.literal("exited"),
204
- exitCode: import_zod.z.number().optional()
205
- }),
206
- import_zod.z.object({
207
- executionId: import_zod.z.string(),
208
- status: import_zod.z.literal("fallback")
209
- })
210
- ]);
211
- var experimentIds = ["autoCondenseContext", "powerSteering"];
212
- var experimentIdsSchema = import_zod.z.enum(experimentIds);
213
- var experimentsSchema = import_zod.z.object({
214
- autoCondenseContext: import_zod.z.boolean(),
215
- powerSteering: import_zod.z.boolean()
216
- });
217
- var providerSettingsEntrySchema = import_zod.z.object({
218
- id: import_zod.z.string(),
219
- name: import_zod.z.string(),
220
- apiProvider: providerNamesSchema.optional()
221
- });
222
- var baseProviderSettingsSchema = import_zod.z.object({
223
- includeMaxTokens: import_zod.z.boolean().optional(),
224
- reasoningEffort: reasoningEffortsSchema.optional(),
225
- diffEnabled: import_zod.z.boolean().optional(),
226
- fuzzyMatchThreshold: import_zod.z.number().optional(),
227
- modelTemperature: import_zod.z.number().nullish(),
228
- rateLimitSeconds: import_zod.z.number().optional(),
229
- // Claude 3.7 Sonnet Thinking
230
- modelMaxTokens: import_zod.z.number().optional(),
231
- modelMaxThinkingTokens: import_zod.z.number().optional()
232
- });
233
- var apiModelIdProviderModelSchema = baseProviderSettingsSchema.extend({
234
- apiModelId: import_zod.z.string().optional()
235
- });
236
- var anthropicSchema = apiModelIdProviderModelSchema.extend({
237
- apiKey: import_zod.z.string().optional(),
238
- anthropicBaseUrl: import_zod.z.string().optional(),
239
- anthropicUseAuthToken: import_zod.z.boolean().optional()
240
- });
241
- var glamaSchema = baseProviderSettingsSchema.extend({
242
- glamaModelId: import_zod.z.string().optional(),
243
- glamaApiKey: import_zod.z.string().optional()
244
- });
245
- var openRouterSchema = baseProviderSettingsSchema.extend({
246
- openRouterApiKey: import_zod.z.string().optional(),
247
- openRouterModelId: import_zod.z.string().optional(),
248
- openRouterBaseUrl: import_zod.z.string().optional(),
249
- openRouterSpecificProvider: import_zod.z.string().optional(),
250
- openRouterUseMiddleOutTransform: import_zod.z.boolean().optional()
251
- });
252
- var bedrockSchema = apiModelIdProviderModelSchema.extend({
253
- awsAccessKey: import_zod.z.string().optional(),
254
- awsSecretKey: import_zod.z.string().optional(),
255
- awsSessionToken: import_zod.z.string().optional(),
256
- awsRegion: import_zod.z.string().optional(),
257
- awsUseCrossRegionInference: import_zod.z.boolean().optional(),
258
- awsUsePromptCache: import_zod.z.boolean().optional(),
259
- awsProfile: import_zod.z.string().optional(),
260
- awsUseProfile: import_zod.z.boolean().optional(),
261
- awsCustomArn: import_zod.z.string().optional()
262
- });
263
- var vertexSchema = apiModelIdProviderModelSchema.extend({
264
- vertexKeyFile: import_zod.z.string().optional(),
265
- vertexJsonCredentials: import_zod.z.string().optional(),
266
- vertexProjectId: import_zod.z.string().optional(),
267
- vertexRegion: import_zod.z.string().optional()
268
- });
269
- var openAiSchema = baseProviderSettingsSchema.extend({
270
- openAiBaseUrl: import_zod.z.string().optional(),
271
- openAiApiKey: import_zod.z.string().optional(),
272
- openAiLegacyFormat: import_zod.z.boolean().optional(),
273
- openAiR1FormatEnabled: import_zod.z.boolean().optional(),
274
- openAiModelId: import_zod.z.string().optional(),
275
- openAiCustomModelInfo: modelInfoSchema.nullish(),
276
- openAiUseAzure: import_zod.z.boolean().optional(),
277
- azureApiVersion: import_zod.z.string().optional(),
278
- openAiStreamingEnabled: import_zod.z.boolean().optional(),
279
- enableReasoningEffort: import_zod.z.boolean().optional(),
280
- openAiHostHeader: import_zod.z.string().optional(),
281
- // Keep temporarily for backward compatibility during migration.
282
- openAiHeaders: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).optional()
283
- });
284
- var ollamaSchema = baseProviderSettingsSchema.extend({
285
- ollamaModelId: import_zod.z.string().optional(),
286
- ollamaBaseUrl: import_zod.z.string().optional()
287
- });
288
- var vsCodeLmSchema = baseProviderSettingsSchema.extend({
289
- vsCodeLmModelSelector: import_zod.z.object({
290
- vendor: import_zod.z.string().optional(),
291
- family: import_zod.z.string().optional(),
292
- version: import_zod.z.string().optional(),
293
- id: import_zod.z.string().optional()
294
- }).optional()
295
- });
296
- var lmStudioSchema = baseProviderSettingsSchema.extend({
297
- lmStudioModelId: import_zod.z.string().optional(),
298
- lmStudioBaseUrl: import_zod.z.string().optional(),
299
- lmStudioDraftModelId: import_zod.z.string().optional(),
300
- lmStudioSpeculativeDecodingEnabled: import_zod.z.boolean().optional()
301
- });
302
- var geminiSchema = apiModelIdProviderModelSchema.extend({
303
- geminiApiKey: import_zod.z.string().optional(),
304
- googleGeminiBaseUrl: import_zod.z.string().optional()
305
- });
306
- var openAiNativeSchema = apiModelIdProviderModelSchema.extend({
307
- openAiNativeApiKey: import_zod.z.string().optional(),
308
- openAiNativeBaseUrl: import_zod.z.string().optional()
309
- });
310
- var mistralSchema = apiModelIdProviderModelSchema.extend({
311
- mistralApiKey: import_zod.z.string().optional(),
312
- mistralCodestralUrl: import_zod.z.string().optional()
313
- });
314
- var deepSeekSchema = apiModelIdProviderModelSchema.extend({
315
- deepSeekBaseUrl: import_zod.z.string().optional(),
316
- deepSeekApiKey: import_zod.z.string().optional()
317
- });
318
- var unboundSchema = baseProviderSettingsSchema.extend({
319
- unboundApiKey: import_zod.z.string().optional(),
320
- unboundModelId: import_zod.z.string().optional()
321
- });
322
- var requestySchema = baseProviderSettingsSchema.extend({
323
- requestyApiKey: import_zod.z.string().optional(),
324
- requestyModelId: import_zod.z.string().optional()
325
- });
326
- var humanRelaySchema = baseProviderSettingsSchema;
327
- var fakeAiSchema = baseProviderSettingsSchema.extend({
328
- fakeAi: import_zod.z.unknown().optional()
329
- });
330
- var xaiSchema = apiModelIdProviderModelSchema.extend({
331
- xaiApiKey: import_zod.z.string().optional()
332
- });
333
- var groqSchema = apiModelIdProviderModelSchema.extend({
334
- groqApiKey: import_zod.z.string().optional()
335
- });
336
- var chutesSchema = apiModelIdProviderModelSchema.extend({
337
- chutesApiKey: import_zod.z.string().optional()
338
- });
339
- var litellmSchema = baseProviderSettingsSchema.extend({
340
- litellmBaseUrl: import_zod.z.string().optional(),
341
- litellmApiKey: import_zod.z.string().optional(),
342
- litellmModelId: import_zod.z.string().optional()
343
- });
344
- var defaultSchema = import_zod.z.object({
345
- apiProvider: import_zod.z.undefined()
346
- });
347
- var providerSettingsSchemaDiscriminated = import_zod.z.discriminatedUnion("apiProvider", [
348
- anthropicSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("anthropic") })),
349
- glamaSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("glama") })),
350
- openRouterSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("openrouter") })),
351
- bedrockSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("bedrock") })),
352
- vertexSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("vertex") })),
353
- openAiSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("openai") })),
354
- ollamaSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("ollama") })),
355
- vsCodeLmSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("vscode-lm") })),
356
- lmStudioSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("lmstudio") })),
357
- geminiSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("gemini") })),
358
- openAiNativeSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("openai-native") })),
359
- mistralSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("mistral") })),
360
- deepSeekSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("deepseek") })),
361
- unboundSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("unbound") })),
362
- requestySchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("requesty") })),
363
- humanRelaySchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("human-relay") })),
364
- fakeAiSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("fake-ai") })),
365
- xaiSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("xai") })),
366
- groqSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("groq") })),
367
- chutesSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("chutes") })),
368
- litellmSchema.merge(import_zod.z.object({ apiProvider: import_zod.z.literal("litellm") })),
369
- defaultSchema
370
- ]);
371
- var providerSettingsSchema = import_zod.z.object({
372
- apiProvider: providerNamesSchema.optional()
373
- }).merge(anthropicSchema).merge(glamaSchema).merge(openRouterSchema).merge(bedrockSchema).merge(vertexSchema).merge(openAiSchema).merge(ollamaSchema).merge(vsCodeLmSchema).merge(lmStudioSchema).merge(geminiSchema).merge(openAiNativeSchema).merge(mistralSchema).merge(deepSeekSchema).merge(unboundSchema).merge(requestySchema).merge(humanRelaySchema).merge(fakeAiSchema).merge(xaiSchema).merge(groqSchema).merge(chutesSchema).merge(litellmSchema);
374
- var providerSettingsRecord = {
375
- apiProvider: void 0,
376
- // Anthropic
377
- apiModelId: void 0,
378
- apiKey: void 0,
379
- anthropicBaseUrl: void 0,
380
- anthropicUseAuthToken: void 0,
381
- // Glama
382
- glamaModelId: void 0,
383
- glamaApiKey: void 0,
384
- // OpenRouter
385
- openRouterApiKey: void 0,
386
- openRouterModelId: void 0,
387
- openRouterBaseUrl: void 0,
388
- openRouterSpecificProvider: void 0,
389
- openRouterUseMiddleOutTransform: void 0,
390
- // Amazon Bedrock
391
- awsAccessKey: void 0,
392
- awsSecretKey: void 0,
393
- awsSessionToken: void 0,
394
- awsRegion: void 0,
395
- awsUseCrossRegionInference: void 0,
396
- awsUsePromptCache: void 0,
397
- awsProfile: void 0,
398
- awsUseProfile: void 0,
399
- awsCustomArn: void 0,
400
- // Google Vertex
401
- vertexKeyFile: void 0,
402
- vertexJsonCredentials: void 0,
403
- vertexProjectId: void 0,
404
- vertexRegion: void 0,
405
- // OpenAI
406
- openAiBaseUrl: void 0,
407
- openAiApiKey: void 0,
408
- openAiLegacyFormat: void 0,
409
- openAiR1FormatEnabled: void 0,
410
- openAiModelId: void 0,
411
- openAiCustomModelInfo: void 0,
412
- openAiUseAzure: void 0,
413
- azureApiVersion: void 0,
414
- openAiStreamingEnabled: void 0,
415
- enableReasoningEffort: void 0,
416
- openAiHostHeader: void 0,
417
- // Keep temporarily for backward compatibility during migration
418
- openAiHeaders: void 0,
419
- // Ollama
420
- ollamaModelId: void 0,
421
- ollamaBaseUrl: void 0,
422
- // VS Code LM
423
- vsCodeLmModelSelector: void 0,
424
- lmStudioModelId: void 0,
425
- lmStudioBaseUrl: void 0,
426
- lmStudioDraftModelId: void 0,
427
- lmStudioSpeculativeDecodingEnabled: void 0,
428
- // Gemini
429
- geminiApiKey: void 0,
430
- googleGeminiBaseUrl: void 0,
431
- // OpenAI Native
432
- openAiNativeApiKey: void 0,
433
- openAiNativeBaseUrl: void 0,
434
- // Mistral
435
- mistralApiKey: void 0,
436
- mistralCodestralUrl: void 0,
437
- // DeepSeek
438
- deepSeekBaseUrl: void 0,
439
- deepSeekApiKey: void 0,
440
- // Unbound
441
- unboundApiKey: void 0,
442
- unboundModelId: void 0,
443
- // Requesty
444
- requestyApiKey: void 0,
445
- requestyModelId: void 0,
446
- // Claude 3.7 Sonnet Thinking
447
- modelMaxTokens: void 0,
448
- modelMaxThinkingTokens: void 0,
449
- // Generic
450
- includeMaxTokens: void 0,
451
- reasoningEffort: void 0,
452
- diffEnabled: void 0,
453
- fuzzyMatchThreshold: void 0,
454
- modelTemperature: void 0,
455
- rateLimitSeconds: void 0,
456
- // Fake AI
457
- fakeAi: void 0,
458
- // X.AI (Grok)
459
- xaiApiKey: void 0,
460
- // Groq
461
- groqApiKey: void 0,
462
- // Chutes AI
463
- chutesApiKey: void 0,
464
- // LiteLLM
465
- litellmBaseUrl: void 0,
466
- litellmApiKey: void 0,
467
- litellmModelId: void 0
468
- };
469
- var PROVIDER_SETTINGS_KEYS = Object.keys(providerSettingsRecord);
470
- var globalSettingsSchema = import_zod.z.object({
471
- currentApiConfigName: import_zod.z.string().optional(),
472
- listApiConfigMeta: import_zod.z.array(providerSettingsEntrySchema).optional(),
473
- pinnedApiConfigs: import_zod.z.record(import_zod.z.string(), import_zod.z.boolean()).optional(),
474
- lastShownAnnouncementId: import_zod.z.string().optional(),
475
- customInstructions: import_zod.z.string().optional(),
476
- taskHistory: import_zod.z.array(historyItemSchema).optional(),
477
- autoApprovalEnabled: import_zod.z.boolean().optional(),
478
- alwaysAllowReadOnly: import_zod.z.boolean().optional(),
479
- alwaysAllowReadOnlyOutsideWorkspace: import_zod.z.boolean().optional(),
480
- alwaysAllowWrite: import_zod.z.boolean().optional(),
481
- alwaysAllowWriteOutsideWorkspace: import_zod.z.boolean().optional(),
482
- writeDelayMs: import_zod.z.number().optional(),
483
- alwaysAllowBrowser: import_zod.z.boolean().optional(),
484
- alwaysApproveResubmit: import_zod.z.boolean().optional(),
485
- requestDelaySeconds: import_zod.z.number().optional(),
486
- alwaysAllowMcp: import_zod.z.boolean().optional(),
487
- alwaysAllowModeSwitch: import_zod.z.boolean().optional(),
488
- alwaysAllowSubtasks: import_zod.z.boolean().optional(),
489
- alwaysAllowExecute: import_zod.z.boolean().optional(),
490
- allowedCommands: import_zod.z.array(import_zod.z.string()).optional(),
491
- browserToolEnabled: import_zod.z.boolean().optional(),
492
- browserViewportSize: import_zod.z.string().optional(),
493
- screenshotQuality: import_zod.z.number().optional(),
494
- remoteBrowserEnabled: import_zod.z.boolean().optional(),
495
- remoteBrowserHost: import_zod.z.string().optional(),
496
- cachedChromeHostUrl: import_zod.z.string().optional(),
497
- enableCheckpoints: import_zod.z.boolean().optional(),
498
- ttsEnabled: import_zod.z.boolean().optional(),
499
- ttsSpeed: import_zod.z.number().optional(),
500
- soundEnabled: import_zod.z.boolean().optional(),
501
- soundVolume: import_zod.z.number().optional(),
502
- maxOpenTabsContext: import_zod.z.number().optional(),
503
- maxWorkspaceFiles: import_zod.z.number().optional(),
504
- showRooIgnoredFiles: import_zod.z.boolean().optional(),
505
- maxReadFileLine: import_zod.z.number().optional(),
506
- terminalOutputLineLimit: import_zod.z.number().optional(),
507
- terminalShellIntegrationTimeout: import_zod.z.number().optional(),
508
- terminalShellIntegrationDisabled: import_zod.z.boolean().optional(),
509
- terminalCommandDelay: import_zod.z.number().optional(),
510
- terminalPowershellCounter: import_zod.z.boolean().optional(),
511
- terminalZshClearEolMark: import_zod.z.boolean().optional(),
512
- terminalZshOhMy: import_zod.z.boolean().optional(),
513
- terminalZshP10k: import_zod.z.boolean().optional(),
514
- terminalZdotdir: import_zod.z.boolean().optional(),
515
- terminalCompressProgressBar: import_zod.z.boolean().optional(),
516
- rateLimitSeconds: import_zod.z.number().optional(),
517
- diffEnabled: import_zod.z.boolean().optional(),
518
- fuzzyMatchThreshold: import_zod.z.number().optional(),
519
- experiments: experimentsSchema.optional(),
520
- language: languagesSchema.optional(),
521
- telemetrySetting: telemetrySettingsSchema.optional(),
522
- mcpEnabled: import_zod.z.boolean().optional(),
523
- enableMcpServerCreation: import_zod.z.boolean().optional(),
524
- mode: import_zod.z.string().optional(),
525
- modeApiConfigs: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).optional(),
526
- customModes: import_zod.z.array(modeConfigSchema).optional(),
527
- customModePrompts: customModePromptsSchema.optional(),
528
- customSupportPrompts: customSupportPromptsSchema.optional(),
529
- enhancementApiConfigId: import_zod.z.string().optional(),
530
- historyPreviewCollapsed: import_zod.z.boolean().optional()
531
- });
532
- var globalSettingsRecord = {
533
- currentApiConfigName: void 0,
534
- listApiConfigMeta: void 0,
535
- pinnedApiConfigs: void 0,
536
- lastShownAnnouncementId: void 0,
537
- customInstructions: void 0,
538
- taskHistory: void 0,
539
- autoApprovalEnabled: void 0,
540
- alwaysAllowReadOnly: void 0,
541
- alwaysAllowReadOnlyOutsideWorkspace: void 0,
542
- alwaysAllowWrite: void 0,
543
- alwaysAllowWriteOutsideWorkspace: void 0,
544
- writeDelayMs: void 0,
545
- alwaysAllowBrowser: void 0,
546
- alwaysApproveResubmit: void 0,
547
- requestDelaySeconds: void 0,
548
- alwaysAllowMcp: void 0,
549
- alwaysAllowModeSwitch: void 0,
550
- alwaysAllowSubtasks: void 0,
551
- alwaysAllowExecute: void 0,
552
- allowedCommands: void 0,
553
- browserToolEnabled: void 0,
554
- browserViewportSize: void 0,
555
- screenshotQuality: void 0,
556
- remoteBrowserEnabled: void 0,
557
- remoteBrowserHost: void 0,
558
- enableCheckpoints: void 0,
559
- ttsEnabled: void 0,
560
- ttsSpeed: void 0,
561
- soundEnabled: void 0,
562
- soundVolume: void 0,
563
- maxOpenTabsContext: void 0,
564
- maxWorkspaceFiles: void 0,
565
- showRooIgnoredFiles: void 0,
566
- maxReadFileLine: void 0,
567
- terminalOutputLineLimit: void 0,
568
- terminalShellIntegrationTimeout: void 0,
569
- terminalShellIntegrationDisabled: void 0,
570
- terminalCommandDelay: void 0,
571
- terminalPowershellCounter: void 0,
572
- terminalZshClearEolMark: void 0,
573
- terminalZshOhMy: void 0,
574
- terminalZshP10k: void 0,
575
- terminalZdotdir: void 0,
576
- terminalCompressProgressBar: void 0,
577
- rateLimitSeconds: void 0,
578
- diffEnabled: void 0,
579
- fuzzyMatchThreshold: void 0,
580
- experiments: void 0,
581
- language: void 0,
582
- telemetrySetting: void 0,
583
- mcpEnabled: void 0,
584
- enableMcpServerCreation: void 0,
585
- mode: void 0,
586
- modeApiConfigs: void 0,
587
- customModes: void 0,
588
- customModePrompts: void 0,
589
- customSupportPrompts: void 0,
590
- enhancementApiConfigId: void 0,
591
- cachedChromeHostUrl: void 0,
592
- historyPreviewCollapsed: void 0
593
- };
594
- var GLOBAL_SETTINGS_KEYS = Object.keys(globalSettingsRecord);
595
- var rooCodeSettingsSchema = providerSettingsSchema.merge(globalSettingsSchema);
596
- var secretStateRecord = {
597
- apiKey: void 0,
598
- glamaApiKey: void 0,
599
- openRouterApiKey: void 0,
600
- awsAccessKey: void 0,
601
- awsSecretKey: void 0,
602
- awsSessionToken: void 0,
603
- openAiApiKey: void 0,
604
- geminiApiKey: void 0,
605
- openAiNativeApiKey: void 0,
606
- deepSeekApiKey: void 0,
607
- mistralApiKey: void 0,
608
- unboundApiKey: void 0,
609
- requestyApiKey: void 0,
610
- xaiApiKey: void 0,
611
- groqApiKey: void 0,
612
- chutesApiKey: void 0,
613
- litellmApiKey: void 0
614
- };
615
- var SECRET_STATE_KEYS = Object.keys(secretStateRecord);
616
- var GLOBAL_STATE_KEYS = [...GLOBAL_SETTINGS_KEYS, ...PROVIDER_SETTINGS_KEYS].filter(
617
- (key) => !SECRET_STATE_KEYS.includes(key)
618
- );
619
- var clineAsks = [
620
- "followup",
621
- "command",
622
- "command_output",
623
- "completion_result",
624
- "tool",
625
- "api_req_failed",
626
- "resume_task",
627
- "resume_completed_task",
628
- "mistake_limit_reached",
629
- "browser_action_launch",
630
- "use_mcp_server"
631
- ];
632
- var clineAskSchema = import_zod.z.enum(clineAsks);
633
- var clineSays = [
634
- "error",
635
- "api_req_started",
636
- "api_req_finished",
637
- "api_req_retried",
638
- "api_req_retry_delayed",
639
- "api_req_deleted",
640
- "text",
641
- "reasoning",
642
- "completion_result",
643
- "user_feedback",
644
- "user_feedback_diff",
645
- "command_output",
646
- "shell_integration_warning",
647
- "browser_action",
648
- "browser_action_result",
649
- "mcp_server_request_started",
650
- "mcp_server_response",
651
- "subtask_result",
652
- "checkpoint_saved",
653
- "rooignore_error",
654
- "diff_error"
655
- ];
656
- var clineSaySchema = import_zod.z.enum(clineSays);
657
- var toolProgressStatusSchema = import_zod.z.object({
658
- icon: import_zod.z.string().optional(),
659
- text: import_zod.z.string().optional()
660
- });
661
- var clineMessageSchema = import_zod.z.object({
662
- ts: import_zod.z.number(),
663
- type: import_zod.z.union([import_zod.z.literal("ask"), import_zod.z.literal("say")]),
664
- ask: clineAskSchema.optional(),
665
- say: clineSaySchema.optional(),
666
- text: import_zod.z.string().optional(),
667
- images: import_zod.z.array(import_zod.z.string()).optional(),
668
- partial: import_zod.z.boolean().optional(),
669
- reasoning: import_zod.z.string().optional(),
670
- conversationHistoryIndex: import_zod.z.number().optional(),
671
- checkpoint: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional(),
672
- progressStatus: toolProgressStatusSchema.optional()
673
- });
674
- var tokenUsageSchema = import_zod.z.object({
675
- totalTokensIn: import_zod.z.number(),
676
- totalTokensOut: import_zod.z.number(),
677
- totalCacheWrites: import_zod.z.number().optional(),
678
- totalCacheReads: import_zod.z.number().optional(),
679
- totalCost: import_zod.z.number(),
680
- contextTokens: import_zod.z.number()
681
- });
682
- var toolNames = [
683
- "execute_command",
684
- "read_file",
685
- "write_to_file",
686
- "apply_diff",
687
- "insert_content",
688
- "search_and_replace",
689
- "search_files",
690
- "list_files",
691
- "list_code_definition_names",
692
- "browser_action",
693
- "use_mcp_tool",
694
- "access_mcp_resource",
695
- "ask_followup_question",
696
- "attempt_completion",
697
- "switch_mode",
698
- "new_task",
699
- "fetch_instructions"
700
- ];
701
- var toolNamesSchema = import_zod.z.enum(toolNames);
702
- var toolUsageSchema = import_zod.z.record(
703
- toolNamesSchema,
704
- import_zod.z.object({
705
- attempts: import_zod.z.number(),
706
- failures: import_zod.z.number()
707
- })
708
- );
709
- var RooCodeEventName = /* @__PURE__ */ ((RooCodeEventName2) => {
710
- RooCodeEventName2["Message"] = "message";
711
- RooCodeEventName2["TaskCreated"] = "taskCreated";
712
- RooCodeEventName2["TaskStarted"] = "taskStarted";
713
- RooCodeEventName2["TaskModeSwitched"] = "taskModeSwitched";
714
- RooCodeEventName2["TaskPaused"] = "taskPaused";
715
- RooCodeEventName2["TaskUnpaused"] = "taskUnpaused";
716
- RooCodeEventName2["TaskAskResponded"] = "taskAskResponded";
717
- RooCodeEventName2["TaskAborted"] = "taskAborted";
718
- RooCodeEventName2["TaskSpawned"] = "taskSpawned";
719
- RooCodeEventName2["TaskCompleted"] = "taskCompleted";
720
- RooCodeEventName2["TaskTokenUsageUpdated"] = "taskTokenUsageUpdated";
721
- RooCodeEventName2["TaskToolFailed"] = "taskToolFailed";
722
- return RooCodeEventName2;
723
- })(RooCodeEventName || {});
724
- var rooCodeEventsSchema = import_zod.z.object({
725
- ["message" /* Message */]: import_zod.z.tuple([
726
- import_zod.z.object({
727
- taskId: import_zod.z.string(),
728
- action: import_zod.z.union([import_zod.z.literal("created"), import_zod.z.literal("updated")]),
729
- message: clineMessageSchema
730
- })
731
- ]),
732
- ["taskCreated" /* TaskCreated */]: import_zod.z.tuple([import_zod.z.string()]),
733
- ["taskStarted" /* TaskStarted */]: import_zod.z.tuple([import_zod.z.string()]),
734
- ["taskModeSwitched" /* TaskModeSwitched */]: import_zod.z.tuple([import_zod.z.string(), import_zod.z.string()]),
735
- ["taskPaused" /* TaskPaused */]: import_zod.z.tuple([import_zod.z.string()]),
736
- ["taskUnpaused" /* TaskUnpaused */]: import_zod.z.tuple([import_zod.z.string()]),
737
- ["taskAskResponded" /* TaskAskResponded */]: import_zod.z.tuple([import_zod.z.string()]),
738
- ["taskAborted" /* TaskAborted */]: import_zod.z.tuple([import_zod.z.string()]),
739
- ["taskSpawned" /* TaskSpawned */]: import_zod.z.tuple([import_zod.z.string(), import_zod.z.string()]),
740
- ["taskCompleted" /* TaskCompleted */]: import_zod.z.tuple([import_zod.z.string(), tokenUsageSchema, toolUsageSchema]),
741
- ["taskTokenUsageUpdated" /* TaskTokenUsageUpdated */]: import_zod.z.tuple([import_zod.z.string(), tokenUsageSchema]),
742
- ["taskToolFailed" /* TaskToolFailed */]: import_zod.z.tuple([import_zod.z.string(), toolNamesSchema, import_zod.z.string()])
743
- });
744
- var ackSchema = import_zod.z.object({
745
- clientId: import_zod.z.string(),
746
- pid: import_zod.z.number(),
747
- ppid: import_zod.z.number()
748
- });
749
- var taskCommandSchema = import_zod.z.discriminatedUnion("commandName", [
750
- import_zod.z.object({
751
- commandName: import_zod.z.literal("StartNewTask" /* StartNewTask */),
752
- data: import_zod.z.object({
753
- configuration: rooCodeSettingsSchema,
754
- text: import_zod.z.string(),
755
- images: import_zod.z.array(import_zod.z.string()).optional(),
756
- newTab: import_zod.z.boolean().optional()
757
- })
758
- }),
759
- import_zod.z.object({
760
- commandName: import_zod.z.literal("CancelTask" /* CancelTask */),
761
- data: import_zod.z.string()
762
- }),
763
- import_zod.z.object({
764
- commandName: import_zod.z.literal("CloseTask" /* CloseTask */),
765
- data: import_zod.z.string()
766
- })
767
- ]);
768
- var taskEventSchema = import_zod.z.discriminatedUnion("eventName", [
769
- import_zod.z.object({
770
- eventName: import_zod.z.literal("message" /* Message */),
771
- payload: rooCodeEventsSchema.shape["message" /* Message */]
772
- }),
773
- import_zod.z.object({
774
- eventName: import_zod.z.literal("taskCreated" /* TaskCreated */),
775
- payload: rooCodeEventsSchema.shape["taskCreated" /* TaskCreated */]
776
- }),
777
- import_zod.z.object({
778
- eventName: import_zod.z.literal("taskStarted" /* TaskStarted */),
779
- payload: rooCodeEventsSchema.shape["taskStarted" /* TaskStarted */]
780
- }),
781
- import_zod.z.object({
782
- eventName: import_zod.z.literal("taskModeSwitched" /* TaskModeSwitched */),
783
- payload: rooCodeEventsSchema.shape["taskModeSwitched" /* TaskModeSwitched */]
784
- }),
785
- import_zod.z.object({
786
- eventName: import_zod.z.literal("taskPaused" /* TaskPaused */),
787
- payload: rooCodeEventsSchema.shape["taskPaused" /* TaskPaused */]
788
- }),
789
- import_zod.z.object({
790
- eventName: import_zod.z.literal("taskUnpaused" /* TaskUnpaused */),
791
- payload: rooCodeEventsSchema.shape["taskUnpaused" /* TaskUnpaused */]
792
- }),
793
- import_zod.z.object({
794
- eventName: import_zod.z.literal("taskAskResponded" /* TaskAskResponded */),
795
- payload: rooCodeEventsSchema.shape["taskAskResponded" /* TaskAskResponded */]
796
- }),
797
- import_zod.z.object({
798
- eventName: import_zod.z.literal("taskAborted" /* TaskAborted */),
799
- payload: rooCodeEventsSchema.shape["taskAborted" /* TaskAborted */]
800
- }),
801
- import_zod.z.object({
802
- eventName: import_zod.z.literal("taskSpawned" /* TaskSpawned */),
803
- payload: rooCodeEventsSchema.shape["taskSpawned" /* TaskSpawned */]
804
- }),
805
- import_zod.z.object({
806
- eventName: import_zod.z.literal("taskCompleted" /* TaskCompleted */),
807
- payload: rooCodeEventsSchema.shape["taskCompleted" /* TaskCompleted */]
808
- }),
809
- import_zod.z.object({
810
- eventName: import_zod.z.literal("taskTokenUsageUpdated" /* TaskTokenUsageUpdated */),
811
- payload: rooCodeEventsSchema.shape["taskTokenUsageUpdated" /* TaskTokenUsageUpdated */]
812
- })
813
- ]);
814
- var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
815
- IpcMessageType2["Connect"] = "Connect";
816
- IpcMessageType2["Disconnect"] = "Disconnect";
817
- IpcMessageType2["Ack"] = "Ack";
818
- IpcMessageType2["TaskCommand"] = "TaskCommand";
819
- IpcMessageType2["TaskEvent"] = "TaskEvent";
820
- return IpcMessageType2;
821
- })(IpcMessageType || {});
822
- var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
823
- IpcOrigin2["Client"] = "client";
824
- IpcOrigin2["Server"] = "server";
825
- return IpcOrigin2;
826
- })(IpcOrigin || {});
827
- var ipcMessageSchema = import_zod.z.discriminatedUnion("type", [
828
- import_zod.z.object({
829
- type: import_zod.z.literal("Ack" /* Ack */),
830
- origin: import_zod.z.literal("server" /* Server */),
831
- data: ackSchema
832
- }),
833
- import_zod.z.object({
834
- type: import_zod.z.literal("TaskCommand" /* TaskCommand */),
835
- origin: import_zod.z.literal("client" /* Client */),
836
- clientId: import_zod.z.string(),
837
- data: taskCommandSchema
838
- }),
839
- import_zod.z.object({
840
- type: import_zod.z.literal("TaskEvent" /* TaskEvent */),
841
- origin: import_zod.z.literal("server" /* Server */),
842
- relayClientId: import_zod.z.string().optional(),
843
- data: taskEventSchema
844
- })
845
- ]);
846
- var TelemetryEventName = /* @__PURE__ */ ((TelemetryEventName2) => {
847
- TelemetryEventName2["TASK_CREATED"] = "Task Created";
848
- TelemetryEventName2["TASK_RESTARTED"] = "Task Reopened";
849
- TelemetryEventName2["TASK_COMPLETED"] = "Task Completed";
850
- TelemetryEventName2["TASK_CONVERSATION_MESSAGE"] = "Conversation Message";
851
- TelemetryEventName2["LLM_COMPLETION"] = "LLM Completion";
852
- TelemetryEventName2["MODE_SWITCH"] = "Mode Switched";
853
- TelemetryEventName2["TOOL_USED"] = "Tool Used";
854
- TelemetryEventName2["CHECKPOINT_CREATED"] = "Checkpoint Created";
855
- TelemetryEventName2["CHECKPOINT_RESTORED"] = "Checkpoint Restored";
856
- TelemetryEventName2["CHECKPOINT_DIFFED"] = "Checkpoint Diffed";
857
- TelemetryEventName2["CODE_ACTION_USED"] = "Code Action Used";
858
- TelemetryEventName2["PROMPT_ENHANCED"] = "Prompt Enhanced";
859
- TelemetryEventName2["TITLE_BUTTON_CLICKED"] = "Title Button Clicked";
860
- TelemetryEventName2["AUTHENTICATION_INITIATED"] = "Authentication Initiated";
861
- TelemetryEventName2["SCHEMA_VALIDATION_ERROR"] = "Schema Validation Error";
862
- TelemetryEventName2["DIFF_APPLICATION_ERROR"] = "Diff Application Error";
863
- TelemetryEventName2["SHELL_INTEGRATION_ERROR"] = "Shell Integration Error";
864
- TelemetryEventName2["CONSECUTIVE_MISTAKE_ERROR"] = "Consecutive Mistake Error";
865
- return TelemetryEventName2;
866
- })(TelemetryEventName || {});
867
- var appPropertiesSchema = import_zod.z.object({
868
- appVersion: import_zod.z.string(),
869
- vscodeVersion: import_zod.z.string(),
870
- platform: import_zod.z.string(),
871
- editorName: import_zod.z.string(),
872
- language: import_zod.z.string(),
873
- mode: import_zod.z.string()
874
- });
875
- var taskPropertiesSchema = import_zod.z.object({
876
- taskId: import_zod.z.string().optional(),
877
- apiProvider: import_zod.z.enum(providerNames).optional(),
878
- modelId: import_zod.z.string().optional(),
879
- diffStrategy: import_zod.z.string().optional(),
880
- isSubtask: import_zod.z.boolean().optional()
881
- });
882
- var telemetryPropertiesSchema = import_zod.z.object({
883
- ...appPropertiesSchema.shape,
884
- ...taskPropertiesSchema.shape
885
- });
886
- var completionPropertiesSchema = import_zod.z.object({
887
- inputTokens: import_zod.z.number(),
888
- outputTokens: import_zod.z.number(),
889
- cacheReadTokens: import_zod.z.number().optional(),
890
- cacheWriteTokens: import_zod.z.number().optional(),
891
- cost: import_zod.z.number().optional()
892
- });
893
- var rooCodeTelemetryEventSchema = import_zod.z.discriminatedUnion("type", [
894
- import_zod.z.object({
895
- type: import_zod.z.enum([
896
- "Task Created" /* TASK_CREATED */,
897
- "Task Reopened" /* TASK_RESTARTED */,
898
- "Task Completed" /* TASK_COMPLETED */,
899
- "Conversation Message" /* TASK_CONVERSATION_MESSAGE */,
900
- "Mode Switched" /* MODE_SWITCH */,
901
- "Tool Used" /* TOOL_USED */,
902
- "Checkpoint Created" /* CHECKPOINT_CREATED */,
903
- "Checkpoint Restored" /* CHECKPOINT_RESTORED */,
904
- "Checkpoint Diffed" /* CHECKPOINT_DIFFED */,
905
- "Code Action Used" /* CODE_ACTION_USED */,
906
- "Prompt Enhanced" /* PROMPT_ENHANCED */,
907
- "Title Button Clicked" /* TITLE_BUTTON_CLICKED */,
908
- "Authentication Initiated" /* AUTHENTICATION_INITIATED */,
909
- "Schema Validation Error" /* SCHEMA_VALIDATION_ERROR */,
910
- "Diff Application Error" /* DIFF_APPLICATION_ERROR */,
911
- "Shell Integration Error" /* SHELL_INTEGRATION_ERROR */,
912
- "Consecutive Mistake Error" /* CONSECUTIVE_MISTAKE_ERROR */
913
- ]),
914
- properties: import_zod.z.object({
915
- ...appPropertiesSchema.shape,
916
- ...taskPropertiesSchema.shape
917
- })
918
- }),
919
- import_zod.z.object({
920
- type: import_zod.z.literal("LLM Completion" /* LLM_COMPLETION */),
921
- properties: import_zod.z.object({
922
- ...appPropertiesSchema.shape,
923
- ...taskPropertiesSchema.shape,
924
- ...completionPropertiesSchema.shape
925
- })
926
- })
927
- ]);
928
- // Annotate the CommonJS export names for ESM import in node:
929
- 0 && (module.exports = {
930
- IpcMessageType,
931
- IpcOrigin,
932
- RooCodeEventName,
933
- TelemetryEventName,
934
- providerNames,
935
- rooCodeTelemetryEventSchema
936
- });