@agent-native/dispatch 0.20.4 → 0.22.0
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/actions/get-agent-thread-debug.d.ts +2 -0
- package/dist/actions/provider-api-register.d.ts +7 -7
- package/dist/actions/search-agent-threads.js +2 -2
- package/dist/actions/search-agent-threads.js.map +1 -1
- package/dist/actions/start-workspace-app-creation.js +1 -1
- package/dist/actions/start-workspace-app-creation.js.map +1 -1
- package/dist/components/create-app-popover.d.ts.map +1 -1
- package/dist/components/create-app-popover.js +5 -71
- package/dist/components/create-app-popover.js.map +1 -1
- package/dist/components/layout/HeaderActions.d.ts +1 -17
- package/dist/components/layout/HeaderActions.d.ts.map +1 -1
- package/dist/components/layout/HeaderActions.js +1 -51
- package/dist/components/layout/HeaderActions.js.map +1 -1
- package/dist/components/layout/Layout.d.ts +23 -1
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +707 -18
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -19
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +1 -22
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +1 -27
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -35
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/popover.d.ts +2 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +2 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/select.d.ts +1 -13
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +1 -26
- package/dist/components/ui/select.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -15
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/automation-display.js +1 -1
- package/dist/lib/automation-display.js.map +1 -1
- package/dist/lib/workspace-apps.d.ts +6 -0
- package/dist/lib/workspace-apps.d.ts.map +1 -1
- package/dist/lib/workspace-apps.js +21 -0
- package/dist/lib/workspace-apps.js.map +1 -1
- package/dist/routes/pages/settings.d.ts.map +1 -1
- package/dist/routes/pages/settings.js +21 -1
- package/dist/routes/pages/settings.js.map +1 -1
- package/dist/routes/pages/thread-debug.d.ts.map +1 -1
- package/dist/routes/pages/thread-debug.js +288 -118
- package/dist/routes/pages/thread-debug.js.map +1 -1
- package/dist/server/lib/app-creation-store.d.ts.map +1 -1
- package/dist/server/lib/app-creation-store.js +13 -0
- package/dist/server/lib/app-creation-store.js.map +1 -1
- package/dist/server/lib/thread-debug-store.d.ts +2 -0
- package/dist/server/lib/thread-debug-store.d.ts.map +1 -1
- package/dist/server/lib/thread-debug-store.js +6 -2
- package/dist/server/lib/thread-debug-store.js.map +1 -1
- package/dist/server/plugins/agent-chat.js +1 -0
- package/dist/server/plugins/agent-chat.js.map +1 -1
- package/dist/server/plugins/integrations.js +1 -1
- package/dist/server/plugins/integrations.js.map +1 -1
- package/package.json +3 -3
- package/src/actions/search-agent-threads.ts +2 -2
- package/src/actions/start-workspace-app-creation.ts +1 -1
- package/src/components/create-app-popover.spec.tsx +22 -0
- package/src/components/create-app-popover.tsx +30 -94
- package/src/components/layout/HeaderActions.tsx +1 -84
- package/src/components/layout/Layout.spec.tsx +35 -10
- package/src/components/layout/Layout.tsx +1394 -74
- package/src/components/ui/dialog.tsx +1 -120
- package/src/components/ui/dropdown-menu.tsx +1 -198
- package/src/components/ui/popover.tsx +3 -1
- package/src/components/ui/select.tsx +1 -158
- package/src/hooks/use-mobile.tsx +1 -21
- package/src/lib/automation-display.spec.ts +1 -1
- package/src/lib/automation-display.ts +1 -1
- package/src/lib/workspace-apps.ts +24 -0
- package/src/routes/pages/settings.tsx +72 -0
- package/src/routes/pages/thread-debug.spec.tsx +103 -5
- package/src/routes/pages/thread-debug.tsx +1051 -451
- package/src/server/lib/app-creation-store.spec.ts +13 -0
- package/src/server/lib/app-creation-store.ts +13 -0
- package/src/server/lib/mcp-gateway.spec.ts +18 -0
- package/src/server/lib/thread-debug-store.spec.ts +17 -0
- package/src/server/lib/thread-debug-store.ts +9 -2
- package/src/server/plugins/agent-chat.ts +1 -0
- package/src/server/plugins/integrations.ts +1 -1
- package/src/styles/dispatch.css +29 -0
|
@@ -1,120 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IconX } from "@tabler/icons-react";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const Dialog = DialogPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const DialogTrigger = DialogPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
12
|
-
|
|
13
|
-
const DialogClose = DialogPrimitive.Close;
|
|
14
|
-
|
|
15
|
-
const DialogOverlay = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<DialogPrimitive.Overlay
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
));
|
|
28
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
29
|
-
|
|
30
|
-
const DialogContent = React.forwardRef<
|
|
31
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
32
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
33
|
-
>(({ className, children, ...props }, ref) => (
|
|
34
|
-
<DialogPortal>
|
|
35
|
-
<DialogOverlay />
|
|
36
|
-
<DialogPrimitive.Content
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
46
|
-
<IconX className="h-4 w-4" />
|
|
47
|
-
<span className="sr-only">Close</span>
|
|
48
|
-
</DialogPrimitive.Close>
|
|
49
|
-
</DialogPrimitive.Content>
|
|
50
|
-
</DialogPortal>
|
|
51
|
-
));
|
|
52
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
53
|
-
|
|
54
|
-
const DialogHeader = ({
|
|
55
|
-
className,
|
|
56
|
-
...props
|
|
57
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
58
|
-
<div
|
|
59
|
-
className={cn(
|
|
60
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
61
|
-
className,
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
DialogHeader.displayName = "DialogHeader";
|
|
67
|
-
|
|
68
|
-
const DialogFooter = ({
|
|
69
|
-
className,
|
|
70
|
-
...props
|
|
71
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
72
|
-
<div
|
|
73
|
-
className={cn(
|
|
74
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
75
|
-
className,
|
|
76
|
-
)}
|
|
77
|
-
{...props}
|
|
78
|
-
/>
|
|
79
|
-
);
|
|
80
|
-
DialogFooter.displayName = "DialogFooter";
|
|
81
|
-
|
|
82
|
-
const DialogTitle = React.forwardRef<
|
|
83
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
84
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
85
|
-
>(({ className, ...props }, ref) => (
|
|
86
|
-
<DialogPrimitive.Title
|
|
87
|
-
ref={ref}
|
|
88
|
-
className={cn(
|
|
89
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
90
|
-
className,
|
|
91
|
-
)}
|
|
92
|
-
{...props}
|
|
93
|
-
/>
|
|
94
|
-
));
|
|
95
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
96
|
-
|
|
97
|
-
const DialogDescription = React.forwardRef<
|
|
98
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
99
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
100
|
-
>(({ className, ...props }, ref) => (
|
|
101
|
-
<DialogPrimitive.Description
|
|
102
|
-
ref={ref}
|
|
103
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
104
|
-
{...props}
|
|
105
|
-
/>
|
|
106
|
-
));
|
|
107
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
108
|
-
|
|
109
|
-
export {
|
|
110
|
-
Dialog,
|
|
111
|
-
DialogPortal,
|
|
112
|
-
DialogOverlay,
|
|
113
|
-
DialogClose,
|
|
114
|
-
DialogTrigger,
|
|
115
|
-
DialogContent,
|
|
116
|
-
DialogHeader,
|
|
117
|
-
DialogFooter,
|
|
118
|
-
DialogTitle,
|
|
119
|
-
DialogDescription,
|
|
120
|
-
};
|
|
1
|
+
export * from "@agent-native/toolkit/ui/dialog";
|
|
@@ -1,198 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IconCheck, IconChevronRight, IconCircle } from "@tabler/icons-react";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
12
|
-
|
|
13
|
-
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
14
|
-
|
|
15
|
-
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
16
|
-
|
|
17
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
18
|
-
|
|
19
|
-
const DropdownMenuSubTrigger = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
-
inset?: boolean;
|
|
23
|
-
}
|
|
24
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
25
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn(
|
|
28
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
29
|
-
inset && "pl-8",
|
|
30
|
-
className,
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
{children}
|
|
35
|
-
<IconChevronRight className="ml-auto h-4 w-4" />
|
|
36
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
37
|
-
));
|
|
38
|
-
DropdownMenuSubTrigger.displayName =
|
|
39
|
-
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
40
|
-
|
|
41
|
-
const DropdownMenuSubContent = React.forwardRef<
|
|
42
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
43
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
44
|
-
>(({ className, ...props }, ref) => (
|
|
45
|
-
<DropdownMenuPrimitive.SubContent
|
|
46
|
-
ref={ref}
|
|
47
|
-
className={cn(
|
|
48
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
49
|
-
className,
|
|
50
|
-
)}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
));
|
|
54
|
-
DropdownMenuSubContent.displayName =
|
|
55
|
-
DropdownMenuPrimitive.SubContent.displayName;
|
|
56
|
-
|
|
57
|
-
const DropdownMenuContent = React.forwardRef<
|
|
58
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
59
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
60
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
61
|
-
<DropdownMenuPrimitive.Portal>
|
|
62
|
-
<DropdownMenuPrimitive.Content
|
|
63
|
-
ref={ref}
|
|
64
|
-
sideOffset={sideOffset}
|
|
65
|
-
className={cn(
|
|
66
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
67
|
-
className,
|
|
68
|
-
)}
|
|
69
|
-
{...props}
|
|
70
|
-
/>
|
|
71
|
-
</DropdownMenuPrimitive.Portal>
|
|
72
|
-
));
|
|
73
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
74
|
-
|
|
75
|
-
const DropdownMenuItem = React.forwardRef<
|
|
76
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
77
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
78
|
-
inset?: boolean;
|
|
79
|
-
}
|
|
80
|
-
>(({ className, inset, ...props }, ref) => (
|
|
81
|
-
<DropdownMenuPrimitive.Item
|
|
82
|
-
ref={ref}
|
|
83
|
-
className={cn(
|
|
84
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
85
|
-
inset && "pl-8",
|
|
86
|
-
className,
|
|
87
|
-
)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
));
|
|
91
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
92
|
-
|
|
93
|
-
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
94
|
-
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
95
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
|
|
96
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
97
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
98
|
-
ref={ref}
|
|
99
|
-
className={cn(
|
|
100
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
101
|
-
className,
|
|
102
|
-
)}
|
|
103
|
-
checked={checked}
|
|
104
|
-
{...props}
|
|
105
|
-
>
|
|
106
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
107
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
108
|
-
<IconCheck className="h-4 w-4" />
|
|
109
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
110
|
-
</span>
|
|
111
|
-
{children}
|
|
112
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
113
|
-
));
|
|
114
|
-
DropdownMenuCheckboxItem.displayName =
|
|
115
|
-
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
116
|
-
|
|
117
|
-
const DropdownMenuRadioItem = React.forwardRef<
|
|
118
|
-
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
119
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
|
|
120
|
-
>(({ className, children, ...props }, ref) => (
|
|
121
|
-
<DropdownMenuPrimitive.RadioItem
|
|
122
|
-
ref={ref}
|
|
123
|
-
className={cn(
|
|
124
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
125
|
-
className,
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
>
|
|
129
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
130
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
131
|
-
<IconCircle className="h-2 w-2 fill-current" />
|
|
132
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
133
|
-
</span>
|
|
134
|
-
{children}
|
|
135
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
136
|
-
));
|
|
137
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
138
|
-
|
|
139
|
-
const DropdownMenuLabel = React.forwardRef<
|
|
140
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
141
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
142
|
-
inset?: boolean;
|
|
143
|
-
}
|
|
144
|
-
>(({ className, inset, ...props }, ref) => (
|
|
145
|
-
<DropdownMenuPrimitive.Label
|
|
146
|
-
ref={ref}
|
|
147
|
-
className={cn(
|
|
148
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
149
|
-
inset && "pl-8",
|
|
150
|
-
className,
|
|
151
|
-
)}
|
|
152
|
-
{...props}
|
|
153
|
-
/>
|
|
154
|
-
));
|
|
155
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
156
|
-
|
|
157
|
-
const DropdownMenuSeparator = React.forwardRef<
|
|
158
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
159
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
160
|
-
>(({ className, ...props }, ref) => (
|
|
161
|
-
<DropdownMenuPrimitive.Separator
|
|
162
|
-
ref={ref}
|
|
163
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
164
|
-
{...props}
|
|
165
|
-
/>
|
|
166
|
-
));
|
|
167
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
168
|
-
|
|
169
|
-
const DropdownMenuShortcut = ({
|
|
170
|
-
className,
|
|
171
|
-
...props
|
|
172
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
173
|
-
return (
|
|
174
|
-
<span
|
|
175
|
-
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
|
|
176
|
-
{...props}
|
|
177
|
-
/>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
180
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
181
|
-
|
|
182
|
-
export {
|
|
183
|
-
DropdownMenu,
|
|
184
|
-
DropdownMenuTrigger,
|
|
185
|
-
DropdownMenuContent,
|
|
186
|
-
DropdownMenuItem,
|
|
187
|
-
DropdownMenuCheckboxItem,
|
|
188
|
-
DropdownMenuRadioItem,
|
|
189
|
-
DropdownMenuLabel,
|
|
190
|
-
DropdownMenuSeparator,
|
|
191
|
-
DropdownMenuShortcut,
|
|
192
|
-
DropdownMenuGroup,
|
|
193
|
-
DropdownMenuPortal,
|
|
194
|
-
DropdownMenuSub,
|
|
195
|
-
DropdownMenuSubContent,
|
|
196
|
-
DropdownMenuSubTrigger,
|
|
197
|
-
DropdownMenuRadioGroup,
|
|
198
|
-
};
|
|
1
|
+
export * from "@agent-native/toolkit/ui/dropdown-menu";
|
|
@@ -5,6 +5,8 @@ import { cn } from "../../lib/utils";
|
|
|
5
5
|
|
|
6
6
|
const Popover = PopoverPrimitive.Root;
|
|
7
7
|
|
|
8
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
9
|
+
|
|
8
10
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
9
11
|
|
|
10
12
|
const PopoverContent = React.forwardRef<
|
|
@@ -26,4 +28,4 @@ const PopoverContent = React.forwardRef<
|
|
|
26
28
|
));
|
|
27
29
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
28
30
|
|
|
29
|
-
export { Popover, PopoverTrigger, PopoverContent };
|
|
31
|
+
export { Popover, PopoverAnchor, PopoverTrigger, PopoverContent };
|
|
@@ -1,158 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const Select = SelectPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
10
|
-
|
|
11
|
-
const SelectValue = SelectPrimitive.Value;
|
|
12
|
-
|
|
13
|
-
const SelectTrigger = React.forwardRef<
|
|
14
|
-
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
15
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
16
|
-
>(({ className, children, ...props }, ref) => (
|
|
17
|
-
<SelectPrimitive.Trigger
|
|
18
|
-
ref={ref}
|
|
19
|
-
className={cn(
|
|
20
|
-
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
<SelectPrimitive.Icon asChild>
|
|
27
|
-
<IconChevronDown className="h-4 w-4 opacity-50" />
|
|
28
|
-
</SelectPrimitive.Icon>
|
|
29
|
-
</SelectPrimitive.Trigger>
|
|
30
|
-
));
|
|
31
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
32
|
-
|
|
33
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
34
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
35
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
36
|
-
>(({ className, ...props }, ref) => (
|
|
37
|
-
<SelectPrimitive.ScrollUpButton
|
|
38
|
-
ref={ref}
|
|
39
|
-
className={cn(
|
|
40
|
-
"flex cursor-default items-center justify-center py-1",
|
|
41
|
-
className,
|
|
42
|
-
)}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
<IconChevronUp className="h-4 w-4" />
|
|
46
|
-
</SelectPrimitive.ScrollUpButton>
|
|
47
|
-
));
|
|
48
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
49
|
-
|
|
50
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
51
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
52
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
53
|
-
>(({ className, ...props }, ref) => (
|
|
54
|
-
<SelectPrimitive.ScrollDownButton
|
|
55
|
-
ref={ref}
|
|
56
|
-
className={cn(
|
|
57
|
-
"flex cursor-default items-center justify-center py-1",
|
|
58
|
-
className,
|
|
59
|
-
)}
|
|
60
|
-
{...props}
|
|
61
|
-
>
|
|
62
|
-
<IconChevronDown className="h-4 w-4" />
|
|
63
|
-
</SelectPrimitive.ScrollDownButton>
|
|
64
|
-
));
|
|
65
|
-
SelectScrollDownButton.displayName =
|
|
66
|
-
SelectPrimitive.ScrollDownButton.displayName;
|
|
67
|
-
|
|
68
|
-
const SelectContent = React.forwardRef<
|
|
69
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
70
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
71
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
72
|
-
<SelectPrimitive.Portal>
|
|
73
|
-
<SelectPrimitive.Content
|
|
74
|
-
ref={ref}
|
|
75
|
-
className={cn(
|
|
76
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
77
|
-
position === "popper" &&
|
|
78
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
79
|
-
className,
|
|
80
|
-
)}
|
|
81
|
-
position={position}
|
|
82
|
-
{...props}
|
|
83
|
-
>
|
|
84
|
-
<SelectScrollUpButton />
|
|
85
|
-
<SelectPrimitive.Viewport
|
|
86
|
-
className={cn(
|
|
87
|
-
"p-1",
|
|
88
|
-
position === "popper" &&
|
|
89
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
90
|
-
)}
|
|
91
|
-
>
|
|
92
|
-
{children}
|
|
93
|
-
</SelectPrimitive.Viewport>
|
|
94
|
-
<SelectScrollDownButton />
|
|
95
|
-
</SelectPrimitive.Content>
|
|
96
|
-
</SelectPrimitive.Portal>
|
|
97
|
-
));
|
|
98
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
99
|
-
|
|
100
|
-
const SelectLabel = React.forwardRef<
|
|
101
|
-
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
102
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
103
|
-
>(({ className, ...props }, ref) => (
|
|
104
|
-
<SelectPrimitive.Label
|
|
105
|
-
ref={ref}
|
|
106
|
-
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
|
107
|
-
{...props}
|
|
108
|
-
/>
|
|
109
|
-
));
|
|
110
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
111
|
-
|
|
112
|
-
const SelectItem = React.forwardRef<
|
|
113
|
-
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
114
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
115
|
-
>(({ className, children, ...props }, ref) => (
|
|
116
|
-
<SelectPrimitive.Item
|
|
117
|
-
ref={ref}
|
|
118
|
-
className={cn(
|
|
119
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
120
|
-
className,
|
|
121
|
-
)}
|
|
122
|
-
{...props}
|
|
123
|
-
>
|
|
124
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
125
|
-
<SelectPrimitive.ItemIndicator>
|
|
126
|
-
<IconCheck className="h-4 w-4" />
|
|
127
|
-
</SelectPrimitive.ItemIndicator>
|
|
128
|
-
</span>
|
|
129
|
-
|
|
130
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
131
|
-
</SelectPrimitive.Item>
|
|
132
|
-
));
|
|
133
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
134
|
-
|
|
135
|
-
const SelectSeparator = React.forwardRef<
|
|
136
|
-
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
137
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
138
|
-
>(({ className, ...props }, ref) => (
|
|
139
|
-
<SelectPrimitive.Separator
|
|
140
|
-
ref={ref}
|
|
141
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
142
|
-
{...props}
|
|
143
|
-
/>
|
|
144
|
-
));
|
|
145
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
146
|
-
|
|
147
|
-
export {
|
|
148
|
-
Select,
|
|
149
|
-
SelectGroup,
|
|
150
|
-
SelectValue,
|
|
151
|
-
SelectTrigger,
|
|
152
|
-
SelectContent,
|
|
153
|
-
SelectLabel,
|
|
154
|
-
SelectItem,
|
|
155
|
-
SelectSeparator,
|
|
156
|
-
SelectScrollUpButton,
|
|
157
|
-
SelectScrollDownButton,
|
|
158
|
-
};
|
|
1
|
+
export * from "@agent-native/toolkit/ui/select";
|
package/src/hooks/use-mobile.tsx
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const MOBILE_BREAKPOINT = 768;
|
|
4
|
-
|
|
5
|
-
export function useIsMobile() {
|
|
6
|
-
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(
|
|
7
|
-
undefined,
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
12
|
-
const onChange = () => {
|
|
13
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
14
|
-
};
|
|
15
|
-
mql.addEventListener("change", onChange);
|
|
16
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
17
|
-
return () => mql.removeEventListener("change", onChange);
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
20
|
-
return !!isMobile;
|
|
21
|
-
}
|
|
1
|
+
export * from "@agent-native/toolkit/hooks";
|
|
@@ -32,7 +32,7 @@ describe("automation-display", () => {
|
|
|
32
32
|
it("prepares a thread-debug search for an automation", () => {
|
|
33
33
|
expect(
|
|
34
34
|
automationTroubleshootPath({ name: "coach onboarding reminder" }),
|
|
35
|
-
).toBe("/admin/thread-debug?query=coach+onboarding+reminder");
|
|
35
|
+
).toBe("/admin/thread-debug?mode=threads&query=coach+onboarding+reminder");
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
it("keeps Dispatch-owned and legacy automations in the default view", () => {
|
|
@@ -27,7 +27,7 @@ export function belongsToDispatch(
|
|
|
27
27
|
export function automationTroubleshootPath(
|
|
28
28
|
item: Pick<DispatchAutomationItem, "name">,
|
|
29
29
|
): string {
|
|
30
|
-
const params = new URLSearchParams({ query: item.name });
|
|
30
|
+
const params = new URLSearchParams({ mode: "threads", query: item.name });
|
|
31
31
|
return `/admin/thread-debug?${params.toString()}`;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHAT_FIRST_DEFAULT_APP_IDS } from "@agent-native/core/client/chat-first";
|
|
1
2
|
import { withBuilderUtmTrackingParams } from "@agent-native/core/shared/builder-link-tracking";
|
|
2
3
|
|
|
3
4
|
export interface WorkspaceAppSummary {
|
|
@@ -45,3 +46,26 @@ export function workspaceAppHref(app: WorkspaceAppSummary): string | null {
|
|
|
45
46
|
export function isPendingBuilderHref(app: WorkspaceAppSummary): boolean {
|
|
46
47
|
return app.status === "pending" && !!app.builderUrl;
|
|
47
48
|
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Keep the chat-first rail useful before a workspace manifest is populated.
|
|
52
|
+
* Mounted workspace rows still win, so custom names and routes remain the
|
|
53
|
+
* source of truth once an app exists in the workspace.
|
|
54
|
+
*/
|
|
55
|
+
export function mergeChatFirstWorkspaceApps(
|
|
56
|
+
apps: readonly WorkspaceAppSummary[] | undefined,
|
|
57
|
+
): WorkspaceAppSummary[] {
|
|
58
|
+
const merged = new Map<string, WorkspaceAppSummary>();
|
|
59
|
+
for (const id of CHAT_FIRST_DEFAULT_APP_IDS) {
|
|
60
|
+
merged.set(id, {
|
|
61
|
+
id,
|
|
62
|
+
name: id.charAt(0).toUpperCase() + id.slice(1),
|
|
63
|
+
path: `/${id}`,
|
|
64
|
+
url: null,
|
|
65
|
+
status: "ready",
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
for (const app of apps ?? []) merged.set(app.id, app);
|
|
69
|
+
|
|
70
|
+
return [...merged.values()];
|
|
71
|
+
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CHAT_FIRST_MODE_CHANGED_EVENT,
|
|
3
|
+
readChatFirstModeState,
|
|
4
|
+
writeChatFirstMode,
|
|
5
|
+
} from "@agent-native/core/client/agent-chat";
|
|
1
6
|
import { ChangelogSettingsCard } from "@agent-native/core/client/changelog";
|
|
2
7
|
import { LanguagePicker, useT } from "@agent-native/core/client/i18n";
|
|
3
8
|
import { TeamPage } from "@agent-native/core/client/org";
|
|
@@ -5,6 +10,7 @@ import {
|
|
|
5
10
|
SettingsTabsPage,
|
|
6
11
|
useAgentSettingsTabs,
|
|
7
12
|
} from "@agent-native/core/client/settings";
|
|
13
|
+
import { useState } from "react";
|
|
8
14
|
import { Link } from "react-router";
|
|
9
15
|
|
|
10
16
|
import changelog from "../../../CHANGELOG.md?raw";
|
|
@@ -18,6 +24,7 @@ import {
|
|
|
18
24
|
CardTitle,
|
|
19
25
|
} from "../../components/ui/card";
|
|
20
26
|
import { Label } from "../../components/ui/label";
|
|
27
|
+
import { Switch } from "../../components/ui/switch";
|
|
21
28
|
|
|
22
29
|
export function meta() {
|
|
23
30
|
return [{ title: "Settings - Dispatch" }];
|
|
@@ -26,6 +33,34 @@ export function meta() {
|
|
|
26
33
|
export default function SettingsRoute() {
|
|
27
34
|
const t = useT();
|
|
28
35
|
const agentSettingsTabs = useAgentSettingsTabs();
|
|
36
|
+
const [chatFirstModeState] = useState(() => readChatFirstModeState());
|
|
37
|
+
const [chatFirstMode, setChatFirstMode] = useState(
|
|
38
|
+
() => chatFirstModeState.enabled,
|
|
39
|
+
);
|
|
40
|
+
const [chatFirstStorageNotice, setChatFirstStorageNotice] = useState<
|
|
41
|
+
string | null
|
|
42
|
+
>(
|
|
43
|
+
chatFirstModeState.availability === "unavailable"
|
|
44
|
+
? "This browser is not allowing local preferences, so Chat-first mode cannot be persisted."
|
|
45
|
+
: null,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
function updateChatFirstMode(enabled: boolean) {
|
|
49
|
+
const result = writeChatFirstMode(enabled);
|
|
50
|
+
if (!result.ok) {
|
|
51
|
+
setChatFirstStorageNotice(
|
|
52
|
+
"This browser blocked local preferences, so Chat-first mode was not changed.",
|
|
53
|
+
);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
setChatFirstStorageNotice(null);
|
|
57
|
+
setChatFirstMode(enabled);
|
|
58
|
+
window.dispatchEvent(
|
|
59
|
+
new CustomEvent(CHAT_FIRST_MODE_CHANGED_EVENT, {
|
|
60
|
+
detail: { enabled },
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
}
|
|
29
64
|
|
|
30
65
|
return (
|
|
31
66
|
<DispatchShell
|
|
@@ -51,6 +86,43 @@ export default function SettingsRoute() {
|
|
|
51
86
|
</CardContent>
|
|
52
87
|
</Card>
|
|
53
88
|
|
|
89
|
+
<Card>
|
|
90
|
+
<CardHeader>
|
|
91
|
+
<CardTitle className="text-base">
|
|
92
|
+
Chat-first workspace
|
|
93
|
+
</CardTitle>
|
|
94
|
+
<CardDescription>
|
|
95
|
+
Keep chats at the center and open workspace apps in a
|
|
96
|
+
contextual pane beside them.
|
|
97
|
+
</CardDescription>
|
|
98
|
+
</CardHeader>
|
|
99
|
+
<CardContent className="flex items-center justify-between gap-4">
|
|
100
|
+
<div className="space-y-1">
|
|
101
|
+
<Label htmlFor="dispatch-chat-first-mode">
|
|
102
|
+
Use chat-first navigation
|
|
103
|
+
</Label>
|
|
104
|
+
<p className="text-sm text-muted-foreground">
|
|
105
|
+
This preference only changes your local Dispatch shell.
|
|
106
|
+
</p>
|
|
107
|
+
<p className="text-sm text-muted-foreground">
|
|
108
|
+
Session watch and follow-up messaging work in this browser
|
|
109
|
+
pane too. Local CLI subscription detection stays in the
|
|
110
|
+
Electron app; Dispatch uses workspace/provider credentials.
|
|
111
|
+
</p>
|
|
112
|
+
</div>
|
|
113
|
+
<Switch
|
|
114
|
+
id="dispatch-chat-first-mode"
|
|
115
|
+
checked={chatFirstMode}
|
|
116
|
+
onCheckedChange={updateChatFirstMode}
|
|
117
|
+
/>
|
|
118
|
+
</CardContent>
|
|
119
|
+
{chatFirstStorageNotice ? (
|
|
120
|
+
<p className="px-6 pb-4 text-sm text-destructive" role="alert">
|
|
121
|
+
{chatFirstStorageNotice}
|
|
122
|
+
</p>
|
|
123
|
+
) : null}
|
|
124
|
+
</Card>
|
|
125
|
+
|
|
54
126
|
<Card>
|
|
55
127
|
<CardHeader>
|
|
56
128
|
<CardTitle className="text-base">
|