@useago/sdk 1.13.2 → 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.
Files changed (40) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/angular.cjs +1 -1
  3. package/dist/angular.d.cts +21 -4
  4. package/dist/angular.d.ts +21 -4
  5. package/dist/angular.js +1 -1
  6. package/dist/{createConversationSession-DrmOaZdO.js → createConversationSession-CybQdMpK.js} +1 -1
  7. package/dist/{createConversationSession-Digvn0GQ.cjs → createConversationSession-jwSXhTLe.cjs} +1 -1
  8. package/dist/createFormCollector-B_hSKcLd.cjs +1 -0
  9. package/dist/{createFormCollector-ki_GTlp9.js → createFormCollector-DJjms78E.js} +49 -47
  10. package/dist/devtools.d.cts +21 -4
  11. package/dist/devtools.d.ts +21 -4
  12. package/dist/helpers.d.cts +9 -4
  13. package/dist/helpers.d.ts +9 -4
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.d.cts +24 -4
  16. package/dist/index.d.ts +24 -4
  17. package/dist/index.js +42 -38
  18. package/dist/react.cjs +4 -4
  19. package/dist/react.d.cts +22 -5
  20. package/dist/react.d.ts +22 -5
  21. package/dist/react.js +901 -912
  22. package/dist/speechToText-BB25_zVM.cjs +7 -0
  23. package/dist/speechToText-BLvTis4S.js +1496 -0
  24. package/dist/testing.d.cts +21 -4
  25. package/dist/testing.d.ts +21 -4
  26. package/dist/{types-D1ZrqVhr.js → types-C39MJUE3.js} +284 -259
  27. package/dist/{types-DNr6XEwI.cjs → types-PGXnhAmQ.cjs} +7 -7
  28. package/dist/vue.cjs +1 -1
  29. package/dist/vue.d.cts +21 -4
  30. package/dist/vue.d.ts +21 -4
  31. package/dist/vue.js +1 -1
  32. package/dist/widget.cjs +5 -6
  33. package/dist/widget.d.cts +31 -8
  34. package/dist/widget.d.ts +31 -8
  35. package/dist/widget.js +1875 -1848
  36. package/llms-full.txt +43 -4
  37. package/package.json +1 -1
  38. package/dist/createFormCollector-Cq7HWjtU.cjs +0 -1
  39. package/dist/speechToText-BV7qxqPF.js +0 -704
  40. package/dist/speechToText-ZciRyyJE.cjs +0 -1
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./types-DNr6XEwI.cjs"),f=require("./errors-o1IB5fEu.cjs"),S=require("./autoContinue-C3UsCvT5.cjs"),p=require("./createConversationSession-Digvn0GQ.cjs"),A=require("./createFormCollector-Cq7HWjtU.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 v(e,t){return e.on("message:error",t),()=>e.off("message:error",t)}function T(e,t){return e.on("toolCall:received",t),()=>e.off("toolCall:received",t)}function R(e,t){return e.on("form:submitted",t),()=>e.off("form:submitted",t)}function b(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,l){const i=[];let n=null,a=!1;const c=s=>{i.push(s),n?.()},m=s=>c({type:"start",data:s}),d=s=>c({type:"chunk",data:s}),r=s=>{c({type:"complete",data:s}),a=!0,n?.()},u=s=>{c({type:"error",data:s}),a=!0,n?.()},E=s=>c({type:"toolCall",data:s}),h=()=>{a=!0,n?.()};e.on("message:start",m),e.on("message:chunk",d),e.on("message:complete",r),e.on("message:error",u),e.on("message:stopped",h),e.on("toolCall:received",E),e.sendMessage(t,l).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",m),e.off("message:chunk",d),e.off("message:complete",r),e.off("message:error",u),e.off("message:stopped",h),e.off("toolCall:received",E)}}function C(e){let t,l,i,n,a,c,m;if(typeof window<"u"&&window.AGO){const r=window.AGO;t=r.basepath,l=r.widgetId,i=r.agent||r.defaultAgent,n=r.permission,a=r.email,c=r.jwt,m=r.metadata}if(typeof document<"u"){const r=u=>document.querySelector(`meta[name="${u}"]`)?.getAttribute("content")||void 0;t=t||r("ago-base-url"),l=l||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,l=l||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,l=e?.widgetId||l,i=e?.agent||e?.defaultAgentId||i,n=e?.permission||n,a=e?.userEmail||a,c=e?.userJwt||c,e?.metadata!==void 0&&(m=e.metadata);const d=e?.debug;return t?{baseUrl:t,widgetId:l,agent:i,permission:n,language:e?.language,userEmail:a,userJwt:c,metadata:m,debug:d}:null}function U(e){const t=C(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 D(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=S.attachAutoContinueAfterNavigation;exports.autoDetectConfig=C;exports.canInlineImage=o.canInlineImage;exports.copyToClipboard=g.copyToClipboard;exports.createAgo=U;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=b;exports.onFormSubmitted=R;exports.onFunctionInvoke=q;exports.onMessage=_;exports.onMessageChunk=y;exports.onMessageError=v;exports.onMessageStart=M;exports.onToolCall=T;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=D;
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
@@ -768,6 +773,11 @@ export declare interface AgoClientEvents {
768
773
  result: unknown;
769
774
  error?: string;
770
775
  };
776
+ /** A validated form collector submission is about to call its submit target. */
777
+ "form:submitting": {
778
+ name: string;
779
+ values: Record<string, unknown>;
780
+ };
771
781
  /**
772
782
  * A form collector submitted successfully. `result` is the raw submit response
773
783
  * (POST body / handler return value / backend relay result) — the third-party
@@ -2390,6 +2400,9 @@ export declare function onFormError(client: AgoClient, callback: (data: AgoClien
2390
2400
  */
2391
2401
  export declare function onFormSubmitted(client: AgoClient, callback: (data: AgoClientEvents["form:submitted"]) => void): () => void;
2392
2402
 
2403
+ /** Observe a validated form submission before its submit target runs. */
2404
+ export declare function onFormSubmitting(client: AgoClient, callback: (data: AgoClientEvents["form:submitting"]) => void): () => void;
2405
+
2393
2406
  /**
2394
2407
  * Subscribe to client function invocations.
2395
2408
  */
@@ -3212,6 +3225,7 @@ export declare interface SubmitToolCallResult {
3212
3225
 
3213
3226
  /** A custom field of a ticket form. */
3214
3227
  declare interface TicketField {
3228
+ prefillAliases?: string[];
3215
3229
  id: string;
3216
3230
  /** The key the ticketing backend expects; used as the submit key when set. */
3217
3231
  externalId?: string;
@@ -3258,6 +3272,7 @@ declare interface TicketFieldOption {
3258
3272
 
3259
3273
  /** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
3260
3274
  declare interface TicketForm {
3275
+ embedDescription?: string;
3261
3276
  id: string;
3262
3277
  name?: string;
3263
3278
  /** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
@@ -3353,16 +3368,21 @@ export declare interface TranscribeAudioOptions {
3353
3368
  */
3354
3369
  export declare function validateConfig(config: unknown, context?: string): asserts config is AgoConfig;
3355
3370
 
3356
- /** The MCP behavior hints AGO has no equivalent for. */
3371
+ /** Metadata for tools exposed through the WebMCP bridge. */
3357
3372
  export declare interface WebMCPToolMeta {
3358
3373
  /**
3359
- * Both default to `false`, so only set what is true: `readOnlyHint` marks a
3360
- * function that changes nothing, `untrustedContentHint` one whose result may
3361
- * carry third-party text.
3374
+ * Optional WebMCP metadata; all fields default to `false` in WebMCP.
3375
+ * These annotations do not affect AGO's in-app agent or approval behavior.
3362
3376
  */
3363
3377
  annotations?: {
3378
+ /** The tool only reads data and does not change state. */
3364
3379
  readOnlyHint?: boolean;
3380
+ /** The output contains content untrusted by the tool author. */
3365
3381
  untrustedContentHint?: boolean;
3382
+ /** Significant, real-world, or irreversible effects; independent of requiresApproval. */
3383
+ consequentialHint?: boolean;
3384
+ /** Intended for debugging and developer tooling. */
3385
+ debugging?: boolean;
3366
3386
  };
3367
3387
  /**
3368
3388
  * This function navigates. The WebMCP call is held open until the function
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
@@ -768,6 +773,11 @@ export declare interface AgoClientEvents {
768
773
  result: unknown;
769
774
  error?: string;
770
775
  };
776
+ /** A validated form collector submission is about to call its submit target. */
777
+ "form:submitting": {
778
+ name: string;
779
+ values: Record<string, unknown>;
780
+ };
771
781
  /**
772
782
  * A form collector submitted successfully. `result` is the raw submit response
773
783
  * (POST body / handler return value / backend relay result) — the third-party
@@ -2390,6 +2400,9 @@ export declare function onFormError(client: AgoClient, callback: (data: AgoClien
2390
2400
  */
2391
2401
  export declare function onFormSubmitted(client: AgoClient, callback: (data: AgoClientEvents["form:submitted"]) => void): () => void;
2392
2402
 
2403
+ /** Observe a validated form submission before its submit target runs. */
2404
+ export declare function onFormSubmitting(client: AgoClient, callback: (data: AgoClientEvents["form:submitting"]) => void): () => void;
2405
+
2393
2406
  /**
2394
2407
  * Subscribe to client function invocations.
2395
2408
  */
@@ -3212,6 +3225,7 @@ export declare interface SubmitToolCallResult {
3212
3225
 
3213
3226
  /** A custom field of a ticket form. */
3214
3227
  declare interface TicketField {
3228
+ prefillAliases?: string[];
3215
3229
  id: string;
3216
3230
  /** The key the ticketing backend expects; used as the submit key when set. */
3217
3231
  externalId?: string;
@@ -3258,6 +3272,7 @@ declare interface TicketFieldOption {
3258
3272
 
3259
3273
  /** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
3260
3274
  declare interface TicketForm {
3275
+ embedDescription?: string;
3261
3276
  id: string;
3262
3277
  name?: string;
3263
3278
  /** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
@@ -3353,16 +3368,21 @@ export declare interface TranscribeAudioOptions {
3353
3368
  */
3354
3369
  export declare function validateConfig(config: unknown, context?: string): asserts config is AgoConfig;
3355
3370
 
3356
- /** The MCP behavior hints AGO has no equivalent for. */
3371
+ /** Metadata for tools exposed through the WebMCP bridge. */
3357
3372
  export declare interface WebMCPToolMeta {
3358
3373
  /**
3359
- * Both default to `false`, so only set what is true: `readOnlyHint` marks a
3360
- * function that changes nothing, `untrustedContentHint` one whose result may
3361
- * carry third-party text.
3374
+ * Optional WebMCP metadata; all fields default to `false` in WebMCP.
3375
+ * These annotations do not affect AGO's in-app agent or approval behavior.
3362
3376
  */
3363
3377
  annotations?: {
3378
+ /** The tool only reads data and does not change state. */
3364
3379
  readOnlyHint?: boolean;
3380
+ /** The output contains content untrusted by the tool author. */
3365
3381
  untrustedContentHint?: boolean;
3382
+ /** Significant, real-world, or irreversible effects; independent of requiresApproval. */
3383
+ consequentialHint?: boolean;
3384
+ /** Intended for debugging and developer tooling. */
3385
+ debugging?: boolean;
3366
3386
  };
3367
3387
  /**
3368
3388
  * This function navigates. The WebMCP call is held open until the function
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { a as w, c as E, d as C, f as S, 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 k, c as N, 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";
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 { 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 ge } from "./createConversationSession-DrmOaZdO.js";
6
- import { n as me, r as fe, t as le } from "./createFormCollector-ki_GTlp9.js";
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) {
@@ -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 Ce(e, t) {
21
+ function Se(e, t) {
22
22
  return e.on("message:error", t), () => e.off("message:error", t);
23
23
  }
24
- function Se(e, t) {
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, g) {
36
+ async function* ve(e, t, u) {
37
37
  const n = [];
38
38
  let a = null, r = !1;
39
- const u = (s) => {
39
+ const g = (s) => {
40
40
  n.push(s), a?.();
41
- }, m = (s) => u({
41
+ }, m = (s) => g({
42
42
  type: "start",
43
43
  data: s
44
- }), f = (s) => u({
44
+ }), f = (s) => g({
45
45
  type: "chunk",
46
46
  data: s
47
47
  }), o = (s) => {
48
- u({
48
+ g({
49
49
  type: "complete",
50
50
  data: s
51
51
  }), r = !0, a?.();
52
52
  }, i = (s) => {
53
- u({
53
+ g({
54
54
  type: "error",
55
55
  data: s
56
56
  }), r = !0, a?.();
57
- }, l = (s) => u({
57
+ }, d = (s) => g({
58
58
  type: "toolCall",
59
59
  data: s
60
- }), d = () => {
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", d), e.on("toolCall:received", l), e.sendMessage(t, g).catch(() => {
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,51 +68,54 @@ 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", d), e.off("toolCall:received", l);
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, g, n, a, r, u, m;
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, g = o.widgetId, n = o.agent || o.defaultAgent, a = o.permission, r = o.email, u = o.jwt, m = o.metadata;
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"), g = g || o("ago-widget-id"), n = n || o("ago-agent") || o("ago-agent-id"), a = a || o("ago-permission"), r = r || o("ago-user-email");
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, g = g || 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);
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, g = e?.widgetId || g, n = e?.agent || e?.defaultAgentId || n, a = e?.permission || a, r = e?.userEmail || r, u = e?.userJwt || u, e?.metadata !== void 0 && (m = e.metadata);
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: g,
96
+ widgetId: u,
94
97
  agent: n,
95
98
  permission: a,
96
99
  language: e?.language,
97
100
  userEmail: r,
98
- userJwt: u,
101
+ userJwt: g,
99
102
  metadata: m,
100
103
  debug: f
101
104
  } : null;
102
105
  }
103
- function _e(e) {
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 Me(e, t) {
111
+ function Te(e, t) {
109
112
  return {
110
113
  ...e,
111
114
  handler: t
112
115
  };
113
116
  }
114
117
  export {
115
- D as ActivityLedger,
118
+ $ as ActivityLedger,
116
119
  re as AgoApiError,
117
120
  c as AgoClient,
118
121
  p as AgoError,
@@ -120,9 +123,9 @@ export {
120
123
  oe as AgoNetworkError,
121
124
  te as AgoStreamError,
122
125
  G as ClientContextRegistry,
123
- $ as DEFAULT_MAX_ACTIVITY_ENTRIES,
126
+ L as DEFAULT_MAX_ACTIVITY_ENTRIES,
124
127
  Z as DEFAULT_MAX_ERRORS,
125
- k as DEFAULT_MAX_ERROR_AGE_MS,
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
- _e as createAgo,
139
+ Me as createAgo,
137
140
  x as createAgoProactive,
138
- ge as createConversationSession,
139
- le as createFormCollector,
141
+ ue as createConversationSession,
142
+ de as createFormCollector,
140
143
  ve as createMessageStream,
141
144
  ce as createMockClient,
142
145
  q as createStore,
@@ -148,28 +151,29 @@ export {
148
151
  w as highlightElement,
149
152
  V as isStreamNetworkError,
150
153
  fe as loadFormCollector,
151
- L as logger,
154
+ D as logger,
152
155
  W as matchesRoutePattern,
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
- Ce as onMessageError,
163
+ Se as onMessageError,
160
164
  Ee as onMessageStart,
161
- Se as onToolCall,
165
+ Ce as onToolCall,
162
166
  v as openUrl,
163
167
  P as partialDeepMatch,
164
- N as safeAttachmentUrl,
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
- C as showNotification,
170
- S as showToast,
173
+ S as showNotification,
174
+ C as showToast,
171
175
  _ as submitForm,
172
176
  F as trackEvent,
173
177
  j as validateConfig,
174
- Me as withHandler
178
+ Te as withHandler
175
179
  };