@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
@@ -2,22 +2,22 @@ import {
2
2
  config,
3
3
  copilotRuntimeNextJSAppRouterEndpoint,
4
4
  copilotRuntimeNextJSPagesRouterEndpoint
5
- } from "../../chunk-XXYYCH4X.mjs";
5
+ } from "../../chunk-SFLMY3ES.mjs";
6
6
  import {
7
7
  copilotRuntimeNestEndpoint
8
- } from "../../chunk-4YJIXJLO.mjs";
8
+ } from "../../chunk-BETLEV37.mjs";
9
9
  import {
10
10
  copilotRuntimeNodeExpressEndpoint
11
- } from "../../chunk-7BOVBWKI.mjs";
11
+ } from "../../chunk-ZCU6UPCY.mjs";
12
12
  import {
13
13
  buildSchema,
14
14
  copilotRuntimeNodeHttpEndpoint,
15
15
  createContext,
16
16
  getCommonConfig
17
- } from "../../chunk-4QJA7OT2.mjs";
17
+ } from "../../chunk-FA5DJ2TZ.mjs";
18
18
  import "../../chunk-CLGKEUOA.mjs";
19
19
  import "../../chunk-U3V2BCGI.mjs";
20
- import "../../chunk-RFF5IIZJ.mjs";
20
+ import "../../chunk-HNUNXFTW.mjs";
21
21
  import "../../chunk-D2WLFQS6.mjs";
22
22
  import "../../chunk-44O2JGUY.mjs";
23
23
  export {
@@ -1,8 +1,8 @@
1
1
  import * as graphql_yoga from 'graphql-yoga';
2
- import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../../copilot-runtime-36700e00.js';
2
+ import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../../copilot-runtime-1a224a0f.js';
3
3
  import '@copilotkit/shared';
4
- import '../../../langserve-9125a12e.js';
5
- import '../../../index-cc2b17be.js';
4
+ import '../../../langserve-a16ef8f4.js';
5
+ import '../../../index-24315d90.js';
6
6
  import '../../../graphql/types/base/index.js';
7
7
  import 'rxjs';
8
8
  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",
@@ -1290,6 +1290,69 @@ var ResultMessage = class extends Message {
1290
1290
  actionExecutionId;
1291
1291
  actionName;
1292
1292
  result;
1293
+ static encodeResult(result, error) {
1294
+ const errorObj = error ? typeof error === "string" ? {
1295
+ code: "ERROR",
1296
+ message: error
1297
+ } : error instanceof Error ? {
1298
+ code: "ERROR",
1299
+ message: error.message
1300
+ } : error : void 0;
1301
+ if (errorObj) {
1302
+ return JSON.stringify({
1303
+ error: errorObj,
1304
+ result: result || ""
1305
+ });
1306
+ }
1307
+ if (result === void 0) {
1308
+ return "";
1309
+ }
1310
+ return typeof result === "string" ? result : JSON.stringify(result);
1311
+ }
1312
+ static decodeResult(result) {
1313
+ if (!result) {
1314
+ return {
1315
+ result: ""
1316
+ };
1317
+ }
1318
+ try {
1319
+ const parsed = JSON.parse(result);
1320
+ if (parsed && typeof parsed === "object") {
1321
+ if ("error" in parsed) {
1322
+ return {
1323
+ error: parsed.error,
1324
+ result: parsed.result || ""
1325
+ };
1326
+ }
1327
+ return {
1328
+ result: JSON.stringify(parsed)
1329
+ };
1330
+ }
1331
+ return {
1332
+ result
1333
+ };
1334
+ } catch (e) {
1335
+ return {
1336
+ result
1337
+ };
1338
+ }
1339
+ }
1340
+ hasError() {
1341
+ try {
1342
+ const { error } = ResultMessage.decodeResult(this.result);
1343
+ return !!error;
1344
+ } catch {
1345
+ return false;
1346
+ }
1347
+ }
1348
+ getError() {
1349
+ try {
1350
+ const { error } = ResultMessage.decodeResult(this.result);
1351
+ return error;
1352
+ } catch {
1353
+ return void 0;
1354
+ }
1355
+ }
1293
1356
  };
1294
1357
  __name(ResultMessage, "ResultMessage");
1295
1358
  var AgentStateMessage = class extends Message {