@copilotkit/runtime 1.4.1-pre.0 → 1.4.1-pre.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 (36) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{chunk-2ARHEWUA.mjs → chunk-2QIJQ6YS.mjs} +3 -3
  3. package/dist/{chunk-2ARHEWUA.mjs.map → chunk-2QIJQ6YS.mjs.map} +1 -1
  4. package/dist/{chunk-PMDCB4Y7.mjs → chunk-6WTF7IML.mjs} +2 -2
  5. package/dist/{chunk-JGBY4ZFE.mjs → chunk-L3CCF3GA.mjs} +2 -2
  6. package/dist/{chunk-ZOC3UIQP.mjs → chunk-OKQVDDJ2.mjs} +2 -30
  7. package/dist/chunk-OKQVDDJ2.mjs.map +1 -0
  8. package/dist/{chunk-KYDFK2B6.mjs → chunk-UAHCJ2F4.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-PMDCB4Y7.mjs.map → chunk-6WTF7IML.mjs.map} +0 -0
  35. /package/dist/{chunk-JGBY4ZFE.mjs.map → chunk-L3CCF3GA.mjs.map} +0 -0
  36. /package/dist/{chunk-KYDFK2B6.mjs.map → chunk-UAHCJ2F4.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-KYDFK2B6.mjs";
6
+ } from "./chunk-UAHCJ2F4.mjs";
7
7
  import {
8
8
  copilotRuntimeNestEndpoint
9
- } from "./chunk-JGBY4ZFE.mjs";
9
+ } from "./chunk-L3CCF3GA.mjs";
10
10
  import {
11
11
  copilotRuntimeNodeExpressEndpoint
12
- } from "./chunk-PMDCB4Y7.mjs";
12
+ } from "./chunk-6WTF7IML.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-2ARHEWUA.mjs";
23
+ } from "./chunk-2QIJQ6YS.mjs";
24
24
  import {
25
25
  AnthropicAdapter,
26
26
  GoogleGenerativeAIAdapter,
@@ -30,7 +30,7 @@ import {
30
30
  OpenAIAssistantAdapter,
31
31
  RemoteChain,
32
32
  UnifyAdapter
33
- } from "./chunk-ZOC3UIQP.mjs";
33
+ } from "./chunk-OKQVDDJ2.mjs";
34
34
  import {
35
35
  GuardrailsValidationFailureResponse,
36
36
  MessageStreamInterruptedResponse,
package/dist/lib/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.0",
47
+ version: "1.4.1-pre.2",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -469,7 +469,6 @@ __name(OpenAIAdapter, "OpenAIAdapter");
469
469
  // src/service-adapters/langchain/utils.ts
470
470
  var import_messages = require("@langchain/core/messages");
471
471
  var import_tools = require("@langchain/core/tools");
472
- var import_zod = require("zod");
473
472
  var import_shared2 = require("@copilotkit/shared");
474
473
  function convertMessageToLangChainMessage(message) {
475
474
  if (message.isTextMessage()) {
@@ -499,38 +498,11 @@ function convertMessageToLangChainMessage(message) {
499
498
  }
500
499
  }
501
500
  __name(convertMessageToLangChainMessage, "convertMessageToLangChainMessage");
502
- function convertJsonSchemaToZodSchema(jsonSchema, required) {
503
- if (jsonSchema.type === "object") {
504
- const spec = {};
505
- if (!jsonSchema.properties || !Object.keys(jsonSchema.properties).length) {
506
- return !required ? import_zod.z.object(spec).optional() : import_zod.z.object(spec);
507
- }
508
- for (const [key, value] of Object.entries(jsonSchema.properties)) {
509
- spec[key] = convertJsonSchemaToZodSchema(value, jsonSchema.required ? jsonSchema.required.includes(key) : false);
510
- }
511
- let schema = import_zod.z.object(spec).describe(jsonSchema.description);
512
- return required ? schema : schema.optional();
513
- } else if (jsonSchema.type === "string") {
514
- let schema = import_zod.z.string().describe(jsonSchema.description);
515
- return required ? schema : schema.optional();
516
- } else if (jsonSchema.type === "number") {
517
- let schema = import_zod.z.number().describe(jsonSchema.description);
518
- return required ? schema : schema.optional();
519
- } else if (jsonSchema.type === "boolean") {
520
- let schema = import_zod.z.boolean().describe(jsonSchema.description);
521
- return required ? schema : schema.optional();
522
- } else if (jsonSchema.type === "array") {
523
- let itemSchema = convertJsonSchemaToZodSchema(jsonSchema.items, true);
524
- let schema = import_zod.z.array(itemSchema).describe(jsonSchema.description);
525
- return required ? schema : schema.optional();
526
- }
527
- }
528
- __name(convertJsonSchemaToZodSchema, "convertJsonSchemaToZodSchema");
529
501
  function convertActionInputToLangChainTool(actionInput) {
530
502
  return new import_tools.DynamicStructuredTool({
531
503
  name: actionInput.name,
532
504
  description: actionInput.description,
533
- schema: convertJsonSchemaToZodSchema(JSON.parse(actionInput.jsonSchema), true),
505
+ schema: (0, import_shared2.convertJsonSchemaToZodSchema)(JSON.parse(actionInput.jsonSchema), true),
534
506
  func: async () => {
535
507
  return "";
536
508
  }