@djangocfg/ui-tools 2.1.336 → 2.1.338

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/index.cjs CHANGED
@@ -7,7 +7,7 @@ var chunkKNDLV4PI_cjs = require('./chunk-KNDLV4PI.cjs');
7
7
  var chunk5I5QNGUG_cjs = require('./chunk-5I5QNGUG.cjs');
8
8
  var chunkYW5IVWHQ_cjs = require('./chunk-YW5IVWHQ.cjs');
9
9
  var chunk76NNDZH6_cjs = require('./chunk-76NNDZH6.cjs');
10
- var chunkNRXYYO5V_cjs = require('./chunk-NRXYYO5V.cjs');
10
+ var chunk5T4K3VUV_cjs = require('./chunk-5T4K3VUV.cjs');
11
11
  var chunkYXZ6GU7H_cjs = require('./chunk-YXZ6GU7H.cjs');
12
12
  var chunkIEEAENLX_cjs = require('./chunk-IEEAENLX.cjs');
13
13
  var chunkQW4RBGHN_cjs = require('./chunk-QW4RBGHN.cjs');
@@ -372,7 +372,7 @@ var LazyTree = createLazyComponent(
372
372
  }
373
373
  );
374
374
  var LazyChat = createLazyComponent(
375
- () => import('./ChatRoot-UUKTYM4N.cjs').then((m) => ({ default: m.ChatRoot })),
375
+ () => import('./ChatRoot-BT3CLXI4.cjs').then((m) => ({ default: m.ChatRoot })),
376
376
  {
377
377
  displayName: "LazyChat",
378
378
  fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
@@ -409,7 +409,7 @@ async function* parseSSE(response, options = {}) {
409
409
  throw new Error("SSE response has no body");
410
410
  }
411
411
  const map = options.map ?? DEFAULT_MAP;
412
- const idleMs = options.idleTimeoutMs ?? chunkNRXYYO5V_cjs.LIMITS.sseIdleMs;
412
+ const idleMs = options.idleTimeoutMs ?? chunk5T4K3VUV_cjs.LIMITS.sseIdleMs;
413
413
  const reader = response.body.getReader();
414
414
  const decoder = new TextDecoder();
415
415
  let buffer = "";
@@ -612,7 +612,7 @@ function createMockTransport(opts = {}) {
612
612
  async createSession(_opts) {
613
613
  await sleep(latency);
614
614
  return {
615
- sessionId: chunkNRXYYO5V_cjs.createId("s"),
615
+ sessionId: chunk5T4K3VUV_cjs.createId("s"),
616
616
  messages: history.length ? [...history] : void 0,
617
617
  hasMore: false,
618
618
  cursor: null,
@@ -629,12 +629,12 @@ function createMockTransport(opts = {}) {
629
629
  throw new Error("mock transport scripted failure");
630
630
  }
631
631
  history.push({
632
- id: chunkNRXYYO5V_cjs.createId("u"),
632
+ id: chunk5T4K3VUV_cjs.createId("u"),
633
633
  role: "user",
634
634
  content,
635
635
  createdAt: Date.now()
636
636
  });
637
- const messageId = chunkNRXYYO5V_cjs.createId("a");
637
+ const messageId = chunk5T4K3VUV_cjs.createId("a");
638
638
  yield { type: "message_start", messageId, sessionId: _sid };
639
639
  const reply = replies[turn % replies.length];
640
640
  turn += 1;
@@ -663,7 +663,7 @@ function createMockTransport(opts = {}) {
663
663
  turn += 1;
664
664
  const text = typeof reply === "string" ? reply : reply.filter((e) => e.type === "chunk").map((e) => e.delta).join("");
665
665
  return {
666
- id: chunkNRXYYO5V_cjs.createId("a"),
666
+ id: chunk5T4K3VUV_cjs.createId("a"),
667
667
  role: "assistant",
668
668
  content: text || DEFAULT_REPLY,
669
669
  createdAt: Date.now()
@@ -2019,155 +2019,159 @@ Object.defineProperty(exports, "useCronWeekDays", {
2019
2019
  });
2020
2020
  Object.defineProperty(exports, "Attachments", {
2021
2021
  enumerable: true,
2022
- get: function () { return chunkNRXYYO5V_cjs.Attachments; }
2022
+ get: function () { return chunk5T4K3VUV_cjs.Attachments; }
2023
2023
  });
2024
2024
  Object.defineProperty(exports, "AttachmentsGrid", {
2025
2025
  enumerable: true,
2026
- get: function () { return chunkNRXYYO5V_cjs.AttachmentsGrid; }
2026
+ get: function () { return chunk5T4K3VUV_cjs.AttachmentsGrid; }
2027
2027
  });
2028
2028
  Object.defineProperty(exports, "AttachmentsList", {
2029
2029
  enumerable: true,
2030
- get: function () { return chunkNRXYYO5V_cjs.AttachmentsList; }
2030
+ get: function () { return chunk5T4K3VUV_cjs.AttachmentsList; }
2031
2031
  });
2032
2032
  Object.defineProperty(exports, "CHAT_EVENT_NAME", {
2033
2033
  enumerable: true,
2034
- get: function () { return chunkNRXYYO5V_cjs.CHAT_EVENT_NAME; }
2034
+ get: function () { return chunk5T4K3VUV_cjs.CHAT_EVENT_NAME; }
2035
2035
  });
2036
2036
  Object.defineProperty(exports, "CSS_VARS", {
2037
2037
  enumerable: true,
2038
- get: function () { return chunkNRXYYO5V_cjs.CSS_VARS; }
2038
+ get: function () { return chunk5T4K3VUV_cjs.CSS_VARS; }
2039
2039
  });
2040
2040
  Object.defineProperty(exports, "ChatProvider", {
2041
2041
  enumerable: true,
2042
- get: function () { return chunkNRXYYO5V_cjs.ChatProvider; }
2042
+ get: function () { return chunk5T4K3VUV_cjs.ChatProvider; }
2043
2043
  });
2044
2044
  Object.defineProperty(exports, "ChatRoot", {
2045
2045
  enumerable: true,
2046
- get: function () { return chunkNRXYYO5V_cjs.ChatRoot; }
2046
+ get: function () { return chunk5T4K3VUV_cjs.ChatRoot; }
2047
2047
  });
2048
2048
  Object.defineProperty(exports, "Composer", {
2049
2049
  enumerable: true,
2050
- get: function () { return chunkNRXYYO5V_cjs.Composer; }
2050
+ get: function () { return chunk5T4K3VUV_cjs.Composer; }
2051
2051
  });
2052
2052
  Object.defineProperty(exports, "DEFAULT_LABELS", {
2053
2053
  enumerable: true,
2054
- get: function () { return chunkNRXYYO5V_cjs.DEFAULT_LABELS; }
2054
+ get: function () { return chunk5T4K3VUV_cjs.DEFAULT_LABELS; }
2055
2055
  });
2056
2056
  Object.defineProperty(exports, "DEFAULT_SIDEBAR", {
2057
2057
  enumerable: true,
2058
- get: function () { return chunkNRXYYO5V_cjs.DEFAULT_SIDEBAR; }
2058
+ get: function () { return chunk5T4K3VUV_cjs.DEFAULT_SIDEBAR; }
2059
2059
  });
2060
2060
  Object.defineProperty(exports, "DEFAULT_Z_INDEX", {
2061
2061
  enumerable: true,
2062
- get: function () { return chunkNRXYYO5V_cjs.DEFAULT_Z_INDEX; }
2062
+ get: function () { return chunk5T4K3VUV_cjs.DEFAULT_Z_INDEX; }
2063
2063
  });
2064
2064
  Object.defineProperty(exports, "EmptyState", {
2065
2065
  enumerable: true,
2066
- get: function () { return chunkNRXYYO5V_cjs.EmptyState; }
2066
+ get: function () { return chunk5T4K3VUV_cjs.EmptyState; }
2067
2067
  });
2068
2068
  Object.defineProperty(exports, "ErrorBanner", {
2069
2069
  enumerable: true,
2070
- get: function () { return chunkNRXYYO5V_cjs.ErrorBanner; }
2070
+ get: function () { return chunk5T4K3VUV_cjs.ErrorBanner; }
2071
2071
  });
2072
2072
  Object.defineProperty(exports, "HOTKEYS", {
2073
2073
  enumerable: true,
2074
- get: function () { return chunkNRXYYO5V_cjs.HOTKEYS; }
2074
+ get: function () { return chunk5T4K3VUV_cjs.HOTKEYS; }
2075
2075
  });
2076
2076
  Object.defineProperty(exports, "JumpToLatest", {
2077
2077
  enumerable: true,
2078
- get: function () { return chunkNRXYYO5V_cjs.JumpToLatest; }
2078
+ get: function () { return chunk5T4K3VUV_cjs.JumpToLatest; }
2079
2079
  });
2080
2080
  Object.defineProperty(exports, "LIMITS", {
2081
2081
  enumerable: true,
2082
- get: function () { return chunkNRXYYO5V_cjs.LIMITS; }
2082
+ get: function () { return chunk5T4K3VUV_cjs.LIMITS; }
2083
2083
  });
2084
2084
  Object.defineProperty(exports, "MessageActions", {
2085
2085
  enumerable: true,
2086
- get: function () { return chunkNRXYYO5V_cjs.MessageActions; }
2086
+ get: function () { return chunk5T4K3VUV_cjs.MessageActions; }
2087
2087
  });
2088
2088
  Object.defineProperty(exports, "MessageBubble", {
2089
2089
  enumerable: true,
2090
- get: function () { return chunkNRXYYO5V_cjs.MessageBubble; }
2090
+ get: function () { return chunk5T4K3VUV_cjs.MessageBubble; }
2091
2091
  });
2092
2092
  Object.defineProperty(exports, "MessageList", {
2093
2093
  enumerable: true,
2094
- get: function () { return chunkNRXYYO5V_cjs.MessageList; }
2094
+ get: function () { return chunk5T4K3VUV_cjs.MessageList; }
2095
2095
  });
2096
2096
  Object.defineProperty(exports, "STORAGE_KEYS", {
2097
2097
  enumerable: true,
2098
- get: function () { return chunkNRXYYO5V_cjs.STORAGE_KEYS; }
2098
+ get: function () { return chunk5T4K3VUV_cjs.STORAGE_KEYS; }
2099
2099
  });
2100
2100
  Object.defineProperty(exports, "Sources", {
2101
2101
  enumerable: true,
2102
- get: function () { return chunkNRXYYO5V_cjs.Sources; }
2102
+ get: function () { return chunk5T4K3VUV_cjs.Sources; }
2103
2103
  });
2104
2104
  Object.defineProperty(exports, "StreamingIndicator", {
2105
2105
  enumerable: true,
2106
- get: function () { return chunkNRXYYO5V_cjs.StreamingIndicator; }
2106
+ get: function () { return chunk5T4K3VUV_cjs.StreamingIndicator; }
2107
2107
  });
2108
2108
  Object.defineProperty(exports, "ToolCalls", {
2109
2109
  enumerable: true,
2110
- get: function () { return chunkNRXYYO5V_cjs.ToolCalls; }
2110
+ get: function () { return chunk5T4K3VUV_cjs.ToolCalls; }
2111
2111
  });
2112
2112
  Object.defineProperty(exports, "createId", {
2113
2113
  enumerable: true,
2114
- get: function () { return chunkNRXYYO5V_cjs.createId; }
2114
+ get: function () { return chunk5T4K3VUV_cjs.createId; }
2115
2115
  });
2116
2116
  Object.defineProperty(exports, "createTokenBuffer", {
2117
2117
  enumerable: true,
2118
- get: function () { return chunkNRXYYO5V_cjs.createTokenBuffer; }
2118
+ get: function () { return chunk5T4K3VUV_cjs.createTokenBuffer; }
2119
2119
  });
2120
2120
  Object.defineProperty(exports, "deriveInitials", {
2121
2121
  enumerable: true,
2122
- get: function () { return chunkNRXYYO5V_cjs.deriveInitials; }
2122
+ get: function () { return chunk5T4K3VUV_cjs.deriveInitials; }
2123
+ });
2124
+ Object.defineProperty(exports, "getChatLogger", {
2125
+ enumerable: true,
2126
+ get: function () { return chunk5T4K3VUV_cjs.getChatLogger; }
2123
2127
  });
2124
2128
  Object.defineProperty(exports, "initialState", {
2125
2129
  enumerable: true,
2126
- get: function () { return chunkNRXYYO5V_cjs.initialState; }
2130
+ get: function () { return chunk5T4K3VUV_cjs.initialState; }
2127
2131
  });
2128
2132
  Object.defineProperty(exports, "reducer", {
2129
2133
  enumerable: true,
2130
- get: function () { return chunkNRXYYO5V_cjs.reducer; }
2134
+ get: function () { return chunk5T4K3VUV_cjs.reducer; }
2131
2135
  });
2132
2136
  Object.defineProperty(exports, "resolvePersona", {
2133
2137
  enumerable: true,
2134
- get: function () { return chunkNRXYYO5V_cjs.resolvePersona; }
2138
+ get: function () { return chunk5T4K3VUV_cjs.resolvePersona; }
2135
2139
  });
2136
2140
  Object.defineProperty(exports, "useChat", {
2137
2141
  enumerable: true,
2138
- get: function () { return chunkNRXYYO5V_cjs.useChat; }
2142
+ get: function () { return chunk5T4K3VUV_cjs.useChat; }
2139
2143
  });
2140
2144
  Object.defineProperty(exports, "useChatAudio", {
2141
2145
  enumerable: true,
2142
- get: function () { return chunkNRXYYO5V_cjs.useChatAudio; }
2146
+ get: function () { return chunk5T4K3VUV_cjs.useChatAudio; }
2143
2147
  });
2144
2148
  Object.defineProperty(exports, "useChatAudioPrefs", {
2145
2149
  enumerable: true,
2146
- get: function () { return chunkNRXYYO5V_cjs.useChatAudioPrefs; }
2150
+ get: function () { return chunk5T4K3VUV_cjs.useChatAudioPrefs; }
2147
2151
  });
2148
2152
  Object.defineProperty(exports, "useChatComposer", {
2149
2153
  enumerable: true,
2150
- get: function () { return chunkNRXYYO5V_cjs.useChatComposer; }
2154
+ get: function () { return chunk5T4K3VUV_cjs.useChatComposer; }
2151
2155
  });
2152
2156
  Object.defineProperty(exports, "useChatContext", {
2153
2157
  enumerable: true,
2154
- get: function () { return chunkNRXYYO5V_cjs.useChatContext; }
2158
+ get: function () { return chunk5T4K3VUV_cjs.useChatContext; }
2155
2159
  });
2156
2160
  Object.defineProperty(exports, "useChatContextOptional", {
2157
2161
  enumerable: true,
2158
- get: function () { return chunkNRXYYO5V_cjs.useChatContextOptional; }
2162
+ get: function () { return chunk5T4K3VUV_cjs.useChatContextOptional; }
2159
2163
  });
2160
2164
  Object.defineProperty(exports, "useChatHistory", {
2161
2165
  enumerable: true,
2162
- get: function () { return chunkNRXYYO5V_cjs.useChatHistory; }
2166
+ get: function () { return chunk5T4K3VUV_cjs.useChatHistory; }
2163
2167
  });
2164
2168
  Object.defineProperty(exports, "useChatLayout", {
2165
2169
  enumerable: true,
2166
- get: function () { return chunkNRXYYO5V_cjs.useChatLayout; }
2170
+ get: function () { return chunk5T4K3VUV_cjs.useChatLayout; }
2167
2171
  });
2168
2172
  Object.defineProperty(exports, "useChatScroll", {
2169
2173
  enumerable: true,
2170
- get: function () { return chunkNRXYYO5V_cjs.useChatScroll; }
2174
+ get: function () { return chunk5T4K3VUV_cjs.useChatScroll; }
2171
2175
  });
2172
2176
  Object.defineProperty(exports, "TreeError", {
2173
2177
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -15,6 +15,7 @@ import { b as TreeRootProps } from './types-CevSbyfD.cjs';
15
15
  export { c as DEFAULT_TREE_APPEARANCE, D as DEFAULT_TREE_LABELS, F as FlatRow, R as ResolvedAppearance, m as TreeAccentIntensity, k as TreeAppearance, e as TreeContextMenuSlot, l as TreeDensity, f as TreeItemId, g as TreeLabels, j as TreeLoadChildren, T as TreeNode, n as TreeRadius, i as TreeRowRenderProps, a as TreeRowSlot, h as TreeSelectionMode, d as appearanceToStyle, r as resolveAppearance } from './types-CevSbyfD.cjs';
16
16
  import * as zustand_middleware from 'zustand/middleware';
17
17
  import * as zustand from 'zustand';
18
+ import { ConsolaInstance } from 'consola';
18
19
  import { MediaPlayerInstance } from '@vidstack/react';
19
20
  import * as monaco from 'monaco-editor';
20
21
  export { ChildCache, ChildEntry, ChildEntryStatus, DemoNode, FlattenInput, PersistedTreeState, TreeRoot as Tree, TreeChevron, TreeChevronProps, TreeContent, TreeContentProps, TreeContextValue, TreeEmpty, TreeEmptyProps, TreeError, TreeErrorProps, TreeIcon, TreeIconProps, TreeIndentGuides, TreeIndentGuidesProps, TreeLabel, TreeLabelProps, TreeProvider, TreeProviderProps, TreeRoot, TreeRow, TreeRowProps, TreeSearchInput, TreeSearchInputProps, TreeSkeleton, TreeSkeletonProps, UseTreeKeyboardOptions, UseTreeTypeAheadOptions, clearTreeState, createChildCache, createDemoTree, flattenTree, loadTreeState, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './tree/index.cjs';
@@ -1755,6 +1756,12 @@ interface UseChatConfig {
1755
1756
  metadata?: Record<string, unknown>;
1756
1757
  /** Stamped on outgoing user messages as `message.sender`. */
1757
1758
  userPersona?: ChatPersona;
1759
+ /**
1760
+ * Enable verbose dev-mode logging (consola, namespace `chat:*`).
1761
+ * Defaults to `isDev` from `@djangocfg/ui-core/lib`. Pass `false` to silence
1762
+ * even in development; `true` to force on in production.
1763
+ */
1764
+ debug?: boolean;
1758
1765
  }
1759
1766
  interface UseChatReturn extends ChatState {
1760
1767
  sendMessage: (content: string, attachments?: ChatAttachment[]) => Promise<void>;
@@ -1808,9 +1815,11 @@ interface ChatProviderProps {
1808
1815
  streaming?: boolean;
1809
1816
  /** Audio-trigger configuration. Off by default (no `sounds` map). */
1810
1817
  audio?: ChatAudioConfig;
1818
+ /** Enable verbose dev logging via consola. Defaults to `isDev`. */
1819
+ debug?: boolean;
1811
1820
  children?: ReactNode;
1812
1821
  }
1813
- declare function ChatProvider({ transport, config, initialSessionId, autoCreateSession, streaming, audio, children, }: ChatProviderProps): react_jsx_runtime.JSX.Element;
1822
+ declare function ChatProvider({ transport, config, initialSessionId, autoCreateSession, streaming, audio, debug, children, }: ChatProviderProps): react_jsx_runtime.JSX.Element;
1814
1823
  declare function useChatContext(): ChatContextValue;
1815
1824
  declare function useChatContextOptional(): ChatContextValue | null;
1816
1825
 
@@ -1920,6 +1929,12 @@ interface ChatRootProps {
1920
1929
  streaming?: boolean;
1921
1930
  /** Audio-trigger configuration. Off by default (no `sounds` map). */
1922
1931
  audio?: ChatAudioConfig;
1932
+ /**
1933
+ * Verbose dev-mode logging via `consola` (namespace `chat:*`).
1934
+ * Defaults to `isDev` from `@djangocfg/ui-core/lib`. Pass `false` to silence
1935
+ * even in development, or `true` to force on in production for debugging.
1936
+ */
1937
+ debug?: boolean;
1923
1938
  className?: string;
1924
1939
  /** Sticky banner above the message list (e.g. quota warning). */
1925
1940
  banner?: ReactNode;
@@ -2197,6 +2212,44 @@ declare function isStringValue(v: unknown): v is string;
2197
2212
  /** Walk the conversation and collect image attachments in chronological order. */
2198
2213
  declare function collectImageAttachments(messages: ChatMessage[]): ChatAttachment[];
2199
2214
 
2215
+ /**
2216
+ * Chat dev logger.
2217
+ *
2218
+ * A thin namespaced wrapper over `consola` that no-ops in production unless
2219
+ * the host app explicitly opts in via `<ChatRoot debug />`. The default
2220
+ * detection uses `isDev` from `@djangocfg/ui-core/lib/env` (NODE_ENV).
2221
+ *
2222
+ * Why a dedicated module: chat is async and event-heavy (bootstrap, transport,
2223
+ * SSE chunks, tool calls, regenerate, …). Inline `console.log`s rot fast and
2224
+ * leak into prod. A single `getChatLogger()` call gives every layer the same
2225
+ * namespaced sub-logger and keeps zero-cost gating in one place.
2226
+ *
2227
+ * Sub-loggers:
2228
+ * bootstrap — initial session bootstrap (createSession / loadHistory)
2229
+ * transport — outbound transport calls + responses
2230
+ * stream — SSE chunk / tool / message_end events
2231
+ * lifecycle — sendMessage, regenerate, newSession, edits
2232
+ * tools — tool_call_start / _delta / _end specifics
2233
+ * error — caught errors (always emitted as `error` level)
2234
+ */
2235
+
2236
+ type ChatLogScope = 'bootstrap' | 'transport' | 'stream' | 'lifecycle' | 'tools' | 'error';
2237
+ interface ChatLogger {
2238
+ bootstrap: ConsolaInstance;
2239
+ transport: ConsolaInstance;
2240
+ stream: ConsolaInstance;
2241
+ lifecycle: ConsolaInstance;
2242
+ tools: ConsolaInstance;
2243
+ error: ConsolaInstance;
2244
+ /** True when this logger is actually emitting (host opted in or NODE_ENV=development). */
2245
+ enabled: boolean;
2246
+ }
2247
+ /**
2248
+ * Get the chat logger.
2249
+ * @param debug Explicit override from the host. `undefined` falls back to `isDev`.
2250
+ */
2251
+ declare function getChatLogger(debug?: boolean): ChatLogger;
2252
+
2200
2253
  interface MessageListProps {
2201
2254
  messages?: ChatMessage[];
2202
2255
  renderItem?: (m: ChatMessage, i: number) => ReactNode;
@@ -3333,4 +3386,4 @@ declare function useBlobUrlCleanup(key: string | null): void;
3333
3386
  */
3334
3387
  declare function generateContentKey(content: ArrayBuffer): string;
3335
3388
 
3336
- export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
3389
+ export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatLogScope, type ChatLogger, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getChatLogger, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ import { b as TreeRootProps } from './types-CevSbyfD.js';
15
15
  export { c as DEFAULT_TREE_APPEARANCE, D as DEFAULT_TREE_LABELS, F as FlatRow, R as ResolvedAppearance, m as TreeAccentIntensity, k as TreeAppearance, e as TreeContextMenuSlot, l as TreeDensity, f as TreeItemId, g as TreeLabels, j as TreeLoadChildren, T as TreeNode, n as TreeRadius, i as TreeRowRenderProps, a as TreeRowSlot, h as TreeSelectionMode, d as appearanceToStyle, r as resolveAppearance } from './types-CevSbyfD.js';
16
16
  import * as zustand_middleware from 'zustand/middleware';
17
17
  import * as zustand from 'zustand';
18
+ import { ConsolaInstance } from 'consola';
18
19
  import { MediaPlayerInstance } from '@vidstack/react';
19
20
  import * as monaco from 'monaco-editor';
20
21
  export { ChildCache, ChildEntry, ChildEntryStatus, DemoNode, FlattenInput, PersistedTreeState, TreeRoot as Tree, TreeChevron, TreeChevronProps, TreeContent, TreeContentProps, TreeContextValue, TreeEmpty, TreeEmptyProps, TreeError, TreeErrorProps, TreeIcon, TreeIconProps, TreeIndentGuides, TreeIndentGuidesProps, TreeLabel, TreeLabelProps, TreeProvider, TreeProviderProps, TreeRoot, TreeRow, TreeRowProps, TreeSearchInput, TreeSearchInputProps, TreeSkeleton, TreeSkeletonProps, UseTreeKeyboardOptions, UseTreeTypeAheadOptions, clearTreeState, createChildCache, createDemoTree, flattenTree, loadTreeState, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './tree/index.js';
@@ -1755,6 +1756,12 @@ interface UseChatConfig {
1755
1756
  metadata?: Record<string, unknown>;
1756
1757
  /** Stamped on outgoing user messages as `message.sender`. */
1757
1758
  userPersona?: ChatPersona;
1759
+ /**
1760
+ * Enable verbose dev-mode logging (consola, namespace `chat:*`).
1761
+ * Defaults to `isDev` from `@djangocfg/ui-core/lib`. Pass `false` to silence
1762
+ * even in development; `true` to force on in production.
1763
+ */
1764
+ debug?: boolean;
1758
1765
  }
1759
1766
  interface UseChatReturn extends ChatState {
1760
1767
  sendMessage: (content: string, attachments?: ChatAttachment[]) => Promise<void>;
@@ -1808,9 +1815,11 @@ interface ChatProviderProps {
1808
1815
  streaming?: boolean;
1809
1816
  /** Audio-trigger configuration. Off by default (no `sounds` map). */
1810
1817
  audio?: ChatAudioConfig;
1818
+ /** Enable verbose dev logging via consola. Defaults to `isDev`. */
1819
+ debug?: boolean;
1811
1820
  children?: ReactNode;
1812
1821
  }
1813
- declare function ChatProvider({ transport, config, initialSessionId, autoCreateSession, streaming, audio, children, }: ChatProviderProps): react_jsx_runtime.JSX.Element;
1822
+ declare function ChatProvider({ transport, config, initialSessionId, autoCreateSession, streaming, audio, debug, children, }: ChatProviderProps): react_jsx_runtime.JSX.Element;
1814
1823
  declare function useChatContext(): ChatContextValue;
1815
1824
  declare function useChatContextOptional(): ChatContextValue | null;
1816
1825
 
@@ -1920,6 +1929,12 @@ interface ChatRootProps {
1920
1929
  streaming?: boolean;
1921
1930
  /** Audio-trigger configuration. Off by default (no `sounds` map). */
1922
1931
  audio?: ChatAudioConfig;
1932
+ /**
1933
+ * Verbose dev-mode logging via `consola` (namespace `chat:*`).
1934
+ * Defaults to `isDev` from `@djangocfg/ui-core/lib`. Pass `false` to silence
1935
+ * even in development, or `true` to force on in production for debugging.
1936
+ */
1937
+ debug?: boolean;
1923
1938
  className?: string;
1924
1939
  /** Sticky banner above the message list (e.g. quota warning). */
1925
1940
  banner?: ReactNode;
@@ -2197,6 +2212,44 @@ declare function isStringValue(v: unknown): v is string;
2197
2212
  /** Walk the conversation and collect image attachments in chronological order. */
2198
2213
  declare function collectImageAttachments(messages: ChatMessage[]): ChatAttachment[];
2199
2214
 
2215
+ /**
2216
+ * Chat dev logger.
2217
+ *
2218
+ * A thin namespaced wrapper over `consola` that no-ops in production unless
2219
+ * the host app explicitly opts in via `<ChatRoot debug />`. The default
2220
+ * detection uses `isDev` from `@djangocfg/ui-core/lib/env` (NODE_ENV).
2221
+ *
2222
+ * Why a dedicated module: chat is async and event-heavy (bootstrap, transport,
2223
+ * SSE chunks, tool calls, regenerate, …). Inline `console.log`s rot fast and
2224
+ * leak into prod. A single `getChatLogger()` call gives every layer the same
2225
+ * namespaced sub-logger and keeps zero-cost gating in one place.
2226
+ *
2227
+ * Sub-loggers:
2228
+ * bootstrap — initial session bootstrap (createSession / loadHistory)
2229
+ * transport — outbound transport calls + responses
2230
+ * stream — SSE chunk / tool / message_end events
2231
+ * lifecycle — sendMessage, regenerate, newSession, edits
2232
+ * tools — tool_call_start / _delta / _end specifics
2233
+ * error — caught errors (always emitted as `error` level)
2234
+ */
2235
+
2236
+ type ChatLogScope = 'bootstrap' | 'transport' | 'stream' | 'lifecycle' | 'tools' | 'error';
2237
+ interface ChatLogger {
2238
+ bootstrap: ConsolaInstance;
2239
+ transport: ConsolaInstance;
2240
+ stream: ConsolaInstance;
2241
+ lifecycle: ConsolaInstance;
2242
+ tools: ConsolaInstance;
2243
+ error: ConsolaInstance;
2244
+ /** True when this logger is actually emitting (host opted in or NODE_ENV=development). */
2245
+ enabled: boolean;
2246
+ }
2247
+ /**
2248
+ * Get the chat logger.
2249
+ * @param debug Explicit override from the host. `undefined` falls back to `isDev`.
2250
+ */
2251
+ declare function getChatLogger(debug?: boolean): ChatLogger;
2252
+
2200
2253
  interface MessageListProps {
2201
2254
  messages?: ChatMessage[];
2202
2255
  renderItem?: (m: ChatMessage, i: number) => ReactNode;
@@ -3333,4 +3386,4 @@ declare function useBlobUrlCleanup(key: string | null): void;
3333
3386
  */
3334
3387
  declare function generateContentKey(content: ArrayBuffer): string;
3335
3388
 
3336
- export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
3389
+ export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatLogScope, type ChatLogger, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getChatLogger, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
package/dist/index.mjs CHANGED
@@ -5,8 +5,8 @@ export { NativeProvider, StreamProvider, VideoControls, VideoErrorFallback, Vide
5
5
  export { ImageViewer } from './chunk-OBRSGM64.mjs';
6
6
  export { generateContentKey, useAudioCache, useBlobUrlCleanup, useImageCache, useMediaCacheStore, useVideoCache, useVideoPlayerSettings } from './chunk-C6GXVH5J.mjs';
7
7
  export { CronSchedulerProvider, CustomInput, DayChips, MonthDayGrid, SchedulePreview, ScheduleTypeSelector, TimeSelector, buildCron, humanizeCron, isValidCron, parseCron, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays } from './chunk-PVAX67JG.mjs';
8
- import { LIMITS, createId } from './chunk-KRETIZU6.mjs';
9
- export { Attachments, AttachmentsGrid, AttachmentsList, CHAT_EVENT_NAME, CSS_VARS, ChatProvider, ChatRoot, Composer, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, EmptyState, ErrorBanner, HOTKEYS, JumpToLatest, LIMITS, MessageActions, MessageBubble, MessageList, STORAGE_KEYS, Sources, StreamingIndicator, ToolCalls, createId, createTokenBuffer, deriveInitials, initialState, reducer, resolvePersona, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatScroll } from './chunk-KRETIZU6.mjs';
8
+ import { LIMITS, createId } from './chunk-QE25H6DP.mjs';
9
+ export { Attachments, AttachmentsGrid, AttachmentsList, CHAT_EVENT_NAME, CSS_VARS, ChatProvider, ChatRoot, Composer, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, EmptyState, ErrorBanner, HOTKEYS, JumpToLatest, LIMITS, MessageActions, MessageBubble, MessageList, STORAGE_KEYS, Sources, StreamingIndicator, ToolCalls, createId, createTokenBuffer, deriveInitials, getChatLogger, initialState, reducer, resolvePersona, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatScroll } from './chunk-QE25H6DP.mjs';
10
10
  export { TreeError, TreeSkeleton, createDemoTree } from './chunk-B6IR5KSC.mjs';
11
11
  export { DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, TreeRoot as Tree, TreeChevron, TreeContent, TreeEmpty, TreeIcon, TreeIndentGuides, TreeLabel, TreeProvider, TreeRoot, TreeRow, TreeSearchInput, appearanceToStyle, clearTreeState, createChildCache, flattenTree, loadTreeState, resolveAppearance, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './chunk-G5IEC7SR.mjs';
12
12
  import { PlaygroundProvider } from './chunk-ZUFTH5IR.mjs';
@@ -347,7 +347,7 @@ var LazyTree = createLazyComponent(
347
347
  }
348
348
  );
349
349
  var LazyChat = createLazyComponent(
350
- () => import('./ChatRoot-IIYQEWUU.mjs').then((m) => ({ default: m.ChatRoot })),
350
+ () => import('./ChatRoot-R5YQTOLP.mjs').then((m) => ({ default: m.ChatRoot })),
351
351
  {
352
352
  displayName: "LazyChat",
353
353
  fallback: /* @__PURE__ */ jsx(LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/ui-tools",
3
- "version": "2.1.336",
3
+ "version": "2.1.338",
4
4
  "description": "Heavy React tools with lazy loading - for Electron, Vite, CRA, Next.js apps",
5
5
  "keywords": [
6
6
  "ui-tools",
@@ -101,8 +101,8 @@
101
101
  "check": "tsc --noEmit"
102
102
  },
103
103
  "peerDependencies": {
104
- "@djangocfg/i18n": "^2.1.336",
105
- "@djangocfg/ui-core": "^2.1.336",
104
+ "@djangocfg/i18n": "^2.1.338",
105
+ "@djangocfg/ui-core": "^2.1.338",
106
106
  "consola": "^3.4.2",
107
107
  "lodash-es": "^4.18.1",
108
108
  "lucide-react": "^0.545.0",
@@ -155,10 +155,10 @@
155
155
  "material-file-icons": "^2.4.0"
156
156
  },
157
157
  "devDependencies": {
158
- "@djangocfg/i18n": "^2.1.336",
158
+ "@djangocfg/i18n": "^2.1.338",
159
159
  "@djangocfg/playground": "workspace:*",
160
- "@djangocfg/typescript-config": "^2.1.336",
161
- "@djangocfg/ui-core": "^2.1.336",
160
+ "@djangocfg/typescript-config": "^2.1.338",
161
+ "@djangocfg/ui-core": "^2.1.338",
162
162
  "@types/lodash-es": "^4.17.12",
163
163
  "@types/mapbox__mapbox-gl-draw": "^1.4.8",
164
164
  "@types/node": "^24.7.2",
@@ -28,6 +28,12 @@ export interface ChatRootProps {
28
28
  streaming?: boolean;
29
29
  /** Audio-trigger configuration. Off by default (no `sounds` map). */
30
30
  audio?: ChatAudioConfig;
31
+ /**
32
+ * Verbose dev-mode logging via `consola` (namespace `chat:*`).
33
+ * Defaults to `isDev` from `@djangocfg/ui-core/lib`. Pass `false` to silence
34
+ * even in development, or `true` to force on in production for debugging.
35
+ */
36
+ debug?: boolean;
31
37
  className?: string;
32
38
 
33
39
  // ---- named ReactNode slots --------------------------------------------
@@ -70,7 +76,7 @@ export interface ChatRootProps {
70
76
  }
71
77
 
72
78
  export function ChatRoot(props: ChatRootProps) {
73
- const { transport, config, initialSessionId, autoCreateSession, streaming, audio, className, ...slots } = props;
79
+ const { transport, config, initialSessionId, autoCreateSession, streaming, audio, debug, className, ...slots } = props;
74
80
  return (
75
81
  <ChatProvider
76
82
  transport={transport}
@@ -79,6 +85,7 @@ export function ChatRoot(props: ChatRootProps) {
79
85
  autoCreateSession={autoCreateSession}
80
86
  streaming={streaming}
81
87
  audio={audio}
88
+ debug={debug}
82
89
  >
83
90
  <ChatRootShell className={className} slots={slots} />
84
91
  </ChatProvider>
@@ -87,7 +94,7 @@ export function ChatRoot(props: ChatRootProps) {
87
94
 
88
95
  interface ChatRootShellProps {
89
96
  className?: string;
90
- slots: Omit<ChatRootProps, 'transport' | 'config' | 'initialSessionId' | 'autoCreateSession' | 'streaming' | 'audio' | 'className'>;
97
+ slots: Omit<ChatRootProps, 'transport' | 'config' | 'initialSessionId' | 'autoCreateSession' | 'streaming' | 'audio' | 'debug' | 'className'>;
91
98
  }
92
99
 
93
100
  function ChatRootShell({ className, slots }: ChatRootShellProps) {
@@ -34,6 +34,8 @@ export interface ChatProviderProps {
34
34
  streaming?: boolean;
35
35
  /** Audio-trigger configuration. Off by default (no `sounds` map). */
36
36
  audio?: ChatAudioConfig;
37
+ /** Enable verbose dev logging via consola. Defaults to `isDev`. */
38
+ debug?: boolean;
37
39
  children?: ReactNode;
38
40
  }
39
41
 
@@ -44,6 +46,7 @@ export function ChatProvider({
44
46
  autoCreateSession,
45
47
  streaming,
46
48
  audio,
49
+ debug,
47
50
  children,
48
51
  }: ChatProviderProps) {
49
52
  const audioApi = useChatAudio(audio ?? {});
@@ -63,6 +66,7 @@ export function ChatProvider({
63
66
  initialSessionId,
64
67
  autoCreateSession,
65
68
  streaming,
69
+ debug,
66
70
  metadata: {
67
71
  locale: config.locale ?? config.prefs?.locale,
68
72
  slug: config.slug,