Skip to content

Commit aa389dd

Browse files
committed
fix: types
1 parent 99b5e40 commit aa389dd

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

backend/src/run-programmatic-step.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export async function runProgrammaticStep(
125125
)
126126
} else {
127127
// Initialize native generator
128-
generator = (template.handleSteps as any)({
128+
generator = template.handleSteps({
129129
agentState,
130130
prompt,
131131
params,
@@ -172,9 +172,10 @@ export async function runProgrammaticStep(
172172
...data,
173173
})
174174
},
175-
agentState: cloneDeep(
176-
agentState as AgentState & Required<Pick<AgentState, 'runId'>>,
177-
),
175+
agentState: cloneDeep({
176+
...agentState,
177+
runId: agentState.runId!, // We've already verified runId exists above
178+
}),
178179
agentContext: cloneDeep(agentState.agentContext),
179180
messages: cloneDeep(agentState.messageHistory),
180181
}

common/src/types/agent-template.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Backend Agent Template Types
3-
*
3+
*
44
* This file provides backend-compatible agent template types with strict validation.
55
* It imports base types from the user-facing template to eliminate duplication.
66
*/
@@ -68,9 +68,11 @@ export type StepGenerator = Generator<
6868
export type StepHandler<
6969
P = string | undefined,
7070
T = Record<string, any> | undefined,
71-
> = (
72-
params: { agentState: AgentState; prompt: P; params: T },
73-
logger: Logger,
74-
) => StepGenerator
71+
> = (context: {
72+
agentState: AgentState
73+
prompt: P
74+
params: T
75+
logger: Logger
76+
}) => StepGenerator
7577

7678
export { Logger, PublicAgentState }

0 commit comments

Comments
 (0)