@agent-native/dispatch 0.15.24 → 0.15.26

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.
Files changed (68) hide show
  1. package/dist/actions/get-agent-thread-debug.d.ts +7 -1
  2. package/dist/actions/get-agent-thread-debug.js +16 -3
  3. package/dist/actions/get-agent-thread-debug.js.map +1 -1
  4. package/dist/actions/list-connected-agents.js +7 -3
  5. package/dist/actions/list-connected-agents.js.map +1 -1
  6. package/dist/actions/list-curated-workspace-templates.js +1 -1
  7. package/dist/actions/list-curated-workspace-templates.js.map +1 -1
  8. package/dist/actions/provider-api-register.d.ts +14 -14
  9. package/dist/actions/remix-workspace-template.js +5 -5
  10. package/dist/actions/remix-workspace-template.js.map +1 -1
  11. package/dist/actions/search-agent-threads.js +1 -1
  12. package/dist/actions/search-agent-threads.js.map +1 -1
  13. package/dist/actions/start-workspace-app-creation.js +1 -1
  14. package/dist/actions/start-workspace-app-creation.js.map +1 -1
  15. package/dist/components/create-app-popover.js +2 -2
  16. package/dist/components/create-app-popover.js.map +1 -1
  17. package/dist/components/dispatch-control-plane.d.ts.map +1 -1
  18. package/dist/components/dispatch-control-plane.js +13 -3
  19. package/dist/components/dispatch-control-plane.js.map +1 -1
  20. package/dist/components/workspace-app-card.d.ts.map +1 -1
  21. package/dist/components/workspace-app-card.js +35 -4
  22. package/dist/components/workspace-app-card.js.map +1 -1
  23. package/dist/components/workspace-template-card.js +4 -4
  24. package/dist/components/workspace-template-card.js.map +1 -1
  25. package/dist/lib/workspace-apps.d.ts +3 -0
  26. package/dist/lib/workspace-apps.d.ts.map +1 -1
  27. package/dist/lib/workspace-apps.js.map +1 -1
  28. package/dist/routes/pages/apps.d.ts.map +1 -1
  29. package/dist/routes/pages/apps.js +19 -4
  30. package/dist/routes/pages/apps.js.map +1 -1
  31. package/dist/routes/pages/thread-debug.d.ts.map +1 -1
  32. package/dist/routes/pages/thread-debug.js +25 -11
  33. package/dist/routes/pages/thread-debug.js.map +1 -1
  34. package/dist/server/lib/app-creation-store.d.ts +3 -0
  35. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  36. package/dist/server/lib/app-creation-store.js +54 -2
  37. package/dist/server/lib/app-creation-store.js.map +1 -1
  38. package/dist/server/lib/curated-workspace-templates.d.ts +1 -1
  39. package/dist/server/lib/curated-workspace-templates.js +2 -2
  40. package/dist/server/lib/curated-workspace-templates.js.map +1 -1
  41. package/dist/server/lib/thread-debug-store.d.ts +7 -1
  42. package/dist/server/lib/thread-debug-store.d.ts.map +1 -1
  43. package/dist/server/lib/thread-debug-store.js +43 -5
  44. package/dist/server/lib/thread-debug-store.js.map +1 -1
  45. package/dist/server/plugins/integrations.js +1 -1
  46. package/dist/server/plugins/integrations.js.map +1 -1
  47. package/package.json +3 -3
  48. package/src/actions/get-agent-thread-debug.ts +30 -15
  49. package/src/actions/list-connected-agents.ts +7 -2
  50. package/src/actions/list-curated-workspace-templates.ts +1 -1
  51. package/src/actions/remix-workspace-template.spec.ts +2 -2
  52. package/src/actions/remix-workspace-template.ts +5 -5
  53. package/src/actions/search-agent-threads.ts +1 -1
  54. package/src/actions/start-workspace-app-creation.ts +1 -1
  55. package/src/components/create-app-popover.tsx +2 -2
  56. package/src/components/dispatch-control-plane.tsx +70 -4
  57. package/src/components/workspace-app-card.spec.tsx +43 -0
  58. package/src/components/workspace-app-card.tsx +97 -1
  59. package/src/components/workspace-template-card.spec.tsx +4 -4
  60. package/src/components/workspace-template-card.tsx +4 -4
  61. package/src/lib/workspace-apps.ts +3 -0
  62. package/src/routes/pages/apps.tsx +84 -4
  63. package/src/routes/pages/thread-debug.tsx +34 -14
  64. package/src/server/lib/app-creation-store.ts +95 -2
  65. package/src/server/lib/curated-workspace-templates.ts +2 -2
  66. package/src/server/lib/thread-debug-store.spec.ts +82 -0
  67. package/src/server/lib/thread-debug-store.ts +62 -6
  68. package/src/server/plugins/integrations.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-app-card.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AgB,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,MAAM,GAAG,CAChD,aAEM,IACL,IACF,EAEL,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CACtB,YAAG,SAAS,EAAC,iDAAiD,YAC3D,QAAQ,CAAC,WAAW,GACnB,CACL,CAAC,CAAC,CAAC,IAAI,EAEP,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,yBAAyB,IACxB,KAAK,EAAE,GAAG,CAAC,EAAE,EACb,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,KA9DH,QAAQ,CAAC,EAAE,CA+DZ,CACP,CAAC;gCACJ,CAAC,CAAC,GACE,CACP,IACG,EACN,KAAC,YAAY,cACX,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,qBAE1C,GACI,IACD,IACT,CACV,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,GAAY;IAClC,IAAI,GAAG,YAAY,KAAK;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IAC7C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC","sourcesContent":["import {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport {\n IconChevronDown,\n IconChevronRight,\n IconClockHour4,\n IconDots,\n IconEdit,\n IconEye,\n IconEyeOff,\n IconFileText,\n IconWorld,\n IconTrash,\n} from \"@tabler/icons-react\";\nimport { useEffect, useState, type FormEvent } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { cn } from \"../lib/utils\";\nimport {\n isPendingBuilderHref,\n workspaceAppHref,\n type WorkspaceAppSummary,\n} from \"../lib/workspace-apps\";\nimport { ActionQueryError } from \"./action-query-error\";\nimport { AppKeysPopover } from \"./app-keys-popover\";\nimport { Badge } from \"./ui/badge\";\nimport { Button } from \"./ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"./ui/dialog\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"./ui/dropdown-menu\";\nimport { Input } from \"./ui/input\";\nimport { Label } from \"./ui/label\";\nimport { Textarea } from \"./ui/textarea\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"./ui/tooltip\";\nimport { AppResourceEffectiveStack } from \"./workspace-resource-effective-stack\";\n\nconst APP_CARD_ACTION_CLASS =\n \"size-7 rounded-md p-0 text-muted-foreground transition-[background-color,color] hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-foreground\";\n\nexport function WorkspaceAppCard({\n app,\n className,\n}: {\n app: WorkspaceAppSummary;\n className?: string;\n}) {\n const href = workspaceAppHref(app);\n const openInNewTab = isPendingBuilderHref(app);\n const isPending = app.status === \"pending\";\n const pendingLabel = app.statusLabel || \"Builder branch\";\n const isArchived = !!app.archived;\n const audience = app.audience ?? \"internal\";\n const [editOpen, setEditOpen] = useState(false);\n const [draftName, setDraftName] = useState(app.name);\n const [draftDescription, setDraftDescription] = useState(\n app.description || \"\",\n );\n\n useEffect(() => {\n if (editOpen) return;\n setDraftName(app.name);\n setDraftDescription(app.description || \"\");\n }, [app.description, app.name, editOpen]);\n\n const archive = useActionMutation(\"archive-workspace-app\", {\n onError: (err) =>\n toast.error(`Could not hide ${app.name}: ${stringifyError(err)}`),\n });\n const unarchive = useActionMutation(\"unarchive-workspace-app\", {\n onError: (err) =>\n toast.error(`Could not restore ${app.name}: ${stringifyError(err)}`),\n });\n const removePending = useActionMutation(\"remove-pending-workspace-app\", {\n onError: (err) =>\n toast.error(`Could not remove ${app.name}: ${stringifyError(err)}`),\n });\n const updateMetadata = useActionMutation(\"update-workspace-app-metadata\", {\n onSuccess: () => {\n toast.success(`Updated ${draftName.trim() || app.name}`);\n setEditOpen(false);\n },\n onError: (err) =>\n toast.error(`Could not update ${app.name}: ${stringifyError(err)}`),\n });\n\n const handleArchive = () => {\n archive.mutate({ appId: app.id });\n toast.success(`Hid ${app.name} from the Apps list`);\n };\n const handleUnarchive = () => {\n unarchive.mutate({ appId: app.id });\n toast.success(`Restored ${app.name} to the Apps list`);\n };\n const handleRemovePending = () => {\n removePending.mutate({ appId: app.id });\n toast.success(`Removed pending ${app.name}`);\n };\n const handleMetadataSubmit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const name = draftName.trim();\n if (!name) {\n toast.error(\"App name is required.\");\n return;\n }\n updateMetadata.mutate({\n appId: app.id,\n name,\n description: draftDescription.trim(),\n });\n };\n\n return (\n <div\n aria-disabled={!href}\n className={cn(\n \"group relative rounded-xl bg-card/40 p-4 transition-[background-color] hover:bg-accent/15 focus-within:bg-accent/15 aria-disabled:opacity-60\",\n isArchived && \"opacity-70\",\n className,\n )}\n >\n {href ? (\n <a\n href={href}\n target={openInNewTab ? \"_blank\" : undefined}\n rel={openInNewTab ? \"noreferrer\" : undefined}\n aria-label={`Open ${app.name}`}\n className=\"absolute inset-0 z-0 rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n />\n ) : null}\n\n <div className=\"pointer-events-none relative z-10 flex h-full min-w-0 items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5\">\n <h3 className=\"min-w-0 flex-1 truncate text-sm font-semibold text-foreground\">\n {app.name}\n </h3>\n {isPending ? (\n <Badge\n variant=\"outline\"\n className=\"shrink-0 gap-1 border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300\"\n >\n <IconClockHour4 size={12} />\n {pendingLabel}\n </Badge>\n ) : null}\n {isArchived ? (\n <Badge variant=\"outline\" className=\"shrink-0 gap-1\">\n <IconEyeOff size={12} />\n Hidden\n </Badge>\n ) : null}\n {audience === \"public\" ? (\n <Badge variant=\"outline\" className=\"shrink-0 gap-1\">\n <IconWorld size={12} />\n Public\n </Badge>\n ) : null}\n </div>\n <p className=\"mt-1 truncate font-mono text-[11px] text-muted-foreground\">\n {app.path}\n </p>\n {isPending && app.branchName ? (\n <p className=\"mt-1 truncate text-xs text-muted-foreground\">\n Builder branch: {app.branchName}\n </p>\n ) : null}\n {app.description ? (\n <p className=\"mt-2 min-h-10 line-clamp-2 text-[13px] leading-5 text-muted-foreground\">\n {app.description}\n </p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {!isPending && !isArchived ? (\n <div className=\"pointer-events-auto\">\n <AppResourcesDialog app={app} />\n </div>\n ) : null}\n {!isPending && !isArchived ? (\n <div className=\"pointer-events-auto\">\n <AppKeysPopover appId={app.id} appName={app.name} />\n </div>\n ) : null}\n <div className=\"pointer-events-auto\">\n <DropdownMenu>\n <Tooltip>\n <TooltipTrigger asChild>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n aria-label={`More actions for ${app.name}`}\n className={cn(\n APP_CARD_ACTION_CLASS,\n \"inline-flex cursor-pointer items-center justify-center\",\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <IconDots size={15} />\n </button>\n </DropdownMenuTrigger>\n </TooltipTrigger>\n <TooltipContent>More actions</TooltipContent>\n </Tooltip>\n <DropdownMenuContent align=\"end\" className=\"w-44\">\n <DropdownMenuItem\n onSelect={(event) => {\n event.preventDefault();\n setEditOpen(true);\n }}\n >\n <IconEdit size={14} className=\"mr-2\" />\n Edit details\n </DropdownMenuItem>\n {isPending ? (\n <DropdownMenuItem\n onSelect={handleRemovePending}\n className=\"text-red-600 focus:text-red-600 dark:text-red-400 dark:focus:text-red-400\"\n >\n <IconTrash size={14} className=\"mr-2\" />\n Remove from list\n </DropdownMenuItem>\n ) : isArchived ? (\n <DropdownMenuItem onSelect={handleUnarchive}>\n <IconEye size={14} className=\"mr-2\" />\n Restore to list\n </DropdownMenuItem>\n ) : (\n <DropdownMenuItem onSelect={handleArchive}>\n <IconEyeOff size={14} className=\"mr-2\" />\n Hide from list\n </DropdownMenuItem>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </div>\n </div>\n <Dialog open={editOpen} onOpenChange={setEditOpen}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Edit app details</DialogTitle>\n </DialogHeader>\n <form className=\"space-y-4\" onSubmit={handleMetadataSubmit}>\n <div className=\"space-y-2\">\n <Label htmlFor={`app-name-${app.id}`}>Name</Label>\n <Input\n id={`app-name-${app.id}`}\n value={draftName}\n maxLength={120}\n onChange={(event) => setDraftName(event.target.value)}\n />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor={`app-description-${app.id}`}>Description</Label>\n <Textarea\n id={`app-description-${app.id}`}\n value={draftDescription}\n maxLength={500}\n rows={4}\n onChange={(event) => setDraftDescription(event.target.value)}\n />\n </div>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => setEditOpen(false)}\n >\n Cancel\n </Button>\n <Button type=\"submit\" disabled={updateMetadata.isPending}>\n {updateMetadata.isPending ? \"Saving...\" : \"Save\"}\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n </div>\n );\n}\n\nfunction AppResourcesDialog({ app }: { app: WorkspaceAppSummary }) {\n const [open, setOpen] = useState(false);\n const [inspectedResourceId, setInspectedResourceId] = useState<string | null>(\n null,\n );\n const query = useActionQuery(\n \"list-workspace-resources-for-app\",\n { appId: app.id },\n { enabled: open },\n );\n const { data, isLoading } = query;\n\n const resources = ((data as any)?.resources ?? []) as any[];\n const counts = (data as any)?.counts;\n\n return (\n <Dialog\n open={open}\n onOpenChange={(nextOpen) => {\n setOpen(nextOpen);\n if (!nextOpen) setInspectedResourceId(null);\n }}\n >\n <Tooltip>\n <TooltipTrigger asChild>\n <DialogTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`View agent resources for ${app.name}`}\n className={APP_CARD_ACTION_CLASS}\n onClick={(e) => e.stopPropagation()}\n >\n <IconFileText size={14} />\n </Button>\n </DialogTrigger>\n </TooltipTrigger>\n <TooltipContent>View agent resources</TooltipContent>\n </Tooltip>\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>{app.name} agent resources</DialogTitle>\n <DialogDescription>\n Workspace-scope agent resources are inherited at runtime. App shared\n and personal resources can override them locally.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-4\">\n <div className=\"rounded-lg border bg-muted/30 px-3 py-2 text-xs leading-relaxed text-muted-foreground\">\n All-app agent resources live once at workspace scope and are read by\n each app agent when it builds context. Nothing is copied into this\n app.\n </div>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n <Badge variant=\"secondary\">{counts?.total ?? 0} total</Badge>\n <Badge variant=\"outline\">\n {counts?.workspace ?? counts?.global ?? 0} workspace\n </Badge>\n <Badge variant=\"outline\">{counts?.granted ?? 0} granted</Badge>\n <Badge variant=\"outline\">\n {counts?.autoLoaded ?? 0} auto-loaded\n </Badge>\n </div>\n\n {query.isError ? (\n <ActionQueryError\n error={query.error}\n onRetry={() => void query.refetch()}\n />\n ) : isLoading ? (\n <div className=\"space-y-2\">\n <div className=\"h-14 rounded-lg border bg-muted/30\" />\n <div className=\"h-14 rounded-lg border bg-muted/30\" />\n <div className=\"h-14 rounded-lg border bg-muted/30\" />\n </div>\n ) : resources.length === 0 ? (\n <div className=\"rounded-lg border border-dashed px-4 py-8 text-center text-sm text-muted-foreground\">\n No workspace or granted resources are visible to this app yet.\n </div>\n ) : (\n <div className=\"max-h-[420px] space-y-2 overflow-y-auto pr-1\">\n {resources.map((resource) => {\n const inspected = inspectedResourceId === resource.id;\n return (\n <div\n key={resource.id}\n className=\"rounded-lg border px-3 py-3\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-medium text-foreground\">\n {resource.name}\n </span>\n <Badge variant=\"secondary\">{resource.kind}</Badge>\n <Badge variant=\"outline\">\n {resource.source === \"workspace\"\n ? \"All apps\"\n : \"Granted\"}\n </Badge>\n {resource.autoLoaded ? (\n <Badge variant=\"outline\">Auto-loaded</Badge>\n ) : null}\n </div>\n <div className=\"mt-1 truncate font-mono text-xs text-muted-foreground\">\n {resource.path}\n </div>\n </div>\n <div className=\"flex shrink-0 flex-col items-end gap-2\">\n {resource.source === \"grant\" ? (\n <div className=\"text-right text-[11px] text-muted-foreground\">\n Selected grant\n </div>\n ) : null}\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 px-2 text-xs\"\n onClick={(event) => {\n event.stopPropagation();\n setInspectedResourceId(\n inspected ? null : resource.id,\n );\n }}\n >\n {inspected ? (\n <IconChevronDown size={14} className=\"mr-1\" />\n ) : (\n <IconChevronRight size={14} className=\"mr-1\" />\n )}\n Stack\n </Button>\n </div>\n </div>\n\n {resource.description ? (\n <p className=\"mt-2 line-clamp-2 text-xs text-muted-foreground\">\n {resource.description}\n </p>\n ) : null}\n\n {inspected ? (\n <AppResourceEffectiveStack\n appId={app.id}\n resource={resource}\n />\n ) : null}\n </div>\n );\n })}\n </div>\n )}\n </div>\n <DialogFooter>\n <Button type=\"button\" onClick={() => setOpen(false)}>\n Done\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction stringifyError(err: unknown): string {\n if (err instanceof Error) return err.message;\n return String(err);\n}\n"]}
1
+ {"version":3,"file":"workspace-app-card.js","sourceRoot":"","sources":["../../src/components/workspace-app-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,O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C;IAC7C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC","sourcesContent":["import {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport { useFormatters, useT } from \"@agent-native/core/client/i18n\";\nimport {\n IconCalendar,\n IconChevronDown,\n IconChevronRight,\n IconClockHour4,\n IconDots,\n IconEdit,\n IconEye,\n IconEyeOff,\n IconFileText,\n IconWorld,\n IconTrash,\n IconUser,\n IconUsersGroup,\n} from \"@tabler/icons-react\";\nimport { useEffect, useState, type FormEvent } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { cn } from \"../lib/utils\";\nimport {\n isPendingBuilderHref,\n workspaceAppHref,\n type WorkspaceAppSummary,\n} from \"../lib/workspace-apps\";\nimport { ActionQueryError } from \"./action-query-error\";\nimport { AppKeysPopover } from \"./app-keys-popover\";\nimport { Badge } from \"./ui/badge\";\nimport { Button } from \"./ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"./ui/dialog\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./ui/dropdown-menu\";\nimport { Input } from \"./ui/input\";\nimport { Label } from \"./ui/label\";\nimport { Textarea } from \"./ui/textarea\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"./ui/tooltip\";\nimport { AppResourceEffectiveStack } from \"./workspace-resource-effective-stack\";\n\nconst APP_CARD_ACTION_CLASS =\n \"size-7 rounded-md p-0 text-muted-foreground transition-[background-color,color] hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-foreground\";\n\nexport function WorkspaceAppCard({\n app,\n className,\n}: {\n app: WorkspaceAppSummary;\n className?: string;\n}) {\n const t = useT();\n const { formatDate } = useFormatters();\n const href = workspaceAppHref(app);\n const openInNewTab = isPendingBuilderHref(app);\n const isPending = app.status === \"pending\";\n const pendingLabel = app.statusLabel || \"Builder branch\";\n const isArchived = !!app.archived;\n const audience = app.audience ?? \"internal\";\n const [editOpen, setEditOpen] = useState(false);\n const [draftName, setDraftName] = useState(app.name);\n const [draftDescription, setDraftDescription] = useState(\n app.description || \"\",\n );\n\n useEffect(() => {\n if (editOpen) return;\n setDraftName(app.name);\n setDraftDescription(app.description || \"\");\n }, [app.description, app.name, editOpen]);\n\n const archive = useActionMutation(\"archive-workspace-app\", {\n onError: (err) =>\n toast.error(`Could not hide ${app.name}: ${stringifyError(err)}`),\n });\n const unarchive = useActionMutation(\"unarchive-workspace-app\", {\n onError: (err) =>\n toast.error(`Could not restore ${app.name}: ${stringifyError(err)}`),\n });\n const removePending = useActionMutation(\"remove-pending-workspace-app\", {\n onError: (err) =>\n toast.error(`Could not remove ${app.name}: ${stringifyError(err)}`),\n });\n const updateMetadata = useActionMutation(\"update-workspace-app-metadata\", {\n onSuccess: () => {\n toast.success(`Updated ${draftName.trim() || app.name}`);\n setEditOpen(false);\n },\n onError: (err) =>\n toast.error(`Could not update ${app.name}: ${stringifyError(err)}`),\n });\n\n const handleArchive = () => {\n archive.mutate({ appId: app.id });\n toast.success(`Hid ${app.name} from the Apps list`);\n };\n const handleUnarchive = () => {\n unarchive.mutate({ appId: app.id });\n toast.success(`Restored ${app.name} to the Apps list`);\n };\n const handleRemovePending = () => {\n removePending.mutate({ appId: app.id });\n toast.success(`Removed pending ${app.name}`);\n };\n const handleMetadataSubmit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const name = draftName.trim();\n if (!name) {\n toast.error(\"App name is required.\");\n return;\n }\n updateMetadata.mutate({\n appId: app.id,\n name,\n description: draftDescription.trim(),\n });\n };\n\n return (\n <div\n aria-disabled={!href}\n className={cn(\n \"group relative rounded-xl bg-card/40 p-4 transition-[background-color] hover:bg-accent/15 focus-within:bg-accent/15 aria-disabled:opacity-60\",\n isArchived && \"opacity-70\",\n className,\n )}\n >\n {href ? (\n <a\n href={href}\n target={openInNewTab ? \"_blank\" : undefined}\n rel={openInNewTab ? \"noreferrer\" : undefined}\n aria-label={`Open ${app.name}`}\n className=\"absolute inset-0 z-0 rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n />\n ) : null}\n\n <div className=\"pointer-events-none relative z-10 flex h-full min-w-0 items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5\">\n <h3 className=\"min-w-0 flex-1 truncate text-sm font-semibold text-foreground\">\n {app.name}\n </h3>\n {isPending ? (\n <Badge\n variant=\"outline\"\n className=\"shrink-0 gap-1 border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300\"\n >\n <IconClockHour4 size={12} />\n {pendingLabel}\n </Badge>\n ) : null}\n {isArchived ? (\n <Badge variant=\"outline\" className=\"shrink-0 gap-1\">\n <IconEyeOff size={12} />\n Hidden\n </Badge>\n ) : null}\n {audience === \"public\" ? (\n <Badge variant=\"outline\" className=\"shrink-0 gap-1\">\n <IconWorld size={12} />\n Public\n </Badge>\n ) : null}\n </div>\n <p className=\"mt-1 truncate font-mono text-[11px] text-muted-foreground\">\n {app.path}\n </p>\n {isPending && app.branchName ? (\n <p className=\"mt-1 truncate text-xs text-muted-foreground\">\n Builder branch: {app.branchName}\n </p>\n ) : null}\n {app.description ? (\n <p className=\"mt-2 min-h-10 line-clamp-2 text-[13px] leading-5 text-muted-foreground\">\n {app.description}\n </p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {!isPending && !isArchived ? (\n <div className=\"pointer-events-auto\">\n <AppResourcesDialog app={app} />\n </div>\n ) : null}\n {!isPending && !isArchived ? (\n <div className=\"pointer-events-auto\">\n <AppKeysPopover appId={app.id} appName={app.name} />\n </div>\n ) : null}\n <div className=\"pointer-events-auto\">\n <DropdownMenu>\n <Tooltip>\n <TooltipTrigger asChild>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n aria-label={`More actions for ${app.name}`}\n className={cn(\n APP_CARD_ACTION_CLASS,\n \"inline-flex cursor-pointer items-center justify-center\",\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <IconDots size={15} />\n </button>\n </DropdownMenuTrigger>\n </TooltipTrigger>\n <TooltipContent>More actions</TooltipContent>\n </Tooltip>\n <DropdownMenuContent align=\"end\" className=\"w-72\">\n <DropdownMenuItem\n onSelect={(event) => {\n event.preventDefault();\n setEditOpen(true);\n }}\n >\n <IconEdit size={14} className=\"mr-2\" />\n Edit details\n </DropdownMenuItem>\n {isPending ? (\n <DropdownMenuItem\n onSelect={handleRemovePending}\n className=\"text-red-600 focus:text-red-600 dark:text-red-400 dark:focus:text-red-400\"\n >\n <IconTrash size={14} className=\"mr-2\" />\n Remove from list\n </DropdownMenuItem>\n ) : isArchived ? (\n <DropdownMenuItem onSelect={handleUnarchive}>\n <IconEye size={14} className=\"mr-2\" />\n Restore to list\n </DropdownMenuItem>\n ) : (\n <DropdownMenuItem onSelect={handleArchive}>\n <IconEyeOff size={14} className=\"mr-2\" />\n Hide from list\n </DropdownMenuItem>\n )}\n <DropdownMenuSeparator />\n <DropdownMenuLabel className=\"font-normal\">\n <WorkspaceAppMetadata\n app={app}\n formatDate={formatDate}\n labels={{\n created: t(\"agents.dashboardMetadataCreated\"),\n createdBy: t(\"agents.dashboardMetadataCreatedBy\"),\n owner: t(\"dispatch.pages.appMetadataOwner\"),\n teams: t(\"dispatch.pages.appMetadataTeams\"),\n notTracked: t(\"agents.notTracked\"),\n }}\n />\n </DropdownMenuLabel>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </div>\n </div>\n <Dialog open={editOpen} onOpenChange={setEditOpen}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Edit app details</DialogTitle>\n </DialogHeader>\n <form className=\"space-y-4\" onSubmit={handleMetadataSubmit}>\n <div className=\"space-y-2\">\n <Label htmlFor={`app-name-${app.id}`}>Name</Label>\n <Input\n id={`app-name-${app.id}`}\n value={draftName}\n maxLength={120}\n onChange={(event) => setDraftName(event.target.value)}\n />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor={`app-description-${app.id}`}>Description</Label>\n <Textarea\n id={`app-description-${app.id}`}\n value={draftDescription}\n maxLength={500}\n rows={4}\n onChange={(event) => setDraftDescription(event.target.value)}\n />\n </div>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => setEditOpen(false)}\n >\n Cancel\n </Button>\n <Button type=\"submit\" disabled={updateMetadata.isPending}>\n {updateMetadata.isPending ? \"Saving...\" : \"Save\"}\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n </div>\n );\n}\n\nfunction WorkspaceAppMetadata({\n app,\n formatDate,\n labels,\n}: {\n app: WorkspaceAppSummary;\n formatDate: ReturnType<typeof useFormatters>[\"formatDate\"];\n labels: {\n created: string;\n createdBy: string;\n owner: string;\n teams: string;\n notTracked: string;\n };\n}) {\n function formatMetadataDate(value: string | null | undefined): string {\n if (!value) return labels.notTracked;\n try {\n return formatDate(value, {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n } catch {\n return value;\n }\n }\n\n return (\n <div className=\"flex flex-col gap-1.5 text-xs text-muted-foreground\">\n <WorkspaceAppMetadataRow\n icon={IconCalendar}\n label={labels.created}\n value={formatMetadataDate(app.createdAt)}\n />\n <WorkspaceAppMetadataRow\n icon={IconUser}\n label={labels.createdBy}\n value={app.createdBy || labels.notTracked}\n />\n <WorkspaceAppMetadataRow\n icon={IconUser}\n label={labels.owner}\n value={app.owner || labels.notTracked}\n />\n <WorkspaceAppMetadataRow\n icon={IconUsersGroup}\n label={labels.teams}\n value={app.teams?.join(\", \") || labels.notTracked}\n />\n </div>\n );\n}\n\nfunction WorkspaceAppMetadataRow({\n icon: Icon,\n label,\n value,\n}: {\n icon: typeof IconCalendar;\n label: string;\n value: string;\n}) {\n return (\n <div className=\"flex items-start gap-1.5\">\n <Icon className=\"mt-0.5 h-3 w-3 shrink-0\" />\n <span className=\"shrink-0\">{label}</span>\n <span className=\"min-w-0 truncate text-foreground/80\">{value}</span>\n </div>\n );\n}\n\nfunction AppResourcesDialog({ app }: { app: WorkspaceAppSummary }) {\n const [open, setOpen] = useState(false);\n const [inspectedResourceId, setInspectedResourceId] = useState<string | null>(\n null,\n );\n const query = useActionQuery(\n \"list-workspace-resources-for-app\",\n { appId: app.id },\n { enabled: open },\n );\n const { data, isLoading } = query;\n\n const resources = ((data as any)?.resources ?? []) as any[];\n const counts = (data as any)?.counts;\n\n return (\n <Dialog\n open={open}\n onOpenChange={(nextOpen) => {\n setOpen(nextOpen);\n if (!nextOpen) setInspectedResourceId(null);\n }}\n >\n <Tooltip>\n <TooltipTrigger asChild>\n <DialogTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-label={`View agent resources for ${app.name}`}\n className={APP_CARD_ACTION_CLASS}\n onClick={(e) => e.stopPropagation()}\n >\n <IconFileText size={14} />\n </Button>\n </DialogTrigger>\n </TooltipTrigger>\n <TooltipContent>View agent resources</TooltipContent>\n </Tooltip>\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>{app.name} agent resources</DialogTitle>\n <DialogDescription>\n Workspace-scope agent resources are inherited at runtime. App shared\n and personal resources can override them locally.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-4\">\n <div className=\"rounded-lg border bg-muted/30 px-3 py-2 text-xs leading-relaxed text-muted-foreground\">\n All-app agent resources live once at workspace scope and are read by\n each app agent when it builds context. Nothing is copied into this\n app.\n </div>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n <Badge variant=\"secondary\">{counts?.total ?? 0} total</Badge>\n <Badge variant=\"outline\">\n {counts?.workspace ?? counts?.global ?? 0} workspace\n </Badge>\n <Badge variant=\"outline\">{counts?.granted ?? 0} granted</Badge>\n <Badge variant=\"outline\">\n {counts?.autoLoaded ?? 0} auto-loaded\n </Badge>\n </div>\n\n {query.isError ? (\n <ActionQueryError\n error={query.error}\n onRetry={() => void query.refetch()}\n />\n ) : isLoading ? (\n <div className=\"space-y-2\">\n <div className=\"h-14 rounded-lg border bg-muted/30\" />\n <div className=\"h-14 rounded-lg border bg-muted/30\" />\n <div className=\"h-14 rounded-lg border bg-muted/30\" />\n </div>\n ) : resources.length === 0 ? (\n <div className=\"rounded-lg border border-dashed px-4 py-8 text-center text-sm text-muted-foreground\">\n No workspace or granted resources are visible to this app yet.\n </div>\n ) : (\n <div className=\"max-h-[420px] space-y-2 overflow-y-auto pr-1\">\n {resources.map((resource) => {\n const inspected = inspectedResourceId === resource.id;\n return (\n <div\n key={resource.id}\n className=\"rounded-lg border px-3 py-3\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-medium text-foreground\">\n {resource.name}\n </span>\n <Badge variant=\"secondary\">{resource.kind}</Badge>\n <Badge variant=\"outline\">\n {resource.source === \"workspace\"\n ? \"All apps\"\n : \"Granted\"}\n </Badge>\n {resource.autoLoaded ? (\n <Badge variant=\"outline\">Auto-loaded</Badge>\n ) : null}\n </div>\n <div className=\"mt-1 truncate font-mono text-xs text-muted-foreground\">\n {resource.path}\n </div>\n </div>\n <div className=\"flex shrink-0 flex-col items-end gap-2\">\n {resource.source === \"grant\" ? (\n <div className=\"text-right text-[11px] text-muted-foreground\">\n Selected grant\n </div>\n ) : null}\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 px-2 text-xs\"\n onClick={(event) => {\n event.stopPropagation();\n setInspectedResourceId(\n inspected ? null : resource.id,\n );\n }}\n >\n {inspected ? (\n <IconChevronDown size={14} className=\"mr-1\" />\n ) : (\n <IconChevronRight size={14} className=\"mr-1\" />\n )}\n Stack\n </Button>\n </div>\n </div>\n\n {resource.description ? (\n <p className=\"mt-2 line-clamp-2 text-xs text-muted-foreground\">\n {resource.description}\n </p>\n ) : null}\n\n {inspected ? (\n <AppResourceEffectiveStack\n appId={app.id}\n resource={resource}\n />\n ) : null}\n </div>\n );\n })}\n </div>\n )}\n </div>\n <DialogFooter>\n <Button type=\"button\" onClick={() => setOpen(false)}>\n Done\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction stringifyError(err: unknown): string {\n if (err instanceof Error) return err.message;\n return String(err);\n}\n"]}
@@ -18,10 +18,10 @@ const DEFAULT_LABELS = {
18
18
  cancel: "Cancel",
19
19
  integrationSetup: "Integration setup",
20
20
  installed: "Installed",
21
- remix: "Remix into workspace",
22
- remixing: "Remixing…",
23
- remixSuccess: "Template remixed into your workspace.",
24
- remixError: "Could not remix this template",
21
+ remix: "Create from template",
22
+ remixing: "Creating app…",
23
+ remixSuccess: "Template app creation started.",
24
+ remixError: "Could not create an app from this template",
25
25
  appIdRequired: "App ID is required.",
26
26
  source: "Source",
27
27
  viewLiveApp: "View the live app",
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-template-card.js","sourceRoot":"","sources":["../../src/components/workspace-template-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAA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C,SAAS,EAAE,MAAM,EACjB,KAAK,EACL,YAAY,EACZ,MAAM,EACN,SAAS,EACT,aAAa,EACb,cAAc,GACiB;IAC/B,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAE3C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAExC,OAAO,CACL,mBAAS,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,aACrD,KAAK,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,uBAAuB,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EACpE,cAAK,SAAS,EAAC,2BAA2B,YACvC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAC3B,KAAC,qBAAqB,IAEpB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,aAAa,EACxB,cAAc,EAAE,cAAc,IALzB,aAAa,CAAC,QAAQ,CAAC,CAM5B,CACH,CAAC,GACE,IACE,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { useActionMutation } from \"@agent-native/core/client/hooks\";\nimport {\n IconArrowUpRight,\n IconCircleCheck,\n IconCopy,\n IconExternalLink,\n IconFileText,\n IconPlugConnected,\n} from \"@tabler/icons-react\";\nimport { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { cn } from \"../lib/utils\";\nimport { Alert, AlertDescription } from \"./ui/alert\";\nimport { Badge } from \"./ui/badge\";\nimport { Button } from \"./ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"./ui/card\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"./ui/dialog\";\nimport { Input } from \"./ui/input\";\nimport { Label } from \"./ui/label\";\nimport { Spinner } from \"./ui/spinner\";\n\nexport interface CuratedWorkspaceTemplate {\n id?: string | null;\n templateId?: string | null;\n appId?: string | null;\n name: string;\n description?: string | null;\n source?: string | null;\n sourceDescription?: string | null;\n integrationSetup?: string | null;\n setupNote?: string | null;\n installed?: boolean | null;\n installedAppId?: string | null;\n liveUrl?: string | null;\n productUrl?: string | null;\n}\n\nexport type CuratedWorkspaceTemplatesResult =\n | CuratedWorkspaceTemplate[]\n | {\n templates: CuratedWorkspaceTemplate[];\n };\n\nexport interface WorkspaceTemplateLabels {\n appId: string;\n appIdDescription: string;\n cancel: string;\n integrationSetup: string;\n installed: string;\n remix: string;\n remixing: string;\n remixSuccess: string;\n remixError: string;\n appIdRequired: string;\n source: string;\n viewLiveApp: string;\n}\n\nconst DEFAULT_LABELS: WorkspaceTemplateLabels = {\n appId: \"App ID\",\n appIdDescription: \"Choose the URL-safe id for the new workspace app.\",\n cancel: \"Cancel\",\n integrationSetup: \"Integration setup\",\n installed: \"Installed\",\n remix: \"Remix into workspace\",\n remixing: \"Remixing…\",\n remixSuccess: \"Template remixed into your workspace.\",\n remixError: \"Could not remix this template\",\n appIdRequired: \"App ID is required.\",\n source: \"Source\",\n viewLiveApp: \"View the live app\",\n};\n\nexport interface WorkspaceTemplateCardProps {\n template: CuratedWorkspaceTemplate;\n defaultAppId?: string;\n labels?: Partial<WorkspaceTemplateLabels>;\n className?: string;\n onRemixSuccess?: (\n result: unknown,\n template: CuratedWorkspaceTemplate,\n ) => void;\n}\n\nfunction slugifyAppId(value: string): string {\n return (\n value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 48) || \"new-app\"\n );\n}\n\nfunction templateIdFor(template: CuratedWorkspaceTemplate): string {\n return template.templateId || template.id || template.appId || template.name;\n}\n\nfunction defaultAppIdFor(\n template: CuratedWorkspaceTemplate,\n defaultAppId?: string,\n): string {\n if (defaultAppId) return slugifyAppId(defaultAppId);\n const sourceId = slugifyAppId(template.appId || template.name);\n return `${sourceId}-remix`;\n}\n\nfunction stringifyError(error: unknown): string {\n if (error instanceof Error && error.message) return error.message;\n if (typeof error === \"string\") return error;\n return \"Unknown error\";\n}\n\nfunction mergeLabels(\n labels?: Partial<WorkspaceTemplateLabels>,\n): WorkspaceTemplateLabels {\n return { ...DEFAULT_LABELS, ...labels };\n}\n\nexport function WorkspaceTemplateCard({\n template,\n defaultAppId,\n labels: labelOverrides,\n className,\n onRemixSuccess,\n}: WorkspaceTemplateCardProps) {\n const labels = useMemo(() => mergeLabels(labelOverrides), [labelOverrides]);\n const [open, setOpen] = useState(false);\n const [appId, setAppId] = useState(() =>\n defaultAppIdFor(template, defaultAppId),\n );\n const isInstalled = Boolean(template.installed || template.installedAppId);\n const liveUrl = template.liveUrl || template.productUrl;\n const setupNote = template.integrationSetup || template.setupNote;\n const remix = useActionMutation(\"remix-workspace-template\", {\n onSuccess: (result) => {\n const mode = (result as { mode?: string } | null)?.mode;\n const message = (result as { message?: string } | null)?.message;\n if (mode === \"builder\") {\n toast.success(labels.remixSuccess);\n } else if (mode === \"builder-unavailable\") {\n toast.error(message || labels.remixError);\n } else if (mode === \"coming-soon\") {\n toast.info(message || labels.remixSuccess);\n } else {\n toast.success(labels.remixSuccess);\n }\n setOpen(false);\n onRemixSuccess?.(result, template);\n },\n onError: (error) =>\n toast.error(`${labels.remixError}: ${stringifyError(error)}`),\n });\n\n useEffect(() => {\n if (open) {\n setAppId(defaultAppIdFor(template, defaultAppId));\n }\n }, [defaultAppId, open, template]);\n\n function submitRemix() {\n const trimmedAppId = appId.trim();\n if (!trimmedAppId) {\n toast.error(labels.appIdRequired);\n return;\n }\n\n remix.mutate({\n templateId: templateIdFor(template),\n appId: trimmedAppId,\n });\n }\n\n return (\n <Card\n className={cn(\n \"flex h-full flex-col bg-card/40 shadow-none transition-[background-color] hover:bg-accent/15\",\n className,\n )}\n >\n <CardHeader className=\"gap-2 p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-2.5\">\n <span className=\"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md bg-muted/40 text-muted-foreground\">\n <IconFileText size={16} />\n </span>\n <div className=\"min-w-0\">\n <CardTitle className=\"truncate text-sm font-semibold\">\n {template.name}\n </CardTitle>\n {template.source || template.sourceDescription ? (\n <CardDescription className=\"mt-1 truncate text-xs\">\n <span className=\"font-medium text-foreground/70\">\n {labels.source}:\n </span>{\" \"}\n {template.sourceDescription || template.source}\n </CardDescription>\n ) : null}\n </div>\n </div>\n {isInstalled ? (\n <Badge\n variant=\"outline\"\n className=\"shrink-0 gap-1 border-primary/30 bg-primary/5 text-primary\"\n >\n <IconCircleCheck size={13} />\n {labels.installed}\n </Badge>\n ) : null}\n </div>\n </CardHeader>\n\n <CardContent className=\"flex flex-1 flex-col gap-3 p-4 pt-0\">\n {template.description ? (\n <p className=\"line-clamp-3 text-[13px] leading-5 text-muted-foreground\">\n {template.description}\n </p>\n ) : null}\n\n {setupNote ? (\n <Alert className=\"border-border/60 bg-muted/25 px-3 py-2 [&>svg]:left-3 [&>svg]:top-2.5\">\n <IconPlugConnected size={15} />\n <AlertDescription className=\"text-xs leading-5\">\n <span className=\"font-medium text-foreground/80\">\n {labels.integrationSetup}:\n </span>{\" \"}\n {setupNote}\n </AlertDescription>\n </Alert>\n ) : null}\n </CardContent>\n\n <CardFooter className=\"flex flex-wrap justify-between gap-2 p-4 pt-0\">\n {liveUrl ? (\n <Button variant=\"link\" size=\"sm\" className=\"h-8 px-0\" asChild>\n <a href={liveUrl} target=\"_blank\" rel=\"noreferrer\">\n {labels.viewLiveApp}\n <IconExternalLink />\n </a>\n </Button>\n ) : (\n <span />\n )}\n\n <Dialog\n open={open}\n onOpenChange={(nextOpen) => {\n if (!remix.isPending) setOpen(nextOpen);\n }}\n >\n <DialogTrigger asChild>\n <Button type=\"button\" size=\"sm\">\n <IconCopy />\n {labels.remix}\n </Button>\n </DialogTrigger>\n <DialogContent className=\"max-w-md\">\n <DialogHeader>\n <DialogTitle>{template.name}</DialogTitle>\n <DialogDescription>{labels.appIdDescription}</DialogDescription>\n </DialogHeader>\n <form\n className=\"flex flex-col gap-4\"\n onSubmit={(event) => {\n event.preventDefault();\n submitRemix();\n }}\n >\n <div className=\"flex flex-col gap-2\">\n <Label\n htmlFor={`workspace-template-app-id-${templateIdFor(template)}`}\n >\n {labels.appId}\n </Label>\n <Input\n id={`workspace-template-app-id-${templateIdFor(template)}`}\n value={appId}\n autoComplete=\"off\"\n onChange={(event) => setAppId(event.target.value)}\n disabled={remix.isPending}\n />\n </div>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => setOpen(false)}\n disabled={remix.isPending}\n >\n {labels.cancel}\n </Button>\n <Button type=\"submit\" disabled={remix.isPending}>\n {remix.isPending ? <Spinner /> : <IconArrowUpRight />}\n {remix.isPending ? labels.remixing : labels.remix}\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n </CardFooter>\n </Card>\n );\n}\n\nexport interface WorkspaceTemplatesSectionProps {\n templates: CuratedWorkspaceTemplatesResult;\n title?: ReactNode;\n defaultAppId?: string;\n labels?: Partial<WorkspaceTemplateLabels>;\n className?: string;\n cardClassName?: string;\n onRemixSuccess?: (\n result: unknown,\n template: CuratedWorkspaceTemplate,\n ) => void;\n}\n\nfunction getTemplateItems(\n result: CuratedWorkspaceTemplatesResult,\n): CuratedWorkspaceTemplate[] {\n return Array.isArray(result) ? result : result.templates;\n}\n\nexport function WorkspaceTemplatesSection({\n templates: result,\n title,\n defaultAppId,\n labels,\n className,\n cardClassName,\n onRemixSuccess,\n}: WorkspaceTemplatesSectionProps) {\n const templates = getTemplateItems(result);\n\n if (templates.length === 0) return null;\n\n return (\n <section className={cn(\"flex flex-col gap-3\", className)}>\n {title ? <div className=\"text-sm font-semibold\">{title}</div> : null}\n <div className=\"grid gap-3 md:grid-cols-2\">\n {templates.map((template) => (\n <WorkspaceTemplateCard\n key={templateIdFor(template)}\n template={template}\n defaultAppId={defaultAppId}\n labels={labels}\n className={cardClassName}\n onRemixSuccess={onRemixSuccess}\n />\n ))}\n </div>\n </section>\n );\n}\n"]}
1
+ {"version":3,"file":"workspace-template-card.js","sourceRoot":"","sources":["../../src/components/workspace-template-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuCvC,MAAM,cAAc,GAA4B;IAC9C,KAAK,EAAE,QAAQ;IACf,gBAAgB,EAAE,mDAAmD;IACrE,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,mBAAmB;IACrC,SAAS,EAAE,WA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Y,EAC1B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,aAAa,EACxB,cAAc,EAAE,cAAc,IALzB,aAAa,CAAC,QAAQ,CAAC,CAM5B,CACH,CAAC,GACE,IACE,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { useActionMutation } from \"@agent-native/core/client/hooks\";\nimport {\n IconArrowUpRight,\n IconCircleCheck,\n IconCopy,\n IconExternalLink,\n IconFileText,\n IconPlugConnected,\n} from \"@tabler/icons-react\";\nimport { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { cn } from \"../lib/utils\";\nimport { Alert, AlertDescription } from \"./ui/alert\";\nimport { Badge } from \"./ui/badge\";\nimport { Button } from \"./ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"./ui/card\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"./ui/dialog\";\nimport { Input } from \"./ui/input\";\nimport { Label } from \"./ui/label\";\nimport { Spinner } from \"./ui/spinner\";\n\nexport interface CuratedWorkspaceTemplate {\n id?: string | null;\n templateId?: string | null;\n appId?: string | null;\n name: string;\n description?: string | null;\n source?: string | null;\n sourceDescription?: string | null;\n integrationSetup?: string | null;\n setupNote?: string | null;\n installed?: boolean | null;\n installedAppId?: string | null;\n liveUrl?: string | null;\n productUrl?: string | null;\n}\n\nexport type CuratedWorkspaceTemplatesResult =\n | CuratedWorkspaceTemplate[]\n | {\n templates: CuratedWorkspaceTemplate[];\n };\n\nexport interface WorkspaceTemplateLabels {\n appId: string;\n appIdDescription: string;\n cancel: string;\n integrationSetup: string;\n installed: string;\n remix: string;\n remixing: string;\n remixSuccess: string;\n remixError: string;\n appIdRequired: string;\n source: string;\n viewLiveApp: string;\n}\n\nconst DEFAULT_LABELS: WorkspaceTemplateLabels = {\n appId: \"App ID\",\n appIdDescription: \"Choose the URL-safe id for the new workspace app.\",\n cancel: \"Cancel\",\n integrationSetup: \"Integration setup\",\n installed: \"Installed\",\n remix: \"Create from template\",\n remixing: \"Creating app…\",\n remixSuccess: \"Template app creation started.\",\n remixError: \"Could not create an app from this template\",\n appIdRequired: \"App ID is required.\",\n source: \"Source\",\n viewLiveApp: \"View the live app\",\n};\n\nexport interface WorkspaceTemplateCardProps {\n template: CuratedWorkspaceTemplate;\n defaultAppId?: string;\n labels?: Partial<WorkspaceTemplateLabels>;\n className?: string;\n onRemixSuccess?: (\n result: unknown,\n template: CuratedWorkspaceTemplate,\n ) => void;\n}\n\nfunction slugifyAppId(value: string): string {\n return (\n value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 48) || \"new-app\"\n );\n}\n\nfunction templateIdFor(template: CuratedWorkspaceTemplate): string {\n return template.templateId || template.id || template.appId || template.name;\n}\n\nfunction defaultAppIdFor(\n template: CuratedWorkspaceTemplate,\n defaultAppId?: string,\n): string {\n if (defaultAppId) return slugifyAppId(defaultAppId);\n const sourceId = slugifyAppId(template.appId || template.name);\n return `${sourceId}-remix`;\n}\n\nfunction stringifyError(error: unknown): string {\n if (error instanceof Error && error.message) return error.message;\n if (typeof error === \"string\") return error;\n return \"Unknown error\";\n}\n\nfunction mergeLabels(\n labels?: Partial<WorkspaceTemplateLabels>,\n): WorkspaceTemplateLabels {\n return { ...DEFAULT_LABELS, ...labels };\n}\n\nexport function WorkspaceTemplateCard({\n template,\n defaultAppId,\n labels: labelOverrides,\n className,\n onRemixSuccess,\n}: WorkspaceTemplateCardProps) {\n const labels = useMemo(() => mergeLabels(labelOverrides), [labelOverrides]);\n const [open, setOpen] = useState(false);\n const [appId, setAppId] = useState(() =>\n defaultAppIdFor(template, defaultAppId),\n );\n const isInstalled = Boolean(template.installed || template.installedAppId);\n const liveUrl = template.liveUrl || template.productUrl;\n const setupNote = template.integrationSetup || template.setupNote;\n const remix = useActionMutation(\"remix-workspace-template\", {\n onSuccess: (result) => {\n const mode = (result as { mode?: string } | null)?.mode;\n const message = (result as { message?: string } | null)?.message;\n if (mode === \"builder\") {\n toast.success(labels.remixSuccess);\n } else if (mode === \"builder-unavailable\") {\n toast.error(message || labels.remixError);\n } else if (mode === \"coming-soon\") {\n toast.info(message || labels.remixSuccess);\n } else {\n toast.success(labels.remixSuccess);\n }\n setOpen(false);\n onRemixSuccess?.(result, template);\n },\n onError: (error) =>\n toast.error(`${labels.remixError}: ${stringifyError(error)}`),\n });\n\n useEffect(() => {\n if (open) {\n setAppId(defaultAppIdFor(template, defaultAppId));\n }\n }, [defaultAppId, open, template]);\n\n function submitRemix() {\n const trimmedAppId = appId.trim();\n if (!trimmedAppId) {\n toast.error(labels.appIdRequired);\n return;\n }\n\n remix.mutate({\n templateId: templateIdFor(template),\n appId: trimmedAppId,\n });\n }\n\n return (\n <Card\n className={cn(\n \"flex h-full flex-col bg-card/40 shadow-none transition-[background-color] hover:bg-accent/15\",\n className,\n )}\n >\n <CardHeader className=\"gap-2 p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-2.5\">\n <span className=\"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md bg-muted/40 text-muted-foreground\">\n <IconFileText size={16} />\n </span>\n <div className=\"min-w-0\">\n <CardTitle className=\"truncate text-sm font-semibold\">\n {template.name}\n </CardTitle>\n {template.source || template.sourceDescription ? (\n <CardDescription className=\"mt-1 truncate text-xs\">\n <span className=\"font-medium text-foreground/70\">\n {labels.source}:\n </span>{\" \"}\n {template.sourceDescription || template.source}\n </CardDescription>\n ) : null}\n </div>\n </div>\n {isInstalled ? (\n <Badge\n variant=\"outline\"\n className=\"shrink-0 gap-1 border-primary/30 bg-primary/5 text-primary\"\n >\n <IconCircleCheck size={13} />\n {labels.installed}\n </Badge>\n ) : null}\n </div>\n </CardHeader>\n\n <CardContent className=\"flex flex-1 flex-col gap-3 p-4 pt-0\">\n {template.description ? (\n <p className=\"line-clamp-3 text-[13px] leading-5 text-muted-foreground\">\n {template.description}\n </p>\n ) : null}\n\n {setupNote ? (\n <Alert className=\"border-border/60 bg-muted/25 px-3 py-2 [&>svg]:left-3 [&>svg]:top-2.5\">\n <IconPlugConnected size={15} />\n <AlertDescription className=\"text-xs leading-5\">\n <span className=\"font-medium text-foreground/80\">\n {labels.integrationSetup}:\n </span>{\" \"}\n {setupNote}\n </AlertDescription>\n </Alert>\n ) : null}\n </CardContent>\n\n <CardFooter className=\"flex flex-wrap justify-between gap-2 p-4 pt-0\">\n {liveUrl ? (\n <Button variant=\"link\" size=\"sm\" className=\"h-8 px-0\" asChild>\n <a href={liveUrl} target=\"_blank\" rel=\"noreferrer\">\n {labels.viewLiveApp}\n <IconExternalLink />\n </a>\n </Button>\n ) : (\n <span />\n )}\n\n <Dialog\n open={open}\n onOpenChange={(nextOpen) => {\n if (!remix.isPending) setOpen(nextOpen);\n }}\n >\n <DialogTrigger asChild>\n <Button type=\"button\" size=\"sm\">\n <IconCopy />\n {labels.remix}\n </Button>\n </DialogTrigger>\n <DialogContent className=\"max-w-md\">\n <DialogHeader>\n <DialogTitle>{template.name}</DialogTitle>\n <DialogDescription>{labels.appIdDescription}</DialogDescription>\n </DialogHeader>\n <form\n className=\"flex flex-col gap-4\"\n onSubmit={(event) => {\n event.preventDefault();\n submitRemix();\n }}\n >\n <div className=\"flex flex-col gap-2\">\n <Label\n htmlFor={`workspace-template-app-id-${templateIdFor(template)}`}\n >\n {labels.appId}\n </Label>\n <Input\n id={`workspace-template-app-id-${templateIdFor(template)}`}\n value={appId}\n autoComplete=\"off\"\n onChange={(event) => setAppId(event.target.value)}\n disabled={remix.isPending}\n />\n </div>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => setOpen(false)}\n disabled={remix.isPending}\n >\n {labels.cancel}\n </Button>\n <Button type=\"submit\" disabled={remix.isPending}>\n {remix.isPending ? <Spinner /> : <IconArrowUpRight />}\n {remix.isPending ? labels.remixing : labels.remix}\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n </CardFooter>\n </Card>\n );\n}\n\nexport interface WorkspaceTemplatesSectionProps {\n templates: CuratedWorkspaceTemplatesResult;\n title?: ReactNode;\n defaultAppId?: string;\n labels?: Partial<WorkspaceTemplateLabels>;\n className?: string;\n cardClassName?: string;\n onRemixSuccess?: (\n result: unknown,\n template: CuratedWorkspaceTemplate,\n ) => void;\n}\n\nfunction getTemplateItems(\n result: CuratedWorkspaceTemplatesResult,\n): CuratedWorkspaceTemplate[] {\n return Array.isArray(result) ? result : result.templates;\n}\n\nexport function WorkspaceTemplatesSection({\n templates: result,\n title,\n defaultAppId,\n labels,\n className,\n cardClassName,\n onRemixSuccess,\n}: WorkspaceTemplatesSectionProps) {\n const templates = getTemplateItems(result);\n\n if (templates.length === 0) return null;\n\n return (\n <section className={cn(\"flex flex-col gap-3\", className)}>\n {title ? <div className=\"text-sm font-semibold\">{title}</div> : null}\n <div className=\"grid gap-3 md:grid-cols-2\">\n {templates.map((template) => (\n <WorkspaceTemplateCard\n key={templateIdFor(template)}\n template={template}\n defaultAppId={defaultAppId}\n labels={labels}\n className={cardClassName}\n onRemixSuccess={onRemixSuccess}\n />\n ))}\n </div>\n </section>\n );\n}\n"]}
@@ -13,6 +13,9 @@ export interface WorkspaceAppSummary {
13
13
  builderUrl?: string | null;
14
14
  branchName?: string | null;
15
15
  createdAt?: string | null;
16
+ createdBy?: string | null;
17
+ owner?: string | null;
18
+ teams?: string[];
16
19
  agentCardUrl?: string | null;
17
20
  agentCardReachable?: boolean;
18
21
  a2aEndpointUrl?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-apps.d.ts","sourceRoot":"","sources":["../../src/lib/workspace-apps.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;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B,CAAC,GAAG,CAAC,UAAU,EAAE;gBAC3C,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,iBAAiB;aAC3B,CAAC;YACJ,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAwB;IAC3D,OAAO,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;AACtD,CAAC","sourcesContent":["import { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\n\nexport interface WorkspaceAppSummary {\n id: string;\n name: string;\n description?: string;\n path: string;\n url?: string | null;\n isDispatch?: boolean;\n audience?: \"internal\" | \"public\";\n publicPaths?: string[];\n protectedPaths?: string[];\n status?: \"ready\" | \"pending\";\n statusLabel?: string;\n builderUrl?: string | null;\n branchName?: string | null;\n createdAt?: string | null;\n agentCardUrl?: string | null;\n agentCardReachable?: boolean;\n a2aEndpointUrl?: string | null;\n agentName?: string | null;\n agentSkillsCount?: number | null;\n archived?: boolean;\n}\n\nexport function workspaceAppHref(app: WorkspaceAppSummary): string | null {\n if (app.status === \"pending\") {\n return app.builderUrl\n ? withBuilderUtmTrackingParams(app.builderUrl, {\n campaign: \"product\",\n content: \"dispatch_branch\",\n })\n : null;\n }\n return app.path || app.url || null;\n}\n\nexport function isPendingBuilderHref(app: WorkspaceAppSummary): boolean {\n return app.status === \"pending\" && !!app.builderUrl;\n}\n"]}
1
+ {"version":3,"file":"workspace-apps.js","sourceRoot":"","sources":["../../src/lib/workspace-apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AA4B/F,MAAM,UAAU,gBAAgB,CAAC,GAAwB;IACvD,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC,UAAU;YACnB,CAAC,CAAC,4BAA4B,CAAC,GAAG,CAAC,UAAU,EAAE;gBAC3C,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,iBAAiB;aAC3B,CAAC;YACJ,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAwB;IAC3D,OAAO,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;AACtD,CAAC","sourcesContent":["import { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\n\nexport interface WorkspaceAppSummary {\n id: string;\n name: string;\n description?: string;\n path: string;\n url?: string | null;\n isDispatch?: boolean;\n audience?: \"internal\" | \"public\";\n publicPaths?: string[];\n protectedPaths?: string[];\n status?: \"ready\" | \"pending\";\n statusLabel?: string;\n builderUrl?: string | null;\n branchName?: string | null;\n createdAt?: string | null;\n createdBy?: string | null;\n owner?: string | null;\n teams?: string[];\n agentCardUrl?: string | null;\n agentCardReachable?: boolean;\n a2aEndpointUrl?: string | null;\n agentName?: string | null;\n agentSkillsCount?: number | null;\n archived?: boolean;\n}\n\nexport function workspaceAppHref(app: WorkspaceAppSummary): string | null {\n if (app.status === \"pending\") {\n return app.builderUrl\n ? withBuilderUtmTrackingParams(app.builderUrl, {\n campaign: \"product\",\n content: \"dispatch_branch\",\n })\n : null;\n }\n return app.path || app.url || null;\n}\n\nexport function isPendingBuilderHref(app: WorkspaceAppSummary): boolean {\n return app.status === \"pending\" && !!app.builderUrl;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/apps.tsx"],"names":[],"mappings":"AAoCA,wBAAgB,IAAI;;IAEnB;AAQD,MAAM,CAAC,OAAO,UAAU,SAAS,oDAuOhC"}
1
+ {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/apps.tsx"],"names":[],"mappings":"AAqCA,wBAAgB,IAAI;;IAEnB;AAQD,MAAM,CAAC,OAAO,UAAU,SAAS,oDAwShC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useActionQuery } from "@agent-native/core/client/hooks";
3
3
  import { useT } from "@agent-native/core/client/i18n";
4
4
  import { withBuilderUtmTrackingParams } from "@agent-native/core/shared/builder-link-tracking";
5
- import { IconApps, IconArrowUpRight, IconChevronDown, IconEyeOff, IconPlus, IconStack2, } from "@tabler/icons-react";
5
+ import { IconApps, IconArrowUpRight, IconChevronDown, IconClockHour4, IconEyeOff, IconPlus, IconStack2, } from "@tabler/icons-react";
6
6
  import { useState } from "react";
7
7
  import { ActionQueryError } from "../../components/action-query-error.js";
8
8
  import { CreateAppPopover } from "../../components/create-app-popover.js";
@@ -19,6 +19,7 @@ export function meta() {
19
19
  }
20
20
  export default function AppsRoute() {
21
21
  const t = useT();
22
+ const [showPending, setShowPending] = useState(false);
22
23
  const [showHidden, setShowHidden] = useState(false);
23
24
  const appsQuery = useActionQuery("list-workspace-apps", {
24
25
  includeAgentCards: false,
@@ -32,6 +33,8 @@ export default function AppsRoute() {
32
33
  const workspaceLabel = ws?.displayName ?? ws?.name ?? null;
33
34
  const allApps = apps.filter((app) => !app.isDispatch);
34
35
  const visibleApps = allApps.filter((app) => !app.archived);
36
+ const activeApps = visibleApps.filter((app) => app.status !== "pending");
37
+ const pendingApps = visibleApps.filter((app) => app.status === "pending");
35
38
  const archivedApps = allApps.filter((app) => app.archived);
36
39
  const otherApps = filterOtherApps((connectedAppsQuery.data || []), allApps);
37
40
  const showAppSkeletons = appsLoading && allApps.length === 0;
@@ -58,12 +61,20 @@ export default function AppsRoute() {
58
61
  workspace: workspaceLabel,
59
62
  })
60
63
  : t("dispatch.pages.workspaceApps") }), _jsxs("p", { className: "mt-0.5 text-xs text-muted-foreground", children: [t("dispatch.pages.activeCount", {
61
- count: visibleApps.length,
62
- }), archivedApps.length > 0
64
+ count: activeApps.length,
65
+ }), pendingApps.length > 0
66
+ ? ` · ${t("dispatch.pages.pendingCount", {
67
+ count: pendingApps.length,
68
+ })}`
69
+ : "", archivedApps.length > 0
63
70
  ? ` · ${t("dispatch.pages.hiddenCount", {
64
71
  count: archivedApps.length,
65
72
  })}`
66
- : ""] })] })] }), visibleApps.length > 0 ? (_jsx(CreateAppPopover, { align: "end", trigger: _jsxs(Button, { size: "sm", children: [_jsx(IconPlus, { size: 15, className: "mr-1.5" }), t("dispatch.pages.createApp")] }) })) : null] }), appsQuery.isError ? (_jsx(ActionQueryError, { error: appsQuery.error, onRetry: () => void appsQuery.refetch() })) : showAppSkeletons ? (_jsx(AppsSkeletonGrid, {})) : visibleApps.length > 0 ? (_jsx("div", { className: "grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3", children: visibleApps.map((app) => (_jsx(WorkspaceAppCard, { app: app, className: "h-full" }, app.id))) })) : (_jsx(EmptyAppsState, {}))] }), curatedTemplatesQuery.isError ? (_jsx("section", { className: "space-y-3 border-t pt-4", children: _jsx(ActionQueryError, { error: curatedTemplatesQuery.error, onRetry: () => void curatedTemplatesQuery.refetch() }) })) : curatedTemplatesQuery.data ? (_jsxs("section", { className: "space-y-3 border-t pt-4", children: [_jsxs("div", { className: "flex min-w-0 items-start gap-2", children: [_jsx(IconStack2, { size: 16, className: "mt-0.5 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "truncate text-sm font-semibold text-foreground", children: t("dispatch.pages.curatedTemplates") }), _jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: t("dispatch.pages.curatedTemplatesDescription") })] })] }), _jsx(WorkspaceTemplatesSection, { templates: curatedTemplatesQuery.data, labels: templateLabels, onRemixSuccess: () => {
73
+ : ""] })] })] }), activeApps.length > 0 || pendingApps.length > 0 ? (_jsx(CreateAppPopover, { align: "end", trigger: _jsxs(Button, { size: "sm", children: [_jsx(IconPlus, { size: 15, className: "mr-1.5" }), t("dispatch.pages.createApp")] }) })) : null] }), appsQuery.isError ? (_jsx(ActionQueryError, { error: appsQuery.error, onRetry: () => void appsQuery.refetch() })) : showAppSkeletons ? (_jsx(AppsSkeletonGrid, {})) : activeApps.length > 0 ? (_jsx("div", { className: "grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3", children: activeApps.map((app) => (_jsx(WorkspaceAppCard, { app: app, className: "h-full" }, app.id))) })) : pendingApps.length > 0 ? (_jsx(EmptyActiveAppsState, {})) : (_jsx(EmptyAppsState, {}))] }), pendingApps.length > 0 ? (_jsx(Collapsible, { open: showPending, onOpenChange: setShowPending, children: _jsxs("section", { className: "space-y-3 border-t pt-4", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(IconClockHour4, { size: 16, className: "shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "text-sm font-semibold text-foreground", children: t("dispatch.pages.pendingApps") }), _jsx("p", { className: "text-xs text-muted-foreground", children: t("dispatch.pages.pendingAppsDescription", {
74
+ count: pendingApps.length,
75
+ }) })] })] }), _jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "gap-1.5", children: [showPending
76
+ ? t("dispatch.pages.hidePendingApps")
77
+ : t("dispatch.pages.showPendingApps"), _jsx(IconChevronDown, { size: 14, className: cn("transition-transform", showPending && "rotate-180") })] }) })] }), _jsx(CollapsibleContent, { children: _jsx("div", { className: "grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3", children: pendingApps.map((app) => (_jsx(WorkspaceAppCard, { app: app, className: "h-full" }, app.id))) }) })] }) })) : null, curatedTemplatesQuery.isError ? (_jsx("section", { className: "space-y-3 border-t pt-4", children: _jsx(ActionQueryError, { error: curatedTemplatesQuery.error, onRetry: () => void curatedTemplatesQuery.refetch() }) })) : curatedTemplatesQuery.data ? (_jsxs("section", { className: "space-y-3 border-t pt-4", children: [_jsxs("div", { className: "flex min-w-0 items-start gap-2", children: [_jsx(IconStack2, { size: 16, className: "mt-0.5 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "truncate text-sm font-semibold text-foreground", children: t("dispatch.pages.curatedTemplates") }), _jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: t("dispatch.pages.curatedTemplatesDescription") })] })] }), _jsx(WorkspaceTemplatesSection, { templates: curatedTemplatesQuery.data, labels: templateLabels, onRemixSuccess: () => {
67
78
  void appsQuery.refetch();
68
79
  void curatedTemplatesQuery.refetch();
69
80
  } })] })) : null, connectedAppsQuery.isError ? (_jsxs("section", { className: "space-y-3 border-t pt-4", children: [_jsx(OtherAppsHeading, { count: 0 }), _jsx(ActionQueryError, { error: connectedAppsQuery.error, onRetry: () => void connectedAppsQuery.refetch() })] })) : connectedAppsQuery.isLoading || otherApps.length > 0 ? (_jsxs("section", { className: "space-y-3 border-t pt-4", children: [_jsx(OtherAppsHeading, { count: otherApps.length }), connectedAppsQuery.isLoading ? (_jsx(OtherAppsSkeletonGrid, {})) : (_jsx("div", { className: "grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3", children: otherApps.map((app) => (_jsx(OtherAppCard, { app: app }, app.id))) }))] })) : null, archivedApps.length > 0 ? (_jsx(Collapsible, { open: showHidden, onOpenChange: setShowHidden, children: _jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 border-t pt-4", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(IconEyeOff, { size: 16, className: "shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "text-sm font-semibold text-foreground", children: t("dispatch.pages.hiddenApps") }), _jsx("p", { className: "text-xs text-muted-foreground", children: t("dispatch.pages.hiddenAppCount", {
@@ -95,4 +106,8 @@ function EmptyAppsState() {
95
106
  const t = useT();
96
107
  return (_jsxs("div", { className: "rounded-lg border border-dashed bg-card px-4 py-10 text-center", children: [_jsx("div", { className: "mx-auto flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground", children: _jsx(IconApps, { size: 18 }) }), _jsx("h3", { className: "mt-3 text-sm font-semibold text-foreground", children: t("dispatch.pages.noWorkspaceApps") }), _jsx("p", { className: "mx-auto mt-1 max-w-sm text-sm text-muted-foreground", children: t("dispatch.pages.noWorkspaceAppsDescription") }), _jsx("div", { className: "mt-4", children: _jsx(CreateAppPopover, { trigger: _jsxs(Button, { size: "sm", children: [_jsx(IconPlus, { size: 15, className: "mr-1.5" }), t("dispatch.pages.createApp")] }) }) })] }));
97
108
  }
109
+ function EmptyActiveAppsState() {
110
+ const t = useT();
111
+ return (_jsxs("div", { className: "rounded-lg border border-dashed bg-card px-4 py-10 text-center", children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: t("dispatch.pages.noActiveWorkspaceApps") }), _jsx("p", { className: "mx-auto mt-1 max-w-md text-xs text-muted-foreground", children: t("dispatch.pages.noActiveWorkspaceAppsDescription") })] }));
112
+ }
98
113
  //# sourceMappingURL=apps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apps.js","sourceRoot":"","sources":["../../../src/routes/pages/apps.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,QAAQ,EACR,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM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QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,GAClB,EACN,aAAI,SAAS,EAAC,4CAA4C,YACvD,CAAC,CAAC,gCAAgC,CAAC,GACjC,EACL,YAAG,SAAS,EAAC,qDAAqD,YAC/D,CAAC,CAAC,2CAA2C,CAAC,GAC7C,EACJ,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,gBAAgB,IACf,OAAO,EACL,MAAC,MAAM,IAAC,IAAI,EAAC,IAAI,aACf,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,GAAG,EACxC,CAAC,CAAC,0BAA0B,CAAC,IACvB,GAEX,GACE,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\nimport {\n IconApps,\n IconArrowUpRight,\n IconChevronDown,\n IconEyeOff,\n IconPlus,\n IconStack2,\n} from \"@tabler/icons-react\";\nimport { useState } from \"react\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { CreateAppPopover } from \"../../components/create-app-popover\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../components/ui/collapsible\";\nimport { Skeleton } from \"../../components/ui/skeleton\";\nimport { WorkspaceAppCard } from \"../../components/workspace-app-card\";\nimport {\n WorkspaceTemplatesSection,\n type CuratedWorkspaceTemplatesResult,\n type WorkspaceTemplateLabels,\n} from \"../../components/workspace-template-card\";\nimport {\n filterOtherApps,\n type ConnectedAppSummary,\n} from \"../../lib/other-apps\";\nimport { cn } from \"../../lib/utils\";\nimport type { WorkspaceAppSummary } from \"../../lib/workspace-apps\";\n\nexport function meta() {\n return [{ title: \"Apps — Dispatch\" }];\n}\n\ninterface WorkspaceInfo {\n name: string | null;\n displayName: string | null;\n appCount: number;\n}\n\nexport default function AppsRoute() {\n const t = useT();\n const [showHidden, setShowHidden] = useState(false);\n const appsQuery = useActionQuery(\"list-workspace-apps\", {\n includeAgentCards: false,\n includeArchived: true,\n });\n const connectedAppsQuery = useActionQuery(\"list-connected-agents\", {});\n const curatedTemplatesQuery = useActionQuery(\n \"list-curated-workspace-templates\",\n {},\n );\n const { data: apps = [], isLoading: appsLoading } = appsQuery;\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 allApps = (apps as WorkspaceAppSummary[]).filter(\n (app) => !app.isDispatch,\n );\n const visibleApps = allApps.filter((app) => !app.archived);\n const archivedApps = allApps.filter((app) => app.archived);\n const otherApps = filterOtherApps(\n (connectedAppsQuery.data || []) as ConnectedAppSummary[],\n allApps,\n );\n const showAppSkeletons = appsLoading && allApps.length === 0;\n const templateLabels: WorkspaceTemplateLabels = {\n appId: t(\"dispatch.pages.remixAppIdLabel\"),\n appIdDescription: t(\"dispatch.pages.remixAppIdDescription\"),\n cancel: t(\"dispatch.pages.cancel\"),\n integrationSetup: t(\"dispatch.pages.integrationSetup\"),\n installed: t(\"dispatch.pages.alreadyInWorkspace\"),\n remix: t(\"dispatch.pages.remix\"),\n remixing: t(\"dispatch.pages.remixing\"),\n remixSuccess: t(\"dispatch.pages.remixSuccess\"),\n remixError: t(\"dispatch.pages.remixError\"),\n appIdRequired: t(\"dispatch.pages.appIdRequired\"),\n source: t(\"dispatch.pages.source\"),\n viewLiveApp: t(\"dispatch.pages.viewLiveApp\"),\n };\n\n return (\n <DispatchShell\n title={t(\"dispatch.nav.apps\")}\n description={\n workspaceLabel\n ? t(\"dispatch.pages.appsDescriptionWithWorkspace\", {\n workspace: workspaceLabel,\n })\n : t(\"dispatch.pages.appsDescription\")\n }\n >\n <div className=\"space-y-8\">\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-end justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-2\">\n <IconApps\n size={16}\n className=\"mt-0.5 shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {workspaceLabel\n ? t(\"dispatch.pages.appsInWorkspace\", {\n workspace: workspaceLabel,\n })\n : t(\"dispatch.pages.workspaceApps\")}\n </h2>\n <p className=\"mt-0.5 text-xs text-muted-foreground\">\n {t(\"dispatch.pages.activeCount\", {\n count: visibleApps.length,\n })}\n {archivedApps.length > 0\n ? ` · ${t(\"dispatch.pages.hiddenCount\", {\n count: archivedApps.length,\n })}`\n : \"\"}\n </p>\n </div>\n </div>\n {visibleApps.length > 0 ? (\n <CreateAppPopover\n align=\"end\"\n trigger={\n <Button size=\"sm\">\n <IconPlus size={15} className=\"mr-1.5\" />\n {t(\"dispatch.pages.createApp\")}\n </Button>\n }\n />\n ) : null}\n </div>\n\n {appsQuery.isError ? (\n <ActionQueryError\n error={appsQuery.error}\n onRetry={() => void appsQuery.refetch()}\n />\n ) : showAppSkeletons ? (\n <AppsSkeletonGrid />\n ) : visibleApps.length > 0 ? (\n <div className=\"grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {visibleApps.map((app) => (\n <WorkspaceAppCard key={app.id} app={app} className=\"h-full\" />\n ))}\n </div>\n ) : (\n <EmptyAppsState />\n )}\n </section>\n\n {curatedTemplatesQuery.isError ? (\n <section className=\"space-y-3 border-t pt-4\">\n <ActionQueryError\n error={curatedTemplatesQuery.error}\n onRetry={() => void curatedTemplatesQuery.refetch()}\n />\n </section>\n ) : curatedTemplatesQuery.data ? (\n <section className=\"space-y-3 border-t pt-4\">\n <div className=\"flex min-w-0 items-start gap-2\">\n <IconStack2\n size={16}\n className=\"mt-0.5 shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.curatedTemplates\")}\n </h2>\n <p className=\"mt-0.5 text-xs text-muted-foreground\">\n {t(\"dispatch.pages.curatedTemplatesDescription\")}\n </p>\n </div>\n </div>\n <WorkspaceTemplatesSection\n templates={\n curatedTemplatesQuery.data as CuratedWorkspaceTemplatesResult\n }\n labels={templateLabels}\n onRemixSuccess={() => {\n void appsQuery.refetch();\n void curatedTemplatesQuery.refetch();\n }}\n />\n </section>\n ) : null}\n\n {connectedAppsQuery.isError ? (\n <section className=\"space-y-3 border-t pt-4\">\n <OtherAppsHeading count={0} />\n <ActionQueryError\n error={connectedAppsQuery.error}\n onRetry={() => void connectedAppsQuery.refetch()}\n />\n </section>\n ) : connectedAppsQuery.isLoading || otherApps.length > 0 ? (\n <section className=\"space-y-3 border-t pt-4\">\n <OtherAppsHeading count={otherApps.length} />\n {connectedAppsQuery.isLoading ? (\n <OtherAppsSkeletonGrid />\n ) : (\n <div className=\"grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {otherApps.map((app) => (\n <OtherAppCard key={app.id} app={app} />\n ))}\n </div>\n )}\n </section>\n ) : null}\n\n {archivedApps.length > 0 ? (\n <Collapsible open={showHidden} onOpenChange={setShowHidden}>\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3 border-t pt-4\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconEyeOff\n size={16}\n className=\"shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.hiddenApps\")}\n </h2>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.hiddenAppCount\", {\n count: archivedApps.length,\n })}\n </p>\n </div>\n </div>\n <CollapsibleTrigger asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"gap-1.5\"\n >\n {showHidden\n ? t(\"dispatch.pages.hide\")\n : t(\"dispatch.pages.show\")}\n <IconChevronDown\n size={14}\n className={cn(\n \"transition-transform\",\n showHidden && \"rotate-180\",\n )}\n />\n </Button>\n </CollapsibleTrigger>\n </div>\n <CollapsibleContent>\n <div className=\"grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {archivedApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className=\"h-full\"\n />\n ))}\n </div>\n </CollapsibleContent>\n </section>\n </Collapsible>\n ) : null}\n </div>\n </DispatchShell>\n );\n}\n\nfunction OtherAppsHeading({ count }: { count: number }) {\n const t = useT();\n return (\n <div className=\"flex min-w-0 items-start gap-2\">\n <IconStack2 size={16} className=\"mt-0.5 shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.otherApps\")}\n </h2>\n <p className=\"mt-0.5 text-xs text-muted-foreground\">\n {t(\"dispatch.pages.otherAppsDescription\")}\n {count > 0\n ? ` · ${t(\"dispatch.pages.availableCount\", { count })}`\n : \"\"}\n </p>\n </div>\n </div>\n );\n}\n\nfunction OtherAppsSkeletonGrid() {\n return (\n <div className=\"grid gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <div key={index} className=\"rounded-lg bg-card p-4\">\n <div className=\"flex items-start gap-3\">\n <Skeleton className=\"size-8 rounded-md\" />\n <div className=\"flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction OtherAppCard({ app }: { app: ConnectedAppSummary }) {\n const t = useT();\n return (\n <a\n href={withBuilderUtmTrackingParams(app.url, {\n campaign: \"product\",\n content: \"dispatch_app\",\n })}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"group flex min-h-[116px] items-start gap-3 rounded-xl bg-card/40 p-4 transition-[background-color] hover:bg-accent/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-xs font-semibold text-muted-foreground\">\n {app.name.charAt(0).toUpperCase()}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex items-start justify-between gap-3\">\n <span className=\"truncate text-sm font-semibold text-foreground\">\n {app.name}\n </span>\n <IconArrowUpRight\n size={15}\n className=\"shrink-0 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5\"\n />\n </span>\n <span className=\"mt-2 line-clamp-2 block text-[13px] leading-5 text-muted-foreground\">\n {app.description || app.url}\n </span>\n <span className=\"mt-3 block text-xs font-medium text-foreground\">\n {t(\"dispatch.pages.openApp\")}\n </span>\n </span>\n </a>\n );\n}\n\nfunction AppsSkeletonGrid() {\n return (\n <div className=\"grid gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <div key={index} className=\"rounded-lg bg-card p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-24\" />\n <div className=\"space-y-2 pt-1\">\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n <Skeleton className=\"h-7 w-7 rounded-md\" />\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction EmptyAppsState() {\n const t = useT();\n return (\n <div className=\"rounded-lg border border-dashed bg-card px-4 py-10 text-center\">\n <div className=\"mx-auto flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground\">\n <IconApps size={18} />\n </div>\n <h3 className=\"mt-3 text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.noWorkspaceApps\")}\n </h3>\n <p className=\"mx-auto mt-1 max-w-sm text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noWorkspaceAppsDescription\")}\n </p>\n <div className=\"mt-4\">\n <CreateAppPopover\n trigger={\n <Button size=\"sm\">\n <IconPlus size={15} className=\"mr-1.5\" />\n {t(\"dispatch.pages.createApp\")}\n </Button>\n }\n />\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"apps.js","sourceRoot":"","sources":["../../../src/routes/pages/apps.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,UAAU,EACV,QAAQ,EACR,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EACL,yBAAyB,GAG1B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,eAAe,GAEhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAGrC,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACxC,CAAC;AAQD,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,MAAM,CAAC,GAAG,IAAI,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ACjC,EACL,YAAG,SAAS,EAAC,qDAAqD,YAC/D,CAAC,CAAC,2CAA2C,CAAC,GAC7C,EACJ,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,gBAAgB,IACf,OAAO,EACL,MAAC,MAAM,IAAC,IAAI,EAAC,IAAI,aACf,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,GAAG,EACxC,CAAC,CAAC,0BAA0B,CAAC,IACvB,GAEX,GACE,IACF,CACP,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB;IAC3B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,OAAO,CACL,eAAK,SAAS,EAAC,gEAAgE,aAC7E,YAAG,SAAS,EAAC,qCAAqC,YAC/C,CAAC,CAAC,sCAAsC,CAAC,GACxC,EACJ,YAAG,SAAS,EAAC,qDAAqD,YAC/D,CAAC,CAAC,iDAAiD,CAAC,GACnD,IACA,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\nimport {\n IconApps,\n IconArrowUpRight,\n IconChevronDown,\n IconClockHour4,\n IconEyeOff,\n IconPlus,\n IconStack2,\n} from \"@tabler/icons-react\";\nimport { useState } from \"react\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { CreateAppPopover } from \"../../components/create-app-popover\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../components/ui/collapsible\";\nimport { Skeleton } from \"../../components/ui/skeleton\";\nimport { WorkspaceAppCard } from \"../../components/workspace-app-card\";\nimport {\n WorkspaceTemplatesSection,\n type CuratedWorkspaceTemplatesResult,\n type WorkspaceTemplateLabels,\n} from \"../../components/workspace-template-card\";\nimport {\n filterOtherApps,\n type ConnectedAppSummary,\n} from \"../../lib/other-apps\";\nimport { cn } from \"../../lib/utils\";\nimport type { WorkspaceAppSummary } from \"../../lib/workspace-apps\";\n\nexport function meta() {\n return [{ title: \"Apps — Dispatch\" }];\n}\n\ninterface WorkspaceInfo {\n name: string | null;\n displayName: string | null;\n appCount: number;\n}\n\nexport default function AppsRoute() {\n const t = useT();\n const [showPending, setShowPending] = useState(false);\n const [showHidden, setShowHidden] = useState(false);\n const appsQuery = useActionQuery(\"list-workspace-apps\", {\n includeAgentCards: false,\n includeArchived: true,\n });\n const connectedAppsQuery = useActionQuery(\"list-connected-agents\", {});\n const curatedTemplatesQuery = useActionQuery(\n \"list-curated-workspace-templates\",\n {},\n );\n const { data: apps = [], isLoading: appsLoading } = appsQuery;\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 allApps = (apps as WorkspaceAppSummary[]).filter(\n (app) => !app.isDispatch,\n );\n const visibleApps = allApps.filter((app) => !app.archived);\n const activeApps = visibleApps.filter((app) => app.status !== \"pending\");\n const pendingApps = visibleApps.filter((app) => app.status === \"pending\");\n const archivedApps = allApps.filter((app) => app.archived);\n const otherApps = filterOtherApps(\n (connectedAppsQuery.data || []) as ConnectedAppSummary[],\n allApps,\n );\n const showAppSkeletons = appsLoading && allApps.length === 0;\n const templateLabels: WorkspaceTemplateLabels = {\n appId: t(\"dispatch.pages.remixAppIdLabel\"),\n appIdDescription: t(\"dispatch.pages.remixAppIdDescription\"),\n cancel: t(\"dispatch.pages.cancel\"),\n integrationSetup: t(\"dispatch.pages.integrationSetup\"),\n installed: t(\"dispatch.pages.alreadyInWorkspace\"),\n remix: t(\"dispatch.pages.remix\"),\n remixing: t(\"dispatch.pages.remixing\"),\n remixSuccess: t(\"dispatch.pages.remixSuccess\"),\n remixError: t(\"dispatch.pages.remixError\"),\n appIdRequired: t(\"dispatch.pages.appIdRequired\"),\n source: t(\"dispatch.pages.source\"),\n viewLiveApp: t(\"dispatch.pages.viewLiveApp\"),\n };\n\n return (\n <DispatchShell\n title={t(\"dispatch.nav.apps\")}\n description={\n workspaceLabel\n ? t(\"dispatch.pages.appsDescriptionWithWorkspace\", {\n workspace: workspaceLabel,\n })\n : t(\"dispatch.pages.appsDescription\")\n }\n >\n <div className=\"space-y-8\">\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-end justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-2\">\n <IconApps\n size={16}\n className=\"mt-0.5 shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {workspaceLabel\n ? t(\"dispatch.pages.appsInWorkspace\", {\n workspace: workspaceLabel,\n })\n : t(\"dispatch.pages.workspaceApps\")}\n </h2>\n <p className=\"mt-0.5 text-xs text-muted-foreground\">\n {t(\"dispatch.pages.activeCount\", {\n count: activeApps.length,\n })}\n {pendingApps.length > 0\n ? ` · ${t(\"dispatch.pages.pendingCount\", {\n count: pendingApps.length,\n })}`\n : \"\"}\n {archivedApps.length > 0\n ? ` · ${t(\"dispatch.pages.hiddenCount\", {\n count: archivedApps.length,\n })}`\n : \"\"}\n </p>\n </div>\n </div>\n {activeApps.length > 0 || pendingApps.length > 0 ? (\n <CreateAppPopover\n align=\"end\"\n trigger={\n <Button size=\"sm\">\n <IconPlus size={15} className=\"mr-1.5\" />\n {t(\"dispatch.pages.createApp\")}\n </Button>\n }\n />\n ) : null}\n </div>\n\n {appsQuery.isError ? (\n <ActionQueryError\n error={appsQuery.error}\n onRetry={() => void appsQuery.refetch()}\n />\n ) : showAppSkeletons ? (\n <AppsSkeletonGrid />\n ) : activeApps.length > 0 ? (\n <div className=\"grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {activeApps.map((app) => (\n <WorkspaceAppCard key={app.id} app={app} className=\"h-full\" />\n ))}\n </div>\n ) : pendingApps.length > 0 ? (\n <EmptyActiveAppsState />\n ) : (\n <EmptyAppsState />\n )}\n </section>\n\n {pendingApps.length > 0 ? (\n <Collapsible open={showPending} onOpenChange={setShowPending}>\n <section className=\"space-y-3 border-t pt-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconClockHour4\n size={16}\n className=\"shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.pendingApps\")}\n </h2>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.pendingAppsDescription\", {\n count: pendingApps.length,\n })}\n </p>\n </div>\n </div>\n <CollapsibleTrigger asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"gap-1.5\"\n >\n {showPending\n ? t(\"dispatch.pages.hidePendingApps\")\n : t(\"dispatch.pages.showPendingApps\")}\n <IconChevronDown\n size={14}\n className={cn(\n \"transition-transform\",\n showPending && \"rotate-180\",\n )}\n />\n </Button>\n </CollapsibleTrigger>\n </div>\n <CollapsibleContent>\n <div className=\"grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {pendingApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className=\"h-full\"\n />\n ))}\n </div>\n </CollapsibleContent>\n </section>\n </Collapsible>\n ) : null}\n\n {curatedTemplatesQuery.isError ? (\n <section className=\"space-y-3 border-t pt-4\">\n <ActionQueryError\n error={curatedTemplatesQuery.error}\n onRetry={() => void curatedTemplatesQuery.refetch()}\n />\n </section>\n ) : curatedTemplatesQuery.data ? (\n <section className=\"space-y-3 border-t pt-4\">\n <div className=\"flex min-w-0 items-start gap-2\">\n <IconStack2\n size={16}\n className=\"mt-0.5 shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.curatedTemplates\")}\n </h2>\n <p className=\"mt-0.5 text-xs text-muted-foreground\">\n {t(\"dispatch.pages.curatedTemplatesDescription\")}\n </p>\n </div>\n </div>\n <WorkspaceTemplatesSection\n templates={\n curatedTemplatesQuery.data as CuratedWorkspaceTemplatesResult\n }\n labels={templateLabels}\n onRemixSuccess={() => {\n void appsQuery.refetch();\n void curatedTemplatesQuery.refetch();\n }}\n />\n </section>\n ) : null}\n\n {connectedAppsQuery.isError ? (\n <section className=\"space-y-3 border-t pt-4\">\n <OtherAppsHeading count={0} />\n <ActionQueryError\n error={connectedAppsQuery.error}\n onRetry={() => void connectedAppsQuery.refetch()}\n />\n </section>\n ) : connectedAppsQuery.isLoading || otherApps.length > 0 ? (\n <section className=\"space-y-3 border-t pt-4\">\n <OtherAppsHeading count={otherApps.length} />\n {connectedAppsQuery.isLoading ? (\n <OtherAppsSkeletonGrid />\n ) : (\n <div className=\"grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {otherApps.map((app) => (\n <OtherAppCard key={app.id} app={app} />\n ))}\n </div>\n )}\n </section>\n ) : null}\n\n {archivedApps.length > 0 ? (\n <Collapsible open={showHidden} onOpenChange={setShowHidden}>\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3 border-t pt-4\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <IconEyeOff\n size={16}\n className=\"shrink-0 text-muted-foreground\"\n />\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.hiddenApps\")}\n </h2>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.hiddenAppCount\", {\n count: archivedApps.length,\n })}\n </p>\n </div>\n </div>\n <CollapsibleTrigger asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"gap-1.5\"\n >\n {showHidden\n ? t(\"dispatch.pages.hide\")\n : t(\"dispatch.pages.show\")}\n <IconChevronDown\n size={14}\n className={cn(\n \"transition-transform\",\n showHidden && \"rotate-180\",\n )}\n />\n </Button>\n </CollapsibleTrigger>\n </div>\n <CollapsibleContent>\n <div className=\"grid auto-rows-fr gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {archivedApps.map((app) => (\n <WorkspaceAppCard\n key={app.id}\n app={app}\n className=\"h-full\"\n />\n ))}\n </div>\n </CollapsibleContent>\n </section>\n </Collapsible>\n ) : null}\n </div>\n </DispatchShell>\n );\n}\n\nfunction OtherAppsHeading({ count }: { count: number }) {\n const t = useT();\n return (\n <div className=\"flex min-w-0 items-start gap-2\">\n <IconStack2 size={16} className=\"mt-0.5 shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0\">\n <h2 className=\"truncate text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.otherApps\")}\n </h2>\n <p className=\"mt-0.5 text-xs text-muted-foreground\">\n {t(\"dispatch.pages.otherAppsDescription\")}\n {count > 0\n ? ` · ${t(\"dispatch.pages.availableCount\", { count })}`\n : \"\"}\n </p>\n </div>\n </div>\n );\n}\n\nfunction OtherAppsSkeletonGrid() {\n return (\n <div className=\"grid gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <div key={index} className=\"rounded-lg bg-card p-4\">\n <div className=\"flex items-start gap-3\">\n <Skeleton className=\"size-8 rounded-md\" />\n <div className=\"flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction OtherAppCard({ app }: { app: ConnectedAppSummary }) {\n const t = useT();\n return (\n <a\n href={withBuilderUtmTrackingParams(app.url, {\n campaign: \"product\",\n content: \"dispatch_app\",\n })}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"group flex min-h-[116px] items-start gap-3 rounded-xl bg-card/40 p-4 transition-[background-color] hover:bg-accent/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-xs font-semibold text-muted-foreground\">\n {app.name.charAt(0).toUpperCase()}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex items-start justify-between gap-3\">\n <span className=\"truncate text-sm font-semibold text-foreground\">\n {app.name}\n </span>\n <IconArrowUpRight\n size={15}\n className=\"shrink-0 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5\"\n />\n </span>\n <span className=\"mt-2 line-clamp-2 block text-[13px] leading-5 text-muted-foreground\">\n {app.description || app.url}\n </span>\n <span className=\"mt-3 block text-xs font-medium text-foreground\">\n {t(\"dispatch.pages.openApp\")}\n </span>\n </span>\n </a>\n );\n}\n\nfunction AppsSkeletonGrid() {\n return (\n <div className=\"grid gap-3 md:grid-cols-2 xl:grid-cols-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <div key={index} className=\"rounded-lg bg-card p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-24\" />\n <div className=\"space-y-2 pt-1\">\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n <Skeleton className=\"h-7 w-7 rounded-md\" />\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction EmptyAppsState() {\n const t = useT();\n return (\n <div className=\"rounded-lg border border-dashed bg-card px-4 py-10 text-center\">\n <div className=\"mx-auto flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground\">\n <IconApps size={18} />\n </div>\n <h3 className=\"mt-3 text-sm font-semibold text-foreground\">\n {t(\"dispatch.pages.noWorkspaceApps\")}\n </h3>\n <p className=\"mx-auto mt-1 max-w-sm text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noWorkspaceAppsDescription\")}\n </p>\n <div className=\"mt-4\">\n <CreateAppPopover\n trigger={\n <Button size=\"sm\">\n <IconPlus size={15} className=\"mr-1.5\" />\n {t(\"dispatch.pages.createApp\")}\n </Button>\n }\n />\n </div>\n </div>\n );\n}\n\nfunction EmptyActiveAppsState() {\n const t = useT();\n return (\n <div className=\"rounded-lg border border-dashed bg-card px-4 py-10 text-center\">\n <p className=\"text-sm font-medium text-foreground\">\n {t(\"dispatch.pages.noActiveWorkspaceApps\")}\n </p>\n <p className=\"mx-auto mt-1 max-w-md text-xs text-muted-foreground\">\n {t(\"dispatch.pages.noActiveWorkspaceAppsDescription\")}\n </p>\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"thread-debug.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/thread-debug.tsx"],"names":[],"mappings":"AAgCA,wBAAgB,IAAI;;IAEnB;AAgYD,MAAM,CAAC,OAAO,UAAU,gBAAgB,oDA2RvC"}
1
+ {"version":3,"file":"thread-debug.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/thread-debug.tsx"],"names":[],"mappings":"AAgCA,wBAAgB,IAAI;;IAEnB;AAiYD,MAAM,CAAC,OAAO,UAAU,gBAAgB,oDA8SvC"}