thoth-agents 0.2.7 → 0.2.8
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/{chunk-4AC2TTUO.js → chunk-75JOF37E.js} +1 -1
- package/dist/{chunk-32672NLJ.js → chunk-FM7HCZSW.js} +992 -161
- package/dist/{chunk-N7GFXGFJ.js → chunk-YLRPDTU7.js} +234 -203
- package/dist/cli/claude-code-install.d.ts +7 -2
- package/dist/cli/codex-install.d.ts +4 -0
- package/dist/cli/commands.d.ts +13 -3
- package/dist/cli/index.js +83 -15
- package/dist/cli/managed-state-io.d.ts +1 -0
- package/dist/cli/model-catalog/cache.d.ts +29 -0
- package/dist/cli/model-catalog/index.d.ts +18 -0
- package/dist/cli/model-catalog/models-dev.d.ts +12 -0
- package/dist/cli/model-catalog/types.d.ts +19 -0
- package/dist/cli/model-effort.d.ts +11 -0
- package/dist/cli/opencode-effort.d.ts +10 -0
- package/dist/cli/operations/claude-code.d.ts +9 -0
- package/dist/cli/operations/codex.d.ts +9 -1
- package/dist/cli/operations/types.d.ts +4 -0
- package/dist/cli/paths.d.ts +1 -0
- package/dist/cli/providers.d.ts +9 -9
- package/dist/cli/tui/components/ModelChoiceScreen.d.ts +8 -0
- package/dist/cli/tui/components/ModelScreen.d.ts +1 -0
- package/dist/cli/tui/index.js +250 -335
- package/dist/cli/tui/model-catalog.d.ts +4 -8
- package/dist/cli/tui/operations.d.ts +1 -1
- package/dist/cli/types.d.ts +3 -1
- package/dist/config/constants.d.ts +26 -0
- package/dist/harness/writers/claude-code-subagent.d.ts +2 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -47,6 +47,9 @@ function getLiteConfig() {
|
|
|
47
47
|
function getLiteConfigJsonc() {
|
|
48
48
|
return join(getConfigDir(), "thoth-agents.jsonc");
|
|
49
49
|
}
|
|
50
|
+
function getOpenCodeManagedModelStatePath() {
|
|
51
|
+
return join(getConfigDir(), ".thoth-agents-managed-models.json");
|
|
52
|
+
}
|
|
50
53
|
function getExistingLiteConfigPath() {
|
|
51
54
|
const jsonPath = getLiteConfig();
|
|
52
55
|
if (existsSync(jsonPath)) return jsonPath;
|
|
@@ -74,17 +77,240 @@ function ensureOpenCodeConfigDir() {
|
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
|
|
80
|
+
// src/config/constants.ts
|
|
81
|
+
var AGENT_ALIASES = {
|
|
82
|
+
explore: "explorer",
|
|
83
|
+
"frontend-ui-ux-engineer": "designer"
|
|
84
|
+
};
|
|
85
|
+
var SUBAGENT_NAMES = [
|
|
86
|
+
"explorer",
|
|
87
|
+
"librarian",
|
|
88
|
+
"oracle",
|
|
89
|
+
"designer",
|
|
90
|
+
"quick",
|
|
91
|
+
"deep"
|
|
92
|
+
];
|
|
93
|
+
var ORCHESTRATOR_NAME = "orchestrator";
|
|
94
|
+
var ALL_AGENT_NAMES = [
|
|
95
|
+
ORCHESTRATOR_NAME,
|
|
96
|
+
"explorer",
|
|
97
|
+
"librarian",
|
|
98
|
+
"oracle",
|
|
99
|
+
"designer",
|
|
100
|
+
"quick",
|
|
101
|
+
"deep"
|
|
102
|
+
];
|
|
103
|
+
var DEFAULT_MODELS = {
|
|
104
|
+
orchestrator: void 0,
|
|
105
|
+
oracle: "openai/gpt-5.4",
|
|
106
|
+
librarian: "openai/gpt-5.4-mini",
|
|
107
|
+
explorer: "openai/gpt-5.4-mini",
|
|
108
|
+
designer: "openai/gpt-5.4-mini",
|
|
109
|
+
quick: "openai/gpt-5.4-mini",
|
|
110
|
+
deep: "openai/gpt-5.4"
|
|
111
|
+
};
|
|
112
|
+
var CONFIRMED_OPENAI_SUBAGENT_PRESET = {
|
|
113
|
+
oracle: { model: "gpt-5.6-sol", effort: "high" },
|
|
114
|
+
librarian: { model: "gpt-5.6-luna", effort: "low" },
|
|
115
|
+
explorer: { model: "gpt-5.6-luna", effort: "low" },
|
|
116
|
+
designer: { model: "gpt-5.6-terra", effort: "high" },
|
|
117
|
+
quick: { model: "gpt-5.6-luna", effort: "medium" },
|
|
118
|
+
deep: { model: "gpt-5.6-terra", effort: "xhigh" }
|
|
119
|
+
};
|
|
120
|
+
var POLL_INTERVAL_BACKGROUND_MS = 2e3;
|
|
121
|
+
var DEFAULT_TIMEOUT_MS = 2 * 60 * 1e3;
|
|
122
|
+
var MAX_POLL_TIME_MS = 5 * 60 * 1e3;
|
|
123
|
+
var DEFAULT_THOTH_COMMAND = ["npx", "-y", "thoth-mem", "mcp"];
|
|
124
|
+
|
|
125
|
+
// src/config/schema.ts
|
|
126
|
+
import { z } from "zod";
|
|
127
|
+
var AGENT_NAMES = [
|
|
128
|
+
"orchestrator",
|
|
129
|
+
"oracle",
|
|
130
|
+
"designer",
|
|
131
|
+
"explorer",
|
|
132
|
+
"librarian",
|
|
133
|
+
"quick",
|
|
134
|
+
"deep"
|
|
135
|
+
];
|
|
136
|
+
var FALLBACK_AGENT_NAMES = [...AGENT_NAMES];
|
|
137
|
+
var MANUAL_AGENT_NAMES = [...AGENT_NAMES];
|
|
138
|
+
var ProviderModelIdSchema = z.string().regex(
|
|
139
|
+
/^[^/\s]+\/[^\s]+$/,
|
|
140
|
+
"Expected provider/model format (provider/.../model)"
|
|
141
|
+
);
|
|
142
|
+
var ManualAgentPlanSchema = z.object({
|
|
143
|
+
primary: ProviderModelIdSchema,
|
|
144
|
+
fallback1: ProviderModelIdSchema,
|
|
145
|
+
fallback2: ProviderModelIdSchema,
|
|
146
|
+
fallback3: ProviderModelIdSchema
|
|
147
|
+
}).superRefine((value, ctx) => {
|
|
148
|
+
const unique = /* @__PURE__ */ new Set([
|
|
149
|
+
value.primary,
|
|
150
|
+
value.fallback1,
|
|
151
|
+
value.fallback2,
|
|
152
|
+
value.fallback3
|
|
153
|
+
]);
|
|
154
|
+
if (unique.size !== 4) {
|
|
155
|
+
ctx.addIssue({
|
|
156
|
+
code: z.ZodIssueCode.custom,
|
|
157
|
+
message: "primary and fallbacks must be unique per agent"
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
var ManualPlanSchema = z.object({
|
|
162
|
+
orchestrator: ManualAgentPlanSchema,
|
|
163
|
+
oracle: ManualAgentPlanSchema,
|
|
164
|
+
designer: ManualAgentPlanSchema,
|
|
165
|
+
explorer: ManualAgentPlanSchema,
|
|
166
|
+
librarian: ManualAgentPlanSchema,
|
|
167
|
+
quick: ManualAgentPlanSchema,
|
|
168
|
+
deep: ManualAgentPlanSchema
|
|
169
|
+
}).strict();
|
|
170
|
+
var AgentModelChainSchema = z.array(z.string()).min(1);
|
|
171
|
+
var FallbackChainsSchema = z.object({
|
|
172
|
+
orchestrator: AgentModelChainSchema.optional(),
|
|
173
|
+
oracle: AgentModelChainSchema.optional(),
|
|
174
|
+
designer: AgentModelChainSchema.optional(),
|
|
175
|
+
explorer: AgentModelChainSchema.optional(),
|
|
176
|
+
librarian: AgentModelChainSchema.optional(),
|
|
177
|
+
quick: AgentModelChainSchema.optional(),
|
|
178
|
+
deep: AgentModelChainSchema.optional()
|
|
179
|
+
}).catchall(AgentModelChainSchema);
|
|
180
|
+
var AgentOverrideConfigSchema = z.object({
|
|
181
|
+
model: z.union([
|
|
182
|
+
z.string(),
|
|
183
|
+
z.array(
|
|
184
|
+
z.union([
|
|
185
|
+
z.string(),
|
|
186
|
+
z.object({
|
|
187
|
+
id: z.string(),
|
|
188
|
+
variant: z.string().optional()
|
|
189
|
+
})
|
|
190
|
+
])
|
|
191
|
+
)
|
|
192
|
+
]).optional(),
|
|
193
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
194
|
+
steps: z.number().int().min(1).optional(),
|
|
195
|
+
variant: z.string().optional().catch(void 0)
|
|
196
|
+
});
|
|
197
|
+
var TmuxLayoutSchema = z.enum([
|
|
198
|
+
"main-horizontal",
|
|
199
|
+
// Main pane on top, agents stacked below
|
|
200
|
+
"main-vertical",
|
|
201
|
+
// Main pane on left, agents stacked on right
|
|
202
|
+
"tiled",
|
|
203
|
+
// All panes equal size grid
|
|
204
|
+
"even-horizontal",
|
|
205
|
+
// All panes side by side
|
|
206
|
+
"even-vertical"
|
|
207
|
+
// All panes stacked vertically
|
|
208
|
+
]);
|
|
209
|
+
var TmuxConfigSchema = z.object({
|
|
210
|
+
enabled: z.boolean().default(false),
|
|
211
|
+
layout: TmuxLayoutSchema.default("main-vertical"),
|
|
212
|
+
main_pane_size: z.number().min(20).max(80).default(60)
|
|
213
|
+
// percentage for main pane
|
|
214
|
+
});
|
|
215
|
+
var PresetSchema = z.record(z.string(), AgentOverrideConfigSchema);
|
|
216
|
+
var AgentNameSchema = z.enum(AGENT_NAMES);
|
|
217
|
+
var McpNameSchema = z.enum([
|
|
218
|
+
"exa",
|
|
219
|
+
"context7",
|
|
220
|
+
"grep_app",
|
|
221
|
+
"thoth_mem"
|
|
222
|
+
]);
|
|
223
|
+
var ThothConfigSchema = z.object({
|
|
224
|
+
command: z.array(z.string()).optional(),
|
|
225
|
+
data_dir: z.string().optional(),
|
|
226
|
+
environment: z.record(z.string(), z.string()).optional(),
|
|
227
|
+
timeout: z.number().optional(),
|
|
228
|
+
http_port: z.number().optional()
|
|
229
|
+
});
|
|
230
|
+
var ArtifactStoreModeSchema = z.enum([
|
|
231
|
+
"thoth-mem",
|
|
232
|
+
"openspec",
|
|
233
|
+
"hybrid"
|
|
234
|
+
]);
|
|
235
|
+
var ArtifactStoreConfigSchema = z.object({
|
|
236
|
+
mode: ArtifactStoreModeSchema.default("hybrid")
|
|
237
|
+
});
|
|
238
|
+
var CodexGenerationConfigSchema = z.object({
|
|
239
|
+
enabled: z.boolean().default(false),
|
|
240
|
+
outputRoot: z.string().optional(),
|
|
241
|
+
dryRun: z.boolean().default(true)
|
|
242
|
+
});
|
|
243
|
+
var ClaudeCodeGenerationConfigSchema = z.object({
|
|
244
|
+
enabled: z.boolean().default(false),
|
|
245
|
+
outputRoot: z.string().optional(),
|
|
246
|
+
dryRun: z.boolean().default(true)
|
|
247
|
+
});
|
|
248
|
+
var FailoverConfigSchema = z.object({
|
|
249
|
+
enabled: z.boolean().default(true),
|
|
250
|
+
timeoutMs: z.number().min(0).default(15e3),
|
|
251
|
+
retryDelayMs: z.number().min(0).default(500),
|
|
252
|
+
chains: FallbackChainsSchema.default({})
|
|
253
|
+
});
|
|
254
|
+
var PluginConfigSchema = z.object({
|
|
255
|
+
$schema: z.string().optional(),
|
|
256
|
+
preset: z.string().optional(),
|
|
257
|
+
setDefaultAgent: z.boolean().optional(),
|
|
258
|
+
scoringEngineVersion: z.enum(["v1", "v2-shadow", "v2"]).optional(),
|
|
259
|
+
balanceProviderUsage: z.boolean().optional(),
|
|
260
|
+
manualPlan: ManualPlanSchema.optional(),
|
|
261
|
+
presets: z.record(z.string(), PresetSchema).optional(),
|
|
262
|
+
agents: z.record(z.string(), AgentOverrideConfigSchema).optional(),
|
|
263
|
+
disabled_mcps: z.array(z.string()).optional(),
|
|
264
|
+
tmux: TmuxConfigSchema.optional(),
|
|
265
|
+
fallback: FailoverConfigSchema.optional(),
|
|
266
|
+
thoth: ThothConfigSchema.optional(),
|
|
267
|
+
artifactStore: ArtifactStoreConfigSchema.optional(),
|
|
268
|
+
codex: CodexGenerationConfigSchema.optional(),
|
|
269
|
+
claudeCode: ClaudeCodeGenerationConfigSchema.optional()
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// src/config/utils.ts
|
|
273
|
+
function getAgentOverride(config, name) {
|
|
274
|
+
const overrides = config?.agents ?? {};
|
|
275
|
+
return overrides[name] ?? overrides[Object.keys(AGENT_ALIASES).find((k) => AGENT_ALIASES[k] === name) ?? ""];
|
|
276
|
+
}
|
|
277
|
+
function getPrimaryModelId(model) {
|
|
278
|
+
if (Array.isArray(model)) {
|
|
279
|
+
const first = model[0];
|
|
280
|
+
return typeof first === "string" ? first : first?.id;
|
|
281
|
+
}
|
|
282
|
+
return model;
|
|
283
|
+
}
|
|
284
|
+
|
|
77
285
|
// src/cli/providers.ts
|
|
78
286
|
var THOTH_AGENTS_CONFIG_SCHEMA_URL = "https://unpkg.com/thoth-agents@latest/thoth-agents.schema.json";
|
|
79
287
|
var MODEL_MAPPINGS = {
|
|
80
288
|
openai: {
|
|
81
289
|
orchestrator: { model: "openai/gpt-5.4" },
|
|
82
|
-
oracle: {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
290
|
+
oracle: {
|
|
291
|
+
model: `openai/${CONFIRMED_OPENAI_SUBAGENT_PRESET.oracle.model}`,
|
|
292
|
+
variant: CONFIRMED_OPENAI_SUBAGENT_PRESET.oracle.effort
|
|
293
|
+
},
|
|
294
|
+
librarian: {
|
|
295
|
+
model: `openai/${CONFIRMED_OPENAI_SUBAGENT_PRESET.librarian.model}`,
|
|
296
|
+
variant: CONFIRMED_OPENAI_SUBAGENT_PRESET.librarian.effort
|
|
297
|
+
},
|
|
298
|
+
explorer: {
|
|
299
|
+
model: `openai/${CONFIRMED_OPENAI_SUBAGENT_PRESET.explorer.model}`,
|
|
300
|
+
variant: CONFIRMED_OPENAI_SUBAGENT_PRESET.explorer.effort
|
|
301
|
+
},
|
|
302
|
+
designer: {
|
|
303
|
+
model: `openai/${CONFIRMED_OPENAI_SUBAGENT_PRESET.designer.model}`,
|
|
304
|
+
variant: CONFIRMED_OPENAI_SUBAGENT_PRESET.designer.effort
|
|
305
|
+
},
|
|
306
|
+
quick: {
|
|
307
|
+
model: `openai/${CONFIRMED_OPENAI_SUBAGENT_PRESET.quick.model}`,
|
|
308
|
+
variant: CONFIRMED_OPENAI_SUBAGENT_PRESET.quick.effort
|
|
309
|
+
},
|
|
310
|
+
deep: {
|
|
311
|
+
model: `openai/${CONFIRMED_OPENAI_SUBAGENT_PRESET.deep.model}`,
|
|
312
|
+
variant: CONFIRMED_OPENAI_SUBAGENT_PRESET.deep.effort
|
|
313
|
+
}
|
|
88
314
|
},
|
|
89
315
|
kimi: {
|
|
90
316
|
orchestrator: { model: "kimi-for-coding/k2p5" },
|
|
@@ -341,153 +567,6 @@ function detectCurrentConfig() {
|
|
|
341
567
|
return result;
|
|
342
568
|
}
|
|
343
569
|
|
|
344
|
-
// src/config/schema.ts
|
|
345
|
-
import { z } from "zod";
|
|
346
|
-
var AGENT_NAMES = [
|
|
347
|
-
"orchestrator",
|
|
348
|
-
"oracle",
|
|
349
|
-
"designer",
|
|
350
|
-
"explorer",
|
|
351
|
-
"librarian",
|
|
352
|
-
"quick",
|
|
353
|
-
"deep"
|
|
354
|
-
];
|
|
355
|
-
var FALLBACK_AGENT_NAMES = [...AGENT_NAMES];
|
|
356
|
-
var MANUAL_AGENT_NAMES = [...AGENT_NAMES];
|
|
357
|
-
var ProviderModelIdSchema = z.string().regex(
|
|
358
|
-
/^[^/\s]+\/[^\s]+$/,
|
|
359
|
-
"Expected provider/model format (provider/.../model)"
|
|
360
|
-
);
|
|
361
|
-
var ManualAgentPlanSchema = z.object({
|
|
362
|
-
primary: ProviderModelIdSchema,
|
|
363
|
-
fallback1: ProviderModelIdSchema,
|
|
364
|
-
fallback2: ProviderModelIdSchema,
|
|
365
|
-
fallback3: ProviderModelIdSchema
|
|
366
|
-
}).superRefine((value, ctx) => {
|
|
367
|
-
const unique = /* @__PURE__ */ new Set([
|
|
368
|
-
value.primary,
|
|
369
|
-
value.fallback1,
|
|
370
|
-
value.fallback2,
|
|
371
|
-
value.fallback3
|
|
372
|
-
]);
|
|
373
|
-
if (unique.size !== 4) {
|
|
374
|
-
ctx.addIssue({
|
|
375
|
-
code: z.ZodIssueCode.custom,
|
|
376
|
-
message: "primary and fallbacks must be unique per agent"
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
var ManualPlanSchema = z.object({
|
|
381
|
-
orchestrator: ManualAgentPlanSchema,
|
|
382
|
-
oracle: ManualAgentPlanSchema,
|
|
383
|
-
designer: ManualAgentPlanSchema,
|
|
384
|
-
explorer: ManualAgentPlanSchema,
|
|
385
|
-
librarian: ManualAgentPlanSchema,
|
|
386
|
-
quick: ManualAgentPlanSchema,
|
|
387
|
-
deep: ManualAgentPlanSchema
|
|
388
|
-
}).strict();
|
|
389
|
-
var AgentModelChainSchema = z.array(z.string()).min(1);
|
|
390
|
-
var FallbackChainsSchema = z.object({
|
|
391
|
-
orchestrator: AgentModelChainSchema.optional(),
|
|
392
|
-
oracle: AgentModelChainSchema.optional(),
|
|
393
|
-
designer: AgentModelChainSchema.optional(),
|
|
394
|
-
explorer: AgentModelChainSchema.optional(),
|
|
395
|
-
librarian: AgentModelChainSchema.optional(),
|
|
396
|
-
quick: AgentModelChainSchema.optional(),
|
|
397
|
-
deep: AgentModelChainSchema.optional()
|
|
398
|
-
}).catchall(AgentModelChainSchema);
|
|
399
|
-
var AgentOverrideConfigSchema = z.object({
|
|
400
|
-
model: z.union([
|
|
401
|
-
z.string(),
|
|
402
|
-
z.array(
|
|
403
|
-
z.union([
|
|
404
|
-
z.string(),
|
|
405
|
-
z.object({
|
|
406
|
-
id: z.string(),
|
|
407
|
-
variant: z.string().optional()
|
|
408
|
-
})
|
|
409
|
-
])
|
|
410
|
-
)
|
|
411
|
-
]).optional(),
|
|
412
|
-
temperature: z.number().min(0).max(2).optional(),
|
|
413
|
-
steps: z.number().int().min(1).optional(),
|
|
414
|
-
variant: z.string().optional().catch(void 0)
|
|
415
|
-
});
|
|
416
|
-
var TmuxLayoutSchema = z.enum([
|
|
417
|
-
"main-horizontal",
|
|
418
|
-
// Main pane on top, agents stacked below
|
|
419
|
-
"main-vertical",
|
|
420
|
-
// Main pane on left, agents stacked on right
|
|
421
|
-
"tiled",
|
|
422
|
-
// All panes equal size grid
|
|
423
|
-
"even-horizontal",
|
|
424
|
-
// All panes side by side
|
|
425
|
-
"even-vertical"
|
|
426
|
-
// All panes stacked vertically
|
|
427
|
-
]);
|
|
428
|
-
var TmuxConfigSchema = z.object({
|
|
429
|
-
enabled: z.boolean().default(false),
|
|
430
|
-
layout: TmuxLayoutSchema.default("main-vertical"),
|
|
431
|
-
main_pane_size: z.number().min(20).max(80).default(60)
|
|
432
|
-
// percentage for main pane
|
|
433
|
-
});
|
|
434
|
-
var PresetSchema = z.record(z.string(), AgentOverrideConfigSchema);
|
|
435
|
-
var AgentNameSchema = z.enum(AGENT_NAMES);
|
|
436
|
-
var McpNameSchema = z.enum([
|
|
437
|
-
"exa",
|
|
438
|
-
"context7",
|
|
439
|
-
"grep_app",
|
|
440
|
-
"thoth_mem"
|
|
441
|
-
]);
|
|
442
|
-
var ThothConfigSchema = z.object({
|
|
443
|
-
command: z.array(z.string()).optional(),
|
|
444
|
-
data_dir: z.string().optional(),
|
|
445
|
-
environment: z.record(z.string(), z.string()).optional(),
|
|
446
|
-
timeout: z.number().optional(),
|
|
447
|
-
http_port: z.number().optional()
|
|
448
|
-
});
|
|
449
|
-
var ArtifactStoreModeSchema = z.enum([
|
|
450
|
-
"thoth-mem",
|
|
451
|
-
"openspec",
|
|
452
|
-
"hybrid"
|
|
453
|
-
]);
|
|
454
|
-
var ArtifactStoreConfigSchema = z.object({
|
|
455
|
-
mode: ArtifactStoreModeSchema.default("hybrid")
|
|
456
|
-
});
|
|
457
|
-
var CodexGenerationConfigSchema = z.object({
|
|
458
|
-
enabled: z.boolean().default(false),
|
|
459
|
-
outputRoot: z.string().optional(),
|
|
460
|
-
dryRun: z.boolean().default(true)
|
|
461
|
-
});
|
|
462
|
-
var ClaudeCodeGenerationConfigSchema = z.object({
|
|
463
|
-
enabled: z.boolean().default(false),
|
|
464
|
-
outputRoot: z.string().optional(),
|
|
465
|
-
dryRun: z.boolean().default(true)
|
|
466
|
-
});
|
|
467
|
-
var FailoverConfigSchema = z.object({
|
|
468
|
-
enabled: z.boolean().default(true),
|
|
469
|
-
timeoutMs: z.number().min(0).default(15e3),
|
|
470
|
-
retryDelayMs: z.number().min(0).default(500),
|
|
471
|
-
chains: FallbackChainsSchema.default({})
|
|
472
|
-
});
|
|
473
|
-
var PluginConfigSchema = z.object({
|
|
474
|
-
$schema: z.string().optional(),
|
|
475
|
-
preset: z.string().optional(),
|
|
476
|
-
setDefaultAgent: z.boolean().optional(),
|
|
477
|
-
scoringEngineVersion: z.enum(["v1", "v2-shadow", "v2"]).optional(),
|
|
478
|
-
balanceProviderUsage: z.boolean().optional(),
|
|
479
|
-
manualPlan: ManualPlanSchema.optional(),
|
|
480
|
-
presets: z.record(z.string(), PresetSchema).optional(),
|
|
481
|
-
agents: z.record(z.string(), AgentOverrideConfigSchema).optional(),
|
|
482
|
-
disabled_mcps: z.array(z.string()).optional(),
|
|
483
|
-
tmux: TmuxConfigSchema.optional(),
|
|
484
|
-
fallback: FailoverConfigSchema.optional(),
|
|
485
|
-
thoth: ThothConfigSchema.optional(),
|
|
486
|
-
artifactStore: ArtifactStoreConfigSchema.optional(),
|
|
487
|
-
codex: CodexGenerationConfigSchema.optional(),
|
|
488
|
-
claudeCode: ClaudeCodeGenerationConfigSchema.optional()
|
|
489
|
-
});
|
|
490
|
-
|
|
491
570
|
// src/config/loader.ts
|
|
492
571
|
var PROMPTS_DIR_NAME = "thoth-agents";
|
|
493
572
|
function loadConfigFromPath(configPath) {
|
|
@@ -617,56 +696,6 @@ function loadAgentPrompt(agentName, preset) {
|
|
|
617
696
|
return result;
|
|
618
697
|
}
|
|
619
698
|
|
|
620
|
-
// src/config/constants.ts
|
|
621
|
-
var AGENT_ALIASES = {
|
|
622
|
-
explore: "explorer",
|
|
623
|
-
"frontend-ui-ux-engineer": "designer"
|
|
624
|
-
};
|
|
625
|
-
var SUBAGENT_NAMES = [
|
|
626
|
-
"explorer",
|
|
627
|
-
"librarian",
|
|
628
|
-
"oracle",
|
|
629
|
-
"designer",
|
|
630
|
-
"quick",
|
|
631
|
-
"deep"
|
|
632
|
-
];
|
|
633
|
-
var ORCHESTRATOR_NAME = "orchestrator";
|
|
634
|
-
var ALL_AGENT_NAMES = [
|
|
635
|
-
ORCHESTRATOR_NAME,
|
|
636
|
-
"explorer",
|
|
637
|
-
"librarian",
|
|
638
|
-
"oracle",
|
|
639
|
-
"designer",
|
|
640
|
-
"quick",
|
|
641
|
-
"deep"
|
|
642
|
-
];
|
|
643
|
-
var DEFAULT_MODELS = {
|
|
644
|
-
orchestrator: void 0,
|
|
645
|
-
oracle: "openai/gpt-5.4",
|
|
646
|
-
librarian: "openai/gpt-5.4-mini",
|
|
647
|
-
explorer: "openai/gpt-5.4-mini",
|
|
648
|
-
designer: "openai/gpt-5.4-mini",
|
|
649
|
-
quick: "openai/gpt-5.4-mini",
|
|
650
|
-
deep: "openai/gpt-5.4"
|
|
651
|
-
};
|
|
652
|
-
var POLL_INTERVAL_BACKGROUND_MS = 2e3;
|
|
653
|
-
var DEFAULT_TIMEOUT_MS = 2 * 60 * 1e3;
|
|
654
|
-
var MAX_POLL_TIME_MS = 5 * 60 * 1e3;
|
|
655
|
-
var DEFAULT_THOTH_COMMAND = ["npx", "-y", "thoth-mem", "mcp"];
|
|
656
|
-
|
|
657
|
-
// src/config/utils.ts
|
|
658
|
-
function getAgentOverride(config, name) {
|
|
659
|
-
const overrides = config?.agents ?? {};
|
|
660
|
-
return overrides[name] ?? overrides[Object.keys(AGENT_ALIASES).find((k) => AGENT_ALIASES[k] === name) ?? ""];
|
|
661
|
-
}
|
|
662
|
-
function getPrimaryModelId(model) {
|
|
663
|
-
if (Array.isArray(model)) {
|
|
664
|
-
const first = model[0];
|
|
665
|
-
return typeof first === "string" ? first : first?.id;
|
|
666
|
-
}
|
|
667
|
-
return model;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
699
|
// src/agents/prompt-dialects.ts
|
|
671
700
|
var OPENCODE_CAPABILITIES = {
|
|
672
701
|
agentDefinitions: "supported",
|
|
@@ -2238,9 +2267,11 @@ export {
|
|
|
2238
2267
|
SUBAGENT_NAMES,
|
|
2239
2268
|
ALL_AGENT_NAMES,
|
|
2240
2269
|
DEFAULT_MODELS,
|
|
2270
|
+
CONFIRMED_OPENAI_SUBAGENT_PRESET,
|
|
2241
2271
|
POLL_INTERVAL_BACKGROUND_MS,
|
|
2242
2272
|
DEFAULT_THOTH_COMMAND,
|
|
2243
2273
|
getOpenCodeConfigPaths,
|
|
2274
|
+
getOpenCodeManagedModelStatePath,
|
|
2244
2275
|
getExistingLiteConfigPath,
|
|
2245
2276
|
getExistingConfigPath,
|
|
2246
2277
|
ensureConfigDir,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isClaudeCodeModel } from '../harness/writers/claude-code-subagent';
|
|
2
2
|
import type { ClaudeCodeInstallScope, ClaudeCodeResolvedTargets, ClaudeCodeRoleName } from './claude-code-paths';
|
|
3
3
|
import { type ManagedModelState } from './managed-state-io';
|
|
4
4
|
export { CLAUDE_CODE_ROLE_NAMES } from './claude-code-paths';
|
|
@@ -39,11 +39,16 @@ export interface ClaudeCodeApplyResult {
|
|
|
39
39
|
}
|
|
40
40
|
export interface ClaudeCodeManagedModelOverride {
|
|
41
41
|
role: ClaudeCodeRoleName;
|
|
42
|
-
model:
|
|
42
|
+
model: string;
|
|
43
|
+
catalogId?: string;
|
|
44
|
+
effort?: string;
|
|
45
|
+
clearEffort?: boolean;
|
|
43
46
|
}
|
|
44
47
|
export declare const isClaudeCodeModelAlias: typeof isClaudeCodeModel;
|
|
45
48
|
export declare function parseSubagentModel(content: string): string | undefined;
|
|
46
49
|
export declare function replaceSubagentModel(content: string, model: string): string;
|
|
50
|
+
export declare function parseSubagentEffort(content: string): string | undefined;
|
|
51
|
+
export declare function replaceSubagentEffort(content: string, effort: string | undefined): string;
|
|
47
52
|
export declare function parseManagedModelStateJson(text: string | undefined): ManagedModelState;
|
|
48
53
|
export declare function readManagedModelState(path: string): ManagedModelState;
|
|
49
54
|
export declare function buildClaudeCodeSetupPlan(config: ClaudeCodeInstallConfig): ClaudeCodeSetupPlan;
|
|
@@ -41,10 +41,14 @@ export declare const MANAGED_MODEL_STATE_VERSION = 1;
|
|
|
41
41
|
export declare function readManagedModelState(path: string): ManagedModelState;
|
|
42
42
|
export declare function parseRoleTomlModel(content: string): string | undefined;
|
|
43
43
|
export declare function replaceRoleTomlModel(content: string, model: string): string;
|
|
44
|
+
export declare function parseRoleTomlEffort(content: string): string | undefined;
|
|
45
|
+
export declare function replaceRoleTomlEffort(content: string, effort: string | undefined): string;
|
|
44
46
|
export declare function roleManagedModelStateKey(path: string): string;
|
|
45
47
|
export interface CodexManagedModelOverride {
|
|
46
48
|
role: CodexRoleName;
|
|
47
49
|
model: string;
|
|
50
|
+
effort?: string;
|
|
51
|
+
clearEffort?: boolean;
|
|
48
52
|
}
|
|
49
53
|
export declare function applyCodexManagedModelOverrides(config: CodexInstallConfig, overrides: CodexManagedModelOverride[]): CodexApplyResult;
|
|
50
54
|
export declare function buildCodexSetupPlan(config: CodexInstallConfig): CodexSetupPlan;
|
package/dist/cli/commands.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import type { HarnessStatusReport, OperationApplyResult, OperationHarnessMetadata, OperationPlan } from './operations/types';
|
|
2
|
-
import
|
|
1
|
+
import type { HarnessStatusReport, ModelRoleInput, OperationApplyResult, OperationContext, OperationHarnessMetadata, OperationPlan } from './operations/types';
|
|
2
|
+
import { type ModelOption } from './tui/model-catalog';
|
|
3
|
+
import type { CliModelRoleArg, CliParseResult, GenerateArgs, OperationHarnessArg } from './types';
|
|
3
4
|
export declare function formatHarnessStatusReport(reports: readonly HarnessStatusReport[]): string;
|
|
4
5
|
export declare function formatHarnessList(harnesses: readonly OperationHarnessMetadata[]): string;
|
|
5
6
|
export declare function formatOperationPlan(plan: OperationPlan): string;
|
|
6
7
|
export declare function formatOperationApplyResult(result: OperationApplyResult): string;
|
|
7
8
|
export declare function printHelp(): void;
|
|
9
|
+
export declare function resolveCliModelRoles(harness: OperationHarnessArg, roles: readonly CliModelRoleArg[], resolution?: {
|
|
10
|
+
currentRoles: readonly ModelRoleInput[];
|
|
11
|
+
modelOptions: readonly ModelOption[];
|
|
12
|
+
}): ModelRoleInput[];
|
|
13
|
+
export interface CliModelCommandServices {
|
|
14
|
+
operationContext(): OperationContext;
|
|
15
|
+
modelRoles(harness: OperationHarnessArg): ModelRoleInput[];
|
|
16
|
+
modelOptions(harness: OperationHarnessArg): Promise<ModelOption[]>;
|
|
17
|
+
}
|
|
8
18
|
export declare function printHarnessGeneration(args: GenerateArgs): number;
|
|
9
|
-
export declare function runCliCommand(parsed: CliParseResult): Promise<number>;
|
|
19
|
+
export declare function runCliCommand(parsed: CliParseResult, modelServices?: CliModelCommandServices): Promise<number>;
|