@copilotkit/runtime 1.8.3 → 1.8.4-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 +14 -0
- package/dist/{chunk-YAGK34TY.mjs → chunk-J3MFBKHV.mjs} +2 -2
- package/dist/{chunk-3QQN3UHZ.mjs → chunk-K7ZZXZK5.mjs} +2 -2
- package/dist/{chunk-4PYMUXNW.mjs → chunk-WVWVPGXI.mjs} +19 -10
- package/dist/chunk-WVWVPGXI.mjs.map +1 -0
- package/dist/{chunk-GWEVSIPK.mjs → chunk-ZXFXJVAP.mjs} +2 -2
- package/dist/{copilot-runtime-eb953402.d.ts → copilot-runtime-9347bd66.d.ts} +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +12 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +7 -7
- package/dist/lib/integrations/index.d.ts +2 -2
- package/dist/lib/integrations/index.js +1 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +7 -7
- package/dist/lib/integrations/nest/index.d.ts +1 -1
- 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 +3 -3
- package/dist/lib/integrations/node-express/index.d.ts +1 -1
- 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 +3 -3
- package/dist/lib/integrations/node-http/index.d.ts +1 -1
- 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 +2 -2
- package/package.json +2 -2
- package/src/lib/runtime/copilot-runtime.ts +6 -3
- package/dist/chunk-4PYMUXNW.mjs.map +0 -1
- /package/dist/{chunk-YAGK34TY.mjs.map → chunk-J3MFBKHV.mjs.map} +0 -0
- /package/dist/{chunk-3QQN3UHZ.mjs.map → chunk-K7ZZXZK5.mjs.map} +0 -0
- /package/dist/{chunk-GWEVSIPK.mjs.map → chunk-ZXFXJVAP.mjs.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-WVWVPGXI.mjs";
|
|
4
|
+
import "../../../chunk-RTFJTJMA.mjs";
|
|
4
5
|
import "../../../chunk-FZJAYGIR.mjs";
|
|
5
6
|
import "../../../chunk-5BIEM2UU.mjs";
|
|
6
|
-
import "../../../chunk-RTFJTJMA.mjs";
|
|
7
7
|
import "../../../chunk-2OZAGFV3.mjs";
|
|
8
8
|
import "../../../chunk-FHD4JECV.mjs";
|
|
9
9
|
export {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.8.
|
|
12
|
+
"version": "1.8.4-next.1",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"rxjs": "^7.8.1",
|
|
60
60
|
"type-graphql": "2.0.0-rc.1",
|
|
61
61
|
"zod": "^3.23.3",
|
|
62
|
-
"@copilotkit/shared": "1.8.
|
|
62
|
+
"@copilotkit/shared": "1.8.4-next.1"
|
|
63
63
|
},
|
|
64
64
|
"keywords": [
|
|
65
65
|
"copilotkit",
|
|
@@ -218,6 +218,7 @@ export class CopilotRuntime<const T extends Parameter[] | [] = []> {
|
|
|
218
218
|
private onAfterRequest?: OnAfterRequestHandler;
|
|
219
219
|
private delegateAgentProcessingToServiceAdapter: boolean;
|
|
220
220
|
private observability?: CopilotObservabilityConfig;
|
|
221
|
+
private availableAgents: Pick<AgentWithEndpoint, "name" | "id">[];
|
|
221
222
|
|
|
222
223
|
constructor(params?: CopilotRuntimeConstructorParams<T>) {
|
|
223
224
|
if (
|
|
@@ -228,6 +229,7 @@ export class CopilotRuntime<const T extends Parameter[] | [] = []> {
|
|
|
228
229
|
console.warn("Actions set in runtime instance will not be available for the agent");
|
|
229
230
|
}
|
|
230
231
|
this.actions = params?.actions || [];
|
|
232
|
+
this.availableAgents = [];
|
|
231
233
|
|
|
232
234
|
for (const chain of params?.langserve || []) {
|
|
233
235
|
const remoteChain = new RemoteChain(chain);
|
|
@@ -480,7 +482,7 @@ please use an LLM adapter instead.`,
|
|
|
480
482
|
}
|
|
481
483
|
|
|
482
484
|
async discoverAgentsFromEndpoints(graphqlContext: GraphQLContext): Promise<AgentWithEndpoint[]> {
|
|
483
|
-
const agents = this.remoteEndpointDefinitions.reduce(
|
|
485
|
+
const agents: Promise<AgentWithEndpoint[]> = this.remoteEndpointDefinitions.reduce(
|
|
484
486
|
async (acc: Promise<Agent[]>, endpoint) => {
|
|
485
487
|
const agents = await acc;
|
|
486
488
|
if (endpoint.type === EndpointType.LangGraphPlatform) {
|
|
@@ -498,7 +500,7 @@ please use an LLM adapter instead.`,
|
|
|
498
500
|
data = await client.assistants.search();
|
|
499
501
|
|
|
500
502
|
if (data && "detail" in data && (data.detail as string).toLowerCase() === "not found") {
|
|
501
|
-
throw new CopilotKitAgentDiscoveryError();
|
|
503
|
+
throw new CopilotKitAgentDiscoveryError({ availableAgents: this.availableAgents });
|
|
502
504
|
}
|
|
503
505
|
} catch (e) {
|
|
504
506
|
throw new CopilotKitMisuseError({
|
|
@@ -560,6 +562,7 @@ please use an LLM adapter instead.`,
|
|
|
560
562
|
},
|
|
561
563
|
Promise.resolve([]),
|
|
562
564
|
);
|
|
565
|
+
this.availableAgents = ((await agents) ?? []).map((a) => ({ name: a.name, id: a.id }));
|
|
563
566
|
|
|
564
567
|
return agents;
|
|
565
568
|
}
|
|
@@ -685,7 +688,7 @@ please use an LLM adapter instead.`,
|
|
|
685
688
|
) as RemoteAgentAction;
|
|
686
689
|
|
|
687
690
|
if (!currentAgent) {
|
|
688
|
-
throw new CopilotKitAgentDiscoveryError({ agentName });
|
|
691
|
+
throw new CopilotKitAgentDiscoveryError({ agentName, availableAgents: this.availableAgents });
|
|
689
692
|
}
|
|
690
693
|
|
|
691
694
|
// Filter actions to include:
|