1+ import { publishedTools } from 'src/tools/list'
12import type { AgentDefinition } from '../../util/types/agent-definition'
23import type { DynamicAgentDefinition } from '../dynamic-agent-template'
34
45// Create a version of DynamicAgentDefinition where handleSteps is compatible with AgentDefinition
56
6- type DynamicAgentDefinitionHandleSteps = Omit < DynamicAgentDefinition , 'handleSteps' > & {
7+ type DynamicAgentDefinitionHandleSteps = Omit <
8+ DynamicAgentDefinition ,
9+ 'handleSteps' | 'toolNames'
10+ > & {
711 handleSteps ?: AgentDefinition [ 'handleSteps' ]
12+ toolNames ?: ( typeof publishedTools ) [ number ] [ ]
813}
914// Don't remove these lines! And don't change the values away from true!
1015const _typecheck1 : AgentDefinition extends DynamicAgentDefinitionHandleSteps
@@ -14,9 +19,10 @@ const _typecheck2: DynamicAgentDefinitionHandleSteps extends AgentDefinition
1419 ? true
1520 : false = true
1621// These two give nicer to read type errors. Let's keep them.
17- const a : DynamicAgentDefinitionHandleSteps = { } as DynamicAgentDefinitionHandleSteps
22+ const a : DynamicAgentDefinitionHandleSteps =
23+ { } as DynamicAgentDefinitionHandleSteps
1824const b : AgentDefinition = { } as DynamicAgentDefinitionHandleSteps
1925const _keyTypecheck1 : keyof AgentDefinition =
2026 { } as keyof DynamicAgentDefinitionHandleSteps
2127const _keyTypecheck2 : keyof DynamicAgentDefinitionHandleSteps =
22- { } as keyof AgentDefinition
28+ { } as keyof AgentDefinition
0 commit comments