UNPKG

@copilotkit/runtime

Version:

<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />

199 lines (196 loc) • 7.47 kB
export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-4ba7b2f0.js'; export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from '../shared-26958730.js'; export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js'; export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js'; export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/index.js'; export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js'; import * as rxjs from 'rxjs'; import { TextMessageStartEvent, TextMessageContentEvent, TextMessageEndEvent, ToolCallStartEvent, ToolCallArgsEvent, ToolCallEndEvent, RunAgentInput, EventType } from '@ag-ui/client'; import { LangGraphAgent as LangGraphAgent$1, LangGraphAgentConfig, ProcessedEvents, State, SchemaKeys } from '@ag-ui/langgraph'; export { LangGraphHttpAgent } from '@ag-ui/langgraph'; import { Message } from '@langchain/langgraph-sdk/dist/types.messages'; import 'openai'; import '../langserve-3f99bf2e.js'; import '../index-d4614f9b.js'; import '../graphql/types/base/index.js'; import '@copilotkit/shared'; import '@langchain/core/messages'; import '@langchain/core/tools'; import '@langchain/core/utils/stream'; import 'groq-sdk'; import 'graphql'; import 'pino'; import 'graphql-yoga'; import './cloud/index.js'; interface PredictStateTool { tool: string; state_key: string; tool_argument: string; } type TextMessageEvents = TextMessageStartEvent | TextMessageContentEvent | TextMessageEndEvent; type ToolCallEvents = ToolCallStartEvent | ToolCallArgsEvent | ToolCallEndEvent; declare enum CustomEventNames { CopilotKitManuallyEmitMessage = "copilotkit_manually_emit_message", CopilotKitManuallyEmitToolCall = "copilotkit_manually_emit_tool_call", CopilotKitManuallyEmitIntermediateState = "copilotkit_manually_emit_intermediate_state", CopilotKitExit = "copilotkit_exit" } declare class LangGraphAgent extends LangGraphAgent$1 { constructor(config: LangGraphAgentConfig); dispatchEvent(event: ProcessedEvents): boolean; run(input: RunAgentInput): rxjs.Observable<{ type: EventType.TEXT_MESSAGE_START; role: "developer" | "system" | "assistant" | "user"; messageId: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.TEXT_MESSAGE_CONTENT; messageId: string; delta: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.TEXT_MESSAGE_END; messageId: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.TOOL_CALL_START; toolCallId: string; toolCallName: string; timestamp?: number | undefined; rawEvent?: any; parentMessageId?: string | undefined; } | { type: EventType.TOOL_CALL_ARGS; toolCallId: string; delta: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.TOOL_CALL_END; toolCallId: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.THINKING_TEXT_MESSAGE_START; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.THINKING_TEXT_MESSAGE_CONTENT; delta: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.THINKING_TEXT_MESSAGE_END; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.THINKING_START; timestamp?: number | undefined; rawEvent?: any; title?: string | undefined; } | { type: EventType.THINKING_END; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.STATE_SNAPSHOT; timestamp?: number | undefined; rawEvent?: any; snapshot?: any; } | { type: EventType.STATE_DELTA; delta: any[]; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.MESSAGES_SNAPSHOT; messages: ({ id: string; role: "developer"; content: string; name?: string | undefined; } | { id: string; role: "system"; content: string; name?: string | undefined; } | { id: string; role: "assistant"; name?: string | undefined; content?: string | undefined; toolCalls?: { function: { name: string; arguments: string; }; type: "function"; id: string; }[] | undefined; } | { id: string; role: "user"; content: string; name?: string | undefined; } | { id: string; role: "tool"; content: string; toolCallId: string; error?: string | undefined; })[]; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.RAW; timestamp?: number | undefined; rawEvent?: any; event?: any; source?: string | undefined; } | { name: string; type: EventType.CUSTOM; value?: any; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.RUN_STARTED; threadId: string; runId: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.RUN_FINISHED; threadId: string; runId: string; timestamp?: number | undefined; rawEvent?: any; result?: any; } | { message: string; type: EventType.RUN_ERROR; code?: string | undefined; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.STEP_STARTED; stepName: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType.STEP_FINISHED; stepName: string; timestamp?: number | undefined; rawEvent?: any; } | { type: EventType; name: string; value: any; }>; langGraphDefaultMergeState(state: State, messages: Message[], tools: any): State; getSchemaKeys(): Promise<SchemaKeys>; } export { CustomEventNames, LangGraphAgent, PredictStateTool, TextMessageEvents, ToolCallEvents };