import { PiSessionStatus, PiSteeringMode } from "./constants.js"; import { InstantiatedFragmentFromDefinition } from "@fragno-dev/core"; import { TxResult } from "@fragno-dev/db"; import { AgentEvent, AgentMessage, AgentOptions, AgentTool, StreamFn, ThinkingLevel } from "@mariozechner/pi-agent-core"; import { Api, Model } from "@mariozechner/pi-ai"; import { InstanceStatus, WorkflowsHistoryStep, workflowsFragmentDefinition } from "@fragno-dev/workflows"; //#region src/pi/types.d.ts type WorkflowsService = InstantiatedFragmentFromDefinition["services"]; type PiSession = { id: string; name: string | null; status: PiSessionStatus; agent: string; workflowInstanceId: string | null; steeringMode: PiSteeringMode; metadata: unknown; tags: string[]; createdAt: Date; updatedAt: Date; }; type PiTurnSummary = { turn: number; assistant: AgentMessage | null; summary: string | null; }; type PiWorkflowsInstanceStatus = InstanceStatus; type PiWorkflowHistoryStep = WorkflowsHistoryStep; type PiWorkflowsService = Pick & { getInstanceStatusBatch?: (workflowName: string, instanceIds: string[]) => TxResult; }; type PiAgentDefinition = { name: string; systemPrompt: string; model: Model; thinkingLevel?: ThinkingLevel; tools?: string[]; toolConfig?: unknown; maxTraceEvents?: number; streamFn?: StreamFn; convertToLlm?: AgentOptions["convertToLlm"]; transformContext?: AgentOptions["transformContext"]; getApiKey?: AgentOptions["getApiKey"]; thinkingBudgets?: AgentOptions["thinkingBudgets"]; maxRetryDelayMs?: AgentOptions["maxRetryDelayMs"]; onEvent?: (event: AgentEvent, ctx: { sessionId: string; turnId: string; }) => void; }; type PiAgentRegistry = Record; type PiToolFactoryContext = { session: PiSession; turnId: string; toolConfig: unknown; messages: AgentMessage[]; }; type PiToolFactory = AgentTool | ((ctx: PiToolFactoryContext) => AgentTool | Promise); type PiToolRegistry = Record; interface PiFragmentConfig { agents: PiAgentRegistry; tools: PiToolRegistry; defaultSteeringMode?: PiSteeringMode; } //#endregion export { PiAgentDefinition, PiAgentRegistry, PiFragmentConfig, PiSession, PiToolFactory, PiToolFactoryContext, PiToolRegistry, PiTurnSummary, PiWorkflowHistoryStep, PiWorkflowsInstanceStatus, PiWorkflowsService }; //# sourceMappingURL=types.d.ts.map