@kya-os/agentshield-nextjs 0.2.12 → 0.2.13

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/dist/index.mjs CHANGED
@@ -1963,7 +1963,7 @@ function createEnhancedAgentShieldMiddleware(config = {}) {
1963
1963
 
1964
1964
  // src/api-client.ts
1965
1965
  var DEFAULT_BASE_URL = "https://kya.vouched.id";
1966
- var EDGE_DETECT_URL = "https://detect.kya-os.ai";
1966
+ var EDGE_DETECT_URL = "https://detect.checkpoint-gateway.ai";
1967
1967
  var DEFAULT_TIMEOUT = 5e3;
1968
1968
  var AgentShieldClient = class {
1969
1969
  apiKey;
@@ -2175,21 +2175,16 @@ function shouldIncludePath(path, includePaths) {
2175
2175
  }
2176
2176
  function buildBlockedResponse(decision, config) {
2177
2177
  const status = config.blockedResponse?.status ?? 403;
2178
- const redirectUrl = config.redirectUrl || decision.redirectUrl;
2179
- const baseMessage = config.blockedResponse?.message ?? decision.message ?? "Access denied";
2180
- const errorMessage = redirectUrl ? `${baseMessage}. Please go to ${redirectUrl}` : baseMessage;
2181
- const message = config.blockedResponse?.message ?? decision.message ?? (redirectUrl ? `AI agents are not permitted on this resource. Please go to ${redirectUrl} for more information.` : "AI agents are not permitted on this resource.");
2182
- const responseBody = {
2183
- error: errorMessage,
2184
- code: "AGENT_BLOCKED",
2185
- reason: decision.reason,
2186
- agentType: decision.agentType,
2187
- message
2188
- };
2189
- if (redirectUrl) {
2190
- responseBody.redirectUrl = redirectUrl;
2191
- }
2192
- const response = NextResponse.json(responseBody, { status });
2178
+ const message = config.blockedResponse?.message ?? decision.message ?? "Access denied";
2179
+ const response = NextResponse.json(
2180
+ {
2181
+ error: message,
2182
+ code: "AGENT_BLOCKED",
2183
+ reason: decision.reason,
2184
+ agentType: decision.agentType
2185
+ },
2186
+ { status }
2187
+ );
2193
2188
  if (config.blockedResponse?.headers) {
2194
2189
  for (const [key, value] of Object.entries(config.blockedResponse.headers)) {
2195
2190
  response.headers.set(key, value);
@@ -2197,9 +2192,6 @@ function buildBlockedResponse(decision, config) {
2197
2192
  }
2198
2193
  response.headers.set("X-AgentShield-Action", decision.action);
2199
2194
  response.headers.set("X-AgentShield-Reason", decision.reason);
2200
- if (redirectUrl) {
2201
- response.headers.set("X-AgentShield-Redirect", redirectUrl);
2202
- }
2203
2195
  return response;
2204
2196
  }
2205
2197
  function buildRedirectResponse(request, decision, config) {