@agent-native/dispatch 0.40.4 → 0.40.5
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/CHANGELOG.md +20 -7
- package/dist/actions/provider-api-register.d.ts +8 -8
- package/dist/components/app-open-actions.d.ts +1 -1
- package/dist/components/app-open-actions.d.ts.map +1 -1
- package/dist/components/app-open-actions.js +1 -1
- package/dist/components/app-open-actions.js.map +1 -1
- package/dist/components/app-row-settings.js +1 -1
- package/dist/components/app-row-settings.js.map +1 -1
- package/dist/components/chat-home-apps.js +1 -1
- package/dist/components/chat-home-apps.js.map +1 -1
- package/dist/components/deferred-chat-components.d.ts +31 -0
- package/dist/components/deferred-chat-components.d.ts.map +1 -0
- package/dist/components/deferred-chat-components.js +28 -0
- package/dist/components/deferred-chat-components.js.map +1 -0
- package/dist/components/layout/Header.js +1 -1
- package/dist/components/layout/Header.js.map +1 -1
- package/dist/components/layout/Layout.d.ts +2 -1
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +3 -3
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/workspace-app-card.js +1 -1
- package/dist/components/workspace-app-card.js.map +1 -1
- package/dist/components/workspace-app-host.d.ts +1 -1
- package/dist/components/workspace-app-host.d.ts.map +1 -1
- package/dist/components/workspace-app-host.js +3 -2
- package/dist/components/workspace-app-host.js.map +1 -1
- package/dist/lib/workspace-apps.js +1 -1
- package/dist/lib/workspace-apps.js.map +1 -1
- package/dist/routes/pages/browser-chat.js +1 -1
- package/dist/routes/pages/browser-chat.js.map +1 -1
- package/dist/routes/pages/chat.js +2 -2
- package/dist/routes/pages/chat.js.map +1 -1
- package/dist/server/lib/private-icon-assets.d.ts +7 -0
- package/dist/server/lib/private-icon-assets.d.ts.map +1 -0
- package/dist/server/lib/private-icon-assets.js +176 -0
- package/dist/server/lib/private-icon-assets.js.map +1 -0
- package/dist/server/plugins/auth.d.ts.map +1 -1
- package/dist/server/plugins/auth.js +6 -1
- package/dist/server/plugins/auth.js.map +1 -1
- package/dist/server/plugins/core-routes.d.ts.map +1 -1
- package/dist/server/plugins/core-routes.js +2 -0
- package/dist/server/plugins/core-routes.js.map +1 -1
- package/package.json +3 -3
- package/src/components/app-open-actions.tsx +1 -1
- package/src/components/app-row-settings.tsx +1 -1
- package/src/components/chat-home-apps.tsx +1 -1
- package/src/components/deferred-chat-components.tsx +96 -0
- package/src/components/layout/Header.tsx +1 -1
- package/src/components/layout/Layout.app-chat.spec.ts +7 -0
- package/src/components/layout/Layout.spec.tsx +6 -3
- package/src/components/layout/Layout.tsx +23 -21
- package/src/components/workspace-app-card.tsx +1 -1
- package/src/components/workspace-app-chat-rail.spec.tsx +5 -2
- package/src/components/workspace-app-host.spec.tsx +5 -9
- package/src/components/workspace-app-host.tsx +4 -6
- package/src/lib/workspace-apps.ts +1 -1
- package/src/routes/pages/browser-chat.spec.tsx +1 -1
- package/src/routes/pages/browser-chat.tsx +1 -1
- package/src/routes/pages/chat.spec.tsx +4 -1
- package/src/routes/pages/chat.tsx +2 -2
- package/src/server/lib/private-icon-assets.spec.ts +498 -0
- package/src/server/lib/private-icon-assets.ts +244 -0
- package/src/server/plugins/auth.spec.ts +1 -1
- package/src/server/plugins/auth.ts +6 -1
- package/src/server/plugins/core-routes.private-icons.spec.ts +36 -0
- package/src/server/plugins/core-routes.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/dispatch",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.5",
|
|
4
4
|
"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.",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"tailwind-merge": "^3.5.0",
|
|
90
90
|
"vaul": "^1.1.2",
|
|
91
91
|
"zod": "^4.3.6",
|
|
92
|
-
"@agent-native/toolkit": "0.198.
|
|
92
|
+
"@agent-native/toolkit": "0.198.4"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@react-router/dev": "^8.1.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"typescript-7": "npm:typescript@^7.0.2",
|
|
104
104
|
"vite": "8.1.0",
|
|
105
105
|
"vitest": "^4.1.5",
|
|
106
|
-
"@agent-native/core": "0.198.
|
|
106
|
+
"@agent-native/core": "0.198.4"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"@agent-native/core": ">=0.8.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APP_ACTION_MENU_CONTENT_CLASS } from "@agent-native/toolkit/app/chat/chat-first";
|
|
1
|
+
import { APP_ACTION_MENU_CONTENT_CLASS } from "@agent-native/toolkit/app/chat/chat-first/app-open-actions";
|
|
2
2
|
import { IconPlus, IconSettings } from "@tabler/icons-react";
|
|
3
3
|
|
|
4
4
|
import { Button } from "./ui/button";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useT } from "@agent-native/core/client/i18n";
|
|
2
|
-
import { AppOpenActions } from "@agent-native/toolkit/app/chat/chat-first";
|
|
2
|
+
import { AppOpenActions } from "@agent-native/toolkit/app/chat/chat-first/app-open-actions";
|
|
3
3
|
import { IconArrowUpRight, IconPlus } from "@tabler/icons-react";
|
|
4
4
|
import { useMemo, useState } from "react";
|
|
5
5
|
import { Link } from "react-router";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LazyChunkErrorBoundary,
|
|
3
|
+
LazyChunkRetryFallback,
|
|
4
|
+
} from "@agent-native/toolkit/app/shared";
|
|
5
|
+
import { lazy, Suspense, type ComponentProps, type ComponentType } from "react";
|
|
6
|
+
|
|
7
|
+
function defer<T extends ComponentType<any>>(
|
|
8
|
+
loader: () => Promise<{ default: T }>,
|
|
9
|
+
): ComponentType<ComponentProps<T>> {
|
|
10
|
+
const LazyComponent = lazy(loader);
|
|
11
|
+
return function DeferredComponent(props: ComponentProps<T>) {
|
|
12
|
+
return (
|
|
13
|
+
<LazyChunkErrorBoundary fallback={<LazyChunkRetryFallback />}>
|
|
14
|
+
<Suspense fallback={null}>
|
|
15
|
+
<LazyComponent {...props} />
|
|
16
|
+
</Suspense>
|
|
17
|
+
</LazyChunkErrorBoundary>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const AgentChatSurface = defer(() =>
|
|
23
|
+
import("@agent-native/toolkit/app/chat/AgentPanel").then((module) => ({
|
|
24
|
+
default: module.AgentChatSurface,
|
|
25
|
+
})),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const ChatFirstAgentsPane = defer(() =>
|
|
29
|
+
import("@agent-native/toolkit/app/chat/chat-first/agents-pane").then(
|
|
30
|
+
(module) => ({ default: module.ChatFirstAgentsPane }),
|
|
31
|
+
),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const ChatFirstAppPane = defer(() =>
|
|
35
|
+
import("@agent-native/toolkit/app/chat/chat-first/app-pane").then(
|
|
36
|
+
(module) => ({ default: module.ChatFirstAppPane }),
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const ChatFirstAppsRail = defer(() =>
|
|
41
|
+
import("@agent-native/toolkit/app/chat/chat-first/apps-rail").then(
|
|
42
|
+
(module) => ({
|
|
43
|
+
default: module.ChatFirstAppsRail,
|
|
44
|
+
}),
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export const ChatFirstBrowserPane = defer(() =>
|
|
49
|
+
import("@agent-native/toolkit/app/chat/chat-first/browser-pane").then(
|
|
50
|
+
(module) => ({ default: module.ChatFirstBrowserPane }),
|
|
51
|
+
),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
export const ChatFirstChatHistory = defer(() =>
|
|
55
|
+
import("@agent-native/toolkit/app/chat/chat-first/chat-history").then(
|
|
56
|
+
(module) => ({ default: module.ChatFirstChatHistory }),
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const ChatFirstPrimaryNavigation = defer(() =>
|
|
61
|
+
import("@agent-native/toolkit/app/chat/chat-first/primary-nav").then(
|
|
62
|
+
(module) => ({
|
|
63
|
+
default: module.ChatFirstPrimaryNavigation,
|
|
64
|
+
}),
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export const ChatFirstSessionWatchPane = defer(() =>
|
|
69
|
+
import("@agent-native/toolkit/app/chat/chat-first/session-watch-pane").then(
|
|
70
|
+
(module) => ({ default: module.ChatFirstSessionWatchPane }),
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export const ChatFirstSurfaceContent = defer(() =>
|
|
75
|
+
import("@agent-native/toolkit/app/chat/chat-first/surface-tabs").then(
|
|
76
|
+
(module) => ({ default: module.ChatFirstSurfaceContent }),
|
|
77
|
+
),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export const ChatFirstSurfacePanel = defer(() =>
|
|
81
|
+
import("@agent-native/toolkit/app/chat/chat-first/surface-panel").then(
|
|
82
|
+
(module) => ({ default: module.ChatFirstSurfacePanel }),
|
|
83
|
+
),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const ChatFirstSurfacePanelToggle = defer(() =>
|
|
87
|
+
import("@agent-native/toolkit/app/chat/chat-first/ChatFirstSurfacePanelToggle").then(
|
|
88
|
+
(module) => ({ default: module.ChatFirstSurfacePanelToggle }),
|
|
89
|
+
),
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
export const ChatFirstSurfaceTabs = defer(() =>
|
|
93
|
+
import("@agent-native/toolkit/app/chat/chat-first/surface-tabs").then(
|
|
94
|
+
(module) => ({ default: module.ChatFirstSurfaceTabs }),
|
|
95
|
+
),
|
|
96
|
+
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentToggleButton } from "@agent-native/toolkit/app/chat";
|
|
1
|
+
import { AgentToggleButton } from "@agent-native/toolkit/app/chat/AgentSidebar";
|
|
2
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";
|
|
@@ -28,6 +28,13 @@ describe("Dispatch layout scrolling", () => {
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
describe("Dispatch workspace app chat rail", () => {
|
|
31
|
+
it("keeps ChatFirst panes behind the deferred component entrypoint", () => {
|
|
32
|
+
expect(railSource).toContain('from "./deferred-chat-components.js"');
|
|
33
|
+
expect(railSource).not.toMatch(
|
|
34
|
+
/^import\s+(?!type\b)[^;]*?\sfrom "@agent-native\/toolkit\/app\/chat\/chat-first";/m,
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
31
38
|
it("routes the open-app rail through the shared app-chat component", () => {
|
|
32
39
|
expect(layoutSource).toContain("<WorkspaceAppChatRail");
|
|
33
40
|
expect(layoutSource).toContain("workspaceAppChatRegistration ? (");
|
|
@@ -71,9 +71,7 @@ vi.mock("@agent-native/core/client/agent-chat", async (importOriginal) => ({
|
|
|
71
71
|
}),
|
|
72
72
|
}));
|
|
73
73
|
|
|
74
|
-
vi.mock("@agent-native/toolkit/app/chat",
|
|
75
|
-
...(await importOriginal<typeof import("@agent-native/toolkit/app/chat")>()),
|
|
76
|
-
AgentChatSurface: () => null,
|
|
74
|
+
vi.mock("@agent-native/toolkit/app/chat/AgentSidebar", () => ({
|
|
77
75
|
AgentToggleButton: () => null,
|
|
78
76
|
AgentSidebar: ({ children }: { children: React.ReactNode }) => (
|
|
79
77
|
<div data-agent-sidebar>{children}</div>
|
|
@@ -81,6 +79,11 @@ vi.mock("@agent-native/toolkit/app/chat", async (importOriginal) => ({
|
|
|
81
79
|
focusAgentChat: vi.fn(),
|
|
82
80
|
}));
|
|
83
81
|
|
|
82
|
+
vi.mock("../deferred-chat-components.js", async (importOriginal) => ({
|
|
83
|
+
...(await importOriginal<typeof import("../deferred-chat-components.js")>()),
|
|
84
|
+
AgentChatSurface: () => null,
|
|
85
|
+
}));
|
|
86
|
+
|
|
84
87
|
vi.mock("@agent-native/core/client/api-path", () => ({
|
|
85
88
|
agentNativePath: (path: string) => path,
|
|
86
89
|
appBasePath: () => clientState.basePath,
|
|
@@ -42,30 +42,18 @@ import { useActionQuery } from "@agent-native/core/client/hooks";
|
|
|
42
42
|
import { useT } from "@agent-native/core/client/i18n";
|
|
43
43
|
import { SETTINGS_REDESIGN_FLAG } from "@agent-native/core/feature-flags/registry";
|
|
44
44
|
import {
|
|
45
|
-
AgentChatSurface,
|
|
46
45
|
AgentToggleButton,
|
|
47
46
|
AgentSidebar,
|
|
48
47
|
focusAgentChat,
|
|
49
|
-
} from "@agent-native/toolkit/app/chat";
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ChatFirstSessionWatchPane,
|
|
59
|
-
ChatFirstSurfacePanel,
|
|
60
|
-
ChatFirstSurfaceContent,
|
|
61
|
-
ChatFirstSurfaceTabs,
|
|
62
|
-
defaultChatFirstCopy,
|
|
63
|
-
type ChatFirstAgentActivity,
|
|
64
|
-
type ChatFirstAppItem,
|
|
65
|
-
type ChatFirstCopy,
|
|
66
|
-
type ChatFirstEmbedTarget,
|
|
67
|
-
type ChatFirstPrimaryTab,
|
|
68
|
-
} from "@agent-native/toolkit/app/chat/chat-first";
|
|
48
|
+
} from "@agent-native/toolkit/app/chat/AgentSidebar";
|
|
49
|
+
import { defaultChatFirstCopy } from "@agent-native/toolkit/app/chat/chat-first-copy";
|
|
50
|
+
import type { ChatFirstPrimaryTab } from "@agent-native/toolkit/app/chat/chat-first/primary-nav";
|
|
51
|
+
import type {
|
|
52
|
+
ChatFirstAgentActivity,
|
|
53
|
+
ChatFirstAppItem,
|
|
54
|
+
ChatFirstCopy,
|
|
55
|
+
ChatFirstEmbedTarget,
|
|
56
|
+
} from "@agent-native/toolkit/app/chat/chat-first/types";
|
|
69
57
|
import { FeedbackButton } from "@agent-native/toolkit/app/feedback";
|
|
70
58
|
import { InvitationBanner, OrgSwitcher } from "@agent-native/toolkit/app/org";
|
|
71
59
|
import { RunsTray } from "@agent-native/toolkit/app/progress";
|
|
@@ -132,6 +120,20 @@ import {
|
|
|
132
120
|
import { CHAT_FIRST_PANE_STATE_KEY } from "../../shared/chat-first-pane";
|
|
133
121
|
import { AppIcon } from "../app-icon";
|
|
134
122
|
import { CreateAppPopover } from "../create-app-popover";
|
|
123
|
+
import {
|
|
124
|
+
AgentChatSurface,
|
|
125
|
+
ChatFirstAgentsPane,
|
|
126
|
+
ChatFirstAppPane,
|
|
127
|
+
ChatFirstAppsRail,
|
|
128
|
+
ChatFirstBrowserPane,
|
|
129
|
+
ChatFirstChatHistory,
|
|
130
|
+
ChatFirstPrimaryNavigation,
|
|
131
|
+
ChatFirstSessionWatchPane,
|
|
132
|
+
ChatFirstSurfaceContent,
|
|
133
|
+
ChatFirstSurfacePanel,
|
|
134
|
+
ChatFirstSurfacePanelToggle,
|
|
135
|
+
ChatFirstSurfaceTabs,
|
|
136
|
+
} from "../deferred-chat-components.js";
|
|
135
137
|
import { Button } from "../ui/button";
|
|
136
138
|
import { Sheet, SheetContent, SheetDescription, SheetTitle } from "../ui/sheet";
|
|
137
139
|
import { Skeleton } from "../ui/skeleton";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
useActionQuery,
|
|
4
4
|
} from "@agent-native/core/client/hooks";
|
|
5
5
|
import { useT } from "@agent-native/core/client/i18n";
|
|
6
|
-
import { APP_ACTION_MENU_CONTENT_CLASS } from "@agent-native/toolkit/app/chat/chat-first";
|
|
6
|
+
import { APP_ACTION_MENU_CONTENT_CLASS } from "@agent-native/toolkit/app/chat/chat-first/app-open-actions";
|
|
7
7
|
import { ShareButton } from "@agent-native/toolkit/app/sharing";
|
|
8
8
|
import {
|
|
9
9
|
IconChevronDown,
|
|
@@ -10,7 +10,7 @@ const railState = vi.hoisted(() => ({
|
|
|
10
10
|
mutateAsync: vi.fn().mockResolvedValue({ startUrl: "about:blank" }),
|
|
11
11
|
}));
|
|
12
12
|
|
|
13
|
-
vi.mock("@agent-native/toolkit/app/chat", () => ({
|
|
13
|
+
vi.mock("@agent-native/toolkit/app/chat/AgentSidebar", () => ({
|
|
14
14
|
AgentSidebar: (props: Record<string, unknown>) => {
|
|
15
15
|
railState.sidebarProps.push(props);
|
|
16
16
|
return (
|
|
@@ -25,10 +25,13 @@ vi.mock("@agent-native/core/client/api-path", () => ({
|
|
|
25
25
|
agentNativePath: (path: string) => path,
|
|
26
26
|
}));
|
|
27
27
|
|
|
28
|
-
vi.mock("@agent-native/toolkit/app/chat/chat-first", () => ({
|
|
28
|
+
vi.mock("@agent-native/toolkit/app/chat/chat-first/app-pane", () => ({
|
|
29
29
|
ChatFirstAppPane: ({ app }: { app: { name: string } | null }) => (
|
|
30
30
|
<div data-app-pane>{app?.name}</div>
|
|
31
31
|
),
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
vi.mock("@agent-native/toolkit/app/chat/chat-first-copy", () => ({
|
|
32
35
|
defaultChatFirstCopy: (key: string) => key,
|
|
33
36
|
}));
|
|
34
37
|
|
|
@@ -47,14 +47,7 @@ const clientState = vi.hoisted(() => {
|
|
|
47
47
|
};
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
vi.mock("@agent-native/toolkit/app/chat/chat-first", () => ({
|
|
51
|
-
CHAT_FIRST_DEFAULT_APP_IDS: [
|
|
52
|
-
"content",
|
|
53
|
-
"design",
|
|
54
|
-
"mail",
|
|
55
|
-
"calendar",
|
|
56
|
-
"clips",
|
|
57
|
-
],
|
|
50
|
+
vi.mock("@agent-native/toolkit/app/chat/chat-first/app-pane", () => ({
|
|
58
51
|
ChatFirstAppPane: ({
|
|
59
52
|
app,
|
|
60
53
|
embedUrl,
|
|
@@ -88,10 +81,13 @@ vi.mock("@agent-native/toolkit/app/chat/chat-first", () => ({
|
|
|
88
81
|
: null}
|
|
89
82
|
</div>
|
|
90
83
|
),
|
|
84
|
+
}));
|
|
85
|
+
|
|
86
|
+
vi.mock("@agent-native/toolkit/app/chat/chat-first-copy", () => ({
|
|
91
87
|
defaultChatFirstCopy: (key: string) => key,
|
|
92
88
|
}));
|
|
93
89
|
|
|
94
|
-
vi.mock("@agent-native/toolkit/app/chat", () => ({
|
|
90
|
+
vi.mock("@agent-native/toolkit/app/chat/AgentSidebar", () => ({
|
|
95
91
|
AgentSidebar: () => null,
|
|
96
92
|
}));
|
|
97
93
|
|
|
@@ -7,12 +7,9 @@ import {
|
|
|
7
7
|
import { useT } from "@agent-native/core/client/i18n";
|
|
8
8
|
import { AGENT_NATIVE_WORKSPACE_APP_ROUTE_MESSAGE_TYPE } from "@agent-native/core/client/navigation";
|
|
9
9
|
import { withBuilderUtmTrackingParams } from "@agent-native/core/shared/builder-link-tracking";
|
|
10
|
-
import { AgentSidebar } from "@agent-native/toolkit/app/chat";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
defaultChatFirstCopy,
|
|
14
|
-
type ChatFirstCopy,
|
|
15
|
-
} from "@agent-native/toolkit/app/chat/chat-first";
|
|
10
|
+
import { AgentSidebar } from "@agent-native/toolkit/app/chat/AgentSidebar";
|
|
11
|
+
import { defaultChatFirstCopy } from "@agent-native/toolkit/app/chat/chat-first-copy";
|
|
12
|
+
import type { ChatFirstCopy } from "@agent-native/toolkit/app/chat/chat-first/types";
|
|
16
13
|
import {
|
|
17
14
|
IconAlertTriangle,
|
|
18
15
|
IconArrowLeft,
|
|
@@ -43,6 +40,7 @@ import {
|
|
|
43
40
|
import { DISPATCH_WORKSPACE_SSO_FLAG } from "../shared/feature-flags";
|
|
44
41
|
import { workspaceAppChatProxyPath } from "../shared/workspace-app-chat";
|
|
45
42
|
import { ActionQueryError } from "./action-query-error";
|
|
43
|
+
import { ChatFirstAppPane } from "./deferred-chat-components.js";
|
|
46
44
|
import { Alert, AlertDescription } from "./ui/alert";
|
|
47
45
|
import { Badge } from "./ui/badge";
|
|
48
46
|
import { Button } from "./ui/button";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHAT_FIRST_DEFAULT_APP_IDS } from "@agent-native/core/client/chat-first-state";
|
|
1
2
|
import {
|
|
2
3
|
getClientSurface,
|
|
3
4
|
isInBuilderFrame,
|
|
@@ -7,7 +8,6 @@ import {
|
|
|
7
8
|
resolveEnvironmentTargets,
|
|
8
9
|
withBuilderUtmTrackingParams,
|
|
9
10
|
} from "@agent-native/core/shared";
|
|
10
|
-
import { CHAT_FIRST_DEFAULT_APP_IDS } from "@agent-native/toolkit/app/chat/chat-first";
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
CANONICAL_WORKSPACE_SSO_APP_ORIGINS,
|
|
@@ -12,7 +12,7 @@ const browserChat = vi.hoisted(() => ({
|
|
|
12
12
|
surfaceProps: null as Record<string, unknown> | null,
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
vi.mock("@agent-native/toolkit/app/chat", () => ({
|
|
15
|
+
vi.mock("@agent-native/toolkit/app/chat/AgentPanel", () => ({
|
|
16
16
|
AgentChatSurface: (props: Record<string, unknown>) => {
|
|
17
17
|
browserChat.surfaceProps = props;
|
|
18
18
|
return <div data-testid="browser-agent-chat" />;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isEmbedAuthActive } from "@agent-native/core/client/host";
|
|
2
2
|
import { useT } from "@agent-native/core/client/i18n";
|
|
3
|
-
import { AgentChatSurface } from "@agent-native/toolkit/app/chat";
|
|
3
|
+
import { AgentChatSurface } from "@agent-native/toolkit/app/chat/AgentPanel";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { useSearchParams } from "react-router";
|
|
6
6
|
|
|
@@ -41,7 +41,7 @@ vi.mock("@agent-native/core/client/agent-chat", () => ({
|
|
|
41
41
|
sendToAgentChat: vi.fn(),
|
|
42
42
|
}));
|
|
43
43
|
|
|
44
|
-
vi.mock("@agent-native/toolkit/app/chat", () => ({
|
|
44
|
+
vi.mock("@agent-native/toolkit/app/chat/AgentChatHome", () => ({
|
|
45
45
|
AgentChatHome: (props: Record<string, unknown>) => {
|
|
46
46
|
clientState.surfaceProps = { mode: "page", ...props };
|
|
47
47
|
return (
|
|
@@ -317,6 +317,9 @@ describe("Dispatch ChatRoute", () => {
|
|
|
317
317
|
|
|
318
318
|
expect(clientState.surfaceProps?.suggestions).toEqual([]);
|
|
319
319
|
expect(clientState.surfaceProps?.contentClassName).toBe("max-w-none");
|
|
320
|
+
expect(clientState.surfaceProps?.surfaceClassName).toBe(
|
|
321
|
+
"dispatch-chat-panel",
|
|
322
|
+
);
|
|
320
323
|
expect(container.textContent).not.toContain("Request ID");
|
|
321
324
|
});
|
|
322
325
|
});
|
|
@@ -9,7 +9,7 @@ import { useT } from "@agent-native/core/client/i18n";
|
|
|
9
9
|
import {
|
|
10
10
|
AgentChatHome,
|
|
11
11
|
type AgentChatHomeProps,
|
|
12
|
-
} from "@agent-native/toolkit/app/chat";
|
|
12
|
+
} from "@agent-native/toolkit/app/chat/AgentChatHome";
|
|
13
13
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
14
14
|
import { useLocation, useNavigate } from "react-router";
|
|
15
15
|
|
|
@@ -273,7 +273,7 @@ export default function ChatRoute() {
|
|
|
273
273
|
key={agent ? `agent-${agent.id}` : "dispatch"}
|
|
274
274
|
className="flex-1 min-h-0"
|
|
275
275
|
contentClassName="max-w-none"
|
|
276
|
-
surfaceClassName="dispatch-chat-panel
|
|
276
|
+
surfaceClassName="dispatch-chat-panel"
|
|
277
277
|
chatViewTransition
|
|
278
278
|
defaultMode="chat"
|
|
279
279
|
storageKey={agent ? `dispatch-agent-${agent.id}` : "dispatch"}
|