@copilotkit/runtime 1.3.14 → 1.3.15

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 (39) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{chunk-I5X63624.mjs → chunk-3RAQGSAI.mjs} +3 -3
  3. package/dist/{chunk-I5X63624.mjs.map → chunk-3RAQGSAI.mjs.map} +1 -1
  4. package/dist/{chunk-TOIJ5IIA.mjs → chunk-CUN5GXCO.mjs} +3 -3
  5. package/dist/{chunk-EN2GQDJF.mjs → chunk-FH4SPOAG.mjs} +2 -2
  6. package/dist/{chunk-CPAHDRLS.mjs → chunk-MXXPWWBF.mjs} +4 -8
  7. package/dist/chunk-MXXPWWBF.mjs.map +1 -0
  8. package/dist/{chunk-Y6RQG5HF.mjs → chunk-NMV7A7VP.mjs} +2 -2
  9. package/dist/{chunk-6TFW5P6C.mjs → chunk-R3IJK6GR.mjs} +2 -2
  10. package/dist/{chunk-HTQXEUKU.mjs → chunk-WYB2Z6SM.mjs} +2 -2
  11. package/dist/index.js +4 -8
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +7 -7
  14. package/dist/lib/index.js +4 -8
  15. package/dist/lib/index.js.map +1 -1
  16. package/dist/lib/index.mjs +7 -7
  17. package/dist/lib/integrations/index.js +1 -1
  18. package/dist/lib/integrations/index.js.map +1 -1
  19. package/dist/lib/integrations/index.mjs +5 -5
  20. package/dist/lib/integrations/nest/index.js +1 -1
  21. package/dist/lib/integrations/nest/index.js.map +1 -1
  22. package/dist/lib/integrations/nest/index.mjs +3 -3
  23. package/dist/lib/integrations/node-express/index.js +1 -1
  24. package/dist/lib/integrations/node-express/index.js.map +1 -1
  25. package/dist/lib/integrations/node-express/index.mjs +3 -3
  26. package/dist/lib/integrations/node-http/index.js +1 -1
  27. package/dist/lib/integrations/node-http/index.js.map +1 -1
  28. package/dist/lib/integrations/node-http/index.mjs +2 -2
  29. package/dist/service-adapters/index.js +3 -7
  30. package/dist/service-adapters/index.js.map +1 -1
  31. package/dist/service-adapters/index.mjs +2 -2
  32. package/package.json +4 -4
  33. package/src/service-adapters/langchain/utils.ts +3 -7
  34. package/dist/chunk-CPAHDRLS.mjs.map +0 -1
  35. /package/dist/{chunk-TOIJ5IIA.mjs.map → chunk-CUN5GXCO.mjs.map} +0 -0
  36. /package/dist/{chunk-EN2GQDJF.mjs.map → chunk-FH4SPOAG.mjs.map} +0 -0
  37. /package/dist/{chunk-Y6RQG5HF.mjs.map → chunk-NMV7A7VP.mjs.map} +0 -0
  38. /package/dist/{chunk-6TFW5P6C.mjs.map → chunk-R3IJK6GR.mjs.map} +0 -0
  39. /package/dist/{chunk-HTQXEUKU.mjs.map → chunk-WYB2Z6SM.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CopilotRuntime,
3
3
  flattenToolCallsNoDuplicates
4
- } from "./chunk-TOIJ5IIA.mjs";
4
+ } from "./chunk-CUN5GXCO.mjs";
5
5
  import {
6
6
  AnthropicAdapter,
7
7
  GoogleGenerativeAIAdapter,
@@ -11,25 +11,25 @@ import {
11
11
  OpenAIAssistantAdapter,
12
12
  RemoteChain,
13
13
  UnifyAdapter
14
- } from "./chunk-Y6RQG5HF.mjs";
14
+ } from "./chunk-NMV7A7VP.mjs";
15
15
  import {
16
16
  config,
17
17
  copilotRuntimeNextJSAppRouterEndpoint,
18
18
  copilotRuntimeNextJSPagesRouterEndpoint
19
- } from "./chunk-HTQXEUKU.mjs";
19
+ } from "./chunk-WYB2Z6SM.mjs";
20
20
  import {
21
21
  copilotRuntimeNestEndpoint
22
- } from "./chunk-EN2GQDJF.mjs";
22
+ } from "./chunk-FH4SPOAG.mjs";
23
23
  import {
24
24
  copilotRuntimeNodeExpressEndpoint
25
- } from "./chunk-6TFW5P6C.mjs";
25
+ } from "./chunk-R3IJK6GR.mjs";
26
26
  import {
27
27
  buildSchema,
28
28
  copilotRuntimeNodeHttpEndpoint,
29
29
  createContext,
30
30
  getCommonConfig
31
- } from "./chunk-I5X63624.mjs";
32
- import "./chunk-CPAHDRLS.mjs";
31
+ } from "./chunk-3RAQGSAI.mjs";
32
+ import "./chunk-MXXPWWBF.mjs";
33
33
  import {
34
34
  GuardrailsValidationFailureResponse,
35
35
  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.3.14",
47
+ version: "1.3.15",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -500,7 +500,7 @@ function convertJsonSchemaToZodSchema(jsonSchema, required) {
500
500
  for (const [key, value] of Object.entries(jsonSchema.properties)) {
501
501
  spec[key] = convertJsonSchemaToZodSchema(value, jsonSchema.required ? jsonSchema.required.includes(key) : false);
502
502
  }
503
- let schema = import_zod.z.object(spec);
503
+ let schema = import_zod.z.object(spec).describe(jsonSchema.description);
504
504
  return required ? schema : schema.optional();
505
505
  } else if (jsonSchema.type === "string") {
506
506
  let schema = import_zod.z.string().describe(jsonSchema.description);
@@ -513,7 +513,7 @@ function convertJsonSchemaToZodSchema(jsonSchema, required) {
513
513
  return required ? schema : schema.optional();
514
514
  } else if (jsonSchema.type === "array") {
515
515
  let itemSchema = convertJsonSchemaToZodSchema(jsonSchema.items, true);
516
- let schema = import_zod.z.array(itemSchema);
516
+ let schema = import_zod.z.array(itemSchema).describe(jsonSchema.description);
517
517
  return required ? schema : schema.optional();
518
518
  }
519
519
  }
@@ -589,8 +589,6 @@ async function streamLangChainResponse({ result, eventStream$, actionExecution }
589
589
  let toolCallName = void 0;
590
590
  let toolCallId = void 0;
591
591
  let toolCallArgs = void 0;
592
- let toolCallIndex = void 0;
593
- let toolCallPrevIndex = void 0;
594
592
  let hasToolCall = false;
595
593
  let content = value == null ? void 0 : value.content;
596
594
  if (isAIMessageChunk(value)) {
@@ -608,8 +606,6 @@ async function streamLangChainResponse({ result, eventStream$, actionExecution }
608
606
  toolCallDetails.id = chunk.index != null ? `${chunk.id}-idx-${chunk.index}` : chunk.id;
609
607
  toolCallName = toolCallDetails.name;
610
608
  toolCallId = toolCallDetails.id;
611
- toolCallIndex = toolCallDetails.index;
612
- toolCallPrevIndex = toolCallDetails.prevIndex;
613
609
  } else if (isBaseMessageChunk(value)) {
614
610
  let chunk = (_f = (_e = value.additional_kwargs) == null ? void 0 : _e.tool_calls) == null ? void 0 : _f[0];
615
611
  toolCallName = (_g = chunk == null ? void 0 : chunk.function) == null ? void 0 : _g.name;
@@ -639,7 +635,7 @@ async function streamLangChainResponse({ result, eventStream$, actionExecution }
639
635
  if (mode === "message" && content) {
640
636
  eventStream$.sendTextMessageContent(Array.isArray(content) ? ((_i = content[0]) == null ? void 0 : _i.text) ?? "" : content);
641
637
  } else if (mode === "function" && toolCallArgs) {
642
- if (toolCallIndex !== toolCallPrevIndex) {
638
+ if (toolCallDetails.index !== toolCallDetails.prevIndex) {
643
639
  eventStream$.sendActionExecutionEnd();
644
640
  eventStream$.sendActionExecutionStart(toolCallId, toolCallName);
645
641
  toolCallDetails.prevIndex = toolCallDetails.index;