@agent-native/dispatch 0.2.8 → 0.2.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAoCrE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,YAAY,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,iFAAiF;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,mFAAmF;IACnF,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,gEAAgE;IAChE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAmJD,wBAAgB,UAAU,CAAC,EACzB,UAAU,EACV,UAAU,GACX,EAAE;IACD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC,2CAwGA;AAED,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC,2CAiEA"}
1
+ {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAoCrE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,YAAY,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,iFAAiF;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,mFAAmF;IACnF,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,gEAAgE;IAChE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAmJD,wBAAgB,UAAU,CAAC,EACzB,UAAU,EACV,UAAU,GACX,EAAE;IACD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC,2CA4GA;AAED,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC,2CAiEA"}
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useState } from "react";
3
3
  import { NavLink, useLocation } from "react-router";
4
4
  import { AgentSidebar, FeedbackButton, appPath, useActionQuery, } from "@agent-native/core/client";
5
- import { InvitationBanner } from "@agent-native/core/client/org";
6
- import { ToolsSidebarSection } from "@agent-native/core/client/tools";
5
+ import { ExtensionsSidebarSection } from "@agent-native/core/client/extensions";
6
+ import { InvitationBanner, OrgSwitcher } from "@agent-native/core/client/org";
7
7
  import { IconArrowUpRight, IconApps, IconChartBar, IconBrandTelegram, IconKey, IconChevronDown, IconLayersSubtract, IconPlugConnected, IconBroadcast, IconFingerprint, IconHistory, IconPuzzle, IconShieldCheck, IconUsersGroup, } from "@tabler/icons-react";
8
8
  import { cn } from "../../lib/utils.js";
9
9
  import { Sheet, SheetContent, SheetDescription, SheetTitle, } from "../../components/ui/sheet.js";
@@ -165,7 +165,7 @@ export function NavContent({ onNavigate, extensions, }) {
165
165
  };
166
166
  return (_jsxs(_Fragment, { children: [_jsx("div", { className: "border-b px-4 py-3", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("div", { className: "flex h-9 w-9 items-center justify-center rounded-xl border bg-card text-foreground", children: [_jsx("img", { src: appPath("/agent-native-icon-light.svg"), alt: "", "aria-hidden": "true", className: "block h-4 w-auto shrink-0 dark:hidden" }), _jsx("img", { src: appPath("/agent-native-icon-dark.svg"), alt: "", "aria-hidden": "true", className: "hidden h-4 w-auto shrink-0 dark:block" })] }), _jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-semibold text-foreground", children: workspaceLabel ?? "Dispatch" }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: workspaceLabel
167
167
  ? `Workspace · ${ws?.appCount ?? 0} app${ws?.appCount === 1 ? "" : "s"}`
168
- : "Workspace control plane" })] })] }) }), _jsxs("nav", { className: "flex-1 overflow-y-auto px-2 py-3", children: [_jsx("ul", { className: "space-y-0.5", children: primaryNavItems.map(renderNavItem) }), _jsxs("details", { className: "group mt-4", open: operationsOpen, children: [_jsxs("summary", { className: "flex h-8 cursor-pointer list-none items-center justify-between rounded-md px-2 text-xs font-medium uppercase text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: "Operations" }), _jsx(IconChevronDown, { size: 14, className: "transition-transform group-open:rotate-180" })] }), _jsx("ul", { className: "mt-1 space-y-0.5", children: operationsNavItems.map(renderNavItem) })] })] }), _jsxs("div", { className: "border-t px-2 py-2", children: [_jsx(ToolsSidebarSection, {}), _jsx(FeedbackButton, {})] })] }));
168
+ : "Workspace control plane" })] })] }) }), _jsxs("nav", { className: "flex-1 overflow-y-auto px-2 py-3", children: [_jsx("ul", { className: "space-y-0.5", children: primaryNavItems.map(renderNavItem) }), _jsxs("details", { className: "group mt-4", open: operationsOpen, children: [_jsxs("summary", { className: "flex h-8 cursor-pointer list-none items-center justify-between rounded-md px-2 text-xs font-medium uppercase text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: "Operations" }), _jsx(IconChevronDown, { size: 14, className: "transition-transform group-open:rotate-180" })] }), _jsx("ul", { className: "mt-1 space-y-0.5", children: operationsNavItems.map(renderNavItem) })] })] }), _jsx("div", { className: "border-t px-2 py-2", children: _jsx(ExtensionsSidebarSection, {}) }), _jsxs("div", { className: "space-y-2 border-t px-3 py-2", children: [_jsx(FeedbackButton, {}), _jsx(OrgSwitcher, {})] })] }));
169
169
  }
170
170
  export function Layout({ children, extensions, }) {
171
171
  const location = useLocation();
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,OAA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KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,2CAElB,EACnB,cAAK,SAAS,EAAC,6BAA6B,YAC1C,KAAC,UAAU,IACT,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACtC,GACE,IACO,GACT,EAMR,KAAC,YAAY,IACX,QAAQ,EAAC,OAAO,EAChB,WAAW,EAAE,KAAK,EAClB,cAAc,EAAC,+DAA+D,EAC9E,WAAW,EAAE,mBAAmB,YAE/B,UAAU,GACE,IACX,GACgB,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import { useState, type ComponentType, type ReactNode } from \"react\";\nimport { NavLink, useLocation } from \"react-router\";\nimport {\n AgentSidebar,\n FeedbackButton,\n appPath,\n useActionQuery,\n} from \"@agent-native/core/client\";\nimport { InvitationBanner } from \"@agent-native/core/client/org\";\nimport { ToolsSidebarSection } from \"@agent-native/core/client/tools\";\nimport {\n IconArrowUpRight,\n IconApps,\n IconChartBar,\n IconBrandTelegram,\n IconKey,\n IconChevronDown,\n IconLayersSubtract,\n IconPlugConnected,\n IconBroadcast,\n IconFingerprint,\n IconHistory,\n IconPuzzle,\n IconShieldCheck,\n IconUsersGroup,\n} from \"@tabler/icons-react\";\nimport { cn } from \"@/lib/utils\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetTitle,\n} from \"@/components/ui/sheet\";\nimport { Header } from \"./Header\";\nimport { HeaderActionsProvider } from \"./HeaderActions\";\n\nexport type DispatchNavSection = \"primary\" | \"operations\";\n\nexport type DispatchNavIcon = ComponentType<{\n size?: number | string;\n className?: string;\n}>;\n\nexport interface DispatchNavItem {\n /** Stable id used for keys and navigation.view. Avoid built-in ids. */\n id: string;\n /** React Router path for the tab, usually backed by an app/routes/*.tsx file. */\n to: string;\n label: string;\n icon?: DispatchNavIcon;\n /** Defaults to \"operations\", which is where local management tools usually fit. */\n section?: DispatchNavSection;\n /** Override active matching for nested or multi-route tools. */\n match?: (pathname: string) => boolean;\n}\n\nexport interface DispatchExtensionConfig {\n /** Extra sidebar tabs supplied by the generated workspace. */\n navItems?: readonly DispatchNavItem[];\n /** Extra React Query keys to invalidate when Dispatch receives DB sync events. */\n queryKeys?: readonly string[];\n}\n\nconst PRIMARY_NAV_ITEMS = [\n {\n id: \"overview\",\n to: \"/overview\",\n label: \"Overview\",\n icon: IconBroadcast,\n section: \"primary\",\n },\n {\n id: \"apps\",\n to: \"/apps\",\n label: \"Apps\",\n icon: IconApps,\n section: \"primary\",\n },\n {\n id: \"metrics\",\n to: \"/metrics\",\n label: \"Metrics\",\n icon: IconChartBar,\n section: \"primary\",\n },\n {\n id: \"vault\",\n to: \"/vault\",\n label: \"Vault\",\n icon: IconKey,\n section: \"primary\",\n },\n {\n id: \"integrations\",\n to: \"/integrations\",\n label: \"Integrations\",\n icon: IconPuzzle,\n section: \"primary\",\n },\n {\n id: \"agents\",\n to: \"/agents\",\n label: \"Agents\",\n icon: IconPlugConnected,\n section: \"primary\",\n },\n] as const satisfies readonly DispatchNavItem[];\n\nconst OPERATIONS_NAV_ITEMS = [\n {\n id: \"workspace\",\n to: \"/workspace\",\n label: \"Resources\",\n icon: IconLayersSubtract,\n section: \"operations\",\n },\n {\n id: \"messaging\",\n to: \"/messaging\",\n label: \"Messaging\",\n icon: IconBrandTelegram,\n section: \"operations\",\n },\n {\n id: \"destinations\",\n to: \"/destinations\",\n label: \"Destinations\",\n icon: IconArrowUpRight,\n section: \"operations\",\n },\n {\n id: \"identities\",\n to: \"/identities\",\n label: \"Identities\",\n icon: IconFingerprint,\n section: \"operations\",\n },\n {\n id: \"approvals\",\n to: \"/approvals\",\n label: \"Approvals\",\n icon: IconShieldCheck,\n section: \"operations\",\n },\n {\n id: \"audit\",\n to: \"/audit\",\n label: \"Audit\",\n icon: IconHistory,\n section: \"operations\",\n },\n {\n id: \"team\",\n to: \"/team\",\n label: \"Team\",\n icon: IconUsersGroup,\n section: \"operations\",\n },\n] as const satisfies readonly DispatchNavItem[];\n\nconst EMPTY_NAV_ITEMS: readonly DispatchNavItem[] = [];\n\nconst SIDEBAR_SUGGESTIONS = [\n \"Create a new app\",\n \"Grant a key to an app\",\n \"Check integration health\",\n];\n\nconst CHROMELESS_PATHS = [\"/approval\"];\n\n// Routes whose page renders its own toolbar (with NotificationsBell + AgentToggleButton).\n// Layout still mounts the sidebar + AgentSidebar, but skips its own Header so\n// there's no double-header.\nfunction pageOwnsToolbar(pathname: string): boolean {\n if (pathname === \"/tools\" || pathname.startsWith(\"/tools/\")) return true;\n if (pathname === \"/extensions\" || pathname.startsWith(\"/extensions/\"))\n return true;\n return false;\n}\n\ninterface WorkspaceInfo {\n name: string | null;\n displayName: string | null;\n appCount: number;\n}\n\nfunction sectionFor(item: DispatchNavItem): DispatchNavSection {\n return item.section ?? \"operations\";\n}\n\nfunction navItemMatchesPath(item: DispatchNavItem, pathname: string): boolean {\n if (item.match) {\n try {\n if (item.match(pathname)) return true;\n } catch {\n return false;\n }\n }\n return pathname === item.to || pathname.startsWith(`${item.to}/`);\n}\n\nfunction navItemsForSection(\n items: readonly DispatchNavItem[],\n section: DispatchNavSection,\n): DispatchNavItem[] {\n return items.filter((item) => sectionFor(item) === section);\n}\n\nexport function NavContent({\n onNavigate,\n extensions,\n}: {\n onNavigate?: () => void;\n extensions?: DispatchExtensionConfig;\n}) {\n const location = useLocation();\n const { data: workspace } = useActionQuery(\n \"get-workspace-info\",\n {},\n { staleTime: 60_000 },\n );\n const ws = workspace as WorkspaceInfo | undefined;\n const workspaceLabel = ws?.displayName ?? ws?.name ?? null;\n const extensionNavItems = extensions?.navItems ?? EMPTY_NAV_ITEMS;\n const primaryNavItems = [\n ...PRIMARY_NAV_ITEMS,\n ...navItemsForSection(extensionNavItems, \"primary\"),\n ];\n const operationsNavItems = [\n ...OPERATIONS_NAV_ITEMS,\n ...navItemsForSection(extensionNavItems, \"operations\"),\n ];\n const operationsOpen = operationsNavItems.some((item) =>\n navItemMatchesPath(item, location.pathname),\n );\n\n const renderNavItem = (item: DispatchNavItem) => {\n const Icon = item.icon;\n return (\n <li key={item.id}>\n <NavLink\n to={item.to}\n onClick={onNavigate}\n className={({ isActive }) => {\n const active =\n isActive || navItemMatchesPath(item, location.pathname);\n return cn(\n \"flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm\",\n active\n ? \"bg-sidebar-accent font-medium text-sidebar-accent-foreground\"\n : \"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n );\n }}\n >\n {Icon ? (\n <Icon size={16} className=\"shrink-0\" />\n ) : (\n <span className=\"h-4 w-4 shrink-0\" aria-hidden=\"true\" />\n )}\n <span className=\"truncate\">{item.label}</span>\n </NavLink>\n </li>\n );\n };\n\n return (\n <>\n <div className=\"border-b px-4 py-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-xl border bg-card text-foreground\">\n <img\n src={appPath(\"/agent-native-icon-light.svg\")}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"block h-4 w-auto shrink-0 dark:hidden\"\n />\n <img\n src={appPath(\"/agent-native-icon-dark.svg\")}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"hidden h-4 w-auto shrink-0 dark:block\"\n />\n </div>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-foreground\">\n {workspaceLabel ?? \"Dispatch\"}\n </div>\n <div className=\"truncate text-xs text-muted-foreground\">\n {workspaceLabel\n ? `Workspace · ${ws?.appCount ?? 0} app${ws?.appCount === 1 ? \"\" : \"s\"}`\n : \"Workspace control plane\"}\n </div>\n </div>\n </div>\n </div>\n\n <nav className=\"flex-1 overflow-y-auto px-2 py-3\">\n <ul className=\"space-y-0.5\">{primaryNavItems.map(renderNavItem)}</ul>\n <details className=\"group mt-4\" open={operationsOpen}>\n <summary className=\"flex h-8 cursor-pointer list-none items-center justify-between rounded-md px-2 text-xs font-medium uppercase text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&::-webkit-details-marker]:hidden\">\n <span>Operations</span>\n <IconChevronDown\n size={14}\n className=\"transition-transform group-open:rotate-180\"\n />\n </summary>\n <ul className=\"mt-1 space-y-0.5\">\n {operationsNavItems.map(renderNavItem)}\n </ul>\n </details>\n </nav>\n\n <div className=\"border-t px-2 py-2\">\n <ToolsSidebarSection />\n <FeedbackButton />\n </div>\n </>\n );\n}\n\nexport function Layout({\n children,\n extensions,\n}: {\n children: ReactNode;\n extensions?: DispatchExtensionConfig;\n}) {\n const location = useLocation();\n const [mobileOpen, setMobileOpen] = useState(false);\n\n if (CHROMELESS_PATHS.some((path) => location.pathname === path)) {\n return <>{children}</>;\n }\n\n const showHeader = !pageOwnsToolbar(location.pathname);\n const appContent = (\n <div className=\"flex h-full flex-1 flex-col overflow-hidden\">\n {showHeader ? <Header onOpenMobile={() => setMobileOpen(true)} /> : null}\n <InvitationBanner />\n <main className=\"flex-1 overflow-y-auto\">\n {showHeader ? (\n <div className=\"mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6\">\n {children}\n </div>\n ) : (\n children\n )}\n </main>\n </div>\n );\n\n return (\n <HeaderActionsProvider>\n <div className=\"flex h-screen w-full overflow-hidden bg-background\">\n <aside className=\"hidden lg:flex w-64 shrink-0 flex-col border-r bg-sidebar text-sidebar-foreground\">\n <NavContent extensions={extensions} />\n </aside>\n\n <Sheet open={mobileOpen} onOpenChange={setMobileOpen}>\n <SheetContent\n side=\"left\"\n className=\"w-72 p-0 bg-sidebar text-sidebar-foreground [&>button]:hidden\"\n >\n <SheetTitle className=\"sr-only\">Navigation</SheetTitle>\n <SheetDescription className=\"sr-only\">\n Workspace navigation links\n </SheetDescription>\n <div className=\"flex h-full w-full flex-col\">\n <NavContent\n extensions={extensions}\n onNavigate={() => setMobileOpen(false)}\n />\n </div>\n </SheetContent>\n </Sheet>\n\n {/*\n * Always mount AgentSidebar so home composer's sendToAgentChat\n * fallback can pop it via agent-panel:open.\n */}\n <AgentSidebar\n position=\"right\"\n defaultOpen={false}\n emptyStateText=\"Create apps, grant keys, and route work across the workspace.\"\n suggestions={SIDEBAR_SUGGESTIONS}\n >\n {appContent}\n </AgentSidebar>\n </div>\n </HeaderActionsProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,OAAO,EACP,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AA6BxD,MAAM,iBAAiB,GAAG;IACxB;QACE,EAAE,EAAE,UAAU;QACd,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,SAAS;KACnB;IACD;QACE,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,QA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CAAC,CACZ,cAAK,SAAS,EAAC,+CAA+C,YAC3D,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,GACI,IACH,CACP,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,cACpB,eAAK,SAAS,EAAC,oDAAoD,aACjE,gBAAO,SAAS,EAAC,mFAAmF,YAClG,KAAC,UAAU,IAAC,UAAU,EAAE,UAAU,GAAI,GAChC,EAER,KAAC,KAAK,IAAC,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,YAClD,MAAC,YAAY,IACX,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,+DAA+D,aAEzE,KAAC,UAAU,IAAC,SAAS,EAAC,SAAS,2BAAwB,EACvD,KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,2CAElB,EACnB,cAAK,SAAS,EAAC,6BAA6B,YAC1C,KAAC,UAAU,IACT,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACtC,GACE,IACO,GACT,EAMR,KAAC,YAAY,IACX,QAAQ,EAAC,OAAO,EAChB,WAAW,EAAE,KAAK,EAClB,cAAc,EAAC,+DAA+D,EAC9E,WAAW,EAAE,mBAAmB,YAE/B,UAAU,GACE,IACX,GACgB,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import { useState, type ComponentType, type ReactNode } from \"react\";\nimport { NavLink, useLocation } from \"react-router\";\nimport {\n AgentSidebar,\n FeedbackButton,\n appPath,\n useActionQuery,\n} from \"@agent-native/core/client\";\nimport { ExtensionsSidebarSection } from \"@agent-native/core/client/extensions\";\nimport { InvitationBanner, OrgSwitcher } from \"@agent-native/core/client/org\";\nimport {\n IconArrowUpRight,\n IconApps,\n IconChartBar,\n IconBrandTelegram,\n IconKey,\n IconChevronDown,\n IconLayersSubtract,\n IconPlugConnected,\n IconBroadcast,\n IconFingerprint,\n IconHistory,\n IconPuzzle,\n IconShieldCheck,\n IconUsersGroup,\n} from \"@tabler/icons-react\";\nimport { cn } from \"@/lib/utils\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetTitle,\n} from \"@/components/ui/sheet\";\nimport { Header } from \"./Header\";\nimport { HeaderActionsProvider } from \"./HeaderActions\";\n\nexport type DispatchNavSection = \"primary\" | \"operations\";\n\nexport type DispatchNavIcon = ComponentType<{\n size?: number | string;\n className?: string;\n}>;\n\nexport interface DispatchNavItem {\n /** Stable id used for keys and navigation.view. Avoid built-in ids. */\n id: string;\n /** React Router path for the tab, usually backed by an app/routes/*.tsx file. */\n to: string;\n label: string;\n icon?: DispatchNavIcon;\n /** Defaults to \"operations\", which is where local management tools usually fit. */\n section?: DispatchNavSection;\n /** Override active matching for nested or multi-route tools. */\n match?: (pathname: string) => boolean;\n}\n\nexport interface DispatchExtensionConfig {\n /** Extra sidebar tabs supplied by the generated workspace. */\n navItems?: readonly DispatchNavItem[];\n /** Extra React Query keys to invalidate when Dispatch receives DB sync events. */\n queryKeys?: readonly string[];\n}\n\nconst PRIMARY_NAV_ITEMS = [\n {\n id: \"overview\",\n to: \"/overview\",\n label: \"Overview\",\n icon: IconBroadcast,\n section: \"primary\",\n },\n {\n id: \"apps\",\n to: \"/apps\",\n label: \"Apps\",\n icon: IconApps,\n section: \"primary\",\n },\n {\n id: \"metrics\",\n to: \"/metrics\",\n label: \"Metrics\",\n icon: IconChartBar,\n section: \"primary\",\n },\n {\n id: \"vault\",\n to: \"/vault\",\n label: \"Vault\",\n icon: IconKey,\n section: \"primary\",\n },\n {\n id: \"integrations\",\n to: \"/integrations\",\n label: \"Integrations\",\n icon: IconPuzzle,\n section: \"primary\",\n },\n {\n id: \"agents\",\n to: \"/agents\",\n label: \"Agents\",\n icon: IconPlugConnected,\n section: \"primary\",\n },\n] as const satisfies readonly DispatchNavItem[];\n\nconst OPERATIONS_NAV_ITEMS = [\n {\n id: \"workspace\",\n to: \"/workspace\",\n label: \"Resources\",\n icon: IconLayersSubtract,\n section: \"operations\",\n },\n {\n id: \"messaging\",\n to: \"/messaging\",\n label: \"Messaging\",\n icon: IconBrandTelegram,\n section: \"operations\",\n },\n {\n id: \"destinations\",\n to: \"/destinations\",\n label: \"Destinations\",\n icon: IconArrowUpRight,\n section: \"operations\",\n },\n {\n id: \"identities\",\n to: \"/identities\",\n label: \"Identities\",\n icon: IconFingerprint,\n section: \"operations\",\n },\n {\n id: \"approvals\",\n to: \"/approvals\",\n label: \"Approvals\",\n icon: IconShieldCheck,\n section: \"operations\",\n },\n {\n id: \"audit\",\n to: \"/audit\",\n label: \"Audit\",\n icon: IconHistory,\n section: \"operations\",\n },\n {\n id: \"team\",\n to: \"/team\",\n label: \"Team\",\n icon: IconUsersGroup,\n section: \"operations\",\n },\n] as const satisfies readonly DispatchNavItem[];\n\nconst EMPTY_NAV_ITEMS: readonly DispatchNavItem[] = [];\n\nconst SIDEBAR_SUGGESTIONS = [\n \"Create a new app\",\n \"Grant a key to an app\",\n \"Check integration health\",\n];\n\nconst CHROMELESS_PATHS = [\"/approval\"];\n\n// Routes whose page renders its own toolbar (with NotificationsBell + AgentToggleButton).\n// Layout still mounts the sidebar + AgentSidebar, but skips its own Header so\n// there's no double-header.\nfunction pageOwnsToolbar(pathname: string): boolean {\n if (pathname === \"/tools\" || pathname.startsWith(\"/tools/\")) return true;\n if (pathname === \"/extensions\" || pathname.startsWith(\"/extensions/\"))\n return true;\n return false;\n}\n\ninterface WorkspaceInfo {\n name: string | null;\n displayName: string | null;\n appCount: number;\n}\n\nfunction sectionFor(item: DispatchNavItem): DispatchNavSection {\n return item.section ?? \"operations\";\n}\n\nfunction navItemMatchesPath(item: DispatchNavItem, pathname: string): boolean {\n if (item.match) {\n try {\n if (item.match(pathname)) return true;\n } catch {\n return false;\n }\n }\n return pathname === item.to || pathname.startsWith(`${item.to}/`);\n}\n\nfunction navItemsForSection(\n items: readonly DispatchNavItem[],\n section: DispatchNavSection,\n): DispatchNavItem[] {\n return items.filter((item) => sectionFor(item) === section);\n}\n\nexport function NavContent({\n onNavigate,\n extensions,\n}: {\n onNavigate?: () => void;\n extensions?: DispatchExtensionConfig;\n}) {\n const location = useLocation();\n const { data: workspace } = useActionQuery(\n \"get-workspace-info\",\n {},\n { staleTime: 60_000 },\n );\n const ws = workspace as WorkspaceInfo | undefined;\n const workspaceLabel = ws?.displayName ?? ws?.name ?? null;\n const extensionNavItems = extensions?.navItems ?? EMPTY_NAV_ITEMS;\n const primaryNavItems = [\n ...PRIMARY_NAV_ITEMS,\n ...navItemsForSection(extensionNavItems, \"primary\"),\n ];\n const operationsNavItems = [\n ...OPERATIONS_NAV_ITEMS,\n ...navItemsForSection(extensionNavItems, \"operations\"),\n ];\n const operationsOpen = operationsNavItems.some((item) =>\n navItemMatchesPath(item, location.pathname),\n );\n\n const renderNavItem = (item: DispatchNavItem) => {\n const Icon = item.icon;\n return (\n <li key={item.id}>\n <NavLink\n to={item.to}\n onClick={onNavigate}\n className={({ isActive }) => {\n const active =\n isActive || navItemMatchesPath(item, location.pathname);\n return cn(\n \"flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm\",\n active\n ? \"bg-sidebar-accent font-medium text-sidebar-accent-foreground\"\n : \"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n );\n }}\n >\n {Icon ? (\n <Icon size={16} className=\"shrink-0\" />\n ) : (\n <span className=\"h-4 w-4 shrink-0\" aria-hidden=\"true\" />\n )}\n <span className=\"truncate\">{item.label}</span>\n </NavLink>\n </li>\n );\n };\n\n return (\n <>\n <div className=\"border-b px-4 py-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-xl border bg-card text-foreground\">\n <img\n src={appPath(\"/agent-native-icon-light.svg\")}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"block h-4 w-auto shrink-0 dark:hidden\"\n />\n <img\n src={appPath(\"/agent-native-icon-dark.svg\")}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"hidden h-4 w-auto shrink-0 dark:block\"\n />\n </div>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-foreground\">\n {workspaceLabel ?? \"Dispatch\"}\n </div>\n <div className=\"truncate text-xs text-muted-foreground\">\n {workspaceLabel\n ? `Workspace · ${ws?.appCount ?? 0} app${ws?.appCount === 1 ? \"\" : \"s\"}`\n : \"Workspace control plane\"}\n </div>\n </div>\n </div>\n </div>\n\n <nav className=\"flex-1 overflow-y-auto px-2 py-3\">\n <ul className=\"space-y-0.5\">{primaryNavItems.map(renderNavItem)}</ul>\n <details className=\"group mt-4\" open={operationsOpen}>\n <summary className=\"flex h-8 cursor-pointer list-none items-center justify-between rounded-md px-2 text-xs font-medium uppercase text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&::-webkit-details-marker]:hidden\">\n <span>Operations</span>\n <IconChevronDown\n size={14}\n className=\"transition-transform group-open:rotate-180\"\n />\n </summary>\n <ul className=\"mt-1 space-y-0.5\">\n {operationsNavItems.map(renderNavItem)}\n </ul>\n </details>\n </nav>\n\n <div className=\"border-t px-2 py-2\">\n <ExtensionsSidebarSection />\n </div>\n\n <div className=\"space-y-2 border-t px-3 py-2\">\n <FeedbackButton />\n <OrgSwitcher />\n </div>\n </>\n );\n}\n\nexport function Layout({\n children,\n extensions,\n}: {\n children: ReactNode;\n extensions?: DispatchExtensionConfig;\n}) {\n const location = useLocation();\n const [mobileOpen, setMobileOpen] = useState(false);\n\n if (CHROMELESS_PATHS.some((path) => location.pathname === path)) {\n return <>{children}</>;\n }\n\n const showHeader = !pageOwnsToolbar(location.pathname);\n const appContent = (\n <div className=\"flex h-full flex-1 flex-col overflow-hidden\">\n {showHeader ? <Header onOpenMobile={() => setMobileOpen(true)} /> : null}\n <InvitationBanner />\n <main className=\"flex-1 overflow-y-auto\">\n {showHeader ? (\n <div className=\"mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6\">\n {children}\n </div>\n ) : (\n children\n )}\n </main>\n </div>\n );\n\n return (\n <HeaderActionsProvider>\n <div className=\"flex h-screen w-full overflow-hidden bg-background\">\n <aside className=\"hidden lg:flex w-64 shrink-0 flex-col border-r bg-sidebar text-sidebar-foreground\">\n <NavContent extensions={extensions} />\n </aside>\n\n <Sheet open={mobileOpen} onOpenChange={setMobileOpen}>\n <SheetContent\n side=\"left\"\n className=\"w-72 p-0 bg-sidebar text-sidebar-foreground [&>button]:hidden\"\n >\n <SheetTitle className=\"sr-only\">Navigation</SheetTitle>\n <SheetDescription className=\"sr-only\">\n Workspace navigation links\n </SheetDescription>\n <div className=\"flex h-full w-full flex-col\">\n <NavContent\n extensions={extensions}\n onNavigate={() => setMobileOpen(false)}\n />\n </div>\n </SheetContent>\n </Sheet>\n\n {/*\n * Always mount AgentSidebar so home composer's sendToAgentChat\n * fallback can pop it via agent-panel:open.\n */}\n <AgentSidebar\n position=\"right\"\n defaultOpen={false}\n emptyStateText=\"Create apps, grant keys, and route work across the workspace.\"\n suggestions={SIDEBAR_SUGGESTIONS}\n >\n {appContent}\n </AgentSidebar>\n </div>\n </HeaderActionsProvider>\n );\n}\n"]}
@@ -6,14 +6,14 @@ const DISPATCH_INTEGRATION_SYSTEM_PROMPT = `You are the central dispatch for thi
6
6
 
7
7
  Default posture:
8
8
  - Treat Slack, Telegram, and email as shared entrypoints into the workspace.
9
- - 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), and design (visual designs).
9
+ - 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 images (brand image libraries and generated raster imagery).
10
10
  - Use list-connected-agents to see what agents are available before assuming a request must be handled locally.
11
11
  - 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.
12
12
  - Keep durable memory and operating instructions in resources rather than ephemeral chat.
13
13
  - Reply in the originating thread unless the user explicitly asks you to send to a saved destination.
14
14
 
15
15
  When a user asks for something:
16
- - If it belongs to analytics, content, slides, videos, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.
16
+ - If it belongs to analytics, content, slides, videos, images, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.
17
17
  - 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.
18
18
  - 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.
19
19
  - 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.
@@ -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;;;;;;;;;;;;;;;;;;;4FAmBiD,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), and design (visual designs).\n- Use list-connected-agents 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- 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, 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 the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/starter 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>, and making it appear in the workspace apps list. 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"]}
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;;;;;;;;;;;;;;;;;;;4FAmBiD,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 images (brand image libraries and generated raster imagery).\n- Use list-connected-agents 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- 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, images, 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 the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/starter 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>, and making it appear in the workspace apps list. 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.2.8",
3
+ "version": "0.2.9",
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",
@@ -97,7 +97,7 @@
97
97
  "typescript": "^6.0.3",
98
98
  "vite": "8.0.3",
99
99
  "vitest": "^4.1.5",
100
- "@agent-native/core": "0.12.7"
100
+ "@agent-native/core": "0.12.9"
101
101
  },
102
102
  "scripts": {
103
103
  "build": "tsc && tsc-alias --resolve-full-paths",
@@ -6,8 +6,8 @@ import {
6
6
  appPath,
7
7
  useActionQuery,
8
8
  } from "@agent-native/core/client";
9
- import { InvitationBanner } from "@agent-native/core/client/org";
10
- import { ToolsSidebarSection } from "@agent-native/core/client/tools";
9
+ import { ExtensionsSidebarSection } from "@agent-native/core/client/extensions";
10
+ import { InvitationBanner, OrgSwitcher } from "@agent-native/core/client/org";
11
11
  import {
12
12
  IconArrowUpRight,
13
13
  IconApps,
@@ -311,8 +311,12 @@ export function NavContent({
311
311
  </nav>
312
312
 
313
313
  <div className="border-t px-2 py-2">
314
- <ToolsSidebarSection />
314
+ <ExtensionsSidebarSection />
315
+ </div>
316
+
317
+ <div className="space-y-2 border-t px-3 py-2">
315
318
  <FeedbackButton />
319
+ <OrgSwitcher />
316
320
  </div>
317
321
  </>
318
322
  );
@@ -10,14 +10,14 @@ const DISPATCH_INTEGRATION_SYSTEM_PROMPT = `You are the central dispatch for thi
10
10
 
11
11
  Default posture:
12
12
  - Treat Slack, Telegram, and email as shared entrypoints into the workspace.
13
- - 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), and design (visual designs).
13
+ - 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 images (brand image libraries and generated raster imagery).
14
14
  - Use list-connected-agents to see what agents are available before assuming a request must be handled locally.
15
15
  - 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.
16
16
  - Keep durable memory and operating instructions in resources rather than ephemeral chat.
17
17
  - Reply in the originating thread unless the user explicitly asks you to send to a saved destination.
18
18
 
19
19
  When a user asks for something:
20
- - If it belongs to analytics, content, slides, videos, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.
20
+ - If it belongs to analytics, content, slides, videos, images, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.
21
21
  - 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.
22
22
  - 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.
23
23
  - 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.