MCPcopy Create free account

hub / github.com/codeany-ai/open-agent-sdk-typescript / functions

Functions229 in github.com/codeany-ai/open-agent-sdk-typescript

↓ 24 callersMethodget
* Get a cached file state.
src/utils/fileCache.ts:46
↓ 15 callersMethodset
* Set a cached file state.
src/utils/fileCache.ts:60
↓ 12 callersFunctioncreateAgent
(options: AgentOptions = {})
src/agent.ts:494
↓ 11 callersFunctiondefineTool
(config: { name: string description: string inputSchema: ToolInputSchema call: (input: any, context: T
src/tools/types.ts:10
↓ 9 callersMethodexecuteHooks
* Execute hooks for a lifecycle event. * Returns hook outputs; never throws.
src/engine.ts:166
↓ 9 callersMethodquery
* Run a query with streaming events.
src/agent.ts:231
↓ 8 callersMethodclose
* Close MCP connections and clean up. * Optionally persist session to disk.
src/agent.ts:468
↓ 8 callersMethoddelete
* Delete a cached entry.
src/utils/fileCache.ts:94
↓ 8 callersFunctionloadSession
(sessionId: string)
src/session.ts:83
↓ 7 callersMethodclear
* Clear all cached entries.
src/utils/fileCache.ts:108
↓ 7 callersFunctionsend
(event: string, data: unknown)
examples/web/server.ts:66
↓ 6 callersFunctionfilterTools
( tools: ToolDefinition[], allowedTools?: string[], disallowedTools?: string[], )
src/tools/index.ts:146
↓ 6 callersFunctiongitExec
(cmd: string, timeoutMs = 5000)
src/utils/context.ts:31
↓ 6 callersMethodprompt
* Convenience method: send a prompt and collect the final answer as a single object. * Internally iterates through the streaming query and aggregat
src/agent.ts:355
↓ 6 callersFunctionregisterSkill
(definition: SkillDefinition)
src/skills/registry.ts:19
↓ 5 callersFunctionestimateTokens
(text: string)
src/utils/tokens.ts:11
↓ 5 callersFunctiongetUserInvocableSkills
()
src/skills/registry.ts:55
↓ 5 callersMethodreadEnv
Read a value from process.env (returns undefined if missing).
src/agent.ts:167
↓ 5 callersFunctionsaveSession
( sessionId: string, messages: NormalizedMessageParam[], metadata: Partial<SessionMetadata>, )
src/session.ts:52
↓ 4 callersFunctiongetAllBaseTools
()
src/tools/index.ts:139
↓ 4 callersFunctionquery
(params: { prompt: string options?: AgentOptions })
src/agent.ts:506
↓ 3 callersFunctioncreateProvider
( apiType: ApiType, opts: { apiKey?: string; baseURL?: string }, )
src/providers/index.ts:22
↓ 3 callersFunctiongetAllSkills
()
src/skills/registry.ts:48
↓ 3 callersFunctiongetSessionPath
* Get the path for a specific session.
src/session.ts:45
↓ 3 callersMethodnormalizePath
* Normalize a file path for cache lookup.
src/utils/fileCache.ts:39
↓ 2 callersFunctioncompactConversation
( provider: LLMProvider, model: string, messages: any[], state: AutoCompactState, )
src/utils/compact.ts:60
↓ 2 callersFunctioncreateHookRegistry
(config?: HookConfig)
src/hooks.ts:255
↓ 2 callersMethodcreateMessage
Send a message and get a response.
src/providers/types.ts:84
↓ 2 callersMethodexecuteSingleTool
* Execute a single tool with permission checking.
src/engine.ts:507
↓ 2 callersFunctiongetSessionsDir
* Get the sessions directory path.
src/session.ts:37
↓ 2 callersFunctiongetSkill
(name: string)
src/skills/registry.ts:33
↓ 2 callersFunctiongetSymbolAtPosition
* Get the symbol at a given position in a file.
src/tools/lsp-tool.ts:133
↓ 2 callersFunctioninitBundledSkills
()
src/skills/bundled/index.ts:19
↓ 2 callersFunctionisPromptTooLongError
(err: any)
src/utils/retry.ts:99
↓ 2 callersMethodkeys
* Get all cached file paths.
src/utils/fileCache.ts:123
↓ 2 callersMethodsubmitMessage
* Submit a user message and run the agentic loop. * Yields SDKMessage events as the agent works.
src/engine.ts:187
↓ 2 callersFunctiontool
( name: string, description: string, inputSchema: T, handler: (args: z.infer<ZodObject<T>>, extra: unk
src/tool-helper.ts:62
↓ 2 callersFunctionwriteToMailbox
(agentName: string, message: AgentMessage)
src/tools/send-message.ts:35
↓ 1 callersFunctionbuildCompactionPrompt
* Build compaction prompt from messages.
src/utils/compact.ts:147
↓ 1 callersFunctionbuildSystemPrompt
(config: QueryEngineConfig)
src/engine.ts:77
↓ 1 callersMethodbuildToolPool
Assemble the available tool set based on options.
src/agent.ts:172
↓ 1 callersFunctionconnectMCPServer
( name: string, config: McpServerConfig, )
src/mcp/client.ts:17
↓ 1 callersMethodconvertAssistantMessage
( msg: NormalizedMessageParam, result: OpenAIChatMessage[], )
src/providers/openai.ts:186
↓ 1 callersMethodconvertMessages
( system: string, messages: NormalizedMessageParam[], )
src/providers/openai.ts:125
↓ 1 callersMethodconvertResponse
(data: OpenAIChatResponse)
src/providers/openai.ts:247
↓ 1 callersMethodconvertTools
(tools: NormalizedTool[])
src/providers/openai.ts:232
↓ 1 callersMethodconvertUserMessage
( msg: NormalizedMessageParam, result: OpenAIChatMessage[], )
src/providers/openai.ts:147
↓ 1 callersFunctioncreateAutoCompactState
()
src/utils/compact.ts:30
↓ 1 callersFunctioncreateMCPToolDefinition
* Create a ToolDefinition wrapping an MCP server tool.
src/mcp/client.ts:89
↓ 1 callersFunctioncreateSdkMcpServer
(options: { name: string version?: string tools?: SdkMcpToolDefinition<any>[] })
src/sdk-mcp-server.ts:47
↓ 1 callersFunctiondetectMainBranch
* Detect the main branch name (main or master).
src/utils/context.ts:84
↓ 1 callersFunctiondiscoverProjectContextFiles
(cwd: string)
src/utils/context.ts:100
↓ 1 callersFunctionestimateCost
( model: string, usage: { input_tokens: number; output_tokens: number }, )
src/utils/tokens.ts:136
↓ 1 callersFunctionestimateMessagesTokens
( messages: Array<{ role: string; content: any }>, )
src/utils/tokens.ts:18
↓ 1 callersMethodexecute
* Execute hooks for an event.
src/hooks.ts:142
↓ 1 callersFunctionexecuteShellHook
* Execute a shell command as a hook.
src/hooks.ts:202
↓ 1 callersMethodexecuteTools
* Execute tool calls with concurrency control. * * Read-only tools run concurrently (up to 10 at a time). * Mutation tools run sequentially.
src/engine.ts:454
↓ 1 callersFunctionfixToolResultPairing
* Fix tool result pairing: ensure every tool_result has a * matching tool_use in the previous assistant message.
src/utils/messages.ts:97
↓ 1 callersFunctiongetAllCronJobs
()
src/tools/cron-tools.ts:31
↓ 1 callersFunctiongetAllTasks
()
src/tools/task-tools.ts:44
↓ 1 callersMethodgetApiType
* Get the current API type.
src/agent.ts:449
↓ 1 callersFunctiongetAutoCompactThreshold
(model: string)
src/utils/tokens.ts:101
↓ 1 callersFunctiongetContextWindowSize
(model: string)
src/utils/tokens.ts:68
↓ 1 callersFunctiongetGitStatus
(cwd: string)
src/utils/context.ts:23
↓ 1 callersMethodgetMessages
* Get current messages for session persistence.
src/engine.ts:613
↓ 1 callersMethodgetMessages
* Get conversation messages.
src/agent.ts:392
↓ 1 callersFunctiongetOrCreateAgent
()
examples/web/server.ts:23
↓ 1 callersFunctiongetRetryDelay
(attempt: number, config: RetryConfig = DEFAULT_RETRY_CONFIG)
src/utils/retry.ts:52
↓ 1 callersFunctiongetSystemContext
(cwd: string)
src/utils/context.ts:156
↓ 1 callersFunctiongetTask
(id: string)
src/tools/task-tools.ts:51
↓ 1 callersFunctiongetUserContext
(cwd: string)
src/utils/context.ts:170
↓ 1 callersFunctionhandleChat
Handle POST /api/chat — SSE stream
examples/web/server.ts:49
↓ 1 callersFunctionhandleNewSession
Handle POST /api/new
examples/web/server.ts:119
↓ 1 callersMethodhasHooks
* Check if any hooks are registered for an event.
src/hooks.ts:187
↓ 1 callersFunctionisAuthError
(err: any)
src/utils/retry.ts:112
↓ 1 callersFunctionisRateLimitError
(err: any)
src/utils/retry.ts:119
↓ 1 callersFunctionisRetryableError
(err: any, config: RetryConfig = DEFAULT_RETRY_CONFIG)
src/utils/retry.ts:31
↓ 1 callersFunctionisSdkServerConfig
(config: any)
src/sdk-mcp-server.ts:76
↓ 1 callersFunctionmain
()
examples/11-custom-mcp-tools.ts:74
↓ 1 callersFunctionmain
()
examples/13-hooks.ts:13
↓ 1 callersFunctionmain
()
examples/12-skills.ts:19
↓ 1 callersFunctionmain
()
examples/01-simple-query.ts:11
↓ 1 callersFunctionmain
()
examples/09-subagents.ts:11
↓ 1 callersFunctionmain
()
examples/02-multi-tool.ts:11
↓ 1 callersFunctionmain
()
examples/10-permissions.ts:11
↓ 1 callersFunctionmain
()
examples/03-multi-turn.ts:11
↓ 1 callersFunctionmain
()
examples/05-custom-system-prompt.ts:10
↓ 1 callersFunctionmain
()
examples/04-prompt-api.ts:11
↓ 1 callersFunctionmain
()
examples/07-custom-tools.ts:53
↓ 1 callersFunctionmain
()
examples/14-openai-compat.ts:16
↓ 1 callersFunctionmain
()
examples/08-official-api-compat.ts:11
↓ 1 callersFunctionmain
()
examples/06-mcp-server.ts:15
↓ 1 callersMethodmapFinishReason
( reason: string, )
src/providers/openai.ts:301
↓ 1 callersFunctionmicroCompactMessages
( messages: any[], maxToolResultChars: number = 50000, )
src/utils/compact.ts:182
↓ 1 callersFunctionnormalizeMessagesForAPI
( messages: Array<{ role: string; content: any }>, )
src/utils/messages.ts:56
↓ 1 callersMethodpickCredentials
Pick API key and base URL from options or CODEANY_* env vars.
src/agent.ts:150
↓ 1 callersFunctionreadBody
Read the full request body as a string.
examples/web/server.ts:39
↓ 1 callersFunctionreadProjectContextContent
(cwd: string)
src/utils/context.ts:134
↓ 1 callersMethodregister
* Register a single hook.
src/hooks.ts:133
↓ 1 callersFunctionregisterAgents
(agents: Record<string, AgentDefinition>)
src/tools/agent-tool.ts:19
next →1–100 of 229, ranked by callers