@copilotkit/runtime 1.4.1-pre.5 → 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 (36) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{chunk-ZOC3UIQP.mjs → chunk-OKQVDDJ2.mjs} +2 -30
  3. package/dist/chunk-OKQVDDJ2.mjs.map +1 -0
  4. package/dist/{chunk-QM5B7BZG.mjs → chunk-SFC4IZY3.mjs} +3 -3
  5. package/dist/{chunk-QM5B7BZG.mjs.map → chunk-SFC4IZY3.mjs.map} +1 -1
  6. package/dist/{chunk-IEBJELNR.mjs → chunk-TIWN7W7O.mjs} +2 -2
  7. package/dist/{chunk-KYP35WVS.mjs → chunk-WCQG2CHA.mjs} +2 -2
  8. package/dist/{chunk-WNQJ5JZV.mjs → chunk-WWJRLGPB.mjs} +2 -2
  9. package/dist/index.js +2 -30
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +5 -5
  12. package/dist/lib/index.js +2 -30
  13. package/dist/lib/index.js.map +1 -1
  14. package/dist/lib/index.mjs +5 -5
  15. package/dist/lib/integrations/index.js +1 -1
  16. package/dist/lib/integrations/index.js.map +1 -1
  17. package/dist/lib/integrations/index.mjs +5 -5
  18. package/dist/lib/integrations/nest/index.js +1 -1
  19. package/dist/lib/integrations/nest/index.js.map +1 -1
  20. package/dist/lib/integrations/nest/index.mjs +3 -3
  21. package/dist/lib/integrations/node-express/index.js +1 -1
  22. package/dist/lib/integrations/node-express/index.js.map +1 -1
  23. package/dist/lib/integrations/node-express/index.mjs +3 -3
  24. package/dist/lib/integrations/node-http/index.js +1 -1
  25. package/dist/lib/integrations/node-http/index.js.map +1 -1
  26. package/dist/lib/integrations/node-http/index.mjs +2 -2
  27. package/dist/service-adapters/index.js +1 -29
  28. package/dist/service-adapters/index.js.map +1 -1
  29. package/dist/service-adapters/index.mjs +1 -1
  30. package/package.json +4 -4
  31. package/src/service-adapters/langchain/utils.ts +1 -33
  32. package/dist/chunk-ZOC3UIQP.mjs.map +0 -1
  33. package/src/service-adapters/langchain/utils.test.ts +0 -169
  34. /package/dist/{chunk-IEBJELNR.mjs.map → chunk-TIWN7W7O.mjs.map} +0 -0
  35. /package/dist/{chunk-KYP35WVS.mjs.map → chunk-WCQG2CHA.mjs.map} +0 -0
  36. /package/dist/{chunk-WNQJ5JZV.mjs.map → chunk-WWJRLGPB.mjs.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-QM5B7BZG.mjs";
5
+ } from "./chunk-SFC4IZY3.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-44O2JGUY.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
22
22
  export {
23
23
  copilotRuntimeNestEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-IEBJELNR.mjs.map
25
+ //# sourceMappingURL=chunk-TIWN7W7O.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  getCommonConfig,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-QM5B7BZG.mjs";
5
+ } from "./chunk-SFC4IZY3.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-44O2JGUY.mjs";
@@ -77,4 +77,4 @@ export {
77
77
  config,
78
78
  copilotRuntimeNextJSPagesRouterEndpoint
79
79
  };
80
- //# sourceMappingURL=chunk-KYP35WVS.mjs.map
80
+ //# sourceMappingURL=chunk-WCQG2CHA.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-QM5B7BZG.mjs";
5
+ } from "./chunk-SFC4IZY3.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-44O2JGUY.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
22
22
  export {
23
23
  copilotRuntimeNodeExpressEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-WNQJ5JZV.mjs.map
25
+ //# sourceMappingURL=chunk-WWJRLGPB.mjs.map
package/dist/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.5",
47
+ version: "1.4.1-pre.6",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -475,7 +475,6 @@ __name(OpenAIAdapter, "OpenAIAdapter");
475
475
  // src/service-adapters/langchain/utils.ts
476
476
  var import_messages = require("@langchain/core/messages");
477
477
  var import_tools = require("@langchain/core/tools");
478
- var import_zod = require("zod");
479
478
  var import_shared2 = require("@copilotkit/shared");
480
479
  function convertMessageToLangChainMessage(message) {
481
480
  if (message.isTextMessage()) {
@@ -505,38 +504,11 @@ function convertMessageToLangChainMessage(message) {
505
504
  }
506
505
  }
507
506
  __name(convertMessageToLangChainMessage, "convertMessageToLangChainMessage");
508
- function convertJsonSchemaToZodSchema(jsonSchema, required) {
509
- if (jsonSchema.type === "object") {
510
- const spec = {};
511
- if (!jsonSchema.properties || !Object.keys(jsonSchema.properties).length) {
512
- return !required ? import_zod.z.object(spec).optional() : import_zod.z.object(spec);
513
- }
514
- for (const [key, value] of Object.entries(jsonSchema.properties)) {
515
- spec[key] = convertJsonSchemaToZodSchema(value, jsonSchema.required ? jsonSchema.required.includes(key) : false);
516
- }
517
- let schema = import_zod.z.object(spec).describe(jsonSchema.description);
518
- return required ? schema : schema.optional();
519
- } else if (jsonSchema.type === "string") {
520
- let schema = import_zod.z.string().describe(jsonSchema.description);
521
- return required ? schema : schema.optional();
522
- } else if (jsonSchema.type === "number") {
523
- let schema = import_zod.z.number().describe(jsonSchema.description);
524
- return required ? schema : schema.optional();
525
- } else if (jsonSchema.type === "boolean") {
526
- let schema = import_zod.z.boolean().describe(jsonSchema.description);
527
- return required ? schema : schema.optional();
528
- } else if (jsonSchema.type === "array") {
529
- let itemSchema = convertJsonSchemaToZodSchema(jsonSchema.items, true);
530
- let schema = import_zod.z.array(itemSchema).describe(jsonSchema.description);
531
- return required ? schema : schema.optional();
532
- }
533
- }
534
- __name(convertJsonSchemaToZodSchema, "convertJsonSchemaToZodSchema");
535
507
  function convertActionInputToLangChainTool(actionInput) {
536
508
  return new import_tools.DynamicStructuredTool({
537
509
  name: actionInput.name,
538
510
  description: actionInput.description,
539
- schema: convertJsonSchemaToZodSchema(JSON.parse(actionInput.jsonSchema), true),
511
+ schema: (0, import_shared2.convertJsonSchemaToZodSchema)(JSON.parse(actionInput.jsonSchema), true),
540
512
  func: async () => {
541
513
  return "";
542
514
  }