sgiant-ai-widget 1.0.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/LICENSE +21 -0
- package/README.md +155 -0
- package/dist/ai-invalidation.d.ts +29 -0
- package/dist/ai-invalidation.d.ts.map +1 -0
- package/dist/ai-invalidation.js +121 -0
- package/dist/ai-invalidation.js.map +1 -0
- package/dist/contrast.d.ts +87 -0
- package/dist/contrast.d.ts.map +1 -0
- package/dist/contrast.js +151 -0
- package/dist/contrast.js.map +1 -0
- package/dist/directive.d.ts +37 -0
- package/dist/directive.d.ts.map +1 -0
- package/dist/directive.js +87 -0
- package/dist/directive.js.map +1 -0
- package/dist/dom.d.ts +83 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +146 -0
- package/dist/dom.js.map +1 -0
- package/dist/host-actions.d.ts +192 -0
- package/dist/host-actions.d.ts.map +1 -0
- package/dist/host-actions.js +443 -0
- package/dist/host-actions.js.map +1 -0
- package/dist/icons.d.ts +21 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +84 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +600 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4833 -0
- package/dist/index.js.map +1 -0
- package/dist/labels.d.ts +187 -0
- package/dist/labels.d.ts.map +1 -0
- package/dist/labels.js +232 -0
- package/dist/labels.js.map +1 -0
- package/dist/limits.d.ts +43 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/limits.js +48 -0
- package/dist/limits.js.map +1 -0
- package/dist/markdown.d.ts +23 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +0 -0
- package/dist/markdown.js.map +1 -0
- package/dist/message-chrome.d.ts +45 -0
- package/dist/message-chrome.d.ts.map +1 -0
- package/dist/message-chrome.js +101 -0
- package/dist/message-chrome.js.map +1 -0
- package/dist/pane-follow.d.ts +67 -0
- package/dist/pane-follow.d.ts.map +1 -0
- package/dist/pane-follow.js +61 -0
- package/dist/pane-follow.js.map +1 -0
- package/dist/prefix.d.ts +9 -0
- package/dist/prefix.d.ts.map +1 -0
- package/dist/prefix.js +9 -0
- package/dist/prefix.js.map +1 -0
- package/dist/proposal-summary.d.ts +19 -0
- package/dist/proposal-summary.d.ts.map +1 -0
- package/dist/proposal-summary.js +73 -0
- package/dist/proposal-summary.js.map +1 -0
- package/dist/replay.d.ts +125 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/replay.js +172 -0
- package/dist/replay.js.map +1 -0
- package/dist/safe-url.d.ts +47 -0
- package/dist/safe-url.d.ts.map +1 -0
- package/dist/safe-url.js +80 -0
- package/dist/safe-url.js.map +1 -0
- package/dist/sgiant-ai-widget.global.js +778 -0
- package/dist/sgiant-ai-widget.global.js.map +7 -0
- package/dist/specs.d.ts +173 -0
- package/dist/specs.d.ts.map +1 -0
- package/dist/specs.js +231 -0
- package/dist/specs.js.map +1 -0
- package/dist/storage.d.ts +77 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +124 -0
- package/dist/storage.js.map +1 -0
- package/dist/styles.d.ts +29 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +876 -0
- package/dist/styles.js.map +1 -0
- package/dist/ui-control.d.ts +8 -0
- package/dist/ui-control.d.ts.map +1 -0
- package/dist/ui-control.js +8 -0
- package/dist/ui-control.js.map +1 -0
- package/dist/ui-render.d.ts +75 -0
- package/dist/ui-render.d.ts.map +1 -0
- package/dist/ui-render.js +617 -0
- package/dist/ui-render.js.map +1 -0
- package/dist/ui-spec.d.ts +143 -0
- package/dist/ui-spec.d.ts.map +1 -0
- package/dist/ui-spec.js +288 -0
- package/dist/ui-spec.js.map +1 -0
- package/package.json +61 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Embeddable AI chatbox widget — framework-agnostic vanilla DOM, so it drops
|
|
3
|
+
* into the analytics app OR an external site with one call. It POSTs to a
|
|
4
|
+
* streaming chat endpoint and renders the reply live.
|
|
5
|
+
*
|
|
6
|
+
* Transport is intentionally tolerant: it reads a streamed body and accepts
|
|
7
|
+
* BOTH shapes this platform emits —
|
|
8
|
+
* - SSE : `data: {"type":"assistant_delta","text":"…"}`
|
|
9
|
+
* - NDJSON : `{"d":"…"}`
|
|
10
|
+
* plus `{type:"thread",threadId}` / `{type:"error"}` / `{type:"done"}`.
|
|
11
|
+
*
|
|
12
|
+
* SECURITY: the widget never holds long-lived secrets — the host supplies a
|
|
13
|
+
* token (Clerk session for in-app, or a short-lived embed token for external
|
|
14
|
+
* use). The backend's OBO scoping remains the real ceiling; this is just UI.
|
|
15
|
+
* See [[project_unified_managed_ai]].
|
|
16
|
+
*/
|
|
17
|
+
export { makePageContext, matchManifest, isKnownNavTarget, createHostActions, STANDARD_ACTION_PATHS, isNavigationAction, type PageContext, type PageManifestEntry, type NavTarget, type AppSurface, type HostActionsConfig, type HostActionHandler, } from "./host-actions";
|
|
18
|
+
export { parseJsonDirective, type ParsedDirective } from "./directive";
|
|
19
|
+
export { normalizeUiSpec, uiSpecMediaIds, KNOWN_UI_STATUSES, UI_SAY_ACTION, type UiSpec, type UiItem, type UiAction, type UiLayout, type UiStatus, } from "./ui-spec";
|
|
20
|
+
export { scanAiTargets, clearHighlight, isUiControlAction, isOperateAction, UI_CONTROL_ACTIONS, OPERATE_ACTIONS, type AiTargetInfo, type UiControlAction, type OperateAction, } from "./ui-control";
|
|
21
|
+
export { broadcastAiChange, subscribeAiChange, subscribeLiveSync, type AiChangeEvent, type LiveSyncOptions, } from "./ai-invalidation";
|
|
22
|
+
import type { PageContext } from "./host-actions";
|
|
23
|
+
import { PREFIX } from "./prefix";
|
|
24
|
+
export { genericProposalSummary } from "./proposal-summary";
|
|
25
|
+
import { type WidgetLabels } from "./labels";
|
|
26
|
+
export { WIDGET_LABELS, resolveWidgetLabels } from "./labels";
|
|
27
|
+
export type { WidgetLabels };
|
|
28
|
+
export { PREFIX };
|
|
29
|
+
/**
|
|
30
|
+
* The window event that opens the assistant panel. Owned here, next to the
|
|
31
|
+
* `openEventName` option that consumes it, so a nav link and the widget host
|
|
32
|
+
* can never drift onto different strings and silently produce a dead button.
|
|
33
|
+
*/
|
|
34
|
+
export declare const OPEN_ASSISTANT_EVENT = "sgiant:open-assistant";
|
|
35
|
+
import { type LoadedThreadItem } from "./replay";
|
|
36
|
+
export { buildThreadReplay } from "./replay";
|
|
37
|
+
export type { LoadedThreadItem } from "./replay";
|
|
38
|
+
/**
|
|
39
|
+
* A background job as the CHAT needs to draw it.
|
|
40
|
+
*
|
|
41
|
+
* Deliberately the GENERIC job shape (`JobSummary`'s status + done-of-total
|
|
42
|
+
* progress) rather than anything a site import or a report build owns: the
|
|
43
|
+
* platform is heading toward AI-defined job types, and a card that switched on
|
|
44
|
+
* the type would have to be rewritten for each of them. The host maps the API's
|
|
45
|
+
* `JobRecord` onto this — which is a structural widening, not a translation.
|
|
46
|
+
*
|
|
47
|
+
* Every field but `status` is optional so a job type that has no answer for one
|
|
48
|
+
* simply omits it, and the card draws what it was given.
|
|
49
|
+
*/
|
|
50
|
+
export interface WidgetJobView {
|
|
51
|
+
/**
|
|
52
|
+
* The job's id. Optional because a card fetched BY id already knows it — but
|
|
53
|
+
* required in practice for `listThreadJobs`, where the whole point is
|
|
54
|
+
* learning which jobs exist. A view without one simply cannot be re-attached.
|
|
55
|
+
*/
|
|
56
|
+
id?: string;
|
|
57
|
+
/** The generic job type, used ONLY to pick nicer copy for the types we happen
|
|
58
|
+
* to know. An unrecognised type renders with the neutral fallback title —
|
|
59
|
+
* which is the test that this stays type-agnostic. */
|
|
60
|
+
type?: string;
|
|
61
|
+
/** The coarse, type-agnostic lifecycle — `JobStatus` on the wire. */
|
|
62
|
+
status: "queued" | "running" | "done" | "failed" | "cancelled";
|
|
63
|
+
/** Done-of-total, with a short label for what is happening right now (the
|
|
64
|
+
* report section being built). `total` is null while it is not yet known. */
|
|
65
|
+
progress?: {
|
|
66
|
+
done?: number;
|
|
67
|
+
total?: number | null;
|
|
68
|
+
label?: string | null;
|
|
69
|
+
};
|
|
70
|
+
/** Overrides the type-derived title when the host knows better. */
|
|
71
|
+
title?: string | null;
|
|
72
|
+
/** Why it failed / what went wrong inside it. Shown verbatim. */
|
|
73
|
+
error?: string | null;
|
|
74
|
+
/** Where the finished work landed — an in-app, root-relative path the card
|
|
75
|
+
* links to (e.g. "/assets"). Omit when the job produced nothing to open. */
|
|
76
|
+
resultPath?: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Where this work can be WATCHED while it runs — an in-app, root-relative
|
|
79
|
+
* path, available from the moment the work exists rather than when it ends.
|
|
80
|
+
*
|
|
81
|
+
* Distinct from `resultPath`, which is the finished artefact and is null
|
|
82
|
+
* until then. A report is the case that needs it: its whole premise is a
|
|
83
|
+
* page you watch build, so "come and look" is useful at second one and
|
|
84
|
+
* useless at the end. In advanced view the widget points the app pane here
|
|
85
|
+
* itself (see `autoNavigateFrame`), which is the difference between telling
|
|
86
|
+
* someone to watch it build and showing them.
|
|
87
|
+
*
|
|
88
|
+
* Omit for work with nothing to watch — a job whose only observable state is
|
|
89
|
+
* the card itself.
|
|
90
|
+
*/
|
|
91
|
+
livePath?: string | null;
|
|
92
|
+
/**
|
|
93
|
+
* The MEDIA this job produced, by id — what lets a `[[ui:…]]` tile that was
|
|
94
|
+
* drawn empty fill itself in with the actual asset the moment the job
|
|
95
|
+
* finishes, instead of asking the client to go and look.
|
|
96
|
+
*
|
|
97
|
+
* An id and not a URL, for the same reason everywhere else in this file: ours
|
|
98
|
+
* are signed and short-lived, and a job runs for minutes. The widget
|
|
99
|
+
* resolves it through the same batched `resolveMediaUrls` every other tile
|
|
100
|
+
* uses. Omitted by every job type that produces no single asset.
|
|
101
|
+
*/
|
|
102
|
+
resultMediaId?: string | null;
|
|
103
|
+
/**
|
|
104
|
+
* The job's FLOW — the runner's own narration (which pages the AI picked,
|
|
105
|
+
* how it grouped them, what each step yielded), oldest first. Server text,
|
|
106
|
+
* escaped like every other untrusted string. Rides the same poll as
|
|
107
|
+
* progress, so the card is live while the job runs — and because it comes
|
|
108
|
+
* from the server, a page refresh replays it instead of losing it.
|
|
109
|
+
*/
|
|
110
|
+
events?: Array<{
|
|
111
|
+
/** "status" | "decision" | "step" | "problem" — coarse render hint. */
|
|
112
|
+
kind?: string;
|
|
113
|
+
message: string;
|
|
114
|
+
at?: string;
|
|
115
|
+
/** The runner's MACHINE-readable note on this step. `code` is the one key
|
|
116
|
+
* read here: it lets a step be shown in the reader's own language instead
|
|
117
|
+
* of in the runner's English, which has no request locale to work from.
|
|
118
|
+
*
|
|
119
|
+
* Nullable, not merely optional: the wire type sends an explicit `null`
|
|
120
|
+
* for a step that carries no payload, and the host forwards the API's
|
|
121
|
+
* events verbatim rather than mapping them one by one. */
|
|
122
|
+
data?: Record<string, unknown> | null;
|
|
123
|
+
}>;
|
|
124
|
+
}
|
|
125
|
+
export interface AiChatWidgetOptions {
|
|
126
|
+
/** Streaming chat endpoint (POST). e.g. https://api.example.com/accounts/:id/ai/chat */
|
|
127
|
+
endpoint: string;
|
|
128
|
+
/** Media-upload endpoint (POST multipart) for chat attachments — e.g.
|
|
129
|
+
* https://api.example.com/accounts/:id/assets/media. When set (authed
|
|
130
|
+
* surfaces), the composer shows a paperclip so the user can attach files the
|
|
131
|
+
* assistant reads. Uploads are sent SESSION-scoped (`session=1` + the
|
|
132
|
+
* current threadId): reachable from the chat history, never filed into the
|
|
133
|
+
* asset library. Omit on the anonymous surface (nowhere to store). */
|
|
134
|
+
uploadEndpoint?: string;
|
|
135
|
+
/** Account the chat is scoped to. Omit for the public/anonymous endpoint. */
|
|
136
|
+
accountId?: string;
|
|
137
|
+
/**
|
|
138
|
+
* DYNAMIC account scope, read at call time and preferred over `accountId`.
|
|
139
|
+
* For hosts whose page context changes while the widget lives on (the admin
|
|
140
|
+
* backoffice follows staff across accounts): re-creating the widget per
|
|
141
|
+
* account aborts an in-flight reply and visibly resets the chat, so such a
|
|
142
|
+
* host mounts ONE instance and feeds the current account through here.
|
|
143
|
+
*/
|
|
144
|
+
getAccountScope?: () => string | undefined;
|
|
145
|
+
/** Dynamic twin of `uploadEndpoint`, same reason. The attach button exists
|
|
146
|
+
* when either is provided. */
|
|
147
|
+
getUploadEndpoint?: () => string | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* Extra fields merged into every POST body — e.g. `{ visitorId, source }` for
|
|
150
|
+
* the anonymous marketing endpoint. Never put secrets here; it's plain JSON.
|
|
151
|
+
*/
|
|
152
|
+
extraBody?: Record<string, unknown>;
|
|
153
|
+
/**
|
|
154
|
+
* Dynamic per-send context (current page, recent navigation, last actions).
|
|
155
|
+
* Merged into each POST body under `pageContext` so the assistant can answer
|
|
156
|
+
* about what the user is looking at. Called right before every send.
|
|
157
|
+
*/
|
|
158
|
+
getContext?: () => PageContext | Record<string, unknown> | undefined | Promise<PageContext | Record<string, unknown> | undefined>;
|
|
159
|
+
/**
|
|
160
|
+
* Window event name that opens the panel — pass `OPEN_ASSISTANT_EVENT`, so a
|
|
161
|
+
* nav/sidebar link elsewhere in the app can summon the widget.
|
|
162
|
+
*/
|
|
163
|
+
openEventName?: string;
|
|
164
|
+
/**
|
|
165
|
+
* How the host phrases a confirm card for its OWN write tools.
|
|
166
|
+
*
|
|
167
|
+
* The card is the security boundary — the user approves the sentence, not the
|
|
168
|
+
* tool call — so a host that has write tools should supply both of these.
|
|
169
|
+
* Anything not covered falls through to a generic renderer that describes the
|
|
170
|
+
* call from its arguments, which is what makes an unrecognised tool safe
|
|
171
|
+
* rather than blank.
|
|
172
|
+
*
|
|
173
|
+
* sgiant's own fifteen branches live in `@sgiant/ai-apply`; they were in here
|
|
174
|
+
* until 2026-09-02, naming sgiant tools to people embedding a chat bubble.
|
|
175
|
+
*/
|
|
176
|
+
/** Tool name -> card TITLE. Falls back to the `proposalGeneric` label. */
|
|
177
|
+
proposalTitles?: Record<string, string>;
|
|
178
|
+
/** Tool name + args -> card BODY. Return null to use the generic renderer. */
|
|
179
|
+
proposalSummary?: (name: string, args: Record<string, unknown>) => string | null;
|
|
180
|
+
/**
|
|
181
|
+
* The status badge's vocabulary, all host-supplied and all optional.
|
|
182
|
+
*
|
|
183
|
+
* These were hard-coded to sgiant's own tools until 2026-09-02 — the map
|
|
184
|
+
* literally listed `run_stats_query` and `list_hotels`. That is host
|
|
185
|
+
* configuration sitting in a package meant to be generic, the same mistake
|
|
186
|
+
* `applyProposal` was: harmless while there is one host, nonsense the moment
|
|
187
|
+
* a stranger installs it and the badge flips to "Analytics" for a tool their
|
|
188
|
+
* product does not have.
|
|
189
|
+
*
|
|
190
|
+
* Omit them all and the badge simply never changes role, which is the right
|
|
191
|
+
* behaviour for a host that has no such concept.
|
|
192
|
+
*/
|
|
193
|
+
/** Role id -> display name, e.g. `{ analytics: "Analytics" }`. Unknown ids
|
|
194
|
+
* fall back to the id itself, so a missing entry degrades to something
|
|
195
|
+
* readable rather than blank. */
|
|
196
|
+
roleNames?: Record<string, string>;
|
|
197
|
+
/** Tool name -> role id. Flips the badge as the agent runs that tool. */
|
|
198
|
+
toolRoles?: Record<string, string>;
|
|
199
|
+
/** Host action name -> role id. Flips the badge when the action is invoked. */
|
|
200
|
+
actionRoles?: Record<string, string>;
|
|
201
|
+
/** Bearer token (Clerk session or embed token). Use getToken for refresh. */
|
|
202
|
+
token?: string;
|
|
203
|
+
/** Async token provider — called before each send (overrides `token`). */
|
|
204
|
+
getToken?: () => string | Promise<string>;
|
|
205
|
+
/** Send cookies (same-origin in-app embedding). Default false. */
|
|
206
|
+
withCredentials?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Authed surfaces (org + admin): a persistent status bar shows the remaining
|
|
209
|
+
* AI credits and which Copilot role is acting. Called on open + after each turn;
|
|
210
|
+
* return the current credit balance (null = unknown/hidden).
|
|
211
|
+
*/
|
|
212
|
+
getBalance?: () => Promise<number | null> | number | null;
|
|
213
|
+
/** Assistant name shown in the header + bubble aria-label. Default "Copilot". */
|
|
214
|
+
title?: string;
|
|
215
|
+
/** Small line under the name. Default "Growth assistant". */
|
|
216
|
+
subtitle?: string;
|
|
217
|
+
/** Avatar image URL (the brand logo mark). Falls back to a crescent glyph. */
|
|
218
|
+
avatarUrl?: string;
|
|
219
|
+
/** CSS gradient for the chrome (header/bubble) for a premium look. */
|
|
220
|
+
gradient?: string;
|
|
221
|
+
greeting?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Page-aware shortcuts. Returns a few suggested questions/actions for the
|
|
224
|
+
* CURRENT page (the host derives them from the path) — rendered as clickable
|
|
225
|
+
* chips under the greeting whenever the conversation is empty. Clicking a chip
|
|
226
|
+
* sends it as the user's message. Called on open + new chat, so the shortcuts
|
|
227
|
+
* follow the user around the app. Return [] (or omit) to show none.
|
|
228
|
+
*/
|
|
229
|
+
getSuggestions?: () => string[] | Promise<string[]>;
|
|
230
|
+
accent?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Theme token overrides. The widget's entire stylesheet reads from
|
|
233
|
+
* `--aiw-*` CSS custom properties set on its roots; pass any subset here to
|
|
234
|
+
* restyle it (e.g. a dark theme: `{ surface:"#16161e", bg:"#101016",
|
|
235
|
+
* text:"#e7e7ec", "text-2":"#b6b6c2", muted:"#8a8a96", border:"#2b2b36",
|
|
236
|
+
* "border-strong":"#3a3a48", "border-soft":"#22222c" }`). Known tokens:
|
|
237
|
+
* accent, accent-contrast, gradient, surface, surface-2, bg, text, text-2,
|
|
238
|
+
* muted, border, border-strong, border-soft. `accent`/`gradient` options
|
|
239
|
+
* remain the shorthand for the two most common ones.
|
|
240
|
+
*/
|
|
241
|
+
theme?: Record<string, string>;
|
|
242
|
+
/**
|
|
243
|
+
* Custom directive renderers — the OPEN extension point. The assistant can
|
|
244
|
+
* emit `[[<tag>:{json}]]` for any tag registered here; the widget strips the
|
|
245
|
+
* directive, mounts a host element in the log, and calls your renderer with
|
|
246
|
+
* the parsed JSON. Return a disposer to be called when the message clears.
|
|
247
|
+
* Built-in tags (widget/preview/navigate/action/chips/form) are reserved and
|
|
248
|
+
* cannot be overridden. Also available post-mount via
|
|
249
|
+
* `handle.registerRenderer(tag, fn)`.
|
|
250
|
+
*/
|
|
251
|
+
renderers?: Record<string, DirectiveRenderer>;
|
|
252
|
+
/**
|
|
253
|
+
* Fallback chart renderer for embeds WITHOUT `renderDataWidget` (no React
|
|
254
|
+
* host). When the assistant streams a `render_chart` frame and no host
|
|
255
|
+
* renderer is wired, this is consulted before the built-in degrade
|
|
256
|
+
* (kpi → stat, else a plain table) — plug a lightweight chart lib here to
|
|
257
|
+
* get real charts in a standalone embed. Same contract as renderDataWidget.
|
|
258
|
+
*/
|
|
259
|
+
renderChartFallback?: (host: HTMLElement, spec: unknown, rows: unknown, comparisonRows?: unknown) => (() => void) | void;
|
|
260
|
+
position?: "bottom-right" | "bottom-left";
|
|
261
|
+
/** Mount target; defaults to document.body. */
|
|
262
|
+
container?: HTMLElement;
|
|
263
|
+
/**
|
|
264
|
+
* When set, the conversation (thread id + messages) is persisted to
|
|
265
|
+
* localStorage under this key and restored on reload — so a page refresh
|
|
266
|
+
* doesn't lose the chat. Use a per-visitor/per-user key (e.g. the visitorId).
|
|
267
|
+
*/
|
|
268
|
+
persistKey?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Scope for LAYOUT preferences — the panel's dragged position and its
|
|
271
|
+
* open/closed state. Distinct from `persistKey` (which scopes the CONVERSATION)
|
|
272
|
+
* on purpose: a host that changes persistKey per account (so each account keeps
|
|
273
|
+
* its own thread) would otherwise reset the panel's position and re-close it on
|
|
274
|
+
* every account switch — the user drags it once and it "jumps" as they navigate.
|
|
275
|
+
* Pass a stable app-level value (e.g. "backoffice" / "org") so position + open
|
|
276
|
+
* state follow the user across accounts and pages. Falls back to `persistKey`.
|
|
277
|
+
*/
|
|
278
|
+
layoutKey?: string;
|
|
279
|
+
/**
|
|
280
|
+
* Prefix for every key this widget writes to `localStorage`. Defaults to
|
|
281
|
+
* `"aiw"`, which is deliberately NEUTRAL — it matches the `--aiw-*` custom
|
|
282
|
+
* properties the stylesheet already uses and names no product.
|
|
283
|
+
*
|
|
284
|
+
* It exists because a published widget writes into a stranger's browser
|
|
285
|
+
* (#306). Keys read `aiw:draft:<persistKey>`, `aiw:sound`, `aiw:opened`; a
|
|
286
|
+
* host that embeds more than one widget, or wants its own namespace, sets
|
|
287
|
+
* this.
|
|
288
|
+
*
|
|
289
|
+
* CHANGING IT ORPHANS EXISTING DATA rather than migrating it: the old keys
|
|
290
|
+
* are simply not read any more, so a returning user gets an empty draft and a
|
|
291
|
+
* default position. sgiant's own surfaces pass `"ayca"` for exactly that
|
|
292
|
+
* reason — it is what their keys were called before this option existed.
|
|
293
|
+
*/
|
|
294
|
+
storageNamespace?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Called when the user clicks "Report issue" on an error state — wire it to
|
|
297
|
+
* your Backoffice/contact endpoint so the admin team gets the failed turn.
|
|
298
|
+
*/
|
|
299
|
+
onReportIssue?: (details: {
|
|
300
|
+
error: string;
|
|
301
|
+
lastUserMessage: string;
|
|
302
|
+
threadId?: string;
|
|
303
|
+
}) => void | Promise<void>;
|
|
304
|
+
/**
|
|
305
|
+
* Flag the CURRENT conversation for oversight (agent/admin surfaces only). When
|
|
306
|
+
* provided, a flag control appears in the header; clicking it asks for a reason
|
|
307
|
+
* and calls this with the reason + the live thread id. Wire it to the flags API
|
|
308
|
+
* (e.g. POST /admin/ai/conversations/:kind/:threadId/flag). Omit to hide the
|
|
309
|
+
* control (e.g. the public visitor widget). Throw to surface a failure.
|
|
310
|
+
*/
|
|
311
|
+
onFlag?: (details: {
|
|
312
|
+
reason: string;
|
|
313
|
+
threadId?: string;
|
|
314
|
+
}) => void | Promise<void>;
|
|
315
|
+
/**
|
|
316
|
+
* Lead capture. When the assistant emits the sentinel `[[collect-email]]` in a
|
|
317
|
+
* reply, the widget strips it and renders an inline email form; submitting it
|
|
318
|
+
* calls this with the email (+ the last user message as context). Wire it to
|
|
319
|
+
* your contact/lead API. Omit to disable lead capture entirely.
|
|
320
|
+
*/
|
|
321
|
+
onLead?: (lead: {
|
|
322
|
+
email: string;
|
|
323
|
+
context?: string;
|
|
324
|
+
}) => Promise<void>;
|
|
325
|
+
/**
|
|
326
|
+
* Generic AI-rendered input forms. When the assistant emits a
|
|
327
|
+
* `[[form:{...}]]` directive, the widget renders the described form inline and,
|
|
328
|
+
* on submit, calls this with the directive's `action` name + the collected
|
|
329
|
+
* field values. SECURITY: the AI only names an `action`; the HOST maps action
|
|
330
|
+
* names to real API calls here — the AI can never call an arbitrary endpoint.
|
|
331
|
+
* Throw to surface a retry. Return a string to show as the success message.
|
|
332
|
+
*/
|
|
333
|
+
onWidgetAction?: (action: string, data: Record<string, string>) => Promise<string | void>;
|
|
334
|
+
/**
|
|
335
|
+
* Show an expand/restore control in the header to grow the panel to a larger
|
|
336
|
+
* reading size (and back). Default true. Set false for tight embeds.
|
|
337
|
+
*/
|
|
338
|
+
expandable?: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Offer an "auto-navigate" toggle in the header. When the user turns it ON,
|
|
341
|
+
* the assistant's `[[navigate:…]]` suggestions are followed AUTOMATICALLY (no
|
|
342
|
+
* confirm button) — a hands-free "drive me there" mode. State is BROWSER-LOCAL
|
|
343
|
+
* (localStorage), off by default, and per-user controlled. In-app ACTIONS that
|
|
344
|
+
* carry a `confirm` (anything that changes state or costs credits) are NEVER
|
|
345
|
+
* auto-run — only pure page navigation is. Set true on surfaces where
|
|
346
|
+
* navigation is enabled (org/admin/marketing).
|
|
347
|
+
*/
|
|
348
|
+
autoNavOption?: boolean;
|
|
349
|
+
/**
|
|
350
|
+
* ADVANCED VIEW. When `getAdvancedUrl` is provided, a header toggle opens a
|
|
351
|
+
* full-screen split: the chat on the left and the app in an <iframe> on the
|
|
352
|
+
* right that Copilot can DRIVE (highlight / fill / click) via the postMessage
|
|
353
|
+
* agent bridge (`sgiant-ai-agent-bridge`). The framed page must mount the
|
|
354
|
+
* agent (`mountAiAgent`). `getAdvancedUrl()` returns the embed URL for the
|
|
355
|
+
* CURRENT page; `getAdvancedUrl(path)` returns it for an account-relative path
|
|
356
|
+
* (used to navigate the frame). Omit to disable advanced view.
|
|
357
|
+
*/
|
|
358
|
+
getAdvancedUrl?: (path?: string) => string;
|
|
359
|
+
/**
|
|
360
|
+
* Map a navigation-class action (`navigate` / `open-*`) to the account-relative
|
|
361
|
+
* path it opens, so advanced view can route it to the FRAME instead of the
|
|
362
|
+
* parent app. Return null for non-navigation actions (they run host-side). Only
|
|
363
|
+
* consulted in advanced view.
|
|
364
|
+
*/
|
|
365
|
+
resolveActionPath?: (name: string, data: Record<string, string>) => string | null;
|
|
366
|
+
/** Origin the embedded app is served from, for the agent bridge. Defaults to
|
|
367
|
+
* the current origin (same-origin embedding). */
|
|
368
|
+
advancedOrigin?: string;
|
|
369
|
+
/** Labels for the advanced-view controls (i18n; host supplies translations). */
|
|
370
|
+
advancedLabel?: string;
|
|
371
|
+
exitAdvancedLabel?: string;
|
|
372
|
+
collapsePaneLabel?: string;
|
|
373
|
+
expandPaneLabel?: string;
|
|
374
|
+
/** Labels for the advanced-view fullscreen toggle (edge-to-edge on/off). */
|
|
375
|
+
fullscreenLabel?: string;
|
|
376
|
+
exitFullscreenLabel?: string;
|
|
377
|
+
/** Label for the draggable chat⇆app divider (advanced view; drag to resize,
|
|
378
|
+
* double-click to reset). Width persists to localStorage per host. */
|
|
379
|
+
resizeLabel?: string;
|
|
380
|
+
/**
|
|
381
|
+
* Past-conversation history. When provided, a history control appears in the
|
|
382
|
+
* header; opening it lists the user's prior threads. Picking one calls
|
|
383
|
+
* `loadThread` and replays its messages. Wire these to the authed endpoints
|
|
384
|
+
* (e.g. GET /accounts/:id/ai/threads and …/threads/:threadId/messages). Omit
|
|
385
|
+
* to disable history (the widget still restores the last thread via persistKey).
|
|
386
|
+
*/
|
|
387
|
+
listThreads?: () => Promise<Array<{
|
|
388
|
+
id: string;
|
|
389
|
+
title?: string | null;
|
|
390
|
+
updatedAt?: string;
|
|
391
|
+
starred?: boolean;
|
|
392
|
+
}>>;
|
|
393
|
+
/** Toggle the SHARED star (team bookmark) on a past thread from the history
|
|
394
|
+
* panel. Resolves to the new starred state. Omit to hide the star toggle. */
|
|
395
|
+
starThread?: (threadId: string) => Promise<{
|
|
396
|
+
starred: boolean;
|
|
397
|
+
}>;
|
|
398
|
+
/** Load one past thread (oldest→newest) for replay in the log. Items are
|
|
399
|
+
* messages OR inline data widgets, so reopening a conversation restores its
|
|
400
|
+
* charts/tables — not just text (matching the full-page assistant). */
|
|
401
|
+
loadThread?: (threadId: string) => Promise<LoadedThreadItem[]>;
|
|
402
|
+
/** Switch the active branch of a conversation tree (the ‹n/m› sibling
|
|
403
|
+
* switcher, ChatGPT/Claude-style edit-and-continue). POSTs the chosen leaf so
|
|
404
|
+
* the server recomputes the active path; the widget then reloads the thread
|
|
405
|
+
* via `loadThread`. Omit on hosts without branching → the edit/regenerate/
|
|
406
|
+
* switcher controls stay hidden. */
|
|
407
|
+
setActiveLeaf?: (threadId: string, messageId: string) => Promise<void>;
|
|
408
|
+
/** UI labels for the branching controls. The host feeds translated strings
|
|
409
|
+
* (per the repo i18n rule); the widget uses the English fallbacks below only
|
|
410
|
+
* when an override is absent — it never hardcodes a user-visible string. */
|
|
411
|
+
editLabel?: string;
|
|
412
|
+
regenerateLabel?: string;
|
|
413
|
+
saveLabel?: string;
|
|
414
|
+
cancelLabel?: string;
|
|
415
|
+
/** Record a thumbs up/down on an assistant reply (the chat quality signal).
|
|
416
|
+
* value: 1 = up, -1 = down, 0 = clear. When provided, vote buttons appear on
|
|
417
|
+
* replayed assistant turns; omit on hosts without the vote endpoint → buttons
|
|
418
|
+
* hidden. Wire to POST /ai/vote (reuses the AiMessageVote backend), mirroring
|
|
419
|
+
* the React panel's `vote`. */
|
|
420
|
+
vote?: (input: {
|
|
421
|
+
threadId: string;
|
|
422
|
+
messageId: string;
|
|
423
|
+
value: 1 | -1 | 0;
|
|
424
|
+
model?: string;
|
|
425
|
+
/** One line of free text from the quality prompt (#299). The reason is
|
|
426
|
+
* where the signal actually is — "it answered the wrong question" is
|
|
427
|
+
* actionable in a way a finer number is not. */
|
|
428
|
+
reason?: string;
|
|
429
|
+
}) => Promise<void>;
|
|
430
|
+
voteUpLabel?: string;
|
|
431
|
+
voteDownLabel?: string;
|
|
432
|
+
/** Translated copy for the widget's OWN chrome — header, More menu, composer,
|
|
433
|
+
* status bar, activity chips, proposal cards, history panel, error state. The
|
|
434
|
+
* widget is vanilla DOM and can't call i18next, so the host builds this from
|
|
435
|
+
* its own t() via `resolveWidgetLabels(t)`. Any omitted key falls back to the
|
|
436
|
+
* English default in WIDGET_LABELS — the widget never hardcodes visible copy. */
|
|
437
|
+
labels?: Partial<WidgetLabels>;
|
|
438
|
+
/** Where "Sign up" sends the visitor when the free token allowance runs out
|
|
439
|
+
* (and from the meter's CTA). When set, the widget shows the token meter. */
|
|
440
|
+
signupUrl?: string;
|
|
441
|
+
/**
|
|
442
|
+
* Rich-content render hooks (in-app React hosts). When provided, the widget
|
|
443
|
+
* hands the assistant's final reply markdown / data-widget frames to the host
|
|
444
|
+
* to render with the REAL @sgiant/ui components (<Markdown>, <AiDataWidget>) —
|
|
445
|
+
* pixel-identical to the full-page assistant. Each returns an optional
|
|
446
|
+
* disposer the widget calls when it clears that message (new chat / history
|
|
447
|
+
* switch / destroy) so the host can unmount its React root. Omit on external
|
|
448
|
+
* embeds (no React) → the widget uses its built-in lightweight renderers.
|
|
449
|
+
*/
|
|
450
|
+
renderMarkdown?: (host: HTMLElement, markdown: string) => (() => void) | void;
|
|
451
|
+
/** Render an assistant `render_chart` frame (spec + rows) as a real chart. */
|
|
452
|
+
renderDataWidget?: (host: HTMLElement, spec: unknown, rows: unknown, comparisonRows?: unknown) => (() => void) | void; /**
|
|
453
|
+
* Resolve library media ids to URLs the browser can load, for `[[ui:…]]`
|
|
454
|
+
* cards. Called ONCE per card with every id it needs; return a map (omit an
|
|
455
|
+
* id that can't be resolved — the tile then says so rather than sitting
|
|
456
|
+
* blank).
|
|
457
|
+
*
|
|
458
|
+
* This is the reason a composed card can show the account's own pictures at
|
|
459
|
+
* all: the widget is embeddable and has no session of its own, so only the
|
|
460
|
+
* host can mint a signed URL. It is also why the spec names media by ID and
|
|
461
|
+
* never by URL — an id resolves against media the ACCOUNT owns, so a model
|
|
462
|
+
* that invents one gets an empty tile instead of the client's browser
|
|
463
|
+
* fetching a URL the model chose.
|
|
464
|
+
*/
|
|
465
|
+
resolveMediaUrls?: (ids: string[]) => Promise<Record<string, string>>;
|
|
466
|
+
/**
|
|
467
|
+
* Apply a confirm-gated WRITE-tool proposal (e.g. `organize_assets`). The AI
|
|
468
|
+
* never mutates directly — it proposes; the widget shows a card and THIS runs
|
|
469
|
+
* only when the user clicks Apply (a Clerk-authed action in the host). Map the
|
|
470
|
+
* tool name → a real, access-checked API call. Return a string to show as the
|
|
471
|
+
* success note; throw to let the user retry. Omit to hide write proposals.
|
|
472
|
+
*/
|
|
473
|
+
/**
|
|
474
|
+
* Where a report lives in THIS app. The widget runs in three shells with
|
|
475
|
+
* different route shapes, so it cannot build the URL itself — and guessing
|
|
476
|
+
* one would produce a link that 404s in two of them.
|
|
477
|
+
*/
|
|
478
|
+
reportHref?: (reportId: string) => string;
|
|
479
|
+
onApplyProposal?: (name: string, args: Record<string, unknown>,
|
|
480
|
+
/** The account this proposal is FOR, when the worker said. The host applies
|
|
481
|
+
* on its own session and would otherwise aim at whatever account its page
|
|
482
|
+
* is scoped to — which is not always the account the assistant reasoned
|
|
483
|
+
* about, and on a platform page is not an account at all. */
|
|
484
|
+
opts?: {
|
|
485
|
+
accountId?: string;
|
|
486
|
+
artifactId?: string;
|
|
487
|
+
}) => Promise<string | void | {
|
|
488
|
+
message?: string;
|
|
489
|
+
jobId?: string;
|
|
490
|
+
reportId?: string;
|
|
491
|
+
}>;
|
|
492
|
+
/**
|
|
493
|
+
* OBSERVE the human's answer to a `question` frame — analytics, or resolving
|
|
494
|
+
* the same question on another surface (a critical one also pushed to
|
|
495
|
+
* Telegram). NOT the delivery path: the ask_user turn has already ENDED
|
|
496
|
+
* server-side, so the widget itself delivers the answer as the next user
|
|
497
|
+
* message. A host that omits this loses nothing but the notification.
|
|
498
|
+
*/
|
|
499
|
+
onAnswer?: (answer: {
|
|
500
|
+
questionId: string;
|
|
501
|
+
optionIds?: string[];
|
|
502
|
+
text?: string;
|
|
503
|
+
}) => void;
|
|
504
|
+
/**
|
|
505
|
+
* Read ONE background job, GENERICALLY. Wire it to the type-agnostic job read
|
|
506
|
+
* (`GET /accounts/:id/jobs/:jobId`) — never to a per-type endpoint, because
|
|
507
|
+
* the whole point of the generic row is that a fourth job type must not need a
|
|
508
|
+
* new poller here. Whenever `onApplyProposal` answers with a `jobId`, the
|
|
509
|
+
* widget draws a live card in the conversation and polls this until the job
|
|
510
|
+
* reaches a terminal state.
|
|
511
|
+
*
|
|
512
|
+
* Omit it and nothing changes: an apply that returns a job id is reported
|
|
513
|
+
* exactly as it is today (a one-line "started ✓" and no card).
|
|
514
|
+
*/
|
|
515
|
+
getJob?: (jobId: string) => Promise<WidgetJobView | null>;
|
|
516
|
+
/**
|
|
517
|
+
* Read ONE report. The single deliberate exception to `getJob`'s "never a
|
|
518
|
+
* per-type endpoint" rule, and it is worth stating why.
|
|
519
|
+
*
|
|
520
|
+
* A report stopped being a `job` row: it owns its lifecycle, its narration
|
|
521
|
+
* and its stage vocabulary outright, and after the contract migration there
|
|
522
|
+
* is no generic row to read. That is not a fourth job type wanting its own
|
|
523
|
+
* poller — it is a second SOURCE of tracked work, which is why the fan-out
|
|
524
|
+
* below is untouched and only the READ dispatches. One poll loop still
|
|
525
|
+
* serves every card and every tile.
|
|
526
|
+
*
|
|
527
|
+
* Omit it and a report card simply never polls.
|
|
528
|
+
*/
|
|
529
|
+
getReport?: (reportId: string) => Promise<WidgetJobView | null>;
|
|
530
|
+
/**
|
|
531
|
+
* Jobs still RUNNING for a thread, asked of the server on reopen.
|
|
532
|
+
*
|
|
533
|
+
* The widget also remembers its own jobs in browser storage, which is fast
|
|
534
|
+
* and enough for the device that started them — and wrong everywhere else. A
|
|
535
|
+
* report begun on a phone, or before the cache was cleared, left the desktop
|
|
536
|
+
* showing a conversation with nothing happening in it while it ran. This is
|
|
537
|
+
* the authoritative answer; storage is the instant one.
|
|
538
|
+
*
|
|
539
|
+
* Omit it and re-attach stays per-browser, exactly as before.
|
|
540
|
+
*/
|
|
541
|
+
listThreadJobs?: (threadId: string) => Promise<WidgetJobView[]>;
|
|
542
|
+
/**
|
|
543
|
+
* Cancel a running/queued job the chat is watching (the card's Cancel
|
|
544
|
+
* button). Cooperative on the server — a report stops at the next step
|
|
545
|
+
* boundary — so the card keeps polling and flips to "Cancelled" when the
|
|
546
|
+
* runner actually stops. Omit to hide the button.
|
|
547
|
+
*/
|
|
548
|
+
cancelJob?: (jobId: string) => Promise<void>;
|
|
549
|
+
/** Cancel a running/queued REPORT — the same cooperative contract as
|
|
550
|
+
* `cancelJob`, against the report's own route. Omit to hide the button on
|
|
551
|
+
* report cards. */
|
|
552
|
+
cancelReport?: (reportId: string) => Promise<void>;
|
|
553
|
+
/** This thread's UNSAVED session artifacts (media scraped or imported in the
|
|
554
|
+
* conversation, hidden from the library until saved) — drives the artifact
|
|
555
|
+
* strip above the composer. Omit on hosts without asset storage. */
|
|
556
|
+
listSessionArtifacts?: (threadId: string) => Promise<{
|
|
557
|
+
id: string;
|
|
558
|
+
filename: string;
|
|
559
|
+
contentType: string;
|
|
560
|
+
label?: string | null;
|
|
561
|
+
}[]>;
|
|
562
|
+
}
|
|
563
|
+
export { gateNavigationTarget } from "./safe-url";
|
|
564
|
+
/**
|
|
565
|
+
* Renders one custom `[[<tag>:{json}]]` directive into `host` (already
|
|
566
|
+
* mounted in the chat log). `spec` is the directive's parsed JSON — validate
|
|
567
|
+
* it yourself, the assistant authored it. Optionally return a disposer; the
|
|
568
|
+
* widget calls it when the surrounding message clears (new chat / history
|
|
569
|
+
* switch / destroy).
|
|
570
|
+
*/
|
|
571
|
+
export type DirectiveRenderer = (host: HTMLElement, spec: unknown) => (() => void) | void;
|
|
572
|
+
/**
|
|
573
|
+
* What the collapsed launcher is saying (#305).
|
|
574
|
+
*
|
|
575
|
+
* It had exactly ONE appearance, which is why an unread reply and an idle
|
|
576
|
+
* corner animated about equally. Only `unread` and `working` move; the rest are
|
|
577
|
+
* static differences, and that is what makes movement mean something again.
|
|
578
|
+
*/
|
|
579
|
+
export interface LauncherState {
|
|
580
|
+
state?: "resting" | "unread" | "working" | "offline" | "parked";
|
|
581
|
+
/** `unread` only — shown as a count badge. */
|
|
582
|
+
count?: number;
|
|
583
|
+
/** `pill` on a first visit (a word, not a puzzle — #88); `pebble` after. */
|
|
584
|
+
variant?: "pebble" | "pill";
|
|
585
|
+
/** Which way the mark and disc invert. "auto" reads the host's own surface. */
|
|
586
|
+
ground?: "light" | "ink" | "auto";
|
|
587
|
+
}
|
|
588
|
+
export interface AiChatWidgetHandle {
|
|
589
|
+
open(): void;
|
|
590
|
+
close(): void;
|
|
591
|
+
toggle(): void;
|
|
592
|
+
destroy(): void;
|
|
593
|
+
/** Register a custom directive renderer at runtime (see `renderers`).
|
|
594
|
+
* Reserved built-in tags are rejected with an Error. */
|
|
595
|
+
registerRenderer(tag: string, renderer: DirectiveRenderer): void;
|
|
596
|
+
/** Drive the collapsed launcher. Partial — omitted fields keep their value. */
|
|
597
|
+
setLauncher(next: LauncherState): void;
|
|
598
|
+
}
|
|
599
|
+
export declare function createAiChatWidget(opts: AiChatWidgetOptions): AiChatWidgetHandle;
|
|
600
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAA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