@inkeep/agents-ui 0.0.0-dev-20260501170253 → 0.0.0-dev-20260501195414

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.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),d=require("../../node_modules/.pnpm/botid@1.5.11_next@16.2.4_@babel_core@7.29.0_@opentelemetry_api@1.9.1_react-dom@19.3.0-c_6ac35f5bf61166da3243b6cf36e09c95/node_modules/botid/dist/client/core/index.cjs"),l=require("./config-provider.cjs");function f(){const{baseSettings:s,aiChatSettings:c}=l.useInkeepConfig(),{shouldBypassCaptcha:t}=s,{baseUrl:n,apiKey:i,botProtectionLevel:r}=c,o=a.useRef(!1);return a.useEffect(()=>{if(o.current||t||i||!n)return;const e={checkLevel:r};try{d.initBotId({protect:[{path:"/run/auth/apps/*/anonymous-session",method:"POST",advancedOptions:e},{path:"/run/api/chat",method:"POST",advancedOptions:e},{path:"/run/v1/feedback",method:"POST",advancedOptions:e}]}),o.current=!0}catch(u){console.warn("[botid] initBotId failed",u)}},[n,i,t,r]),null}exports.BotIdInitializer=f;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),w=require("../../node_modules/.pnpm/botid@1.5.11_next@16.2.4_@babel_core@7.29.0_@opentelemetry_api@1.9.1_react-dom@19.3.0-c_6ac35f5bf61166da3243b6cf36e09c95/node_modules/botid/dist/client/core/index.cjs"),I=require("./config-provider.cjs");function _(){const{baseSettings:f,aiChatSettings:b}=I.useInkeepConfig(),{shouldBypassCaptcha:l}=f,{baseUrl:t,apiKey:d,botProtectionLevel:u}=b,h=g.useRef(!1);return g.useEffect(()=>{if(h.current||l||d||!t)return;if(typeof window<"u"&&!window.__INKEEP_FETCH_DEBUG__){window.__INKEEP_FETCH_DEBUG__=!0;const i=window.fetch;window.fetch=async function(e,s){let r;typeof e=="string"?r=e:e instanceof URL?r=e.toString():r=e.url;try{const o=new URL(r,location.href);if(o.pathname.startsWith("/run/")){const a=new Headers(s?.headers??(e instanceof Request?e.headers:void 0)),m=s?.method??(e instanceof Request?e.method:"GET");console.log("[botid-debug] fetch →",{url:o.toString(),method:m,locationOrigin:location.origin,targetOrigin:o.origin,sameOrigin:o.origin===location.origin,hasXIsHuman:a.has("x-is-human"),xIsHumanLength:a.get("x-is-human")?.length??null,xPath:a.get("x-path"),xMethod:a.get("x-method")});const c=await i.call(this,e,s);return console.log("[botid-debug] fetch ←",{url:o.toString(),status:c.status,statusText:c.statusText}),c}}catch{}return i.call(this,e,s)}}const n={checkLevel:u};try{console.log("[botid-debug] calling initBotId",{baseUrl:t,advancedOptions:n}),w.initBotId({protect:[{path:`${t}/run/auth/apps/*/anonymous-session`,method:"POST",advancedOptions:n},{path:`${t}/run/api/chat`,method:"POST",advancedOptions:n},{path:`${t}/run/v1/feedback`,method:"POST",advancedOptions:n}]}),h.current=!0,console.log("[botid-debug] initBotId returned successfully")}catch(i){console.warn("[botid-debug] initBotId threw",i)}},[t,d,l,u]),null}exports.BotIdInitializer=_;
@@ -1,29 +1,64 @@
1
1
  "use client";
2
- import { useRef as u, useEffect as p } from "react";
3
- import { initBotId as f } from "../../node_modules/.pnpm/botid@1.5.11_next@16.2.4_@babel_core@7.29.0_@opentelemetry_api@1.9.1_react-dom@19.3.0-c_6ac35f5bf61166da3243b6cf36e09c95/node_modules/botid/dist/client/core/index.js";
4
- import { useInkeepConfig as h } from "./config-provider.js";
5
- function I() {
6
- const { baseSettings: a, aiChatSettings: s } = h(), { shouldBypassCaptcha: e } = a, { baseUrl: n, apiKey: o, botProtectionLevel: r } = s, i = u(!1);
7
- return p(() => {
8
- if (i.current || e || o || !n) return;
9
- const t = { checkLevel: r };
2
+ import { useRef as w, useEffect as b } from "react";
3
+ import { initBotId as I } from "../../node_modules/.pnpm/botid@1.5.11_next@16.2.4_@babel_core@7.29.0_@opentelemetry_api@1.9.1_react-dom@19.3.0-c_6ac35f5bf61166da3243b6cf36e09c95/node_modules/botid/dist/client/core/index.js";
4
+ import { useInkeepConfig as _ } from "./config-provider.js";
5
+ function B() {
6
+ const { baseSettings: f, aiChatSettings: g } = _(), { shouldBypassCaptcha: l } = f, { baseUrl: e, apiKey: h, botProtectionLevel: d } = g, u = w(!1);
7
+ return b(() => {
8
+ if (u.current || l || h || !e) return;
9
+ if (typeof window < "u" && !window.__INKEEP_FETCH_DEBUG__) {
10
+ window.__INKEEP_FETCH_DEBUG__ = !0;
11
+ const s = window.fetch;
12
+ window.fetch = async function(t, i) {
13
+ let r;
14
+ typeof t == "string" ? r = t : t instanceof URL ? r = t.toString() : r = t.url;
15
+ try {
16
+ const o = new URL(r, location.href);
17
+ if (o.pathname.startsWith("/run/")) {
18
+ const a = new Headers(
19
+ i?.headers ?? (t instanceof Request ? t.headers : void 0)
20
+ ), m = i?.method ?? (t instanceof Request ? t.method : "GET");
21
+ console.log("[botid-debug] fetch →", {
22
+ url: o.toString(),
23
+ method: m,
24
+ locationOrigin: location.origin,
25
+ targetOrigin: o.origin,
26
+ sameOrigin: o.origin === location.origin,
27
+ hasXIsHuman: a.has("x-is-human"),
28
+ xIsHumanLength: a.get("x-is-human")?.length ?? null,
29
+ xPath: a.get("x-path"),
30
+ xMethod: a.get("x-method")
31
+ });
32
+ const c = await s.call(this, t, i);
33
+ return console.log("[botid-debug] fetch ←", {
34
+ url: o.toString(),
35
+ status: c.status,
36
+ statusText: c.statusText
37
+ }), c;
38
+ }
39
+ } catch {
40
+ }
41
+ return s.call(this, t, i);
42
+ };
43
+ }
44
+ const n = { checkLevel: d };
10
45
  try {
11
- f({
46
+ console.log("[botid-debug] calling initBotId", { baseUrl: e, advancedOptions: n }), I({
12
47
  protect: [
13
48
  {
14
- path: "/run/auth/apps/*/anonymous-session",
49
+ path: `${e}/run/auth/apps/*/anonymous-session`,
15
50
  method: "POST",
16
- advancedOptions: t
51
+ advancedOptions: n
17
52
  },
18
- { path: "/run/api/chat", method: "POST", advancedOptions: t },
19
- { path: "/run/v1/feedback", method: "POST", advancedOptions: t }
53
+ { path: `${e}/run/api/chat`, method: "POST", advancedOptions: n },
54
+ { path: `${e}/run/v1/feedback`, method: "POST", advancedOptions: n }
20
55
  ]
21
- }), i.current = !0;
22
- } catch (c) {
23
- console.warn("[botid] initBotId failed", c);
56
+ }), u.current = !0, console.log("[botid-debug] initBotId returned successfully");
57
+ } catch (s) {
58
+ console.warn("[botid-debug] initBotId threw", s);
24
59
  }
25
- }, [n, o, e, r]), null;
60
+ }, [e, h, l, d]), null;
26
61
  }
27
62
  export {
28
- I as BotIdInitializer
63
+ B as BotIdInitializer
29
64
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-ui",
3
- "version": "0.0.0-dev-20260501170253",
3
+ "version": "0.0.0-dev-20260501195414",
4
4
  "description": "",
5
5
  "homepage": "",
6
6
  "repository": {