@searchos/bot-proxy 0.1.2 → 0.1.4

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.d.cts CHANGED
@@ -4,10 +4,19 @@ interface NextjsProxyOptions {
4
4
  cloudfrontDomain: string;
5
5
  prerenderDomain: string;
6
6
  botLogEndpoint: string;
7
+ /** AI 렌더 활성화 (기본: true). true면 AI 봇에게 ai 캐시를 우선 서빙 */
8
+ aiRender?: boolean;
9
+ /** OCR 활성화 (기본: true). AI 워밍 요청 시 OCR 포함 여부 */
10
+ ocr?: boolean;
11
+ /** AI 렌더 경로 prefix (빈 배열 = 전체 경로) */
12
+ aiPathPrefixes?: string[];
7
13
  }
8
14
  /**
9
15
  * Next.js middleware에서 봇 요청을 CloudFront 캐시로 프록시.
10
16
  * 봇이 아니거나 캐시 미스면 null 반환.
17
+ *
18
+ * AI 봇: ai 캐시 → desktop 폴백 → null (origin)
19
+ * 일반 봇: desktop/mobile 캐시 → null (origin)
11
20
  */
12
21
  declare function nextjsProxy(request: Request, options: NextjsProxyOptions): Promise<Response | null>;
13
22
 
@@ -17,13 +26,20 @@ interface CloudflareProxyOptions {
17
26
  siteDomain: string;
18
27
  prerenderDomain: string;
19
28
  botLogEndpoint: string;
29
+ /** AI 렌더 활성화 (기본: true). true면 AI 봇에게 ai 캐시를 우선 서빙 */
30
+ aiRender?: boolean;
31
+ /** OCR 활성화 (기본: true). AI 워밍 요청 시 OCR 포함 여부 */
32
+ ocr?: boolean;
33
+ /** AI 렌더 경로 prefix (빈 배열 = 전체 경로) */
34
+ aiPathPrefixes?: string[];
20
35
  }
21
36
  /**
22
37
  * Cloudflare Worker에서 봇 요청을 KV 캐시로 프록시.
23
38
  * 봇이 아니거나 캐시 미스면 null 반환.
24
39
  *
25
- * env.V2_CACHE에 KV namespace가 바인딩되어 있어야 함.
26
- computeCacheKey*/
40
+ * AI 봇: ai 캐시 desktop 폴백 → null (origin)
41
+ * 일반 봇: desktop/mobile 캐시 → null (origin)
42
+ */
27
43
  declare function cloudflareProxy(request: Request, env: {
28
44
  V2_CACHE?: KVNamespace;
29
45
  [key: string]: unknown;
package/dist/index.d.ts CHANGED
@@ -4,10 +4,19 @@ interface NextjsProxyOptions {
4
4
  cloudfrontDomain: string;
5
5
  prerenderDomain: string;
6
6
  botLogEndpoint: string;
7
+ /** AI 렌더 활성화 (기본: true). true면 AI 봇에게 ai 캐시를 우선 서빙 */
8
+ aiRender?: boolean;
9
+ /** OCR 활성화 (기본: true). AI 워밍 요청 시 OCR 포함 여부 */
10
+ ocr?: boolean;
11
+ /** AI 렌더 경로 prefix (빈 배열 = 전체 경로) */
12
+ aiPathPrefixes?: string[];
7
13
  }
8
14
  /**
9
15
  * Next.js middleware에서 봇 요청을 CloudFront 캐시로 프록시.
10
16
  * 봇이 아니거나 캐시 미스면 null 반환.
17
+ *
18
+ * AI 봇: ai 캐시 → desktop 폴백 → null (origin)
19
+ * 일반 봇: desktop/mobile 캐시 → null (origin)
11
20
  */
12
21
  declare function nextjsProxy(request: Request, options: NextjsProxyOptions): Promise<Response | null>;
13
22
 
@@ -17,13 +26,20 @@ interface CloudflareProxyOptions {
17
26
  siteDomain: string;
18
27
  prerenderDomain: string;
19
28
  botLogEndpoint: string;
29
+ /** AI 렌더 활성화 (기본: true). true면 AI 봇에게 ai 캐시를 우선 서빙 */
30
+ aiRender?: boolean;
31
+ /** OCR 활성화 (기본: true). AI 워밍 요청 시 OCR 포함 여부 */
32
+ ocr?: boolean;
33
+ /** AI 렌더 경로 prefix (빈 배열 = 전체 경로) */
34
+ aiPathPrefixes?: string[];
20
35
  }
21
36
  /**
22
37
  * Cloudflare Worker에서 봇 요청을 KV 캐시로 프록시.
23
38
  * 봇이 아니거나 캐시 미스면 null 반환.
24
39
  *
25
- * env.V2_CACHE에 KV namespace가 바인딩되어 있어야 함.
26
- computeCacheKey*/
40
+ * AI 봇: ai 캐시 desktop 폴백 → null (origin)
41
+ * 일반 봇: desktop/mobile 캐시 → null (origin)
42
+ */
27
43
  declare function cloudflareProxy(request: Request, env: {
28
44
  V2_CACHE?: KVNamespace;
29
45
  [key: string]: unknown;