@agent-native/dispatch 0.15.18 → 0.15.19
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.
- package/dist/components/agents-panel.js +1 -1
- package/dist/components/agents-panel.js.map +1 -1
- package/dist/components/dispatch-control-plane.d.ts.map +1 -1
- package/dist/components/dispatch-control-plane.js +1 -1
- package/dist/components/dispatch-control-plane.js.map +1 -1
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +11 -7
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/messaging-setup-panel.js +1 -1
- package/dist/components/messaging-setup-panel.js.map +1 -1
- package/dist/components/task-queue-health.js +1 -1
- package/dist/components/task-queue-health.js.map +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/workspace-app-card.js +1 -1
- package/dist/components/workspace-app-card.js.map +1 -1
- package/dist/components/workspace-template-card.js +1 -1
- package/dist/components/workspace-template-card.js.map +1 -1
- package/dist/routes/pages/$appId.js +1 -1
- package/dist/routes/pages/$appId.js.map +1 -1
- package/dist/routes/pages/agents.js +1 -1
- package/dist/routes/pages/agents.js.map +1 -1
- package/dist/routes/pages/approval.js +4 -4
- package/dist/routes/pages/approval.js.map +1 -1
- package/dist/routes/pages/approvals.js +2 -2
- package/dist/routes/pages/approvals.js.map +1 -1
- package/dist/routes/pages/apps.$appId.js +1 -1
- package/dist/routes/pages/apps.$appId.js.map +1 -1
- package/dist/routes/pages/apps.js +3 -3
- package/dist/routes/pages/apps.js.map +1 -1
- package/dist/routes/pages/audit.js +1 -1
- package/dist/routes/pages/audit.js.map +1 -1
- package/dist/routes/pages/automations.js +1 -1
- package/dist/routes/pages/automations.js.map +1 -1
- package/dist/routes/pages/destinations.js +2 -2
- package/dist/routes/pages/destinations.js.map +1 -1
- package/dist/routes/pages/dreams.js +5 -5
- package/dist/routes/pages/dreams.js.map +1 -1
- package/dist/routes/pages/identities.js +1 -1
- package/dist/routes/pages/identities.js.map +1 -1
- package/dist/routes/pages/integrations.js +2 -2
- package/dist/routes/pages/integrations.js.map +1 -1
- package/dist/routes/pages/metrics.js +4 -4
- package/dist/routes/pages/metrics.js.map +1 -1
- package/dist/routes/pages/thread-debug.js +5 -5
- package/dist/routes/pages/thread-debug.js.map +1 -1
- package/dist/routes/pages/vault.js +3 -3
- package/dist/routes/pages/vault.js.map +1 -1
- package/dist/routes/pages/workspace.d.ts.map +1 -1
- package/dist/routes/pages/workspace.js +3 -3
- package/dist/routes/pages/workspace.js.map +1 -1
- package/package.json +3 -3
- package/src/components/agents-panel.tsx +1 -1
- package/src/components/dispatch-control-plane.tsx +1 -4
- package/src/components/layout/Layout.spec.tsx +5 -0
- package/src/components/layout/Layout.tsx +62 -32
- package/src/components/messaging-setup-panel.tsx +1 -1
- package/src/components/task-queue-health.tsx +1 -1
- package/src/components/ui/button.tsx +1 -2
- package/src/components/ui/card.tsx +1 -1
- package/src/components/workspace-app-card.tsx +1 -1
- package/src/components/workspace-template-card.tsx +2 -2
- package/src/routes/pages/$appId.tsx +1 -1
- package/src/routes/pages/agents.tsx +1 -1
- package/src/routes/pages/approval.tsx +4 -4
- package/src/routes/pages/approvals.tsx +2 -2
- package/src/routes/pages/apps.$appId.tsx +1 -1
- package/src/routes/pages/apps.tsx +3 -3
- package/src/routes/pages/audit.tsx +1 -1
- package/src/routes/pages/automations.tsx +1 -1
- package/src/routes/pages/destinations.tsx +2 -2
- package/src/routes/pages/dreams.tsx +5 -5
- package/src/routes/pages/identities.tsx +2 -2
- package/src/routes/pages/integrations.tsx +2 -2
- package/src/routes/pages/metrics.tsx +4 -4
- package/src/routes/pages/thread-debug.tsx +6 -6
- package/src/routes/pages/vault.tsx +3 -3
- package/src/routes/pages/workspace.tsx +3 -6
|
@@ -62,11 +62,11 @@ export default function DestinationsRoute() {
|
|
|
62
62
|
const remove = useActionMutation("delete-destination", {
|
|
63
63
|
onSuccess: () => toast.success(t("dispatch.pages.destinationRemoved")),
|
|
64
64
|
});
|
|
65
|
-
return (_jsx(DispatchShell, { title: t("dispatch.nav.destinations"), description: t("dispatch.pages.destinationsDescription"), children: _jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(TaskQueueHealth, {}), _jsxs("section", { className: "rounded-2xl
|
|
65
|
+
return (_jsx(DispatchShell, { title: t("dispatch.nav.destinations"), description: t("dispatch.pages.destinationsDescription"), children: _jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(TaskQueueHealth, {}), _jsxs("section", { className: "rounded-2xl bg-card p-5", children: [_jsx("h2", { className: "text-lg font-semibold text-foreground", children: t("dispatch.pages.savedDestinations") }), destinationsQuery.isError ? (_jsx(ActionQueryError, { className: "mt-4", error: destinationsQuery.error, onRetry: () => void destinationsQuery.refetch() })) : (_jsxs("div", { className: "mt-4 divide-y", children: [(data || []).map((destination) => (_jsxs("div", { className: "py-4 first:pt-0", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: destination.name }), _jsxs("div", { className: "mt-1 text-xs text-muted-foreground", children: [destination.platform, " \u00B7 ", destination.destination, destination.threadRef
|
|
66
66
|
? ` · thread ${destination.threadRef}`
|
|
67
67
|
: ""] }), destination.notes && (_jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: destination.notes }))] }), _jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", size: "sm", children: t("dispatch.pages.delete") }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: t("dispatch.pages.deleteDestinationTitle") }), _jsx(AlertDialogDescription, { children: t("dispatch.pages.deleteDestinationDescription", {
|
|
68
68
|
name: destination.name,
|
|
69
|
-
}) })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: t("dispatch.pages.cancel") }), _jsx(AlertDialogAction, { onClick: () => remove.mutate({ id: destination.id }), children: t("dispatch.pages.delete") })] })] })] })] }), _jsxs(Collapsible, { className: "mt-3", children: [_jsxs(CollapsibleTrigger, { className: "group flex w-full cursor-pointer items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground", children: [_jsx(IconChevronRight, { className: "h-3.5 w-3.5 transition-transform group-data-[state=open]:rotate-90" }), _jsx("span", { children: "Send a test message" })] }), _jsx(CollapsibleContent, { children: _jsx(QuickSendRow, { destination: destination }) })] })] }, destination.id))), (data?.length || 0) === 0 && (_jsx("div", { className: "rounded-xl border border-dashed px-4 py-8 text-sm text-muted-foreground", children: t("dispatch.pages.noDestinations") }))] }))] }), _jsxs(Collapsible, { open: addOpen, onOpenChange: setAddOpen, className: "rounded-2xl
|
|
69
|
+
}) })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: t("dispatch.pages.cancel") }), _jsx(AlertDialogAction, { onClick: () => remove.mutate({ id: destination.id }), children: t("dispatch.pages.delete") })] })] })] })] }), _jsxs(Collapsible, { className: "mt-3", children: [_jsxs(CollapsibleTrigger, { className: "group flex w-full cursor-pointer items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground", children: [_jsx(IconChevronRight, { className: "h-3.5 w-3.5 transition-transform group-data-[state=open]:rotate-90" }), _jsx("span", { children: "Send a test message" })] }), _jsx(CollapsibleContent, { children: _jsx(QuickSendRow, { destination: destination }) })] })] }, destination.id))), (data?.length || 0) === 0 && (_jsx("div", { className: "rounded-xl border border-dashed px-4 py-8 text-sm text-muted-foreground", children: t("dispatch.pages.noDestinations") }))] }))] }), _jsxs(Collapsible, { open: addOpen, onOpenChange: setAddOpen, className: "rounded-2xl bg-card", children: [_jsxs(CollapsibleTrigger, { className: "group flex w-full cursor-pointer items-center justify-between gap-3 p-5 text-left hover:bg-muted/20", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-lg font-semibold text-foreground", children: t("dispatch.pages.addDestination") }), _jsx("span", { className: "mt-1 block text-sm text-muted-foreground", children: "Save a reusable delivery target for scheduled or agent-sent messages." })] }), _jsx(IconChevronRight, { className: "h-5 w-5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90" })] }), _jsx(CollapsibleContent, { className: "border-t px-5 pb-5 pt-4", children: _jsxs("div", { className: "space-y-3", children: [_jsx(Input, { value: form.name, onChange: (event) => setForm((current) => ({
|
|
70
70
|
...current,
|
|
71
71
|
name: event.target.value,
|
|
72
72
|
})), placeholder: t("dispatch.pages.dailyDigestChannel") }), _jsxs(Select, { value: form.platform, onValueChange: (value) => setForm((current) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destinations.js","sourceRoot":"","sources":["../../../src/routes/pages/destinations.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,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,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,G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,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;4CACpB,GAAG,OAAO;4CACV,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;yCAC9B,CAAC,CAAC,EAEL,WAAW,EAAE,CAAC,CAAC,wCAAwC,CAAC,GACxD,EACF,KAAC,QAAQ,IACP,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;4CACpB,GAAG,OAAO;4CACV,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;yCAC1B,CAAC,CAAC,EAEL,WAAW,EAAE,CAAC,CAAC,iCAAiC,CAAC,GACjD,EACF,KAAC,MAAM,IACL,SAAS,EAAC,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CACZ,MAAM,CAAC,MAAM,CAAC;4CACZ,IAAI,EAAE,IAAI,CAAC,IAAI;4CACf,QAAQ,EAAE,IAAI,CAAC,QAA0C;4CACzD,WAAW,EAAE,IAAI,CAAC,WAAW;4CAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,SAAS;4CACtC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;yCAC/B,CAAC,EAEJ,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,YAExC,CAAC,CAAC,gCAAgC,CAAC,GAC7B,IACL,GACa,IACT,IACV,GACQ,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { IconChevronRight } from \"@tabler/icons-react\";\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { TaskQueueHealth } from \"../../components/task-queue-health\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../../components/ui/alert-dialog\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../components/ui/collapsible\";\nimport { Input } from \"../../components/ui/input\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../components/ui/select\";\nimport { Textarea } from \"../../components/ui/textarea\";\n\nexport function meta() {\n return [{ title: \"Destinations — Dispatch\" }];\n}\n\nfunction QuickSendRow({\n destination,\n}: {\n destination: { id: string; name: string };\n}) {\n const t = useT();\n const [text, setText] = useState(\"\");\n const send = useActionMutation(\"send-platform-message\", {\n onSuccess: () => {\n toast.success(t(\"dispatch.pages.messageSent\"));\n setText(\"\");\n },\n onError: (error) => {\n toast.error(\n error instanceof Error\n ? error.message\n : t(\"dispatch.pages.unableToSendMessage\"),\n );\n },\n });\n return (\n <div className=\"mt-3 flex gap-2\">\n <Input\n value={text}\n onChange={(event) => setText(event.target.value)}\n placeholder={t(\"dispatch.pages.quickTestMessage\")}\n />\n <Button\n onClick={() =>\n send.mutate({\n destinationId: destination.id,\n text: text || `Test message to ${destination.name}`,\n })\n }\n disabled={send.isPending}\n >\n {t(\"dispatch.pages.send\")}\n </Button>\n </div>\n );\n}\n\nexport default function DestinationsRoute() {\n const t = useT();\n const destinationsQuery = useActionQuery(\"list-destinations\", {});\n const { data } = destinationsQuery;\n const [form, setForm] = useState({\n name: \"\",\n platform: \"slack\",\n destination: \"\",\n threadRef: \"\",\n notes: \"\",\n });\n const [addOpen, setAddOpen] = useState(false);\n\n const upsert = useActionMutation(\"upsert-destination\", {\n onSuccess: () => {\n toast.success(t(\"dispatch.pages.destinationSaved\"));\n setForm((current) => ({\n ...current,\n name: \"\",\n destination: \"\",\n threadRef: \"\",\n notes: \"\",\n }));\n },\n });\n const remove = useActionMutation(\"delete-destination\", {\n onSuccess: () => toast.success(t(\"dispatch.pages.destinationRemoved\")),\n });\n\n return (\n <DispatchShell\n title={t(\"dispatch.nav.destinations\")}\n description={t(\"dispatch.pages.destinationsDescription\")}\n >\n <div className=\"flex flex-col gap-4\">\n <TaskQueueHealth />\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n {t(\"dispatch.pages.savedDestinations\")}\n </h2>\n {destinationsQuery.isError ? (\n <ActionQueryError\n className=\"mt-4\"\n error={destinationsQuery.error}\n onRetry={() => void destinationsQuery.refetch()}\n />\n ) : (\n <div className=\"mt-4 divide-y\">\n {(data || []).map((destination: any) => (\n <div key={destination.id} className=\"py-4 first:pt-0\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-medium text-foreground\">\n {destination.name}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {destination.platform} · {destination.destination}\n {destination.threadRef\n ? ` · thread ${destination.threadRef}`\n : \"\"}\n </div>\n {destination.notes && (\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {destination.notes}\n </p>\n )}\n </div>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"outline\" size=\"sm\">\n {t(\"dispatch.pages.delete\")}\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {t(\"dispatch.pages.deleteDestinationTitle\")}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {t(\"dispatch.pages.deleteDestinationDescription\", {\n name: destination.name,\n })}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>\n {t(\"dispatch.pages.cancel\")}\n </AlertDialogCancel>\n <AlertDialogAction\n onClick={() =>\n remove.mutate({ id: destination.id })\n }\n >\n {t(\"dispatch.pages.delete\")}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n <Collapsible className=\"mt-3\">\n <CollapsibleTrigger className=\"group flex w-full cursor-pointer items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground\">\n <IconChevronRight className=\"h-3.5 w-3.5 transition-transform group-data-[state=open]:rotate-90\" />\n <span>Send a test message</span>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <QuickSendRow destination={destination} />\n </CollapsibleContent>\n </Collapsible>\n </div>\n ))}\n {(data?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-8 text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noDestinations\")}\n </div>\n )}\n </div>\n )}\n </section>\n\n <Collapsible\n open={addOpen}\n onOpenChange={setAddOpen}\n className=\"rounded-2xl border bg-card\"\n >\n <CollapsibleTrigger className=\"group flex w-full cursor-pointer items-center justify-between gap-3 p-5 text-left hover:bg-muted/20\">\n <span>\n <span className=\"block text-lg font-semibold text-foreground\">\n {t(\"dispatch.pages.addDestination\")}\n </span>\n <span className=\"mt-1 block text-sm text-muted-foreground\">\n Save a reusable delivery target for scheduled or agent-sent\n messages.\n </span>\n </span>\n <IconChevronRight className=\"h-5 w-5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90\" />\n </CollapsibleTrigger>\n <CollapsibleContent className=\"border-t px-5 pb-5 pt-4\">\n <div className=\"space-y-3\">\n <Input\n value={form.name}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n name: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.dailyDigestChannel\")}\n />\n <Select\n value={form.platform}\n onValueChange={(value) =>\n setForm((current) => ({\n ...current,\n platform: value,\n }))\n }\n >\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"slack\">Slack</SelectItem>\n <SelectItem value=\"telegram\">Telegram</SelectItem>\n <SelectItem value=\"email\">Email</SelectItem>\n </SelectContent>\n </Select>\n <Input\n value={form.destination}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n destination: event.target.value,\n }))\n }\n placeholder={\n form.platform === \"slack\"\n ? \"C0123456789\"\n : form.platform === \"email\"\n ? \"teammate+qa@agent-native.test\"\n : \"123456789\"\n }\n />\n <Input\n value={form.threadRef}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n threadRef: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.optionalThreadOrTopicId\")}\n />\n <Textarea\n value={form.notes}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n notes: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.destinationNotes\")}\n />\n <Button\n className=\"w-full\"\n onClick={() =>\n upsert.mutate({\n name: form.name,\n platform: form.platform as \"slack\" | \"telegram\" | \"email\",\n destination: form.destination,\n threadRef: form.threadRef || undefined,\n notes: form.notes || undefined,\n })\n }\n disabled={!form.name || !form.destination}\n >\n {t(\"dispatch.pages.saveDestination\")}\n </Button>\n </div>\n </CollapsibleContent>\n </Collapsible>\n </div>\n </DispatchShell>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"destinations.js","sourceRoot":"","sources":["../../../src/routes/pages/destinations.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,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,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EACL,WAAW,EACX,iBAAiB,EACj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,CAAC","sourcesContent":["import {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { IconChevronRight } from \"@tabler/icons-react\";\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { TaskQueueHealth } from \"../../components/task-queue-health\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../../components/ui/alert-dialog\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../components/ui/collapsible\";\nimport { Input } from \"../../components/ui/input\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../components/ui/select\";\nimport { Textarea } from \"../../components/ui/textarea\";\n\nexport function meta() {\n return [{ title: \"Destinations — Dispatch\" }];\n}\n\nfunction QuickSendRow({\n destination,\n}: {\n destination: { id: string; name: string };\n}) {\n const t = useT();\n const [text, setText] = useState(\"\");\n const send = useActionMutation(\"send-platform-message\", {\n onSuccess: () => {\n toast.success(t(\"dispatch.pages.messageSent\"));\n setText(\"\");\n },\n onError: (error) => {\n toast.error(\n error instanceof Error\n ? error.message\n : t(\"dispatch.pages.unableToSendMessage\"),\n );\n },\n });\n return (\n <div className=\"mt-3 flex gap-2\">\n <Input\n value={text}\n onChange={(event) => setText(event.target.value)}\n placeholder={t(\"dispatch.pages.quickTestMessage\")}\n />\n <Button\n onClick={() =>\n send.mutate({\n destinationId: destination.id,\n text: text || `Test message to ${destination.name}`,\n })\n }\n disabled={send.isPending}\n >\n {t(\"dispatch.pages.send\")}\n </Button>\n </div>\n );\n}\n\nexport default function DestinationsRoute() {\n const t = useT();\n const destinationsQuery = useActionQuery(\"list-destinations\", {});\n const { data } = destinationsQuery;\n const [form, setForm] = useState({\n name: \"\",\n platform: \"slack\",\n destination: \"\",\n threadRef: \"\",\n notes: \"\",\n });\n const [addOpen, setAddOpen] = useState(false);\n\n const upsert = useActionMutation(\"upsert-destination\", {\n onSuccess: () => {\n toast.success(t(\"dispatch.pages.destinationSaved\"));\n setForm((current) => ({\n ...current,\n name: \"\",\n destination: \"\",\n threadRef: \"\",\n notes: \"\",\n }));\n },\n });\n const remove = useActionMutation(\"delete-destination\", {\n onSuccess: () => toast.success(t(\"dispatch.pages.destinationRemoved\")),\n });\n\n return (\n <DispatchShell\n title={t(\"dispatch.nav.destinations\")}\n description={t(\"dispatch.pages.destinationsDescription\")}\n >\n <div className=\"flex flex-col gap-4\">\n <TaskQueueHealth />\n <section className=\"rounded-2xl bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n {t(\"dispatch.pages.savedDestinations\")}\n </h2>\n {destinationsQuery.isError ? (\n <ActionQueryError\n className=\"mt-4\"\n error={destinationsQuery.error}\n onRetry={() => void destinationsQuery.refetch()}\n />\n ) : (\n <div className=\"mt-4 divide-y\">\n {(data || []).map((destination: any) => (\n <div key={destination.id} className=\"py-4 first:pt-0\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-medium text-foreground\">\n {destination.name}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {destination.platform} · {destination.destination}\n {destination.threadRef\n ? ` · thread ${destination.threadRef}`\n : \"\"}\n </div>\n {destination.notes && (\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {destination.notes}\n </p>\n )}\n </div>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"outline\" size=\"sm\">\n {t(\"dispatch.pages.delete\")}\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {t(\"dispatch.pages.deleteDestinationTitle\")}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {t(\"dispatch.pages.deleteDestinationDescription\", {\n name: destination.name,\n })}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>\n {t(\"dispatch.pages.cancel\")}\n </AlertDialogCancel>\n <AlertDialogAction\n onClick={() =>\n remove.mutate({ id: destination.id })\n }\n >\n {t(\"dispatch.pages.delete\")}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n <Collapsible className=\"mt-3\">\n <CollapsibleTrigger className=\"group flex w-full cursor-pointer items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground\">\n <IconChevronRight className=\"h-3.5 w-3.5 transition-transform group-data-[state=open]:rotate-90\" />\n <span>Send a test message</span>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <QuickSendRow destination={destination} />\n </CollapsibleContent>\n </Collapsible>\n </div>\n ))}\n {(data?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-8 text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noDestinations\")}\n </div>\n )}\n </div>\n )}\n </section>\n\n <Collapsible\n open={addOpen}\n onOpenChange={setAddOpen}\n className=\"rounded-2xl bg-card\"\n >\n <CollapsibleTrigger className=\"group flex w-full cursor-pointer items-center justify-between gap-3 p-5 text-left hover:bg-muted/20\">\n <span>\n <span className=\"block text-lg font-semibold text-foreground\">\n {t(\"dispatch.pages.addDestination\")}\n </span>\n <span className=\"mt-1 block text-sm text-muted-foreground\">\n Save a reusable delivery target for scheduled or agent-sent\n messages.\n </span>\n </span>\n <IconChevronRight className=\"h-5 w-5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90\" />\n </CollapsibleTrigger>\n <CollapsibleContent className=\"border-t px-5 pb-5 pt-4\">\n <div className=\"space-y-3\">\n <Input\n value={form.name}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n name: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.dailyDigestChannel\")}\n />\n <Select\n value={form.platform}\n onValueChange={(value) =>\n setForm((current) => ({\n ...current,\n platform: value,\n }))\n }\n >\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"slack\">Slack</SelectItem>\n <SelectItem value=\"telegram\">Telegram</SelectItem>\n <SelectItem value=\"email\">Email</SelectItem>\n </SelectContent>\n </Select>\n <Input\n value={form.destination}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n destination: event.target.value,\n }))\n }\n placeholder={\n form.platform === \"slack\"\n ? \"C0123456789\"\n : form.platform === \"email\"\n ? \"teammate+qa@agent-native.test\"\n : \"123456789\"\n }\n />\n <Input\n value={form.threadRef}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n threadRef: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.optionalThreadOrTopicId\")}\n />\n <Textarea\n value={form.notes}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n notes: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.destinationNotes\")}\n />\n <Button\n className=\"w-full\"\n onClick={() =>\n upsert.mutate({\n name: form.name,\n platform: form.platform as \"slack\" | \"telegram\" | \"email\",\n destination: form.destination,\n threadRef: form.threadRef || undefined,\n notes: form.notes || undefined,\n })\n }\n disabled={!form.name || !form.destination}\n >\n {t(\"dispatch.pages.saveDestination\")}\n </Button>\n </div>\n </CollapsibleContent>\n </Collapsible>\n </div>\n </DispatchShell>\n );\n}\n"]}
|
|
@@ -201,7 +201,7 @@ function ProposalSkeleton() {
|
|
|
201
201
|
return (_jsx("div", { className: "space-y-3", children: Array.from({ length: 3 }).map((_, index) => (_jsxs("div", { className: "rounded-lg border p-4", children: [_jsx(Skeleton, { className: "h-4 w-1/2" }), _jsx(Skeleton, { className: "mt-3 h-3 w-full" }), _jsx(Skeleton, { className: "mt-2 h-3 w-3/4" })] }, index))) }));
|
|
202
202
|
}
|
|
203
203
|
function StatTile({ label, value, icon: Icon, }) {
|
|
204
|
-
return (_jsx("div", { className: "rounded-lg
|
|
204
|
+
return (_jsx("div", { className: "rounded-lg bg-card px-3 py-2.5", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: label }), _jsx("div", { className: "mt-1 text-xl font-semibold tabular-nums text-foreground", children: value })] }), _jsx(Icon, { size: 18, className: "shrink-0 text-muted-foreground" })] }) }));
|
|
205
205
|
}
|
|
206
206
|
function DreamSettingsSheet({ open, onOpenChange, draft, onDraftChange, onSave, saving, loading, }) {
|
|
207
207
|
const sourceIds = splitSourceIds(draft.sourceIdsText);
|
|
@@ -221,7 +221,7 @@ function ProposalCard({ proposal, applying, rejecting, onApply, onReject, }) {
|
|
|
221
221
|
const needsApproval = proposal.targetType != null && proposal.targetType !== "personal-memory";
|
|
222
222
|
const previewQuery = useActionQuery("preview-dream-proposal", { id: proposal.id }, { enabled: open, staleTime: 0 });
|
|
223
223
|
const preview = previewQuery.data;
|
|
224
|
-
return (_jsxs("div", { className: "rounded-lg
|
|
224
|
+
return (_jsxs("div", { className: "rounded-lg bg-card", children: [_jsxs("div", { className: "flex flex-col gap-3 border-b px-4 py-3 md:flex-row md:items-start md:justify-between", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(StatusBadge, { status: proposal.status }), _jsx(Badge, { variant: "outline", className: "font-mono", children: proposalTarget(proposal) }), proposal.risk ? (_jsxs(Badge, { variant: "secondary", className: "capitalize", children: [proposal.risk, " risk"] })) : null] }), _jsx("div", { className: "mt-2 text-sm font-medium text-foreground", children: proposal.title || proposal.summary || proposal.id }), proposal.summary && proposal.title ? (_jsx("div", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: proposal.summary })) : null] }), _jsx("div", { className: "flex shrink-0 gap-2", children: _jsxs(Sheet, { open: open, onOpenChange: setOpen, children: [_jsx(SheetTrigger, { asChild: true, children: _jsxs(Button, { size: "sm", variant: canAct ? "default" : "outline", children: [_jsx(IconFileDiff, { size: 14, className: "mr-1.5" }), "Review"] }) }), _jsxs(SheetContent, { className: "flex w-full flex-col p-0 sm:max-w-3xl", children: [_jsxs(SheetHeader, { className: "border-b px-5 py-4", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 pr-8", children: [_jsx(StatusBadge, { status: proposal.status }), _jsx(Badge, { variant: "outline", className: "font-mono", children: preview?.target?.path || proposalTarget(proposal) }), _jsx(Badge, { variant: "secondary", className: "capitalize", children: preview?.operation || "review" }), preview?.approval?.willRequestApproval ? (_jsx(Badge, { variant: "secondary", children: "Approval request" })) : null] }), _jsx(SheetTitle, { className: "mt-2 text-base", children: proposal.title || proposal.summary || proposal.id }), _jsx(SheetDescription, { children: proposal.summary ||
|
|
225
225
|
"Review the target, evidence, and proposed content before applying this dream proposal." })] }), _jsx(ScrollArea, { className: "min-h-0 flex-1", children: _jsxs("div", { className: "space-y-5 p-5", children: [previewQuery.error ? (_jsx(QueryState, { error: previewQuery.error, label: "Could not preview proposal" })) : null, previewQuery.isLoading ? _jsx(ProposalSkeleton, {}) : null, _jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsxs("div", { className: "rounded-lg border bg-muted/20 p-3", children: [_jsx("div", { className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Target" }), _jsx("div", { className: "mt-1 break-all font-mono text-xs text-foreground", children: preview?.target?.path || proposalTarget(proposal) }), _jsxs("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [_jsx(Badge, { variant: "outline", children: preview?.target?.type ||
|
|
226
226
|
proposal.targetType ||
|
|
227
227
|
"memory" }), preview?.targetExists ? (_jsx(Badge, { variant: "secondary", children: "Existing target" })) : (_jsx(Badge, { variant: "secondary", children: "New target" }))] })] }), _jsxs("div", { className: "rounded-lg border bg-muted/20 p-3", children: [_jsx("div", { className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Review gate" }), _jsx("div", { className: "mt-1 text-xs leading-relaxed text-foreground", children: preview?.approval?.willRequestApproval
|
|
@@ -422,7 +422,7 @@ export default function DreamsRoute() {
|
|
|
422
422
|
candidatesQuery.refetch();
|
|
423
423
|
if (selectedDreamId)
|
|
424
424
|
dreamDetailQuery.refetch();
|
|
425
|
-
}, children: [_jsx(IconRefresh, { size: 15, className: "mr-1.5" }), "Refresh"] }), _jsxs(Button, { variant: "outline", onClick: ensureSchedule, disabled: ensureDreamSchedule.isPending, children: [ensureDreamSchedule.isPending ? (_jsx(Spinner, { className: "mr-1.5 size-3.5" })) : (_jsx(IconCalendarTime, { size: 15, className: "mr-1.5" })), "Ensure schedule"] }), _jsxs(Button, { variant: "outline", onClick: () => runDream(true), disabled: createDream.isPending, children: [createDream.isPending ? (_jsx(Spinner, { className: "mr-1.5 size-3.5" })) : (_jsx(IconDatabase, { size: 15, className: "mr-1.5" })), "Run all sources"] }), _jsxs(Button, { onClick: () => runDream(false), disabled: createDream.isPending, children: [createDream.isPending ? (_jsx(Spinner, { className: "mr-1.5 size-3.5" })) : (_jsx(IconPlayerPlay, { size: 15, className: "mr-1.5" })), "Run dream"] })] })] }), _jsxs("div", { className: "grid gap-4 lg:grid-cols-2 xl:grid-cols-[280px_minmax(0,1fr)_380px]", children: [_jsxs("section", { className: "rounded-lg
|
|
425
|
+
}, children: [_jsx(IconRefresh, { size: 15, className: "mr-1.5" }), "Refresh"] }), _jsxs(Button, { variant: "outline", onClick: ensureSchedule, disabled: ensureDreamSchedule.isPending, children: [ensureDreamSchedule.isPending ? (_jsx(Spinner, { className: "mr-1.5 size-3.5" })) : (_jsx(IconCalendarTime, { size: 15, className: "mr-1.5" })), "Ensure schedule"] }), _jsxs(Button, { variant: "outline", onClick: () => runDream(true), disabled: createDream.isPending, children: [createDream.isPending ? (_jsx(Spinner, { className: "mr-1.5 size-3.5" })) : (_jsx(IconDatabase, { size: 15, className: "mr-1.5" })), "Run all sources"] }), _jsxs(Button, { onClick: () => runDream(false), disabled: createDream.isPending, children: [createDream.isPending ? (_jsx(Spinner, { className: "mr-1.5 size-3.5" })) : (_jsx(IconPlayerPlay, { size: 15, className: "mr-1.5" })), "Run dream"] })] })] }), _jsxs("div", { className: "grid gap-4 lg:grid-cols-2 xl:grid-cols-[280px_minmax(0,1fr)_380px]", children: [_jsxs("section", { className: "rounded-lg bg-card", children: [_jsxs("div", { className: "border-b px-4 py-3", children: [_jsx("div", { className: "text-sm font-semibold text-foreground", children: "Recent passes" }), _jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: "Reports generated from prior agent activity." })] }), _jsxs("div", { className: "max-h-[720px] overflow-auto p-3", children: [_jsx(QueryState, { error: dreamsQuery.error, label: "Could not load dream passes" }), dreamsQuery.isLoading ? _jsx(DreamListSkeleton, {}) : null, !dreamsQuery.isLoading && !dreamsQuery.error ? (dreams.length > 0 ? (_jsx("div", { className: "space-y-2", children: dreams.map((dream, index) => {
|
|
426
426
|
const selected = dream.id === selectedDreamId;
|
|
427
427
|
return (_jsxs("button", { type: "button", onClick: () => selectDream(dream.id), className: cn("w-full rounded-lg border px-3 py-3 text-left transition-colors", selected
|
|
428
428
|
? "border-foreground bg-muted"
|
|
@@ -430,7 +430,7 @@ export default function DreamsRoute() {
|
|
|
430
430
|
dream.updatedAt ??
|
|
431
431
|
dream.startedAt ??
|
|
432
432
|
dream.createdAt) })] }, dream.id));
|
|
433
|
-
}) })) : (_jsx(EmptyPanel, { title: "No dreams yet", description: "Run the first dream pass to review recent agent history and generate proposed memory changes." }))) : null] })] }), _jsxs("section", { className: "min-w-0 rounded-lg
|
|
433
|
+
}) })) : (_jsx(EmptyPanel, { title: "No dreams yet", description: "Run the first dream pass to review recent agent history and generate proposed memory changes." }))) : null] })] }), _jsxs("section", { className: "min-w-0 rounded-lg bg-card", children: [_jsx("div", { className: "border-b px-4 py-3", children: _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-semibold text-foreground", children: selectedDream
|
|
434
434
|
? selectedDream.title || selectedDream.id
|
|
435
435
|
: "Dream detail" }), _jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: selectedDream
|
|
436
436
|
? `Completed ${formatDate(selectedDream.completedAt ??
|
|
@@ -445,7 +445,7 @@ export default function DreamsRoute() {
|
|
|
445
445
|
}), onReject: (reason) => rejectProposal.mutate({
|
|
446
446
|
id: proposal.id,
|
|
447
447
|
reason,
|
|
448
|
-
}) }, proposal.id))) })) : (_jsx(EmptyPanel, { title: "No proposals", description: "This dream did not produce reviewable memory, skill, job, or instruction changes." })) }), _jsx(TabsContent, { value: "report", className: "mt-4", children: detail?.report || detail?.summary ? (_jsx(RawBlock, { value: detail.report || detail.summary || "" })) : (_jsx(EmptyPanel, { title: "No report text", description: "The dream detail action did not return a report body." })) }), _jsxs(TabsContent, { value: "sources", className: "mt-4", children: [selectedSourceHealth.length > 0 ? (_jsx("div", { className: "mb-4", children: _jsx(SourceHealthPanel, { sources: selectedSourceHealth }) })) : null, inspectedRuns.length > 0 || evidenceItems.length ? (_jsxs(Accordion, { type: "multiple", className: "rounded-lg border", children: [inspectedRuns.map((run, index) => (_jsxs(AccordionItem, { value: candidateId(run) || `run-${index}`, className: "px-4", children: [_jsx(AccordionTrigger, { className: "text-sm hover:no-underline", children: _jsx("span", { className: "min-w-0 truncate text-left", children: candidateLabel(run) }) }), _jsxs(AccordionContent, { className: "pb-4", children: [_jsxs("div", { className: "grid gap-2 text-xs text-muted-foreground sm:grid-cols-2", children: [_jsxs("div", { children: ["Thread:", " ", _jsx("span", { className: "font-mono text-foreground", children: run.thread?.id ?? run.threadId ?? "n/a" })] }), _jsxs("div", { children: ["Run:", " ", _jsx("span", { className: "font-mono text-foreground", children: run.runId ?? run.id })] }), _jsxs("div", { children: ["Owner: ", candidateOwner(run)] }), _jsxs("div", { children: ["Status: ", candidateStatus(run)] })] }), candidateSignals(run).length > 0 ? (_jsx("div", { className: "mt-3 flex flex-wrap gap-1.5", children: candidateSignals(run).map((signal) => (_jsx(Badge, { variant: "outline", children: signal }, signal))) })) : null] })] }, candidateId(run)))), evidenceItems.map((item, index) => (_jsxs(AccordionItem, { value: item.id || `evidence-${index}`, className: "px-4", children: [_jsx(AccordionTrigger, { className: "text-sm hover:no-underline", children: evidenceLabel(item, index) }), _jsx(AccordionContent, { className: "pb-4", children: _jsx(RawBlock, { value: item }) })] }, item.id || `evidence-${index}`)))] })) : (_jsx(EmptyPanel, { title: "No source runs", description: "This dream has no structured source list yet." }))] })] })) : null] })] }), _jsxs("section", { className: "rounded-lg
|
|
448
|
+
}) }, proposal.id))) })) : (_jsx(EmptyPanel, { title: "No proposals", description: "This dream did not produce reviewable memory, skill, job, or instruction changes." })) }), _jsx(TabsContent, { value: "report", className: "mt-4", children: detail?.report || detail?.summary ? (_jsx(RawBlock, { value: detail.report || detail.summary || "" })) : (_jsx(EmptyPanel, { title: "No report text", description: "The dream detail action did not return a report body." })) }), _jsxs(TabsContent, { value: "sources", className: "mt-4", children: [selectedSourceHealth.length > 0 ? (_jsx("div", { className: "mb-4", children: _jsx(SourceHealthPanel, { sources: selectedSourceHealth }) })) : null, inspectedRuns.length > 0 || evidenceItems.length ? (_jsxs(Accordion, { type: "multiple", className: "rounded-lg border", children: [inspectedRuns.map((run, index) => (_jsxs(AccordionItem, { value: candidateId(run) || `run-${index}`, className: "px-4", children: [_jsx(AccordionTrigger, { className: "text-sm hover:no-underline", children: _jsx("span", { className: "min-w-0 truncate text-left", children: candidateLabel(run) }) }), _jsxs(AccordionContent, { className: "pb-4", children: [_jsxs("div", { className: "grid gap-2 text-xs text-muted-foreground sm:grid-cols-2", children: [_jsxs("div", { children: ["Thread:", " ", _jsx("span", { className: "font-mono text-foreground", children: run.thread?.id ?? run.threadId ?? "n/a" })] }), _jsxs("div", { children: ["Run:", " ", _jsx("span", { className: "font-mono text-foreground", children: run.runId ?? run.id })] }), _jsxs("div", { children: ["Owner: ", candidateOwner(run)] }), _jsxs("div", { children: ["Status: ", candidateStatus(run)] })] }), candidateSignals(run).length > 0 ? (_jsx("div", { className: "mt-3 flex flex-wrap gap-1.5", children: candidateSignals(run).map((signal) => (_jsx(Badge, { variant: "outline", children: signal }, signal))) })) : null] })] }, candidateId(run)))), evidenceItems.map((item, index) => (_jsxs(AccordionItem, { value: item.id || `evidence-${index}`, className: "px-4", children: [_jsx(AccordionTrigger, { className: "text-sm hover:no-underline", children: evidenceLabel(item, index) }), _jsx(AccordionContent, { className: "pb-4", children: _jsx(RawBlock, { value: item }) })] }, item.id || `evidence-${index}`)))] })) : (_jsx(EmptyPanel, { title: "No source runs", description: "This dream has no structured source list yet." }))] })] })) : null] })] }), _jsxs("section", { className: "rounded-lg bg-card", children: [_jsx("div", { className: "border-b px-4 py-3", children: _jsxs("div", { children: [_jsx("div", { className: "text-sm font-semibold text-foreground", children: "Candidate runs" }), _jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: "Grounded signals ready for review." })] }) }), _jsxs("div", { className: "max-h-[720px] overflow-auto p-3", children: [_jsx(QueryState, { error: candidatesQuery.error, label: "Could not load candidates" }), candidatesQuery.isLoading ? _jsx(DreamListSkeleton, {}) : null, !candidatesQuery.isLoading &&
|
|
449
449
|
!candidatesQuery.error &&
|
|
450
450
|
candidateSourceHealth.length > 0 ? (_jsx("div", { className: "mb-3", children: _jsx(SourceHealthPanel, { sources: candidateSourceHealth }) })) : null, !candidatesQuery.isLoading && !candidatesQuery.error ? (candidates.length > 0 ? (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Run" }), _jsx(TableHead, { children: "Signals" }), _jsx(TableHead, { className: "w-20 text-right", children: "Score" })] }) }), _jsx(TableBody, { children: candidates.map((candidate) => {
|
|
451
451
|
const id = candidateId(candidate);
|