@agent-native/dispatch 0.2.3 → 0.2.4

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/README.md CHANGED
@@ -18,9 +18,9 @@ The agent and the UI are equal citizens of the same system. Every action works b
18
18
  - **Any database, any host** — Any SQL database Drizzle supports. Any hosting target Nitro supports. No lock-in.
19
19
  - **Any AI agent** — Claude Code, Codex, Gemini CLI, OpenCode, or Builder.io. Use whichever agent you prefer.
20
20
 
21
- ## Cloneable SaaS Templates
21
+ ## Templates
22
22
 
23
- Start from a complete, production-grade SaaS app. Each one replaces tools you're paying for except you own everything and can customize it however you want. Not demos; products.
23
+ Start from a complete, production-grade SaaS app — cloneable, not scaffolded. Each one replaces tools you're paying for, except you own everything and can customize it however you want. Not demos; products.
24
24
 
25
25
  <table>
26
26
  <tr>
@@ -145,7 +145,7 @@ Generate forms from a prompt, branch logic with the agent, and own every respons
145
145
  </tr>
146
146
  </table>
147
147
 
148
- Every template is cloneable SaaS — fork it, customize it with the agent, own it. Try them with example data before connecting your own sources.
148
+ Every template is a complete cloneable SaaS — fork it, customize it with the agent, own it. Try them with example data before connecting your own sources.
149
149
 
150
150
  ## Quick Start
151
151
 
@@ -184,7 +184,7 @@ my-platform/
184
184
  Add another app later:
185
185
 
186
186
  ```bash
187
- agent-native add-app notes --template content
187
+ npx @agent-native/core add-app notes --template content
188
188
  ```
189
189
 
190
190
  Deploy every app behind one origin:
@@ -1 +1 @@
1
- {"version":3,"file":"agents-panel.d.ts","sourceRoot":"","sources":["../../src/components/agents-panel.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CAC/B;AAED,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,2CAkOA"}
1
+ {"version":3,"file":"agents-panel.d.ts","sourceRoot":"","sources":["../../src/components/agents-panel.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CAC/B;AA4CD,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,2CAuRA"}
@@ -5,21 +5,66 @@ import { Input } from "../components/ui/input.js";
5
5
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "../components/ui/alert-dialog.js";
6
6
  import { IconExternalLink, IconTrash } from "@tabler/icons-react";
7
7
  import { agentNativePath } from "@agent-native/core/client";
8
+ function slugifyAgentName(value) {
9
+ return value
10
+ .trim()
11
+ .toLowerCase()
12
+ .replace(/[^a-z0-9]+/g, "-")
13
+ .replace(/^-+|-+$/g, "");
14
+ }
15
+ function validateAgentForm(name, url) {
16
+ const errors = {};
17
+ const trimmedName = name.trim();
18
+ const trimmedUrl = url.trim();
19
+ if (!trimmedName) {
20
+ errors.name = "Agent name is required.";
21
+ }
22
+ else if (!slugifyAgentName(trimmedName)) {
23
+ errors.name = "Agent name must include at least one letter or number.";
24
+ }
25
+ if (!trimmedUrl) {
26
+ errors.url = "Agent endpoint URL is required.";
27
+ }
28
+ else {
29
+ try {
30
+ const parsed = new URL(trimmedUrl);
31
+ if (parsed.protocol !== "https:" && parsed.protocol !== "http:") {
32
+ errors.url = "Use an http:// or https:// endpoint URL.";
33
+ }
34
+ else if (!parsed.hostname) {
35
+ errors.url = "Enter a complete endpoint URL with a host.";
36
+ }
37
+ else if (parsed.username || parsed.password) {
38
+ errors.url = "Do not include credentials in the endpoint URL.";
39
+ }
40
+ }
41
+ catch {
42
+ errors.url =
43
+ "Enter a valid endpoint URL, such as https://app.example.com.";
44
+ }
45
+ }
46
+ return errors;
47
+ }
8
48
  export function AgentsPanel({ agents, onRefresh, }) {
9
49
  const [name, setName] = useState("");
10
50
  const [url, setUrl] = useState("");
11
51
  const [description, setDescription] = useState("");
12
52
  const [saving, setSaving] = useState(false);
53
+ const [errors, setErrors] = useState({});
13
54
  const nameRef = useRef(null);
14
55
  const customAgents = agents.filter((agent) => agent.source === "custom");
15
56
  const workspaceAgents = agents.filter((agent) => agent.source === "workspace");
16
57
  const builtinAgents = agents.filter((agent) => agent.source === "builtin");
17
- const handleAdd = async () => {
58
+ const handleAdd = async (event) => {
59
+ event?.preventDefault();
18
60
  const trimmedName = name.trim();
19
61
  const trimmedUrl = url.trim();
20
- if (!trimmedName || !trimmedUrl)
62
+ const nextErrors = validateAgentForm(trimmedName, trimmedUrl);
63
+ if (Object.keys(nextErrors).length > 0) {
64
+ setErrors(nextErrors);
21
65
  return;
22
- const id = trimmedName.toLowerCase().replace(/[^a-z0-9-]/g, "-");
66
+ }
67
+ const id = slugifyAgentName(trimmedName);
23
68
  const agentJson = JSON.stringify({
24
69
  id,
25
70
  name: trimmedName,
@@ -42,9 +87,22 @@ export function AgentsPanel({ agents, onRefresh, }) {
42
87
  setName("");
43
88
  setUrl("");
44
89
  setDescription("");
90
+ setErrors({});
45
91
  onRefresh();
46
92
  nameRef.current?.focus();
47
93
  }
94
+ else {
95
+ setErrors({
96
+ form: `Could not add agent. Request failed with ${res.status}.`,
97
+ });
98
+ }
99
+ }
100
+ catch (error) {
101
+ setErrors({
102
+ form: error instanceof Error
103
+ ? error.message
104
+ : "Could not add agent. Please try again.",
105
+ });
48
106
  }
49
107
  finally {
50
108
  setSaving(false);
@@ -59,6 +117,12 @@ export function AgentsPanel({ agents, onRefresh, }) {
59
117
  if (res.ok)
60
118
  onRefresh();
61
119
  };
62
- return (_jsx("section", { className: "rounded-2xl border bg-card p-5", children: _jsxs("div", { className: "grid gap-4 xl:grid-cols-[minmax(0,1fr)_320px]", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: "Available by default" }), _jsxs("div", { className: "mt-2 flex flex-wrap gap-2", children: [builtinAgents.map((agent) => (_jsxs("div", { className: "inline-flex items-center gap-2 rounded-full border px-3 py-1.5 text-xs text-muted-foreground", children: [_jsx("span", { className: "h-2 w-2 rounded-full", style: { backgroundColor: agent.color } }), _jsx("span", { children: agent.name })] }, agent.id))), builtinAgents.length === 0 && (_jsx("div", { className: "rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground", children: "No default agents detected." }))] })] }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: "Added in this workspace" }), _jsxs("div", { className: "mt-2 space-y-2", children: [workspaceAgents.map((agent) => (_jsx("div", { className: "flex items-start justify-between gap-3 rounded-xl border bg-muted/30 px-4 py-3", children: _jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: agent.name }), agent.description ? (_jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: agent.description })) : null, _jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: _jsxs("a", { href: agent.url, target: "_blank", rel: "noreferrer", className: "inline-flex items-center gap-1 hover:text-foreground", children: [agent.url, _jsx(IconExternalLink, { className: "h-3 w-3" })] }) })] }) }, agent.id))), customAgents.map((agent) => (_jsxs("div", { className: "flex items-start justify-between gap-3 rounded-xl border bg-muted/30 px-4 py-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: agent.name }), agent.description ? (_jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: agent.description })) : null, _jsxs("div", { className: "mt-1 flex items-center gap-2 text-xs text-muted-foreground", children: [_jsxs("a", { href: agent.url, target: "_blank", rel: "noreferrer", className: "inline-flex items-center gap-1 hover:text-foreground", children: [agent.url, _jsx(IconExternalLink, { className: "h-3 w-3" })] }), _jsx("span", { children: "\u00B7" }), _jsx("span", { children: agent.scope || "shared" })] })] }), _jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", children: _jsx(IconTrash, { className: "h-4 w-4" }) }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Remove this agent?" }), _jsxs(AlertDialogDescription, { children: ["\u201C", agent.name, "\u201D will be removed from the workspace. Any jobs or chats that delegate to it will stop working."] })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { onClick: () => handleDelete(agent.resourceId), children: "Remove" })] })] })] })] }, agent.id))), workspaceAgents.length === 0 && customAgents.length === 0 && (_jsx("div", { className: "rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground", children: "No extra agents added yet." }))] })] })] }), _jsxs("div", { className: "rounded-xl border bg-muted/20 p-4", children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: "Add external agent" }), _jsx("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: "Add another A2A-compatible app by saving its agent endpoint here." }), _jsxs("div", { className: "mt-4 space-y-3", children: [_jsx(Input, { ref: nameRef, value: name, onChange: (event) => setName(event.target.value), placeholder: "Name" }), _jsx(Input, { value: url, onChange: (event) => setUrl(event.target.value), placeholder: "https://app.example.com" }), _jsx(Input, { value: description, onChange: (event) => setDescription(event.target.value), placeholder: "Description (optional)" }), _jsx(Button, { className: "w-full", onClick: handleAdd, disabled: !name.trim() || !url.trim() || saving, children: saving ? "Saving..." : "Add agent" })] })] })] }) }));
120
+ return (_jsx("section", { className: "rounded-2xl border bg-card p-5", children: _jsxs("div", { className: "grid gap-4 xl:grid-cols-[minmax(0,1fr)_320px]", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: "Available by default" }), _jsxs("div", { className: "mt-2 flex flex-wrap gap-2", children: [builtinAgents.map((agent) => (_jsxs("div", { className: "inline-flex items-center gap-2 rounded-full border px-3 py-1.5 text-xs text-muted-foreground", children: [_jsx("span", { className: "h-2 w-2 rounded-full", style: { backgroundColor: agent.color } }), _jsx("span", { children: agent.name })] }, agent.id))), builtinAgents.length === 0 && (_jsx("div", { className: "rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground", children: "No default agents detected." }))] })] }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: "Added in this workspace" }), _jsxs("div", { className: "mt-2 space-y-2", children: [workspaceAgents.map((agent) => (_jsx("div", { className: "flex items-start justify-between gap-3 rounded-xl border bg-muted/30 px-4 py-3", children: _jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: agent.name }), agent.description ? (_jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: agent.description })) : null, _jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: _jsxs("a", { href: agent.url, target: "_blank", rel: "noreferrer", className: "inline-flex items-center gap-1 hover:text-foreground", children: [agent.url, _jsx(IconExternalLink, { className: "h-3 w-3" })] }) })] }) }, agent.id))), customAgents.map((agent) => (_jsxs("div", { className: "flex items-start justify-between gap-3 rounded-xl border bg-muted/30 px-4 py-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: agent.name }), agent.description ? (_jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: agent.description })) : null, _jsxs("div", { className: "mt-1 flex items-center gap-2 text-xs text-muted-foreground", children: [_jsxs("a", { href: agent.url, target: "_blank", rel: "noreferrer", className: "inline-flex items-center gap-1 hover:text-foreground", children: [agent.url, _jsx(IconExternalLink, { className: "h-3 w-3" })] }), _jsx("span", { children: "\u00B7" }), _jsx("span", { children: agent.scope || "shared" })] })] }), _jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", children: _jsx(IconTrash, { className: "h-4 w-4" }) }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Remove this agent?" }), _jsxs(AlertDialogDescription, { children: ["\u201C", agent.name, "\u201D will be removed from the workspace. Any jobs or chats that delegate to it will stop working."] })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { onClick: () => handleDelete(agent.resourceId), children: "Remove" })] })] })] })] }, agent.id))), workspaceAgents.length === 0 && customAgents.length === 0 && (_jsx("div", { className: "rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground", children: "No extra agents added yet." }))] })] })] }), _jsxs("div", { className: "rounded-xl border bg-muted/20 p-4", children: [_jsx("div", { className: "text-sm font-medium text-foreground", children: "Add external agent" }), _jsx("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: "Add another A2A-compatible app by saving its agent endpoint here." }), _jsxs("form", { className: "mt-4 space-y-3", onSubmit: handleAdd, noValidate: true, children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Input, { ref: nameRef, value: name, onChange: (event) => {
121
+ setName(event.target.value);
122
+ setErrors((current) => ({ ...current, name: undefined }));
123
+ }, placeholder: "Name", "aria-invalid": Boolean(errors.name), "aria-describedby": errors.name ? "external-agent-name-error" : undefined }), errors.name ? (_jsx("p", { id: "external-agent-name-error", className: "text-xs font-medium text-destructive", children: errors.name })) : null] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Input, { value: url, onChange: (event) => {
124
+ setUrl(event.target.value);
125
+ setErrors((current) => ({ ...current, url: undefined }));
126
+ }, placeholder: "https://app.example.com", "aria-invalid": Boolean(errors.url), "aria-describedby": errors.url ? "external-agent-url-error" : undefined }), errors.url ? (_jsx("p", { id: "external-agent-url-error", className: "text-xs font-medium text-destructive", children: errors.url })) : null] }), _jsx(Input, { value: description, onChange: (event) => setDescription(event.target.value), placeholder: "Description (optional)" }), errors.form ? (_jsx("p", { className: "text-xs font-medium text-destructive", children: errors.form })) : null, _jsx(Button, { type: "submit", className: "w-full", disabled: saving, children: saving ? "Saving..." : "Add agent" })] })] })] }) }));
63
127
  }
64
128
  //# sourceMappingURL=agents-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agents-panel.js","sourceRoot":"","sources":["../../src/components/agents-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAc5D,MAAM,UAAU,WAAW,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AC7B,KAAC,KAAK,IACJ,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAChD,WAAW,EAAC,MAAM,GAClB,EACF,KAAC,KAAK,IACJ,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,WAAW,EAAC,yBAAyB,GACrC,EACF,KAAC,KAAK,IACJ,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,WAAW,EAAC,wBAAwB,GACpC,EACF,KAAC,MAAM,IACL,SAAS,EAAC,QAAQ,EAClB,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,MAAM,YAE9C,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,GAC5B,IACL,IACF,IACF,GACE,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { useRef, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\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 { IconExternalLink, IconTrash } from \"@tabler/icons-react\";\nimport { agentNativePath } from \"@agent-native/core/client\";\n\nexport interface ConnectedAgent {\n id: string;\n name: string;\n description: string;\n url: string;\n color: string;\n source: \"builtin\" | \"custom\" | \"workspace\";\n resourceId?: string;\n path?: string;\n scope?: \"shared\" | \"personal\";\n}\n\nexport function AgentsPanel({\n agents,\n onRefresh,\n}: {\n agents: ConnectedAgent[];\n onRefresh: () => void;\n}) {\n const [name, setName] = useState(\"\");\n const [url, setUrl] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const nameRef = useRef<HTMLInputElement>(null);\n\n const customAgents = agents.filter((agent) => agent.source === \"custom\");\n const workspaceAgents = agents.filter(\n (agent) => agent.source === \"workspace\",\n );\n const builtinAgents = agents.filter((agent) => agent.source === \"builtin\");\n\n const handleAdd = async () => {\n const trimmedName = name.trim();\n const trimmedUrl = url.trim();\n if (!trimmedName || !trimmedUrl) return;\n\n const id = trimmedName.toLowerCase().replace(/[^a-z0-9-]/g, \"-\");\n const agentJson = JSON.stringify(\n {\n id,\n name: trimmedName,\n description: description.trim() || undefined,\n url: trimmedUrl,\n color: \"#6B7280\",\n },\n null,\n 2,\n );\n\n setSaving(true);\n try {\n const res = await fetch(agentNativePath(\"/_agent-native/resources\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n path: `remote-agents/${id}.json`,\n content: agentJson,\n shared: true,\n }),\n });\n if (res.ok) {\n setName(\"\");\n setUrl(\"\");\n setDescription(\"\");\n onRefresh();\n nameRef.current?.focus();\n }\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async (resourceId?: string) => {\n if (!resourceId) return;\n const res = await fetch(\n agentNativePath(`/_agent-native/resources/${resourceId}`),\n {\n method: \"DELETE\",\n },\n );\n if (res.ok) onRefresh();\n };\n\n return (\n <section className=\"rounded-2xl border bg-card p-5\">\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,1fr)_320px]\">\n <div className=\"space-y-4\">\n <div>\n <div className=\"text-sm font-medium text-foreground\">\n Available by default\n </div>\n <div className=\"mt-2 flex flex-wrap gap-2\">\n {builtinAgents.map((agent) => (\n <div\n key={agent.id}\n className=\"inline-flex items-center gap-2 rounded-full border px-3 py-1.5 text-xs text-muted-foreground\"\n >\n <span\n className=\"h-2 w-2 rounded-full\"\n style={{ backgroundColor: agent.color }}\n />\n <span>{agent.name}</span>\n </div>\n ))}\n {builtinAgents.length === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No default agents detected.\n </div>\n )}\n </div>\n </div>\n\n <div>\n <div className=\"text-sm font-medium text-foreground\">\n Added in this workspace\n </div>\n <div className=\"mt-2 space-y-2\">\n {workspaceAgents.map((agent) => (\n <div\n key={agent.id}\n className=\"flex items-start justify-between gap-3 rounded-xl border bg-muted/30 px-4 py-3\"\n >\n <div className=\"min-w-0\">\n <div className=\"text-sm font-medium text-foreground\">\n {agent.name}\n </div>\n {agent.description ? (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {agent.description}\n </div>\n ) : null}\n <div className=\"mt-1 text-xs text-muted-foreground\">\n <a\n href={agent.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n >\n {agent.url}\n <IconExternalLink className=\"h-3 w-3\" />\n </a>\n </div>\n </div>\n </div>\n ))}\n {customAgents.map((agent) => (\n <div\n key={agent.id}\n className=\"flex items-start justify-between gap-3 rounded-xl border bg-muted/30 px-4 py-3\"\n >\n <div className=\"min-w-0\">\n <div className=\"text-sm font-medium text-foreground\">\n {agent.name}\n </div>\n {agent.description ? (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {agent.description}\n </div>\n ) : null}\n <div className=\"mt-1 flex items-center gap-2 text-xs text-muted-foreground\">\n <a\n href={agent.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n >\n {agent.url}\n <IconExternalLink className=\"h-3 w-3\" />\n </a>\n <span>·</span>\n <span>{agent.scope || \"shared\"}</span>\n </div>\n </div>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\">\n <IconTrash className=\"h-4 w-4\" />\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Remove this agent?</AlertDialogTitle>\n <AlertDialogDescription>\n “{agent.name}” will be removed from the workspace. Any\n jobs or chats that delegate to it will stop working.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => handleDelete(agent.resourceId)}\n >\n Remove\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n ))}\n {workspaceAgents.length === 0 && customAgents.length === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No extra agents added yet.\n </div>\n )}\n </div>\n </div>\n </div>\n\n <div className=\"rounded-xl border bg-muted/20 p-4\">\n <div className=\"text-sm font-medium text-foreground\">\n Add external agent\n </div>\n <p className=\"mt-1 text-xs leading-relaxed text-muted-foreground\">\n Add another A2A-compatible app by saving its agent endpoint here.\n </p>\n <div className=\"mt-4 space-y-3\">\n <Input\n ref={nameRef}\n value={name}\n onChange={(event) => setName(event.target.value)}\n placeholder=\"Name\"\n />\n <Input\n value={url}\n onChange={(event) => setUrl(event.target.value)}\n placeholder=\"https://app.example.com\"\n />\n <Input\n value={description}\n onChange={(event) => setDescription(event.target.value)}\n placeholder=\"Description (optional)\"\n />\n <Button\n className=\"w-full\"\n onClick={handleAdd}\n disabled={!name.trim() || !url.trim() || saving}\n >\n {saving ? \"Saving...\" : \"Add agent\"}\n </Button>\n </div>\n </div>\n </div>\n </section>\n );\n}\n"]}
1
+ {"version":3,"file":"agents-panel.js","sourceRoot":"","sources":["../../src/components/agents-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;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C,CACb,YAAG,SAAS,EAAC,sCAAsC,YAChD,MAAM,CAAC,IAAI,GACV,CACL,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,QAAQ,EAAC,QAAQ,EAAE,MAAM,YACtD,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,GAC5B,IACJ,IACH,IACF,GACE,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { useRef, useState, type FormEvent } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\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 { IconExternalLink, IconTrash } from \"@tabler/icons-react\";\nimport { agentNativePath } from \"@agent-native/core/client\";\n\nexport interface ConnectedAgent {\n id: string;\n name: string;\n description: string;\n url: string;\n color: string;\n source: \"builtin\" | \"custom\" | \"workspace\";\n resourceId?: string;\n path?: string;\n scope?: \"shared\" | \"personal\";\n}\n\ntype AgentFormErrors = Partial<Record<\"name\" | \"url\" | \"form\", string>>;\n\nfunction slugifyAgentName(value: string): string {\n return value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\n\nfunction validateAgentForm(name: string, url: string): AgentFormErrors {\n const errors: AgentFormErrors = {};\n const trimmedName = name.trim();\n const trimmedUrl = url.trim();\n\n if (!trimmedName) {\n errors.name = \"Agent name is required.\";\n } else if (!slugifyAgentName(trimmedName)) {\n errors.name = \"Agent name must include at least one letter or number.\";\n }\n\n if (!trimmedUrl) {\n errors.url = \"Agent endpoint URL is required.\";\n } else {\n try {\n const parsed = new URL(trimmedUrl);\n if (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") {\n errors.url = \"Use an http:// or https:// endpoint URL.\";\n } else if (!parsed.hostname) {\n errors.url = \"Enter a complete endpoint URL with a host.\";\n } else if (parsed.username || parsed.password) {\n errors.url = \"Do not include credentials in the endpoint URL.\";\n }\n } catch {\n errors.url =\n \"Enter a valid endpoint URL, such as https://app.example.com.\";\n }\n }\n\n return errors;\n}\n\nexport function AgentsPanel({\n agents,\n onRefresh,\n}: {\n agents: ConnectedAgent[];\n onRefresh: () => void;\n}) {\n const [name, setName] = useState(\"\");\n const [url, setUrl] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [errors, setErrors] = useState<AgentFormErrors>({});\n const nameRef = useRef<HTMLInputElement>(null);\n\n const customAgents = agents.filter((agent) => agent.source === \"custom\");\n const workspaceAgents = agents.filter(\n (agent) => agent.source === \"workspace\",\n );\n const builtinAgents = agents.filter((agent) => agent.source === \"builtin\");\n\n const handleAdd = async (event?: FormEvent<HTMLFormElement>) => {\n event?.preventDefault();\n const trimmedName = name.trim();\n const trimmedUrl = url.trim();\n const nextErrors = validateAgentForm(trimmedName, trimmedUrl);\n if (Object.keys(nextErrors).length > 0) {\n setErrors(nextErrors);\n return;\n }\n\n const id = slugifyAgentName(trimmedName);\n const agentJson = JSON.stringify(\n {\n id,\n name: trimmedName,\n description: description.trim() || undefined,\n url: trimmedUrl,\n color: \"#6B7280\",\n },\n null,\n 2,\n );\n\n setSaving(true);\n try {\n const res = await fetch(agentNativePath(\"/_agent-native/resources\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n path: `remote-agents/${id}.json`,\n content: agentJson,\n shared: true,\n }),\n });\n if (res.ok) {\n setName(\"\");\n setUrl(\"\");\n setDescription(\"\");\n setErrors({});\n onRefresh();\n nameRef.current?.focus();\n } else {\n setErrors({\n form: `Could not add agent. Request failed with ${res.status}.`,\n });\n }\n } catch (error) {\n setErrors({\n form:\n error instanceof Error\n ? error.message\n : \"Could not add agent. Please try again.\",\n });\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async (resourceId?: string) => {\n if (!resourceId) return;\n const res = await fetch(\n agentNativePath(`/_agent-native/resources/${resourceId}`),\n {\n method: \"DELETE\",\n },\n );\n if (res.ok) onRefresh();\n };\n\n return (\n <section className=\"rounded-2xl border bg-card p-5\">\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,1fr)_320px]\">\n <div className=\"space-y-4\">\n <div>\n <div className=\"text-sm font-medium text-foreground\">\n Available by default\n </div>\n <div className=\"mt-2 flex flex-wrap gap-2\">\n {builtinAgents.map((agent) => (\n <div\n key={agent.id}\n className=\"inline-flex items-center gap-2 rounded-full border px-3 py-1.5 text-xs text-muted-foreground\"\n >\n <span\n className=\"h-2 w-2 rounded-full\"\n style={{ backgroundColor: agent.color }}\n />\n <span>{agent.name}</span>\n </div>\n ))}\n {builtinAgents.length === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No default agents detected.\n </div>\n )}\n </div>\n </div>\n\n <div>\n <div className=\"text-sm font-medium text-foreground\">\n Added in this workspace\n </div>\n <div className=\"mt-2 space-y-2\">\n {workspaceAgents.map((agent) => (\n <div\n key={agent.id}\n className=\"flex items-start justify-between gap-3 rounded-xl border bg-muted/30 px-4 py-3\"\n >\n <div className=\"min-w-0\">\n <div className=\"text-sm font-medium text-foreground\">\n {agent.name}\n </div>\n {agent.description ? (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {agent.description}\n </div>\n ) : null}\n <div className=\"mt-1 text-xs text-muted-foreground\">\n <a\n href={agent.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n >\n {agent.url}\n <IconExternalLink className=\"h-3 w-3\" />\n </a>\n </div>\n </div>\n </div>\n ))}\n {customAgents.map((agent) => (\n <div\n key={agent.id}\n className=\"flex items-start justify-between gap-3 rounded-xl border bg-muted/30 px-4 py-3\"\n >\n <div className=\"min-w-0\">\n <div className=\"text-sm font-medium text-foreground\">\n {agent.name}\n </div>\n {agent.description ? (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {agent.description}\n </div>\n ) : null}\n <div className=\"mt-1 flex items-center gap-2 text-xs text-muted-foreground\">\n <a\n href={agent.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n >\n {agent.url}\n <IconExternalLink className=\"h-3 w-3\" />\n </a>\n <span>·</span>\n <span>{agent.scope || \"shared\"}</span>\n </div>\n </div>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\">\n <IconTrash className=\"h-4 w-4\" />\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Remove this agent?</AlertDialogTitle>\n <AlertDialogDescription>\n “{agent.name}” will be removed from the workspace. Any\n jobs or chats that delegate to it will stop working.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => handleDelete(agent.resourceId)}\n >\n Remove\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n ))}\n {workspaceAgents.length === 0 && customAgents.length === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No extra agents added yet.\n </div>\n )}\n </div>\n </div>\n </div>\n\n <div className=\"rounded-xl border bg-muted/20 p-4\">\n <div className=\"text-sm font-medium text-foreground\">\n Add external agent\n </div>\n <p className=\"mt-1 text-xs leading-relaxed text-muted-foreground\">\n Add another A2A-compatible app by saving its agent endpoint here.\n </p>\n <form className=\"mt-4 space-y-3\" onSubmit={handleAdd} noValidate>\n <div className=\"space-y-1.5\">\n <Input\n ref={nameRef}\n value={name}\n onChange={(event) => {\n setName(event.target.value);\n setErrors((current) => ({ ...current, name: undefined }));\n }}\n placeholder=\"Name\"\n aria-invalid={Boolean(errors.name)}\n aria-describedby={\n errors.name ? \"external-agent-name-error\" : undefined\n }\n />\n {errors.name ? (\n <p\n id=\"external-agent-name-error\"\n className=\"text-xs font-medium text-destructive\"\n >\n {errors.name}\n </p>\n ) : null}\n </div>\n <div className=\"space-y-1.5\">\n <Input\n value={url}\n onChange={(event) => {\n setUrl(event.target.value);\n setErrors((current) => ({ ...current, url: undefined }));\n }}\n placeholder=\"https://app.example.com\"\n aria-invalid={Boolean(errors.url)}\n aria-describedby={\n errors.url ? \"external-agent-url-error\" : undefined\n }\n />\n {errors.url ? (\n <p\n id=\"external-agent-url-error\"\n className=\"text-xs font-medium text-destructive\"\n >\n {errors.url}\n </p>\n ) : null}\n </div>\n <Input\n value={description}\n onChange={(event) => setDescription(event.target.value)}\n placeholder=\"Description (optional)\"\n />\n {errors.form ? (\n <p className=\"text-xs font-medium text-destructive\">\n {errors.form}\n </p>\n ) : null}\n <Button type=\"submit\" className=\"w-full\" disabled={saving}>\n {saving ? \"Saving...\" : \"Add agent\"}\n </Button>\n </form>\n </div>\n </div>\n </section>\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function submitOverviewPrompt(message: string, selectedModel?: string | null): string | null;
2
+ //# sourceMappingURL=overview-chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overview-chat.d.ts","sourceRoot":"","sources":["../../src/lib/overview-chat.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAC5B,MAAM,GAAG,IAAI,CAkBf"}
@@ -0,0 +1,20 @@
1
+ import { isInBuilderFrame, sendToAgentChat } from "@agent-native/core/client";
2
+ export function submitOverviewPrompt(message, selectedModel) {
3
+ const trimmed = message.trim();
4
+ if (!trimmed)
5
+ return null;
6
+ if (isInBuilderFrame()) {
7
+ return sendToAgentChat({
8
+ message: trimmed,
9
+ submit: true,
10
+ type: "code",
11
+ });
12
+ }
13
+ return sendToAgentChat({
14
+ message: trimmed,
15
+ submit: true,
16
+ newTab: true,
17
+ model: selectedModel || undefined,
18
+ });
19
+ }
20
+ //# sourceMappingURL=overview-chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overview-chat.js","sourceRoot":"","sources":["../../src/lib/overview-chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE9E,MAAM,UAAU,oBAAoB,CAClC,OAAe,EACf,aAA6B;IAE7B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,IAAI,gBAAgB,EAAE,EAAE,CAAC;QACvB,OAAO,eAAe,CAAC;YACrB,OAAO,EAAE,OAAO;YAChB,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;IACL,CAAC;IAED,OAAO,eAAe,CAAC;QACrB,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,aAAa,IAAI,SAAS;KAClC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { isInBuilderFrame, sendToAgentChat } from \"@agent-native/core/client\";\n\nexport function submitOverviewPrompt(\n message: string,\n selectedModel?: string | null,\n): string | null {\n const trimmed = message.trim();\n if (!trimmed) return null;\n\n if (isInBuilderFrame()) {\n return sendToAgentChat({\n message: trimmed,\n submit: true,\n type: \"code\",\n });\n }\n\n return sendToAgentChat({\n message: trimmed,\n submit: true,\n newTab: true,\n model: selectedModel || undefined,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":"AA+dA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,4CA0SpC"}
1
+ {"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":"AA0dA,wBAAgB,IAAI;;IAEnB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,4CA0SpC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import { Link } from "react-router";
4
- import { PromptComposer, sendToAgentChat, useActionQuery, useChatModels, agentNativePath, } from "@agent-native/core/client";
4
+ import { PromptComposer, useActionQuery, useChatModels, agentNativePath, } from "@agent-native/core/client";
5
5
  import { IconActivity, IconAlertTriangle, IconApps, IconArrowUpRight, IconCheck, IconClockHour4, IconInfoCircle, IconKey, IconListCheck, IconRocket, IconPlugConnected, IconShieldCheck, } from "@tabler/icons-react";
6
6
  import { AppKeysPopover } from "../../components/app-keys-popover.js";
7
7
  import { CreateAppPopover } from "../../components/create-app-popover.js";
@@ -11,6 +11,7 @@ import { Badge } from "../../components/ui/badge.js";
11
11
  import { Button } from "../../components/ui/button.js";
12
12
  import { Skeleton } from "../../components/ui/skeleton.js";
13
13
  import { Tooltip, TooltipContent, TooltipTrigger, } from "../../components/ui/tooltip.js";
14
+ import { submitOverviewPrompt } from "../../lib/overview-chat.js";
14
15
  const ZERO_TASK_QUEUE_STATS = {
15
16
  pending: 0,
16
17
  processing: 0,
@@ -35,14 +36,9 @@ const HOME_CHAT_SUGGESTIONS = [
35
36
  function HomeChatPanel() {
36
37
  const { selectedModel } = useChatModels();
37
38
  const send = (message) => {
38
- sendToAgentChat({
39
- message,
40
- submit: true,
41
- newTab: true,
42
- model: selectedModel || undefined,
43
- });
39
+ submitOverviewPrompt(message, selectedModel);
44
40
  };
45
- return (_jsx("section", { className: "px-2 py-6 sm:py-10", children: _jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-5", children: [_jsx("h1", { className: "text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl", children: "What should we do next?" }), _jsx(PromptComposer, { placeholder: "Message agent\u2026", onSubmit: (text) => {
41
+ return (_jsx("section", { className: "px-2 py-6 sm:py-10", children: _jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: [_jsx("h1", { className: "text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl", children: "What should we do next?" }), _jsx(PromptComposer, { placeholder: "Message agent\u2026", onSubmit: (text) => {
46
42
  const trimmed = text.trim();
47
43
  if (!trimmed)
48
44
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"overview.js","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,cAAc,EACd,OAAO,EACP,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,yBAAyB,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C,yEAAyE,sCAElF,CACP,IACG,IACE,IACN,IACF,IACE,IACI,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport {\n PromptComposer,\n sendToAgentChat,\n useActionQuery,\n useChatModels,\n agentNativePath,\n} from \"@agent-native/core/client\";\nimport {\n IconActivity,\n IconAlertTriangle,\n IconApps,\n IconArrowUpRight,\n IconCheck,\n IconClockHour4,\n IconInfoCircle,\n IconKey,\n IconListCheck,\n IconRocket,\n IconPlugConnected,\n IconShieldCheck,\n type IconProps,\n} from \"@tabler/icons-react\";\nimport { AppKeysPopover } from \"@/components/app-keys-popover\";\nimport { CreateAppPopover } from \"@/components/create-app-popover\";\nimport { DispatchShell } from \"@/components/dispatch-shell\";\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\n\ninterface IntegrationStatus {\n platform: string;\n label: string;\n enabled: boolean;\n configured: boolean;\n}\n\ninterface TaskQueueRecentFailure {\n id: string;\n platform: string;\n error: string;\n attempts: number;\n}\n\ninterface TaskQueueStats {\n pending: number;\n processing: number;\n completed_last_hour: number;\n failed_last_hour: number;\n oldest_pending_age_seconds: number;\n recent_failures: TaskQueueRecentFailure[];\n}\n\nconst ZERO_TASK_QUEUE_STATS: TaskQueueStats = {\n pending: 0,\n processing: 0,\n completed_last_hour: 0,\n failed_last_hour: 0,\n oldest_pending_age_seconds: 0,\n recent_failures: [],\n};\n\ninterface WorkspaceAppSummary {\n id: string;\n name: string;\n description?: string;\n path: string;\n url?: string | null;\n isDispatch: boolean;\n status?: \"ready\" | \"pending\";\n statusLabel?: string;\n builderUrl?: string | null;\n branchName?: string | null;\n}\n\nfunction workspaceAppHref(app: WorkspaceAppSummary): string | null {\n if (app.status === \"pending\") return app.builderUrl || null;\n return app.url || app.path || null;\n}\n\nfunction isPendingBuilderHref(app: WorkspaceAppSummary): boolean {\n return app.status === \"pending\" && !!app.builderUrl;\n}\n\nconst HOME_CHAT_SUGGESTIONS = [\n \"Create a lightweight customer onboarding app\",\n \"Ask Slides to draft a board update from our latest metrics\",\n \"Schedule a Monday morning analytics digest\",\n];\n\nfunction HomeChatPanel() {\n const { selectedModel } = useChatModels();\n\n const send = (message: string) => {\n sendToAgentChat({\n message,\n submit: true,\n newTab: true,\n model: selectedModel || undefined,\n });\n };\n\n return (\n <section className=\"px-2 py-6 sm:py-10\">\n <div className=\"mx-auto w-full max-w-2xl space-y-5\">\n <h1 className=\"text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n What should we do next?\n </h1>\n <PromptComposer\n placeholder=\"Message agent…\"\n onSubmit={(text) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n send(trimmed);\n }}\n />\n <div className=\"flex flex-wrap justify-center gap-2\">\n {HOME_CHAT_SUGGESTIONS.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-full border border-border bg-card px-3 py-1.5 text-xs text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppCardSkeleton() {\n return (\n <div className=\"rounded-lg border bg-card p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-24\" />\n <div className=\"space-y-2 pt-1\">\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n <Skeleton className=\"h-5 w-5 rounded-md\" />\n </div>\n </div>\n );\n}\n\nfunction WorkspaceAppsSection({\n apps,\n isLoading,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n}) {\n const filteredApps = apps.filter((app) => !app.isDispatch);\n const visibleApps = filteredApps.slice(0, 6);\n const showSkeletons = isLoading && visibleApps.length === 0;\n\n return (\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2\">\n <IconApps size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Workspace apps\n </h2>\n </div>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link to=\"/apps\">\n View all\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </Link>\n </Button>\n </div>\n\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {showSkeletons\n ? Array.from({ length: 6 }).map((_, index) => (\n <AppCardSkeleton key={index} />\n ))\n : visibleApps.map((app) => {\n const href = workspaceAppHref(app);\n // Pending Builder branches live on a different host (Builder\n // editor URL); open those in a new tab. Ready workspace apps\n // navigate the current window so this works inside the\n // Builder webview, where new tabs would try to open in the\n // host browser and break the embedded session.\n const openInNewTab = isPendingBuilderHref(app);\n return (\n <a\n key={app.id}\n href={href ?? undefined}\n target={openInNewTab ? \"_blank\" : undefined}\n rel={openInNewTab ? \"noreferrer\" : undefined}\n aria-disabled={!href}\n className=\"group min-h-32 rounded-lg border bg-card p-4 transition hover:border-foreground/30 aria-disabled:pointer-events-none aria-disabled:opacity-60\"\n >\n <div className=\"flex h-full items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <h3 className=\"truncate text-sm font-semibold text-foreground\">\n {app.name}\n </h3>\n {app.status === \"pending\" ? (\n <Badge\n variant=\"outline\"\n className=\"shrink-0 gap-1 border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300\"\n >\n <IconClockHour4 size={12} />\n Building\n </Badge>\n ) : null}\n </div>\n <p className=\"mt-1 truncate font-mono text-xs text-muted-foreground\">\n {app.path}\n </p>\n {app.status === \"pending\" && app.branchName ? (\n <p className=\"mt-1 truncate text-xs text-muted-foreground\">\n Branch: {app.branchName}\n </p>\n ) : null}\n {app.description ? (\n <p className=\"mt-2 line-clamp-2 text-xs leading-relaxed text-muted-foreground\">\n {app.description}\n </p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {app.status === \"ready\" ? (\n <AppKeysPopover appId={app.id} appName={app.name} />\n ) : null}\n <IconArrowUpRight\n size={16}\n className=\"text-muted-foreground transition group-hover:text-foreground\"\n />\n </div>\n </div>\n </a>\n );\n })}\n\n {!showSkeletons ? <CreateAppPopover /> : null}\n </div>\n </section>\n );\n}\n\nfunction formatAgeSeconds(seconds: number): string {\n if (!seconds || seconds < 0) return \"0s\";\n if (seconds < 60) return `${seconds}s`;\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;\n return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;\n}\n\nfunction TaskQueueMetric({\n label,\n value,\n tone,\n icon: Icon,\n}: {\n label: string;\n value: string | number;\n tone?: \"default\" | \"warning\" | \"danger\";\n icon?: React.ComponentType<IconProps>;\n}) {\n const toneClass =\n tone === \"danger\"\n ? \"text-red-600 dark:text-red-400\"\n : tone === \"warning\"\n ? \"text-amber-600 dark:text-amber-400\"\n : \"text-foreground\";\n return (\n <div className=\"rounded-xl border bg-card px-4 py-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n {Icon ? <Icon size={14} /> : null}\n <span>{label}</span>\n </div>\n <div className={`mt-1 text-2xl font-semibold ${toneClass}`}>{value}</div>\n </div>\n );\n}\n\nfunction TaskQueueSection({ stats }: { stats: TaskQueueStats }) {\n const showAlert = stats.pending > 5 || stats.failed_last_hour > 0;\n return (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconListCheck size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">Task queue</h2>\n </div>\n {showAlert && (\n <Alert variant={stats.failed_last_hour > 0 ? \"destructive\" : \"default\"}>\n <IconAlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>\n {stats.failed_last_hour > 0\n ? `${stats.failed_last_hour} integration task${stats.failed_last_hour === 1 ? \"\" : \"s\"} failed in the last hour`\n : `${stats.pending} pending integration task${stats.pending === 1 ? \"\" : \"s\"} queued`}\n </AlertTitle>\n <AlertDescription>\n {stats.failed_last_hour > 0\n ? \"Recent failures are listed below. Check platform credentials and retry.\"\n : \"Tasks are waiting to be processed. The queue may be backed up.\"}\n </AlertDescription>\n </Alert>\n )}\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-5\">\n <TaskQueueMetric\n label=\"Pending\"\n value={stats.pending}\n tone={stats.pending > 5 ? \"warning\" : \"default\"}\n />\n <TaskQueueMetric label=\"Processing\" value={stats.processing} />\n <TaskQueueMetric\n label=\"Completed (1h)\"\n value={stats.completed_last_hour}\n />\n <TaskQueueMetric\n label=\"Failed (1h)\"\n value={stats.failed_last_hour}\n tone={stats.failed_last_hour > 0 ? \"danger\" : \"default\"}\n />\n <TaskQueueMetric\n label=\"Oldest pending\"\n value={formatAgeSeconds(stats.oldest_pending_age_seconds)}\n icon={IconClockHour4}\n tone={stats.oldest_pending_age_seconds > 300 ? \"warning\" : \"default\"}\n />\n </div>\n {stats.recent_failures.length > 0 && (\n <div className=\"rounded-2xl border bg-card p-4\">\n <div className=\"text-sm font-semibold text-foreground\">\n Recent failures\n </div>\n <div className=\"mt-3 space-y-2\">\n {stats.recent_failures.map((failure) => (\n <div\n key={failure.id}\n className=\"rounded-xl border bg-muted/30 px-3 py-2\"\n >\n <div className=\"flex items-center justify-between gap-2 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">\n {failure.platform}\n </span>\n <span>\n {failure.attempts} attempt\n {failure.attempts === 1 ? \"\" : \"s\"}\n </span>\n </div>\n <div className=\"mt-1 truncate text-sm text-foreground\">\n {failure.error || \"(no error message)\"}\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n </section>\n );\n}\n\nfunction HelpTooltip({ content }: { content: string }) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className=\"text-muted-foreground/60 hover:text-foreground cursor-pointer\"\n >\n <IconInfoCircle className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-64 text-xs leading-relaxed\">\n {content}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction StatCard({\n label,\n help,\n value,\n icon: Icon,\n cta,\n}: {\n label: string;\n help: string;\n value: number;\n icon: React.ComponentType<IconProps>;\n cta?: React.ReactNode;\n}) {\n return (\n <div className=\"rounded-2xl border bg-card p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-1.5 text-sm font-medium text-foreground\">\n <span>{label}</span>\n <HelpTooltip content={help} />\n </div>\n <div className=\"mt-3 text-3xl font-semibold text-foreground\">\n {value}\n </div>\n </div>\n <div className=\"rounded-xl border bg-muted/30 p-3 text-muted-foreground\">\n <Icon size={18} />\n </div>\n </div>\n {cta ? <div className=\"mt-4\">{cta}</div> : null}\n </div>\n );\n}\n\ninterface ChecklistStep {\n number: number;\n title: string;\n description: string;\n complete: boolean;\n /** If set, renders a link button to this path */\n to?: string;\n actionLabel?: string;\n /** If true, this step is always shown as informational (never \"complete\") */\n informational?: boolean;\n}\n\nfunction StepRow({ step }: { step: ChecklistStep }) {\n const done = step.complete && !step.informational;\n\n return (\n <div\n className={`flex items-start gap-4 rounded-xl border px-5 py-4 ${done ? \"border-border/50 bg-muted/20\" : \"bg-card\"}`}\n >\n {/* Number / check circle */}\n <div className=\"flex-none pt-0.5\">\n {done ? (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400\">\n <IconCheck size={16} strokeWidth={2.5} />\n </div>\n ) : (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full border-2 border-muted-foreground/30 text-sm font-semibold text-muted-foreground\">\n {step.number}\n </div>\n )}\n </div>\n\n {/* Text */}\n <div className={`min-w-0 flex-1 ${done ? \"opacity-50\" : \"\"}`}>\n <div\n className={`text-sm font-semibold ${done ? \"line-through decoration-muted-foreground/40\" : \"text-foreground\"}`}\n >\n {step.title}\n </div>\n <p className=\"mt-0.5 text-sm leading-relaxed text-muted-foreground\">\n {step.description}\n </p>\n </div>\n\n {/* Action */}\n {step.to && !done && (\n <div className=\"flex-none pt-0.5\">\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to={step.to}>{step.actionLabel || \"Set up\"}</Link>\n </Button>\n </div>\n )}\n </div>\n );\n}\n\nexport function meta() {\n return [{ title: \"Overview — Dispatch\" }];\n}\n\nexport default function OverviewRoute() {\n const { data, isLoading } = useActionQuery(\"list-dispatch-overview\", {});\n const { data: connectedAgents } = useActionQuery(\"list-connected-agents\", {});\n const { data: workspaceApps = [], isLoading: appsLoading } = useActionQuery(\n \"list-workspace-apps\",\n { includeAgentCards: false },\n {\n refetchInterval: 2_000,\n },\n );\n const [integrationStatuses, setIntegrationStatuses] = useState<\n IntegrationStatus[]\n >([]);\n const [taskQueueStats, setTaskQueueStats] = useState<TaskQueueStats>(\n ZERO_TASK_QUEUE_STATS,\n );\n\n useEffect(() => {\n let active = true;\n fetch(agentNativePath(\"/_agent-native/integrations/status\"))\n .then((res) => (res.ok ? res.json() : []))\n .then((rows) => {\n if (active) {\n setIntegrationStatuses(Array.isArray(rows) ? rows : []);\n }\n })\n .catch(() => {\n if (active) setIntegrationStatuses([]);\n });\n return () => {\n active = false;\n };\n }, []);\n\n useEffect(() => {\n let active = true;\n const load = () => {\n fetch(agentNativePath(\"/_agent-native/integrations/task-queue/status\"))\n .then((res) => (res.ok ? res.json() : null))\n .then((stats) => {\n if (!active || !stats || typeof stats !== \"object\") return;\n setTaskQueueStats({\n pending: Number(stats.pending ?? 0),\n processing: Number(stats.processing ?? 0),\n completed_last_hour: Number(stats.completed_last_hour ?? 0),\n failed_last_hour: Number(stats.failed_last_hour ?? 0),\n oldest_pending_age_seconds: Number(\n stats.oldest_pending_age_seconds ?? 0,\n ),\n recent_failures: Array.isArray(stats.recent_failures)\n ? stats.recent_failures\n : [],\n });\n })\n .catch(() => {\n // Endpoint may not exist on older deploys — ignore.\n });\n };\n load();\n const id = window.setInterval(load, 15000);\n return () => {\n active = false;\n window.clearInterval(id);\n };\n }, []);\n\n const counts = data?.counts || {\n destinations: 0,\n pendingApprovals: 0,\n linkedIdentities: 0,\n activeTokens: 0,\n };\n\n const messagingStatuses = useMemo(\n () =>\n integrationStatuses.filter(\n (row) => row.platform === \"slack\" || row.platform === \"telegram\",\n ),\n [integrationStatuses],\n );\n\n const connectedMessagingCount = messagingStatuses.filter(\n (row) => row.enabled || row.configured,\n ).length;\n const connectedAgentCount = connectedAgents?.length || 0;\n const vaultSecretCount = data?.vault?.secretCount || 0;\n const typedWorkspaceApps = workspaceApps as WorkspaceAppSummary[];\n\n const messagingDone = connectedMessagingCount > 0;\n const agentsDone = connectedAgentCount > 0;\n const vaultDone = vaultSecretCount > 0;\n\n const steps: ChecklistStep[] = [\n {\n number: 1,\n title: \"Connect Slack\",\n description:\n \"Add @agent-native to your Slack workspace so your team can ask questions, create decks, pull analytics, and more — right from Slack.\",\n complete: messagingDone,\n to: \"/messaging\",\n actionLabel: \"Connect\",\n },\n {\n number: 2,\n title: \"Review connected agents\",\n description:\n \"Dispatch delegates work to specialized apps. The built-in suite (Slides, Analytics, Content, Video, and more) is available automatically.\",\n complete: agentsDone,\n to: \"/agents\",\n actionLabel: \"Review\",\n },\n {\n number: 3,\n title: \"Set up your vault\",\n description:\n \"Store API keys centrally and sync them to apps that need them.\",\n complete: vaultDone,\n to: \"/vault\",\n actionLabel: \"Open vault\",\n },\n {\n number: 4,\n title: \"Try it out\",\n description: \"Mention @agent-native in any Slack channel to get started.\",\n complete: false,\n informational: true,\n },\n ];\n\n const hasIncompleteSteps = steps.some((s) => !s.complete && !s.informational);\n\n return (\n <DispatchShell\n title=\"Overview\"\n description=\"Create apps, manage shared keys, and route work across your workspace.\"\n >\n <HomeChatPanel />\n\n <WorkspaceAppsSection apps={typedWorkspaceApps} isLoading={appsLoading} />\n\n {hasIncompleteSteps && (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconRocket size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Getting started\n </h2>\n </div>\n <div className=\"space-y-2\">\n {steps.map((step) => (\n <StepRow key={step.number} step={step} />\n ))}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconActivity size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">At a glance</h2>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 xl:grid-cols-4\">\n <StatCard\n label=\"Vault secrets\"\n help=\"Credentials stored in the workspace vault. Grant them to apps from the Vault page.\"\n value={data?.vault?.secretCount || 0}\n icon={IconKey}\n cta={\n (data?.vault?.secretCount || 0) === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/vault\">Set up vault</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Active grants\"\n help=\"Secrets currently granted to apps. Sync them to push credentials.\"\n value={data?.vault?.activeGrantCount || 0}\n icon={IconShieldCheck}\n />\n <StatCard\n label=\"Destinations\"\n help=\"Saved outbound targets used for proactive sends and scheduled jobs.\"\n value={counts.destinations}\n icon={IconArrowUpRight}\n cta={\n counts.destinations === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/destinations\">Set up destinations</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Agents\"\n help=\"Agents available to dispatch for delegation over A2A. This includes the built-in app suite plus any additional agents you add.\"\n value={connectedAgentCount}\n icon={IconPlugConnected}\n cta={\n connectedAgentCount === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/agents\">Open agents</Link>\n </Button>\n ) : undefined\n }\n />\n </div>\n </section>\n\n <details className=\"rounded-xl border\">\n <summary className=\"flex cursor-pointer list-none items-center justify-between gap-3 px-5 py-4 text-sm font-semibold text-foreground hover:bg-muted/30 [&::-webkit-details-marker]:hidden\">\n <span>Operations detail</span>\n <span className=\"text-xs font-normal text-muted-foreground\">\n Queue, audit, and approvals\n </span>\n </summary>\n <div className=\"space-y-5 border-t px-5 py-5\">\n <TaskQueueSection stats={taskQueueStats} />\n\n <div className=\"grid gap-4 xl:grid-cols-3\">\n <section className=\"rounded-2xl border bg-card p-5 xl:col-span-2\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Recent activity\n </h2>\n {isLoading && (\n <span className=\"text-xs text-muted-foreground\">\n Loading...\n </span>\n )}\n </div>\n <div className=\"mt-4 space-y-3\">\n {(data?.recentAudit || []).map((event) => (\n <div\n key={event.id}\n className=\"rounded-xl border bg-muted/30 px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {event.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {event.actor} ·{\" \"}\n {new Date(event.createdAt).toLocaleString()}\n </div>\n </div>\n ))}\n {!isLoading && (data?.recentAudit?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No activity yet.\n </div>\n )}\n </div>\n </section>\n\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Approval mode\n </h2>\n <div className=\"mt-4 rounded-xl border bg-muted/30 p-4\">\n <div className=\"text-sm font-medium text-muted-foreground\">\n Current policy\n </div>\n <div className=\"mt-2 text-2xl font-semibold text-foreground\">\n {data?.settings?.enabled ? \"Reviewed\" : \"Immediate\"}\n </div>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {data?.settings?.enabled\n ? \"Changes wait for approval before they apply.\"\n : \"Changes apply immediately and are recorded in audit.\"}\n </p>\n </div>\n <div className=\"mt-4 space-y-2\">\n {(data?.recentApprovals || []).map((approval) => (\n <div\n key={approval.id}\n className=\"rounded-xl border px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {approval.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {approval.status} · requested by {approval.requestedBy}\n </div>\n </div>\n ))}\n {(data?.recentApprovals?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No approval requests.\n </div>\n )}\n </div>\n </section>\n </div>\n </div>\n </details>\n </DispatchShell>\n );\n}\n"]}
1
+ {"version":3,"file":"overview.js","sourceRoot":"","sources":["../../../src/routes/pages/overview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EACL,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,cAAc,EACd,OAAO,EACP,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CA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C,KAAK,CAAC,IAAI,CAC7C,cAAK,SAAS,EAAC,yEAAyE,sCAElF,CACP,IACG,IACE,IACN,IACF,IACE,IACI,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport {\n PromptComposer,\n useActionQuery,\n useChatModels,\n agentNativePath,\n} from \"@agent-native/core/client\";\nimport {\n IconActivity,\n IconAlertTriangle,\n IconApps,\n IconArrowUpRight,\n IconCheck,\n IconClockHour4,\n IconInfoCircle,\n IconKey,\n IconListCheck,\n IconRocket,\n IconPlugConnected,\n IconShieldCheck,\n type IconProps,\n} from \"@tabler/icons-react\";\nimport { AppKeysPopover } from \"@/components/app-keys-popover\";\nimport { CreateAppPopover } from \"@/components/create-app-popover\";\nimport { DispatchShell } from \"@/components/dispatch-shell\";\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { submitOverviewPrompt } from \"@/lib/overview-chat\";\n\ninterface IntegrationStatus {\n platform: string;\n label: string;\n enabled: boolean;\n configured: boolean;\n}\n\ninterface TaskQueueRecentFailure {\n id: string;\n platform: string;\n error: string;\n attempts: number;\n}\n\ninterface TaskQueueStats {\n pending: number;\n processing: number;\n completed_last_hour: number;\n failed_last_hour: number;\n oldest_pending_age_seconds: number;\n recent_failures: TaskQueueRecentFailure[];\n}\n\nconst ZERO_TASK_QUEUE_STATS: TaskQueueStats = {\n pending: 0,\n processing: 0,\n completed_last_hour: 0,\n failed_last_hour: 0,\n oldest_pending_age_seconds: 0,\n recent_failures: [],\n};\n\ninterface WorkspaceAppSummary {\n id: string;\n name: string;\n description?: string;\n path: string;\n url?: string | null;\n isDispatch: boolean;\n status?: \"ready\" | \"pending\";\n statusLabel?: string;\n builderUrl?: string | null;\n branchName?: string | null;\n}\n\nfunction workspaceAppHref(app: WorkspaceAppSummary): string | null {\n if (app.status === \"pending\") return app.builderUrl || null;\n return app.url || app.path || null;\n}\n\nfunction isPendingBuilderHref(app: WorkspaceAppSummary): boolean {\n return app.status === \"pending\" && !!app.builderUrl;\n}\n\nconst HOME_CHAT_SUGGESTIONS = [\n \"Create a lightweight customer onboarding app\",\n \"Ask Slides to draft a board update from our latest metrics\",\n \"Schedule a Monday morning analytics digest\",\n];\n\nfunction HomeChatPanel() {\n const { selectedModel } = useChatModels();\n\n const send = (message: string) => {\n submitOverviewPrompt(message, selectedModel);\n };\n\n return (\n <section className=\"px-2 py-6 sm:py-10\">\n <div className=\"mx-auto w-full max-w-2xl space-y-8\">\n <h1 className=\"text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl\">\n What should we do next?\n </h1>\n <PromptComposer\n placeholder=\"Message agent…\"\n onSubmit={(text) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n send(trimmed);\n }}\n />\n <div className=\"flex flex-wrap justify-center gap-2\">\n {HOME_CHAT_SUGGESTIONS.map((suggestion) => (\n <button\n key={suggestion}\n type=\"button\"\n onClick={() => send(suggestion)}\n className=\"cursor-pointer rounded-full border border-border bg-card px-3 py-1.5 text-xs text-muted-foreground transition hover:border-foreground/30 hover:text-foreground\"\n >\n {suggestion}\n </button>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nfunction AppCardSkeleton() {\n return (\n <div className=\"rounded-lg border bg-card p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1 space-y-3\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-24\" />\n <div className=\"space-y-2 pt-1\">\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-3 w-2/3\" />\n </div>\n </div>\n <Skeleton className=\"h-5 w-5 rounded-md\" />\n </div>\n </div>\n );\n}\n\nfunction WorkspaceAppsSection({\n apps,\n isLoading,\n}: {\n apps: WorkspaceAppSummary[];\n isLoading: boolean;\n}) {\n const filteredApps = apps.filter((app) => !app.isDispatch);\n const visibleApps = filteredApps.slice(0, 6);\n const showSkeletons = isLoading && visibleApps.length === 0;\n\n return (\n <section className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2\">\n <IconApps size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Workspace apps\n </h2>\n </div>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link to=\"/apps\">\n View all\n <IconArrowUpRight size={15} className=\"ml-1.5\" />\n </Link>\n </Button>\n </div>\n\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {showSkeletons\n ? Array.from({ length: 6 }).map((_, index) => (\n <AppCardSkeleton key={index} />\n ))\n : visibleApps.map((app) => {\n const href = workspaceAppHref(app);\n // Pending Builder branches live on a different host (Builder\n // editor URL); open those in a new tab. Ready workspace apps\n // navigate the current window so this works inside the\n // Builder webview, where new tabs would try to open in the\n // host browser and break the embedded session.\n const openInNewTab = isPendingBuilderHref(app);\n return (\n <a\n key={app.id}\n href={href ?? undefined}\n target={openInNewTab ? \"_blank\" : undefined}\n rel={openInNewTab ? \"noreferrer\" : undefined}\n aria-disabled={!href}\n className=\"group min-h-32 rounded-lg border bg-card p-4 transition hover:border-foreground/30 aria-disabled:pointer-events-none aria-disabled:opacity-60\"\n >\n <div className=\"flex h-full items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <h3 className=\"truncate text-sm font-semibold text-foreground\">\n {app.name}\n </h3>\n {app.status === \"pending\" ? (\n <Badge\n variant=\"outline\"\n className=\"shrink-0 gap-1 border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300\"\n >\n <IconClockHour4 size={12} />\n Building\n </Badge>\n ) : null}\n </div>\n <p className=\"mt-1 truncate font-mono text-xs text-muted-foreground\">\n {app.path}\n </p>\n {app.status === \"pending\" && app.branchName ? (\n <p className=\"mt-1 truncate text-xs text-muted-foreground\">\n Branch: {app.branchName}\n </p>\n ) : null}\n {app.description ? (\n <p className=\"mt-2 line-clamp-2 text-xs leading-relaxed text-muted-foreground\">\n {app.description}\n </p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {app.status === \"ready\" ? (\n <AppKeysPopover appId={app.id} appName={app.name} />\n ) : null}\n <IconArrowUpRight\n size={16}\n className=\"text-muted-foreground transition group-hover:text-foreground\"\n />\n </div>\n </div>\n </a>\n );\n })}\n\n {!showSkeletons ? <CreateAppPopover /> : null}\n </div>\n </section>\n );\n}\n\nfunction formatAgeSeconds(seconds: number): string {\n if (!seconds || seconds < 0) return \"0s\";\n if (seconds < 60) return `${seconds}s`;\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;\n return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;\n}\n\nfunction TaskQueueMetric({\n label,\n value,\n tone,\n icon: Icon,\n}: {\n label: string;\n value: string | number;\n tone?: \"default\" | \"warning\" | \"danger\";\n icon?: React.ComponentType<IconProps>;\n}) {\n const toneClass =\n tone === \"danger\"\n ? \"text-red-600 dark:text-red-400\"\n : tone === \"warning\"\n ? \"text-amber-600 dark:text-amber-400\"\n : \"text-foreground\";\n return (\n <div className=\"rounded-xl border bg-card px-4 py-3\">\n <div className=\"flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n {Icon ? <Icon size={14} /> : null}\n <span>{label}</span>\n </div>\n <div className={`mt-1 text-2xl font-semibold ${toneClass}`}>{value}</div>\n </div>\n );\n}\n\nfunction TaskQueueSection({ stats }: { stats: TaskQueueStats }) {\n const showAlert = stats.pending > 5 || stats.failed_last_hour > 0;\n return (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconListCheck size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">Task queue</h2>\n </div>\n {showAlert && (\n <Alert variant={stats.failed_last_hour > 0 ? \"destructive\" : \"default\"}>\n <IconAlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>\n {stats.failed_last_hour > 0\n ? `${stats.failed_last_hour} integration task${stats.failed_last_hour === 1 ? \"\" : \"s\"} failed in the last hour`\n : `${stats.pending} pending integration task${stats.pending === 1 ? \"\" : \"s\"} queued`}\n </AlertTitle>\n <AlertDescription>\n {stats.failed_last_hour > 0\n ? \"Recent failures are listed below. Check platform credentials and retry.\"\n : \"Tasks are waiting to be processed. The queue may be backed up.\"}\n </AlertDescription>\n </Alert>\n )}\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-5\">\n <TaskQueueMetric\n label=\"Pending\"\n value={stats.pending}\n tone={stats.pending > 5 ? \"warning\" : \"default\"}\n />\n <TaskQueueMetric label=\"Processing\" value={stats.processing} />\n <TaskQueueMetric\n label=\"Completed (1h)\"\n value={stats.completed_last_hour}\n />\n <TaskQueueMetric\n label=\"Failed (1h)\"\n value={stats.failed_last_hour}\n tone={stats.failed_last_hour > 0 ? \"danger\" : \"default\"}\n />\n <TaskQueueMetric\n label=\"Oldest pending\"\n value={formatAgeSeconds(stats.oldest_pending_age_seconds)}\n icon={IconClockHour4}\n tone={stats.oldest_pending_age_seconds > 300 ? \"warning\" : \"default\"}\n />\n </div>\n {stats.recent_failures.length > 0 && (\n <div className=\"rounded-2xl border bg-card p-4\">\n <div className=\"text-sm font-semibold text-foreground\">\n Recent failures\n </div>\n <div className=\"mt-3 space-y-2\">\n {stats.recent_failures.map((failure) => (\n <div\n key={failure.id}\n className=\"rounded-xl border bg-muted/30 px-3 py-2\"\n >\n <div className=\"flex items-center justify-between gap-2 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">\n {failure.platform}\n </span>\n <span>\n {failure.attempts} attempt\n {failure.attempts === 1 ? \"\" : \"s\"}\n </span>\n </div>\n <div className=\"mt-1 truncate text-sm text-foreground\">\n {failure.error || \"(no error message)\"}\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n </section>\n );\n}\n\nfunction HelpTooltip({ content }: { content: string }) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className=\"text-muted-foreground/60 hover:text-foreground cursor-pointer\"\n >\n <IconInfoCircle className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-64 text-xs leading-relaxed\">\n {content}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction StatCard({\n label,\n help,\n value,\n icon: Icon,\n cta,\n}: {\n label: string;\n help: string;\n value: number;\n icon: React.ComponentType<IconProps>;\n cta?: React.ReactNode;\n}) {\n return (\n <div className=\"rounded-2xl border bg-card p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-1.5 text-sm font-medium text-foreground\">\n <span>{label}</span>\n <HelpTooltip content={help} />\n </div>\n <div className=\"mt-3 text-3xl font-semibold text-foreground\">\n {value}\n </div>\n </div>\n <div className=\"rounded-xl border bg-muted/30 p-3 text-muted-foreground\">\n <Icon size={18} />\n </div>\n </div>\n {cta ? <div className=\"mt-4\">{cta}</div> : null}\n </div>\n );\n}\n\ninterface ChecklistStep {\n number: number;\n title: string;\n description: string;\n complete: boolean;\n /** If set, renders a link button to this path */\n to?: string;\n actionLabel?: string;\n /** If true, this step is always shown as informational (never \"complete\") */\n informational?: boolean;\n}\n\nfunction StepRow({ step }: { step: ChecklistStep }) {\n const done = step.complete && !step.informational;\n\n return (\n <div\n className={`flex items-start gap-4 rounded-xl border px-5 py-4 ${done ? \"border-border/50 bg-muted/20\" : \"bg-card\"}`}\n >\n {/* Number / check circle */}\n <div className=\"flex-none pt-0.5\">\n {done ? (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400\">\n <IconCheck size={16} strokeWidth={2.5} />\n </div>\n ) : (\n <div className=\"flex h-7 w-7 items-center justify-center rounded-full border-2 border-muted-foreground/30 text-sm font-semibold text-muted-foreground\">\n {step.number}\n </div>\n )}\n </div>\n\n {/* Text */}\n <div className={`min-w-0 flex-1 ${done ? \"opacity-50\" : \"\"}`}>\n <div\n className={`text-sm font-semibold ${done ? \"line-through decoration-muted-foreground/40\" : \"text-foreground\"}`}\n >\n {step.title}\n </div>\n <p className=\"mt-0.5 text-sm leading-relaxed text-muted-foreground\">\n {step.description}\n </p>\n </div>\n\n {/* Action */}\n {step.to && !done && (\n <div className=\"flex-none pt-0.5\">\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to={step.to}>{step.actionLabel || \"Set up\"}</Link>\n </Button>\n </div>\n )}\n </div>\n );\n}\n\nexport function meta() {\n return [{ title: \"Overview — Dispatch\" }];\n}\n\nexport default function OverviewRoute() {\n const { data, isLoading } = useActionQuery(\"list-dispatch-overview\", {});\n const { data: connectedAgents } = useActionQuery(\"list-connected-agents\", {});\n const { data: workspaceApps = [], isLoading: appsLoading } = useActionQuery(\n \"list-workspace-apps\",\n { includeAgentCards: false },\n {\n refetchInterval: 2_000,\n },\n );\n const [integrationStatuses, setIntegrationStatuses] = useState<\n IntegrationStatus[]\n >([]);\n const [taskQueueStats, setTaskQueueStats] = useState<TaskQueueStats>(\n ZERO_TASK_QUEUE_STATS,\n );\n\n useEffect(() => {\n let active = true;\n fetch(agentNativePath(\"/_agent-native/integrations/status\"))\n .then((res) => (res.ok ? res.json() : []))\n .then((rows) => {\n if (active) {\n setIntegrationStatuses(Array.isArray(rows) ? rows : []);\n }\n })\n .catch(() => {\n if (active) setIntegrationStatuses([]);\n });\n return () => {\n active = false;\n };\n }, []);\n\n useEffect(() => {\n let active = true;\n const load = () => {\n fetch(agentNativePath(\"/_agent-native/integrations/task-queue/status\"))\n .then((res) => (res.ok ? res.json() : null))\n .then((stats) => {\n if (!active || !stats || typeof stats !== \"object\") return;\n setTaskQueueStats({\n pending: Number(stats.pending ?? 0),\n processing: Number(stats.processing ?? 0),\n completed_last_hour: Number(stats.completed_last_hour ?? 0),\n failed_last_hour: Number(stats.failed_last_hour ?? 0),\n oldest_pending_age_seconds: Number(\n stats.oldest_pending_age_seconds ?? 0,\n ),\n recent_failures: Array.isArray(stats.recent_failures)\n ? stats.recent_failures\n : [],\n });\n })\n .catch(() => {\n // Endpoint may not exist on older deploys — ignore.\n });\n };\n load();\n const id = window.setInterval(load, 15000);\n return () => {\n active = false;\n window.clearInterval(id);\n };\n }, []);\n\n const counts = data?.counts || {\n destinations: 0,\n pendingApprovals: 0,\n linkedIdentities: 0,\n activeTokens: 0,\n };\n\n const messagingStatuses = useMemo(\n () =>\n integrationStatuses.filter(\n (row) => row.platform === \"slack\" || row.platform === \"telegram\",\n ),\n [integrationStatuses],\n );\n\n const connectedMessagingCount = messagingStatuses.filter(\n (row) => row.enabled || row.configured,\n ).length;\n const connectedAgentCount = connectedAgents?.length || 0;\n const vaultSecretCount = data?.vault?.secretCount || 0;\n const typedWorkspaceApps = workspaceApps as WorkspaceAppSummary[];\n\n const messagingDone = connectedMessagingCount > 0;\n const agentsDone = connectedAgentCount > 0;\n const vaultDone = vaultSecretCount > 0;\n\n const steps: ChecklistStep[] = [\n {\n number: 1,\n title: \"Connect Slack\",\n description:\n \"Add @agent-native to your Slack workspace so your team can ask questions, create decks, pull analytics, and more — right from Slack.\",\n complete: messagingDone,\n to: \"/messaging\",\n actionLabel: \"Connect\",\n },\n {\n number: 2,\n title: \"Review connected agents\",\n description:\n \"Dispatch delegates work to specialized apps. The built-in suite (Slides, Analytics, Content, Video, and more) is available automatically.\",\n complete: agentsDone,\n to: \"/agents\",\n actionLabel: \"Review\",\n },\n {\n number: 3,\n title: \"Set up your vault\",\n description:\n \"Store API keys centrally and sync them to apps that need them.\",\n complete: vaultDone,\n to: \"/vault\",\n actionLabel: \"Open vault\",\n },\n {\n number: 4,\n title: \"Try it out\",\n description: \"Mention @agent-native in any Slack channel to get started.\",\n complete: false,\n informational: true,\n },\n ];\n\n const hasIncompleteSteps = steps.some((s) => !s.complete && !s.informational);\n\n return (\n <DispatchShell\n title=\"Overview\"\n description=\"Create apps, manage shared keys, and route work across your workspace.\"\n >\n <HomeChatPanel />\n\n <WorkspaceAppsSection apps={typedWorkspaceApps} isLoading={appsLoading} />\n\n {hasIncompleteSteps && (\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconRocket size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">\n Getting started\n </h2>\n </div>\n <div className=\"space-y-2\">\n {steps.map((step) => (\n <StepRow key={step.number} step={step} />\n ))}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <IconActivity size={16} className=\"text-muted-foreground\" />\n <h2 className=\"text-sm font-semibold text-foreground\">At a glance</h2>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 xl:grid-cols-4\">\n <StatCard\n label=\"Vault secrets\"\n help=\"Credentials stored in the workspace vault. Grant them to apps from the Vault page.\"\n value={data?.vault?.secretCount || 0}\n icon={IconKey}\n cta={\n (data?.vault?.secretCount || 0) === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/vault\">Set up vault</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Active grants\"\n help=\"Secrets currently granted to apps. Sync them to push credentials.\"\n value={data?.vault?.activeGrantCount || 0}\n icon={IconShieldCheck}\n />\n <StatCard\n label=\"Destinations\"\n help=\"Saved outbound targets used for proactive sends and scheduled jobs.\"\n value={counts.destinations}\n icon={IconArrowUpRight}\n cta={\n counts.destinations === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/destinations\">Set up destinations</Link>\n </Button>\n ) : undefined\n }\n />\n <StatCard\n label=\"Agents\"\n help=\"Agents available to dispatch for delegation over A2A. This includes the built-in app suite plus any additional agents you add.\"\n value={connectedAgentCount}\n icon={IconPlugConnected}\n cta={\n connectedAgentCount === 0 ? (\n <Button variant=\"outline\" size=\"sm\" asChild>\n <Link to=\"/agents\">Open agents</Link>\n </Button>\n ) : undefined\n }\n />\n </div>\n </section>\n\n <details className=\"rounded-xl border\">\n <summary className=\"flex cursor-pointer list-none items-center justify-between gap-3 px-5 py-4 text-sm font-semibold text-foreground hover:bg-muted/30 [&::-webkit-details-marker]:hidden\">\n <span>Operations detail</span>\n <span className=\"text-xs font-normal text-muted-foreground\">\n Queue, audit, and approvals\n </span>\n </summary>\n <div className=\"space-y-5 border-t px-5 py-5\">\n <TaskQueueSection stats={taskQueueStats} />\n\n <div className=\"grid gap-4 xl:grid-cols-3\">\n <section className=\"rounded-2xl border bg-card p-5 xl:col-span-2\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Recent activity\n </h2>\n {isLoading && (\n <span className=\"text-xs text-muted-foreground\">\n Loading...\n </span>\n )}\n </div>\n <div className=\"mt-4 space-y-3\">\n {(data?.recentAudit || []).map((event) => (\n <div\n key={event.id}\n className=\"rounded-xl border bg-muted/30 px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {event.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {event.actor} ·{\" \"}\n {new Date(event.createdAt).toLocaleString()}\n </div>\n </div>\n ))}\n {!isLoading && (data?.recentAudit?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No activity yet.\n </div>\n )}\n </div>\n </section>\n\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n Approval mode\n </h2>\n <div className=\"mt-4 rounded-xl border bg-muted/30 p-4\">\n <div className=\"text-sm font-medium text-muted-foreground\">\n Current policy\n </div>\n <div className=\"mt-2 text-2xl font-semibold text-foreground\">\n {data?.settings?.enabled ? \"Reviewed\" : \"Immediate\"}\n </div>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {data?.settings?.enabled\n ? \"Changes wait for approval before they apply.\"\n : \"Changes apply immediately and are recorded in audit.\"}\n </p>\n </div>\n <div className=\"mt-4 space-y-2\">\n {(data?.recentApprovals || []).map((approval) => (\n <div\n key={approval.id}\n className=\"rounded-xl border px-4 py-3\"\n >\n <div className=\"text-sm font-medium text-foreground\">\n {approval.summary}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {approval.status} · requested by {approval.requestedBy}\n </div>\n </div>\n ))}\n {(data?.recentApprovals?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-6 text-sm text-muted-foreground\">\n No approval requests.\n </div>\n )}\n </div>\n </section>\n </div>\n </div>\n </details>\n </DispatchShell>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/dispatch",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "description": "Dispatch — workspace control plane for agent-native apps. Vault, integrations, destinations, scheduled jobs, and cross-app delegation, shipped as a single drop-in package.",
6
6
  "license": "MIT",
@@ -97,7 +97,7 @@
97
97
  "typescript": "^6.0.3",
98
98
  "vite": "8.0.3",
99
99
  "vitest": "^4.1.5",
100
- "@agent-native/core": "0.9.1"
100
+ "@agent-native/core": "0.10.0"
101
101
  },
102
102
  "scripts": {
103
103
  "build": "tsc && tsc-alias --resolve-full-paths",
@@ -1,4 +1,4 @@
1
- import { useRef, useState } from "react";
1
+ import { useRef, useState, type FormEvent } from "react";
2
2
  import { Button } from "@/components/ui/button";
3
3
  import { Input } from "@/components/ui/input";
4
4
  import {
@@ -27,6 +27,48 @@ export interface ConnectedAgent {
27
27
  scope?: "shared" | "personal";
28
28
  }
29
29
 
30
+ type AgentFormErrors = Partial<Record<"name" | "url" | "form", string>>;
31
+
32
+ function slugifyAgentName(value: string): string {
33
+ return value
34
+ .trim()
35
+ .toLowerCase()
36
+ .replace(/[^a-z0-9]+/g, "-")
37
+ .replace(/^-+|-+$/g, "");
38
+ }
39
+
40
+ function validateAgentForm(name: string, url: string): AgentFormErrors {
41
+ const errors: AgentFormErrors = {};
42
+ const trimmedName = name.trim();
43
+ const trimmedUrl = url.trim();
44
+
45
+ if (!trimmedName) {
46
+ errors.name = "Agent name is required.";
47
+ } else if (!slugifyAgentName(trimmedName)) {
48
+ errors.name = "Agent name must include at least one letter or number.";
49
+ }
50
+
51
+ if (!trimmedUrl) {
52
+ errors.url = "Agent endpoint URL is required.";
53
+ } else {
54
+ try {
55
+ const parsed = new URL(trimmedUrl);
56
+ if (parsed.protocol !== "https:" && parsed.protocol !== "http:") {
57
+ errors.url = "Use an http:// or https:// endpoint URL.";
58
+ } else if (!parsed.hostname) {
59
+ errors.url = "Enter a complete endpoint URL with a host.";
60
+ } else if (parsed.username || parsed.password) {
61
+ errors.url = "Do not include credentials in the endpoint URL.";
62
+ }
63
+ } catch {
64
+ errors.url =
65
+ "Enter a valid endpoint URL, such as https://app.example.com.";
66
+ }
67
+ }
68
+
69
+ return errors;
70
+ }
71
+
30
72
  export function AgentsPanel({
31
73
  agents,
32
74
  onRefresh,
@@ -38,6 +80,7 @@ export function AgentsPanel({
38
80
  const [url, setUrl] = useState("");
39
81
  const [description, setDescription] = useState("");
40
82
  const [saving, setSaving] = useState(false);
83
+ const [errors, setErrors] = useState<AgentFormErrors>({});
41
84
  const nameRef = useRef<HTMLInputElement>(null);
42
85
 
43
86
  const customAgents = agents.filter((agent) => agent.source === "custom");
@@ -46,12 +89,17 @@ export function AgentsPanel({
46
89
  );
47
90
  const builtinAgents = agents.filter((agent) => agent.source === "builtin");
48
91
 
49
- const handleAdd = async () => {
92
+ const handleAdd = async (event?: FormEvent<HTMLFormElement>) => {
93
+ event?.preventDefault();
50
94
  const trimmedName = name.trim();
51
95
  const trimmedUrl = url.trim();
52
- if (!trimmedName || !trimmedUrl) return;
96
+ const nextErrors = validateAgentForm(trimmedName, trimmedUrl);
97
+ if (Object.keys(nextErrors).length > 0) {
98
+ setErrors(nextErrors);
99
+ return;
100
+ }
53
101
 
54
- const id = trimmedName.toLowerCase().replace(/[^a-z0-9-]/g, "-");
102
+ const id = slugifyAgentName(trimmedName);
55
103
  const agentJson = JSON.stringify(
56
104
  {
57
105
  id,
@@ -79,9 +127,21 @@ export function AgentsPanel({
79
127
  setName("");
80
128
  setUrl("");
81
129
  setDescription("");
130
+ setErrors({});
82
131
  onRefresh();
83
132
  nameRef.current?.focus();
133
+ } else {
134
+ setErrors({
135
+ form: `Could not add agent. Request failed with ${res.status}.`,
136
+ });
84
137
  }
138
+ } catch (error) {
139
+ setErrors({
140
+ form:
141
+ error instanceof Error
142
+ ? error.message
143
+ : "Could not add agent. Please try again.",
144
+ });
85
145
  } finally {
86
146
  setSaving(false);
87
147
  }
@@ -230,31 +290,66 @@ export function AgentsPanel({
230
290
  <p className="mt-1 text-xs leading-relaxed text-muted-foreground">
231
291
  Add another A2A-compatible app by saving its agent endpoint here.
232
292
  </p>
233
- <div className="mt-4 space-y-3">
234
- <Input
235
- ref={nameRef}
236
- value={name}
237
- onChange={(event) => setName(event.target.value)}
238
- placeholder="Name"
239
- />
240
- <Input
241
- value={url}
242
- onChange={(event) => setUrl(event.target.value)}
243
- placeholder="https://app.example.com"
244
- />
293
+ <form className="mt-4 space-y-3" onSubmit={handleAdd} noValidate>
294
+ <div className="space-y-1.5">
295
+ <Input
296
+ ref={nameRef}
297
+ value={name}
298
+ onChange={(event) => {
299
+ setName(event.target.value);
300
+ setErrors((current) => ({ ...current, name: undefined }));
301
+ }}
302
+ placeholder="Name"
303
+ aria-invalid={Boolean(errors.name)}
304
+ aria-describedby={
305
+ errors.name ? "external-agent-name-error" : undefined
306
+ }
307
+ />
308
+ {errors.name ? (
309
+ <p
310
+ id="external-agent-name-error"
311
+ className="text-xs font-medium text-destructive"
312
+ >
313
+ {errors.name}
314
+ </p>
315
+ ) : null}
316
+ </div>
317
+ <div className="space-y-1.5">
318
+ <Input
319
+ value={url}
320
+ onChange={(event) => {
321
+ setUrl(event.target.value);
322
+ setErrors((current) => ({ ...current, url: undefined }));
323
+ }}
324
+ placeholder="https://app.example.com"
325
+ aria-invalid={Boolean(errors.url)}
326
+ aria-describedby={
327
+ errors.url ? "external-agent-url-error" : undefined
328
+ }
329
+ />
330
+ {errors.url ? (
331
+ <p
332
+ id="external-agent-url-error"
333
+ className="text-xs font-medium text-destructive"
334
+ >
335
+ {errors.url}
336
+ </p>
337
+ ) : null}
338
+ </div>
245
339
  <Input
246
340
  value={description}
247
341
  onChange={(event) => setDescription(event.target.value)}
248
342
  placeholder="Description (optional)"
249
343
  />
250
- <Button
251
- className="w-full"
252
- onClick={handleAdd}
253
- disabled={!name.trim() || !url.trim() || saving}
254
- >
344
+ {errors.form ? (
345
+ <p className="text-xs font-medium text-destructive">
346
+ {errors.form}
347
+ </p>
348
+ ) : null}
349
+ <Button type="submit" className="w-full" disabled={saving}>
255
350
  {saving ? "Saving..." : "Add agent"}
256
351
  </Button>
257
- </div>
352
+ </form>
258
353
  </div>
259
354
  </div>
260
355
  </section>
@@ -0,0 +1,48 @@
1
+ import { beforeEach, describe, expect, it, vi } from "vitest";
2
+
3
+ const frameState = vi.hoisted(() => ({ inBuilderFrame: false }));
4
+ const sendToAgentChatMock = vi.hoisted(() => vi.fn(() => "chat-tab"));
5
+
6
+ vi.mock("@agent-native/core/client", () => ({
7
+ isInBuilderFrame: () => frameState.inBuilderFrame,
8
+ sendToAgentChat: sendToAgentChatMock,
9
+ }));
10
+
11
+ const { submitOverviewPrompt } = await import("./overview-chat.js");
12
+
13
+ describe("submitOverviewPrompt", () => {
14
+ beforeEach(() => {
15
+ frameState.inBuilderFrame = false;
16
+ sendToAgentChatMock.mockClear();
17
+ });
18
+
19
+ it("sends overview prompts to a new local agent tab outside Builder", () => {
20
+ const tabId = submitOverviewPrompt(" build a metrics app ", "auto");
21
+
22
+ expect(tabId).toBe("chat-tab");
23
+ expect(sendToAgentChatMock).toHaveBeenCalledWith({
24
+ message: "build a metrics app",
25
+ submit: true,
26
+ newTab: true,
27
+ model: "auto",
28
+ });
29
+ });
30
+
31
+ it("routes overview prompts to Builder chat inside Builder", () => {
32
+ frameState.inBuilderFrame = true;
33
+
34
+ const tabId = submitOverviewPrompt("ship the onboarding flow", "auto");
35
+
36
+ expect(tabId).toBe("chat-tab");
37
+ expect(sendToAgentChatMock).toHaveBeenCalledWith({
38
+ message: "ship the onboarding flow",
39
+ submit: true,
40
+ type: "code",
41
+ });
42
+ });
43
+
44
+ it("ignores empty prompts", () => {
45
+ expect(submitOverviewPrompt(" ", "auto")).toBeNull();
46
+ expect(sendToAgentChatMock).not.toHaveBeenCalled();
47
+ });
48
+ });
@@ -0,0 +1,24 @@
1
+ import { isInBuilderFrame, sendToAgentChat } from "@agent-native/core/client";
2
+
3
+ export function submitOverviewPrompt(
4
+ message: string,
5
+ selectedModel?: string | null,
6
+ ): string | null {
7
+ const trimmed = message.trim();
8
+ if (!trimmed) return null;
9
+
10
+ if (isInBuilderFrame()) {
11
+ return sendToAgentChat({
12
+ message: trimmed,
13
+ submit: true,
14
+ type: "code",
15
+ });
16
+ }
17
+
18
+ return sendToAgentChat({
19
+ message: trimmed,
20
+ submit: true,
21
+ newTab: true,
22
+ model: selectedModel || undefined,
23
+ });
24
+ }
@@ -2,7 +2,6 @@ import { useEffect, useMemo, useState } from "react";
2
2
  import { Link } from "react-router";
3
3
  import {
4
4
  PromptComposer,
5
- sendToAgentChat,
6
5
  useActionQuery,
7
6
  useChatModels,
8
7
  agentNativePath,
@@ -34,6 +33,7 @@ import {
34
33
  TooltipContent,
35
34
  TooltipTrigger,
36
35
  } from "@/components/ui/tooltip";
36
+ import { submitOverviewPrompt } from "@/lib/overview-chat";
37
37
 
38
38
  interface IntegrationStatus {
39
39
  platform: string;
@@ -99,17 +99,12 @@ function HomeChatPanel() {
99
99
  const { selectedModel } = useChatModels();
100
100
 
101
101
  const send = (message: string) => {
102
- sendToAgentChat({
103
- message,
104
- submit: true,
105
- newTab: true,
106
- model: selectedModel || undefined,
107
- });
102
+ submitOverviewPrompt(message, selectedModel);
108
103
  };
109
104
 
110
105
  return (
111
106
  <section className="px-2 py-6 sm:py-10">
112
- <div className="mx-auto w-full max-w-2xl space-y-5">
107
+ <div className="mx-auto w-full max-w-2xl space-y-8">
113
108
  <h1 className="text-center text-2xl font-semibold tracking-tight text-foreground sm:text-3xl">
114
109
  What should we do next?
115
110
  </h1>