@agent-native/dispatch 0.1.1 → 0.2.2
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/index.d.ts.map +1 -1
- package/dist/actions/index.js +2 -0
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/list-dispatch-usage-metrics.d.ts +3 -0
- package/dist/actions/list-dispatch-usage-metrics.d.ts.map +1 -0
- package/dist/actions/list-dispatch-usage-metrics.js +18 -0
- package/dist/actions/list-dispatch-usage-metrics.js.map +1 -0
- package/dist/actions/navigate.d.ts +1 -0
- package/dist/actions/navigate.d.ts.map +1 -1
- package/dist/actions/navigate.js +3 -17
- package/dist/actions/navigate.js.map +1 -1
- package/dist/actions/view-screen.d.ts.map +1 -1
- package/dist/actions/view-screen.js +19 -0
- package/dist/actions/view-screen.js.map +1 -1
- package/dist/components/agents-panel.js +3 -3
- package/dist/components/app-keys-popover.js +2 -2
- package/dist/components/create-app-popover.js +2 -2
- package/dist/components/dispatch-shell.js +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/Header.js +4 -4
- package/dist/components/layout/Header.js.map +1 -1
- package/dist/components/layout/Layout.d.ts +28 -3
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +137 -26
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/messaging-setup-panel.js +4 -4
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/alert.js +1 -1
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.d.ts +2 -2
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/drawer.js +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/progress.js +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/resizable.js +1 -1
- package/dist/components/ui/scroll-area.js +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +8 -8
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/table.js +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/components/ui/toaster.js +2 -2
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/ui/use-toast.d.ts +1 -1
- package/dist/components/ui/use-toast.js +1 -1
- package/dist/hooks/use-navigation-state.d.ts +2 -1
- package/dist/hooks/use-navigation-state.d.ts.map +1 -1
- package/dist/hooks/use-navigation-state.js +36 -8
- package/dist/hooks/use-navigation-state.js.map +1 -1
- package/dist/hooks/use-toast.d.ts +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +3 -2
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/pages/_index.js +1 -1
- package/dist/routes/pages/agents.js +2 -2
- package/dist/routes/pages/approval.js +2 -2
- package/dist/routes/pages/approvals.js +4 -4
- package/dist/routes/pages/apps.$appId.js +3 -3
- package/dist/routes/pages/apps.js +5 -5
- package/dist/routes/pages/audit.js +1 -1
- package/dist/routes/pages/destinations.js +6 -6
- package/dist/routes/pages/extensions.$id.d.ts +2 -0
- package/dist/routes/pages/extensions.$id.d.ts.map +1 -0
- package/dist/routes/pages/extensions.$id.js +6 -0
- package/dist/routes/pages/extensions.$id.js.map +1 -0
- package/dist/routes/pages/extensions._index.d.ts +2 -0
- package/dist/routes/pages/extensions._index.d.ts.map +1 -0
- package/dist/routes/pages/extensions._index.js +6 -0
- package/dist/routes/pages/extensions._index.js.map +1 -0
- package/dist/routes/pages/identities.js +2 -2
- package/dist/routes/pages/integrations.js +4 -4
- package/dist/routes/pages/messaging.js +2 -2
- package/dist/routes/pages/metrics.d.ts +5 -0
- package/dist/routes/pages/metrics.d.ts.map +1 -0
- package/dist/routes/pages/metrics.js +135 -0
- package/dist/routes/pages/metrics.js.map +1 -0
- package/dist/routes/pages/new-app.js +1 -1
- package/dist/routes/pages/overview.d.ts.map +1 -1
- package/dist/routes/pages/overview.js +9 -17
- package/dist/routes/pages/overview.js.map +1 -1
- package/dist/routes/pages/team.js +1 -1
- package/dist/routes/pages/vault.js +10 -10
- package/dist/routes/pages/workspace.js +10 -10
- package/dist/server/lib/pre-auth-routing.d.ts.map +1 -1
- package/dist/server/lib/pre-auth-routing.js +9 -2
- package/dist/server/lib/pre-auth-routing.js.map +1 -1
- package/dist/server/lib/usage-metrics-store.d.ts +93 -0
- package/dist/server/lib/usage-metrics-store.d.ts.map +1 -0
- package/dist/server/lib/usage-metrics-store.js +386 -0
- package/dist/server/lib/usage-metrics-store.js.map +1 -0
- package/package.json +9 -5
- package/src/actions/index.ts +2 -0
- package/src/actions/list-dispatch-usage-metrics.ts +19 -0
- package/src/actions/navigate.ts +5 -17
- package/src/actions/view-screen.ts +18 -0
- package/src/components/index.ts +6 -0
- package/src/components/layout/Header.tsx +1 -1
- package/src/components/layout/Layout.tsx +194 -37
- package/src/hooks/use-navigation-state.ts +57 -8
- package/src/routes/index.ts +3 -2
- package/src/routes/pages/extensions.$id.tsx +5 -0
- package/src/routes/pages/extensions._index.tsx +5 -0
- package/src/routes/pages/metrics.tsx +667 -0
- package/src/routes/pages/overview.tsx +0 -10
- package/src/server/lib/pre-auth-routing.ts +10 -2
- package/src/server/lib/usage-metrics-store.ts +605 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const Popover = PopoverPrimitive.Root;
|
|
6
6
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
7
7
|
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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", className), ...props }) })));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const Progress = React.forwardRef(({ className, value, ...props }, ref) => (_jsx(ProgressPrimitive.Root, { ref: ref, className: cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className), ...props, children: _jsx(ProgressPrimitive.Indicator, { className: "h-full w-full flex-1 bg-primary transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
|
|
6
6
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
7
7
|
export { Progress };
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
4
|
import { IconCircle } from "@tabler/icons-react";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
6
|
const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
7
7
|
return (_jsx(RadioGroupPrimitive.Root, { className: cn("grid gap-2", className), ...props, ref: ref }));
|
|
8
8
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { IconGripVertical } from "@tabler/icons-react";
|
|
3
3
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const ResizablePanelGroup = ({ className, ...props }) => (_jsx(ResizablePrimitive.Group, { className: cn("flex h-full w-full aria-[orientation=vertical]:flex-col", className), ...props }));
|
|
6
6
|
const ResizablePanel = ResizablePrimitive.Panel;
|
|
7
7
|
const ResizableHandle = ({ withHandle, className, ...props }) => (_jsx(ResizablePrimitive.Separator, { className: cn("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 aria-[orientation=vertical]:h-px aria-[orientation=vertical]:w-full aria-[orientation=vertical]:after:left-0 aria-[orientation=vertical]:after:h-1 aria-[orientation=vertical]:after:w-full aria-[orientation=vertical]:after:-translate-y-1/2 aria-[orientation=vertical]:after:translate-x-0 [&[aria-orientation=vertical]>div]:rotate-90", className), ...props, children: withHandle && (_jsx("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: _jsx(IconGripVertical, { className: "h-2.5 w-2.5" }) })) }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(ScrollAreaPrimitive.Root, { ref: ref, className: cn("relative overflow-hidden", className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] })));
|
|
6
6
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
7
7
|
const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, { ref: ref, orientation: orientation, className: cn("flex touch-none select-none transition-colors", orientation === "vertical" &&
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
4
|
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
6
|
const Select = SelectPrimitive.Root;
|
|
7
7
|
const SelectGroup = SelectPrimitive.Group;
|
|
8
8
|
const SelectValue = SelectPrimitive.Value;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (_jsx(SeparatorPrimitive.Root, { ref: ref, decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className), ...props })));
|
|
6
6
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
7
7
|
export { Separator };
|
|
@@ -3,7 +3,7 @@ import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { IconX } from "@tabler/icons-react";
|
|
5
5
|
import * as React from "react";
|
|
6
|
-
import { cn } from "../../lib/utils";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
7
|
const Sheet = SheetPrimitive.Root;
|
|
8
8
|
const SheetTrigger = SheetPrimitive.Trigger;
|
|
9
9
|
const SheetClose = SheetPrimitive.Close;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import { TooltipContent } from "../../components/ui/tooltip";
|
|
3
|
+
import { TooltipContent } from "../../components/ui/tooltip.js";
|
|
4
4
|
type SidebarContext = {
|
|
5
5
|
state: "expanded" | "collapsed";
|
|
6
6
|
open: boolean;
|
|
@@ -22,7 +22,7 @@ declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.ClassAttribute
|
|
|
22
22
|
variant?: "sidebar" | "floating" | "inset";
|
|
23
23
|
collapsible?: "offcanvas" | "icon" | "none";
|
|
24
24
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button.js").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
26
26
|
declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
27
27
|
declare const SidebarInset: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
28
|
declare const SidebarInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -3,14 +3,14 @@ import * as React from "react";
|
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { IconLayoutSidebar } from "@tabler/icons-react";
|
|
6
|
-
import { useIsMobile } from "../../hooks/use-mobile";
|
|
7
|
-
import { cn } from "../../lib/utils";
|
|
8
|
-
import { Button } from "../../components/ui/button";
|
|
9
|
-
import { Input } from "../../components/ui/input";
|
|
10
|
-
import { Separator } from "../../components/ui/separator";
|
|
11
|
-
import { Sheet, SheetContent, SheetDescription, SheetTitle, } from "../../components/ui/sheet";
|
|
12
|
-
import { Skeleton } from "../../components/ui/skeleton";
|
|
13
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../../components/ui/tooltip";
|
|
6
|
+
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
7
|
+
import { cn } from "../../lib/utils.js";
|
|
8
|
+
import { Button } from "../../components/ui/button.js";
|
|
9
|
+
import { Input } from "../../components/ui/input.js";
|
|
10
|
+
import { Separator } from "../../components/ui/separator.js";
|
|
11
|
+
import { Sheet, SheetContent, SheetDescription, SheetTitle, } from "../../components/ui/sheet.js";
|
|
12
|
+
import { Skeleton } from "../../components/ui/skeleton.js";
|
|
13
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../../components/ui/tooltip.js";
|
|
14
14
|
const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
15
15
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
16
16
|
const SIDEBAR_WIDTH = "16rem";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../lib/utils";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
3
|
function Skeleton({ className, ...props }) {
|
|
4
4
|
return (_jsx("div", { className: cn("animate-pulse rounded-md bg-muted", className), ...props }));
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const Slider = React.forwardRef(({ className, ...props }, ref) => (_jsxs(SliderPrimitive.Root, { ref: ref, className: cn("relative flex w-full touch-none select-none items-center", className), ...props, children: [_jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: _jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }), _jsx(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })] })));
|
|
6
6
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
7
7
|
export { Slider };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTheme } from "next-themes";
|
|
3
3
|
import { Toaster as Sonner } from "sonner";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const toastWidthClasses = "group-[.toaster]:!w-[var(--width)] group-[.toaster]:!min-w-[min(20rem,calc(100vw_-_2rem))] group-[.toaster]:!max-w-[var(--width)] group-[.toaster]:!gap-3 group-[.toaster]:!break-normal";
|
|
6
6
|
const toastContentClasses = "group-[.toast]:!min-w-[min(16rem,calc(100vw_-_14rem))] group-[.toast]:!flex-1 group-[.toast]:!basis-auto group-[.toast]:break-words";
|
|
7
7
|
const toastButtonClasses = "group-[.toast]:!shrink-0 group-[.toast]:!whitespace-nowrap";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { IconLoader2 } from "@tabler/icons-react";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
4
|
export function Spinner({ className, ...props }) {
|
|
5
5
|
return (_jsx(IconLoader2, { role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props }));
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0") }) })));
|
|
6
6
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
7
7
|
export { Switch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
4
|
const Table = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { className: "relative w-full overflow-auto", children: _jsx("table", { ref: ref, className: cn("w-full caption-bottom text-sm", className), ...props }) })));
|
|
5
5
|
Table.displayName = "Table";
|
|
6
6
|
const TableHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("thead", { ref: ref, className: cn("[&_tr]:border-b", className), ...props })));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const Tabs = TabsPrimitive.Root;
|
|
6
6
|
const TabsList = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.List, { ref: ref, className: cn("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className), ...props })));
|
|
7
7
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
4
|
const Textarea = React.forwardRef(({ className, ...props }, ref) => {
|
|
5
5
|
return (_jsx("textarea", { className: cn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className), ref: ref, ...props }));
|
|
6
6
|
});
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { IconX } from "@tabler/icons-react";
|
|
6
|
-
import { cn } from "../../lib/utils";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
7
|
const ToastProvider = ToastPrimitives.Provider;
|
|
8
8
|
const ToastViewport = React.forwardRef(({ className, ...props }, ref) => (_jsx(ToastPrimitives.Viewport, { ref: ref, className: cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col sm:max-w-[36rem]", className), ...props })));
|
|
9
9
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useToast } from "../../hooks/use-toast";
|
|
3
|
-
import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "../../components/ui/toast";
|
|
2
|
+
import { useToast } from "../../hooks/use-toast.js";
|
|
3
|
+
import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "../../components/ui/toast.js";
|
|
4
4
|
export function Toaster() {
|
|
5
5
|
const { toasts } = useToast();
|
|
6
6
|
return (_jsxs(ToastProvider, { children: [toasts.map(function ({ id, title, description, action, ...props }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
import { toggleVariants } from "../../components/ui/toggle";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { toggleVariants } from "../../components/ui/toggle.js";
|
|
6
6
|
const ToggleGroupContext = React.createContext({
|
|
7
7
|
size: "default",
|
|
8
8
|
variant: "default",
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
6
|
const toggleVariants = cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
5
|
const TooltipProvider = TooltipPrimitive.Provider;
|
|
6
6
|
const Tooltip = TooltipPrimitive.Root;
|
|
7
7
|
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { DispatchExtensionConfig } from "../components/index.js";
|
|
1
2
|
export interface NavigationState {
|
|
2
3
|
view: string;
|
|
3
4
|
path?: string;
|
|
4
5
|
}
|
|
5
|
-
export declare function useNavigationState(): void;
|
|
6
|
+
export declare function useNavigationState(extensions?: DispatchExtensionConfig): void;
|
|
6
7
|
//# sourceMappingURL=use-navigation-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-navigation-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-navigation-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-navigation-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-navigation-state.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,uBAAuB,QAwDtE"}
|
|
@@ -2,14 +2,14 @@ import { useEffect } from "react";
|
|
|
2
2
|
import { useLocation, useNavigate } from "react-router";
|
|
3
3
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { agentNativePath, appBasePath, appPath, } from "@agent-native/core/client";
|
|
5
|
-
export function useNavigationState() {
|
|
5
|
+
export function useNavigationState(extensions) {
|
|
6
6
|
const location = useLocation();
|
|
7
7
|
const navigate = useNavigate();
|
|
8
8
|
const qc = useQueryClient();
|
|
9
9
|
// Sync current route to application state
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
const state = {
|
|
12
|
-
view: resolveView(location.pathname),
|
|
12
|
+
view: resolveView(location.pathname, extensions),
|
|
13
13
|
path: appPath(location.pathname),
|
|
14
14
|
};
|
|
15
15
|
fetch(agentNativePath("/_agent-native/application-state/navigation"), {
|
|
@@ -18,7 +18,7 @@ export function useNavigationState() {
|
|
|
18
18
|
headers: { "Content-Type": "application/json" },
|
|
19
19
|
body: JSON.stringify(state),
|
|
20
20
|
}).catch(() => { });
|
|
21
|
-
}, [location.pathname]);
|
|
21
|
+
}, [extensions, location.pathname]);
|
|
22
22
|
// Listen for navigate commands from agent
|
|
23
23
|
const { data: navCommand } = useQuery({
|
|
24
24
|
queryKey: ["navigate-command"],
|
|
@@ -47,10 +47,10 @@ export function useNavigationState() {
|
|
|
47
47
|
}).catch(() => { });
|
|
48
48
|
const cmd = navCommand;
|
|
49
49
|
// Navigate to a specific path or resolve view name to path
|
|
50
|
-
const path = routerPath(cmd.path || resolvePath(cmd.view) || "/overview");
|
|
50
|
+
const path = routerPath(cmd.path || resolvePath(cmd.view, extensions) || "/overview");
|
|
51
51
|
navigate(path);
|
|
52
52
|
qc.setQueryData(["navigate-command"], null);
|
|
53
|
-
}, [navCommand, navigate, qc]);
|
|
53
|
+
}, [extensions, navCommand, navigate, qc]);
|
|
54
54
|
}
|
|
55
55
|
function routerPath(path) {
|
|
56
56
|
const basePath = appBasePath();
|
|
@@ -63,9 +63,34 @@ function routerPath(path) {
|
|
|
63
63
|
}
|
|
64
64
|
return path;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function extensionItemMatchesPath(item, pathname) {
|
|
67
|
+
if (item.match) {
|
|
68
|
+
try {
|
|
69
|
+
if (item.match(pathname))
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return pathname === item.to || pathname.startsWith(`${item.to}/`);
|
|
77
|
+
}
|
|
78
|
+
function resolveExtensionView(pathname, extensions) {
|
|
79
|
+
return extensions?.navItems?.find((item) => extensionItemMatchesPath(item, pathname))?.id;
|
|
80
|
+
}
|
|
81
|
+
function resolveExtensionPath(view, extensions) {
|
|
82
|
+
if (!view)
|
|
83
|
+
return undefined;
|
|
84
|
+
return extensions?.navItems?.find((item) => item.id === view)?.to;
|
|
85
|
+
}
|
|
86
|
+
function resolveView(pathname, extensions) {
|
|
87
|
+
const extensionView = resolveExtensionView(pathname, extensions);
|
|
88
|
+
if (extensionView)
|
|
89
|
+
return extensionView;
|
|
67
90
|
if (pathname.startsWith("/apps"))
|
|
68
91
|
return "apps";
|
|
92
|
+
if (pathname.startsWith("/metrics"))
|
|
93
|
+
return "metrics";
|
|
69
94
|
if (pathname.startsWith("/new-app"))
|
|
70
95
|
return "new-app";
|
|
71
96
|
if (pathname.startsWith("/vault"))
|
|
@@ -90,12 +115,15 @@ function resolveView(pathname) {
|
|
|
90
115
|
return "team";
|
|
91
116
|
return "overview";
|
|
92
117
|
}
|
|
93
|
-
function resolvePath(view) {
|
|
118
|
+
function resolvePath(view, extensions) {
|
|
94
119
|
switch (view) {
|
|
95
120
|
case "overview":
|
|
96
121
|
return "/overview";
|
|
97
122
|
case "apps":
|
|
98
123
|
return "/apps";
|
|
124
|
+
case "metrics":
|
|
125
|
+
case "usage":
|
|
126
|
+
return "/metrics";
|
|
99
127
|
case "new-app":
|
|
100
128
|
case "create-app":
|
|
101
129
|
return "/new-app";
|
|
@@ -123,7 +151,7 @@ function resolvePath(view) {
|
|
|
123
151
|
case "team":
|
|
124
152
|
return "/team";
|
|
125
153
|
default:
|
|
126
|
-
return
|
|
154
|
+
return resolveExtensionPath(view, extensions);
|
|
127
155
|
}
|
|
128
156
|
}
|
|
129
157
|
//# sourceMappingURL=use-navigation-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-navigation-state.js","sourceRoot":"","sources":["../../src/hooks/use-navigation-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,WAAW,EA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b,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC;QAClB,KAAK,cAAc;YACjB,OAAO,eAAe,CAAC;QACzB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,cAAc,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,eAAe,CAAC;QACzB,KAAK,YAAY;YACf,OAAO,aAAa,CAAC;QACvB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,OAAO;YACV,OAAO,QAAQ,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC","sourcesContent":["import { useEffect } from \"react\";\nimport { useLocation, useNavigate } from \"react-router\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport {\n agentNativePath,\n appBasePath,\n appPath,\n} from \"@agent-native/core/client\";\n\nexport interface NavigationState {\n view: string;\n path?: string;\n}\n\nexport function useNavigationState() {\n const location = useLocation();\n const navigate = useNavigate();\n const qc = useQueryClient();\n\n // Sync current route to application state\n useEffect(() => {\n const state: NavigationState = {\n view: resolveView(location.pathname),\n path: appPath(location.pathname),\n };\n\n fetch(agentNativePath(\"/_agent-native/application-state/navigation\"), {\n method: \"PUT\",\n keepalive: true,\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(state),\n }).catch(() => {});\n }, [location.pathname]);\n\n // Listen for navigate commands from agent\n const { data: navCommand } = useQuery({\n queryKey: [\"navigate-command\"],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\"/_agent-native/application-state/navigate\"),\n );\n if (!res.ok) return null;\n const data = await res.json();\n if (data) {\n // Return with a timestamp to ensure uniqueness\n return { ...data, _ts: Date.now() };\n }\n return null;\n },\n refetchInterval: 2_000,\n refetchIntervalInBackground: true,\n structuralSharing: false,\n });\n\n useEffect(() => {\n if (!navCommand) return;\n // Delete the one-shot command AFTER reading it\n fetch(agentNativePath(\"/_agent-native/application-state/navigate\"), {\n method: \"DELETE\",\n headers: { \"X-Agent-Native-CSRF\": \"1\" },\n }).catch(() => {});\n const cmd = navCommand as NavigationState;\n\n // Navigate to a specific path or resolve view name to path\n const path = routerPath(cmd.path || resolvePath(cmd.view) || \"/overview\");\n navigate(path);\n qc.setQueryData([\"navigate-command\"], null);\n }, [navCommand, navigate, qc]);\n}\n\nfunction routerPath(path: string): string {\n const basePath = appBasePath();\n if (!basePath) return path;\n if (path === basePath) return \"/\";\n if (path.startsWith(`${basePath}/`)) {\n return path.slice(basePath.length) || \"/\";\n }\n return path;\n}\n\nfunction resolveView(pathname: string): string {\n if (pathname.startsWith(\"/apps\")) return \"apps\";\n if (pathname.startsWith(\"/new-app\")) return \"new-app\";\n if (pathname.startsWith(\"/vault\")) return \"vault\";\n if (pathname.startsWith(\"/integrations\")) return \"integrations\";\n if (pathname.startsWith(\"/workspace\")) return \"workspace\";\n if (pathname.startsWith(\"/agents\")) return \"agents\";\n if (pathname.startsWith(\"/messaging\")) return \"messaging\";\n if (pathname.startsWith(\"/destinations\")) return \"destinations\";\n if (pathname.startsWith(\"/identities\")) return \"identities\";\n if (pathname.startsWith(\"/approvals\")) return \"approvals\";\n if (pathname.startsWith(\"/audit\")) return \"audit\";\n if (pathname.startsWith(\"/team\")) return \"team\";\n return \"overview\";\n}\n\nfunction resolvePath(view?: string): string | undefined {\n switch (view) {\n case \"overview\":\n return \"/overview\";\n case \"apps\":\n return \"/apps\";\n case \"new-app\":\n case \"create-app\":\n return \"/new-app\";\n case \"vault\":\n case \"secrets\":\n return \"/vault\";\n case \"integrations\":\n return \"/integrations\";\n case \"workspace\":\n case \"resources\":\n return \"/workspace\";\n case \"agents\":\n return \"/agents\";\n case \"messaging\":\n return \"/messaging\";\n case \"destinations\":\n case \"routes\":\n return \"/destinations\";\n case \"identities\":\n return \"/identities\";\n case \"approvals\":\n return \"/approvals\";\n case \"audit\":\n return \"/audit\";\n case \"team\":\n return \"/team\";\n default:\n return undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-navigation-state.js","sourceRoot":"","sources":["../../src/hooks/use-navigation-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EACL,eAAe,EACf,WAAW,EACX,OAAO,GACR,MAAM,2BAA2B,CAAC;AAWnC,MAAM,UAAU,kBAAkB,CAAC,UAAoC;IACrE,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IAE5B,0CAA0C;IAC1C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAoB;YAC7B,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;YAChD,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;SACjC,CAAC;QAEF,KAAK,CAAC,eAAe,CAAC,6CAA6C,CAAC,EAAE;YACpE,MAAM,EAAE,KAAK;YACb,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;SAC5B,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEpC,0CAA0C;IAC1C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,QAAQ,C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CAAC;QACrB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB,KAAK,SAAS,CAAC;QACf,KAAK,OAAO;YACV,OAAO,UAAU,CAAC;QACpB,KAAK,SAAS,CAAC;QACf,KAAK,YAAY;YACf,OAAO,UAAU,CAAC;QACpB,KAAK,OAAO,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC;QAClB,KAAK,cAAc;YACjB,OAAO,eAAe,CAAC;QACzB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,cAAc,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,eAAe,CAAC;QACzB,KAAK,YAAY;YACf,OAAO,aAAa,CAAC;QACvB,KAAK,WAAW;YACd,OAAO,YAAY,CAAC;QACtB,KAAK,OAAO;YACV,OAAO,QAAQ,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import { useEffect } from \"react\";\nimport { useLocation, useNavigate } from \"react-router\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport {\n agentNativePath,\n appBasePath,\n appPath,\n} from \"@agent-native/core/client\";\nimport type {\n DispatchExtensionConfig,\n DispatchNavItem,\n} from \"../components/index.js\";\n\nexport interface NavigationState {\n view: string;\n path?: string;\n}\n\nexport function useNavigationState(extensions?: DispatchExtensionConfig) {\n const location = useLocation();\n const navigate = useNavigate();\n const qc = useQueryClient();\n\n // Sync current route to application state\n useEffect(() => {\n const state: NavigationState = {\n view: resolveView(location.pathname, extensions),\n path: appPath(location.pathname),\n };\n\n fetch(agentNativePath(\"/_agent-native/application-state/navigation\"), {\n method: \"PUT\",\n keepalive: true,\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(state),\n }).catch(() => {});\n }, [extensions, location.pathname]);\n\n // Listen for navigate commands from agent\n const { data: navCommand } = useQuery({\n queryKey: [\"navigate-command\"],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\"/_agent-native/application-state/navigate\"),\n );\n if (!res.ok) return null;\n const data = await res.json();\n if (data) {\n // Return with a timestamp to ensure uniqueness\n return { ...data, _ts: Date.now() };\n }\n return null;\n },\n refetchInterval: 2_000,\n refetchIntervalInBackground: true,\n structuralSharing: false,\n });\n\n useEffect(() => {\n if (!navCommand) return;\n // Delete the one-shot command AFTER reading it\n fetch(agentNativePath(\"/_agent-native/application-state/navigate\"), {\n method: \"DELETE\",\n headers: { \"X-Agent-Native-CSRF\": \"1\" },\n }).catch(() => {});\n const cmd = navCommand as NavigationState;\n\n // Navigate to a specific path or resolve view name to path\n const path = routerPath(\n cmd.path || resolvePath(cmd.view, extensions) || \"/overview\",\n );\n navigate(path);\n qc.setQueryData([\"navigate-command\"], null);\n }, [extensions, navCommand, navigate, qc]);\n}\n\nfunction routerPath(path: string): string {\n const basePath = appBasePath();\n if (!basePath) return path;\n if (path === basePath) return \"/\";\n if (path.startsWith(`${basePath}/`)) {\n return path.slice(basePath.length) || \"/\";\n }\n return path;\n}\n\nfunction extensionItemMatchesPath(\n item: DispatchNavItem,\n pathname: string,\n): boolean {\n if (item.match) {\n try {\n if (item.match(pathname)) return true;\n } catch {\n return false;\n }\n }\n return pathname === item.to || pathname.startsWith(`${item.to}/`);\n}\n\nfunction resolveExtensionView(\n pathname: string,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n return extensions?.navItems?.find((item) =>\n extensionItemMatchesPath(item, pathname),\n )?.id;\n}\n\nfunction resolveExtensionPath(\n view: string | undefined,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n if (!view) return undefined;\n return extensions?.navItems?.find((item) => item.id === view)?.to;\n}\n\nfunction resolveView(\n pathname: string,\n extensions?: DispatchExtensionConfig,\n): string {\n const extensionView = resolveExtensionView(pathname, extensions);\n if (extensionView) return extensionView;\n if (pathname.startsWith(\"/apps\")) return \"apps\";\n if (pathname.startsWith(\"/metrics\")) return \"metrics\";\n if (pathname.startsWith(\"/new-app\")) return \"new-app\";\n if (pathname.startsWith(\"/vault\")) return \"vault\";\n if (pathname.startsWith(\"/integrations\")) return \"integrations\";\n if (pathname.startsWith(\"/workspace\")) return \"workspace\";\n if (pathname.startsWith(\"/agents\")) return \"agents\";\n if (pathname.startsWith(\"/messaging\")) return \"messaging\";\n if (pathname.startsWith(\"/destinations\")) return \"destinations\";\n if (pathname.startsWith(\"/identities\")) return \"identities\";\n if (pathname.startsWith(\"/approvals\")) return \"approvals\";\n if (pathname.startsWith(\"/audit\")) return \"audit\";\n if (pathname.startsWith(\"/team\")) return \"team\";\n return \"overview\";\n}\n\nfunction resolvePath(\n view?: string,\n extensions?: DispatchExtensionConfig,\n): string | undefined {\n switch (view) {\n case \"overview\":\n return \"/overview\";\n case \"apps\":\n return \"/apps\";\n case \"metrics\":\n case \"usage\":\n return \"/metrics\";\n case \"new-app\":\n case \"create-app\":\n return \"/new-app\";\n case \"vault\":\n case \"secrets\":\n return \"/vault\";\n case \"integrations\":\n return \"/integrations\";\n case \"workspace\":\n case \"resources\":\n return \"/workspace\";\n case \"agents\":\n return \"/agents\";\n case \"messaging\":\n return \"/messaging\";\n case \"destinations\":\n case \"routes\":\n return \"/destinations\";\n case \"identities\":\n return \"/identities\";\n case \"approvals\":\n return \"/approvals\";\n case \"audit\":\n return \"/audit\";\n case \"team\":\n return \"/team\";\n default:\n return resolveExtensionPath(view, extensions);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ToastActionElement, ToastProps } from "../components/ui/toast";
|
|
2
|
+
import type { ToastActionElement, ToastProps } from "../components/ui/toast.js";
|
|
3
3
|
type ToasterToast = ToastProps & {
|
|
4
4
|
id: string;
|
|
5
5
|
title?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,0BAA0B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,0BAA0B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc,EAAE,WAoB5B,CAAC"}
|
package/dist/routes/index.js
CHANGED
|
@@ -31,6 +31,7 @@ import { route, index } from "@react-router/dev/routes";
|
|
|
31
31
|
export const dispatchRoutes = [
|
|
32
32
|
index("./pages/_index.js"),
|
|
33
33
|
route("overview", "./pages/overview.js"),
|
|
34
|
+
route("metrics", "./pages/metrics.js"),
|
|
34
35
|
route("apps", "./pages/apps.js"),
|
|
35
36
|
route("apps/:appId", "./pages/apps.$appId.js"),
|
|
36
37
|
route("new-app", "./pages/new-app.js"),
|
|
@@ -45,7 +46,7 @@ export const dispatchRoutes = [
|
|
|
45
46
|
route("approvals", "./pages/approvals.js"),
|
|
46
47
|
route("audit", "./pages/audit.js"),
|
|
47
48
|
route("team", "./pages/team.js"),
|
|
48
|
-
route("
|
|
49
|
-
route("
|
|
49
|
+
route("extensions", "./pages/extensions._index.js"),
|
|
50
|
+
route("extensions/:id", "./pages/extensions.$id.js"),
|
|
50
51
|
];
|
|
51
52
|
//# sourceMappingURL=index.js.map
|
package/dist/routes/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,EAAE,KAAK,EAAE,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AAC,aAAa,EAAE,wBAAwB,CAAC;IAC9C,KAAK,CAAC,SAAS,EAAE,oBAAoB,CAAC;IACtC,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC;IAClC,KAAK,CAAC,cAAc,EAAE,yBAAyB,CAAC;IAChD,KAAK,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACpC,KAAK,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC1C,KAAK,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC1C,KAAK,CAAC,cAAc,EAAE,yBAAyB,CAAC;IAChD,KAAK,CAAC,YAAY,EAAE,uBAAuB,CAAC;IAC5C,KAAK,CAAC,UAAU,EAAE,qBAAqB,CAAC;IACxC,KAAK,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC1C,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC;IAClC,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAChC,KAAK,CAAC,YAAY,EAAE,8BAA8B,CAAC;IACnD,KAAK,CAAC,gBAAgB,EAAE,2BAA2B,CAAC;CACrD,CAAC","sourcesContent":["import { type RouteConfig, route, index } from \"@react-router/dev/routes\";\n\n/**\n * Dispatch's routes as a programmatic `RouteConfig[]`. Splat into the\n * consumer's `app/routes.ts`:\n *\n * ```ts\n * import { type RouteConfig } from \"@react-router/dev/routes\";\n * import { dispatchRoutes } from \"@agent-native/dispatch/routes\";\n *\n * export default [\n * ...localRoutes, // consumer's own routes win on collision\n * ...dispatchRoutes, // dispatch fills in everything else\n * ] satisfies RouteConfig;\n * ```\n *\n * Route precedence: React Router 7 matches in declaration order, so\n * placing `dispatchRoutes` LAST means consumer-defined routes with the\n * same path take precedence. To override a single dispatch route, define\n * it in your local routes; to keep it, omit it.\n *\n * The `file` paths below resolve relative to this file at runtime — they\n * point into `packages/dispatch/dist/routes/pages/*.js` after build.\n *\n * Naming maps the original flatRoutes file conventions:\n * `_index.tsx` → `index(...)`\n * `<name>.tsx` → `route(\"<name>\", ...)`\n * `<a>.$<param>.tsx` → `route(\"<a>/:<param>\", ...)`\n * `<a>._index.tsx` → flattened as `route(\"<a>\", ...)` (workspace\n * versions are bare and don't wrap a parent layout)\n */\nexport const dispatchRoutes: RouteConfig = [\n index(\"./pages/_index.js\"),\n route(\"overview\", \"./pages/overview.js\"),\n route(\"metrics\", \"./pages/metrics.js\"),\n route(\"apps\", \"./pages/apps.js\"),\n route(\"apps/:appId\", \"./pages/apps.$appId.js\"),\n route(\"new-app\", \"./pages/new-app.js\"),\n route(\"vault\", \"./pages/vault.js\"),\n route(\"integrations\", \"./pages/integrations.js\"),\n route(\"agents\", \"./pages/agents.js\"),\n route(\"workspace\", \"./pages/workspace.js\"),\n route(\"messaging\", \"./pages/messaging.js\"),\n route(\"destinations\", \"./pages/destinations.js\"),\n route(\"identities\", \"./pages/identities.js\"),\n route(\"approval\", \"./pages/approval.js\"),\n route(\"approvals\", \"./pages/approvals.js\"),\n route(\"audit\", \"./pages/audit.js\"),\n route(\"team\", \"./pages/team.js\"),\n route(\"extensions\", \"./pages/extensions._index.js\"),\n route(\"extensions/:id\", \"./pages/extensions.$id.js\"),\n];\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { redirect } from "react-router";
|
|
3
3
|
import { appPath } from "@agent-native/core/client";
|
|
4
|
-
import { Spinner } from "../../components/ui/spinner";
|
|
4
|
+
import { Spinner } from "../../components/ui/spinner.js";
|
|
5
5
|
export function meta() {
|
|
6
6
|
return [
|
|
7
7
|
{ title: "Agent-Native Dispatch" },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useActionQuery } from "@agent-native/core/client";
|
|
3
|
-
import { AgentsPanel } from "../../components/agents-panel";
|
|
4
|
-
import { DispatchShell } from "../../components/dispatch-shell";
|
|
3
|
+
import { AgentsPanel } from "../../components/agents-panel.js";
|
|
4
|
+
import { DispatchShell } from "../../components/dispatch-shell.js";
|
|
5
5
|
export function meta() {
|
|
6
6
|
return [{ title: "Agents — Dispatch" }];
|
|
7
7
|
}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useSearchParams } from "react-router";
|
|
3
3
|
import { useActionMutation, useActionQuery, isInAgentEmbed, postNavigate, appPath, } from "@agent-native/core/client";
|
|
4
4
|
import { toast } from "sonner";
|
|
5
|
-
import { Button } from "../../components/ui/button";
|
|
6
|
-
import { Badge } from "../../components/ui/badge";
|
|
5
|
+
import { Button } from "../../components/ui/button.js";
|
|
6
|
+
import { Badge } from "../../components/ui/badge.js";
|
|
7
7
|
import { IconCheck, IconX, IconArrowUpRight, IconShieldCheck, IconClock, IconAlertCircle, } from "@tabler/icons-react";
|
|
8
8
|
export function meta() {
|
|
9
9
|
return [{ title: "Approval — Dispatch" }];
|
|
@@ -3,10 +3,10 @@ import { useMemo, useState } from "react";
|
|
|
3
3
|
import { useActionMutation, useActionQuery } from "@agent-native/core/client";
|
|
4
4
|
import { useOrg } from "@agent-native/core/client/org";
|
|
5
5
|
import { toast } from "sonner";
|
|
6
|
-
import { DispatchShell } from "../../components/dispatch-shell";
|
|
7
|
-
import { Button } from "../../components/ui/button";
|
|
8
|
-
import { Input } from "../../components/ui/input";
|
|
9
|
-
import { Switch } from "../../components/ui/switch";
|
|
6
|
+
import { DispatchShell } from "../../components/dispatch-shell.js";
|
|
7
|
+
import { Button } from "../../components/ui/button.js";
|
|
8
|
+
import { Input } from "../../components/ui/input.js";
|
|
9
|
+
import { Switch } from "../../components/ui/switch.js";
|
|
10
10
|
export function meta() {
|
|
11
11
|
return [{ title: "Approvals — Dispatch" }];
|
|
12
12
|
}
|
|
@@ -3,9 +3,9 @@ import { useEffect, useMemo } from "react";
|
|
|
3
3
|
import { Link, useParams } from "react-router";
|
|
4
4
|
import { useActionQuery } from "@agent-native/core/client";
|
|
5
5
|
import { IconArrowLeft, IconArrowUpRight, IconClockHour4, } from "@tabler/icons-react";
|
|
6
|
-
import { DispatchShell } from "../../components/dispatch-shell";
|
|
7
|
-
import { Badge } from "../../components/ui/badge";
|
|
8
|
-
import { Button } from "../../components/ui/button";
|
|
6
|
+
import { DispatchShell } from "../../components/dispatch-shell.js";
|
|
7
|
+
import { Badge } from "../../components/ui/badge.js";
|
|
8
|
+
import { Button } from "../../components/ui/button.js";
|
|
9
9
|
function workspaceAppHref(app) {
|
|
10
10
|
if (app.status === "pending")
|
|
11
11
|
return app.builderUrl || null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useActionQuery } from "@agent-native/core/client";
|
|
3
3
|
import { IconArrowUpRight, IconApps, IconClockHour4, IconPlus, } from "@tabler/icons-react";
|
|
4
|
-
import { AppKeysPopover } from "../../components/app-keys-popover";
|
|
5
|
-
import { CreateAppPopover } from "../../components/create-app-popover";
|
|
6
|
-
import { DispatchShell } from "../../components/dispatch-shell";
|
|
7
|
-
import { Badge } from "../../components/ui/badge";
|
|
8
|
-
import { Button } from "../../components/ui/button";
|
|
4
|
+
import { AppKeysPopover } from "../../components/app-keys-popover.js";
|
|
5
|
+
import { CreateAppPopover } from "../../components/create-app-popover.js";
|
|
6
|
+
import { DispatchShell } from "../../components/dispatch-shell.js";
|
|
7
|
+
import { Badge } from "../../components/ui/badge.js";
|
|
8
|
+
import { Button } from "../../components/ui/button.js";
|
|
9
9
|
function workspaceAppHref(app) {
|
|
10
10
|
if (app.status === "pending")
|
|
11
11
|
return app.builderUrl || null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useActionQuery } from "@agent-native/core/client";
|
|
3
|
-
import { DispatchShell } from "../../components/dispatch-shell";
|
|
3
|
+
import { DispatchShell } from "../../components/dispatch-shell.js";
|
|
4
4
|
export function meta() {
|
|
5
5
|
return [{ title: "Audit — Dispatch" }];
|
|
6
6
|
}
|