@agent-native/dispatch 0.11.1 → 0.11.3
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-catalog.d.ts +2 -2
- package/dist/actions/start-workspace-app-creation.js +1 -1
- package/dist/actions/start-workspace-app-creation.js.map +1 -1
- package/dist/components/create-app-popover.js +3 -3
- package/dist/components/create-app-popover.js.map +1 -1
- package/dist/components/dispatch-control-plane.d.ts +2 -0
- package/dist/components/dispatch-control-plane.d.ts.map +1 -0
- package/dist/components/dispatch-control-plane.js +432 -0
- package/dist/components/dispatch-control-plane.js.map +1 -0
- package/dist/components/layout/Header.d.ts.map +1 -1
- package/dist/components/layout/Header.js +19 -2
- package/dist/components/layout/Header.js.map +1 -1
- package/dist/lib/automations.d.ts +28 -0
- package/dist/lib/automations.d.ts.map +1 -0
- package/dist/lib/automations.js +27 -0
- package/dist/lib/automations.js.map +1 -0
- package/dist/routes/pages/overview.d.ts.map +1 -1
- package/dist/routes/pages/overview.js +3 -213
- package/dist/routes/pages/overview.js.map +1 -1
- package/dist/server/lib/provider-api.d.ts +2 -2
- package/dist/server/plugins/agent-chat.js +1 -1
- package/dist/server/plugins/agent-chat.js.map +1 -1
- package/dist/server/plugins/integrations.js +2 -2
- package/dist/server/plugins/integrations.js.map +1 -1
- package/package.json +2 -2
- package/src/actions/start-workspace-app-creation.ts +1 -1
- package/src/components/create-app-popover.tsx +3 -3
- package/src/components/dispatch-control-plane.tsx +1282 -0
- package/src/components/layout/Header.tsx +22 -1
- package/src/lib/automations.ts +60 -0
- package/src/routes/pages/overview.tsx +2 -755
- package/src/server/plugins/agent-chat.ts +1 -1
- package/src/server/plugins/integrations.ts +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-control-plane.js","sourceRoot":"","sources":["../../src/components/dispatch-control-plane.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ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AS,EAAE,SAAS,GACpB,EAEF,eAAK,SAAS,EAAC,iEAAiE,aAC9E,eAAK,SAAS,EAAC,WAAW,aACxB,eAAK,SAAS,EAAC,2BAA2B,aACxC,KAAC,gBAAgB,KAAG,EACpB,KAAC,SAAS,IAAC,SAAS,EAAE,SAAS,GAAI,IAC/B,EACN,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,GAAI,EACjD,KAAC,sBAAsB,IACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,eAAe,GAC1B,IACE,EAEN,eAAK,SAAS,EAAC,WAAW,aACxB,KAAC,gBAAgB,IACf,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,gBAAgB,CAAC,SAAS,GACrC,EACF,KAAC,kBAAkB,IAAC,MAAM,EAAE,MAAM,GAAI,EACtC,KAAC,cAAc,IACb,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,GACxB,EACD,SAAS,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,CAChC,eAAK,SAAS,EAAC,uFAAuF,aACpG,eAAK,SAAS,EAAC,qCAAqC,aAClD,KAAC,iBAAiB,IAAC,IAAI,EAAE,EAAE,GAAI,qCAE3B,EACN,cAAK,SAAS,EAAC,cAAc,0EAEvB,IACF,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,IACF,IACF,GACQ,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport {\n PromptComposer,\n agentNativePath,\n isInBuilderFrame,\n useActionQuery,\n useChangeVersions,\n useChatModels,\n useChatThreads,\n type ChatThreadSummary,\n} from \"@agent-native/core/client\";\nimport { RunsTray } from \"@agent-native/core/client/progress\";\nimport {\n IconActivity,\n IconAlertTriangle,\n IconArrowUpRight,\n IconBolt,\n IconBroadcast,\n IconCheck,\n IconClockHour4,\n IconListCheck,\n IconMessages,\n IconPlayerPlay,\n IconPlugConnected,\n IconPlus,\n IconRobot,\n IconRocket,\n IconSettingsAutomation,\n IconShieldCheck,\n IconStack3,\n IconUsersGroup,\n type IconProps,\n} from \"@tabler/icons-react\";\nimport { toast } from \"sonner\";\nimport { CreateAppPopover } from \"@/components/create-app-popover\";\nimport { DispatchShell } from \"@/components/dispatch-shell\";\nimport { WorkspaceAppCard } from \"@/components/workspace-app-card\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Switch } from \"@/components/ui/switch\";\nimport { cn } from \"@/lib/utils\";\nimport {\n listDispatchAutomations,\n setDispatchAutomationEnabled,\n type DispatchAutomationItem,\n type SetDispatchAutomationEnabledInput,\n} from \"@/lib/automations\";\nimport { submitOverviewPrompt } from \"@/lib/overview-chat\";\nimport type { ConnectedAgent } from \"@/components/agents-panel\";\nimport type { WorkspaceAppSummary } from \"@/lib/workspace-apps\";\n\ninterface DispatchOverview {\n counts?: {\n destinations?: number;\n pendingApprovals?: number;\n linkedIdentities?: number;\n activeTokens?: number;\n };\n recentApprovals?: Array<{\n id: string;\n summary: string;\n status: string;\n requestedBy?: string;\n }>;\n recentAudit?: RecentAuditEvent[];\n settings?: {\n enabled?: boolean;\n };\n vault?: {\n secretCount?: number;\n activeGrantCount?: number;\n accessMode?: string;\n };\n}\n\ninterface RecentAuditEvent {\n id: string;\n summary: string;\n actor: string;\n action?: string;\n createdAt: string;\n}\n\ninterface TaskQueueRecentFailure {\n id: string;\n platform: string;\n error: string;\n attempts: number;\n}\n\ninterface TaskQueueStats {\n pending: number;\n processing: number;\n completed_last_hour: number;\n failed_last_hour: number;\n oldest_pending_age_seconds: number;\n recent_failures: TaskQueueRecentFailure[];\n}\n\ntype AutomationItem = DispatchAutomationItem;\n\nconst ZERO_TASK_QUEUE_STATS: TaskQueueStats = {\n pending: 0,\n processing: 0,\n completed_last_hour: 0,\n failed_last_hour: 0,\n oldest_pending_age_seconds: 0,\n recent_failures: [],\n};\n\nconst PROMPT_SUGGESTIONS = [\n \"Summarize the current workspace health\",\n \"Create an app for onboarding requests\",\n \"Check which agents can help with analytics\",\n];\n\nconst AUTOMATIONS_QUERY_KEY = [\n \"dispatch-control-plane\",\n \"automations\",\n] as const;\n\nfunction formatNumber(value: number): string {\n return new Intl.NumberFormat(undefined, {\n notation: value >= 10_000 ? \"compact\" : \"standard\",\n maximumFractionDigits: value >= 10_000 ? 1 : 0,\n }).format(value);\n}\n\nfunction formatAgeSeconds(seconds: number): string {\n if (!seconds || seconds < 0) return \"0s\";\n if (seconds < 60) return `${Math.floor(seconds)}s`;\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;\n return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;\n}\n\nfunction timeAgo(value: number | string | null | undefined): string {\n if (value == null || value === \"\") return \"never\";\n const timestamp =\n typeof value === \"number\" ? value : new Date(value).getTime();\n if (!Number.isFinite(timestamp)) return \"never\";\n const diff = Math.max(0, Date.now() - timestamp);\n if (diff < 60_000) return \"now\";\n if (diff < 3_600_000) return `${Math.floor(diff / 60_000)}m`;\n if (diff < 86_400_000) return `${Math.floor(diff / 3_600_000)}h`;\n return `${Math.floor(diff / 86_400_000)}d`;\n}\n\nfunction relativeRunTime(value: string | null | undefined): string {\n if (!value) return \"never\";\n const timestamp = new Date(value).getTime();\n if (!Number.isFinite(timestamp)) return \"never\";\n const diff = timestamp - Date.now();\n const abs = Math.abs(diff);\n const suffix = diff >= 0 ? \"from now\" : \"ago\";\n if (abs < 60_000) return diff >= 0 ? \"soon\" : \"now\";\n if (abs < 3_600_000) return `${Math.floor(abs / 60_000)}m ${suffix}`;\n if (abs < 86_400_000) return `${Math.floor(abs / 3_600_000)}h ${suffix}`;\n return `${Math.floor(abs / 86_400_000)}d ${suffix}`;\n}\n\nfunction dateTimeTitle(value: string | null | undefined): string | undefined {\n if (!value) return undefined;\n const timestamp = new Date(value).getTime();\n if (!Number.isFinite(timestamp)) return undefined;\n return new Intl.DateTimeFormat(undefined, {\n dateStyle: \"medium\",\n timeStyle: \"short\",\n }).format(timestamp);\n}\n\nfunction threadUpdatedAt(thread: ChatThreadSummary): number {\n return Number.isFinite(thread.updatedAt)\n ? thread.updatedAt\n : Number.isFinite(thread.createdAt)\n ? thread.createdAt\n : 0;\n}\n\nfunction threadTitle(thread: ChatThreadSummary): string {\n return thread.title || thread.preview || \"New chat\";\n}\n\nfunction automationTarget(item: AutomationItem): string {\n if (item.triggerType === \"event\" && item.event) return item.event;\n if (item.scheduleDescription) return item.scheduleDescription;\n if (item.schedule) return item.schedule;\n return item.triggerType || \"schedule\";\n}\n\nfunction automationLastRun(item: AutomationItem): string {\n return item.lastRun ? relativeRunTime(item.lastRun) : \"never\";\n}\n\nfunction automationNextRun(item: AutomationItem): string {\n if (!item.enabled) return \"paused\";\n if (item.triggerType === \"event\") return \"on event\";\n return item.nextRun ? relativeRunTime(item.nextRun) : \"not scheduled\";\n}\n\nfunction automationStatus(item: AutomationItem): {\n label: string;\n tone: \"default\" | \"success\" | \"warning\" | \"danger\" | \"muted\";\n} {\n if (!item.enabled) return { label: \"Paused\", tone: \"muted\" };\n if (item.lastStatus === \"error\") return { label: \"Error\", tone: \"danger\" };\n if (item.lastStatus === \"running\")\n return { label: \"Running\", tone: \"warning\" };\n if (item.lastStatus === \"skipped\")\n return { label: \"Skipped\", tone: \"warning\" };\n if (item.lastStatus === \"success\")\n return { label: \"Healthy\", tone: \"success\" };\n return { label: \"Ready\", tone: \"default\" };\n}\n\nfunction automationIdentity(\n item: Pick<AutomationItem, \"owner\" | \"path\">,\n): string {\n return `${item.owner}:${item.path}`;\n}\n\nfunction StatusDot({\n tone = \"default\",\n}: {\n tone?: \"default\" | \"success\" | \"warning\" | \"danger\" | \"muted\";\n}) {\n return (\n <span\n className={cn(\n \"size-2 rounded-full\",\n tone === \"success\" && \"bg-emerald-500\",\n tone === \"warning\" && \"bg-amber-500\",\n tone === \"danger\" && \"bg-destructive\",\n tone === \"muted\" && \"bg-muted-foreground/35\",\n tone === \"default\" && \"bg-primary\",\n )}\n />\n );\n}\n\nfunction useAutomationsStatus() {\n const version = useChangeVersions([\"action\", \"screen-refresh\"]);\n return useQuery<AutomationItem[]>({\n queryKey: [...AUTOMATIONS_QUERY_KEY, version],\n queryFn: listDispatchAutomations,\n placeholderData: (prev) => prev,\n refetchInterval: 15_000,\n staleTime: 5_000,\n });\n}\n\nfunction useToggleAutomation() {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: setDispatchAutomationEnabled,\n onMutate: async (input: SetDispatchAutomationEnabledInput) => {\n await queryClient.cancelQueries({ queryKey: AUTOMATIONS_QUERY_KEY });\n const snapshots = queryClient.getQueriesData<AutomationItem[]>({\n queryKey: AUTOMATIONS_QUERY_KEY,\n });\n\n queryClient.setQueriesData<AutomationItem[]>(\n { queryKey: AUTOMATIONS_QUERY_KEY },\n (rows) =>\n rows?.map((item) =>\n automationIdentity(item) === automationIdentity(input)\n ? { ...item, enabled: input.enabled }\n : item,\n ),\n );\n\n return { snapshots };\n },\n onError: (err, _input, context) => {\n for (const [queryKey, data] of context?.snapshots ?? []) {\n queryClient.setQueryData(queryKey, data);\n }\n toast.error(\n `Could not update automation: ${\n err instanceof Error ? err.message : String(err)\n }`,\n );\n },\n onSuccess: (updated) => {\n queryClient.setQueriesData<AutomationItem[]>(\n { queryKey: AUTOMATIONS_QUERY_KEY },\n (rows) =>\n rows?.map((item) =>\n automationIdentity(item) === automationIdentity(updated)\n ? updated\n : item,\n ),\n );\n },\n onSettled: () => {\n void queryClient.invalidateQueries({ queryKey: AUTOMATIONS_QUERY_KEY });\n },\n });\n}\n\nfunction useTaskQueueStats() {\n return useQuery<TaskQueueStats>({\n queryKey: [\"dispatch-control-plane\", \"task-queue\"],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\"/_agent-native/integrations/task-queue/status\"),\n );\n if (!res.ok) return ZERO_TASK_QUEUE_STATS;\n const stats = await res.json();\n if (!stats || typeof stats !== \"object\") return ZERO_TASK_QUEUE_STATS;\n return {\n pending: Number(stats.pending ?? 0),\n processing: Number(stats.processing ?? 0),\n completed_last_hour: Number(stats.completed_last_hour ?? 0),\n failed_last_hour: Number(stats.failed_last_hour ?? 0),\n oldest_pending_age_seconds: Number(\n stats.oldest_pending_age_seconds ?? 0,\n ),\n recent_failures: Array.isArray(stats.recent_failures)\n ? stats.recent_failures\n : [],\n };\n },\n placeholderData: (prev) => prev,\n refetchInterval: 15_000,\n staleTime: 5_000,\n });\n}\n\nfunction CommandPanel() {\n const { selectedModel } = useChatModels();\n const navigate = useNavigate();\n\n function send(message: string) {\n const trimmed = message.trim();\n if (!trimmed) return;\n\n if (isInBuilderFrame()) {\n submitOverviewPrompt(trimmed, selectedModel);\n return;\n }\n\n navigate(\"/chat\", {\n state: {\n dispatchPrompt: {\n id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n message: trimmed,\n selectedModel,\n },\n },\n });\n }\n\n return (\n <section className=\"rounded-lg border bg-card p-4\">\n <div className=\"mb-3 flex items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2\">\n <IconBroadcast size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Ask Dispatch\n </h2>\n </div>\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/chat\">\n Open chat\n <IconArrowUpRight size={14} />\n </Link>\n </Button>\n </div>\n <PromptComposer\n placeholder=\"Route work, inspect status, or create an app...\"\n onSubmit={(text) => send(text)}\n />\n <div className=\"mt-3 flex flex-wrap gap-2\">\n {PROMPT_SUGGESTIONS.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-md border border-border bg-background px-2.5 py-1.5 text-xs text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </section>\n );\n}\n\nfunction MetricCard({\n label,\n value,\n detail,\n icon: Icon,\n to,\n tone = \"default\",\n}: {\n label: string;\n value: ReactNode;\n detail: string;\n icon: React.ComponentType<IconProps>;\n to?: string;\n tone?: \"default\" | \"success\" | \"warning\" | \"danger\";\n}) {\n const body = (\n <>\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2 text-xs font-medium text-muted-foreground\">\n <Icon size={15} />\n <span className=\"truncate\">{label}</span>\n </div>\n <StatusDot\n tone={\n tone === \"success\"\n ? \"success\"\n : tone === \"warning\"\n ? \"warning\"\n : tone === \"danger\"\n ? \"danger\"\n : \"default\"\n }\n />\n </div>\n <div className=\"mt-3 text-2xl font-semibold tracking-tight text-foreground\">\n {value}\n </div>\n <div className=\"mt-1 truncate text-xs text-muted-foreground\">\n {detail}\n </div>\n </>\n );\n\n const className = cn(\n \"block min-w-0 rounded-lg border bg-card p-4 transition\",\n to && \"hover:border-foreground/30 hover:bg-muted/20\",\n );\n\n if (to) {\n return (\n <Link to={to} className={className}>\n {body}\n </Link>\n );\n }\n\n return <div className={className}>{body}</div>;\n}\n\nfunction ControlPlaneMetrics({\n overview,\n apps,\n agents,\n automations,\n threads,\n taskQueue,\n}: {\n overview?: DispatchOverview;\n apps: WorkspaceAppSummary[];\n agents: ConnectedAgent[];\n automations: AutomationItem[];\n threads: ChatThreadSummary[];\n taskQueue: TaskQueueStats;\n}) {\n const activeApps = apps.filter((app) => !app.isDispatch && !app.archived);\n const pendingApps = activeApps.filter((app) => app.status === \"pending\");\n const enabledAutomations = automations.filter((item) => item.enabled);\n const automationErrors = automations.filter(\n (item) => item.enabled && item.lastStatus === \"error\",\n );\n const pendingApprovals = overview?.counts?.pendingApprovals ?? 0;\n const activeRuns = taskQueue.processing;\n\n return (\n <section className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-6\">\n <MetricCard\n label=\"Chats\"\n value={formatNumber(threads.length)}\n detail={`${threads.filter((thread) => thread.messageCount > 0).length} with messages`}\n icon={IconMessages}\n to=\"/chat\"\n />\n <MetricCard\n label=\"Runs\"\n value={formatNumber(activeRuns)}\n detail={`${formatNumber(taskQueue.pending)} queued`}\n icon={IconPlayerPlay}\n tone={\n taskQueue.failed_last_hour > 0\n ? \"danger\"\n : taskQueue.pending > 5\n ? \"warning\"\n : \"default\"\n }\n />\n <MetricCard\n label=\"Apps\"\n value={formatNumber(activeApps.length)}\n detail={`${formatNumber(pendingApps.length)} building`}\n icon={IconStack3}\n to=\"/apps\"\n tone={pendingApps.length > 0 ? \"warning\" : \"default\"}\n />\n <MetricCard\n label=\"Agents\"\n value={formatNumber(agents.length)}\n detail={`${formatNumber(agents.filter((agent) => agent.source === \"custom\").length)} custom`}\n icon={IconRobot}\n to=\"/agents\"\n />\n <MetricCard\n label=\"Automations\"\n value={formatNumber(enabledAutomations.length)}\n detail={`${formatNumber(automationErrors.length)} need attention`}\n icon={IconSettingsAutomation}\n tone={automationErrors.length > 0 ? \"danger\" : \"success\"}\n />\n <MetricCard\n label=\"Approvals\"\n value={formatNumber(pendingApprovals)}\n detail={\n overview?.settings?.enabled ? \"review mode\" : \"immediate changes\"\n }\n icon={IconShieldCheck}\n to=\"/approvals\"\n tone={pendingApprovals > 0 ? \"warning\" : \"default\"}\n />\n </section>\n );\n}\n\nfunction SectionHeader({\n icon: Icon,\n title,\n detail,\n action,\n}: {\n icon: React.ComponentType<IconProps>;\n title: string;\n detail?: string;\n action?: ReactNode;\n}) {\n return (\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <Icon size={16} className=\"shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {title}\n </h2>\n {detail ? (\n <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {detail}\n </p>\n ) : null}\n </div>\n </div>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n );\n}\n\nfunction RecentChatsPanel() {\n const navigate = useNavigate();\n const { threads, activeThreadId, createThread, switchThread } =\n useChatThreads(undefined, undefined, undefined, { autoCreate: false });\n const [creating, setCreating] = useState(false);\n\n const visibleThreads = useMemo(\n () =>\n threads\n .filter(\n (thread) => thread.messageCount > 0 || thread.id === activeThreadId,\n )\n .sort((a, b) => threadUpdatedAt(b) - threadUpdatedAt(a))\n .slice(0, 5),\n [activeThreadId, threads],\n );\n\n function openThread(threadId: string, isNew = false) {\n switchThread(threadId);\n navigate(\"/chat\", {\n state: {\n dispatchThread: {\n id: `${Date.now()}-${threadId}`,\n threadId,\n },\n },\n });\n window.requestAnimationFrame(() => {\n window.dispatchEvent(\n new CustomEvent(\"agent-chat:open-thread\", {\n detail: { threadId, newThread: isNew },\n }),\n );\n });\n }\n\n async function handleNewChat() {\n setCreating(true);\n try {\n const threadId = await createThread();\n if (threadId) openThread(threadId, true);\n } finally {\n setCreating(false);\n }\n }\n\n return (\n <section className=\"rounded-lg border bg-card p-4\">\n <SectionHeader\n icon={IconMessages}\n title=\"Chats\"\n detail={`${visibleThreads.length} recent`}\n action={\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleNewChat}\n disabled={creating}\n >\n <IconPlus size={14} />\n New\n </Button>\n }\n />\n <div className=\"mt-3 divide-y rounded-md border\">\n {visibleThreads.length > 0 ? (\n visibleThreads.map((thread) => (\n <button\n key={thread.id}\n type=\"button\"\n onClick={() => openThread(thread.id)}\n className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] gap-3 px-3 py-2.5 text-left transition hover:bg-muted/40\"\n >\n <span className=\"min-w-0\">\n <span className=\"block truncate text-sm font-medium text-foreground\">\n {threadTitle(thread)}\n </span>\n <span className=\"mt-0.5 block truncate text-xs text-muted-foreground\">\n {thread.preview || `${thread.messageCount} messages`}\n </span>\n </span>\n <span className=\"text-[11px] text-muted-foreground\">\n {timeAgo(threadUpdatedAt(thread))}\n </span>\n </button>\n ))\n ) : (\n <button\n type=\"button\"\n onClick={handleNewChat}\n className=\"block w-full px-3 py-8 text-center text-sm text-muted-foreground transition hover:bg-muted/40\"\n >\n Start a Dispatch chat\n </button>\n )}\n </div>\n </section>\n );\n}\n\nfunction RunsPanel({ taskQueue }: { taskQueue: TaskQueueStats }) {\n const hasFailure = taskQueue.failed_last_hour > 0;\n const hasBacklog =\n taskQueue.pending > 5 || taskQueue.oldest_pending_age_seconds > 300;\n\n return (\n <section className=\"rounded-lg border bg-card p-4\">\n <SectionHeader\n icon={IconPlayerPlay}\n title=\"Runs\"\n detail={\n hasFailure\n ? `${taskQueue.failed_last_hour} failed in the last hour`\n : `${taskQueue.processing} processing`\n }\n action={\n <RunsTray\n triggerVariant=\"pill\"\n hideWhenIdle={false}\n showRecent\n limit={8}\n />\n }\n />\n <div className=\"mt-3 grid grid-cols-4 gap-2\">\n <QueueCell label=\"Queued\" value={taskQueue.pending} />\n <QueueCell label=\"Active\" value={taskQueue.processing} />\n <QueueCell label=\"Done 1h\" value={taskQueue.completed_last_hour} />\n <QueueCell\n label=\"Failed 1h\"\n value={taskQueue.failed_last_hour}\n danger={hasFailure}\n />\n </div>\n <div\n className={cn(\n \"mt-3 rounded-md border px-3 py-2 text-xs\",\n hasFailure\n ? \"border-destructive/30 bg-destructive/5 text-destructive\"\n : hasBacklog\n ? \"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300\"\n : \"bg-muted/20 text-muted-foreground\",\n )}\n >\n Oldest queued: {formatAgeSeconds(taskQueue.oldest_pending_age_seconds)}\n </div>\n {taskQueue.recent_failures.length > 0 ? (\n <div className=\"mt-3 divide-y rounded-md border\">\n {taskQueue.recent_failures.slice(0, 3).map((failure) => (\n <div key={failure.id} className=\"px-3 py-2\">\n <div className=\"flex items-center justify-between gap-3 text-xs\">\n <span className=\"font-medium text-foreground\">\n {failure.platform}\n </span>\n <span className=\"text-muted-foreground\">\n {failure.attempts} attempts\n </span>\n </div>\n <div className=\"mt-1 truncate text-xs text-muted-foreground\">\n {failure.error || \"(no error message)\"}\n </div>\n </div>\n ))}\n </div>\n ) : null}\n </section>\n );\n}\n\nfunction QueueCell({\n label,\n value,\n danger,\n}: {\n label: string;\n value: number;\n danger?: boolean;\n}) {\n return (\n <div className=\"rounded-md border bg-background px-2 py-2\">\n <div\n className={cn(\n \"text-lg font-semibold text-foreground\",\n danger && \"text-destructive\",\n )}\n >\n {formatNumber(value)}\n </div>\n <div className=\"truncate text-[11px] text-muted-foreground\">{label}</div>\n </div>\n );\n}\n\nfunction AppsPanel({\n apps,\n isLoading,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n}) {\n const visibleApps = apps\n .filter((app) => !app.isDispatch && !app.archived)\n .slice(0, 4);\n const showSkeletons = isLoading && visibleApps.length === 0;\n\n return (\n <section className=\"space-y-3\">\n <SectionHeader\n icon={IconStack3}\n title=\"Projects and apps\"\n detail={`${apps.filter((app) => !app.isDispatch && !app.archived).length} active`}\n action={\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/apps\">\n View all\n <IconArrowUpRight size={14} />\n </Link>\n </Button>\n }\n />\n {showSkeletons ? (\n <div className=\"grid gap-3 md:grid-cols-2\">\n {Array.from({ length: 4 }).map((_, index) => (\n <div key={index} className=\"rounded-lg border bg-card p-4\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"mt-3 h-3 w-24\" />\n <Skeleton className=\"mt-3 h-3 w-full\" />\n </div>\n ))}\n </div>\n ) : visibleApps.length > 0 ? (\n <div className=\"grid gap-3 md:grid-cols-2\">\n {visibleApps.map((app) => (\n <WorkspaceAppCard key={app.id} app={app} className=\"min-h-32\" />\n ))}\n </div>\n ) : (\n <CreateAppPopover />\n )}\n </section>\n );\n}\n\nfunction AutomationsPanel({\n automations,\n isLoading,\n}: {\n automations: AutomationItem[];\n isLoading: boolean;\n}) {\n const toggleAutomation = useToggleAutomation();\n const ordered = useMemo(\n () =>\n [...automations].sort((a, b) => {\n const aError = a.enabled && a.lastStatus === \"error\" ? 1 : 0;\n const bError = b.enabled && b.lastStatus === \"error\" ? 1 : 0;\n if (aError !== bError) return bError - aError;\n return (b.lastRun || \"\").localeCompare(a.lastRun || \"\");\n }),\n [automations],\n );\n const enabled = automations.filter((item) => item.enabled).length;\n const errors = automations.filter(\n (item) => item.enabled && item.lastStatus === \"error\",\n ).length;\n const pendingToggleIdentity = toggleAutomation.isPending\n ? toggleAutomation.variables\n ? automationIdentity(toggleAutomation.variables)\n : null\n : null;\n\n function handleToggle(item: AutomationItem, enabled: boolean) {\n toggleAutomation.mutate({\n owner: item.owner,\n path: item.path,\n enabled,\n });\n }\n\n return (\n <section className=\"rounded-lg border bg-card p-4\">\n <SectionHeader\n icon={IconSettingsAutomation}\n title=\"Automations\"\n detail={`${enabled} enabled · ${errors} errors`}\n action={\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/chat\">\n Create\n <IconArrowUpRight size={14} />\n </Link>\n </Button>\n }\n />\n <div className=\"mt-3 divide-y rounded-md border\">\n {isLoading && ordered.length === 0 ? (\n Array.from({ length: 4 }).map((_, index) => (\n <div key={index} className=\"px-3 py-2.5\">\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"mt-2 h-3 w-28\" />\n </div>\n ))\n ) : ordered.length > 0 ? (\n ordered.slice(0, 6).map((item) => {\n const status = automationStatus(item);\n const canUpdate = item.canUpdate !== false;\n const isToggling =\n pendingToggleIdentity === automationIdentity(item);\n return (\n <div\n key={item.id}\n className=\"grid grid-cols-[minmax(0,1fr)_auto] gap-3 px-3 py-2.5\"\n >\n <div className=\"min-w-0\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <StatusDot tone={status.tone} />\n <span className=\"truncate text-sm font-medium text-foreground\">\n {item.name}\n </span>\n </div>\n <div className=\"mt-1 truncate text-xs text-muted-foreground\">\n {automationTarget(item)}\n </div>\n <div className=\"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground\">\n <span title={dateTimeTitle(item.lastRun)}>\n Last {automationLastRun(item)}\n </span>\n <span title={dateTimeTitle(item.nextRun)}>\n Next {automationNextRun(item)}\n </span>\n </div>\n {item.lastError ? (\n <div className=\"mt-1 truncate text-xs text-destructive\">\n {item.lastError}\n </div>\n ) : null}\n </div>\n <div className=\"flex flex-col items-end gap-1\">\n <Badge\n variant={\n status.tone === \"danger\" ? \"destructive\" : \"outline\"\n }\n className=\"h-5\"\n >\n {status.label}\n </Badge>\n <Switch\n checked={!!item.enabled}\n disabled={!canUpdate || isToggling}\n aria-label={`${item.enabled ? \"Disable\" : \"Enable\"} automation ${item.name}`}\n onCheckedChange={(checked) => handleToggle(item, checked)}\n />\n </div>\n </div>\n );\n })\n ) : (\n <div className=\"px-3 py-8 text-center text-sm text-muted-foreground\">\n No automations yet\n </div>\n )}\n </div>\n </section>\n );\n}\n\nfunction AgentsPanelSummary({ agents }: { agents: ConnectedAgent[] }) {\n const builtin = agents.filter((agent) => agent.source === \"builtin\");\n const extra = agents.filter((agent) => agent.source !== \"builtin\");\n\n return (\n <section className=\"rounded-lg border bg-card p-4\">\n <SectionHeader\n icon={IconPlugConnected}\n title=\"Agents\"\n detail={`${builtin.length} built in · ${extra.length} added`}\n action={\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/agents\">\n Manage\n <IconArrowUpRight size={14} />\n </Link>\n </Button>\n }\n />\n <div className=\"mt-3 flex flex-wrap gap-2\">\n {agents.slice(0, 12).map((agent) => (\n <span\n key={agent.id}\n className=\"inline-flex max-w-full items-center gap-2 rounded-md border bg-background px-2.5 py-1.5 text-xs text-muted-foreground\"\n >\n <span\n className=\"size-2 shrink-0 rounded-full\"\n style={{ backgroundColor: agent.color || \"hsl(var(--primary))\" }}\n />\n <span className=\"truncate\">{agent.name}</span>\n </span>\n ))}\n {agents.length === 0 ? (\n <div className=\"w-full rounded-md border border-dashed px-3 py-6 text-center text-sm text-muted-foreground\">\n No agents detected\n </div>\n ) : null}\n </div>\n </section>\n );\n}\n\nfunction ApprovalsAndAuditPanel({\n overview,\n isLoading,\n}: {\n overview?: DispatchOverview;\n isLoading: boolean;\n}) {\n const approvals = overview?.recentApprovals ?? [];\n const audit = overview?.recentAudit ?? [];\n\n return (\n <section className=\"rounded-lg border bg-card p-4\">\n <SectionHeader\n icon={IconActivity}\n title=\"Activity\"\n detail={`${approvals.length} approvals · ${audit.length} audit rows`}\n action={\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/audit\">\n Audit\n <IconArrowUpRight size={14} />\n </Link>\n </Button>\n }\n />\n <div className=\"mt-3 grid gap-3 lg:grid-cols-2\">\n <div className=\"rounded-md border\">\n <div className=\"flex items-center justify-between gap-3 border-b px-3 py-2\">\n <div className=\"text-xs font-medium uppercase text-muted-foreground\">\n Approvals\n </div>\n <Button variant=\"ghost\" size=\"sm\" asChild>\n <Link to=\"/approvals\">Open</Link>\n </Button>\n </div>\n <div className=\"divide-y\">\n {isLoading && approvals.length === 0 ? (\n Array.from({ length: 3 }).map((_, index) => (\n <div key={index} className=\"px-3 py-2.5\">\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"mt-2 h-3 w-24\" />\n </div>\n ))\n ) : approvals.length > 0 ? (\n approvals.slice(0, 4).map((approval) => (\n <div key={approval.id} className=\"px-3 py-2.5\">\n <div className=\"truncate text-sm font-medium text-foreground\">\n {approval.summary}\n </div>\n <div className=\"mt-1 flex items-center gap-2 text-xs text-muted-foreground\">\n <StatusDot\n tone={approval.status === \"pending\" ? \"warning\" : \"muted\"}\n />\n <span>{approval.status}</span>\n </div>\n </div>\n ))\n ) : (\n <div className=\"px-3 py-8 text-center text-sm text-muted-foreground\">\n No approval requests\n </div>\n )}\n </div>\n </div>\n\n <div className=\"rounded-md border\">\n <div className=\"border-b px-3 py-2 text-xs font-medium uppercase text-muted-foreground\">\n Recent audit\n </div>\n <div className=\"divide-y\">\n {isLoading && audit.length === 0 ? (\n Array.from({ length: 3 }).map((_, index) => (\n <div key={index} className=\"px-3 py-2.5\">\n <Skeleton className=\"h-4 w-44\" />\n <Skeleton className=\"mt-2 h-3 w-28\" />\n </div>\n ))\n ) : audit.length > 0 ? (\n audit.slice(0, 4).map((event) => (\n <div key={event.id} className=\"px-3 py-2.5\">\n <div className=\"truncate text-sm font-medium text-foreground\">\n {event.summary}\n </div>\n <div className=\"mt-1 truncate text-xs text-muted-foreground\">\n {event.actor} · {timeAgo(event.createdAt)}\n </div>\n </div>\n ))\n ) : (\n <div className=\"px-3 py-8 text-center text-sm text-muted-foreground\">\n No audit entries\n </div>\n )}\n </div>\n </div>\n </div>\n </section>\n );\n}\n\nfunction ReadinessPanel({\n overview,\n apps,\n agents,\n automations,\n}: {\n overview?: DispatchOverview;\n apps: WorkspaceAppSummary[];\n agents: ConnectedAgent[];\n automations: AutomationItem[];\n}) {\n const rows = [\n {\n label: \"Vault\",\n detail:\n (overview?.vault?.secretCount ?? 0) > 0\n ? `${overview?.vault?.secretCount ?? 0} secrets`\n : \"no secrets\",\n ok: (overview?.vault?.secretCount ?? 0) > 0,\n to: \"/vault\",\n icon: IconShieldCheck,\n },\n {\n label: \"Apps\",\n detail: `${apps.filter((app) => !app.isDispatch && !app.archived).length} active`,\n ok: apps.some((app) => !app.isDispatch && !app.archived),\n to: \"/apps\",\n icon: IconRocket,\n },\n {\n label: \"Agents\",\n detail: `${agents.length} available`,\n ok: agents.length > 0,\n to: \"/agents\",\n icon: IconRobot,\n },\n {\n label: \"Automations\",\n detail: `${automations.filter((item) => item.enabled).length} enabled`,\n ok: automations.every(\n (item) => !item.enabled || item.lastStatus !== \"error\",\n ),\n to: \"/chat\",\n icon: IconBolt,\n },\n {\n label: \"Team\",\n detail: `${overview?.counts?.linkedIdentities ?? 0} linked identities`,\n ok: (overview?.counts?.linkedIdentities ?? 0) > 0,\n to: \"/team\",\n icon: IconUsersGroup,\n },\n ];\n\n return (\n <section className=\"rounded-lg border bg-card p-4\">\n <SectionHeader icon={IconListCheck} title=\"Readiness\" />\n <div className=\"mt-3 divide-y rounded-md border\">\n {rows.map((row) => {\n const Icon = row.icon;\n return (\n <Link\n key={row.label}\n to={row.to}\n className=\"flex items-center gap-3 px-3 py-2.5 transition hover:bg-muted/40\"\n >\n <span\n className={cn(\n \"flex size-7 shrink-0 items-center justify-center rounded-md border\",\n row.ok\n ? \"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400\"\n : \"bg-background text-muted-foreground\",\n )}\n >\n {row.ok ? <IconCheck size={14} /> : <Icon size={14} />}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-sm font-medium text-foreground\">\n {row.label}\n </span>\n <span className=\"block truncate text-xs text-muted-foreground\">\n {row.detail}\n </span>\n </span>\n <IconArrowUpRight size={14} className=\"text-muted-foreground\" />\n </Link>\n );\n })}\n </div>\n </section>\n );\n}\n\nexport function DispatchControlPlane() {\n const { data: overviewData, isLoading: overviewLoading } =\n useActionQuery<DispatchOverview>(\"list-dispatch-overview\", {});\n const { data: connectedAgents = [] } = useActionQuery<ConnectedAgent[]>(\n \"list-connected-agents\",\n {},\n );\n const { data: workspaceApps = [], isLoading: appsLoading } = useActionQuery<\n WorkspaceAppSummary[]\n >(\n \"list-workspace-apps\",\n { includeAgentCards: false, includeArchived: true },\n { refetchInterval: 2_000 },\n );\n const { threads } = useChatThreads(undefined, undefined, undefined, {\n autoCreate: false,\n });\n const automationsQuery = useAutomationsStatus();\n const taskQueueQuery = useTaskQueueStats();\n\n const overview = overviewData;\n const apps = workspaceApps ?? [];\n const agents = connectedAgents ?? [];\n const automations = automationsQuery.data ?? [];\n const taskQueue = taskQueueQuery.data ?? ZERO_TASK_QUEUE_STATS;\n const visibleThreads = threads.filter((thread) => thread.messageCount > 0);\n\n useEffect(() => {\n const handleRunning = () => {\n void taskQueueQuery.refetch();\n };\n window.addEventListener(\"agentNative.chatRunning\", handleRunning);\n return () => {\n window.removeEventListener(\"agentNative.chatRunning\", handleRunning);\n };\n }, [taskQueueQuery]);\n\n return (\n <DispatchShell\n title=\"Control plane\"\n description=\"Dispatch is the workspace shell for chats, runs, apps, agents, automations, approvals, and resources.\"\n >\n <div className=\"space-y-6\">\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,1.08fr)_minmax(360px,0.92fr)]\">\n <CommandPanel />\n <div className=\"grid gap-3 sm:grid-cols-2\">\n <MetricCard\n label=\"Vault\"\n value={formatNumber(overview?.vault?.secretCount ?? 0)}\n detail={`${formatNumber(overview?.vault?.activeGrantCount ?? 0)} active grants`}\n icon={IconShieldCheck}\n to=\"/vault\"\n tone={\n (overview?.vault?.secretCount ?? 0) > 0 ? \"success\" : \"default\"\n }\n />\n <MetricCard\n label=\"Resources\"\n value={formatNumber(overview?.counts?.destinations ?? 0)}\n detail=\"destinations\"\n icon={IconArrowUpRight}\n to=\"/destinations\"\n />\n </div>\n </div>\n\n <ControlPlaneMetrics\n overview={overview}\n apps={apps}\n agents={agents}\n automations={automations}\n threads={visibleThreads}\n taskQueue={taskQueue}\n />\n\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,1.15fr)_minmax(340px,0.85fr)]\">\n <div className=\"space-y-4\">\n <div className=\"grid gap-4 lg:grid-cols-2\">\n <RecentChatsPanel />\n <RunsPanel taskQueue={taskQueue} />\n </div>\n <AppsPanel apps={apps} isLoading={appsLoading} />\n <ApprovalsAndAuditPanel\n overview={overview}\n isLoading={overviewLoading}\n />\n </div>\n\n <div className=\"space-y-4\">\n <AutomationsPanel\n automations={automations}\n isLoading={automationsQuery.isLoading}\n />\n <AgentsPanelSummary agents={agents} />\n <ReadinessPanel\n overview={overview}\n apps={apps}\n agents={agents}\n automations={automations}\n />\n {taskQueue.failed_last_hour > 0 ? (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive\">\n <div className=\"flex items-center gap-2 font-medium\">\n <IconAlertTriangle size={16} />\n Integration failures detected\n </div>\n <div className=\"mt-1 text-xs\">\n Check credentials, destinations, and recent queue errors.\n </div>\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </DispatchShell>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Header.tsx"],"names":[],"mappings":"AA8BA,wBAAgB,MAAM,CAAC,EACrB,YAAY,EACZ,eAAsB,GACvB,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,2CAqDA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useLocation } from "react-router";
|
|
2
|
+
import { useLocation, useNavigate } from "react-router";
|
|
3
3
|
import { useHeaderTitle, useHeaderActions } from "./HeaderActions.js";
|
|
4
4
|
import { AgentToggleButton } from "@agent-native/core/client";
|
|
5
|
+
import { RunsTray } from "@agent-native/core/client/progress";
|
|
5
6
|
import { Button } from "../../components/ui/button.js";
|
|
6
7
|
import { IconLayoutSidebar } from "@tabler/icons-react";
|
|
7
8
|
const pageTitles = {
|
|
@@ -27,8 +28,24 @@ function resolveTitle(pathname) {
|
|
|
27
28
|
}
|
|
28
29
|
export function Header({ onOpenMobile, showAgentToggle = true, }) {
|
|
29
30
|
const location = useLocation();
|
|
31
|
+
const navigate = useNavigate();
|
|
30
32
|
const title = useHeaderTitle();
|
|
31
33
|
const actions = useHeaderActions();
|
|
32
|
-
|
|
34
|
+
function openRunThread(threadId) {
|
|
35
|
+
navigate("/chat", {
|
|
36
|
+
state: {
|
|
37
|
+
dispatchThread: {
|
|
38
|
+
id: `${Date.now()}-${threadId}`,
|
|
39
|
+
threadId,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
window.requestAnimationFrame(() => {
|
|
44
|
+
window.dispatchEvent(new CustomEvent("agent-chat:open-thread", {
|
|
45
|
+
detail: { threadId },
|
|
46
|
+
}));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return (_jsxs("header", { className: "flex h-12 shrink-0 items-center gap-3 border-b border-border bg-background px-4 lg:px-6", children: [onOpenMobile ? (_jsx(Button, { variant: "ghost", size: "icon", className: "h-8 w-8 lg:hidden cursor-pointer", onClick: onOpenMobile, "aria-label": "Open navigation", children: _jsx(IconLayoutSidebar, {}) })) : null, _jsx("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: title ?? (_jsx("h1", { className: "text-lg font-semibold tracking-tight truncate", children: resolveTitle(location.pathname) })) }), _jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [actions, _jsx(RunsTray, { limit: 8, onOpenThread: openRunThread }), showAgentToggle ? (_jsx(AgentToggleButton, { className: "h-8 w-8 rounded-md hover:bg-accent" })) : null] })] }));
|
|
33
50
|
}
|
|
34
51
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/components/layout/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/components/layout/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,UAAU,GAA2B;IACzC,GA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,YAAY,CAAC,CAAC,CAAC,CACd,KAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,kCAAkC,EAC5C,OAAO,EAAE,YAAY,gBACV,iBAAiB,YAE5B,KAAC,iBAAiB,KAAG,GACd,CACV,CAAC,CAAC,CAAC,IAAI,EACR,cAAK,SAAS,EAAC,wCAAwC,YACpD,KAAK,IAAI,CACR,aAAI,SAAS,EAAC,+CAA+C,YAC1D,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAC7B,CACN,GACG,EACN,eAAK,SAAS,EAAC,kCAAkC,aAC9C,OAAO,EACR,KAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,aAAa,GAAI,EAClD,eAAe,CAAC,CAAC,CAAC,CACjB,KAAC,iBAAiB,IAAC,SAAS,EAAC,oCAAoC,GAAG,CACrE,CAAC,CAAC,CAAC,IAAI,IACJ,IACC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import { useLocation, useNavigate } from \"react-router\";\nimport { useHeaderTitle, useHeaderActions } from \"./HeaderActions\";\nimport { AgentToggleButton } from \"@agent-native/core/client\";\nimport { RunsTray } from \"@agent-native/core/client/progress\";\nimport { Button } from \"@/components/ui/button\";\nimport { IconLayoutSidebar } from \"@tabler/icons-react\";\n\nconst pageTitles: Record<string, string> = {\n \"/\": \"Overview\",\n \"/overview\": \"Overview\",\n \"/vault\": \"Vault\",\n \"/integrations\": \"Integrations\",\n \"/workspace\": \"Resources\",\n \"/messaging\": \"Messaging\",\n \"/agents\": \"Agents\",\n \"/destinations\": \"Destinations\",\n \"/identities\": \"Identities\",\n \"/approvals\": \"Approvals\",\n \"/audit\": \"Audit\",\n \"/team\": \"Team\",\n};\n\nfunction resolveTitle(pathname: string): string {\n if (pageTitles[pathname]) return pageTitles[pathname];\n\n if (pathname.startsWith(\"/extensions\")) return \"Extensions\";\n\n return \"Dispatch\";\n}\n\nexport function Header({\n onOpenMobile,\n showAgentToggle = true,\n}: {\n onOpenMobile?: () => void;\n showAgentToggle?: boolean;\n}) {\n const location = useLocation();\n const navigate = useNavigate();\n const title = useHeaderTitle();\n const actions = useHeaderActions();\n\n function openRunThread(threadId: string) {\n navigate(\"/chat\", {\n state: {\n dispatchThread: {\n id: `${Date.now()}-${threadId}`,\n threadId,\n },\n },\n });\n window.requestAnimationFrame(() => {\n window.dispatchEvent(\n new CustomEvent(\"agent-chat:open-thread\", {\n detail: { threadId },\n }),\n );\n });\n }\n\n return (\n <header className=\"flex h-12 shrink-0 items-center gap-3 border-b border-border bg-background px-4 lg:px-6\">\n {onOpenMobile ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-8 w-8 lg:hidden cursor-pointer\"\n onClick={onOpenMobile}\n aria-label=\"Open navigation\"\n >\n <IconLayoutSidebar />\n </Button>\n ) : null}\n <div className=\"flex items-center gap-3 flex-1 min-w-0\">\n {title ?? (\n <h1 className=\"text-lg font-semibold tracking-tight truncate\">\n {resolveTitle(location.pathname)}\n </h1>\n )}\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {actions}\n <RunsTray limit={8} onOpenThread={openRunThread} />\n {showAgentToggle ? (\n <AgentToggleButton className=\"h-8 w-8 rounded-md hover:bg-accent\" />\n ) : null}\n </div>\n </header>\n );\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface DispatchAutomationItem {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
owner: string;
|
|
6
|
+
canUpdate?: boolean;
|
|
7
|
+
triggerType?: "schedule" | "event" | string;
|
|
8
|
+
event?: string;
|
|
9
|
+
schedule?: string;
|
|
10
|
+
scheduleDescription?: string;
|
|
11
|
+
condition?: string;
|
|
12
|
+
mode?: string;
|
|
13
|
+
domain?: string;
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
lastStatus?: string;
|
|
16
|
+
lastRun?: string;
|
|
17
|
+
lastError?: string;
|
|
18
|
+
nextRun?: string;
|
|
19
|
+
createdBy?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SetDispatchAutomationEnabledInput {
|
|
22
|
+
owner: string;
|
|
23
|
+
path: string;
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function listDispatchAutomations(): Promise<DispatchAutomationItem[]>;
|
|
27
|
+
export declare function setDispatchAutomationEnabled(input: SetDispatchAutomationEnabledInput): Promise<DispatchAutomationItem>;
|
|
28
|
+
//# sourceMappingURL=automations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.d.ts","sourceRoot":"","sources":["../../src/lib/automations.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iCAAiC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAcD,wBAAsB,uBAAuB,IAAI,OAAO,CACtD,sBAAsB,EAAE,CACzB,CAKA;AAED,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,iCAAiC,GACvC,OAAO,CAAC,sBAAsB,CAAC,CAOjC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { agentNativePath } from "@agent-native/core/client";
|
|
2
|
+
async function readAutomationResponse(response) {
|
|
3
|
+
const data = await response.json().catch(() => null);
|
|
4
|
+
if (!response.ok) {
|
|
5
|
+
const message = data && typeof data === "object" && "error" in data
|
|
6
|
+
? String(data.error)
|
|
7
|
+
: "Automation request failed";
|
|
8
|
+
throw new Error(message);
|
|
9
|
+
}
|
|
10
|
+
return data;
|
|
11
|
+
}
|
|
12
|
+
export async function listDispatchAutomations() {
|
|
13
|
+
const response = await fetch(agentNativePath("/_agent-native/automations"));
|
|
14
|
+
if (!response.ok)
|
|
15
|
+
return [];
|
|
16
|
+
const rows = await response.json().catch(() => []);
|
|
17
|
+
return Array.isArray(rows) ? rows : [];
|
|
18
|
+
}
|
|
19
|
+
export async function setDispatchAutomationEnabled(input) {
|
|
20
|
+
const response = await fetch(agentNativePath("/_agent-native/automations"), {
|
|
21
|
+
method: "PATCH",
|
|
22
|
+
headers: { "content-type": "application/json" },
|
|
23
|
+
body: JSON.stringify(input),
|
|
24
|
+
});
|
|
25
|
+
return readAutomationResponse(response);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=automations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.js","sourceRoot":"","sources":["../../src/lib/automations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AA6B5D,KAAK,UAAU,sBAAsB,CAAI,QAAkB;IACzD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,OAAO,GACX,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,IAAI;YACjD,CAAC,CAAC,MAAM,CAAE,IAA4B,CAAC,KAAK,CAAC;YAC7C,CAAC,CAAC,2BAA2B,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,IAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAG3C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,eAAe,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAC5E,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,CAAC;IAC5B,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,KAAwC;IAExC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,eAAe,CAAC,4BAA4B,CAAC,EAAE;QAC1E,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;KAC5B,CAAC,CAAC;IACH,OAAO,sBAAsB,CAAyB,QAAQ,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { agentNativePath } from \"@agent-native/core/client\";\n\nexport interface DispatchAutomationItem {\n id: string;\n name: string;\n path: string;\n owner: string;\n canUpdate?: boolean;\n triggerType?: \"schedule\" | \"event\" | string;\n event?: string;\n schedule?: string;\n scheduleDescription?: string;\n condition?: string;\n mode?: string;\n domain?: string;\n enabled?: boolean;\n lastStatus?: string;\n lastRun?: string;\n lastError?: string;\n nextRun?: string;\n createdBy?: string;\n}\n\nexport interface SetDispatchAutomationEnabledInput {\n owner: string;\n path: string;\n enabled: boolean;\n}\n\nasync function readAutomationResponse<T>(response: Response): Promise<T> {\n const data = await response.json().catch(() => null);\n if (!response.ok) {\n const message =\n data && typeof data === \"object\" && \"error\" in data\n ? String((data as { error?: unknown }).error)\n : \"Automation request failed\";\n throw new Error(message);\n }\n return data as T;\n}\n\nexport async function listDispatchAutomations(): Promise<\n DispatchAutomationItem[]\n> {\n const response = await fetch(agentNativePath(\"/_agent-native/automations\"));\n if (!response.ok) return [];\n const rows = await response.json().catch(() => []);\n return Array.isArray(rows) ? rows : [];\n}\n\nexport async function setDispatchAutomationEnabled(\n input: SetDispatchAutomationEnabledInput,\n): Promise<DispatchAutomationItem> {\n const response = await fetch(agentNativePath(\"/_agent-native/automations\"), {\n method: \"PATCH\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify(input),\n });\n return readAutomationResponse<DispatchAutomationItem>(response);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":"AAEA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,4CAEpC"}
|
|
@@ -1,219 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import {
|
|
3
|
-
import { Link, useNavigate } from "react-router";
|
|
4
|
-
import { PromptComposer, useActionQuery, useChatModels, agentNativePath, isInBuilderFrame, } from "@agent-native/core/client";
|
|
5
|
-
import { IconActivity, IconAlertTriangle, IconApps, IconArrowUpRight, IconCheck, IconClockHour4, IconInfoCircle, IconKey, IconListCheck, IconRocket, IconPlugConnected, IconShieldCheck, } from "@tabler/icons-react";
|
|
6
|
-
import { CreateAppPopover } from "../../components/create-app-popover.js";
|
|
7
|
-
import { DispatchShell } from "../../components/dispatch-shell.js";
|
|
8
|
-
import { WorkspaceAppCard } from "../../components/workspace-app-card.js";
|
|
9
|
-
import { Alert, AlertDescription, AlertTitle } from "../../components/ui/alert.js";
|
|
10
|
-
import { Button } from "../../components/ui/button.js";
|
|
11
|
-
import { Skeleton } from "../../components/ui/skeleton.js";
|
|
12
|
-
import { Tooltip, TooltipContent, TooltipTrigger, } from "../../components/ui/tooltip.js";
|
|
13
|
-
import { submitOverviewPrompt } from "../../lib/overview-chat.js";
|
|
14
|
-
const ZERO_TASK_QUEUE_STATS = {
|
|
15
|
-
pending: 0,
|
|
16
|
-
processing: 0,
|
|
17
|
-
completed_last_hour: 0,
|
|
18
|
-
failed_last_hour: 0,
|
|
19
|
-
oldest_pending_age_seconds: 0,
|
|
20
|
-
recent_failures: [],
|
|
21
|
-
};
|
|
22
|
-
const HOME_CHAT_SUGGESTIONS = [
|
|
23
|
-
"Create a lightweight customer onboarding app",
|
|
24
|
-
"Ask Slides to draft a board update from our latest metrics",
|
|
25
|
-
"Schedule a Monday morning analytics digest",
|
|
26
|
-
];
|
|
27
|
-
function HomeChatPanel() {
|
|
28
|
-
const { selectedModel } = useChatModels();
|
|
29
|
-
const navigate = useNavigate();
|
|
30
|
-
const send = (message) => {
|
|
31
|
-
const trimmed = message.trim();
|
|
32
|
-
if (!trimmed)
|
|
33
|
-
return;
|
|
34
|
-
if (isInBuilderFrame()) {
|
|
35
|
-
submitOverviewPrompt(trimmed, selectedModel);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
navigate("/chat", {
|
|
39
|
-
state: {
|
|
40
|
-
dispatchPrompt: {
|
|
41
|
-
id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
42
|
-
message: trimmed,
|
|
43
|
-
selectedModel,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
return (_jsx("section", { className: "px-2 py-6 sm:py-10", children: _jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: [_jsx("h1", { className: "text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl", children: "What should we do next?" }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PromptComposer, { placeholder: "Message agent\u2026", onSubmit: (text) => {
|
|
49
|
-
send(text);
|
|
50
|
-
} }), _jsx("div", { className: "flex flex-wrap justify-center gap-2", children: HOME_CHAT_SUGGESTIONS.map((suggestion) => (_jsx("button", { type: "button", onClick: () => send(suggestion), className: "cursor-pointer rounded-full border border-border bg-card px-3 py-1.5 text-xs text-muted-foreground transition hover:border-foreground/30 hover:text-foreground", children: suggestion }, suggestion))) })] })] }) }));
|
|
51
|
-
}
|
|
52
|
-
function AppCardSkeleton() {
|
|
53
|
-
return (_jsx("div", { className: "rounded-lg border bg-card p-4", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0 flex-1 space-y-3", children: [_jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-3 w-24" }), _jsxs("div", { className: "space-y-2 pt-1", children: [_jsx(Skeleton, { className: "h-3 w-full" }), _jsx(Skeleton, { className: "h-3 w-2/3" })] })] }), _jsx(Skeleton, { className: "h-5 w-5 rounded-md" })] }) }));
|
|
54
|
-
}
|
|
55
|
-
function RecentActivityList({ isLoading, events, }) {
|
|
56
|
-
if (isLoading && events.length === 0) {
|
|
57
|
-
return (_jsx("div", { className: "mt-4 space-y-3", children: Array.from({ length: 3 }).map((_, index) => (_jsxs("div", { className: "rounded-xl border bg-muted/30 px-4 py-3 space-y-2", children: [_jsx(Skeleton, { className: "h-4 w-3/5" }), _jsx(Skeleton, { className: "h-3 w-2/5" })] }, index))) }));
|
|
58
|
-
}
|
|
59
|
-
if (events.length === 0) {
|
|
60
|
-
return (_jsx("div", { className: "mt-4 space-y-3", children: _jsx("div", { className: "rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground", children: "No activity yet." }) }));
|
|
61
|
-
}
|
|
62
|
-
return (_jsx("div", { className: "mt-4 space-y-3", children: events.map((event) => (_jsxs("div", { className: "rounded-xl border bg-muted/30 px-4 py-3", children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: event.summary }), _jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: [event.actor, " \u00B7 ", new Date(event.createdAt).toLocaleString()] })] }, event.id))) }));
|
|
63
|
-
}
|
|
64
|
-
function WorkspaceAppsSection({ apps, isLoading, }) {
|
|
65
|
-
const filteredApps = apps.filter((app) => !app.isDispatch);
|
|
66
|
-
const visibleApps = filteredApps.slice(0, 6);
|
|
67
|
-
const showSkeletons = isLoading && visibleApps.length === 0;
|
|
68
|
-
return (_jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(IconApps, { size: 16, className: "text-muted-foreground" }), _jsx("h2", { className: "text-sm font-semibold text-foreground", children: "Workspace apps" })] }), _jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsxs(Link, { to: "/apps", children: ["View all", _jsx(IconArrowUpRight, { size: 15, className: "ml-1.5" })] }) })] }), _jsx("div", { className: "grid auto-rows-fr gap-3 sm:grid-cols-2 xl:grid-cols-3", children: showSkeletons ? (Array.from({ length: 6 }).map((_, index) => (_jsx(AppCardSkeleton, {}, index)))) : visibleApps.length > 0 ? (visibleApps.map((app) => (_jsx(WorkspaceAppCard, { app: app, className: "h-full min-h-32" }, app.id)))) : (_jsx(CreateAppPopover, {})) })] }));
|
|
69
|
-
}
|
|
70
|
-
function formatAgeSeconds(seconds) {
|
|
71
|
-
if (!seconds || seconds < 0)
|
|
72
|
-
return "0s";
|
|
73
|
-
if (seconds < 60)
|
|
74
|
-
return `${seconds}s`;
|
|
75
|
-
if (seconds < 3600)
|
|
76
|
-
return `${Math.floor(seconds / 60)}m`;
|
|
77
|
-
return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;
|
|
78
|
-
}
|
|
79
|
-
function TaskQueueMetric({ label, value, tone, icon: Icon, }) {
|
|
80
|
-
const toneClass = tone === "danger"
|
|
81
|
-
? "text-red-600 dark:text-red-400"
|
|
82
|
-
: tone === "warning"
|
|
83
|
-
? "text-amber-600 dark:text-amber-400"
|
|
84
|
-
: "text-foreground";
|
|
85
|
-
return (_jsxs("div", { className: "rounded-xl border bg-card px-4 py-3", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-xs font-medium text-muted-foreground", children: [Icon ? _jsx(Icon, { size: 14 }) : null, _jsx("span", { children: label })] }), _jsx("div", { className: `mt-1 text-2xl font-semibold ${toneClass}`, children: value })] }));
|
|
86
|
-
}
|
|
87
|
-
function TaskQueueSection({ stats }) {
|
|
88
|
-
const showAlert = stats.pending > 5 || stats.failed_last_hour > 0;
|
|
89
|
-
return (_jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(IconListCheck, { size: 16, className: "text-muted-foreground" }), _jsx("h2", { className: "text-sm font-semibold text-foreground", children: "Task queue" })] }), showAlert && (_jsxs(Alert, { variant: stats.failed_last_hour > 0 ? "destructive" : "default", children: [_jsx(IconAlertTriangle, { className: "h-4 w-4" }), _jsx(AlertTitle, { children: stats.failed_last_hour > 0
|
|
90
|
-
? `${stats.failed_last_hour} integration task${stats.failed_last_hour === 1 ? "" : "s"} failed in the last hour`
|
|
91
|
-
: `${stats.pending} pending integration task${stats.pending === 1 ? "" : "s"} queued` }), _jsx(AlertDescription, { children: stats.failed_last_hour > 0
|
|
92
|
-
? "Recent failures are listed below. Check platform credentials and retry."
|
|
93
|
-
: "Tasks are waiting to be processed. The queue may be backed up." })] })), _jsxs("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-5", children: [_jsx(TaskQueueMetric, { label: "Pending", value: stats.pending, tone: stats.pending > 5 ? "warning" : "default" }), _jsx(TaskQueueMetric, { label: "Processing", value: stats.processing }), _jsx(TaskQueueMetric, { label: "Completed (1h)", value: stats.completed_last_hour }), _jsx(TaskQueueMetric, { label: "Failed (1h)", value: stats.failed_last_hour, tone: stats.failed_last_hour > 0 ? "danger" : "default" }), _jsx(TaskQueueMetric, { label: "Oldest pending", value: formatAgeSeconds(stats.oldest_pending_age_seconds), icon: IconClockHour4, tone: stats.oldest_pending_age_seconds > 300 ? "warning" : "default" })] }), stats.recent_failures.length > 0 && (_jsxs("div", { className: "rounded-2xl border bg-card p-4", children: [_jsx("div", { className: "text-sm font-semibold text-foreground", children: "Recent failures" }), _jsx("div", { className: "mt-3 space-y-2", children: stats.recent_failures.map((failure) => (_jsxs("div", { className: "rounded-xl border bg-muted/30 px-3 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2 text-xs text-muted-foreground", children: [_jsx("span", { className: "font-medium text-foreground", children: failure.platform }), _jsxs("span", { children: [failure.attempts, " attempt", failure.attempts === 1 ? "" : "s"] })] }), _jsx("div", { className: "mt-1 truncate text-sm text-foreground", children: failure.error || "(no error message)" })] }, failure.id))) })] }))] }));
|
|
94
|
-
}
|
|
95
|
-
function HelpTooltip({ content }) {
|
|
96
|
-
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "text-muted-foreground/60 hover:text-foreground cursor-pointer", children: _jsx(IconInfoCircle, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { side: "top", className: "max-w-64 text-xs leading-relaxed", children: content })] }));
|
|
97
|
-
}
|
|
98
|
-
function StatCard({ label, help, value, icon: Icon, cta, }) {
|
|
99
|
-
return (_jsxs("div", { className: "min-w-0 rounded-2xl border bg-card p-5", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-sm font-medium leading-snug text-foreground", children: [_jsx("span", { className: "min-w-0", children: label }), _jsx(HelpTooltip, { content: help })] }), _jsx("div", { className: "mt-3 text-3xl font-semibold text-foreground", children: value })] }), _jsx("div", { className: "shrink-0 rounded-xl border bg-muted/30 p-3 text-muted-foreground", children: _jsx(Icon, { size: 18 }) })] }), cta ? _jsx("div", { className: "mt-4", children: cta }) : null] }));
|
|
100
|
-
}
|
|
101
|
-
function StepRow({ step }) {
|
|
102
|
-
const done = step.complete && !step.informational;
|
|
103
|
-
return (_jsxs("div", { className: `flex items-start gap-4 rounded-xl border px-5 py-4 ${done ? "border-border/50 bg-muted/20" : "bg-card"}`, children: [_jsx("div", { className: "flex-none pt-0.5", children: done ? (_jsx("div", { className: "flex h-7 w-7 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400", children: _jsx(IconCheck, { size: 16, strokeWidth: 2.5 }) })) : (_jsx("div", { className: "flex h-7 w-7 items-center justify-center rounded-full border border-muted-foreground/30 text-muted-foreground", children: _jsx(IconListCheck, { size: 15 }) })) }), _jsxs("div", { className: `min-w-0 flex-1 ${done ? "opacity-50" : ""}`, children: [_jsx("div", { className: `text-sm font-semibold ${done ? "line-through decoration-muted-foreground/40" : "text-foreground"}`, children: step.title }), _jsx("p", { className: "mt-0.5 text-sm leading-relaxed text-muted-foreground", children: step.description })] }), step.to && !done && (_jsx("div", { className: "flex-none pt-0.5", children: _jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: step.to, children: step.actionLabel || "Set up" }) }) }))] }));
|
|
104
|
-
}
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DispatchControlPlane } from "../../components/dispatch-control-plane.js";
|
|
105
3
|
export function meta() {
|
|
106
4
|
return [{ title: "Overview — Dispatch" }];
|
|
107
5
|
}
|
|
108
6
|
export default function OverviewRoute() {
|
|
109
|
-
|
|
110
|
-
const { data: connectedAgents } = useActionQuery("list-connected-agents", {});
|
|
111
|
-
const { data: workspaceApps = [], isLoading: appsLoading } = useActionQuery("list-workspace-apps", { includeAgentCards: false }, {
|
|
112
|
-
refetchInterval: 2_000,
|
|
113
|
-
});
|
|
114
|
-
const [integrationStatuses, setIntegrationStatuses] = useState([]);
|
|
115
|
-
const [taskQueueStats, setTaskQueueStats] = useState(ZERO_TASK_QUEUE_STATS);
|
|
116
|
-
useEffect(() => {
|
|
117
|
-
let active = true;
|
|
118
|
-
fetch(agentNativePath("/_agent-native/integrations/status"))
|
|
119
|
-
.then((res) => (res.ok ? res.json() : []))
|
|
120
|
-
.then((rows) => {
|
|
121
|
-
if (active) {
|
|
122
|
-
setIntegrationStatuses(Array.isArray(rows) ? rows : []);
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
.catch(() => {
|
|
126
|
-
if (active)
|
|
127
|
-
setIntegrationStatuses([]);
|
|
128
|
-
});
|
|
129
|
-
return () => {
|
|
130
|
-
active = false;
|
|
131
|
-
};
|
|
132
|
-
}, []);
|
|
133
|
-
useEffect(() => {
|
|
134
|
-
let active = true;
|
|
135
|
-
const load = () => {
|
|
136
|
-
fetch(agentNativePath("/_agent-native/integrations/task-queue/status"))
|
|
137
|
-
.then((res) => (res.ok ? res.json() : null))
|
|
138
|
-
.then((stats) => {
|
|
139
|
-
if (!active || !stats || typeof stats !== "object")
|
|
140
|
-
return;
|
|
141
|
-
setTaskQueueStats({
|
|
142
|
-
pending: Number(stats.pending ?? 0),
|
|
143
|
-
processing: Number(stats.processing ?? 0),
|
|
144
|
-
completed_last_hour: Number(stats.completed_last_hour ?? 0),
|
|
145
|
-
failed_last_hour: Number(stats.failed_last_hour ?? 0),
|
|
146
|
-
oldest_pending_age_seconds: Number(stats.oldest_pending_age_seconds ?? 0),
|
|
147
|
-
recent_failures: Array.isArray(stats.recent_failures)
|
|
148
|
-
? stats.recent_failures
|
|
149
|
-
: [],
|
|
150
|
-
});
|
|
151
|
-
})
|
|
152
|
-
.catch(() => {
|
|
153
|
-
// Endpoint may not exist on older deploys — ignore.
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
load();
|
|
157
|
-
const id = window.setInterval(load, 15000);
|
|
158
|
-
return () => {
|
|
159
|
-
active = false;
|
|
160
|
-
window.clearInterval(id);
|
|
161
|
-
};
|
|
162
|
-
}, []);
|
|
163
|
-
const counts = data?.counts || {
|
|
164
|
-
destinations: 0,
|
|
165
|
-
pendingApprovals: 0,
|
|
166
|
-
linkedIdentities: 0,
|
|
167
|
-
activeTokens: 0,
|
|
168
|
-
};
|
|
169
|
-
const messagingStatuses = useMemo(() => integrationStatuses.filter((row) => row.platform === "slack" || row.platform === "telegram"), [integrationStatuses]);
|
|
170
|
-
const connectedMessagingCount = messagingStatuses.filter((row) => row.enabled || row.configured).length;
|
|
171
|
-
const connectedAgentCount = connectedAgents?.length || 0;
|
|
172
|
-
const vaultSecretCount = data?.vault?.secretCount || 0;
|
|
173
|
-
const typedWorkspaceApps = workspaceApps;
|
|
174
|
-
const messagingDone = connectedMessagingCount > 0;
|
|
175
|
-
const agentsDone = connectedAgentCount > 0;
|
|
176
|
-
const vaultDone = vaultSecretCount > 0;
|
|
177
|
-
const steps = [
|
|
178
|
-
{
|
|
179
|
-
number: 1,
|
|
180
|
-
title: "Connect Slack",
|
|
181
|
-
description: "Add @agent-native to your Slack workspace so your team can ask questions, create decks, pull analytics, and more — right from Slack.",
|
|
182
|
-
complete: messagingDone,
|
|
183
|
-
to: "/messaging",
|
|
184
|
-
actionLabel: "Connect",
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
number: 2,
|
|
188
|
-
title: "Review connected agents",
|
|
189
|
-
description: "Dispatch delegates work to specialized apps. The built-in suite (Slides, Analytics, Content, Video, and more) is available automatically.",
|
|
190
|
-
complete: agentsDone,
|
|
191
|
-
to: "/agents",
|
|
192
|
-
actionLabel: "Review",
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
number: 3,
|
|
196
|
-
title: "Set up your vault",
|
|
197
|
-
description: "Store API keys centrally and sync them to apps that need them.",
|
|
198
|
-
complete: vaultDone,
|
|
199
|
-
to: "/vault",
|
|
200
|
-
actionLabel: "Open vault",
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
number: 4,
|
|
204
|
-
title: "Try it out",
|
|
205
|
-
description: "Mention @agent-native in any Slack channel to get started.",
|
|
206
|
-
complete: false,
|
|
207
|
-
informational: true,
|
|
208
|
-
},
|
|
209
|
-
];
|
|
210
|
-
const hasIncompleteSteps = steps.some((s) => !s.complete && !s.informational);
|
|
211
|
-
return (_jsxs(DispatchShell, { title: "Overview", description: "Create apps, manage shared keys, and route work across your workspace.", children: [_jsx(HomeChatPanel, {}), _jsx(WorkspaceAppsSection, { apps: typedWorkspaceApps, isLoading: appsLoading }), hasIncompleteSteps && (_jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(IconRocket, { size: 16, className: "text-muted-foreground" }), _jsx("h2", { className: "text-sm font-semibold text-foreground", children: "Getting started" })] }), _jsx("div", { className: "space-y-2", children: steps.map((step) => (_jsx(StepRow, { step: step }, step.number))) })] })), _jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(IconActivity, { size: 16, className: "text-muted-foreground" }), _jsx("h2", { className: "text-sm font-semibold text-foreground", children: "At a glance" })] }), _jsxs("div", { className: "grid grid-cols-[repeat(auto-fit,minmax(min(100%,13rem),1fr))] gap-4", children: [_jsx(StatCard, { label: "Vault secrets", help: "Credentials stored in the workspace vault.", value: data?.vault?.secretCount || 0, icon: IconKey, cta: (data?.vault?.secretCount || 0) === 0 ? (_jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/vault", children: "Set up vault" }) })) : undefined }), _jsx(StatCard, { label: data?.vault?.accessMode === "manual"
|
|
212
|
-
? "Active grants"
|
|
213
|
-
: "Accessible keys", help: data?.vault?.accessMode === "manual"
|
|
214
|
-
? "Secrets currently granted to apps. Sync them to push credentials."
|
|
215
|
-
: "Vault keys available to every workspace app.", value: data?.vault?.activeGrantCount || 0, icon: IconShieldCheck }), _jsx(StatCard, { label: "Destinations", help: "Saved outbound targets used for proactive sends and scheduled jobs.", value: counts.destinations, icon: IconArrowUpRight, cta: counts.destinations === 0 ? (_jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/destinations", children: "Set up destinations" }) })) : undefined }), _jsx(StatCard, { label: "Agents", help: "Agents available to dispatch for delegation over A2A. This includes the built-in app suite plus any additional agents you add.", value: connectedAgentCount, icon: IconPlugConnected, cta: connectedAgentCount === 0 ? (_jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/agents", children: "Open agents" }) })) : undefined })] })] }), _jsxs("details", { className: "rounded-xl border", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 px-5 py-4 text-sm font-semibold text-foreground hover:bg-muted/30 [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: "Operations detail" }), _jsx("span", { className: "text-xs font-normal text-muted-foreground", children: "Queue, audit, and approvals" })] }), _jsxs("div", { className: "space-y-5 border-t px-5 py-5", children: [_jsx(TaskQueueSection, { stats: taskQueueStats }), _jsxs("div", { className: "grid gap-4 xl:grid-cols-3", children: [_jsxs("section", { className: "rounded-2xl border bg-card p-5 xl:col-span-2", children: [_jsx("div", { className: "flex items-center justify-between", children: _jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Recent activity" }) }), _jsx(RecentActivityList, { isLoading: isLoading, events: data?.recentAudit ?? [] })] }), _jsxs("section", { className: "rounded-2xl border bg-card p-5", children: [_jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Approval mode" }), _jsxs("div", { className: "mt-4 rounded-xl border bg-muted/30 p-4", children: [_jsx("div", { className: "text-sm font-medium text-muted-foreground", children: "Current policy" }), _jsx("div", { className: "mt-2 text-2xl font-semibold text-foreground", children: data?.settings?.enabled ? "Reviewed" : "Immediate" }), _jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: data?.settings?.enabled
|
|
216
|
-
? "Changes wait for approval before they apply."
|
|
217
|
-
: "Changes apply immediately and are recorded in audit." })] }), _jsxs("div", { className: "mt-4 space-y-2", children: [(data?.recentApprovals || []).map((approval) => (_jsxs("div", { className: "rounded-xl border px-4 py-3", children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: approval.summary }), _jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: [approval.status, " \u00B7 requested by ", approval.requestedBy] })] }, approval.id))), (data?.recentApprovals?.length || 0) === 0 && (_jsx("div", { className: "rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground", children: "No approval requests." }))] })] })] })] })] })] }));
|
|
7
|
+
return _jsx(DispatchControlPlane, {});
|
|
218
8
|
}
|
|
219
9
|
//# sourceMappingURL=overview.js.map
|