@copilotkit/runtime 1.4.8 → 1.5.0-coagents-v0-3.0

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 (73) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/__snapshots__/schema/schema.graphql +7 -9
  3. package/dist/{chunk-W7GP2EOT.mjs → chunk-4AYRDPWK.mjs} +239 -65
  4. package/dist/chunk-4AYRDPWK.mjs.map +1 -0
  5. package/dist/{chunk-LSLFIYKP.mjs → chunk-7BOO3OFP.mjs} +2 -2
  6. package/dist/{chunk-GGNRDS7N.mjs → chunk-GSTWFOZF.mjs} +2 -2
  7. package/dist/{chunk-TA5I5LYF.mjs → chunk-OMAAKIJQ.mjs} +2 -2
  8. package/dist/{chunk-R6AUAQK6.mjs → chunk-PXS4SBRF.mjs} +423 -299
  9. package/dist/chunk-PXS4SBRF.mjs.map +1 -0
  10. package/dist/{chunk-B74M7FXG.mjs → chunk-RFF5IIZJ.mjs} +3 -2
  11. package/dist/chunk-RFF5IIZJ.mjs.map +1 -0
  12. package/dist/{copilot-runtime-48d7c2fc.d.ts → copilot-runtime-2e46a7b6.d.ts} +2 -2
  13. package/dist/graphql/types/converted/index.d.ts +1 -1
  14. package/dist/graphql/types/converted/index.js +2 -1
  15. package/dist/graphql/types/converted/index.js.map +1 -1
  16. package/dist/graphql/types/converted/index.mjs +1 -1
  17. package/dist/{groq-adapter-ac43305a.d.ts → groq-adapter-7bf6824b.d.ts} +1 -1
  18. package/dist/{index-10b1c870.d.ts → index-ff3fbc33.d.ts} +7 -8
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.js +747 -448
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +6 -6
  23. package/dist/{langserve-b74e8606.d.ts → langserve-f318db89.d.ts} +51 -12
  24. package/dist/lib/index.d.ts +4 -4
  25. package/dist/lib/index.js +714 -439
  26. package/dist/lib/index.js.map +1 -1
  27. package/dist/lib/index.mjs +6 -6
  28. package/dist/lib/integrations/index.d.ts +4 -4
  29. package/dist/lib/integrations/index.js +71 -30
  30. package/dist/lib/integrations/index.js.map +1 -1
  31. package/dist/lib/integrations/index.mjs +6 -6
  32. package/dist/lib/integrations/nest/index.d.ts +3 -3
  33. package/dist/lib/integrations/nest/index.js +71 -30
  34. package/dist/lib/integrations/nest/index.js.map +1 -1
  35. package/dist/lib/integrations/nest/index.mjs +4 -4
  36. package/dist/lib/integrations/node-express/index.d.ts +3 -3
  37. package/dist/lib/integrations/node-express/index.js +71 -30
  38. package/dist/lib/integrations/node-express/index.js.map +1 -1
  39. package/dist/lib/integrations/node-express/index.mjs +4 -4
  40. package/dist/lib/integrations/node-http/index.d.ts +3 -3
  41. package/dist/lib/integrations/node-http/index.js +71 -30
  42. package/dist/lib/integrations/node-http/index.js.map +1 -1
  43. package/dist/lib/integrations/node-http/index.mjs +3 -3
  44. package/dist/service-adapters/index.d.ts +4 -4
  45. package/dist/service-adapters/index.js +238 -64
  46. package/dist/service-adapters/index.js.map +1 -1
  47. package/dist/service-adapters/index.mjs +1 -1
  48. package/package.json +2 -2
  49. package/src/agents/langgraph/event-source.ts +140 -148
  50. package/src/agents/langgraph/events.ts +1 -1
  51. package/src/graphql/inputs/message.input.ts +15 -3
  52. package/src/graphql/resolvers/copilot.resolver.ts +32 -6
  53. package/src/graphql/types/converted/index.ts +4 -3
  54. package/src/graphql/types/copilot-response.type.ts +12 -3
  55. package/src/graphql/types/enums.ts +0 -11
  56. package/src/lib/runtime/remote-action-constructors.ts +4 -2
  57. package/src/lib/runtime/remote-actions.ts +1 -0
  58. package/src/lib/runtime/remote-lg-action.ts +159 -140
  59. package/src/service-adapters/anthropic/anthropic-adapter.ts +16 -6
  60. package/src/service-adapters/conversion.ts +2 -1
  61. package/src/service-adapters/events.ts +116 -52
  62. package/src/service-adapters/experimental/ollama/ollama-adapter.ts +7 -3
  63. package/src/service-adapters/groq/groq-adapter.ts +23 -8
  64. package/src/service-adapters/langchain/utils.ts +55 -32
  65. package/src/service-adapters/openai/openai-adapter.ts +22 -9
  66. package/src/service-adapters/openai/openai-assistant-adapter.ts +22 -8
  67. package/src/service-adapters/unify/unify-adapter.ts +28 -11
  68. package/dist/chunk-B74M7FXG.mjs.map +0 -1
  69. package/dist/chunk-R6AUAQK6.mjs.map +0 -1
  70. package/dist/chunk-W7GP2EOT.mjs.map +0 -1
  71. /package/dist/{chunk-LSLFIYKP.mjs.map → chunk-7BOO3OFP.mjs.map} +0 -0
  72. /package/dist/{chunk-GGNRDS7N.mjs.map → chunk-GSTWFOZF.mjs.map} +0 -0
  73. /package/dist/{chunk-TA5I5LYF.mjs.map → chunk-OMAAKIJQ.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-GGNRDS7N.mjs";
6
+ } from "./chunk-GSTWFOZF.mjs";
7
7
  import {
8
8
  copilotRuntimeNestEndpoint
9
- } from "./chunk-TA5I5LYF.mjs";
9
+ } from "./chunk-OMAAKIJQ.mjs";
10
10
  import {
11
11
  copilotRuntimeNodeExpressEndpoint
12
- } from "./chunk-LSLFIYKP.mjs";
12
+ } from "./chunk-7BOO3OFP.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-R6AUAQK6.mjs";
23
+ } from "./chunk-PXS4SBRF.mjs";
24
24
  import {
25
25
  AnthropicAdapter,
26
26
  ExperimentalEmptyAdapter,
@@ -32,13 +32,13 @@ import {
32
32
  OpenAIAssistantAdapter,
33
33
  RemoteChain,
34
34
  UnifyAdapter
35
- } from "./chunk-W7GP2EOT.mjs";
35
+ } from "./chunk-4AYRDPWK.mjs";
36
36
  import {
37
37
  GuardrailsValidationFailureResponse,
38
38
  MessageStreamInterruptedResponse,
39
39
  UnknownErrorResponse
40
40
  } from "./chunk-U3V2BCGI.mjs";
41
- import "./chunk-B74M7FXG.mjs";
41
+ import "./chunk-RFF5IIZJ.mjs";
42
42
  import "./chunk-D2WLFQS6.mjs";
43
43
  import "./chunk-44O2JGUY.mjs";
44
44
 
@@ -1,4 +1,4 @@
1
- import { A as ActionInputAvailability, a as Message } from './index-10b1c870.js';
1
+ import { A as ActionInputAvailability, a as Message } from './index-ff3fbc33.js';
2
2
  import * as rxjs from 'rxjs';
3
3
  import { Subject, ReplaySubject } from 'rxjs';
4
4
  import { Action, Parameter } from '@copilotkit/shared';
@@ -29,25 +29,29 @@ declare enum RuntimeEventTypes {
29
29
  ActionExecutionResult = "ActionExecutionResult",
30
30
  AgentStateMessage = "AgentStateMessage"
31
31
  }
32
- type FunctionCallScope = "client" | "server" | "passThrough";
33
32
  type RuntimeEvent = {
34
33
  type: RuntimeEventTypes.TextMessageStart;
35
34
  messageId: string;
35
+ parentMessageId?: string;
36
36
  } | {
37
37
  type: RuntimeEventTypes.TextMessageContent;
38
+ messageId: string;
38
39
  content: string;
39
40
  } | {
40
41
  type: RuntimeEventTypes.TextMessageEnd;
42
+ messageId: string;
41
43
  } | {
42
44
  type: RuntimeEventTypes.ActionExecutionStart;
43
45
  actionExecutionId: string;
44
46
  actionName: string;
45
- scope?: FunctionCallScope;
47
+ parentMessageId?: string;
46
48
  } | {
47
49
  type: RuntimeEventTypes.ActionExecutionArgs;
50
+ actionExecutionId: string;
48
51
  args: string;
49
52
  } | {
50
53
  type: RuntimeEventTypes.ActionExecutionEnd;
54
+ actionExecutionId: string;
51
55
  } | {
52
56
  type: RuntimeEventTypes.ActionExecutionResult;
53
57
  actionName: string;
@@ -67,16 +71,51 @@ type RuntimeEvent = {
67
71
  type EventSourceCallback = (eventStream$: RuntimeEventSubject) => Promise<void>;
68
72
  declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
69
73
  constructor();
70
- sendTextMessageStart(messageId: string): void;
71
- sendTextMessageContent(content: string): void;
72
- sendTextMessageEnd(): void;
74
+ sendTextMessageStart({ messageId, parentMessageId, }: {
75
+ messageId: string;
76
+ parentMessageId?: string;
77
+ }): void;
78
+ sendTextMessageContent({ messageId, content }: {
79
+ messageId: string;
80
+ content: string;
81
+ }): void;
82
+ sendTextMessageEnd({ messageId }: {
83
+ messageId: string;
84
+ }): void;
73
85
  sendTextMessage(messageId: string, content: string): void;
74
- sendActionExecutionStart(actionExecutionId: string, actionName: string): void;
75
- sendActionExecutionArgs(args: string): void;
76
- sendActionExecutionEnd(): void;
77
- sendActionExecution(actionExecutionId: string, toolName: string, args: string): void;
78
- sendActionExecutionResult(actionExecutionId: string, actionName: string, result: string): void;
79
- sendAgentStateMessage(threadId: string, agentName: string, nodeName: string, runId: string, active: boolean, role: string, state: string, running: boolean): void;
86
+ sendActionExecutionStart({ actionExecutionId, actionName, parentMessageId, }: {
87
+ actionExecutionId: string;
88
+ actionName: string;
89
+ parentMessageId?: string;
90
+ }): void;
91
+ sendActionExecutionArgs({ actionExecutionId, args, }: {
92
+ actionExecutionId: string;
93
+ args: string;
94
+ }): void;
95
+ sendActionExecutionEnd({ actionExecutionId }: {
96
+ actionExecutionId: string;
97
+ }): void;
98
+ sendActionExecution({ actionExecutionId, actionName, args, parentMessageId, }: {
99
+ actionExecutionId: string;
100
+ actionName: string;
101
+ args: string;
102
+ parentMessageId?: string;
103
+ }): void;
104
+ sendActionExecutionResult({ actionExecutionId, actionName, result, }: {
105
+ actionExecutionId: string;
106
+ actionName: string;
107
+ result: string;
108
+ }): void;
109
+ sendAgentStateMessage({ threadId, agentName, nodeName, runId, active, role, state, running, }: {
110
+ threadId: string;
111
+ agentName: string;
112
+ nodeName: string;
113
+ runId: string;
114
+ active: boolean;
115
+ role: string;
116
+ state: string;
117
+ running: boolean;
118
+ }): void;
80
119
  }
81
120
  declare class RuntimeEventSource {
82
121
  private eventStream$;
@@ -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-48d7c2fc.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-ac43305a.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-2e46a7b6.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-7bf6824b.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-b74e8606.js';
9
- import '../index-10b1c870.js';
8
+ import '../langserve-f318db89.js';
9
+ import '../index-ff3fbc33.js';
10
10
  import '../graphql/types/base/index.js';
11
11
  import 'rxjs';
12
12
  import 'graphql';