@useago/sdk 1.13.3 → 1.14.0
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 +6 -0
- package/dist/angular.cjs +1 -1
- package/dist/angular.d.cts +7 -0
- package/dist/angular.d.ts +7 -0
- package/dist/angular.js +1 -1
- package/dist/{createConversationSession-DrmOaZdO.js → createConversationSession-CybQdMpK.js} +1 -1
- package/dist/{createConversationSession-Digvn0GQ.cjs → createConversationSession-jwSXhTLe.cjs} +1 -1
- package/dist/{createFormCollector-D_5SDuk9.cjs → createFormCollector-B_hSKcLd.cjs} +1 -1
- package/dist/{createFormCollector-D6_N8wYq.js → createFormCollector-DJjms78E.js} +1 -1
- package/dist/devtools.d.cts +7 -0
- package/dist/devtools.d.ts +7 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -6
- package/dist/react.cjs +4 -4
- package/dist/react.d.cts +8 -1
- package/dist/react.d.ts +8 -1
- package/dist/react.js +901 -912
- package/dist/speechToText-BB25_zVM.cjs +7 -0
- package/dist/speechToText-BLvTis4S.js +1496 -0
- package/dist/testing.d.cts +7 -0
- package/dist/testing.d.ts +7 -0
- package/dist/{types-D1ZrqVhr.js → types-C39MJUE3.js} +284 -259
- package/dist/{types-DNr6XEwI.cjs → types-PGXnhAmQ.cjs} +7 -7
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +7 -0
- package/dist/vue.d.ts +7 -0
- package/dist/vue.js +1 -1
- package/dist/widget.cjs +5 -6
- package/dist/widget.d.cts +12 -4
- package/dist/widget.d.ts +12 -4
- package/dist/widget.js +1868 -1841
- package/llms-full.txt +23 -3
- package/package.json +1 -1
- package/dist/speechToText-BV7qxqPF.js +0 -704
- package/dist/speechToText-ZciRyyJE.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.14.0] - 2026-10-19
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- UI and configured ticket-form translations in six languages. Language switching preserves drafts, attachments and submission state; explicit wording overrides remain supported.
|
|
15
|
+
|
|
10
16
|
## [1.13.3] - 2026-10-13
|
|
11
17
|
|
|
12
18
|
### Added
|
package/dist/angular.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./types-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./types-PGXnhAmQ.cjs"),a=require("./autoContinue-C3UsCvT5.cjs");var n=class{constructor(t){this.client=new s.AgoClient(t),this.messages$=this.fromEvent("message:complete"),this.chunks$=this.fromEvent("message:chunk"),this.errors$=this.fromEvent("message:error"),this.messageStart$=this.fromEvent("message:start")}fromEvent(t){const e=this.client;return{subscribe(i){const r=o=>{i.next?.(o)};return e.on(t,r),{unsubscribe:()=>e.off(t,r)}}}}sendMessage(t,e){return this.client.sendMessage(t,e)}transcribeAudio(t,e){return this.client.transcribeAudio(t,e)}stop(){return this.client.stop()}stopMessage(t){return this.client.stopMessage(t)}isGenerating(){return this.client.isGenerating()}getConversations(){return this.client.getConversations().then(t=>t.data)}getConversation(t){return this.client.getConversation(t)}getMessages(t){return this.client.getMessages(t)}submitToolCallForm(t,e){return this.client.submitToolCallForm(t,e)}confirmToolCall(t){return this.client.confirmToolCall(t)}rejectToolCall(t){return this.client.rejectToolCall(t)}submitFeedback(t,e,i){return this.client.submitFeedback(t,e,i)}submitConversationFeedback(t,e,i){return this.client.submitConversationFeedback(t,e,i)}registerFunction(t,e,i){typeof t=="object"?this.client.registerFunction(t):this.client.registerFunction(t,e,i)}unregisterFunction(t){return this.client.unregisterFunction(t)}registerNavigationFunction(t,e,i){this.client.registerNavigationFunction(t,e,{catalogue:i?.catalogue==="onDemand"?"onDemand":"inline"})}unregisterNavigationFunction(){this.client.unregisterNavigationFunction()}enableAutoContinueAfterNavigation(t){return a.attachAutoContinueAfterNavigation(this.client,t)}registerPageStateFunction(t,e){this.client.registerPageStateFunction(t,e)}unregisterPageStateFunction(t){this.client.unregisterPageStateFunction(t)}on(t,e){this.client.on(t,e)}off(t,e){this.client.off(t,e)}updateConfig(t){this.client.updateConfig(t)}getClient(){return this.client}destroy(){this.client.destroy()}};function c(t){return{provide:n,useValue:new n(t)}}exports.AgoService=n;exports.FEEDBACK_REASONS=s.FEEDBACK_REASONS;exports.provideAgo=c;
|
package/dist/angular.d.cts
CHANGED
|
@@ -262,6 +262,8 @@ declare class AgoClient {
|
|
|
262
262
|
* Show the returned text as a draft; call `sendMessage` when the user sends it.
|
|
263
263
|
*/
|
|
264
264
|
transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
|
|
265
|
+
/** The requested language, before UI fallback. */
|
|
266
|
+
getLanguage(): string | null;
|
|
265
267
|
/**
|
|
266
268
|
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
267
269
|
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
@@ -637,6 +639,9 @@ declare class AgoClient {
|
|
|
637
639
|
* SDK Events
|
|
638
640
|
*/
|
|
639
641
|
export declare interface AgoClientEvents {
|
|
642
|
+
"config:changed": {
|
|
643
|
+
language: string | null;
|
|
644
|
+
};
|
|
640
645
|
/**
|
|
641
646
|
* The client-side context changed: a context entry or dynamic provider was
|
|
642
647
|
* added/removed, or a stateful helper (e.g. `createFormCollector`) updated its
|
|
@@ -2139,6 +2144,7 @@ declare interface SubmitToolCallResult {
|
|
|
2139
2144
|
|
|
2140
2145
|
/** A custom field of a ticket form. */
|
|
2141
2146
|
declare interface TicketField {
|
|
2147
|
+
prefillAliases?: string[];
|
|
2142
2148
|
id: string;
|
|
2143
2149
|
/** The key the ticketing backend expects; used as the submit key when set. */
|
|
2144
2150
|
externalId?: string;
|
|
@@ -2185,6 +2191,7 @@ declare interface TicketFieldOption {
|
|
|
2185
2191
|
|
|
2186
2192
|
/** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
|
|
2187
2193
|
declare interface TicketForm {
|
|
2194
|
+
embedDescription?: string;
|
|
2188
2195
|
id: string;
|
|
2189
2196
|
name?: string;
|
|
2190
2197
|
/** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
|
package/dist/angular.d.ts
CHANGED
|
@@ -262,6 +262,8 @@ declare class AgoClient {
|
|
|
262
262
|
* Show the returned text as a draft; call `sendMessage` when the user sends it.
|
|
263
263
|
*/
|
|
264
264
|
transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
|
|
265
|
+
/** The requested language, before UI fallback. */
|
|
266
|
+
getLanguage(): string | null;
|
|
265
267
|
/**
|
|
266
268
|
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
267
269
|
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
@@ -637,6 +639,9 @@ declare class AgoClient {
|
|
|
637
639
|
* SDK Events
|
|
638
640
|
*/
|
|
639
641
|
export declare interface AgoClientEvents {
|
|
642
|
+
"config:changed": {
|
|
643
|
+
language: string | null;
|
|
644
|
+
};
|
|
640
645
|
/**
|
|
641
646
|
* The client-side context changed: a context entry or dynamic provider was
|
|
642
647
|
* added/removed, or a stateful helper (e.g. `createFormCollector`) updated its
|
|
@@ -2139,6 +2144,7 @@ declare interface SubmitToolCallResult {
|
|
|
2139
2144
|
|
|
2140
2145
|
/** A custom field of a ticket form. */
|
|
2141
2146
|
declare interface TicketField {
|
|
2147
|
+
prefillAliases?: string[];
|
|
2142
2148
|
id: string;
|
|
2143
2149
|
/** The key the ticketing backend expects; used as the submit key when set. */
|
|
2144
2150
|
externalId?: string;
|
|
@@ -2185,6 +2191,7 @@ declare interface TicketFieldOption {
|
|
|
2185
2191
|
|
|
2186
2192
|
/** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
|
|
2187
2193
|
declare interface TicketForm {
|
|
2194
|
+
embedDescription?: string;
|
|
2188
2195
|
id: string;
|
|
2189
2196
|
name?: string;
|
|
2190
2197
|
/** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
|
package/dist/angular.js
CHANGED
package/dist/{createConversationSession-DrmOaZdO.js → createConversationSession-CybQdMpK.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as d } from "./types-
|
|
1
|
+
import { g as d } from "./types-C39MJUE3.js";
|
|
2
2
|
var f = "ago_widget_id", g = "ago_last_thread", y = 7200 * 1e3;
|
|
3
3
|
function v() {
|
|
4
4
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
package/dist/{createConversationSession-Digvn0GQ.cjs → createConversationSession-jwSXhTLe.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
const d=require("./types-
|
|
1
|
+
const d=require("./types-PGXnhAmQ.cjs");var f="ago_widget_id",g="ago_last_thread",y=7200*1e3;function v(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const r=Math.floor(Math.random()*16);return(e==="x"?r:r&3|8).toString(16)})}function _(e={}){const r=e.key??f,i=e.threadKey??g,u=e.ttlMs??y,l=e.storage??(typeof localStorage<"u"?localStorage:void 0);let n=e.widgetId??"";if(!n&&l)try{n=l.getItem(r)??""}catch{}if(n||(n=v()),l)try{l.setItem(r,n)}catch{}const o=d.createStore({value:null,lastMessageAt:null},{key:i,storage:l}),s=o.get();s.value!==null&&c(s.lastMessageAt)&&o.set({value:null,lastMessageAt:null});function c(t){return t===null?!0:Number.isFinite(u)?Date.now()-t>u:!1}return{widgetId:n,key:r,getLastActiveThread(){const{value:t,lastMessageAt:a}=o.get();return t===null||c(a)?null:t},setActiveThread(t,a){const x=a==null?null:a instanceof Date?a.getTime():a;o.set({value:t,lastMessageAt:x})},clear(){o.set({value:null,lastMessageAt:null})}}}Object.defineProperty(exports,"createConversationSession",{enumerable:!0,get:function(){return _}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const C=require("./types-
|
|
1
|
+
const C=require("./types-PGXnhAmQ.cjs");var W=/^[a-zA-Z0-9_-]{1,40}$/,V=n=>n==null||n==="";function S(n,e){if("anyOf"in n)return n.anyOf.some(c=>S(c,e));if("allOf"in n)return n.allOf.every(c=>S(c,e));const l=e[n.property];if(V(l))return!1;if(Array.isArray(n.value))return n.value.some(c=>String(l)===String(c));if(!n.op)return String(l)===String(n.value);const i=Number(l),a=Number(n.value);if(Number.isNaN(i)||Number.isNaN(a))return!1;switch(n.op){case">=":return i>=a;case"<=":return i<=a;case">":return i>a;case"<":return i<a;default:return C.logger.warn(`Unknown requiredWhen op "${n.op}"; treating as not required.`),!1}}function h(n,e){const l=n.properties??{},i=new Set;for(const c of n.required??[]){const b=l[c]?.requiredWhen;(!b||S(b,e))&&i.add(c)}for(const[c,b]of Object.entries(l))b.requiredWhen&&S(b.requiredWhen,e)&&i.add(c);const a=[...i].filter(c=>V(e[c]));return{missing:a,complete:a.length===0}}function B(n){const e={};for(const[l,i]of Object.entries(n.properties??{}))e[l]={type:i.type,...i.description!=null&&{description:i.description},...i.enum&&{enum:i.enum},...i.default!==void 0&&{default:i.default}};return{type:"object",properties:e,required:[]}}function A(n){const{name:e,description:l,schema:i}=n;if(!W.test(e))throw new Error(`Invalid form collector name "${e}": must match ${W} (it becomes the update_/submit_ function names).`);const a=typeof n.submit=="string"?n.submit?{via:"client",url:n.submit}:!1:n.submit??!1;n.autoSubmit===!0&&!a&&C.logger.warn(`FormCollector "${e}": autoSubmit is ignored because no submit target is configured.`);const c=(n.autoSubmit??!0)&&!!a,b=i.properties??{},$=t=>{const r={};for(const[o,s]of Object.entries(t)){const u=b[o];if(u)if(s==null)r[o]=s;else if(u.type==="number"||u.type==="integer"){const f=typeof s=="number"?s:Number(s);r[o]=Number.isNaN(f)?s:f}else u.type==="boolean"?r[o]=typeof s=="boolean"?s:s==="true"?!0:s==="false"?!1:!!s:r[o]=s}return r},F=n.initialValues??{},m=C.createStore({values:F,submitted:!1}),w=t=>{const r=m.get(),o={...r,values:{...r.values,...t}};return m.set(o),o};let d=null;const k=(t,r)=>{d?.emitFormEvent("form:error",{name:e,values:t,error:r})};let p=null;const I=async()=>{const{values:t}=m.get(),{complete:r,missing:o}=h(i,t);if(!r)return{ok:!1,missing:o};if(!a)return{ok:!1,error:"No submit target configured for this form collector."};if(a.via==="backend"&&!d)return{ok:!1,error:"Backend submit requires install(client) (or useFormCollector) first."};const s=t;try{d?.emitFormEvent("form:submitting",{name:e,values:s});let u;if(a.via==="client")if("handler"in a)u=await a.handler(s);else{const f=await fetch(a.url,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(s)});if(!f.ok){const j=`Submit failed: HTTP ${f.status}`;return k(s,j),{ok:!1,error:j}}u=await f.json().catch(()=>{})}else u=await d.submitFormCollector(e,s);return m.set({...m.get(),submitted:!0,submitResult:u}),d?.emitFormEvent("form:submitted",{name:e,values:s,result:u}),{ok:!0,result:u}}catch(u){const f=u instanceof Error?u.message:"Submit failed";return C.logger.error(`FormCollector "${e}" submit failed:`,u),k(s,f),{ok:!1,error:f}}},N=()=>p||(p=(async()=>{try{return await I()}finally{p=null}})(),p),q=async()=>{if(!c||!a)return null;const{values:t,submitted:r}=m.get();return r||!h(i,t).complete?null:N()},O={name:`update_${e}`,description:`Fill or update fields of the "${e}" form. ${l} Pass any subset of fields; call it repeatedly to fill the form as the user provides information. Returns the current values and which required fields are still missing.`,parameters:B(i),handler:async t=>{const r=w($(t)),{missing:o}=h(i,r.values),s=await q();return s?s.ok?{ok:!0,values:r.values,missing:o,submitted:!0}:{ok:!0,values:r.values,missing:o,submitted:!1,submitError:s.error}:{ok:!0,values:r.values,missing:o}}},y=[O];a&&!c&&y.push({name:`submit_${e}`,description:`Submit the completed "${e}" form. Only call this once every required field is collected and the user has confirmed. If fields are missing it returns them instead of submitting.`,parameters:{type:"object",properties:{}},handler:()=>N()});const D="client__",_=a?`submit_${e}`:null,R=t=>{const r=t.functionName??t.toolName;if(r)return r.startsWith(D)?r.slice(8):r},x=t=>{let r={...F},o=!1;for(const s of t){const u=R(s);u===O.name?s.arguments&&(r={...r,...$(s.arguments)}):_&&u===_&&s.status?.toLowerCase()==="done"&&(o=!0)}m.set({values:r,submitted:o})},g=`form:${e}`,v=`${g}:definition`,E=()=>({name:`Form definition: ${e}`,description:`${l} Some fields are conditionally required; the requiredWhen field in the schema tells you when each becomes required. The form schema is the following: ${JSON.stringify(i)}.`,stable:!0}),P=()=>{const{values:t,submitted:r}=m.get(),{missing:o,complete:s}=h(i,t),u=a?c?" The form is submitted automatically as soon as every required field is filled, so there is no submit function to call.":` When nothing is missing and the user confirms, call submit_${e}.`:"",f=r?`The "${e}" form has been submitted.`:`You are currently collecting information from the user to fill the "${e}" form.`;return{name:`Form: ${e}`,description:`${f} The form's schema and field requirements are in the "${v}" client context. Call update_${e} with any fields the user provides; ask only for what is still missing.${u}`,data:{values:t,missing:o,complete:s,submitted:r}}},T=t=>{x((t.messages??[]).flatMap(r=>r.toolCalls??[]))};return{name:e,store:m,functions:y,contextKey:g,contextProvider:P,definitionContextKey:v,definitionContextProvider:E,install:t=>{d=t;for(const o of y)t.register(o);t.addDynamicContext(v,E),t.addDynamicContext(g,P);const r=m.subscribe(()=>t.notifyContextChanged());return t.on("conversation:loaded",T),()=>{r();for(const o of y)t.unregisterFunction(o.name);t.removeDynamicContext(g),t.removeDynamicContext(v),t.off("conversation:loaded",T),d===t&&(d=null)}},hydrate:x,submit:N,getValues:()=>m.get().values,setValues:t=>{w($(t)),q()},reset:()=>{m.set({values:F,submitted:!1})},getStatus:()=>h(i,m.get().values)}}async function L(n,e){const l=await n.getFormCollector(e.name);return A({name:l.name,description:e.description??l.description,schema:e.schema??l.schema,submit:e.submit??l.submit,initialValues:e.initialValues,autoSubmit:e.autoSubmit??l.autoSubmit})}Object.defineProperty(exports,"createFormCollector",{enumerable:!0,get:function(){return A}});Object.defineProperty(exports,"deriveFormStatus",{enumerable:!0,get:function(){return h}});Object.defineProperty(exports,"loadFormCollector",{enumerable:!0,get:function(){return L}});
|
package/dist/devtools.d.cts
CHANGED
|
@@ -245,6 +245,8 @@ declare class AgoClient {
|
|
|
245
245
|
* Show the returned text as a draft; call `sendMessage` when the user sends it.
|
|
246
246
|
*/
|
|
247
247
|
transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
|
|
248
|
+
/** The requested language, before UI fallback. */
|
|
249
|
+
getLanguage(): string | null;
|
|
248
250
|
/**
|
|
249
251
|
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
250
252
|
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
@@ -620,6 +622,9 @@ declare class AgoClient {
|
|
|
620
622
|
* SDK Events
|
|
621
623
|
*/
|
|
622
624
|
declare interface AgoClientEvents {
|
|
625
|
+
"config:changed": {
|
|
626
|
+
language: string | null;
|
|
627
|
+
};
|
|
623
628
|
/**
|
|
624
629
|
* The client-side context changed: a context entry or dynamic provider was
|
|
625
630
|
* added/removed, or a stateful helper (e.g. `createFormCollector`) updated its
|
|
@@ -1979,6 +1984,7 @@ declare interface SubmitToolCallResult {
|
|
|
1979
1984
|
|
|
1980
1985
|
/** A custom field of a ticket form. */
|
|
1981
1986
|
declare interface TicketField {
|
|
1987
|
+
prefillAliases?: string[];
|
|
1982
1988
|
id: string;
|
|
1983
1989
|
/** The key the ticketing backend expects; used as the submit key when set. */
|
|
1984
1990
|
externalId?: string;
|
|
@@ -2025,6 +2031,7 @@ declare interface TicketFieldOption {
|
|
|
2025
2031
|
|
|
2026
2032
|
/** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
|
|
2027
2033
|
declare interface TicketForm {
|
|
2034
|
+
embedDescription?: string;
|
|
2028
2035
|
id: string;
|
|
2029
2036
|
name?: string;
|
|
2030
2037
|
/** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
|
package/dist/devtools.d.ts
CHANGED
|
@@ -245,6 +245,8 @@ declare class AgoClient {
|
|
|
245
245
|
* Show the returned text as a draft; call `sendMessage` when the user sends it.
|
|
246
246
|
*/
|
|
247
247
|
transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
|
|
248
|
+
/** The requested language, before UI fallback. */
|
|
249
|
+
getLanguage(): string | null;
|
|
248
250
|
/**
|
|
249
251
|
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
250
252
|
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
@@ -620,6 +622,9 @@ declare class AgoClient {
|
|
|
620
622
|
* SDK Events
|
|
621
623
|
*/
|
|
622
624
|
declare interface AgoClientEvents {
|
|
625
|
+
"config:changed": {
|
|
626
|
+
language: string | null;
|
|
627
|
+
};
|
|
623
628
|
/**
|
|
624
629
|
* The client-side context changed: a context entry or dynamic provider was
|
|
625
630
|
* added/removed, or a stateful helper (e.g. `createFormCollector`) updated its
|
|
@@ -1979,6 +1984,7 @@ declare interface SubmitToolCallResult {
|
|
|
1979
1984
|
|
|
1980
1985
|
/** A custom field of a ticket form. */
|
|
1981
1986
|
declare interface TicketField {
|
|
1987
|
+
prefillAliases?: string[];
|
|
1982
1988
|
id: string;
|
|
1983
1989
|
/** The key the ticketing backend expects; used as the submit key when set. */
|
|
1984
1990
|
externalId?: string;
|
|
@@ -2025,6 +2031,7 @@ declare interface TicketFieldOption {
|
|
|
2025
2031
|
|
|
2026
2032
|
/** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
|
|
2027
2033
|
declare interface TicketForm {
|
|
2034
|
+
embedDescription?: string;
|
|
2028
2035
|
id: string;
|
|
2029
2036
|
name?: string;
|
|
2030
2037
|
/** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./types-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./types-PGXnhAmQ.cjs"),f=require("./errors-o1IB5fEu.cjs"),C=require("./autoContinue-C3UsCvT5.cjs"),p=require("./createConversationSession-jwSXhTLe.cjs"),A=require("./createFormCollector-B_hSKcLd.cjs"),w=require("./createMockClient-BPt1gSve.cjs");require("./testing.cjs");const g=require("./functions-CPs7omgM.cjs");function F(e){return e}function _(e,t){return e.on("message:complete",t),()=>e.off("message:complete",t)}function y(e,t){return e.on("message:chunk",t),()=>e.off("message:chunk",t)}function M(e,t){return e.on("message:start",t),()=>e.off("message:start",t)}function b(e,t){return e.on("message:error",t),()=>e.off("message:error",t)}function v(e,t){return e.on("toolCall:received",t),()=>e.off("toolCall:received",t)}function T(e,t){return e.on("form:submitted",t),()=>e.off("form:submitted",t)}function R(e,t){return e.on("form:error",t),()=>e.off("form:error",t)}function q(e,t){return e.on("function:invoke",t),()=>e.off("function:invoke",t)}async function*I(e,t,m){const i=[];let n=null,a=!1;const l=s=>{i.push(s),n?.()},c=s=>l({type:"start",data:s}),d=s=>l({type:"chunk",data:s}),r=s=>{l({type:"complete",data:s}),a=!0,n?.()},u=s=>{l({type:"error",data:s}),a=!0,n?.()},E=s=>l({type:"toolCall",data:s}),S=()=>{a=!0,n?.()};e.on("message:start",c),e.on("message:chunk",d),e.on("message:complete",r),e.on("message:error",u),e.on("message:stopped",S),e.on("toolCall:received",E),e.sendMessage(t,m).catch(()=>{a=!0,n?.()});try{for(;!a||i.length>0;)i.length>0?yield i.shift():(await new Promise(s=>{n=s}),n=null)}finally{e.off("message:start",c),e.off("message:chunk",d),e.off("message:complete",r),e.off("message:error",u),e.off("message:stopped",S),e.off("toolCall:received",E)}}function U(e,t){return e.on("form:submitting",t),()=>e.off("form:submitting",t)}function h(e){let t,m,i,n,a,l,c;if(typeof window<"u"&&window.AGO){const r=window.AGO;t=r.basepath,m=r.widgetId,i=r.agent||r.defaultAgent,n=r.permission,a=r.email,l=r.jwt,c=r.metadata}if(typeof document<"u"){const r=u=>document.querySelector(`meta[name="${u}"]`)?.getAttribute("content")||void 0;t=t||r("ago-base-url"),m=m||r("ago-widget-id"),i=i||r("ago-agent")||r("ago-agent-id"),n=n||r("ago-permission"),a=a||r("ago-user-email")}if(typeof document<"u"){const r=[document.body,...Array.from(document.querySelectorAll("script[data-ago-base-url]"))].filter(Boolean);for(const u of r)u&&(t=t||u.getAttribute("data-ago-base-url")||void 0,m=m||u.getAttribute("data-ago-widget-id")||void 0,i=i||u.getAttribute("data-ago-agent")||u.getAttribute("data-ago-agent-id")||void 0,n=n||u.getAttribute("data-ago-permission")||void 0,a=a||u.getAttribute("data-ago-user-email")||void 0)}t=e?.baseUrl||t,m=e?.widgetId||m,i=e?.agent||e?.defaultAgentId||i,n=e?.permission||n,a=e?.userEmail||a,l=e?.userJwt||l,e?.metadata!==void 0&&(c=e.metadata);const d=e?.debug;return t?{baseUrl:t,widgetId:m,agent:i,permission:n,language:e?.language,userEmail:a,userJwt:l,metadata:c,debug:d}:null}function D(e){const t=h(e);if(!t)throw new f.AgoError('createAgo(): could not detect AGO configuration. Set window.AGO, add <meta name="ago-base-url">, or pass { baseUrl } explicitly.',"config_missing_base_url");return new o.AgoClient(t)}function L(e,t){return{...e,handler:t}}exports.ActivityLedger=o.ActivityLedger;exports.AgoApiError=f.AgoApiError;exports.AgoClient=o.AgoClient;exports.AgoError=f.AgoError;exports.AgoFunctionError=f.AgoFunctionError;exports.AgoNetworkError=f.AgoNetworkError;exports.AgoStreamError=f.AgoStreamError;exports.ClientContextRegistry=o.ClientContextRegistry;exports.DEFAULT_MAX_ACTIVITY_ENTRIES=o.DEFAULT_MAX_ACTIVITY_ENTRIES;exports.DEFAULT_MAX_ERRORS=o.DEFAULT_MAX_ERRORS;exports.DEFAULT_MAX_ERROR_AGE_MS=o.DEFAULT_MAX_ERROR_AGE_MS;exports.ErrorWatcher=o.ErrorWatcher;exports.EventEmitter=o.EventEmitter;exports.FEEDBACK_REASONS=o.FEEDBACK_REASONS;exports.FunctionRegistry=o.FunctionRegistry;exports.SSEHandler=o.SSEHandler;exports.SignalCollector=o.SignalCollector;exports.attachAutoContinueAfterNavigation=C.attachAutoContinueAfterNavigation;exports.autoDetectConfig=h;exports.canInlineImage=o.canInlineImage;exports.copyToClipboard=g.copyToClipboard;exports.createAgo=D;exports.createAgoProactive=o.createAgoProactive;exports.createConversationSession=p.createConversationSession;exports.createFormCollector=A.createFormCollector;exports.createMessageStream=I;exports.createMockClient=w.createMockClient;exports.createStore=o.createStore;exports.defineFunction=F;exports.deriveFormStatus=A.deriveFormStatus;exports.formatFileSize=o.formatFileSize;exports.getLocalStorage=g.getLocalStorage;exports.getUserLocation=g.getUserLocation;exports.highlightElement=g.highlightElement;exports.isStreamNetworkError=o.isStreamNetworkError;exports.loadFormCollector=A.loadFormCollector;exports.logger=o.logger;exports.matchesRoutePattern=o.matchesRoutePattern;exports.matchesWhen=o.matchesWhen;exports.onFormError=R;exports.onFormSubmitted=T;exports.onFormSubmitting=U;exports.onFunctionInvoke=q;exports.onMessage=_;exports.onMessageChunk=y;exports.onMessageError=b;exports.onMessageStart=M;exports.onToolCall=v;exports.openUrl=g.openUrl;exports.partialDeepMatch=o.partialDeepMatch;exports.safeAttachmentUrl=o.safeAttachmentUrl;exports.scrollToElement=g.scrollToElement;exports.setLocalStorage=g.setLocalStorage;exports.setTheme=g.setTheme;exports.showConfirmDialog=g.showConfirmDialog;exports.showNotification=g.showNotification;exports.showToast=g.showToast;exports.submitForm=g.submitForm;exports.trackEvent=g.trackEvent;exports.validateConfig=o.validateConfig;exports.withHandler=L;
|
package/dist/index.d.cts
CHANGED
|
@@ -284,6 +284,8 @@ export declare class AgoClient {
|
|
|
284
284
|
* Show the returned text as a draft; call `sendMessage` when the user sends it.
|
|
285
285
|
*/
|
|
286
286
|
transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
|
|
287
|
+
/** The requested language, before UI fallback. */
|
|
288
|
+
getLanguage(): string | null;
|
|
287
289
|
/**
|
|
288
290
|
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
289
291
|
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
@@ -659,6 +661,9 @@ export declare class AgoClient {
|
|
|
659
661
|
* SDK Events
|
|
660
662
|
*/
|
|
661
663
|
export declare interface AgoClientEvents {
|
|
664
|
+
"config:changed": {
|
|
665
|
+
language: string | null;
|
|
666
|
+
};
|
|
662
667
|
/**
|
|
663
668
|
* The client-side context changed: a context entry or dynamic provider was
|
|
664
669
|
* added/removed, or a stateful helper (e.g. `createFormCollector`) updated its
|
|
@@ -3220,6 +3225,7 @@ export declare interface SubmitToolCallResult {
|
|
|
3220
3225
|
|
|
3221
3226
|
/** A custom field of a ticket form. */
|
|
3222
3227
|
declare interface TicketField {
|
|
3228
|
+
prefillAliases?: string[];
|
|
3223
3229
|
id: string;
|
|
3224
3230
|
/** The key the ticketing backend expects; used as the submit key when set. */
|
|
3225
3231
|
externalId?: string;
|
|
@@ -3266,6 +3272,7 @@ declare interface TicketFieldOption {
|
|
|
3266
3272
|
|
|
3267
3273
|
/** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
|
|
3268
3274
|
declare interface TicketForm {
|
|
3275
|
+
embedDescription?: string;
|
|
3269
3276
|
id: string;
|
|
3270
3277
|
name?: string;
|
|
3271
3278
|
/** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
|
package/dist/index.d.ts
CHANGED
|
@@ -284,6 +284,8 @@ export declare class AgoClient {
|
|
|
284
284
|
* Show the returned text as a draft; call `sendMessage` when the user sends it.
|
|
285
285
|
*/
|
|
286
286
|
transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
|
|
287
|
+
/** The requested language, before UI fallback. */
|
|
288
|
+
getLanguage(): string | null;
|
|
287
289
|
/**
|
|
288
290
|
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
289
291
|
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
@@ -659,6 +661,9 @@ export declare class AgoClient {
|
|
|
659
661
|
* SDK Events
|
|
660
662
|
*/
|
|
661
663
|
export declare interface AgoClientEvents {
|
|
664
|
+
"config:changed": {
|
|
665
|
+
language: string | null;
|
|
666
|
+
};
|
|
662
667
|
/**
|
|
663
668
|
* The client-side context changed: a context entry or dynamic provider was
|
|
664
669
|
* added/removed, or a stateful helper (e.g. `createFormCollector`) updated its
|
|
@@ -3220,6 +3225,7 @@ export declare interface SubmitToolCallResult {
|
|
|
3220
3225
|
|
|
3221
3226
|
/** A custom field of a ticket form. */
|
|
3222
3227
|
declare interface TicketField {
|
|
3228
|
+
prefillAliases?: string[];
|
|
3223
3229
|
id: string;
|
|
3224
3230
|
/** The key the ticketing backend expects; used as the submit key when set. */
|
|
3225
3231
|
externalId?: string;
|
|
@@ -3266,6 +3272,7 @@ declare interface TicketFieldOption {
|
|
|
3266
3272
|
|
|
3267
3273
|
/** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
|
|
3268
3274
|
declare interface TicketForm {
|
|
3275
|
+
embedDescription?: string;
|
|
3269
3276
|
id: string;
|
|
3270
3277
|
name?: string;
|
|
3271
3278
|
/** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
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 {
|
|
2
|
+
import { S as D, T 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-C39MJUE3.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 ue } from "./createConversationSession-
|
|
6
|
-
import { n as me, r as fe, t as de } from "./createFormCollector-
|
|
5
|
+
import { t as ue } from "./createConversationSession-CybQdMpK.js";
|
|
6
|
+
import { n as me, r as fe, t as de } from "./createFormCollector-DJjms78E.js";
|
|
7
7
|
import { t as ce } from "./createMockClient-YoYr3pQr.js";
|
|
8
8
|
import "./testing.js";
|
|
9
9
|
function Ae(e) {
|
|
@@ -115,7 +115,7 @@ function Te(e, t) {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
export {
|
|
118
|
-
|
|
118
|
+
$ as ActivityLedger,
|
|
119
119
|
re as AgoApiError,
|
|
120
120
|
c as AgoClient,
|
|
121
121
|
p as AgoError,
|
|
@@ -123,7 +123,7 @@ export {
|
|
|
123
123
|
oe as AgoNetworkError,
|
|
124
124
|
te as AgoStreamError,
|
|
125
125
|
G as ClientContextRegistry,
|
|
126
|
-
|
|
126
|
+
L as DEFAULT_MAX_ACTIVITY_ENTRIES,
|
|
127
127
|
Z as DEFAULT_MAX_ERRORS,
|
|
128
128
|
N as DEFAULT_MAX_ERROR_AGE_MS,
|
|
129
129
|
Q as ErrorWatcher,
|
|
@@ -151,7 +151,7 @@ export {
|
|
|
151
151
|
w as highlightElement,
|
|
152
152
|
V as isStreamNetworkError,
|
|
153
153
|
fe as loadFormCollector,
|
|
154
|
-
|
|
154
|
+
D as logger,
|
|
155
155
|
W as matchesRoutePattern,
|
|
156
156
|
H as matchesWhen,
|
|
157
157
|
be as onFormError,
|