@inkeep/agents-ui 0.0.0-dev-20260501205503 → 0.0.0-dev-20260501215045
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/primitives/components/embedded-chat/chat-error-helpers.d.ts +2 -4
- package/dist/primitives/components/embedded-chat/use-captcha.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-captcha.d.ts +30 -0
- package/dist/primitives/components/embedded-chat/use-captcha.js +67 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +2 -2
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +2 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +262 -237
- package/dist/primitives/hooks/use-anonymous-session.cjs +1 -1
- package/dist/primitives/hooks/use-anonymous-session.d.ts +3 -1
- package/dist/primitives/hooks/use-anonymous-session.js +56 -51
- package/dist/primitives/hooks/use-conversation-loader.cjs +1 -1
- package/dist/primitives/hooks/use-conversation-loader.d.ts +3 -1
- package/dist/primitives/hooks/use-conversation-loader.js +20 -15
- package/dist/primitives/hooks/use-feedback-api.cjs +1 -1
- package/dist/primitives/hooks/use-feedback-api.d.ts +3 -1
- package/dist/primitives/hooks/use-feedback-api.js +22 -16
- package/dist/primitives/hooks/use-inkeep-api-client.cjs +1 -1
- package/dist/primitives/hooks/use-inkeep-api-client.d.ts +11 -8
- package/dist/primitives/hooks/use-inkeep-api-client.js +64 -36
- package/dist/primitives/providers/chat-history-provider.cjs +1 -1
- package/dist/primitives/providers/chat-history-provider.js +39 -35
- package/dist/primitives/providers/feedback-provider.cjs +1 -1
- package/dist/primitives/providers/feedback-provider.js +35 -26
- package/dist/primitives/providers/root-provider.cjs +1 -1
- package/dist/primitives/providers/root-provider.js +9 -13
- package/dist/primitives/utils/default-settings.cjs +1 -1
- package/dist/primitives/utils/default-settings.d.ts +0 -1
- package/dist/primitives/utils/default-settings.js +5 -6
- package/dist/types/config/ai.d.ts +0 -8
- package/package.json +2 -2
- package/dist/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 +0 -1
- package/dist/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 +0 -160
- package/dist/primitives/providers/botid-initializer.cjs +0 -1
- package/dist/primitives/providers/botid-initializer.d.ts +0 -15
- package/dist/primitives/providers/botid-initializer.js +0 -69
|
@@ -10,11 +10,9 @@ export interface ErrorWithCode extends Error {
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function resolveHttpStatusCode(error: Error): number | null;
|
|
12
12
|
/**
|
|
13
|
-
* Classifies a streaming-transport error as a session auth failure, or null.
|
|
14
|
-
* Bot-protection failures (403) are not retried transparently — they surface
|
|
15
|
-
* to the user as a config error.
|
|
13
|
+
* Classifies a streaming-transport error as a PoW or session auth failure, or null.
|
|
16
14
|
*/
|
|
17
|
-
export declare function resolveStreamingAuthError(error: Error): 'session' | null;
|
|
15
|
+
export declare function resolveStreamingAuthError(error: Error): 'pow' | 'session' | null;
|
|
18
16
|
/**
|
|
19
17
|
* Recoverable errors are input-validation failures where the user can fix
|
|
20
18
|
* their input and retry without clearing the conversation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("altcha-lib"),c=require("react"),x=30*1e3;function b(l){const e=/[?&]expires=(\d+)/.exec(l);return e?Number.parseInt(e[1],10)*1e3:null}const p=async l=>{try{const e=await fetch(l,{method:"GET"});if(!e.ok)throw new Error(`Failed to fetch challenge: ${e.statusText}`);const i=await e.json(),{challenge:u,algorithm:n,salt:r,maxnumber:t}=i,{promise:g}=await w.solveChallenge(u,r,n,t),f=await g||void 0;if(!f)throw new Error("Challenge not solved");return{payload:{number:f.number,...i},expiresAt:b(r)}}catch(e){console.warn("[captcha] Error fetching/solving challenge:",e);return}},m=({baseUrl:l,shouldBypassCaptcha:e=!1,shouldMakeInitialRequest:i=!0})=>{const u=`${l}/run/auth/pow/challenge`,n=c.useRef(null),r=c.useRef(null),t=c.useCallback(()=>{const o=p(u);n.current=o,o.then(a=>{a&&(r.current=a.expiresAt)})},[u]),g=c.useCallback(async()=>{if(e)return{};n.current||t();const o=n.current;n.current=null,t();const a=n.current,h=await o;if(!h){const s=await a;return s?{"x-inkeep-challenge-solution":btoa(JSON.stringify(s.payload))}:{}}if(h.expiresAt!==null&&Date.now()>=h.expiresAt){const s=await a;return s?{"x-inkeep-challenge-solution":btoa(JSON.stringify(s.payload))}:{}}return{"x-inkeep-challenge-solution":btoa(JSON.stringify(h.payload))}},[e,t]),f=c.useCallback(()=>{e||t()},[e,t]);return c.useEffect(()=>{if(!i||e)return;const o=r.current!==null&&Date.now()>=r.current-x;(!n.current||o)&&t()},[i,e,t]),{getCaptchaHeader:g,invalidate:f}};exports.fetchAndSolveChallenge=p;exports.useCaptcha=m;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Payload } from 'altcha-lib/types';
|
|
2
|
+
interface UseCaptchaOptions {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
shouldBypassCaptcha?: boolean;
|
|
5
|
+
shouldMakeInitialRequest?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface SolvedEntry {
|
|
8
|
+
payload: Payload;
|
|
9
|
+
expiresAt: number | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const fetchAndSolveChallenge: (fetchUrl: string) => Promise<SolvedEntry | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* Manages the PoW captcha lifecycle for /run/* API requests.
|
|
14
|
+
*
|
|
15
|
+
* - getCaptchaHeader(): atomically consumes the current pre-fetched challenge,
|
|
16
|
+
* immediately kicks off the next fetch so a fresh solution is always warm, and
|
|
17
|
+
* returns the ready-to-use `{ 'x-inkeep-challenge-solution': '...' }` header
|
|
18
|
+
* (or {} when bypassing or on failure). Checks token expiry and falls back to
|
|
19
|
+
* the already-started pre-fetch if the resolved token is stale.
|
|
20
|
+
*
|
|
21
|
+
* - invalidate(): discards any in-flight solution and starts a fresh fetch.
|
|
22
|
+
* Call this on request errors to recover from a rejected/stale challenge.
|
|
23
|
+
*
|
|
24
|
+
* All hooks are called unconditionally — bypass logic lives inside callbacks.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useCaptcha: ({ baseUrl, shouldBypassCaptcha, shouldMakeInitialRequest, }: UseCaptchaOptions) => {
|
|
27
|
+
getCaptchaHeader: () => Promise<Record<string, string>>;
|
|
28
|
+
invalidate: () => void;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { solveChallenge as m } from "altcha-lib";
|
|
3
|
+
import { useRef as p, useCallback as h, useEffect as x } from "react";
|
|
4
|
+
const w = 30 * 1e3;
|
|
5
|
+
function E(i) {
|
|
6
|
+
const e = /[?&]expires=(\d+)/.exec(i);
|
|
7
|
+
return e ? Number.parseInt(e[1], 10) * 1e3 : null;
|
|
8
|
+
}
|
|
9
|
+
const y = async (i) => {
|
|
10
|
+
try {
|
|
11
|
+
const e = await fetch(i, { method: "GET" });
|
|
12
|
+
if (!e.ok)
|
|
13
|
+
throw new Error(`Failed to fetch challenge: ${e.statusText}`);
|
|
14
|
+
const c = await e.json(), { challenge: s, algorithm: t, salt: r, maxnumber: n } = c, { promise: g } = await m(
|
|
15
|
+
s,
|
|
16
|
+
r,
|
|
17
|
+
t,
|
|
18
|
+
n
|
|
19
|
+
), u = await g || void 0;
|
|
20
|
+
if (!u)
|
|
21
|
+
throw new Error("Challenge not solved");
|
|
22
|
+
return {
|
|
23
|
+
payload: { number: u.number, ...c },
|
|
24
|
+
expiresAt: E(r)
|
|
25
|
+
};
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.warn("[captcha] Error fetching/solving challenge:", e);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}, k = ({
|
|
31
|
+
baseUrl: i,
|
|
32
|
+
shouldBypassCaptcha: e = !1,
|
|
33
|
+
shouldMakeInitialRequest: c = !0
|
|
34
|
+
}) => {
|
|
35
|
+
const s = `${i}/run/auth/pow/challenge`, t = p(null), r = p(null), n = h(() => {
|
|
36
|
+
const o = y(s);
|
|
37
|
+
t.current = o, o.then((l) => {
|
|
38
|
+
l && (r.current = l.expiresAt);
|
|
39
|
+
});
|
|
40
|
+
}, [s]), g = h(async () => {
|
|
41
|
+
if (e) return {};
|
|
42
|
+
t.current || n();
|
|
43
|
+
const o = t.current;
|
|
44
|
+
t.current = null, n();
|
|
45
|
+
const l = t.current, f = await o;
|
|
46
|
+
if (!f) {
|
|
47
|
+
const a = await l;
|
|
48
|
+
return a ? { "x-inkeep-challenge-solution": btoa(JSON.stringify(a.payload)) } : {};
|
|
49
|
+
}
|
|
50
|
+
if (f.expiresAt !== null && Date.now() >= f.expiresAt) {
|
|
51
|
+
const a = await l;
|
|
52
|
+
return a ? { "x-inkeep-challenge-solution": btoa(JSON.stringify(a.payload)) } : {};
|
|
53
|
+
}
|
|
54
|
+
return { "x-inkeep-challenge-solution": btoa(JSON.stringify(f.payload)) };
|
|
55
|
+
}, [e, n]), u = h(() => {
|
|
56
|
+
e || n();
|
|
57
|
+
}, [e, n]);
|
|
58
|
+
return x(() => {
|
|
59
|
+
if (!c || e) return;
|
|
60
|
+
const o = r.current !== null && Date.now() >= r.current - w;
|
|
61
|
+
(!t.current || o) && n();
|
|
62
|
+
}, [c, e, n]), { getCaptchaHeader: g, invalidate: u };
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
y as fetchAndSolveChallenge,
|
|
66
|
+
k as useCaptcha
|
|
67
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`)??"";t.useEffect(()=>{
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("@ai-sdk/react"),we=require("./file-upload-input.cjs"),tt=require("ai"),t=require("react"),st=require("../modal/modal-provider.cjs"),rt=require("../../providers/chat-bubble-provider.cjs"),nt=require("../../providers/sidebar-chat-provider.cjs"),at=require("../../providers/config-provider.cjs"),ot=require("./use-captcha.cjs"),it=require("../../hooks/use-media-query.cjs"),ut=require("../../hooks/use-anonymous-session.cjs"),ct=require("../../hooks/use-auth-token.cjs"),lt=require("../../hooks/use-conversation-loader.cjs"),dt=require("../../hooks/use-initial-conversation.cjs"),D=require("../../utils/generate-uid.cjs"),pt=require("../../providers/base-events-provider.cjs"),ft=require("../../providers/chat-form-provider.cjs"),gt=require("../../providers/widget-provider.cjs"),ht=require("@radix-ui/react-use-controllable-state"),mt=require("../../hooks/use-streaming-events.cjs"),vt=require("../../hooks/use-input-notification.cjs"),p=require("./chat-error-helpers.cjs"),yt=()=>{const{baseSettings:U,aiChatSettings:R}=at.useInkeepConfig(),[u="",m]=ht.useControllableState({prop:R.conversationIdOverride,defaultProp:R.conversationIdOverride??""}),ke=st.useModal(),Me=rt.useOptionalChatBubble(),Fe=nt.useOptionalSidebarChat(),{logEvent:h}=pt.useBaseEvents(),{setConversationId:_e,emitToParent:_}=mt.useStreamingEvents(),ae=t.useRef(u);t.useEffect(()=>{const e=ae.current;ae.current=u,e!==u&&h({eventName:"chat_conversation_changed",properties:{conversationId:u,previousConversationId:e}})},[u,h]);const[C,S]=t.useState(""),qe=e=>S(e.target.value),{shouldBypassCaptcha:oe,filters:ie,privacyPreferences:xe,userProperties:B}=U,{authToken:q,isLoading:Oe,refreshToken:ue}=ct.useAuthToken(),ce=!!U.getAuthToken,f=!!q,{onInputMessageChange:Pe,filters:le,baseUrl:x,agentUrl:Le,context:de,headers:pe,appId:E,apiKey:v,files:A}=R,Ne=ke?.isOpen??Me?.isOpen??Fe?.isOpen??!0,{getCaptchaHeader:b,invalidate:l}=ot.useCaptcha({baseUrl:x,shouldBypassCaptcha:oe||!!v,shouldMakeInitialRequest:Ne}),fe=t.useRef(b);fe.current=b;const ge=Le||`${x}/run/api/chat`,{sessionToken:$,refreshSession:z}=ut.useAnonymousSession({baseUrl:x,appId:E,getCaptchaHeader:b,invalidateCaptcha:l,optOutAllAnalytics:xe?.optOutAllAnalytics,enabled:!f&&!Oe}),he=v??(f?q:$),{loadConversation:me}=lt.useConversationLoader({baseUrl:x,appId:E,authToken:he,getCaptchaHeader:b,invalidateCaptcha:l,refreshSession:v||f?void 0:z}),[De,ve]=t.useState(!1),G=t.useRef(null);G.current=$;const H=t.useRef(null);H.current=q;const K=t.useRef(void 0);K.current=B&&Object.keys(B).length>0?JSON.stringify(B):void 0;const y=t.useRef(0),V=t.useRef(null),j=t.useRef(null),I=t.useRef(void 0),Ue=A?.map(e=>`${e.filename??""}:${e.mediaType}:${e.url.length}:${e.url.slice(0,64)}:${e.url.slice(-32)}`).join(`
|
|
2
|
+
`)??"";t.useEffect(()=>{I.current=A?.length?A:void 0},[Ue]);const ye=t.useRef(pe);ye.current=pe;const J=t.useRef(void 0);J.current=ie||le?JSON.stringify({...ie,...le}):void 0;const Be=e=>{switch(p.resolveHttpStatusCode(e)){case 400:try{const s=JSON.parse(e.message??"");return s.detail??s.error?.message??p.RECOVERABLE_FALLBACK_MESSAGE}catch{return e.message?.trim()||p.RECOVERABLE_FALLBACK_MESSAGE}case 401:return ce?"Authentication failed. Please try again.":p.DEFAULT_ERROR_MESSAGE;case 403:return`There seems to be a configuration error. Please contact ${U.organizationDisplayName??"Administrator"}`;case 429:return p.RATE_LIMIT_MESSAGE;default:return p.DEFAULT_ERROR_MESSAGE}},[O,Q]=t.useState([]),$e=t.useMemo(()=>new tt.DefaultChatTransport({api:ge,headers:()=>{const e=v??H.current??G.current;return{"x-inkeep-client-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone,"x-inkeep-client-timestamp":new Date().toISOString(),"x-inkeep-invocation-type":"chat_widget",...E?{"x-inkeep-app-id":E}:{},...e?{Authorization:`Bearer ${e}`}:{},...J.current?{"inkeep-filters":J.current}:{},...K.current?{"x-inkeep-user-properties":K.current}:{},...ye.current}},prepareSendMessagesRequest:async e=>{const i=await fe.current(),s=e.messages[e.messages.length-1];return s||console.warn("[useInkeepChat] prepareSendMessagesRequest called with empty messages array"),{body:{...e.body,id:e.id,messages:s?[s]:[],trigger:e.trigger,messageId:e.messageId},headers:{...e.headers,...i}}},body:{requestContext:de}}),[ge,de,E,v]),{messages:P,sendMessage:W,addToolApprovalResponse:Z,status:Re,setMessages:g,stop:L,error:N}=et.useChat({transport:$e,onData(e){_(e.type,e.data)},async onFinish(){_("completion",{conversationId:u}),await h({eventName:"assistant_message_received",properties:{conversationId:u}}),h({eventName:"assistant_answer_displayed",properties:{conversationId:u}})},onError(e){console.error("onError",{code:e.code,message:e.message});const i=oe||v?null:p.resolveStreamingAuthError(e);if(i!==null&&y.current<1){y.current++;const a=j.current,r=V.current;(async()=>{if(i==="session"&&ce){const c=await ue();if(!c)throw new Error("Auth token refresh failed");H.current=c}else if(i==="session"){const c=await z();c&&(G.current=c)}else l();if(a){Z(a);return}r&&(g(c=>{let n=[...c];return n.at(-1)?.role==="assistant"&&(n=n.slice(0,-1)),n.at(-1)?.role==="user"&&(n=n.slice(0,-1)),n}),W(r.files?.length?{parts:[{type:"text",text:r.content},...r.files]}:{text:r.content},{body:r.body}))})().catch(()=>{y.current=0,l(),g(c=>{const n=[...c],k=n[n.length-1];if(!k)return n;const M=p.DEFAULT_ERROR_MESSAGE;return k.role==="user"?n.push({id:D.generateUid(16),role:"assistant",parts:[{type:"text",text:M}]}):k.parts=[{type:"text",text:M}],n})});return}y.current=0,i!==null&&l();const s=p.isRecoverableError(e),d=Be(e);if(h({eventName:"chat_error",properties:{conversationId:u,error:e.message}}),s){se({title:"Request failed",message:d},p.RECOVERABLE_NOTIFICATION_DURATION_MS),g(r=>{let o=[...r];return o.at(-1)?.role==="assistant"&&(o=o.slice(0,-1)),o.at(-1)?.role==="user"&&(o=o.slice(0,-1)),o});const a=V.current?.content;a&&S(a),te.current=e;return}g(a=>{const r=[...a],o=r[r.length-1];return o&&(o.role==="user"?r.push({id:D.generateUid(16),role:"assistant",parts:[{type:"text",text:d}]}):o.parts=[{type:"text",text:d}]),r})}}),Ce=t.useRef(f);t.useEffect(()=>{const e=Ce.current;Ce.current=f,e!==f&&(L(),T(null),g([]),m(""),S(""),Q([]),l())},[f,L,g,m,l]);const Se=Re==="submitted",X=Re==="streaming",ze=t.useMemo(()=>{const e=a=>{if(!a||typeof a!="object")return!1;const r=a;return typeof r.type=="string"&&r.type.startsWith("tool-")},s=[...P??[]].reverse().find(a=>a.role==="assistant");if(!s)return!1;const d=s.parts?.at(-1);return!(!e(d)||d.state!=="output-available"||!d.approval?.id||X)},[P,X]),[Ge,Y]=t.useState(!1),Ee=X||ze&&!Ge,Ae=Se||Ee,He=P.length===0,ee=!C.trim()&&O.length===0||Ae,Ke=it.useMediaQuery("(max-width: 768px)"),[Ve,T]=t.useState(null),te=t.useRef(null);t.useEffect(()=>{if(N){if(te.current===N){te.current=null;return}T(N)}},[N]);const je=()=>T(null),{inputNotification:Je,showInputNotification:se,clearInputNotification:Qe}=vt.useInputNotification(),be=t.useRef(null);t.useEffect(()=>{Pe?.(C)},[C]);const We=e=>{e.key==="Enter"&&!e.shiftKey&&!ee&&!e.nativeEvent.isComposing&&(e.preventDefault(),re())},re=async(e=C)=>{if(ee&&(!e||e.trim().length===0)&&O.length===0)return;const i=O;Q([]),S(""),y.current=0,j.current=null,Y(!1),await h({eventName:"user_message_submitted",properties:{conversationId:u}});let s=u;s||(s=`conv_${D.generateUid(16)}`,m(s)),_e(s);const d=I.current;I.current=void 0;let a,r;if(d?.length){let o;try{o=await Promise.all(i.map(c=>{const n=we.normalizeFileType(c);return new Promise((k,M)=>{const F=new FileReader;F.onload=()=>{if(typeof F.result!="string"){M(new Error(`Failed to read file "${n.name}"`));return}k({type:"file",url:F.result,mediaType:n.type,filename:n.name})},F.onerror=()=>M(new Error(`Failed to read file "${n.name}"`)),F.readAsDataURL(n)})}))}catch{se({title:"Failed to attach files",message:"Could not read one or more files. Please try again."});return}r=[...o,...d],a=e.trim()?{parts:[{type:"text",text:e},...r]}:{parts:r}}else if(i.length>0){const o=new DataTransfer;for(const n of i)o.items.add(we.normalizeFileType(n));const c=o.files;a=e.trim()?{text:e,files:c}:{files:c}}else a={text:e};V.current={content:e,body:{conversationId:s},files:r},W(a,{body:{conversationId:s}})},Ze=t.useCallback(e=>{y.current=0,j.current=e,Y(!1),Z(e)},[Z]),ne=t.useCallback(()=>{Y(!0),L().then(()=>{_("aborted",{conversationId:u})})},[L,u,_]),Ie=()=>{je(),g([]),m(""),l(),I.current=A?.length?A:void 0,h({eventName:"chat_clear_button_clicked",properties:{conversationId:u}})},w=t.useCallback((e,i)=>{T(null),g(i),m(e),l(),I.current=void 0},[g,m,l]),Te=t.useCallback(async(e,i)=>{ne(),w(e,[]),ve(!0);try{const s=await me(e,i);if(s===null)return!1;const a=s[s.length-1]?.role==="user"?[...s,{id:D.generateUid(16),role:"assistant",parts:[{type:"text",text:"This session was interrupted. Please check back in a few minutes or start a new conversation."}]}]:s;return w(e,a),!0}finally{i?.aborted||ve(!1)}},[w,me,ne]);dt.useInitialConversation({conversationId:R.conversationId,effectiveAuthToken:he,loadAndRestoreSession:Te,onLoadFailed:()=>w("",[])});const{openForm:Xe}=ft.useChatForm(),Ye=gt.useWidget();return t.useImperativeHandle(R.chatFunctionsRef,()=>({submitMessage:re,updateInputMessage(e){S(e)},clearChat:Ie,openForm:e=>{Ye?.setView("chat"),Xe(e,void 0)},focusInput:()=>{be.current?.focus()}})),{messages:P,sendMessage:W,addToolApprovalResponse:Ze,isLoading:Se,isStreaming:Ee,isBusy:Ae,error:Ve,setError:T,isSubmitDisabled:ee,input:C,handleInputChange:qe,handleInputKeyDown:We,handleSubmit:re,stop:ne,clear:Ie,inputRef:be,isMobile:Ke,files:O,setFiles:Q,isNewChat:He,conversationId:u,restoreSession:w,loadAndRestoreSession:Te,isSessionLoading:De,authToken:f?q:$,refreshSession:f?ue:z,getCaptchaHeader:b,invalidateCaptcha:l,inputNotification:Je,showInputNotification:se,clearInputNotification:Qe}};exports.useInkeepChat=yt;
|
|
@@ -50,6 +50,8 @@ export declare const useInkeepChat: () => {
|
|
|
50
50
|
isSessionLoading: boolean;
|
|
51
51
|
authToken: string | null;
|
|
52
52
|
refreshSession: () => Promise<string | null>;
|
|
53
|
+
getCaptchaHeader: () => Promise<Record<string, string>>;
|
|
54
|
+
invalidateCaptcha: () => void;
|
|
53
55
|
inputNotification: InputNotification | null;
|
|
54
56
|
showInputNotification: (n: InputNotification, durationMs?: number) => void;
|
|
55
57
|
clearInputNotification: () => void;
|