@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
@@ -2,20 +2,20 @@ import {
2
2
  config,
3
3
  copilotRuntimeNextJSAppRouterEndpoint,
4
4
  copilotRuntimeNextJSPagesRouterEndpoint
5
- } from "../../chunk-G4NOAQUA.mjs";
5
+ } from "../../chunk-MKAQQQ7D.mjs";
6
6
  import {
7
7
  copilotRuntimeNestEndpoint
8
- } from "../../chunk-XPTVSVNM.mjs";
8
+ } from "../../chunk-T3HIFVU2.mjs";
9
9
  import {
10
10
  copilotRuntimeNodeExpressEndpoint
11
- } from "../../chunk-S5TNKSNR.mjs";
11
+ } from "../../chunk-5CY2MEHT.mjs";
12
12
  import {
13
13
  addCustomHeaderPlugin,
14
14
  buildSchema,
15
15
  copilotRuntimeNodeHttpEndpoint,
16
16
  createContext,
17
17
  getCommonConfig
18
- } from "../../chunk-6A27R7IP.mjs";
18
+ } from "../../chunk-YVZCIKZM.mjs";
19
19
  import "../../chunk-IIXJVVTV.mjs";
20
20
  import "../../chunk-5BIEM2UU.mjs";
21
21
  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",
@@ -1830,7 +1830,9 @@ var telemetryClient = new import_shared4.TelemetryClient({
1830
1830
  packageName: packageJson.name,
1831
1831
  packageVersion: packageJson.version
1832
1832
  });
1833
- function getRuntimeInstanceTelemetryInfo(runtime) {
1833
+ function getRuntimeInstanceTelemetryInfo(options) {
1834
+ var _a, _b;
1835
+ const runtime = options.runtime;
1834
1836
  const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
1835
1837
  let info = {
1836
1838
  ...acc
@@ -1859,12 +1861,21 @@ function getRuntimeInstanceTelemetryInfo(runtime) {
1859
1861
  agentsAmount: null,
1860
1862
  hashedKey: null
1861
1863
  });
1864
+ const publicApiKey = (_a = options.cloud) == null ? void 0 : _a.publicApiKey;
1865
+ const apiKeyProvided = !!publicApiKey && publicApiKey.trim().length > 0;
1862
1866
  return {
1863
1867
  actionsAmount: runtime.actions.length,
1864
1868
  endpointsAmount: runtime.remoteEndpointDefinitions.length,
1865
1869
  endpointTypes: endpointsInfo.endpointTypes,
1866
1870
  agentsAmount: endpointsInfo.agentsAmount,
1867
- hashedLgcKey: endpointsInfo.hashedKey
1871
+ hashedLgcKey: endpointsInfo.hashedKey,
1872
+ "cloud.api_key_provided": apiKeyProvided,
1873
+ ...apiKeyProvided ? {
1874
+ "cloud.public_api_key": publicApiKey
1875
+ } : {},
1876
+ ...((_b = options.cloud) == null ? void 0 : _b.baseUrl) ? {
1877
+ "cloud.base_url": options.cloud.baseUrl
1878
+ } : {}
1868
1879
  };
1869
1880
  }
1870
1881
  __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
@@ -2058,7 +2069,16 @@ var CopilotResolver = class {
2058
2069
  var _a, _b, _c, _d;
2059
2070
  telemetry_client_default.capture("oss.runtime.copilot_request_created", {
2060
2071
  "cloud.guardrails.enabled": ((_a = data.cloud) == null ? void 0 : _a.guardrails) !== void 0,
2061
- requestType: data.metadata.requestType
2072
+ requestType: data.metadata.requestType,
2073
+ "cloud.api_key_provided": !!ctx.request.headers.get("x-copilotcloud-public-api-key"),
2074
+ ...ctx.request.headers.get("x-copilotcloud-public-api-key") ? {
2075
+ "cloud.public_api_key": ctx.request.headers.get("x-copilotcloud-public-api-key")
2076
+ } : {},
2077
+ ...ctx._copilotkit.baseUrl ? {
2078
+ "cloud.base_url": ctx._copilotkit.baseUrl
2079
+ } : {
2080
+ "cloud.base_url": "https://api.cloud.copilotkit.ai"
2081
+ }
2062
2082
  });
2063
2083
  let logger2 = ctx.logger.child({
2064
2084
  component: "CopilotResolver.generateCopilotResponse"
@@ -2794,7 +2814,7 @@ function copilotRuntimeNodeHttpEndpoint(options) {
2794
2814
  _copilotkit: options.properties._copilotkit
2795
2815
  });
2796
2816
  }
2797
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2817
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
2798
2818
  const logger2 = commonConfig.logging;
2799
2819
  logger2.debug("Creating Node HTTP endpoint");
2800
2820
  const yoga = (0, import_graphql_yoga2.createYoga)({
@@ -2812,7 +2832,7 @@ function copilotRuntimeNestEndpoint(options) {
2812
2832
  framework: "nest"
2813
2833
  }
2814
2834
  });
2815
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
2835
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
2816
2836
  return copilotRuntimeNodeHttpEndpoint(options);
2817
2837
  }
2818
2838
  __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");