@agent-native/dispatch 0.40.0 → 0.40.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 (121) hide show
  1. package/CHANGELOG.md +38 -12
  2. package/dist/actions/provider-api-register.d.ts +7 -7
  3. package/dist/components/app-open-actions.d.ts +1 -1
  4. package/dist/components/app-open-actions.d.ts.map +1 -1
  5. package/dist/components/app-open-actions.js +1 -1
  6. package/dist/components/app-open-actions.js.map +1 -1
  7. package/dist/components/app-row-settings.js +1 -1
  8. package/dist/components/app-row-settings.js.map +1 -1
  9. package/dist/components/automation-create-dialog.js +2 -2
  10. package/dist/components/automation-create-dialog.js.map +1 -1
  11. package/dist/components/automation-details-panel.js +1 -1
  12. package/dist/components/automation-details-panel.js.map +1 -1
  13. package/dist/components/chat-home-apps.js +1 -1
  14. package/dist/components/chat-home-apps.js.map +1 -1
  15. package/dist/components/create-app-popover.js +3 -3
  16. package/dist/components/create-app-popover.js.map +1 -1
  17. package/dist/components/dispatch-control-plane.d.ts.map +1 -1
  18. package/dist/components/dispatch-control-plane.js +9 -30
  19. package/dist/components/dispatch-control-plane.js.map +1 -1
  20. package/dist/components/layout/Header.js +2 -2
  21. package/dist/components/layout/Header.js.map +1 -1
  22. package/dist/components/layout/Layout.d.ts +6 -5
  23. package/dist/components/layout/Layout.d.ts.map +1 -1
  24. package/dist/components/layout/Layout.js +73 -113
  25. package/dist/components/layout/Layout.js.map +1 -1
  26. package/dist/components/layout/workspace-apps-rail.d.ts.map +1 -1
  27. package/dist/components/layout/workspace-apps-rail.js +7 -19
  28. package/dist/components/layout/workspace-apps-rail.js.map +1 -1
  29. package/dist/components/messaging-setup-panel.js +2 -1
  30. package/dist/components/messaging-setup-panel.js.map +1 -1
  31. package/dist/components/workspace-app-card.js +2 -2
  32. package/dist/components/workspace-app-card.js.map +1 -1
  33. package/dist/components/workspace-app-host.d.ts +1 -1
  34. package/dist/components/workspace-app-host.d.ts.map +1 -1
  35. package/dist/components/workspace-app-host.js +7 -74
  36. package/dist/components/workspace-app-host.js.map +1 -1
  37. package/dist/hooks/use-navigation-state.js +1 -1
  38. package/dist/hooks/use-navigation-state.js.map +1 -1
  39. package/dist/lib/workspace-apps.js +1 -1
  40. package/dist/lib/workspace-apps.js.map +1 -1
  41. package/dist/routes/pages/$appId.js +1 -1
  42. package/dist/routes/pages/$appId.js.map +1 -1
  43. package/dist/routes/pages/_index.js +1 -1
  44. package/dist/routes/pages/_index.js.map +1 -1
  45. package/dist/routes/pages/admin._index.js +1 -1
  46. package/dist/routes/pages/admin._index.js.map +1 -1
  47. package/dist/routes/pages/agent-integrations.js +1 -1
  48. package/dist/routes/pages/agent-integrations.js.map +1 -1
  49. package/dist/routes/pages/apps.d.ts.map +1 -1
  50. package/dist/routes/pages/apps.js +3 -43
  51. package/dist/routes/pages/apps.js.map +1 -1
  52. package/dist/routes/pages/browser-chat.js +1 -1
  53. package/dist/routes/pages/browser-chat.js.map +1 -1
  54. package/dist/routes/pages/chat.d.ts.map +1 -1
  55. package/dist/routes/pages/chat.js +24 -43
  56. package/dist/routes/pages/chat.js.map +1 -1
  57. package/dist/routes/pages/extensions.$id.js +1 -1
  58. package/dist/routes/pages/extensions.$id.js.map +1 -1
  59. package/dist/routes/pages/extensions._index.js +1 -1
  60. package/dist/routes/pages/extensions._index.js.map +1 -1
  61. package/dist/routes/pages/integrations.js +1 -1
  62. package/dist/routes/pages/integrations.js.map +1 -1
  63. package/dist/routes/pages/new-app.js +1 -1
  64. package/dist/routes/pages/new-app.js.map +1 -1
  65. package/dist/routes/pages/operations.js +2 -2
  66. package/dist/routes/pages/operations.js.map +1 -1
  67. package/dist/routes/pages/overview.d.ts +2 -2
  68. package/dist/routes/pages/settings.d.ts.map +1 -1
  69. package/dist/routes/pages/settings.js +26 -8
  70. package/dist/routes/pages/settings.js.map +1 -1
  71. package/dist/routes/pages/tools.$id.js +1 -1
  72. package/dist/routes/pages/tools.$id.js.map +1 -1
  73. package/dist/routes/pages/tools._index.js +1 -1
  74. package/dist/routes/pages/tools._index.js.map +1 -1
  75. package/dist/routes/pages/vault.d.ts +1 -1
  76. package/dist/routes/pages/vault.js +1 -1
  77. package/dist/routes/pages/vault.js.map +1 -1
  78. package/dist/shared/app-roles.js.map +1 -1
  79. package/package.json +3 -3
  80. package/src/components/app-open-actions.tsx +1 -1
  81. package/src/components/app-row-settings.tsx +1 -1
  82. package/src/components/automation-create-dialog.tsx +7 -7
  83. package/src/components/automation-details-panel.tsx +1 -1
  84. package/src/components/chat-home-apps.tsx +1 -1
  85. package/src/components/create-app-popover.spec.tsx +5 -7
  86. package/src/components/create-app-popover.tsx +3 -3
  87. package/src/components/dispatch-control-plane.spec.tsx +12 -19
  88. package/src/components/dispatch-control-plane.tsx +10 -84
  89. package/src/components/layout/Header.tsx +2 -2
  90. package/src/components/layout/Layout.app-chat.spec.ts +1 -0
  91. package/src/components/layout/Layout.spec.tsx +18 -20
  92. package/src/components/layout/Layout.tsx +153 -205
  93. package/src/components/layout/workspace-apps-rail.spec.tsx +79 -0
  94. package/src/components/layout/workspace-apps-rail.tsx +6 -30
  95. package/src/components/messaging-setup-panel.tsx +1 -1
  96. package/src/components/workspace-app-card.tsx +2 -2
  97. package/src/components/workspace-app-chat-rail.spec.tsx +1 -1
  98. package/src/components/workspace-app-host.spec.tsx +19 -19
  99. package/src/components/workspace-app-host.tsx +12 -129
  100. package/src/hooks/use-navigation-state.ts +1 -1
  101. package/src/lib/workspace-apps.ts +1 -1
  102. package/src/routes/pages/$appId.tsx +1 -1
  103. package/src/routes/pages/_index.tsx +1 -1
  104. package/src/routes/pages/admin._index.tsx +1 -1
  105. package/src/routes/pages/agent-integrations.tsx +1 -1
  106. package/src/routes/pages/apps.tsx +2 -86
  107. package/src/routes/pages/automations.spec.tsx +1 -1
  108. package/src/routes/pages/browser-chat.tsx +1 -1
  109. package/src/routes/pages/chat.spec.tsx +23 -46
  110. package/src/routes/pages/chat.tsx +20 -57
  111. package/src/routes/pages/extensions.$id.tsx +1 -1
  112. package/src/routes/pages/extensions._index.tsx +1 -1
  113. package/src/routes/pages/integrations.tsx +1 -1
  114. package/src/routes/pages/new-app.tsx +1 -1
  115. package/src/routes/pages/operations.tsx +2 -2
  116. package/src/routes/pages/settings.spec.tsx +30 -8
  117. package/src/routes/pages/settings.tsx +75 -7
  118. package/src/routes/pages/tools.$id.tsx +1 -1
  119. package/src/routes/pages/tools._index.tsx +1 -1
  120. package/src/routes/pages/vault.tsx +1 -1
  121. package/src/shared/app-roles.ts +1 -1
@@ -1,3 +1,8 @@
1
+ import {
2
+ useActionMutation,
3
+ useActionQuery,
4
+ } from "@agent-native/core/client/hooks";
5
+ import { useT } from "@agent-native/core/client/i18n";
1
6
  import {
2
7
  DEFAULT_AUTOMATION_SCHEDULE_DRAFT,
3
8
  AUTOMATION_WEEKDAYS,
@@ -6,16 +11,11 @@ import {
6
11
  type AutomationScheduleDraft,
7
12
  type AutomationSchedulePreset,
8
13
  type AutomationScheduleUnit,
9
- } from "@agent-native/core/client/agent-page/automation-schedule";
14
+ } from "@agent-native/toolkit/app/agent-page/automation-schedule";
10
15
  import {
11
16
  TimezoneSelect,
12
17
  browserTimezone,
13
- } from "@agent-native/core/client/agent-page/timezone-select";
14
- import {
15
- useActionMutation,
16
- useActionQuery,
17
- } from "@agent-native/core/client/hooks";
18
- import { useT } from "@agent-native/core/client/i18n";
18
+ } from "@agent-native/toolkit/app/agent-page/TimezoneSelect";
19
19
  import {
20
20
  IconBolt,
21
21
  IconCalendarEvent,
@@ -1,7 +1,7 @@
1
1
  import { appPath } from "@agent-native/core/client/api-path";
2
- import { writeClipboardText } from "@agent-native/core/client/clipboard";
3
2
  import { useActionQuery } from "@agent-native/core/client/hooks";
4
3
  import { useT } from "@agent-native/core/client/i18n";
4
+ import { writeClipboardText } from "@agent-native/toolkit/clipboard";
5
5
  import {
6
6
  IconAlertTriangle,
7
7
  IconCheck,
@@ -1,5 +1,5 @@
1
- import { AppOpenActions } from "@agent-native/core/client/chat-first";
2
1
  import { useT } from "@agent-native/core/client/i18n";
2
+ import { AppOpenActions } from "@agent-native/toolkit/app/chat/chat-first";
3
3
  import { IconArrowUpRight, IconPlus } from "@tabler/icons-react";
4
4
  import { useMemo, useState } from "react";
5
5
  import { Link } from "react-router";
@@ -31,7 +31,7 @@ vi.mock("@agent-native/core/client/host", () => ({
31
31
  isInBuilderFrame: () => frameState.inBuilderFrame,
32
32
  }));
33
33
 
34
- vi.mock("@agent-native/core/client/settings/useBuilderStatus", () => ({
34
+ vi.mock("@agent-native/toolkit/app/settings/useBuilderStatus", () => ({
35
35
  useBuilderConnectFlow: () => ({
36
36
  configured: false,
37
37
  connecting: builderConnectFlowState.connecting,
@@ -41,15 +41,13 @@ vi.mock("@agent-native/core/client/settings/useBuilderStatus", () => ({
41
41
  }),
42
42
  }));
43
43
 
44
- vi.mock("@agent-native/core/client/settings", async (importOriginal) => {
45
- const settings =
46
- await importOriginal<typeof import("@agent-native/core/client/settings")>();
44
+ vi.mock("@agent-native/toolkit/app/settings", async () => {
47
45
  const { BuilderConnectPopover } =
48
- await import("../../../core/src/client/settings/BuilderConnectPopover.js");
49
- return { ...settings, BuilderConnectPopover };
46
+ await import("../../../toolkit/src/app/settings/BuilderConnectPopover.js");
47
+ return { BuilderConnectPopover };
50
48
  });
51
49
 
52
- vi.mock("@agent-native/core/client/composer", async () => {
50
+ vi.mock("@agent-native/toolkit/app/chat/composer/index", async () => {
53
51
  const ReactModule = await import("react");
54
52
  return {
55
53
  PromptComposer: ({
@@ -4,16 +4,16 @@ import {
4
4
  agentNativePath,
5
5
  appBasePath,
6
6
  } from "@agent-native/core/client/api-path";
7
- import { PromptComposer } from "@agent-native/core/client/composer";
8
7
  import { isInBuilderFrame } from "@agent-native/core/client/host";
9
- import { BuilderConnectPopover } from "@agent-native/core/client/settings";
10
- import { useBuilderConnectFlow } from "@agent-native/core/client/settings/useBuilderStatus";
11
8
  import {
12
9
  buildChatFirstAppCreationPrompt,
13
10
  docsUrl,
14
11
  getWorkspaceAppIdValidationError,
15
12
  titleFromChatFirstAppPrompt,
16
13
  } from "@agent-native/core/shared";
14
+ import { PromptComposer } from "@agent-native/toolkit/app/chat/composer/index";
15
+ import { BuilderConnectPopover } from "@agent-native/toolkit/app/settings";
16
+ import { useBuilderConnectFlow } from "@agent-native/toolkit/app/settings/useBuilderStatus";
17
17
  import {
18
18
  IconAlertTriangle,
19
19
  IconArrowLeft,
@@ -43,7 +43,7 @@ vi.mock("@agent-native/core/client/agent-chat", () => ({
43
43
  useChatModels: clientState.useChatModels,
44
44
  }));
45
45
 
46
- vi.mock("@agent-native/core/client/composer", () => ({
46
+ vi.mock("@agent-native/toolkit/app/chat/composer/index", () => ({
47
47
  PromptBar: ({ children }: { children?: React.ReactNode }) => (
48
48
  <div data-prompt-bar="inline">{children}</div>
49
49
  ),
@@ -293,7 +293,7 @@ describe("DispatchControlPlane", () => {
293
293
  });
294
294
  });
295
295
 
296
- it("shows mounted and connected apps together without duplicates", async () => {
296
+ it("shows apps built in this workspace without cross-workspace catalogs", async () => {
297
297
  clientState.workspaceApps = [
298
298
  {
299
299
  id: "onboarding",
@@ -378,10 +378,10 @@ describe("DispatchControlPlane", () => {
378
378
  });
379
379
 
380
380
  expect(container.textContent).toContain("Onboarding");
381
- expect(container.textContent).toContain("Mail");
382
- expect(container.textContent).toContain("Custom app");
381
+ expect(container.textContent).not.toContain("Mail");
382
+ expect(container.textContent).not.toContain("Custom app");
383
383
  expect(container.textContent).not.toContain("Clips");
384
- expect(container.textContent).toContain("Analytics");
384
+ expect(container.textContent).not.toContain("Analytics");
385
385
  expect(container.textContent).toContain("Apps");
386
386
  expect(container.textContent).toContain("New");
387
387
  expect(
@@ -392,16 +392,10 @@ describe("DispatchControlPlane", () => {
392
392
  );
393
393
  expect(viewAllLink?.className).toContain("text-muted-foreground");
394
394
  expect(container.textContent).not.toContain("Other apps");
395
- expect(container.textContent).not.toContain("available");
395
+ expect(container.textContent).not.toContain("Available apps");
396
396
  expect(container.textContent).not.toContain("Archived app");
397
397
  expect(container.textContent).not.toContain("Duplicate onboarding");
398
398
  expect(container.textContent).not.toContain("CRM");
399
- expect(
400
- Array.from(container.querySelectorAll("a")).some(
401
- (anchor) =>
402
- anchor.getAttribute("href") === "https://custom.agent-native.com",
403
- ),
404
- ).toBe(true);
405
399
  expect(
406
400
  container.querySelectorAll(
407
401
  'button[aria-label="Open options for Onboarding"]',
@@ -422,7 +416,7 @@ describe("DispatchControlPlane", () => {
422
416
  expect(onboardingNewTabLink).not.toBeNull();
423
417
  });
424
418
 
425
- it("searches available apps case-insensitively before showing the empty state", async () => {
419
+ it("searches only apps in this workspace", async () => {
426
420
  clientState.workspaceApps = [
427
421
  {
428
422
  id: "analytics",
@@ -462,16 +456,15 @@ describe("DispatchControlPlane", () => {
462
456
  });
463
457
 
464
458
  await searchApps("Brain");
465
- expect(container.textContent).toContain("Brain");
466
- expect(container.textContent).not.toContain("Assets");
467
- expect(container.textContent).not.toContain("No apps match your search");
459
+ expect(container.textContent).toContain("No apps match your search");
460
+ expect(container.querySelectorAll("article")).toHaveLength(0);
468
461
 
469
462
  await searchApps("brain");
470
- expect(container.textContent).toContain("Brain");
471
- expect(container.textContent).not.toContain("Assets");
463
+ expect(container.textContent).toContain("No apps match your search");
464
+ expect(container.querySelectorAll("article")).toHaveLength(0);
472
465
 
473
466
  await searchApps("missing app");
474
467
  expect(container.textContent).toContain("No apps match your search");
475
- expect(container.textContent).not.toContain("Brain");
468
+ expect(container.querySelectorAll("article")).toHaveLength(0);
476
469
  });
477
470
  });
@@ -3,16 +3,18 @@ import {
3
3
  navigateWithAgentChatViewTransition,
4
4
  useChatModels,
5
5
  } from "@agent-native/core/client/agent-chat";
6
- import { PromptBar, PromptComposer } from "@agent-native/core/client/composer";
7
6
  import { useActionQuery } from "@agent-native/core/client/hooks";
8
7
  import { useT } from "@agent-native/core/client/i18n";
9
8
  import { useOrgRole } from "@agent-native/core/client/org";
9
+ import {
10
+ PromptBar,
11
+ PromptComposer,
12
+ } from "@agent-native/toolkit/app/chat/composer/index";
10
13
  import { IconChevronDown, IconClockHour4, IconPlus } from "@tabler/icons-react";
11
14
  import type { ReactNode } from "react";
12
15
  import { useState } from "react";
13
16
  import { Link, useNavigate } from "react-router";
14
17
 
15
- import type { ConnectedAppSummary } from "../lib/other-apps";
16
18
  import { cn } from "../lib/utils";
17
19
  import {
18
20
  orderWorkspaceApps,
@@ -31,11 +33,6 @@ import {
31
33
  } from "./app-list-row";
32
34
  import { CreateAppPopover } from "./create-app-popover";
33
35
  import { useSetPageTitle } from "./layout/HeaderActions";
34
- import {
35
- filterOtherAppEntries,
36
- mergeOtherAppEntries,
37
- OtherAppsSection,
38
- } from "./other-apps-section";
39
36
  import { Button } from "./ui/button";
40
37
  import {
41
38
  Collapsible,
@@ -48,7 +45,6 @@ import {
48
45
  WorkspaceAppSearch,
49
46
  WorkspaceAppSearchEmpty,
50
47
  } from "./workspace-app-search";
51
- import type { CuratedWorkspaceTemplatesResult } from "./workspace-template-card";
52
48
 
53
49
  function SectionHeader({
54
50
  title,
@@ -163,25 +159,9 @@ function CommandPanel() {
163
159
  function AppsPanel({
164
160
  apps,
165
161
  isLoading,
166
- connectedApps,
167
- connectedAppsError,
168
- connectedAppsLoading,
169
- onRetryConnectedApps,
170
- curatedTemplates,
171
- curatedTemplatesError,
172
- curatedTemplatesLoading,
173
- onRetryCuratedTemplates,
174
162
  }: {
175
163
  apps: WorkspaceAppSummary[];
176
164
  isLoading: boolean;
177
- connectedApps: ConnectedAppSummary[];
178
- connectedAppsError?: Error | null;
179
- connectedAppsLoading: boolean;
180
- onRetryConnectedApps: () => void;
181
- curatedTemplates?: CuratedWorkspaceTemplatesResult;
182
- curatedTemplatesError?: Error | null;
183
- curatedTemplatesLoading: boolean;
184
- onRetryCuratedTemplates: () => void;
185
165
  }) {
186
166
  const t = useT();
187
167
  const [showPending, setShowPending] = useState(false);
@@ -200,20 +180,8 @@ function AppsPanel({
200
180
  const filteredPendingApps = orderedPendingApps.filter((app) =>
201
181
  workspaceAppMatchesQuery(app, searchQuery),
202
182
  );
203
- const otherAppEntries = filterOtherAppEntries(
204
- mergeOtherAppEntries({
205
- templates: curatedTemplates,
206
- connectedApps,
207
- workspaceApps: apps,
208
- }),
209
- searchQuery,
210
- );
211
183
  const hasSearchResults =
212
- filteredActiveApps.length > 0 ||
213
- filteredPendingApps.length > 0 ||
214
- otherAppEntries.length > 0;
215
- const otherAppsLoading = curatedTemplatesLoading || connectedAppsLoading;
216
- const otherAppsError = curatedTemplatesError || connectedAppsError;
184
+ filteredActiveApps.length > 0 || filteredPendingApps.length > 0;
217
185
  const showSkeletons =
218
186
  isLoading && activeApps.length === 0 && pendingApps.length === 0;
219
187
 
@@ -229,9 +197,7 @@ function AppsPanel({
229
197
  </Link>
230
198
  </Button>
231
199
  {!showSkeletons &&
232
- (visibleApps.length > 0 ||
233
- otherAppEntries.length > 0 ||
234
- Boolean(searchQuery.trim())) ? (
200
+ (visibleApps.length > 0 || Boolean(searchQuery.trim())) ? (
235
201
  <WorkspaceAppSearch
236
202
  className="w-[220px]"
237
203
  query={searchQuery}
@@ -263,10 +229,7 @@ function AppsPanel({
263
229
  ) : null}
264
230
  {showSkeletons ? (
265
231
  <OverviewAppsSkeleton />
266
- ) : searchQuery.trim() &&
267
- !hasSearchResults &&
268
- !otherAppsLoading &&
269
- !otherAppsError ? (
232
+ ) : searchQuery.trim() && !hasSearchResults ? (
270
233
  <WorkspaceAppSearchEmpty
271
234
  query={searchQuery}
272
235
  onClear={() => setSearchQuery("")}
@@ -284,32 +247,14 @@ function AppsPanel({
284
247
  />
285
248
  ))}
286
249
  {filteredActiveApps.length === 0 &&
287
- !searchQuery.trim() &&
288
- otherAppEntries.length === 0 &&
289
- !curatedTemplatesLoading &&
290
- !connectedAppsLoading &&
291
- !curatedTemplatesError &&
292
- !connectedAppsError ? (
250
+ pendingApps.length === 0 &&
251
+ !searchQuery.trim() ? (
293
252
  <p className="px-4 py-3 text-sm text-muted-foreground">
294
253
  {t("dispatch.pages.noApps", {
295
254
  defaultValue: "No apps yet.",
296
255
  })}
297
256
  </p>
298
257
  ) : null}
299
- <OtherAppsSection
300
- templates={curatedTemplates}
301
- connectedApps={connectedApps}
302
- workspaceApps={apps}
303
- templatesLoading={curatedTemplatesLoading}
304
- connectedAppsLoading={connectedAppsLoading}
305
- templatesError={curatedTemplatesError}
306
- connectedAppsError={connectedAppsError}
307
- query={searchQuery}
308
- onRetryTemplates={onRetryCuratedTemplates}
309
- onRetryConnectedApps={onRetryConnectedApps}
310
- heading={null}
311
- embeddedInList
312
- />
313
258
  </AppList>
314
259
  </>
315
260
  )}
@@ -405,14 +350,6 @@ export function DispatchControlPlane() {
405
350
  "list-workspace-apps",
406
351
  { includeAgentCards: false, includeArchived: true },
407
352
  );
408
- const connectedAppsQuery = useActionQuery<ConnectedAppSummary[]>(
409
- "list-connected-agents",
410
- {},
411
- );
412
- const curatedTemplatesQuery = useActionQuery<CuratedWorkspaceTemplatesResult>(
413
- "list-curated-workspace-templates",
414
- {},
415
- );
416
353
  const { data: workspaceApps = [], isLoading: appsLoading } = appsQuery;
417
354
 
418
355
  return (
@@ -424,18 +361,7 @@ export function DispatchControlPlane() {
424
361
  onRetry={() => void appsQuery.refetch()}
425
362
  />
426
363
  ) : (
427
- <AppsPanel
428
- apps={workspaceApps ?? []}
429
- isLoading={appsLoading}
430
- connectedApps={connectedAppsQuery.data ?? []}
431
- connectedAppsError={connectedAppsQuery.error}
432
- connectedAppsLoading={connectedAppsQuery.isLoading}
433
- onRetryConnectedApps={() => void connectedAppsQuery.refetch()}
434
- curatedTemplates={curatedTemplatesQuery.data}
435
- curatedTemplatesError={curatedTemplatesQuery.error}
436
- curatedTemplatesLoading={curatedTemplatesQuery.isLoading}
437
- onRetryCuratedTemplates={() => void curatedTemplatesQuery.refetch()}
438
- />
364
+ <AppsPanel apps={workspaceApps ?? []} isLoading={appsLoading} />
439
365
  )}
440
366
  </div>
441
367
  );
@@ -1,5 +1,5 @@
1
- import { AgentToggleButton } from "@agent-native/core/client/agent-chat";
2
- import { RunsTray } from "@agent-native/core/client/progress";
1
+ import { AgentToggleButton } from "@agent-native/toolkit/app/chat";
2
+ import { RunsTray } from "@agent-native/toolkit/app/progress";
3
3
  import { IconLayoutSidebar } from "@tabler/icons-react";
4
4
  import { useLocation, useNavigate } from "react-router";
5
5
 
@@ -30,6 +30,7 @@ describe("Dispatch layout scrolling", () => {
30
30
  describe("Dispatch workspace app chat rail", () => {
31
31
  it("routes the open-app rail through the shared app-chat component", () => {
32
32
  expect(layoutSource).toContain("<WorkspaceAppChatRail");
33
+ expect(layoutSource).toContain("workspaceAppChatRegistration ? (");
33
34
  expect(layoutSource).toContain("data-dispatch-workspace-app-frame");
34
35
  expect(layoutSource).toContain('new Event("agent-panel:toggle")');
35
36
  expect(layoutSource).toContain('new CustomEvent("agent-panel:toggle"');
@@ -31,11 +31,6 @@ const clientState = vi.hoisted(() => ({
31
31
  }));
32
32
 
33
33
  vi.mock("@agent-native/core/client/agent-chat", () => ({
34
- AgentSidebar: ({ children }: { children: React.ReactNode }) => (
35
- <div data-agent-sidebar>{children}</div>
36
- ),
37
- ExternalAgentNudge: () => null,
38
- focusAgentChat: vi.fn(),
39
34
  navigateWithAgentChatViewTransition: (
40
35
  navigate: (path: string) => void,
41
36
  path: string,
@@ -53,6 +48,14 @@ vi.mock("@agent-native/core/client/agent-chat", () => ({
53
48
  }),
54
49
  }));
55
50
 
51
+ vi.mock("@agent-native/toolkit/app/chat", async (importOriginal) => ({
52
+ ...(await importOriginal<typeof import("@agent-native/toolkit/app/chat")>()),
53
+ AgentSidebar: ({ children }: { children: React.ReactNode }) => (
54
+ <div data-agent-sidebar>{children}</div>
55
+ ),
56
+ focusAgentChat: vi.fn(),
57
+ }));
58
+
56
59
  vi.mock("@agent-native/core/client/api-path", () => ({
57
60
  agentNativePath: (path: string) => path,
58
61
  appBasePath: () => clientState.basePath,
@@ -105,23 +108,18 @@ vi.mock("@agent-native/core/client/i18n", () => ({
105
108
  },
106
109
  }));
107
110
 
108
- vi.mock("@agent-native/core/client/navigation", () => ({
111
+ vi.mock("@agent-native/toolkit/app/shared", async (importOriginal) => ({
112
+ ...(await importOriginal<
113
+ typeof import("@agent-native/toolkit/app/shared")
114
+ >()),
109
115
  openCommandMenu: vi.fn(),
110
116
  }));
111
117
 
112
- vi.mock("@agent-native/core/client/ui", async (importOriginal) => {
113
- const actual =
114
- await importOriginal<typeof import("@agent-native/core/client/ui")>();
115
- return {
116
- ...actual,
117
- AgentNativeIcon: (props: React.SVGProps<SVGSVGElement>) => (
118
- <svg data-agent-native-icon {...props} />
119
- ),
120
- FeedbackButton: () => <div>Feedback</div>,
121
- };
122
- });
118
+ vi.mock("@agent-native/toolkit/app/feedback", () => ({
119
+ FeedbackButton: () => <div>Feedback</div>,
120
+ }));
123
121
 
124
- vi.mock("@agent-native/core/client/org", () => ({
122
+ vi.mock("@agent-native/toolkit/app/org", () => ({
125
123
  InvitationBanner: () => null,
126
124
  OrgSwitcher: () => <div>Organization</div>,
127
125
  }));
@@ -753,7 +751,7 @@ describe("chat-first surface panel toggle stacking", () => {
753
751
  typeof import("@agent-native/core/client/agent-chat")
754
752
  >("@agent-native/core/client/agent-chat");
755
753
  const { ChatFirstSurfacePanel } =
756
- await import("@agent-native/core/client/chat-first");
754
+ await import("@agent-native/toolkit/app/chat/chat-first");
757
755
 
758
756
  const container = document.createElement("div");
759
757
  document.body.appendChild(container);
@@ -805,7 +803,7 @@ describe("chat-first app surface tab chat rail", () => {
805
803
 
806
804
  async function renderAppTab(isMobileSurface: boolean) {
807
805
  const { defaultChatFirstCopy } =
808
- await import("@agent-native/core/client/chat-first");
806
+ await import("@agent-native/toolkit/app/chat/chat-first");
809
807
  vi.stubGlobal(
810
808
  "fetch",
811
809
  vi.fn().mockResolvedValue(new Response("{}", { status: 200 })),