import type { StreamCallbacks } from "./stream.js"; import type { AgentCreateRequest, AppEnvironmentGetResponse, AppEnvironmentUpdateResponse, AppExecutionTimelineResponse, AppListItem, AppRuntimeSummary, AppSchedulesResponse, AssistantMode, AssistantRunResponse, CreateRepoRequest, CreateRepoResponse, DeploymentLogEntry, OpenPondAccountResponse, OpenPondApiHealth, OpenToolRecipe, OpenToolRecipeGetRequest, OpenToolRecipeListRequest, OpenToolRecipeListResponse, OpenToolRecipeSearchRequest, OpenToolRecipeSearchResponse, OpenToolRulesGetRequest, OpenToolRulesGetResponse, PromotePreviewToProductionRequest, PromotePreviewToProductionResponse, ScheduleDeleteResponse, ScheduleExecutionLog, ScheduleExecutionLogsResponse, ScheduleRunNowRequest, ScheduleRunNowResponse, ScheduleToggleRequest, ScheduleToggleResult, StartAppLifecycleRequest, StartAppLifecycleResponse, TemplateBranchesResponse, TemplateDeployLatestRequest, TemplateDeployLatestResponse, TemplateStatusResponse, ToolExecuteRequest, ToolExecuteResponse } from "./api.js"; export type OpenPondClientOptions = { apiKey?: string; baseUrl?: string; apiUrl?: string; chatApiUrl?: string; opChatApiUrl?: string; toolUrl?: string; cacheTtlMs?: number; useCache?: boolean; }; export type ToolSummary = { name: string; description?: string; raw: unknown; }; export type ToolListResult = { app: AppListItem; deploymentId: string | null; tools: ToolSummary[]; }; export type DeploymentWatchResult = { deploymentId: string; status: string | "timeout" | null; logs: DeploymentLogEntry[]; }; export type AgentCreateStreamCallbacks = StreamCallbacks & { onAppId?: (appId: string) => void; onDeploymentId?: (deploymentId: string) => void; }; export type AgentCreateStreamResult = { conversationId?: string; appId?: string; deploymentId?: string; }; export type OpenPondClient = { baseUrl: string; apiUrl: string; chatApiUrl: string; toolUrl: string; apiKey: string; account: { get: () => Promise; health: () => Promise; }; chat: { providers: () => Promise; provider: (provider: string) => Promise; models: () => Promise; model: (model: string) => Promise; send: (input: Omit) => Promise; stream: (input: Omit) => AsyncGenerator; }; tool: { list: (target: string, options?: ToolListOptions) => Promise; run: (target: string, toolName: string, options?: ToolRunOptions) => Promise; }; deploy: { watch: (target: string, options?: DeployWatchOptions) => Promise; }; template: { status: (target: string, options?: TemplateTargetOptions) => Promise; branches: (target: string, options?: TemplateTargetOptions) => Promise; update: (target: string, options?: TemplateUpdateOptions) => Promise; }; opentool: { recipesList: (input?: OpenToolRecipeListRequest) => Promise; recipesSearch: (input: OpenToolRecipeSearchRequest) => Promise; recipeGet: (input: OpenToolRecipeGetRequest) => Promise; rulesGet: (input: OpenToolRulesGetRequest) => Promise; }; apps: { list: (options?: AppsListOptions) => Promise; tools: (options?: AppsToolsOptions) => Promise; performance: (options?: AppsPerformanceOptions) => Promise; summary: (input: AppSummaryOptions) => Promise; schedules: (input: AppSchedulesOptions) => Promise; schedulesStart: (input: AppSchedulesStartOptions) => Promise; schedulesStop: (input: AppSchedulesStopOptions) => Promise; schedulesStopCurrent: () => Promise; scheduleRunNow: (input: ScheduleRunNowOptions) => Promise; scheduleDelete: (input: ScheduleDeleteOptions) => Promise; scheduleExecutionLogs: (input: ScheduleExecutionLogsOptions) => Promise; scheduleExecutionLog: (input: ScheduleExecutionLogOptions) => Promise; deploymentScheduleExecutionLogs: (input: DeploymentScheduleExecutionLogsOptions) => Promise; executionTimeline: (input: AppExecutionTimelineOptions) => Promise; assistantRun: (input: AppsAssistantRunOptions) => Promise; agentCreate: (input: AgentCreateRequest & { refreshCache?: boolean; }, callbacks?: AgentCreateStreamCallbacks) => Promise; toolsExecute: (input: ExecuteUserToolOptions) => Promise; deploy: (input: AppDeployOptions) => Promise<{ deploymentId: string; }>; startApp: (input: AppStartOptions) => Promise; promotePreview: (input: AppPromotePreviewOptions) => Promise; envGet: (input: AppEnvironmentGetOptions) => Promise; envSet: (input: AppEnvironmentSetOptions) => Promise; }; repo: { create: (input: CreateRepoRequest & { refreshCache?: boolean; }) => Promise; }; cache: { refresh: () => Promise; }; }; export type ToolListOptions = { branch?: string; forceRefresh?: boolean; deploymentId?: string; }; export type ToolRunOptions = { branch?: string; deploymentId?: string; method?: ToolExecuteRequest["method"]; body?: unknown; headers?: Record; forceRefresh?: boolean; }; export type DeployWatchOptions = { branch?: string; deploymentId?: string; intervalMs?: number; timeoutMs?: number; forceRefresh?: boolean; onLog?: (log: DeploymentLogEntry) => void; onStatus?: (status: string | null) => void; }; export type TemplateTargetOptions = { forceRefresh?: boolean; }; export type TemplateUpdateOptions = { environment?: TemplateDeployLatestRequest["environment"]; forceRefresh?: boolean; }; export type AppsListOptions = { handle?: string; forceRefresh?: boolean; }; export type AppsToolsOptions = { forceRefresh?: boolean; }; export type AppsPerformanceOptions = { appId?: string; }; export type AppSummaryOptions = { appId: string; }; export type AppSchedulesOptions = { appId: string; }; export type AppSchedulesStartOptions = { appId: string; } & ScheduleToggleRequest; export type AppSchedulesStopOptions = { appId: string; }; export type ScheduleRunNowOptions = ScheduleRunNowRequest; export type ScheduleDeleteOptions = { appId: string; scheduleId: string; }; export type ScheduleExecutionLogsOptions = { scheduleId: string; limit?: number; }; export type ScheduleExecutionLogOptions = { runId: string; }; export type DeploymentScheduleExecutionLogsOptions = { deploymentId: string; limit?: number; }; export type AppExecutionTimelineOptions = { appId: string; limit?: number; }; export type AppsAssistantRunOptions = { appId: string; mode: AssistantMode; prompt: string; }; export type ExecuteUserToolOptions = { appId: string; deploymentId: string; toolName: string; scheduleId?: string; method?: ToolExecuteRequest["method"]; body?: unknown; headers?: Record; notifyEmail?: boolean; }; export type AppEnvironmentSetOptions = { appId: string; envVars: Record; }; export type AppEnvironmentGetOptions = { appId: string; }; export type AppDeployOptions = { appId: string; environment?: "preview" | "production"; commitSha?: string; branch?: string; }; export type AppPromotePreviewOptions = { appId: string; } & PromotePreviewToProductionRequest; export type AppStartOptions = { appId: string; } & StartAppLifecycleRequest;