@agent-native/dispatch 0.14.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/actions/navigate.js +1 -1
  2. package/dist/actions/navigate.js.map +1 -1
  3. package/dist/actions/view-screen.js +9 -0
  4. package/dist/actions/view-screen.js.map +1 -1
  5. package/dist/components/layout/Layout.d.ts.map +1 -1
  6. package/dist/components/layout/Layout.js +75 -70
  7. package/dist/components/layout/Layout.js.map +1 -1
  8. package/dist/components/messaging-setup-panel.d.ts.map +1 -1
  9. package/dist/components/messaging-setup-panel.js +15 -2
  10. package/dist/components/messaging-setup-panel.js.map +1 -1
  11. package/dist/routes/index.d.ts.map +1 -1
  12. package/dist/routes/index.js +1 -0
  13. package/dist/routes/index.js.map +1 -1
  14. package/dist/routes/pages/operations.d.ts +5 -0
  15. package/dist/routes/pages/operations.d.ts.map +1 -0
  16. package/dist/routes/pages/operations.js +51 -0
  17. package/dist/routes/pages/operations.js.map +1 -0
  18. package/dist/routes/pages/overview.d.ts +2 -2
  19. package/dist/server/lib/dispatch-routing.js +1 -1
  20. package/dist/server/lib/dispatch-routing.js.map +1 -1
  21. package/dist/server/lib/env-config.js +1 -1
  22. package/dist/server/lib/env-config.js.map +1 -1
  23. package/package.json +2 -2
  24. package/src/actions/navigate.ts +1 -1
  25. package/src/actions/view-screen.ts +11 -0
  26. package/src/components/layout/Layout.spec.tsx +154 -0
  27. package/src/components/layout/Layout.tsx +196 -189
  28. package/src/components/messaging-setup-panel.spec.tsx +17 -1
  29. package/src/components/messaging-setup-panel.tsx +81 -1
  30. package/src/routes/index.spec.ts +23 -0
  31. package/src/routes/index.ts +1 -0
  32. package/src/routes/pages/operations.tsx +134 -0
  33. package/src/server/lib/dispatch-routing.spec.ts +2 -0
  34. package/src/server/lib/dispatch-routing.ts +1 -1
  35. package/src/server/lib/env-config.ts +1 -1
  36. package/src/styles/dispatch-css.spec.ts +11 -0
@@ -0,0 +1,23 @@
1
+ import { describe, expect, it } from "vitest";
2
+
3
+ import { dispatchRoutes } from "./index.js";
4
+
5
+ describe("Dispatch route registration", () => {
6
+ it("registers chat and operator routes before the workspace-app fallback", () => {
7
+ const routes = dispatchRoutes as Array<{
8
+ path?: string;
9
+ file?: string;
10
+ index?: boolean;
11
+ }>;
12
+ const paths = routes.map((route) => route.path);
13
+
14
+ expect(paths).toContain("chat");
15
+ expect(paths).toContain("chat/:threadId");
16
+ expect(paths).toContain("operations");
17
+ expect(paths.indexOf("chat")).toBeLessThan(paths.indexOf(":appId"));
18
+ expect(paths.indexOf("chat/:threadId")).toBeLessThan(
19
+ paths.indexOf(":appId"),
20
+ );
21
+ expect(paths.indexOf("operations")).toBeLessThan(paths.indexOf(":appId"));
22
+ });
23
+ });
@@ -35,6 +35,7 @@ export const dispatchRoutes: RouteConfig = [
35
35
  route("chat/:threadId", "./pages/chat.js"),
36
36
  route("overview", "./pages/overview.js"),
37
37
  route("metrics", "./pages/metrics.js"),
38
+ route("operations", "./pages/operations.js"),
38
39
  route("apps", "./pages/apps.js"),
39
40
  route("apps/:appId", "./pages/apps.$appId.js"),
40
41
  route("new-app", "./pages/new-app.js"),
@@ -0,0 +1,134 @@
1
+ import {
2
+ DbAdminPage,
3
+ ObservabilityDashboard,
4
+ useT,
5
+ } from "@agent-native/core/client";
6
+ import {
7
+ IconActivity,
8
+ IconArrowUpRight,
9
+ IconDatabase,
10
+ IconHistory,
11
+ IconMessages,
12
+ IconSend,
13
+ } from "@tabler/icons-react";
14
+ import { Link, useSearchParams } from "react-router";
15
+
16
+ import { DispatchShell } from "../../components/dispatch-shell";
17
+ import {
18
+ Tabs,
19
+ TabsContent,
20
+ TabsList,
21
+ TabsTrigger,
22
+ } from "../../components/ui/tabs";
23
+
24
+ type OperationsView = "monitoring" | "database";
25
+
26
+ function selectedView(value: string | null): OperationsView {
27
+ return value === "database" ? "database" : "monitoring";
28
+ }
29
+
30
+ function OperationsShortcuts() {
31
+ const t = useT();
32
+
33
+ const tools = [
34
+ {
35
+ to: "/thread-debug",
36
+ icon: IconMessages,
37
+ title: t("dispatch.nav.threadDebug", { defaultValue: "Thread debug" }),
38
+ },
39
+ {
40
+ to: "/audit",
41
+ icon: IconHistory,
42
+ title: t("dispatch.nav.audit"),
43
+ },
44
+ {
45
+ to: "/destinations",
46
+ icon: IconSend,
47
+ title: t("dispatch.pages.deliveryQueue"),
48
+ },
49
+ ];
50
+
51
+ return (
52
+ <section className="border-t pt-5">
53
+ <h2 className="text-sm font-semibold text-foreground">
54
+ {t("dispatch.nav.advanced", { defaultValue: "Related tools" })}
55
+ </h2>
56
+ <div className="mt-2 grid gap-x-6 gap-y-1 lg:grid-cols-3">
57
+ {tools.map(({ to, icon: Icon, title }) => (
58
+ <Link
59
+ key={to}
60
+ to={to}
61
+ className="group flex min-w-0 items-start gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-muted"
62
+ >
63
+ <Icon
64
+ size={16}
65
+ className="mt-0.5 shrink-0 text-muted-foreground transition-colors group-hover:text-foreground"
66
+ />
67
+ <span className="min-w-0">
68
+ <span className="flex items-center gap-1 font-medium text-foreground">
69
+ <span className="truncate">{title}</span>
70
+ <IconArrowUpRight
71
+ size={13}
72
+ className="shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"
73
+ />
74
+ </span>
75
+ </span>
76
+ </Link>
77
+ ))}
78
+ </div>
79
+ </section>
80
+ );
81
+ }
82
+
83
+ export function meta() {
84
+ return [{ title: "Operations — Dispatch" }];
85
+ }
86
+
87
+ export default function OperationsRoute() {
88
+ const t = useT();
89
+ const [searchParams, setSearchParams] = useSearchParams();
90
+ const view = selectedView(searchParams.get("view"));
91
+
92
+ function setView(nextView: OperationsView) {
93
+ const next = new URLSearchParams(searchParams);
94
+ if (nextView === "monitoring") next.delete("view");
95
+ else next.set("view", nextView);
96
+ setSearchParams(next, { replace: true });
97
+ }
98
+
99
+ return (
100
+ <DispatchShell title={t("dispatch.nav.operations")}>
101
+ <Tabs
102
+ value={view}
103
+ onValueChange={(value) => {
104
+ if (value === "monitoring" || value === "database") setView(value);
105
+ }}
106
+ className="flex min-w-0 flex-col gap-5"
107
+ >
108
+ <TabsList className="w-fit">
109
+ <TabsTrigger value="monitoring">
110
+ <IconActivity size={15} />
111
+ {t("dispatch.pages.monitoring")}
112
+ </TabsTrigger>
113
+ <TabsTrigger value="database">
114
+ <IconDatabase size={15} />
115
+ {t("dispatch.pages.database")}
116
+ </TabsTrigger>
117
+ </TabsList>
118
+
119
+ <TabsContent value="monitoring" className="mt-0 min-w-0">
120
+ <ObservabilityDashboard />
121
+ <div className="mt-8">
122
+ <OperationsShortcuts />
123
+ </div>
124
+ </TabsContent>
125
+
126
+ <TabsContent value="database" className="mt-0 min-w-0">
127
+ <div className="min-h-[620px] overflow-hidden rounded-lg border bg-background">
128
+ <DbAdminPage title={t("dispatch.pages.database")} />
129
+ </div>
130
+ </TabsContent>
131
+ </Tabs>
132
+ </DispatchShell>
133
+ );
134
+ }
@@ -6,6 +6,8 @@ describe("dispatchIntegrationRoutingHint", () => {
6
6
  it.each([
7
7
  "File a security review request for the platform team",
8
8
  "Add this hiring ask to the intake board",
9
+ "Add two design tasks for the launch page",
10
+ "Create a design task for the new onboarding flow",
9
11
  "Create a vendor request form with the required fields",
10
12
  "What is currently in the editorial requests queue?",
11
13
  ])(
@@ -1,5 +1,5 @@
1
1
  const STRUCTURED_INTAKE_PATTERNS = [
2
- /\b(?:file|submit|add|log|track|triage|prioriti[sz]e)\b.{0,64}\b(?:asks?|requests?|tickets?|intake)\b/i,
2
+ /\b(?:file|submit|add|log|track|triage|prioriti[sz]e|create)\b.{0,64}\b(?:asks?|requests?|tickets?|tasks?|intake)\b/i,
3
3
  /\b(?:asks?|requests?|tickets?|intake)\b.{0,64}\b(?:database|table|board|form|queue|priority|deadline|urgency)\b/i,
4
4
  /\b(?:database|table|board|form|queue)\b.{0,64}\b(?:asks?|requests?|tickets?|intake|priority|deadline|urgency)\b/i,
5
5
  ];
@@ -3,7 +3,7 @@ import type { EnvKeyConfig } from "@agent-native/core/server";
3
3
  export const envKeys: EnvKeyConfig[] = [
4
4
  {
5
5
  key: "SLACK_BOT_TOKEN",
6
- label: "Slack bot token",
6
+ label: "Slack bot token (legacy)",
7
7
  required: false,
8
8
  },
9
9
  {
@@ -62,4 +62,15 @@ describe("dispatch route shells", () => {
62
62
 
63
63
  expect(chatRoute).toContain("@agent-native/dispatch/routes/pages/chat");
64
64
  });
65
+
66
+ it("re-exports the operations console from the Dispatch template", () => {
67
+ const operationsRoute = fs.readFileSync(
68
+ path.join(repoRoot, "templates/dispatch/app/routes/operations.tsx"),
69
+ "utf-8",
70
+ );
71
+
72
+ expect(operationsRoute).toContain(
73
+ "@agent-native/dispatch/routes/pages/operations",
74
+ );
75
+ });
65
76
  });