@copilotkit/runtime 1.9.3 → 1.10.0-next.1
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 +17 -0
- package/dist/{chunk-YKUWJR33.mjs → chunk-5OSQ6CM5.mjs} +2 -2
- package/dist/{chunk-TPT4AKCH.mjs → chunk-7WC4OMOL.mjs} +2 -2
- package/dist/{chunk-27ICMTNV.mjs → chunk-NV4PTNDU.mjs} +2 -2
- package/dist/{chunk-DC55PN5M.mjs → chunk-VOCP3OKE.mjs} +2 -2
- package/dist/{chunk-IWD3ZNTV.mjs → chunk-YBAPVMN4.mjs} +9 -5
- package/dist/chunk-YBAPVMN4.mjs.map +1 -0
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/lib/index.js +8 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.js +1 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.js +1 -1
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.js +1 -1
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.js +1 -1
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/package.json +4 -4
- package/src/lib/runtime/agui-action.ts +5 -0
- package/src/lib/runtime/remote-actions.ts +1 -0
- package/src/lib/streaming.ts +1 -0
- package/dist/chunk-IWD3ZNTV.mjs.map +0 -1
- /package/dist/{chunk-YKUWJR33.mjs.map → chunk-5OSQ6CM5.mjs.map} +0 -0
- /package/dist/{chunk-TPT4AKCH.mjs.map → chunk-7WC4OMOL.mjs.map} +0 -0
- /package/dist/{chunk-27ICMTNV.mjs.map → chunk-NV4PTNDU.mjs.map} +0 -0
- /package/dist/{chunk-DC55PN5M.mjs.map → chunk-VOCP3OKE.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.
|
|
12
|
+
"version": "1.10.0-next.1",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"tsup": "^6.7.0",
|
|
34
34
|
"typescript": "^5.2.3",
|
|
35
35
|
"zod-to-json-schema": "^3.23.5",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"tsconfig": "1.4.6",
|
|
37
|
+
"eslint-config-custom": "1.4.6"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@ag-ui/client": "0.0.35",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"rxjs": "7.8.1",
|
|
70
70
|
"type-graphql": "2.0.0-rc.1",
|
|
71
71
|
"zod": "^3.23.3",
|
|
72
|
-
"@copilotkit/shared": "1.
|
|
72
|
+
"@copilotkit/shared": "1.10.0-next.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@ag-ui/client": ">=0.0.34",
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import { AbstractAgent } from "@ag-ui/client";
|
|
16
16
|
import { parseJson } from "@copilotkit/shared";
|
|
17
17
|
import { MetaEventInput } from "../../graphql/inputs/meta-event.input";
|
|
18
|
+
import { GraphQLContext } from "../integrations/shared";
|
|
18
19
|
|
|
19
20
|
export function constructAGUIRemoteAction({
|
|
20
21
|
logger,
|
|
@@ -24,6 +25,7 @@ export function constructAGUIRemoteAction({
|
|
|
24
25
|
metaEvents,
|
|
25
26
|
threadMetadata,
|
|
26
27
|
nodeName,
|
|
28
|
+
graphqlContext,
|
|
27
29
|
}: {
|
|
28
30
|
logger: Logger;
|
|
29
31
|
messages: Message[];
|
|
@@ -32,6 +34,7 @@ export function constructAGUIRemoteAction({
|
|
|
32
34
|
metaEvents?: MetaEventInput[];
|
|
33
35
|
threadMetadata?: Record<string, any>;
|
|
34
36
|
nodeName?: string;
|
|
37
|
+
graphqlContext: GraphQLContext;
|
|
35
38
|
}) {
|
|
36
39
|
const action = {
|
|
37
40
|
name: agent.agentId,
|
|
@@ -75,6 +78,8 @@ export function constructAGUIRemoteAction({
|
|
|
75
78
|
...(metaEvents?.length ? { command: { resume: metaEvents[0]?.response } } : {}),
|
|
76
79
|
...(threadMetadata ? { threadMetadata } : {}),
|
|
77
80
|
...(nodeName ? { nodeName } : {}),
|
|
81
|
+
// Forward properties from the graphql context to the agent, e.g Authorization token
|
|
82
|
+
...graphqlContext.properties,
|
|
78
83
|
};
|
|
79
84
|
|
|
80
85
|
return agent.legacy_to_be_removed_runAgentBridged({
|
package/src/lib/streaming.ts
CHANGED
|
@@ -81,6 +81,7 @@ function convertStreamingErrorToStructured(error: any): CopilotKitError {
|
|
|
81
81
|
error?.message?.includes("other side closed") ||
|
|
82
82
|
error?.code === "UND_ERR_SOCKET"
|
|
83
83
|
) {
|
|
84
|
+
console.log("error", error);
|
|
84
85
|
return new CopilotKitLowLevelError({
|
|
85
86
|
error: error instanceof Error ? error : new Error(String(error)),
|
|
86
87
|
url: "streaming connection",
|