@skj1724/oh-my-opencode 3.19.7 → 3.19.9
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/cli/index.js +22 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +251 -0
- package/dist/features/background-agent/manager.d.ts +6 -2
- package/dist/features/background-agent/types.d.ts +2 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/runtime-fallback/index.d.ts +4 -0
- package/dist/index.js +709 -345
- package/dist/shared/provider-error-classifier.d.ts +1 -1
- package/dist/shared/runtime-fallback.d.ts +15 -1
- package/dist/tools/delegate-task/tools.d.ts +3 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -8467,7 +8467,7 @@ var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
|
8467
8467
|
// package.json
|
|
8468
8468
|
var package_default = {
|
|
8469
8469
|
name: "@skj1724/oh-my-opencode",
|
|
8470
|
-
version: "3.19.
|
|
8470
|
+
version: "3.19.9",
|
|
8471
8471
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
8472
8472
|
main: "dist/index.js",
|
|
8473
8473
|
types: "dist/index.d.ts",
|
|
@@ -25014,6 +25014,23 @@ var BuiltinCommandNameSchema = exports_external.enum([
|
|
|
25014
25014
|
"init-deep",
|
|
25015
25015
|
"start-work"
|
|
25016
25016
|
]);
|
|
25017
|
+
var ProviderModelStringSchema = exports_external.string().refine((value) => {
|
|
25018
|
+
const separatorIndex = value.indexOf("/");
|
|
25019
|
+
return separatorIndex > 0 && separatorIndex < value.length - 1;
|
|
25020
|
+
}, "Expected provider/model format");
|
|
25021
|
+
var NonEmptyStringSchema = exports_external.string().min(1);
|
|
25022
|
+
var FallbackModelEntrySchema = exports_external.union([
|
|
25023
|
+
exports_external.object({
|
|
25024
|
+
model: ProviderModelStringSchema,
|
|
25025
|
+
variant: exports_external.string().optional()
|
|
25026
|
+
}).strict(),
|
|
25027
|
+
exports_external.object({
|
|
25028
|
+
providerID: NonEmptyStringSchema,
|
|
25029
|
+
modelID: NonEmptyStringSchema,
|
|
25030
|
+
variant: exports_external.string().optional()
|
|
25031
|
+
}).strict()
|
|
25032
|
+
]);
|
|
25033
|
+
var FallbackModelsSchema = exports_external.array(FallbackModelEntrySchema);
|
|
25017
25034
|
var AgentOverrideConfigSchema = exports_external.object({
|
|
25018
25035
|
model: exports_external.string().optional(),
|
|
25019
25036
|
variant: exports_external.string().optional(),
|
|
@@ -25028,7 +25045,8 @@ var AgentOverrideConfigSchema = exports_external.object({
|
|
|
25028
25045
|
description: exports_external.string().optional(),
|
|
25029
25046
|
mode: exports_external.enum(["subagent", "primary", "all"]).optional(),
|
|
25030
25047
|
color: exports_external.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
25031
|
-
permission: AgentPermissionSchema.optional()
|
|
25048
|
+
permission: AgentPermissionSchema.optional(),
|
|
25049
|
+
fallback_models: FallbackModelsSchema.optional()
|
|
25032
25050
|
});
|
|
25033
25051
|
var AgentOverridesSchema = exports_external.object({
|
|
25034
25052
|
build: AgentOverrideConfigSchema.optional(),
|
|
@@ -25064,6 +25082,7 @@ var CategoryConfigSchema = exports_external.object({
|
|
|
25064
25082
|
description: exports_external.string().optional(),
|
|
25065
25083
|
model: exports_external.string().optional(),
|
|
25066
25084
|
variant: exports_external.string().optional(),
|
|
25085
|
+
fallback_models: FallbackModelsSchema.optional(),
|
|
25067
25086
|
temperature: exports_external.number().min(0).max(2).optional(),
|
|
25068
25087
|
top_p: exports_external.number().min(0).max(1).optional(),
|
|
25069
25088
|
maxTokens: exports_external.number().optional(),
|
|
@@ -25194,6 +25213,7 @@ var GitMasterConfigSchema = exports_external.object({
|
|
|
25194
25213
|
var RuntimeFallbackConfigSchema = exports_external.object({
|
|
25195
25214
|
enabled: exports_external.boolean().default(true),
|
|
25196
25215
|
max_attempts: exports_external.number().min(0).default(3),
|
|
25216
|
+
max_retries_before_fallback: exports_external.number().min(0).default(2),
|
|
25197
25217
|
initial_delay_ms: exports_external.number().min(0).default(2000),
|
|
25198
25218
|
backoff_factor: exports_external.number().min(1).default(2),
|
|
25199
25219
|
max_delay_ms: exports_external.number().min(0).default(30000),
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OhMyOpenCodeConfigSchema, AgentOverrideConfigSchema, AgentOverridesSchema, McpNameSchema, AgentNameSchema, HookNameSchema, BuiltinCommandNameSchema, SisyphusAgentConfigSchema, ExperimentalConfigSchema, RalphLoopConfigSchema, } from "./schema";
|
|
2
|
-
export type { OhMyOpenCodeConfig, AgentOverrideConfig, AgentOverrides, McpName, AgentName, HookName, BuiltinCommandName, SisyphusAgentConfig, ExperimentalConfig, DynamicContextPruningConfig, RalphLoopConfig, } from "./schema";
|
|
1
|
+
export { OhMyOpenCodeConfigSchema, AgentOverrideConfigSchema, AgentOverridesSchema, McpNameSchema, AgentNameSchema, HookNameSchema, BuiltinCommandNameSchema, SisyphusAgentConfigSchema, ExperimentalConfigSchema, RalphLoopConfigSchema, FallbackModelEntrySchema, } from "./schema";
|
|
2
|
+
export type { OhMyOpenCodeConfig, AgentOverrideConfig, AgentOverrides, McpName, AgentName, HookName, BuiltinCommandName, SisyphusAgentConfig, ExperimentalConfig, DynamicContextPruningConfig, RalphLoopConfig, RuntimeFallbackConfig, FallbackModelEntry, } from "./schema";
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -79,6 +79,14 @@ export declare const BuiltinCommandNameSchema: z.ZodEnum<{
|
|
|
79
79
|
"start-work": "start-work";
|
|
80
80
|
"init-deep": "init-deep";
|
|
81
81
|
}>;
|
|
82
|
+
export declare const FallbackModelEntrySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
83
|
+
model: z.ZodString;
|
|
84
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
86
|
+
providerID: z.ZodString;
|
|
87
|
+
modelID: z.ZodString;
|
|
88
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strict>]>;
|
|
82
90
|
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
83
91
|
model: z.ZodOptional<z.ZodString>;
|
|
84
92
|
variant: z.ZodOptional<z.ZodString>;
|
|
@@ -128,6 +136,14 @@ export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
|
128
136
|
ask: "ask";
|
|
129
137
|
}>>;
|
|
130
138
|
}, z.core.$strip>>;
|
|
139
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
140
|
+
model: z.ZodString;
|
|
141
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
143
|
+
providerID: z.ZodString;
|
|
144
|
+
modelID: z.ZodString;
|
|
145
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>]>>>;
|
|
131
147
|
}, z.core.$strip>;
|
|
132
148
|
export declare const AgentOverridesSchema: z.ZodObject<{
|
|
133
149
|
build: z.ZodOptional<z.ZodObject<{
|
|
@@ -179,6 +195,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
179
195
|
ask: "ask";
|
|
180
196
|
}>>;
|
|
181
197
|
}, z.core.$strip>>;
|
|
198
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
199
|
+
model: z.ZodString;
|
|
200
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
201
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
202
|
+
providerID: z.ZodString;
|
|
203
|
+
modelID: z.ZodString;
|
|
204
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
205
|
+
}, z.core.$strict>]>>>;
|
|
182
206
|
}, z.core.$strip>>;
|
|
183
207
|
plan: z.ZodOptional<z.ZodObject<{
|
|
184
208
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -229,6 +253,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
229
253
|
ask: "ask";
|
|
230
254
|
}>>;
|
|
231
255
|
}, z.core.$strip>>;
|
|
256
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
257
|
+
model: z.ZodString;
|
|
258
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
259
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
260
|
+
providerID: z.ZodString;
|
|
261
|
+
modelID: z.ZodString;
|
|
262
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
263
|
+
}, z.core.$strict>]>>>;
|
|
232
264
|
}, z.core.$strip>>;
|
|
233
265
|
sisyphus: z.ZodOptional<z.ZodObject<{
|
|
234
266
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -279,6 +311,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
279
311
|
ask: "ask";
|
|
280
312
|
}>>;
|
|
281
313
|
}, z.core.$strip>>;
|
|
314
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
315
|
+
model: z.ZodString;
|
|
316
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
317
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
318
|
+
providerID: z.ZodString;
|
|
319
|
+
modelID: z.ZodString;
|
|
320
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
321
|
+
}, z.core.$strict>]>>>;
|
|
282
322
|
}, z.core.$strip>>;
|
|
283
323
|
"sisyphus-junior": z.ZodOptional<z.ZodObject<{
|
|
284
324
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -329,6 +369,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
329
369
|
ask: "ask";
|
|
330
370
|
}>>;
|
|
331
371
|
}, z.core.$strip>>;
|
|
372
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
373
|
+
model: z.ZodString;
|
|
374
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
375
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
376
|
+
providerID: z.ZodString;
|
|
377
|
+
modelID: z.ZodString;
|
|
378
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
379
|
+
}, z.core.$strict>]>>>;
|
|
332
380
|
}, z.core.$strip>>;
|
|
333
381
|
"OpenCode-Builder": z.ZodOptional<z.ZodObject<{
|
|
334
382
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -379,6 +427,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
379
427
|
ask: "ask";
|
|
380
428
|
}>>;
|
|
381
429
|
}, z.core.$strip>>;
|
|
430
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
431
|
+
model: z.ZodString;
|
|
432
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
433
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
434
|
+
providerID: z.ZodString;
|
|
435
|
+
modelID: z.ZodString;
|
|
436
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
437
|
+
}, z.core.$strict>]>>>;
|
|
382
438
|
}, z.core.$strip>>;
|
|
383
439
|
prometheus: z.ZodOptional<z.ZodObject<{
|
|
384
440
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -429,6 +485,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
429
485
|
ask: "ask";
|
|
430
486
|
}>>;
|
|
431
487
|
}, z.core.$strip>>;
|
|
488
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
489
|
+
model: z.ZodString;
|
|
490
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
491
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
492
|
+
providerID: z.ZodString;
|
|
493
|
+
modelID: z.ZodString;
|
|
494
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
495
|
+
}, z.core.$strict>]>>>;
|
|
432
496
|
}, z.core.$strip>>;
|
|
433
497
|
metis: z.ZodOptional<z.ZodObject<{
|
|
434
498
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -479,6 +543,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
479
543
|
ask: "ask";
|
|
480
544
|
}>>;
|
|
481
545
|
}, z.core.$strip>>;
|
|
546
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
547
|
+
model: z.ZodString;
|
|
548
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
549
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
550
|
+
providerID: z.ZodString;
|
|
551
|
+
modelID: z.ZodString;
|
|
552
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
553
|
+
}, z.core.$strict>]>>>;
|
|
482
554
|
}, z.core.$strip>>;
|
|
483
555
|
momus: z.ZodOptional<z.ZodObject<{
|
|
484
556
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -529,6 +601,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
529
601
|
ask: "ask";
|
|
530
602
|
}>>;
|
|
531
603
|
}, z.core.$strip>>;
|
|
604
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
605
|
+
model: z.ZodString;
|
|
606
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
607
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
608
|
+
providerID: z.ZodString;
|
|
609
|
+
modelID: z.ZodString;
|
|
610
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
611
|
+
}, z.core.$strict>]>>>;
|
|
532
612
|
}, z.core.$strip>>;
|
|
533
613
|
oracle: z.ZodOptional<z.ZodObject<{
|
|
534
614
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -579,6 +659,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
579
659
|
ask: "ask";
|
|
580
660
|
}>>;
|
|
581
661
|
}, z.core.$strip>>;
|
|
662
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
663
|
+
model: z.ZodString;
|
|
664
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
665
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
666
|
+
providerID: z.ZodString;
|
|
667
|
+
modelID: z.ZodString;
|
|
668
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
669
|
+
}, z.core.$strict>]>>>;
|
|
582
670
|
}, z.core.$strip>>;
|
|
583
671
|
librarian: z.ZodOptional<z.ZodObject<{
|
|
584
672
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -629,6 +717,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
629
717
|
ask: "ask";
|
|
630
718
|
}>>;
|
|
631
719
|
}, z.core.$strip>>;
|
|
720
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
721
|
+
model: z.ZodString;
|
|
722
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
723
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
724
|
+
providerID: z.ZodString;
|
|
725
|
+
modelID: z.ZodString;
|
|
726
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
727
|
+
}, z.core.$strict>]>>>;
|
|
632
728
|
}, z.core.$strip>>;
|
|
633
729
|
explore: z.ZodOptional<z.ZodObject<{
|
|
634
730
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -679,6 +775,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
679
775
|
ask: "ask";
|
|
680
776
|
}>>;
|
|
681
777
|
}, z.core.$strip>>;
|
|
778
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
779
|
+
model: z.ZodString;
|
|
780
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
781
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
782
|
+
providerID: z.ZodString;
|
|
783
|
+
modelID: z.ZodString;
|
|
784
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
785
|
+
}, z.core.$strict>]>>>;
|
|
682
786
|
}, z.core.$strip>>;
|
|
683
787
|
"multimodal-looker": z.ZodOptional<z.ZodObject<{
|
|
684
788
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -729,6 +833,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
729
833
|
ask: "ask";
|
|
730
834
|
}>>;
|
|
731
835
|
}, z.core.$strip>>;
|
|
836
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
837
|
+
model: z.ZodString;
|
|
838
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
839
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
840
|
+
providerID: z.ZodString;
|
|
841
|
+
modelID: z.ZodString;
|
|
842
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
843
|
+
}, z.core.$strict>]>>>;
|
|
732
844
|
}, z.core.$strip>>;
|
|
733
845
|
atlas: z.ZodOptional<z.ZodObject<{
|
|
734
846
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -779,6 +891,14 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
779
891
|
ask: "ask";
|
|
780
892
|
}>>;
|
|
781
893
|
}, z.core.$strip>>;
|
|
894
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
895
|
+
model: z.ZodString;
|
|
896
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
897
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
898
|
+
providerID: z.ZodString;
|
|
899
|
+
modelID: z.ZodString;
|
|
900
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
901
|
+
}, z.core.$strict>]>>>;
|
|
782
902
|
}, z.core.$strip>>;
|
|
783
903
|
}, z.core.$strip>;
|
|
784
904
|
export declare const ClaudeCodeConfigSchema: z.ZodObject<{
|
|
@@ -800,6 +920,14 @@ export declare const CategoryConfigSchema: z.ZodObject<{
|
|
|
800
920
|
description: z.ZodOptional<z.ZodString>;
|
|
801
921
|
model: z.ZodOptional<z.ZodString>;
|
|
802
922
|
variant: z.ZodOptional<z.ZodString>;
|
|
923
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
924
|
+
model: z.ZodString;
|
|
925
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
926
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
927
|
+
providerID: z.ZodString;
|
|
928
|
+
modelID: z.ZodString;
|
|
929
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
930
|
+
}, z.core.$strict>]>>>;
|
|
803
931
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
804
932
|
top_p: z.ZodOptional<z.ZodNumber>;
|
|
805
933
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -838,6 +966,14 @@ export declare const CategoriesConfigSchema: z.ZodRecord<z.ZodString, z.ZodObjec
|
|
|
838
966
|
description: z.ZodOptional<z.ZodString>;
|
|
839
967
|
model: z.ZodOptional<z.ZodString>;
|
|
840
968
|
variant: z.ZodOptional<z.ZodString>;
|
|
969
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
970
|
+
model: z.ZodString;
|
|
971
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
972
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
973
|
+
providerID: z.ZodString;
|
|
974
|
+
modelID: z.ZodString;
|
|
975
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
976
|
+
}, z.core.$strict>]>>>;
|
|
841
977
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
842
978
|
top_p: z.ZodOptional<z.ZodNumber>;
|
|
843
979
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1020,6 +1156,7 @@ export declare const GitMasterConfigSchema: z.ZodObject<{
|
|
|
1020
1156
|
export declare const RuntimeFallbackConfigSchema: z.ZodObject<{
|
|
1021
1157
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1022
1158
|
max_attempts: z.ZodDefault<z.ZodNumber>;
|
|
1159
|
+
max_retries_before_fallback: z.ZodDefault<z.ZodNumber>;
|
|
1023
1160
|
initial_delay_ms: z.ZodDefault<z.ZodNumber>;
|
|
1024
1161
|
backoff_factor: z.ZodDefault<z.ZodNumber>;
|
|
1025
1162
|
max_delay_ms: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1133,6 +1270,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1133
1270
|
ask: "ask";
|
|
1134
1271
|
}>>;
|
|
1135
1272
|
}, z.core.$strip>>;
|
|
1273
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1274
|
+
model: z.ZodString;
|
|
1275
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1276
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1277
|
+
providerID: z.ZodString;
|
|
1278
|
+
modelID: z.ZodString;
|
|
1279
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1280
|
+
}, z.core.$strict>]>>>;
|
|
1136
1281
|
}, z.core.$strip>>;
|
|
1137
1282
|
plan: z.ZodOptional<z.ZodObject<{
|
|
1138
1283
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1183,6 +1328,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1183
1328
|
ask: "ask";
|
|
1184
1329
|
}>>;
|
|
1185
1330
|
}, z.core.$strip>>;
|
|
1331
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1332
|
+
model: z.ZodString;
|
|
1333
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1334
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1335
|
+
providerID: z.ZodString;
|
|
1336
|
+
modelID: z.ZodString;
|
|
1337
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1338
|
+
}, z.core.$strict>]>>>;
|
|
1186
1339
|
}, z.core.$strip>>;
|
|
1187
1340
|
sisyphus: z.ZodOptional<z.ZodObject<{
|
|
1188
1341
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1233,6 +1386,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1233
1386
|
ask: "ask";
|
|
1234
1387
|
}>>;
|
|
1235
1388
|
}, z.core.$strip>>;
|
|
1389
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1390
|
+
model: z.ZodString;
|
|
1391
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1392
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1393
|
+
providerID: z.ZodString;
|
|
1394
|
+
modelID: z.ZodString;
|
|
1395
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1396
|
+
}, z.core.$strict>]>>>;
|
|
1236
1397
|
}, z.core.$strip>>;
|
|
1237
1398
|
"sisyphus-junior": z.ZodOptional<z.ZodObject<{
|
|
1238
1399
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1283,6 +1444,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1283
1444
|
ask: "ask";
|
|
1284
1445
|
}>>;
|
|
1285
1446
|
}, z.core.$strip>>;
|
|
1447
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1448
|
+
model: z.ZodString;
|
|
1449
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1450
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1451
|
+
providerID: z.ZodString;
|
|
1452
|
+
modelID: z.ZodString;
|
|
1453
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1454
|
+
}, z.core.$strict>]>>>;
|
|
1286
1455
|
}, z.core.$strip>>;
|
|
1287
1456
|
"OpenCode-Builder": z.ZodOptional<z.ZodObject<{
|
|
1288
1457
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1333,6 +1502,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1333
1502
|
ask: "ask";
|
|
1334
1503
|
}>>;
|
|
1335
1504
|
}, z.core.$strip>>;
|
|
1505
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1506
|
+
model: z.ZodString;
|
|
1507
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1508
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1509
|
+
providerID: z.ZodString;
|
|
1510
|
+
modelID: z.ZodString;
|
|
1511
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1512
|
+
}, z.core.$strict>]>>>;
|
|
1336
1513
|
}, z.core.$strip>>;
|
|
1337
1514
|
prometheus: z.ZodOptional<z.ZodObject<{
|
|
1338
1515
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1383,6 +1560,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1383
1560
|
ask: "ask";
|
|
1384
1561
|
}>>;
|
|
1385
1562
|
}, z.core.$strip>>;
|
|
1563
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1564
|
+
model: z.ZodString;
|
|
1565
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1566
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1567
|
+
providerID: z.ZodString;
|
|
1568
|
+
modelID: z.ZodString;
|
|
1569
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1570
|
+
}, z.core.$strict>]>>>;
|
|
1386
1571
|
}, z.core.$strip>>;
|
|
1387
1572
|
metis: z.ZodOptional<z.ZodObject<{
|
|
1388
1573
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1433,6 +1618,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1433
1618
|
ask: "ask";
|
|
1434
1619
|
}>>;
|
|
1435
1620
|
}, z.core.$strip>>;
|
|
1621
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1622
|
+
model: z.ZodString;
|
|
1623
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1624
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1625
|
+
providerID: z.ZodString;
|
|
1626
|
+
modelID: z.ZodString;
|
|
1627
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1628
|
+
}, z.core.$strict>]>>>;
|
|
1436
1629
|
}, z.core.$strip>>;
|
|
1437
1630
|
momus: z.ZodOptional<z.ZodObject<{
|
|
1438
1631
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1483,6 +1676,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1483
1676
|
ask: "ask";
|
|
1484
1677
|
}>>;
|
|
1485
1678
|
}, z.core.$strip>>;
|
|
1679
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1680
|
+
model: z.ZodString;
|
|
1681
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1682
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1683
|
+
providerID: z.ZodString;
|
|
1684
|
+
modelID: z.ZodString;
|
|
1685
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1686
|
+
}, z.core.$strict>]>>>;
|
|
1486
1687
|
}, z.core.$strip>>;
|
|
1487
1688
|
oracle: z.ZodOptional<z.ZodObject<{
|
|
1488
1689
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1533,6 +1734,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1533
1734
|
ask: "ask";
|
|
1534
1735
|
}>>;
|
|
1535
1736
|
}, z.core.$strip>>;
|
|
1737
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1738
|
+
model: z.ZodString;
|
|
1739
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1740
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1741
|
+
providerID: z.ZodString;
|
|
1742
|
+
modelID: z.ZodString;
|
|
1743
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1744
|
+
}, z.core.$strict>]>>>;
|
|
1536
1745
|
}, z.core.$strip>>;
|
|
1537
1746
|
librarian: z.ZodOptional<z.ZodObject<{
|
|
1538
1747
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1583,6 +1792,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1583
1792
|
ask: "ask";
|
|
1584
1793
|
}>>;
|
|
1585
1794
|
}, z.core.$strip>>;
|
|
1795
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1796
|
+
model: z.ZodString;
|
|
1797
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1798
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1799
|
+
providerID: z.ZodString;
|
|
1800
|
+
modelID: z.ZodString;
|
|
1801
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1802
|
+
}, z.core.$strict>]>>>;
|
|
1586
1803
|
}, z.core.$strip>>;
|
|
1587
1804
|
explore: z.ZodOptional<z.ZodObject<{
|
|
1588
1805
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1633,6 +1850,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1633
1850
|
ask: "ask";
|
|
1634
1851
|
}>>;
|
|
1635
1852
|
}, z.core.$strip>>;
|
|
1853
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1854
|
+
model: z.ZodString;
|
|
1855
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1856
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1857
|
+
providerID: z.ZodString;
|
|
1858
|
+
modelID: z.ZodString;
|
|
1859
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1860
|
+
}, z.core.$strict>]>>>;
|
|
1636
1861
|
}, z.core.$strip>>;
|
|
1637
1862
|
"multimodal-looker": z.ZodOptional<z.ZodObject<{
|
|
1638
1863
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1683,6 +1908,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1683
1908
|
ask: "ask";
|
|
1684
1909
|
}>>;
|
|
1685
1910
|
}, z.core.$strip>>;
|
|
1911
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1912
|
+
model: z.ZodString;
|
|
1913
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1914
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1915
|
+
providerID: z.ZodString;
|
|
1916
|
+
modelID: z.ZodString;
|
|
1917
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1918
|
+
}, z.core.$strict>]>>>;
|
|
1686
1919
|
}, z.core.$strip>>;
|
|
1687
1920
|
atlas: z.ZodOptional<z.ZodObject<{
|
|
1688
1921
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -1733,12 +1966,28 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1733
1966
|
ask: "ask";
|
|
1734
1967
|
}>>;
|
|
1735
1968
|
}, z.core.$strip>>;
|
|
1969
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1970
|
+
model: z.ZodString;
|
|
1971
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1972
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1973
|
+
providerID: z.ZodString;
|
|
1974
|
+
modelID: z.ZodString;
|
|
1975
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1976
|
+
}, z.core.$strict>]>>>;
|
|
1736
1977
|
}, z.core.$strip>>;
|
|
1737
1978
|
}, z.core.$strip>>;
|
|
1738
1979
|
categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1739
1980
|
description: z.ZodOptional<z.ZodString>;
|
|
1740
1981
|
model: z.ZodOptional<z.ZodString>;
|
|
1741
1982
|
variant: z.ZodOptional<z.ZodString>;
|
|
1983
|
+
fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1984
|
+
model: z.ZodString;
|
|
1985
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1986
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1987
|
+
providerID: z.ZodString;
|
|
1988
|
+
modelID: z.ZodString;
|
|
1989
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1990
|
+
}, z.core.$strict>]>>>;
|
|
1742
1991
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
1743
1992
|
top_p: z.ZodOptional<z.ZodNumber>;
|
|
1744
1993
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1869,6 +2118,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1869
2118
|
runtime_fallback: z.ZodOptional<z.ZodObject<{
|
|
1870
2119
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1871
2120
|
max_attempts: z.ZodDefault<z.ZodNumber>;
|
|
2121
|
+
max_retries_before_fallback: z.ZodDefault<z.ZodNumber>;
|
|
1872
2122
|
initial_delay_ms: z.ZodDefault<z.ZodNumber>;
|
|
1873
2123
|
backoff_factor: z.ZodDefault<z.ZodNumber>;
|
|
1874
2124
|
max_delay_ms: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1898,4 +2148,5 @@ export type CategoriesConfig = z.infer<typeof CategoriesConfigSchema>;
|
|
|
1898
2148
|
export type BuiltinCategoryName = z.infer<typeof BuiltinCategoryNameSchema>;
|
|
1899
2149
|
export type GitMasterConfig = z.infer<typeof GitMasterConfigSchema>;
|
|
1900
2150
|
export type RuntimeFallbackConfig = z.infer<typeof RuntimeFallbackConfigSchema>;
|
|
2151
|
+
export type FallbackModelEntry = z.infer<typeof FallbackModelEntrySchema>;
|
|
1901
2152
|
export { AnyMcpNameSchema, type AnyMcpName, McpNameSchema, type McpName } from "../mcp/types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
|
|
3
3
|
import type { PerfTracer } from "../../shared/perf-tracer";
|
|
4
|
-
import type { BackgroundTaskConfig } from "../../config/schema";
|
|
4
|
+
import type { BackgroundTaskConfig, RuntimeFallbackConfig } from "../../config/schema";
|
|
5
5
|
interface EventProperties {
|
|
6
6
|
sessionID?: string;
|
|
7
7
|
info?: {
|
|
@@ -13,6 +13,9 @@ interface Event {
|
|
|
13
13
|
type: string;
|
|
14
14
|
properties?: EventProperties;
|
|
15
15
|
}
|
|
16
|
+
type BackgroundManagerConfig = BackgroundTaskConfig & {
|
|
17
|
+
runtimeFallback?: RuntimeFallbackConfig;
|
|
18
|
+
};
|
|
16
19
|
export declare class BackgroundManager {
|
|
17
20
|
private static cleanupManagers;
|
|
18
21
|
private static cleanupRegistered;
|
|
@@ -30,11 +33,12 @@ export declare class BackgroundManager {
|
|
|
30
33
|
private perfTracer?;
|
|
31
34
|
private queuesByKey;
|
|
32
35
|
private processingKeys;
|
|
33
|
-
constructor(ctx: PluginInput, config?:
|
|
36
|
+
constructor(ctx: PluginInput, config?: BackgroundManagerConfig);
|
|
34
37
|
setPerfTracer(tracer: PerfTracer): void;
|
|
35
38
|
launch(input: LaunchInput): Promise<BackgroundTask>;
|
|
36
39
|
private processKey;
|
|
37
40
|
private startTask;
|
|
41
|
+
private handlePromptFailure;
|
|
38
42
|
getTask(id: string): BackgroundTask | undefined;
|
|
39
43
|
getTasksByParentSession(sessionID: string): BackgroundTask[];
|
|
40
44
|
getAllDescendantTasks(sessionID: string): BackgroundTask[];
|
|
@@ -55,6 +55,7 @@ export interface BackgroundTask {
|
|
|
55
55
|
concurrencyGroup?: string;
|
|
56
56
|
/** Parent session's agent name for notification */
|
|
57
57
|
parentAgent?: string;
|
|
58
|
+
category?: string;
|
|
58
59
|
/** Last message count for stability detection */
|
|
59
60
|
lastMsgCount?: number;
|
|
60
61
|
/** Number of consecutive polls with stable message count */
|
|
@@ -81,6 +82,7 @@ export interface LaunchInput {
|
|
|
81
82
|
modelID: string;
|
|
82
83
|
};
|
|
83
84
|
parentAgent?: string;
|
|
85
|
+
category?: string;
|
|
84
86
|
model?: {
|
|
85
87
|
providerID: string;
|
|
86
88
|
modelID: string;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -29,3 +29,4 @@ export { createAtlasHook } from "./atlas";
|
|
|
29
29
|
export { createDelegateTaskRetryHook } from "./delegate-task-retry";
|
|
30
30
|
export { createQuestionLabelTruncatorHook } from "./question-label-truncator";
|
|
31
31
|
export { createPerfProfilerHook } from "./perf-profiler";
|
|
32
|
+
export { createRuntimeFallbackHook } from "./runtime-fallback";
|
|
@@ -8,10 +8,14 @@
|
|
|
8
8
|
* 避让 sessionRecovery(可恢复错误优先由 sessionRecovery 处理)。
|
|
9
9
|
*/
|
|
10
10
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
11
|
+
import type { RuntimeFallbackConfig } from "../../config/schema";
|
|
12
|
+
import { type FallbackModel } from "../../shared/runtime-fallback";
|
|
11
13
|
export interface RuntimeFallbackOptions {
|
|
14
|
+
config?: RuntimeFallbackConfig;
|
|
12
15
|
sessionRecovery?: {
|
|
13
16
|
isRecoverableError: (error: unknown) => boolean;
|
|
14
17
|
};
|
|
18
|
+
getConfiguredFallbackModels?: (agent?: string, category?: string) => FallbackModel[] | undefined;
|
|
15
19
|
}
|
|
16
20
|
export declare function createRuntimeFallbackHook(ctx: PluginInput, options?: RuntimeFallbackOptions): {
|
|
17
21
|
handler: ({ event, }: {
|