@agent-native/dispatch 0.21.0 → 0.22.1
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 +8 -8
- package/dist/actions/search-agent-threads.js +2 -2
- package/dist/actions/search-agent-threads.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.map +1 -1
- package/dist/components/layout/Layout.js +22 -14
- 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/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/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/package.json +3 -3
- package/src/actions/search-agent-threads.ts +2 -2
- package/src/components/layout/HeaderActions.tsx +1 -84
- package/src/components/layout/Layout.spec.tsx +94 -10
- package/src/components/layout/Layout.tsx +107 -101
- 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/routes/pages/thread-debug.spec.tsx +103 -5
- package/src/routes/pages/thread-debug.tsx +1051 -451
- package/src/server/lib/thread-debug-store.spec.ts +17 -0
- package/src/server/lib/thread-debug-store.ts +9 -2
|
@@ -55,6 +55,8 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
|
55
55
|
workerStage: string | null;
|
|
56
56
|
diagStage: string | null;
|
|
57
57
|
peakRssMb: number | null;
|
|
58
|
+
inFlightSince: number | null;
|
|
59
|
+
hasDispatchPayload: boolean;
|
|
58
60
|
events: any[];
|
|
59
61
|
}[];
|
|
60
62
|
traces: {
|
|
@@ -47,8 +47,9 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
47
47
|
notes?: string | undefined;
|
|
48
48
|
scope?: "org" | "user" | undefined;
|
|
49
49
|
}, {
|
|
50
|
-
deleted?: undefined;
|
|
51
50
|
id?: undefined;
|
|
51
|
+
provider?: undefined;
|
|
52
|
+
deleted?: undefined;
|
|
52
53
|
providers: {
|
|
53
54
|
id: string;
|
|
54
55
|
label: string;
|
|
@@ -59,15 +60,14 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
59
60
|
updatedAt: number;
|
|
60
61
|
}[];
|
|
61
62
|
count: number;
|
|
62
|
-
provider?: undefined;
|
|
63
63
|
found?: undefined;
|
|
64
64
|
registered?: undefined;
|
|
65
65
|
label?: undefined;
|
|
66
66
|
message?: undefined;
|
|
67
67
|
} | {
|
|
68
|
-
deleted?: undefined;
|
|
69
68
|
count?: undefined;
|
|
70
69
|
id?: undefined;
|
|
70
|
+
deleted?: undefined;
|
|
71
71
|
providers?: undefined;
|
|
72
72
|
found: boolean;
|
|
73
73
|
provider: import("node_modules/@agent-native/core/dist/provider-api").CustomProviderConfig;
|
|
@@ -75,10 +75,10 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
75
75
|
label?: undefined;
|
|
76
76
|
message?: undefined;
|
|
77
77
|
} | {
|
|
78
|
-
deleted?: undefined;
|
|
79
78
|
count?: undefined;
|
|
80
|
-
providers?: undefined;
|
|
81
79
|
provider?: undefined;
|
|
80
|
+
deleted?: undefined;
|
|
81
|
+
providers?: undefined;
|
|
82
82
|
found: boolean;
|
|
83
83
|
id: string;
|
|
84
84
|
registered?: undefined;
|
|
@@ -86,8 +86,8 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
86
86
|
message?: undefined;
|
|
87
87
|
} | {
|
|
88
88
|
count?: undefined;
|
|
89
|
-
providers?: undefined;
|
|
90
89
|
provider?: undefined;
|
|
90
|
+
providers?: undefined;
|
|
91
91
|
found?: undefined;
|
|
92
92
|
deleted: boolean;
|
|
93
93
|
id: string;
|
|
@@ -95,10 +95,10 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
95
95
|
label?: undefined;
|
|
96
96
|
message?: undefined;
|
|
97
97
|
} | {
|
|
98
|
-
deleted?: undefined;
|
|
99
98
|
count?: undefined;
|
|
100
|
-
providers?: undefined;
|
|
101
99
|
provider?: undefined;
|
|
100
|
+
deleted?: undefined;
|
|
101
|
+
providers?: undefined;
|
|
102
102
|
found?: undefined;
|
|
103
103
|
registered: boolean;
|
|
104
104
|
id: string;
|
|
@@ -2,7 +2,7 @@ import { defineAction } from "@agent-native/core";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { searchAgentThreads } from "../server/lib/thread-debug-store.js";
|
|
4
4
|
export default defineAction({
|
|
5
|
-
description: "Search agent chat threads by title, preview, full persisted thread content, or an exact request/run ID. Non-admins are limited to their own current Dispatch DB threads.",
|
|
5
|
+
description: "Search agent chat threads by title, owner email, preview, full persisted thread content, or an exact request/run ID. Non-admins are limited to their own current Dispatch DB threads.",
|
|
6
6
|
schema: z.object({
|
|
7
7
|
sourceId: z
|
|
8
8
|
.string()
|
|
@@ -11,7 +11,7 @@ export default defineAction({
|
|
|
11
11
|
query: z
|
|
12
12
|
.string()
|
|
13
13
|
.optional()
|
|
14
|
-
.describe("Full-text search term matched against title, preview, and thread data."),
|
|
14
|
+
.describe("Full-text search term matched against title, owner email, preview, and thread data."),
|
|
15
15
|
ownerEmail: z
|
|
16
16
|
.string()
|
|
17
17
|
.optional()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-agent-threads.js","sourceRoot":"","sources":["../../src/actions/search-agent-threads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"search-agent-threads.js","sourceRoot":"","sources":["../../src/actions/search-agent-threads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,uLAAuL;IACzL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,OAAO,CAAC,SAAS,CAAC;aAClB,QAAQ,CAAC,wDAAwD,CAAC;QACrE,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,qFAAqF,CACtF;QACH,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,6FAA6F,CAC9F;QACH,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KAC3D,CAAC;IACF,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;IACvB,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core\";\nimport { z } from \"zod\";\n\nimport { searchAgentThreads } from \"../server/lib/thread-debug-store.js\";\n\nexport default defineAction({\n description:\n \"Search agent chat threads by title, owner email, preview, full persisted thread content, or an exact request/run ID. Non-admins are limited to their own current Dispatch DB threads.\",\n schema: z.object({\n sourceId: z\n .string()\n .default(\"current\")\n .describe(\"Thread debug source id from list-agent-thread-sources.\"),\n query: z\n .string()\n .optional()\n .describe(\n \"Full-text search term matched against title, owner email, preview, and thread data.\",\n ),\n ownerEmail: z\n .string()\n .optional()\n .describe(\n \"Optional owner email filter. Admins may pass '*' or omit to search the admin-visible scope.\",\n ),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n run: async (input) => searchAgentThreads(input),\n});\n"]}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/** Consumed only by <Header /> — returns the current title. */
|
|
3
|
-
export declare function useHeaderTitle(): ReactNode;
|
|
4
|
-
/** Consumed only by <Header /> — returns the current actions slot. */
|
|
5
|
-
export declare function useHeaderActions(): ReactNode;
|
|
6
|
-
/**
|
|
7
|
-
* Provider is now a no-op wrapper for backwards compatibility — the state
|
|
8
|
-
* lives in the module-level store above. Kept as a component so callers of
|
|
9
|
-
* <HeaderActionsProvider> don't need to change.
|
|
10
|
-
*/
|
|
11
|
-
export declare const HeaderActionsProvider: FC<{
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
}>;
|
|
14
|
-
/** Mount a custom title into the app header. Cleans up on unmount. */
|
|
15
|
-
export declare function useSetPageTitle(node: ReactNode): void;
|
|
16
|
-
/** Mount ReactNode into the header's actions slot. Cleans up on unmount. */
|
|
17
|
-
export declare function useSetHeaderActions(node: ReactNode): void;
|
|
1
|
+
export * from "@agent-native/toolkit/app-shell";
|
|
18
2
|
//# sourceMappingURL=HeaderActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderActions.d.ts","sourceRoot":"","sources":["../../../src/components/layout/HeaderActions.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"HeaderActions.d.ts","sourceRoot":"","sources":["../../../src/components/layout/HeaderActions.tsx"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|
|
@@ -1,52 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { useEffect, useSyncExternalStore, } from "react";
|
|
3
|
-
let currentTitle = null;
|
|
4
|
-
let currentActions = null;
|
|
5
|
-
const listeners = new Set();
|
|
6
|
-
function notify() {
|
|
7
|
-
for (const l of listeners)
|
|
8
|
-
l();
|
|
9
|
-
}
|
|
10
|
-
function subscribe(l) {
|
|
11
|
-
listeners.add(l);
|
|
12
|
-
return () => {
|
|
13
|
-
listeners.delete(l);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
/** Consumed only by <Header /> — returns the current title. */
|
|
17
|
-
export function useHeaderTitle() {
|
|
18
|
-
return useSyncExternalStore(subscribe, () => currentTitle, () => currentTitle);
|
|
19
|
-
}
|
|
20
|
-
/** Consumed only by <Header /> — returns the current actions slot. */
|
|
21
|
-
export function useHeaderActions() {
|
|
22
|
-
return useSyncExternalStore(subscribe, () => currentActions, () => currentActions);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Provider is now a no-op wrapper for backwards compatibility — the state
|
|
26
|
-
* lives in the module-level store above. Kept as a component so callers of
|
|
27
|
-
* <HeaderActionsProvider> don't need to change.
|
|
28
|
-
*/
|
|
29
|
-
export const HeaderActionsProvider = ({ children, }) => _jsx(_Fragment, { children: children });
|
|
30
|
-
/** Mount a custom title into the app header. Cleans up on unmount. */
|
|
31
|
-
export function useSetPageTitle(node) {
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
currentTitle = node;
|
|
34
|
-
notify();
|
|
35
|
-
return () => {
|
|
36
|
-
currentTitle = null;
|
|
37
|
-
notify();
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/** Mount ReactNode into the header's actions slot. Cleans up on unmount. */
|
|
42
|
-
export function useSetHeaderActions(node) {
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
currentActions = node;
|
|
45
|
-
notify();
|
|
46
|
-
return () => {
|
|
47
|
-
currentActions = null;
|
|
48
|
-
notify();
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
}
|
|
1
|
+
export * from "@agent-native/toolkit/app-shell";
|
|
52
2
|
//# sourceMappingURL=HeaderActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderActions.js","sourceRoot":"","sources":["../../../src/components/layout/HeaderActions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HeaderActions.js","sourceRoot":"","sources":["../../../src/components/layout/HeaderActions.tsx"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC","sourcesContent":["export * from \"@agent-native/toolkit/app-shell\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAuBL,KAAK,4BAA4B,EAWlC,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EAaL,KAAK,gBAAgB,EAGtB,MAAM,sCAAsC,CAAC;AAgC9C,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":"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"}
|
|
@@ -24,7 +24,6 @@ import { Skeleton } from "../ui/skeleton.js";
|
|
|
24
24
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip.js";
|
|
25
25
|
import { Header } from "./Header.js";
|
|
26
26
|
import { HeaderActionsProvider } from "./HeaderActions.js";
|
|
27
|
-
import { WorkspaceAppsRail } from "./workspace-apps-rail.js";
|
|
28
27
|
const PRIMARY_NAV_ITEMS = [
|
|
29
28
|
{
|
|
30
29
|
id: "overview",
|
|
@@ -336,8 +335,9 @@ function threadUpdatedAt(thread) {
|
|
|
336
335
|
? thread.createdAt
|
|
337
336
|
: 0;
|
|
338
337
|
}
|
|
339
|
-
function DispatchChatsSection({ onNavigate, showNewChat = false, prelude, chatFirstMode = false, chatFirstEmbedded = false, }) {
|
|
338
|
+
function DispatchChatsSection({ onNavigate, showNewChat = false, prelude, chatFirstMode = false, chatFirstEmbedded = false, chatFirstNavigation, }) {
|
|
340
339
|
const t = useT();
|
|
340
|
+
const chatFirstCopy = useMemo(() => createDispatchChatFirstCopy(t), [t]);
|
|
341
341
|
const navigate = useNavigate();
|
|
342
342
|
const location = useLocation();
|
|
343
343
|
const [includeExternal, setIncludeExternal] = useState(false);
|
|
@@ -417,7 +417,7 @@ function DispatchChatsSection({ onNavigate, showNewChat = false, prelude, chatFi
|
|
|
417
417
|
if (threadId)
|
|
418
418
|
openThread(threadId, { isNew: true });
|
|
419
419
|
}
|
|
420
|
-
return (_jsxs("div", { className: cn("ms-4 min-w-0 space-y-0.5", showNewChat && "dispatch-chat-first-chats"), children: [showNewChat ? (
|
|
420
|
+
return (_jsxs("div", { className: cn("ms-4 min-w-0 space-y-0.5", showNewChat && "dispatch-chat-first-chats"), children: [showNewChat && chatFirstNavigation ? (_jsx("nav", { className: "space-y-0.5 px-2 py-2", children: _jsx(ChatFirstPrimaryNavigation, { copy: chatFirstCopy, onNewChat: () => void handleNewChat(), onOpenIntegrations: chatFirstNavigation.onOpenIntegrations, onOpenScheduled: chatFirstNavigation.onOpenScheduled, onSearch: openCommandMenu }) })) : null, prelude, !chatFirstMode ? (_jsx("div", { className: "flex justify-end px-2 pt-0.5", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", "data-dispatch-chat-source-toggle": true, "aria-pressed": includeExternal, "aria-label": includeExternal
|
|
421
421
|
? t("dispatch.sidebar.showLocalChats", {
|
|
422
422
|
defaultValue: "Show local chats",
|
|
423
423
|
})
|
|
@@ -429,7 +429,7 @@ function DispatchChatsSection({ onNavigate, showNewChat = false, prelude, chatFi
|
|
|
429
429
|
})
|
|
430
430
|
: t("dispatch.sidebar.showAllChats", {
|
|
431
431
|
defaultValue: "Show all chats",
|
|
432
|
-
}) })] }) }), !chatFirstMode &&
|
|
432
|
+
}) })] }) })) : null, !chatFirstMode &&
|
|
433
433
|
chatsLoading &&
|
|
434
434
|
visibleThreads.length === 0 &&
|
|
435
435
|
Array.from({ length: 3 }).map((_, index) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1", children: [_jsx(Skeleton, { className: "size-3.5 shrink-0 rounded-sm" }), _jsx(Skeleton, { className: "h-3 w-3/4 rounded" })] }, `chat-skeleton-${index}`))), chatFirstMode ? (_jsx(ChatFirstChatHistory, { items: chatItems, activeId: displayedActiveThreadId, loading: chatsLoading && visibleThreads.length === 0, loadingLabel: _jsx("div", { className: "space-y-1 px-2 py-1", children: [0, 1, 2].map((index) => (_jsxs("div", { className: "flex items-center gap-2 px-1 py-1", children: [_jsx(Skeleton, { className: "size-3.5 shrink-0 rounded-sm" }), _jsx(Skeleton, { className: "h-3 w-3/4 rounded" })] }, index))) }), label: t("dispatch.sidebar.chats", { defaultValue: "Chats" }), onSelect: (threadId) => openThread(threadId), renameMaxLength: 160, onRename: (threadId, title) => void renameThread(threadId, title), labels: {
|
|
@@ -509,16 +509,12 @@ export function NavContent({ onNavigate, extensions, chatFirstMode = false, chat
|
|
|
509
509
|
const searchButton = (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: openCommandMenu, "aria-label": t("sidebar.search"), className: "flex h-8 w-8 items-center justify-center rounded-md text-sidebar-foreground/65 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground", children: _jsx(IconSearch, { className: "h-4 w-4" }) }) }), _jsx(TooltipContent, { side: "right", children: t("sidebar.search") })] }));
|
|
510
510
|
const feedbackButton = (_jsx(FeedbackButton, { variant: collapsed ? "icon" : "sidebar", side: "right", className: collapsed ? "size-8" : "min-w-0" }));
|
|
511
511
|
const chatFirstCreateAppTrigger = (_jsx(CreateAppPopover, { align: "start", trigger: _jsx("button", { type: "button", className: "flex size-6 items-center justify-center rounded text-sidebar-foreground/55 hover:bg-sidebar-accent hover:text-sidebar-foreground", "aria-label": chatFirstCopy("createWorkspaceApp"), title: chatFirstCopy("createWorkspaceApp"), children: _jsx(IconPlus, { size: 14, "aria-hidden": "true" }) }) }));
|
|
512
|
-
const chatFirstPrimaryNavigation = (_jsx(ChatFirstPrimaryNavigation, { copy: chatFirstCopy, onOpenIntegrations: () => {
|
|
513
|
-
navigate(dispatchNavLinkTarget("/admin/integrations"));
|
|
514
|
-
onNavigate?.();
|
|
515
|
-
}, onOpenScheduled: () => {
|
|
516
|
-
navigate(dispatchNavLinkTarget("/admin/automations"));
|
|
517
|
-
onNavigate?.();
|
|
518
|
-
} }));
|
|
519
512
|
const chatFirstAppsRail = (_jsx(ChatFirstAppsRail, { apps: chatFirstApps, activeAppId: chatFirstActiveAppId, collapsed: collapsed, loading: chatFirstAppsLoading, error: chatFirstAppsError, layout: chatFirstAppLayout, onLayoutChange: onChatFirstAppLayoutChange, onRetry: onChatFirstAppsRetry, onOpenApp: (app) => {
|
|
520
513
|
onChatFirstAppOpen?.(app);
|
|
521
514
|
onNavigate?.();
|
|
515
|
+
}, onOpenAllApps: () => {
|
|
516
|
+
navigate(dispatchNavLinkTarget("/apps"));
|
|
517
|
+
onNavigate?.();
|
|
522
518
|
}, createAppTrigger: chatFirstCreateAppTrigger, renderIcon: (app) => (_jsx(AppIcon, { id: app.id, name: app.name, size: "sm", className: "size-5 rounded-md" })), copy: chatFirstCopy }));
|
|
523
519
|
const renderNavItem = (item) => {
|
|
524
520
|
const Icon = item.icon;
|
|
@@ -537,7 +533,7 @@ export function NavContent({ onNavigate, extensions, chatFirstMode = false, chat
|
|
|
537
533
|
return;
|
|
538
534
|
}
|
|
539
535
|
onNavigate?.();
|
|
540
|
-
}, "aria-label": label, className: cn("flex size-9 items-center justify-center rounded-md text-sm", itemMatchesLocalPath
|
|
536
|
+
}, "aria-label": label, "aria-current": itemMatchesLocalPath ? "page" : undefined, className: cn("flex size-9 items-center justify-center rounded-md text-sm", itemMatchesLocalPath
|
|
541
537
|
? "bg-sidebar-accent font-medium text-sidebar-accent-foreground"
|
|
542
538
|
: "text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"), children: Icon ? (_jsx(Icon, { size: 16, className: "shrink-0" })) : (_jsx("span", { className: "h-4 w-4 shrink-0", "aria-hidden": "true" })) }) }), _jsx(TooltipContent, { side: "right", children: label })] })) : (_jsxs(Link, { to: dispatchNavLinkTarget(item.to), onClick: (event) => {
|
|
543
539
|
if (item.id === "chat" &&
|
|
@@ -552,11 +548,23 @@ export function NavContent({ onNavigate, extensions, chatFirstMode = false, chat
|
|
|
552
548
|
return;
|
|
553
549
|
}
|
|
554
550
|
onNavigate?.();
|
|
555
|
-
}, className: cn("flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm", itemMatchesLocalPath
|
|
551
|
+
}, "aria-current": itemMatchesLocalPath ? "page" : undefined, className: cn("flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm", itemMatchesLocalPath
|
|
556
552
|
? "bg-sidebar-accent font-medium text-sidebar-accent-foreground"
|
|
557
553
|
: "text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"), children: [Icon ? (_jsx(Icon, { size: 16, className: "shrink-0" })) : (_jsx("span", { className: "h-4 w-4 shrink-0", "aria-hidden": "true" })), _jsx("span", { className: "truncate", children: label })] })), !collapsed && item.id === "chat" && itemMatchesLocalPath ? (_jsx(DispatchChatsSection, { onNavigate: onNavigate, chatFirstMode: chatFirstMode, chatFirstEmbedded: chatFirstEmbedded })) : null] }, item.id));
|
|
558
554
|
};
|
|
559
|
-
|
|
555
|
+
const bottomNavigation = (_jsx("nav", { className: cn("py-1", collapsed ? "px-1.5" : "px-2"), children: _jsx("ul", { className: cn(collapsed ? "flex flex-col items-center gap-1" : "space-y-0.5"), children: BOTTOM_NAV_ITEMS.map(renderNavItem) }) }));
|
|
556
|
+
const organizationPicker = (_jsx("div", { className: cn("py-2", collapsed ? "flex justify-center px-1" : "px-3"), children: _jsx(OrgSwitcher, { compact: collapsed, reserveSpace: true }) }));
|
|
557
|
+
const sidebarFooterActions = (_jsx(SidebarFooterActions, { collapsed: collapsed, feedback: feedbackButton, search: searchButton, collapse: collapseButton }));
|
|
558
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn("flex h-12 shrink-0 items-center border-b border-sidebar-border", collapsed ? "justify-center px-0" : "px-4"), children: _jsxs("div", { className: cn("flex items-center", collapsed ? "justify-center" : "gap-2"), children: [_jsx("img", { src: appPath("/agent-native-icon-light.svg"), alt: "", "aria-hidden": "true", width: 35, height: 20, className: cn("block shrink-0 object-contain object-center dark:hidden", collapsed ? "h-4 w-7" : "h-5 w-[35px]") }), _jsx("img", { src: appPath("/agent-native-icon-dark.svg"), alt: "", "aria-hidden": "true", width: 35, height: 20, className: cn("hidden shrink-0 object-contain object-center dark:block", collapsed ? "h-4 w-7" : "h-5 w-[35px]") }), !collapsed && (_jsx("div", { className: "min-w-0 flex-1", children: _jsx("div", { "data-dispatch-sidebar-label": true, className: "truncate text-lg font-bold tracking-tight text-foreground", children: DISPATCH_SIDEBAR_LABEL }) }))] }) }), chatFirstMode ? (_jsx("div", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: !collapsed ? (_jsx(DispatchChatsSection, { onNavigate: onNavigate, showNewChat: true, chatFirstMode: true, chatFirstEmbedded: chatFirstEmbedded, chatFirstNavigation: {
|
|
559
|
+
onOpenIntegrations: () => {
|
|
560
|
+
navigate(dispatchNavLinkTarget("/admin/integrations"));
|
|
561
|
+
onNavigate?.();
|
|
562
|
+
},
|
|
563
|
+
onOpenScheduled: () => {
|
|
564
|
+
navigate(dispatchNavLinkTarget("/admin/automations"));
|
|
565
|
+
onNavigate?.();
|
|
566
|
+
},
|
|
567
|
+
}, prelude: chatFirstAppsRail })) : (chatFirstAppsRail) })) : null, _jsxs("div", { className: cn("flex min-h-0 flex-1 flex-col overflow-y-auto", chatFirstMode && "hidden"), children: [_jsx("nav", { className: cn("py-2", collapsed ? "px-1.5" : "px-2"), children: _jsx("ul", { className: cn(collapsed ? "flex flex-col items-center gap-1" : "space-y-0.5"), children: primaryNavItems.map(renderNavItem) }) }), _jsxs("div", { className: "mt-auto shrink-0", children: [bottomNavigation, organizationPicker] }), sidebarFooterActions] }), chatFirstMode ? (_jsxs("div", { className: "mt-auto shrink-0", children: [bottomNavigation, organizationPicker, collapsed ? sidebarFooterActions : null] })) : null] }));
|
|
560
568
|
}
|
|
561
569
|
export function Layout({ children, extensions, agentPageHref, }) {
|
|
562
570
|
const t = useT();
|