@@ -20,9 +20,9 @@ export namespace Agent {
2020 prompt : Prompt ,
2121 ) => CommandSpec | Promise < CommandSpec > ;
2222
23- export interface Definition < TModel extends string = string > {
23+ export interface Definition {
2424 run : (
25- model : TModel ,
25+ model : string ,
2626 prompt : Prompt ,
2727 options : RunOptions ,
2828 ) => Promise < RunResult > ;
@@ -43,33 +43,29 @@ export namespace Agent {
4343 logger : Logger . Instance ;
4444 }
4545
46- export interface Registration < TModel extends string = string > {
46+ export interface Registration {
4747 name : string ;
48- definition : Definition < TModel > ;
49- models : ReadonlyArray < TModel > ;
48+ definition : Definition ;
5049 }
5150
52- const agents : Record < string , Registration < any > > = {
51+ const agents : Record < string , Registration > = {
5352 // Only keep opencode active while debugging timeouts for specific models.
5453 opencode : createRegistration ( "opencode" , opencodeAgent ) ,
5554 //codex: createRegistration("codex", codexAgent),
5655 //"claude-code": createRegistration("claude-code", claudeCodeAgent),
5756 } ;
5857
59- function createRegistration < TModel extends string > (
58+ function createRegistration (
6059 name : string ,
6160 module : {
62- default ?: Definition < TModel > ;
63- models ?: ReadonlyArray < TModel > ;
61+ default ?: Definition ;
6462 } ,
65- ) : Registration < TModel > {
63+ ) : Registration {
6664 const definition = module . default ;
67- const models = module . models ;
6865
6966 assert ( definition , `Agent module ${ name } is missing a default export.` ) ;
70- assert ( models , `Agent module ${ name } is missing the exported models list.` ) ;
7167
72- return { name, definition, models } ;
68+ return { name, definition } ;
7369 }
7470
7571 export function get ( name : string ) : Registration {
@@ -78,13 +74,6 @@ export namespace Agent {
7874 return agent ;
7975 }
8076
81- export function validateModel ( agent : Registration , model : string ) {
82- if ( ! agent . models . find ( ( entry ) => entry === model ) )
83- throw new Error (
84- `Model ${ model } is not registered for agent ${ agent . name } .` ,
85- ) ;
86- }
87-
8877 export function list ( ) {
8978 return Object . values ( agents ) ;
9079 }
0 commit comments