@osvi-ai/chat 0.0.0-stage → 0.1.1

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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -3
  3. package/dist/core.js +10 -0
  4. package/dist/core.js.map +1 -0
  5. package/dist/index-HWHyM4-l.js +1331 -0
  6. package/dist/index-HWHyM4-l.js.map +1 -0
  7. package/dist/types/core/client.d.ts +67 -0
  8. package/dist/types/core/connection.d.ts +78 -0
  9. package/dist/types/core/errors.d.ts +14 -0
  10. package/dist/types/core/http.d.ts +38 -0
  11. package/dist/types/core/index.d.ts +7 -0
  12. package/dist/types/core/interactions.d.ts +50 -0
  13. package/dist/types/core/protocol/envelope.d.ts +2 -0
  14. package/dist/types/core/protocol/readers.d.ts +14 -0
  15. package/dist/types/core/protocol/types.d.ts +118 -0
  16. package/dist/types/core/protocol/validators.d.ts +10 -0
  17. package/dist/types/core/state.d.ts +23 -0
  18. package/dist/types/core/storage.d.ts +10 -0
  19. package/dist/types/core/version.d.ts +1 -0
  20. package/dist/types/ui/define.d.ts +1 -0
  21. package/dist/types/ui/icons.d.ts +9 -0
  22. package/dist/types/ui/index.d.ts +9 -0
  23. package/dist/types/ui/osvi-chat.d.ts +70 -0
  24. package/dist/types/ui/panel/attrs.d.ts +6 -0
  25. package/dist/types/ui/panel/composer.d.ts +10 -0
  26. package/dist/types/ui/panel/linkify.d.ts +7 -0
  27. package/dist/types/ui/panel/transcript.d.ts +4 -0
  28. package/dist/types/ui/strings.d.ts +27 -0
  29. package/dist/types/ui/styles.d.ts +1 -0
  30. package/dist/types/ui/theme.d.ts +22 -0
  31. package/dist/types/ui/tools/base.d.ts +14 -0
  32. package/dist/types/ui/tools/osvi-buttons.d.ts +10 -0
  33. package/dist/types/ui/tools/osvi-carousel.d.ts +16 -0
  34. package/dist/types/ui/tools/osvi-date-picker.d.ts +17 -0
  35. package/dist/types/widget/config.d.ts +23 -0
  36. package/dist/types/widget/index.d.ts +1 -0
  37. package/dist/types/widget/launcher.d.ts +35 -0
  38. package/dist/types/widget/widget.d.ts +13 -0
  39. package/dist/ui.js +109 -0
  40. package/dist/ui.js.map +1 -0
  41. package/dist/ui.mjs +646 -0
  42. package/dist/ui.mjs.map +1 -0
  43. package/dist/widget.js +132 -0
  44. package/dist/widget.js.map +1 -0
  45. package/package.json +60 -4
@@ -0,0 +1,50 @@
1
+ import type { Snapshot } from './http';
2
+ import type { TranscriptItem } from './state';
3
+ import { type InteractionMessage, type InteractionResponse, type PublicRow, type WireEnvelope, type WriteResult } from './protocol/types';
4
+ export interface InteractionHost {
5
+ sessionId(): string | null;
6
+ humanConnected(): boolean;
7
+ sendFrame(frame: Record<string, unknown>): boolean;
8
+ updateItems(fn: (items: TranscriptItem[]) => TranscriptItem[]): void;
9
+ refreshSnapshot(): Promise<Snapshot | null>;
10
+ onChange(): void;
11
+ newId(): string;
12
+ }
13
+ export type InteractionError = {
14
+ code: 'interaction_not_pending' | 'interaction_suspended' | 'invalid_interaction' | 'network';
15
+ message: string;
16
+ };
17
+ export declare class InteractionController {
18
+ private readonly host;
19
+ private _active;
20
+ private _cursor;
21
+ private _pending;
22
+ private _error;
23
+ private operations;
24
+ private operation;
25
+ private generation;
26
+ private refreshInFlight;
27
+ private recoveryCursor;
28
+ constructor(host: InteractionHost);
29
+ get active(): InteractionMessage | null;
30
+ get cursor(): string;
31
+ get pending(): boolean;
32
+ get error(): InteractionError | null;
33
+ private setActive;
34
+ private setCursor;
35
+ private setSelectionPending;
36
+ private setInteractionError;
37
+ private setRows;
38
+ reset(): void;
39
+ private reject;
40
+ private mergeProjection;
41
+ private refreshMissingOutcome;
42
+ private hasMissingOutcome;
43
+ applySnapshot(snapshot: Snapshot): void;
44
+ applyEvent(event: WireEnvelope): boolean;
45
+ handleWriteResult(result: WriteResult): boolean;
46
+ respond(interactionId: string, response: InteractionResponse): boolean;
47
+ onConnectionOpen(): void;
48
+ }
49
+ export declare function toRows(items: TranscriptItem[]): PublicRow[];
50
+ export declare function fromRows(rows: PublicRow[], previous: TranscriptItem[]): TranscriptItem[];
@@ -0,0 +1,2 @@
1
+ import type { WireEnvelope } from './types';
2
+ export declare function parseEnvelope(data: unknown): WireEnvelope | null;
@@ -0,0 +1,14 @@
1
+ import type { InteractionMessage, PublicRow, WireMessage } from './types';
2
+ export declare function readInteraction(value: unknown): (InteractionMessage & {
3
+ role: 'assistant';
4
+ }) | null;
5
+ export declare function readPublicMessage(value: unknown): PublicRow | null;
6
+ export declare function interactionCursor(value: unknown): string | null;
7
+ export declare function compareCursors(left: string, right: string): number;
8
+ export declare function mergeItems<T extends {
9
+ id: string;
10
+ interaction_id?: string;
11
+ interaction_revision?: number;
12
+ interaction_status?: string;
13
+ }>(current: T[], additions: T[]): T[];
14
+ export declare function readWireMessage(v: unknown): WireMessage | null;
@@ -0,0 +1,118 @@
1
+ export interface InteractionCapability {
2
+ tool_type: string;
3
+ schema_version: number;
4
+ }
5
+ export interface ChoiceOption {
6
+ id: string;
7
+ label: string;
8
+ description?: string;
9
+ allow_input?: true;
10
+ input_placeholder?: string;
11
+ }
12
+ export interface ChoicePresentation {
13
+ label: string;
14
+ description?: string;
15
+ options: ChoiceOption[];
16
+ }
17
+ export interface CarouselImage {
18
+ url: string;
19
+ alt: string;
20
+ }
21
+ export interface CarouselItem {
22
+ id: string;
23
+ title: string;
24
+ description?: string;
25
+ image?: CarouselImage;
26
+ action_label?: string;
27
+ }
28
+ export interface CarouselPresentation {
29
+ label: string;
30
+ description?: string;
31
+ items: CarouselItem[];
32
+ }
33
+ export interface DatePickerPresentation {
34
+ label: string;
35
+ description?: string;
36
+ selection_mode: 'single' | 'range';
37
+ min_date?: string;
38
+ max_date?: string;
39
+ confirm_label?: string;
40
+ }
41
+ export type InteractionPresentation = ChoicePresentation | CarouselPresentation | DatePickerPresentation;
42
+ export type InteractionResponse = {
43
+ kind: 'selection';
44
+ value: string;
45
+ } | {
46
+ kind: 'text';
47
+ value: string;
48
+ } | {
49
+ kind: 'date';
50
+ value: string;
51
+ } | {
52
+ kind: 'date_range';
53
+ value: {
54
+ start_date: string;
55
+ end_date: string;
56
+ };
57
+ };
58
+ export interface InteractionMessage {
59
+ id: string;
60
+ type: 'interaction';
61
+ role: string;
62
+ content: string;
63
+ created_at?: string;
64
+ interaction_id: string;
65
+ tool_type: string;
66
+ schema_version: number;
67
+ presentation: InteractionPresentation;
68
+ interaction_status: 'preparing' | 'pending' | 'accepted' | 'resumed' | 'cancelled' | 'expired';
69
+ interaction_revision: number;
70
+ selected_option_id?: string | null;
71
+ response_payload?: InteractionResponse | null;
72
+ }
73
+ export declare const SUPPORTED_INTERACTIONS: readonly [{
74
+ readonly tool_type: "ui_buttons";
75
+ readonly schema_version: 1;
76
+ }, {
77
+ readonly tool_type: "ui_buttons";
78
+ readonly schema_version: 2;
79
+ }, {
80
+ readonly tool_type: "ui_carousel";
81
+ readonly schema_version: 1;
82
+ }, {
83
+ readonly tool_type: "ui_date_picker";
84
+ readonly schema_version: 1;
85
+ }];
86
+ export interface WireEnvelope {
87
+ type: string;
88
+ session_id?: string;
89
+ account_id?: number | string;
90
+ ts?: string;
91
+ event_id?: string | number;
92
+ payload: Record<string, unknown>;
93
+ }
94
+ export type WriteState = 'accepted' | 'merged' | 'done' | 'failed' | 'busy' | 'invalid' | 'error';
95
+ export interface WriteResult {
96
+ state: WriteState;
97
+ error?: string;
98
+ message_id?: string;
99
+ turn_id?: string;
100
+ interaction_id?: string;
101
+ merged_into?: string;
102
+ }
103
+ export interface WireMessage {
104
+ id: string;
105
+ role: 'user' | 'ai' | 'assistant' | 'operator' | 'support' | 'system';
106
+ content: string;
107
+ created_at?: string;
108
+ type?: 'message' | 'interaction';
109
+ }
110
+ export interface PublicRow extends Partial<Omit<InteractionMessage, 'id' | 'role' | 'content' | 'type' | 'presentation'>> {
111
+ id: string;
112
+ role: 'assistant' | 'user' | 'operator' | 'system';
113
+ content: string;
114
+ ts: string;
115
+ type?: 'message' | 'interaction';
116
+ presentation?: unknown;
117
+ local?: true;
118
+ }
@@ -0,0 +1,10 @@
1
+ import type { CarouselPresentation, ChoicePresentation, DatePickerPresentation, InteractionCapability, InteractionPresentation, InteractionResponse } from './types';
2
+ export declare function isProxyImageUrl(value: unknown): value is string;
3
+ export declare function isPublicHttpsUrl(value: unknown): value is string;
4
+ export declare function isChoicePresentation(value: unknown, maximum?: number): value is ChoicePresentation;
5
+ export declare function isButtonsV1Presentation(value: unknown, maximum?: number): value is ChoicePresentation;
6
+ export declare function isCarouselPresentation(value: unknown, maximum?: number, allowProxy?: boolean): value is CarouselPresentation;
7
+ export declare function isCalendarDate(value: unknown): value is string;
8
+ export declare function isDatePickerPresentation(value: unknown): value is DatePickerPresentation;
9
+ export declare function isInteractionPresentation(pair: InteractionCapability, value: unknown): value is InteractionPresentation;
10
+ export declare function isInteractionResponse(pair: InteractionCapability, value: unknown): value is InteractionResponse;
@@ -0,0 +1,23 @@
1
+ import type { InteractionMessage } from './protocol/types';
2
+ export type MessageRole = 'user' | 'assistant' | 'human';
3
+ export interface Message {
4
+ kind: 'message';
5
+ id: string;
6
+ role: MessageRole;
7
+ content: string;
8
+ createdAt: string;
9
+ status: 'sending' | 'sent' | 'failed';
10
+ serverId?: string;
11
+ idempotencyKey?: string;
12
+ }
13
+ export interface InteractionItem {
14
+ kind: 'interaction';
15
+ id: string;
16
+ interaction: InteractionMessage;
17
+ }
18
+ export interface Divider {
19
+ kind: 'divider';
20
+ id: string;
21
+ reason: 'session_ended';
22
+ }
23
+ export type TranscriptItem = Message | InteractionItem | Divider;
@@ -0,0 +1,10 @@
1
+ export interface KeyValueStore {
2
+ get(key: string): string | null;
3
+ set(key: string, value: string): void;
4
+ remove(key: string): void;
5
+ }
6
+ export declare const VISITOR_KEY = "osvi.chat.visitor";
7
+ export declare function memoryStore(): KeyValueStore;
8
+ export declare function browserStore(): KeyValueStore;
9
+ export declare function getVisitorId(store: KeyValueStore, random?: () => Uint8Array): string;
10
+ export declare function sessionHintKey(agentId: string): string;
@@ -0,0 +1 @@
1
+ export declare const SDK_VERSION: string;
@@ -0,0 +1 @@
1
+ export declare function defineOnce(name: string, ctor: CustomElementConstructor): void;
@@ -0,0 +1,9 @@
1
+ export declare const chatIcon: import("lit-html").TemplateResult<2>;
2
+ export declare const newChatIcon: import("lit-html").TemplateResult<2>;
3
+ export declare const closeIcon: import("lit-html").TemplateResult<2>;
4
+ export declare const launcherChatIcon: import("lit-html").TemplateResult<2>;
5
+ export declare const launcherCloseIcon: import("lit-html").TemplateResult<2>;
6
+ export declare const sendIcon: import("lit-html").TemplateResult<2>;
7
+ export declare const leftIcon: import("lit-html").TemplateResult<2>;
8
+ export declare const rightIcon: import("lit-html").TemplateResult<2>;
9
+ export declare const osviLogo: import("lit-html").TemplateResult<2>;
@@ -0,0 +1,9 @@
1
+ import { OsviChat } from './osvi-chat';
2
+ import { OsviButtons } from './tools/osvi-buttons';
3
+ import { OsviCarousel } from './tools/osvi-carousel';
4
+ import { OsviDatePicker } from './tools/osvi-date-picker';
5
+ export { OsviButtons, OsviCarousel, OsviDatePicker };
6
+ export { defineOnce } from './define';
7
+ export { themeVariables, explicitThemeVariables, applyTheme, cssVar, type ChatTheme, type Variants } from './theme';
8
+ export { OsviChat };
9
+ export { DEFAULT_STRINGS, type ChatStrings } from './strings';
@@ -0,0 +1,70 @@
1
+ import { LitElement } from 'lit';
2
+ import { createChatClient, type ChatClient } from '../core';
3
+ import { type ChatTheme, type Variants } from './theme';
4
+ import { type ChatStrings } from './strings';
5
+ export declare class OsviChat extends LitElement {
6
+ static clientFactory: typeof createChatClient;
7
+ static properties: {
8
+ themeAttribute: {
9
+ attribute: string;
10
+ };
11
+ stringsAttribute: {
12
+ attribute: string;
13
+ };
14
+ };
15
+ static styles: import("lit").CSSResult;
16
+ agentId: string;
17
+ baseUrl: string;
18
+ client: ChatClient | null;
19
+ theme: ChatTheme;
20
+ variants: Variants;
21
+ strings: Partial<ChatStrings>;
22
+ poweredBy: boolean;
23
+ newChat: boolean;
24
+ newChatHistory: string | undefined;
25
+ header: {
26
+ title?: string;
27
+ subtitle?: string;
28
+ avatarUrl?: string;
29
+ };
30
+ closable: boolean;
31
+ headerTitle: string | undefined;
32
+ headerSubtitle: string | undefined;
33
+ headerAvatar: string | undefined;
34
+ primaryColor: string | undefined;
35
+ radius: string | undefined;
36
+ mode: string | undefined;
37
+ buttons: string | undefined;
38
+ carousel: string | undefined;
39
+ themeAttribute: string | undefined;
40
+ stringsAttribute: string | undefined;
41
+ private chatState;
42
+ private draft;
43
+ private busy;
44
+ private typed;
45
+ private ownClient;
46
+ private boundClient;
47
+ private ownKey;
48
+ private unsubscribe;
49
+ private generation;
50
+ private followBottom;
51
+ private focusedInteraction;
52
+ connectedCallback(): void;
53
+ disconnectedCallback(): void;
54
+ private releaseClient;
55
+ private syncClient;
56
+ protected willUpdate(): void;
57
+ private mergedTheme;
58
+ private get labels();
59
+ private get blocked();
60
+ private get sessionBusy();
61
+ private run;
62
+ private restoreDraft;
63
+ private send;
64
+ private respond;
65
+ private requestInput;
66
+ focusActiveInteraction(): Promise<void>;
67
+ protected updated(): void;
68
+ private statusText;
69
+ render(): import("lit-html").TemplateResult<1>;
70
+ }
@@ -0,0 +1,6 @@
1
+ import type { ChatTheme } from '../theme';
2
+ export declare function oneOf<T extends string>(value: string | null | undefined, allowed: readonly T[]): T | undefined;
3
+ export declare function parseRadius(value: string | null | undefined): ChatTheme['radius'] | undefined;
4
+ export declare function safeBaseUrl(value: string | null | undefined): string | undefined;
5
+ export declare function safeAvatar(value: string | null | undefined): string | undefined;
6
+ export declare function parseJsonAttr(name: string, value: string | null | undefined): Record<string, unknown> | undefined;
@@ -0,0 +1,10 @@
1
+ import type { ChatStrings } from '../strings';
2
+ export interface ComposerOptions {
3
+ strings: ChatStrings;
4
+ draft: string;
5
+ placeholder: string;
6
+ disabled: boolean;
7
+ input: (event: Event) => void;
8
+ send: () => void;
9
+ }
10
+ export declare function renderComposer(o: ComposerOptions): import("lit-html").TemplateResult<1>;
@@ -0,0 +1,7 @@
1
+ export type LinkPart = {
2
+ text: string;
3
+ } | {
4
+ href: string;
5
+ text: string;
6
+ };
7
+ export declare function linkify(text: string): LinkPart[];
@@ -0,0 +1,4 @@
1
+ import type { ChatState } from '../../core';
2
+ import type { ChatStrings } from '../strings';
3
+ import type { Variants } from '../theme';
4
+ export declare function renderTranscript(state: ChatState, strings: ChatStrings, variants: Variants, baseUrl: string, retry: (id: string) => void): import("lit-html").TemplateResult<1>;
@@ -0,0 +1,27 @@
1
+ export declare const DEFAULT_STRINGS: {
2
+ placeholder: string;
3
+ send: string;
4
+ typing: string;
5
+ humanJoined: string;
6
+ chooseOption: string;
7
+ typeAnswer: string;
8
+ sending: string;
9
+ pausedForHuman: string;
10
+ sendFailed: string;
11
+ retry: string;
12
+ sessionEnded: string;
13
+ reconnecting: string;
14
+ offline: string;
15
+ unavailable: string;
16
+ originBlocked: string;
17
+ rateLimited: string;
18
+ tryAgain: string;
19
+ closeChat: string;
20
+ poweredBy: string;
21
+ newChat: string;
22
+ emptyState: string;
23
+ defaultTitle: string;
24
+ };
25
+ export type ChatStrings = {
26
+ [K in keyof typeof DEFAULT_STRINGS]: string;
27
+ };
@@ -0,0 +1 @@
1
+ export declare const toolStyles: import("lit").CSSResult;
@@ -0,0 +1,22 @@
1
+ export interface ChatTheme {
2
+ colors?: Partial<Record<'primary' | 'background' | 'surface' | 'text' | 'userBubble' | 'assistantBubble', string>>;
3
+ radius?: 'none' | 'sm' | 'md' | 'lg' | 'full' | number;
4
+ mode?: 'light' | 'dark';
5
+ }
6
+ export interface Variants {
7
+ buttons?: 'chips' | 'list';
8
+ carousel?: 'slider' | 'list';
9
+ }
10
+ declare const LIGHT: {
11
+ primary: string;
12
+ background: string;
13
+ surface: string;
14
+ text: string;
15
+ userBubble: string;
16
+ assistantBubble: string;
17
+ };
18
+ export declare const cssVar: (key: keyof typeof LIGHT) => string;
19
+ export declare function themeVariables(theme: ChatTheme | undefined): Record<string, string>;
20
+ export declare function explicitThemeVariables(theme: ChatTheme | undefined): Record<string, string>;
21
+ export declare function applyTheme(host: HTMLElement, theme: ChatTheme | undefined): void;
22
+ export {};
@@ -0,0 +1,14 @@
1
+ import { LitElement } from 'lit';
2
+ import type { InteractionMessage, InteractionResponse } from '../../core/protocol/types';
3
+ import { type ChatTheme } from '../theme';
4
+ export declare abstract class ToolElement extends LitElement {
5
+ interaction: InteractionMessage | null;
6
+ disabled: boolean;
7
+ theme: ChatTheme | undefined;
8
+ baseUrl: string;
9
+ protected abstract readonly toolType: string;
10
+ protected get live(): boolean;
11
+ protected get valid(): boolean;
12
+ protected respond(response: InteractionResponse): void;
13
+ protected updated(changed: Map<PropertyKey, unknown>): void;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { nothing } from 'lit';
2
+ import { ToolElement } from './base';
3
+ export declare class OsviButtons extends ToolElement {
4
+ static styles: import("lit").CSSResult;
5
+ protected readonly toolType = "ui_buttons";
6
+ variant: 'chips' | 'list';
7
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
8
+ private pick;
9
+ private onKey;
10
+ }
@@ -0,0 +1,16 @@
1
+ import { nothing } from 'lit';
2
+ import { ToolElement } from './base';
3
+ export declare class OsviCarousel extends ToolElement {
4
+ static styles: import("lit").CSSResult;
5
+ protected readonly toolType = "ui_carousel";
6
+ variant: 'slider' | 'list';
7
+ private index;
8
+ private imageFailed;
9
+ private pointerStart;
10
+ private suppressPointerClick;
11
+ protected willUpdate(changed: Map<PropertyKey, unknown>): void;
12
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
13
+ private navigate;
14
+ private select;
15
+ private card;
16
+ }
@@ -0,0 +1,17 @@
1
+ import { nothing } from 'lit';
2
+ import { ToolElement } from './base';
3
+ export declare class OsviDatePicker extends ToolElement {
4
+ static styles: import("lit").CSSResult;
5
+ protected readonly toolType = "ui_date_picker";
6
+ variant: string;
7
+ private month;
8
+ private start;
9
+ private end;
10
+ private earliest;
11
+ protected willUpdate(changed: Map<PropertyKey, unknown>): void;
12
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
13
+ private moveMonth;
14
+ private pick;
15
+ private confirm;
16
+ private onKey;
17
+ }
@@ -0,0 +1,23 @@
1
+ import type { ChatAuth } from '../core';
2
+ import type { ChatTheme, Variants } from '../ui/theme';
3
+ import type { ChatStrings } from '../ui/strings';
4
+ export interface WidgetConfig {
5
+ agentId: string;
6
+ baseUrl?: string;
7
+ position?: 'right' | 'left';
8
+ launcher?: 'bubble' | 'none';
9
+ greeting?: string;
10
+ theme?: ChatTheme;
11
+ variants?: Variants;
12
+ strings?: Partial<ChatStrings>;
13
+ poweredBy?: boolean;
14
+ newChat?: boolean;
15
+ newChatHistory?: 'clear' | 'keep';
16
+ header?: {
17
+ title?: string;
18
+ subtitle?: string;
19
+ avatarUrl?: string;
20
+ };
21
+ auth?: ChatAuth;
22
+ }
23
+ export declare function readConfig(script: HTMLScriptElement | null, global: unknown): WidgetConfig;
@@ -0,0 +1 @@
1
+ import '../ui/index';
@@ -0,0 +1,35 @@
1
+ import { LitElement } from 'lit';
2
+ import type { ChatClient } from '../core';
3
+ import type { OsviChat } from '../ui/osvi-chat';
4
+ import type { WidgetConfig } from './config';
5
+ export declare class OsviChatWidget extends LitElement {
6
+ static properties: {
7
+ config: {
8
+ attribute: boolean;
9
+ };
10
+ client: {
11
+ attribute: boolean;
12
+ };
13
+ opened: {
14
+ type: BooleanConstructor;
15
+ };
16
+ badge: {
17
+ type: NumberConstructor;
18
+ };
19
+ greetingDismissed: {
20
+ type: BooleanConstructor;
21
+ };
22
+ };
23
+ config: WidgetConfig;
24
+ client: ChatClient | null;
25
+ opened: boolean;
26
+ badge: number;
27
+ greetingDismissed: boolean;
28
+ onToggle: () => void;
29
+ onClose: () => void;
30
+ onDismiss: () => void;
31
+ static styles: import("lit").CSSResult;
32
+ get panel(): OsviChat | null;
33
+ focusLauncher(): void;
34
+ render(): import("lit-html").TemplateResult<1>;
35
+ }
@@ -0,0 +1,13 @@
1
+ import { type WidgetConfig } from './config';
2
+ export interface WidgetApi {
3
+ open(): void;
4
+ close(): void;
5
+ toggle(): void;
6
+ destroy(): void;
7
+ init(config?: Partial<WidgetConfig>): void;
8
+ }
9
+ export declare const GREETING_KEY: (agentId: string) => string;
10
+ export declare const SEEN_KEY: (agentId: string) => string;
11
+ export declare const BADGE_RECHECK_MS = 30000;
12
+ export declare function unmountWidget(): void;
13
+ export declare function mountWidget(initial: WidgetConfig): WidgetApi;