@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview.js","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM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,2BAAkB,QAAQ,CAAC,WAAW,IAClD,KARD,QAAQ,CAAC,EAAE,CASZ,CACP,CAAC,EACD,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAC7C,cAAK,SAAS,EAAC,yEAAyE,sCAElF,CACP,IACG,IACE,IACN,IACF,IACE,IACI,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\nimport {\n PromptComposer,\n useActionQuery,\n useChatModels,\n agentNativePath,\n isInBuilderFrame,\n} from \"@agent-native/core/client\";\nimport {\n IconActivity,\n IconAlertTriangle,\n IconApps,\n IconArrowUpRight,\n IconCheck,\n IconClockHour4,\n IconInfoCircle,\n IconKey,\n IconListCheck,\n IconRocket,\n IconPlugConnected,\n IconShieldCheck,\n type IconProps,\n} from \"@tabler/icons-react\";\nimport { CreateAppPopover } from \"@/components/create-app-popover\";\nimport { DispatchShell } from \"@/components/dispatch-shell\";\nimport { WorkspaceAppCard } from \"@/components/workspace-app-card\";\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\";\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { submitOverviewPrompt } from \"@/lib/overview-chat\";\nimport type { WorkspaceAppSummary } from \"@/lib/workspace-apps\";\n\ninterface IntegrationStatus {\n platform: string;\n label: string;\n enabled: boolean;\n configured: boolean;\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\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 HOME_CHAT_SUGGESTIONS = [\n \"Create a lightweight customer onboarding app\",\n \"Ask Slides to draft a board update from our latest metrics\",\n \"Schedule a Monday morning analytics digest\",\n];\n\nfunction HomeChatPanel() {\n const { selectedModel } = useChatModels();\n const navigate = useNavigate();\n\n const 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=\"px-2 py-6 sm:py-10\">\n <div className=\"mx-auto w-full max-w-2xl space-y-8\">\n <h1 className=\"text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n What should we do next?\n </h1>\n <div className=\"flex flex-col gap-4\">\n <PromptComposer\n placeholder=\"Message agent…\"\n onSubmit={(text) => {\n send(text);\n }}\n />\n <div className=\"flex flex-wrap justify-center gap-2\">\n {HOME_CHAT_SUGGESTIONS.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n 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\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppCardSkeleton() {\n return (\n <div className=\"rounded-lg border bg-card p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-24\" />\n <div className=\"space-y-2 pt-1\">\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n <Skeleton className=\"h-5 w-5 rounded-md\" />\n </div>\n </div>\n );\n}\n\ninterface RecentAuditEvent {\n id: string;\n summary: string;\n actor: string;\n createdAt: string;\n}\n\nfunction RecentActivityList({\n isLoading,\n events,\n}: {\n isLoading: boolean;\n events: RecentAuditEvent[];\n}) {\n if (isLoading && events.length === 0) {\n return (\n <div className=\"mt-4 space-y-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <div\n key={index}\n className=\"rounded-xl border bg-muted/30 px-4 py-3 space-y-2\"\n >\n <Skeleton className=\"h-4 w-3/5\" />\n <Skeleton className=\"h-3 w-2/5\" />\n </div>\n ))}\n </div>\n );\n }\n if (events.length === 0) {\n return (\n <div className=\"mt-4 space-y-3\">\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No activity yet.\n </div>\n </div>\n );\n }\n return (\n <div className=\"mt-4 space-y-3\">\n {events.map((event) => (\n <div key={event.id} className=\"rounded-xl border bg-muted/30 px-4 py-3\">\n <div className=\"text-sm font-medium text-foreground\">\n {event.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {event.actor} · {new Date(event.createdAt).toLocaleString()}\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction WorkspaceAppsSection({\n apps,\n isLoading,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n}) {\n const filteredApps = apps.filter((app) => !app.isDispatch);\n const visibleApps = filteredApps.slice(0, 6);\n const showSkeletons = isLoading && visibleApps.length === 0;\n\n return (\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2\">\n <IconApps size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Workspace apps\n </h2>\n </div>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link to=\"/apps\">\n View all\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </Link>\n </Button>\n </div>\n\n <div className=\"grid auto-rows-fr gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {showSkeletons ? (\n Array.from({ length: 6 }).map((_, index) => (\n <AppCardSkeleton key={index} />\n ))\n ) : visibleApps.length > 0 ? (\n visibleApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className=\"h-full min-h-32\"\n />\n ))\n ) : (\n <CreateAppPopover />\n )}\n </div>\n </section>\n );\n}\n\nfunction formatAgeSeconds(seconds: number): string {\n if (!seconds || seconds < 0) return \"0s\";\n if (seconds < 60) return `${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 TaskQueueMetric({\n label,\n value,\n tone,\n icon: Icon,\n}: {\n label: string;\n value: string | number;\n tone?: \"default\" | \"warning\" | \"danger\";\n icon?: React.ComponentType<IconProps>;\n}) {\n const toneClass =\n tone === \"danger\"\n ? \"text-red-600 dark:text-red-400\"\n : tone === \"warning\"\n ? \"text-amber-600 dark:text-amber-400\"\n : \"text-foreground\";\n return (\n <div className=\"rounded-xl border bg-card px-4 py-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n {Icon ? <Icon size={14} /> : null}\n <span>{label}</span>\n </div>\n <div className={`mt-1 text-2xl font-semibold ${toneClass}`}>{value}</div>\n </div>\n );\n}\n\nfunction TaskQueueSection({ stats }: { stats: TaskQueueStats }) {\n const showAlert = stats.pending > 5 || stats.failed_last_hour > 0;\n return (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconListCheck size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">Task queue</h2>\n </div>\n {showAlert && (\n <Alert variant={stats.failed_last_hour > 0 ? \"destructive\" : \"default\"}>\n <IconAlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>\n {stats.failed_last_hour > 0\n ? `${stats.failed_last_hour} integration task${stats.failed_last_hour === 1 ? \"\" : \"s\"} failed in the last hour`\n : `${stats.pending} pending integration task${stats.pending === 1 ? \"\" : \"s\"} queued`}\n </AlertTitle>\n <AlertDescription>\n {stats.failed_last_hour > 0\n ? \"Recent failures are listed below. Check platform credentials and retry.\"\n : \"Tasks are waiting to be processed. The queue may be backed up.\"}\n </AlertDescription>\n </Alert>\n )}\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-5\">\n <TaskQueueMetric\n label=\"Pending\"\n value={stats.pending}\n tone={stats.pending > 5 ? \"warning\" : \"default\"}\n />\n <TaskQueueMetric label=\"Processing\" value={stats.processing} />\n <TaskQueueMetric\n label=\"Completed (1h)\"\n value={stats.completed_last_hour}\n />\n <TaskQueueMetric\n label=\"Failed (1h)\"\n value={stats.failed_last_hour}\n tone={stats.failed_last_hour > 0 ? \"danger\" : \"default\"}\n />\n <TaskQueueMetric\n label=\"Oldest pending\"\n value={formatAgeSeconds(stats.oldest_pending_age_seconds)}\n icon={IconClockHour4}\n tone={stats.oldest_pending_age_seconds > 300 ? \"warning\" : \"default\"}\n />\n </div>\n {stats.recent_failures.length > 0 && (\n <div className=\"rounded-2xl border bg-card p-4\">\n <div className=\"text-sm font-semibold text-foreground\">\n Recent failures\n </div>\n <div className=\"mt-3 space-y-2\">\n {stats.recent_failures.map((failure) => (\n <div\n key={failure.id}\n className=\"rounded-xl border bg-muted/30 px-3 py-2\"\n >\n <div className=\"flex items-center justify-between gap-2 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">\n {failure.platform}\n </span>\n <span>\n {failure.attempts} attempt\n {failure.attempts === 1 ? \"\" : \"s\"}\n </span>\n </div>\n <div className=\"mt-1 truncate text-sm text-foreground\">\n {failure.error || \"(no error message)\"}\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n </section>\n );\n}\n\nfunction HelpTooltip({ content }: { content: string }) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className=\"text-muted-foreground/60 hover:text-foreground cursor-pointer\"\n >\n <IconInfoCircle className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-64 text-xs leading-relaxed\">\n {content}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction StatCard({\n label,\n help,\n value,\n icon: Icon,\n cta,\n}: {\n label: string;\n help: string;\n value: number;\n icon: React.ComponentType<IconProps>;\n cta?: React.ReactNode;\n}) {\n return (\n <div className=\"min-w-0 rounded-2xl border bg-card p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-1.5 text-sm font-medium leading-snug text-foreground\">\n <span className=\"min-w-0\">{label}</span>\n <HelpTooltip content={help} />\n </div>\n <div className=\"mt-3 text-3xl font-semibold text-foreground\">\n {value}\n </div>\n </div>\n <div className=\"shrink-0 rounded-xl border bg-muted/30 p-3 text-muted-foreground\">\n <Icon size={18} />\n </div>\n </div>\n {cta ? <div className=\"mt-4\">{cta}</div> : null}\n </div>\n );\n}\n\ninterface ChecklistStep {\n number: number;\n title: string;\n description: string;\n complete: boolean;\n /** If set, renders a link button to this path */\n to?: string;\n actionLabel?: string;\n /** If true, this step is always shown as informational (never \"complete\") */\n informational?: boolean;\n}\n\nfunction StepRow({ step }: { step: ChecklistStep }) {\n const done = step.complete && !step.informational;\n\n return (\n <div\n className={`flex items-start gap-4 rounded-xl border px-5 py-4 ${done ? \"border-border/50 bg-muted/20\" : \"bg-card\"}`}\n >\n {/* Status marker */}\n <div className=\"flex-none pt-0.5\">\n {done ? (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400\">\n <IconCheck size={16} strokeWidth={2.5} />\n </div>\n ) : (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full border border-muted-foreground/30 text-muted-foreground\">\n <IconListCheck size={15} />\n </div>\n )}\n </div>\n\n {/* Text */}\n <div className={`min-w-0 flex-1 ${done ? \"opacity-50\" : \"\"}`}>\n <div\n className={`text-sm font-semibold ${done ? \"line-through decoration-muted-foreground/40\" : \"text-foreground\"}`}\n >\n {step.title}\n </div>\n <p className=\"mt-0.5 text-sm leading-relaxed text-muted-foreground\">\n {step.description}\n </p>\n </div>\n\n {/* Action */}\n {step.to && !done && (\n <div className=\"flex-none pt-0.5\">\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to={step.to}>{step.actionLabel || \"Set up\"}</Link>\n </Button>\n </div>\n )}\n </div>\n );\n}\n\nexport function meta() {\n return [{ title: \"Overview — Dispatch\" }];\n}\n\nexport default function OverviewRoute() {\n const { data, isLoading } = useActionQuery(\"list-dispatch-overview\", {});\n const { data: connectedAgents } = useActionQuery(\"list-connected-agents\", {});\n const { data: workspaceApps = [], isLoading: appsLoading } = useActionQuery(\n \"list-workspace-apps\",\n { includeAgentCards: false },\n {\n refetchInterval: 2_000,\n },\n );\n const [integrationStatuses, setIntegrationStatuses] = useState<\n IntegrationStatus[]\n >([]);\n const [taskQueueStats, setTaskQueueStats] = useState<TaskQueueStats>(\n ZERO_TASK_QUEUE_STATS,\n );\n\n useEffect(() => {\n let active = true;\n fetch(agentNativePath(\"/_agent-native/integrations/status\"))\n .then((res) => (res.ok ? res.json() : []))\n .then((rows) => {\n if (active) {\n setIntegrationStatuses(Array.isArray(rows) ? rows : []);\n }\n })\n .catch(() => {\n if (active) setIntegrationStatuses([]);\n });\n return () => {\n active = false;\n };\n }, []);\n\n useEffect(() => {\n let active = true;\n const load = () => {\n fetch(agentNativePath(\"/_agent-native/integrations/task-queue/status\"))\n .then((res) => (res.ok ? res.json() : null))\n .then((stats) => {\n if (!active || !stats || typeof stats !== \"object\") return;\n setTaskQueueStats({\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 .catch(() => {\n // Endpoint may not exist on older deploys — ignore.\n });\n };\n load();\n const id = window.setInterval(load, 15000);\n return () => {\n active = false;\n window.clearInterval(id);\n };\n }, []);\n\n const counts = data?.counts || {\n destinations: 0,\n pendingApprovals: 0,\n linkedIdentities: 0,\n activeTokens: 0,\n };\n\n const messagingStatuses = useMemo(\n () =>\n integrationStatuses.filter(\n (row) => row.platform === \"slack\" || row.platform === \"telegram\",\n ),\n [integrationStatuses],\n );\n\n const connectedMessagingCount = messagingStatuses.filter(\n (row) => row.enabled || row.configured,\n ).length;\n const connectedAgentCount = connectedAgents?.length || 0;\n const vaultSecretCount = data?.vault?.secretCount || 0;\n const typedWorkspaceApps = workspaceApps as WorkspaceAppSummary[];\n\n const messagingDone = connectedMessagingCount > 0;\n const agentsDone = connectedAgentCount > 0;\n const vaultDone = vaultSecretCount > 0;\n\n const steps: ChecklistStep[] = [\n {\n number: 1,\n title: \"Connect Slack\",\n description:\n \"Add @agent-native to your Slack workspace so your team can ask questions, create decks, pull analytics, and more — right from Slack.\",\n complete: messagingDone,\n to: \"/messaging\",\n actionLabel: \"Connect\",\n },\n {\n number: 2,\n title: \"Review connected agents\",\n description:\n \"Dispatch delegates work to specialized apps. The built-in suite (Slides, Analytics, Content, Video, and more) is available automatically.\",\n complete: agentsDone,\n to: \"/agents\",\n actionLabel: \"Review\",\n },\n {\n number: 3,\n title: \"Set up your vault\",\n description:\n \"Store API keys centrally and sync them to apps that need them.\",\n complete: vaultDone,\n to: \"/vault\",\n actionLabel: \"Open vault\",\n },\n {\n number: 4,\n title: \"Try it out\",\n description: \"Mention @agent-native in any Slack channel to get started.\",\n complete: false,\n informational: true,\n },\n ];\n\n const hasIncompleteSteps = steps.some((s) => !s.complete && !s.informational);\n\n return (\n <DispatchShell\n title=\"Overview\"\n description=\"Create apps, manage shared keys, and route work across your workspace.\"\n >\n <HomeChatPanel />\n\n <WorkspaceAppsSection apps={typedWorkspaceApps} isLoading={appsLoading} />\n\n {hasIncompleteSteps && (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconRocket size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Getting started\n </h2>\n </div>\n <div className=\"space-y-2\">\n {steps.map((step) => (\n <StepRow key={step.number} step={step} />\n ))}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconActivity size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">At a glance</h2>\n </div>\n <div className=\"grid grid-cols-[repeat(auto-fit,minmax(min(100%,13rem),1fr))] gap-4\">\n <StatCard\n label=\"Vault secrets\"\n help=\"Credentials stored in the workspace vault.\"\n value={data?.vault?.secretCount || 0}\n icon={IconKey}\n cta={\n (data?.vault?.secretCount || 0) === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/vault\">Set up vault</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label={\n data?.vault?.accessMode === \"manual\"\n ? \"Active grants\"\n : \"Accessible keys\"\n }\n help={\n data?.vault?.accessMode === \"manual\"\n ? \"Secrets currently granted to apps. Sync them to push credentials.\"\n : \"Vault keys available to every workspace app.\"\n }\n value={data?.vault?.activeGrantCount || 0}\n icon={IconShieldCheck}\n />\n <StatCard\n label=\"Destinations\"\n help=\"Saved outbound targets used for proactive sends and scheduled jobs.\"\n value={counts.destinations}\n icon={IconArrowUpRight}\n cta={\n counts.destinations === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/destinations\">Set up destinations</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Agents\"\n help=\"Agents available to dispatch for delegation over A2A. This includes the built-in app suite plus any additional agents you add.\"\n value={connectedAgentCount}\n icon={IconPlugConnected}\n cta={\n connectedAgentCount === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/agents\">Open agents</Link>\n </Button>\n ) : undefined\n }\n />\n </div>\n </section>\n\n <details className=\"rounded-xl border\">\n <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\">\n <span>Operations detail</span>\n <span className=\"text-xs font-normal text-muted-foreground\">\n Queue, audit, and approvals\n </span>\n </summary>\n <div className=\"space-y-5 border-t px-5 py-5\">\n <TaskQueueSection stats={taskQueueStats} />\n\n <div className=\"grid gap-4 xl:grid-cols-3\">\n <section className=\"rounded-2xl border bg-card p-5 xl:col-span-2\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Recent activity\n </h2>\n </div>\n <RecentActivityList\n isLoading={isLoading}\n events={data?.recentAudit ?? []}\n />\n </section>\n\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Approval mode\n </h2>\n <div className=\"mt-4 rounded-xl border bg-muted/30 p-4\">\n <div className=\"text-sm font-medium text-muted-foreground\">\n Current policy\n </div>\n <div className=\"mt-2 text-2xl font-semibold text-foreground\">\n {data?.settings?.enabled ? \"Reviewed\" : \"Immediate\"}\n </div>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {data?.settings?.enabled\n ? \"Changes wait for approval before they apply.\"\n : \"Changes apply immediately and are recorded in audit.\"}\n </p>\n </div>\n <div className=\"mt-4 space-y-2\">\n {(data?.recentApprovals || []).map((approval: any) => (\n <div\n key={approval.id}\n className=\"rounded-xl border px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {approval.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {approval.status} · requested by {approval.requestedBy}\n </div>\n </div>\n ))}\n {(data?.recentApprovals?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No approval requests.\n </div>\n )}\n </div>\n </section>\n </div>\n </div>\n </details>\n </DispatchShell>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"overview.js","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,aAAa;IACnC,OAAO,KAAC,oBAAoB,KAAG,CAAC;AAClC,CAAC","sourcesContent":["import { DispatchControlPlane } from \"@/components/dispatch-control-plane\";\n\nexport function meta() {\n return [{ title: \"Overview — Dispatch\" }];\n}\n\nexport default function OverviewRoute() {\n return <DispatchControlPlane />;\n}\n"]}
|
|
@@ -4,10 +4,10 @@ export declare const DISPATCH_PROVIDER_API_IDS: readonly ["amplitude", "apollo",
|
|
|
4
4
|
export type DispatchProviderApiId = ProviderApiId;
|
|
5
5
|
export type { ProviderApiMethod, ProviderApiRequestArgs };
|
|
6
6
|
export declare function listProviderApiCatalog(provider?: string): {
|
|
7
|
-
id: "
|
|
7
|
+
id: "slack" | "github" | "notion" | "gmail" | "google_drive" | "hubspot" | "granola" | "amplitude" | "apollo" | "bigquery" | "commonroom" | "dataforseo" | "ga4" | "gcloud" | "gong" | "google_calendar" | "grafana" | "jira" | "mixpanel" | "posthog" | "prometheus" | "pylon" | "sentry" | "stripe" | "twitter";
|
|
8
8
|
label: string;
|
|
9
9
|
defaultBaseUrl: string;
|
|
10
|
-
baseUrlCredentialKey: string
|
|
10
|
+
baseUrlCredentialKey: string;
|
|
11
11
|
auth: string;
|
|
12
12
|
credentialKeys: readonly string[];
|
|
13
13
|
docsUrls: readonly string[];
|
|
@@ -54,7 +54,7 @@ Use the standard workspace primitives:
|
|
|
54
54
|
- You receive a compact available-apps block with sibling workspace app names and descriptions. Use it to pick the right A2A target, and call list-connected-agents or tool-search only when you need fresh details.
|
|
55
55
|
- When answering whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.
|
|
56
56
|
- When creating a new workspace app, create a separate app under apps/<app-id> with apps/<app-id>/package.json including a concise generated description, mount it at /<app-id>, use relative /<app-id> links, never hardcode localhost or dev ports, use shadcn/ui with @tabler/icons-react rather than lucide-react, and ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath(). There is no separate workspace app registry to edit.
|
|
57
|
-
- If the
|
|
57
|
+
- If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible "Chat", "Starter", "Blank app", or "New app" UI behind.
|
|
58
58
|
- Treat first-party apps such as Mail, Calendar, Analytics, Brain, Assets, and Dispatch as existing hosted/connected neighbors available through links and A2A/default connected agents. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.
|
|
59
59
|
- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.
|
|
60
60
|
- For broad provider searches, joins, classification, corpus counts, or absence claims, fetch every relevant page or an explicitly bounded cohort, stage/save large responses with stageAs/saveToFile/fetchAllPages, and reduce them with query-staged-dataset or run-code. Report source, filters, row counts, pagination, truncation, failed pages, and uncovered gaps.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-chat.js","sourceRoot":"","sources":["../../../src/server/plugins/agent-chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,kBAAkB,GAAG;IACzB,aAAa;IACb,qBAAqB;IACrB,uBAAuB;IACvB,SAAS;IACT,UAAU;IACV,0BAA0B;IAC1B,2BAA2B;IAC3B,2BAA2B;IAC3B,oBAAoB;IACpB,sBAAsB;IACtB,qBAAqB;IACrB,mBAAmB;IACnB,oBAAoB;IACpB,aAAa;IACb,8BAA8B;IAC9B,oCAAoC;IACpC,sBAAsB;IACtB,mBAAmB;IACnB,sBAAsB;IACtB,sBAAsB;IACtB,UAAU;CACX,CAAC;AAEF,eAAe,qBAAqB,CAAC;IACnC,KAAK,EAAE,UAAU;IACjB,gBAAgB,EAAE,kBAAkB;IACpC,0EAA0E;IAC1E,2EAA2E;IAC3E,2EAA2E;IAC3E,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,OAAO,EAAE,eAAe;IACxB,aAAa,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE;IAC1C,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;4EAuB4D;CAC3E,CAAC,CAAC","sourcesContent":["import { createAgentChatPlugin } from \"@agent-native/core/server\";\nimport { getOrgContext } from \"@agent-native/core/org\";\nimport { dispatchActions } from \"../../actions/index.js\";\n\nconst INITIAL_TOOL_NAMES = [\n \"view-screen\",\n \"list-workspace-apps\",\n \"list-connected-agents\",\n \"ask_app\",\n \"open_app\",\n \"list-workspace-resources\",\n \"create-workspace-resource\",\n \"update-workspace-resource\",\n \"list-vault-secrets\",\n \"request-vault-secret\",\n \"create-vault-secret\",\n \"list-destinations\",\n \"upsert-destination\",\n \"list-dreams\",\n \"start-workspace-app-creation\",\n \"list-available-workspace-templates\",\n \"provider-api-catalog\",\n \"provider-api-docs\",\n \"provider-api-request\",\n \"query-staged-dataset\",\n \"navigate\",\n];\n\nexport default createAgentChatPlugin({\n appId: \"dispatch\",\n initialToolNames: INITIAL_TOOL_NAMES,\n // Without this, AGENT_ORG_ID is never set on agent action calls and every\n // row written through the frontend (vault secrets, destinations, workspace\n // resources) lands with org_id=NULL — breaking data isolation across orgs.\n resolveOrgId: async (event) => {\n const ctx = await getOrgContext(event);\n return ctx.orgId;\n },\n // Read actions directly from the package's own action map rather than from\n // a build-time-generated `.generated/actions-registry.ts` (the latter is a\n // template-only construct that the Vite plugin emits next to actions/).\n actions: dispatchActions,\n codeExecution: { production: \"sandboxed\" },\n systemPrompt: `You are the central dispatch for this workspace.\n\nDefault posture:\n- Treat Slack and Telegram as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A when another app owns the job.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Prefer replying in the current external thread unless the user explicitly asks you to send to a saved destination.\n\nUse the standard workspace primitives:\n- Read and update resources like AGENTS.md, LEARNINGS.md, jobs/*.md, agents/*.md, and remote-agents/*.json when appropriate.\n- Use recurring jobs for scheduled behavior.\n- Use custom agent profiles in agents/*.md for local spawned work and remote-agents/*.json for remote A2A apps.\n- You receive a compact available-apps block with sibling workspace app names and descriptions. Use it to pick the right A2A target, and call list-connected-agents or tool-search only when you need fresh details.\n- When answering whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.\n- When creating a new workspace app, create a separate app under apps/<app-id> with apps/<app-id>/package.json including a concise generated description, mount it at /<app-id>, use relative /<app-id> links, never hardcode localhost or dev ports, use shadcn/ui with @tabler/icons-react rather than lucide-react, and ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath(). There is no separate workspace app registry to edit.\n- If the
|
|
1
|
+
{"version":3,"file":"agent-chat.js","sourceRoot":"","sources":["../../../src/server/plugins/agent-chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,kBAAkB,GAAG;IACzB,aAAa;IACb,qBAAqB;IACrB,uBAAuB;IACvB,SAAS;IACT,UAAU;IACV,0BAA0B;IAC1B,2BAA2B;IAC3B,2BAA2B;IAC3B,oBAAoB;IACpB,sBAAsB;IACtB,qBAAqB;IACrB,mBAAmB;IACnB,oBAAoB;IACpB,aAAa;IACb,8BAA8B;IAC9B,oCAAoC;IACpC,sBAAsB;IACtB,mBAAmB;IACnB,sBAAsB;IACtB,sBAAsB;IACtB,UAAU;CACX,CAAC;AAEF,eAAe,qBAAqB,CAAC;IACnC,KAAK,EAAE,UAAU;IACjB,gBAAgB,EAAE,kBAAkB;IACpC,0EAA0E;IAC1E,2EAA2E;IAC3E,2EAA2E;IAC3E,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,OAAO,EAAE,eAAe;IACxB,aAAa,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE;IAC1C,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;4EAuB4D;CAC3E,CAAC,CAAC","sourcesContent":["import { createAgentChatPlugin } from \"@agent-native/core/server\";\nimport { getOrgContext } from \"@agent-native/core/org\";\nimport { dispatchActions } from \"../../actions/index.js\";\n\nconst INITIAL_TOOL_NAMES = [\n \"view-screen\",\n \"list-workspace-apps\",\n \"list-connected-agents\",\n \"ask_app\",\n \"open_app\",\n \"list-workspace-resources\",\n \"create-workspace-resource\",\n \"update-workspace-resource\",\n \"list-vault-secrets\",\n \"request-vault-secret\",\n \"create-vault-secret\",\n \"list-destinations\",\n \"upsert-destination\",\n \"list-dreams\",\n \"start-workspace-app-creation\",\n \"list-available-workspace-templates\",\n \"provider-api-catalog\",\n \"provider-api-docs\",\n \"provider-api-request\",\n \"query-staged-dataset\",\n \"navigate\",\n];\n\nexport default createAgentChatPlugin({\n appId: \"dispatch\",\n initialToolNames: INITIAL_TOOL_NAMES,\n // Without this, AGENT_ORG_ID is never set on agent action calls and every\n // row written through the frontend (vault secrets, destinations, workspace\n // resources) lands with org_id=NULL — breaking data isolation across orgs.\n resolveOrgId: async (event) => {\n const ctx = await getOrgContext(event);\n return ctx.orgId;\n },\n // Read actions directly from the package's own action map rather than from\n // a build-time-generated `.generated/actions-registry.ts` (the latter is a\n // template-only construct that the Vite plugin emits next to actions/).\n actions: dispatchActions,\n codeExecution: { production: \"sandboxed\" },\n systemPrompt: `You are the central dispatch for this workspace.\n\nDefault posture:\n- Treat Slack and Telegram as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A when another app owns the job.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Prefer replying in the current external thread unless the user explicitly asks you to send to a saved destination.\n\nUse the standard workspace primitives:\n- Read and update resources like AGENTS.md, LEARNINGS.md, jobs/*.md, agents/*.md, and remote-agents/*.json when appropriate.\n- Use recurring jobs for scheduled behavior.\n- Use custom agent profiles in agents/*.md for local spawned work and remote-agents/*.json for remote A2A apps.\n- You receive a compact available-apps block with sibling workspace app names and descriptions. Use it to pick the right A2A target, and call list-connected-agents or tool-search only when you need fresh details.\n- When answering whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.\n- When creating a new workspace app, create a separate app under apps/<app-id> with apps/<app-id>/package.json including a concise generated description, mount it at /<app-id>, use relative /<app-id> links, never hardcode localhost or dev ports, use shadcn/ui with @tabler/icons-react rather than lucide-react, and ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath(). There is no separate workspace app registry to edit.\n- If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible \"Chat\", \"Starter\", \"Blank app\", or \"New app\" UI behind.\n- Treat first-party apps such as Mail, Calendar, Analytics, Brain, Assets, and Dispatch as existing hosted/connected neighbors available through links and A2A/default connected agents. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- For broad provider searches, joins, classification, corpus counts, or absence claims, fetch every relevant page or an explicitly bounded cohort, stage/save large responses with stageAs/saveToFile/fetchAllPages, and reduce them with query-staged-dataset or run-code. Report source, filters, row counts, pagination, truncation, failed pages, and uncovered gaps.\n\nWhen a user asks for something like a digest, reminder, routing rule, or saved behavior:\n- First decide whether it should be a resource, a recurring job, a destination, or a delegated task.\n- Keep responses concise and operational.\n- Avoid inventing integrations or destinations that are not configured yet.`,\n});\n"]}
|
|
@@ -20,8 +20,8 @@ When a user asks for something:
|
|
|
20
20
|
- Exception: if the downstream agent reports a missing model/provider credential, do not name exact env vars, Vault keys, tokens, or secrets. Say the target app needs an LLM connection and recommend connecting Builder/managed LLM for that app; keep bring-your-own provider keys as a secondary option only if the user asks.
|
|
21
21
|
- If the user asks to create, build, make, scaffold, or generate an "agent" from Dispatch chat or by tagging @agent-native in Slack, email, or Telegram, first classify the ask. If it is a simple Dispatch-native behavior like a reminder, digest, monitor, routing rule, saved instruction, or recurring workflow, create or update the recurring job/resource/destination in Dispatch. If it is a robust unique product or teammate that needs its own UI, data model, actions, integrations, or domain workflow, treat it as a new workspace app and call start-workspace-app-creation.
|
|
22
22
|
- If a new-app prompt asks for access to Mail, Calendar, Analytics, Brain, Assets, or similar first-party app data/agents, keep using the existing hosted/connected app and A2A path. Do not ask Builder to scaffold those apps as children of the new app unless the user explicitly asks for a customized fork/copy.
|
|
23
|
-
- If the
|
|
24
|
-
- If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt and include a concise generated description by default. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/
|
|
23
|
+
- If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible "Chat", "Starter", "Blank app", or "New app" UI behind.
|
|
24
|
+
- If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt and include a concise generated description by default. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app. If the request is too vague to classify, ask one concise follow-up. If the action returns mode "builder", reply with the Builder branch URL; Builder is responsible for creating the separate workspace app under apps/<app-id>, mounting it at /<app-id>, ensuring apps/<app-id>/package.json exists with name/displayName and description so Dispatch discovers it, using relative /<app-id> links instead of hardcoded localhost/dev ports, and preserving APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath() in the React Router client entry. The new app lives at the workspace root /<app-id>, NOT under /dispatch/<app-id>, /apps/<app-id>, or any other Dispatch tab — when telling the user where to find it, link to /<app-id> only. There is no separate workspace app registry to edit. If it returns mode "local-agent", tell the user it is ready for the local code agent and include the returned app path/prompt summary. If it returns mode "coming-soon" or "builder-unavailable", explain the missing Builder setup and ask them to connect/configure Builder.
|
|
25
25
|
- For digests, reminders, or saved behavior, prefer recurring jobs, resources, or destinations over chat replies.
|
|
26
26
|
- Keep responses concise and operational — messaging platforms have character limits.
|
|
27
27
|
- Use markdown sparingly (bold and lists are fine, avoid complex formatting).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/server/plugins/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,kCAAkC,GAAG;;;;;;;;;;;;;;;;;;;;;;;4FAuBiD,CAAC;AAE7F;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,KAAK,EAAE,QAAa,EAAE,EAAE;IACzD,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAClD,MAAM,cAAc,GAAG,YAAY,CAAC,YAAY,CAAC;IACjD,MAAM,YAAY,GAChB,OAAO,cAAc,KAAK,QAAQ;QAChC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,OAAO,cAAc,KAAK,UAAU;YACpC,CAAC,CAAC,cAAc,CAAC,kCAAkC,CAAC;YACpD,CAAC,CAAC,kCAAkC,CAAC;IAE3C,MAAM,MAAM,GAAG,wBAAwB,CAAC;QACtC,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,eAAe;QACxB,YAAY,EAAE,oBAAoB;QAClC,aAAa,EAAE,qBAAqB;QACpC,YAAY;QACZ,wDAAwD;QACxD,yEAAyE;QACzE,+DAA+D;QAC/D,6EAA6E;KAC9E,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { createIntegrationsPlugin } from \"@agent-native/core/server\";\nimport {\n beforeDispatchProcess,\n resolveDispatchOwner,\n} from \"../lib/dispatch-integrations.js\";\nimport { getDispatchConfig } from \"../index.js\";\nimport { dispatchActions } from \"../../actions/index.js\";\n\nconst DISPATCH_INTEGRATION_SYSTEM_PROMPT = `You are the central dispatch for this workspace, responding via a messaging platform integration (Slack, Telegram, email, etc.).\n\nDefault posture:\n- Treat Slack, Telegram, and email as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A (call-agent) when another app owns the job. Apps you can delegate to include slides (decks/presentations), analytics (data/dashboards), content (docs/articles), videos (Remotion compositions), forms (form builder), clips (screen recordings), design (visual designs), and assets (brand libraries plus generated images/videos).\n- Use the available-apps prompt context first, then list-connected-agents when you need fresh details, to see what agents are available before assuming a request must be handled locally.\n- When asked whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. Without that probe, missing agent-card fields mean unchecked, not unavailable.\n- Treat first-party apps such as Mail, Calendar, Analytics, Brain, Assets, and Dispatch as existing hosted/connected neighbors available through links and A2A/default connected agents. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Reply in the originating thread unless the user explicitly asks you to send to a saved destination.\n\nWhen a user asks for something:\n- If it belongs to analytics, content, slides, videos, assets, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.\n- After call-agent returns an answer, RELAY IT DIRECTLY to the user with at most a one-line preface — do not rephrase, summarize, or add commentary. The downstream agent already crafted the answer; your job is delivery, not editing. This minimizes round-trips and keeps the user-visible reply fast.\n- Exception: if the downstream agent reports a missing model/provider credential, do not name exact env vars, Vault keys, tokens, or secrets. Say the target app needs an LLM connection and recommend connecting Builder/managed LLM for that app; keep bring-your-own provider keys as a secondary option only if the user asks.\n- If the user asks to create, build, make, scaffold, or generate an \"agent\" from Dispatch chat or by tagging @agent-native in Slack, email, or Telegram, first classify the ask. If it is a simple Dispatch-native behavior like a reminder, digest, monitor, routing rule, saved instruction, or recurring workflow, create or update the recurring job/resource/destination in Dispatch. If it is a robust unique product or teammate that needs its own UI, data model, actions, integrations, or domain workflow, treat it as a new workspace app and call start-workspace-app-creation.\n- If a new-app prompt asks for access to Mail, Calendar, Analytics, Brain, Assets, or similar first-party app data/agents, keep using the existing hosted/connected app and A2A path. Do not ask Builder to scaffold those apps as children of the new app unless the user explicitly asks for a customized fork/copy.\n- If the
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/server/plugins/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,kCAAkC,GAAG;;;;;;;;;;;;;;;;;;;;;;;4FAuBiD,CAAC;AAE7F;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,KAAK,EAAE,QAAa,EAAE,EAAE;IACzD,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAClD,MAAM,cAAc,GAAG,YAAY,CAAC,YAAY,CAAC;IACjD,MAAM,YAAY,GAChB,OAAO,cAAc,KAAK,QAAQ;QAChC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,OAAO,cAAc,KAAK,UAAU;YACpC,CAAC,CAAC,cAAc,CAAC,kCAAkC,CAAC;YACpD,CAAC,CAAC,kCAAkC,CAAC;IAE3C,MAAM,MAAM,GAAG,wBAAwB,CAAC;QACtC,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,eAAe;QACxB,YAAY,EAAE,oBAAoB;QAClC,aAAa,EAAE,qBAAqB;QACpC,YAAY;QACZ,wDAAwD;QACxD,yEAAyE;QACzE,+DAA+D;QAC/D,6EAA6E;KAC9E,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { createIntegrationsPlugin } from \"@agent-native/core/server\";\nimport {\n beforeDispatchProcess,\n resolveDispatchOwner,\n} from \"../lib/dispatch-integrations.js\";\nimport { getDispatchConfig } from \"../index.js\";\nimport { dispatchActions } from \"../../actions/index.js\";\n\nconst DISPATCH_INTEGRATION_SYSTEM_PROMPT = `You are the central dispatch for this workspace, responding via a messaging platform integration (Slack, Telegram, email, etc.).\n\nDefault posture:\n- Treat Slack, Telegram, and email as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A (call-agent) when another app owns the job. Apps you can delegate to include slides (decks/presentations), analytics (data/dashboards), content (docs/articles), videos (Remotion compositions), forms (form builder), clips (screen recordings), design (visual designs), and assets (brand libraries plus generated images/videos).\n- Use the available-apps prompt context first, then list-connected-agents when you need fresh details, to see what agents are available before assuming a request must be handled locally.\n- When asked whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. Without that probe, missing agent-card fields mean unchecked, not unavailable.\n- Treat first-party apps such as Mail, Calendar, Analytics, Brain, Assets, and Dispatch as existing hosted/connected neighbors available through links and A2A/default connected agents. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Reply in the originating thread unless the user explicitly asks you to send to a saved destination.\n\nWhen a user asks for something:\n- If it belongs to analytics, content, slides, videos, assets, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.\n- After call-agent returns an answer, RELAY IT DIRECTLY to the user with at most a one-line preface — do not rephrase, summarize, or add commentary. The downstream agent already crafted the answer; your job is delivery, not editing. This minimizes round-trips and keeps the user-visible reply fast.\n- Exception: if the downstream agent reports a missing model/provider credential, do not name exact env vars, Vault keys, tokens, or secrets. Say the target app needs an LLM connection and recommend connecting Builder/managed LLM for that app; keep bring-your-own provider keys as a secondary option only if the user asks.\n- If the user asks to create, build, make, scaffold, or generate an \"agent\" from Dispatch chat or by tagging @agent-native in Slack, email, or Telegram, first classify the ask. If it is a simple Dispatch-native behavior like a reminder, digest, monitor, routing rule, saved instruction, or recurring workflow, create or update the recurring job/resource/destination in Dispatch. If it is a robust unique product or teammate that needs its own UI, data model, actions, integrations, or domain workflow, treat it as a new workspace app and call start-workspace-app-creation.\n- If a new-app prompt asks for access to Mail, Calendar, Analytics, Brain, Assets, or similar first-party app data/agents, keep using the existing hosted/connected app and A2A path. Do not ask Builder to scaffold those apps as children of the new app unless the user explicitly asks for a customized fork/copy.\n- If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible \"Chat\", \"Starter\", \"Blank app\", or \"New app\" UI behind.\n- If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt and include a concise generated description by default. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app. If the request is too vague to classify, ask one concise follow-up. If the action returns mode \"builder\", reply with the Builder branch URL; Builder is responsible for creating the separate workspace app under apps/<app-id>, mounting it at /<app-id>, ensuring apps/<app-id>/package.json exists with name/displayName and description so Dispatch discovers it, using relative /<app-id> links instead of hardcoded localhost/dev ports, and preserving APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath() in the React Router client entry. The new app lives at the workspace root /<app-id>, NOT under /dispatch/<app-id>, /apps/<app-id>, or any other Dispatch tab — when telling the user where to find it, link to /<app-id> only. There is no separate workspace app registry to edit. If it returns mode \"local-agent\", tell the user it is ready for the local code agent and include the returned app path/prompt summary. If it returns mode \"coming-soon\" or \"builder-unavailable\", explain the missing Builder setup and ask them to connect/configure Builder.\n- For digests, reminders, or saved behavior, prefer recurring jobs, resources, or destinations over chat replies.\n- Keep responses concise and operational — messaging platforms have character limits.\n- Use markdown sparingly (bold and lists are fine, avoid complex formatting).\n- If a task requires many steps, summarize what you did rather than streaming every detail.`;\n\n/**\n * Defer plugin construction until the Nitro plugin actually fires so the\n * config-aware system prompt resolves AFTER `setupDispatch(config)` has\n * stamped the active config (plugin module load order is not guaranteed).\n */\nconst dispatchIntegrationsPlugin = async (nitroApp: any) => {\n const { integrations = {} } = getDispatchConfig();\n const promptOverride = integrations.systemPrompt;\n const systemPrompt =\n typeof promptOverride === \"string\"\n ? promptOverride\n : typeof promptOverride === \"function\"\n ? promptOverride(DISPATCH_INTEGRATION_SYSTEM_PROMPT)\n : DISPATCH_INTEGRATION_SYSTEM_PROMPT;\n\n const plugin = createIntegrationsPlugin({\n appId: \"dispatch\",\n actions: dispatchActions,\n resolveOwner: resolveDispatchOwner,\n beforeProcess: beforeDispatchProcess,\n systemPrompt,\n // Inherit the framework default (claude-sonnet-4-6 from\n // packages/core/src/integrations/plugin.ts). Haiku was tried for latency\n // but hallucinated URLs/IDs after delegated call-agent results\n // (e.g. inventing `https://slides.workspace.com/deck/builder-io-deck-2024`).\n });\n\n return plugin(nitroApp);\n};\n\nexport default dispatchIntegrationsPlugin;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/dispatch",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dispatch — workspace control plane for agent-native apps. Vault, integrations, destinations, scheduled jobs, and cross-app delegation, shipped as a single drop-in package.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"typescript": "^6.0.3",
|
|
101
101
|
"vite": "8.0.3",
|
|
102
102
|
"vitest": "^4.1.5",
|
|
103
|
-
"@agent-native/core": "0.
|
|
103
|
+
"@agent-native/core": "0.62.0"
|
|
104
104
|
},
|
|
105
105
|
"scripts": {
|
|
106
106
|
"build": "tsc && tsc-alias --resolve-full-paths",
|
|
@@ -5,7 +5,7 @@ import { startWorkspaceAppCreation } from "../server/lib/app-creation-store.js";
|
|
|
5
5
|
|
|
6
6
|
export default defineAction({
|
|
7
7
|
description:
|
|
8
|
-
'Start creating a new workspace app from Dispatch when the request truly needs its own app. Callers should include a concise generated description by default; Dispatch generates one from the prompt when omitted. In local dev this returns a code-agent prompt; in production it creates a Builder branch when a Builder project is configured. The result must be a separate workspace app under apps/<app-id>, not a new route or file in apps/
|
|
8
|
+
'Start creating a new workspace app from Dispatch when the request truly needs its own app. Callers should include a concise generated description by default; Dispatch generates one from the prompt when omitted. In local dev this returns a code-agent prompt; in production it creates a Builder branch when a Builder project is configured. The result must be a separate workspace app under apps/<app-id>, not a new route or file in apps/chat. If chat is used as the source template, the finished app must be branded as the requested app and must not leave visible "Chat", "Starter", "Blank app", or "New app" UI behind. If the request needs Mail, Calendar, Analytics, Brain, Assets, or another first-party app, use the existing hosted/connected app via links or A2A; do not clone, wrap, or nest those templates inside the new app unless the user explicitly asks for a customized copy.',
|
|
9
9
|
schema: z.object({
|
|
10
10
|
prompt: z.string().min(1).describe("The user's app creation request"),
|
|
11
11
|
appId: z
|
|
@@ -110,8 +110,8 @@ function buildAppCreationPrompt(input: {
|
|
|
110
110
|
`Requested Dispatch workspace resources for this app:\n${resourceList}`,
|
|
111
111
|
`Dispatch workspace resources with scope=all are inherited workspace context. Do not copy or sync them into the new app; every workspace app reads them at runtime and may override with app shared or personal resources.`,
|
|
112
112
|
``,
|
|
113
|
-
`Pick a
|
|
114
|
-
`If you use the
|
|
113
|
+
`Pick a UI template that fits the user's prompt — analytics, assets, brain, calendar, chat, content, design, dispatch, forms, mail, slides, or clips when none of the others fit.`,
|
|
114
|
+
`If you use the chat template, treat it as scaffolding only: the finished app must use the requested app's real name, home screen, navigation, package metadata, and manifest, and it must not leave visible "Chat", "Starter", "Blank app", or "New app" UI behind.`,
|
|
115
115
|
`Use the workspace app layout: create it under apps/${input.appId}, mount it at /${input.appId}, keep it on the shared workspace database/hosting model, and avoid table-name collisions by namespacing any new domain tables to the app.`,
|
|
116
116
|
`Important routing rule: from outside the app, link to /${input.appId}; inside apps/${input.appId}, React Router routes are app-local. Use <Link to="/review"> and navigate("/review"), not "/${input.appId}/review"; APP_BASE_PATH supplies the mounted prefix, and hardcoding it causes doubled URLs like /${input.appId}/${input.appId}/review.`,
|
|
117
117
|
`Prefer useActionQuery/useActionMutation for actions. If you must raw-fetch framework endpoints, wrap them with agentNativePath("/_agent-native/actions/<name>") so mounted apps call the right URL.`,
|
|
@@ -120,7 +120,7 @@ function buildAppCreationPrompt(input: {
|
|
|
120
120
|
`Existing first-party apps are neighbors, not implementation details for this app. If the user's prompt mentions Mail, Calendar, Analytics, Brain, Assets, Dispatch, or other templates, treat them as existing hosted/connected apps that this app can link to or call through A2A/default connected agents. For example, Mail, Calendar, Analytics, Brain, and Assets already exist at https://mail.agent-native.com, https://calendar.agent-native.com, https://analytics.agent-native.com, https://brain.agent-native.com, and https://assets.agent-native.com.`,
|
|
121
121
|
`Do not clone first-party templates, create wrapper apps, or scaffold child apps/routes for Mail, Calendar, Analytics, Brain, Assets, etc. inside apps/${input.appId} just so this app can access them. If the request is a cross-app dashboard or overview, build only the new dashboard/overview app and delegate to the existing apps for domain work.`,
|
|
122
122
|
`Only create another first-party app copy when the user explicitly asks for a customized fork/copy of that app; otherwise keep using the hosted/shared app so improvements to the base template keep flowing to users.`,
|
|
123
|
-
`Do not satisfy this by adding a route, page, component, or file inside apps/
|
|
123
|
+
`Do not satisfy this by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app.`,
|
|
124
124
|
input.vaultAccessMode === "all-apps"
|
|
125
125
|
? `Do not create per-app Dispatch vault grants unless the workspace switches vault access to manual or the user explicitly asks for manual grants.`
|
|
126
126
|
: keyList
|