File size: 1,456 Bytes
064bfd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import type { CallToolResult, ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'
import type { ZodTypeAny } from 'zod/v4'

export type EffortLevel = 'low' | 'medium' | 'high' | 'max'

export type AnyZodRawShape = Record<string, ZodTypeAny>

export type InferShape<Schema extends AnyZodRawShape> = {
  [K in keyof Schema]?: unknown
}

export type SdkMcpToolDefinition<Schema extends AnyZodRawShape> = {
  name: string
  description: string
  inputSchema: Schema
  handler: (args: InferShape<Schema>, extra: unknown) => Promise<CallToolResult>
  annotations?: ToolAnnotations
  searchHint?: string
  alwaysLoad?: boolean
}

export type McpSdkServerConfigWithInstance = Record<string, unknown>

export type Options = Record<string, unknown>
export type InternalOptions = Options

export type SDKSessionOptions = Options & {
  model?: string
}

export type Query = AsyncIterable<unknown>
export type InternalQuery = AsyncIterable<unknown>

export type SessionMutationOptions = {
  dir?: string
}

export type ListSessionsOptions = SessionMutationOptions & {
  limit?: number
  offset?: number
}

export type GetSessionInfoOptions = SessionMutationOptions

export type GetSessionMessagesOptions = SessionMutationOptions & {
  limit?: number
  offset?: number
  includeSystemMessages?: boolean
}

export type ForkSessionOptions = SessionMutationOptions

export type ForkSessionResult = {
  sessionId: string
}

export type SDKSession = {
  id: string
}