@townco/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.
@@ -228,7 +228,7 @@ export declare function useChatMessages(client: AcpClient | null, startSession:
228
228
  }[] | undefined;
229
229
  sources?: {
230
230
  id: string;
231
- url: string;
231
+ url?: string | undefined;
232
232
  title: string;
233
233
  snippet?: string | undefined;
234
234
  favicon?: string | undefined;
@@ -312,7 +312,7 @@ export declare const DisplayMessage: z.ZodObject<{
312
312
  }, z.core.$strip>>>;
313
313
  sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
314
314
  id: z.ZodString;
315
- url: z.ZodString;
315
+ url: z.ZodOptional<z.ZodString>;
316
316
  title: z.ZodString;
317
317
  snippet: z.ZodOptional<z.ZodString>;
318
318
  favicon: z.ZodOptional<z.ZodString>;
@@ -607,7 +607,7 @@ export declare const ChatSessionState: z.ZodObject<{
607
607
  }, z.core.$strip>>>;
608
608
  sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
609
609
  id: z.ZodString;
610
- url: z.ZodString;
610
+ url: z.ZodOptional<z.ZodString>;
611
611
  title: z.ZodString;
612
612
  snippet: z.ZodOptional<z.ZodString>;
613
613
  favicon: z.ZodOptional<z.ZodString>;
@@ -4,7 +4,7 @@ import { z } from "zod";
4
4
  */
5
5
  export declare const SourceSchema: z.ZodObject<{
6
6
  id: z.ZodString;
7
- url: z.ZodString;
7
+ url: z.ZodOptional<z.ZodString>;
8
8
  title: z.ZodString;
9
9
  snippet: z.ZodOptional<z.ZodString>;
10
10
  favicon: z.ZodOptional<z.ZodString>;
@@ -5,8 +5,8 @@ import { z } from "zod";
5
5
  export const SourceSchema = z.object({
6
6
  /** Unique identifier for LLM reference (e.g., "1", "2") */
7
7
  id: z.string(),
8
- /** The URL of the source */
9
- url: z.string().url(),
8
+ /** The URL of the source (optional for backward compatibility with sessions that have missing URLs) */
9
+ url: z.string().optional(),
10
10
  /** Title of the source page/article */
11
11
  title: z.string(),
12
12
  /** Optional snippet/excerpt from the source */
@@ -144,7 +144,7 @@ export function ChatView({ client, initialSessionId, error: initError, debuggerU
144
144
  byId.set(source.id, {
145
145
  id: source.id,
146
146
  title: source.title,
147
- url: source.url,
147
+ url: source.url || "",
148
148
  snippet: source.snippet || "",
149
149
  sourceName: source.sourceName || "",
150
150
  favicon: source.favicon || "",
@@ -39,7 +39,7 @@ export const CitationChip = React.forwardRef(({ sourceId, sources, className },
39
39
  if (!source) {
40
40
  return (_jsxs("span", { ref: ref, className: cn("inline-flex items-center px-1.5 py-0.5 text-xs font-medium", "bg-muted text-muted-foreground rounded-md", "cursor-default", className), children: ["[", sourceId, "]"] }));
41
41
  }
42
- const domain = source.sourceName || getDomain(source.url);
42
+ const domain = source.sourceName || (source.url ? getDomain(source.url) : "");
43
43
  return (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [
44
44
  _jsx(TooltipTrigger, { asChild: true, children: _jsxs("span", { ref: ref, role: "button", tabIndex: 0, onClick: handleClick, onKeyDown: (e) => {
45
45
  if (e.key === "Enter" || e.key === " ") {
@@ -411,7 +411,7 @@ export type HookNotificationChunk = z.infer<typeof HookNotificationChunk>;
411
411
  */
412
412
  export declare const CitationSource: z.ZodObject<{
413
413
  id: z.ZodString;
414
- url: z.ZodString;
414
+ url: z.ZodOptional<z.ZodString>;
415
415
  title: z.ZodString;
416
416
  snippet: z.ZodOptional<z.ZodString>;
417
417
  favicon: z.ZodOptional<z.ZodString>;
@@ -426,7 +426,7 @@ export declare const SourcesChunk: z.ZodObject<{
426
426
  type: z.ZodLiteral<"sources">;
427
427
  sources: z.ZodArray<z.ZodObject<{
428
428
  id: z.ZodString;
429
- url: z.ZodString;
429
+ url: z.ZodOptional<z.ZodString>;
430
430
  title: z.ZodString;
431
431
  snippet: z.ZodOptional<z.ZodString>;
432
432
  favicon: z.ZodOptional<z.ZodString>;
@@ -553,7 +553,7 @@ export declare const MessageChunk: z.ZodDiscriminatedUnion<[z.ZodObject<{
553
553
  type: z.ZodLiteral<"sources">;
554
554
  sources: z.ZodArray<z.ZodObject<{
555
555
  id: z.ZodString;
556
- url: z.ZodString;
556
+ url: z.ZodOptional<z.ZodString>;
557
557
  title: z.ZodString;
558
558
  snippet: z.ZodOptional<z.ZodString>;
559
559
  favicon: z.ZodOptional<z.ZodString>;
@@ -214,7 +214,7 @@ export const HookNotificationChunk = z.object({
214
214
  */
215
215
  export const CitationSource = z.object({
216
216
  id: z.string(),
217
- url: z.string().url(),
217
+ url: z.string().optional(), // Optional for backward compatibility with sessions that have missing URLs
218
218
  title: z.string(),
219
219
  snippet: z.string().optional(),
220
220
  favicon: z.string().optional(),
@@ -758,7 +758,7 @@ export declare const SessionUpdate: z.ZodUnion<readonly [z.ZodObject<{
758
758
  type: z.ZodLiteral<"sources">;
759
759
  sources: z.ZodArray<z.ZodObject<{
760
760
  id: z.ZodString;
761
- url: z.ZodString;
761
+ url: z.ZodOptional<z.ZodString>;
762
762
  title: z.ZodString;
763
763
  snippet: z.ZodOptional<z.ZodString>;
764
764
  favicon: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@townco/ui",
3
- "version": "0.1.134",
3
+ "version": "0.1.136",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -49,7 +49,7 @@
49
49
  "@radix-ui/react-slot": "^1.2.4",
50
50
  "@radix-ui/react-tabs": "^1.1.13",
51
51
  "@radix-ui/react-tooltip": "^1.2.8",
52
- "@townco/core": "0.0.112",
52
+ "@townco/core": "0.0.114",
53
53
  "@types/mdast": "^4.0.4",
54
54
  "@uiw/react-json-view": "^2.0.0-alpha.39",
55
55
  "class-variance-authority": "^0.7.1",
@@ -67,7 +67,7 @@
67
67
  "zustand": "^5.0.8"
68
68
  },
69
69
  "devDependencies": {
70
- "@townco/tsconfig": "0.1.131",
70
+ "@townco/tsconfig": "0.1.133",
71
71
  "@types/node": "^24.10.0",
72
72
  "@types/react": "^19.2.2",
73
73
  "@types/unist": "^3.0.3",