@useago/sdk 1.5.2 → 1.5.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/dist/AgoClient-BGkFSNZF.cjs +8 -0
- package/dist/AgoClient-CW-BLT1_.js +1542 -0
- package/dist/angular.cjs +1 -1
- package/dist/angular.d.cts +311 -0
- package/dist/angular.d.ts +311 -0
- package/dist/angular.js +2 -2
- package/dist/createConversationSession-BCb0D6bt.cjs +1 -0
- package/dist/{createConversationSession-DPrrr70o.js → createConversationSession-C7cnnWKW.js} +3 -3
- package/dist/createFormCollector-iCDwAwYJ.js +279 -0
- package/dist/createFormCollector-t_fGyuTD.cjs +1 -0
- package/dist/createMockClient-Br0TWgLO.js +97 -0
- package/dist/createMockClient-BwNLPjeT.cjs +1 -0
- package/dist/devtools.d.cts +311 -0
- package/dist/devtools.d.ts +311 -0
- package/dist/functions-IGSjjvF4.cjs +1 -0
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +510 -0
- package/dist/index.d.ts +510 -0
- package/dist/index.js +95 -90
- package/dist/react.cjs +3 -3
- package/dist/react.d.cts +375 -0
- package/dist/react.d.ts +375 -0
- package/dist/react.js +559 -422
- package/dist/rolldown-runtime-16Nf8qvH.cjs +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +311 -0
- package/dist/testing.d.ts +311 -0
- package/dist/testing.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +332 -0
- package/dist/vue.d.ts +332 -0
- package/dist/vue.js +133 -110
- package/dist/widget.cjs +1 -1
- package/dist/widget.d.cts +308 -0
- package/dist/widget.d.ts +308 -0
- package/dist/widget.js +7 -7
- package/package.json +1 -1
- package/dist/AgoClient-5VGybmvz.cjs +0 -8
- package/dist/AgoClient-DXrH2AMi.js +0 -964
- package/dist/createConversationSession-0WTqcCLK.cjs +0 -1
- package/dist/createFormCollector-1GKKwQV_.cjs +0 -1
- package/dist/createFormCollector-DYh90kiG.js +0 -305
- package/dist/createMockClient-C-wrjb2C.cjs +0 -1
- package/dist/createMockClient-we-XoPom.js +0 -79
- package/dist/functions-CPs7omgM.cjs +0 -1
- /package/dist/{autoContinue-CP9pJR-V.cjs → autoContinue-CcCTva-D.cjs} +0 -0
- /package/dist/{autoContinue-CC8K9mBU.js → autoContinue-D3Mmaaca.js} +0 -0
- /package/dist/{functions-tzyOZNp6.js → functions-CApuQZ2b.js} +0 -0
package/dist/angular.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./AgoClient-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./AgoClient-BGkFSNZF.cjs"),c=require("./autoContinue-CcCTva-D.cjs");var n=class{constructor(t){this.client=new o.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=s=>{i.next?.(s)};return e.on(t,r),{unsubscribe:()=>e.off(t,r)}}}}sendMessage(t,e){return this.client.sendMessage(t,e)}getConversations(){return this.client.getConversations()}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){return this.client.submitFeedback(t,e)}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){this.client.registerNavigationFunction(t,e)}unregisterNavigationFunction(){this.client.unregisterNavigationFunction()}enableAutoContinueAfterNavigation(t){return c.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 u(t){return{provide:n,useValue:new n(t)}}exports.AgoService=n;exports.provideAgo=u;
|
package/dist/angular.d.cts
CHANGED
|
@@ -66,6 +66,12 @@ declare class AgoClient {
|
|
|
66
66
|
private pendingApprovals;
|
|
67
67
|
/** App-provided gate deciding WHEN a paused turn resumes (see {@link registerResumeGate}). */
|
|
68
68
|
private resumeGate;
|
|
69
|
+
/**
|
|
70
|
+
* Proactive-mode controller, set when the client was created with
|
|
71
|
+
* `proactive` options or when `createAgoProactive(client, opts)` was called.
|
|
72
|
+
* `null` otherwise.
|
|
73
|
+
*/
|
|
74
|
+
proactive: ProactiveController | null;
|
|
69
75
|
constructor(config: AgoConfig);
|
|
70
76
|
/**
|
|
71
77
|
* Send a message and receive a streaming response
|
|
@@ -236,6 +242,14 @@ declare class AgoClient {
|
|
|
236
242
|
* Get all registered function schemas
|
|
237
243
|
*/
|
|
238
244
|
getRegisteredFunctions(): ClientFunctionSchema[];
|
|
245
|
+
/**
|
|
246
|
+
* Execute a registered client function locally, through the same
|
|
247
|
+
* FunctionRegistry path (result-size guard, error wrapping) as agent-invoked
|
|
248
|
+
* calls. Used by proactive nudge actions, where the user's explicit click on
|
|
249
|
+
* the action button constitutes the approval — nothing is submitted to the
|
|
250
|
+
* backend (there is no tool call to answer).
|
|
251
|
+
*/
|
|
252
|
+
executeClientFunction(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
239
253
|
/**
|
|
240
254
|
* Register a navigation function that lets AGO navigate users to different pages.
|
|
241
255
|
*
|
|
@@ -337,6 +351,9 @@ declare class AgoClient {
|
|
|
337
351
|
*/
|
|
338
352
|
notifyContextChanged(): void;
|
|
339
353
|
/* Excluded from this release type: emitFormEvent */
|
|
354
|
+
/* Excluded from this release type: emitProactiveEvent */
|
|
355
|
+
/* Excluded from this release type: getHttp */
|
|
356
|
+
/* Excluded from this release type: getConfiguredAgent */
|
|
340
357
|
/**
|
|
341
358
|
* Enable automatic capture of the current browser page (URL + title).
|
|
342
359
|
* Injected as a dynamic context entry named `browser-page`.
|
|
@@ -381,6 +398,7 @@ declare class AgoClient {
|
|
|
381
398
|
* Clean up resources
|
|
382
399
|
*/
|
|
383
400
|
destroy(): void;
|
|
401
|
+
/* Excluded from this release type: reviveAfterDestroy */
|
|
384
402
|
}
|
|
385
403
|
|
|
386
404
|
/**
|
|
@@ -497,6 +515,25 @@ export declare interface AgoClientEvents {
|
|
|
497
515
|
"connection:status": {
|
|
498
516
|
connected: boolean;
|
|
499
517
|
};
|
|
518
|
+
/**
|
|
519
|
+
* A proactive nudge passed every governor gate and is ready to display.
|
|
520
|
+
* `useProactiveNudge` / `<AgoNudge>` consume this; custom UIs should call
|
|
521
|
+
* `client.proactive.shown(nudge)` when they render it (impression tracking
|
|
522
|
+
* + frequency caps), then `accept(nudge)` / `dismiss(nudge)`.
|
|
523
|
+
*/
|
|
524
|
+
"nudge:ready": ProactiveNudgeInstance;
|
|
525
|
+
/** A nudge was displayed to the user (fires once per nudge). */
|
|
526
|
+
"nudge:shown": {
|
|
527
|
+
nudge: ProactiveNudgeInstance;
|
|
528
|
+
};
|
|
529
|
+
/** The user dismissed the nudge (its trigger is suppressed, see governor). */
|
|
530
|
+
"nudge:dismissed": {
|
|
531
|
+
nudge: ProactiveNudgeInstance;
|
|
532
|
+
};
|
|
533
|
+
/** The user accepted the nudge (its action ran / the chat is being seeded). */
|
|
534
|
+
"nudge:accepted": {
|
|
535
|
+
nudge: ProactiveNudgeInstance;
|
|
536
|
+
};
|
|
500
537
|
}
|
|
501
538
|
|
|
502
539
|
/**
|
|
@@ -558,6 +595,16 @@ export declare interface AgoConfig {
|
|
|
558
595
|
* with `maxResultBytes` on its definition; `Infinity` disables the guard.
|
|
559
596
|
*/
|
|
560
597
|
maxFunctionResultBytes?: number;
|
|
598
|
+
/**
|
|
599
|
+
* Enable the proactive mode: declarative triggers evaluated client-side
|
|
600
|
+
* against friction signals (dwell/idle time, rage clicks, route bounces…)
|
|
601
|
+
* that can surface a nudge before the user opens the chat. Equivalent to
|
|
602
|
+
* calling `createAgoProactive(client, proactive)` — the resulting controller
|
|
603
|
+
* is available as `client.proactive`. Requires the tenant-level kill-switch
|
|
604
|
+
* (`GET /api/sdk/v1/config` → `proactive.enabled`) to be on; disabled by
|
|
605
|
+
* default otherwise.
|
|
606
|
+
*/
|
|
607
|
+
proactive?: ProactiveOptions;
|
|
561
608
|
}
|
|
562
609
|
|
|
563
610
|
declare type AgoEventHandler<K extends AgoEventName> = (data: AgoClientEvents[K]) => void;
|
|
@@ -992,6 +1039,43 @@ declare interface FormSchema {
|
|
|
992
1039
|
required?: string[];
|
|
993
1040
|
}
|
|
994
1041
|
|
|
1042
|
+
/**
|
|
1043
|
+
* HTTP client with authentication headers
|
|
1044
|
+
*/
|
|
1045
|
+
declare class HttpClient {
|
|
1046
|
+
private baseUrl;
|
|
1047
|
+
private headers;
|
|
1048
|
+
constructor(config: AgoConfig);
|
|
1049
|
+
/**
|
|
1050
|
+
* Update configuration (e.g., JWT token)
|
|
1051
|
+
*/
|
|
1052
|
+
updateConfig(config: Partial<AgoConfig>): void;
|
|
1053
|
+
/**
|
|
1054
|
+
* Make a GET request
|
|
1055
|
+
*/
|
|
1056
|
+
get<T>(path: string): Promise<T>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Make a POST request with JSON body.
|
|
1059
|
+
*
|
|
1060
|
+
* `keepalive: true` lets the request survive a page unload (used by the
|
|
1061
|
+
* proactive event tracker's flush-on-hide — sendBeacon can't carry the auth
|
|
1062
|
+
* headers, so it's a keepalive fetch instead).
|
|
1063
|
+
*/
|
|
1064
|
+
post<T>(path: string, body?: unknown, options?: {
|
|
1065
|
+
keepalive?: boolean;
|
|
1066
|
+
}): Promise<T>;
|
|
1067
|
+
/**
|
|
1068
|
+
* Make a POST request and return the raw Response (for streaming)
|
|
1069
|
+
*/
|
|
1070
|
+
postStream(path: string, body?: unknown): Promise<Response>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Make a POST request with FormData (for file uploads)
|
|
1073
|
+
*/
|
|
1074
|
+
postFormData(path: string, formData: FormData): Promise<Response>;
|
|
1075
|
+
private request;
|
|
1076
|
+
private handleErrorResponse;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
995
1079
|
declare type MessageStatus = "IN_PROGRESS" | "DONE" | "ERROR" | "TODO" | "CANCELED"
|
|
996
1080
|
/**
|
|
997
1081
|
* The turn paused on client function call(s) (pause mode): the agent waits for
|
|
@@ -1000,6 +1084,21 @@ declare type MessageStatus = "IN_PROGRESS" | "DONE" | "ERROR" | "TODO" | "CANCEL
|
|
|
1000
1084
|
*/
|
|
1001
1085
|
| "WAITING_CLIENT";
|
|
1002
1086
|
|
|
1087
|
+
/**
|
|
1088
|
+
* Optional action attached to a nudge. Accepting a `functionName` action
|
|
1089
|
+
* executes the registered client function (same `FunctionRegistry` path as
|
|
1090
|
+
* agent-invoked calls); `setPageState` applies values through the registered
|
|
1091
|
+
* page-state controls.
|
|
1092
|
+
*/
|
|
1093
|
+
declare type NudgeAction = {
|
|
1094
|
+
label: string;
|
|
1095
|
+
functionName: string;
|
|
1096
|
+
arguments?: Record<string, unknown>;
|
|
1097
|
+
} | {
|
|
1098
|
+
label: string;
|
|
1099
|
+
setPageState: Record<string, unknown>;
|
|
1100
|
+
};
|
|
1101
|
+
|
|
1003
1102
|
declare interface Observable<T> {
|
|
1004
1103
|
subscribe(observer: {
|
|
1005
1104
|
next?: (value: T) => void;
|
|
@@ -1009,6 +1108,167 @@ declare interface Observable<T> {
|
|
|
1009
1108
|
};
|
|
1010
1109
|
}
|
|
1011
1110
|
|
|
1111
|
+
/**
|
|
1112
|
+
* Controller returned by {@link createAgoProactive} (also available as
|
|
1113
|
+
* `client.proactive`).
|
|
1114
|
+
*/
|
|
1115
|
+
declare interface ProactiveController {
|
|
1116
|
+
/** Persistently opt this browser out of proactive nudges. */
|
|
1117
|
+
optOut(): void;
|
|
1118
|
+
/** Undo {@link optOut}. */
|
|
1119
|
+
optIn(): void;
|
|
1120
|
+
isOptedOut(): boolean;
|
|
1121
|
+
/**
|
|
1122
|
+
* Tell the governor the user is already engaged (e.g. the chat widget is
|
|
1123
|
+
* open) — nudges are suppressed while `true`. Call from the UI layer.
|
|
1124
|
+
*/
|
|
1125
|
+
setEngaged(engaged: boolean): void;
|
|
1126
|
+
/** App-pushed field error counter (field NAME only — never values). */
|
|
1127
|
+
signalFieldError(fieldName: string): void;
|
|
1128
|
+
/** Current aggregated friction snapshot. */
|
|
1129
|
+
getSignalsSnapshot(): SignalsSnapshot;
|
|
1130
|
+
/** The nudge currently occupying the single-nudge slot, if any. */
|
|
1131
|
+
getActiveNudge(): ProactiveNudgeInstance | null;
|
|
1132
|
+
/**
|
|
1133
|
+
* Mark the nudge as displayed. Idempotent per nudge; counts it against the
|
|
1134
|
+
* frequency caps, tracks the impression, and emits `nudge:shown`.
|
|
1135
|
+
*/
|
|
1136
|
+
shown(nudge: ProactiveNudgeInstance): void;
|
|
1137
|
+
/**
|
|
1138
|
+
* Accept the nudge: run its action (if any), emit `nudge:accepted`, track,
|
|
1139
|
+
* and — for agent nudges or nudges with a `goal` — pre-seed the chat with a
|
|
1140
|
+
* hidden kickoff message so the agent starts the turn with full context.
|
|
1141
|
+
*/
|
|
1142
|
+
accept(nudge: ProactiveNudgeInstance): Promise<void>;
|
|
1143
|
+
/** Dismiss the nudge: suppress the trigger, track, emit `nudge:dismissed`. */
|
|
1144
|
+
dismiss(nudge: ProactiveNudgeInstance): void;
|
|
1145
|
+
/** Report a downstream conversion attributable to the nudge (analytics only). */
|
|
1146
|
+
markConverted(nudge: ProactiveNudgeInstance): void;
|
|
1147
|
+
/** Detach everything: listeners, timers, context provider, event flush. */
|
|
1148
|
+
destroy(): void;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/** A concrete nudge produced by the engine, carried by every `nudge:*` event. */
|
|
1152
|
+
declare interface ProactiveNudgeInstance {
|
|
1153
|
+
/** Client-generated uuid for this nudge instance (`client_nudge_id`). */
|
|
1154
|
+
id: string;
|
|
1155
|
+
triggerId: string;
|
|
1156
|
+
/** `static` = configured message; `agent` = backend LLM evaluation. */
|
|
1157
|
+
source: "static" | "agent";
|
|
1158
|
+
message: string;
|
|
1159
|
+
action?: NudgeAction;
|
|
1160
|
+
goal?: string;
|
|
1161
|
+
/** See {@link ProactiveTrigger.kickoff}. */
|
|
1162
|
+
kickoff?: string;
|
|
1163
|
+
createdAt: Date;
|
|
1164
|
+
/** Server-side nudge id (agent nudges only). */
|
|
1165
|
+
serverNudgeId?: string;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/** Options for {@link createAgoProactive} / `AgoConfig.proactive`. */
|
|
1169
|
+
declare interface ProactiveOptions {
|
|
1170
|
+
triggers: ProactiveTrigger[];
|
|
1171
|
+
/**
|
|
1172
|
+
* Global caps on nudges actually shown. `perSession` is in-memory (page
|
|
1173
|
+
* lifetime); `perDay` is persisted in localStorage with a date rollover —
|
|
1174
|
+
* best-effort by design (private browsing resets it); the costly LLM path is
|
|
1175
|
+
* additionally capped server-side.
|
|
1176
|
+
*/
|
|
1177
|
+
frequencyCap?: {
|
|
1178
|
+
perSession?: number;
|
|
1179
|
+
perDay?: number;
|
|
1180
|
+
};
|
|
1181
|
+
/** Evaluation tick, ms. Default 1000. Zero network per tick. */
|
|
1182
|
+
tickMs?: number;
|
|
1183
|
+
/** Storage backend for persisted governance state. Default `localStorage`. */
|
|
1184
|
+
storage?: StorageLike;
|
|
1185
|
+
/** Storage key for persisted governance state. Default `"ago_proactive"`. */
|
|
1186
|
+
storageKey?: string;
|
|
1187
|
+
/** Tuning of the signal detectors (rage-click window, throttles…). */
|
|
1188
|
+
signals?: SignalCollectorTuning;
|
|
1189
|
+
/**
|
|
1190
|
+
* Local demos and tests ONLY: bypass the remote kill-switch. When set, the
|
|
1191
|
+
* `GET /config` fetch is skipped and the kill-switch takes this value.
|
|
1192
|
+
* Leave unset in production — the tenant admin controls the feature, and
|
|
1193
|
+
* the evaluate endpoint stays gated server-side regardless.
|
|
1194
|
+
*/
|
|
1195
|
+
enabledOverride?: boolean;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/** A declarative proactive trigger. */
|
|
1199
|
+
declare interface ProactiveTrigger {
|
|
1200
|
+
/** Stable id, used for cooldowns, dismissal memory, and analytics. */
|
|
1201
|
+
id: string;
|
|
1202
|
+
/** Conjunction of matchers (see {@link ProactiveTriggerWhen}). */
|
|
1203
|
+
when: ProactiveTriggerWhen;
|
|
1204
|
+
/**
|
|
1205
|
+
* Min time between two firings of this trigger (persisted across reloads).
|
|
1206
|
+
* A firing is the moment the trigger passes the gates — including an agent
|
|
1207
|
+
* evaluation that decides NOT to intervene, so a persistent condition can't
|
|
1208
|
+
* hammer the evaluate endpoint. Default 60 000.
|
|
1209
|
+
*/
|
|
1210
|
+
cooldownMs?: number;
|
|
1211
|
+
/**
|
|
1212
|
+
* `'agent'` asks the backend's fast-LLM second filter whether (and how) to
|
|
1213
|
+
* intervene; a `static` object shows the given message with no network call.
|
|
1214
|
+
*/
|
|
1215
|
+
intervene: "agent" | {
|
|
1216
|
+
type: "static";
|
|
1217
|
+
message: string;
|
|
1218
|
+
action?: NudgeAction;
|
|
1219
|
+
};
|
|
1220
|
+
/**
|
|
1221
|
+
* What the agent should help with. Sent to the evaluate endpoint, and used to
|
|
1222
|
+
* pre-seed the chat turn when the user accepts the nudge.
|
|
1223
|
+
*/
|
|
1224
|
+
goal?: string;
|
|
1225
|
+
/**
|
|
1226
|
+
* User-voice line used to OPEN the conversation when the user accepts this
|
|
1227
|
+
* nudge and no conversation exists yet — a hidden kickoff cannot start one
|
|
1228
|
+
* (the backend rejects it). Sent as a visible user message, so write it in
|
|
1229
|
+
* the app's language ("Oui, aidez-moi à choisir !"). When a conversation is
|
|
1230
|
+
* already open, the SDK sends a hidden meta kickoff instead and this field
|
|
1231
|
+
* is unused. Without it, accepting with no open conversation skips the chat
|
|
1232
|
+
* pre-seed (the nudge action still runs).
|
|
1233
|
+
*/
|
|
1234
|
+
kickoff?: string;
|
|
1235
|
+
/**
|
|
1236
|
+
* How long a dismissal of this trigger's nudge suppresses it (persisted).
|
|
1237
|
+
* Default 24h.
|
|
1238
|
+
*/
|
|
1239
|
+
resurfaceAfterMs?: number;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* Conditions of a proactive trigger. Pure conjunction: EVERY specified matcher
|
|
1244
|
+
* must pass against the current {@link SignalsSnapshot}. Numeric fields are
|
|
1245
|
+
* `>=` thresholds.
|
|
1246
|
+
*/
|
|
1247
|
+
declare interface ProactiveTriggerWhen {
|
|
1248
|
+
/**
|
|
1249
|
+
* Route pattern the current pathname must match. Supports the SDK's route
|
|
1250
|
+
* styles: exact (`/billing`), `:param` segments (`/users/:id`), single-segment
|
|
1251
|
+
* wildcards (`/a/*` / `/b`), and a trailing `/*` that matches one or more
|
|
1252
|
+
* remaining segments (`/dossier/*`).
|
|
1253
|
+
*/
|
|
1254
|
+
route?: string;
|
|
1255
|
+
/** Min time since the last user activity, ms. */
|
|
1256
|
+
idleMs?: number;
|
|
1257
|
+
/** Min time spent on the current route, ms. */
|
|
1258
|
+
dwellMs?: number;
|
|
1259
|
+
/**
|
|
1260
|
+
* Partial deep match against the registered page state (funnel step,
|
|
1261
|
+
* filters…). Every key present here must deep-match the live value.
|
|
1262
|
+
*/
|
|
1263
|
+
pageState?: Partial<Record<string, unknown>>;
|
|
1264
|
+
/** Min rage-click bursts on the current route. */
|
|
1265
|
+
rageClicks?: number;
|
|
1266
|
+
/** Min A→B→A→B route oscillations this session. */
|
|
1267
|
+
routeBounces?: number;
|
|
1268
|
+
/** Per-field minimum error counts (field NAME → min count). */
|
|
1269
|
+
fieldErrors?: Record<string, number>;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1012
1272
|
/**
|
|
1013
1273
|
* Factory function that returns an Angular-compatible provider.
|
|
1014
1274
|
* Use in your app's `providers` array or `bootstrapApplication`:
|
|
@@ -1065,6 +1325,54 @@ declare interface SendMessageOptions {
|
|
|
1065
1325
|
clientFunctionsMode?: ClientFunctionsMode;
|
|
1066
1326
|
}
|
|
1067
1327
|
|
|
1328
|
+
/** Tuning knobs for the collector's detectors. All optional. */
|
|
1329
|
+
declare interface SignalCollectorTuning {
|
|
1330
|
+
/** Min gap between heavy activity work (route checks, notifications), ms. Default 250. */
|
|
1331
|
+
activityThrottleMs?: number;
|
|
1332
|
+
/** Rage click: clicks needed to count a burst. Default 3. */
|
|
1333
|
+
rageClickCount?: number;
|
|
1334
|
+
/** Rage click: max time between first and last click of a burst, ms. Default 1000. */
|
|
1335
|
+
rageClickWindowMs?: number;
|
|
1336
|
+
/** Rage click: max radius between clicks of a burst, px. Default 24. */
|
|
1337
|
+
rageClickRadiusPx?: number;
|
|
1338
|
+
/** Max routes kept in the recent-route sequence. Default 10. */
|
|
1339
|
+
maxRecentRoutes?: number;
|
|
1340
|
+
/** Max typed signals kept in the ring buffer. Default 50. */
|
|
1341
|
+
maxSignals?: number;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* Aggregated view of the current friction state. Registered as a dynamic
|
|
1346
|
+
* context provider (key `friction_signals`) so it rides along as
|
|
1347
|
+
* `client_context` on every message, and sent as `signals` to the proactive
|
|
1348
|
+
* evaluate endpoint.
|
|
1349
|
+
*/
|
|
1350
|
+
declare interface SignalsSnapshot {
|
|
1351
|
+
/** Current pathname. */
|
|
1352
|
+
route: string;
|
|
1353
|
+
/** Time spent on the current route, ms. */
|
|
1354
|
+
dwellMs: number;
|
|
1355
|
+
/** Time since the last user activity (pointer/key/scroll/touch), ms. */
|
|
1356
|
+
idleMs: number;
|
|
1357
|
+
/** Rage-click bursts detected on the current route. */
|
|
1358
|
+
rageClicks: number;
|
|
1359
|
+
/**
|
|
1360
|
+
* A→B→A→B route oscillations detected in the recent route sequence. Rolling
|
|
1361
|
+
* session counter (cross-route by nature); trigger cooldowns and dismissal
|
|
1362
|
+
* memory keep it from re-firing forever.
|
|
1363
|
+
*/
|
|
1364
|
+
routeBounces: number;
|
|
1365
|
+
/** App-pushed field error counters (field NAME → count), current route only. */
|
|
1366
|
+
fieldErrors: Record<string, number>;
|
|
1367
|
+
/** Most recent pathnames, oldest first (bounded). */
|
|
1368
|
+
recentRoutes: string[];
|
|
1369
|
+
/**
|
|
1370
|
+
* Merged `AgoStateControl.get()` snapshot of the registered page-state
|
|
1371
|
+
* controls (funnel step, filters…), or `null` when none are registered.
|
|
1372
|
+
*/
|
|
1373
|
+
pageState: Record<string, unknown> | null;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1068
1376
|
/**
|
|
1069
1377
|
* SSE stream chunk data
|
|
1070
1378
|
*/
|
|
@@ -1108,6 +1416,9 @@ declare interface SSEChunkData {
|
|
|
1108
1416
|
waiting_tool_call_ids?: string[];
|
|
1109
1417
|
}
|
|
1110
1418
|
|
|
1419
|
+
/** The slice of the Web Storage API that {@link createStore} relies on. */
|
|
1420
|
+
declare type StorageLike = Pick<Storage, "getItem" | "setItem">;
|
|
1421
|
+
|
|
1111
1422
|
/**
|
|
1112
1423
|
* Where a completed form is sent.
|
|
1113
1424
|
* - `"https://..."` (a bare string) — shorthand for `{ via: "client", url }`: the browser
|