@copilotkit/runtime 1.9.0 → 1.9.1-next.0

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 (41) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/{chunk-M3JAEGRU.mjs → chunk-32OC2CBT.mjs} +2 -2
  3. package/dist/{chunk-GI32PQX6.mjs → chunk-5CY2MEHT.mjs} +3 -3
  4. package/dist/chunk-5CY2MEHT.mjs.map +1 -0
  5. package/dist/{chunk-U74GJORZ.mjs → chunk-MKAQQQ7D.mjs} +4 -4
  6. package/dist/chunk-MKAQQQ7D.mjs.map +1 -0
  7. package/dist/{chunk-FK4NZL4G.mjs → chunk-T3HIFVU2.mjs} +3 -3
  8. package/dist/chunk-T3HIFVU2.mjs.map +1 -0
  9. package/dist/{chunk-YCN5NOAP.mjs → chunk-YVZCIKZM.mjs} +26 -6
  10. package/dist/chunk-YVZCIKZM.mjs.map +1 -0
  11. package/dist/index.js +29 -9
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +5 -5
  14. package/dist/lib/index.js +29 -9
  15. package/dist/lib/index.js.map +1 -1
  16. package/dist/lib/index.mjs +5 -5
  17. package/dist/lib/integrations/index.js +29 -9
  18. package/dist/lib/integrations/index.js.map +1 -1
  19. package/dist/lib/integrations/index.mjs +4 -4
  20. package/dist/lib/integrations/nest/index.js +26 -6
  21. package/dist/lib/integrations/nest/index.js.map +1 -1
  22. package/dist/lib/integrations/nest/index.mjs +2 -2
  23. package/dist/lib/integrations/node-express/index.js +26 -6
  24. package/dist/lib/integrations/node-express/index.js.map +1 -1
  25. package/dist/lib/integrations/node-express/index.mjs +2 -2
  26. package/dist/lib/integrations/node-http/index.js +25 -5
  27. package/dist/lib/integrations/node-http/index.js.map +1 -1
  28. package/dist/lib/integrations/node-http/index.mjs +1 -1
  29. package/package.json +4 -4
  30. package/src/graphql/resolvers/copilot.resolver.ts +13 -0
  31. package/src/lib/integrations/nest/index.ts +1 -4
  32. package/src/lib/integrations/nextjs/app-router.ts +1 -4
  33. package/src/lib/integrations/nextjs/pages-router.ts +1 -4
  34. package/src/lib/integrations/node-express/index.ts +1 -4
  35. package/src/lib/integrations/node-http/index.ts +1 -4
  36. package/src/lib/telemetry-client.ts +11 -2
  37. package/dist/chunk-FK4NZL4G.mjs.map +0 -1
  38. package/dist/chunk-GI32PQX6.mjs.map +0 -1
  39. package/dist/chunk-U74GJORZ.mjs.map +0 -1
  40. package/dist/chunk-YCN5NOAP.mjs.map +0 -1
  41. /package/dist/{chunk-M3JAEGRU.mjs.map → chunk-32OC2CBT.mjs.map} +0 -0
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  CustomEventNames,
3
3
  LangGraphAgent
4
- } from "../chunk-M3JAEGRU.mjs";
4
+ } from "../chunk-32OC2CBT.mjs";
5
5
  import {
6
6
  config,
7
7
  copilotRuntimeNextJSAppRouterEndpoint,
8
8
  copilotRuntimeNextJSPagesRouterEndpoint
9
- } from "../chunk-U74GJORZ.mjs";
9
+ } from "../chunk-MKAQQQ7D.mjs";
10
10
  import {
11
11
  copilotRuntimeNestEndpoint
12
- } from "../chunk-FK4NZL4G.mjs";
12
+ } from "../chunk-T3HIFVU2.mjs";
13
13
  import {
14
14
  copilotRuntimeNodeExpressEndpoint
15
- } from "../chunk-GI32PQX6.mjs";
15
+ } from "../chunk-5CY2MEHT.mjs";
16
16
  import {
17
17
  CopilotRuntime,
18
18
  addCustomHeaderPlugin,
@@ -28,7 +28,7 @@ import {
28
28
  getCommonConfig,
29
29
  langGraphPlatformEndpoint,
30
30
  resolveEndpointType
31
- } from "../chunk-YCN5NOAP.mjs";
31
+ } from "../chunk-YVZCIKZM.mjs";
32
32
  import {
33
33
  GoogleGenerativeAIAdapter,
34
34
  GroqAdapter,
@@ -44,7 +44,7 @@ var require_package = __commonJS({
44
44
  publishConfig: {
45
45
  access: "public"
46
46
  },
47
- version: "1.9.0",
47
+ version: "1.9.1-next.0",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -1836,7 +1836,9 @@ var telemetryClient = new import_shared4.TelemetryClient({
1836
1836
  packageName: packageJson.name,
1837
1837
  packageVersion: packageJson.version
1838
1838
  });
1839
- function getRuntimeInstanceTelemetryInfo(runtime) {
1839
+ function getRuntimeInstanceTelemetryInfo(options) {
1840
+ var _a, _b;
1841
+ const runtime = options.runtime;
1840
1842
  const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
1841
1843
  let info = {
1842
1844
  ...acc
@@ -1865,12 +1867,21 @@ function getRuntimeInstanceTelemetryInfo(runtime) {
1865
1867
  agentsAmount: null,
1866
1868
  hashedKey: null
1867
1869
  });
1870
+ const publicApiKey = (_a = options.cloud) == null ? void 0 : _a.publicApiKey;
1871
+ const apiKeyProvided = !!publicApiKey && publicApiKey.trim().length > 0;
1868
1872
  return {
1869
1873
  actionsAmount: runtime.actions.length,
1870
1874
  endpointsAmount: runtime.remoteEndpointDefinitions.length,
1871
1875
  endpointTypes: endpointsInfo.endpointTypes,
1872
1876
  agentsAmount: endpointsInfo.agentsAmount,
1873
- hashedLgcKey: endpointsInfo.hashedKey
1877
+ hashedLgcKey: endpointsInfo.hashedKey,
1878
+ "cloud.api_key_provided": apiKeyProvided,
1879
+ ...apiKeyProvided ? {
1880
+ "cloud.public_api_key": publicApiKey
1881
+ } : {},
1882
+ ...((_b = options.cloud) == null ? void 0 : _b.baseUrl) ? {
1883
+ "cloud.base_url": options.cloud.baseUrl
1884
+ } : {}
1874
1885
  };
1875
1886
  }
1876
1887
  __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
@@ -2064,7 +2075,16 @@ var CopilotResolver = class {
2064
2075
  var _a, _b, _c, _d;
2065
2076
  telemetry_client_default.capture("oss.runtime.copilot_request_created", {
2066
2077
  "cloud.guardrails.enabled": ((_a = data.cloud) == null ? void 0 : _a.guardrails) !== void 0,
2067
- requestType: data.metadata.requestType
2078
+ requestType: data.metadata.requestType,
2079
+ "cloud.api_key_provided": !!ctx.request.headers.get("x-copilotcloud-public-api-key"),
2080
+ ...ctx.request.headers.get("x-copilotcloud-public-api-key") ? {
2081
+ "cloud.public_api_key": ctx.request.headers.get("x-copilotcloud-public-api-key")
2082
+ } : {},
2083
+ ...ctx._copilotkit.baseUrl ? {
2084
+ "cloud.base_url": ctx._copilotkit.baseUrl
2085
+ } : {
2086
+ "cloud.base_url": "https://api.cloud.copilotkit.ai"
2087
+ }
2068
2088
  });
2069
2089
  let logger2 = ctx.logger.child({
2070
2090
  component: "CopilotResolver.generateCopilotResponse"
@@ -2801,7 +2821,7 @@ function copilotRuntimeNextJSAppRouterEndpoint(options) {
2801
2821
  _copilotkit: options.properties._copilotkit
2802
2822
  });
2803
2823
  }
2804
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2824
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
2805
2825
  const logger2 = commonConfig.logging;
2806
2826
  logger2.debug("Creating NextJS App Router endpoint");
2807
2827
  const yoga = (0, import_graphql_yoga2.createYoga)({
@@ -2840,7 +2860,7 @@ function copilotRuntimeNextJSPagesRouterEndpoint(options) {
2840
2860
  _copilotkit: options.properties._copilotkit
2841
2861
  });
2842
2862
  }
2843
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2863
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
2844
2864
  const logger2 = commonConfig.logging;
2845
2865
  logger2.debug("Creating NextJS Pages Router endpoint");
2846
2866
  const yoga = (0, import_graphql_yoga3.createYoga)({
@@ -2866,7 +2886,7 @@ function copilotRuntimeNodeHttpEndpoint(options) {
2866
2886
  _copilotkit: options.properties._copilotkit
2867
2887
  });
2868
2888
  }
2869
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2889
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
2870
2890
  const logger2 = commonConfig.logging;
2871
2891
  logger2.debug("Creating Node HTTP endpoint");
2872
2892
  const yoga = (0, import_graphql_yoga4.createYoga)({
@@ -2884,7 +2904,7 @@ function copilotRuntimeNodeExpressEndpoint(options) {
2884
2904
  framework: "node-express"
2885
2905
  }
2886
2906
  });
2887
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2907
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
2888
2908
  return copilotRuntimeNodeHttpEndpoint(options);
2889
2909
  }
2890
2910
  __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
@@ -2896,7 +2916,7 @@ function copilotRuntimeNestEndpoint(options) {
2896
2916
  framework: "nest"
2897
2917
  }
2898
2918
  });
2899
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2919
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
2900
2920
  return copilotRuntimeNodeHttpEndpoint(options);
2901
2921
  }
2902
2922
  __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");