runtimeTypes.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * Stub: SDK Runtime Types (not yet published in open-source).
  3. * Non-serializable types: callbacks, interfaces with methods.
  4. */
  5. export type AnyZodRawShape = Record<string, unknown>
  6. export type InferShape<T extends AnyZodRawShape> = { [K in keyof T]: unknown }
  7. export type ForkSessionOptions = { dir?: string; upToMessageId?: string; title?: string }
  8. export type ForkSessionResult = { sessionId: string }
  9. export type GetSessionInfoOptions = { dir?: string }
  10. export type GetSessionMessagesOptions = { dir?: string; limit?: number; offset?: number; includeSystemMessages?: boolean }
  11. export type ListSessionsOptions = { dir?: string; limit?: number; offset?: number }
  12. export type SessionMutationOptions = { dir?: string }
  13. export type SessionMessage = { role: string; content: unknown; [key: string]: unknown }
  14. export interface SDKSession {
  15. sessionId: string
  16. prompt(input: string | AsyncIterable<unknown>): Promise<unknown>
  17. abort(): void
  18. [key: string]: unknown
  19. }
  20. export type SDKSessionOptions = {
  21. model?: string
  22. systemPrompt?: string
  23. [key: string]: unknown
  24. }
  25. export interface SdkMcpToolDefinition<T extends AnyZodRawShape = AnyZodRawShape> {
  26. name: string
  27. description: string
  28. inputSchema: T
  29. handler: (args: InferShape<T>, extra: unknown) => Promise<unknown>
  30. [key: string]: unknown
  31. }
  32. export type McpSdkServerConfigWithInstance = {
  33. name: string
  34. version?: string
  35. tools?: SdkMcpToolDefinition[]
  36. [key: string]: unknown
  37. }
  38. export interface Options {
  39. model?: string
  40. systemPrompt?: string
  41. [key: string]: unknown
  42. }
  43. export interface InternalOptions extends Options {
  44. [key: string]: unknown
  45. }
  46. export interface Query {
  47. [Symbol.asyncIterator](): AsyncIterator<unknown>
  48. [key: string]: unknown
  49. }
  50. export interface InternalQuery extends Query {
  51. [key: string]: unknown
  52. }
  53. export type EffortLevel = 'low' | 'medium' | 'high' | 'max';