mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 10:55:27 +00:00
refactor(agent): make AgentExecutionContext 100% type-safe
- Use generated Prisma types to precisely define AgentExecutionContext properties - Make sessionId public in DatabaseSessionStorage and use instanceof type guard - Explicitly type getAgentChatContextActivity and getAgentAutofillContextActivity returns - Clean up all 'as any' casts and ESLint disable comments - Refactor agent.test.ts to cast Session with DatabaseSessionMetadata
This commit is contained in:
@@ -16,7 +16,7 @@ export interface DatabaseSessionMetadata extends SessionMetadata {
|
||||
}
|
||||
|
||||
export class DatabaseSessionStorage implements SessionStorage<DatabaseSessionMetadata> {
|
||||
constructor(private sessionId: string) {}
|
||||
constructor(public readonly sessionId: string) {}
|
||||
|
||||
async getMetadata(): Promise<DatabaseSessionMetadata> {
|
||||
const session = await prisma.agentSession.findUnique({
|
||||
|
||||
Reference in New Issue
Block a user