@copilotkit/runtime 1.51.3-next.5 → 1.51.3-next.7

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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.51.3-next.7
4
+
5
+ ### Patch Changes
6
+
7
+ - @copilotkit/shared@1.51.3-next.7
8
+ - @copilotkitnext/agent@1.51.3-next.7
9
+ - @copilotkitnext/runtime@1.51.3-next.7
10
+
11
+ ## 1.51.3-next.6
12
+
13
+ ### Patch Changes
14
+
15
+ - 3a0822d: fix: do not run middleware for internal get requests
16
+ - @copilotkit/shared@1.51.3-next.6
17
+ - @copilotkitnext/agent@1.51.3-next.6
18
+ - @copilotkitnext/runtime@1.51.3-next.6
19
+
3
20
  ## 1.51.3-next.5
4
21
 
5
22
  ### Patch Changes
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ var require_package = __commonJS({
72
72
  publishConfig: {
73
73
  access: "public"
74
74
  },
75
- version: "1.51.3-next.5",
75
+ version: "1.51.3-next.7",
76
76
  sideEffects: false,
77
77
  main: "./dist/index.js",
78
78
  module: "./dist/index.mjs",
@@ -3580,7 +3580,7 @@ var CopilotRuntime = class {
3580
3580
  const { request } = hookParams;
3581
3581
  const publicApiKey = request.headers.get("x-copilotcloud-public-api-key");
3582
3582
  const body = await shared.readBody(request);
3583
- const forwardedProps = body.forwardedProps;
3583
+ const forwardedProps = body == null ? void 0 : body.forwardedProps;
3584
3584
  const cloudBaseUrl = process.env.COPILOT_CLOUD_BASE_URL || "https://api.cloud.copilotkit.ai";
3585
3585
  telemetry_client_default.capture("oss.runtime.copilot_request_created", {
3586
3586
  "cloud.guardrails.enabled": ((_a = forwardedProps == null ? void 0 : forwardedProps.cloud) == null ? void 0 : _a.guardrails) !== void 0,
@@ -3591,6 +3591,8 @@ var CopilotRuntime = class {
3591
3591
  } : {},
3592
3592
  "cloud.base_url": cloudBaseUrl
3593
3593
  });
3594
+ if (request.method === "GET" || !body)
3595
+ return;
3594
3596
  const middlewareResult = await ((_c = params == null ? void 0 : params.beforeRequestMiddleware) == null ? void 0 : _c.call(params, hookParams));
3595
3597
  if ((_d = params == null ? void 0 : params.middleware) == null ? void 0 : _d.onBeforeRequest) {
3596
3598
  const { request: request2, runtime, path } = hookParams;