@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.
- package/CHANGELOG.md +22 -0
- package/dist/{chunk-FK4NZL4G.mjs → chunk-2CND6WGV.mjs} +3 -3
- package/dist/chunk-2CND6WGV.mjs.map +1 -0
- package/dist/{chunk-M3JAEGRU.mjs → chunk-BHNTR222.mjs} +2 -2
- package/dist/{chunk-GI32PQX6.mjs → chunk-EVF3MXEK.mjs} +3 -3
- package/dist/chunk-EVF3MXEK.mjs.map +1 -0
- package/dist/{chunk-YCN5NOAP.mjs → chunk-GOPTDPPB.mjs} +26 -6
- package/dist/chunk-GOPTDPPB.mjs.map +1 -0
- package/dist/{chunk-U74GJORZ.mjs → chunk-RVLXQ2V5.mjs} +4 -4
- package/dist/chunk-RVLXQ2V5.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 +4 -4
- 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-FK4NZL4G.mjs.map +0 -1
- package/dist/chunk-GI32PQX6.mjs.map +0 -1
- package/dist/chunk-U74GJORZ.mjs.map +0 -1
- package/dist/chunk-YCN5NOAP.mjs.map +0 -1
- /package/dist/{chunk-M3JAEGRU.mjs.map → chunk-BHNTR222.mjs.map} +0 -0
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
config,
|
|
3
3
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
4
4
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-RVLXQ2V5.mjs";
|
|
6
6
|
import {
|
|
7
7
|
copilotRuntimeNestEndpoint
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-2CND6WGV.mjs";
|
|
9
9
|
import {
|
|
10
10
|
copilotRuntimeNodeExpressEndpoint
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-EVF3MXEK.mjs";
|
|
12
12
|
import {
|
|
13
13
|
addCustomHeaderPlugin,
|
|
14
14
|
buildSchema,
|
|
15
15
|
copilotRuntimeNodeHttpEndpoint,
|
|
16
16
|
createContext,
|
|
17
17
|
getCommonConfig
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-GOPTDPPB.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.
|
|
47
|
+
version: "1.9.1",
|
|
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(
|
|
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
|
|
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
|
|
2835
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options));
|
|
2816
2836
|
return copilotRuntimeNodeHttpEndpoint(options);
|
|
2817
2837
|
}
|
|
2818
2838
|
__name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|