@agent-native/dispatch 0.31.14 → 0.31.16
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/provider-api-register.d.ts +7 -7
- package/dist/components/dispatch-control-plane.d.ts.map +1 -1
- package/dist/components/dispatch-control-plane.js +2 -2
- package/dist/components/dispatch-control-plane.js.map +1 -1
- package/dist/components/layout/Layout.d.ts +17 -4
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +45 -20
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/workspace-app-card.d.ts.map +1 -1
- package/dist/components/workspace-app-card.js +18 -1
- package/dist/components/workspace-app-card.js.map +1 -1
- package/dist/lib/catch-all-target.d.ts.map +1 -1
- package/dist/lib/catch-all-target.js +4 -2
- package/dist/lib/catch-all-target.js.map +1 -1
- package/dist/routes/pages/automations.d.ts.map +1 -1
- package/dist/routes/pages/automations.js +19 -16
- package/dist/routes/pages/automations.js.map +1 -1
- package/dist/server/lib/app-creation-store.d.ts.map +1 -1
- package/dist/server/lib/app-creation-store.js +31 -10
- package/dist/server/lib/app-creation-store.js.map +1 -1
- package/package.json +3 -3
- package/src/components/dispatch-control-plane.spec.tsx +3 -1
- package/src/components/dispatch-control-plane.tsx +2 -1
- package/src/components/layout/Layout.spec.tsx +143 -25
- package/src/components/layout/Layout.tsx +79 -47
- package/src/components/workspace-app-card.tsx +27 -1
- package/src/lib/catch-all-target.spec.ts +8 -0
- package/src/lib/catch-all-target.ts +4 -2
- package/src/routes/pages/automations.spec.tsx +240 -0
- package/src/routes/pages/automations.tsx +22 -16
- package/src/server/lib/app-creation-store.spec.ts +42 -15
- package/src/server/lib/app-creation-store.ts +36 -10
- package/src/styles/dispatch-css.spec.ts +3 -0
- package/src/styles/dispatch.css +5 -0
|
@@ -48,7 +48,6 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
48
48
|
scope?: "org" | "user" | undefined;
|
|
49
49
|
}, {
|
|
50
50
|
id?: undefined;
|
|
51
|
-
provider?: undefined;
|
|
52
51
|
deleted?: undefined;
|
|
53
52
|
providers: {
|
|
54
53
|
id: string;
|
|
@@ -60,34 +59,35 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
60
59
|
updatedAt: number;
|
|
61
60
|
}[];
|
|
62
61
|
count: number;
|
|
62
|
+
provider?: undefined;
|
|
63
63
|
found?: undefined;
|
|
64
64
|
registered?: undefined;
|
|
65
65
|
label?: undefined;
|
|
66
66
|
message?: undefined;
|
|
67
67
|
} | {
|
|
68
68
|
id?: undefined;
|
|
69
|
-
count?: undefined;
|
|
70
69
|
deleted?: undefined;
|
|
71
70
|
providers?: undefined;
|
|
71
|
+
count?: undefined;
|
|
72
72
|
found: boolean;
|
|
73
73
|
provider: import("node_modules/@agent-native/core/dist/provider-api").CustomProviderConfig;
|
|
74
74
|
registered?: undefined;
|
|
75
75
|
label?: undefined;
|
|
76
76
|
message?: undefined;
|
|
77
77
|
} | {
|
|
78
|
-
count?: undefined;
|
|
79
|
-
provider?: undefined;
|
|
80
78
|
deleted?: undefined;
|
|
81
79
|
providers?: undefined;
|
|
80
|
+
count?: undefined;
|
|
81
|
+
provider?: undefined;
|
|
82
82
|
found: boolean;
|
|
83
83
|
id: string;
|
|
84
84
|
registered?: undefined;
|
|
85
85
|
label?: undefined;
|
|
86
86
|
message?: undefined;
|
|
87
87
|
} | {
|
|
88
|
+
providers?: undefined;
|
|
88
89
|
count?: undefined;
|
|
89
90
|
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
|
-
count?: undefined;
|
|
99
|
-
provider?: undefined;
|
|
100
98
|
deleted?: undefined;
|
|
101
99
|
providers?: undefined;
|
|
100
|
+
count?: undefined;
|
|
101
|
+
provider?: undefined;
|
|
102
102
|
found?: undefined;
|
|
103
103
|
registered: boolean;
|
|
104
104
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-control-plane.d.ts","sourceRoot":"","sources":["../../src/components/dispatch-control-plane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dispatch-control-plane.d.ts","sourceRoot":"","sources":["../../src/components/dispatch-control-plane.tsx"],"names":[],"mappings":"AAwXA,wBAAgB,oBAAoB,oDAwCnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { navigateWithAgentChatViewTransition, useChatModels, } from "@agent-native/core/client/agent-chat";
|
|
2
|
+
import { chatModelSelectionStorageKey, navigateWithAgentChatViewTransition, useChatModels, } from "@agent-native/core/client/agent-chat";
|
|
3
3
|
import { PromptComposer } from "@agent-native/core/client/composer";
|
|
4
4
|
import { useActionQuery } from "@agent-native/core/client/hooks";
|
|
5
5
|
import { useT } from "@agent-native/core/client/i18n";
|
|
@@ -24,7 +24,7 @@ function SectionHeader({ title, action, }) {
|
|
|
24
24
|
}
|
|
25
25
|
function CommandPanel() {
|
|
26
26
|
const t = useT();
|
|
27
|
-
const { availableModels, isLoading: modelListLoading, onEffortChange, onModelChange, selectedEffort, selectedEngine, selectedModel, } = useChatModels({ storageKey: "dispatch" });
|
|
27
|
+
const { availableModels, isLoading: modelListLoading, onEffortChange, onModelChange, selectedEffort, selectedEngine, selectedModel, } = useChatModels({ storageKey: chatModelSelectionStorageKey("dispatch") });
|
|
28
28
|
const navigate = useNavigate();
|
|
29
29
|
const promptSuggestions = [
|
|
30
30
|
t("dispatch.pages.suggestionOnboardingApp", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-control-plane.js","source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M,qBAAqB,GAAG,cAAc,CAC1C,kCAAkC,EAClC,EAAE,CACH,CAAC;IACF,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IAEvE,OAAO,CACL,eAAK,SAAS,EAAC,qBAAqB,aAClC,KAAC,YAAY,KAAG,EACf,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CACnB,KAAC,gBAAgB,IACf,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC,OAAO,EAAE,GACvC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,SAAS,IACR,IAAI,EAAE,aAAa,IAAI,EAAE,EACzB,SAAS,EAAE,WAAW,EACtB,aAAa,EAAE,kBAAkB,CAAC,IAAI,IAAI,EAAE,EAC5C,kBAAkB,EAAE,kBAAkB,CAAC,KAAK,EAC5C,oBAAoB,EAAE,kBAAkB,CAAC,SAAS,EAClD,oBAAoB,EAAE,GAAG,EAAE,CAAC,KAAK,kBAAkB,CAAC,OAAO,EAAE,EAC7D,gBAAgB,EAAE,qBAAqB,CAAC,IAAI,EAC5C,qBAAqB,EAAE,qBAAqB,CAAC,KAAK,EAClD,uBAAuB,EAAE,qBAAqB,CAAC,SAAS,EACxD,uBAAuB,EAAE,GAAG,EAAE,CAAC,KAAK,qBAAqB,CAAC,OAAO,EAAE,GACnE,CACH,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n navigateWithAgentChatViewTransition,\n useChatModels,\n} from \"@agent-native/core/client/agent-chat\";\nimport { PromptComposer } from \"@agent-native/core/client/composer\";\nimport { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { IconChevronDown, IconClockHour4, IconPlus } from \"@tabler/icons-react\";\nimport type { ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\n\nimport type { ConnectedAppSummary } from \"../lib/other-apps\";\nimport { cn } from \"../lib/utils\";\nimport {\n orderWorkspaceApps,\n useWorkspaceAppLayout,\n workspaceAppMatchesQuery,\n} from \"../lib/workspace-app-layout\";\nimport {\n isWorkspaceAppVisibleInDefaultLaunchers,\n type WorkspaceAppSummary,\n} from \"../lib/workspace-apps\";\nimport { ActionQueryError } from \"./action-query-error\";\nimport {\n APP_LIST_GRID_CLASS,\n AppList,\n APP_LIST_GRID_ROW_CLASS,\n} from \"./app-list-row\";\nimport { CreateAppPopover } from \"./create-app-popover\";\nimport { useSetPageTitle } from \"./layout/HeaderActions\";\nimport { mergeOtherAppEntries, OtherAppsSection } from \"./other-apps-section\";\nimport { Button } from \"./ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"./ui/collapsible\";\nimport { Skeleton } from \"./ui/skeleton\";\nimport { WorkspaceAppCard } from \"./workspace-app-card\";\nimport {\n WorkspaceAppSearch,\n WorkspaceAppSearchEmpty,\n} from \"./workspace-app-search\";\nimport type { CuratedWorkspaceTemplatesResult } from \"./workspace-template-card\";\n\nfunction SectionHeader({\n title,\n action,\n}: {\n title: string;\n action?: ReactNode;\n}) {\n return (\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {title}\n </h2>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n );\n}\n\nfunction CommandPanel() {\n const t = useT();\n const {\n availableModels,\n isLoading: modelListLoading,\n onEffortChange,\n onModelChange,\n selectedEffort,\n selectedEngine,\n selectedModel,\n } = useChatModels({ storageKey: \"dispatch\" });\n const navigate = useNavigate();\n const promptSuggestions = [\n t(\"dispatch.pages.suggestionOnboardingApp\", {\n defaultValue: \"Create an app for onboarding requests\",\n }),\n t(\"dispatch.pages.suggestionAnalyticsAgents\", {\n defaultValue: \"Check which agents can help with analytics\",\n }),\n ];\n\n function send(message: string) {\n const trimmed = message.trim();\n if (!trimmed) return;\n\n navigateWithAgentChatViewTransition(navigate, \"/chat\", {\n state: {\n dispatchPrompt: {\n id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n message: trimmed,\n selectedModel,\n selectedEngine,\n selectedEffort,\n },\n },\n });\n }\n\n return (\n <section className=\"flex flex-col\">\n <div className=\"mx-auto flex w-full max-w-[750px] flex-col pt-4 sm:pt-6\">\n <div className=\"mb-5 text-center\">\n <h2 className=\"text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n {t(\"dispatch.pages.chatAcrossApps\", {\n defaultValue: \"Chat across your apps\",\n })}\n </h2>\n <p className=\"mx-auto mt-2 max-w-xl text-sm leading-6 text-muted-foreground\">\n {t(\"dispatch.pages.chatAcrossAppsDescription\", {\n defaultValue:\n \"Route work, inspect status, or create something new from one place.\",\n })}\n </p>\n </div>\n <PromptComposer\n availableModels={availableModels}\n modelListLoading={modelListLoading}\n placeholder={t(\"dispatch.pages.overviewPromptPlaceholder\", {\n defaultValue: \"Ask Dispatch anything...\",\n })}\n selectedEffort={selectedEffort}\n selectedEngine={selectedEngine}\n selectedModel={selectedModel}\n rootClassName=\"bg-card\"\n onEffortChange={onEffortChange}\n onModelChange={onModelChange}\n onSubmit={(text) => send(text)}\n />\n <div className=\"mt-3 flex flex-wrap justify-center gap-2\">\n {promptSuggestions.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-md border border-transparent bg-muted/60 px-2.5 py-1.5 text-xs text-muted-foreground transition-[background-color,color] hover:bg-muted hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppsPanel({\n apps,\n isLoading,\n connectedApps,\n connectedAppsError,\n connectedAppsLoading,\n onRetryConnectedApps,\n curatedTemplates,\n curatedTemplatesError,\n curatedTemplatesLoading,\n onRetryCuratedTemplates,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n connectedApps: ConnectedAppSummary[];\n connectedAppsError?: Error | null;\n connectedAppsLoading: boolean;\n onRetryConnectedApps: () => void;\n curatedTemplates?: CuratedWorkspaceTemplatesResult;\n curatedTemplatesError?: Error | null;\n curatedTemplatesLoading: boolean;\n onRetryCuratedTemplates: () => void;\n}) {\n const t = useT();\n const [showPending, setShowPending] = useState(false);\n const [searchQuery, setSearchQuery] = useState(\"\");\n const { layout, persistenceError, togglePinned } = useWorkspaceAppLayout();\n const visibleApps = apps.filter(\n (app) => isWorkspaceAppVisibleInDefaultLaunchers(app) && !app.archived,\n );\n const activeApps = visibleApps.filter((app) => app.status !== \"pending\");\n const pendingApps = visibleApps.filter((app) => app.status === \"pending\");\n const orderedActiveApps = orderWorkspaceApps(activeApps, layout);\n const orderedPendingApps = orderWorkspaceApps(pendingApps, layout);\n const filteredActiveApps = orderedActiveApps.filter((app) =>\n workspaceAppMatchesQuery(app, searchQuery),\n );\n const filteredPendingApps = orderedPendingApps.filter((app) =>\n workspaceAppMatchesQuery(app, searchQuery),\n );\n const hasSearchResults =\n filteredActiveApps.length > 0 || filteredPendingApps.length > 0;\n const otherAppEntries = mergeOtherAppEntries({\n templates: curatedTemplates,\n connectedApps,\n workspaceApps: apps,\n });\n const showSkeletons =\n isLoading && activeApps.length === 0 && pendingApps.length === 0;\n\n return (\n <section className=\"mx-auto flex w-full max-w-[1000px] flex-col gap-3\">\n <SectionHeader\n title=\"Apps\"\n action={\n <div className=\"flex min-w-0 flex-wrap items-center justify-end gap-1.5\">\n <Button variant=\"ghost\" size=\"sm\" asChild>\n <Link to=\"/apps\" className=\"text-muted-foreground\">\n View all\n </Link>\n </Button>\n {!showSkeletons && visibleApps.length > 0 ? (\n <WorkspaceAppSearch\n className=\"w-[220px]\"\n query={searchQuery}\n onQueryChange={setSearchQuery}\n />\n ) : null}\n <CreateAppPopover\n align=\"end\"\n trigger={\n <Button variant=\"default\" size=\"sm\" className=\"gap-1.5\">\n <IconPlus size={14} />\n {t(\"dispatch.pages.newApp\", { defaultValue: \"New\" })}\n </Button>\n }\n />\n </div>\n }\n />\n {!showSkeletons && visibleApps.length > 0 && persistenceError ? (\n <p className=\"text-xs text-muted-foreground\" role=\"status\">\n {persistenceError === \"both\"\n ? t(\"dispatch.pages.appPinSaveFailed\", {\n defaultValue: \"App pins could not be saved.\",\n })\n : t(\"dispatch.pages.appPinSavedLocally\", {\n defaultValue: \"App pins are saved on this device only.\",\n })}\n </p>\n ) : null}\n {showSkeletons ? (\n <OverviewAppsSkeleton />\n ) : searchQuery.trim() && !hasSearchResults ? (\n <WorkspaceAppSearchEmpty\n query={searchQuery}\n onClear={() => setSearchQuery(\"\")}\n />\n ) : (\n <>\n <AppList className={APP_LIST_GRID_CLASS}>\n {filteredActiveApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className={APP_LIST_GRID_ROW_CLASS}\n isPinned={layout.pinnedIds.includes(app.id)}\n onTogglePinned={() => togglePinned(app.id)}\n />\n ))}\n {filteredActiveApps.length === 0 &&\n !searchQuery.trim() &&\n otherAppEntries.length === 0 &&\n !curatedTemplatesLoading &&\n !connectedAppsLoading &&\n !curatedTemplatesError &&\n !connectedAppsError ? (\n <p className=\"px-4 py-3 text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noApps\", {\n defaultValue: \"No apps yet.\",\n })}\n </p>\n ) : null}\n {!searchQuery.trim() ? (\n <OtherAppsSection\n templates={curatedTemplates}\n connectedApps={connectedApps}\n workspaceApps={apps}\n templatesLoading={curatedTemplatesLoading}\n connectedAppsLoading={connectedAppsLoading}\n templatesError={curatedTemplatesError}\n connectedAppsError={connectedAppsError}\n onRetryTemplates={onRetryCuratedTemplates}\n onRetryConnectedApps={onRetryConnectedApps}\n heading={null}\n embeddedInList\n />\n ) : null}\n </AppList>\n </>\n )}\n {pendingApps.length > 0 &&\n (!searchQuery.trim() || filteredPendingApps.length > 0) ? (\n <Collapsible\n open={showPending || Boolean(searchQuery.trim())}\n onOpenChange={setShowPending}\n >\n <div className=\"space-y-3 border-t pt-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconClockHour4\n size={15}\n className=\"shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h3 className=\"text-xs font-semibold text-foreground\">\n {t(\"dispatch.pages.pendingApps\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.pendingAppsDescription\", {\n count: pendingApps.length,\n })}\n </p>\n </div>\n </div>\n <CollapsibleTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 gap-1.5 px-2 text-xs\"\n >\n {showPending || Boolean(searchQuery.trim())\n ? t(\"dispatch.pages.hidePendingApps\")\n : t(\"dispatch.pages.showPendingApps\")}\n <IconChevronDown\n size={13}\n className={\n showPending || searchQuery.trim()\n ? \"rotate-180\"\n : undefined\n }\n />\n </Button>\n </CollapsibleTrigger>\n </div>\n <CollapsibleContent>\n <AppList className={APP_LIST_GRID_CLASS}>\n {filteredPendingApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className={APP_LIST_GRID_ROW_CLASS}\n />\n ))}\n </AppList>\n </CollapsibleContent>\n </div>\n </Collapsible>\n ) : null}\n </section>\n );\n}\n\nfunction OverviewAppsSkeleton() {\n return (\n <AppList className={APP_LIST_GRID_CLASS}>\n {Array.from({ length: 4 }).map((_, index) => (\n <div\n key={index}\n className={cn(\n \"flex min-w-0 items-center gap-3 border-b px-4 py-3.5 last:border-b-0\",\n APP_LIST_GRID_ROW_CLASS,\n )}\n >\n <Skeleton className=\"size-8 shrink-0 rounded-xl\" />\n <div className=\"min-w-0 flex-1 space-y-2\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n <Skeleton className=\"h-9 w-24 shrink-0 rounded-md\" />\n </div>\n ))}\n </AppList>\n );\n}\n\nexport function DispatchControlPlane() {\n useSetPageTitle(<span aria-hidden />);\n const appsQuery = useActionQuery<WorkspaceAppSummary[]>(\n \"list-workspace-apps\",\n { includeAgentCards: false, includeArchived: true },\n );\n const connectedAppsQuery = useActionQuery<ConnectedAppSummary[]>(\n \"list-connected-agents\",\n {},\n );\n const curatedTemplatesQuery = useActionQuery<CuratedWorkspaceTemplatesResult>(\n \"list-curated-workspace-templates\",\n {},\n );\n const { data: workspaceApps = [], isLoading: appsLoading } = appsQuery;\n\n return (\n <div className=\"flex flex-col gap-8\">\n <CommandPanel />\n {appsQuery.isError ? (\n <ActionQueryError\n error={appsQuery.error}\n onRetry={() => void appsQuery.refetch()}\n />\n ) : (\n <AppsPanel\n apps={workspaceApps ?? []}\n isLoading={appsLoading}\n connectedApps={connectedAppsQuery.data ?? []}\n connectedAppsError={connectedAppsQuery.error}\n connectedAppsLoading={connectedAppsQuery.isLoading}\n onRetryConnectedApps={() => void connectedAppsQuery.refetch()}\n curatedTemplates={curatedTemplatesQuery.data}\n curatedTemplatesError={curatedTemplatesQuery.error}\n curatedTemplatesLoading={curatedTemplatesQuery.isLoading}\n onRetryCuratedTemplates={() => void curatedTemplatesQuery.refetch()}\n />\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dispatch-control-plane.js","sourceRoot":"","sources":["../../src/components/dispatch-control-plane.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,4BAA4B,EAC5B,mCAAmC,EACnC,aAAa,GACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,C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SAAS,IACR,IAAI,EAAE,aAAa,IAAI,EAAE,EACzB,SAAS,EAAE,WAAW,EACtB,aAAa,EAAE,kBAAkB,CAAC,IAAI,IAAI,EAAE,EAC5C,kBAAkB,EAAE,kBAAkB,CAAC,KAAK,EAC5C,oBAAoB,EAAE,kBAAkB,CAAC,SAAS,EAClD,oBAAoB,EAAE,GAAG,EAAE,CAAC,KAAK,kBAAkB,CAAC,OAAO,EAAE,EAC7D,gBAAgB,EAAE,qBAAqB,CAAC,IAAI,EAC5C,qBAAqB,EAAE,qBAAqB,CAAC,KAAK,EAClD,uBAAuB,EAAE,qBAAqB,CAAC,SAAS,EACxD,uBAAuB,EAAE,GAAG,EAAE,CAAC,KAAK,qBAAqB,CAAC,OAAO,EAAE,GACnE,CACH,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n chatModelSelectionStorageKey,\n navigateWithAgentChatViewTransition,\n useChatModels,\n} from \"@agent-native/core/client/agent-chat\";\nimport { PromptComposer } from \"@agent-native/core/client/composer\";\nimport { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { IconChevronDown, IconClockHour4, IconPlus } from \"@tabler/icons-react\";\nimport type { ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\n\nimport type { ConnectedAppSummary } from \"../lib/other-apps\";\nimport { cn } from \"../lib/utils\";\nimport {\n orderWorkspaceApps,\n useWorkspaceAppLayout,\n workspaceAppMatchesQuery,\n} from \"../lib/workspace-app-layout\";\nimport {\n isWorkspaceAppVisibleInDefaultLaunchers,\n type WorkspaceAppSummary,\n} from \"../lib/workspace-apps\";\nimport { ActionQueryError } from \"./action-query-error\";\nimport {\n APP_LIST_GRID_CLASS,\n AppList,\n APP_LIST_GRID_ROW_CLASS,\n} from \"./app-list-row\";\nimport { CreateAppPopover } from \"./create-app-popover\";\nimport { useSetPageTitle } from \"./layout/HeaderActions\";\nimport { mergeOtherAppEntries, OtherAppsSection } from \"./other-apps-section\";\nimport { Button } from \"./ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"./ui/collapsible\";\nimport { Skeleton } from \"./ui/skeleton\";\nimport { WorkspaceAppCard } from \"./workspace-app-card\";\nimport {\n WorkspaceAppSearch,\n WorkspaceAppSearchEmpty,\n} from \"./workspace-app-search\";\nimport type { CuratedWorkspaceTemplatesResult } from \"./workspace-template-card\";\n\nfunction SectionHeader({\n title,\n action,\n}: {\n title: string;\n action?: ReactNode;\n}) {\n return (\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {title}\n </h2>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n );\n}\n\nfunction CommandPanel() {\n const t = useT();\n const {\n availableModels,\n isLoading: modelListLoading,\n onEffortChange,\n onModelChange,\n selectedEffort,\n selectedEngine,\n selectedModel,\n } = useChatModels({ storageKey: chatModelSelectionStorageKey(\"dispatch\") });\n const navigate = useNavigate();\n const promptSuggestions = [\n t(\"dispatch.pages.suggestionOnboardingApp\", {\n defaultValue: \"Create an app for onboarding requests\",\n }),\n t(\"dispatch.pages.suggestionAnalyticsAgents\", {\n defaultValue: \"Check which agents can help with analytics\",\n }),\n ];\n\n function send(message: string) {\n const trimmed = message.trim();\n if (!trimmed) return;\n\n navigateWithAgentChatViewTransition(navigate, \"/chat\", {\n state: {\n dispatchPrompt: {\n id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n message: trimmed,\n selectedModel,\n selectedEngine,\n selectedEffort,\n },\n },\n });\n }\n\n return (\n <section className=\"flex flex-col\">\n <div className=\"mx-auto flex w-full max-w-[750px] flex-col pt-4 sm:pt-6\">\n <div className=\"mb-5 text-center\">\n <h2 className=\"text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n {t(\"dispatch.pages.chatAcrossApps\", {\n defaultValue: \"Chat across your apps\",\n })}\n </h2>\n <p className=\"mx-auto mt-2 max-w-xl text-sm leading-6 text-muted-foreground\">\n {t(\"dispatch.pages.chatAcrossAppsDescription\", {\n defaultValue:\n \"Route work, inspect status, or create something new from one place.\",\n })}\n </p>\n </div>\n <PromptComposer\n availableModels={availableModels}\n modelListLoading={modelListLoading}\n placeholder={t(\"dispatch.pages.overviewPromptPlaceholder\", {\n defaultValue: \"Ask Dispatch anything...\",\n })}\n selectedEffort={selectedEffort}\n selectedEngine={selectedEngine}\n selectedModel={selectedModel}\n rootClassName=\"bg-card\"\n onEffortChange={onEffortChange}\n onModelChange={onModelChange}\n onSubmit={(text) => send(text)}\n />\n <div className=\"mt-3 flex flex-wrap justify-center gap-2\">\n {promptSuggestions.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-md border border-transparent bg-muted/60 px-2.5 py-1.5 text-xs text-muted-foreground transition-[background-color,color] hover:bg-muted hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppsPanel({\n apps,\n isLoading,\n connectedApps,\n connectedAppsError,\n connectedAppsLoading,\n onRetryConnectedApps,\n curatedTemplates,\n curatedTemplatesError,\n curatedTemplatesLoading,\n onRetryCuratedTemplates,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n connectedApps: ConnectedAppSummary[];\n connectedAppsError?: Error | null;\n connectedAppsLoading: boolean;\n onRetryConnectedApps: () => void;\n curatedTemplates?: CuratedWorkspaceTemplatesResult;\n curatedTemplatesError?: Error | null;\n curatedTemplatesLoading: boolean;\n onRetryCuratedTemplates: () => void;\n}) {\n const t = useT();\n const [showPending, setShowPending] = useState(false);\n const [searchQuery, setSearchQuery] = useState(\"\");\n const { layout, persistenceError, togglePinned } = useWorkspaceAppLayout();\n const visibleApps = apps.filter(\n (app) => isWorkspaceAppVisibleInDefaultLaunchers(app) && !app.archived,\n );\n const activeApps = visibleApps.filter((app) => app.status !== \"pending\");\n const pendingApps = visibleApps.filter((app) => app.status === \"pending\");\n const orderedActiveApps = orderWorkspaceApps(activeApps, layout);\n const orderedPendingApps = orderWorkspaceApps(pendingApps, layout);\n const filteredActiveApps = orderedActiveApps.filter((app) =>\n workspaceAppMatchesQuery(app, searchQuery),\n );\n const filteredPendingApps = orderedPendingApps.filter((app) =>\n workspaceAppMatchesQuery(app, searchQuery),\n );\n const hasSearchResults =\n filteredActiveApps.length > 0 || filteredPendingApps.length > 0;\n const otherAppEntries = mergeOtherAppEntries({\n templates: curatedTemplates,\n connectedApps,\n workspaceApps: apps,\n });\n const showSkeletons =\n isLoading && activeApps.length === 0 && pendingApps.length === 0;\n\n return (\n <section className=\"mx-auto flex w-full max-w-[1000px] flex-col gap-3\">\n <SectionHeader\n title=\"Apps\"\n action={\n <div className=\"flex min-w-0 flex-wrap items-center justify-end gap-1.5\">\n <Button variant=\"ghost\" size=\"sm\" asChild>\n <Link to=\"/apps\" className=\"text-muted-foreground\">\n View all\n </Link>\n </Button>\n {!showSkeletons && visibleApps.length > 0 ? (\n <WorkspaceAppSearch\n className=\"w-[220px]\"\n query={searchQuery}\n onQueryChange={setSearchQuery}\n />\n ) : null}\n <CreateAppPopover\n align=\"end\"\n trigger={\n <Button variant=\"default\" size=\"sm\" className=\"gap-1.5\">\n <IconPlus size={14} />\n {t(\"dispatch.pages.newApp\", { defaultValue: \"New\" })}\n </Button>\n }\n />\n </div>\n }\n />\n {!showSkeletons && visibleApps.length > 0 && persistenceError ? (\n <p className=\"text-xs text-muted-foreground\" role=\"status\">\n {persistenceError === \"both\"\n ? t(\"dispatch.pages.appPinSaveFailed\", {\n defaultValue: \"App pins could not be saved.\",\n })\n : t(\"dispatch.pages.appPinSavedLocally\", {\n defaultValue: \"App pins are saved on this device only.\",\n })}\n </p>\n ) : null}\n {showSkeletons ? (\n <OverviewAppsSkeleton />\n ) : searchQuery.trim() && !hasSearchResults ? (\n <WorkspaceAppSearchEmpty\n query={searchQuery}\n onClear={() => setSearchQuery(\"\")}\n />\n ) : (\n <>\n <AppList className={APP_LIST_GRID_CLASS}>\n {filteredActiveApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className={APP_LIST_GRID_ROW_CLASS}\n isPinned={layout.pinnedIds.includes(app.id)}\n onTogglePinned={() => togglePinned(app.id)}\n />\n ))}\n {filteredActiveApps.length === 0 &&\n !searchQuery.trim() &&\n otherAppEntries.length === 0 &&\n !curatedTemplatesLoading &&\n !connectedAppsLoading &&\n !curatedTemplatesError &&\n !connectedAppsError ? (\n <p className=\"px-4 py-3 text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noApps\", {\n defaultValue: \"No apps yet.\",\n })}\n </p>\n ) : null}\n {!searchQuery.trim() ? (\n <OtherAppsSection\n templates={curatedTemplates}\n connectedApps={connectedApps}\n workspaceApps={apps}\n templatesLoading={curatedTemplatesLoading}\n connectedAppsLoading={connectedAppsLoading}\n templatesError={curatedTemplatesError}\n connectedAppsError={connectedAppsError}\n onRetryTemplates={onRetryCuratedTemplates}\n onRetryConnectedApps={onRetryConnectedApps}\n heading={null}\n embeddedInList\n />\n ) : null}\n </AppList>\n </>\n )}\n {pendingApps.length > 0 &&\n (!searchQuery.trim() || filteredPendingApps.length > 0) ? (\n <Collapsible\n open={showPending || Boolean(searchQuery.trim())}\n onOpenChange={setShowPending}\n >\n <div className=\"space-y-3 border-t pt-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconClockHour4\n size={15}\n className=\"shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h3 className=\"text-xs font-semibold text-foreground\">\n {t(\"dispatch.pages.pendingApps\")}\n </h3>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.pendingAppsDescription\", {\n count: pendingApps.length,\n })}\n </p>\n </div>\n </div>\n <CollapsibleTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 gap-1.5 px-2 text-xs\"\n >\n {showPending || Boolean(searchQuery.trim())\n ? t(\"dispatch.pages.hidePendingApps\")\n : t(\"dispatch.pages.showPendingApps\")}\n <IconChevronDown\n size={13}\n className={\n showPending || searchQuery.trim()\n ? \"rotate-180\"\n : undefined\n }\n />\n </Button>\n </CollapsibleTrigger>\n </div>\n <CollapsibleContent>\n <AppList className={APP_LIST_GRID_CLASS}>\n {filteredPendingApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className={APP_LIST_GRID_ROW_CLASS}\n />\n ))}\n </AppList>\n </CollapsibleContent>\n </div>\n </Collapsible>\n ) : null}\n </section>\n );\n}\n\nfunction OverviewAppsSkeleton() {\n return (\n <AppList className={APP_LIST_GRID_CLASS}>\n {Array.from({ length: 4 }).map((_, index) => (\n <div\n key={index}\n className={cn(\n \"flex min-w-0 items-center gap-3 border-b px-4 py-3.5 last:border-b-0\",\n APP_LIST_GRID_ROW_CLASS,\n )}\n >\n <Skeleton className=\"size-8 shrink-0 rounded-xl\" />\n <div className=\"min-w-0 flex-1 space-y-2\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n <Skeleton className=\"h-9 w-24 shrink-0 rounded-md\" />\n </div>\n ))}\n </AppList>\n );\n}\n\nexport function DispatchControlPlane() {\n useSetPageTitle(<span aria-hidden />);\n const appsQuery = useActionQuery<WorkspaceAppSummary[]>(\n \"list-workspace-apps\",\n { includeAgentCards: false, includeArchived: true },\n );\n const connectedAppsQuery = useActionQuery<ConnectedAppSummary[]>(\n \"list-connected-agents\",\n {},\n );\n const curatedTemplatesQuery = useActionQuery<CuratedWorkspaceTemplatesResult>(\n \"list-curated-workspace-templates\",\n {},\n );\n const { data: workspaceApps = [], isLoading: appsLoading } = appsQuery;\n\n return (\n <div className=\"flex flex-col gap-8\">\n <CommandPanel />\n {appsQuery.isError ? (\n <ActionQueryError\n error={appsQuery.error}\n onRetry={() => void appsQuery.refetch()}\n />\n ) : (\n <AppsPanel\n apps={workspaceApps ?? []}\n isLoading={appsLoading}\n connectedApps={connectedAppsQuery.data ?? []}\n connectedAppsError={connectedAppsQuery.error}\n connectedAppsLoading={connectedAppsQuery.isLoading}\n onRetryConnectedApps={() => void connectedAppsQuery.refetch()}\n curatedTemplates={curatedTemplatesQuery.data}\n curatedTemplatesError={curatedTemplatesQuery.error}\n curatedTemplatesLoading={curatedTemplatesQuery.isLoading}\n onRetryCuratedTemplates={() => void curatedTemplatesQuery.refetch()}\n />\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ChatFirstAppLayoutPreference } from "@agent-native/core/client/agent-chat";
|
|
2
|
-
import { type ChatFirstAppItem, type ChatFirstPrimaryTab } from "@agent-native/core/client/chat-first";
|
|
1
|
+
import { type ChatFirstAppRegistration, type ChatFirstAppLayoutPreference } from "@agent-native/core/client/agent-chat";
|
|
2
|
+
import { type ChatFirstAppItem, type ChatFirstCopy, type ChatFirstPrimaryTab } from "@agent-native/core/client/chat-first";
|
|
3
3
|
import { type ComponentType, type ReactNode } from "react";
|
|
4
4
|
export { buildChatFirstEmbedSessionInput } from "../workspace-app-host.js";
|
|
5
5
|
export type DispatchNavSection = "primary" | "operations";
|
|
@@ -29,18 +29,18 @@ export interface DispatchExtensionConfig {
|
|
|
29
29
|
/** Extra React Query keys to invalidate when Dispatch receives DB sync events. */
|
|
30
30
|
queryKeys?: readonly string[];
|
|
31
31
|
}
|
|
32
|
+
export declare const CHAT_FIRST_SURFACE_PANEL_TOGGLE_CLASS_NAME = "absolute right-3 top-2 z-20";
|
|
32
33
|
export declare function useDispatchExtensions(): DispatchExtensionConfig | undefined;
|
|
33
34
|
export declare function isElectronEmbeddedSearch(search: string): boolean;
|
|
34
35
|
export declare function shouldAutoCollapseDispatchSidebar(pathname: string): boolean;
|
|
35
36
|
export declare function formatThreadAge(updatedAt: number, now?: number): string;
|
|
36
|
-
export declare function NavContent({ onNavigate, extensions, chatFirstMode, chatFirstEmbedded, collapsed, collapsible,
|
|
37
|
+
export declare function NavContent({ onNavigate, extensions, chatFirstMode, chatFirstEmbedded, collapsed, collapsible, onCollapsedChange, chatFirstAppLayout, onChatFirstAppLayoutChange, chatFirstApps, chatFirstAppsLoading, chatFirstAppsError, chatFirstActiveAppId, chatFirstActivePrimaryTab, onChatFirstNewChat, onChatFirstAppOpen, onChatFirstAppsRetry, }: {
|
|
37
38
|
onNavigate?: () => void;
|
|
38
39
|
extensions?: DispatchExtensionConfig;
|
|
39
40
|
chatFirstMode?: boolean;
|
|
40
41
|
chatFirstEmbedded?: boolean;
|
|
41
42
|
collapsed?: boolean;
|
|
42
43
|
collapsible?: boolean;
|
|
43
|
-
reserveEnvironmentBadgeSpace?: boolean;
|
|
44
44
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
45
45
|
chatFirstAppLayout?: ChatFirstAppLayoutPreference;
|
|
46
46
|
onChatFirstAppLayoutChange?: (layout: ChatFirstAppLayoutPreference) => void;
|
|
@@ -53,6 +53,19 @@ export declare function NavContent({ onNavigate, extensions, chatFirstMode, chat
|
|
|
53
53
|
onChatFirstAppOpen?: (app: ChatFirstAppItem) => void;
|
|
54
54
|
onChatFirstAppsRetry?: () => void;
|
|
55
55
|
}): import("node_modules/@types/react").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* Below 768px `ChatFirstSurfacePanel` is already a full-screen overlay
|
|
58
|
+
* (surface-panel.tsx). Mounting the sub-app's own `AgentSidebar` chat rail
|
|
59
|
+
* inside it too would stack a second full-screen shell on top of it, so the
|
|
60
|
+
* rail only gets its own chat surface once there is room beside the panel.
|
|
61
|
+
*/
|
|
62
|
+
export declare function renderChatFirstAppSurfaceTab({ registration, embedPath, loading, isMobileSurface, copy, }: {
|
|
63
|
+
registration: ChatFirstAppRegistration | null;
|
|
64
|
+
embedPath: string;
|
|
65
|
+
loading: boolean;
|
|
66
|
+
isMobileSurface: boolean;
|
|
67
|
+
copy: ChatFirstCopy;
|
|
68
|
+
}): ReactNode;
|
|
56
69
|
export declare function Layout({ children, extensions, agentPageHref, }: {
|
|
57
70
|
children: ReactNode;
|
|
58
71
|
extensions?: DispatchExtensionConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAqBL,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EAYlC,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EAaL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAElB,KAAK,mBAAmB,EACzB,MAAM,sCAAsC,CAAC;AA8B9C,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAgCf,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,YAAY,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,iFAAiF;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,gEAAgE;IAChE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACtC,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;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AAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB,CAAC,EAAE,mBAAmB,CAAC;IAChD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC,mDAmVA;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,YAAY,EACZ,SAAS,EACT,OAAO,EACP,eAAe,EACf,IAAI,GACL,EAAE;IACD,YAAY,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,IAAI,EAAE,aAAa,CAAC;CACrB,GAAG,SAAS,CAsCZ;AAED,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,mDAkoCA"}
|
|
@@ -15,6 +15,7 @@ import { IconApps, IconBrandSlack, IconBrandTelegram, IconCopy, IconEye, IconHie
|
|
|
15
15
|
import { createContext, useEffect, useMemo, useRef, useState, useContext, useCallback, } from "react";
|
|
16
16
|
import { Link, useLocation, useNavigate } from "react-router";
|
|
17
17
|
import { toast } from "sonner";
|
|
18
|
+
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
18
19
|
import { cn } from "../../lib/utils.js";
|
|
19
20
|
import { isDispatchWorkspaceAppId, isPathMountedWorkspaceApp, isWorkspaceAppVisibleInDefaultLaunchers, isWorkspaceSsoApp, mergeChatFirstWorkspaceApps, navigateToWorkspaceApp, workspaceAppIdFromRoute, workspaceAppDirectHref, workspaceAppRoute, } from "../../lib/workspace-apps.js";
|
|
20
21
|
import { CHAT_FIRST_PANE_STATE_KEY } from "../../shared/chat-first-pane.js";
|
|
@@ -76,6 +77,11 @@ const DISPATCH_SIDEBAR_LABEL = "Dispatch";
|
|
|
76
77
|
const CHROMELESS_PATHS = ["/approval", "/browser-chat", "/browser-connect"];
|
|
77
78
|
const SIDEBAR_COLLAPSE_KEY = "dispatch.sidebar.collapsed";
|
|
78
79
|
const CHAT_HISTORY_SOURCE_KEY = "dispatch.chat-history.source";
|
|
80
|
+
// Below 768px, ChatFirstSurfacePanel becomes a max-[767px]:z-10 full-screen
|
|
81
|
+
// overlay (surface-panel.tsx). This toggle is the only way to dismiss it, so
|
|
82
|
+
// its z-index must stay above that overlay in every stacking context or the
|
|
83
|
+
// panel becomes undismissable on mobile.
|
|
84
|
+
export const CHAT_FIRST_SURFACE_PANEL_TOGGLE_CLASS_NAME = "absolute right-3 top-2 z-20";
|
|
79
85
|
const DispatchExtensionsContext = createContext(undefined);
|
|
80
86
|
export function useDispatchExtensions() {
|
|
81
87
|
return useContext(DispatchExtensionsContext);
|
|
@@ -525,7 +531,7 @@ function DispatchChatsSection({ onNavigate, showNewChat = false, prelude, chatFi
|
|
|
525
531
|
});
|
|
526
532
|
}, children: [_jsx(IconEye, { size: 13, strokeWidth: 1.8 }), _jsx("span", { children: "Watch and message session" })] })) : null] })), className: "min-w-0 px-2" })) : null] }));
|
|
527
533
|
}
|
|
528
|
-
export function NavContent({ onNavigate, extensions, chatFirstMode = false, chatFirstEmbedded = false, collapsed = false, collapsible = false,
|
|
534
|
+
export function NavContent({ onNavigate, extensions, chatFirstMode = false, chatFirstEmbedded = false, collapsed = false, collapsible = false, onCollapsedChange, chatFirstAppLayout, onChatFirstAppLayoutChange, chatFirstApps = [], chatFirstAppsLoading = false, chatFirstAppsError, chatFirstActiveAppId, chatFirstActivePrimaryTab, onChatFirstNewChat, onChatFirstAppOpen, onChatFirstAppsRetry, }) {
|
|
529
535
|
const t = useT();
|
|
530
536
|
const chatFirstCopy = useMemo(() => createDispatchChatFirstCopy(t), [t]);
|
|
531
537
|
const location = useLocation();
|
|
@@ -607,13 +613,40 @@ export function NavContent({ onNavigate, extensions, chatFirstMode = false, chat
|
|
|
607
613
|
navigate(dispatchNavLinkTarget("/admin/automations"));
|
|
608
614
|
onNavigate?.();
|
|
609
615
|
},
|
|
610
|
-
}, prelude: chatFirstAppsRail }) })) : null, !chatFirstMode ? (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", 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) }) }) })) : null, _jsxs("div", { className:
|
|
616
|
+
}, prelude: chatFirstAppsRail }) })) : null, !chatFirstMode ? (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", 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) }) }) })) : null, _jsxs("div", { className: "mt-auto shrink-0", "data-dispatch-sidebar-footer": chatFirstMode ? "chat-first" : "standard", children: [bottomNavigation, organizationPicker, sidebarFooterActions] })] }));
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Below 768px `ChatFirstSurfacePanel` is already a full-screen overlay
|
|
620
|
+
* (surface-panel.tsx). Mounting the sub-app's own `AgentSidebar` chat rail
|
|
621
|
+
* inside it too would stack a second full-screen shell on top of it, so the
|
|
622
|
+
* rail only gets its own chat surface once there is room beside the panel.
|
|
623
|
+
*/
|
|
624
|
+
export function renderChatFirstAppSurfaceTab({ registration, embedPath, loading, isMobileSurface, copy, }) {
|
|
625
|
+
if (!registration) {
|
|
626
|
+
return (_jsx(ChatFirstAppPane, { app: null, status: loading ? "loading" : "unresolved", renderEmbed: () => null, copy: copy }));
|
|
627
|
+
}
|
|
628
|
+
if (!embedPath.startsWith("/")) {
|
|
629
|
+
return (_jsx(ChatFirstAppPane, { app: {
|
|
630
|
+
id: registration.id,
|
|
631
|
+
name: registration.name ?? registration.id,
|
|
632
|
+
}, status: "error", errorMessage: copy("appUnavailable"), renderEmbed: () => null, copy: copy }));
|
|
633
|
+
}
|
|
634
|
+
return (_jsx(WorkspaceAppFrame, { app: {
|
|
635
|
+
id: registration.id,
|
|
636
|
+
name: registration.name ?? registration.id,
|
|
637
|
+
path: registration.path,
|
|
638
|
+
url: registration.url,
|
|
639
|
+
}, embedPath: embedPath, chatSidebar: !isMobileSurface, copy: copy }));
|
|
611
640
|
}
|
|
612
641
|
export function Layout({ children, extensions, agentPageHref, }) {
|
|
613
642
|
const t = useT();
|
|
614
643
|
const location = useLocation();
|
|
615
644
|
const navigate = useNavigate();
|
|
616
645
|
const [mobileOpen, setMobileOpen] = useState(false);
|
|
646
|
+
// Drives renderChatFirstSurfaceTab's app-tab chatSidebar decision below —
|
|
647
|
+
// the chat-first surface panel is already a full-screen overlay at this
|
|
648
|
+
// width, so an app tab must not also mount its own full-screen chat rail.
|
|
649
|
+
const isMobileSurface = useIsMobile();
|
|
617
650
|
const [sidebarCollapsed, setSidebarCollapsed] = useState(() => {
|
|
618
651
|
if (typeof window === "undefined")
|
|
619
652
|
return false;
|
|
@@ -1187,22 +1220,13 @@ export function Layout({ children, extensions, agentPageHref, }) {
|
|
|
1187
1220
|
const registration = tab.appId
|
|
1188
1221
|
? (chatFirstAppRegistrations.find((candidate) => candidate.id === tab.appId) ?? null)
|
|
1189
1222
|
: null;
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
name: registration.name ?? registration.id,
|
|
1198
|
-
}, status: "error", errorMessage: chatFirstCopy("appUnavailable"), renderEmbed: () => null, copy: chatFirstCopy }));
|
|
1199
|
-
}
|
|
1200
|
-
return (_jsx(WorkspaceAppFrame, { app: {
|
|
1201
|
-
id: registration.id,
|
|
1202
|
-
name: registration.name ?? registration.id,
|
|
1203
|
-
path: registration.path,
|
|
1204
|
-
url: registration.url,
|
|
1205
|
-
}, embedPath: embedPath, chatSidebar: true, copy: chatFirstCopy }));
|
|
1223
|
+
return renderChatFirstAppSurfaceTab({
|
|
1224
|
+
registration,
|
|
1225
|
+
embedPath: tab.path ?? registration?.path ?? "/",
|
|
1226
|
+
loading: chatFirstAppsQuery.isLoading,
|
|
1227
|
+
isMobileSurface,
|
|
1228
|
+
copy: chatFirstCopy,
|
|
1229
|
+
});
|
|
1206
1230
|
}
|
|
1207
1231
|
if (tab.kind === "browser" && tab.url) {
|
|
1208
1232
|
return (_jsx(ChatFirstBrowserPane, { url: tab.url, title: tab.title, onClose: () => closeChatFirstSurfaceTab(tab), renderEmbed: ({ url, title, key }) => (_jsx("iframe", { src: url, title: title ?? chatFirstCopy("browserPage"), referrerPolicy: "no-referrer", allow: "clipboard-read; clipboard-write", className: "h-full w-full border-0 bg-background" }, key)), copy: chatFirstCopy }));
|
|
@@ -1236,6 +1260,7 @@ export function Layout({ children, extensions, agentPageHref, }) {
|
|
|
1236
1260
|
chatFirstSurfaceTabs.activeTabId,
|
|
1237
1261
|
chatFirstAppRegistrations,
|
|
1238
1262
|
closeChatFirstSurfaceTab,
|
|
1263
|
+
isMobileSurface,
|
|
1239
1264
|
renderChatFirstWatchChat,
|
|
1240
1265
|
]);
|
|
1241
1266
|
if (CHROMELESS_PATHS.some((path) => localPathname === path)) {
|
|
@@ -1257,7 +1282,7 @@ export function Layout({ children, extensions, agentPageHref, }) {
|
|
|
1257
1282
|
t("dispatch.sidebar.suggestionRouteSlack"),
|
|
1258
1283
|
t("dispatch.sidebar.suggestionGrantKey"),
|
|
1259
1284
|
];
|
|
1260
|
-
const appContent = (_jsxs("div", { className: "relative flex h-full min-w-0 flex-1 flex-col overflow-hidden", children: [showHeader ? _jsx(Header, { onOpenMobile: () => setMobileOpen(true) }) : null, _jsx(InvitationBanner, {}), isChatRoute && chatFirstMode && chatFirstHasActiveChat ? (_jsx(ChatFirstSurfacePanelToggle, { open: chatFirstSurfacePanel.open, onToggle: chatFirstSurfacePanel.toggle, className:
|
|
1285
|
+
const appContent = (_jsxs("div", { className: "relative flex h-full min-w-0 flex-1 flex-col overflow-hidden", children: [showHeader ? _jsx(Header, { onOpenMobile: () => setMobileOpen(true) }) : null, _jsx(InvitationBanner, {}), isChatRoute && chatFirstMode && chatFirstHasActiveChat ? (_jsx(ChatFirstSurfacePanelToggle, { open: chatFirstSurfacePanel.open, onToggle: chatFirstSurfacePanel.toggle, className: CHAT_FIRST_SURFACE_PANEL_TOGGLE_CLASS_NAME })) : null, isChatRoute && chatFirstMode && chatFirstNotice ? (_jsxs("div", { className: "dispatch-chat-first-notice", role: "status", "aria-live": "polite", children: [_jsx("span", { children: chatFirstNotice }), _jsx("button", { type: "button", onClick: () => setChatFirstNotice(null), "aria-label": "Dismiss app notice", children: "Dismiss" })] })) : null, _jsx("main", { className: cn("flex-1", isChatRoute || isWorkspaceAppRoute
|
|
1261
1286
|
? "min-h-0 overflow-hidden"
|
|
1262
1287
|
: "overflow-y-auto"), children: showHeader ? (_jsx("div", { className: "mx-auto max-w-7xl space-y-10 px-4 py-6 sm:px-6", children: children })) : (children) })] }));
|
|
1263
1288
|
const chatFirstSurfaceTabsBar = activeChatFirstSurfaceTab?.kind === "app" ? null : (_jsx(ChatFirstSurfaceTabs, { tabs: chatFirstSurfaceTabs.tabs, activeTabId: chatFirstSurfaceTabs.activeTabId, onActivate: activateChatFirstSurfaceTab, onClose: closeChatFirstSurfaceTab, onCloseOthers: (tab) => {
|
|
@@ -1291,7 +1316,7 @@ export function Layout({ children, extensions, agentPageHref, }) {
|
|
|
1291
1316
|
return;
|
|
1292
1317
|
setSidebarCollapsed(true);
|
|
1293
1318
|
openChatFirstApp(app);
|
|
1294
|
-
}, onChatFirstAppsRetry: () => void chatFirstAppsQuery.refetch(), collapsible: true,
|
|
1319
|
+
}, onChatFirstAppsRetry: () => void chatFirstAppsQuery.refetch(), collapsible: true, onCollapsedChange: setSidebarCollapsed }) }), _jsx(Sheet, { open: mobileOpen, onOpenChange: setMobileOpen, children: _jsxs(SheetContent, { side: "left", className: "w-72 bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", children: [_jsx(SheetTitle, { className: "sr-only", children: t("dispatch.nav.navigation") }), _jsx(SheetDescription, { className: "sr-only", children: t("dispatch.nav.navigationDescription") }), _jsx("div", { className: "flex h-full w-full flex-col", children: _jsx(NavContent, { extensions: extensions, chatFirstMode: chatFirstMode, chatFirstEmbedded: chatFirstEmbedded, collapsed: false, chatFirstAppLayout: chatFirstAppLayout, onChatFirstAppLayoutChange: persistChatFirstAppLayout, chatFirstApps: chatFirstAppItems, chatFirstAppsLoading: chatFirstAppsQuery.isLoading, chatFirstAppsError: chatFirstAppsQuery.isError
|
|
1295
1320
|
? chatFirstCopy("appsLoadError")
|
|
1296
1321
|
: null, chatFirstActiveAppId: chatFirstActiveAppId, chatFirstActivePrimaryTab: chatFirstActivePrimaryTab, onChatFirstNewChat: () => {
|
|
1297
1322
|
closeChatFirstSessionWatch();
|