@inkeep/agents-ui 0.0.0-dev-20260604224102 → 0.0.0-dev-20260604233912

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";var A=Object.create;var w=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var L=(r,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of S(n))!b.call(r,t)&&t!==e&&w(r,t,{get:()=>n[t],enumerable:!(o=P(n,t))||o.enumerable});return r};var C=(r,n,e)=>(e=r!=null?A(O(r)):{},L(n||!r||!r.__esModule?w(e,"default",{value:r,enumerable:!0}):e,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),h="[sentinel]",x=45e3,M=3e4,D=3,I=5,N=250,Y=4e3;let v=null;function F(){return typeof customElements>"u"||customElements.get("altcha-widget")?Promise.resolve():v||(v=import("altcha").then(()=>customElements.whenDefined("altcha-widget")).then(()=>{}).catch(r=>{throw v=null,console.error(h,"failed to load altcha widget module",r),r instanceof Error?r:new Error("Failed to load altcha widget module")}),v)}function k(r){const n=document.createElement("div");n.style.cssText="position:fixed;left:-9999px;top:-9999px;width:0;height:0;overflow:hidden;pointer-events:none",document.body.appendChild(n);const e=document.createElement("altcha-widget");e.setAttribute("challenge",r),e.setAttribute("auto","onload"),e.setAttribute("hidefooter","true"),e.setAttribute("hidelogo","true"),n.appendChild(e);let o=[],t,c="mounted",s=!1,E=!1,u=null,i=null,a=0,m=!1;const R=d=>{const l=o;o=[];for(const p of l)p(d)},g=()=>{s||m||(t=void 0,c="resetting",e.reset?.(),e.verify?.())},_=()=>{u&&clearTimeout(u),u=setTimeout(()=>{u=null,!(!s||m)&&(s=!1,a=0,t=void 0,c="resetting",e.reset?.(),e.verify?.())},M)},y=d=>{const l=d.detail;if(l&&(c=l.state??c,l.state==="verified"&&l.payload&&(E=!0,a=0,t=l.payload,R(l.payload)),l.state==="error"))if(t=void 0,a++,a>=(E?I:D))R(void 0),s=!0,console.warn(h,`Sentinel unavailable after ${a} consecutive errors, requests will proceed without bot protection`),_();else{const T=Math.min(N*2**(a-1),Y);i&&clearTimeout(i),i=setTimeout(()=>{i=null,!(m||s)&&(c="resetting",e.reset?.(),e.verify?.())},T)}};return e.addEventListener("statechange",y),{getPayload:()=>{if(m||s)return Promise.resolve(void 0);if(t){const d=t;return t=void 0,g(),Promise.resolve(d)}return c==="verified"&&g(),new Promise(d=>{o.push(d),setTimeout(()=>{const l=o.indexOf(d);l!==-1&&(o.splice(l,1),d(void 0))},x)})},startNextSolve:g,destroy:()=>{m=!0,e.removeEventListener("statechange",y),u&&(clearTimeout(u),u=null),i&&(clearTimeout(i),i=null),R(void 0),n.remove()}}}const V=({baseUrl:r,appId:n,shouldBypassCaptcha:e=!1})=>{const o=f.useRef(null),t=f.useRef(null),c=f.useRef(!1),s=f.useCallback(()=>o.current?Promise.resolve():t.current?t.current:n?(t.current=F().then(()=>{if(!c.current&&!o.current){const i=`${r}/run/auth/sentinel/challenge?appId=${encodeURIComponent(n)}`;o.current=k(i)}}).catch(i=>{console.error(h,"failed to mount widget",i),t.current=null}),t.current):Promise.resolve(),[r,n]);f.useEffect(()=>{if(c.current=!1,!e)return s(),()=>{c.current=!0,o.current?.destroy(),o.current=null,t.current=null}},[e,s]);const E=f.useCallback(async()=>{if(e)return{};await s();const i=o.current;if(!i)return{};const a=await i.getPayload();return a?{"x-inkeep-challenge-solution":btoa(JSON.stringify({payload:a}))}:{}},[e,s]),u=f.useCallback(()=>{o.current?.startNextSolve()},[]);return{getCaptchaHeader:E,invalidate:u}};exports.useCaptcha=V;
1
+ "use client";"use strict";var A=Object.create;var w=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var L=(r,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of P(n))!O.call(r,t)&&t!==e&&w(r,t,{get:()=>n[t],enumerable:!(o=S(n,t))||o.enumerable});return r};var C=(r,n,e)=>(e=r!=null?A(b(r)):{},L(n||!r||!r.__esModule?w(e,"default",{value:r,enumerable:!0}):e,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),h="[sentinel]",x=45e3,M=3e4,N=3,D=5,F=250,I=4e3;let v=null;function Y(){return typeof customElements>"u"||customElements.get("altcha-widget")?Promise.resolve():v||(v=import("altcha").then(()=>customElements.whenDefined("altcha-widget")).then(()=>{}).catch(r=>{throw v=null,console.error(h,"failed to load altcha widget module",r),r instanceof Error?r:new Error("Failed to load altcha widget module")}),v)}function k(r){const n=document.createElement("div");n.style.cssText="position:fixed;left:-9999px;top:-9999px;width:0;height:0;overflow:hidden;pointer-events:none",document.body.appendChild(n);const e=document.createElement("altcha-widget");e.setAttribute("challenge",r),e.setAttribute("auto","onload"),e.setAttribute("hidefooter","true"),e.setAttribute("hidelogo","true"),e.setAttribute("configuration",JSON.stringify({disableAutoFocus:!0})),n.appendChild(e);let o=[],t,c="mounted",s=!1,E=!1,u=null,i=null,a=0,m=!1;const R=d=>{const l=o;o=[];for(const p of l)p(d)},g=()=>{s||m||(t=void 0,c="resetting",e.reset?.(),e.verify?.())},_=()=>{u&&clearTimeout(u),u=setTimeout(()=>{u=null,!(!s||m)&&(s=!1,a=0,t=void 0,c="resetting",e.reset?.(),e.verify?.())},M)},y=d=>{const l=d.detail;if(l&&(c=l.state??c,l.state==="verified"&&l.payload&&(E=!0,a=0,t=l.payload,R(l.payload)),l.state==="error"))if(t=void 0,a++,a>=(E?D:N))R(void 0),s=!0,console.warn(h,`Sentinel unavailable after ${a} consecutive errors, requests will proceed without bot protection`),_();else{const T=Math.min(F*2**(a-1),I);i&&clearTimeout(i),i=setTimeout(()=>{i=null,!(m||s)&&(c="resetting",e.reset?.(),e.verify?.())},T)}};return e.addEventListener("statechange",y),{getPayload:()=>{if(m||s)return Promise.resolve(void 0);if(t){const d=t;return t=void 0,g(),Promise.resolve(d)}return c==="verified"&&g(),new Promise(d=>{o.push(d),setTimeout(()=>{const l=o.indexOf(d);l!==-1&&(o.splice(l,1),d(void 0))},x)})},startNextSolve:g,destroy:()=>{m=!0,e.removeEventListener("statechange",y),u&&(clearTimeout(u),u=null),i&&(clearTimeout(i),i=null),R(void 0),n.remove()}}}const V=({baseUrl:r,appId:n,shouldBypassCaptcha:e=!1})=>{const o=f.useRef(null),t=f.useRef(null),c=f.useRef(!1),s=f.useCallback(()=>o.current?Promise.resolve():t.current?t.current:n?(t.current=Y().then(()=>{if(!c.current&&!o.current){const i=`${r}/run/auth/sentinel/challenge?appId=${encodeURIComponent(n)}`;o.current=k(i)}}).catch(i=>{console.error(h,"failed to mount widget",i),t.current=null}),t.current):Promise.resolve(),[r,n]);f.useEffect(()=>{if(c.current=!1,!e)return s(),()=>{c.current=!0,o.current?.destroy(),o.current=null,t.current=null}},[e,s]);const E=f.useCallback(async()=>{if(e)return{};await s();const i=o.current;if(!i)return{};const a=await i.getPayload();return a?{"x-inkeep-challenge-solution":btoa(JSON.stringify({payload:a}))}:{}},[e,s]),u=f.useCallback(()=>{o.current?.startNextSolve()},[]);return{getCaptchaHeader:E,invalidate:u}};exports.useCaptcha=V;
@@ -1,24 +1,24 @@
1
1
  "use client";
2
- import { useRef as g, useCallback as h, useEffect as A } from "react";
3
- const y = "[sentinel]", P = 45e3, S = 3e4, O = 3, L = 5, x = 250, b = 4e3;
2
+ import { useRef as R, useCallback as h, useEffect as A } from "react";
3
+ const y = "[sentinel]", P = 45e3, S = 3e4, O = 3, b = 5, L = 250, x = 4e3;
4
4
  let m = null;
5
- function C() {
5
+ function N() {
6
6
  return typeof customElements > "u" || customElements.get("altcha-widget") ? Promise.resolve() : m || (m = import("altcha").then(() => customElements.whenDefined("altcha-widget")).then(() => {
7
7
  }).catch((a) => {
8
8
  throw m = null, console.error(y, "failed to load altcha widget module", a), a instanceof Error ? a : new Error("Failed to load altcha widget module");
9
9
  }), m);
10
10
  }
11
- function D(a) {
11
+ function C(a) {
12
12
  const d = document.createElement("div");
13
13
  d.style.cssText = "position:fixed;left:-9999px;top:-9999px;width:0;height:0;overflow:hidden;pointer-events:none", document.body.appendChild(d);
14
14
  const e = document.createElement("altcha-widget");
15
- e.setAttribute("challenge", a), e.setAttribute("auto", "onload"), e.setAttribute("hidefooter", "true"), e.setAttribute("hidelogo", "true"), d.appendChild(e);
15
+ e.setAttribute("challenge", a), e.setAttribute("auto", "onload"), e.setAttribute("hidefooter", "true"), e.setAttribute("hidelogo", "true"), e.setAttribute("configuration", JSON.stringify({ disableAutoFocus: !0 })), d.appendChild(e);
16
16
  let n = [], t, l = "mounted", i = !1, E = !1, s = null, r = null, c = 0, f = !1;
17
17
  const v = (u) => {
18
18
  const o = n;
19
19
  n = [];
20
20
  for (const w of o) w(u);
21
- }, R = () => {
21
+ }, g = () => {
22
22
  i || f || (t = void 0, l = "resetting", e.reset?.(), e.verify?.());
23
23
  }, _ = () => {
24
24
  s && clearTimeout(s), s = setTimeout(() => {
@@ -27,15 +27,15 @@ function D(a) {
27
27
  }, p = (u) => {
28
28
  const o = u.detail;
29
29
  if (o && (l = o.state ?? l, o.state === "verified" && o.payload && (E = !0, c = 0, t = o.payload, v(o.payload)), o.state === "error"))
30
- if (t = void 0, c++, c >= (E ? L : O))
30
+ if (t = void 0, c++, c >= (E ? b : O))
31
31
  v(void 0), i = !0, console.warn(
32
32
  y,
33
33
  `Sentinel unavailable after ${c} consecutive errors, requests will proceed without bot protection`
34
34
  ), _();
35
35
  else {
36
36
  const T = Math.min(
37
- x * 2 ** (c - 1),
38
- b
37
+ L * 2 ** (c - 1),
38
+ x
39
39
  );
40
40
  r && clearTimeout(r), r = setTimeout(() => {
41
41
  r = null, !(f || i) && (l = "resetting", e.reset?.(), e.verify?.());
@@ -46,23 +46,23 @@ function D(a) {
46
46
  if (f || i) return Promise.resolve(void 0);
47
47
  if (t) {
48
48
  const u = t;
49
- return t = void 0, R(), Promise.resolve(u);
49
+ return t = void 0, g(), Promise.resolve(u);
50
50
  }
51
- return l === "verified" && R(), new Promise((u) => {
51
+ return l === "verified" && g(), new Promise((u) => {
52
52
  n.push(u), setTimeout(() => {
53
53
  const o = n.indexOf(u);
54
54
  o !== -1 && (n.splice(o, 1), u(void 0));
55
55
  }, P);
56
56
  });
57
- }, startNextSolve: R, destroy: () => {
57
+ }, startNextSolve: g, destroy: () => {
58
58
  f = !0, e.removeEventListener("statechange", p), s && (clearTimeout(s), s = null), r && (clearTimeout(r), r = null), v(void 0), d.remove();
59
59
  } };
60
60
  }
61
- const Y = ({ baseUrl: a, appId: d, shouldBypassCaptcha: e = !1 }) => {
62
- const n = g(null), t = g(null), l = g(!1), i = h(() => n.current ? Promise.resolve() : t.current ? t.current : d ? (t.current = C().then(() => {
61
+ const M = ({ baseUrl: a, appId: d, shouldBypassCaptcha: e = !1 }) => {
62
+ const n = R(null), t = R(null), l = R(!1), i = h(() => n.current ? Promise.resolve() : t.current ? t.current : d ? (t.current = N().then(() => {
63
63
  if (!l.current && !n.current) {
64
64
  const r = `${a}/run/auth/sentinel/challenge?appId=${encodeURIComponent(d)}`;
65
- n.current = D(r);
65
+ n.current = C(r);
66
66
  }
67
67
  }).catch((r) => {
68
68
  console.error(y, "failed to mount widget", r), t.current = null;
@@ -88,5 +88,5 @@ const Y = ({ baseUrl: a, appId: d, shouldBypassCaptcha: e = !1 }) => {
88
88
  return { getCaptchaHeader: E, invalidate: s };
89
89
  };
90
90
  export {
91
- Y as useCaptcha
91
+ M as useCaptcha
92
92
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-ui",
3
- "version": "0.0.0-dev-20260604224102",
3
+ "version": "0.0.0-dev-20260604233912",
4
4
  "description": "",
5
5
  "homepage": "",
6
6
  "repository": {