@copilotkit/runtime 1.9.0 → 1.9.1

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 +22 -0
  2. package/dist/{chunk-FK4NZL4G.mjs → chunk-2CND6WGV.mjs} +3 -3
  3. package/dist/chunk-2CND6WGV.mjs.map +1 -0
  4. package/dist/{chunk-M3JAEGRU.mjs → chunk-BHNTR222.mjs} +2 -2
  5. package/dist/{chunk-GI32PQX6.mjs → chunk-EVF3MXEK.mjs} +3 -3
  6. package/dist/chunk-EVF3MXEK.mjs.map +1 -0
  7. package/dist/{chunk-YCN5NOAP.mjs → chunk-GOPTDPPB.mjs} +26 -6
  8. package/dist/chunk-GOPTDPPB.mjs.map +1 -0
  9. package/dist/{chunk-U74GJORZ.mjs → chunk-RVLXQ2V5.mjs} +4 -4
  10. package/dist/chunk-RVLXQ2V5.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-BHNTR222.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - deaeca0: - feat: Add public key
8
+
9
+ Signed-off-by: Luis Valdes <luis@copilotkit.ai>
10
+
11
+ - Updated dependencies [deaeca0]
12
+ - @copilotkit/shared@1.9.1
13
+
14
+ ## 1.9.1-next.0
15
+
16
+ ### Patch Changes
17
+
18
+ - deaeca0: - feat: Add public key
19
+
20
+ Signed-off-by: Luis Valdes <luis@copilotkit.ai>
21
+
22
+ - Updated dependencies [deaeca0]
23
+ - @copilotkit/shared@1.9.1-next.0
24
+
3
25
  ## 1.9.0
4
26
 
5
27
  ### Minor Changes
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-YCN5NOAP.mjs";
5
+ } from "./chunk-GOPTDPPB.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -14,7 +14,7 @@ function copilotRuntimeNestEndpoint(options) {
14
14
  framework: "nest"
15
15
  }
16
16
  });
17
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
17
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
18
18
  return copilotRuntimeNodeHttpEndpoint(options);
19
19
  }
20
20
  __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
22
22
  export {
23
23
  copilotRuntimeNestEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-FK4NZL4G.mjs.map
25
+ //# sourceMappingURL=chunk-2CND6WGV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/integrations/nest/index.ts"],"sourcesContent":["import { CreateCopilotRuntimeServerOptions } from \"../shared\";\nimport { copilotRuntimeNodeHttpEndpoint } from \"../node-http\";\nimport telemetry, { getRuntimeInstanceTelemetryInfo } from \"../../telemetry-client\";\n\nexport function copilotRuntimeNestEndpoint(options: CreateCopilotRuntimeServerOptions) {\n telemetry.setGlobalProperties({\n runtime: {\n framework: \"nest\",\n },\n });\n\n telemetry.capture(\"oss.runtime.instance_created\", getRuntimeInstanceTelemetryInfo(options));\n return copilotRuntimeNodeHttpEndpoint(options);\n}\n"],"mappings":";;;;;;;;;;AAIO,SAASA,2BAA2BC,SAA0C;AACnFC,2BAAUC,oBAAoB;IAC5BC,SAAS;MACPC,WAAW;IACb;EACF,CAAA;AAEAH,2BAAUI,QAAQ,gCAAgCC,gCAAgCN,OAAAA,CAAAA;AAClF,SAAOO,+BAA+BP,OAAAA;AACxC;AATgBD;","names":["copilotRuntimeNestEndpoint","options","telemetry","setGlobalProperties","runtime","framework","capture","getRuntimeInstanceTelemetryInfo","copilotRuntimeNodeHttpEndpoint"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LangGraphEventTypes
3
- } from "./chunk-YCN5NOAP.mjs";
3
+ } from "./chunk-GOPTDPPB.mjs";
4
4
  import {
5
5
  __name
6
6
  } from "./chunk-FHD4JECV.mjs";
@@ -138,4 +138,4 @@ export {
138
138
  CustomEventNames,
139
139
  LangGraphAgent
140
140
  };
141
- //# sourceMappingURL=chunk-M3JAEGRU.mjs.map
141
+ //# sourceMappingURL=chunk-BHNTR222.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-YCN5NOAP.mjs";
5
+ } from "./chunk-GOPTDPPB.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -14,7 +14,7 @@ function copilotRuntimeNodeExpressEndpoint(options) {
14
14
  framework: "node-express"
15
15
  }
16
16
  });
17
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
17
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
18
18
  return copilotRuntimeNodeHttpEndpoint(options);
19
19
  }
20
20
  __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
22
22
  export {
23
23
  copilotRuntimeNodeExpressEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-GI32PQX6.mjs.map
25
+ //# sourceMappingURL=chunk-EVF3MXEK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/integrations/node-express/index.ts"],"sourcesContent":["import { CreateCopilotRuntimeServerOptions } from \"../shared\";\nimport { copilotRuntimeNodeHttpEndpoint } from \"../node-http\";\nimport telemetry, { getRuntimeInstanceTelemetryInfo } from \"../../telemetry-client\";\n\nexport function copilotRuntimeNodeExpressEndpoint(options: CreateCopilotRuntimeServerOptions) {\n telemetry.setGlobalProperties({\n runtime: {\n framework: \"node-express\",\n },\n });\n\n telemetry.capture(\"oss.runtime.instance_created\", getRuntimeInstanceTelemetryInfo(options));\n return copilotRuntimeNodeHttpEndpoint(options);\n}\n"],"mappings":";;;;;;;;;;AAIO,SAASA,kCAAkCC,SAA0C;AAC1FC,2BAAUC,oBAAoB;IAC5BC,SAAS;MACPC,WAAW;IACb;EACF,CAAA;AAEAH,2BAAUI,QAAQ,gCAAgCC,gCAAgCN,OAAAA,CAAAA;AAClF,SAAOO,+BAA+BP,OAAAA;AACxC;AATgBD;","names":["copilotRuntimeNodeExpressEndpoint","options","telemetry","setGlobalProperties","runtime","framework","capture","getRuntimeInstanceTelemetryInfo","copilotRuntimeNodeHttpEndpoint"]}
@@ -40,7 +40,7 @@ var require_package = __commonJS({
40
40
  publishConfig: {
41
41
  access: "public"
42
42
  },
43
- version: "1.9.0",
43
+ version: "1.9.1",
44
44
  sideEffects: false,
45
45
  main: "./dist/index.js",
46
46
  module: "./dist/index.mjs",
@@ -3879,7 +3879,9 @@ var telemetryClient = new TelemetryClient({
3879
3879
  packageName: packageJson.name,
3880
3880
  packageVersion: packageJson.version
3881
3881
  });
3882
- function getRuntimeInstanceTelemetryInfo(runtime) {
3882
+ function getRuntimeInstanceTelemetryInfo(options) {
3883
+ var _a, _b;
3884
+ const runtime = options.runtime;
3883
3885
  const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
3884
3886
  let info = {
3885
3887
  ...acc
@@ -3908,12 +3910,21 @@ function getRuntimeInstanceTelemetryInfo(runtime) {
3908
3910
  agentsAmount: null,
3909
3911
  hashedKey: null
3910
3912
  });
3913
+ const publicApiKey = (_a = options.cloud) == null ? void 0 : _a.publicApiKey;
3914
+ const apiKeyProvided = !!publicApiKey && publicApiKey.trim().length > 0;
3911
3915
  return {
3912
3916
  actionsAmount: runtime.actions.length,
3913
3917
  endpointsAmount: runtime.remoteEndpointDefinitions.length,
3914
3918
  endpointTypes: endpointsInfo.endpointTypes,
3915
3919
  agentsAmount: endpointsInfo.agentsAmount,
3916
- hashedLgcKey: endpointsInfo.hashedKey
3920
+ hashedLgcKey: endpointsInfo.hashedKey,
3921
+ "cloud.api_key_provided": apiKeyProvided,
3922
+ ...apiKeyProvided ? {
3923
+ "cloud.public_api_key": publicApiKey
3924
+ } : {},
3925
+ ...((_b = options.cloud) == null ? void 0 : _b.baseUrl) ? {
3926
+ "cloud.base_url": options.cloud.baseUrl
3927
+ } : {}
3917
3928
  };
3918
3929
  }
3919
3930
  __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
@@ -4335,7 +4346,16 @@ var CopilotResolver = class {
4335
4346
  var _a, _b, _c, _d;
4336
4347
  telemetry_client_default.capture("oss.runtime.copilot_request_created", {
4337
4348
  "cloud.guardrails.enabled": ((_a = data.cloud) == null ? void 0 : _a.guardrails) !== void 0,
4338
- requestType: data.metadata.requestType
4349
+ requestType: data.metadata.requestType,
4350
+ "cloud.api_key_provided": !!ctx.request.headers.get("x-copilotcloud-public-api-key"),
4351
+ ...ctx.request.headers.get("x-copilotcloud-public-api-key") ? {
4352
+ "cloud.public_api_key": ctx.request.headers.get("x-copilotcloud-public-api-key")
4353
+ } : {},
4354
+ ...ctx._copilotkit.baseUrl ? {
4355
+ "cloud.base_url": ctx._copilotkit.baseUrl
4356
+ } : {
4357
+ "cloud.base_url": "https://api.cloud.copilotkit.ai"
4358
+ }
4339
4359
  });
4340
4360
  let logger2 = ctx.logger.child({
4341
4361
  component: "CopilotResolver.generateCopilotResponse"
@@ -5071,7 +5091,7 @@ function copilotRuntimeNodeHttpEndpoint(options) {
5071
5091
  _copilotkit: options.properties._copilotkit
5072
5092
  });
5073
5093
  }
5074
- telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
5094
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
5075
5095
  const logger2 = commonConfig.logging;
5076
5096
  logger2.debug("Creating Node HTTP endpoint");
5077
5097
  const yoga = createYoga({
@@ -5101,4 +5121,4 @@ export {
5101
5121
  getCommonConfig,
5102
5122
  copilotRuntimeNodeHttpEndpoint
5103
5123
  };
5104
- //# sourceMappingURL=chunk-YCN5NOAP.mjs.map
5124
+ //# sourceMappingURL=chunk-GOPTDPPB.mjs.map