@copilotkit/runtime 1.9.0-next.2 → 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 +26 -0
  2. package/dist/{chunk-XB3TW5NJ.mjs → chunk-32OC2CBT.mjs} +2 -2
  3. package/dist/{chunk-S5TNKSNR.mjs → chunk-5CY2MEHT.mjs} +3 -3
  4. package/dist/chunk-5CY2MEHT.mjs.map +1 -0
  5. package/dist/{chunk-G4NOAQUA.mjs → chunk-MKAQQQ7D.mjs} +4 -4
  6. package/dist/chunk-MKAQQQ7D.mjs.map +1 -0
  7. package/dist/{chunk-XPTVSVNM.mjs → chunk-T3HIFVU2.mjs} +3 -3
  8. package/dist/chunk-T3HIFVU2.mjs.map +1 -0
  9. package/dist/{chunk-6A27R7IP.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 +2 -2
  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-6A27R7IP.mjs.map +0 -1
  38. package/dist/chunk-G4NOAQUA.mjs.map +0 -1
  39. package/dist/chunk-S5TNKSNR.mjs.map +0 -1
  40. package/dist/chunk-XPTVSVNM.mjs.map +0 -1
  41. /package/dist/{chunk-XB3TW5NJ.mjs.map → chunk-32OC2CBT.mjs.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  copilotRuntimeNodeExpressEndpoint
3
- } from "../../../chunk-S5TNKSNR.mjs";
4
- import "../../../chunk-6A27R7IP.mjs";
3
+ } from "../../../chunk-5CY2MEHT.mjs";
4
+ import "../../../chunk-YVZCIKZM.mjs";
5
5
  import "../../../chunk-IIXJVVTV.mjs";
6
6
  import "../../../chunk-5BIEM2UU.mjs";
7
7
  import "../../../chunk-SHBDMA63.mjs";
@@ -44,7 +44,7 @@ var require_package = __commonJS({
44
44
  publishConfig: {
45
45
  access: "public"
46
46
  },
47
- version: "1.9.0-next.2",
47
+ version: "1.9.1-next.0",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -1828,7 +1828,9 @@ var telemetryClient = new import_shared4.TelemetryClient({
1828
1828
  packageName: packageJson.name,
1829
1829
  packageVersion: packageJson.version
1830
1830
  });
1831
- function getRuntimeInstanceTelemetryInfo(runtime) {
1831
+ function getRuntimeInstanceTelemetryInfo(options) {
1832
+ var _a, _b;
1833
+ const runtime = options.runtime;
1832
1834
  const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
1833
1835
  let info = {
1834
1836
  ...acc
@@ -1857,12 +1859,21 @@ function getRuntimeInstanceTelemetryInfo(runtime) {
1857
1859
  agentsAmount: null,
1858
1860
  hashedKey: null
1859
1861
  });
1862
+ const publicApiKey = (_a = options.cloud) == null ? void 0 : _a.publicApiKey;
1863
+ const apiKeyProvided = !!publicApiKey && publicApiKey.trim().length > 0;
1860
1864
  return {
1861
1865
  actionsAmount: runtime.actions.length,
1862
1866
  endpointsAmount: runtime.remoteEndpointDefinitions.length,
1863
1867
  endpointTypes: endpointsInfo.endpointTypes,
1864
1868
  agentsAmount: endpointsInfo.agentsAmount,
1865
- hashedLgcKey: endpointsInfo.hashedKey
1869
+ hashedLgcKey: endpointsInfo.hashedKey,
1870
+ "cloud.api_key_provided": apiKeyProvided,
1871
+ ...apiKeyProvided ? {
1872
+ "cloud.public_api_key": publicApiKey
1873
+ } : {},
1874
+ ...((_b = options.cloud) == null ? void 0 : _b.baseUrl) ? {
1875
+ "cloud.base_url": options.cloud.baseUrl
1876
+ } : {}
1866
1877
  };
1867
1878
  }
1868
1879
  __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
@@ -2056,7 +2067,16 @@ var CopilotResolver = class {
2056
2067
  var _a, _b, _c, _d;
2057
2068
  telemetry_client_default.capture("oss.runtime.copilot_request_created", {
2058
2069
  "cloud.guardrails.enabled": ((_a = data.cloud) == null ? void 0 : _a.guardrails) !== void 0,
2059
- requestType: data.metadata.requestType
2070
+ requestType: data.metadata.requestType,
2071
+ "cloud.api_key_provided": !!ctx.request.headers.get("x-copilotcloud-public-api-key"),
2072
+ ...ctx.request.headers.get("x-copilotcloud-public-api-key") ? {
2073
+ "cloud.public_api_key": ctx.request.headers.get("x-copilotcloud-public-api-key")
2074
+ } : {},
2075
+ ...ctx._copilotkit.baseUrl ? {
2076
+ "cloud.base_url": ctx._copilotkit.baseUrl
2077
+ } : {
2078
+ "cloud.base_url": "https://api.cloud.copilotkit.ai"
2079
+ }
2060
2080
  });
2061
2081
  let logger2 = ctx.logger.child({
2062
2082
  component: "CopilotResolver.generateCopilotResponse"
@@ -2792,7 +2812,7 @@ function copilotRuntimeNodeHttpEndpoint(options) {
2792
2812
  _copilotkit: options.properties._copilotkit
2793
2813
  });
2794
2814
  }
2795
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2815
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
2796
2816
  const logger2 = commonConfig.logging;
2797
2817
  logger2.debug("Creating Node HTTP endpoint");
2798
2818
  const yoga = (0, import_graphql_yoga2.createYoga)({