@agent-native/dispatch 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../src/routes/pages/workspace.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,SAAS,EACT,QAAQ,EACR,KAAK,GACN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,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AEN,MAAC,IAAI,IAAC,YAAY,EAAC,QAAQ,aACzB,MAAC,QAAQ,eACP,MAAC,WAAW,IAAC,KAAK,EAAC,QAAQ,wBACjB,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,GAAG,IACrC,EACd,MAAC,WAAW,IAAC,KAAK,EAAC,cAAc,8BACjB,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,YAAY,CAAC,MAAM,GAAG,IACvD,EACd,MAAC,WAAW,IAAC,KAAK,EAAC,QAAQ,wBACjB,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,GAAG,IACrC,EACd,MAAC,WAAW,IAAC,KAAK,EAAC,WAAW,2BACjB,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,SAAS,CAAC,MAAM,GAAG,IAC9C,IACL,EAEX,KAAC,WAAW,IAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAC,MAAM,YAC1C,KAAC,YAAY,IACX,KAAK,EAAE,MAAM,EACb,SAAS,EAAC,2EAA2E,GACrF,GACU,EAEd,KAAC,WAAW,IAAC,KAAK,EAAC,cAAc,EAAC,SAAS,EAAC,MAAM,YAChD,KAAC,YAAY,IACX,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,sFAAsF,GAChG,GACU,EAEd,KAAC,WAAW,IAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAC,MAAM,YAC1C,KAAC,YAAY,IACX,KAAK,EAAE,MAAM,EACb,SAAS,EAAC,+FAA+F,GACzG,GACU,EAEd,KAAC,WAAW,IAAC,KAAK,EAAC,WAAW,EAAC,SAAS,EAAC,MAAM,YAC7C,KAAC,YAAY,IACX,KAAK,EAAE,SAAS,EAChB,SAAS,EAAC,kFAAkF,GAC5F,GACU,IACT,IACO,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useState } from \"react\";\nimport { useActionMutation, useActionQuery } from \"@agent-native/core/client\";\nimport { toast } from \"sonner\";\nimport {\n IconBook,\n IconChevronDown,\n IconChevronRight,\n IconCode,\n IconFileText,\n IconPlus,\n IconRefresh,\n IconTrash,\n IconUser,\n IconX,\n} from \"@tabler/icons-react\";\nimport { DispatchShell } from \"@/components/dispatch-shell\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"@/components/ui/alert-dialog\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/ui/dialog\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport { Textarea } from \"@/components/ui/textarea\";\n\nexport function meta() {\n return [{ title: \"Workspace Resources — Dispatch\" }];\n}\n\nconst KIND_CONFIG = {\n skill: {\n label: \"Skill\",\n icon: IconCode,\n pathPrefix: \"skills/\",\n description: \"Agent skills — detailed guidance for patterns and workflows\",\n },\n instruction: {\n label: \"Instruction\",\n icon: IconBook,\n pathPrefix: \"\",\n description:\n \"Agent instructions — operational rules and behavioral guidance\",\n },\n agent: {\n label: \"Agent\",\n icon: IconUser,\n pathPrefix: \"agents/\",\n description:\n \"Reusable agent profiles — specialist agents shared across apps\",\n },\n knowledge: {\n label: \"Knowledge\",\n icon: IconFileText,\n pathPrefix: \"context/\",\n description:\n \"Knowledge packs — reusable GTM, product, and domain context for apps\",\n },\n} as const;\n\nfunction AddResourceDialog() {\n const [open, setOpen] = useState(false);\n const [kind, setKind] = useState<string>(\"skill\");\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [path, setPath] = useState(\"\");\n const [content, setContent] = useState(\"\");\n const [scope, setScope] = useState<string>(\"all\");\n\n const create = useActionMutation(\"create-workspace-resource\", {\n onSuccess: () => {\n toast.success(\"Resource created\");\n setOpen(false);\n setKind(\"skill\");\n setName(\"\");\n setDescription(\"\");\n setPath(\"\");\n setContent(\"\");\n setScope(\"all\");\n },\n onError: (err) => toast.error(String(err)),\n });\n\n const kindInfo = KIND_CONFIG[kind as keyof typeof KIND_CONFIG];\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button>\n <IconPlus size={16} className=\"mr-1.5\" />\n Add resource\n </Button>\n </DialogTrigger>\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>Add workspace resource</DialogTitle>\n <DialogDescription>\n Create a skill, instruction, or agent profile that can be shared\n across workspace apps.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-4 py-2\">\n <div className=\"grid grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <Label>Kind</Label>\n <Select value={kind} onValueChange={setKind}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"skill\">Skill</SelectItem>\n <SelectItem value=\"instruction\">Instruction</SelectItem>\n <SelectItem value=\"agent\">Agent</SelectItem>\n <SelectItem value=\"knowledge\">Knowledge pack</SelectItem>\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-2\">\n <Label>Scope</Label>\n <Select value={scope} onValueChange={setScope}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">All apps</SelectItem>\n <SelectItem value=\"selected\">Selected apps only</SelectItem>\n </SelectContent>\n </Select>\n </div>\n </div>\n <div className=\"space-y-2\">\n <Label>Name</Label>\n <Input\n placeholder={\n kind === \"skill\"\n ? \"Frontend Designer\"\n : kind === \"agent\"\n ? \"Research Specialist\"\n : kind === \"knowledge\"\n ? \"Core GTM Messaging\"\n : \"Code Style Guide\"\n }\n value={name}\n onChange={(e) => setName(e.target.value)}\n />\n </div>\n <div className=\"space-y-2\">\n <Label>Path</Label>\n <Input\n placeholder={`${kindInfo?.pathPrefix || \"\"}${name.toLowerCase().replace(/\\s+/g, \"-\") || \"example\"}.md`}\n value={path}\n onChange={(e) => setPath(e.target.value)}\n className=\"font-mono text-sm\"\n />\n <p className=\"text-xs text-muted-foreground\">\n Resource path in target apps. Skills go in skills/, agents in\n agents/, knowledge packs in context/.\n </p>\n </div>\n <div className=\"space-y-2\">\n <Label>Description (optional)</Label>\n <Input\n placeholder=\"Short description of what this resource does\"\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n />\n </div>\n <div className=\"space-y-2\">\n <Label>Content</Label>\n <Textarea\n placeholder={\n kind === \"skill\"\n ? \"---\\nname: my-skill\\ndescription: What this skill teaches\\n---\\n\\n# My Skill\\n\\n...\"\n : kind === \"agent\"\n ? \"---\\nname: Research Specialist\\ndescription: Handles research tasks\\n---\\n\\n# Instructions\\n\\n...\"\n : kind === \"knowledge\"\n ? \"# Core GTM Messaging\\n\\n## Positioning\\n\\n## ICP\\n\\n## Proof points\\n\\n## Source\\n\\n\"\n : \"# Instructions\\n\\nBehavioral rules and guidance for agents across apps...\"\n }\n value={content}\n onChange={(e) => setContent(e.target.value)}\n rows={12}\n className=\"font-mono text-sm\"\n />\n </div>\n </div>\n <DialogFooter>\n <Button\n onClick={() =>\n create.mutate({\n kind: kind as \"skill\" | \"instruction\" | \"agent\" | \"knowledge\",\n name,\n description: description || undefined,\n path:\n path ||\n `${kindInfo?.pathPrefix || \"\"}${name.toLowerCase().replace(/\\s+/g, \"-\")}.md`,\n content,\n scope: scope as \"all\" | \"selected\",\n })\n }\n disabled={!name || !content || create.isPending}\n >\n {create.isPending ? \"Creating...\" : \"Create resource\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction GrantDialog({\n resourceId,\n resourceName,\n}: {\n resourceId: string;\n resourceName: string;\n}) {\n const [open, setOpen] = useState(false);\n const [appId, setAppId] = useState(\"\");\n const { data: catalog } = useActionQuery(\"list-integrations-catalog\", {});\n\n const grant = useActionMutation(\"create-workspace-resource-grant\", {\n onSuccess: () => {\n toast.success(`Granted to ${appId}`);\n setOpen(false);\n setAppId(\"\");\n },\n onError: (err) => toast.error(String(err)),\n });\n\n const apps = (catalog || []).map((a: any) => ({\n id: a.appId,\n name: a.appName,\n }));\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"outline\" size=\"sm\">\n <IconPlus size={14} className=\"mr-1\" />\n Grant\n </Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Grant \"{resourceName}\" to an app</DialogTitle>\n <DialogDescription>\n Choose which app should receive this resource.\n </DialogDescription>\n </DialogHeader>\n <div className=\"py-2\">\n <Select value={appId} onValueChange={setAppId}>\n <SelectTrigger>\n <SelectValue placeholder=\"Select an app...\" />\n </SelectTrigger>\n <SelectContent>\n {apps.map((app: any) => (\n <SelectItem key={app.id} value={app.id}>\n {app.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <DialogFooter>\n <Button\n onClick={() => grant.mutate({ resourceId, appId })}\n disabled={!appId || grant.isPending}\n >\n {grant.isPending ? \"Granting...\" : \"Grant access\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction ResourceRow({ resource, grants }: { resource: any; grants: any[] }) {\n const [expanded, setExpanded] = useState(false);\n\n const deleteResource = useActionMutation(\"delete-workspace-resource\", {\n onSuccess: () => toast.success(\"Resource deleted\"),\n onError: (err) => toast.error(String(err)),\n });\n const revokeGrant = useActionMutation(\"revoke-workspace-resource-grant\", {\n onSuccess: () => toast.success(\"Grant revoked\"),\n onError: (err) => toast.error(String(err)),\n });\n const syncToApp = useActionMutation(\"sync-workspace-resources-to-app\", {\n onSuccess: (data: any) =>\n toast.success(`Synced ${data.synced} resource(s) to ${data.appId}`),\n onError: (err) => toast.error(String(err)),\n });\n\n const kindInfo = KIND_CONFIG[resource.kind as keyof typeof KIND_CONFIG];\n const KindIcon = kindInfo?.icon || IconCode;\n const activeGrants = grants.filter((g) => g.status === \"active\");\n\n return (\n <div className=\"rounded-xl border bg-card\">\n <button\n type=\"button\"\n className=\"flex w-full items-center gap-3 px-4 py-3 text-left cursor-pointer\"\n onClick={() => setExpanded(!expanded)}\n >\n {expanded ? (\n <IconChevronDown size={16} className=\"text-muted-foreground\" />\n ) : (\n <IconChevronRight size={16} className=\"text-muted-foreground\" />\n )}\n <KindIcon size={16} className=\"text-muted-foreground\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium text-foreground\">\n {resource.name}\n </span>\n <Badge variant=\"secondary\" className=\"text-xs\">\n {kindInfo?.label || resource.kind}\n </Badge>\n <Badge\n variant=\"outline\"\n className={\n resource.scope === \"all\"\n ? \"text-xs bg-green-500/10 text-green-700 dark:text-green-400\"\n : \"text-xs\"\n }\n >\n {resource.scope === \"all\" ? \"All apps\" : \"Selected\"}\n </Badge>\n </div>\n <div className=\"mt-0.5 font-mono text-xs text-muted-foreground\">\n {resource.path}\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n {resource.scope === \"selected\" && (\n <Badge variant=\"outline\" className=\"text-xs\">\n {activeGrants.length} grant\n {activeGrants.length !== 1 ? \"s\" : \"\"}\n </Badge>\n )}\n </div>\n </button>\n\n {expanded && (\n <div className=\"border-t px-4 py-3 space-y-3\">\n {resource.description && (\n <p className=\"text-sm text-muted-foreground\">\n {resource.description}\n </p>\n )}\n\n <div className=\"rounded-lg border bg-muted/30 p-3\">\n <pre className=\"whitespace-pre-wrap text-xs font-mono text-foreground max-h-64 overflow-y-auto\">\n {resource.content}\n </pre>\n </div>\n\n {resource.scope === \"selected\" && (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs font-medium text-foreground\">\n Grants\n </span>\n <GrantDialog\n resourceId={resource.id}\n resourceName={resource.name}\n />\n </div>\n {activeGrants.length > 0 ? (\n <div className=\"space-y-1.5\">\n {activeGrants.map((grant: any) => (\n <div\n key={grant.id}\n className=\"flex items-center justify-between rounded-lg border px-3 py-2\"\n >\n <div>\n <span className=\"text-sm font-medium text-foreground\">\n {grant.appId}\n </span>\n <span className=\"ml-2 text-xs text-muted-foreground\">\n {grant.syncedAt\n ? `synced ${new Date(grant.syncedAt).toLocaleString()}`\n : \"not synced\"}\n </span>\n </div>\n <div className=\"flex gap-1.5\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() =>\n syncToApp.mutate({ appId: grant.appId })\n }\n disabled={syncToApp.isPending}\n >\n <IconRefresh size={14} />\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() =>\n revokeGrant.mutate({ grantId: grant.id })\n }\n disabled={revokeGrant.isPending}\n >\n <IconX size={14} />\n </Button>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"rounded-lg border border-dashed px-3 py-4 text-center text-xs text-muted-foreground\">\n No grants yet. Grant this resource to specific apps.\n </div>\n )}\n </div>\n )}\n\n <div className=\"flex justify-between border-t pt-3\">\n <div className=\"text-xs text-muted-foreground\">\n Created by {resource.createdBy} ·{\" \"}\n {new Date(resource.createdAt).toLocaleString()}\n </div>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n disabled={deleteResource.isPending}\n >\n <IconTrash size={14} className=\"mr-1\" />\n Delete\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Delete this resource?</AlertDialogTitle>\n <AlertDialogDescription>\n Removing \"{resource.name}\" revokes all of its grants. Apps\n that depended on this resource will lose access on the next\n sync. This cannot be undone.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => deleteResource.mutate({ id: resource.id })}\n >\n Delete resource\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default function WorkspaceRoute() {\n const { data: resources, isLoading } = useActionQuery(\n \"list-workspace-resources\",\n {},\n );\n const { data: grants } = useActionQuery(\"list-workspace-resource-grants\", {});\n\n const syncAll = useActionMutation(\"sync-workspace-resources-to-all\", {\n onSuccess: (data: any) => {\n const total = (data || []).reduce(\n (sum: number, r: any) => sum + r.synced,\n 0,\n );\n toast.success(\n `Synced resources to ${data?.length || 0} apps (${total} total pushes)`,\n );\n },\n onError: (err) => toast.error(String(err)),\n });\n\n const grantsByResource = (grants || []).reduce(\n (acc: Record<string, any[]>, g: any) => {\n if (!acc[g.resourceId]) acc[g.resourceId] = [];\n acc[g.resourceId].push(g);\n return acc;\n },\n {} as Record<string, any[]>,\n );\n\n const skills = (resources || []).filter((r: any) => r.kind === \"skill\");\n const instructions = (resources || []).filter(\n (r: any) => r.kind === \"instruction\",\n );\n const agents = (resources || []).filter((r: any) => r.kind === \"agent\");\n const knowledge = (resources || []).filter(\n (r: any) => r.kind === \"knowledge\",\n );\n\n function ResourceList({\n items,\n emptyText,\n }: {\n items: any[];\n emptyText: string;\n }) {\n if (items.length === 0) {\n return (\n <div className=\"rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground\">\n {emptyText}\n </div>\n );\n }\n return (\n <div className=\"space-y-3\">\n {items.map((resource: any) => (\n <ResourceRow\n key={resource.id}\n resource={resource}\n grants={grantsByResource[resource.id] || []}\n />\n ))}\n </div>\n );\n }\n\n return (\n <DispatchShell\n title=\"Workspace Resources\"\n description=\"Share skills, instructions, agent profiles, and knowledge packs across workspace apps. Scope to all apps or grant per-app.\"\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"text-sm text-muted-foreground\">\n {isLoading\n ? \"Loading...\"\n : `${resources?.length || 0} resource${(resources?.length || 0) !== 1 ? \"s\" : \"\"}`}\n </div>\n <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n onClick={() => syncAll.mutate({})}\n disabled={syncAll.isPending || (resources?.length || 0) === 0}\n >\n <IconRefresh\n size={16}\n className={syncAll.isPending ? \"mr-1.5 animate-spin\" : \"mr-1.5\"}\n />\n Sync all\n </Button>\n <AddResourceDialog />\n </div>\n </div>\n\n <Tabs defaultValue=\"skills\">\n <TabsList>\n <TabsTrigger value=\"skills\">\n Skills {skills.length > 0 && `(${skills.length})`}\n </TabsTrigger>\n <TabsTrigger value=\"instructions\">\n Instructions {instructions.length > 0 && `(${instructions.length})`}\n </TabsTrigger>\n <TabsTrigger value=\"agents\">\n Agents {agents.length > 0 && `(${agents.length})`}\n </TabsTrigger>\n <TabsTrigger value=\"knowledge\">\n Knowledge {knowledge.length > 0 && `(${knowledge.length})`}\n </TabsTrigger>\n </TabsList>\n\n <TabsContent value=\"skills\" className=\"mt-4\">\n <ResourceList\n items={skills}\n emptyText=\"No workspace skills yet. Add a skill to share agent guidance across apps.\"\n />\n </TabsContent>\n\n <TabsContent value=\"instructions\" className=\"mt-4\">\n <ResourceList\n items={instructions}\n emptyText=\"No workspace instructions yet. Add instructions to set behavioral rules across apps.\"\n />\n </TabsContent>\n\n <TabsContent value=\"agents\" className=\"mt-4\">\n <ResourceList\n items={agents}\n emptyText=\"No workspace agents yet. Add a reusable agent profile to share specialist agents across apps.\"\n />\n </TabsContent>\n\n <TabsContent value=\"knowledge\" className=\"mt-4\">\n <ResourceList\n items={knowledge}\n emptyText=\"No knowledge packs yet. Add GTM, product, or domain context that apps can reuse.\"\n />\n </TabsContent>\n </Tabs>\n </DispatchShell>\n );\n}\n"]}
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../src/routes/pages/workspace.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,cAAc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AC,+FAA+F,GACzG,GACU,EAEd,KAAC,WAAW,IAAC,KAAK,EAAC,WAAW,EAAC,SAAS,EAAC,MAAM,YAC7C,KAAC,YAAY,IACX,KAAK,EAAE,SAAS,EAChB,SAAS,EAAC,kFAAkF,GAC5F,GACU,IACT,IACO,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useState } from \"react\";\nimport { useActionMutation, useActionQuery } from \"@agent-native/core/client\";\nimport { toast } from \"sonner\";\nimport {\n IconBook,\n IconChevronDown,\n IconChevronRight,\n IconCode,\n IconFileText,\n IconPlus,\n IconRefresh,\n IconTrash,\n IconUser,\n IconX,\n} from \"@tabler/icons-react\";\nimport { DispatchShell } from \"@/components/dispatch-shell\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"@/components/ui/alert-dialog\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/ui/dialog\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\nexport function meta() {\n return [{ title: \"Workspace Resources — Dispatch\" }];\n}\n\nconst KIND_CONFIG = {\n skill: {\n label: \"Skill\",\n icon: IconCode,\n pathPrefix: \"skills/\",\n description: \"Agent skills — detailed guidance for patterns and workflows\",\n },\n instruction: {\n label: \"Instruction\",\n icon: IconBook,\n pathPrefix: \"\",\n description:\n \"Agent instructions — operational rules and behavioral guidance\",\n },\n agent: {\n label: \"Agent\",\n icon: IconUser,\n pathPrefix: \"agents/\",\n description:\n \"Reusable agent profiles — specialist agents shared across apps\",\n },\n knowledge: {\n label: \"Knowledge\",\n icon: IconFileText,\n pathPrefix: \"context/\",\n description:\n \"Knowledge packs — reusable GTM, product, and domain context for apps\",\n },\n} as const;\n\nfunction AddResourceDialog() {\n const [open, setOpen] = useState(false);\n const [kind, setKind] = useState<string>(\"skill\");\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [path, setPath] = useState(\"\");\n const [content, setContent] = useState(\"\");\n const [scope, setScope] = useState<string>(\"all\");\n\n const create = useActionMutation(\"create-workspace-resource\", {\n onSuccess: () => {\n toast.success(\"Resource created\");\n setOpen(false);\n setKind(\"skill\");\n setName(\"\");\n setDescription(\"\");\n setPath(\"\");\n setContent(\"\");\n setScope(\"all\");\n },\n onError: (err) => toast.error(String(err)),\n });\n\n const kindInfo = KIND_CONFIG[kind as keyof typeof KIND_CONFIG];\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button>\n <IconPlus size={16} className=\"mr-1.5\" />\n Add resource\n </Button>\n </DialogTrigger>\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>Add workspace resource</DialogTitle>\n <DialogDescription>\n Create a skill, instruction, or agent profile that can be shared\n across workspace apps.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-4 py-2\">\n <div className=\"grid grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <Label>Kind</Label>\n <Select value={kind} onValueChange={setKind}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"skill\">Skill</SelectItem>\n <SelectItem value=\"instruction\">Instruction</SelectItem>\n <SelectItem value=\"agent\">Agent</SelectItem>\n <SelectItem value=\"knowledge\">Knowledge pack</SelectItem>\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-2\">\n <Label>Scope</Label>\n <Select value={scope} onValueChange={setScope}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">All apps</SelectItem>\n <SelectItem value=\"selected\">Selected apps only</SelectItem>\n </SelectContent>\n </Select>\n </div>\n </div>\n <div className=\"space-y-2\">\n <Label>Name</Label>\n <Input\n placeholder={\n kind === \"skill\"\n ? \"Frontend Designer\"\n : kind === \"agent\"\n ? \"Research Specialist\"\n : kind === \"knowledge\"\n ? \"Core GTM Messaging\"\n : \"Code Style Guide\"\n }\n value={name}\n onChange={(e) => setName(e.target.value)}\n />\n </div>\n <div className=\"space-y-2\">\n <Label>Path</Label>\n <Input\n placeholder={`${kindInfo?.pathPrefix || \"\"}${name.toLowerCase().replace(/\\s+/g, \"-\") || \"example\"}.md`}\n value={path}\n onChange={(e) => setPath(e.target.value)}\n className=\"font-mono text-sm\"\n />\n <p className=\"text-xs text-muted-foreground\">\n Resource path in target apps. Skills go in skills/, agents in\n agents/, knowledge packs in context/.\n </p>\n </div>\n <div className=\"space-y-2\">\n <Label>Description (optional)</Label>\n <Input\n placeholder=\"Short description of what this resource does\"\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n />\n </div>\n <div className=\"space-y-2\">\n <Label>Content</Label>\n <Textarea\n placeholder={\n kind === \"skill\"\n ? \"---\\nname: my-skill\\ndescription: What this skill teaches\\n---\\n\\n# My Skill\\n\\n...\"\n : kind === \"agent\"\n ? \"---\\nname: Research Specialist\\ndescription: Handles research tasks\\n---\\n\\n# Instructions\\n\\n...\"\n : kind === \"knowledge\"\n ? \"# Core GTM Messaging\\n\\n## Positioning\\n\\n## ICP\\n\\n## Proof points\\n\\n## Source\\n\\n\"\n : \"# Instructions\\n\\nBehavioral rules and guidance for agents across apps...\"\n }\n value={content}\n onChange={(e) => setContent(e.target.value)}\n rows={12}\n className=\"font-mono text-sm\"\n />\n </div>\n </div>\n <DialogFooter>\n <Button\n onClick={() =>\n create.mutate({\n kind: kind as \"skill\" | \"instruction\" | \"agent\" | \"knowledge\",\n name,\n description: description || undefined,\n path:\n path ||\n `${kindInfo?.pathPrefix || \"\"}${name.toLowerCase().replace(/\\s+/g, \"-\")}.md`,\n content,\n scope: scope as \"all\" | \"selected\",\n })\n }\n disabled={!name || !content || create.isPending}\n >\n {create.isPending ? \"Creating...\" : \"Create resource\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction GrantDialog({\n resourceId,\n resourceName,\n}: {\n resourceId: string;\n resourceName: string;\n}) {\n const [open, setOpen] = useState(false);\n const [appId, setAppId] = useState(\"\");\n const { data: catalog } = useActionQuery(\"list-integrations-catalog\", {});\n\n const grant = useActionMutation(\"create-workspace-resource-grant\", {\n onSuccess: () => {\n toast.success(`Granted to ${appId}`);\n setOpen(false);\n setAppId(\"\");\n },\n onError: (err) => toast.error(String(err)),\n });\n\n const apps = (catalog || []).map((a: any) => ({\n id: a.appId,\n name: a.appName,\n }));\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"outline\" size=\"sm\">\n <IconPlus size={14} className=\"mr-1\" />\n Grant\n </Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Grant \"{resourceName}\" to an app</DialogTitle>\n <DialogDescription>\n Choose which app should receive this resource.\n </DialogDescription>\n </DialogHeader>\n <div className=\"py-2\">\n <Select value={appId} onValueChange={setAppId}>\n <SelectTrigger>\n <SelectValue placeholder=\"Select an app...\" />\n </SelectTrigger>\n <SelectContent>\n {apps.map((app: any) => (\n <SelectItem key={app.id} value={app.id}>\n {app.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <DialogFooter>\n <Button\n onClick={() => grant.mutate({ resourceId, appId })}\n disabled={!appId || grant.isPending}\n >\n {grant.isPending ? \"Granting...\" : \"Grant access\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction ResourceRow({ resource, grants }: { resource: any; grants: any[] }) {\n const [expanded, setExpanded] = useState(false);\n\n const deleteResource = useActionMutation(\"delete-workspace-resource\", {\n onSuccess: () => toast.success(\"Resource deleted\"),\n onError: (err) => toast.error(String(err)),\n });\n const revokeGrant = useActionMutation(\"revoke-workspace-resource-grant\", {\n onSuccess: () => toast.success(\"Grant revoked\"),\n onError: (err) => toast.error(String(err)),\n });\n const syncToApp = useActionMutation(\"sync-workspace-resources-to-app\", {\n onSuccess: (data: any) =>\n toast.success(`Synced ${data.synced} resource(s) to ${data.appId}`),\n onError: (err) => toast.error(String(err)),\n });\n\n const kindInfo = KIND_CONFIG[resource.kind as keyof typeof KIND_CONFIG];\n const KindIcon = kindInfo?.icon || IconCode;\n const activeGrants = grants.filter((g) => g.status === \"active\");\n\n return (\n <div className=\"rounded-xl border bg-card\">\n <button\n type=\"button\"\n className=\"flex w-full items-center gap-3 px-4 py-3 text-left cursor-pointer\"\n onClick={() => setExpanded(!expanded)}\n >\n {expanded ? (\n <IconChevronDown size={16} className=\"text-muted-foreground\" />\n ) : (\n <IconChevronRight size={16} className=\"text-muted-foreground\" />\n )}\n <KindIcon size={16} className=\"text-muted-foreground\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium text-foreground\">\n {resource.name}\n </span>\n <Badge variant=\"secondary\" className=\"text-xs\">\n {kindInfo?.label || resource.kind}\n </Badge>\n <Badge\n variant=\"outline\"\n className={\n resource.scope === \"all\"\n ? \"text-xs bg-green-500/10 text-green-700 dark:text-green-400\"\n : \"text-xs\"\n }\n >\n {resource.scope === \"all\" ? \"All apps\" : \"Selected\"}\n </Badge>\n </div>\n <div className=\"mt-0.5 font-mono text-xs text-muted-foreground\">\n {resource.path}\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n {resource.scope === \"selected\" && (\n <Badge variant=\"outline\" className=\"text-xs\">\n {activeGrants.length} grant\n {activeGrants.length !== 1 ? \"s\" : \"\"}\n </Badge>\n )}\n </div>\n </button>\n\n {expanded && (\n <div className=\"border-t px-4 py-3 space-y-3\">\n {resource.description && (\n <p className=\"text-sm text-muted-foreground\">\n {resource.description}\n </p>\n )}\n\n <div className=\"rounded-lg border bg-muted/30 p-3\">\n <pre className=\"whitespace-pre-wrap text-xs font-mono text-foreground max-h-64 overflow-y-auto\">\n {resource.content}\n </pre>\n </div>\n\n {resource.scope === \"selected\" && (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs font-medium text-foreground\">\n Grants\n </span>\n <GrantDialog\n resourceId={resource.id}\n resourceName={resource.name}\n />\n </div>\n {activeGrants.length > 0 ? (\n <div className=\"space-y-1.5\">\n {activeGrants.map((grant: any) => (\n <div\n key={grant.id}\n className=\"flex items-center justify-between rounded-lg border px-3 py-2\"\n >\n <div>\n <span className=\"text-sm font-medium text-foreground\">\n {grant.appId}\n </span>\n <span className=\"ml-2 text-xs text-muted-foreground\">\n {grant.syncedAt\n ? `synced ${new Date(grant.syncedAt).toLocaleString()}`\n : \"not synced\"}\n </span>\n </div>\n <div className=\"flex gap-1.5\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() =>\n syncToApp.mutate({ appId: grant.appId })\n }\n disabled={syncToApp.isPending}\n >\n <IconRefresh size={14} />\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() =>\n revokeGrant.mutate({ grantId: grant.id })\n }\n disabled={revokeGrant.isPending}\n >\n <IconX size={14} />\n </Button>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"rounded-lg border border-dashed px-3 py-4 text-center text-xs text-muted-foreground\">\n No grants yet. Grant this resource to specific apps.\n </div>\n )}\n </div>\n )}\n\n <div className=\"flex justify-between border-t pt-3\">\n <div className=\"text-xs text-muted-foreground\">\n Created by {resource.createdBy} ·{\" \"}\n {new Date(resource.createdAt).toLocaleString()}\n </div>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n disabled={deleteResource.isPending}\n >\n <IconTrash size={14} className=\"mr-1\" />\n Delete\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Delete this resource?</AlertDialogTitle>\n <AlertDialogDescription>\n Removing \"{resource.name}\" revokes all of its grants. Apps\n that depended on this resource will lose access on the next\n sync. This cannot be undone.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => deleteResource.mutate({ id: resource.id })}\n >\n Delete resource\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default function WorkspaceRoute() {\n const { data: resources, isLoading } = useActionQuery(\n \"list-workspace-resources\",\n {},\n );\n const { data: grants } = useActionQuery(\"list-workspace-resource-grants\", {});\n\n const syncAll = useActionMutation(\"sync-workspace-resources-to-all\", {\n onSuccess: (data: any) => {\n const total = (data || []).reduce(\n (sum: number, r: any) => sum + r.synced,\n 0,\n );\n toast.success(\n `Synced resources to ${data?.length || 0} apps (${total} total pushes)`,\n );\n },\n onError: (err) => toast.error(String(err)),\n });\n\n const grantsByResource = (grants || []).reduce(\n (acc: Record<string, any[]>, g: any) => {\n if (!acc[g.resourceId]) acc[g.resourceId] = [];\n acc[g.resourceId].push(g);\n return acc;\n },\n {} as Record<string, any[]>,\n );\n\n const skills = (resources || []).filter((r: any) => r.kind === \"skill\");\n const instructions = (resources || []).filter(\n (r: any) => r.kind === \"instruction\",\n );\n const agents = (resources || []).filter((r: any) => r.kind === \"agent\");\n const knowledge = (resources || []).filter(\n (r: any) => r.kind === \"knowledge\",\n );\n\n function ResourceList({\n items,\n emptyText,\n }: {\n items: any[];\n emptyText: string;\n }) {\n if (isLoading && (resources ?? []).length === 0) {\n return (\n <div className=\"space-y-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <div\n key={index}\n className=\"rounded-2xl border bg-card px-5 py-4 space-y-2\"\n >\n <Skeleton className=\"h-4 w-1/3\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n ))}\n </div>\n );\n }\n if (items.length === 0) {\n return (\n <div className=\"rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground\">\n {emptyText}\n </div>\n );\n }\n return (\n <div className=\"space-y-3\">\n {items.map((resource: any) => (\n <ResourceRow\n key={resource.id}\n resource={resource}\n grants={grantsByResource[resource.id] || []}\n />\n ))}\n </div>\n );\n }\n\n return (\n <DispatchShell\n title=\"Workspace Resources\"\n description=\"Share skills, instructions, agent profiles, and knowledge packs across workspace apps. Scope to all apps or grant per-app.\"\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"text-sm text-muted-foreground\">\n {isLoading ? (\n <Skeleton className=\"h-4 w-24\" />\n ) : (\n `${resources?.length || 0} resource${(resources?.length || 0) !== 1 ? \"s\" : \"\"}`\n )}\n </div>\n <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n onClick={() => syncAll.mutate({})}\n disabled={syncAll.isPending || (resources?.length || 0) === 0}\n >\n <IconRefresh\n size={16}\n className={syncAll.isPending ? \"mr-1.5 animate-spin\" : \"mr-1.5\"}\n />\n Sync all\n </Button>\n <AddResourceDialog />\n </div>\n </div>\n\n <Tabs defaultValue=\"skills\">\n <TabsList>\n <TabsTrigger value=\"skills\">\n Skills {skills.length > 0 && `(${skills.length})`}\n </TabsTrigger>\n <TabsTrigger value=\"instructions\">\n Instructions {instructions.length > 0 && `(${instructions.length})`}\n </TabsTrigger>\n <TabsTrigger value=\"agents\">\n Agents {agents.length > 0 && `(${agents.length})`}\n </TabsTrigger>\n <TabsTrigger value=\"knowledge\">\n Knowledge {knowledge.length > 0 && `(${knowledge.length})`}\n </TabsTrigger>\n </TabsList>\n\n <TabsContent value=\"skills\" className=\"mt-4\">\n <ResourceList\n items={skills}\n emptyText=\"No workspace skills yet. Add a skill to share agent guidance across apps.\"\n />\n </TabsContent>\n\n <TabsContent value=\"instructions\" className=\"mt-4\">\n <ResourceList\n items={instructions}\n emptyText=\"No workspace instructions yet. Add instructions to set behavioral rules across apps.\"\n />\n </TabsContent>\n\n <TabsContent value=\"agents\" className=\"mt-4\">\n <ResourceList\n items={agents}\n emptyText=\"No workspace agents yet. Add a reusable agent profile to share specialist agents across apps.\"\n />\n </TabsContent>\n\n <TabsContent value=\"knowledge\" className=\"mt-4\">\n <ResourceList\n items={knowledge}\n emptyText=\"No knowledge packs yet. Add GTM, product, or domain context that apps can reuse.\"\n />\n </TabsContent>\n </Tabs>\n </DispatchShell>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/dispatch",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
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",
@@ -96,7 +96,7 @@
96
96
  "typescript": "^6.0.3",
97
97
  "vite": "8.0.3",
98
98
  "vitest": "^4.1.5",
99
- "@agent-native/core": "0.14.0"
99
+ "@agent-native/core": "0.14.2"
100
100
  },
101
101
  "scripts": {
102
102
  "build": "tsc && tsc-alias --resolve-full-paths",
@@ -13,6 +13,7 @@ import {
13
13
  PopoverTrigger,
14
14
  } from "@/components/ui/popover";
15
15
  import { Button } from "@/components/ui/button";
16
+ import { Skeleton } from "@/components/ui/skeleton";
16
17
 
17
18
  interface VaultSecret {
18
19
  id: string;
@@ -180,7 +181,20 @@ function AppKeysPanel({ appId, appName }: { appId: string; appName: string }) {
180
181
 
181
182
  <div className="max-h-[320px] space-y-1.5 overflow-y-auto rounded-md border border-border bg-card p-1.5">
182
183
  {isLoading ? (
183
- <p className="px-3 py-3 text-xs text-muted-foreground">Loading…</p>
184
+ <div className="space-y-1.5 p-1.5">
185
+ {Array.from({ length: 3 }).map((_, index) => (
186
+ <div
187
+ key={index}
188
+ className="flex items-start gap-3 rounded-md px-2.5 py-2"
189
+ >
190
+ <Skeleton className="mt-0.5 h-4 w-4 shrink-0 rounded" />
191
+ <div className="flex-1 space-y-1.5">
192
+ <Skeleton className="h-3 w-1/2" />
193
+ <Skeleton className="h-3 w-3/4" />
194
+ </div>
195
+ </div>
196
+ ))}
197
+ </div>
184
198
  ) : typedSecrets.length === 0 ? (
185
199
  <p className="rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground">
186
200
  No vault keys yet. Add one from the Vault page.
@@ -1,6 +1,7 @@
1
1
  import { useEffect, useMemo } from "react";
2
2
  import {
3
3
  Link,
4
+ Navigate,
4
5
  redirect,
5
6
  useParams,
6
7
  type LoaderFunctionArgs,
@@ -47,10 +48,22 @@ export function meta() {
47
48
  * OAuth callbackURL, so Google sign-in completes back at /dispatch/todo
48
49
  * and looks broken. This route fixes both the post-creation navigation
49
50
  * and the OAuth round-trip from a single place.
51
+ *
52
+ * `appId === "dispatch"` short-circuit: when the segment matches Dispatch
53
+ * itself (e.g. `/dispatch/dispatch`), we go straight to the overview rather
54
+ * than chaining through `/dispatch` (which polled `useActionQuery` re-fired
55
+ * `window.location.assign` against and looped forever in production).
50
56
  */
57
+ function dispatchSelfRedirect(appId: string | undefined): string | null {
58
+ if (appId === "dispatch") return appPath("/overview");
59
+ return null;
60
+ }
61
+
51
62
  export function loader({ params }: LoaderFunctionArgs) {
52
63
  const appId = params.appId;
53
64
  if (!appId) return null;
65
+ const selfTarget = dispatchSelfRedirect(appId);
66
+ if (selfTarget) throw redirect(selfTarget);
54
67
  const apps = loadWorkspaceAppsManifest();
55
68
  if (!apps) return null;
56
69
  const app = apps.find((entry) => entry?.id === appId);
@@ -60,6 +73,12 @@ export function loader({ params }: LoaderFunctionArgs) {
60
73
  return null;
61
74
  }
62
75
 
76
+ export function clientLoader({ params }: LoaderFunctionArgs) {
77
+ const selfTarget = dispatchSelfRedirect(params.appId);
78
+ if (selfTarget) throw redirect(selfTarget);
79
+ return null;
80
+ }
81
+
63
82
  export default function WorkspaceAppCatchAllRoute() {
64
83
  const { appId } = useParams();
65
84
  const { data: apps = [], isLoading } = useActionQuery(
@@ -73,11 +92,17 @@ export default function WorkspaceAppCatchAllRoute() {
73
92
  [appId, apps],
74
93
  );
75
94
  const href = app ? workspaceAppHref(app) : null;
95
+ const isSelfReference = appId === "dispatch";
76
96
 
77
97
  useEffect(() => {
98
+ if (isSelfReference) return;
78
99
  if (!app || app.status === "pending" || !href) return;
79
100
  window.location.assign(href);
80
- }, [app, href]);
101
+ }, [app, href, isSelfReference]);
102
+
103
+ if (isSelfReference) {
104
+ return <Navigate to={appPath("/overview")} replace />;
105
+ }
81
106
 
82
107
  if ((isLoading && !app) || (app && app.status !== "pending" && href)) {
83
108
  return (
@@ -9,6 +9,7 @@ import {
9
9
  import { toast } from "sonner";
10
10
  import { Button } from "@/components/ui/button";
11
11
  import { Badge } from "@/components/ui/badge";
12
+ import { Skeleton } from "@/components/ui/skeleton";
12
13
  import {
13
14
  IconCheck,
14
15
  IconX,
@@ -98,9 +99,38 @@ export default function ApprovalPreviewRoute() {
98
99
 
99
100
  if (isLoading) {
100
101
  return (
101
- <div className="flex min-h-screen items-center justify-center bg-background p-6">
102
- <div className="w-full max-w-md rounded-2xl border bg-card p-6 text-center">
103
- <p className="text-sm text-muted-foreground">Loading...</p>
102
+ <div className="flex min-h-screen items-start justify-center bg-background p-6">
103
+ <div className="w-full max-w-md space-y-4">
104
+ <div className="rounded-2xl border bg-card p-5">
105
+ <div className="flex items-start gap-3">
106
+ <Skeleton className="h-9 w-9 shrink-0 rounded-xl" />
107
+ <div className="min-w-0 flex-1 space-y-2">
108
+ <div className="flex flex-wrap items-center gap-2">
109
+ <Skeleton className="h-4 w-40" />
110
+ <Skeleton className="h-5 w-20 rounded-full" />
111
+ </div>
112
+ <Skeleton className="h-3 w-32" />
113
+ </div>
114
+ </div>
115
+ <div className="mt-4 space-y-2 rounded-xl border bg-muted/30 px-4 py-3">
116
+ <div className="flex justify-between gap-4">
117
+ <Skeleton className="h-3 w-20" />
118
+ <Skeleton className="h-3 w-24" />
119
+ </div>
120
+ <div className="flex justify-between gap-4">
121
+ <Skeleton className="h-3 w-20" />
122
+ <Skeleton className="h-3 w-28" />
123
+ </div>
124
+ <div className="flex justify-between gap-4">
125
+ <Skeleton className="h-3 w-16" />
126
+ <Skeleton className="h-3 w-32" />
127
+ </div>
128
+ </div>
129
+ <div className="mt-4 flex gap-2">
130
+ <Skeleton className="h-8 flex-1 rounded-md" />
131
+ <Skeleton className="h-8 flex-1 rounded-md" />
132
+ </div>
133
+ </div>
104
134
  </div>
105
135
  </div>
106
136
  );
@@ -9,6 +9,7 @@ import {
9
9
  import { DispatchShell } from "@/components/dispatch-shell";
10
10
  import { Badge } from "@/components/ui/badge";
11
11
  import { Button } from "@/components/ui/button";
12
+ import { Skeleton } from "@/components/ui/skeleton";
12
13
  import {
13
14
  workspaceAppHref,
14
15
  type WorkspaceAppSummary,
@@ -53,7 +54,11 @@ export default function WorkspaceAppRoute() {
53
54
  </Button>
54
55
 
55
56
  {isLoading && !app ? (
56
- <p className="text-sm text-muted-foreground">Loading app status...</p>
57
+ <div className="space-y-3">
58
+ <Skeleton className="h-5 w-48" />
59
+ <Skeleton className="h-4 w-full" />
60
+ <Skeleton className="h-4 w-2/3" />
61
+ </div>
57
62
  ) : !app ? (
58
63
  <div className="space-y-3">
59
64
  <h2 className="text-base font-semibold text-foreground">
@@ -131,6 +131,60 @@ function AppCardSkeleton() {
131
131
  );
132
132
  }
133
133
 
134
+ interface RecentAuditEvent {
135
+ id: string;
136
+ summary: string;
137
+ actor: string;
138
+ createdAt: string;
139
+ }
140
+
141
+ function RecentActivityList({
142
+ isLoading,
143
+ events,
144
+ }: {
145
+ isLoading: boolean;
146
+ events: RecentAuditEvent[];
147
+ }) {
148
+ if (isLoading && events.length === 0) {
149
+ return (
150
+ <div className="mt-4 space-y-3">
151
+ {Array.from({ length: 3 }).map((_, index) => (
152
+ <div
153
+ key={index}
154
+ className="rounded-xl border bg-muted/30 px-4 py-3 space-y-2"
155
+ >
156
+ <Skeleton className="h-4 w-3/5" />
157
+ <Skeleton className="h-3 w-2/5" />
158
+ </div>
159
+ ))}
160
+ </div>
161
+ );
162
+ }
163
+ if (events.length === 0) {
164
+ return (
165
+ <div className="mt-4 space-y-3">
166
+ <div className="rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground">
167
+ No activity yet.
168
+ </div>
169
+ </div>
170
+ );
171
+ }
172
+ return (
173
+ <div className="mt-4 space-y-3">
174
+ {events.map((event) => (
175
+ <div key={event.id} className="rounded-xl border bg-muted/30 px-4 py-3">
176
+ <div className="text-sm font-medium text-foreground">
177
+ {event.summary}
178
+ </div>
179
+ <div className="mt-1 text-xs text-muted-foreground">
180
+ {event.actor} · {new Date(event.createdAt).toLocaleString()}
181
+ </div>
182
+ </div>
183
+ ))}
184
+ </div>
185
+ );
186
+ }
187
+
134
188
  function WorkspaceAppsSection({
135
189
  apps,
136
190
  isLoading,
@@ -625,33 +679,11 @@ export default function OverviewRoute() {
625
679
  <h2 className="text-lg font-semibold text-foreground">
626
680
  Recent activity
627
681
  </h2>
628
- {isLoading && (
629
- <span className="text-xs text-muted-foreground">
630
- Loading...
631
- </span>
632
- )}
633
- </div>
634
- <div className="mt-4 space-y-3">
635
- {(data?.recentAudit || []).map((event) => (
636
- <div
637
- key={event.id}
638
- className="rounded-xl border bg-muted/30 px-4 py-3"
639
- >
640
- <div className="text-sm font-medium text-foreground">
641
- {event.summary}
642
- </div>
643
- <div className="mt-1 text-xs text-muted-foreground">
644
- {event.actor} ·{" "}
645
- {new Date(event.createdAt).toLocaleString()}
646
- </div>
647
- </div>
648
- ))}
649
- {!isLoading && (data?.recentAudit?.length || 0) === 0 && (
650
- <div className="rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground">
651
- No activity yet.
652
- </div>
653
- )}
654
682
  </div>
683
+ <RecentActivityList
684
+ isLoading={isLoading}
685
+ events={data?.recentAudit ?? []}
686
+ />
655
687
  </section>
656
688
 
657
689
  <section className="rounded-2xl border bg-card p-5">
@@ -46,6 +46,7 @@ import {
46
46
  } from "@/components/ui/select";
47
47
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
48
48
  import { Textarea } from "@/components/ui/textarea";
49
+ import { Skeleton } from "@/components/ui/skeleton";
49
50
 
50
51
  const PROVIDERS = [
51
52
  "google",
@@ -549,22 +550,34 @@ export default function VaultRoute() {
549
550
  <div className="flex items-center justify-between">
550
551
  <div className="flex items-center gap-2 text-sm text-muted-foreground">
551
552
  <IconKey size={16} />
552
- <span>
553
- {secretsLoading
554
- ? "Loading..."
555
- : `${secrets?.length || 0} secret${(secrets?.length || 0) !== 1 ? "s" : ""}`}
556
- </span>
553
+ {secretsLoading ? (
554
+ <Skeleton className="h-4 w-20" />
555
+ ) : (
556
+ <span>
557
+ {`${secrets?.length || 0} secret${(secrets?.length || 0) !== 1 ? "s" : ""}`}
558
+ </span>
559
+ )}
557
560
  </div>
558
561
  <AddSecretDialog />
559
562
  </div>
560
563
 
561
- {(secrets || []).map((secret: any) => (
562
- <SecretRow
563
- key={secret.id}
564
- secret={secret}
565
- grants={grantsBySecret[secret.id] || []}
566
- />
567
- ))}
564
+ {secretsLoading && (secrets ?? []).length === 0
565
+ ? Array.from({ length: 3 }).map((_, index) => (
566
+ <div
567
+ key={index}
568
+ className="rounded-2xl border bg-card px-5 py-4 space-y-2"
569
+ >
570
+ <Skeleton className="h-4 w-1/3" />
571
+ <Skeleton className="h-3 w-2/3" />
572
+ </div>
573
+ ))
574
+ : (secrets || []).map((secret: any) => (
575
+ <SecretRow
576
+ key={secret.id}
577
+ secret={secret}
578
+ grants={grantsBySecret[secret.id] || []}
579
+ />
580
+ ))}
568
581
 
569
582
  {!secretsLoading && (secrets?.length || 0) === 0 && (
570
583
  <div className="rounded-2xl border border-dashed px-6 py-12 text-center">
@@ -47,6 +47,7 @@ import {
47
47
  } from "@/components/ui/select";
48
48
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
49
49
  import { Textarea } from "@/components/ui/textarea";
50
+ import { Skeleton } from "@/components/ui/skeleton";
50
51
 
51
52
  export function meta() {
52
53
  return [{ title: "Workspace Resources — Dispatch" }];
@@ -528,6 +529,21 @@ export default function WorkspaceRoute() {
528
529
  items: any[];
529
530
  emptyText: string;
530
531
  }) {
532
+ if (isLoading && (resources ?? []).length === 0) {
533
+ return (
534
+ <div className="space-y-3">
535
+ {Array.from({ length: 3 }).map((_, index) => (
536
+ <div
537
+ key={index}
538
+ className="rounded-2xl border bg-card px-5 py-4 space-y-2"
539
+ >
540
+ <Skeleton className="h-4 w-1/3" />
541
+ <Skeleton className="h-3 w-2/3" />
542
+ </div>
543
+ ))}
544
+ </div>
545
+ );
546
+ }
531
547
  if (items.length === 0) {
532
548
  return (
533
549
  <div className="rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground">
@@ -555,9 +571,11 @@ export default function WorkspaceRoute() {
555
571
  >
556
572
  <div className="flex items-center justify-between">
557
573
  <div className="text-sm text-muted-foreground">
558
- {isLoading
559
- ? "Loading..."
560
- : `${resources?.length || 0} resource${(resources?.length || 0) !== 1 ? "s" : ""}`}
574
+ {isLoading ? (
575
+ <Skeleton className="h-4 w-24" />
576
+ ) : (
577
+ `${resources?.length || 0} resource${(resources?.length || 0) !== 1 ? "s" : ""}`
578
+ )}
561
579
  </div>
562
580
  <div className="flex gap-2">
563
581
  <Button