@copilotkit/runtime 1.8.10-next.1 → 1.8.10-next.2
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 +7 -0
- package/dist/{chunk-TIJIKNRW.mjs → chunk-34Z6UB6N.mjs} +2 -2
- package/dist/{chunk-QT6WWDGM.mjs → chunk-L57B2EB7.mjs} +2 -2
- package/dist/{chunk-2UGQMYRO.mjs → chunk-R3Z3JTED.mjs} +29 -28
- package/dist/chunk-R3Z3JTED.mjs.map +1 -0
- package/dist/{chunk-DLKNGWDL.mjs → chunk-WOYBKZKY.mjs} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.js +28 -27
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.d.ts +3 -3
- package/dist/lib/integrations/index.js +6 -6
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.d.ts +2 -2
- package/dist/lib/integrations/nest/index.js +6 -6
- 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.d.ts +2 -2
- package/dist/lib/integrations/node-express/index.js +6 -6
- 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.d.ts +2 -2
- package/dist/lib/integrations/node-http/index.js +6 -6
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/dist/{shared-a7b30781.d.ts → shared-ede87417.d.ts} +1 -1
- package/package.json +7 -7
- package/src/lib/runtime/agentwire-action.ts +7 -9
- package/src/lib/runtime/copilot-runtime.ts +1 -1
- package/src/lib/runtime/remote-actions.ts +1 -1
- package/src/lib/runtime/remote-lg-action.ts +37 -24
- package/dist/chunk-2UGQMYRO.mjs.map +0 -1
- /package/dist/{chunk-TIJIKNRW.mjs.map → chunk-34Z6UB6N.mjs.map} +0 -0
- /package/dist/{chunk-QT6WWDGM.mjs.map → chunk-L57B2EB7.mjs.map} +0 -0
- /package/dist/{chunk-DLKNGWDL.mjs.map → chunk-WOYBKZKY.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-R3Z3JTED.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
config,
|
|
78
78
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-34Z6UB6N.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-R3Z3JTED.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNestEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-L57B2EB7.mjs.map
|
|
@@ -40,7 +40,7 @@ var require_package = __commonJS({
|
|
|
40
40
|
publishConfig: {
|
|
41
41
|
access: "public"
|
|
42
42
|
},
|
|
43
|
-
version: "1.8.10-next.
|
|
43
|
+
version: "1.8.10-next.2",
|
|
44
44
|
sideEffects: false,
|
|
45
45
|
main: "./dist/index.js",
|
|
46
46
|
module: "./dist/index.mjs",
|
|
@@ -77,17 +77,17 @@ var require_package = __commonJS({
|
|
|
77
77
|
"zod-to-json-schema": "^3.23.5"
|
|
78
78
|
},
|
|
79
79
|
dependencies: {
|
|
80
|
-
"@
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@
|
|
80
|
+
"@ag-ui/client": "^0.0.27",
|
|
81
|
+
"@ag-ui/core": "^0.0.27",
|
|
82
|
+
"@ag-ui/encoder": "^0.0.27",
|
|
83
|
+
"@ag-ui/proto": "^0.0.27",
|
|
84
84
|
"@anthropic-ai/sdk": "^0.27.3",
|
|
85
85
|
"@copilotkit/shared": "workspace:*",
|
|
86
86
|
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
87
87
|
"@langchain/community": "^0.3.29",
|
|
88
88
|
"@langchain/core": "^0.3.38",
|
|
89
89
|
"@langchain/google-gauth": "^0.1.0",
|
|
90
|
-
"@langchain/langgraph-sdk": "^0.0.
|
|
90
|
+
"@langchain/langgraph-sdk": "^0.0.70",
|
|
91
91
|
"@langchain/openai": "^0.4.2",
|
|
92
92
|
"class-transformer": "^0.5.1",
|
|
93
93
|
"class-validator": "^0.14.1",
|
|
@@ -1795,7 +1795,7 @@ async function execute(args) {
|
|
|
1795
1795
|
}
|
|
1796
1796
|
__name(execute, "execute");
|
|
1797
1797
|
async function streamEvents(controller, args) {
|
|
1798
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
1798
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1799
1799
|
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, config: explicitConfig, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
1800
1800
|
let nodeName = initialNodeName;
|
|
1801
1801
|
let state = initialState;
|
|
@@ -1936,18 +1936,19 @@ async function streamEvents(controller, args) {
|
|
|
1936
1936
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_started", {
|
|
1937
1937
|
hashedLgcKey: streamInfo.hashedLgcKey
|
|
1938
1938
|
});
|
|
1939
|
-
for await (
|
|
1939
|
+
for await (let streamResponseChunk of streamResponse) {
|
|
1940
1940
|
if (![
|
|
1941
1941
|
"events",
|
|
1942
1942
|
"values",
|
|
1943
1943
|
"error",
|
|
1944
1944
|
"updates"
|
|
1945
|
-
].includes(
|
|
1945
|
+
].includes(streamResponseChunk.event))
|
|
1946
1946
|
continue;
|
|
1947
|
-
if (
|
|
1948
|
-
throw new Error(`Error event thrown: ${
|
|
1947
|
+
if (streamResponseChunk.event === "error") {
|
|
1948
|
+
throw new Error(`Error event thrown: ${streamResponseChunk.data.message}`);
|
|
1949
1949
|
}
|
|
1950
|
-
const
|
|
1950
|
+
const chunk = streamResponseChunk;
|
|
1951
|
+
const interruptEvents = chunk.data.__interrupt__;
|
|
1951
1952
|
if (interruptEvents == null ? void 0 : interruptEvents.length) {
|
|
1952
1953
|
activeInterruptEvent = true;
|
|
1953
1954
|
const interruptValue = interruptEvents == null ? void 0 : interruptEvents[0].value;
|
|
@@ -1968,20 +1969,20 @@ async function streamEvents(controller, args) {
|
|
|
1968
1969
|
}
|
|
1969
1970
|
continue;
|
|
1970
1971
|
}
|
|
1971
|
-
if (
|
|
1972
|
+
if (streamResponseChunk.event === "updates")
|
|
1972
1973
|
continue;
|
|
1973
|
-
if (
|
|
1974
|
+
if (streamResponseChunk.event === "values") {
|
|
1974
1975
|
latestStateValues = chunk.data;
|
|
1975
1976
|
continue;
|
|
1976
1977
|
}
|
|
1977
|
-
const
|
|
1978
|
-
const currentNodeName =
|
|
1979
|
-
const eventType =
|
|
1980
|
-
const runId =
|
|
1978
|
+
const chunkData = chunk.data;
|
|
1979
|
+
const currentNodeName = chunkData.metadata.langgraph_node;
|
|
1980
|
+
const eventType = chunkData.event;
|
|
1981
|
+
const runId = chunkData.metadata.run_id;
|
|
1981
1982
|
externalRunId = runId;
|
|
1982
|
-
const metadata =
|
|
1983
|
-
if (((
|
|
1984
|
-
streamInfo.provider = (
|
|
1983
|
+
const metadata = chunkData.metadata;
|
|
1984
|
+
if (((_b = (_a = chunkData.data) == null ? void 0 : _a.output) == null ? void 0 : _b.model) != null && ((_d = (_c = chunkData.data) == null ? void 0 : _c.output) == null ? void 0 : _d.model) != "") {
|
|
1985
|
+
streamInfo.provider = (_f = (_e = chunkData.data) == null ? void 0 : _e.output) == null ? void 0 : _f.model;
|
|
1985
1986
|
}
|
|
1986
1987
|
if (metadata.langgraph_host != null && metadata.langgraph_host != "") {
|
|
1987
1988
|
streamInfo.langGraphHost = metadata.langgraph_host;
|
|
@@ -1989,9 +1990,9 @@ async function streamEvents(controller, args) {
|
|
|
1989
1990
|
if (metadata.langgraph_version != null && metadata.langgraph_version != "") {
|
|
1990
1991
|
streamInfo.langGraphVersion = metadata.langgraph_version;
|
|
1991
1992
|
}
|
|
1992
|
-
shouldExit = shouldExit || eventType === LangGraphEventTypes.OnCustomEvent &&
|
|
1993
|
+
shouldExit = shouldExit || eventType === LangGraphEventTypes.OnCustomEvent && chunkData.name === CustomEventNames.CopilotKitExit;
|
|
1993
1994
|
const emitIntermediateState = metadata["copilotkit:emit-intermediate-state"];
|
|
1994
|
-
const manuallyEmitIntermediateState = eventType === LangGraphEventTypes.OnCustomEvent &&
|
|
1995
|
+
const manuallyEmitIntermediateState = eventType === LangGraphEventTypes.OnCustomEvent && chunkData.name === CustomEventNames.CopilotKitManuallyEmitIntermediateState;
|
|
1995
1996
|
const exitingNode = nodeName === currentNodeName && eventType === LangGraphEventTypes.OnChainEnd;
|
|
1996
1997
|
if (exitingNode) {
|
|
1997
1998
|
manuallyEmittedState = null;
|
|
@@ -2004,7 +2005,7 @@ async function streamEvents(controller, args) {
|
|
|
2004
2005
|
continue;
|
|
2005
2006
|
}
|
|
2006
2007
|
if (manuallyEmitIntermediateState) {
|
|
2007
|
-
manuallyEmittedState =
|
|
2008
|
+
manuallyEmittedState = chunkData.data;
|
|
2008
2009
|
emit(getStateSyncEvent({
|
|
2009
2010
|
threadId,
|
|
2010
2011
|
runId,
|
|
@@ -2024,7 +2025,7 @@ async function streamEvents(controller, args) {
|
|
|
2024
2025
|
streamingStateExtractor = new StreamingStateExtractor(emitIntermediateState);
|
|
2025
2026
|
}
|
|
2026
2027
|
if (emitIntermediateState && eventType === LangGraphEventTypes.OnChatModelStream) {
|
|
2027
|
-
streamingStateExtractor.bufferToolCalls(
|
|
2028
|
+
streamingStateExtractor.bufferToolCalls(chunkData);
|
|
2028
2029
|
}
|
|
2029
2030
|
if (emitIntermediateStateUntilEnd !== null) {
|
|
2030
2031
|
updatedState = {
|
|
@@ -2049,10 +2050,10 @@ async function streamEvents(controller, args) {
|
|
|
2049
2050
|
schemaKeys
|
|
2050
2051
|
}));
|
|
2051
2052
|
}
|
|
2052
|
-
emit(JSON.stringify(
|
|
2053
|
+
emit(JSON.stringify(chunkData) + "\n");
|
|
2053
2054
|
}
|
|
2054
2055
|
state = await client.threads.getState(threadId);
|
|
2055
|
-
const interrupts = (
|
|
2056
|
+
const interrupts = (_h = (_g = state.tasks) == null ? void 0 : _g[0]) == null ? void 0 : _h.interrupts;
|
|
2056
2057
|
nodeName = interrupts ? nodeName : Object.keys(state.metadata.writes)[0];
|
|
2057
2058
|
const isEndNode = state.next.length === 0 && !interrupts;
|
|
2058
2059
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_ended", streamInfo);
|
|
@@ -5072,4 +5073,4 @@ export {
|
|
|
5072
5073
|
getCommonConfig,
|
|
5073
5074
|
copilotRuntimeNodeHttpEndpoint
|
|
5074
5075
|
};
|
|
5075
|
-
//# sourceMappingURL=chunk-
|
|
5076
|
+
//# sourceMappingURL=chunk-R3Z3JTED.mjs.map
|