@helpai/elements 0.4.1 → 0.5.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, L as Link, S as ServerConfig, b as SiteConfig, c as StartSessionResponse, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial } from './deployment-CmhOIzLY.js';
1
+ export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, L as Link, S as ServerConfig, b as SiteConfig, c as StartSessionResponse, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial } from './deployment-DKyrRSGL.js';
2
2
  import 'zod';
3
3
 
4
4
  /**
@@ -40,7 +40,7 @@ interface ClientStorage {
40
40
  * populated {@link Strings} map. UI components then read `strings.send` as a
41
41
  * normal property access — no per-render lookup, no per-render allocation.
42
42
  */
43
- type StringKey = "launcherOpen" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "popOut" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyNewChat" | "historyBack" | "messagesLoading" | "chatClosed" | "startNewConversation" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "thinking" | "thoughts" | "usedTool" | "collapseSidebar" | "expandSidebar" | "tabHome" | "tabMessages" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
43
+ type StringKey = "launcherOpen" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "popOut" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyNewChat" | "historyBack" | "messagesLoading" | "chatClosed" | "startNewConversation" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "loading" | "thinking" | "thoughts" | "usedTool" | "collapseSidebar" | "expandSidebar" | "tabHome" | "tabMessages" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
44
44
  /** A partial map for one locale — what overrides look like on the wire. */
45
45
  type LocaleStrings = Partial<Record<StringKey, string>>;
46
46
  /**
@@ -501,7 +501,11 @@ interface ModuleAvatar {
501
501
  /** The Home status card. */
502
502
  interface ModuleStatus {
503
503
  text: string;
504
- level?: "operational" | "degraded" | "down";
504
+ /**
505
+ * Status severity → status-icon colour. Free text; `operational` (default),
506
+ * `degraded`, and `down` are styled, any other value uses the operational style.
507
+ */
508
+ level?: string;
505
509
  /** Opens in an in-widget iframe when tapped. */
506
510
  url?: string;
507
511
  }
@@ -999,6 +1003,14 @@ interface ServerConfig {
999
1003
  * transcripts.
1000
1004
  */
1001
1005
  type LogLevel = "off" | "error" | "warn" | "info" | "debug" | "trace";
1006
+ /** One structured line, as forwarded to an external {@link setLogSink} sink. */
1007
+ interface LogEntry {
1008
+ level: LogLevel;
1009
+ /** Subsystem tag, e.g. `"transport"` or `"core:hooks"`. */
1010
+ scope: string;
1011
+ message: string;
1012
+ payload?: unknown;
1013
+ }
1002
1014
 
1003
1015
  /**
1004
1016
  * Tiny typed pub/sub for widget lifecycle events.
@@ -1296,6 +1308,13 @@ interface ChatWidgetInstance {
1296
1308
  setDebug: (level: LogLevel | boolean | number | string) => void;
1297
1309
  /** Current log level. Read-only. */
1298
1310
  readonly debugLevel: () => LogLevel;
1311
+ /**
1312
+ * Forward every log line (that passes the active level) to an external sink —
1313
+ * pipe errors/warnings/debug into Sentry, Datadog, your own logger, etc. Pass
1314
+ * `null` to clear. One global sink per bundle (logger is module-global); use
1315
+ * `setDebug("trace")` to capture everything, not just warnings + errors.
1316
+ */
1317
+ onLog: (sink: ((entry: LogEntry) => void) | null) => void;
1299
1318
  }
1300
1319
  /**
1301
1320
  * Mount a new widget. If an instance with the same `widgetId` already
@@ -1384,4 +1403,4 @@ declare const brand: {
1384
1403
  */
1385
1404
  declare function resolveInitialHostMode(options: ResolvedOptions): HostMode;
1386
1405
 
1387
- export { type ChatWidgetInstance, type ChatWidgetOptions, type EventMap, type EventName, HOOK_WILDCARD, type HookListener, type ResolvedOptions, brand, destroy, getAllInstances, getInstance, hook, init, mount, resolveInitialHostMode, version };
1406
+ export { type ChatWidgetInstance, type ChatWidgetOptions, type EventMap, type EventName, HOOK_WILDCARD, type HookListener, type LogEntry, type LogLevel, type ResolvedOptions, brand, destroy, getAllInstances, getInstance, hook, init, mount, resolveInitialHostMode, version };