@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.
Files changed (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{chunk-YAGK34TY.mjs → chunk-J3MFBKHV.mjs} +2 -2
  3. package/dist/{chunk-3QQN3UHZ.mjs → chunk-K7ZZXZK5.mjs} +2 -2
  4. package/dist/{chunk-4PYMUXNW.mjs → chunk-WVWVPGXI.mjs} +19 -10
  5. package/dist/chunk-WVWVPGXI.mjs.map +1 -0
  6. package/dist/{chunk-GWEVSIPK.mjs → chunk-ZXFXJVAP.mjs} +2 -2
  7. package/dist/{copilot-runtime-eb953402.d.ts → copilot-runtime-9347bd66.d.ts} +1 -0
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +12 -3
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +7 -7
  12. package/dist/lib/index.d.ts +1 -1
  13. package/dist/lib/index.js +12 -3
  14. package/dist/lib/index.js.map +1 -1
  15. package/dist/lib/index.mjs +7 -7
  16. package/dist/lib/integrations/index.d.ts +2 -2
  17. package/dist/lib/integrations/index.js +1 -1
  18. package/dist/lib/integrations/index.js.map +1 -1
  19. package/dist/lib/integrations/index.mjs +7 -7
  20. package/dist/lib/integrations/nest/index.d.ts +1 -1
  21. package/dist/lib/integrations/nest/index.js +1 -1
  22. package/dist/lib/integrations/nest/index.js.map +1 -1
  23. package/dist/lib/integrations/nest/index.mjs +3 -3
  24. package/dist/lib/integrations/node-express/index.d.ts +1 -1
  25. package/dist/lib/integrations/node-express/index.js +1 -1
  26. package/dist/lib/integrations/node-express/index.js.map +1 -1
  27. package/dist/lib/integrations/node-express/index.mjs +3 -3
  28. package/dist/lib/integrations/node-http/index.d.ts +1 -1
  29. package/dist/lib/integrations/node-http/index.js +1 -1
  30. package/dist/lib/integrations/node-http/index.js.map +1 -1
  31. package/dist/lib/integrations/node-http/index.mjs +2 -2
  32. package/package.json +2 -2
  33. package/src/lib/runtime/copilot-runtime.ts +6 -3
  34. package/dist/chunk-4PYMUXNW.mjs.map +0 -1
  35. /package/dist/{chunk-YAGK34TY.mjs.map → chunk-J3MFBKHV.mjs.map} +0 -0
  36. /package/dist/{chunk-3QQN3UHZ.mjs.map → chunk-K7ZZXZK5.mjs.map} +0 -0
  37. /package/dist/{chunk-GWEVSIPK.mjs.map → chunk-ZXFXJVAP.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -3,13 +3,13 @@ import {
3
3
  config,
4
4
  copilotRuntimeNextJSAppRouterEndpoint,
5
5
  copilotRuntimeNextJSPagesRouterEndpoint
6
- } from "./chunk-YAGK34TY.mjs";
7
- import {
8
- copilotRuntimeNestEndpoint
9
- } from "./chunk-3QQN3UHZ.mjs";
6
+ } from "./chunk-J3MFBKHV.mjs";
10
7
  import {
11
8
  copilotRuntimeNodeExpressEndpoint
12
- } from "./chunk-GWEVSIPK.mjs";
9
+ } from "./chunk-ZXFXJVAP.mjs";
10
+ import {
11
+ copilotRuntimeNestEndpoint
12
+ } from "./chunk-K7ZZXZK5.mjs";
13
13
  import {
14
14
  CopilotRuntime,
15
15
  addCustomHeaderPlugin,
@@ -22,7 +22,8 @@ import {
22
22
  getCommonConfig,
23
23
  langGraphPlatformEndpoint,
24
24
  resolveEndpointType
25
- } from "./chunk-4PYMUXNW.mjs";
25
+ } from "./chunk-WVWVPGXI.mjs";
26
+ import "./chunk-RTFJTJMA.mjs";
26
27
  import {
27
28
  AnthropicAdapter,
28
29
  EmptyAdapter,
@@ -41,7 +42,6 @@ import {
41
42
  MessageStreamInterruptedResponse,
42
43
  UnknownErrorResponse
43
44
  } from "./chunk-5BIEM2UU.mjs";
44
- import "./chunk-RTFJTJMA.mjs";
45
45
  import "./chunk-2OZAGFV3.mjs";
46
46
  import "./chunk-FHD4JECV.mjs";
47
47
 
@@ -1,4 +1,4 @@
1
- export { i as CommonConfig, d as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, k as CopilotRuntimeLogger, e as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, b as addCustomHeaderPlugin, h as buildSchema, c as copilotKitEndpoint, g as createContext, m as createLogger, f as flattenToolCallsNoDuplicates, j as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-eb953402.js';
1
+ export { i as CommonConfig, d as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, k as CopilotRuntimeLogger, e as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, b as addCustomHeaderPlugin, h as buildSchema, c as copilotKitEndpoint, g as createContext, m as createLogger, f as flattenToolCallsNoDuplicates, j as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-9347bd66.js';
2
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 '../groq-adapter-fb9aa3ab.js';
3
3
  export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
4
4
  export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
package/dist/lib/index.js CHANGED
@@ -44,7 +44,7 @@ var require_package = __commonJS({
44
44
  publishConfig: {
45
45
  access: "public"
46
46
  },
47
- version: "1.8.3",
47
+ version: "1.8.4-next.1",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -3677,12 +3677,14 @@ var CopilotRuntime = class {
3677
3677
  onAfterRequest;
3678
3678
  delegateAgentProcessingToServiceAdapter;
3679
3679
  observability;
3680
+ availableAgents;
3680
3681
  constructor(params) {
3681
3682
  var _a, _b;
3682
3683
  if ((params == null ? void 0 : params.actions) && (params == null ? void 0 : params.remoteEndpoints) && (params == null ? void 0 : params.remoteEndpoints.some((e) => e.type === EndpointType.LangGraphPlatform))) {
3683
3684
  console.warn("Actions set in runtime instance will not be available for the agent");
3684
3685
  }
3685
3686
  this.actions = (params == null ? void 0 : params.actions) || [];
3687
+ this.availableAgents = [];
3686
3688
  for (const chain of (params == null ? void 0 : params.langserve) || []) {
3687
3689
  const remoteChain = new RemoteChain(chain);
3688
3690
  this.langserve.push(remoteChain.toAction());
@@ -3888,7 +3890,9 @@ please use an LLM adapter instead.`
3888
3890
  try {
3889
3891
  data = await client.assistants.search();
3890
3892
  if (data && "detail" in data && data.detail.toLowerCase() === "not found") {
3891
- throw new import_shared18.CopilotKitAgentDiscoveryError();
3893
+ throw new import_shared18.CopilotKitAgentDiscoveryError({
3894
+ availableAgents: this.availableAgents
3895
+ });
3892
3896
  }
3893
3897
  } catch (e) {
3894
3898
  throw new import_shared18.CopilotKitMisuseError({
@@ -3953,6 +3957,10 @@ please use an LLM adapter instead.`
3953
3957
  });
3954
3958
  }
3955
3959
  }, Promise.resolve([]));
3960
+ this.availableAgents = (await agents ?? []).map((a) => ({
3961
+ name: a.name,
3962
+ id: a.id
3963
+ }));
3956
3964
  return agents;
3957
3965
  }
3958
3966
  async loadAgentState(graphqlContext, threadId, agentName) {
@@ -4050,7 +4058,8 @@ please use an LLM adapter instead.`
4050
4058
  const currentAgent = serverSideActions.find((action) => action.name === agentName && isRemoteAgentAction(action));
4051
4059
  if (!currentAgent) {
4052
4060
  throw new import_shared18.CopilotKitAgentDiscoveryError({
4053
- agentName
4061
+ agentName,
4062
+ availableAgents: this.availableAgents
4054
4063
  });
4055
4064
  }
4056
4065
  const availableActionsForCurrentAgent = serverSideActions.filter((action) => (