@pluno/product-agent-web 0.1.209 → 0.1.210

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.
@@ -0,0 +1,42 @@
1
+ import type { ProductAgentState } from "./index";
2
+ export type UiFlightRecord = {
3
+ sequence: number;
4
+ occurred_at: string;
5
+ monotonic_ms: number;
6
+ kind: "runtime" | "paint" | "click" | "submit" | "focus";
7
+ action: "new_chat" | "send" | "stop" | "retry" | null;
8
+ session_id: string | null;
9
+ run_id: string | null;
10
+ item_keys: string[];
11
+ item_count: number;
12
+ items_truncated: boolean;
13
+ thinking: boolean;
14
+ loading: boolean;
15
+ welcome: boolean;
16
+ error: boolean;
17
+ connected: boolean;
18
+ visible: boolean;
19
+ output_length: number;
20
+ active_count: number;
21
+ terminal_count: number;
22
+ };
23
+ export type UiFlightEvidence = {
24
+ schema_version: 1;
25
+ surface: "extension_sidepanel" | "extension_widget" | "main_web_chat" | "embedded_widget";
26
+ recorder_id: string;
27
+ sdk_version: string;
28
+ dropped_records: number;
29
+ records: UiFlightRecord[];
30
+ };
31
+ export type UiFlightRecorder = {
32
+ snapshot(): UiFlightEvidence;
33
+ dispose(): void;
34
+ };
35
+ export type UiFlightRecorderHost = HTMLElement & {
36
+ __plunoUiFlightRecorder?: UiFlightRecorder;
37
+ };
38
+ export declare function startUiFlightRecorder(host: UiFlightRecorderHost, root: HTMLElement, surface: UiFlightEvidence["surface"], runtime: {
39
+ getState(): ProductAgentState;
40
+ on(event: "state", listener: (state: ProductAgentState) => void): () => void;
41
+ reportInvalidStateTransition?(reason: string, clientMessageId?: string): void;
42
+ }): UiFlightRecorder;
@@ -0,0 +1,31 @@
1
+ export type UiInvariantSnapshot = {
2
+ messageKeys: string[];
3
+ canonicalItemKeys: string[];
4
+ toolCallKeys: string[];
5
+ attachmentKeys: string[];
6
+ terminalResponseKeys: string[];
7
+ activeResponseKeys: string[];
8
+ selectedSessionId: string | null;
9
+ visibleSessionIds: string[];
10
+ welcome?: boolean;
11
+ runtimeItemCount?: number;
12
+ };
13
+ declare const INVARIANT_MESSAGES: {
14
+ readonly "duplicate-message-item": "A canonical message rendered more than once.";
15
+ readonly "duplicate-canonical-item": "A canonical session item rendered more than once.";
16
+ readonly "duplicate-tool-call": "A tool call rendered more than once.";
17
+ readonly "duplicate-attachment": "An attachment rendered more than once.";
18
+ readonly "duplicate-terminal-outcome": "A response rendered more than one terminal outcome.";
19
+ readonly "foreign-session-item-visible": "The visible transcript contains state owned by another session.";
20
+ readonly "terminal-response-reactivated": "A terminal response became active again.";
21
+ readonly "terminal-history-not-append-only": "An established terminal outcome disappeared or changed order.";
22
+ readonly "runtime-transcript-not-rendered": "A nonempty runtime transcript is displaying starter prompts.";
23
+ };
24
+ export type UiInvariantFinding = {
25
+ code: keyof typeof INVARIANT_MESSAGES;
26
+ message: string;
27
+ };
28
+ export declare function getProactiveQuestionTraceKey(clientMessageId: string | undefined): string | undefined;
29
+ export declare function isUiInvariantReason(reason: unknown): boolean;
30
+ export declare function checkUiInvariants(snapshot: UiInvariantSnapshot, previous?: UiInvariantSnapshot): UiInvariantFinding[];
31
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluno/product-agent-web",
3
- "version": "0.1.209",
3
+ "version": "0.1.210",
4
4
  "description": "Browser SDK and default widget for embedding Pluno Product Agent into customer web apps.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",