@copilotkit/runtime 1.5.11 → 1.5.12-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 (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{chunk-A6VFRI4R.mjs → chunk-GOA7HNXW.mjs} +2 -2
  3. package/dist/chunk-HNUNXFTW.mjs +129 -0
  4. package/dist/chunk-HNUNXFTW.mjs.map +1 -0
  5. package/dist/{chunk-IJASJOA2.mjs → chunk-NTSKJEJQ.mjs} +2 -2
  6. package/dist/{chunk-QIJT75EM.mjs → chunk-P34QEPO5.mjs} +61 -19
  7. package/dist/chunk-P34QEPO5.mjs.map +1 -0
  8. package/dist/{chunk-OKJI7OJY.mjs → chunk-ZF34MJL7.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-QIJT75EM.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-A6VFRI4R.mjs.map → chunk-GOA7HNXW.mjs.map} +0 -0
  50. /package/dist/{chunk-IJASJOA2.mjs.map → chunk-NTSKJEJQ.mjs.map} +0 -0
  51. /package/dist/{chunk-OKJI7OJY.mjs.map → chunk-ZF34MJL7.mjs.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  copilotRuntimeNodeExpressEndpoint
3
- } from "../../../chunk-IJASJOA2.mjs";
4
- import "../../../chunk-QIJT75EM.mjs";
3
+ } from "../../../chunk-NTSKJEJQ.mjs";
4
+ import "../../../chunk-P34QEPO5.mjs";
5
5
  import "../../../chunk-CLGKEUOA.mjs";
6
6
  import "../../../chunk-U3V2BCGI.mjs";
7
- import "../../../chunk-RFF5IIZJ.mjs";
7
+ import "../../../chunk-HNUNXFTW.mjs";
8
8
  import "../../../chunk-D2WLFQS6.mjs";
9
9
  import "../../../chunk-44O2JGUY.mjs";
10
10
  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.11",
47
+ version: "1.5.12-next.1",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -1288,6 +1288,69 @@ var ResultMessage = class extends Message {
1288
1288
  actionExecutionId;
1289
1289
  actionName;
1290
1290
  result;
1291
+ static encodeResult(result, error) {
1292
+ const errorObj = error ? typeof error === "string" ? {
1293
+ code: "ERROR",
1294
+ message: error
1295
+ } : error instanceof Error ? {
1296
+ code: "ERROR",
1297
+ message: error.message
1298
+ } : error : void 0;
1299
+ if (errorObj) {
1300
+ return JSON.stringify({
1301
+ error: errorObj,
1302
+ result: result || ""
1303
+ });
1304
+ }
1305
+ if (result === void 0) {
1306
+ return "";
1307
+ }
1308
+ return typeof result === "string" ? result : JSON.stringify(result);
1309
+ }
1310
+ static decodeResult(result) {
1311
+ if (!result) {
1312
+ return {
1313
+ result: ""
1314
+ };
1315
+ }
1316
+ try {
1317
+ const parsed = JSON.parse(result);
1318
+ if (parsed && typeof parsed === "object") {
1319
+ if ("error" in parsed) {
1320
+ return {
1321
+ error: parsed.error,
1322
+ result: parsed.result || ""
1323
+ };
1324
+ }
1325
+ return {
1326
+ result: JSON.stringify(parsed)
1327
+ };
1328
+ }
1329
+ return {
1330
+ result
1331
+ };
1332
+ } catch (e) {
1333
+ return {
1334
+ result
1335
+ };
1336
+ }
1337
+ }
1338
+ hasError() {
1339
+ try {
1340
+ const { error } = ResultMessage.decodeResult(this.result);
1341
+ return !!error;
1342
+ } catch {
1343
+ return false;
1344
+ }
1345
+ }
1346
+ getError() {
1347
+ try {
1348
+ const { error } = ResultMessage.decodeResult(this.result);
1349
+ return error;
1350
+ } catch {
1351
+ return void 0;
1352
+ }
1353
+ }
1291
1354
  };
1292
1355
  __name(ResultMessage, "ResultMessage");
1293
1356
  var AgentStateMessage = class extends Message {