@useago/sdk 1.13.2 → 1.13.3
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/CHANGELOG.md +18 -0
- package/dist/angular.d.cts +14 -4
- package/dist/angular.d.ts +14 -4
- package/dist/{createFormCollector-ki_GTlp9.js → createFormCollector-D6_N8wYq.js} +48 -46
- package/dist/createFormCollector-D_5SDuk9.cjs +1 -0
- package/dist/devtools.d.cts +14 -4
- package/dist/devtools.d.ts +14 -4
- package/dist/helpers.d.cts +9 -4
- package/dist/helpers.d.ts +9 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.js +39 -35
- package/dist/react.cjs +1 -1
- package/dist/react.d.cts +14 -4
- package/dist/react.d.ts +14 -4
- package/dist/react.js +1 -1
- package/dist/testing.d.cts +14 -4
- package/dist/testing.d.ts +14 -4
- package/dist/vue.d.cts +14 -4
- package/dist/vue.d.ts +14 -4
- package/dist/widget.cjs +6 -6
- package/dist/widget.d.cts +19 -4
- package/dist/widget.d.ts +19 -4
- package/dist/widget.js +886 -886
- package/llms-full.txt +20 -1
- package/package.json +1 -1
- package/dist/createFormCollector-Cq7HWjtU.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as w, c as E, d as
|
|
2
|
-
import { C as D, S as L, _ as O, b as
|
|
1
|
+
import { a as w, c as E, d as S, f as C, i as y, l as b, m as F, o as v, p as _, r as M, s as T, t as R, u as I } from "./functions-tzyOZNp6.js";
|
|
2
|
+
import { C as D, S as L, _ as O, b as N, c as k, d as G, f as x, g as q, h as P, i as X, l as B, m as H, n as c, o as J, p as W, r as j, s as z, t as K, u as V, v as Y, w as $, x as Q, y as Z } from "./types-D1ZrqVhr.js";
|
|
3
3
|
import { a as te, i as oe, n as p, r as ae, t as re } from "./errors-BLfjXnLB.js";
|
|
4
4
|
import { t as se } from "./autoContinue-Cb4_iEbO.js";
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as me, r as fe, t as
|
|
5
|
+
import { t as ue } from "./createConversationSession-DrmOaZdO.js";
|
|
6
|
+
import { n as me, r as fe, t as de } from "./createFormCollector-D6_N8wYq.js";
|
|
7
7
|
import { t as ce } from "./createMockClient-YoYr3pQr.js";
|
|
8
8
|
import "./testing.js";
|
|
9
9
|
function Ae(e) {
|
|
@@ -18,10 +18,10 @@ function we(e, t) {
|
|
|
18
18
|
function Ee(e, t) {
|
|
19
19
|
return e.on("message:start", t), () => e.off("message:start", t);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Se(e, t) {
|
|
22
22
|
return e.on("message:error", t), () => e.off("message:error", t);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Ce(e, t) {
|
|
25
25
|
return e.on("toolCall:received", t), () => e.off("toolCall:received", t);
|
|
26
26
|
}
|
|
27
27
|
function ye(e, t) {
|
|
@@ -33,34 +33,34 @@ function be(e, t) {
|
|
|
33
33
|
function Fe(e, t) {
|
|
34
34
|
return e.on("function:invoke", t), () => e.off("function:invoke", t);
|
|
35
35
|
}
|
|
36
|
-
async function* ve(e, t,
|
|
36
|
+
async function* ve(e, t, u) {
|
|
37
37
|
const n = [];
|
|
38
38
|
let a = null, r = !1;
|
|
39
|
-
const
|
|
39
|
+
const g = (s) => {
|
|
40
40
|
n.push(s), a?.();
|
|
41
|
-
}, m = (s) =>
|
|
41
|
+
}, m = (s) => g({
|
|
42
42
|
type: "start",
|
|
43
43
|
data: s
|
|
44
|
-
}), f = (s) =>
|
|
44
|
+
}), f = (s) => g({
|
|
45
45
|
type: "chunk",
|
|
46
46
|
data: s
|
|
47
47
|
}), o = (s) => {
|
|
48
|
-
|
|
48
|
+
g({
|
|
49
49
|
type: "complete",
|
|
50
50
|
data: s
|
|
51
51
|
}), r = !0, a?.();
|
|
52
52
|
}, i = (s) => {
|
|
53
|
-
|
|
53
|
+
g({
|
|
54
54
|
type: "error",
|
|
55
55
|
data: s
|
|
56
56
|
}), r = !0, a?.();
|
|
57
|
-
},
|
|
57
|
+
}, d = (s) => g({
|
|
58
58
|
type: "toolCall",
|
|
59
59
|
data: s
|
|
60
|
-
}),
|
|
60
|
+
}), l = () => {
|
|
61
61
|
r = !0, a?.();
|
|
62
62
|
};
|
|
63
|
-
e.on("message:start", m), e.on("message:chunk", f), e.on("message:complete", o), e.on("message:error", i), e.on("message:stopped",
|
|
63
|
+
e.on("message:start", m), e.on("message:chunk", f), e.on("message:complete", o), e.on("message:error", i), e.on("message:stopped", l), e.on("toolCall:received", d), e.sendMessage(t, u).catch(() => {
|
|
64
64
|
r = !0, a?.();
|
|
65
65
|
});
|
|
66
66
|
try {
|
|
@@ -68,44 +68,47 @@ async function* ve(e, t, g) {
|
|
|
68
68
|
a = s;
|
|
69
69
|
}), a = null);
|
|
70
70
|
} finally {
|
|
71
|
-
e.off("message:start", m), e.off("message:chunk", f), e.off("message:complete", o), e.off("message:error", i), e.off("message:stopped",
|
|
71
|
+
e.off("message:start", m), e.off("message:chunk", f), e.off("message:complete", o), e.off("message:error", i), e.off("message:stopped", l), e.off("toolCall:received", d);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
function _e(e, t) {
|
|
75
|
+
return e.on("form:submitting", t), () => e.off("form:submitting", t);
|
|
76
|
+
}
|
|
74
77
|
function A(e) {
|
|
75
|
-
let t,
|
|
78
|
+
let t, u, n, a, r, g, m;
|
|
76
79
|
if (typeof window < "u" && window.AGO) {
|
|
77
80
|
const o = window.AGO;
|
|
78
|
-
t = o.basepath,
|
|
81
|
+
t = o.basepath, u = o.widgetId, n = o.agent || o.defaultAgent, a = o.permission, r = o.email, g = o.jwt, m = o.metadata;
|
|
79
82
|
}
|
|
80
83
|
if (typeof document < "u") {
|
|
81
84
|
const o = (i) => document.querySelector(`meta[name="${i}"]`)?.getAttribute("content") || void 0;
|
|
82
|
-
t = t || o("ago-base-url"),
|
|
85
|
+
t = t || o("ago-base-url"), u = u || o("ago-widget-id"), n = n || o("ago-agent") || o("ago-agent-id"), a = a || o("ago-permission"), r = r || o("ago-user-email");
|
|
83
86
|
}
|
|
84
87
|
if (typeof document < "u") {
|
|
85
88
|
const o = [document.body, ...Array.from(document.querySelectorAll("script[data-ago-base-url]"))].filter(Boolean);
|
|
86
89
|
for (const i of o)
|
|
87
|
-
i && (t = t || i.getAttribute("data-ago-base-url") || void 0,
|
|
90
|
+
i && (t = t || i.getAttribute("data-ago-base-url") || void 0, u = u || i.getAttribute("data-ago-widget-id") || void 0, n = n || i.getAttribute("data-ago-agent") || i.getAttribute("data-ago-agent-id") || void 0, a = a || i.getAttribute("data-ago-permission") || void 0, r = r || i.getAttribute("data-ago-user-email") || void 0);
|
|
88
91
|
}
|
|
89
|
-
t = e?.baseUrl || t,
|
|
92
|
+
t = e?.baseUrl || t, u = e?.widgetId || u, n = e?.agent || e?.defaultAgentId || n, a = e?.permission || a, r = e?.userEmail || r, g = e?.userJwt || g, e?.metadata !== void 0 && (m = e.metadata);
|
|
90
93
|
const f = e?.debug;
|
|
91
94
|
return t ? {
|
|
92
95
|
baseUrl: t,
|
|
93
|
-
widgetId:
|
|
96
|
+
widgetId: u,
|
|
94
97
|
agent: n,
|
|
95
98
|
permission: a,
|
|
96
99
|
language: e?.language,
|
|
97
100
|
userEmail: r,
|
|
98
|
-
userJwt:
|
|
101
|
+
userJwt: g,
|
|
99
102
|
metadata: m,
|
|
100
103
|
debug: f
|
|
101
104
|
} : null;
|
|
102
105
|
}
|
|
103
|
-
function
|
|
106
|
+
function Me(e) {
|
|
104
107
|
const t = A(e);
|
|
105
108
|
if (!t) throw new p('createAgo(): could not detect AGO configuration. Set window.AGO, add <meta name="ago-base-url">, or pass { baseUrl } explicitly.', "config_missing_base_url");
|
|
106
109
|
return new c(t);
|
|
107
110
|
}
|
|
108
|
-
function
|
|
111
|
+
function Te(e, t) {
|
|
109
112
|
return {
|
|
110
113
|
...e,
|
|
111
114
|
handler: t
|
|
@@ -122,7 +125,7 @@ export {
|
|
|
122
125
|
G as ClientContextRegistry,
|
|
123
126
|
$ as DEFAULT_MAX_ACTIVITY_ENTRIES,
|
|
124
127
|
Z as DEFAULT_MAX_ERRORS,
|
|
125
|
-
|
|
128
|
+
N as DEFAULT_MAX_ERROR_AGE_MS,
|
|
126
129
|
Q as ErrorWatcher,
|
|
127
130
|
X as EventEmitter,
|
|
128
131
|
K as FEEDBACK_REASONS,
|
|
@@ -133,10 +136,10 @@ export {
|
|
|
133
136
|
A as autoDetectConfig,
|
|
134
137
|
J as canInlineImage,
|
|
135
138
|
R as copyToClipboard,
|
|
136
|
-
|
|
139
|
+
Me as createAgo,
|
|
137
140
|
x as createAgoProactive,
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
ue as createConversationSession,
|
|
142
|
+
de as createFormCollector,
|
|
140
143
|
ve as createMessageStream,
|
|
141
144
|
ce as createMockClient,
|
|
142
145
|
q as createStore,
|
|
@@ -153,23 +156,24 @@ export {
|
|
|
153
156
|
H as matchesWhen,
|
|
154
157
|
be as onFormError,
|
|
155
158
|
ye as onFormSubmitted,
|
|
159
|
+
_e as onFormSubmitting,
|
|
156
160
|
Fe as onFunctionInvoke,
|
|
157
161
|
he as onMessage,
|
|
158
162
|
we as onMessageChunk,
|
|
159
|
-
|
|
163
|
+
Se as onMessageError,
|
|
160
164
|
Ee as onMessageStart,
|
|
161
|
-
|
|
165
|
+
Ce as onToolCall,
|
|
162
166
|
v as openUrl,
|
|
163
167
|
P as partialDeepMatch,
|
|
164
|
-
|
|
168
|
+
k as safeAttachmentUrl,
|
|
165
169
|
T as scrollToElement,
|
|
166
170
|
E as setLocalStorage,
|
|
167
171
|
b as setTheme,
|
|
168
172
|
I as showConfirmDialog,
|
|
169
|
-
|
|
170
|
-
|
|
173
|
+
S as showNotification,
|
|
174
|
+
C as showToast,
|
|
171
175
|
_ as submitForm,
|
|
172
176
|
F as trackEvent,
|
|
173
177
|
j as validateConfig,
|
|
174
|
-
|
|
178
|
+
Te as withHandler
|
|
175
179
|
};
|
package/dist/react.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var $e=Object.create,Y=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,Ue=Object.getOwnPropertyNames,Ge=Object.getPrototypeOf,Je=Object.prototype.hasOwnProperty,Ve=(e,r)=>{let t={};for(var s in e)Y(t,s,{get:e[s],enumerable:!0});return r||Y(t,Symbol.toStringTag,{value:"Module"}),t},Xe=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(var o=Ue(r),l=0,c=o.length,i;l<c;l++)i=o[l],!Je.call(e,i)&&i!==t&&Y(e,i,{get:(x=>r[x]).bind(null,i),enumerable:!(s=Ke(r,i))||s.enumerable});return e},oe=(e,r,t)=>(t=e!=null?$e(Ge(e)):{},Xe(r||!e||!e.__esModule?Y(t,"default",{value:e,enumerable:!0}):t,e));const L=require("./types-DNr6XEwI.cjs"),Z=require("./errors-o1IB5fEu.cjs"),Ye=require("./autoContinue-C3UsCvT5.cjs"),z=require("./createFormCollector-Cq7HWjtU.cjs"),Ze=require("./createMockClient-BPt1gSve.cjs"),G=require("./speechToText-ZciRyyJE.cjs");let n=require("react");n=oe(n,1);let a=require("react/jsx-runtime"),te=require("react-markdown");te=oe(te,1);let ne=require("remark-gfm");ne=oe(ne,1);function ye(e){const[r,t]=(0,n.useState)(!1),s=(0,n.useRef)(null),o=(0,n.useMemo)(()=>{if(s.current&&(s.current.destroy(),s.current=null),!e)return null;const l=new L.AgoClient(e);return s.current=l,l},[e?.baseUrl,e?.widgetId]);return(0,n.useEffect)(()=>(o&&s.current===null&&(s.current=o,o.reviveAfterDestroy()),t(!0),()=>{s.current?.destroy(),s.current=null}),[o]),(0,n.useEffect)(()=>{s.current&&e&&s.current.updateConfig({agent:e.agent,defaultAgentId:e.defaultAgentId,permission:e.permission,language:e.language??null,userEmail:e.userEmail,userJwt:e.userJwt,metadata:e.metadata??null,debug:e.debug,warnOnEmptyReply:e.warnOnEmptyReply})},[e?.agent,e?.defaultAgentId,e?.permission,e?.language,e?.userEmail,e?.userJwt,e?.metadata,e?.debug,e?.warnOnEmptyReply]),{client:o,isReady:r}}var se=(0,n.createContext)(null),Qe=({children:e,client:r,tools:t,helpers:s,pageContext:o,...l})=>{const{client:c}=ye(r?null:l),i=r||c;return(0,n.useEffect)(()=>{if(!(!t||t.length===0)){for(const x of t)i.register(x);return()=>{for(const x of t)i.unregisterFunction(x.name)}}},[i,t]),(0,n.useEffect)(()=>{if(!s)return;const x=[];return Promise.resolve().then(()=>require("./functions-CPs7omgM.cjs")).then(d=>d.functions_exports).then(d=>{for(const[g,w]of Object.entries(s)){const m=d[g];if(!m){console.warn(`[AGO] Unknown helper: "${g}"`);continue}const f=w===!0?m:{...m,handler:w};i.register(f),x.push(f.name)}}),()=>{for(const d of x)i.unregisterFunction(d)}},[i,s]),(0,n.useEffect)(()=>{o==="auto"&&i.enableAutoPageContext()},[i,o]),(0,a.jsx)(se.Provider,{value:i,children:e})};function B(){const e=(0,n.useContext)(se);if(!e)throw new Error('useAgoClient must be used within an <AgoProvider>. Wrap your component tree with <AgoProvider baseUrl="...">.');return e}function D(){return(0,n.useContext)(se)}var et=new Set(["awaiting-approval"]);function ve(e){switch(e){case"progress_indicator":return"progress";case"reasoning":return"reasoning";case"confirmation_input":return"confirmation";case"form":return"form";default:return"status"}}function tt(e){return e.type==="client_function"?e.functionName==="navigateToPage"?"navigation":"action":ve(e.type)}function ge(e,r){const t=(e??"").toLowerCase();return t.includes("reject")?"rejected":t.includes("error")||t.includes("fail")?"error":t.includes("done")||t.includes("complet")?"done":(t.includes("waiting")||t.includes("pending"))&&(r==="confirmation"||r==="form")?"awaiting-approval":"running"}function xe(e){return typeof e!="string"||!e?"page":e.replace(/[-_]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,r=>r.toUpperCase()).trim()}function nt(e){switch(e.kind){case"navigation":return`Navigating to ${xe(e.arguments?.page)}`;case"action":return e.functionName==="setPageState"?"Updating the page":e.functionName==="openFilteredConversations"?"Opening conversations":e.toolDisplayName||e.message||xe(e.functionName)||"Working";case"progress":return e.message||"Working";case"reasoning":return e.message||"Thinking";case"confirmation":return e.message||"Waiting for your confirmation";case"form":return e.message||e.toolDisplayName||"Please fill in the form";default:return e.message||e.toolDisplayName||e.toolName||"Working"}}function Ce(e={}){const{includeReasoning:r=!1,labelFor:t}=e,s=D(),o=e.client||s;if(!o)throw new Z.AgoError("useAgoActivity requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.","provider_missing_client");const[l,c]=(0,n.useState)([]),i=(0,n.useRef)(new Set),x=(0,n.useRef)(void 0),d=(0,n.useRef)(t);d.current=t;const g=(0,n.useCallback)((p,S)=>{c(b=>{const N=b.findIndex(y=>y.id===p),_={...N>=0?b[N]:{id:p,kind:"status",label:"",status:"running",requiresApproval:!1,createdAt:new Date},...S};return _.label=d.current?.(_)??nt(_),N>=0?[...b.slice(0,N),_,...b.slice(N+1)]:[...b,_]})},[]);(0,n.useEffect)(()=>{const p=h=>{x.current=h.messageId},S=h=>{const I=ve(h.type);I==="reasoning"&&!r||g(h.id,{kind:I,status:ge(h.status,I),messageId:x.current,toolName:h.toolName,toolDisplayName:h.toolDisplayName,message:h.message,data:h.data,formSchema:h.formSchema,requiresApproval:I==="confirmation"||I==="form"})},b=h=>{h.invocationId&&g(h.invocationId,{kind:h.functionName==="navigateToPage"?"navigation":"action",status:"running",messageId:x.current,functionName:h.functionName,arguments:h.arguments})},N=h=>{h.invocationId&&g(h.invocationId,{kind:h.functionName==="navigateToPage"?"navigation":"action",status:"awaiting-approval",messageId:x.current,functionName:h.functionName,arguments:h.arguments,requiresApproval:!0})},_=h=>{if(!h.invocationId)return;const I=h.result,u=typeof h.result=="object"&&I!==null&&I.approved===!1&&I.reason==="user_rejected";g(h.invocationId,{status:h.error?"error":u?"rejected":"done",requiresApproval:!1})},y=h=>{for(const I of h.messages??[])if(I.role==="assistant")for(const u of I.toolCalls??[]){const A=tt(u);A==="reasoning"&&!r||/waiting/i.test(u.status??"")||g(u.id,{kind:A,status:ge(u.status,A),messageId:I.id,toolName:u.toolName,toolDisplayName:u.toolDisplayName,functionName:u.functionName,arguments:u.arguments,message:u.message,data:u.data,formSchema:u.formSchema,requiresApproval:A==="confirmation"||A==="form"})}},k=h=>{c(I=>I.map(u=>u.status==="running"||u.status==="awaiting-approval"?{...u,status:h}:u))},j=()=>k("done"),E=()=>k("error");return o.on("message:start",p),o.on("toolCall:received",S),o.on("function:invoke",b),o.on("function:awaiting-approval",N),o.on("function:result",_),o.on("conversation:loaded",y),o.on("message:complete",j),o.on("message:error",E),()=>{o.off("message:start",p),o.off("toolCall:received",S),o.off("function:invoke",b),o.off("function:awaiting-approval",N),o.off("function:result",_),o.off("conversation:loaded",y),o.off("message:complete",j),o.off("message:error",E)}},[o,r,g]);const w=(0,n.useCallback)(async p=>{const S=l.find(b=>b.id===p);!S||S.status!=="awaiting-approval"||i.current.has(p)||S.kind!=="form"&&(i.current.add(p),g(p,{status:"running",requiresApproval:!1}),S.functionName?await o.approveFunction(p):await o.confirmToolCall(p))},[o,l,g]),m=(0,n.useCallback)(async p=>{const S=l.find(b=>b.id===p);!S||S.status!=="awaiting-approval"||i.current.has(p)||(i.current.add(p),g(p,{status:"rejected",requiresApproval:!1}),S.functionName?await o.rejectFunction(p):await o.rejectToolCall(p))},[o,l,g]),f=(0,n.useCallback)(async(p,S)=>{g(p,{status:"running",requiresApproval:!1}),await o.submitToolCallForm(p,S),g(p,{status:"done"})},[o,g]),v=(0,n.useCallback)(()=>{i.current.clear(),c([])},[]);return{items:l,latest:l.length>0?l[l.length-1]:void 0,isAwaitingApproval:l.some(p=>et.has(p.status)),approve:w,reject:m,submitForm:f,clear:v}}function ae({client:e,conversationId:r}={}){const t=D(),s=e||t;if(!s)throw new Error("useMessages requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");const[o,l]=(0,n.useState)([]),[c,i]=(0,n.useState)(r),[x,d]=(0,n.useState)(!1),[g,w]=(0,n.useState)(null);(0,n.useEffect)(()=>{r&&r!==c&&(i(r),m(r))},[r]);const m=async f=>{try{l((await s.getMessages(f)).filter(v=>!v.hidden))}catch(v){w(v instanceof Error?v:new Error("Failed to load messages"))}};return(0,n.useEffect)(()=>{const f=y=>y==="IN_PROGRESS"||y==="WAITING_CLIENT",v=y=>{c||i(y.conversationId),d(!0),l(k=>{const j=k.findIndex(E=>E.id===y.messageId);return j>=0?k.map((E,h)=>h===j?{...E,status:"IN_PROGRESS"}:E):k.some(E=>E.role==="assistant"&&f(E.status))?k:[...k,{id:y.messageId,conversationId:y.conversationId,content:"",role:"assistant",status:"IN_PROGRESS",createdAt:new Date}]})},p=y=>{l(k=>{const j=k.findIndex(E=>E.id===y.messageId);return j<0?k:k.map((E,h)=>h===j?{...E,content:E.content+y.content}:E)})},S=y=>{l(k=>{let j=-1;for(let E=k.length-1;E>=0;E--)if(k[E].role==="assistant"&&f(k[E].status)){j=E;break}return j<0?k:[...k.slice(0,j),{...k[j],...y},...k.slice(j+1)]})},b=y=>{l(k=>{const j=k.findIndex(E=>E.id===y.id);return j>=0?[...k.slice(0,j),y,...k.slice(j+1)]:[...k,y]}),d(!1)},N=y=>{w(new Error(y.error)),d(!1)},_=()=>{l(y=>{let k=-1;for(let j=y.length-1;j>=0;j--)if(y[j].role==="assistant"&&f(y[j].status)){k=j;break}return k<0?y:y[k].content?y.map((j,E)=>E===k?{...j,status:"CANCELED"}:j):y.filter((j,E)=>E!==k)}),d(!1)};return s.on("message:start",v),s.on("message:chunk",p),s.on("message:answer-complete",S),s.on("message:complete",b),s.on("message:error",N),s.on("message:stopped",_),()=>{s.off("message:start",v),s.off("message:chunk",p),s.off("message:answer-complete",S),s.off("message:complete",b),s.off("message:error",N),s.off("message:stopped",_)}},[s,c]),{messages:o,isLoading:x,error:g,sendMessage:(0,n.useCallback)(async(f,v)=>{d(!0),w(null);const p={id:`temp-${Date.now()}`,conversationId:c||"",content:f,role:"user",status:"DONE",attachments:v&&v.length>0?L.attachmentsFromFiles(v):void 0,createdAt:new Date},S={id:`temp-assistant-${Date.now()}`,conversationId:c||"",content:"",role:"assistant",status:"IN_PROGRESS",createdAt:new Date};l(b=>[...b,p,S]);try{const b=await s.sendMessage(f,{conversationId:c,files:v});return b.conversationId&&!c&&i(b.conversationId),l(N=>{const _=N.filter(k=>!k.id.startsWith("temp-")),y={...p,id:p.id.replace("temp-","user-"),conversationId:b.conversationId};return _.some(k=>k.id===b.id)?[..._,y].sort((k,j)=>new Date(k.createdAt).getTime()-new Date(j.createdAt).getTime()):[..._,y,b]}),b}catch(b){return w(b instanceof Error?b:new Error("Failed to send message")),d(!1),l(N=>N.filter(_=>!_.id.startsWith("temp-"))),null}},[s,c]),stop:(0,n.useCallback)(async()=>{await s.stop()},[s]),clearMessages:(0,n.useCallback)(()=>{l([]),i(void 0),w(null)},[]),conversationId:c}}var me={compact:!1,state:"peek",isModal:!1,surface:{style:{},attrs:{}}},rt={tabindex:"tabIndex"};function ot(e){const r={};for(const[t,s]of Object.entries(e))r[rt[t]??t]=s;return r}function we(e){const r=e!==!1,t=r?e??{}:void 0,s=(0,n.useRef)(t?.onStateChange);s.current=t?.onStateChange;const o=(0,n.useMemo)(()=>{if(r)return G.createSheetController({breakpoint:t?.breakpoint,initialState:t?.initialState,bottomOffset:t?.bottomOffset,peekHeight:t?.peekHeight,onStateChange:(c,i)=>s.current?.(c,i)})},[r,t?.breakpoint,t?.initialState,t?.bottomOffset,t?.peekHeight]),l=(0,n.useSyncExternalStore)((0,n.useCallback)(c=>o?.subscribe(c)??(()=>{}),[o]),(0,n.useCallback)(()=>o?.getSnapshot()??me,[o]),(0,n.useCallback)(()=>o?.getServerSnapshot()??me,[o]));return{sheet:(0,n.useMemo)(()=>({...l,surface:{...l.surface,attrs:ot(l.surface.attrs)}}),[l]),expand:(0,n.useCallback)(c=>o?.expand(c),[o]),collapse:(0,n.useCallback)(c=>o?.collapse(c),[o]),toggle:(0,n.useCallback)(c=>o?.toggle(c),[o])}}var st=/(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|_[^_\n]+_)/g;function Se(e){const r=e.split(st);return r.length===1?e:r.map((t,s)=>s%2===0||!t?t:t.startsWith("`")?(0,a.jsx)("code",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:"0.92em",padding:"0 3px",borderRadius:"3px",backgroundColor:"rgba(0, 0, 0, 0.06)"},children:t.slice(1,-1)},s):t.startsWith("**")?(0,a.jsx)("strong",{style:{fontWeight:600},children:t.slice(2,-2)},s):(0,a.jsx)("em",{children:t.slice(1,-1)},s))}var at=`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var $e=Object.create,Y=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,Ue=Object.getOwnPropertyNames,Ge=Object.getPrototypeOf,Je=Object.prototype.hasOwnProperty,Ve=(e,r)=>{let t={};for(var s in e)Y(t,s,{get:e[s],enumerable:!0});return r||Y(t,Symbol.toStringTag,{value:"Module"}),t},Xe=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(var o=Ue(r),l=0,c=o.length,i;l<c;l++)i=o[l],!Je.call(e,i)&&i!==t&&Y(e,i,{get:(x=>r[x]).bind(null,i),enumerable:!(s=Ke(r,i))||s.enumerable});return e},oe=(e,r,t)=>(t=e!=null?$e(Ge(e)):{},Xe(r||!e||!e.__esModule?Y(t,"default",{value:e,enumerable:!0}):t,e));const L=require("./types-DNr6XEwI.cjs"),Z=require("./errors-o1IB5fEu.cjs"),Ye=require("./autoContinue-C3UsCvT5.cjs"),z=require("./createFormCollector-D_5SDuk9.cjs"),Ze=require("./createMockClient-BPt1gSve.cjs"),G=require("./speechToText-ZciRyyJE.cjs");let n=require("react");n=oe(n,1);let a=require("react/jsx-runtime"),te=require("react-markdown");te=oe(te,1);let ne=require("remark-gfm");ne=oe(ne,1);function ye(e){const[r,t]=(0,n.useState)(!1),s=(0,n.useRef)(null),o=(0,n.useMemo)(()=>{if(s.current&&(s.current.destroy(),s.current=null),!e)return null;const l=new L.AgoClient(e);return s.current=l,l},[e?.baseUrl,e?.widgetId]);return(0,n.useEffect)(()=>(o&&s.current===null&&(s.current=o,o.reviveAfterDestroy()),t(!0),()=>{s.current?.destroy(),s.current=null}),[o]),(0,n.useEffect)(()=>{s.current&&e&&s.current.updateConfig({agent:e.agent,defaultAgentId:e.defaultAgentId,permission:e.permission,language:e.language??null,userEmail:e.userEmail,userJwt:e.userJwt,metadata:e.metadata??null,debug:e.debug,warnOnEmptyReply:e.warnOnEmptyReply})},[e?.agent,e?.defaultAgentId,e?.permission,e?.language,e?.userEmail,e?.userJwt,e?.metadata,e?.debug,e?.warnOnEmptyReply]),{client:o,isReady:r}}var se=(0,n.createContext)(null),Qe=({children:e,client:r,tools:t,helpers:s,pageContext:o,...l})=>{const{client:c}=ye(r?null:l),i=r||c;return(0,n.useEffect)(()=>{if(!(!t||t.length===0)){for(const x of t)i.register(x);return()=>{for(const x of t)i.unregisterFunction(x.name)}}},[i,t]),(0,n.useEffect)(()=>{if(!s)return;const x=[];return Promise.resolve().then(()=>require("./functions-CPs7omgM.cjs")).then(d=>d.functions_exports).then(d=>{for(const[g,w]of Object.entries(s)){const m=d[g];if(!m){console.warn(`[AGO] Unknown helper: "${g}"`);continue}const f=w===!0?m:{...m,handler:w};i.register(f),x.push(f.name)}}),()=>{for(const d of x)i.unregisterFunction(d)}},[i,s]),(0,n.useEffect)(()=>{o==="auto"&&i.enableAutoPageContext()},[i,o]),(0,a.jsx)(se.Provider,{value:i,children:e})};function B(){const e=(0,n.useContext)(se);if(!e)throw new Error('useAgoClient must be used within an <AgoProvider>. Wrap your component tree with <AgoProvider baseUrl="...">.');return e}function D(){return(0,n.useContext)(se)}var et=new Set(["awaiting-approval"]);function ve(e){switch(e){case"progress_indicator":return"progress";case"reasoning":return"reasoning";case"confirmation_input":return"confirmation";case"form":return"form";default:return"status"}}function tt(e){return e.type==="client_function"?e.functionName==="navigateToPage"?"navigation":"action":ve(e.type)}function ge(e,r){const t=(e??"").toLowerCase();return t.includes("reject")?"rejected":t.includes("error")||t.includes("fail")?"error":t.includes("done")||t.includes("complet")?"done":(t.includes("waiting")||t.includes("pending"))&&(r==="confirmation"||r==="form")?"awaiting-approval":"running"}function xe(e){return typeof e!="string"||!e?"page":e.replace(/[-_]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,r=>r.toUpperCase()).trim()}function nt(e){switch(e.kind){case"navigation":return`Navigating to ${xe(e.arguments?.page)}`;case"action":return e.functionName==="setPageState"?"Updating the page":e.functionName==="openFilteredConversations"?"Opening conversations":e.toolDisplayName||e.message||xe(e.functionName)||"Working";case"progress":return e.message||"Working";case"reasoning":return e.message||"Thinking";case"confirmation":return e.message||"Waiting for your confirmation";case"form":return e.message||e.toolDisplayName||"Please fill in the form";default:return e.message||e.toolDisplayName||e.toolName||"Working"}}function Ce(e={}){const{includeReasoning:r=!1,labelFor:t}=e,s=D(),o=e.client||s;if(!o)throw new Z.AgoError("useAgoActivity requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.","provider_missing_client");const[l,c]=(0,n.useState)([]),i=(0,n.useRef)(new Set),x=(0,n.useRef)(void 0),d=(0,n.useRef)(t);d.current=t;const g=(0,n.useCallback)((p,S)=>{c(b=>{const N=b.findIndex(y=>y.id===p),_={...N>=0?b[N]:{id:p,kind:"status",label:"",status:"running",requiresApproval:!1,createdAt:new Date},...S};return _.label=d.current?.(_)??nt(_),N>=0?[...b.slice(0,N),_,...b.slice(N+1)]:[...b,_]})},[]);(0,n.useEffect)(()=>{const p=h=>{x.current=h.messageId},S=h=>{const I=ve(h.type);I==="reasoning"&&!r||g(h.id,{kind:I,status:ge(h.status,I),messageId:x.current,toolName:h.toolName,toolDisplayName:h.toolDisplayName,message:h.message,data:h.data,formSchema:h.formSchema,requiresApproval:I==="confirmation"||I==="form"})},b=h=>{h.invocationId&&g(h.invocationId,{kind:h.functionName==="navigateToPage"?"navigation":"action",status:"running",messageId:x.current,functionName:h.functionName,arguments:h.arguments})},N=h=>{h.invocationId&&g(h.invocationId,{kind:h.functionName==="navigateToPage"?"navigation":"action",status:"awaiting-approval",messageId:x.current,functionName:h.functionName,arguments:h.arguments,requiresApproval:!0})},_=h=>{if(!h.invocationId)return;const I=h.result,u=typeof h.result=="object"&&I!==null&&I.approved===!1&&I.reason==="user_rejected";g(h.invocationId,{status:h.error?"error":u?"rejected":"done",requiresApproval:!1})},y=h=>{for(const I of h.messages??[])if(I.role==="assistant")for(const u of I.toolCalls??[]){const A=tt(u);A==="reasoning"&&!r||/waiting/i.test(u.status??"")||g(u.id,{kind:A,status:ge(u.status,A),messageId:I.id,toolName:u.toolName,toolDisplayName:u.toolDisplayName,functionName:u.functionName,arguments:u.arguments,message:u.message,data:u.data,formSchema:u.formSchema,requiresApproval:A==="confirmation"||A==="form"})}},k=h=>{c(I=>I.map(u=>u.status==="running"||u.status==="awaiting-approval"?{...u,status:h}:u))},j=()=>k("done"),E=()=>k("error");return o.on("message:start",p),o.on("toolCall:received",S),o.on("function:invoke",b),o.on("function:awaiting-approval",N),o.on("function:result",_),o.on("conversation:loaded",y),o.on("message:complete",j),o.on("message:error",E),()=>{o.off("message:start",p),o.off("toolCall:received",S),o.off("function:invoke",b),o.off("function:awaiting-approval",N),o.off("function:result",_),o.off("conversation:loaded",y),o.off("message:complete",j),o.off("message:error",E)}},[o,r,g]);const w=(0,n.useCallback)(async p=>{const S=l.find(b=>b.id===p);!S||S.status!=="awaiting-approval"||i.current.has(p)||S.kind!=="form"&&(i.current.add(p),g(p,{status:"running",requiresApproval:!1}),S.functionName?await o.approveFunction(p):await o.confirmToolCall(p))},[o,l,g]),m=(0,n.useCallback)(async p=>{const S=l.find(b=>b.id===p);!S||S.status!=="awaiting-approval"||i.current.has(p)||(i.current.add(p),g(p,{status:"rejected",requiresApproval:!1}),S.functionName?await o.rejectFunction(p):await o.rejectToolCall(p))},[o,l,g]),f=(0,n.useCallback)(async(p,S)=>{g(p,{status:"running",requiresApproval:!1}),await o.submitToolCallForm(p,S),g(p,{status:"done"})},[o,g]),v=(0,n.useCallback)(()=>{i.current.clear(),c([])},[]);return{items:l,latest:l.length>0?l[l.length-1]:void 0,isAwaitingApproval:l.some(p=>et.has(p.status)),approve:w,reject:m,submitForm:f,clear:v}}function ae({client:e,conversationId:r}={}){const t=D(),s=e||t;if(!s)throw new Error("useMessages requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");const[o,l]=(0,n.useState)([]),[c,i]=(0,n.useState)(r),[x,d]=(0,n.useState)(!1),[g,w]=(0,n.useState)(null);(0,n.useEffect)(()=>{r&&r!==c&&(i(r),m(r))},[r]);const m=async f=>{try{l((await s.getMessages(f)).filter(v=>!v.hidden))}catch(v){w(v instanceof Error?v:new Error("Failed to load messages"))}};return(0,n.useEffect)(()=>{const f=y=>y==="IN_PROGRESS"||y==="WAITING_CLIENT",v=y=>{c||i(y.conversationId),d(!0),l(k=>{const j=k.findIndex(E=>E.id===y.messageId);return j>=0?k.map((E,h)=>h===j?{...E,status:"IN_PROGRESS"}:E):k.some(E=>E.role==="assistant"&&f(E.status))?k:[...k,{id:y.messageId,conversationId:y.conversationId,content:"",role:"assistant",status:"IN_PROGRESS",createdAt:new Date}]})},p=y=>{l(k=>{const j=k.findIndex(E=>E.id===y.messageId);return j<0?k:k.map((E,h)=>h===j?{...E,content:E.content+y.content}:E)})},S=y=>{l(k=>{let j=-1;for(let E=k.length-1;E>=0;E--)if(k[E].role==="assistant"&&f(k[E].status)){j=E;break}return j<0?k:[...k.slice(0,j),{...k[j],...y},...k.slice(j+1)]})},b=y=>{l(k=>{const j=k.findIndex(E=>E.id===y.id);return j>=0?[...k.slice(0,j),y,...k.slice(j+1)]:[...k,y]}),d(!1)},N=y=>{w(new Error(y.error)),d(!1)},_=()=>{l(y=>{let k=-1;for(let j=y.length-1;j>=0;j--)if(y[j].role==="assistant"&&f(y[j].status)){k=j;break}return k<0?y:y[k].content?y.map((j,E)=>E===k?{...j,status:"CANCELED"}:j):y.filter((j,E)=>E!==k)}),d(!1)};return s.on("message:start",v),s.on("message:chunk",p),s.on("message:answer-complete",S),s.on("message:complete",b),s.on("message:error",N),s.on("message:stopped",_),()=>{s.off("message:start",v),s.off("message:chunk",p),s.off("message:answer-complete",S),s.off("message:complete",b),s.off("message:error",N),s.off("message:stopped",_)}},[s,c]),{messages:o,isLoading:x,error:g,sendMessage:(0,n.useCallback)(async(f,v)=>{d(!0),w(null);const p={id:`temp-${Date.now()}`,conversationId:c||"",content:f,role:"user",status:"DONE",attachments:v&&v.length>0?L.attachmentsFromFiles(v):void 0,createdAt:new Date},S={id:`temp-assistant-${Date.now()}`,conversationId:c||"",content:"",role:"assistant",status:"IN_PROGRESS",createdAt:new Date};l(b=>[...b,p,S]);try{const b=await s.sendMessage(f,{conversationId:c,files:v});return b.conversationId&&!c&&i(b.conversationId),l(N=>{const _=N.filter(k=>!k.id.startsWith("temp-")),y={...p,id:p.id.replace("temp-","user-"),conversationId:b.conversationId};return _.some(k=>k.id===b.id)?[..._,y].sort((k,j)=>new Date(k.createdAt).getTime()-new Date(j.createdAt).getTime()):[..._,y,b]}),b}catch(b){return w(b instanceof Error?b:new Error("Failed to send message")),d(!1),l(N=>N.filter(_=>!_.id.startsWith("temp-"))),null}},[s,c]),stop:(0,n.useCallback)(async()=>{await s.stop()},[s]),clearMessages:(0,n.useCallback)(()=>{l([]),i(void 0),w(null)},[]),conversationId:c}}var me={compact:!1,state:"peek",isModal:!1,surface:{style:{},attrs:{}}},rt={tabindex:"tabIndex"};function ot(e){const r={};for(const[t,s]of Object.entries(e))r[rt[t]??t]=s;return r}function we(e){const r=e!==!1,t=r?e??{}:void 0,s=(0,n.useRef)(t?.onStateChange);s.current=t?.onStateChange;const o=(0,n.useMemo)(()=>{if(r)return G.createSheetController({breakpoint:t?.breakpoint,initialState:t?.initialState,bottomOffset:t?.bottomOffset,peekHeight:t?.peekHeight,onStateChange:(c,i)=>s.current?.(c,i)})},[r,t?.breakpoint,t?.initialState,t?.bottomOffset,t?.peekHeight]),l=(0,n.useSyncExternalStore)((0,n.useCallback)(c=>o?.subscribe(c)??(()=>{}),[o]),(0,n.useCallback)(()=>o?.getSnapshot()??me,[o]),(0,n.useCallback)(()=>o?.getServerSnapshot()??me,[o]));return{sheet:(0,n.useMemo)(()=>({...l,surface:{...l.surface,attrs:ot(l.surface.attrs)}}),[l]),expand:(0,n.useCallback)(c=>o?.expand(c),[o]),collapse:(0,n.useCallback)(c=>o?.collapse(c),[o]),toggle:(0,n.useCallback)(c=>o?.toggle(c),[o])}}var st=/(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|_[^_\n]+_)/g;function Se(e){const r=e.split(st);return r.length===1?e:r.map((t,s)=>s%2===0||!t?t:t.startsWith("`")?(0,a.jsx)("code",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:"0.92em",padding:"0 3px",borderRadius:"3px",backgroundColor:"rgba(0, 0, 0, 0.06)"},children:t.slice(1,-1)},s):t.startsWith("**")?(0,a.jsx)("strong",{style:{fontWeight:600},children:t.slice(2,-2)},s):(0,a.jsx)("em",{children:t.slice(1,-1)},s))}var at=`
|
|
2
2
|
@keyframes ago-activity-enter {
|
|
3
3
|
from { opacity: 0; transform: translateY(4px); }
|
|
4
4
|
to { opacity: 1; transform: none; }
|
package/dist/react.d.cts
CHANGED
|
@@ -787,6 +787,11 @@ declare interface AgoClientEvents {
|
|
|
787
787
|
result: unknown;
|
|
788
788
|
error?: string;
|
|
789
789
|
};
|
|
790
|
+
/** A validated form collector submission is about to call its submit target. */
|
|
791
|
+
"form:submitting": {
|
|
792
|
+
name: string;
|
|
793
|
+
values: Record<string, unknown>;
|
|
794
|
+
};
|
|
790
795
|
/**
|
|
791
796
|
* A form collector submitted successfully. `result` is the raw submit response
|
|
792
797
|
* (POST body / handler return value / backend relay result) — the third-party
|
|
@@ -3325,16 +3330,21 @@ export declare interface UseSheetResult {
|
|
|
3325
3330
|
toggle: (cause?: SheetChangeCause) => void;
|
|
3326
3331
|
}
|
|
3327
3332
|
|
|
3328
|
-
/**
|
|
3333
|
+
/** Metadata for tools exposed through the WebMCP bridge. */
|
|
3329
3334
|
declare interface WebMCPToolMeta {
|
|
3330
3335
|
/**
|
|
3331
|
-
*
|
|
3332
|
-
*
|
|
3333
|
-
* carry third-party text.
|
|
3336
|
+
* Optional WebMCP metadata; all fields default to `false` in WebMCP.
|
|
3337
|
+
* These annotations do not affect AGO's in-app agent or approval behavior.
|
|
3334
3338
|
*/
|
|
3335
3339
|
annotations?: {
|
|
3340
|
+
/** The tool only reads data and does not change state. */
|
|
3336
3341
|
readOnlyHint?: boolean;
|
|
3342
|
+
/** The output contains content untrusted by the tool author. */
|
|
3337
3343
|
untrustedContentHint?: boolean;
|
|
3344
|
+
/** Significant, real-world, or irreversible effects; independent of requiresApproval. */
|
|
3345
|
+
consequentialHint?: boolean;
|
|
3346
|
+
/** Intended for debugging and developer tooling. */
|
|
3347
|
+
debugging?: boolean;
|
|
3338
3348
|
};
|
|
3339
3349
|
/**
|
|
3340
3350
|
* This function navigates. The WebMCP call is held open until the function
|
package/dist/react.d.ts
CHANGED
|
@@ -787,6 +787,11 @@ declare interface AgoClientEvents {
|
|
|
787
787
|
result: unknown;
|
|
788
788
|
error?: string;
|
|
789
789
|
};
|
|
790
|
+
/** A validated form collector submission is about to call its submit target. */
|
|
791
|
+
"form:submitting": {
|
|
792
|
+
name: string;
|
|
793
|
+
values: Record<string, unknown>;
|
|
794
|
+
};
|
|
790
795
|
/**
|
|
791
796
|
* A form collector submitted successfully. `result` is the raw submit response
|
|
792
797
|
* (POST body / handler return value / backend relay result) — the third-party
|
|
@@ -3325,16 +3330,21 @@ export declare interface UseSheetResult {
|
|
|
3325
3330
|
toggle: (cause?: SheetChangeCause) => void;
|
|
3326
3331
|
}
|
|
3327
3332
|
|
|
3328
|
-
/**
|
|
3333
|
+
/** Metadata for tools exposed through the WebMCP bridge. */
|
|
3329
3334
|
declare interface WebMCPToolMeta {
|
|
3330
3335
|
/**
|
|
3331
|
-
*
|
|
3332
|
-
*
|
|
3333
|
-
* carry third-party text.
|
|
3336
|
+
* Optional WebMCP metadata; all fields default to `false` in WebMCP.
|
|
3337
|
+
* These annotations do not affect AGO's in-app agent or approval behavior.
|
|
3334
3338
|
*/
|
|
3335
3339
|
annotations?: {
|
|
3340
|
+
/** The tool only reads data and does not change state. */
|
|
3336
3341
|
readOnlyHint?: boolean;
|
|
3342
|
+
/** The output contains content untrusted by the tool author. */
|
|
3337
3343
|
untrustedContentHint?: boolean;
|
|
3344
|
+
/** Significant, real-world, or irreversible effects; independent of requiresApproval. */
|
|
3345
|
+
consequentialHint?: boolean;
|
|
3346
|
+
/** Intended for debugging and developer tooling. */
|
|
3347
|
+
debugging?: boolean;
|
|
3338
3348
|
};
|
|
3339
3349
|
/**
|
|
3340
3350
|
* This function navigates. The WebMCP call is held open until the function
|
package/dist/react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as De, c as ze, g as Le, n as Pe, o as Be, s as He, t as Oe } from "./types-D1ZrqVhr.js";
|
|
2
2
|
import { n as Q } from "./errors-BLfjXnLB.js";
|
|
3
3
|
import { t as $e } from "./autoContinue-Cb4_iEbO.js";
|
|
4
|
-
import { n as jt, r as he, t as xe } from "./createFormCollector-
|
|
4
|
+
import { n as jt, r as he, t as xe } from "./createFormCollector-D6_N8wYq.js";
|
|
5
5
|
import { t as Kt } from "./createMockClient-YoYr3pQr.js";
|
|
6
6
|
import { C as je, dt as qe, n as Ke, t as Jt, ut as Ue } from "./speechToText-BV7qxqPF.js";
|
|
7
7
|
import Ge, { createContext as Je, forwardRef as Ve, useCallback as T, useContext as be, useEffect as E, useId as Xe, useImperativeHandle as Ye, useLayoutEffect as Ze, useMemo as $, useRef as W, useState as M, useSyncExternalStore as ye } from "react";
|
package/dist/testing.d.cts
CHANGED
|
@@ -729,6 +729,11 @@ declare interface AgoClientEvents {
|
|
|
729
729
|
result: unknown;
|
|
730
730
|
error?: string;
|
|
731
731
|
};
|
|
732
|
+
/** A validated form collector submission is about to call its submit target. */
|
|
733
|
+
"form:submitting": {
|
|
734
|
+
name: string;
|
|
735
|
+
values: Record<string, unknown>;
|
|
736
|
+
};
|
|
732
737
|
/**
|
|
733
738
|
* A form collector submitted successfully. `result` is the raw submit response
|
|
734
739
|
* (POST body / handler return value / backend relay result) — the third-party
|
|
@@ -2096,16 +2101,21 @@ declare interface TranscribeAudioOptions {
|
|
|
2096
2101
|
signal?: AbortSignal;
|
|
2097
2102
|
}
|
|
2098
2103
|
|
|
2099
|
-
/**
|
|
2104
|
+
/** Metadata for tools exposed through the WebMCP bridge. */
|
|
2100
2105
|
declare interface WebMCPToolMeta {
|
|
2101
2106
|
/**
|
|
2102
|
-
*
|
|
2103
|
-
*
|
|
2104
|
-
* carry third-party text.
|
|
2107
|
+
* Optional WebMCP metadata; all fields default to `false` in WebMCP.
|
|
2108
|
+
* These annotations do not affect AGO's in-app agent or approval behavior.
|
|
2105
2109
|
*/
|
|
2106
2110
|
annotations?: {
|
|
2111
|
+
/** The tool only reads data and does not change state. */
|
|
2107
2112
|
readOnlyHint?: boolean;
|
|
2113
|
+
/** The output contains content untrusted by the tool author. */
|
|
2108
2114
|
untrustedContentHint?: boolean;
|
|
2115
|
+
/** Significant, real-world, or irreversible effects; independent of requiresApproval. */
|
|
2116
|
+
consequentialHint?: boolean;
|
|
2117
|
+
/** Intended for debugging and developer tooling. */
|
|
2118
|
+
debugging?: boolean;
|
|
2109
2119
|
};
|
|
2110
2120
|
/**
|
|
2111
2121
|
* This function navigates. The WebMCP call is held open until the function
|
package/dist/testing.d.ts
CHANGED
|
@@ -729,6 +729,11 @@ declare interface AgoClientEvents {
|
|
|
729
729
|
result: unknown;
|
|
730
730
|
error?: string;
|
|
731
731
|
};
|
|
732
|
+
/** A validated form collector submission is about to call its submit target. */
|
|
733
|
+
"form:submitting": {
|
|
734
|
+
name: string;
|
|
735
|
+
values: Record<string, unknown>;
|
|
736
|
+
};
|
|
732
737
|
/**
|
|
733
738
|
* A form collector submitted successfully. `result` is the raw submit response
|
|
734
739
|
* (POST body / handler return value / backend relay result) — the third-party
|
|
@@ -2096,16 +2101,21 @@ declare interface TranscribeAudioOptions {
|
|
|
2096
2101
|
signal?: AbortSignal;
|
|
2097
2102
|
}
|
|
2098
2103
|
|
|
2099
|
-
/**
|
|
2104
|
+
/** Metadata for tools exposed through the WebMCP bridge. */
|
|
2100
2105
|
declare interface WebMCPToolMeta {
|
|
2101
2106
|
/**
|
|
2102
|
-
*
|
|
2103
|
-
*
|
|
2104
|
-
* carry third-party text.
|
|
2107
|
+
* Optional WebMCP metadata; all fields default to `false` in WebMCP.
|
|
2108
|
+
* These annotations do not affect AGO's in-app agent or approval behavior.
|
|
2105
2109
|
*/
|
|
2106
2110
|
annotations?: {
|
|
2111
|
+
/** The tool only reads data and does not change state. */
|
|
2107
2112
|
readOnlyHint?: boolean;
|
|
2113
|
+
/** The output contains content untrusted by the tool author. */
|
|
2108
2114
|
untrustedContentHint?: boolean;
|
|
2115
|
+
/** Significant, real-world, or irreversible effects; independent of requiresApproval. */
|
|
2116
|
+
consequentialHint?: boolean;
|
|
2117
|
+
/** Intended for debugging and developer tooling. */
|
|
2118
|
+
debugging?: boolean;
|
|
2109
2119
|
};
|
|
2110
2120
|
/**
|
|
2111
2121
|
* This function navigates. The WebMCP call is held open until the function
|
package/dist/vue.d.cts
CHANGED
|
@@ -737,6 +737,11 @@ declare interface AgoClientEvents {
|
|
|
737
737
|
result: unknown;
|
|
738
738
|
error?: string;
|
|
739
739
|
};
|
|
740
|
+
/** A validated form collector submission is about to call its submit target. */
|
|
741
|
+
"form:submitting": {
|
|
742
|
+
name: string;
|
|
743
|
+
values: Record<string, unknown>;
|
|
744
|
+
};
|
|
740
745
|
/**
|
|
741
746
|
* A form collector submitted successfully. `result` is the raw submit response
|
|
742
747
|
* (POST body / handler return value / backend relay result) — the third-party
|
|
@@ -3118,16 +3123,21 @@ export declare interface UseProactiveNudgeResult {
|
|
|
3118
3123
|
dismiss: () => void;
|
|
3119
3124
|
}
|
|
3120
3125
|
|
|
3121
|
-
/**
|
|
3126
|
+
/** Metadata for tools exposed through the WebMCP bridge. */
|
|
3122
3127
|
declare interface WebMCPToolMeta {
|
|
3123
3128
|
/**
|
|
3124
|
-
*
|
|
3125
|
-
*
|
|
3126
|
-
* carry third-party text.
|
|
3129
|
+
* Optional WebMCP metadata; all fields default to `false` in WebMCP.
|
|
3130
|
+
* These annotations do not affect AGO's in-app agent or approval behavior.
|
|
3127
3131
|
*/
|
|
3128
3132
|
annotations?: {
|
|
3133
|
+
/** The tool only reads data and does not change state. */
|
|
3129
3134
|
readOnlyHint?: boolean;
|
|
3135
|
+
/** The output contains content untrusted by the tool author. */
|
|
3130
3136
|
untrustedContentHint?: boolean;
|
|
3137
|
+
/** Significant, real-world, or irreversible effects; independent of requiresApproval. */
|
|
3138
|
+
consequentialHint?: boolean;
|
|
3139
|
+
/** Intended for debugging and developer tooling. */
|
|
3140
|
+
debugging?: boolean;
|
|
3131
3141
|
};
|
|
3132
3142
|
/**
|
|
3133
3143
|
* This function navigates. The WebMCP call is held open until the function
|
package/dist/vue.d.ts
CHANGED
|
@@ -737,6 +737,11 @@ declare interface AgoClientEvents {
|
|
|
737
737
|
result: unknown;
|
|
738
738
|
error?: string;
|
|
739
739
|
};
|
|
740
|
+
/** A validated form collector submission is about to call its submit target. */
|
|
741
|
+
"form:submitting": {
|
|
742
|
+
name: string;
|
|
743
|
+
values: Record<string, unknown>;
|
|
744
|
+
};
|
|
740
745
|
/**
|
|
741
746
|
* A form collector submitted successfully. `result` is the raw submit response
|
|
742
747
|
* (POST body / handler return value / backend relay result) — the third-party
|
|
@@ -3118,16 +3123,21 @@ export declare interface UseProactiveNudgeResult {
|
|
|
3118
3123
|
dismiss: () => void;
|
|
3119
3124
|
}
|
|
3120
3125
|
|
|
3121
|
-
/**
|
|
3126
|
+
/** Metadata for tools exposed through the WebMCP bridge. */
|
|
3122
3127
|
declare interface WebMCPToolMeta {
|
|
3123
3128
|
/**
|
|
3124
|
-
*
|
|
3125
|
-
*
|
|
3126
|
-
* carry third-party text.
|
|
3129
|
+
* Optional WebMCP metadata; all fields default to `false` in WebMCP.
|
|
3130
|
+
* These annotations do not affect AGO's in-app agent or approval behavior.
|
|
3127
3131
|
*/
|
|
3128
3132
|
annotations?: {
|
|
3133
|
+
/** The tool only reads data and does not change state. */
|
|
3129
3134
|
readOnlyHint?: boolean;
|
|
3135
|
+
/** The output contains content untrusted by the tool author. */
|
|
3130
3136
|
untrustedContentHint?: boolean;
|
|
3137
|
+
/** Significant, real-world, or irreversible effects; independent of requiresApproval. */
|
|
3138
|
+
consequentialHint?: boolean;
|
|
3139
|
+
/** Intended for debugging and developer tooling. */
|
|
3140
|
+
debugging?: boolean;
|
|
3131
3141
|
};
|
|
3132
3142
|
/**
|
|
3133
3143
|
* This function navigates. The WebMCP call is held open until the function
|