@copilotkit/runtime 1.5.12-next.0 → 1.5.12-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.
Files changed (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{chunk-4YJIXJLO.mjs → chunk-BETLEV37.mjs} +2 -2
  3. package/dist/{chunk-4QJA7OT2.mjs → chunk-FA5DJ2TZ.mjs} +61 -19
  4. package/dist/chunk-FA5DJ2TZ.mjs.map +1 -0
  5. package/dist/chunk-HNUNXFTW.mjs +129 -0
  6. package/dist/chunk-HNUNXFTW.mjs.map +1 -0
  7. package/dist/{chunk-XXYYCH4X.mjs → chunk-SFLMY3ES.mjs} +2 -2
  8. package/dist/{chunk-7BOVBWKI.mjs → chunk-ZCU6UPCY.mjs} +2 -2
  9. package/dist/{copilot-runtime-36700e00.d.ts → copilot-runtime-1a224a0f.d.ts} +2 -2
  10. package/dist/graphql/types/converted/index.d.ts +1 -1
  11. package/dist/graphql/types/converted/index.js +63 -0
  12. package/dist/graphql/types/converted/index.js.map +1 -1
  13. package/dist/graphql/types/converted/index.mjs +1 -1
  14. package/dist/{groq-adapter-696b5d29.d.ts → groq-adapter-c35c5374.d.ts} +1 -1
  15. package/dist/{index-cc2b17be.d.ts → index-24315d90.d.ts} +16 -0
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +121 -16
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +5 -5
  20. package/dist/{langserve-9125a12e.d.ts → langserve-a16ef8f4.d.ts} +7 -3
  21. package/dist/lib/index.d.ts +4 -4
  22. package/dist/lib/index.js +121 -16
  23. package/dist/lib/index.js.map +1 -1
  24. package/dist/lib/index.mjs +5 -5
  25. package/dist/lib/integrations/index.d.ts +4 -4
  26. package/dist/lib/integrations/index.js +64 -1
  27. package/dist/lib/integrations/index.js.map +1 -1
  28. package/dist/lib/integrations/index.mjs +5 -5
  29. package/dist/lib/integrations/nest/index.d.ts +3 -3
  30. package/dist/lib/integrations/nest/index.js +64 -1
  31. package/dist/lib/integrations/nest/index.js.map +1 -1
  32. package/dist/lib/integrations/nest/index.mjs +3 -3
  33. package/dist/lib/integrations/node-express/index.d.ts +3 -3
  34. package/dist/lib/integrations/node-express/index.js +64 -1
  35. package/dist/lib/integrations/node-express/index.js.map +1 -1
  36. package/dist/lib/integrations/node-express/index.mjs +3 -3
  37. package/dist/lib/integrations/node-http/index.d.ts +3 -3
  38. package/dist/lib/integrations/node-http/index.js +64 -1
  39. package/dist/lib/integrations/node-http/index.js.map +1 -1
  40. package/dist/lib/integrations/node-http/index.mjs +2 -2
  41. package/dist/service-adapters/index.d.ts +4 -4
  42. package/package.json +2 -2
  43. package/src/graphql/types/converted/index.ts +66 -0
  44. package/src/lib/runtime/copilot-runtime.ts +5 -1
  45. package/src/service-adapters/events.ts +58 -16
  46. package/dist/chunk-4QJA7OT2.mjs.map +0 -1
  47. package/dist/chunk-RFF5IIZJ.mjs +0 -66
  48. package/dist/chunk-RFF5IIZJ.mjs.map +0 -1
  49. /package/dist/{chunk-4YJIXJLO.mjs.map → chunk-BETLEV37.mjs.map} +0 -0
  50. /package/dist/{chunk-XXYYCH4X.mjs.map → chunk-SFLMY3ES.mjs.map} +0 -0
  51. /package/dist/{chunk-7BOVBWKI.mjs.map → chunk-ZCU6UPCY.mjs.map} +0 -0
@@ -3,13 +3,13 @@ import {
3
3
  config,
4
4
  copilotRuntimeNextJSAppRouterEndpoint,
5
5
  copilotRuntimeNextJSPagesRouterEndpoint
6
- } from "../chunk-XXYYCH4X.mjs";
6
+ } from "../chunk-SFLMY3ES.mjs";
7
7
  import {
8
8
  copilotRuntimeNestEndpoint
9
- } from "../chunk-4YJIXJLO.mjs";
9
+ } from "../chunk-BETLEV37.mjs";
10
10
  import {
11
11
  copilotRuntimeNodeExpressEndpoint
12
- } from "../chunk-7BOVBWKI.mjs";
12
+ } from "../chunk-ZCU6UPCY.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-4QJA7OT2.mjs";
23
+ } from "../chunk-FA5DJ2TZ.mjs";
24
24
  import {
25
25
  GoogleGenerativeAIAdapter,
26
26
  GroqAdapter,
@@ -30,7 +30,7 @@ import {
30
30
  UnifyAdapter
31
31
  } from "../chunk-CLGKEUOA.mjs";
32
32
  import "../chunk-U3V2BCGI.mjs";
33
- import "../chunk-RFF5IIZJ.mjs";
33
+ import "../chunk-HNUNXFTW.mjs";
34
34
  import "../chunk-D2WLFQS6.mjs";
35
35
  import "../chunk-44O2JGUY.mjs";
36
36
  export {
@@ -1,13 +1,13 @@
1
- import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-36700e00.js';
2
- export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-36700e00.js';
1
+ import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-1a224a0f.js';
2
+ export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-1a224a0f.js';
3
3
  import * as graphql_yoga from 'graphql-yoga';
4
4
  import { YogaServerInstance } from 'graphql-yoga';
5
5
  export { copilotRuntimeNodeHttpEndpoint } from './node-http/index.js';
6
6
  export { copilotRuntimeNodeExpressEndpoint } from './node-express/index.js';
7
7
  export { copilotRuntimeNestEndpoint } from './nest/index.js';
8
8
  import '@copilotkit/shared';
9
- import '../../langserve-9125a12e.js';
10
- import '../../index-cc2b17be.js';
9
+ import '../../langserve-a16ef8f4.js';
10
+ import '../../index-24315d90.js';
11
11
  import '../../graphql/types/base/index.js';
12
12
  import 'rxjs';
13
13
  import 'graphql';
@@ -44,7 +44,7 @@ var require_package = __commonJS({
44
44
  publishConfig: {
45
45
  access: "public"
46
46
  },
47
- version: "1.5.12-next.0",
47
+ version: "1.5.12-next.2",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -1295,6 +1295,69 @@ var ResultMessage = class extends Message {
1295
1295
  actionExecutionId;
1296
1296
  actionName;
1297
1297
  result;
1298
+ static encodeResult(result, error) {
1299
+ const errorObj = error ? typeof error === "string" ? {
1300
+ code: "ERROR",
1301
+ message: error
1302
+ } : error instanceof Error ? {
1303
+ code: "ERROR",
1304
+ message: error.message
1305
+ } : error : void 0;
1306
+ if (errorObj) {
1307
+ return JSON.stringify({
1308
+ error: errorObj,
1309
+ result: result || ""
1310
+ });
1311
+ }
1312
+ if (result === void 0) {
1313
+ return "";
1314
+ }
1315
+ return typeof result === "string" ? result : JSON.stringify(result);
1316
+ }
1317
+ static decodeResult(result) {
1318
+ if (!result) {
1319
+ return {
1320
+ result: ""
1321
+ };
1322
+ }
1323
+ try {
1324
+ const parsed = JSON.parse(result);
1325
+ if (parsed && typeof parsed === "object") {
1326
+ if ("error" in parsed) {
1327
+ return {
1328
+ error: parsed.error,
1329
+ result: parsed.result || ""
1330
+ };
1331
+ }
1332
+ return {
1333
+ result: JSON.stringify(parsed)
1334
+ };
1335
+ }
1336
+ return {
1337
+ result
1338
+ };
1339
+ } catch (e) {
1340
+ return {
1341
+ result
1342
+ };
1343
+ }
1344
+ }
1345
+ hasError() {
1346
+ try {
1347
+ const { error } = ResultMessage.decodeResult(this.result);
1348
+ return !!error;
1349
+ } catch {
1350
+ return false;
1351
+ }
1352
+ }
1353
+ getError() {
1354
+ try {
1355
+ const { error } = ResultMessage.decodeResult(this.result);
1356
+ return error;
1357
+ } catch {
1358
+ return void 0;
1359
+ }
1360
+ }
1298
1361
  };
1299
1362
  __name(ResultMessage, "ResultMessage");
1300
1363
  var AgentStateMessage = class extends Message {