@townco/ui 0.1.68 → 0.1.70

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.
Files changed (51) hide show
  1. package/dist/core/hooks/use-chat-messages.d.ts +6 -1
  2. package/dist/core/hooks/use-chat-session.d.ts +1 -1
  3. package/dist/core/hooks/use-tool-calls.d.ts +6 -1
  4. package/dist/core/schemas/chat.d.ts +10 -0
  5. package/dist/core/schemas/tool-call.d.ts +13 -8
  6. package/dist/core/schemas/tool-call.js +8 -0
  7. package/dist/core/utils/tool-call-state.d.ts +30 -0
  8. package/dist/core/utils/tool-call-state.js +73 -0
  9. package/dist/core/utils/tool-summary.d.ts +13 -0
  10. package/dist/core/utils/tool-summary.js +172 -0
  11. package/dist/core/utils/tool-verbiage.d.ts +28 -0
  12. package/dist/core/utils/tool-verbiage.js +185 -0
  13. package/dist/gui/components/AppSidebar.d.ts +22 -0
  14. package/dist/gui/components/AppSidebar.js +22 -0
  15. package/dist/gui/components/ChatLayout.d.ts +5 -0
  16. package/dist/gui/components/ChatLayout.js +130 -138
  17. package/dist/gui/components/ChatView.js +42 -118
  18. package/dist/gui/components/HookNotification.d.ts +9 -0
  19. package/dist/gui/components/HookNotification.js +50 -0
  20. package/dist/gui/components/MessageContent.js +151 -39
  21. package/dist/gui/components/SessionHistory.d.ts +10 -0
  22. package/dist/gui/components/SessionHistory.js +101 -0
  23. package/dist/gui/components/SessionHistoryItem.d.ts +11 -0
  24. package/dist/gui/components/SessionHistoryItem.js +24 -0
  25. package/dist/gui/components/Sheet.d.ts +25 -0
  26. package/dist/gui/components/Sheet.js +36 -0
  27. package/dist/gui/components/Sidebar.d.ts +65 -0
  28. package/dist/gui/components/Sidebar.js +231 -0
  29. package/dist/gui/components/SidebarToggle.d.ts +3 -0
  30. package/dist/gui/components/SidebarToggle.js +9 -0
  31. package/dist/gui/components/SubAgentDetails.js +13 -2
  32. package/dist/gui/components/ToolCallList.js +3 -3
  33. package/dist/gui/components/ToolOperation.d.ts +11 -0
  34. package/dist/gui/components/ToolOperation.js +329 -0
  35. package/dist/gui/components/WorkProgress.d.ts +20 -0
  36. package/dist/gui/components/WorkProgress.js +79 -0
  37. package/dist/gui/components/index.d.ts +8 -1
  38. package/dist/gui/components/index.js +9 -1
  39. package/dist/gui/hooks/index.d.ts +1 -0
  40. package/dist/gui/hooks/index.js +1 -0
  41. package/dist/gui/hooks/use-mobile.d.ts +1 -0
  42. package/dist/gui/hooks/use-mobile.js +15 -0
  43. package/dist/gui/index.d.ts +1 -0
  44. package/dist/gui/index.js +2 -0
  45. package/dist/gui/lib/motion.d.ts +55 -0
  46. package/dist/gui/lib/motion.js +217 -0
  47. package/dist/sdk/schemas/message.d.ts +2 -2
  48. package/dist/sdk/schemas/session.d.ts +5 -0
  49. package/dist/sdk/transports/types.d.ts +5 -0
  50. package/package.json +8 -7
  51. package/src/styles/global.css +128 -1
@@ -0,0 +1,217 @@
1
+ /**
2
+ * Motion utilities and reusable animation variants for the UI package
3
+ * Provides consistent animation behavior across components
4
+ */
5
+ // ============================================================================
6
+ // Standard Durations
7
+ // ============================================================================
8
+ export const motionDuration = {
9
+ fast: 0.15,
10
+ normal: 0.25,
11
+ slow: 0.4,
12
+ };
13
+ // ============================================================================
14
+ // Standard Easings
15
+ // ============================================================================
16
+ export const motionEasing = {
17
+ // Smooth, natural easing
18
+ smooth: [0.25, 0.1, 0.25, 1],
19
+ // Bouncy, playful easing
20
+ bounce: [0.68, -0.55, 0.265, 1.55],
21
+ // Sharp, snappy easing
22
+ sharp: [0.4, 0, 0.2, 1],
23
+ // Gentle, subtle easing
24
+ gentle: [0.25, 0.46, 0.45, 0.94],
25
+ };
26
+ // ============================================================================
27
+ // Fade Variants
28
+ // ============================================================================
29
+ export const fadeInVariants = {
30
+ hidden: {
31
+ opacity: 0,
32
+ },
33
+ visible: {
34
+ opacity: 1,
35
+ },
36
+ };
37
+ export const fadeInUpVariants = {
38
+ hidden: {
39
+ opacity: 0,
40
+ y: 8,
41
+ },
42
+ visible: {
43
+ opacity: 1,
44
+ y: 0,
45
+ },
46
+ };
47
+ // ============================================================================
48
+ // Expand/Collapse Variants
49
+ // ============================================================================
50
+ export const expandCollapseVariants = {
51
+ collapsed: {
52
+ height: 0,
53
+ opacity: 0,
54
+ overflow: "hidden",
55
+ },
56
+ expanded: {
57
+ height: "auto",
58
+ opacity: 1,
59
+ overflow: "visible",
60
+ },
61
+ };
62
+ export const slideDownVariants = {
63
+ hidden: {
64
+ opacity: 0,
65
+ height: 0,
66
+ y: -4,
67
+ },
68
+ visible: {
69
+ opacity: 1,
70
+ height: "auto",
71
+ y: 0,
72
+ },
73
+ };
74
+ // ============================================================================
75
+ // Shimmer Effect
76
+ // ============================================================================
77
+ export const shimmerTransition = {
78
+ duration: 2,
79
+ ease: "linear",
80
+ repeat: Infinity,
81
+ repeatType: "loop",
82
+ };
83
+ // For shimmer, we'll use a background gradient that shifts
84
+ export const shimmerVariants = {
85
+ idle: {
86
+ backgroundPosition: "200% 0",
87
+ },
88
+ active: {
89
+ backgroundPosition: "-200% 0",
90
+ },
91
+ };
92
+ // ============================================================================
93
+ // Scale Variants
94
+ // ============================================================================
95
+ export const scaleInVariants = {
96
+ hidden: {
97
+ scale: 0.95,
98
+ opacity: 0,
99
+ },
100
+ visible: {
101
+ scale: 1,
102
+ opacity: 1,
103
+ },
104
+ };
105
+ export const pulseVariants = {
106
+ idle: {
107
+ scale: 1,
108
+ },
109
+ pulse: {
110
+ scale: [1, 1.05, 1],
111
+ },
112
+ };
113
+ // ============================================================================
114
+ // Rotation Variants
115
+ // ============================================================================
116
+ export const rotateVariants = {
117
+ collapsed: {
118
+ rotate: 0,
119
+ },
120
+ expanded: {
121
+ rotate: 180,
122
+ },
123
+ };
124
+ // ============================================================================
125
+ // Standard Transitions
126
+ // ============================================================================
127
+ export const standardTransition = {
128
+ duration: motionDuration.normal,
129
+ ease: motionEasing.smooth,
130
+ };
131
+ export const fastTransition = {
132
+ duration: motionDuration.fast,
133
+ ease: motionEasing.sharp,
134
+ };
135
+ export const slowTransition = {
136
+ duration: motionDuration.slow,
137
+ ease: motionEasing.gentle,
138
+ };
139
+ export const springTransition = {
140
+ type: "spring",
141
+ stiffness: 300,
142
+ damping: 30,
143
+ };
144
+ export const gentleSpringTransition = {
145
+ type: "spring",
146
+ stiffness: 200,
147
+ damping: 25,
148
+ };
149
+ // ============================================================================
150
+ // Layout Transition (for shared layout animations)
151
+ // ============================================================================
152
+ export const layoutTransition = {
153
+ layout: {
154
+ duration: motionDuration.normal,
155
+ ease: motionEasing.smooth,
156
+ },
157
+ };
158
+ // ============================================================================
159
+ // Stagger Configurations
160
+ // ============================================================================
161
+ export const staggerChildren = {
162
+ visible: {
163
+ transition: {
164
+ staggerChildren: 0.05,
165
+ },
166
+ },
167
+ };
168
+ export const staggerChildrenFast = {
169
+ visible: {
170
+ transition: {
171
+ staggerChildren: 0.03,
172
+ },
173
+ },
174
+ };
175
+ // ============================================================================
176
+ // Slide Variants (for panels and drawers)
177
+ // ============================================================================
178
+ export const slideInFromRightVariants = {
179
+ hidden: {
180
+ x: "100%",
181
+ opacity: 0,
182
+ },
183
+ visible: {
184
+ x: 0,
185
+ opacity: 1,
186
+ },
187
+ };
188
+ export const slideOutToRightVariants = {
189
+ visible: {
190
+ x: 0,
191
+ opacity: 1,
192
+ },
193
+ hidden: {
194
+ x: "100%",
195
+ opacity: 0,
196
+ },
197
+ };
198
+ // ============================================================================
199
+ // Helper Functions
200
+ // ============================================================================
201
+ /**
202
+ * Get transition with reduced motion consideration
203
+ */
204
+ export function getTransition(shouldReduceMotion, transition = standardTransition) {
205
+ if (shouldReduceMotion) {
206
+ return {
207
+ duration: 0.01,
208
+ };
209
+ }
210
+ return transition;
211
+ }
212
+ /**
213
+ * Get duration with reduced motion consideration
214
+ */
215
+ export function getDuration(shouldReduceMotion, duration = motionDuration.normal) {
216
+ return shouldReduceMotion ? 0.01 : duration;
217
+ }
@@ -13,9 +13,9 @@ export type MessageRole = z.infer<typeof MessageRole>;
13
13
  * Content type for messages
14
14
  */
15
15
  export declare const ContentType: z.ZodEnum<{
16
- file: "file";
17
16
  text: "text";
18
17
  image: "image";
18
+ file: "file";
19
19
  tool_call: "tool_call";
20
20
  tool_result: "tool_result";
21
21
  }>;
@@ -25,9 +25,9 @@ export type ContentType = z.infer<typeof ContentType>;
25
25
  */
26
26
  export declare const BaseContent: z.ZodObject<{
27
27
  type: z.ZodEnum<{
28
- file: "file";
29
28
  text: "text";
30
29
  image: "image";
30
+ file: "file";
31
31
  tool_call: "tool_call";
32
32
  tool_result: "tool_result";
33
33
  }>;
@@ -178,6 +178,11 @@ export declare const SessionUpdate: z.ZodUnion<readonly [z.ZodObject<{
178
178
  title: z.ZodString;
179
179
  prettyName: z.ZodOptional<z.ZodString>;
180
180
  icon: z.ZodOptional<z.ZodString>;
181
+ verbiage: z.ZodOptional<z.ZodObject<{
182
+ active: z.ZodString;
183
+ past: z.ZodString;
184
+ paramKey: z.ZodOptional<z.ZodString>;
185
+ }, z.core.$strip>>;
181
186
  subline: z.ZodOptional<z.ZodString>;
182
187
  kind: z.ZodEnum<{
183
188
  read: "read";
@@ -7,6 +7,11 @@ export interface AgentToolInfo {
7
7
  description?: string;
8
8
  prettyName?: string;
9
9
  icon?: string;
10
+ verbiage?: {
11
+ active: string;
12
+ past: string;
13
+ paramKey?: string;
14
+ };
10
15
  }
11
16
  /**
12
17
  * Agent MCP (Model Context Protocol) server information
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@townco/ui",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -49,11 +49,12 @@
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.46",
52
+ "@townco/core": "0.0.48",
53
53
  "@uiw/react-json-view": "^2.0.0-alpha.39",
54
54
  "bun": "^1.3.1",
55
55
  "class-variance-authority": "^0.7.1",
56
56
  "clsx": "^2.1.1",
57
+ "framer-motion": "^12.23.25",
57
58
  "lucide-react": "^0.552.0",
58
59
  "react-markdown": "^10.1.0",
59
60
  "react-resizable-panels": "^3.0.6",
@@ -66,18 +67,18 @@
66
67
  },
67
68
  "devDependencies": {
68
69
  "@tailwindcss/postcss": "^4.1.17",
69
- "@townco/tsconfig": "0.1.65",
70
+ "@townco/tsconfig": "0.1.67",
70
71
  "@types/node": "^24.10.0",
71
72
  "@types/react": "^19.2.2",
72
73
  "ink": "^6.4.0",
73
- "react": "^19.2.0",
74
+ "react": "19.2.1",
74
75
  "tailwindcss": "^4.1.17",
75
76
  "typescript": "^5.9.3"
76
77
  },
77
78
  "peerDependencies": {
78
- "ink": "^5.1.0",
79
- "react": "^19.2.0",
80
- "react-dom": "^19.2.0"
79
+ "ink": "^6.4.0",
80
+ "react": "^19.2.1",
81
+ "react-dom": "^19.2.1"
81
82
  },
82
83
  "peerDependenciesMeta": {
83
84
  "react": {
@@ -47,6 +47,14 @@
47
47
  --color-text-primary: var(--text-primary);
48
48
  --color-text-secondary: var(--text-secondary);
49
49
  --color-text-tertiary: var(--text-tertiary);
50
+
51
+ /* Sidebar colors */
52
+ --color-sidebar: var(--sidebar);
53
+ --color-sidebar-foreground: var(--sidebar-foreground);
54
+ --color-sidebar-accent: var(--sidebar-accent);
55
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
56
+ --color-sidebar-border: var(--sidebar-border);
57
+ --color-sidebar-ring: var(--sidebar-ring);
50
58
 
51
59
  /* Layout widths - max-width utilities */
52
60
  --max-width-chat: 720px;
@@ -149,8 +157,16 @@
149
157
 
150
158
  /* Text colors from design system */
151
159
  --text-primary: var(--color-neutral-900);
152
- --text-secondary: var(--color-neutral-600);
160
+ --text-secondary: var(--color-neutral-700);
153
161
  --text-tertiary: var(--color-neutral-500);
162
+
163
+ /* Sidebar colors */
164
+ --sidebar: var(--color-neutral-50);
165
+ --sidebar-foreground: var(--color-neutral-950);
166
+ --sidebar-accent: var(--color-neutral-100);
167
+ --sidebar-accent-foreground: var(--color-neutral-900);
168
+ --sidebar-border: var(--color-neutral-200);
169
+ --sidebar-ring: var(--color-neutral-900);
154
170
  }
155
171
 
156
172
  .dark {
@@ -194,6 +210,14 @@
194
210
  --text-primary: var(--color-neutral-50);
195
211
  --text-secondary: var(--color-neutral-400);
196
212
  --text-tertiary: var(--color-neutral-500);
213
+
214
+ /* Sidebar colors (dark mode) */
215
+ --sidebar: var(--color-neutral-900);
216
+ --sidebar-foreground: var(--color-neutral-50);
217
+ --sidebar-accent: var(--color-neutral-800);
218
+ --sidebar-accent-foreground: var(--color-neutral-50);
219
+ --sidebar-border: var(--color-neutral-800);
220
+ --sidebar-ring: var(--color-neutral-300);
197
221
  }
198
222
 
199
223
  @layer base {
@@ -417,3 +441,106 @@
417
441
  .animate-pulse-scale {
418
442
  animation: pulse-scale 1s ease-in-out infinite;
419
443
  }
444
+
445
+ @keyframes fadeIn {
446
+ from {
447
+ opacity: 0;
448
+ }
449
+ to {
450
+ opacity: 1;
451
+ }
452
+ }
453
+
454
+ .animate-fadeIn {
455
+ animation: fadeIn 200ms ease-out;
456
+ }
457
+
458
+ @keyframes slideDown {
459
+ from {
460
+ opacity: 0;
461
+ max-height: 0;
462
+ transform: translateY(-4px);
463
+ }
464
+ to {
465
+ opacity: 1;
466
+ max-height: 500px;
467
+ transform: translateY(0);
468
+ }
469
+ }
470
+
471
+ .animate-slideDown {
472
+ animation: slideDown 250ms ease-out;
473
+ }
474
+
475
+ @keyframes collapseUp {
476
+ from {
477
+ opacity: 1;
478
+ max-height: 500px;
479
+ transform: translateY(0);
480
+ }
481
+ to {
482
+ opacity: 0;
483
+ max-height: 0;
484
+ transform: translateY(-4px);
485
+ }
486
+ }
487
+
488
+ .animate-collapseUp {
489
+ animation: collapseUp 200ms ease-in;
490
+ }
491
+
492
+ @keyframes pulse-subtle {
493
+ 0%, 100% {
494
+ opacity: 1;
495
+ }
496
+ 50% {
497
+ opacity: 0.8;
498
+ }
499
+ }
500
+
501
+ .animate-pulse-subtle {
502
+ animation: pulse-subtle 2s ease-in-out infinite;
503
+ }
504
+
505
+ @keyframes typing {
506
+ 0%, 100% {
507
+ opacity: 0;
508
+ }
509
+ 50% {
510
+ opacity: 1;
511
+ }
512
+ }
513
+
514
+ .animate-typing {
515
+ animation: typing 1.4s ease-in-out infinite;
516
+ }
517
+
518
+ @keyframes shimmer {
519
+ 0% {
520
+ background-position: -200% 0;
521
+ }
522
+ 100% {
523
+ background-position: 200% 0;
524
+ }
525
+ }
526
+
527
+ .animate-shimmer {
528
+ background: linear-gradient(
529
+ 90deg,
530
+ transparent 0%,
531
+ rgba(255, 255, 255, 0.5) 50%,
532
+ transparent 100%
533
+ );
534
+ background-size: 200% 100%;
535
+ animation: shimmer 2s ease-in-out infinite;
536
+ }
537
+
538
+ .dark .animate-shimmer {
539
+ background: linear-gradient(
540
+ 90deg,
541
+ transparent 0%,
542
+ rgba(255, 255, 255, 0.05) 50%,
543
+ transparent 100%
544
+ );
545
+ background-size: 200% 100%;
546
+ }