@copilotkit/runtime 1.4.1-pre.2 → 1.4.1-pre.6

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 (46) hide show
  1. package/CHANGELOG.md +41 -3
  2. package/__snapshots__/schema/schema.graphql +8 -0
  3. package/dist/{chunk-2QIJQ6YS.mjs → chunk-SFC4IZY3.mjs} +24 -4
  4. package/dist/chunk-SFC4IZY3.mjs.map +1 -0
  5. package/dist/{chunk-L3CCF3GA.mjs → chunk-TIWN7W7O.mjs} +2 -2
  6. package/dist/{chunk-UAHCJ2F4.mjs → chunk-WCQG2CHA.mjs} +2 -2
  7. package/dist/{chunk-6WTF7IML.mjs → chunk-WWJRLGPB.mjs} +2 -2
  8. package/dist/{copilot-runtime-335a610d.d.ts → copilot-runtime-12e7ac40.d.ts} +2 -2
  9. package/dist/graphql/types/converted/index.d.ts +1 -1
  10. package/dist/{groq-adapter-b6c2b7ec.d.ts → groq-adapter-24abe931.d.ts} +1 -1
  11. package/dist/{index-83ee522f.d.ts → index-10b1c870.d.ts} +6 -1
  12. package/dist/index.d.ts +4 -4
  13. package/dist/index.js +23 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +4 -4
  16. package/dist/{langserve-cc06e76e.d.ts → langserve-f021ab9c.d.ts} +2 -1
  17. package/dist/lib/index.d.ts +4 -4
  18. package/dist/lib/index.js +23 -3
  19. package/dist/lib/index.js.map +1 -1
  20. package/dist/lib/index.mjs +4 -4
  21. package/dist/lib/integrations/index.d.ts +4 -4
  22. package/dist/lib/integrations/index.js +19 -2
  23. package/dist/lib/integrations/index.js.map +1 -1
  24. package/dist/lib/integrations/index.mjs +4 -4
  25. package/dist/lib/integrations/nest/index.d.ts +3 -3
  26. package/dist/lib/integrations/nest/index.js +19 -2
  27. package/dist/lib/integrations/nest/index.js.map +1 -1
  28. package/dist/lib/integrations/nest/index.mjs +2 -2
  29. package/dist/lib/integrations/node-express/index.d.ts +3 -3
  30. package/dist/lib/integrations/node-express/index.js +19 -2
  31. package/dist/lib/integrations/node-express/index.js.map +1 -1
  32. package/dist/lib/integrations/node-express/index.mjs +2 -2
  33. package/dist/lib/integrations/node-http/index.d.ts +3 -3
  34. package/dist/lib/integrations/node-http/index.js +19 -2
  35. package/dist/lib/integrations/node-http/index.js.map +1 -1
  36. package/dist/lib/integrations/node-http/index.mjs +1 -1
  37. package/dist/service-adapters/index.d.ts +4 -4
  38. package/package.json +4 -4
  39. package/src/graphql/inputs/action.input.ts +4 -1
  40. package/src/graphql/resolvers/copilot.resolver.ts +4 -2
  41. package/src/graphql/types/enums.ts +11 -0
  42. package/src/lib/runtime/copilot-runtime.ts +5 -1
  43. package/dist/chunk-2QIJQ6YS.mjs.map +0 -1
  44. /package/dist/{chunk-L3CCF3GA.mjs.map → chunk-TIWN7W7O.mjs.map} +0 -0
  45. /package/dist/{chunk-UAHCJ2F4.mjs.map → chunk-WCQG2CHA.mjs.map} +0 -0
  46. /package/dist/{chunk-6WTF7IML.mjs.map → chunk-WWJRLGPB.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-UAHCJ2F4.mjs";
6
+ } from "./chunk-WCQG2CHA.mjs";
7
7
  import {
8
8
  copilotRuntimeNestEndpoint
9
- } from "./chunk-L3CCF3GA.mjs";
9
+ } from "./chunk-TIWN7W7O.mjs";
10
10
  import {
11
11
  copilotRuntimeNodeExpressEndpoint
12
- } from "./chunk-6WTF7IML.mjs";
12
+ } from "./chunk-WWJRLGPB.mjs";
13
13
  import {
14
14
  CopilotRuntime,
15
15
  buildSchema,
@@ -20,7 +20,7 @@ import {
20
20
  getCommonConfig,
21
21
  langGraphPlatformEndpoint,
22
22
  resolveEndpointType
23
- } from "./chunk-2QIJQ6YS.mjs";
23
+ } from "./chunk-SFC4IZY3.mjs";
24
24
  import {
25
25
  AnthropicAdapter,
26
26
  GoogleGenerativeAIAdapter,
@@ -1,4 +1,4 @@
1
- import { a as Message } from './index-83ee522f.js';
1
+ import { A as ActionInputAvailability, a as Message } from './index-10b1c870.js';
2
2
  import * as rxjs from 'rxjs';
3
3
  import { Subject, ReplaySubject } from 'rxjs';
4
4
  import { Action, Parameter } from '@copilotkit/shared';
@@ -16,6 +16,7 @@ declare class ActionInput {
16
16
  name: string;
17
17
  description: string;
18
18
  jsonSchema: string;
19
+ available?: ActionInputAvailability;
19
20
  }
20
21
 
21
22
  declare enum RuntimeEventTypes {
@@ -1,12 +1,12 @@
1
- export { h as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, d as CreateCopilotRuntimeServerOptions, G as GraphQLContext, g as buildSchema, c as copilotKitEndpoint, e as createContext, f as flattenToolCallsNoDuplicates, i as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-335a610d.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 '../groq-adapter-b6c2b7ec.js';
1
+ export { h as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, d as CreateCopilotRuntimeServerOptions, G as GraphQLContext, g as buildSchema, c as copilotKitEndpoint, e as createContext, f as flattenToolCallsNoDuplicates, i as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-12e7ac40.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 '../groq-adapter-24abe931.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
7
  import '@copilotkit/shared';
8
- import '../langserve-cc06e76e.js';
9
- import '../index-83ee522f.js';
8
+ import '../langserve-f021ab9c.js';
9
+ import '../index-10b1c870.js';
10
10
  import '../graphql/types/base/index.js';
11
11
  import 'rxjs';
12
12
  import 'graphql';
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.4.1-pre.2",
47
+ version: "1.4.1-pre.6",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -1313,6 +1313,12 @@ var CopilotRequestType;
1313
1313
  CopilotRequestType2["TextareaPopover"] = "TextareaPopover";
1314
1314
  CopilotRequestType2["Suggestion"] = "Suggestion";
1315
1315
  })(CopilotRequestType || (CopilotRequestType = {}));
1316
+ var ActionInputAvailability;
1317
+ (function(ActionInputAvailability2) {
1318
+ ActionInputAvailability2["disabled"] = "disabled";
1319
+ ActionInputAvailability2["enabled"] = "enabled";
1320
+ ActionInputAvailability2["remote"] = "remote";
1321
+ })(ActionInputAvailability || (ActionInputAvailability = {}));
1316
1322
  (0, import_type_graphql.registerEnumType)(MessageRole, {
1317
1323
  name: "MessageRole",
1318
1324
  description: "The role of the message"
@@ -1325,6 +1331,10 @@ var CopilotRequestType;
1325
1331
  name: "CopilotRequestType",
1326
1332
  description: "The type of Copilot request"
1327
1333
  });
1334
+ (0, import_type_graphql.registerEnumType)(ActionInputAvailability, {
1335
+ name: "ActionInputAvailability",
1336
+ description: "The availability of the frontend action"
1337
+ });
1328
1338
 
1329
1339
  // src/lib/runtime/remote-lg-action.ts
1330
1340
  async function execute(args) {
@@ -2502,7 +2512,10 @@ var CopilotRuntime = class {
2502
2512
  }));
2503
2513
  const actionInputs = flattenToolCallsNoDuplicates([
2504
2514
  ...serverSideActionsInput,
2505
- ...clientSideActionsInput
2515
+ ...clientSideActionsInput.filter(
2516
+ // Filter remote actions from CopilotKit core loop
2517
+ (action) => action.available !== ActionInputAvailability.remote
2518
+ )
2506
2519
  ]);
2507
2520
  await ((_a = this.onBeforeRequest) == null ? void 0 : _a.call(this, {
2508
2521
  threadId,
@@ -2881,6 +2894,7 @@ var ActionInput = class {
2881
2894
  name;
2882
2895
  description;
2883
2896
  jsonSchema;
2897
+ available;
2884
2898
  };
2885
2899
  __name(ActionInput, "ActionInput");
2886
2900
  _ts_decorate3([
@@ -2895,6 +2909,12 @@ _ts_decorate3([
2895
2909
  (0, import_type_graphql4.Field)(() => String),
2896
2910
  _ts_metadata3("design:type", String)
2897
2911
  ], ActionInput.prototype, "jsonSchema", void 0);
2912
+ _ts_decorate3([
2913
+ (0, import_type_graphql4.Field)(() => ActionInputAvailability, {
2914
+ nullable: true
2915
+ }),
2916
+ _ts_metadata3("design:type", typeof ActionInputAvailability === "undefined" ? Object : ActionInputAvailability)
2917
+ ], ActionInput.prototype, "available", void 0);
2898
2918
  ActionInput = _ts_decorate3([
2899
2919
  (0, import_type_graphql4.InputType)()
2900
2920
  ], ActionInput);
@@ -3821,7 +3841,7 @@ var CopilotResolver = class {
3821
3841
  const { eventSource, threadId = (0, import_shared10.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
3822
3842
  serviceAdapter,
3823
3843
  messages: data.messages,
3824
- actions: data.frontend.actions,
3844
+ actions: data.frontend.actions.filter((action) => action.available !== ActionInputAvailability.disabled),
3825
3845
  threadId: data.threadId,
3826
3846
  runId: data.runId,
3827
3847
  publicApiKey: void 0,