Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/castari/castari-proxy
/ functions
Functions
120 in github.com/castari/castari-proxy
⨍
Functions
120
◇
Types & classes
46
↓ 10 callers
Function
send
(event: string, payload: unknown)
worker/src/stream.ts:27
↓ 9 callers
Function
invalidRequest
(message: string, details?: Record<string, unknown>)
worker/src/errors.ts:21
↓ 8 callers
Function
mapMessageToUIEvents
(message: SDKMessage)
claude-agent-demo/lib/agent/events.ts:13
↓ 5 callers
Function
buildPolicy
(mode: ToolMode)
claude-agent-demo/lib/policy/permission.ts:41
↓ 5 callers
Function
buildUserMessageContent
( text: string, images: ImagePayload[] )
claude-agent-demo/lib/agent/messages.ts:4
↓ 4 callers
Function
buildOptions
(config: QueryRuntimeConfig = {})
claude-agent-demo/lib/agent/session.ts:20
↓ 4 callers
Function
ensureInside
(base: string, candidate: string)
claude-agent-demo/lib/policy/paths.ts:16
↓ 4 callers
Function
getProcessEnv
()
src/queryCastari.ts:381
↓ 4 callers
Function
isRecord
(value: unknown)
claude-agent-demo/lib/agent/events.ts:340
↓ 4 callers
Function
normalizeEffort
(value: unknown)
src/queryCastari.ts:292
↓ 4 callers
Function
normalizeSummary
(value: unknown)
src/queryCastari.ts:299
↓ 3 callers
Function
createThinkingEvent
({ blockId, status, text, redacted }: { blockId: string; status: 'start' | 'delta' | 'complete';
claude-agent-demo/lib/agent/events.ts:203
↓ 3 callers
Function
ensureDir
(dirPath: string)
claude-agent-demo/lib/policy/paths.ts:12
↓ 3 callers
Function
fetch
(request: Request, env: Env)
worker/src/index.ts:17
↓ 3 callers
Function
getHeader
(headers: Headers, name: string)
worker/src/utils.ts:4
↓ 3 callers
Function
randomId
(prefix: string)
worker/src/utils.ts:58
↓ 3 callers
Function
resolveProvider
( headers: CastariHeaders, body: AnthropicRequest, config: WorkerConfig, )
worker/src/provider.ts:45
↓ 2 callers
Method
append
(sessionId: string, entry: TranscriptEntry)
claude-agent-demo/lib/store/transcripts.ts:13
↓ 2 callers
Function
canonicalize
(p: string)
claude-agent-demo/lib/policy/paths.ts:4
↓ 2 callers
Function
categorizeServerTools
(tools?: AnthropicToolDefinition[])
worker/src/provider.ts:82
↓ 2 callers
Function
encodeEvent
(event: UIEvent, encoder: TextEncoder)
claude-agent-demo/app/api/chat/route.ts:168
↓ 2 callers
Function
ensureInterceptorInstalled
()
src/queryCastari.ts:204
↓ 2 callers
Function
extractTextDelta
(message: SDKPartialAssistantMessage)
claude-agent-demo/lib/agent/events.ts:261
↓ 2 callers
Function
finalizeToolBlocks
()
worker/src/stream.ts:136
↓ 2 callers
Function
flushTextBlockStop
()
worker/src/stream.ts:48
↓ 2 callers
Function
formatError
(error: unknown)
claude-agent-demo/app/api/chat/route.ts:172
↓ 2 callers
Function
formatStructuredData
(value: unknown)
claude-agent-demo/app/components/Chat.tsx:891
↓ 2 callers
Function
isServerTool
(tool: AnthropicToolDefinition | undefined)
worker/src/provider.ts:103
↓ 2 callers
Function
jsonHeaders
()
worker/src/errors.ts:66
↓ 2 callers
Function
mapStopReason
(reason: string | null)
worker/src/translator.ts:253
↓ 2 callers
Function
normalizeBaseUrl
(value: string, suffix: '/v1/messages' | '/v1/chat/completions')
worker/src/config.ts:30
↓ 2 callers
Function
registerBaseOrigins
(options?: { env?: Record<string, string | undefined>; explicit?: string })
src/queryCastari.ts:261
↓ 2 callers
Function
resolveConfig
(env: Env)
worker/src/config.ts:14
↓ 1 callers
Function
addBaseOrigin
(candidate?: string)
src/queryCastari.ts:271
↓ 1 callers
Function
appendAssistantEvents
(message: SDKAssistantMessage, events: UIEvent[])
claude-agent-demo/lib/agent/events.ts:91
↓ 1 callers
Function
appendStreamEvents
(message: SDKPartialAssistantMessage, events: UIEvent[])
claude-agent-demo/lib/agent/events.ts:150
↓ 1 callers
Function
authenticationError
(message = 'Authentication failed')
worker/src/errors.ts:25
↓ 1 callers
Function
buildAnthropicHeaders
(original: Headers, apiKey: string)
worker/src/index.ts:119
↓ 1 callers
Function
buildMcpServers
()
claude-agent-demo/lib/mcp/servers.ts:6
↓ 1 callers
Function
buildOpenRouterRequest
( body: AnthropicRequest, options: OpenRouterBuildOptions, )
worker/src/translator.ts:30
↓ 1 callers
Function
buildPromptStream
( message: APIUserMessage )
claude-agent-demo/app/api/chat/route.ts:190
↓ 1 callers
Function
buildResolvedMeta
(args: { base?: CastariMeta; env: Record<string, string | undefined>; provider: Provider; originalMode
src/queryCastari.ts:355
↓ 1 callers
Function
convertContentParts
(parts: AnthropicContent[])
worker/src/translator.ts:125
↓ 1 callers
Function
convertMessage
(message: AnthropicMessage)
worker/src/translator.ts:76
↓ 1 callers
Function
convertMessages
(body: AnthropicRequest)
worker/src/translator.ts:60
↓ 1 callers
Function
convertOpenRouterContent
(content: string | null | OpenRouterMessageContent)
worker/src/translator.ts:234
↓ 1 callers
Function
convertToolChoice
(choice: AnthropicRequest['tool_choice'])
worker/src/translator.ts:166
↓ 1 callers
Function
convertTools
(tools?: AnthropicToolDefinition[])
worker/src/translator.ts:148
↓ 1 callers
Function
createToolCallEvent
(segment: ToolUseSegment)
claude-agent-demo/lib/agent/events.ts:225
↓ 1 callers
Function
createToolResultEvent
(segment: ToolResultSegment)
claude-agent-demo/lib/agent/events.ts:237
↓ 1 callers
Function
createTranscriptHooks
()
claude-agent-demo/lib/agent/hooks.ts:17
↓ 1 callers
Function
deriveBlockId
( message: SDKPartialAssistantMessage, payload: Record<string, unknown> )
claude-agent-demo/lib/agent/events.ts:251
↓ 1 callers
Function
deriveToolResultContent
(result: AnthropicContent)
worker/src/translator.ts:176
↓ 1 callers
Function
detectServerTools
(tools?: AnthropicToolDefinition[])
worker/src/provider.ts:99
↓ 1 callers
Function
ensureTextBlock
()
worker/src/stream.ts:55
↓ 1 callers
Function
ensureToolBlock
(call: OpenRouterToolCall)
worker/src/stream.ts:67
↓ 1 callers
Function
errorResponse
(error: unknown)
worker/src/errors.ts:42
↓ 1 callers
Function
extractApiKey
(headers: Headers)
worker/src/index.ts:85
↓ 1 callers
Function
extractStopReason
(message: SDKAssistantMessage)
claude-agent-demo/lib/agent/events.ts:287
↓ 1 callers
Function
extractToolResultText
(segment: ToolResultSegment)
claude-agent-demo/lib/agent/events.ts:295
↓ 1 callers
Function
getCredentialsForProvider
( provider: Provider, providers: CastariProviders | undefined, env: Record<string, string | undefined>,
src/queryCastari.ts:281
↓ 1 callers
Function
getToolStatusLabel
(tool: ToolCallState)
claude-agent-demo/app/components/Chat.tsx:882
↓ 1 callers
Function
handleChunk
(json: any)
worker/src/stream.ts:100
↓ 1 callers
Function
handleOpenRouter
(ctx: OpenRouterContext)
worker/src/index.ts:138
↓ 1 callers
Function
handleToolCalls
(toolCalls?: OpenRouterToolCall[])
worker/src/stream.ts:85
↓ 1 callers
Function
inferProviderFromModel
(model: string)
worker/src/provider.ts:59
↓ 1 callers
Function
injectReasoningIntoPayload
(raw: string, reasoning?: ReasoningConfig)
src/queryCastari.ts:325
↓ 1 callers
Function
isTextDeltaEntry
(entry: unknown)
claude-agent-demo/lib/agent/events.ts:344
↓ 1 callers
Function
isWebSearchTool
(tool: AnthropicToolDefinition | undefined)
worker/src/provider.ts:114
↓ 1 callers
Function
mapOpenRouterResponse
( providerResponse: OpenRouterResponse, originalModel: string, )
worker/src/translator.ts:193
↓ 1 callers
Function
normalizeCastariHeaders
(headers: Headers)
worker/src/utils.ts:24
↓ 1 callers
Function
normalizeMcpMode
(value?: string)
worker/src/config.ts:49
↓ 1 callers
Function
normalizeMetadata
(metadata: AnthropicRequest['metadata'])
worker/src/index.ts:80
↓ 1 callers
Function
normalizeReasoning
( cfg: ReasoningConfig | undefined, eff: ReasoningEffortPreference | undefined, sum: ReasoningSummaryPre
src/queryCastari.ts:306
↓ 1 callers
Function
normalizeServerToolsMode
(value?: string)
worker/src/config.ts:36
↓ 1 callers
Function
parseRequest
( req: NextRequest )
claude-agent-demo/app/api/chat/route.ts:150
↓ 1 callers
Function
parseToolArguments
(value?: string)
worker/src/translator.ts:244
↓ 1 callers
Function
processEvent
(raw: string)
worker/src/stream.ts:173
↓ 1 callers
Function
proxyAnthropic
( body: AnthropicRequest, request: Request, apiKey: string, upstreamUrl: string, )
worker/src/index.ts:96
↓ 1 callers
Function
queryCastari
({ prompt, options = {}, }: { prompt: string | AsyncIterable<SDKUserMessage>; options?: CastariOptions
src/queryCastari.ts:97
↓ 1 callers
Function
readFileAsDataUrl
(file: File)
claude-agent-demo/app/components/Chat.tsx:804
↓ 1 callers
Function
recordTranscriptEntry
(message: SDKMessage, event: UIEvent)
claude-agent-demo/app/api/chat/route.ts:177
↓ 1 callers
Function
resolveOpenRouterModel
(model: string, defaultVendor: string)
worker/src/provider.ts:66
↓ 1 callers
Function
resolveProvider
(model: string)
src/queryCastari.ts:64
↓ 1 callers
Function
resolveSubagentModel
(params: SubagentResolutionParams)
src/queryCastari.ts:397
↓ 1 callers
Function
resolveWireModel
(model: string, provider: Provider, defaultVendor = 'openai')
src/queryCastari.ts:74
↓ 1 callers
Function
rewriteEditInput
(input: ToolInput)
claude-agent-demo/lib/policy/permission.ts:101
↓ 1 callers
Function
rewriteInputs
(toolName: string, input: ToolInput)
claude-agent-demo/lib/policy/permission.ts:76
↓ 1 callers
Function
rewriteReadInput
(input: ToolInput)
claude-agent-demo/lib/policy/permission.ts:92
↓ 1 callers
Function
rewriteSearchInput
(input: ToolInput)
claude-agent-demo/lib/policy/permission.ts:121
↓ 1 callers
Function
rewriteWriteInput
(input: ToolInput)
claude-agent-demo/lib/policy/permission.ts:110
↓ 1 callers
Function
safePayload
(payload: unknown)
claude-agent-demo/lib/agent/hooks.ts:39
↓ 1 callers
Function
safeStringify
(value: unknown)
worker/src/translator.ts:185
↓ 1 callers
Function
sanitizeSessionId
(sessionId: string)
claude-agent-demo/lib/store/transcripts.ts:19
↓ 1 callers
Function
shouldIntercept
(request: Request)
src/queryCastari.ts:249
↓ 1 callers
Function
startQuery
(prompt: QueryPrompt, config: QueryRuntimeConfig = {})
claude-agent-demo/lib/agent/session.ts:60
↓ 1 callers
Function
streamOpenRouterToAnthropic
(upstream: Response, options: StreamOptions)
worker/src/stream.ts:17
↓ 1 callers
Function
stringifySystem
(system: string | AnthropicContentText[])
worker/src/translator.ts:71
Function
Chat
()
claude-agent-demo/app/components/Chat.tsx:83
Function
Home
()
claude-agent-demo/app/page.tsx:3
next →
1–100 of 120, ranked by callers