@agent-native/dispatch 0.17.6 → 0.19.0

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 (117) hide show
  1. package/dist/actions/grant-vault-secrets-to-app.js +1 -1
  2. package/dist/actions/grant-vault-secrets-to-app.js.map +1 -1
  3. package/dist/actions/list-vault-audit.js +1 -1
  4. package/dist/actions/list-vault-audit.js.map +1 -1
  5. package/dist/actions/list-vault-secret-options.js +2 -9
  6. package/dist/actions/list-vault-secret-options.js.map +1 -1
  7. package/dist/actions/list-vault-secrets.js +1 -1
  8. package/dist/actions/list-vault-secrets.js.map +1 -1
  9. package/dist/actions/set-app-creation-settings.js +1 -1
  10. package/dist/actions/set-app-creation-settings.js.map +1 -1
  11. package/dist/actions/set-vault-access-settings.js +1 -1
  12. package/dist/actions/set-vault-access-settings.js.map +1 -1
  13. package/dist/actions/sync-vault-to-app.js +1 -1
  14. package/dist/actions/sync-vault-to-app.js.map +1 -1
  15. package/dist/actions/view-screen.js +4 -3
  16. package/dist/actions/view-screen.js.map +1 -1
  17. package/dist/components/admin-navigation.d.ts +15 -0
  18. package/dist/components/admin-navigation.d.ts.map +1 -0
  19. package/dist/components/admin-navigation.js +174 -0
  20. package/dist/components/admin-navigation.js.map +1 -0
  21. package/dist/components/automation-run-history-dialog.js +1 -1
  22. package/dist/components/automation-run-history-dialog.js.map +1 -1
  23. package/dist/components/index.d.ts +1 -0
  24. package/dist/components/index.d.ts.map +1 -1
  25. package/dist/components/index.js +1 -0
  26. package/dist/components/index.js.map +1 -1
  27. package/dist/components/layout/Header.d.ts.map +1 -1
  28. package/dist/components/layout/Header.js +9 -0
  29. package/dist/components/layout/Header.js.map +1 -1
  30. package/dist/components/layout/Layout.d.ts +4 -1
  31. package/dist/components/layout/Layout.d.ts.map +1 -1
  32. package/dist/components/layout/Layout.js +14 -117
  33. package/dist/components/layout/Layout.js.map +1 -1
  34. package/dist/components/layout/workspace-apps-rail.d.ts +5 -0
  35. package/dist/components/layout/workspace-apps-rail.d.ts.map +1 -0
  36. package/dist/components/layout/workspace-apps-rail.js +76 -0
  37. package/dist/components/layout/workspace-apps-rail.js.map +1 -0
  38. package/dist/hooks/use-navigation-state.js +38 -15
  39. package/dist/hooks/use-navigation-state.js.map +1 -1
  40. package/dist/lib/automation-display.js +1 -1
  41. package/dist/lib/automation-display.js.map +1 -1
  42. package/dist/routes/index.d.ts.map +1 -1
  43. package/dist/routes/index.js +22 -0
  44. package/dist/routes/index.js.map +1 -1
  45. package/dist/routes/pages/admin._index.d.ts +5 -0
  46. package/dist/routes/pages/admin._index.d.ts.map +1 -0
  47. package/dist/routes/pages/admin._index.js +19 -0
  48. package/dist/routes/pages/admin._index.js.map +1 -0
  49. package/dist/routes/pages/admin.d.ts +5 -0
  50. package/dist/routes/pages/admin.d.ts.map +1 -0
  51. package/dist/routes/pages/admin.js +10 -0
  52. package/dist/routes/pages/admin.js.map +1 -0
  53. package/dist/routes/pages/approval.js +2 -2
  54. package/dist/routes/pages/approval.js.map +1 -1
  55. package/dist/routes/pages/apps.$appId.d.ts.map +1 -1
  56. package/dist/routes/pages/apps.$appId.js +3 -2
  57. package/dist/routes/pages/apps.$appId.js.map +1 -1
  58. package/dist/routes/pages/integrations.d.ts.map +1 -1
  59. package/dist/routes/pages/integrations.js +2 -1
  60. package/dist/routes/pages/integrations.js.map +1 -1
  61. package/dist/routes/pages/operations.js +3 -3
  62. package/dist/routes/pages/operations.js.map +1 -1
  63. package/dist/routes/pages/settings.d.ts.map +1 -1
  64. package/dist/routes/pages/settings.js +1 -1
  65. package/dist/routes/pages/settings.js.map +1 -1
  66. package/dist/routes/pages/transactional-email.$appId.$id.d.ts.map +1 -1
  67. package/dist/routes/pages/transactional-email.$appId.$id.js +5 -2
  68. package/dist/routes/pages/transactional-email.$appId.$id.js.map +1 -1
  69. package/dist/routes/pages/transactional-email.d.ts.map +1 -1
  70. package/dist/routes/pages/transactional-email.js +6 -2
  71. package/dist/routes/pages/transactional-email.js.map +1 -1
  72. package/dist/routes/pages/vault.d.ts.map +1 -1
  73. package/dist/routes/pages/vault.js +20 -16
  74. package/dist/routes/pages/vault.js.map +1 -1
  75. package/dist/server/lib/app-creation-store.js +2 -2
  76. package/dist/server/lib/app-creation-store.js.map +1 -1
  77. package/dist/server/lib/vault-store.d.ts +15 -0
  78. package/dist/server/lib/vault-store.d.ts.map +1 -1
  79. package/dist/server/lib/vault-store.js +110 -17
  80. package/dist/server/lib/vault-store.js.map +1 -1
  81. package/package.json +3 -3
  82. package/src/actions/grant-vault-secrets-to-app.ts +1 -1
  83. package/src/actions/list-vault-audit.ts +1 -1
  84. package/src/actions/list-vault-secret-options.ts +2 -9
  85. package/src/actions/list-vault-secrets.ts +1 -1
  86. package/src/actions/set-app-creation-settings.ts +1 -1
  87. package/src/actions/set-vault-access-settings.ts +1 -1
  88. package/src/actions/sync-vault-to-app.ts +1 -1
  89. package/src/actions/view-screen.spec.ts +1 -0
  90. package/src/actions/view-screen.ts +5 -3
  91. package/src/components/admin-navigation.tsx +278 -0
  92. package/src/components/automation-run-history-dialog.tsx +1 -1
  93. package/src/components/index.ts +1 -0
  94. package/src/components/layout/Header.tsx +8 -0
  95. package/src/components/layout/Layout.spec.tsx +85 -6
  96. package/src/components/layout/Layout.tsx +62 -206
  97. package/src/components/layout/workspace-apps-rail.tsx +154 -0
  98. package/src/hooks/use-navigation-state.spec.ts +11 -0
  99. package/src/hooks/use-navigation-state.ts +36 -15
  100. package/src/lib/automation-display.spec.ts +1 -1
  101. package/src/lib/automation-display.ts +1 -1
  102. package/src/routes/index.spec.ts +8 -0
  103. package/src/routes/index.ts +25 -0
  104. package/src/routes/pages/admin._index.tsx +39 -0
  105. package/src/routes/pages/admin.tsx +15 -0
  106. package/src/routes/pages/approval.tsx +2 -2
  107. package/src/routes/pages/apps.$appId.tsx +7 -2
  108. package/src/routes/pages/integrations.tsx +3 -2
  109. package/src/routes/pages/operations.tsx +3 -3
  110. package/src/routes/pages/settings.tsx +7 -3
  111. package/src/routes/pages/transactional-email.$appId.$id.tsx +9 -2
  112. package/src/routes/pages/transactional-email.tsx +6 -2
  113. package/src/routes/pages/vault.tsx +152 -89
  114. package/src/server/lib/app-creation-store.ts +2 -2
  115. package/src/server/lib/approval-fencing.spec.ts +69 -0
  116. package/src/server/lib/vault-store.spec.ts +59 -0
  117. package/src/server/lib/vault-store.ts +123 -17
@@ -1 +1 @@
1
- {"version":3,"file":"approval.js","sourceRoot":"","sources":["../../../src/routes/pages/approval.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,cAAc,EACd,YAAY,GACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,SAAS,EACT,KAAK,EACL,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,MAAM,EAAsB;IACjD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,CACL,MAAC,KAAK,IACJ,OAAO,EAAC,SAAS,EACj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,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,aAElD,KAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,GAAI,mBAEvB,GACL,CACP,IACG,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { appPath } from \"@agent-native/core/client/api-path\";\nimport {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport {\n isInAgentEmbed,\n postNavigate,\n} from \"@agent-native/core/client/navigation\";\nimport {\n IconCheck,\n IconX,\n IconArrowUpRight,\n IconShieldCheck,\n IconClock,\n IconAlertCircle,\n} from \"@tabler/icons-react\";\nimport { useSearchParams } from \"react-router\";\nimport { toast } from \"sonner\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport {\n ApprovalValueBlock,\n parseApprovalValue,\n} from \"../../components/approval-value-block\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { Skeleton } from \"../../components/ui/skeleton\";\n\nexport function meta() {\n return [{ title: \"Approval — Dispatch\" }];\n}\n\nfunction StatusBadge({ status }: { status: string }) {\n if (status === \"pending\") {\n return (\n <Badge\n variant=\"outline\"\n className=\"gap-1.5 border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400\"\n >\n <IconClock size={11} />\n Pending\n </Badge>\n );\n }\n if (status === \"approved\") {\n return (\n <Badge\n variant=\"outline\"\n className=\"gap-1.5 border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400\"\n >\n <IconCheck size={11} />\n Approved\n </Badge>\n );\n }\n return (\n <Badge\n variant=\"outline\"\n className=\"gap-1.5 border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-400\"\n >\n <IconX size={11} />\n Rejected\n </Badge>\n );\n}\n\nexport default function ApprovalPreviewRoute() {\n const [searchParams] = useSearchParams();\n const id = searchParams.get(\"id\") ?? \"\";\n\n const approvalsQuery = useActionQuery(\"list-dispatch-approvals\", {});\n const { data: approvals, isLoading } = approvalsQuery;\n\n const approve = useActionMutation(\"approve-dispatch-change\", {\n onSuccess: () => toast.success(\"Change approved\"),\n });\n const reject = useActionMutation(\"reject-dispatch-change\", {\n onSuccess: () => toast.success(\"Change rejected\"),\n });\n\n const inEmbed = isInAgentEmbed();\n\n const approval = approvals?.find((item: any) => item.id === id) ?? null;\n\n if (!id) {\n return (\n <div className=\"flex min-h-screen items-center justify-center bg-background p-6\">\n <div className=\"w-full max-w-md rounded-2xl bg-card p-6 text-center\">\n <IconAlertCircle\n size={32}\n className=\"mx-auto mb-3 text-muted-foreground\"\n />\n <p className=\"text-sm font-medium text-foreground\">\n No approval id provided\n </p>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n Add <code className=\"rounded bg-muted px-1\">?id=&lt;id&gt;</code> to\n the URL.\n </p>\n </div>\n </div>\n );\n }\n\n if (isLoading) {\n return (\n <div className=\"flex min-h-screen items-start justify-center bg-background p-6\">\n <div className=\"w-full max-w-md space-y-4\">\n <div className=\"rounded-2xl bg-card p-5\">\n <div className=\"flex items-start gap-3\">\n <Skeleton className=\"h-9 w-9 shrink-0 rounded-xl\" />\n <div className=\"min-w-0 flex-1 space-y-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"h-5 w-20 rounded-full\" />\n </div>\n <Skeleton className=\"h-3 w-32\" />\n </div>\n </div>\n <div className=\"mt-4 space-y-2 rounded-xl border bg-muted/30 px-4 py-3\">\n <div className=\"flex justify-between gap-4\">\n <Skeleton className=\"h-3 w-20\" />\n <Skeleton className=\"h-3 w-24\" />\n </div>\n <div className=\"flex justify-between gap-4\">\n <Skeleton className=\"h-3 w-20\" />\n <Skeleton className=\"h-3 w-28\" />\n </div>\n <div className=\"flex justify-between gap-4\">\n <Skeleton className=\"h-3 w-16\" />\n <Skeleton className=\"h-3 w-32\" />\n </div>\n </div>\n <div className=\"mt-4 flex gap-2\">\n <Skeleton className=\"h-8 flex-1 rounded-md\" />\n <Skeleton className=\"h-8 flex-1 rounded-md\" />\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n if (approvalsQuery.isError) {\n return (\n <div className=\"flex min-h-screen items-start justify-center bg-background p-6\">\n <div className=\"w-full max-w-md\">\n <ActionQueryError\n error={approvalsQuery.error}\n onRetry={() => void approvalsQuery.refetch()}\n />\n </div>\n </div>\n );\n }\n\n if (!approval) {\n return (\n <div className=\"flex min-h-screen items-center justify-center bg-background p-6\">\n <div className=\"w-full max-w-md rounded-2xl bg-card p-6 text-center\">\n <IconAlertCircle\n size={32}\n className=\"mx-auto mb-3 text-muted-foreground\"\n />\n <p className=\"text-sm font-medium text-foreground\">\n Approval not found\n </p>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n The approval with id{\" \"}\n <code className=\"rounded bg-muted px-1\">{id}</code> does not exist.\n </p>\n {inEmbed && (\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"mt-4 gap-1.5\"\n onClick={() => postNavigate(appPath(\"/approvals\"))}\n >\n <IconArrowUpRight size={14} />\n View all approvals\n </Button>\n )}\n </div>\n </div>\n );\n }\n\n const isPending = approval.status === \"pending\";\n const beforeValue = parseApprovalValue(approval.beforeValue);\n const afterValue = parseApprovalValue(approval.afterValue);\n\n return (\n <div className=\"flex min-h-screen items-start justify-center bg-background p-6\">\n <div className=\"w-full max-w-2xl space-y-4\">\n <div className=\"rounded-2xl bg-card p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border bg-muted text-foreground\">\n <IconShieldCheck size={17} />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-semibold text-foreground\">\n {approval.summary}\n </span>\n <StatusBadge status={approval.status} />\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n Requested by{\" \"}\n <span className=\"font-medium text-foreground\">\n {approval.requestedBy}\n </span>\n </div>\n </div>\n </div>\n\n <div className=\"mt-4 space-y-2 rounded-xl border bg-muted/30 px-4 py-3 text-xs\">\n <div className=\"flex justify-between gap-4\">\n <span className=\"text-muted-foreground\">Change type</span>\n <span className=\"font-mono font-medium text-foreground\">\n {approval.changeType}\n </span>\n </div>\n <div className=\"flex justify-between gap-4\">\n <span className=\"text-muted-foreground\">Target type</span>\n <span className=\"font-mono font-medium text-foreground\">\n {approval.targetType}\n </span>\n </div>\n {approval.targetId && (\n <div className=\"flex justify-between gap-4\">\n <span className=\"text-muted-foreground\">Target id</span>\n <span className=\"truncate font-mono font-medium text-foreground\">\n {approval.targetId}\n </span>\n </div>\n )}\n {approval.reviewedBy && (\n <div className=\"flex justify-between gap-4\">\n <span className=\"text-muted-foreground\">Reviewed by</span>\n <span className=\"font-medium text-foreground\">\n {approval.reviewedBy}\n </span>\n </div>\n )}\n </div>\n\n {(beforeValue !== null || afterValue !== null) && (\n <div className=\"mt-4 grid gap-3 md:grid-cols-2\">\n <ApprovalValueBlock label=\"Before\" value={beforeValue} />\n <ApprovalValueBlock label=\"After\" value={afterValue} />\n </div>\n )}\n\n {isPending && (\n <div className=\"mt-4 flex gap-2\">\n <Button\n size=\"sm\"\n className=\"flex-1\"\n disabled={approve.isPending || reject.isPending}\n onClick={() => approve.mutate({ id: approval.id })}\n >\n <IconCheck size={14} className=\"mr-1.5\" />\n Approve\n </Button>\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"flex-1\"\n disabled={approve.isPending || reject.isPending}\n onClick={() =>\n reject.mutate({\n id: approval.id,\n reason: \"Rejected in dispatch UI\",\n })\n }\n >\n <IconX size={14} className=\"mr-1.5\" />\n Reject\n </Button>\n </div>\n )}\n </div>\n\n {inEmbed && (\n <div className=\"flex justify-end\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"gap-1.5 text-muted-foreground\"\n onClick={() => postNavigate(appPath(\"/approvals\"))}\n >\n <IconArrowUpRight size={14} />\n Open in app\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n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AAkB,IAAC,KAAK,EAAC,OAAO,EAAC,KAAK,EAAE,UAAU,GAAI,IACnD,CACP,EAEA,SAAS,IAAI,CACZ,eAAK,SAAS,EAAC,iBAAiB,aAC9B,MAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,QAAQ,EAClB,QAAQ,EAAE,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,EAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,aAElD,KAAC,SAAS,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,GAAG,eAEnC,EACT,MAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,SAAS,EACjB,SAAS,EAAC,QAAQ,EAClB,QAAQ,EAAE,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,EAC/C,OAAO,EAAE,GAAG,EAAE,CACZ,MAAM,CAAC,MAAM,CAAC;wCACZ,EAAE,EAAE,QAAQ,CAAC,EAAE;wCACf,MAAM,EAAE,yBAAyB;qCAClC,CAAC,aAGJ,KAAC,KAAK,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,GAAG,cAE/B,IACL,CACP,IACG,EAEL,OAAO,IAAI,CACV,cAAK,SAAS,EAAC,kBAAkB,YAC/B,MAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,aAExD,KAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,GAAI,mBAEvB,GACL,CACP,IACG,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { appPath } from \"@agent-native/core/client/api-path\";\nimport {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport {\n isInAgentEmbed,\n postNavigate,\n} from \"@agent-native/core/client/navigation\";\nimport {\n IconCheck,\n IconX,\n IconArrowUpRight,\n IconShieldCheck,\n IconClock,\n IconAlertCircle,\n} from \"@tabler/icons-react\";\nimport { useSearchParams } from \"react-router\";\nimport { toast } from \"sonner\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport {\n ApprovalValueBlock,\n parseApprovalValue,\n} from \"../../components/approval-value-block\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { Skeleton } from \"../../components/ui/skeleton\";\n\nexport function meta() {\n return [{ title: \"Approval — Dispatch\" }];\n}\n\nfunction StatusBadge({ status }: { status: string }) {\n if (status === \"pending\") {\n return (\n <Badge\n variant=\"outline\"\n className=\"gap-1.5 border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400\"\n >\n <IconClock size={11} />\n Pending\n </Badge>\n );\n }\n if (status === \"approved\") {\n return (\n <Badge\n variant=\"outline\"\n className=\"gap-1.5 border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400\"\n >\n <IconCheck size={11} />\n Approved\n </Badge>\n );\n }\n return (\n <Badge\n variant=\"outline\"\n className=\"gap-1.5 border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-400\"\n >\n <IconX size={11} />\n Rejected\n </Badge>\n );\n}\n\nexport default function ApprovalPreviewRoute() {\n const [searchParams] = useSearchParams();\n const id = searchParams.get(\"id\") ?? \"\";\n\n const approvalsQuery = useActionQuery(\"list-dispatch-approvals\", {});\n const { data: approvals, isLoading } = approvalsQuery;\n\n const approve = useActionMutation(\"approve-dispatch-change\", {\n onSuccess: () => toast.success(\"Change approved\"),\n });\n const reject = useActionMutation(\"reject-dispatch-change\", {\n onSuccess: () => toast.success(\"Change rejected\"),\n });\n\n const inEmbed = isInAgentEmbed();\n\n const approval = approvals?.find((item: any) => item.id === id) ?? null;\n\n if (!id) {\n return (\n <div className=\"flex min-h-screen items-center justify-center bg-background p-6\">\n <div className=\"w-full max-w-md rounded-2xl bg-card p-6 text-center\">\n <IconAlertCircle\n size={32}\n className=\"mx-auto mb-3 text-muted-foreground\"\n />\n <p className=\"text-sm font-medium text-foreground\">\n No approval id provided\n </p>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n Add <code className=\"rounded bg-muted px-1\">?id=&lt;id&gt;</code> to\n the URL.\n </p>\n </div>\n </div>\n );\n }\n\n if (isLoading) {\n return (\n <div className=\"flex min-h-screen items-start justify-center bg-background p-6\">\n <div className=\"w-full max-w-md space-y-4\">\n <div className=\"rounded-2xl bg-card p-5\">\n <div className=\"flex items-start gap-3\">\n <Skeleton className=\"h-9 w-9 shrink-0 rounded-xl\" />\n <div className=\"min-w-0 flex-1 space-y-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"h-5 w-20 rounded-full\" />\n </div>\n <Skeleton className=\"h-3 w-32\" />\n </div>\n </div>\n <div className=\"mt-4 space-y-2 rounded-xl border bg-muted/30 px-4 py-3\">\n <div className=\"flex justify-between gap-4\">\n <Skeleton className=\"h-3 w-20\" />\n <Skeleton className=\"h-3 w-24\" />\n </div>\n <div className=\"flex justify-between gap-4\">\n <Skeleton className=\"h-3 w-20\" />\n <Skeleton className=\"h-3 w-28\" />\n </div>\n <div className=\"flex justify-between gap-4\">\n <Skeleton className=\"h-3 w-16\" />\n <Skeleton className=\"h-3 w-32\" />\n </div>\n </div>\n <div className=\"mt-4 flex gap-2\">\n <Skeleton className=\"h-8 flex-1 rounded-md\" />\n <Skeleton className=\"h-8 flex-1 rounded-md\" />\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n if (approvalsQuery.isError) {\n return (\n <div className=\"flex min-h-screen items-start justify-center bg-background p-6\">\n <div className=\"w-full max-w-md\">\n <ActionQueryError\n error={approvalsQuery.error}\n onRetry={() => void approvalsQuery.refetch()}\n />\n </div>\n </div>\n );\n }\n\n if (!approval) {\n return (\n <div className=\"flex min-h-screen items-center justify-center bg-background p-6\">\n <div className=\"w-full max-w-md rounded-2xl bg-card p-6 text-center\">\n <IconAlertCircle\n size={32}\n className=\"mx-auto mb-3 text-muted-foreground\"\n />\n <p className=\"text-sm font-medium text-foreground\">\n Approval not found\n </p>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n The approval with id{\" \"}\n <code className=\"rounded bg-muted px-1\">{id}</code> does not exist.\n </p>\n {inEmbed && (\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"mt-4 gap-1.5\"\n onClick={() => postNavigate(appPath(\"/admin/approvals\"))}\n >\n <IconArrowUpRight size={14} />\n View all approvals\n </Button>\n )}\n </div>\n </div>\n );\n }\n\n const isPending = approval.status === \"pending\";\n const beforeValue = parseApprovalValue(approval.beforeValue);\n const afterValue = parseApprovalValue(approval.afterValue);\n\n return (\n <div className=\"flex min-h-screen items-start justify-center bg-background p-6\">\n <div className=\"w-full max-w-2xl space-y-4\">\n <div className=\"rounded-2xl bg-card p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border bg-muted text-foreground\">\n <IconShieldCheck size={17} />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-semibold text-foreground\">\n {approval.summary}\n </span>\n <StatusBadge status={approval.status} />\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n Requested by{\" \"}\n <span className=\"font-medium text-foreground\">\n {approval.requestedBy}\n </span>\n </div>\n </div>\n </div>\n\n <div className=\"mt-4 space-y-2 rounded-xl border bg-muted/30 px-4 py-3 text-xs\">\n <div className=\"flex justify-between gap-4\">\n <span className=\"text-muted-foreground\">Change type</span>\n <span className=\"font-mono font-medium text-foreground\">\n {approval.changeType}\n </span>\n </div>\n <div className=\"flex justify-between gap-4\">\n <span className=\"text-muted-foreground\">Target type</span>\n <span className=\"font-mono font-medium text-foreground\">\n {approval.targetType}\n </span>\n </div>\n {approval.targetId && (\n <div className=\"flex justify-between gap-4\">\n <span className=\"text-muted-foreground\">Target id</span>\n <span className=\"truncate font-mono font-medium text-foreground\">\n {approval.targetId}\n </span>\n </div>\n )}\n {approval.reviewedBy && (\n <div className=\"flex justify-between gap-4\">\n <span className=\"text-muted-foreground\">Reviewed by</span>\n <span className=\"font-medium text-foreground\">\n {approval.reviewedBy}\n </span>\n </div>\n )}\n </div>\n\n {(beforeValue !== null || afterValue !== null) && (\n <div className=\"mt-4 grid gap-3 md:grid-cols-2\">\n <ApprovalValueBlock label=\"Before\" value={beforeValue} />\n <ApprovalValueBlock label=\"After\" value={afterValue} />\n </div>\n )}\n\n {isPending && (\n <div className=\"mt-4 flex gap-2\">\n <Button\n size=\"sm\"\n className=\"flex-1\"\n disabled={approve.isPending || reject.isPending}\n onClick={() => approve.mutate({ id: approval.id })}\n >\n <IconCheck size={14} className=\"mr-1.5\" />\n Approve\n </Button>\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"flex-1\"\n disabled={approve.isPending || reject.isPending}\n onClick={() =>\n reject.mutate({\n id: approval.id,\n reason: \"Rejected in dispatch UI\",\n })\n }\n >\n <IconX size={14} className=\"mr-1.5\" />\n Reject\n </Button>\n </div>\n )}\n </div>\n\n {inEmbed && (\n <div className=\"flex justify-end\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"gap-1.5 text-muted-foreground\"\n onClick={() => postNavigate(appPath(\"/admin/approvals\"))}\n >\n <IconArrowUpRight size={14} />\n Open in app\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"apps.$appId.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/apps.$appId.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,oDAkHxC"}
1
+ {"version":3,"file":"apps.$appId.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/apps.$appId.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,oDAuHxC"}
@@ -4,7 +4,7 @@ import { useT } from "@agent-native/core/client/i18n";
4
4
  import { withBuilderUtmTrackingParams } from "@agent-native/core/shared/builder-link-tracking";
5
5
  import { IconArrowLeft, IconArrowUpRight, IconClockHour4, } from "@tabler/icons-react";
6
6
  import { useEffect, useMemo } from "react";
7
- import { Link, useParams } from "react-router";
7
+ import { Link, useLocation, useParams } from "react-router";
8
8
  import { ActionQueryError } from "../../components/action-query-error.js";
9
9
  import { DispatchShell } from "../../components/dispatch-shell.js";
10
10
  import { Badge } from "../../components/ui/badge.js";
@@ -16,6 +16,7 @@ export function meta() {
16
16
  }
17
17
  export default function WorkspaceAppRoute() {
18
18
  const t = useT();
19
+ const location = useLocation();
19
20
  const { appId } = useParams();
20
21
  const appsQuery = useActionQuery("list-workspace-apps", {
21
22
  includeAgentCards: false,
@@ -28,7 +29,7 @@ export default function WorkspaceAppRoute() {
28
29
  return;
29
30
  window.location.assign(href);
30
31
  }, [app, href]);
31
- return (_jsx(DispatchShell, { title: app?.name || t("dispatch.pages.workspaceAppFallback"), description: t("dispatch.pages.workspaceAppDescription"), children: _jsxs("div", { className: "max-w-2xl rounded-lg bg-card p-5", children: [_jsx(Button, { asChild: true, size: "sm", variant: "ghost", className: "-ml-2 mb-4", children: _jsxs(Link, { to: "/apps", children: [_jsx(IconArrowLeft, { size: 15, className: "mr-1.5" }), t("dispatch.nav.apps")] }) }), appsQuery.isError ? (_jsx(ActionQueryError, { error: appsQuery.error, onRetry: () => void appsQuery.refetch() })) : isLoading && !app ? (_jsxs("div", { className: "space-y-3", children: [_jsx(Skeleton, { className: "h-5 w-48" }), _jsx(Skeleton, { className: "h-4 w-full" }), _jsx(Skeleton, { className: "h-4 w-2/3" })] })) : !app ? (_jsxs("div", { className: "space-y-3", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: t("dispatch.pages.appNotFound") }), _jsx("p", { className: "text-sm text-muted-foreground", children: t("dispatch.pages.pageNotFoundDescription") })] })) : app.status === "pending" ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: app.name }), _jsxs(Badge, { variant: "outline", className: "gap-1 border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300", children: [_jsx(IconClockHour4, { size: 12 }), t("dispatch.pages.building")] })] }), _jsxs("p", { className: "text-sm text-muted-foreground", children: [t("dispatch.pages.appBuildingPrefix"), " ", _jsx("span", { className: "font-mono text-foreground", children: app.path }), " ", t("dispatch.pages.appBuildingSuffix")] }), app.branchName ? (_jsx("p", { className: "text-xs text-muted-foreground", children: t("dispatch.pages.branch", { branch: app.branchName }) })) : null, app.builderUrl ? (_jsx(Button, { asChild: true, children: _jsxs("a", { href: withBuilderUtmTrackingParams(app.builderUrl, {
32
+ return (_jsx(DispatchShell, { title: app?.name || t("dispatch.pages.workspaceAppFallback"), description: t("dispatch.pages.workspaceAppDescription"), children: _jsxs("div", { className: "max-w-2xl rounded-lg bg-card p-5", children: [_jsx(Button, { asChild: true, size: "sm", variant: "ghost", className: "-ml-2 mb-4", children: _jsxs(Link, { to: location.pathname.startsWith("/admin/") ? "/admin/apps" : "/apps", children: [_jsx(IconArrowLeft, { size: 15, className: "mr-1.5" }), t("dispatch.nav.apps")] }) }), appsQuery.isError ? (_jsx(ActionQueryError, { error: appsQuery.error, onRetry: () => void appsQuery.refetch() })) : isLoading && !app ? (_jsxs("div", { className: "space-y-3", children: [_jsx(Skeleton, { className: "h-5 w-48" }), _jsx(Skeleton, { className: "h-4 w-full" }), _jsx(Skeleton, { className: "h-4 w-2/3" })] })) : !app ? (_jsxs("div", { className: "space-y-3", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: t("dispatch.pages.appNotFound") }), _jsx("p", { className: "text-sm text-muted-foreground", children: t("dispatch.pages.pageNotFoundDescription") })] })) : app.status === "pending" ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: app.name }), _jsxs(Badge, { variant: "outline", className: "gap-1 border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300", children: [_jsx(IconClockHour4, { size: 12 }), t("dispatch.pages.building")] })] }), _jsxs("p", { className: "text-sm text-muted-foreground", children: [t("dispatch.pages.appBuildingPrefix"), " ", _jsx("span", { className: "font-mono text-foreground", children: app.path }), " ", t("dispatch.pages.appBuildingSuffix")] }), app.branchName ? (_jsx("p", { className: "text-xs text-muted-foreground", children: t("dispatch.pages.branch", { branch: app.branchName }) })) : null, app.builderUrl ? (_jsx(Button, { asChild: true, children: _jsxs("a", { href: withBuilderUtmTrackingParams(app.builderUrl, {
32
33
  campaign: "product",
33
34
  content: "dispatch_branch",
34
35
  }), target: "_blank", rel: "noreferrer", children: [t("dispatch.pages.openBuilderBranch"), _jsx(IconArrowUpRight, { size: 15, className: "ml-1.5" })] }) })) : null] })) : (_jsxs("div", { className: "space-y-3", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: t("dispatch.pages.openingApp", { name: app.name }) }), _jsxs("p", { className: "text-sm text-muted-foreground", children: [t("dispatch.pages.redirectingTo"), " ", _jsx("span", { className: "font-mono text-foreground", children: app.path }), "."] }), href ? (_jsx(Button, { asChild: true, children: _jsxs("a", { href: href, children: [t("dispatch.pages.openApp"), _jsx(IconArrowUpRight, { size: 15, className: "ml-1.5" })] }) })) : null] }))] }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"apps.$appId.js","sourceRoot":"","sources":["../../../src/routes/pages/apps.$appId.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAA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C,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,CACF,eAAK,SAAS,EAAC,WAAW,aACxB,aAAI,SAAS,EAAC,yCAAyC,YACpD,CAAC,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,GAChD,EACL,aAAG,SAAS,EAAC,+BAA+B,aACzC,CAAC,CAAC,8BAA8B,CAAC,EAAE,GAAG,EACvC,eAAM,SAAS,EAAC,2BAA2B,YAAE,GAAG,CAAC,IAAI,GAAQ,SAC3D,EACH,IAAI,CAAC,CAAC,CAAC,CACN,KAAC,MAAM,IAAC,OAAO,kBACb,aAAG,IAAI,EAAE,IAAI,aACV,CAAC,CAAC,wBAAwB,CAAC,EAC5B,KAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,GAAG,IAC/C,GACG,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,IACG,GACQ,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\nimport {\n IconArrowLeft,\n IconArrowUpRight,\n IconClockHour4,\n} from \"@tabler/icons-react\";\nimport { useEffect, useMemo } from \"react\";\nimport { Link, useParams } from \"react-router\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { Skeleton } from \"../../components/ui/skeleton\";\nimport {\n workspaceAppHref,\n type WorkspaceAppSummary,\n} from \"../../lib/workspace-apps\";\n\nexport function meta() {\n return [{ title: \"Workspace app - Dispatch\" }];\n}\n\nexport default function WorkspaceAppRoute() {\n const t = useT();\n const { appId } = useParams();\n const appsQuery = useActionQuery(\"list-workspace-apps\", {\n includeAgentCards: false,\n });\n const { data: apps = [], isLoading } = appsQuery;\n const app = useMemo(\n () =>\n (apps as WorkspaceAppSummary[]).find((item) => item.id === appId) ?? null,\n [appId, apps],\n );\n const href = app ? workspaceAppHref(app) : null;\n\n useEffect(() => {\n if (!app || app.status === \"pending\" || !href) return;\n window.location.assign(href);\n }, [app, href]);\n\n return (\n <DispatchShell\n title={app?.name || t(\"dispatch.pages.workspaceAppFallback\")}\n description={t(\"dispatch.pages.workspaceAppDescription\")}\n >\n <div className=\"max-w-2xl rounded-lg bg-card p-5\">\n <Button asChild size=\"sm\" variant=\"ghost\" className=\"-ml-2 mb-4\">\n <Link to=\"/apps\">\n <IconArrowLeft size={15} className=\"mr-1.5\" />\n {t(\"dispatch.nav.apps\")}\n </Link>\n </Button>\n\n {appsQuery.isError ? (\n <ActionQueryError\n error={appsQuery.error}\n onRetry={() => void appsQuery.refetch()}\n />\n ) : isLoading && !app ? (\n <div className=\"space-y-3\">\n <Skeleton className=\"h-5 w-48\" />\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-2/3\" />\n </div>\n ) : !app ? (\n <div className=\"space-y-3\">\n <h2 className=\"text-base font-semibold text-foreground\">\n {t(\"dispatch.pages.appNotFound\")}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"dispatch.pages.pageNotFoundDescription\")}\n </p>\n </div>\n ) : app.status === \"pending\" ? (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h2 className=\"text-base font-semibold text-foreground\">\n {app.name}\n </h2>\n <Badge\n variant=\"outline\"\n className=\"gap-1 border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300\"\n >\n <IconClockHour4 size={12} />\n {t(\"dispatch.pages.building\")}\n </Badge>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"dispatch.pages.appBuildingPrefix\")}{\" \"}\n <span className=\"font-mono text-foreground\">{app.path}</span>{\" \"}\n {t(\"dispatch.pages.appBuildingSuffix\")}\n </p>\n {app.branchName ? (\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.branch\", { branch: app.branchName })}\n </p>\n ) : null}\n {app.builderUrl ? (\n <Button asChild>\n <a\n href={withBuilderUtmTrackingParams(app.builderUrl, {\n campaign: \"product\",\n content: \"dispatch_branch\",\n })}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n {t(\"dispatch.pages.openBuilderBranch\")}\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </a>\n </Button>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <h2 className=\"text-base font-semibold text-foreground\">\n {t(\"dispatch.pages.openingApp\", { name: app.name })}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"dispatch.pages.redirectingTo\")}{\" \"}\n <span className=\"font-mono text-foreground\">{app.path}</span>.\n </p>\n {href ? (\n <Button asChild>\n <a href={href}>\n {t(\"dispatch.pages.openApp\")}\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </a>\n </Button>\n ) : null}\n </div>\n )}\n </div>\n </DispatchShell>\n );\n}\n"]}
1
+ {"version":3,"file":"apps.$appId.js","sourceRoot":"","sources":["../../../src/routes/pages/apps.$appId.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE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AChD,EACL,aAAG,SAAS,EAAC,+BAA+B,aACzC,CAAC,CAAC,8BAA8B,CAAC,EAAE,GAAG,EACvC,eAAM,SAAS,EAAC,2BAA2B,YAAE,GAAG,CAAC,IAAI,GAAQ,SAC3D,EACH,IAAI,CAAC,CAAC,CAAC,CACN,KAAC,MAAM,IAAC,OAAO,kBACb,aAAG,IAAI,EAAE,IAAI,aACV,CAAC,CAAC,wBAAwB,CAAC,EAC5B,KAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,GAAG,IAC/C,GACG,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,IACG,GACQ,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useActionQuery } from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { withBuilderUtmTrackingParams } from \"@agent-native/core/shared/builder-link-tracking\";\nimport {\n IconArrowLeft,\n IconArrowUpRight,\n IconClockHour4,\n} from \"@tabler/icons-react\";\nimport { useEffect, useMemo } from \"react\";\nimport { Link, useLocation, useParams } from \"react-router\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { Skeleton } from \"../../components/ui/skeleton\";\nimport {\n workspaceAppHref,\n type WorkspaceAppSummary,\n} from \"../../lib/workspace-apps\";\n\nexport function meta() {\n return [{ title: \"Workspace app - Dispatch\" }];\n}\n\nexport default function WorkspaceAppRoute() {\n const t = useT();\n const location = useLocation();\n const { appId } = useParams();\n const appsQuery = useActionQuery(\"list-workspace-apps\", {\n includeAgentCards: false,\n });\n const { data: apps = [], isLoading } = appsQuery;\n const app = useMemo(\n () =>\n (apps as WorkspaceAppSummary[]).find((item) => item.id === appId) ?? null,\n [appId, apps],\n );\n const href = app ? workspaceAppHref(app) : null;\n\n useEffect(() => {\n if (!app || app.status === \"pending\" || !href) return;\n window.location.assign(href);\n }, [app, href]);\n\n return (\n <DispatchShell\n title={app?.name || t(\"dispatch.pages.workspaceAppFallback\")}\n description={t(\"dispatch.pages.workspaceAppDescription\")}\n >\n <div className=\"max-w-2xl rounded-lg bg-card p-5\">\n <Button asChild size=\"sm\" variant=\"ghost\" className=\"-ml-2 mb-4\">\n <Link\n to={\n location.pathname.startsWith(\"/admin/\") ? \"/admin/apps\" : \"/apps\"\n }\n >\n <IconArrowLeft size={15} className=\"mr-1.5\" />\n {t(\"dispatch.nav.apps\")}\n </Link>\n </Button>\n\n {appsQuery.isError ? (\n <ActionQueryError\n error={appsQuery.error}\n onRetry={() => void appsQuery.refetch()}\n />\n ) : isLoading && !app ? (\n <div className=\"space-y-3\">\n <Skeleton className=\"h-5 w-48\" />\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-2/3\" />\n </div>\n ) : !app ? (\n <div className=\"space-y-3\">\n <h2 className=\"text-base font-semibold text-foreground\">\n {t(\"dispatch.pages.appNotFound\")}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"dispatch.pages.pageNotFoundDescription\")}\n </p>\n </div>\n ) : app.status === \"pending\" ? (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h2 className=\"text-base font-semibold text-foreground\">\n {app.name}\n </h2>\n <Badge\n variant=\"outline\"\n className=\"gap-1 border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300\"\n >\n <IconClockHour4 size={12} />\n {t(\"dispatch.pages.building\")}\n </Badge>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"dispatch.pages.appBuildingPrefix\")}{\" \"}\n <span className=\"font-mono text-foreground\">{app.path}</span>{\" \"}\n {t(\"dispatch.pages.appBuildingSuffix\")}\n </p>\n {app.branchName ? (\n <p className=\"text-xs text-muted-foreground\">\n {t(\"dispatch.pages.branch\", { branch: app.branchName })}\n </p>\n ) : null}\n {app.builderUrl ? (\n <Button asChild>\n <a\n href={withBuilderUtmTrackingParams(app.builderUrl, {\n campaign: \"product\",\n content: \"dispatch_branch\",\n })}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n {t(\"dispatch.pages.openBuilderBranch\")}\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </a>\n </Button>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <h2 className=\"text-base font-semibold text-foreground\">\n {t(\"dispatch.pages.openingApp\", { name: app.name })}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"dispatch.pages.redirectingTo\")}{\" \"}\n <span className=\"font-mono text-foreground\">{app.path}</span>.\n </p>\n {href ? (\n <Button asChild>\n <a href={href}>\n {t(\"dispatch.pages.openApp\")}\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </a>\n </Button>\n ) : null}\n </div>\n )}\n </div>\n </DispatchShell>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/integrations.tsx"],"names":[],"mappings":"AAyCA,wBAAgB,IAAI;;IAEnB;AAyRD,MAAM,CAAC,OAAO,UAAU,gBAAgB,oDAwIvC"}
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/integrations.tsx"],"names":[],"mappings":"AA0CA,wBAAgB,IAAI;;IAEnB;AAyRD,MAAM,CAAC,OAAO,UAAU,gBAAgB,oDAwIvC"}
@@ -3,6 +3,7 @@ import { useActionMutation, useActionQuery, } from "@agent-native/core/client/ho
3
3
  import { IconCheck, IconChevronRight, IconCircleDashed, IconKey, IconLink, IconPlugConnected, } from "@tabler/icons-react";
4
4
  import { useQueryClient } from "@tanstack/react-query";
5
5
  import { useMemo, useState } from "react";
6
+ import { Link } from "react-router";
6
7
  import { toast } from "sonner";
7
8
  import { ActionQueryError } from "../../components/action-query-error.js";
8
9
  import { DispatchShell } from "../../components/dispatch-shell.js";
@@ -153,6 +154,6 @@ export default function ConnectionsRoute() {
153
154
  return (_jsxs(DispatchShell, { title: "Connections", description: "Connect services once. Apps that need them pick up the key automatically.", children: [catalogQuery.isError || accessQuery.isError ? (_jsx(ActionQueryError, { error: catalogQuery.error ?? accessQuery.error, onRetry: () => {
154
155
  void catalogQuery.refetch();
155
156
  void accessQuery.refetch();
156
- } })) : null, !catalogQuery.isError && isLoading && services.length === 0 && (_jsx("div", { className: "rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground", children: "Discovering apps and credentials\u2026" })), !catalogQuery.isError && !isLoading && services.length === 0 && (_jsx("div", { className: "rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground", children: "No apps with declared integrations are reachable yet." })), available.length > 0 && (_jsxs("section", { children: [_jsxs("div", { className: "mb-3 flex items-baseline justify-between", children: [_jsx("h2", { className: "text-sm font-medium text-foreground", children: "Available to connect" }), _jsx("span", { className: "text-xs text-muted-foreground", children: available.length })] }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3", children: available.map((service) => (_jsx(ConnectorCard, { service: service, accessMode: accessMode }, service.key))) })] })), connected.length > 0 && (_jsxs("section", { children: [_jsxs("div", { className: "mb-3 mt-2 flex items-baseline justify-between", children: [_jsx("h2", { className: "text-sm font-medium text-foreground", children: "Connected" }), _jsx("span", { className: "text-xs text-muted-foreground", children: connected.length })] }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3", children: connected.map((service) => (_jsx(ConnectorCard, { service: service, accessMode: accessMode }, service.key))) })] })), apps.length > 0 && (_jsxs(Collapsible, { className: "mt-6 rounded-2xl bg-card", children: [_jsxs(CollapsibleTrigger, { className: "group flex w-full items-center justify-between px-4 py-3 text-sm", children: [_jsxs("span", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx(IconPlugConnected, { size: 14 }), "Per-app status"] }), _jsx(IconChevronRight, { size: 14, className: "text-muted-foreground transition group-data-[state=open]:rotate-90" })] }), _jsxs(CollapsibleContent, { children: [_jsx("div", { className: "border-t", children: apps.map((app) => (_jsx(PerAppDetailRow, { app: app }, app.appId))) }), _jsxs("div", { className: "flex items-center justify-end gap-1.5 border-t px-4 py-2.5 text-xs text-muted-foreground", children: [_jsx(IconLink, { size: 12 }), _jsx("a", { href: "/vault", className: "hover:underline", children: "Open vault for advanced sharing" })] })] })] }))] }));
157
+ } })) : null, !catalogQuery.isError && isLoading && services.length === 0 && (_jsx("div", { className: "rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground", children: "Discovering apps and credentials\u2026" })), !catalogQuery.isError && !isLoading && services.length === 0 && (_jsx("div", { className: "rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground", children: "No apps with declared integrations are reachable yet." })), available.length > 0 && (_jsxs("section", { children: [_jsxs("div", { className: "mb-3 flex items-baseline justify-between", children: [_jsx("h2", { className: "text-sm font-medium text-foreground", children: "Available to connect" }), _jsx("span", { className: "text-xs text-muted-foreground", children: available.length })] }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3", children: available.map((service) => (_jsx(ConnectorCard, { service: service, accessMode: accessMode }, service.key))) })] })), connected.length > 0 && (_jsxs("section", { children: [_jsxs("div", { className: "mb-3 mt-2 flex items-baseline justify-between", children: [_jsx("h2", { className: "text-sm font-medium text-foreground", children: "Connected" }), _jsx("span", { className: "text-xs text-muted-foreground", children: connected.length })] }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3", children: connected.map((service) => (_jsx(ConnectorCard, { service: service, accessMode: accessMode }, service.key))) })] })), apps.length > 0 && (_jsxs(Collapsible, { className: "mt-6 rounded-2xl bg-card", children: [_jsxs(CollapsibleTrigger, { className: "group flex w-full items-center justify-between px-4 py-3 text-sm", children: [_jsxs("span", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx(IconPlugConnected, { size: 14 }), "Per-app status"] }), _jsx(IconChevronRight, { size: 14, className: "text-muted-foreground transition group-data-[state=open]:rotate-90" })] }), _jsxs(CollapsibleContent, { children: [_jsx("div", { className: "border-t", children: apps.map((app) => (_jsx(PerAppDetailRow, { app: app }, app.appId))) }), _jsxs("div", { className: "flex items-center justify-end gap-1.5 border-t px-4 py-2.5 text-xs text-muted-foreground", children: [_jsx(IconLink, { size: 12 }), _jsx(Link, { to: "/admin/vault", className: "hover:underline", children: "Open vault for advanced sharing" })] })] })] }))] }));
157
158
  }
158
159
  //# sourceMappingURL=integrations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/routes/pages/integrations.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc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,EACN,cAAK,SAAS,EAAC,0CAA0C,YACtD,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC1B,KAAC,aAAa,IAEZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,IAFjB,OAAO,CAAC,GAAG,CAGhB,CACH,CAAC,GACE,IACE,CACX,EAEA,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAClB,MAAC,WAAW,IAAC,SAAS,EAAC,0BAA0B,aAC/C,MAAC,kBAAkB,IAAC,SAAS,EAAC,kEAAkE,aAC9F,gBAAM,SAAS,EAAC,+CAA+C,aAC7D,KAAC,iBAAiB,IAAC,IAAI,EAAE,EAAE,GAAI,sBAE1B,EACP,KAAC,gBAAgB,IACf,IAAI,EAAE,EAAE,EACR,SAAS,EAAC,oEAAoE,GAC9E,IACiB,EACrB,MAAC,kBAAkB,eACjB,cAAK,SAAS,EAAC,UAAU,YACtB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,KAAC,eAAe,IAAiB,GAAG,EAAE,GAAG,IAAnB,GAAG,CAAC,KAAK,CAAc,CAC9C,CAAC,GACE,EACN,eAAK,SAAS,EAAC,0FAA0F,aACvG,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,EACtB,YAAG,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,gDAExC,IACA,IACa,IACT,CACf,IACa,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport {\n IconCheck,\n IconChevronRight,\n IconCircleDashed,\n IconKey,\n IconLink,\n IconPlugConnected,\n} from \"@tabler/icons-react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useMemo, useState } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../components/ui/collapsible\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../../components/ui/dialog\";\nimport { Input } from \"../../components/ui/input\";\nimport { Label } from \"../../components/ui/label\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../../components/ui/tooltip\";\n\nexport function meta() {\n return [{ title: \"Connections — Dispatch\" }];\n}\n\ninterface AppRef {\n appId: string;\n appName: string;\n color: string;\n configured: boolean;\n vaultGranted: boolean;\n vaultSecretId?: string;\n}\n\ninterface Service {\n /** Credential key shared across apps (e.g. `OPENAI_API_KEY`). */\n key: string;\n /** Human label from the first app that declares it (`\"OpenAI\"`, `\"Stripe\"`). */\n label: string;\n /** Apps in the workspace that declare this credential. */\n apps: AppRef[];\n}\n\ninterface CatalogApp {\n appId: string;\n appName: string;\n color: string;\n url: string;\n reachable: boolean;\n integrations?: Array<{\n key: string;\n label: string;\n required: boolean;\n configured: boolean;\n vaultGranted: boolean;\n vaultSecretId?: string;\n }>;\n}\n\nfunction inferProviderFromKey(key: string, label: string): string {\n const haystack = `${key} ${label}`.toLowerCase();\n for (const provider of [\n \"google\",\n \"slack\",\n \"sendgrid\",\n \"github\",\n \"stripe\",\n \"hubspot\",\n \"jira\",\n \"bigquery\",\n \"anthropic\",\n \"openai\",\n ]) {\n if (haystack.includes(provider)) return provider;\n }\n return \"other\";\n}\n\nfunction ConnectDialog({\n service,\n open,\n onOpenChange,\n accessMode,\n}: {\n service: Service;\n open: boolean;\n onOpenChange: (next: boolean) => void;\n accessMode: \"all-apps\" | \"manual\";\n}) {\n const [value, setValue] = useState(\"\");\n const qc = useQueryClient();\n\n const createSecret = useActionMutation(\"create-vault-secret\", {});\n const createGrant = useActionMutation(\"create-vault-grant\", {});\n const syncToApp = useActionMutation(\"sync-vault-to-app\", {});\n\n function reset() {\n setValue(\"\");\n }\n\n async function handleSave() {\n const trimmed = value.trim();\n if (!trimmed) {\n toast.error(\"Enter a value to save\");\n return;\n }\n try {\n // 1. Create the secret (or get the existing one — server treats key as\n // the unique identifier). The server returns { secret: { id, ... } }.\n const created = await createSecret.mutateAsync({\n credentialKey: service.key,\n name: service.label,\n value: trimmed,\n provider: inferProviderFromKey(service.key, service.label),\n });\n const secretId =\n (created as { secret?: { id?: string } })?.secret?.id ??\n (created as { id?: string })?.id;\n if (!secretId) {\n throw new Error(\"Secret created but id missing\");\n }\n\n // 2. Manual mode needs grants; all-apps mode only needs sync.\n if (accessMode === \"manual\") {\n const targets = service.apps.filter((a) => !a.vaultGranted);\n for (const app of targets) {\n try {\n await createGrant.mutateAsync({\n secretId,\n appId: app.appId,\n });\n } catch (err) {\n console.warn(`grant to ${app.appId} failed`, err);\n }\n }\n }\n for (const app of service.apps) {\n try {\n await syncToApp.mutateAsync({ appId: app.appId });\n } catch (err) {\n console.warn(`sync to ${app.appId} failed`, err);\n }\n }\n\n qc.invalidateQueries({\n queryKey: [\"action\", \"list-integrations-catalog\"],\n });\n toast.success(`Connected ${service.label}`);\n onOpenChange(false);\n reset();\n } catch (err: any) {\n toast.error(err?.message ?? \"Failed to save credential\");\n }\n }\n\n const pending =\n createSecret.isPending || createGrant.isPending || syncToApp.isPending;\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next) reset();\n onOpenChange(next);\n }}\n >\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Connect {service.label}</DialogTitle>\n <DialogDescription>\n Used by{\" \"}\n {service.apps.length === 1\n ? service.apps[0].appName\n : `${service.apps.length} apps`}\n . Saved to the workspace vault and synced to every app that needs\n it.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-3\">\n <div>\n <Label className=\"text-xs text-muted-foreground\">Key</Label>\n <div className=\"font-mono text-sm\">{service.key}</div>\n </div>\n <div>\n <Label htmlFor=\"connector-value\">Value</Label>\n <Input\n id=\"connector-value\"\n type=\"password\"\n autoComplete=\"off\"\n value={value}\n onChange={(e) => setValue(e.target.value)}\n placeholder={`Paste your ${service.label} key…`}\n autoFocus\n />\n </div>\n </div>\n <DialogFooter>\n <Button\n variant=\"outline\"\n onClick={() => onOpenChange(false)}\n disabled={pending}\n >\n Cancel\n </Button>\n <Button onClick={handleSave} disabled={pending || !value.trim()}>\n {pending ? \"Saving…\" : \"Connect\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction ConnectorCard({\n service,\n accessMode,\n}: {\n service: Service;\n accessMode: \"all-apps\" | \"manual\";\n}) {\n const [open, setOpen] = useState(false);\n const isConnected = service.apps.some((a) => a.configured);\n const appCount = service.apps.length;\n\n return (\n <>\n <button\n type=\"button\"\n onClick={() => setOpen(true)}\n className=\"group flex flex-col items-start gap-2 rounded-2xl bg-card p-5 text-left transition-[background-color] hover:bg-card/80 cursor-pointer\"\n >\n <div className=\"flex w-full items-start justify-between gap-2\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-xl bg-muted\">\n <IconKey size={16} className=\"text-muted-foreground\" />\n </div>\n {isConnected ? (\n <Badge\n variant=\"secondary\"\n className=\"bg-green-500/10 text-green-700 dark:text-green-400 gap-1\"\n >\n <IconCheck size={12} />\n Connected\n </Badge>\n ) : (\n <Badge\n variant=\"secondary\"\n className=\"bg-amber-500/10 text-amber-700 dark:text-amber-400 gap-1\"\n >\n <IconCircleDashed size={12} />\n Connect\n </Badge>\n )}\n </div>\n <div className=\"w-full min-w-0\">\n <Tooltip>\n <TooltipTrigger asChild>\n <div className=\"text-sm font-semibold text-foreground truncate\">\n {service.label}\n </div>\n </TooltipTrigger>\n <TooltipContent>{service.label}</TooltipContent>\n </Tooltip>\n <div className=\"font-mono text-xs text-muted-foreground/80 truncate\">\n {service.key}\n </div>\n </div>\n <div className=\"text-xs text-muted-foreground\">\n Used by {appCount} {appCount === 1 ? \"app\" : \"apps\"}\n </div>\n </button>\n <ConnectDialog\n service={service}\n open={open}\n onOpenChange={setOpen}\n accessMode={accessMode}\n />\n </>\n );\n}\n\nfunction PerAppDetailRow({ app }: { app: CatalogApp }) {\n const total = (app.integrations ?? []).length;\n const ok = (app.integrations ?? []).filter((i) => i.configured).length;\n return (\n <div className=\"flex items-center justify-between border-t px-4 py-2.5 first:border-t-0\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <div\n className=\"h-5 w-5 rounded text-[10px] font-bold text-white flex items-center justify-center shrink-0\"\n style={{ backgroundColor: app.color }}\n >\n {app.appName.charAt(0).toUpperCase()}\n </div>\n <span className=\"text-sm truncate\">{app.appName}</span>\n {!app.reachable && (\n <span className=\"text-xs text-muted-foreground\">offline</span>\n )}\n </div>\n <span className=\"text-xs text-muted-foreground\">\n {total === 0 ? \"no integrations\" : `${ok}/${total}`}\n </span>\n </div>\n );\n}\n\nexport default function ConnectionsRoute() {\n const catalogQuery = useActionQuery(\"list-integrations-catalog\", {});\n const accessQuery = useActionQuery(\"get-vault-access-settings\", {});\n const { data: catalog, isLoading } = catalogQuery;\n const { data: accessSettings } = accessQuery;\n const apps = (catalog as CatalogApp[]) || [];\n const accessMode =\n (accessSettings as any)?.mode === \"manual\" ? \"manual\" : \"all-apps\";\n\n const services = useMemo<Service[]>(() => {\n const map = new Map<string, Service>();\n for (const app of apps) {\n for (const intg of app.integrations ?? []) {\n if (!map.has(intg.key)) {\n map.set(intg.key, {\n key: intg.key,\n label: intg.label,\n apps: [],\n });\n }\n map.get(intg.key)!.apps.push({\n appId: app.appId,\n appName: app.appName,\n color: app.color,\n configured: intg.configured,\n vaultGranted: intg.vaultGranted,\n vaultSecretId: intg.vaultSecretId,\n });\n }\n }\n return Array.from(map.values()).sort((a, b) =>\n a.label.localeCompare(b.label),\n );\n }, [apps]);\n\n const available = services.filter((s) => !s.apps.some((a) => a.configured));\n const connected = services.filter((s) => s.apps.some((a) => a.configured));\n\n return (\n <DispatchShell\n title=\"Connections\"\n description=\"Connect services once. Apps that need them pick up the key automatically.\"\n >\n {catalogQuery.isError || accessQuery.isError ? (\n <ActionQueryError\n error={catalogQuery.error ?? accessQuery.error}\n onRetry={() => {\n void catalogQuery.refetch();\n void accessQuery.refetch();\n }}\n />\n ) : null}\n\n {!catalogQuery.isError && isLoading && services.length === 0 && (\n <div className=\"rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground\">\n Discovering apps and credentials…\n </div>\n )}\n\n {!catalogQuery.isError && !isLoading && services.length === 0 && (\n <div className=\"rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground\">\n No apps with declared integrations are reachable yet.\n </div>\n )}\n\n {available.length > 0 && (\n <section>\n <div className=\"mb-3 flex items-baseline justify-between\">\n <h2 className=\"text-sm font-medium text-foreground\">\n Available to connect\n </h2>\n <span className=\"text-xs text-muted-foreground\">\n {available.length}\n </span>\n </div>\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {available.map((service) => (\n <ConnectorCard\n key={service.key}\n service={service}\n accessMode={accessMode}\n />\n ))}\n </div>\n </section>\n )}\n\n {connected.length > 0 && (\n <section>\n <div className=\"mb-3 mt-2 flex items-baseline justify-between\">\n <h2 className=\"text-sm font-medium text-foreground\">Connected</h2>\n <span className=\"text-xs text-muted-foreground\">\n {connected.length}\n </span>\n </div>\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {connected.map((service) => (\n <ConnectorCard\n key={service.key}\n service={service}\n accessMode={accessMode}\n />\n ))}\n </div>\n </section>\n )}\n\n {apps.length > 0 && (\n <Collapsible className=\"mt-6 rounded-2xl bg-card\">\n <CollapsibleTrigger className=\"group flex w-full items-center justify-between px-4 py-3 text-sm\">\n <span className=\"flex items-center gap-2 text-muted-foreground\">\n <IconPlugConnected size={14} />\n Per-app status\n </span>\n <IconChevronRight\n size={14}\n className=\"text-muted-foreground transition group-data-[state=open]:rotate-90\"\n />\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"border-t\">\n {apps.map((app) => (\n <PerAppDetailRow key={app.appId} app={app} />\n ))}\n </div>\n <div className=\"flex items-center justify-end gap-1.5 border-t px-4 py-2.5 text-xs text-muted-foreground\">\n <IconLink size={12} />\n <a href=\"/vault\" className=\"hover:underline\">\n Open vault for advanced sharing\n </a>\n </div>\n </CollapsibleContent>\n </Collapsible>\n )}\n </DispatchShell>\n );\n}\n"]}
1
+ {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/routes/pages/integrations.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EACL,OAAO,EACP,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MAAM,GACZ,IACH,EACN,cAAK,SAAS,EAAC,0CAA0C,YACtD,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC1B,KAAC,aAAa,IAEZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,IAFjB,OAAO,CAAC,GAAG,CAGhB,CACH,CAAC,GACE,IACE,CACX,EAEA,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAClB,MAAC,WAAW,IAAC,SAAS,EAAC,0BAA0B,aAC/C,MAAC,kBAAkB,IAAC,SAAS,EAAC,kEAAkE,aAC9F,gBAAM,SAAS,EAAC,+CAA+C,aAC7D,KAAC,iBAAiB,IAAC,IAAI,EAAE,EAAE,GAAI,sBAE1B,EACP,KAAC,gBAAgB,IACf,IAAI,EAAE,EAAE,EACR,SAAS,EAAC,oEAAoE,GAC9E,IACiB,EACrB,MAAC,kBAAkB,eACjB,cAAK,SAAS,EAAC,UAAU,YACtB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,KAAC,eAAe,IAAiB,GAAG,EAAE,GAAG,IAAnB,GAAG,CAAC,KAAK,CAAc,CAC9C,CAAC,GACE,EACN,eAAK,SAAS,EAAC,0FAA0F,aACvG,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,EACtB,KAAC,IAAI,IAAC,EAAE,EAAC,cAAc,EAAC,SAAS,EAAC,iBAAiB,gDAE5C,IACH,IACa,IACT,CACf,IACa,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport {\n IconCheck,\n IconChevronRight,\n IconCircleDashed,\n IconKey,\n IconLink,\n IconPlugConnected,\n} from \"@tabler/icons-react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useMemo, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { toast } from \"sonner\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../components/ui/collapsible\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../../components/ui/dialog\";\nimport { Input } from \"../../components/ui/input\";\nimport { Label } from \"../../components/ui/label\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../../components/ui/tooltip\";\n\nexport function meta() {\n return [{ title: \"Connections — Dispatch\" }];\n}\n\ninterface AppRef {\n appId: string;\n appName: string;\n color: string;\n configured: boolean;\n vaultGranted: boolean;\n vaultSecretId?: string;\n}\n\ninterface Service {\n /** Credential key shared across apps (e.g. `OPENAI_API_KEY`). */\n key: string;\n /** Human label from the first app that declares it (`\"OpenAI\"`, `\"Stripe\"`). */\n label: string;\n /** Apps in the workspace that declare this credential. */\n apps: AppRef[];\n}\n\ninterface CatalogApp {\n appId: string;\n appName: string;\n color: string;\n url: string;\n reachable: boolean;\n integrations?: Array<{\n key: string;\n label: string;\n required: boolean;\n configured: boolean;\n vaultGranted: boolean;\n vaultSecretId?: string;\n }>;\n}\n\nfunction inferProviderFromKey(key: string, label: string): string {\n const haystack = `${key} ${label}`.toLowerCase();\n for (const provider of [\n \"google\",\n \"slack\",\n \"sendgrid\",\n \"github\",\n \"stripe\",\n \"hubspot\",\n \"jira\",\n \"bigquery\",\n \"anthropic\",\n \"openai\",\n ]) {\n if (haystack.includes(provider)) return provider;\n }\n return \"other\";\n}\n\nfunction ConnectDialog({\n service,\n open,\n onOpenChange,\n accessMode,\n}: {\n service: Service;\n open: boolean;\n onOpenChange: (next: boolean) => void;\n accessMode: \"all-apps\" | \"manual\";\n}) {\n const [value, setValue] = useState(\"\");\n const qc = useQueryClient();\n\n const createSecret = useActionMutation(\"create-vault-secret\", {});\n const createGrant = useActionMutation(\"create-vault-grant\", {});\n const syncToApp = useActionMutation(\"sync-vault-to-app\", {});\n\n function reset() {\n setValue(\"\");\n }\n\n async function handleSave() {\n const trimmed = value.trim();\n if (!trimmed) {\n toast.error(\"Enter a value to save\");\n return;\n }\n try {\n // 1. Create the secret (or get the existing one — server treats key as\n // the unique identifier). The server returns { secret: { id, ... } }.\n const created = await createSecret.mutateAsync({\n credentialKey: service.key,\n name: service.label,\n value: trimmed,\n provider: inferProviderFromKey(service.key, service.label),\n });\n const secretId =\n (created as { secret?: { id?: string } })?.secret?.id ??\n (created as { id?: string })?.id;\n if (!secretId) {\n throw new Error(\"Secret created but id missing\");\n }\n\n // 2. Manual mode needs grants; all-apps mode only needs sync.\n if (accessMode === \"manual\") {\n const targets = service.apps.filter((a) => !a.vaultGranted);\n for (const app of targets) {\n try {\n await createGrant.mutateAsync({\n secretId,\n appId: app.appId,\n });\n } catch (err) {\n console.warn(`grant to ${app.appId} failed`, err);\n }\n }\n }\n for (const app of service.apps) {\n try {\n await syncToApp.mutateAsync({ appId: app.appId });\n } catch (err) {\n console.warn(`sync to ${app.appId} failed`, err);\n }\n }\n\n qc.invalidateQueries({\n queryKey: [\"action\", \"list-integrations-catalog\"],\n });\n toast.success(`Connected ${service.label}`);\n onOpenChange(false);\n reset();\n } catch (err: any) {\n toast.error(err?.message ?? \"Failed to save credential\");\n }\n }\n\n const pending =\n createSecret.isPending || createGrant.isPending || syncToApp.isPending;\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next) reset();\n onOpenChange(next);\n }}\n >\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Connect {service.label}</DialogTitle>\n <DialogDescription>\n Used by{\" \"}\n {service.apps.length === 1\n ? service.apps[0].appName\n : `${service.apps.length} apps`}\n . Saved to the workspace vault and synced to every app that needs\n it.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-3\">\n <div>\n <Label className=\"text-xs text-muted-foreground\">Key</Label>\n <div className=\"font-mono text-sm\">{service.key}</div>\n </div>\n <div>\n <Label htmlFor=\"connector-value\">Value</Label>\n <Input\n id=\"connector-value\"\n type=\"password\"\n autoComplete=\"off\"\n value={value}\n onChange={(e) => setValue(e.target.value)}\n placeholder={`Paste your ${service.label} key…`}\n autoFocus\n />\n </div>\n </div>\n <DialogFooter>\n <Button\n variant=\"outline\"\n onClick={() => onOpenChange(false)}\n disabled={pending}\n >\n Cancel\n </Button>\n <Button onClick={handleSave} disabled={pending || !value.trim()}>\n {pending ? \"Saving…\" : \"Connect\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction ConnectorCard({\n service,\n accessMode,\n}: {\n service: Service;\n accessMode: \"all-apps\" | \"manual\";\n}) {\n const [open, setOpen] = useState(false);\n const isConnected = service.apps.some((a) => a.configured);\n const appCount = service.apps.length;\n\n return (\n <>\n <button\n type=\"button\"\n onClick={() => setOpen(true)}\n className=\"group flex flex-col items-start gap-2 rounded-2xl bg-card p-5 text-left transition-[background-color] hover:bg-card/80 cursor-pointer\"\n >\n <div className=\"flex w-full items-start justify-between gap-2\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-xl bg-muted\">\n <IconKey size={16} className=\"text-muted-foreground\" />\n </div>\n {isConnected ? (\n <Badge\n variant=\"secondary\"\n className=\"bg-green-500/10 text-green-700 dark:text-green-400 gap-1\"\n >\n <IconCheck size={12} />\n Connected\n </Badge>\n ) : (\n <Badge\n variant=\"secondary\"\n className=\"bg-amber-500/10 text-amber-700 dark:text-amber-400 gap-1\"\n >\n <IconCircleDashed size={12} />\n Connect\n </Badge>\n )}\n </div>\n <div className=\"w-full min-w-0\">\n <Tooltip>\n <TooltipTrigger asChild>\n <div className=\"text-sm font-semibold text-foreground truncate\">\n {service.label}\n </div>\n </TooltipTrigger>\n <TooltipContent>{service.label}</TooltipContent>\n </Tooltip>\n <div className=\"font-mono text-xs text-muted-foreground/80 truncate\">\n {service.key}\n </div>\n </div>\n <div className=\"text-xs text-muted-foreground\">\n Used by {appCount} {appCount === 1 ? \"app\" : \"apps\"}\n </div>\n </button>\n <ConnectDialog\n service={service}\n open={open}\n onOpenChange={setOpen}\n accessMode={accessMode}\n />\n </>\n );\n}\n\nfunction PerAppDetailRow({ app }: { app: CatalogApp }) {\n const total = (app.integrations ?? []).length;\n const ok = (app.integrations ?? []).filter((i) => i.configured).length;\n return (\n <div className=\"flex items-center justify-between border-t px-4 py-2.5 first:border-t-0\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <div\n className=\"h-5 w-5 rounded text-[10px] font-bold text-white flex items-center justify-center shrink-0\"\n style={{ backgroundColor: app.color }}\n >\n {app.appName.charAt(0).toUpperCase()}\n </div>\n <span className=\"text-sm truncate\">{app.appName}</span>\n {!app.reachable && (\n <span className=\"text-xs text-muted-foreground\">offline</span>\n )}\n </div>\n <span className=\"text-xs text-muted-foreground\">\n {total === 0 ? \"no integrations\" : `${ok}/${total}`}\n </span>\n </div>\n );\n}\n\nexport default function ConnectionsRoute() {\n const catalogQuery = useActionQuery(\"list-integrations-catalog\", {});\n const accessQuery = useActionQuery(\"get-vault-access-settings\", {});\n const { data: catalog, isLoading } = catalogQuery;\n const { data: accessSettings } = accessQuery;\n const apps = (catalog as CatalogApp[]) || [];\n const accessMode =\n (accessSettings as any)?.mode === \"manual\" ? \"manual\" : \"all-apps\";\n\n const services = useMemo<Service[]>(() => {\n const map = new Map<string, Service>();\n for (const app of apps) {\n for (const intg of app.integrations ?? []) {\n if (!map.has(intg.key)) {\n map.set(intg.key, {\n key: intg.key,\n label: intg.label,\n apps: [],\n });\n }\n map.get(intg.key)!.apps.push({\n appId: app.appId,\n appName: app.appName,\n color: app.color,\n configured: intg.configured,\n vaultGranted: intg.vaultGranted,\n vaultSecretId: intg.vaultSecretId,\n });\n }\n }\n return Array.from(map.values()).sort((a, b) =>\n a.label.localeCompare(b.label),\n );\n }, [apps]);\n\n const available = services.filter((s) => !s.apps.some((a) => a.configured));\n const connected = services.filter((s) => s.apps.some((a) => a.configured));\n\n return (\n <DispatchShell\n title=\"Connections\"\n description=\"Connect services once. Apps that need them pick up the key automatically.\"\n >\n {catalogQuery.isError || accessQuery.isError ? (\n <ActionQueryError\n error={catalogQuery.error ?? accessQuery.error}\n onRetry={() => {\n void catalogQuery.refetch();\n void accessQuery.refetch();\n }}\n />\n ) : null}\n\n {!catalogQuery.isError && isLoading && services.length === 0 && (\n <div className=\"rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground\">\n Discovering apps and credentials…\n </div>\n )}\n\n {!catalogQuery.isError && !isLoading && services.length === 0 && (\n <div className=\"rounded-2xl border border-dashed px-6 py-12 text-center text-sm text-muted-foreground\">\n No apps with declared integrations are reachable yet.\n </div>\n )}\n\n {available.length > 0 && (\n <section>\n <div className=\"mb-3 flex items-baseline justify-between\">\n <h2 className=\"text-sm font-medium text-foreground\">\n Available to connect\n </h2>\n <span className=\"text-xs text-muted-foreground\">\n {available.length}\n </span>\n </div>\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {available.map((service) => (\n <ConnectorCard\n key={service.key}\n service={service}\n accessMode={accessMode}\n />\n ))}\n </div>\n </section>\n )}\n\n {connected.length > 0 && (\n <section>\n <div className=\"mb-3 mt-2 flex items-baseline justify-between\">\n <h2 className=\"text-sm font-medium text-foreground\">Connected</h2>\n <span className=\"text-xs text-muted-foreground\">\n {connected.length}\n </span>\n </div>\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {connected.map((service) => (\n <ConnectorCard\n key={service.key}\n service={service}\n accessMode={accessMode}\n />\n ))}\n </div>\n </section>\n )}\n\n {apps.length > 0 && (\n <Collapsible className=\"mt-6 rounded-2xl bg-card\">\n <CollapsibleTrigger className=\"group flex w-full items-center justify-between px-4 py-3 text-sm\">\n <span className=\"flex items-center gap-2 text-muted-foreground\">\n <IconPlugConnected size={14} />\n Per-app status\n </span>\n <IconChevronRight\n size={14}\n className=\"text-muted-foreground transition group-data-[state=open]:rotate-90\"\n />\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"border-t\">\n {apps.map((app) => (\n <PerAppDetailRow key={app.appId} app={app} />\n ))}\n </div>\n <div className=\"flex items-center justify-end gap-1.5 border-t px-4 py-2.5 text-xs text-muted-foreground\">\n <IconLink size={12} />\n <Link to=\"/admin/vault\" className=\"hover:underline\">\n Open vault for advanced sharing\n </Link>\n </div>\n </CollapsibleContent>\n </Collapsible>\n )}\n </DispatchShell>\n );\n}\n"]}
@@ -13,17 +13,17 @@ function OperationsShortcuts() {
13
13
  const t = useT();
14
14
  const tools = [
15
15
  {
16
- to: "/thread-debug",
16
+ to: "/admin/thread-debug",
17
17
  icon: IconMessages,
18
18
  title: t("dispatch.nav.threadDebug", { defaultValue: "Thread debug" }),
19
19
  },
20
20
  {
21
- to: "/audit",
21
+ to: "/admin/audit",
22
22
  icon: IconHistory,
23
23
  title: t("dispatch.nav.audit"),
24
24
  },
25
25
  {
26
- to: "/destinations",
26
+ to: "/admin/destinations",
27
27
  icon: IconSend,
28
28
  title: t("dispatch.pages.deliveryQueue"),
29
29
  },
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/routes/pages/operations.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,GACZ,MAAM,0BAA0B,CAAC;AAIlC,S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CAAC,CAAC,yBAAyB,CAAC,IACjB,IACL,EAEX,MAAC,WAAW,IAAC,KAAK,EAAC,YAAY,EAAC,SAAS,EAAC,cAAc,aACtD,KAAC,sBAAsB,KAAG,EAC1B,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,mBAAmB,KAAG,GACnB,IACM,EAEd,KAAC,WAAW,IAAC,KAAK,EAAC,UAAU,EAAC,SAAS,EAAC,cAAc,YACpD,cAAK,SAAS,EAAC,+DAA+D,YAC5E,KAAC,WAAW,IAAC,KAAK,EAAE,CAAC,CAAC,yBAAyB,CAAC,GAAI,GAChD,GACM,IACT,GACO,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { DbAdminPage } from \"@agent-native/core/client/db-admin\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { ObservabilityDashboard } from \"@agent-native/core/client/observability\";\nimport {\n IconActivity,\n IconArrowUpRight,\n IconDatabase,\n IconHistory,\n IconMessages,\n IconSend,\n} from \"@tabler/icons-react\";\nimport { Link, useSearchParams } from \"react-router\";\n\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport {\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n} from \"../../components/ui/tabs\";\n\ntype OperationsView = \"monitoring\" | \"database\";\n\nfunction selectedView(value: string | null): OperationsView {\n return value === \"database\" ? \"database\" : \"monitoring\";\n}\n\nfunction OperationsShortcuts() {\n const t = useT();\n\n const tools = [\n {\n to: \"/thread-debug\",\n icon: IconMessages,\n title: t(\"dispatch.nav.threadDebug\", { defaultValue: \"Thread debug\" }),\n },\n {\n to: \"/audit\",\n icon: IconHistory,\n title: t(\"dispatch.nav.audit\"),\n },\n {\n to: \"/destinations\",\n icon: IconSend,\n title: t(\"dispatch.pages.deliveryQueue\"),\n },\n ];\n\n return (\n <section className=\"border-t pt-5\">\n <h2 className=\"text-sm font-semibold text-foreground\">\n {t(\"dispatch.nav.advanced\", { defaultValue: \"Related tools\" })}\n </h2>\n <div className=\"mt-2 grid gap-x-6 gap-y-1 lg:grid-cols-3\">\n {tools.map(({ to, icon: Icon, title }) => (\n <Link\n key={to}\n to={to}\n className=\"group flex min-w-0 items-start gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-muted\"\n >\n <Icon\n size={16}\n className=\"mt-0.5 shrink-0 text-muted-foreground transition-colors group-hover:text-foreground\"\n />\n <span className=\"min-w-0\">\n <span className=\"flex items-center gap-1 font-medium text-foreground\">\n <span className=\"truncate\">{title}</span>\n <IconArrowUpRight\n size={13}\n className=\"shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100\"\n />\n </span>\n </span>\n </Link>\n ))}\n </div>\n </section>\n );\n}\n\nexport function meta() {\n return [{ title: \"Operations — Dispatch\" }];\n}\n\nexport default function OperationsRoute() {\n const t = useT();\n const [searchParams, setSearchParams] = useSearchParams();\n const view = selectedView(searchParams.get(\"view\"));\n\n function setView(nextView: OperationsView) {\n const next = new URLSearchParams(searchParams);\n if (nextView === \"monitoring\") next.delete(\"view\");\n else next.set(\"view\", nextView);\n setSearchParams(next, { replace: true });\n }\n\n return (\n <DispatchShell title={t(\"dispatch.nav.operations\")}>\n <Tabs\n value={view}\n onValueChange={(value) => {\n if (value === \"monitoring\" || value === \"database\") setView(value);\n }}\n className=\"flex min-w-0 flex-col gap-5\"\n >\n <TabsList className=\"w-fit\">\n <TabsTrigger value=\"monitoring\">\n <IconActivity size={15} />\n {t(\"dispatch.pages.monitoring\")}\n </TabsTrigger>\n <TabsTrigger value=\"database\">\n <IconDatabase size={15} />\n {t(\"dispatch.pages.database\")}\n </TabsTrigger>\n </TabsList>\n\n <TabsContent value=\"monitoring\" className=\"mt-0 min-w-0\">\n <ObservabilityDashboard />\n <div className=\"mt-8\">\n <OperationsShortcuts />\n </div>\n </TabsContent>\n\n <TabsContent value=\"database\" className=\"mt-0 min-w-0\">\n <div className=\"min-h-[620px] overflow-hidden rounded-lg border bg-background\">\n <DbAdminPage title={t(\"dispatch.pages.database\")} />\n </div>\n </TabsContent>\n </Tabs>\n </DispatchShell>\n );\n}\n"]}
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/routes/pages/operations.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,GACZ,MAAM,0BAA0B,CAAC;AAIlC,SAAS,YAAY,CAAC,KAAoB;IACxC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC;AAC1D,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IAEjB,MAAM,KAAK,GAAG;QACZ;YACE,EAAE,EAAE,qBAAqB;YACzB,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,CAAC,CAAC,0BAA0B,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;SACvE;QACD;YACE,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,CAAC,CAAC,oBAAoB,CAAC;SAC/B;QACD;YACE,EAAE,EAAE,qBAAqB;YACzB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,CAAC,CAAC,8BAA8B,CAAC;SACzC;KACF,CAAC;IAEF,OAAO,CACL,mBAAS,SAAS,EAAC,eAAe,aAChC,aAAI,SAAS,EAAC,uCAAuC,YA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I,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,CAAC,CAAC,yBAAyB,CAAC,YAChD,MAAC,IAAI,IACH,KAAK,EAAE,IAAI,EACX,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;gBACvB,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,UAAU;oBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;YACrE,CAAC,EACD,SAAS,EAAC,6BAA6B,aAEvC,MAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,aACzB,MAAC,WAAW,IAAC,KAAK,EAAC,YAAY,aAC7B,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,EACzB,CAAC,CAAC,2BAA2B,CAAC,IACnB,EACd,MAAC,WAAW,IAAC,KAAK,EAAC,UAAU,aAC3B,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,EACzB,CAAC,CAAC,yBAAyB,CAAC,IACjB,IACL,EAEX,MAAC,WAAW,IAAC,KAAK,EAAC,YAAY,EAAC,SAAS,EAAC,cAAc,aACtD,KAAC,sBAAsB,KAAG,EAC1B,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,mBAAmB,KAAG,GACnB,IACM,EAEd,KAAC,WAAW,IAAC,KAAK,EAAC,UAAU,EAAC,SAAS,EAAC,cAAc,YACpD,cAAK,SAAS,EAAC,+DAA+D,YAC5E,KAAC,WAAW,IAAC,KAAK,EAAE,CAAC,CAAC,yBAAyB,CAAC,GAAI,GAChD,GACM,IACT,GACO,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { DbAdminPage } from \"@agent-native/core/client/db-admin\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { ObservabilityDashboard } from \"@agent-native/core/client/observability\";\nimport {\n IconActivity,\n IconArrowUpRight,\n IconDatabase,\n IconHistory,\n IconMessages,\n IconSend,\n} from \"@tabler/icons-react\";\nimport { Link, useSearchParams } from \"react-router\";\n\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport {\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n} from \"../../components/ui/tabs\";\n\ntype OperationsView = \"monitoring\" | \"database\";\n\nfunction selectedView(value: string | null): OperationsView {\n return value === \"database\" ? \"database\" : \"monitoring\";\n}\n\nfunction OperationsShortcuts() {\n const t = useT();\n\n const tools = [\n {\n to: \"/admin/thread-debug\",\n icon: IconMessages,\n title: t(\"dispatch.nav.threadDebug\", { defaultValue: \"Thread debug\" }),\n },\n {\n to: \"/admin/audit\",\n icon: IconHistory,\n title: t(\"dispatch.nav.audit\"),\n },\n {\n to: \"/admin/destinations\",\n icon: IconSend,\n title: t(\"dispatch.pages.deliveryQueue\"),\n },\n ];\n\n return (\n <section className=\"border-t pt-5\">\n <h2 className=\"text-sm font-semibold text-foreground\">\n {t(\"dispatch.nav.advanced\", { defaultValue: \"Related tools\" })}\n </h2>\n <div className=\"mt-2 grid gap-x-6 gap-y-1 lg:grid-cols-3\">\n {tools.map(({ to, icon: Icon, title }) => (\n <Link\n key={to}\n to={to}\n className=\"group flex min-w-0 items-start gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-muted\"\n >\n <Icon\n size={16}\n className=\"mt-0.5 shrink-0 text-muted-foreground transition-colors group-hover:text-foreground\"\n />\n <span className=\"min-w-0\">\n <span className=\"flex items-center gap-1 font-medium text-foreground\">\n <span className=\"truncate\">{title}</span>\n <IconArrowUpRight\n size={13}\n className=\"shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100\"\n />\n </span>\n </span>\n </Link>\n ))}\n </div>\n </section>\n );\n}\n\nexport function meta() {\n return [{ title: \"Operations — Dispatch\" }];\n}\n\nexport default function OperationsRoute() {\n const t = useT();\n const [searchParams, setSearchParams] = useSearchParams();\n const view = selectedView(searchParams.get(\"view\"));\n\n function setView(nextView: OperationsView) {\n const next = new URLSearchParams(searchParams);\n if (nextView === \"monitoring\") next.delete(\"view\");\n else next.set(\"view\", nextView);\n setSearchParams(next, { replace: true });\n }\n\n return (\n <DispatchShell title={t(\"dispatch.nav.operations\")}>\n <Tabs\n value={view}\n onValueChange={(value) => {\n if (value === \"monitoring\" || value === \"database\") setView(value);\n }}\n className=\"flex min-w-0 flex-col gap-5\"\n >\n <TabsList className=\"w-fit\">\n <TabsTrigger value=\"monitoring\">\n <IconActivity size={15} />\n {t(\"dispatch.pages.monitoring\")}\n </TabsTrigger>\n <TabsTrigger value=\"database\">\n <IconDatabase size={15} />\n {t(\"dispatch.pages.database\")}\n </TabsTrigger>\n </TabsList>\n\n <TabsContent value=\"monitoring\" className=\"mt-0 min-w-0\">\n <ObservabilityDashboard />\n <div className=\"mt-8\">\n <OperationsShortcuts />\n </div>\n </TabsContent>\n\n <TabsContent value=\"database\" className=\"mt-0 min-w-0\">\n <div className=\"min-h-[620px] overflow-hidden rounded-lg border bg-background\">\n <DbAdminPage title={t(\"dispatch.pages.database\")} />\n </div>\n </TabsContent>\n </Tabs>\n </DispatchShell>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/settings.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,oDA+FpC"}
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/settings.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,oDAmGpC"}
@@ -15,6 +15,6 @@ export function meta() {
15
15
  export default function SettingsRoute() {
16
16
  const t = useT();
17
17
  const agentSettingsTabs = useAgentSettingsTabs();
18
- return (_jsx(DispatchShell, { title: t("settings.title"), description: t("settings.description"), children: _jsx(SettingsTabsPage, { extraTabs: agentSettingsTabs, general: _jsxs("div", { className: "mx-auto w-full max-w-3xl space-y-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: t("settings.languageTitle") }), _jsx(CardDescription, { children: t("settings.languageDescription") })] }), _jsxs(CardContent, { className: "max-w-xs space-y-1.5", children: [_jsx(Label, { children: t("settings.languageLabel") }), _jsx(LanguagePicker, { label: t("settings.languageLabel") })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: t("settings.workspaceTitle") }), _jsx(CardDescription, { children: t("settings.workspaceDescription") })] }), _jsx(CardContent, { children: _jsx(Button, { variant: "outline", asChild: true, children: _jsx(Link, { to: "/workspace", children: t("settings.openResourceSettings") }) }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: t("settings.automationsTitle") }), _jsx(CardDescription, { children: t("settings.automationsDescription") })] }), _jsx(CardContent, { children: _jsx(Button, { variant: "outline", asChild: true, children: _jsx(Link, { to: "/automations", children: t("settings.openAutomations") }) }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: t("settings.deliveryTitle") }), _jsx(CardDescription, { children: t("settings.deliveryDescription") })] }), _jsx(CardContent, { children: _jsx(Button, { variant: "outline", asChild: true, children: _jsx(Link, { to: "/destinations", children: t("settings.openDelivery") }) }) })] })] }), team: _jsx("div", { className: "mx-auto w-full max-w-3xl", children: _jsx(TeamPage, { showTitle: false, createOrgDescription: "Set up a team to share dispatch destinations and approvals with your colleagues." }) }), whatsNew: _jsx("div", { className: "mx-auto w-full max-w-3xl", children: _jsx(ChangelogSettingsCard, { markdown: changelog }) }) }) }));
18
+ return (_jsx(DispatchShell, { title: t("settings.title"), description: t("settings.description"), children: _jsx(SettingsTabsPage, { extraTabs: agentSettingsTabs, general: _jsxs("div", { className: "mx-auto w-full max-w-3xl space-y-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: t("settings.languageTitle") }), _jsx(CardDescription, { children: t("settings.languageDescription") })] }), _jsxs(CardContent, { className: "max-w-xs space-y-1.5", children: [_jsx(Label, { children: t("settings.languageLabel") }), _jsx(LanguagePicker, { label: t("settings.languageLabel") })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: t("settings.workspaceTitle") }), _jsx(CardDescription, { children: t("settings.workspaceDescription") })] }), _jsx(CardContent, { children: _jsx(Button, { variant: "outline", asChild: true, children: _jsx(Link, { to: "/admin/workspace", children: t("settings.openResourceSettings") }) }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: t("settings.automationsTitle") }), _jsx(CardDescription, { children: t("settings.automationsDescription") })] }), _jsx(CardContent, { children: _jsx(Button, { variant: "outline", asChild: true, children: _jsx(Link, { to: "/admin/automations", children: t("settings.openAutomations") }) }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: t("settings.deliveryTitle") }), _jsx(CardDescription, { children: t("settings.deliveryDescription") })] }), _jsx(CardContent, { children: _jsx(Button, { variant: "outline", asChild: true, children: _jsx(Link, { to: "/admin/destinations", children: t("settings.openDelivery") }) }) })] })] }), team: _jsx("div", { className: "mx-auto w-full max-w-3xl", children: _jsx(TeamPage, { showTitle: false, createOrgDescription: "Set up a team to share dispatch destinations and approvals with your colleagues." }) }), whatsNew: _jsx("div", { className: "mx-auto w-full max-w-3xl", children: _jsx(ChangelogSettingsCard, { markdown: changelog }) }) }) }));
19
19
  }
20
20
  //# sourceMappingURL=settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/routes/pages/settings.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAC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C;AACJ,CAAC","sourcesContent":["import { ChangelogSettingsCard } from \"@agent-native/core/client/changelog\";\nimport { LanguagePicker, useT } from \"@agent-native/core/client/i18n\";\nimport { TeamPage } from \"@agent-native/core/client/org\";\nimport {\n SettingsTabsPage,\n useAgentSettingsTabs,\n} from \"@agent-native/core/client/settings\";\nimport { Link } from \"react-router\";\n\nimport changelog from \"../../../CHANGELOG.md?raw\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/ui/card\";\nimport { Label } from \"../../components/ui/label\";\n\nexport function meta() {\n return [{ title: \"Settings - Dispatch\" }];\n}\n\nexport default function SettingsRoute() {\n const t = useT();\n const agentSettingsTabs = useAgentSettingsTabs();\n\n return (\n <DispatchShell\n title={t(\"settings.title\")}\n description={t(\"settings.description\")}\n >\n <SettingsTabsPage\n extraTabs={agentSettingsTabs}\n general={\n <div className=\"mx-auto w-full max-w-3xl space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n {t(\"settings.languageTitle\")}\n </CardTitle>\n <CardDescription>\n {t(\"settings.languageDescription\")}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"max-w-xs space-y-1.5\">\n <Label>{t(\"settings.languageLabel\")}</Label>\n <LanguagePicker label={t(\"settings.languageLabel\")} />\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n {t(\"settings.workspaceTitle\")}\n </CardTitle>\n <CardDescription>\n {t(\"settings.workspaceDescription\")}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <Button variant=\"outline\" asChild>\n <Link to=\"/workspace\">\n {t(\"settings.openResourceSettings\")}\n </Link>\n </Button>\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n {t(\"settings.automationsTitle\")}\n </CardTitle>\n <CardDescription>\n {t(\"settings.automationsDescription\")}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <Button variant=\"outline\" asChild>\n <Link to=\"/automations\">{t(\"settings.openAutomations\")}</Link>\n </Button>\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n {t(\"settings.deliveryTitle\")}\n </CardTitle>\n <CardDescription>\n {t(\"settings.deliveryDescription\")}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <Button variant=\"outline\" asChild>\n <Link to=\"/destinations\">{t(\"settings.openDelivery\")}</Link>\n </Button>\n </CardContent>\n </Card>\n </div>\n }\n team={\n <div className=\"mx-auto w-full max-w-3xl\">\n <TeamPage\n showTitle={false}\n createOrgDescription=\"Set up a team to share dispatch destinations and approvals with your colleagues.\"\n />\n </div>\n }\n whatsNew={\n <div className=\"mx-auto w-full max-w-3xl\">\n <ChangelogSettingsCard markdown={changelog} />\n </div>\n }\n />\n </DispatchShell>\n );\n}\n"]}
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/routes/pages/settings.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,SAAS,GACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,MAAM,UA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AC,GACrB,EACZ,KAAC,eAAe,cACb,CAAC,CAAC,iCAAiC,CAAC,GACrB,IACP,EACb,KAAC,WAAW,cACV,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,kBAC/B,KAAC,IAAI,IAAC,EAAE,EAAC,oBAAoB,YAC1B,CAAC,CAAC,0BAA0B,CAAC,GACzB,GACA,GACG,IACT,EAEP,MAAC,IAAI,eACH,MAAC,UAAU,eACT,KAAC,SAAS,IAAC,SAAS,EAAC,WAAW,YAC7B,CAAC,CAAC,wBAAwB,CAAC,GAClB,EACZ,KAAC,eAAe,cACb,CAAC,CAAC,8BAA8B,CAAC,GAClB,IACP,EACb,KAAC,WAAW,cACV,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,kBAC/B,KAAC,IAAI,IAAC,EAAE,EAAC,qBAAqB,YAC3B,CAAC,CAAC,uBAAuB,CAAC,GACtB,GACA,GACG,IACT,IACH,EAER,IAAI,EACF,cAAK,SAAS,EAAC,0BAA0B,YACvC,KAAC,QAAQ,IACP,SAAS,EAAE,KAAK,EAChB,oBAAoB,EAAC,kFAAkF,GACvG,GACE,EAER,QAAQ,EACN,cAAK,SAAS,EAAC,0BAA0B,YACvC,KAAC,qBAAqB,IAAC,QAAQ,EAAE,SAAS,GAAI,GAC1C,GAER,GACY,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { ChangelogSettingsCard } from \"@agent-native/core/client/changelog\";\nimport { LanguagePicker, useT } from \"@agent-native/core/client/i18n\";\nimport { TeamPage } from \"@agent-native/core/client/org\";\nimport {\n SettingsTabsPage,\n useAgentSettingsTabs,\n} from \"@agent-native/core/client/settings\";\nimport { Link } from \"react-router\";\n\nimport changelog from \"../../../CHANGELOG.md?raw\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/ui/card\";\nimport { Label } from \"../../components/ui/label\";\n\nexport function meta() {\n return [{ title: \"Settings - Dispatch\" }];\n}\n\nexport default function SettingsRoute() {\n const t = useT();\n const agentSettingsTabs = useAgentSettingsTabs();\n\n return (\n <DispatchShell\n title={t(\"settings.title\")}\n description={t(\"settings.description\")}\n >\n <SettingsTabsPage\n extraTabs={agentSettingsTabs}\n general={\n <div className=\"mx-auto w-full max-w-3xl space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n {t(\"settings.languageTitle\")}\n </CardTitle>\n <CardDescription>\n {t(\"settings.languageDescription\")}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"max-w-xs space-y-1.5\">\n <Label>{t(\"settings.languageLabel\")}</Label>\n <LanguagePicker label={t(\"settings.languageLabel\")} />\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n {t(\"settings.workspaceTitle\")}\n </CardTitle>\n <CardDescription>\n {t(\"settings.workspaceDescription\")}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <Button variant=\"outline\" asChild>\n <Link to=\"/admin/workspace\">\n {t(\"settings.openResourceSettings\")}\n </Link>\n </Button>\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n {t(\"settings.automationsTitle\")}\n </CardTitle>\n <CardDescription>\n {t(\"settings.automationsDescription\")}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <Button variant=\"outline\" asChild>\n <Link to=\"/admin/automations\">\n {t(\"settings.openAutomations\")}\n </Link>\n </Button>\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n {t(\"settings.deliveryTitle\")}\n </CardTitle>\n <CardDescription>\n {t(\"settings.deliveryDescription\")}\n </CardDescription>\n </CardHeader>\n <CardContent>\n <Button variant=\"outline\" asChild>\n <Link to=\"/admin/destinations\">\n {t(\"settings.openDelivery\")}\n </Link>\n </Button>\n </CardContent>\n </Card>\n </div>\n }\n team={\n <div className=\"mx-auto w-full max-w-3xl\">\n <TeamPage\n showTitle={false}\n createOrgDescription=\"Set up a team to share dispatch destinations and approvals with your colleagues.\"\n />\n </div>\n }\n whatsNew={\n <div className=\"mx-auto w-full max-w-3xl\">\n <ChangelogSettingsCard markdown={changelog} />\n </div>\n }\n />\n </DispatchShell>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"transactional-email.$appId.$id.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/transactional-email.$appId.$id.tsx"],"names":[],"mappings":"AAiCA,wBAAgB,IAAI;;IAEnB;AAwHD,MAAM,CAAC,OAAO,UAAU,6BAA6B,oDA8MpD"}
1
+ {"version":3,"file":"transactional-email.$appId.$id.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/transactional-email.$appId.$id.tsx"],"names":[],"mappings":"AAiCA,wBAAgB,IAAI;;IAEnB;AAwHD,MAAM,CAAC,OAAO,UAAU,6BAA6B,oDAqNpD"}
@@ -4,7 +4,7 @@ import { useT } from "@agent-native/core/client/i18n";
4
4
  import { IconAlertTriangle, IconArrowLeft } from "@tabler/icons-react";
5
5
  import { useQueries, useQuery } from "@tanstack/react-query";
6
6
  import { useMemo } from "react";
7
- import { Link, useParams } from "react-router";
7
+ import { Link, useLocation, useParams } from "react-router";
8
8
  import { aggregateSharedEmails, callAppAction, fetchAppEmailCatalog, } from "../../client/transactional-emails.js";
9
9
  import { ActionQueryError } from "../../components/action-query-error.js";
10
10
  import { DispatchShell } from "../../components/dispatch-shell.js";
@@ -105,6 +105,7 @@ function useEmailDetail(appId, id) {
105
105
  }
106
106
  export default function TransactionalEmailDetailRoute() {
107
107
  const t = useT();
108
+ const location = useLocation();
108
109
  const params = useParams();
109
110
  const appId = params.appId ?? "";
110
111
  const id = params.id ?? "";
@@ -136,7 +137,9 @@ export default function TransactionalEmailDetailRoute() {
136
137
  detail.appPath.length > 0 &&
137
138
  !engagementUnavailable,
138
139
  });
139
- return (_jsx(DispatchShell, { title: detail.email?.name ?? t("dispatch.transactionalEmail.title"), description: t("dispatch.transactionalEmail.description"), children: _jsxs("div", { className: "max-w-3xl space-y-4", children: [_jsx(Button, { asChild: true, size: "sm", variant: "ghost", className: "-ml-2", children: _jsxs(Link, { to: "/transactional-email", children: [_jsx(IconArrowLeft, { size: 15, className: "mr-1.5" }), t("dispatch.transactionalEmail.title")] }) }), detail.isError ? (_jsx(ActionQueryError, { error: detail.error, onRetry: detail.onRetry })) : detail.isLoading ? (_jsxs("div", { className: "space-y-3", children: [_jsx(Skeleton, { className: "h-6 w-64" }), _jsx(Skeleton, { className: "h-32 w-full" })] })) : detail.notFound || !detail.email ? (_jsxs(Alert, { variant: "destructive", children: [_jsx(IconAlertTriangle, { className: "size-4" }), _jsx(AlertTitle, { children: t("dispatch.transactionalEmail.emailNotFound") }), _jsx(AlertDescription, { children: detail.catalogError ??
140
+ return (_jsx(DispatchShell, { title: detail.email?.name ?? t("dispatch.transactionalEmail.title"), description: t("dispatch.transactionalEmail.description"), children: _jsxs("div", { className: "max-w-3xl space-y-4", children: [_jsx(Button, { asChild: true, size: "sm", variant: "ghost", className: "-ml-2", children: _jsxs(Link, { to: location.pathname.startsWith("/admin/")
141
+ ? "/admin/transactional-email"
142
+ : "/transactional-email", children: [_jsx(IconArrowLeft, { size: 15, className: "mr-1.5" }), t("dispatch.transactionalEmail.title")] }) }), detail.isError ? (_jsx(ActionQueryError, { error: detail.error, onRetry: detail.onRetry })) : detail.isLoading ? (_jsxs("div", { className: "space-y-3", children: [_jsx(Skeleton, { className: "h-6 w-64" }), _jsx(Skeleton, { className: "h-32 w-full" })] })) : detail.notFound || !detail.email ? (_jsxs(Alert, { variant: "destructive", children: [_jsx(IconAlertTriangle, { className: "size-4" }), _jsx(AlertTitle, { children: t("dispatch.transactionalEmail.emailNotFound") }), _jsx(AlertDescription, { children: detail.catalogError ??
140
143
  t("dispatch.transactionalEmail.emailNotFoundDescription") })] })) : (_jsxs(_Fragment, { children: [_jsxs("section", { className: "rounded-2xl bg-card p-5", children: [_jsx("div", { className: "text-lg font-semibold text-foreground", children: detail.email.name }), _jsx("div", { className: "mt-1 font-mono text-xs text-muted-foreground", children: detail.email.id }), _jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: [detail.appName, detail.appPath ? ` · ${detail.appPath}` : ""] }), _jsxs("dl", { className: "mt-4 space-y-3 text-sm", children: [_jsxs("div", { children: [_jsx("dt", { className: "text-xs font-medium text-muted-foreground", children: t("dispatch.transactionalEmail.trigger") }), _jsx("dd", { className: "mt-1 text-foreground", children: detail.email.trigger })] }), _jsxs("div", { children: [_jsx("dt", { className: "text-xs font-medium text-muted-foreground", children: t("dispatch.transactionalEmail.recipient") }), _jsx("dd", { className: "mt-1 text-foreground", children: detail.email.recipient })] }), _jsxs("div", { children: [_jsx("dt", { className: "text-xs font-medium text-muted-foreground", children: t("dispatch.transactionalEmail.sender") }), _jsx("dd", { className: "mt-1 text-foreground", children: detail.email.sender })] })] }), _jsxs("div", { className: "mt-4 flex flex-wrap gap-6 border-t pt-4 text-sm", children: [_jsxs("div", { children: [_jsx("div", { className: "text-xs font-medium text-muted-foreground", children: t("dispatch.transactionalEmail.sends") }), _jsx("div", { className: "mt-1", children: _jsx(SendsCell, { sent: detail.email.sent, failed: detail.email.failed }) })] }), _jsxs("div", { children: [_jsx("div", { className: "text-xs font-medium text-muted-foreground", children: t("dispatch.transactionalEmail.openRate") }), _jsx("div", { className: "mt-1", children: _jsx(OpenRateCell, { engagement: engagement, unavailableReason: engagementUnavailable, loading: engagementQuery.isLoading }) })] }), _jsxs("div", { children: [_jsx("div", { className: "text-xs font-medium text-muted-foreground", children: t("dispatch.transactionalEmail.lastSent") }), _jsx("div", { className: "mt-1", children: _jsx(LastSentCell, { lastSentAt: detail.email.lastSentAt, sent: detail.email.sent }) })] })] })] }), _jsxs("section", { className: "rounded-2xl bg-card p-5", children: [_jsx("h2", { className: "text-sm font-medium text-foreground", children: t("dispatch.transactionalEmail.preview") }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: t("dispatch.transactionalEmail.previewDescription") }), _jsx("div", { className: "mt-4", children: _jsx(EmailPreviewPane, { appId: appId, appPath: detail.appPath, id: detail.email.id, name: detail.email.name }) })] }), _jsxs("section", { className: "rounded-2xl bg-card p-5", children: [_jsx("h2", { className: "text-sm font-medium text-foreground", children: t("dispatch.transactionalEmail.activityLink") }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: t("dispatch.transactionalEmail.retentionNote") }), _jsx("div", { className: "mt-4", children: _jsx(ActivityTable, { result: engagementUnavailable
141
144
  ? { available: false, reason: engagementUnavailable }
142
145
  : activityQuery.data, isLoading: activityQuery.isLoading, isError: activityQuery.isError, error: activityQuery.error, onRetry: () => void activityQuery.refetch() }) })] })] }))] }) }));