Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codeany-ai/open-agent-sdk-typescript
/ functions
Functions
229 in github.com/codeany-ai/open-agent-sdk-typescript
⨍
Functions
229
◇
Types & classes
72
↓ 24 callers
Method
get
* Get a cached file state.
src/utils/fileCache.ts:46
↓ 15 callers
Method
set
* Set a cached file state.
src/utils/fileCache.ts:60
↓ 12 callers
Function
createAgent
(options: AgentOptions = {})
src/agent.ts:494
↓ 11 callers
Function
defineTool
(config: { name: string description: string inputSchema: ToolInputSchema call: (input: any, context: T
src/tools/types.ts:10
↓ 9 callers
Method
executeHooks
* Execute hooks for a lifecycle event. * Returns hook outputs; never throws.
src/engine.ts:166
↓ 9 callers
Method
query
* Run a query with streaming events.
src/agent.ts:231
↓ 8 callers
Method
close
* Close MCP connections and clean up. * Optionally persist session to disk.
src/agent.ts:468
↓ 8 callers
Method
delete
* Delete a cached entry.
src/utils/fileCache.ts:94
↓ 8 callers
Function
loadSession
(sessionId: string)
src/session.ts:83
↓ 7 callers
Method
clear
* Clear all cached entries.
src/utils/fileCache.ts:108
↓ 7 callers
Function
send
(event: string, data: unknown)
examples/web/server.ts:66
↓ 6 callers
Function
filterTools
( tools: ToolDefinition[], allowedTools?: string[], disallowedTools?: string[], )
src/tools/index.ts:146
↓ 6 callers
Function
gitExec
(cmd: string, timeoutMs = 5000)
src/utils/context.ts:31
↓ 6 callers
Method
prompt
* 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 callers
Function
registerSkill
(definition: SkillDefinition)
src/skills/registry.ts:19
↓ 5 callers
Function
estimateTokens
(text: string)
src/utils/tokens.ts:11
↓ 5 callers
Function
getUserInvocableSkills
()
src/skills/registry.ts:55
↓ 5 callers
Method
readEnv
Read a value from process.env (returns undefined if missing).
src/agent.ts:167
↓ 5 callers
Function
saveSession
( sessionId: string, messages: NormalizedMessageParam[], metadata: Partial<SessionMetadata>, )
src/session.ts:52
↓ 4 callers
Function
getAllBaseTools
()
src/tools/index.ts:139
↓ 4 callers
Function
query
(params: { prompt: string options?: AgentOptions })
src/agent.ts:506
↓ 3 callers
Function
createProvider
( apiType: ApiType, opts: { apiKey?: string; baseURL?: string }, )
src/providers/index.ts:22
↓ 3 callers
Function
getAllSkills
()
src/skills/registry.ts:48
↓ 3 callers
Function
getSessionPath
* Get the path for a specific session.
src/session.ts:45
↓ 3 callers
Method
normalizePath
* Normalize a file path for cache lookup.
src/utils/fileCache.ts:39
↓ 2 callers
Function
compactConversation
( provider: LLMProvider, model: string, messages: any[], state: AutoCompactState, )
src/utils/compact.ts:60
↓ 2 callers
Function
createHookRegistry
(config?: HookConfig)
src/hooks.ts:255
↓ 2 callers
Method
createMessage
Send a message and get a response.
src/providers/types.ts:84
↓ 2 callers
Method
executeSingleTool
* Execute a single tool with permission checking.
src/engine.ts:507
↓ 2 callers
Function
getSessionsDir
* Get the sessions directory path.
src/session.ts:37
↓ 2 callers
Function
getSkill
(name: string)
src/skills/registry.ts:33
↓ 2 callers
Function
getSymbolAtPosition
* Get the symbol at a given position in a file.
src/tools/lsp-tool.ts:133
↓ 2 callers
Function
initBundledSkills
()
src/skills/bundled/index.ts:19
↓ 2 callers
Function
isPromptTooLongError
(err: any)
src/utils/retry.ts:99
↓ 2 callers
Method
keys
* Get all cached file paths.
src/utils/fileCache.ts:123
↓ 2 callers
Method
submitMessage
* Submit a user message and run the agentic loop. * Yields SDKMessage events as the agent works.
src/engine.ts:187
↓ 2 callers
Function
tool
( name: string, description: string, inputSchema: T, handler: (args: z.infer<ZodObject<T>>, extra: unk
src/tool-helper.ts:62
↓ 2 callers
Function
writeToMailbox
(agentName: string, message: AgentMessage)
src/tools/send-message.ts:35
↓ 1 callers
Function
buildCompactionPrompt
* Build compaction prompt from messages.
src/utils/compact.ts:147
↓ 1 callers
Function
buildSystemPrompt
(config: QueryEngineConfig)
src/engine.ts:77
↓ 1 callers
Method
buildToolPool
Assemble the available tool set based on options.
src/agent.ts:172
↓ 1 callers
Function
connectMCPServer
( name: string, config: McpServerConfig, )
src/mcp/client.ts:17
↓ 1 callers
Method
convertAssistantMessage
( msg: NormalizedMessageParam, result: OpenAIChatMessage[], )
src/providers/openai.ts:186
↓ 1 callers
Method
convertMessages
( system: string, messages: NormalizedMessageParam[], )
src/providers/openai.ts:125
↓ 1 callers
Method
convertResponse
(data: OpenAIChatResponse)
src/providers/openai.ts:247
↓ 1 callers
Method
convertTools
(tools: NormalizedTool[])
src/providers/openai.ts:232
↓ 1 callers
Method
convertUserMessage
( msg: NormalizedMessageParam, result: OpenAIChatMessage[], )
src/providers/openai.ts:147
↓ 1 callers
Function
createAutoCompactState
()
src/utils/compact.ts:30
↓ 1 callers
Function
createMCPToolDefinition
* Create a ToolDefinition wrapping an MCP server tool.
src/mcp/client.ts:89
↓ 1 callers
Function
createSdkMcpServer
(options: { name: string version?: string tools?: SdkMcpToolDefinition<any>[] })
src/sdk-mcp-server.ts:47
↓ 1 callers
Function
detectMainBranch
* Detect the main branch name (main or master).
src/utils/context.ts:84
↓ 1 callers
Function
discoverProjectContextFiles
(cwd: string)
src/utils/context.ts:100
↓ 1 callers
Function
estimateCost
( model: string, usage: { input_tokens: number; output_tokens: number }, )
src/utils/tokens.ts:136
↓ 1 callers
Function
estimateMessagesTokens
( messages: Array<{ role: string; content: any }>, )
src/utils/tokens.ts:18
↓ 1 callers
Method
execute
* Execute hooks for an event.
src/hooks.ts:142
↓ 1 callers
Function
executeShellHook
* Execute a shell command as a hook.
src/hooks.ts:202
↓ 1 callers
Method
executeTools
* 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 callers
Function
fixToolResultPairing
* Fix tool result pairing: ensure every tool_result has a * matching tool_use in the previous assistant message.
src/utils/messages.ts:97
↓ 1 callers
Function
getAllCronJobs
()
src/tools/cron-tools.ts:31
↓ 1 callers
Function
getAllTasks
()
src/tools/task-tools.ts:44
↓ 1 callers
Method
getApiType
* Get the current API type.
src/agent.ts:449
↓ 1 callers
Function
getAutoCompactThreshold
(model: string)
src/utils/tokens.ts:101
↓ 1 callers
Function
getContextWindowSize
(model: string)
src/utils/tokens.ts:68
↓ 1 callers
Function
getGitStatus
(cwd: string)
src/utils/context.ts:23
↓ 1 callers
Method
getMessages
* Get current messages for session persistence.
src/engine.ts:613
↓ 1 callers
Method
getMessages
* Get conversation messages.
src/agent.ts:392
↓ 1 callers
Function
getOrCreateAgent
()
examples/web/server.ts:23
↓ 1 callers
Function
getRetryDelay
(attempt: number, config: RetryConfig = DEFAULT_RETRY_CONFIG)
src/utils/retry.ts:52
↓ 1 callers
Function
getSystemContext
(cwd: string)
src/utils/context.ts:156
↓ 1 callers
Function
getTask
(id: string)
src/tools/task-tools.ts:51
↓ 1 callers
Function
getUserContext
(cwd: string)
src/utils/context.ts:170
↓ 1 callers
Function
handleChat
Handle POST /api/chat — SSE stream
examples/web/server.ts:49
↓ 1 callers
Function
handleNewSession
Handle POST /api/new
examples/web/server.ts:119
↓ 1 callers
Method
hasHooks
* Check if any hooks are registered for an event.
src/hooks.ts:187
↓ 1 callers
Function
isAuthError
(err: any)
src/utils/retry.ts:112
↓ 1 callers
Function
isRateLimitError
(err: any)
src/utils/retry.ts:119
↓ 1 callers
Function
isRetryableError
(err: any, config: RetryConfig = DEFAULT_RETRY_CONFIG)
src/utils/retry.ts:31
↓ 1 callers
Function
isSdkServerConfig
(config: any)
src/sdk-mcp-server.ts:76
↓ 1 callers
Function
main
()
examples/11-custom-mcp-tools.ts:74
↓ 1 callers
Function
main
()
examples/13-hooks.ts:13
↓ 1 callers
Function
main
()
examples/12-skills.ts:19
↓ 1 callers
Function
main
()
examples/01-simple-query.ts:11
↓ 1 callers
Function
main
()
examples/09-subagents.ts:11
↓ 1 callers
Function
main
()
examples/02-multi-tool.ts:11
↓ 1 callers
Function
main
()
examples/10-permissions.ts:11
↓ 1 callers
Function
main
()
examples/03-multi-turn.ts:11
↓ 1 callers
Function
main
()
examples/05-custom-system-prompt.ts:10
↓ 1 callers
Function
main
()
examples/04-prompt-api.ts:11
↓ 1 callers
Function
main
()
examples/07-custom-tools.ts:53
↓ 1 callers
Function
main
()
examples/14-openai-compat.ts:16
↓ 1 callers
Function
main
()
examples/08-official-api-compat.ts:11
↓ 1 callers
Function
main
()
examples/06-mcp-server.ts:15
↓ 1 callers
Method
mapFinishReason
( reason: string, )
src/providers/openai.ts:301
↓ 1 callers
Function
microCompactMessages
( messages: any[], maxToolResultChars: number = 50000, )
src/utils/compact.ts:182
↓ 1 callers
Function
normalizeMessagesForAPI
( messages: Array<{ role: string; content: any }>, )
src/utils/messages.ts:56
↓ 1 callers
Method
pickCredentials
Pick API key and base URL from options or CODEANY_* env vars.
src/agent.ts:150
↓ 1 callers
Function
readBody
Read the full request body as a string.
examples/web/server.ts:39
↓ 1 callers
Function
readProjectContextContent
(cwd: string)
src/utils/context.ts:134
↓ 1 callers
Method
register
* Register a single hook.
src/hooks.ts:133
↓ 1 callers
Function
registerAgents
(agents: Record<string, AgentDefinition>)
src/tools/agent-tool.ts:19
next →
1–100 of 229, ranked by callers