Skip to content

Commit b1a9f84

Browse files
committed
Fix types
1 parent aa41db4 commit b1a9f84

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
import { publishedTools } from 'src/tools/list'
12
import type { AgentDefinition } from '../../util/types/agent-definition'
23
import 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!
1015
const _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
1824
const b: AgentDefinition = {} as DynamicAgentDefinitionHandleSteps
1925
const _keyTypecheck1: keyof AgentDefinition =
2026
{} as keyof DynamicAgentDefinitionHandleSteps
2127
const _keyTypecheck2: keyof DynamicAgentDefinitionHandleSteps =
22-
{} as keyof AgentDefinition
28+
{} as keyof AgentDefinition

0 commit comments

Comments
 (0)