@agent-native/dispatch 0.2.10 → 0.2.12

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 (55) hide show
  1. package/dist/actions/create-workspace-resource.js +4 -4
  2. package/dist/actions/create-workspace-resource.js.map +1 -1
  3. package/dist/actions/grant-workspace-resources-to-app.d.ts +3 -0
  4. package/dist/actions/grant-workspace-resources-to-app.d.ts.map +1 -0
  5. package/dist/actions/grant-workspace-resources-to-app.js +15 -0
  6. package/dist/actions/grant-workspace-resources-to-app.js.map +1 -0
  7. package/dist/actions/index.d.ts.map +1 -1
  8. package/dist/actions/index.js +4 -0
  9. package/dist/actions/index.js.map +1 -1
  10. package/dist/actions/list-workspace-resource-options.d.ts +3 -0
  11. package/dist/actions/list-workspace-resource-options.d.ts.map +1 -0
  12. package/dist/actions/list-workspace-resource-options.js +15 -0
  13. package/dist/actions/list-workspace-resource-options.js.map +1 -0
  14. package/dist/actions/list-workspace-resources.js +2 -2
  15. package/dist/actions/list-workspace-resources.js.map +1 -1
  16. package/dist/actions/start-workspace-app-creation.d.ts.map +1 -1
  17. package/dist/actions/start-workspace-app-creation.js +5 -0
  18. package/dist/actions/start-workspace-app-creation.js.map +1 -1
  19. package/dist/actions/view-screen.d.ts.map +1 -1
  20. package/dist/actions/view-screen.js +4 -0
  21. package/dist/actions/view-screen.js.map +1 -1
  22. package/dist/components/create-app-popover.d.ts +1 -1
  23. package/dist/components/create-app-popover.d.ts.map +1 -1
  24. package/dist/components/create-app-popover.js +63 -20
  25. package/dist/components/create-app-popover.js.map +1 -1
  26. package/dist/db/schema.js +2 -2
  27. package/dist/db/schema.js.map +1 -1
  28. package/dist/routes/pages/overview.d.ts.map +1 -1
  29. package/dist/routes/pages/overview.js +6 -6
  30. package/dist/routes/pages/overview.js.map +1 -1
  31. package/dist/routes/pages/workspace.d.ts.map +1 -1
  32. package/dist/routes/pages/workspace.js +17 -6
  33. package/dist/routes/pages/workspace.js.map +1 -1
  34. package/dist/server/lib/app-creation-store.d.ts +1 -0
  35. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  36. package/dist/server/lib/app-creation-store.js +33 -0
  37. package/dist/server/lib/app-creation-store.js.map +1 -1
  38. package/dist/server/lib/workspace-resources-store.d.ts +29 -1
  39. package/dist/server/lib/workspace-resources-store.d.ts.map +1 -1
  40. package/dist/server/lib/workspace-resources-store.js +46 -0
  41. package/dist/server/lib/workspace-resources-store.js.map +1 -1
  42. package/package.json +2 -3
  43. package/src/actions/create-workspace-resource.ts +4 -4
  44. package/src/actions/grant-workspace-resources-to-app.ts +16 -0
  45. package/src/actions/index.ts +4 -0
  46. package/src/actions/list-workspace-resource-options.ts +16 -0
  47. package/src/actions/list-workspace-resources.ts +2 -2
  48. package/src/actions/start-workspace-app-creation.ts +7 -0
  49. package/src/actions/view-screen.ts +4 -0
  50. package/src/components/create-app-popover.tsx +152 -21
  51. package/src/db/schema.ts +2 -2
  52. package/src/routes/pages/overview.tsx +21 -19
  53. package/src/routes/pages/workspace.tsx +31 -5
  54. package/src/server/lib/app-creation-store.ts +49 -0
  55. package/src/server/lib/workspace-resources-store.ts +75 -1
@@ -1 +1 @@
1
- {"version":3,"file":"create-app-popover.js","sourceRoot":"","sources":["../../src/components/create-app-popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACrE,OAAO,EACL,cAAc,EACd,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,OAAO,EACP,WAAW,EACX,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,yBAAyB,C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,EAAE,SAAS,EACf,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,EAChB,SAAS,EAAC,2EAA2E,6BAEzE,KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,GAAG,IAClD,CACL,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,KAAK,GAAG,QAAQ,GACM;IACtB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,CACL,MAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,aACxC,KAAC,cAAc,IAAC,OAAO,kBACpB,OAAO,IAAI,CACV,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,4MAA4M,YAEtN,gBAAM,SAAS,EAAC,gCAAgC,aAC9C,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,kBAEjB,GACA,CACV,GACc,EACjB,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,EAAE,EACd,SAAS,EAAC,4DAA4D,YAEtE,KAAC,aAAa,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI,GACjC,IACT,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport {\n PromptComposer,\n agentNativePath,\n appBasePath,\n isInBuilderFrame,\n sendToAgentChat,\n useDevMode,\n} from \"@agent-native/core/client\";\nimport { getWorkspaceAppIdValidationError } from \"@agent-native/core/shared\";\nimport {\n IconArrowLeft,\n IconArrowUpRight,\n IconCheck,\n IconChevronDown,\n IconKey,\n IconLoader2,\n IconPlus,\n} from \"@tabler/icons-react\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/components/ui/popover\";\nimport { Button } from \"@/components/ui/button\";\n\ninterface VaultSecretOption {\n id: string;\n name: string;\n credentialKey: string;\n provider?: string | null;\n description?: string | null;\n}\n\ninterface CreateAppPopoverProps {\n /**\n * Custom trigger element. Defaults to a dashed-border tile that matches the\n * apps grid empty state.\n */\n trigger?: ReactNode;\n /**\n * Override the popover alignment. Defaults to \"center\" with a 10px offset.\n */\n align?: \"start\" | \"center\" | \"end\";\n}\n\nfunction slugify(value: string): string {\n return value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .replace(/^[^a-z]+/, \"\")\n .slice(0, 48);\n}\n\nfunction titleFromPrompt(prompt: string): string {\n const cleaned = prompt\n .replace(/\\b(build|create|make|an?|the|app|tool|dashboard)\\b/gi, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n return slugify(cleaned || \"new-app\") || \"new-app\";\n}\n\nfunction buildAppCreationPrompt(input: {\n appId: string;\n prompt: string;\n selectedKeys: string[];\n}): string {\n const keyList = input.selectedKeys.join(\", \");\n const grantRequest = keyList\n ? `Requested Dispatch vault key grants for this app: ${keyList}`\n : `Requested Dispatch vault key grants for this app: none`;\n\n return [\n `Create a new agent-native app in this workspace.`,\n `This is a new workspace app request, not a feature request for the current app.`,\n ``,\n `Suggested app name: ${input.appId} (you may adjust the slug if it conflicts)`,\n `User prompt: ${input.prompt.trim()}`,\n grantRequest,\n ``,\n `Pick a starter template that fits the user's prompt — analytics, calendar, content, design, dispatch, forms, mail, slides, clips, or starter when none of the others fit.`,\n `Use the workspace app layout: create it under apps/${input.appId}, mount it at /${input.appId}, keep it on the shared workspace database/hosting model, and avoid table-name collisions by namespacing any new domain tables to the app.`,\n `Use relative workspace links like /${input.appId}. Do not hardcode localhost, 127.0.0.1, 8080, 8100, or any dev port; the active workspace gateway/browser origin owns the port.`,\n `Use the framework/template UI stack: shadcn/ui components and @tabler/icons-react. Do not add lucide-react or another icon library for standard UI.`,\n `If the user's prompt mentions sibling apps like Mail, Calendar, Dispatch, or other templates, treat them as existing workspace neighbors or integrations. Do not scaffold those sibling apps inside apps/${input.appId} unless the user explicitly asks to create them too.`,\n `Do not satisfy this by adding a route, page, component, or file inside apps/starter or another existing app unless the user explicitly asks to modify that existing app.`,\n keyList\n ? `After the app exists, grant the selected Dispatch vault keys to appId \"${input.appId}\" and sync them once the app server is available. Treat these as requested grants, not active grants before creation succeeds.`\n : `Do not grant any Dispatch vault keys unless the user asks later.`,\n ``,\n `App readiness requirements before handing off:`,\n `- Ensure apps/${input.appId}/package.json exists; Dispatch discovers workspace apps from apps/<app-id>/package.json, not a separate app registry.`,\n `- Update the app manifest/package/deploy metadata needed by the existing workspace deployment model.`,\n `- Ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath() so /${input.appId} hydrates correctly.`,\n `- Verify the app's agent card/A2A metadata is ready so Dispatch can discover and delegate to the app after deployment.`,\n `When it is ready, start or update the workspace dev server and navigate the user to /${input.appId}.`,\n ].join(\"\\n\");\n}\n\nasync function fetchJson(url: string, init?: RequestInit): Promise<any> {\n const res = await fetch(url, init);\n const data = await res.json().catch(() => null);\n if (!res.ok) {\n throw new Error(\n data?.error || data?.message || `Request failed ${res.status}`,\n );\n }\n return data;\n}\n\nfunction defaultDispatchBasePath(): string | null {\n const base = appBasePath();\n if (base === \"/dispatch\") return null;\n return null;\n}\n\nfunction actionUrl(basePath: string | null, action: string): string {\n const path = `/_agent-native/actions/${action}`;\n if (basePath === null) return agentNativePath(path);\n const normalized = basePath.replace(/\\/+$/, \"\");\n return `${normalized}${path}`;\n}\n\n/**\n * Inline two-step app-creation flow: prompt → optional key picker → submit.\n * Used both in the popover form and in the dedicated `/new-app` page so the\n * same UX shows up everywhere a teammate kicks off a new workspace app.\n */\nexport function CreateAppFlow({\n onClose,\n className = \"\",\n}: {\n onClose?: () => void;\n className?: string;\n}) {\n const [step, setStep] = useState<\"prompt\" | \"keys\">(\"prompt\");\n const [prompt, setPrompt] = useState(\"\");\n const [selectedSecretIds, setSelectedSecretIds] = useState<string[]>([]);\n const [secrets, setSecrets] = useState<VaultSecretOption[]>([]);\n const [secretsError, setSecretsError] = useState<string | null>(null);\n const [statusMessage, setStatusMessage] = useState<string | null>(null);\n const [branchUrl, setBranchUrl] = useState<string | null>(null);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const { isDevMode } = useDevMode();\n\n const basePath = useMemo(() => defaultDispatchBasePath(), []);\n\n // Fetch the vault keys eagerly so step 2 has them ready the moment the user\n // taps \"Choose keys\" — no spinner, no pause between steps.\n useEffect(() => {\n let cancelled = false;\n fetchJson(actionUrl(basePath, \"list-vault-secret-options\"))\n .then((data) => {\n if (cancelled) return;\n setSecrets(Array.isArray(data) ? data : []);\n setSecretsError(null);\n })\n .catch((err) => {\n if (cancelled) return;\n setSecrets([]);\n setSecretsError(err?.message || \"Could not load Dispatch keys\");\n });\n return () => {\n cancelled = true;\n };\n }, [basePath]);\n\n const selectedSecrets = useMemo(\n () => secrets.filter((s) => selectedSecretIds.includes(s.id)),\n [secrets, selectedSecretIds],\n );\n const selectedSecretLabel =\n selectedSecretIds.length === 0\n ? \"no keys\"\n : `${selectedSecretIds.length} key${selectedSecretIds.length === 1 ? \"\" : \"s\"}`;\n\n function toggleSecret(id: string) {\n setSelectedSecretIds((cur) =>\n cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id],\n );\n }\n\n async function submit(rawPrompt: string, selectedKeys: string[]) {\n const trimmed = rawPrompt.trim();\n if (!trimmed || isSubmitting) return;\n const appId = titleFromPrompt(trimmed);\n const validationError = getWorkspaceAppIdValidationError(appId);\n if (validationError) {\n setStatusMessage(validationError);\n return;\n }\n\n const message = buildAppCreationPrompt({\n appId,\n prompt: trimmed,\n selectedKeys,\n });\n setIsSubmitting(true);\n setStatusMessage(null);\n setBranchUrl(null);\n\n try {\n if (isInBuilderFrame()) {\n sendToAgentChat({ message, submit: true, type: \"code\" });\n setStatusMessage(\"Sent to Builder chat.\");\n onClose?.();\n } else if (isDevMode) {\n sendToAgentChat({ message, submit: true, type: \"code\", newTab: true });\n setStatusMessage(\"Sent to the local agent.\");\n onClose?.();\n } else {\n const result = await fetchJson(\n actionUrl(basePath, \"start-workspace-app-creation\"),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n prompt: trimmed,\n appId,\n secretIds: selectedKeys.length > 0 ? selectedSecretIds : [],\n }),\n },\n );\n if (result?.mode === \"builder\") {\n setBranchUrl(result?.url || null);\n setStatusMessage(\"Builder branch created.\");\n } else {\n setStatusMessage(\n result?.message ||\n \"Builder app creation is coming soon. Open this workspace in Builder to create an app from this prompt.\",\n );\n }\n }\n } catch (err: any) {\n setStatusMessage(err?.message || \"Could not start the new app flow.\");\n } finally {\n setIsSubmitting(false);\n }\n }\n\n const submitWithSelectedKeys = () =>\n submit(\n prompt,\n selectedSecrets.map((s) => s.credentialKey),\n );\n\n return (\n <div className={`flex flex-col gap-3 ${className}`}>\n {step === \"prompt\" ? (\n <>\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <p className=\"text-sm font-semibold text-foreground\">Create app</p>\n <button\n type=\"button\"\n onClick={() => setStep(\"keys\")}\n className=\"inline-flex cursor-pointer items-center gap-1 rounded-md border border-border bg-background/40 px-2 py-1 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconKey size={11} />\n {selectedSecretLabel}\n </button>\n </div>\n <PromptComposer\n autoFocus\n disabled={isSubmitting}\n placeholder=\"Describe the app your teammate should be able to use...\"\n draftScope=\"dispatch:create-app\"\n onSubmit={(text) => {\n setPrompt(text);\n submit(\n text,\n selectedSecrets.map((s) => s.credentialKey),\n );\n }}\n />\n </>\n ) : (\n <>\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <button\n type=\"button\"\n onClick={() => setStep(\"prompt\")}\n className=\"inline-flex cursor-pointer items-center gap-1 text-xs text-muted-foreground hover:text-foreground\"\n >\n <IconArrowLeft size={12} />\n Back\n </button>\n <span className=\"text-[11px] text-muted-foreground/70\">\n {selectedSecretLabel} selected\n </span>\n </div>\n <div className=\"max-h-[340px] space-y-2 overflow-y-auto rounded-md border border-border bg-card p-2\">\n {secretsError ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n {secretsError}\n </p>\n ) : secrets.length === 0 ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n No Dispatch vault keys found yet.\n </p>\n ) : (\n secrets.map((secret) => {\n const selected = selectedSecretIds.includes(secret.id);\n return (\n <div\n key={secret.id}\n className={`group rounded-md border text-sm ${\n selected\n ? \"border-primary/45 bg-primary/5\"\n : \"border-border hover:border-muted-foreground/40 hover:bg-accent/35\"\n }`}\n >\n <button\n type=\"button\"\n aria-pressed={selected}\n onClick={() => toggleSecret(secret.id)}\n className=\"flex w-full cursor-pointer items-start gap-3 rounded-md px-3 py-2 text-left\"\n >\n <span\n className={`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${\n selected\n ? \"border-primary/60 bg-primary/10 text-primary\"\n : \"border-muted-foreground/35 text-transparent\"\n }`}\n >\n {selected ? <IconCheck className=\"h-3 w-3\" /> : null}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">\n {secret.credentialKey}\n </span>\n <span className=\"block truncate text-xs text-muted-foreground/70\">\n {selected\n ? \"Will be requested for this app\"\n : \"Click to request\"}\n </span>\n </span>\n </button>\n {(secret.provider || secret.name) && (\n <details className=\"group/details border-t border-border/60 px-3 py-1.5 text-xs text-muted-foreground/75\">\n <summary className=\"flex cursor-pointer list-none items-center gap-1.5 text-[11px] hover:text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <IconChevronDown className=\"h-3 w-3 transition-transform group-open/details:rotate-180\" />\n Details\n </summary>\n <div className=\"mt-1.5 space-y-1 pb-0.5 pl-4\">\n <div className=\"truncate\">\n Provider: {secret.provider || \"Not specified\"}\n </div>\n <div className=\"truncate\">Name: {secret.name}</div>\n </div>\n </details>\n )}\n </div>\n );\n })\n )}\n </div>\n <div className=\"flex items-center justify-end gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={submitWithSelectedKeys}\n disabled={!prompt.trim() || isSubmitting}\n >\n {isSubmitting ? (\n <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <IconPlus className=\"h-3.5 w-3.5\" />\n )}\n Create app\n </Button>\n </div>\n {!prompt.trim() ? (\n <p className=\"px-1 text-[11px] text-muted-foreground/70\">\n Add a prompt on the previous step before creating the app.\n </p>\n ) : null}\n </>\n )}\n\n {statusMessage ? (\n <div className=\"rounded-md border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground\">\n {statusMessage}\n {branchUrl ? (\n <a\n href={branchUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"ml-2 inline-flex items-center gap-1 font-medium text-foreground underline\"\n >\n Open branch <IconArrowUpRight className=\"h-3 w-3\" />\n </a>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function CreateAppPopover({\n trigger,\n align = \"center\",\n}: CreateAppPopoverProps) {\n const [open, setOpen] = useState(false);\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n {trigger ?? (\n <button\n type=\"button\"\n className=\"flex min-h-32 cursor-pointer items-center justify-center rounded-lg border border-dashed bg-card p-4 text-sm font-medium text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n <span className=\"inline-flex items-center gap-2\">\n <IconPlus size={16} />\n Create app\n </span>\n </button>\n )}\n </PopoverTrigger>\n <PopoverContent\n align={align}\n sideOffset={10}\n className=\"w-[calc(100vw-2rem)] rounded-xl p-3 shadow-xl sm:w-[460px]\"\n >\n <CreateAppFlow onClose={() => setOpen(false)} />\n </PopoverContent>\n </Popover>\n );\n}\n"]}
1
+ {"version":3,"file":"create-app-popover.js","sourceRoot":"","sources":["../../src/components/create-app-popover.tsx"],"names":[],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KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,kBAEjB,GACA,CACV,GACc,EACjB,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,EAAE,EACd,SAAS,EAAC,4DAA4D,YAEtE,KAAC,aAAa,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI,GACjC,IACT,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport {\n PromptComposer,\n agentNativePath,\n appBasePath,\n isInBuilderFrame,\n sendToAgentChat,\n useDevMode,\n} from \"@agent-native/core/client\";\nimport { getWorkspaceAppIdValidationError } from \"@agent-native/core/shared\";\nimport {\n IconArrowLeft,\n IconArrowUpRight,\n IconBook,\n IconCheck,\n IconChevronDown,\n IconFileText,\n IconKey,\n IconLoader2,\n IconPlus,\n} from \"@tabler/icons-react\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/components/ui/popover\";\nimport { Button } from \"@/components/ui/button\";\n\ninterface VaultSecretOption {\n id: string;\n name: string;\n credentialKey: string;\n provider?: string | null;\n description?: string | null;\n}\n\ninterface WorkspaceResourceOption {\n id: string;\n kind: \"skill\" | \"instruction\" | \"agent\" | \"knowledge\";\n name: string;\n description?: string | null;\n path: string;\n scope: \"all\" | \"selected\";\n updatedAt?: number;\n}\n\ninterface CreateAppPopoverProps {\n /**\n * Custom trigger element. Defaults to a dashed-border tile that matches the\n * apps grid empty state.\n */\n trigger?: ReactNode;\n /**\n * Override the popover alignment. Defaults to \"center\" with a 10px offset.\n */\n align?: \"start\" | \"center\" | \"end\";\n}\n\nfunction slugify(value: string): string {\n return value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .replace(/^[^a-z]+/, \"\")\n .slice(0, 48);\n}\n\nfunction titleFromPrompt(prompt: string): string {\n const cleaned = prompt\n .replace(/\\b(build|create|make|an?|the|app|tool|dashboard)\\b/gi, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n return slugify(cleaned || \"new-app\") || \"new-app\";\n}\n\nfunction buildAppCreationPrompt(input: {\n appId: string;\n prompt: string;\n selectedKeys: string[];\n selectedResources: WorkspaceResourceOption[];\n}): string {\n const keyList = input.selectedKeys.join(\", \");\n const grantRequest = keyList\n ? `Requested Dispatch vault key grants for this app: ${keyList}`\n : `Requested Dispatch vault key grants for this app: none`;\n const resourceList = input.selectedResources.length\n ? input.selectedResources\n .map(\n (resource) =>\n `- ${resource.name} (${resource.kind}, ${resource.path})`,\n )\n .join(\"\\n\")\n : \"none\";\n\n return [\n `Create a new agent-native app in this workspace.`,\n `This is a new workspace app request, not a feature request for the current app.`,\n ``,\n `Suggested app name: ${input.appId} (you may adjust the slug if it conflicts)`,\n `User prompt: ${input.prompt.trim()}`,\n grantRequest,\n `Requested Dispatch workspace resources for this app:\\n${resourceList}`,\n ``,\n `Pick a starter template that fits the user's prompt — analytics, calendar, content, design, dispatch, forms, mail, slides, clips, or starter when none of the others fit.`,\n `Use the workspace app layout: create it under apps/${input.appId}, mount it at /${input.appId}, keep it on the shared workspace database/hosting model, and avoid table-name collisions by namespacing any new domain tables to the app.`,\n `Use relative workspace links like /${input.appId}. Do not hardcode localhost, 127.0.0.1, 8080, 8100, or any dev port; the active workspace gateway/browser origin owns the port.`,\n `Use the framework/template UI stack: shadcn/ui components and @tabler/icons-react. Do not add lucide-react or another icon library for standard UI.`,\n `If the user's prompt mentions sibling apps like Mail, Calendar, Dispatch, or other templates, treat them as existing workspace neighbors or integrations. Do not scaffold those sibling apps inside apps/${input.appId} unless the user explicitly asks to create them too.`,\n `Do not satisfy this by adding a route, page, component, or file inside apps/starter or another existing app unless the user explicitly asks to modify that existing app.`,\n keyList\n ? `After the app exists, grant the selected Dispatch vault keys to appId \"${input.appId}\" and sync them once the app server is available. Treat these as requested grants, not active grants before creation succeeds.`\n : `Do not grant any Dispatch vault keys unless the user asks later.`,\n input.selectedResources.length\n ? `After the app exists, grant the selected Dispatch workspace resources to appId \"${input.appId}\" and sync them once the app server is available. Add a short note to apps/${input.appId}/AGENTS.md telling the app agent to read relevant shared resources under context/ or the selected resource paths before doing GTM/domain work.`\n : `Do not grant any Dispatch workspace resources unless the user asks later.`,\n ``,\n `App readiness requirements before handing off:`,\n `- Ensure apps/${input.appId}/package.json exists; Dispatch discovers workspace apps from apps/<app-id>/package.json, not a separate app registry.`,\n `- Update the app manifest/package/deploy metadata needed by the existing workspace deployment model.`,\n `- Ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath() so /${input.appId} hydrates correctly.`,\n `- Verify the app's agent card/A2A metadata is ready so Dispatch can discover and delegate to the app after deployment.`,\n `When it is ready, start or update the workspace dev server and navigate the user to /${input.appId}.`,\n ].join(\"\\n\");\n}\n\nasync function fetchJson(url: string, init?: RequestInit): Promise<any> {\n const res = await fetch(url, init);\n const data = await res.json().catch(() => null);\n if (!res.ok) {\n throw new Error(\n data?.error || data?.message || `Request failed ${res.status}`,\n );\n }\n return data;\n}\n\nfunction defaultDispatchBasePath(): string | null {\n const base = appBasePath();\n if (base === \"/dispatch\") return null;\n return null;\n}\n\nfunction actionUrl(basePath: string | null, action: string): string {\n const path = `/_agent-native/actions/${action}`;\n if (basePath === null) return agentNativePath(path);\n const normalized = basePath.replace(/\\/+$/, \"\");\n return `${normalized}${path}`;\n}\n\n/**\n * Inline two-step app-creation flow: prompt → optional access picker → submit.\n * Used both in the popover form and in the dedicated `/new-app` page so the\n * same UX shows up everywhere a teammate kicks off a new workspace app.\n */\nexport function CreateAppFlow({\n onClose,\n className = \"\",\n}: {\n onClose?: () => void;\n className?: string;\n}) {\n const [step, setStep] = useState<\"prompt\" | \"access\">(\"prompt\");\n const [prompt, setPrompt] = useState(\"\");\n const [selectedSecretIds, setSelectedSecretIds] = useState<string[]>([]);\n const [selectedResourceIds, setSelectedResourceIds] = useState<string[]>([]);\n const [secrets, setSecrets] = useState<VaultSecretOption[]>([]);\n const [resources, setResources] = useState<WorkspaceResourceOption[]>([]);\n const [secretsError, setSecretsError] = useState<string | null>(null);\n const [resourcesError, setResourcesError] = useState<string | null>(null);\n const [statusMessage, setStatusMessage] = useState<string | null>(null);\n const [branchUrl, setBranchUrl] = useState<string | null>(null);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const { isDevMode } = useDevMode();\n\n const basePath = useMemo(() => defaultDispatchBasePath(), []);\n\n // Fetch access options eagerly so step 2 has them ready immediately.\n useEffect(() => {\n let cancelled = false;\n fetchJson(actionUrl(basePath, \"list-vault-secret-options\"))\n .then((data) => {\n if (cancelled) return;\n setSecrets(Array.isArray(data) ? data : []);\n setSecretsError(null);\n })\n .catch((err) => {\n if (cancelled) return;\n setSecrets([]);\n setSecretsError(err?.message || \"Could not load Dispatch keys\");\n });\n fetchJson(actionUrl(basePath, \"list-workspace-resource-options\"))\n .then((data) => {\n if (cancelled) return;\n setResources(Array.isArray(data) ? data : []);\n setResourcesError(null);\n })\n .catch((err) => {\n if (cancelled) return;\n setResources([]);\n setResourcesError(err?.message || \"Could not load Dispatch resources\");\n });\n return () => {\n cancelled = true;\n };\n }, [basePath]);\n\n const selectedSecrets = useMemo(\n () => secrets.filter((s) => selectedSecretIds.includes(s.id)),\n [secrets, selectedSecretIds],\n );\n const selectedResources = useMemo(\n () => resources.filter((r) => selectedResourceIds.includes(r.id)),\n [resources, selectedResourceIds],\n );\n const selectedSecretLabel =\n selectedSecretIds.length === 0\n ? \"no keys\"\n : `${selectedSecretIds.length} key${selectedSecretIds.length === 1 ? \"\" : \"s\"}`;\n const selectedResourceLabel =\n selectedResourceIds.length === 0\n ? \"no resources\"\n : `${selectedResourceIds.length} resource${selectedResourceIds.length === 1 ? \"\" : \"s\"}`;\n const selectedAccessLabel = [selectedSecretLabel, selectedResourceLabel].join(\n \" · \",\n );\n\n function toggleSecret(id: string) {\n setSelectedSecretIds((cur) =>\n cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id],\n );\n }\n\n function toggleResource(id: string) {\n setSelectedResourceIds((cur) =>\n cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id],\n );\n }\n\n async function submit(rawPrompt: string) {\n const trimmed = rawPrompt.trim();\n if (!trimmed || isSubmitting) return;\n const appId = titleFromPrompt(trimmed);\n const validationError = getWorkspaceAppIdValidationError(appId);\n if (validationError) {\n setStatusMessage(validationError);\n return;\n }\n\n const message = buildAppCreationPrompt({\n appId,\n prompt: trimmed,\n selectedKeys: selectedSecrets.map((s) => s.credentialKey),\n selectedResources,\n });\n setIsSubmitting(true);\n setStatusMessage(null);\n setBranchUrl(null);\n\n try {\n if (isInBuilderFrame()) {\n sendToAgentChat({ message, submit: true, type: \"code\" });\n setStatusMessage(\"Sent to Builder chat.\");\n onClose?.();\n } else if (isDevMode) {\n sendToAgentChat({ message, submit: true, type: \"code\", newTab: true });\n setStatusMessage(\"Sent to the local agent.\");\n onClose?.();\n } else {\n const result = await fetchJson(\n actionUrl(basePath, \"start-workspace-app-creation\"),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n prompt: trimmed,\n appId,\n secretIds: selectedSecretIds.length > 0 ? selectedSecretIds : [],\n resourceIds:\n selectedResourceIds.length > 0 ? selectedResourceIds : [],\n }),\n },\n );\n if (result?.mode === \"builder\") {\n setBranchUrl(result?.url || null);\n setStatusMessage(\"Builder branch created.\");\n } else {\n setStatusMessage(\n result?.message ||\n \"Builder app creation is coming soon. Open this workspace in Builder to create an app from this prompt.\",\n );\n }\n }\n } catch (err: any) {\n setStatusMessage(err?.message || \"Could not start the new app flow.\");\n } finally {\n setIsSubmitting(false);\n }\n }\n\n const submitWithSelectedAccess = () => submit(prompt);\n\n return (\n <div className={`flex flex-col gap-3 ${className}`}>\n {step === \"prompt\" ? (\n <>\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <p className=\"text-sm font-semibold text-foreground\">Create app</p>\n <button\n type=\"button\"\n onClick={() => setStep(\"access\")}\n className=\"inline-flex cursor-pointer items-center gap-1 rounded-md border border-border bg-background/40 px-2 py-1 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconKey size={11} />\n {selectedAccessLabel}\n </button>\n </div>\n <PromptComposer\n autoFocus\n disabled={isSubmitting}\n placeholder=\"Describe the app your teammate should be able to use...\"\n draftScope=\"dispatch:create-app\"\n onSubmit={(text) => {\n setPrompt(text);\n submit(text);\n }}\n />\n </>\n ) : (\n <>\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <button\n type=\"button\"\n onClick={() => setStep(\"prompt\")}\n className=\"inline-flex cursor-pointer items-center gap-1 text-xs text-muted-foreground hover:text-foreground\"\n >\n <IconArrowLeft size={12} />\n Back\n </button>\n <span className=\"text-[11px] text-muted-foreground/70\">\n {selectedAccessLabel}\n </span>\n </div>\n <div className=\"max-h-[180px] space-y-2 overflow-y-auto rounded-md border border-border bg-card p-2\">\n <div className=\"flex items-center gap-1.5 px-1 pb-1 text-[11px] font-medium text-muted-foreground\">\n <IconKey size={12} />\n Dispatch keys\n </div>\n {secretsError ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n {secretsError}\n </p>\n ) : secrets.length === 0 ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n No Dispatch vault keys found yet.\n </p>\n ) : (\n secrets.map((secret) => {\n const selected = selectedSecretIds.includes(secret.id);\n return (\n <div\n key={secret.id}\n className={`group rounded-md border text-sm ${\n selected\n ? \"border-primary/45 bg-primary/5\"\n : \"border-border hover:border-muted-foreground/40 hover:bg-accent/35\"\n }`}\n >\n <button\n type=\"button\"\n aria-pressed={selected}\n onClick={() => toggleSecret(secret.id)}\n className=\"flex w-full cursor-pointer items-start gap-3 rounded-md px-3 py-2 text-left\"\n >\n <span\n className={`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${\n selected\n ? \"border-primary/60 bg-primary/10 text-primary\"\n : \"border-muted-foreground/35 text-transparent\"\n }`}\n >\n {selected ? <IconCheck className=\"h-3 w-3\" /> : null}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">\n {secret.credentialKey}\n </span>\n <span className=\"block truncate text-xs text-muted-foreground/70\">\n {selected\n ? \"Will be requested for this app\"\n : \"Click to request\"}\n </span>\n </span>\n </button>\n {(secret.provider || secret.name) && (\n <details className=\"group/details border-t border-border/60 px-3 py-1.5 text-xs text-muted-foreground/75\">\n <summary className=\"flex cursor-pointer list-none items-center gap-1.5 text-[11px] hover:text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <IconChevronDown className=\"h-3 w-3 transition-transform group-open/details:rotate-180\" />\n Details\n </summary>\n <div className=\"mt-1.5 space-y-1 pb-0.5 pl-4\">\n <div className=\"truncate\">\n Provider: {secret.provider || \"Not specified\"}\n </div>\n <div className=\"truncate\">Name: {secret.name}</div>\n </div>\n </details>\n )}\n </div>\n );\n })\n )}\n </div>\n <div className=\"max-h-[180px] space-y-2 overflow-y-auto rounded-md border border-border bg-card p-2\">\n <div className=\"flex items-center gap-1.5 px-1 pb-1 text-[11px] font-medium text-muted-foreground\">\n <IconBook size={12} />\n Resource packs\n </div>\n {resourcesError ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n {resourcesError}\n </p>\n ) : resources.length === 0 ? (\n <p className=\"rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground\">\n No Dispatch resource packs found yet.\n </p>\n ) : (\n resources.map((resource) => {\n const selected = selectedResourceIds.includes(resource.id);\n return (\n <div\n key={resource.id}\n className={`group rounded-md border text-sm ${\n selected\n ? \"border-primary/45 bg-primary/5\"\n : \"border-border hover:border-muted-foreground/40 hover:bg-accent/35\"\n }`}\n >\n <button\n type=\"button\"\n aria-pressed={selected}\n onClick={() => toggleResource(resource.id)}\n className=\"flex w-full cursor-pointer items-start gap-3 rounded-md px-3 py-2 text-left\"\n >\n <span\n className={`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${\n selected\n ? \"border-primary/60 bg-primary/10 text-primary\"\n : \"border-muted-foreground/35 text-transparent\"\n }`}\n >\n {selected ? <IconCheck className=\"h-3 w-3\" /> : null}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex min-w-0 items-center gap-1.5\">\n <IconFileText className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground/70\" />\n <span className=\"block truncate font-medium\">\n {resource.name}\n </span>\n </span>\n <span className=\"block truncate text-xs text-muted-foreground/70\">\n {resource.kind} · {resource.path}\n </span>\n </span>\n </button>\n <details className=\"group/details border-t border-border/60 px-3 py-1.5 text-xs text-muted-foreground/75\">\n <summary className=\"flex cursor-pointer list-none items-center gap-1.5 text-[11px] hover:text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <IconChevronDown className=\"h-3 w-3 transition-transform group-open/details:rotate-180\" />\n Details\n </summary>\n <div className=\"mt-1.5 space-y-1 pb-0.5 pl-4\">\n <div className=\"truncate\">\n Scope:{\" \"}\n {resource.scope === \"all\"\n ? \"All apps\"\n : \"Selected apps\"}\n </div>\n {resource.description ? (\n <div className=\"line-clamp-2\">\n {resource.description}\n </div>\n ) : null}\n </div>\n </details>\n </div>\n );\n })\n )}\n </div>\n <div className=\"flex items-center justify-end gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={submitWithSelectedAccess}\n disabled={!prompt.trim() || isSubmitting}\n >\n {isSubmitting ? (\n <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <IconPlus className=\"h-3.5 w-3.5\" />\n )}\n Create app\n </Button>\n </div>\n {!prompt.trim() ? (\n <p className=\"px-1 text-[11px] text-muted-foreground/70\">\n Add a prompt on the previous step before creating the app.\n </p>\n ) : null}\n </>\n )}\n\n {statusMessage ? (\n <div className=\"rounded-md border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground\">\n {statusMessage}\n {branchUrl ? (\n <a\n href={branchUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"ml-2 inline-flex items-center gap-1 font-medium text-foreground underline\"\n >\n Open branch <IconArrowUpRight className=\"h-3 w-3\" />\n </a>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function CreateAppPopover({\n trigger,\n align = \"center\",\n}: CreateAppPopoverProps) {\n const [open, setOpen] = useState(false);\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n {trigger ?? (\n <button\n type=\"button\"\n className=\"flex min-h-32 cursor-pointer items-center justify-center rounded-lg border border-dashed bg-card p-4 text-sm font-medium text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n <span className=\"inline-flex items-center gap-2\">\n <IconPlus size={16} />\n Create app\n </span>\n </button>\n )}\n </PopoverTrigger>\n <PopoverContent\n align={align}\n sideOffset={10}\n className=\"w-[calc(100vw-2rem)] rounded-xl p-3 shadow-xl sm:w-[460px]\"\n >\n <CreateAppFlow onClose={() => setOpen(false)} />\n </PopoverContent>\n </Popover>\n );\n}\n"]}
package/dist/db/schema.js CHANGED
@@ -119,12 +119,12 @@ export const vaultAuditLog = table("vault_audit_log", {
119
119
  metadata: text("metadata"),
120
120
  createdAt: integer("created_at").notNull(),
121
121
  });
122
- // ─── Workspace Resources: shared skills, instructions, agents ──────
122
+ // ─── Workspace Resources: shared skills, instructions, agents, knowledge ──────
123
123
  export const workspaceResources = table("workspace_resources", {
124
124
  id: text("id").primaryKey(),
125
125
  ownerEmail: text("owner_email").notNull(),
126
126
  orgId: text("org_id"),
127
- kind: text("kind").notNull(), // "skill" | "instruction" | "agent"
127
+ kind: text("kind").notNull(), // "skill" | "instruction" | "agent" | "knowledge"
128
128
  name: text("name").notNull(),
129
129
  description: text("description"),
130
130
  path: text("path").notNull(), // resource path, e.g. "skills/designer.md"
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAA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AAI,CAAC,CAAC,UAAU,EAAE;IAC3B,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;IACrB,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;IAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,uBAAuB;IACzD,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CAC3C,CAAC,CAAC","sourcesContent":["import { table, text, integer } from \"@agent-native/core/db/schema\";\n\nexport const dispatchDestinations = table(\"dispatch_destinations\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n name: text(\"name\").notNull(),\n platform: text(\"platform\").notNull(),\n destination: text(\"destination\").notNull(),\n threadRef: text(\"thread_ref\"),\n notes: text(\"notes\"),\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchIdentityLinks = table(\"dispatch_identity_links\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n platform: text(\"platform\").notNull(),\n externalUserId: text(\"external_user_id\").notNull(),\n externalUserName: text(\"external_user_name\"),\n linkedBy: text(\"linked_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchLinkTokens = table(\"dispatch_link_tokens\", {\n id: text(\"id\").primaryKey(),\n token: text(\"token\").notNull(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n platform: text(\"platform\").notNull(),\n createdBy: text(\"created_by\").notNull(),\n expiresAt: integer(\"expires_at\").notNull(),\n claimedAt: integer(\"claimed_at\"),\n claimedByExternalUserId: text(\"claimed_by_external_user_id\"),\n claimedByExternalUserName: text(\"claimed_by_external_user_name\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchApprovalRequests = table(\"dispatch_approval_requests\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n changeType: text(\"change_type\").notNull(),\n targetType: text(\"target_type\").notNull(),\n targetId: text(\"target_id\"),\n status: text(\"status\").notNull(),\n summary: text(\"summary\").notNull(),\n payload: text(\"payload\").notNull(),\n beforeValue: text(\"before_value\"),\n afterValue: text(\"after_value\"),\n requestedBy: text(\"requested_by\").notNull(),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: integer(\"reviewed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchAuditEvents = table(\"dispatch_audit_events\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n actor: text(\"actor\").notNull(),\n action: text(\"action\").notNull(),\n targetType: text(\"target_type\").notNull(),\n targetId: text(\"target_id\"),\n summary: text(\"summary\").notNull(),\n metadata: text(\"metadata\"),\n createdAt: integer(\"created_at\").notNull(),\n});\n\n// ─── Vault: workspace-wide secret management ───────────────────────\n\nexport const vaultSecrets = table(\"vault_secrets\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n name: text(\"name\").notNull(),\n credentialKey: text(\"credential_key\").notNull(),\n value: text(\"value\").notNull(),\n provider: text(\"provider\"),\n description: text(\"description\"),\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultGrants = table(\"vault_grants\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n secretId: text(\"secret_id\").notNull(),\n appId: text(\"app_id\").notNull(),\n grantedBy: text(\"granted_by\").notNull(),\n status: text(\"status\").notNull(),\n syncedAt: integer(\"synced_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultRequests = table(\"vault_requests\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n credentialKey: text(\"credential_key\").notNull(),\n appId: text(\"app_id\").notNull(),\n reason: text(\"reason\"),\n requestedBy: text(\"requested_by\").notNull(),\n status: text(\"status\").notNull(),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: integer(\"reviewed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultAuditLog = table(\"vault_audit_log\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n secretId: text(\"secret_id\"),\n appId: text(\"app_id\"),\n action: text(\"action\").notNull(),\n actor: text(\"actor\").notNull(),\n summary: text(\"summary\").notNull(),\n metadata: text(\"metadata\"),\n createdAt: integer(\"created_at\").notNull(),\n});\n\n// ─── Workspace Resources: shared skills, instructions, agents ──────\n\nexport const workspaceResources = table(\"workspace_resources\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n kind: text(\"kind\").notNull(), // \"skill\" | \"instruction\" | \"agent\"\n name: text(\"name\").notNull(),\n description: text(\"description\"),\n path: text(\"path\").notNull(), // resource path, e.g. \"skills/designer.md\"\n content: text(\"content\").notNull(),\n scope: text(\"scope\").notNull(), // \"all\" (push to all apps) | \"selected\" (grant per-app)\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const workspaceResourceGrants = table(\"workspace_resource_grants\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n resourceId: text(\"resource_id\").notNull(),\n appId: text(\"app_id\").notNull(),\n status: text(\"status\").notNull(), // \"active\" | \"revoked\"\n syncedAt: integer(\"synced_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,uBAAuB,EAAE;IACjE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;IACpC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;IAC7B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CAC3C,CAAC,CAAC;AAEH,MAAM,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,EAAE,2CAA2C;IACzE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;IAClC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,wDAAwD;IACxF,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CAC3C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC,2BAA2B,EAAE;IACxE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;IACrB,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;IAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,uBAAuB;IACzD,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CAC3C,CAAC,CAAC","sourcesContent":["import { table, text, integer } from \"@agent-native/core/db/schema\";\n\nexport const dispatchDestinations = table(\"dispatch_destinations\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n name: text(\"name\").notNull(),\n platform: text(\"platform\").notNull(),\n destination: text(\"destination\").notNull(),\n threadRef: text(\"thread_ref\"),\n notes: text(\"notes\"),\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchIdentityLinks = table(\"dispatch_identity_links\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n platform: text(\"platform\").notNull(),\n externalUserId: text(\"external_user_id\").notNull(),\n externalUserName: text(\"external_user_name\"),\n linkedBy: text(\"linked_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchLinkTokens = table(\"dispatch_link_tokens\", {\n id: text(\"id\").primaryKey(),\n token: text(\"token\").notNull(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n platform: text(\"platform\").notNull(),\n createdBy: text(\"created_by\").notNull(),\n expiresAt: integer(\"expires_at\").notNull(),\n claimedAt: integer(\"claimed_at\"),\n claimedByExternalUserId: text(\"claimed_by_external_user_id\"),\n claimedByExternalUserName: text(\"claimed_by_external_user_name\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchApprovalRequests = table(\"dispatch_approval_requests\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n changeType: text(\"change_type\").notNull(),\n targetType: text(\"target_type\").notNull(),\n targetId: text(\"target_id\"),\n status: text(\"status\").notNull(),\n summary: text(\"summary\").notNull(),\n payload: text(\"payload\").notNull(),\n beforeValue: text(\"before_value\"),\n afterValue: text(\"after_value\"),\n requestedBy: text(\"requested_by\").notNull(),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: integer(\"reviewed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const dispatchAuditEvents = table(\"dispatch_audit_events\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n actor: text(\"actor\").notNull(),\n action: text(\"action\").notNull(),\n targetType: text(\"target_type\").notNull(),\n targetId: text(\"target_id\"),\n summary: text(\"summary\").notNull(),\n metadata: text(\"metadata\"),\n createdAt: integer(\"created_at\").notNull(),\n});\n\n// ─── Vault: workspace-wide secret management ───────────────────────\n\nexport const vaultSecrets = table(\"vault_secrets\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n name: text(\"name\").notNull(),\n credentialKey: text(\"credential_key\").notNull(),\n value: text(\"value\").notNull(),\n provider: text(\"provider\"),\n description: text(\"description\"),\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultGrants = table(\"vault_grants\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n secretId: text(\"secret_id\").notNull(),\n appId: text(\"app_id\").notNull(),\n grantedBy: text(\"granted_by\").notNull(),\n status: text(\"status\").notNull(),\n syncedAt: integer(\"synced_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultRequests = table(\"vault_requests\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n credentialKey: text(\"credential_key\").notNull(),\n appId: text(\"app_id\").notNull(),\n reason: text(\"reason\"),\n requestedBy: text(\"requested_by\").notNull(),\n status: text(\"status\").notNull(),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: integer(\"reviewed_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const vaultAuditLog = table(\"vault_audit_log\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n secretId: text(\"secret_id\"),\n appId: text(\"app_id\"),\n action: text(\"action\").notNull(),\n actor: text(\"actor\").notNull(),\n summary: text(\"summary\").notNull(),\n metadata: text(\"metadata\"),\n createdAt: integer(\"created_at\").notNull(),\n});\n\n// ─── Workspace Resources: shared skills, instructions, agents, knowledge ──────\n\nexport const workspaceResources = table(\"workspace_resources\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n kind: text(\"kind\").notNull(), // \"skill\" | \"instruction\" | \"agent\" | \"knowledge\"\n name: text(\"name\").notNull(),\n description: text(\"description\"),\n path: text(\"path\").notNull(), // resource path, e.g. \"skills/designer.md\"\n content: text(\"content\").notNull(),\n scope: text(\"scope\").notNull(), // \"all\" (push to all apps) | \"selected\" (grant per-app)\n createdBy: text(\"created_by\").notNull(),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n\nexport const workspaceResourceGrants = table(\"workspace_resource_grants\", {\n id: text(\"id\").primaryKey(),\n ownerEmail: text(\"owner_email\").notNull(),\n orgId: text(\"org_id\"),\n resourceId: text(\"resource_id\").notNull(),\n appId: text(\"app_id\").notNull(),\n status: text(\"status\").notNull(), // \"active\" | \"revoked\"\n syncedAt: integer(\"synced_at\"),\n createdAt: integer(\"created_at\").notNull(),\n updatedAt: integer(\"updated_at\").notNull(),\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":"AA0dA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,4CA0SpC"}
1
+ {"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":"AA4dA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,4CA0SpC"}
@@ -38,12 +38,12 @@ function HomeChatPanel() {
38
38
  const send = (message) => {
39
39
  submitOverviewPrompt(message, selectedModel);
40
40
  };
41
- return (_jsx("section", { className: "px-2 py-6 sm:py-10", children: _jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: [_jsx("h1", { className: "text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl", children: "What should we do next?" }), _jsx(PromptComposer, { placeholder: "Message agent\u2026", onSubmit: (text) => {
42
- const trimmed = text.trim();
43
- if (!trimmed)
44
- return;
45
- send(trimmed);
46
- } }), _jsx("div", { className: "flex flex-wrap justify-center gap-2", children: HOME_CHAT_SUGGESTIONS.map((suggestion) => (_jsx("button", { type: "button", onClick: () => send(suggestion), className: "cursor-pointer rounded-full border border-border bg-card px-3 py-1.5 text-xs text-muted-foreground transition hover:border-foreground/30 hover:text-foreground", children: suggestion }, suggestion))) })] }) }));
41
+ return (_jsx("section", { className: "px-2 py-6 sm:py-10", children: _jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: [_jsx("h1", { className: "text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl", children: "What should we do next?" }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PromptComposer, { placeholder: "Message agent\u2026", onSubmit: (text) => {
42
+ const trimmed = text.trim();
43
+ if (!trimmed)
44
+ return;
45
+ send(trimmed);
46
+ } }), _jsx("div", { className: "flex flex-wrap justify-center gap-2", children: HOME_CHAT_SUGGESTIONS.map((suggestion) => (_jsx("button", { type: "button", onClick: () => send(suggestion), className: "cursor-pointer rounded-full border border-border bg-card px-3 py-1.5 text-xs text-muted-foreground transition hover:border-foreground/30 hover:text-foreground", children: suggestion }, suggestion))) })] })] }) }));
47
47
  }
48
48
  function AppCardSkeleton() {
49
49
  return (_jsx("div", { className: "rounded-lg border bg-card p-4", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0 flex-1 space-y-3", children: [_jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-3 w-24" }), _jsxs("div", { className: "space-y-2 pt-1", children: [_jsx(Skeleton, { className: "h-3 w-full" }), _jsx(Skeleton, { className: "h-3 w-2/3" })] })] }), _jsx(Skeleton, { className: "h-5 w-5 rounded-md" })] }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"overview.js","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EACL,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,cAAc,EACd,OAAO,EACP,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAyB3D,MAAM,qBAAqB,GAAmB;IAC5C,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,CAAC;IACn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AC,EAAE,CAUT,CACP,CAAC,EACD,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CACvD,cAAK,SAAS,EAAC,yEAAyE,iCAElF,CACP,IACG,IACE,EAEV,mBAAS,SAAS,EAAC,gCAAgC,aACjD,aAAI,SAAS,EAAC,uCAAuC,8BAEhD,EACL,eAAK,SAAS,EAAC,wCAAwC,aACrD,cAAK,SAAS,EAAC,2CAA2C,+BAEpD,EACN,cAAK,SAAS,EAAC,6CAA6C,YACzD,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,GAC/C,EACN,YAAG,SAAS,EAAC,oCAAoC,YAC9C,IAAI,EAAE,QAAQ,EAAE,OAAO;4DACtB,CAAC,CAAC,8CAA8C;4DAChD,CAAC,CAAC,sDAAsD,GACxD,IACA,EACN,eAAK,SAAS,EAAC,gBAAgB,aAC5B,CAAC,IAAI,EAAE,eAAe,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAC/C,eAEE,SAAS,EAAC,6BAA6B,aAEvC,cAAK,SAAS,EAAC,qCAAqC,YACjD,QAAQ,CAAC,OAAO,GACb,EACN,eAAK,SAAS,EAAC,oCAAoC,aAChD,QAAQ,CAAC,MAAM,2BAAkB,QAAQ,CAAC,WAAW,IAClD,KARD,QAAQ,CAAC,EAAE,CASZ,CACP,CAAC,EACD,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAC7C,cAAK,SAAS,EAAC,yEAAyE,sCAElF,CACP,IACG,IACE,IACN,IACF,IACE,IACI,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport {\n PromptComposer,\n useActionQuery,\n useChatModels,\n agentNativePath,\n} from \"@agent-native/core/client\";\nimport {\n IconActivity,\n IconAlertTriangle,\n IconApps,\n IconArrowUpRight,\n IconCheck,\n IconClockHour4,\n IconInfoCircle,\n IconKey,\n IconListCheck,\n IconRocket,\n IconPlugConnected,\n IconShieldCheck,\n type IconProps,\n} from \"@tabler/icons-react\";\nimport { AppKeysPopover } from \"@/components/app-keys-popover\";\nimport { CreateAppPopover } from \"@/components/create-app-popover\";\nimport { DispatchShell } from \"@/components/dispatch-shell\";\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { submitOverviewPrompt } from \"@/lib/overview-chat\";\n\ninterface IntegrationStatus {\n platform: string;\n label: string;\n enabled: boolean;\n configured: boolean;\n}\n\ninterface TaskQueueRecentFailure {\n id: string;\n platform: string;\n error: string;\n attempts: number;\n}\n\ninterface TaskQueueStats {\n pending: number;\n processing: number;\n completed_last_hour: number;\n failed_last_hour: number;\n oldest_pending_age_seconds: number;\n recent_failures: TaskQueueRecentFailure[];\n}\n\nconst ZERO_TASK_QUEUE_STATS: TaskQueueStats = {\n pending: 0,\n processing: 0,\n completed_last_hour: 0,\n failed_last_hour: 0,\n oldest_pending_age_seconds: 0,\n recent_failures: [],\n};\n\ninterface WorkspaceAppSummary {\n id: string;\n name: string;\n description?: string;\n path: string;\n url?: string | null;\n isDispatch: boolean;\n status?: \"ready\" | \"pending\";\n statusLabel?: string;\n builderUrl?: string | null;\n branchName?: string | null;\n}\n\nfunction workspaceAppHref(app: WorkspaceAppSummary): string | null {\n if (app.status === \"pending\") return app.builderUrl || null;\n return app.path || app.url || null;\n}\n\nfunction isPendingBuilderHref(app: WorkspaceAppSummary): boolean {\n return app.status === \"pending\" && !!app.builderUrl;\n}\n\nconst HOME_CHAT_SUGGESTIONS = [\n \"Create a lightweight customer onboarding app\",\n \"Ask Slides to draft a board update from our latest metrics\",\n \"Schedule a Monday morning analytics digest\",\n];\n\nfunction HomeChatPanel() {\n const { selectedModel } = useChatModels();\n\n const send = (message: string) => {\n submitOverviewPrompt(message, selectedModel);\n };\n\n return (\n <section className=\"px-2 py-6 sm:py-10\">\n <div className=\"mx-auto w-full max-w-2xl space-y-8\">\n <h1 className=\"text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n What should we do next?\n </h1>\n <PromptComposer\n placeholder=\"Message agent…\"\n onSubmit={(text) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n send(trimmed);\n }}\n />\n <div className=\"flex flex-wrap justify-center gap-2\">\n {HOME_CHAT_SUGGESTIONS.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-full border border-border bg-card px-3 py-1.5 text-xs text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppCardSkeleton() {\n return (\n <div className=\"rounded-lg border bg-card p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-24\" />\n <div className=\"space-y-2 pt-1\">\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n <Skeleton className=\"h-5 w-5 rounded-md\" />\n </div>\n </div>\n );\n}\n\nfunction WorkspaceAppsSection({\n apps,\n isLoading,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n}) {\n const filteredApps = apps.filter((app) => !app.isDispatch);\n const visibleApps = filteredApps.slice(0, 6);\n const showSkeletons = isLoading && visibleApps.length === 0;\n\n return (\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2\">\n <IconApps size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Workspace apps\n </h2>\n </div>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link to=\"/apps\">\n View all\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </Link>\n </Button>\n </div>\n\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {showSkeletons\n ? Array.from({ length: 6 }).map((_, index) => (\n <AppCardSkeleton key={index} />\n ))\n : visibleApps.map((app) => {\n const href = workspaceAppHref(app);\n // Pending Builder branches live on a different host (Builder\n // editor URL); open those in a new tab. Ready workspace apps\n // navigate the current window so this works inside the\n // Builder webview, where new tabs would try to open in the\n // host browser and break the embedded session.\n const openInNewTab = isPendingBuilderHref(app);\n return (\n <a\n key={app.id}\n href={href ?? undefined}\n target={openInNewTab ? \"_blank\" : undefined}\n rel={openInNewTab ? \"noreferrer\" : undefined}\n aria-disabled={!href}\n className=\"group min-h-32 rounded-lg border bg-card p-4 transition hover:border-foreground/30 aria-disabled:pointer-events-none aria-disabled:opacity-60\"\n >\n <div className=\"flex h-full items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <h3 className=\"truncate text-sm font-semibold text-foreground\">\n {app.name}\n </h3>\n {app.status === \"pending\" ? (\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 Building\n </Badge>\n ) : null}\n </div>\n <p className=\"mt-1 truncate font-mono text-xs text-muted-foreground\">\n {app.path}\n </p>\n {app.status === \"pending\" && app.branchName ? (\n <p className=\"mt-1 truncate text-xs text-muted-foreground\">\n Branch: {app.branchName}\n </p>\n ) : null}\n {app.description ? (\n <p className=\"mt-2 line-clamp-2 text-xs leading-relaxed text-muted-foreground\">\n {app.description}\n </p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {app.status === \"ready\" ? (\n <AppKeysPopover appId={app.id} appName={app.name} />\n ) : null}\n <IconArrowUpRight\n size={16}\n className=\"text-muted-foreground transition group-hover:text-foreground\"\n />\n </div>\n </div>\n </a>\n );\n })}\n\n {!showSkeletons ? <CreateAppPopover /> : null}\n </div>\n </section>\n );\n}\n\nfunction formatAgeSeconds(seconds: number): string {\n if (!seconds || seconds < 0) return \"0s\";\n if (seconds < 60) return `${seconds}s`;\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;\n return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;\n}\n\nfunction TaskQueueMetric({\n label,\n value,\n tone,\n icon: Icon,\n}: {\n label: string;\n value: string | number;\n tone?: \"default\" | \"warning\" | \"danger\";\n icon?: React.ComponentType<IconProps>;\n}) {\n const toneClass =\n tone === \"danger\"\n ? \"text-red-600 dark:text-red-400\"\n : tone === \"warning\"\n ? \"text-amber-600 dark:text-amber-400\"\n : \"text-foreground\";\n return (\n <div className=\"rounded-xl border bg-card px-4 py-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n {Icon ? <Icon size={14} /> : null}\n <span>{label}</span>\n </div>\n <div className={`mt-1 text-2xl font-semibold ${toneClass}`}>{value}</div>\n </div>\n );\n}\n\nfunction TaskQueueSection({ stats }: { stats: TaskQueueStats }) {\n const showAlert = stats.pending > 5 || stats.failed_last_hour > 0;\n return (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconListCheck size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">Task queue</h2>\n </div>\n {showAlert && (\n <Alert variant={stats.failed_last_hour > 0 ? \"destructive\" : \"default\"}>\n <IconAlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>\n {stats.failed_last_hour > 0\n ? `${stats.failed_last_hour} integration task${stats.failed_last_hour === 1 ? \"\" : \"s\"} failed in the last hour`\n : `${stats.pending} pending integration task${stats.pending === 1 ? \"\" : \"s\"} queued`}\n </AlertTitle>\n <AlertDescription>\n {stats.failed_last_hour > 0\n ? \"Recent failures are listed below. Check platform credentials and retry.\"\n : \"Tasks are waiting to be processed. The queue may be backed up.\"}\n </AlertDescription>\n </Alert>\n )}\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-5\">\n <TaskQueueMetric\n label=\"Pending\"\n value={stats.pending}\n tone={stats.pending > 5 ? \"warning\" : \"default\"}\n />\n <TaskQueueMetric label=\"Processing\" value={stats.processing} />\n <TaskQueueMetric\n label=\"Completed (1h)\"\n value={stats.completed_last_hour}\n />\n <TaskQueueMetric\n label=\"Failed (1h)\"\n value={stats.failed_last_hour}\n tone={stats.failed_last_hour > 0 ? \"danger\" : \"default\"}\n />\n <TaskQueueMetric\n label=\"Oldest pending\"\n value={formatAgeSeconds(stats.oldest_pending_age_seconds)}\n icon={IconClockHour4}\n tone={stats.oldest_pending_age_seconds > 300 ? \"warning\" : \"default\"}\n />\n </div>\n {stats.recent_failures.length > 0 && (\n <div className=\"rounded-2xl border bg-card p-4\">\n <div className=\"text-sm font-semibold text-foreground\">\n Recent failures\n </div>\n <div className=\"mt-3 space-y-2\">\n {stats.recent_failures.map((failure) => (\n <div\n key={failure.id}\n className=\"rounded-xl border bg-muted/30 px-3 py-2\"\n >\n <div className=\"flex items-center justify-between gap-2 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">\n {failure.platform}\n </span>\n <span>\n {failure.attempts} attempt\n {failure.attempts === 1 ? \"\" : \"s\"}\n </span>\n </div>\n <div className=\"mt-1 truncate text-sm text-foreground\">\n {failure.error || \"(no error message)\"}\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n </section>\n );\n}\n\nfunction HelpTooltip({ content }: { content: string }) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className=\"text-muted-foreground/60 hover:text-foreground cursor-pointer\"\n >\n <IconInfoCircle className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-64 text-xs leading-relaxed\">\n {content}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction StatCard({\n label,\n help,\n value,\n icon: Icon,\n cta,\n}: {\n label: string;\n help: string;\n value: number;\n icon: React.ComponentType<IconProps>;\n cta?: React.ReactNode;\n}) {\n return (\n <div className=\"rounded-2xl border bg-card p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-1.5 text-sm font-medium text-foreground\">\n <span>{label}</span>\n <HelpTooltip content={help} />\n </div>\n <div className=\"mt-3 text-3xl font-semibold text-foreground\">\n {value}\n </div>\n </div>\n <div className=\"rounded-xl border bg-muted/30 p-3 text-muted-foreground\">\n <Icon size={18} />\n </div>\n </div>\n {cta ? <div className=\"mt-4\">{cta}</div> : null}\n </div>\n );\n}\n\ninterface ChecklistStep {\n number: number;\n title: string;\n description: string;\n complete: boolean;\n /** If set, renders a link button to this path */\n to?: string;\n actionLabel?: string;\n /** If true, this step is always shown as informational (never \"complete\") */\n informational?: boolean;\n}\n\nfunction StepRow({ step }: { step: ChecklistStep }) {\n const done = step.complete && !step.informational;\n\n return (\n <div\n className={`flex items-start gap-4 rounded-xl border px-5 py-4 ${done ? \"border-border/50 bg-muted/20\" : \"bg-card\"}`}\n >\n {/* Status marker */}\n <div className=\"flex-none pt-0.5\">\n {done ? (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400\">\n <IconCheck size={16} strokeWidth={2.5} />\n </div>\n ) : (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full border border-muted-foreground/30 text-muted-foreground\">\n <IconListCheck size={15} />\n </div>\n )}\n </div>\n\n {/* Text */}\n <div className={`min-w-0 flex-1 ${done ? \"opacity-50\" : \"\"}`}>\n <div\n className={`text-sm font-semibold ${done ? \"line-through decoration-muted-foreground/40\" : \"text-foreground\"}`}\n >\n {step.title}\n </div>\n <p className=\"mt-0.5 text-sm leading-relaxed text-muted-foreground\">\n {step.description}\n </p>\n </div>\n\n {/* Action */}\n {step.to && !done && (\n <div className=\"flex-none pt-0.5\">\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to={step.to}>{step.actionLabel || \"Set up\"}</Link>\n </Button>\n </div>\n )}\n </div>\n );\n}\n\nexport function meta() {\n return [{ title: \"Overview — Dispatch\" }];\n}\n\nexport default function OverviewRoute() {\n const { data, isLoading } = useActionQuery(\"list-dispatch-overview\", {});\n const { data: connectedAgents } = useActionQuery(\"list-connected-agents\", {});\n const { data: workspaceApps = [], isLoading: appsLoading } = useActionQuery(\n \"list-workspace-apps\",\n { includeAgentCards: false },\n {\n refetchInterval: 2_000,\n },\n );\n const [integrationStatuses, setIntegrationStatuses] = useState<\n IntegrationStatus[]\n >([]);\n const [taskQueueStats, setTaskQueueStats] = useState<TaskQueueStats>(\n ZERO_TASK_QUEUE_STATS,\n );\n\n useEffect(() => {\n let active = true;\n fetch(agentNativePath(\"/_agent-native/integrations/status\"))\n .then((res) => (res.ok ? res.json() : []))\n .then((rows) => {\n if (active) {\n setIntegrationStatuses(Array.isArray(rows) ? rows : []);\n }\n })\n .catch(() => {\n if (active) setIntegrationStatuses([]);\n });\n return () => {\n active = false;\n };\n }, []);\n\n useEffect(() => {\n let active = true;\n const load = () => {\n fetch(agentNativePath(\"/_agent-native/integrations/task-queue/status\"))\n .then((res) => (res.ok ? res.json() : null))\n .then((stats) => {\n if (!active || !stats || typeof stats !== \"object\") return;\n setTaskQueueStats({\n pending: Number(stats.pending ?? 0),\n processing: Number(stats.processing ?? 0),\n completed_last_hour: Number(stats.completed_last_hour ?? 0),\n failed_last_hour: Number(stats.failed_last_hour ?? 0),\n oldest_pending_age_seconds: Number(\n stats.oldest_pending_age_seconds ?? 0,\n ),\n recent_failures: Array.isArray(stats.recent_failures)\n ? stats.recent_failures\n : [],\n });\n })\n .catch(() => {\n // Endpoint may not exist on older deploys — ignore.\n });\n };\n load();\n const id = window.setInterval(load, 15000);\n return () => {\n active = false;\n window.clearInterval(id);\n };\n }, []);\n\n const counts = data?.counts || {\n destinations: 0,\n pendingApprovals: 0,\n linkedIdentities: 0,\n activeTokens: 0,\n };\n\n const messagingStatuses = useMemo(\n () =>\n integrationStatuses.filter(\n (row) => row.platform === \"slack\" || row.platform === \"telegram\",\n ),\n [integrationStatuses],\n );\n\n const connectedMessagingCount = messagingStatuses.filter(\n (row) => row.enabled || row.configured,\n ).length;\n const connectedAgentCount = connectedAgents?.length || 0;\n const vaultSecretCount = data?.vault?.secretCount || 0;\n const typedWorkspaceApps = workspaceApps as WorkspaceAppSummary[];\n\n const messagingDone = connectedMessagingCount > 0;\n const agentsDone = connectedAgentCount > 0;\n const vaultDone = vaultSecretCount > 0;\n\n const steps: ChecklistStep[] = [\n {\n number: 1,\n title: \"Connect Slack\",\n description:\n \"Add @agent-native to your Slack workspace so your team can ask questions, create decks, pull analytics, and more — right from Slack.\",\n complete: messagingDone,\n to: \"/messaging\",\n actionLabel: \"Connect\",\n },\n {\n number: 2,\n title: \"Review connected agents\",\n description:\n \"Dispatch delegates work to specialized apps. The built-in suite (Slides, Analytics, Content, Video, and more) is available automatically.\",\n complete: agentsDone,\n to: \"/agents\",\n actionLabel: \"Review\",\n },\n {\n number: 3,\n title: \"Set up your vault\",\n description:\n \"Store API keys centrally and sync them to apps that need them.\",\n complete: vaultDone,\n to: \"/vault\",\n actionLabel: \"Open vault\",\n },\n {\n number: 4,\n title: \"Try it out\",\n description: \"Mention @agent-native in any Slack channel to get started.\",\n complete: false,\n informational: true,\n },\n ];\n\n const hasIncompleteSteps = steps.some((s) => !s.complete && !s.informational);\n\n return (\n <DispatchShell\n title=\"Overview\"\n description=\"Create apps, manage shared keys, and route work across your workspace.\"\n >\n <HomeChatPanel />\n\n <WorkspaceAppsSection apps={typedWorkspaceApps} isLoading={appsLoading} />\n\n {hasIncompleteSteps && (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconRocket size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Getting started\n </h2>\n </div>\n <div className=\"space-y-2\">\n {steps.map((step) => (\n <StepRow key={step.number} step={step} />\n ))}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconActivity size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">At a glance</h2>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 xl:grid-cols-4\">\n <StatCard\n label=\"Vault secrets\"\n help=\"Credentials stored in the workspace vault. Grant them to apps from the Vault page.\"\n value={data?.vault?.secretCount || 0}\n icon={IconKey}\n cta={\n (data?.vault?.secretCount || 0) === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/vault\">Set up vault</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Active grants\"\n help=\"Secrets currently granted to apps. Sync them to push credentials.\"\n value={data?.vault?.activeGrantCount || 0}\n icon={IconShieldCheck}\n />\n <StatCard\n label=\"Destinations\"\n help=\"Saved outbound targets used for proactive sends and scheduled jobs.\"\n value={counts.destinations}\n icon={IconArrowUpRight}\n cta={\n counts.destinations === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/destinations\">Set up destinations</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Agents\"\n help=\"Agents available to dispatch for delegation over A2A. This includes the built-in app suite plus any additional agents you add.\"\n value={connectedAgentCount}\n icon={IconPlugConnected}\n cta={\n connectedAgentCount === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/agents\">Open agents</Link>\n </Button>\n ) : undefined\n }\n />\n </div>\n </section>\n\n <details className=\"rounded-xl border\">\n <summary className=\"flex cursor-pointer list-none items-center justify-between gap-3 px-5 py-4 text-sm font-semibold text-foreground hover:bg-muted/30 [&::-webkit-details-marker]:hidden\">\n <span>Operations detail</span>\n <span className=\"text-xs font-normal text-muted-foreground\">\n Queue, audit, and approvals\n </span>\n </summary>\n <div className=\"space-y-5 border-t px-5 py-5\">\n <TaskQueueSection stats={taskQueueStats} />\n\n <div className=\"grid gap-4 xl:grid-cols-3\">\n <section className=\"rounded-2xl border bg-card p-5 xl:col-span-2\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Recent activity\n </h2>\n {isLoading && (\n <span className=\"text-xs text-muted-foreground\">\n Loading...\n </span>\n )}\n </div>\n <div className=\"mt-4 space-y-3\">\n {(data?.recentAudit || []).map((event) => (\n <div\n key={event.id}\n className=\"rounded-xl border bg-muted/30 px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {event.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {event.actor} ·{\" \"}\n {new Date(event.createdAt).toLocaleString()}\n </div>\n </div>\n ))}\n {!isLoading && (data?.recentAudit?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No activity yet.\n </div>\n )}\n </div>\n </section>\n\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Approval mode\n </h2>\n <div className=\"mt-4 rounded-xl border bg-muted/30 p-4\">\n <div className=\"text-sm font-medium text-muted-foreground\">\n Current policy\n </div>\n <div className=\"mt-2 text-2xl font-semibold text-foreground\">\n {data?.settings?.enabled ? \"Reviewed\" : \"Immediate\"}\n </div>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {data?.settings?.enabled\n ? \"Changes wait for approval before they apply.\"\n : \"Changes apply immediately and are recorded in audit.\"}\n </p>\n </div>\n <div className=\"mt-4 space-y-2\">\n {(data?.recentApprovals || []).map((approval) => (\n <div\n key={approval.id}\n className=\"rounded-xl border px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {approval.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {approval.status} · requested by {approval.requestedBy}\n </div>\n </div>\n ))}\n {(data?.recentApprovals?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No approval requests.\n </div>\n )}\n </div>\n </section>\n </div>\n </div>\n </details>\n </DispatchShell>\n );\n}\n"]}
1
+ {"version":3,"file":"overview.js","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EACL,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,cAAc,EACd,OAAO,EACP,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAyB3D,MAAM,qBAAqB,GAAmB;IAC5C,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IAC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State } from \"react\";\nimport { Link } from \"react-router\";\nimport {\n PromptComposer,\n useActionQuery,\n useChatModels,\n agentNativePath,\n} from \"@agent-native/core/client\";\nimport {\n IconActivity,\n IconAlertTriangle,\n IconApps,\n IconArrowUpRight,\n IconCheck,\n IconClockHour4,\n IconInfoCircle,\n IconKey,\n IconListCheck,\n IconRocket,\n IconPlugConnected,\n IconShieldCheck,\n type IconProps,\n} from \"@tabler/icons-react\";\nimport { AppKeysPopover } from \"@/components/app-keys-popover\";\nimport { CreateAppPopover } from \"@/components/create-app-popover\";\nimport { DispatchShell } from \"@/components/dispatch-shell\";\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { submitOverviewPrompt } from \"@/lib/overview-chat\";\n\ninterface IntegrationStatus {\n platform: string;\n label: string;\n enabled: boolean;\n configured: boolean;\n}\n\ninterface TaskQueueRecentFailure {\n id: string;\n platform: string;\n error: string;\n attempts: number;\n}\n\ninterface TaskQueueStats {\n pending: number;\n processing: number;\n completed_last_hour: number;\n failed_last_hour: number;\n oldest_pending_age_seconds: number;\n recent_failures: TaskQueueRecentFailure[];\n}\n\nconst ZERO_TASK_QUEUE_STATS: TaskQueueStats = {\n pending: 0,\n processing: 0,\n completed_last_hour: 0,\n failed_last_hour: 0,\n oldest_pending_age_seconds: 0,\n recent_failures: [],\n};\n\ninterface WorkspaceAppSummary {\n id: string;\n name: string;\n description?: string;\n path: string;\n url?: string | null;\n isDispatch: boolean;\n status?: \"ready\" | \"pending\";\n statusLabel?: string;\n builderUrl?: string | null;\n branchName?: string | null;\n}\n\nfunction workspaceAppHref(app: WorkspaceAppSummary): string | null {\n if (app.status === \"pending\") return app.builderUrl || null;\n return app.path || app.url || null;\n}\n\nfunction isPendingBuilderHref(app: WorkspaceAppSummary): boolean {\n return app.status === \"pending\" && !!app.builderUrl;\n}\n\nconst HOME_CHAT_SUGGESTIONS = [\n \"Create a lightweight customer onboarding app\",\n \"Ask Slides to draft a board update from our latest metrics\",\n \"Schedule a Monday morning analytics digest\",\n];\n\nfunction HomeChatPanel() {\n const { selectedModel } = useChatModels();\n\n const send = (message: string) => {\n submitOverviewPrompt(message, selectedModel);\n };\n\n return (\n <section className=\"px-2 py-6 sm:py-10\">\n <div className=\"mx-auto w-full max-w-2xl space-y-8\">\n <h1 className=\"text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n What should we do next?\n </h1>\n <div className=\"flex flex-col gap-4\">\n <PromptComposer\n placeholder=\"Message agent…\"\n onSubmit={(text) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n send(trimmed);\n }}\n />\n <div className=\"flex flex-wrap justify-center gap-2\">\n {HOME_CHAT_SUGGESTIONS.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-full border border-border bg-card px-3 py-1.5 text-xs text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppCardSkeleton() {\n return (\n <div className=\"rounded-lg border bg-card p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-24\" />\n <div className=\"space-y-2 pt-1\">\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n <Skeleton className=\"h-5 w-5 rounded-md\" />\n </div>\n </div>\n );\n}\n\nfunction WorkspaceAppsSection({\n apps,\n isLoading,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n}) {\n const filteredApps = apps.filter((app) => !app.isDispatch);\n const visibleApps = filteredApps.slice(0, 6);\n const showSkeletons = isLoading && visibleApps.length === 0;\n\n return (\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2\">\n <IconApps size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Workspace apps\n </h2>\n </div>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link to=\"/apps\">\n View all\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </Link>\n </Button>\n </div>\n\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {showSkeletons\n ? Array.from({ length: 6 }).map((_, index) => (\n <AppCardSkeleton key={index} />\n ))\n : visibleApps.map((app) => {\n const href = workspaceAppHref(app);\n // Pending Builder branches live on a different host (Builder\n // editor URL); open those in a new tab. Ready workspace apps\n // navigate the current window so this works inside the\n // Builder webview, where new tabs would try to open in the\n // host browser and break the embedded session.\n const openInNewTab = isPendingBuilderHref(app);\n return (\n <a\n key={app.id}\n href={href ?? undefined}\n target={openInNewTab ? \"_blank\" : undefined}\n rel={openInNewTab ? \"noreferrer\" : undefined}\n aria-disabled={!href}\n className=\"group min-h-32 rounded-lg border bg-card p-4 transition hover:border-foreground/30 aria-disabled:pointer-events-none aria-disabled:opacity-60\"\n >\n <div className=\"flex h-full items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <h3 className=\"truncate text-sm font-semibold text-foreground\">\n {app.name}\n </h3>\n {app.status === \"pending\" ? (\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 Building\n </Badge>\n ) : null}\n </div>\n <p className=\"mt-1 truncate font-mono text-xs text-muted-foreground\">\n {app.path}\n </p>\n {app.status === \"pending\" && app.branchName ? (\n <p className=\"mt-1 truncate text-xs text-muted-foreground\">\n Branch: {app.branchName}\n </p>\n ) : null}\n {app.description ? (\n <p className=\"mt-2 line-clamp-2 text-xs leading-relaxed text-muted-foreground\">\n {app.description}\n </p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {app.status === \"ready\" ? (\n <AppKeysPopover appId={app.id} appName={app.name} />\n ) : null}\n <IconArrowUpRight\n size={16}\n className=\"text-muted-foreground transition group-hover:text-foreground\"\n />\n </div>\n </div>\n </a>\n );\n })}\n\n {!showSkeletons ? <CreateAppPopover /> : null}\n </div>\n </section>\n );\n}\n\nfunction formatAgeSeconds(seconds: number): string {\n if (!seconds || seconds < 0) return \"0s\";\n if (seconds < 60) return `${seconds}s`;\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;\n return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;\n}\n\nfunction TaskQueueMetric({\n label,\n value,\n tone,\n icon: Icon,\n}: {\n label: string;\n value: string | number;\n tone?: \"default\" | \"warning\" | \"danger\";\n icon?: React.ComponentType<IconProps>;\n}) {\n const toneClass =\n tone === \"danger\"\n ? \"text-red-600 dark:text-red-400\"\n : tone === \"warning\"\n ? \"text-amber-600 dark:text-amber-400\"\n : \"text-foreground\";\n return (\n <div className=\"rounded-xl border bg-card px-4 py-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n {Icon ? <Icon size={14} /> : null}\n <span>{label}</span>\n </div>\n <div className={`mt-1 text-2xl font-semibold ${toneClass}`}>{value}</div>\n </div>\n );\n}\n\nfunction TaskQueueSection({ stats }: { stats: TaskQueueStats }) {\n const showAlert = stats.pending > 5 || stats.failed_last_hour > 0;\n return (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconListCheck size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">Task queue</h2>\n </div>\n {showAlert && (\n <Alert variant={stats.failed_last_hour > 0 ? \"destructive\" : \"default\"}>\n <IconAlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>\n {stats.failed_last_hour > 0\n ? `${stats.failed_last_hour} integration task${stats.failed_last_hour === 1 ? \"\" : \"s\"} failed in the last hour`\n : `${stats.pending} pending integration task${stats.pending === 1 ? \"\" : \"s\"} queued`}\n </AlertTitle>\n <AlertDescription>\n {stats.failed_last_hour > 0\n ? \"Recent failures are listed below. Check platform credentials and retry.\"\n : \"Tasks are waiting to be processed. The queue may be backed up.\"}\n </AlertDescription>\n </Alert>\n )}\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-5\">\n <TaskQueueMetric\n label=\"Pending\"\n value={stats.pending}\n tone={stats.pending > 5 ? \"warning\" : \"default\"}\n />\n <TaskQueueMetric label=\"Processing\" value={stats.processing} />\n <TaskQueueMetric\n label=\"Completed (1h)\"\n value={stats.completed_last_hour}\n />\n <TaskQueueMetric\n label=\"Failed (1h)\"\n value={stats.failed_last_hour}\n tone={stats.failed_last_hour > 0 ? \"danger\" : \"default\"}\n />\n <TaskQueueMetric\n label=\"Oldest pending\"\n value={formatAgeSeconds(stats.oldest_pending_age_seconds)}\n icon={IconClockHour4}\n tone={stats.oldest_pending_age_seconds > 300 ? \"warning\" : \"default\"}\n />\n </div>\n {stats.recent_failures.length > 0 && (\n <div className=\"rounded-2xl border bg-card p-4\">\n <div className=\"text-sm font-semibold text-foreground\">\n Recent failures\n </div>\n <div className=\"mt-3 space-y-2\">\n {stats.recent_failures.map((failure) => (\n <div\n key={failure.id}\n className=\"rounded-xl border bg-muted/30 px-3 py-2\"\n >\n <div className=\"flex items-center justify-between gap-2 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">\n {failure.platform}\n </span>\n <span>\n {failure.attempts} attempt\n {failure.attempts === 1 ? \"\" : \"s\"}\n </span>\n </div>\n <div className=\"mt-1 truncate text-sm text-foreground\">\n {failure.error || \"(no error message)\"}\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n </section>\n );\n}\n\nfunction HelpTooltip({ content }: { content: string }) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className=\"text-muted-foreground/60 hover:text-foreground cursor-pointer\"\n >\n <IconInfoCircle className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-64 text-xs leading-relaxed\">\n {content}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction StatCard({\n label,\n help,\n value,\n icon: Icon,\n cta,\n}: {\n label: string;\n help: string;\n value: number;\n icon: React.ComponentType<IconProps>;\n cta?: React.ReactNode;\n}) {\n return (\n <div className=\"rounded-2xl border bg-card p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-1.5 text-sm font-medium text-foreground\">\n <span>{label}</span>\n <HelpTooltip content={help} />\n </div>\n <div className=\"mt-3 text-3xl font-semibold text-foreground\">\n {value}\n </div>\n </div>\n <div className=\"rounded-xl border bg-muted/30 p-3 text-muted-foreground\">\n <Icon size={18} />\n </div>\n </div>\n {cta ? <div className=\"mt-4\">{cta}</div> : null}\n </div>\n );\n}\n\ninterface ChecklistStep {\n number: number;\n title: string;\n description: string;\n complete: boolean;\n /** If set, renders a link button to this path */\n to?: string;\n actionLabel?: string;\n /** If true, this step is always shown as informational (never \"complete\") */\n informational?: boolean;\n}\n\nfunction StepRow({ step }: { step: ChecklistStep }) {\n const done = step.complete && !step.informational;\n\n return (\n <div\n className={`flex items-start gap-4 rounded-xl border px-5 py-4 ${done ? \"border-border/50 bg-muted/20\" : \"bg-card\"}`}\n >\n {/* Status marker */}\n <div className=\"flex-none pt-0.5\">\n {done ? (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400\">\n <IconCheck size={16} strokeWidth={2.5} />\n </div>\n ) : (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full border border-muted-foreground/30 text-muted-foreground\">\n <IconListCheck size={15} />\n </div>\n )}\n </div>\n\n {/* Text */}\n <div className={`min-w-0 flex-1 ${done ? \"opacity-50\" : \"\"}`}>\n <div\n className={`text-sm font-semibold ${done ? \"line-through decoration-muted-foreground/40\" : \"text-foreground\"}`}\n >\n {step.title}\n </div>\n <p className=\"mt-0.5 text-sm leading-relaxed text-muted-foreground\">\n {step.description}\n </p>\n </div>\n\n {/* Action */}\n {step.to && !done && (\n <div className=\"flex-none pt-0.5\">\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to={step.to}>{step.actionLabel || \"Set up\"}</Link>\n </Button>\n </div>\n )}\n </div>\n );\n}\n\nexport function meta() {\n return [{ title: \"Overview — Dispatch\" }];\n}\n\nexport default function OverviewRoute() {\n const { data, isLoading } = useActionQuery(\"list-dispatch-overview\", {});\n const { data: connectedAgents } = useActionQuery(\"list-connected-agents\", {});\n const { data: workspaceApps = [], isLoading: appsLoading } = useActionQuery(\n \"list-workspace-apps\",\n { includeAgentCards: false },\n {\n refetchInterval: 2_000,\n },\n );\n const [integrationStatuses, setIntegrationStatuses] = useState<\n IntegrationStatus[]\n >([]);\n const [taskQueueStats, setTaskQueueStats] = useState<TaskQueueStats>(\n ZERO_TASK_QUEUE_STATS,\n );\n\n useEffect(() => {\n let active = true;\n fetch(agentNativePath(\"/_agent-native/integrations/status\"))\n .then((res) => (res.ok ? res.json() : []))\n .then((rows) => {\n if (active) {\n setIntegrationStatuses(Array.isArray(rows) ? rows : []);\n }\n })\n .catch(() => {\n if (active) setIntegrationStatuses([]);\n });\n return () => {\n active = false;\n };\n }, []);\n\n useEffect(() => {\n let active = true;\n const load = () => {\n fetch(agentNativePath(\"/_agent-native/integrations/task-queue/status\"))\n .then((res) => (res.ok ? res.json() : null))\n .then((stats) => {\n if (!active || !stats || typeof stats !== \"object\") return;\n setTaskQueueStats({\n pending: Number(stats.pending ?? 0),\n processing: Number(stats.processing ?? 0),\n completed_last_hour: Number(stats.completed_last_hour ?? 0),\n failed_last_hour: Number(stats.failed_last_hour ?? 0),\n oldest_pending_age_seconds: Number(\n stats.oldest_pending_age_seconds ?? 0,\n ),\n recent_failures: Array.isArray(stats.recent_failures)\n ? stats.recent_failures\n : [],\n });\n })\n .catch(() => {\n // Endpoint may not exist on older deploys — ignore.\n });\n };\n load();\n const id = window.setInterval(load, 15000);\n return () => {\n active = false;\n window.clearInterval(id);\n };\n }, []);\n\n const counts = data?.counts || {\n destinations: 0,\n pendingApprovals: 0,\n linkedIdentities: 0,\n activeTokens: 0,\n };\n\n const messagingStatuses = useMemo(\n () =>\n integrationStatuses.filter(\n (row) => row.platform === \"slack\" || row.platform === \"telegram\",\n ),\n [integrationStatuses],\n );\n\n const connectedMessagingCount = messagingStatuses.filter(\n (row) => row.enabled || row.configured,\n ).length;\n const connectedAgentCount = connectedAgents?.length || 0;\n const vaultSecretCount = data?.vault?.secretCount || 0;\n const typedWorkspaceApps = workspaceApps as WorkspaceAppSummary[];\n\n const messagingDone = connectedMessagingCount > 0;\n const agentsDone = connectedAgentCount > 0;\n const vaultDone = vaultSecretCount > 0;\n\n const steps: ChecklistStep[] = [\n {\n number: 1,\n title: \"Connect Slack\",\n description:\n \"Add @agent-native to your Slack workspace so your team can ask questions, create decks, pull analytics, and more — right from Slack.\",\n complete: messagingDone,\n to: \"/messaging\",\n actionLabel: \"Connect\",\n },\n {\n number: 2,\n title: \"Review connected agents\",\n description:\n \"Dispatch delegates work to specialized apps. The built-in suite (Slides, Analytics, Content, Video, and more) is available automatically.\",\n complete: agentsDone,\n to: \"/agents\",\n actionLabel: \"Review\",\n },\n {\n number: 3,\n title: \"Set up your vault\",\n description:\n \"Store API keys centrally and sync them to apps that need them.\",\n complete: vaultDone,\n to: \"/vault\",\n actionLabel: \"Open vault\",\n },\n {\n number: 4,\n title: \"Try it out\",\n description: \"Mention @agent-native in any Slack channel to get started.\",\n complete: false,\n informational: true,\n },\n ];\n\n const hasIncompleteSteps = steps.some((s) => !s.complete && !s.informational);\n\n return (\n <DispatchShell\n title=\"Overview\"\n description=\"Create apps, manage shared keys, and route work across your workspace.\"\n >\n <HomeChatPanel />\n\n <WorkspaceAppsSection apps={typedWorkspaceApps} isLoading={appsLoading} />\n\n {hasIncompleteSteps && (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconRocket size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Getting started\n </h2>\n </div>\n <div className=\"space-y-2\">\n {steps.map((step) => (\n <StepRow key={step.number} step={step} />\n ))}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconActivity size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">At a glance</h2>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 xl:grid-cols-4\">\n <StatCard\n label=\"Vault secrets\"\n help=\"Credentials stored in the workspace vault. Grant them to apps from the Vault page.\"\n value={data?.vault?.secretCount || 0}\n icon={IconKey}\n cta={\n (data?.vault?.secretCount || 0) === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/vault\">Set up vault</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Active grants\"\n help=\"Secrets currently granted to apps. Sync them to push credentials.\"\n value={data?.vault?.activeGrantCount || 0}\n icon={IconShieldCheck}\n />\n <StatCard\n label=\"Destinations\"\n help=\"Saved outbound targets used for proactive sends and scheduled jobs.\"\n value={counts.destinations}\n icon={IconArrowUpRight}\n cta={\n counts.destinations === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/destinations\">Set up destinations</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Agents\"\n help=\"Agents available to dispatch for delegation over A2A. This includes the built-in app suite plus any additional agents you add.\"\n value={connectedAgentCount}\n icon={IconPlugConnected}\n cta={\n connectedAgentCount === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/agents\">Open agents</Link>\n </Button>\n ) : undefined\n }\n />\n </div>\n </section>\n\n <details className=\"rounded-xl border\">\n <summary className=\"flex cursor-pointer list-none items-center justify-between gap-3 px-5 py-4 text-sm font-semibold text-foreground hover:bg-muted/30 [&::-webkit-details-marker]:hidden\">\n <span>Operations detail</span>\n <span className=\"text-xs font-normal text-muted-foreground\">\n Queue, audit, and approvals\n </span>\n </summary>\n <div className=\"space-y-5 border-t px-5 py-5\">\n <TaskQueueSection stats={taskQueueStats} />\n\n <div className=\"grid gap-4 xl:grid-cols-3\">\n <section className=\"rounded-2xl border bg-card p-5 xl:col-span-2\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Recent activity\n </h2>\n {isLoading && (\n <span className=\"text-xs text-muted-foreground\">\n Loading...\n </span>\n )}\n </div>\n <div className=\"mt-4 space-y-3\">\n {(data?.recentAudit || []).map((event) => (\n <div\n key={event.id}\n className=\"rounded-xl border bg-muted/30 px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {event.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {event.actor} ·{\" \"}\n {new Date(event.createdAt).toLocaleString()}\n </div>\n </div>\n ))}\n {!isLoading && (data?.recentAudit?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No activity yet.\n </div>\n )}\n </div>\n </section>\n\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Approval mode\n </h2>\n <div className=\"mt-4 rounded-xl border bg-muted/30 p-4\">\n <div className=\"text-sm font-medium text-muted-foreground\">\n Current policy\n </div>\n <div className=\"mt-2 text-2xl font-semibold text-foreground\">\n {data?.settings?.enabled ? \"Reviewed\" : \"Immediate\"}\n </div>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {data?.settings?.enabled\n ? \"Changes wait for approval before they apply.\"\n : \"Changes apply immediately and are recorded in audit.\"}\n </p>\n </div>\n <div className=\"mt-4 space-y-2\">\n {(data?.recentApprovals || []).map((approval) => (\n <div\n key={approval.id}\n className=\"rounded-xl border px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {approval.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {approval.status} · requested by {approval.requestedBy}\n </div>\n </div>\n ))}\n {(data?.recentApprovals?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No approval requests.\n </div>\n )}\n </div>\n </section>\n </div>\n </div>\n </details>\n </DispatchShell>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/workspace.tsx"],"names":[],"mappings":"AAiDA,wBAAgB,IAAI;;IAEnB;AAqaD,MAAM,CAAC,OAAO,UAAU,cAAc,4CA6HrC"}
1
+ {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/workspace.tsx"],"names":[],"mappings":"AAkDA,wBAAgB,IAAI;;IAEnB;AAibD,MAAM,CAAC,OAAO,UAAU,cAAc,4CA0IrC"}