@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.
- package/CHANGELOG.md +26 -0
- package/dist/{chunk-XB3TW5NJ.mjs → chunk-32OC2CBT.mjs} +2 -2
- package/dist/{chunk-S5TNKSNR.mjs → chunk-5CY2MEHT.mjs} +3 -3
- package/dist/chunk-5CY2MEHT.mjs.map +1 -0
- package/dist/{chunk-G4NOAQUA.mjs → chunk-MKAQQQ7D.mjs} +4 -4
- package/dist/chunk-MKAQQQ7D.mjs.map +1 -0
- package/dist/{chunk-XPTVSVNM.mjs → chunk-T3HIFVU2.mjs} +3 -3
- package/dist/chunk-T3HIFVU2.mjs.map +1 -0
- package/dist/{chunk-6A27R7IP.mjs → chunk-YVZCIKZM.mjs} +26 -6
- package/dist/chunk-YVZCIKZM.mjs.map +1 -0
- package/dist/index.js +29 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/lib/index.js +29 -9
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.js +29 -9
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.js +26 -6
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.js +26 -6
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.js +25 -5
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/package.json +2 -2
- package/src/graphql/resolvers/copilot.resolver.ts +13 -0
- package/src/lib/integrations/nest/index.ts +1 -4
- package/src/lib/integrations/nextjs/app-router.ts +1 -4
- package/src/lib/integrations/nextjs/pages-router.ts +1 -4
- package/src/lib/integrations/node-express/index.ts +1 -4
- package/src/lib/integrations/node-http/index.ts +1 -4
- package/src/lib/telemetry-client.ts +11 -2
- package/dist/chunk-6A27R7IP.mjs.map +0 -1
- package/dist/chunk-G4NOAQUA.mjs.map +0 -1
- package/dist/chunk-S5TNKSNR.mjs.map +0 -1
- package/dist/chunk-XPTVSVNM.mjs.map +0 -1
- /package/dist/{chunk-XB3TW5NJ.mjs.map → chunk-32OC2CBT.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.9.
|
|
47
|
+
version: "1.9.1-next.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -5754,7 +5754,9 @@ var telemetryClient = new import_shared21.TelemetryClient({
|
|
|
5754
5754
|
packageName: packageJson.name,
|
|
5755
5755
|
packageVersion: packageJson.version
|
|
5756
5756
|
});
|
|
5757
|
-
function getRuntimeInstanceTelemetryInfo(
|
|
5757
|
+
function getRuntimeInstanceTelemetryInfo(options) {
|
|
5758
|
+
var _a, _b;
|
|
5759
|
+
const runtime = options.runtime;
|
|
5758
5760
|
const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
|
|
5759
5761
|
let info = {
|
|
5760
5762
|
...acc
|
|
@@ -5783,12 +5785,21 @@ function getRuntimeInstanceTelemetryInfo(runtime) {
|
|
|
5783
5785
|
agentsAmount: null,
|
|
5784
5786
|
hashedKey: null
|
|
5785
5787
|
});
|
|
5788
|
+
const publicApiKey = (_a = options.cloud) == null ? void 0 : _a.publicApiKey;
|
|
5789
|
+
const apiKeyProvided = !!publicApiKey && publicApiKey.trim().length > 0;
|
|
5786
5790
|
return {
|
|
5787
5791
|
actionsAmount: runtime.actions.length,
|
|
5788
5792
|
endpointsAmount: runtime.remoteEndpointDefinitions.length,
|
|
5789
5793
|
endpointTypes: endpointsInfo.endpointTypes,
|
|
5790
5794
|
agentsAmount: endpointsInfo.agentsAmount,
|
|
5791
|
-
hashedLgcKey: endpointsInfo.hashedKey
|
|
5795
|
+
hashedLgcKey: endpointsInfo.hashedKey,
|
|
5796
|
+
"cloud.api_key_provided": apiKeyProvided,
|
|
5797
|
+
...apiKeyProvided ? {
|
|
5798
|
+
"cloud.public_api_key": publicApiKey
|
|
5799
|
+
} : {},
|
|
5800
|
+
...((_b = options.cloud) == null ? void 0 : _b.baseUrl) ? {
|
|
5801
|
+
"cloud.base_url": options.cloud.baseUrl
|
|
5802
|
+
} : {}
|
|
5792
5803
|
};
|
|
5793
5804
|
}
|
|
5794
5805
|
__name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
@@ -6245,7 +6256,16 @@ var CopilotResolver = class {
|
|
|
6245
6256
|
var _a, _b, _c, _d;
|
|
6246
6257
|
telemetry_client_default.capture("oss.runtime.copilot_request_created", {
|
|
6247
6258
|
"cloud.guardrails.enabled": ((_a = data.cloud) == null ? void 0 : _a.guardrails) !== void 0,
|
|
6248
|
-
requestType: data.metadata.requestType
|
|
6259
|
+
requestType: data.metadata.requestType,
|
|
6260
|
+
"cloud.api_key_provided": !!ctx.request.headers.get("x-copilotcloud-public-api-key"),
|
|
6261
|
+
...ctx.request.headers.get("x-copilotcloud-public-api-key") ? {
|
|
6262
|
+
"cloud.public_api_key": ctx.request.headers.get("x-copilotcloud-public-api-key")
|
|
6263
|
+
} : {},
|
|
6264
|
+
...ctx._copilotkit.baseUrl ? {
|
|
6265
|
+
"cloud.base_url": ctx._copilotkit.baseUrl
|
|
6266
|
+
} : {
|
|
6267
|
+
"cloud.base_url": "https://api.cloud.copilotkit.ai"
|
|
6268
|
+
}
|
|
6249
6269
|
});
|
|
6250
6270
|
let logger2 = ctx.logger.child({
|
|
6251
6271
|
component: "CopilotResolver.generateCopilotResponse"
|
|
@@ -6982,7 +7002,7 @@ function copilotRuntimeNextJSAppRouterEndpoint(options) {
|
|
|
6982
7002
|
_copilotkit: options.properties._copilotkit
|
|
6983
7003
|
});
|
|
6984
7004
|
}
|
|
6985
|
-
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options
|
|
7005
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
|
|
6986
7006
|
const logger2 = commonConfig.logging;
|
|
6987
7007
|
logger2.debug("Creating NextJS App Router endpoint");
|
|
6988
7008
|
const yoga = (0, import_graphql_yoga2.createYoga)({
|
|
@@ -7021,7 +7041,7 @@ function copilotRuntimeNextJSPagesRouterEndpoint(options) {
|
|
|
7021
7041
|
_copilotkit: options.properties._copilotkit
|
|
7022
7042
|
});
|
|
7023
7043
|
}
|
|
7024
|
-
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options
|
|
7044
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
|
|
7025
7045
|
const logger2 = commonConfig.logging;
|
|
7026
7046
|
logger2.debug("Creating NextJS Pages Router endpoint");
|
|
7027
7047
|
const yoga = (0, import_graphql_yoga3.createYoga)({
|
|
@@ -7047,7 +7067,7 @@ function copilotRuntimeNodeHttpEndpoint(options) {
|
|
|
7047
7067
|
_copilotkit: options.properties._copilotkit
|
|
7048
7068
|
});
|
|
7049
7069
|
}
|
|
7050
|
-
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options
|
|
7070
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
|
|
7051
7071
|
const logger2 = commonConfig.logging;
|
|
7052
7072
|
logger2.debug("Creating Node HTTP endpoint");
|
|
7053
7073
|
const yoga = (0, import_graphql_yoga4.createYoga)({
|
|
@@ -7065,7 +7085,7 @@ function copilotRuntimeNodeExpressEndpoint(options) {
|
|
|
7065
7085
|
framework: "node-express"
|
|
7066
7086
|
}
|
|
7067
7087
|
});
|
|
7068
|
-
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options
|
|
7088
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
|
|
7069
7089
|
return copilotRuntimeNodeHttpEndpoint(options);
|
|
7070
7090
|
}
|
|
7071
7091
|
__name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
|
|
@@ -7077,7 +7097,7 @@ function copilotRuntimeNestEndpoint(options) {
|
|
|
7077
7097
|
framework: "nest"
|
|
7078
7098
|
}
|
|
7079
7099
|
});
|
|
7080
|
-
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options
|
|
7100
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
|
|
7081
7101
|
return copilotRuntimeNodeHttpEndpoint(options);
|
|
7082
7102
|
}
|
|
7083
7103
|
__name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|