@roo-code/types 1.93.0 → 1.94.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/dist/index.js CHANGED
@@ -149,6 +149,7 @@ var toolNames = [
149
149
  "apply_diff",
150
150
  "search_and_replace",
151
151
  "search_replace",
152
+ "edit_file",
152
153
  "apply_patch",
153
154
  "search_files",
154
155
  "list_files",
@@ -177,6 +178,10 @@ var TOOL_PROTOCOL = {
177
178
  XML: "xml",
178
179
  NATIVE: "native"
179
180
  };
181
+ var NATIVE_TOOL_DEFAULTS = {
182
+ supportsNativeTools: true,
183
+ defaultToolProtocol: TOOL_PROTOCOL.NATIVE
184
+ };
180
185
  function isNativeProtocol(protocol) {
181
186
  return protocol === TOOL_PROTOCOL.NATIVE;
182
187
  }
@@ -2419,6 +2424,7 @@ var geminiModels = {
2419
2424
  supportsReasoningEffort: ["low", "high"],
2420
2425
  reasoningEffort: "low",
2421
2426
  includedTools: ["write_file", "edit_file"],
2427
+ excludedTools: ["apply_diff"],
2422
2428
  supportsTemperature: true,
2423
2429
  defaultTemperature: 1,
2424
2430
  inputPrice: 4,
@@ -2446,6 +2452,7 @@ var geminiModels = {
2446
2452
  supportsReasoningEffort: ["minimal", "low", "medium", "high"],
2447
2453
  reasoningEffort: "medium",
2448
2454
  includedTools: ["write_file", "edit_file"],
2455
+ excludedTools: ["apply_diff"],
2449
2456
  supportsTemperature: true,
2450
2457
  defaultTemperature: 1,
2451
2458
  inputPrice: 0.3,
@@ -2462,6 +2469,7 @@ var geminiModels = {
2462
2469
  defaultToolProtocol: "native",
2463
2470
  supportsPromptCache: true,
2464
2471
  includedTools: ["write_file", "edit_file"],
2472
+ excludedTools: ["apply_diff"],
2465
2473
  inputPrice: 2.5,
2466
2474
  // This is the pricing for prompts above 200k tokens.
2467
2475
  outputPrice: 15,
@@ -2493,6 +2501,7 @@ var geminiModels = {
2493
2501
  defaultToolProtocol: "native",
2494
2502
  supportsPromptCache: true,
2495
2503
  includedTools: ["write_file", "edit_file"],
2504
+ excludedTools: ["apply_diff"],
2496
2505
  inputPrice: 2.5,
2497
2506
  // This is the pricing for prompts above 200k tokens.
2498
2507
  outputPrice: 15,
@@ -2523,6 +2532,7 @@ var geminiModels = {
2523
2532
  defaultToolProtocol: "native",
2524
2533
  supportsPromptCache: true,
2525
2534
  includedTools: ["write_file", "edit_file"],
2535
+ excludedTools: ["apply_diff"],
2526
2536
  inputPrice: 2.5,
2527
2537
  // This is the pricing for prompts above 200k tokens.
2528
2538
  outputPrice: 15,
@@ -2551,6 +2561,7 @@ var geminiModels = {
2551
2561
  defaultToolProtocol: "native",
2552
2562
  supportsPromptCache: true,
2553
2563
  includedTools: ["write_file", "edit_file"],
2564
+ excludedTools: ["apply_diff"],
2554
2565
  inputPrice: 2.5,
2555
2566
  // This is the pricing for prompts above 200k tokens.
2556
2567
  outputPrice: 15,
@@ -2582,6 +2593,7 @@ var geminiModels = {
2582
2593
  defaultToolProtocol: "native",
2583
2594
  supportsPromptCache: true,
2584
2595
  includedTools: ["write_file", "edit_file"],
2596
+ excludedTools: ["apply_diff"],
2585
2597
  inputPrice: 0.3,
2586
2598
  outputPrice: 2.5,
2587
2599
  cacheReadsPrice: 0.075,
@@ -2597,6 +2609,7 @@ var geminiModels = {
2597
2609
  defaultToolProtocol: "native",
2598
2610
  supportsPromptCache: true,
2599
2611
  includedTools: ["write_file", "edit_file"],
2612
+ excludedTools: ["apply_diff"],
2600
2613
  inputPrice: 0.3,
2601
2614
  outputPrice: 2.5,
2602
2615
  cacheReadsPrice: 0.075,
@@ -2612,6 +2625,7 @@ var geminiModels = {
2612
2625
  defaultToolProtocol: "native",
2613
2626
  supportsPromptCache: true,
2614
2627
  includedTools: ["write_file", "edit_file"],
2628
+ excludedTools: ["apply_diff"],
2615
2629
  inputPrice: 0.3,
2616
2630
  outputPrice: 2.5,
2617
2631
  cacheReadsPrice: 0.075,
@@ -2628,6 +2642,7 @@ var geminiModels = {
2628
2642
  defaultToolProtocol: "native",
2629
2643
  supportsPromptCache: true,
2630
2644
  includedTools: ["write_file", "edit_file"],
2645
+ excludedTools: ["apply_diff"],
2631
2646
  inputPrice: 0.1,
2632
2647
  outputPrice: 0.4,
2633
2648
  cacheReadsPrice: 0.025,
@@ -2643,6 +2658,7 @@ var geminiModels = {
2643
2658
  defaultToolProtocol: "native",
2644
2659
  supportsPromptCache: true,
2645
2660
  includedTools: ["write_file", "edit_file"],
2661
+ excludedTools: ["apply_diff"],
2646
2662
  inputPrice: 0.1,
2647
2663
  outputPrice: 0.4,
2648
2664
  cacheReadsPrice: 0.025,
@@ -2855,6 +2871,8 @@ var lMStudioDefaultModelInfo = {
2855
2871
  contextWindow: 2e5,
2856
2872
  supportsImages: true,
2857
2873
  supportsPromptCache: true,
2874
+ supportsNativeTools: true,
2875
+ defaultToolProtocol: "native",
2858
2876
  inputPrice: 0,
2859
2877
  outputPrice: 0,
2860
2878
  cacheWritesPrice: 0,
@@ -3681,6 +3699,8 @@ var qwenCodeModels = {
3681
3699
  contextWindow: 1e6,
3682
3700
  supportsImages: false,
3683
3701
  supportsPromptCache: false,
3702
+ supportsNativeTools: true,
3703
+ defaultToolProtocol: "native",
3684
3704
  inputPrice: 0,
3685
3705
  outputPrice: 0,
3686
3706
  cacheWritesPrice: 0,
@@ -3692,6 +3712,8 @@ var qwenCodeModels = {
3692
3712
  contextWindow: 1e6,
3693
3713
  supportsImages: false,
3694
3714
  supportsPromptCache: false,
3715
+ supportsNativeTools: true,
3716
+ defaultToolProtocol: "native",
3695
3717
  inputPrice: 0,
3696
3718
  outputPrice: 0,
3697
3719
  cacheWritesPrice: 0,
@@ -3895,6 +3917,7 @@ var vertexModels = {
3895
3917
  supportsReasoningEffort: ["low", "high"],
3896
3918
  reasoningEffort: "low",
3897
3919
  includedTools: ["write_file", "edit_file"],
3920
+ excludedTools: ["apply_diff"],
3898
3921
  supportsTemperature: true,
3899
3922
  defaultTemperature: 1,
3900
3923
  inputPrice: 4,
@@ -3922,6 +3945,7 @@ var vertexModels = {
3922
3945
  supportsReasoningEffort: ["minimal", "low", "medium", "high"],
3923
3946
  reasoningEffort: "medium",
3924
3947
  includedTools: ["write_file", "edit_file"],
3948
+ excludedTools: ["apply_diff"],
3925
3949
  supportsTemperature: true,
3926
3950
  defaultTemperature: 1,
3927
3951
  inputPrice: 0.3,
@@ -3937,6 +3961,7 @@ var vertexModels = {
3937
3961
  defaultToolProtocol: "native",
3938
3962
  supportsPromptCache: true,
3939
3963
  includedTools: ["write_file", "edit_file"],
3964
+ excludedTools: ["apply_diff"],
3940
3965
  inputPrice: 0.15,
3941
3966
  outputPrice: 3.5,
3942
3967
  maxThinkingTokens: 24576,
@@ -3951,6 +3976,7 @@ var vertexModels = {
3951
3976
  defaultToolProtocol: "native",
3952
3977
  supportsPromptCache: true,
3953
3978
  includedTools: ["write_file", "edit_file"],
3979
+ excludedTools: ["apply_diff"],
3954
3980
  inputPrice: 0.15,
3955
3981
  outputPrice: 0.6
3956
3982
  },
@@ -3962,6 +3988,7 @@ var vertexModels = {
3962
3988
  defaultToolProtocol: "native",
3963
3989
  supportsPromptCache: true,
3964
3990
  includedTools: ["write_file", "edit_file"],
3991
+ excludedTools: ["apply_diff"],
3965
3992
  inputPrice: 0.3,
3966
3993
  outputPrice: 2.5,
3967
3994
  cacheReadsPrice: 0.075,
@@ -3977,6 +4004,7 @@ var vertexModels = {
3977
4004
  defaultToolProtocol: "native",
3978
4005
  supportsPromptCache: false,
3979
4006
  includedTools: ["write_file", "edit_file"],
4007
+ excludedTools: ["apply_diff"],
3980
4008
  inputPrice: 0.15,
3981
4009
  outputPrice: 3.5,
3982
4010
  maxThinkingTokens: 24576,
@@ -3991,6 +4019,7 @@ var vertexModels = {
3991
4019
  defaultToolProtocol: "native",
3992
4020
  supportsPromptCache: false,
3993
4021
  includedTools: ["write_file", "edit_file"],
4022
+ excludedTools: ["apply_diff"],
3994
4023
  inputPrice: 0.15,
3995
4024
  outputPrice: 0.6
3996
4025
  },
@@ -4002,6 +4031,7 @@ var vertexModels = {
4002
4031
  defaultToolProtocol: "native",
4003
4032
  supportsPromptCache: true,
4004
4033
  includedTools: ["write_file", "edit_file"],
4034
+ excludedTools: ["apply_diff"],
4005
4035
  inputPrice: 2.5,
4006
4036
  outputPrice: 15
4007
4037
  },
@@ -4013,6 +4043,7 @@ var vertexModels = {
4013
4043
  defaultToolProtocol: "native",
4014
4044
  supportsPromptCache: true,
4015
4045
  includedTools: ["write_file", "edit_file"],
4046
+ excludedTools: ["apply_diff"],
4016
4047
  inputPrice: 2.5,
4017
4048
  outputPrice: 15
4018
4049
  },
@@ -4024,6 +4055,7 @@ var vertexModels = {
4024
4055
  defaultToolProtocol: "native",
4025
4056
  supportsPromptCache: true,
4026
4057
  includedTools: ["write_file", "edit_file"],
4058
+ excludedTools: ["apply_diff"],
4027
4059
  inputPrice: 2.5,
4028
4060
  outputPrice: 15,
4029
4061
  maxThinkingTokens: 32768,
@@ -4037,6 +4069,7 @@ var vertexModels = {
4037
4069
  defaultToolProtocol: "native",
4038
4070
  supportsPromptCache: true,
4039
4071
  includedTools: ["write_file", "edit_file"],
4072
+ excludedTools: ["apply_diff"],
4040
4073
  inputPrice: 2.5,
4041
4074
  outputPrice: 15,
4042
4075
  maxThinkingTokens: 32768,
@@ -4065,6 +4098,7 @@ var vertexModels = {
4065
4098
  defaultToolProtocol: "native",
4066
4099
  supportsPromptCache: false,
4067
4100
  includedTools: ["write_file", "edit_file"],
4101
+ excludedTools: ["apply_diff"],
4068
4102
  inputPrice: 0,
4069
4103
  outputPrice: 0
4070
4104
  },
@@ -4076,6 +4110,7 @@ var vertexModels = {
4076
4110
  defaultToolProtocol: "native",
4077
4111
  supportsPromptCache: false,
4078
4112
  includedTools: ["write_file", "edit_file"],
4113
+ excludedTools: ["apply_diff"],
4079
4114
  inputPrice: 0,
4080
4115
  outputPrice: 0
4081
4116
  },
@@ -4087,6 +4122,7 @@ var vertexModels = {
4087
4122
  defaultToolProtocol: "native",
4088
4123
  supportsPromptCache: true,
4089
4124
  includedTools: ["write_file", "edit_file"],
4125
+ excludedTools: ["apply_diff"],
4090
4126
  inputPrice: 0.15,
4091
4127
  outputPrice: 0.6
4092
4128
  },
@@ -4098,6 +4134,7 @@ var vertexModels = {
4098
4134
  defaultToolProtocol: "native",
4099
4135
  supportsPromptCache: false,
4100
4136
  includedTools: ["write_file", "edit_file"],
4137
+ excludedTools: ["apply_diff"],
4101
4138
  inputPrice: 0.075,
4102
4139
  outputPrice: 0.3
4103
4140
  },
@@ -4109,6 +4146,7 @@ var vertexModels = {
4109
4146
  defaultToolProtocol: "native",
4110
4147
  supportsPromptCache: false,
4111
4148
  includedTools: ["write_file", "edit_file"],
4149
+ excludedTools: ["apply_diff"],
4112
4150
  inputPrice: 0,
4113
4151
  outputPrice: 0
4114
4152
  },
@@ -4120,6 +4158,7 @@ var vertexModels = {
4120
4158
  defaultToolProtocol: "native",
4121
4159
  supportsPromptCache: true,
4122
4160
  includedTools: ["write_file", "edit_file"],
4161
+ excludedTools: ["apply_diff"],
4123
4162
  inputPrice: 0.075,
4124
4163
  outputPrice: 0.3
4125
4164
  },
@@ -4131,36 +4170,83 @@ var vertexModels = {
4131
4170
  defaultToolProtocol: "native",
4132
4171
  supportsPromptCache: false,
4133
4172
  includedTools: ["write_file", "edit_file"],
4173
+ excludedTools: ["apply_diff"],
4134
4174
  inputPrice: 1.25,
4135
4175
  outputPrice: 5
4136
4176
  },
4137
4177
  "claude-sonnet-4@20250514": {
4138
4178
  maxTokens: 8192,
4139
4179
  contextWindow: 2e5,
4180
+ // Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'
4140
4181
  supportsImages: true,
4141
4182
  supportsPromptCache: true,
4183
+ supportsNativeTools: true,
4184
+ defaultToolProtocol: "native",
4142
4185
  inputPrice: 3,
4186
+ // $3 per million input tokens (≤200K context)
4143
4187
  outputPrice: 15,
4188
+ // $15 per million output tokens (≤200K context)
4144
4189
  cacheWritesPrice: 3.75,
4190
+ // $3.75 per million tokens
4145
4191
  cacheReadsPrice: 0.3,
4146
- supportsReasoningBudget: true
4192
+ // $0.30 per million tokens
4193
+ supportsReasoningBudget: true,
4194
+ // Tiered pricing for extended context (requires beta flag 'context-1m-2025-08-07')
4195
+ tiers: [
4196
+ {
4197
+ contextWindow: 1e6,
4198
+ // 1M tokens with beta flag
4199
+ inputPrice: 6,
4200
+ // $6 per million input tokens (>200K context)
4201
+ outputPrice: 22.5,
4202
+ // $22.50 per million output tokens (>200K context)
4203
+ cacheWritesPrice: 7.5,
4204
+ // $7.50 per million tokens (>200K context)
4205
+ cacheReadsPrice: 0.6
4206
+ // $0.60 per million tokens (>200K context)
4207
+ }
4208
+ ]
4147
4209
  },
4148
4210
  "claude-sonnet-4-5@20250929": {
4149
4211
  maxTokens: 8192,
4150
4212
  contextWindow: 2e5,
4213
+ // Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'
4151
4214
  supportsImages: true,
4152
4215
  supportsPromptCache: true,
4216
+ supportsNativeTools: true,
4217
+ defaultToolProtocol: "native",
4153
4218
  inputPrice: 3,
4219
+ // $3 per million input tokens (≤200K context)
4154
4220
  outputPrice: 15,
4221
+ // $15 per million output tokens (≤200K context)
4155
4222
  cacheWritesPrice: 3.75,
4223
+ // $3.75 per million tokens
4156
4224
  cacheReadsPrice: 0.3,
4157
- supportsReasoningBudget: true
4225
+ // $0.30 per million tokens
4226
+ supportsReasoningBudget: true,
4227
+ // Tiered pricing for extended context (requires beta flag 'context-1m-2025-08-07')
4228
+ tiers: [
4229
+ {
4230
+ contextWindow: 1e6,
4231
+ // 1M tokens with beta flag
4232
+ inputPrice: 6,
4233
+ // $6 per million input tokens (>200K context)
4234
+ outputPrice: 22.5,
4235
+ // $22.50 per million output tokens (>200K context)
4236
+ cacheWritesPrice: 7.5,
4237
+ // $7.50 per million tokens (>200K context)
4238
+ cacheReadsPrice: 0.6
4239
+ // $0.60 per million tokens (>200K context)
4240
+ }
4241
+ ]
4158
4242
  },
4159
4243
  "claude-haiku-4-5@20251001": {
4160
4244
  maxTokens: 8192,
4161
4245
  contextWindow: 2e5,
4162
4246
  supportsImages: true,
4163
4247
  supportsPromptCache: true,
4248
+ supportsNativeTools: true,
4249
+ defaultToolProtocol: "native",
4164
4250
  inputPrice: 1,
4165
4251
  outputPrice: 5,
4166
4252
  cacheWritesPrice: 1.25,
@@ -4172,6 +4258,8 @@ var vertexModels = {
4172
4258
  contextWindow: 2e5,
4173
4259
  supportsImages: true,
4174
4260
  supportsPromptCache: true,
4261
+ supportsNativeTools: true,
4262
+ defaultToolProtocol: "native",
4175
4263
  inputPrice: 5,
4176
4264
  outputPrice: 25,
4177
4265
  cacheWritesPrice: 6.25,
@@ -4183,6 +4271,8 @@ var vertexModels = {
4183
4271
  contextWindow: 2e5,
4184
4272
  supportsImages: true,
4185
4273
  supportsPromptCache: true,
4274
+ supportsNativeTools: true,
4275
+ defaultToolProtocol: "native",
4186
4276
  inputPrice: 15,
4187
4277
  outputPrice: 75,
4188
4278
  cacheWritesPrice: 18.75,
@@ -4194,6 +4284,8 @@ var vertexModels = {
4194
4284
  contextWindow: 2e5,
4195
4285
  supportsImages: true,
4196
4286
  supportsPromptCache: true,
4287
+ supportsNativeTools: true,
4288
+ defaultToolProtocol: "native",
4197
4289
  inputPrice: 15,
4198
4290
  outputPrice: 75,
4199
4291
  cacheWritesPrice: 18.75,
@@ -4204,6 +4296,8 @@ var vertexModels = {
4204
4296
  contextWindow: 2e5,
4205
4297
  supportsImages: true,
4206
4298
  supportsPromptCache: true,
4299
+ supportsNativeTools: true,
4300
+ defaultToolProtocol: "native",
4207
4301
  inputPrice: 3,
4208
4302
  outputPrice: 15,
4209
4303
  cacheWritesPrice: 3.75,
@@ -4216,6 +4310,8 @@ var vertexModels = {
4216
4310
  contextWindow: 2e5,
4217
4311
  supportsImages: true,
4218
4312
  supportsPromptCache: true,
4313
+ supportsNativeTools: true,
4314
+ defaultToolProtocol: "native",
4219
4315
  inputPrice: 3,
4220
4316
  outputPrice: 15,
4221
4317
  cacheWritesPrice: 3.75,
@@ -4226,6 +4322,8 @@ var vertexModels = {
4226
4322
  contextWindow: 2e5,
4227
4323
  supportsImages: true,
4228
4324
  supportsPromptCache: true,
4325
+ supportsNativeTools: true,
4326
+ defaultToolProtocol: "native",
4229
4327
  inputPrice: 3,
4230
4328
  outputPrice: 15,
4231
4329
  cacheWritesPrice: 3.75,
@@ -4236,6 +4334,8 @@ var vertexModels = {
4236
4334
  contextWindow: 2e5,
4237
4335
  supportsImages: true,
4238
4336
  supportsPromptCache: true,
4337
+ supportsNativeTools: true,
4338
+ defaultToolProtocol: "native",
4239
4339
  inputPrice: 3,
4240
4340
  outputPrice: 15,
4241
4341
  cacheWritesPrice: 3.75,
@@ -4246,6 +4346,8 @@ var vertexModels = {
4246
4346
  contextWindow: 2e5,
4247
4347
  supportsImages: false,
4248
4348
  supportsPromptCache: true,
4349
+ supportsNativeTools: true,
4350
+ defaultToolProtocol: "native",
4249
4351
  inputPrice: 1,
4250
4352
  outputPrice: 5,
4251
4353
  cacheWritesPrice: 1.25,
@@ -4256,6 +4358,8 @@ var vertexModels = {
4256
4358
  contextWindow: 2e5,
4257
4359
  supportsImages: true,
4258
4360
  supportsPromptCache: true,
4361
+ supportsNativeTools: true,
4362
+ defaultToolProtocol: "native",
4259
4363
  inputPrice: 15,
4260
4364
  outputPrice: 75,
4261
4365
  cacheWritesPrice: 18.75,
@@ -4266,6 +4370,8 @@ var vertexModels = {
4266
4370
  contextWindow: 2e5,
4267
4371
  supportsImages: true,
4268
4372
  supportsPromptCache: true,
4373
+ supportsNativeTools: true,
4374
+ defaultToolProtocol: "native",
4269
4375
  inputPrice: 0.25,
4270
4376
  outputPrice: 1.25,
4271
4377
  cacheWritesPrice: 0.3,
@@ -4279,6 +4385,7 @@ var vertexModels = {
4279
4385
  defaultToolProtocol: "native",
4280
4386
  supportsPromptCache: true,
4281
4387
  includedTools: ["write_file", "edit_file"],
4388
+ excludedTools: ["apply_diff"],
4282
4389
  inputPrice: 0.1,
4283
4390
  outputPrice: 0.4,
4284
4391
  cacheReadsPrice: 0.025,
@@ -4350,6 +4457,7 @@ var vertexModels = {
4350
4457
  description: "Qwen3 235B A22B Instruct. Available in us-south1"
4351
4458
  }
4352
4459
  };
4460
+ var VERTEX_1M_CONTEXT_MODEL_IDS = ["claude-sonnet-4@20250514", "claude-sonnet-4-5@20250929"];
4353
4461
  var VERTEX_REGIONS = [
4354
4462
  { value: "global", label: "global" },
4355
4463
  { value: "us-central1", label: "us-central1" },
@@ -5273,7 +5381,9 @@ var vertexSchema = apiModelIdProviderModelSchema.extend({
5273
5381
  vertexProjectId: z8.string().optional(),
5274
5382
  vertexRegion: z8.string().optional(),
5275
5383
  enableUrlContext: z8.boolean().optional(),
5276
- enableGrounding: z8.boolean().optional()
5384
+ enableGrounding: z8.boolean().optional(),
5385
+ vertex1MContext: z8.boolean().optional()
5386
+ // Enable 'context-1m-2025-08-07' beta for 1M context window.
5277
5387
  });
5278
5388
  var openAiSchema = baseProviderSettingsSchema.extend({
5279
5389
  openAiBaseUrl: z8.string().optional(),
@@ -5690,6 +5800,16 @@ var historyItemSchema = z9.object({
5690
5800
  size: z9.number().optional(),
5691
5801
  workspace: z9.string().optional(),
5692
5802
  mode: z9.string().optional(),
5803
+ /**
5804
+ * The tool protocol used by this task. Once a task uses tools with a specific
5805
+ * protocol (XML or Native), it is permanently locked to that protocol.
5806
+ *
5807
+ * - "xml": Tool calls are parsed from XML text (no tool IDs)
5808
+ * - "native": Tool calls come as tool_call chunks with IDs
5809
+ *
5810
+ * This ensures task resumption works correctly even when NTC settings change.
5811
+ */
5812
+ toolProtocol: z9.enum(["xml", "native"]).optional(),
5693
5813
  status: z9.enum(["active", "completed", "delegated"]).optional(),
5694
5814
  delegatedToId: z9.string().optional(),
5695
5815
  // Last child this parent delegated to
@@ -5985,6 +6105,31 @@ function extractApiProviderErrorProperties(error) {
5985
6105
  ...error.errorCode !== void 0 && { errorCode: error.errorCode }
5986
6106
  };
5987
6107
  }
6108
+ var ConsecutiveMistakeError = class extends Error {
6109
+ constructor(message, taskId, consecutiveMistakeCount, consecutiveMistakeLimit, reason = "unknown", provider, modelId) {
6110
+ super(message);
6111
+ this.taskId = taskId;
6112
+ this.consecutiveMistakeCount = consecutiveMistakeCount;
6113
+ this.consecutiveMistakeLimit = consecutiveMistakeLimit;
6114
+ this.reason = reason;
6115
+ this.provider = provider;
6116
+ this.modelId = modelId;
6117
+ this.name = "ConsecutiveMistakeError";
6118
+ }
6119
+ };
6120
+ function isConsecutiveMistakeError(error) {
6121
+ return error instanceof Error && error.name === "ConsecutiveMistakeError" && "taskId" in error && "consecutiveMistakeCount" in error && "consecutiveMistakeLimit" in error;
6122
+ }
6123
+ function extractConsecutiveMistakeErrorProperties(error) {
6124
+ return {
6125
+ taskId: error.taskId,
6126
+ consecutiveMistakeCount: error.consecutiveMistakeCount,
6127
+ consecutiveMistakeLimit: error.consecutiveMistakeLimit,
6128
+ reason: error.reason,
6129
+ ...error.provider !== void 0 && { provider: error.provider },
6130
+ ...error.modelId !== void 0 && { modelId: error.modelId }
6131
+ };
6132
+ }
5988
6133
 
5989
6134
  // src/mode.ts
5990
6135
  import { z as z12 } from "zod";
@@ -6869,15 +7014,21 @@ var COOKIE_CONSENT_EVENTS = {
6869
7014
  CHANGED: "cookieConsentChanged"
6870
7015
  };
6871
7016
 
7017
+ // src/custom-tool.ts
7018
+ import { z as z17 } from "zod/v4";
7019
+ function defineCustomTool(definition) {
7020
+ return definition;
7021
+ }
7022
+
6872
7023
  // src/followup.ts
6873
- import { z as z17 } from "zod";
6874
- var suggestionItemSchema = z17.object({
6875
- answer: z17.string(),
6876
- mode: z17.string().optional()
7024
+ import { z as z18 } from "zod";
7025
+ var suggestionItemSchema = z18.object({
7026
+ answer: z18.string(),
7027
+ mode: z18.string().optional()
6877
7028
  });
6878
- var followUpDataSchema = z17.object({
6879
- question: z17.string().optional(),
6880
- suggest: z17.array(suggestionItemSchema).optional()
7029
+ var followUpDataSchema = z18.object({
7030
+ question: z18.string().optional(),
7031
+ suggest: z18.array(suggestionItemSchema).optional()
6881
7032
  });
6882
7033
 
6883
7034
  // src/image-generation.ts
@@ -6905,7 +7056,7 @@ function getImageGenerationProvider(explicitProvider, hasExistingModel) {
6905
7056
  }
6906
7057
 
6907
7058
  // src/ipc.ts
6908
- import { z as z18 } from "zod";
7059
+ import { z as z19 } from "zod";
6909
7060
  var IpcMessageType = /* @__PURE__ */ ((IpcMessageType2) => {
6910
7061
  IpcMessageType2["Connect"] = "Connect";
6911
7062
  IpcMessageType2["Disconnect"] = "Disconnect";
@@ -6919,10 +7070,10 @@ var IpcOrigin = /* @__PURE__ */ ((IpcOrigin2) => {
6919
7070
  IpcOrigin2["Server"] = "server";
6920
7071
  return IpcOrigin2;
6921
7072
  })(IpcOrigin || {});
6922
- var ackSchema = z18.object({
6923
- clientId: z18.string(),
6924
- pid: z18.number(),
6925
- ppid: z18.number()
7073
+ var ackSchema = z19.object({
7074
+ clientId: z19.string(),
7075
+ pid: z19.number(),
7076
+ ppid: z19.number()
6926
7077
  });
6927
7078
  var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
6928
7079
  TaskCommandName2["StartNewTask"] = "StartNewTask";
@@ -6932,79 +7083,79 @@ var TaskCommandName = /* @__PURE__ */ ((TaskCommandName2) => {
6932
7083
  TaskCommandName2["SendMessage"] = "SendMessage";
6933
7084
  return TaskCommandName2;
6934
7085
  })(TaskCommandName || {});
6935
- var taskCommandSchema = z18.discriminatedUnion("commandName", [
6936
- z18.object({
6937
- commandName: z18.literal("StartNewTask" /* StartNewTask */),
6938
- data: z18.object({
7086
+ var taskCommandSchema = z19.discriminatedUnion("commandName", [
7087
+ z19.object({
7088
+ commandName: z19.literal("StartNewTask" /* StartNewTask */),
7089
+ data: z19.object({
6939
7090
  configuration: rooCodeSettingsSchema,
6940
- text: z18.string(),
6941
- images: z18.array(z18.string()).optional(),
6942
- newTab: z18.boolean().optional()
7091
+ text: z19.string(),
7092
+ images: z19.array(z19.string()).optional(),
7093
+ newTab: z19.boolean().optional()
6943
7094
  })
6944
7095
  }),
6945
- z18.object({
6946
- commandName: z18.literal("CancelTask" /* CancelTask */),
6947
- data: z18.string()
7096
+ z19.object({
7097
+ commandName: z19.literal("CancelTask" /* CancelTask */),
7098
+ data: z19.string()
6948
7099
  }),
6949
- z18.object({
6950
- commandName: z18.literal("CloseTask" /* CloseTask */),
6951
- data: z18.string()
7100
+ z19.object({
7101
+ commandName: z19.literal("CloseTask" /* CloseTask */),
7102
+ data: z19.string()
6952
7103
  }),
6953
- z18.object({
6954
- commandName: z18.literal("ResumeTask" /* ResumeTask */),
6955
- data: z18.string()
7104
+ z19.object({
7105
+ commandName: z19.literal("ResumeTask" /* ResumeTask */),
7106
+ data: z19.string()
6956
7107
  }),
6957
- z18.object({
6958
- commandName: z18.literal("SendMessage" /* SendMessage */),
6959
- data: z18.object({
6960
- text: z18.string().optional(),
6961
- images: z18.array(z18.string()).optional()
7108
+ z19.object({
7109
+ commandName: z19.literal("SendMessage" /* SendMessage */),
7110
+ data: z19.object({
7111
+ text: z19.string().optional(),
7112
+ images: z19.array(z19.string()).optional()
6962
7113
  })
6963
7114
  })
6964
7115
  ]);
6965
- var ipcMessageSchema = z18.discriminatedUnion("type", [
6966
- z18.object({
6967
- type: z18.literal("Ack" /* Ack */),
6968
- origin: z18.literal("server" /* Server */),
7116
+ var ipcMessageSchema = z19.discriminatedUnion("type", [
7117
+ z19.object({
7118
+ type: z19.literal("Ack" /* Ack */),
7119
+ origin: z19.literal("server" /* Server */),
6969
7120
  data: ackSchema
6970
7121
  }),
6971
- z18.object({
6972
- type: z18.literal("TaskCommand" /* TaskCommand */),
6973
- origin: z18.literal("client" /* Client */),
6974
- clientId: z18.string(),
7122
+ z19.object({
7123
+ type: z19.literal("TaskCommand" /* TaskCommand */),
7124
+ origin: z19.literal("client" /* Client */),
7125
+ clientId: z19.string(),
6975
7126
  data: taskCommandSchema
6976
7127
  }),
6977
- z18.object({
6978
- type: z18.literal("TaskEvent" /* TaskEvent */),
6979
- origin: z18.literal("server" /* Server */),
6980
- relayClientId: z18.string().optional(),
7128
+ z19.object({
7129
+ type: z19.literal("TaskEvent" /* TaskEvent */),
7130
+ origin: z19.literal("server" /* Server */),
7131
+ relayClientId: z19.string().optional(),
6981
7132
  data: taskEventSchema
6982
7133
  })
6983
7134
  ]);
6984
7135
 
6985
7136
  // src/mcp.ts
6986
- import { z as z19 } from "zod";
6987
- var mcpExecutionStatusSchema = z19.discriminatedUnion("status", [
6988
- z19.object({
6989
- executionId: z19.string(),
6990
- status: z19.literal("started"),
6991
- serverName: z19.string(),
6992
- toolName: z19.string()
7137
+ import { z as z20 } from "zod";
7138
+ var mcpExecutionStatusSchema = z20.discriminatedUnion("status", [
7139
+ z20.object({
7140
+ executionId: z20.string(),
7141
+ status: z20.literal("started"),
7142
+ serverName: z20.string(),
7143
+ toolName: z20.string()
6993
7144
  }),
6994
- z19.object({
6995
- executionId: z19.string(),
6996
- status: z19.literal("output"),
6997
- response: z19.string()
7145
+ z20.object({
7146
+ executionId: z20.string(),
7147
+ status: z20.literal("output"),
7148
+ response: z20.string()
6998
7149
  }),
6999
- z19.object({
7000
- executionId: z19.string(),
7001
- status: z19.literal("completed"),
7002
- response: z19.string().optional()
7150
+ z20.object({
7151
+ executionId: z20.string(),
7152
+ status: z20.literal("completed"),
7153
+ response: z20.string().optional()
7003
7154
  }),
7004
- z19.object({
7005
- executionId: z19.string(),
7006
- status: z19.literal("error"),
7007
- error: z19.string().optional()
7155
+ z20.object({
7156
+ executionId: z20.string(),
7157
+ status: z20.literal("error"),
7158
+ error: z20.string().optional()
7008
7159
  })
7009
7160
  ]);
7010
7161
 
@@ -7014,40 +7165,40 @@ function shouldUseSingleFileRead(modelId) {
7014
7165
  }
7015
7166
 
7016
7167
  // src/todo.ts
7017
- import { z as z20 } from "zod";
7018
- var todoStatusSchema = z20.enum(["pending", "in_progress", "completed"]);
7019
- var todoItemSchema = z20.object({
7020
- id: z20.string(),
7021
- content: z20.string(),
7168
+ import { z as z21 } from "zod";
7169
+ var todoStatusSchema = z21.enum(["pending", "in_progress", "completed"]);
7170
+ var todoItemSchema = z21.object({
7171
+ id: z21.string(),
7172
+ content: z21.string(),
7022
7173
  status: todoStatusSchema
7023
7174
  });
7024
7175
 
7025
7176
  // src/terminal.ts
7026
- import { z as z21 } from "zod";
7027
- var commandExecutionStatusSchema = z21.discriminatedUnion("status", [
7028
- z21.object({
7029
- executionId: z21.string(),
7030
- status: z21.literal("started"),
7031
- pid: z21.number().optional(),
7032
- command: z21.string()
7177
+ import { z as z22 } from "zod";
7178
+ var commandExecutionStatusSchema = z22.discriminatedUnion("status", [
7179
+ z22.object({
7180
+ executionId: z22.string(),
7181
+ status: z22.literal("started"),
7182
+ pid: z22.number().optional(),
7183
+ command: z22.string()
7033
7184
  }),
7034
- z21.object({
7035
- executionId: z21.string(),
7036
- status: z21.literal("output"),
7037
- output: z21.string()
7185
+ z22.object({
7186
+ executionId: z22.string(),
7187
+ status: z22.literal("output"),
7188
+ output: z22.string()
7038
7189
  }),
7039
- z21.object({
7040
- executionId: z21.string(),
7041
- status: z21.literal("exited"),
7042
- exitCode: z21.number().optional()
7190
+ z22.object({
7191
+ executionId: z22.string(),
7192
+ status: z22.literal("exited"),
7193
+ exitCode: z22.number().optional()
7043
7194
  }),
7044
- z21.object({
7045
- executionId: z21.string(),
7046
- status: z21.literal("fallback")
7195
+ z22.object({
7196
+ executionId: z22.string(),
7197
+ status: z22.literal("fallback")
7047
7198
  }),
7048
- z21.object({
7049
- executionId: z21.string(),
7050
- status: z21.literal("timeout")
7199
+ z22.object({
7200
+ executionId: z22.string(),
7201
+ status: z22.literal("timeout")
7051
7202
  })
7052
7203
  ]);
7053
7204
  export {
@@ -7068,6 +7219,7 @@ export {
7068
7219
  CONTEXT_MANAGEMENT_EVENTS,
7069
7220
  COOKIE_CONSENT_EVENTS,
7070
7221
  ConnectionState,
7222
+ ConsecutiveMistakeError,
7071
7223
  DEEP_SEEK_DEFAULT_TEMPERATURE,
7072
7224
  DEFAULT_CHECKPOINT_TIMEOUT_SECONDS,
7073
7225
  DEFAULT_CONSECUTIVE_MISTAKE_LIMIT,
@@ -7108,6 +7260,7 @@ export {
7108
7260
  MISTRAL_DEFAULT_TEMPERATURE,
7109
7261
  MODELS_BY_PROVIDER,
7110
7262
  MOONSHOT_DEFAULT_TEMPERATURE,
7263
+ NATIVE_TOOL_DEFAULTS,
7111
7264
  OPENAI_AZURE_AI_INFERENCE_PATH,
7112
7265
  OPENAI_NATIVE_DEFAULT_TEMPERATURE,
7113
7266
  OPENROUTER_DEFAULT_PROVIDER_NAME,
@@ -7133,6 +7286,7 @@ export {
7133
7286
  VERCEL_AI_GATEWAY_PROMPT_CACHING_MODELS,
7134
7287
  VERCEL_AI_GATEWAY_VISION_AND_TOOLS_MODELS,
7135
7288
  VERCEL_AI_GATEWAY_VISION_ONLY_MODELS,
7289
+ VERTEX_1M_CONTEXT_MODEL_IDS,
7136
7290
  VERTEX_REGIONS,
7137
7291
  ZAI_DEFAULT_TEMPERATURE,
7138
7292
  ackSchema,
@@ -7175,6 +7329,7 @@ export {
7175
7329
  deepInfraDefaultModelInfo,
7176
7330
  deepSeekDefaultModelId,
7177
7331
  deepSeekModels,
7332
+ defineCustomTool,
7178
7333
  discriminatedProviderSettingsWithIdSchema,
7179
7334
  doubaoDefaultModelId,
7180
7335
  doubaoDefaultModelInfo,
@@ -7188,6 +7343,7 @@ export {
7188
7343
  extensionBridgeEventSchema,
7189
7344
  extensionInstanceSchema,
7190
7345
  extractApiProviderErrorProperties,
7346
+ extractConsecutiveMistakeErrorProperties,
7191
7347
  extractMessageFromJsonPayload,
7192
7348
  fauxProviders,
7193
7349
  featherlessDefaultModelId,
@@ -7222,6 +7378,7 @@ export {
7222
7378
  ioIntelligenceModels,
7223
7379
  ipcMessageSchema,
7224
7380
  isApiProviderError,
7381
+ isConsecutiveMistakeError,
7225
7382
  isContextManagementEvent,
7226
7383
  isCustomProvider,
7227
7384
  isDynamicProvider,
@@ -7282,6 +7439,7 @@ export {
7282
7439
  organizationDefaultSettingsSchema,
7283
7440
  organizationFeaturesSchema,
7284
7441
  organizationSettingsSchema,
7442
+ z17 as parametersSchema,
7285
7443
  promptComponentSchema,
7286
7444
  providerNames,
7287
7445
  providerNamesSchema,