@copilotkit/runtime 1.2.0 → 1.2.2-feat-runtime-remote-actions.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/CHANGELOG.md +43 -0
- package/__snapshots__/schema/schema.graphql +41 -0
- package/dist/{chunk-HCUZC4GO.mjs → chunk-2N45GS3P.mjs} +2 -2
- package/dist/{chunk-URMISMK2.mjs → chunk-73NMP3DI.mjs} +2 -2
- package/dist/{chunk-736EEICU.mjs → chunk-BJ2LVHWA.mjs} +3 -3
- package/dist/{chunk-ZHFBLKC3.mjs → chunk-T6O5FSTK.mjs} +2 -2
- package/dist/{chunk-GEIBJJQ4.mjs → chunk-TBZGOJJX.mjs} +14 -2
- package/dist/chunk-TBZGOJJX.mjs.map +1 -0
- package/dist/{chunk-3MYGPMKL.mjs → chunk-X5QBBMCJ.mjs} +2 -2
- package/dist/{chunk-3TQLJ3YL.mjs → chunk-XROLDARH.mjs} +786 -158
- package/dist/chunk-XROLDARH.mjs.map +1 -0
- package/dist/chunk-ZNZGATLW.mjs +260 -0
- package/dist/chunk-ZNZGATLW.mjs.map +1 -0
- package/dist/{shared-c5362338.d.ts → copilot-runtime-d427e991.d.ts} +65 -38
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/graphql/types/converted/index.js +13 -0
- package/dist/graphql/types/converted/index.js.map +1 -1
- package/dist/graphql/types/converted/index.mjs +3 -1
- package/dist/{index-aa091e3c.d.ts → index-0476e4f7.d.ts} +24 -2
- package/dist/{index-13aa818e.d.ts → index-079752b9.d.ts} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +982 -245
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/{langserve-a54438c6.d.ts → langserve-d6073a3b.d.ts} +24 -11
- package/dist/lib/index.d.ts +7 -7
- package/dist/lib/index.js +982 -245
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +8 -8
- package/dist/lib/integrations/index.d.ts +6 -6
- package/dist/lib/integrations/index.js +437 -182
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +6 -6
- package/dist/lib/integrations/nest/index.d.ts +5 -5
- package/dist/lib/integrations/nest/index.js +437 -182
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +4 -4
- package/dist/lib/integrations/node-express/index.d.ts +5 -5
- package/dist/lib/integrations/node-express/index.js +437 -182
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +4 -4
- package/dist/lib/integrations/node-http/index.d.ts +5 -5
- package/dist/lib/integrations/node-http/index.js +437 -182
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +3 -3
- package/dist/service-adapters/index.d.ts +3 -3
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +3 -3
- package/package.json +7 -5
- package/src/agents/langgraph/event-source.ts +222 -0
- package/src/agents/langgraph/events.ts +309 -0
- package/src/graphql/inputs/agent-session.input.ts +13 -0
- package/src/graphql/inputs/agent-state.input.ts +10 -0
- package/src/graphql/inputs/generate-copilot-response.input.ts +11 -0
- package/src/graphql/inputs/message.input.ts +30 -0
- package/src/graphql/resolvers/copilot.resolver.ts +56 -12
- package/src/graphql/types/converted/index.ts +15 -0
- package/src/graphql/types/copilot-response.type.ts +29 -0
- package/src/graphql/types/enums.ts +1 -0
- package/src/lib/index.ts +1 -1
- package/src/lib/integrations/shared.ts +1 -1
- package/src/lib/runtime/copilot-runtime.ts +360 -0
- package/src/lib/runtime/remote-actions.ts +241 -0
- package/src/service-adapters/conversion.ts +16 -0
- package/src/service-adapters/events.ts +101 -19
- package/dist/chunk-3TQLJ3YL.mjs.map +0 -1
- package/dist/chunk-GEIBJJQ4.mjs.map +0 -1
- package/dist/chunk-MHLJQ2RF.mjs +0 -158
- package/dist/chunk-MHLJQ2RF.mjs.map +0 -1
- package/src/lib/copilot-runtime.ts +0 -231
- /package/dist/{chunk-HCUZC4GO.mjs.map → chunk-2N45GS3P.mjs.map} +0 -0
- /package/dist/{chunk-URMISMK2.mjs.map → chunk-73NMP3DI.mjs.map} +0 -0
- /package/dist/{chunk-736EEICU.mjs.map → chunk-BJ2LVHWA.mjs.map} +0 -0
- /package/dist/{chunk-ZHFBLKC3.mjs.map → chunk-T6O5FSTK.mjs.map} +0 -0
- /package/dist/{chunk-3MYGPMKL.mjs.map → chunk-X5QBBMCJ.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotRuntime,
|
|
3
3
|
flattenToolCallsNoDuplicates
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZNZGATLW.mjs";
|
|
5
5
|
import {
|
|
6
6
|
GoogleGenerativeAIAdapter,
|
|
7
7
|
GroqAdapter,
|
|
@@ -9,31 +9,31 @@ import {
|
|
|
9
9
|
OpenAIAdapter,
|
|
10
10
|
OpenAIAssistantAdapter,
|
|
11
11
|
UnifyAdapter
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BJ2LVHWA.mjs";
|
|
13
13
|
import {
|
|
14
14
|
config,
|
|
15
15
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
16
16
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-X5QBBMCJ.mjs";
|
|
18
18
|
import {
|
|
19
19
|
copilotRuntimeNestEndpoint
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-2N45GS3P.mjs";
|
|
21
21
|
import {
|
|
22
22
|
copilotRuntimeNodeExpressEndpoint
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-T6O5FSTK.mjs";
|
|
24
24
|
import {
|
|
25
25
|
buildSchema,
|
|
26
26
|
copilotRuntimeNodeHttpEndpoint,
|
|
27
27
|
createContext,
|
|
28
28
|
getCommonConfig
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
29
|
+
} from "./chunk-XROLDARH.mjs";
|
|
30
|
+
import "./chunk-73NMP3DI.mjs";
|
|
31
31
|
import {
|
|
32
32
|
GuardrailsValidationFailureResponse,
|
|
33
33
|
MessageStreamInterruptedResponse,
|
|
34
34
|
UnknownErrorResponse
|
|
35
35
|
} from "./chunk-U3V2BCGI.mjs";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-TBZGOJJX.mjs";
|
|
37
37
|
import "./chunk-RMZWGQ46.mjs";
|
|
38
38
|
import "./chunk-44O2JGUY.mjs";
|
|
39
39
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Message } from './index-
|
|
1
|
+
import { a as Message } from './index-0476e4f7.js';
|
|
2
2
|
import * as rxjs from 'rxjs';
|
|
3
3
|
import { Subject, ReplaySubject } from 'rxjs';
|
|
4
4
|
import { Action, Parameter } from '@copilotkit/shared';
|
|
@@ -12,6 +12,12 @@ declare class GuardrailsResult {
|
|
|
12
12
|
reason?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
declare class ActionInput {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
jsonSchema: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
declare enum RuntimeEventTypes {
|
|
16
22
|
TextMessageStart = "TextMessageStart",
|
|
17
23
|
TextMessageContent = "TextMessageContent",
|
|
@@ -19,9 +25,10 @@ declare enum RuntimeEventTypes {
|
|
|
19
25
|
ActionExecutionStart = "ActionExecutionStart",
|
|
20
26
|
ActionExecutionArgs = "ActionExecutionArgs",
|
|
21
27
|
ActionExecutionEnd = "ActionExecutionEnd",
|
|
22
|
-
ActionExecutionResult = "ActionExecutionResult"
|
|
28
|
+
ActionExecutionResult = "ActionExecutionResult",
|
|
29
|
+
AgentStateMessage = "AgentStateMessage"
|
|
23
30
|
}
|
|
24
|
-
type FunctionCallScope = "client" | "server";
|
|
31
|
+
type FunctionCallScope = "client" | "server" | "passThrough";
|
|
25
32
|
type RuntimeEvent = {
|
|
26
33
|
type: RuntimeEventTypes.TextMessageStart;
|
|
27
34
|
messageId: string;
|
|
@@ -45,6 +52,16 @@ type RuntimeEvent = {
|
|
|
45
52
|
actionName: string;
|
|
46
53
|
actionExecutionId: string;
|
|
47
54
|
result: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: RuntimeEventTypes.AgentStateMessage;
|
|
57
|
+
threadId: string;
|
|
58
|
+
agentName: string;
|
|
59
|
+
nodeName: string;
|
|
60
|
+
runId: string;
|
|
61
|
+
active: boolean;
|
|
62
|
+
role: string;
|
|
63
|
+
state: string;
|
|
64
|
+
running: boolean;
|
|
48
65
|
};
|
|
49
66
|
type EventSourceCallback = (eventStream$: RuntimeEventSubject) => Promise<void>;
|
|
50
67
|
declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
|
|
@@ -58,23 +75,19 @@ declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
|
|
|
58
75
|
sendActionExecutionEnd(): void;
|
|
59
76
|
sendActionExecution(actionExecutionId: string, toolName: string, args: string): void;
|
|
60
77
|
sendActionExecutionResult(actionExecutionId: string, actionName: string, result: string): void;
|
|
78
|
+
sendAgentStateMessage(threadId: string, agentName: string, nodeName: string, runId: string, active: boolean, role: string, state: string, running: boolean): void;
|
|
61
79
|
}
|
|
62
80
|
declare class RuntimeEventSource {
|
|
63
81
|
private eventStream$;
|
|
64
82
|
private callback;
|
|
65
83
|
stream(callback: EventSourceCallback): Promise<void>;
|
|
66
|
-
|
|
67
|
-
|
|
84
|
+
processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents, }: {
|
|
85
|
+
serverSideActions: Action<any>[];
|
|
68
86
|
guardrailsResult$?: Subject<GuardrailsResult>;
|
|
87
|
+
actionInputsWithoutAgents: ActionInput[];
|
|
69
88
|
}): rxjs.Observable<RuntimeEvent>;
|
|
70
89
|
}
|
|
71
90
|
|
|
72
|
-
declare class ActionInput {
|
|
73
|
-
name: string;
|
|
74
|
-
description: string;
|
|
75
|
-
jsonSchema: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
91
|
declare class ForwardedParametersInput {
|
|
79
92
|
model?: string;
|
|
80
93
|
maxTokens?: number;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { g as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, c as CreateCopilotRuntimeServerOptions, G as GraphQLContext, e as buildSchema, d as createContext, f as flattenToolCallsNoDuplicates, h as getCommonConfig } from '../
|
|
2
|
-
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 '../index-
|
|
1
|
+
export { g as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, c as CreateCopilotRuntimeServerOptions, G as GraphQLContext, e as buildSchema, d as createContext, f as flattenToolCallsNoDuplicates, h as getCommonConfig } from '../copilot-runtime-d427e991.js';
|
|
2
|
+
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 '../index-079752b9.js';
|
|
3
3
|
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
|
|
5
5
|
export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/index.js';
|
|
6
6
|
export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js';
|
|
7
|
-
import 'graphql';
|
|
8
|
-
import 'pino';
|
|
9
|
-
import 'graphql-yoga';
|
|
10
7
|
import '@copilotkit/shared';
|
|
11
|
-
import '../langserve-
|
|
12
|
-
import '../index-
|
|
8
|
+
import '../langserve-d6073a3b.js';
|
|
9
|
+
import '../index-0476e4f7.js';
|
|
13
10
|
import '../graphql/types/base/index.js';
|
|
14
11
|
import 'rxjs';
|
|
12
|
+
import 'graphql';
|
|
13
|
+
import 'pino';
|
|
14
|
+
import 'graphql-yoga';
|
|
15
15
|
import './cloud/index.js';
|
|
16
16
|
import 'openai';
|
|
17
17
|
import '@google/generative-ai';
|