@copilotkit/runtime 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +7 -0
- package/.turbo/turbo-build.log +70 -0
- package/CHANGELOG.md +1 -0
- package/__snapshots__/schema/schema.graphql +178 -0
- package/dist/chunk-2CCVVJDU.mjs +56 -0
- package/dist/chunk-2CCVVJDU.mjs.map +1 -0
- package/dist/chunk-4UA4RB4C.mjs +185 -0
- package/dist/chunk-4UA4RB4C.mjs.map +1 -0
- package/dist/chunk-5HGYI6EG.mjs +678 -0
- package/dist/chunk-5HGYI6EG.mjs.map +1 -0
- package/dist/chunk-7IFP53C6.mjs +169 -0
- package/dist/chunk-7IFP53C6.mjs.map +1 -0
- package/dist/chunk-BLTAUVRP.mjs +30 -0
- package/dist/chunk-BLTAUVRP.mjs.map +1 -0
- package/dist/chunk-NFCPM5AM.mjs +43 -0
- package/dist/chunk-NFCPM5AM.mjs.map +1 -0
- package/dist/chunk-XPAUPJMW.mjs +1051 -0
- package/dist/chunk-XPAUPJMW.mjs.map +1 -0
- package/dist/graphql/types/base/index.d.ts +6 -0
- package/dist/graphql/types/base/index.js +63 -0
- package/dist/graphql/types/base/index.js.map +1 -0
- package/dist/graphql/types/base/index.mjs +7 -0
- package/dist/graphql/types/base/index.mjs.map +1 -0
- package/dist/graphql/types/converted/index.d.ts +2 -0
- package/dist/graphql/types/converted/index.js +88 -0
- package/dist/graphql/types/converted/index.js.map +1 -0
- package/dist/graphql/types/converted/index.mjs +12 -0
- package/dist/graphql/types/converted/index.mjs.map +1 -0
- package/dist/index-aa091e3c.d.ts +49 -0
- package/dist/index-f0875df3.d.ts +197 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +2171 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +49 -0
- package/dist/index.mjs.map +1 -0
- package/dist/langchain-adapter-9ce103f3.d.ts +200 -0
- package/dist/langserve-fd5066ee.d.ts +96 -0
- package/dist/lib/index.d.ts +15 -0
- package/dist/lib/index.js +2170 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/index.mjs +46 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/integrations/index.d.ts +9 -0
- package/dist/lib/integrations/index.js +1024 -0
- package/dist/lib/integrations/index.js.map +1 -0
- package/dist/lib/integrations/index.mjs +24 -0
- package/dist/lib/integrations/index.mjs.map +1 -0
- package/dist/lib/integrations/node-http/index.d.ts +8 -0
- package/dist/lib/integrations/node-http/index.js +969 -0
- package/dist/lib/integrations/node-http/index.js.map +1 -0
- package/dist/lib/integrations/node-http/index.mjs +10 -0
- package/dist/lib/integrations/node-http/index.mjs.map +1 -0
- package/dist/pages-router-b6bc6c60.d.ts +30 -0
- package/dist/service-adapters/index.d.ts +11 -0
- package/dist/service-adapters/index.js +912 -0
- package/dist/service-adapters/index.js.map +1 -0
- package/dist/service-adapters/index.mjs +18 -0
- package/dist/service-adapters/index.mjs.map +1 -0
- package/jest.config.js +5 -0
- package/package.json +63 -0
- package/scripts/generate-gql-schema.ts +13 -0
- package/src/graphql/inputs/action.input.ts +13 -0
- package/src/graphql/inputs/cloud-guardrails.input.ts +19 -0
- package/src/graphql/inputs/cloud.input.ts +8 -0
- package/src/graphql/inputs/context-property.input.ts +10 -0
- package/src/graphql/inputs/custom-property.input.ts +15 -0
- package/src/graphql/inputs/frontend.input.ts +11 -0
- package/src/graphql/inputs/generate-copilot-response.input.ts +22 -0
- package/src/graphql/inputs/message.input.ts +50 -0
- package/src/graphql/resolvers/copilot.resolver.ts +147 -0
- package/src/graphql/types/base/index.ts +10 -0
- package/src/graphql/types/converted/index.ts +29 -0
- package/src/graphql/types/copilot-response.type.ts +75 -0
- package/src/graphql/types/enums.ts +22 -0
- package/src/graphql/types/guardrails-result.type.ts +20 -0
- package/src/graphql/types/message-status.type.ts +40 -0
- package/src/graphql/types/response-status.type.ts +52 -0
- package/src/index.ts +2 -0
- package/src/lib/copilot-cloud.ts +63 -0
- package/src/lib/copilot-runtime.ts +261 -0
- package/src/lib/guardrails.ts +3 -0
- package/src/lib/index.ts +7 -0
- package/src/lib/integrations/index.ts +4 -0
- package/src/lib/integrations/nextjs/app-router.ts +29 -0
- package/src/lib/integrations/nextjs/pages-router.ts +36 -0
- package/src/lib/integrations/node-http/index.ts +23 -0
- package/src/lib/integrations/shared.ts +68 -0
- package/src/service-adapters/conversion.ts +47 -0
- package/src/service-adapters/events.ts +197 -0
- package/src/service-adapters/experimental/groq/groq-adapter.ts +124 -0
- package/src/service-adapters/experimental/ollama/ollama-adapter.ts +75 -0
- package/src/service-adapters/google/google-genai-adapter.ts +149 -0
- package/src/service-adapters/google/utils.ts +94 -0
- package/src/service-adapters/index.ts +6 -0
- package/src/service-adapters/langchain/langchain-adapter.ts +82 -0
- package/src/service-adapters/langchain/langserve.ts +81 -0
- package/src/service-adapters/langchain/types.ts +14 -0
- package/src/service-adapters/langchain/utils.ts +235 -0
- package/src/service-adapters/openai/openai-adapter.ts +142 -0
- package/src/service-adapters/openai/openai-assistant-adapter.ts +260 -0
- package/src/service-adapters/openai/utils.ts +164 -0
- package/src/service-adapters/service-adapter.ts +29 -0
- package/tsconfig.json +11 -0
- package/tsup.config.ts +17 -0
- package/typedoc.json +4 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { a as Message } from './index-aa091e3c.js';
|
|
2
|
+
import * as rxjs from 'rxjs';
|
|
3
|
+
import { ReplaySubject } from 'rxjs';
|
|
4
|
+
import { Action, Parameter } from '@copilotkit/shared';
|
|
5
|
+
|
|
6
|
+
declare enum RuntimeEventTypes {
|
|
7
|
+
TextMessageStart = "TextMessageStart",
|
|
8
|
+
TextMessageContent = "TextMessageContent",
|
|
9
|
+
TextMessageEnd = "TextMessageEnd",
|
|
10
|
+
ActionExecutionStart = "ActionExecutionStart",
|
|
11
|
+
ActionExecutionArgs = "ActionExecutionArgs",
|
|
12
|
+
ActionExecutionEnd = "ActionExecutionEnd",
|
|
13
|
+
ActionExecutionResult = "ActionExecutionResult"
|
|
14
|
+
}
|
|
15
|
+
type FunctionCallScope = "client" | "server";
|
|
16
|
+
type RuntimeEvent = {
|
|
17
|
+
type: RuntimeEventTypes.TextMessageStart;
|
|
18
|
+
messageId: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: RuntimeEventTypes.TextMessageContent;
|
|
21
|
+
content: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: RuntimeEventTypes.TextMessageEnd;
|
|
24
|
+
} | {
|
|
25
|
+
type: RuntimeEventTypes.ActionExecutionStart;
|
|
26
|
+
actionExecutionId: string;
|
|
27
|
+
actionName: string;
|
|
28
|
+
scope?: FunctionCallScope;
|
|
29
|
+
} | {
|
|
30
|
+
type: RuntimeEventTypes.ActionExecutionArgs;
|
|
31
|
+
args: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: RuntimeEventTypes.ActionExecutionEnd;
|
|
34
|
+
} | {
|
|
35
|
+
type: RuntimeEventTypes.ActionExecutionResult;
|
|
36
|
+
actionName: string;
|
|
37
|
+
actionExecutionId: string;
|
|
38
|
+
result: string;
|
|
39
|
+
};
|
|
40
|
+
type EventSourceCallback = (eventStream$: RuntimeEventSubject) => Promise<void>;
|
|
41
|
+
declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
|
|
42
|
+
constructor();
|
|
43
|
+
sendTextMessageStart(messageId: string): void;
|
|
44
|
+
sendTextMessageContent(content: string): void;
|
|
45
|
+
sendTextMessageEnd(): void;
|
|
46
|
+
sendTextMessage(messageId: string, content: string): void;
|
|
47
|
+
sendActionExecutionStart(actionExecutionId: string, actionName: string): void;
|
|
48
|
+
sendActionExecutionArgs(args: string): void;
|
|
49
|
+
sendActionExecutionEnd(): void;
|
|
50
|
+
sendActionExecution(actionExecutionId: string, toolName: string, args: string): void;
|
|
51
|
+
sendActionExecutionResult(actionExecutionId: string, actionName: string, result: string): void;
|
|
52
|
+
}
|
|
53
|
+
declare class RuntimeEventSource {
|
|
54
|
+
private eventStream$;
|
|
55
|
+
private callback;
|
|
56
|
+
stream(callback: EventSourceCallback): Promise<void>;
|
|
57
|
+
process(serversideActions: Action<any>[]): rxjs.Observable<RuntimeEvent>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare class ActionInput {
|
|
61
|
+
name: string;
|
|
62
|
+
description: string;
|
|
63
|
+
jsonSchema: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface CopilotRuntimeChatCompletionRequest {
|
|
67
|
+
eventSource: RuntimeEventSource;
|
|
68
|
+
messages: Message[];
|
|
69
|
+
actions: ActionInput[];
|
|
70
|
+
model?: string;
|
|
71
|
+
threadId?: string;
|
|
72
|
+
runId?: string;
|
|
73
|
+
}
|
|
74
|
+
interface CopilotRuntimeChatCompletionResponse {
|
|
75
|
+
stream?: ReadableStream;
|
|
76
|
+
threadId?: string;
|
|
77
|
+
runId?: string;
|
|
78
|
+
}
|
|
79
|
+
interface CopilotServiceAdapter {
|
|
80
|
+
process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface RemoteChain {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string;
|
|
86
|
+
chainUrl: string;
|
|
87
|
+
parameters?: Parameter[];
|
|
88
|
+
parameterType: "single" | "multi";
|
|
89
|
+
}
|
|
90
|
+
declare class RemoteChain implements RemoteChain {
|
|
91
|
+
constructor(options: RemoteChain);
|
|
92
|
+
toAction(): Promise<Action<any>>;
|
|
93
|
+
inferLangServeParameters(): Promise<void>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { ActionInput as A, CopilotServiceAdapter as C, RemoteChain as R, RuntimeEventSource as a, CopilotRuntimeChatCompletionRequest as b, CopilotRuntimeChatCompletionResponse as c };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { c as CloudCheckGuardrailsInputParams, d as CloudCheckGuardrailsInputResponse, b as CopilotBackend, e as CopilotCloud, g as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, h as CreateCopilotRuntimeServerOptions, G as GraphQLContext, R as RemoteCopilotCloud, j as buildSchema, l as copilotRuntimeNodeHttpEndpoint, i as createContext, f as flattenToolCallsNoDuplicates, k as getCommonConfig } from '../index-f0875df3.js';
|
|
2
|
+
export { G as GoogleGenerativeAIAdapter, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams } from '../langchain-adapter-9ce103f3.js';
|
|
3
|
+
export { C as CopilotRuntimeServerInstance, a as config, c as copilotRuntimeNextJSAppRouterEndpoint, b as copilotRuntimeNextJSPagesRouterEndpoint } from '../pages-router-b6bc6c60.js';
|
|
4
|
+
import 'graphql-yoga';
|
|
5
|
+
import 'graphql';
|
|
6
|
+
import '@copilotkit/shared';
|
|
7
|
+
import '../langserve-fd5066ee.js';
|
|
8
|
+
import '../index-aa091e3c.js';
|
|
9
|
+
import '../graphql/types/base/index.js';
|
|
10
|
+
import 'rxjs';
|
|
11
|
+
import 'openai';
|
|
12
|
+
import '@google/generative-ai';
|
|
13
|
+
import '@langchain/core/messages';
|
|
14
|
+
import '@langchain/core/tools';
|
|
15
|
+
import '@langchain/core/utils/stream';
|