@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
package/dist/index.mjs CHANGED
@@ -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
  AnthropicAdapter,
34
34
  BedrockAdapter,
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.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",
@@ -5342,7 +5342,9 @@ var telemetryClient = new import_shared19.TelemetryClient({
5342
5342
  packageName: packageJson.name,
5343
5343
  packageVersion: packageJson.version
5344
5344
  });
5345
- function getRuntimeInstanceTelemetryInfo(runtime) {
5345
+ function getRuntimeInstanceTelemetryInfo(options) {
5346
+ var _a, _b;
5347
+ const runtime = options.runtime;
5346
5348
  const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
5347
5349
  let info = {
5348
5350
  ...acc
@@ -5371,12 +5373,21 @@ function getRuntimeInstanceTelemetryInfo(runtime) {
5371
5373
  agentsAmount: null,
5372
5374
  hashedKey: null
5373
5375
  });
5376
+ const publicApiKey = (_a = options.cloud) == null ? void 0 : _a.publicApiKey;
5377
+ const apiKeyProvided = !!publicApiKey && publicApiKey.trim().length > 0;
5374
5378
  return {
5375
5379
  actionsAmount: runtime.actions.length,
5376
5380
  endpointsAmount: runtime.remoteEndpointDefinitions.length,
5377
5381
  endpointTypes: endpointsInfo.endpointTypes,
5378
5382
  agentsAmount: endpointsInfo.agentsAmount,
5379
- hashedLgcKey: endpointsInfo.hashedKey
5383
+ hashedLgcKey: endpointsInfo.hashedKey,
5384
+ "cloud.api_key_provided": apiKeyProvided,
5385
+ ...apiKeyProvided ? {
5386
+ "cloud.public_api_key": publicApiKey
5387
+ } : {},
5388
+ ...((_b = options.cloud) == null ? void 0 : _b.baseUrl) ? {
5389
+ "cloud.base_url": options.cloud.baseUrl
5390
+ } : {}
5380
5391
  };
5381
5392
  }
5382
5393
  __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
@@ -5833,7 +5844,16 @@ var CopilotResolver = class {
5833
5844
  var _a, _b, _c, _d;
5834
5845
  telemetry_client_default.capture("oss.runtime.copilot_request_created", {
5835
5846
  "cloud.guardrails.enabled": ((_a = data.cloud) == null ? void 0 : _a.guardrails) !== void 0,
5836
- requestType: data.metadata.requestType
5847
+ requestType: data.metadata.requestType,
5848
+ "cloud.api_key_provided": !!ctx.request.headers.get("x-copilotcloud-public-api-key"),
5849
+ ...ctx.request.headers.get("x-copilotcloud-public-api-key") ? {
5850
+ "cloud.public_api_key": ctx.request.headers.get("x-copilotcloud-public-api-key")
5851
+ } : {},
5852
+ ...ctx._copilotkit.baseUrl ? {
5853
+ "cloud.base_url": ctx._copilotkit.baseUrl
5854
+ } : {
5855
+ "cloud.base_url": "https://api.cloud.copilotkit.ai"
5856
+ }
5837
5857
  });
5838
5858
  let logger2 = ctx.logger.child({
5839
5859
  component: "CopilotResolver.generateCopilotResponse"
@@ -6570,7 +6590,7 @@ function copilotRuntimeNextJSAppRouterEndpoint(options) {
6570
6590
  _copilotkit: options.properties._copilotkit
6571
6591
  });
6572
6592
  }
6573
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
6593
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
6574
6594
  const logger2 = commonConfig.logging;
6575
6595
  logger2.debug("Creating NextJS App Router endpoint");
6576
6596
  const yoga = (0, import_graphql_yoga2.createYoga)({
@@ -6609,7 +6629,7 @@ function copilotRuntimeNextJSPagesRouterEndpoint(options) {
6609
6629
  _copilotkit: options.properties._copilotkit
6610
6630
  });
6611
6631
  }
6612
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
6632
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
6613
6633
  const logger2 = commonConfig.logging;
6614
6634
  logger2.debug("Creating NextJS Pages Router endpoint");
6615
6635
  const yoga = (0, import_graphql_yoga3.createYoga)({
@@ -6635,7 +6655,7 @@ function copilotRuntimeNodeHttpEndpoint(options) {
6635
6655
  _copilotkit: options.properties._copilotkit
6636
6656
  });
6637
6657
  }
6638
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
6658
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
6639
6659
  const logger2 = commonConfig.logging;
6640
6660
  logger2.debug("Creating Node HTTP endpoint");
6641
6661
  const yoga = (0, import_graphql_yoga4.createYoga)({
@@ -6653,7 +6673,7 @@ function copilotRuntimeNodeExpressEndpoint(options) {
6653
6673
  framework: "node-express"
6654
6674
  }
6655
6675
  });
6656
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
6676
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
6657
6677
  return copilotRuntimeNodeHttpEndpoint(options);
6658
6678
  }
6659
6679
  __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
@@ -6665,7 +6685,7 @@ function copilotRuntimeNestEndpoint(options) {
6665
6685
  framework: "nest"
6666
6686
  }
6667
6687
  });
6668
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
6688
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
6669
6689
  return copilotRuntimeNodeHttpEndpoint(options);
6670
6690
  }
6671
6691
  __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");