@columenlabs/lumen-ui 0.1.135 → 0.1.137

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.
@@ -1,5 +1,14 @@
1
1
  import { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { errorText } from '../integrations.js';
3
+ /** The browser's IANA zone, sent with each message for the assistant's bearings. */
4
+ function browserZone() {
5
+ try {
6
+ return Intl.DateTimeFormat().resolvedOptions().timeZone || undefined;
7
+ }
8
+ catch {
9
+ return undefined;
10
+ }
11
+ }
3
12
  /** Where an event lands: the chat, or the last hand-off section when it came from inside one. */
4
13
  function sinkOf(items, handoff) {
5
14
  if (!handoff)
@@ -130,7 +139,12 @@ export function useAssistantChat(client) {
130
139
  },
131
140
  ]);
132
141
  try {
133
- await client.send({ message, ...(idRef.current ? { chat_id: idRef.current } : {}), ...extra }, (e) => {
142
+ await client.send({
143
+ message,
144
+ ...(idRef.current ? { chat_id: idRef.current } : {}),
145
+ ...(browserZone() ? { time_zone: browserZone() } : {}),
146
+ ...extra,
147
+ }, (e) => {
134
148
  if (e.event === 'chat') {
135
149
  idRef.current = e.data.id;
136
150
  setChatId(e.data.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@columenlabs/lumen-ui",
3
- "version": "0.1.135",
3
+ "version": "0.1.137",
4
4
  "description": "Lumen: shared React components (frame, views, widgets, charts, drawers).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,7 +49,7 @@
49
49
  "@codemirror/lang-javascript": "6.2.5",
50
50
  "@codemirror/lang-json": "6.0.2",
51
51
  "@codemirror/lang-sql": "6.10.0",
52
- "@columenlabs/lumen-ui-types": "0.1.135",
52
+ "@columenlabs/lumen-ui-types": "0.1.137",
53
53
  "@dnd-kit/core": "6.3.1",
54
54
  "@dnd-kit/sortable": "10.0.0",
55
55
  "@dnd-kit/utilities": "3.2.2",