@columenlabs/lumen-ui 0.1.134 → 0.1.136

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,6 +1,6 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useQuery, useQueryClient } from '@tanstack/react-query';
3
- import { CoinsIcon, GlobeIcon, InboxIcon, KeyRoundIcon, LayersIcon, LogInIcon, ReceiptIcon, SparklesIcon, WrenchIcon, } from 'lucide-react';
3
+ import { CoinsIcon, GlobeIcon, InboxIcon, KeyRoundIcon, LayersIcon, Link2Icon, LogInIcon, ReceiptIcon, SparklesIcon, WrenchIcon, } from 'lucide-react';
4
4
  import { useId, useState } from 'react';
5
5
  import { ConnectionLogo, LumenConnection, } from '../connection.js';
6
6
  import { LumenExpandList, LumenExpandRow } from '../expand-list.js';
@@ -215,6 +215,21 @@ function ScrapeqlBlock({ client, s }) {
215
215
  const state = s.web.scrapeql;
216
216
  if (!state)
217
217
  return null;
218
+ // Reached over the app's service binding: nothing to paste, only a test.
219
+ if (state.bound)
220
+ return (_jsx(LumenExpandList, { children: _jsx(LumenConnection, { id: "scrapeql", name: "ScrapeQL", logo: _jsx(ConnectionLogo, { icon: GlobeIcon }), meta: "Linked to this app, no token needed", ways: [
221
+ {
222
+ id: 'link',
223
+ label: 'App link',
224
+ icon: Link2Icon,
225
+ info: 'This app reaches ScrapeQL over a Cloudflare service binding, so no token is stored.',
226
+ set: true,
227
+ test: wayTest(state),
228
+ note: 'Set by the app',
229
+ readOnly: true,
230
+ ...(s.admin ? { onTest: () => client.testScrapeql().finally(refresh) } : {}),
231
+ },
232
+ ] }) }));
218
233
  return (_jsx(LumenExpandList, { children: _jsx(LumenConnection, { id: "scrapeql", name: "ScrapeQL", logo: _jsx(ConnectionLogo, { icon: GlobeIcon }), meta: state.set ? undefined : 'Search and pages that need a real browser', ways: [
219
234
  {
220
235
  id: 'token',
@@ -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.134",
3
+ "version": "0.1.136",
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.134",
52
+ "@columenlabs/lumen-ui-types": "0.1.136",
53
53
  "@dnd-kit/core": "6.3.1",
54
54
  "@dnd-kit/sortable": "10.0.0",
55
55
  "@dnd-kit/utilities": "3.2.2",