@agent-native/toolkit 0.198.2 → 0.198.3-nightly-20260930154911
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/agentkit/react/components.d.ts.map +1 -1
- package/dist/app/agentkit/react/components.js +13 -5
- package/dist/app/agentkit/react/components.js.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.js +20 -6
- package/dist/app/chat/AgentKitAssistantChat.js.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.js +211 -0
- package/dist/app/i18n/catalogs/ar-SA.js.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.js +147 -0
- package/dist/app/i18n/catalogs/de-DE.js.map +1 -1
- package/dist/app/i18n/catalogs/en-US.d.ts +147 -0
- package/dist/app/i18n/catalogs/en-US.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/en-US.js +147 -0
- package/dist/app/i18n/catalogs/en-US.js.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.js +163 -0
- package/dist/app/i18n/catalogs/es-ES.js.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.js +163 -0
- package/dist/app/i18n/catalogs/fr-FR.js.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.js +147 -0
- package/dist/app/i18n/catalogs/hi-IN.js.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.js +131 -0
- package/dist/app/i18n/catalogs/ja-JP.js.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.js +131 -0
- package/dist/app/i18n/catalogs/ko-KR.js.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.js +163 -0
- package/dist/app/i18n/catalogs/pt-BR.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.js +131 -0
- package/dist/app/i18n/catalogs/zh-CN.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.js +131 -0
- package/dist/app/i18n/catalogs/zh-TW.js.map +1 -1
- package/dist/app/observability/ObservabilityDashboard.d.ts.map +1 -1
- package/dist/app/observability/ObservabilityDashboard.js +101 -109
- package/dist/app/observability/ObservabilityDashboard.js.map +1 -1
- package/dist/app/observability/RunInsights.d.ts +22 -0
- package/dist/app/observability/RunInsights.d.ts.map +1 -0
- package/dist/app/observability/RunInsights.js +658 -0
- package/dist/app/observability/RunInsights.js.map +1 -0
- package/dist/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/composer/RealtimeVoiceMode.js +1 -1
- package/dist/composer/RealtimeVoiceMode.js.map +1 -1
- package/package.json +5 -5
- package/src/app/agent-page/ConnectionsTab.spec.tsx +0 -3
- package/src/app/agentkit/react/components.spec.tsx +2 -1
- package/src/app/agentkit/react/components.tsx +14 -5
- package/src/app/agentkit/react/composer-context.spec.tsx +4 -1
- package/src/app/agentkit/react/suggestions.spec.tsx +51 -1
- package/src/app/chat/AgentKitAssistantChat.spec.tsx +57 -0
- package/src/app/chat/AgentKitAssistantChat.tsx +44 -8
- package/src/app/chat/AgentPanel.header.spec.ts +22 -22
- package/src/app/chat/agentkit-chat/action-widget.spec.tsx +17 -2
- package/src/app/chat/agentkit-chat/approval-card.spec.tsx +2 -2
- package/src/app/chat/agentkit-chat/connections.spec.tsx +1 -1
- package/src/app/chat/chat/markdown-renderer.spec.tsx +1 -1
- package/src/app/chat/chat/tool-call-display.spec.tsx +25 -2
- package/src/app/chat/chat/widgets/DataTableWidget.spec.tsx +38 -26
- package/src/app/chat/chat/widgets/agent-team-progress-widget.spec.tsx +7 -1
- package/src/app/chat/chat/widgets/builtin-connect-required-renderer.spec.tsx +24 -1
- package/src/app/chat/chat/widgets/record-change-widget.spec.tsx +16 -1
- package/src/app/chat/thinking-display.spec.tsx +1 -1
- package/src/app/db-admin/useAgentSync.spec.tsx +1 -1
- package/src/app/extensions/ExtensionViewer.spec.tsx +2 -1
- package/src/app/i18n/catalogs/ar-SA.ts +282 -0
- package/src/app/i18n/catalogs/de-DE.ts +198 -0
- package/src/app/i18n/catalogs/en-US.ts +187 -0
- package/src/app/i18n/catalogs/es-ES.ts +221 -0
- package/src/app/i18n/catalogs/fr-FR.ts +219 -0
- package/src/app/i18n/catalogs/hi-IN.ts +182 -0
- package/src/app/i18n/catalogs/ja-JP.ts +160 -0
- package/src/app/i18n/catalogs/ko-KR.ts +160 -0
- package/src/app/i18n/catalogs/pt-BR.ts +220 -0
- package/src/app/i18n/catalogs/zh-CN.ts +154 -0
- package/src/app/i18n/catalogs/zh-TW.ts +154 -0
- package/src/app/integrations/BuilderIntegrationPage.spec.tsx +3 -3
- package/src/app/integrations/ChannelsPage.spec.tsx +3 -3
- package/src/app/integrations/IntegrationsPage.spec.tsx +3 -3
- package/src/app/integrations/IntegrationsPanel.spec.tsx +7 -4
- package/src/app/observability/ObservabilityDashboard.review.spec.tsx +211 -52
- package/src/app/observability/ObservabilityDashboard.spec.tsx +80 -20
- package/src/app/observability/ObservabilityDashboard.tsx +240 -400
- package/src/app/observability/RunInsights.tsx +1603 -0
- package/src/app/observability/ThumbsFeedback.spec.tsx +29 -12
- package/src/app/onboarding/FirstRunOnboarding.spec.tsx +25 -5
- package/src/app/onboarding/first-run-startup-gate.spec.tsx +12 -7
- package/src/app/resources/McpConnectionSuggestion.render.spec.tsx +43 -5
- package/src/app/resources/McpIntegrationDialog.spec.tsx +20 -14
- package/src/app/resources/ResourcesPanel.spec.ts +9 -7
- package/src/app/review/ReviewThreadPanel.spec.tsx +2 -2
- package/src/app/settings/SecretsSection.spec.tsx +12 -3
- package/src/app/settings/SettingsTabsPage.spec.tsx +4 -1
- package/src/app/settings/VoiceTranscriptionSection.spec.tsx +12 -1
- package/src/app/settings/account/PreferencesSettings.spec.tsx +13 -1
- package/src/app/settings/account/ProfileSettings.spec.tsx +13 -1
- package/src/app/settings/account/SecuritySettings.spec.tsx +12 -1
- package/src/app/settings/shell/SettingsShell.spec.tsx +35 -15
- package/src/app/settings/shell/pages/app-group-pages.spec.tsx +7 -0
- package/src/app/settings/shell/pages/audit.spec.tsx +5 -2
- package/src/app/settings/shell/pages/resource-pages.spec.tsx +25 -16
- package/src/app/settings/shell/pages/sub-agents.spec.tsx +24 -15
- package/src/app/settings/usage/UsagePage.spec.tsx +4 -0
- package/src/app/setup-connections/BuilderConnectCard.spec.tsx +27 -8
- package/src/app/sharing/ShareButton.spec.tsx +7 -3
- package/src/app/sharing/ShareDialog.spec.tsx +4 -4
- package/src/app/sharing/useShareButtonController.spec.tsx +1 -1
- package/src/app/sharing/useShareDialogController.spec.tsx +2 -2
- package/src/app/transcription/BuilderTranscriptionCta.spec.tsx +1 -1
- package/src/composer/RealtimeVoiceMode.spec.tsx +1 -0
- package/src/composer/RealtimeVoiceMode.tsx +1 -5
|
@@ -7,6 +7,11 @@ import { createRoot, type Root } from "react-dom/client";
|
|
|
7
7
|
import { MemoryRouter, useLocation } from "react-router";
|
|
8
8
|
import { describe, expect, it, vi } from "vitest";
|
|
9
9
|
|
|
10
|
+
import {
|
|
11
|
+
DropdownMenu,
|
|
12
|
+
DropdownMenuContent,
|
|
13
|
+
DropdownMenuTrigger,
|
|
14
|
+
} from "../../ui/dropdown-menu.js";
|
|
10
15
|
import {
|
|
11
16
|
AgentChatSurface,
|
|
12
17
|
AgentPanelFullViewMenuItem,
|
|
@@ -45,11 +50,6 @@ import {
|
|
|
45
50
|
focusAgentChat,
|
|
46
51
|
preloadAgentChatSurface,
|
|
47
52
|
} from "./AgentSidebar.js";
|
|
48
|
-
import {
|
|
49
|
-
DropdownMenu,
|
|
50
|
-
DropdownMenuContent,
|
|
51
|
-
DropdownMenuTrigger,
|
|
52
|
-
} from "./components/ui/dropdown-menu.js";
|
|
53
53
|
|
|
54
54
|
describe("AgentPanel compatibility exports", () => {
|
|
55
55
|
it("preserves the legacy sidebar entry point", () => {
|
|
@@ -60,7 +60,7 @@ describe("AgentPanel compatibility exports", () => {
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
it("uses a stable-ref link in the full-view menu item", () => {
|
|
63
|
-
const source = readFileSync("src/
|
|
63
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", "utf8").replace(
|
|
64
64
|
/\s+/g,
|
|
65
65
|
" ",
|
|
66
66
|
);
|
|
@@ -150,7 +150,7 @@ describe("AgentPanel fullscreen menu", () => {
|
|
|
150
150
|
|
|
151
151
|
describe("AgentPanel suggestion placement", () => {
|
|
152
152
|
it("forwards explicit placement and defaults to context chips", () => {
|
|
153
|
-
const source = readFileSync("src/
|
|
153
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
154
154
|
encoding: "utf8",
|
|
155
155
|
});
|
|
156
156
|
|
|
@@ -323,7 +323,7 @@ describe("AgentPanel header tab visibility", () => {
|
|
|
323
323
|
});
|
|
324
324
|
|
|
325
325
|
it("exposes page header composition without moving it into app chrome", () => {
|
|
326
|
-
const source = readFileSync("src/
|
|
326
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", "utf8");
|
|
327
327
|
|
|
328
328
|
expect(source).toContain('data-agent-page-chat-header=""');
|
|
329
329
|
expect(source).toContain("pageHeaderLeadingSlot");
|
|
@@ -699,7 +699,7 @@ describe("AgentPanel Integrations link", () => {
|
|
|
699
699
|
});
|
|
700
700
|
|
|
701
701
|
it("sits right after Open full view and shares its separator", () => {
|
|
702
|
-
const source = readFileSync("src/
|
|
702
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
703
703
|
encoding: "utf8",
|
|
704
704
|
});
|
|
705
705
|
const overflowMenu = source.slice(
|
|
@@ -914,10 +914,10 @@ describe("AgentPanel header overflow actions", () => {
|
|
|
914
914
|
});
|
|
915
915
|
|
|
916
916
|
it("keeps width and full-view actions out of the icon row", () => {
|
|
917
|
-
const source = readFileSync("src/
|
|
917
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
918
918
|
encoding: "utf8",
|
|
919
919
|
});
|
|
920
|
-
const sidebarSource = readFileSync("src/
|
|
920
|
+
const sidebarSource = readFileSync("src/app/chat/AgentSidebar.tsx", {
|
|
921
921
|
encoding: "utf8",
|
|
922
922
|
});
|
|
923
923
|
const headerActions = source.slice(
|
|
@@ -957,7 +957,7 @@ describe("AgentPanel header overflow actions", () => {
|
|
|
957
957
|
});
|
|
958
958
|
|
|
959
959
|
it("keeps the overflow menu scrollable within the viewport", () => {
|
|
960
|
-
const source = readFileSync("src/
|
|
960
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
961
961
|
encoding: "utf8",
|
|
962
962
|
});
|
|
963
963
|
const overflowMenu = source.slice(
|
|
@@ -972,7 +972,7 @@ describe("AgentPanel header overflow actions", () => {
|
|
|
972
972
|
});
|
|
973
973
|
|
|
974
974
|
it("offers sharing from the sidebar overflow for an active chat", () => {
|
|
975
|
-
const source = readFileSync("src/
|
|
975
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
976
976
|
encoding: "utf8",
|
|
977
977
|
});
|
|
978
978
|
const overflowMenu = source.slice(
|
|
@@ -992,7 +992,7 @@ describe("AgentPanel header overflow actions", () => {
|
|
|
992
992
|
});
|
|
993
993
|
|
|
994
994
|
it("keeps chat headers persistent while switching app surfaces", () => {
|
|
995
|
-
const source = readFileSync("src/
|
|
995
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
996
996
|
encoding: "utf8",
|
|
997
997
|
});
|
|
998
998
|
|
|
@@ -1002,10 +1002,10 @@ describe("AgentPanel header overflow actions", () => {
|
|
|
1002
1002
|
});
|
|
1003
1003
|
|
|
1004
1004
|
it("supports a persistent two-state sidebar toggle", () => {
|
|
1005
|
-
const source = readFileSync("src/
|
|
1005
|
+
const source = readFileSync("src/app/chat/AgentSidebar.tsx", {
|
|
1006
1006
|
encoding: "utf8",
|
|
1007
1007
|
});
|
|
1008
|
-
const panelSource = readFileSync("src/
|
|
1008
|
+
const panelSource = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
1009
1009
|
encoding: "utf8",
|
|
1010
1010
|
});
|
|
1011
1011
|
|
|
@@ -1021,7 +1021,7 @@ describe("AgentPanel header overflow actions", () => {
|
|
|
1021
1021
|
});
|
|
1022
1022
|
|
|
1023
1023
|
it("keeps host CLI tabs mounted while chat is active", () => {
|
|
1024
|
-
const source = readFileSync("src/
|
|
1024
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
1025
1025
|
encoding: "utf8",
|
|
1026
1026
|
});
|
|
1027
1027
|
|
|
@@ -1035,7 +1035,7 @@ describe("AgentPanel header overflow actions", () => {
|
|
|
1035
1035
|
});
|
|
1036
1036
|
|
|
1037
1037
|
it("only shows tabs for the active desktop surface", () => {
|
|
1038
|
-
const source = readFileSync("src/
|
|
1038
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
1039
1039
|
encoding: "utf8",
|
|
1040
1040
|
});
|
|
1041
1041
|
|
|
@@ -1046,7 +1046,7 @@ describe("AgentPanel header overflow actions", () => {
|
|
|
1046
1046
|
|
|
1047
1047
|
describe("AgentSidebar wide drawer layout", () => {
|
|
1048
1048
|
it("can disable the panel without unmounting the app surface", () => {
|
|
1049
|
-
const source = readFileSync("src/
|
|
1049
|
+
const source = readFileSync("src/app/chat/AgentSidebar.tsx", {
|
|
1050
1050
|
encoding: "utf8",
|
|
1051
1051
|
});
|
|
1052
1052
|
|
|
@@ -1058,7 +1058,7 @@ describe("AgentSidebar wide drawer layout", () => {
|
|
|
1058
1058
|
});
|
|
1059
1059
|
|
|
1060
1060
|
it("does not reserve the drawer placeholder after the panel closes", () => {
|
|
1061
|
-
const source = readFileSync("src/
|
|
1061
|
+
const source = readFileSync("src/app/chat/AgentSidebar.tsx", {
|
|
1062
1062
|
encoding: "utf8",
|
|
1063
1063
|
});
|
|
1064
1064
|
const placeholderStart = source.indexOf("const drawerPlaceholder");
|
|
@@ -1083,7 +1083,7 @@ describe("AgentChatSurface chrome defaults", () => {
|
|
|
1083
1083
|
});
|
|
1084
1084
|
|
|
1085
1085
|
it("keeps settings out of every chat surface", () => {
|
|
1086
|
-
const source = readFileSync("src/
|
|
1086
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
1087
1087
|
encoding: "utf8",
|
|
1088
1088
|
});
|
|
1089
1089
|
|
|
@@ -1117,7 +1117,7 @@ describe("AgentChatSurface chrome defaults", () => {
|
|
|
1117
1117
|
|
|
1118
1118
|
describe("AgentPanel stale lazy chunk recovery", () => {
|
|
1119
1119
|
it("uses the guarded reload path before the panel reset fallback", () => {
|
|
1120
|
-
const source = readFileSync("src/
|
|
1120
|
+
const source = readFileSync("src/app/chat/AgentPanel.tsx", {
|
|
1121
1121
|
encoding: "utf8",
|
|
1122
1122
|
});
|
|
1123
1123
|
const componentDidCatch = source.slice(
|
|
@@ -11,23 +11,38 @@ import {
|
|
|
11
11
|
ACTION_CHAT_UI_DATA_WIDGET_RENDERER,
|
|
12
12
|
ACTION_CHAT_UI_RECORD_CHANGE_RENDERER,
|
|
13
13
|
} from "@agent-native/core/action-ui";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
AgentNativeI18nProvider as CoreAgentNativeI18nProvider,
|
|
16
|
+
type AgentNativeI18nProviderProps,
|
|
17
|
+
} from "@agent-native/core/client/i18n";
|
|
15
18
|
import {
|
|
16
19
|
createDataInsightsWidgetResult,
|
|
17
20
|
createDataTableWidgetResult,
|
|
18
21
|
} from "@agent-native/core/data-widgets";
|
|
19
|
-
import { AgentKitProvider } from "@agent-native/toolkit/app/agentkit/react/context";
|
|
20
22
|
import { act } from "react";
|
|
21
23
|
import { createRoot } from "react-dom/client";
|
|
22
24
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
23
25
|
import { describe, expect, it } from "vitest";
|
|
24
26
|
|
|
27
|
+
import { AgentKitProvider } from "../../agentkit/react/context.js";
|
|
28
|
+
import { createToolkitI18nCatalog } from "../../i18n.js";
|
|
25
29
|
import {
|
|
26
30
|
registerActionChatRenderer,
|
|
27
31
|
type ToolRendererProps,
|
|
28
32
|
} from "../chat/tool-render-registry.js";
|
|
29
33
|
import { AgentKitActionWidget } from "./action-widget.js";
|
|
30
34
|
|
|
35
|
+
const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
|
|
36
|
+
|
|
37
|
+
function AgentNativeI18nProvider(props: AgentNativeI18nProviderProps) {
|
|
38
|
+
return (
|
|
39
|
+
<CoreAgentNativeI18nProvider
|
|
40
|
+
{...props}
|
|
41
|
+
catalog={props.catalog ?? toolkitI18nCatalog}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
31
46
|
describe("AgentKitActionWidget", () => {
|
|
32
47
|
it("resolves the renderer with stored action args and structured result", async () => {
|
|
33
48
|
const toolCall: AgentToolCall = {
|
|
@@ -6,13 +6,13 @@ import type {
|
|
|
6
6
|
AgentThreadSnapshot,
|
|
7
7
|
AgentTransport,
|
|
8
8
|
} from "@agent-native/agentkit/protocol";
|
|
9
|
-
import { AgentKitChat } from "@agent-native/toolkit/app/agentkit/react/components";
|
|
10
|
-
import { AgentKitProvider } from "@agent-native/toolkit/app/agentkit/react/context";
|
|
11
9
|
import { act, type ReactNode } from "react";
|
|
12
10
|
import { createRoot, type Root } from "react-dom/client";
|
|
13
11
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
14
12
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
15
13
|
|
|
14
|
+
import { AgentKitChat } from "../../agentkit/react/components.js";
|
|
15
|
+
import { AgentKitProvider } from "../../agentkit/react/context.js";
|
|
16
16
|
import { CoreAgentKitApproval } from "./approval-card.js";
|
|
17
17
|
import { CoreAgentKitRoot } from "./root.js";
|
|
18
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
notifyMcpConnectionComplete,
|
|
5
5
|
saveMcpConnectionResume,
|
|
6
|
-
} from "@agent-native/core/client/resources";
|
|
6
|
+
} from "@agent-native/core/client/resources/mcp-connection-resume";
|
|
7
7
|
import React, { act } from "react";
|
|
8
8
|
import { createRoot, type Root } from "react-dom/client";
|
|
9
9
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @vitest-environment happy-dom
|
|
2
2
|
|
|
3
|
-
import { splitMarkdownBlocks } from "@agent-native/core/shared";
|
|
4
3
|
import React, { act } from "react";
|
|
5
4
|
import { createRoot, type Root } from "react-dom/client";
|
|
6
5
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
7
6
|
|
|
7
|
+
import { splitMarkdownBlocks } from "../../../markdown-block-split.js";
|
|
8
8
|
import {
|
|
9
9
|
loadMarkdown,
|
|
10
10
|
markdownComponents,
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// @vitest-environment happy-dom
|
|
2
2
|
|
|
3
3
|
import type { ContentPart } from "@agent-native/core/client/agent-chat";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
AgentNativeI18nProvider as CoreAgentNativeI18nProvider,
|
|
6
|
+
type AgentNativeI18nProviderProps,
|
|
7
|
+
} from "@agent-native/core/client/i18n";
|
|
5
8
|
import type { AgentMcpAppPayload } from "@agent-native/core/mcp-client";
|
|
6
|
-
import { act, useState } from "react";
|
|
9
|
+
import { act, useState, type ReactNode } from "react";
|
|
7
10
|
import { createRoot, type Root } from "react-dom/client";
|
|
8
11
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
9
12
|
|
|
13
|
+
import { createToolkitI18nCatalog } from "../../i18n.js";
|
|
10
14
|
import { ThinkingDisplayProvider } from "../thinking-display.js";
|
|
11
15
|
import {
|
|
12
16
|
ApprovalContext,
|
|
@@ -35,6 +39,17 @@ import {
|
|
|
35
39
|
resolveBuiltinFallbackToolRenderer,
|
|
36
40
|
} from "./widgets/builtin-tool-renderers.js";
|
|
37
41
|
|
|
42
|
+
const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
|
|
43
|
+
|
|
44
|
+
function AgentNativeI18nProvider(props: AgentNativeI18nProviderProps) {
|
|
45
|
+
return (
|
|
46
|
+
<CoreAgentNativeI18nProvider
|
|
47
|
+
{...props}
|
|
48
|
+
catalog={props.catalog ?? toolkitI18nCatalog}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
38
53
|
const builderHandoffMocks = vi.hoisted(() => ({
|
|
39
54
|
useAgentChatContext: vi.fn(),
|
|
40
55
|
}));
|
|
@@ -146,6 +161,13 @@ describe("ToolCallDisplay native renderers", () => {
|
|
|
146
161
|
container = document.createElement("div");
|
|
147
162
|
document.body.appendChild(container);
|
|
148
163
|
root = createRoot(container);
|
|
164
|
+
const render = root.render.bind(root);
|
|
165
|
+
root.render = (children: ReactNode) =>
|
|
166
|
+
render(
|
|
167
|
+
<AgentNativeI18nProvider persistPreference={false}>
|
|
168
|
+
{children}
|
|
169
|
+
</AgentNativeI18nProvider>,
|
|
170
|
+
);
|
|
149
171
|
});
|
|
150
172
|
|
|
151
173
|
afterEach(() => {
|
|
@@ -972,6 +994,7 @@ describe("ToolCallDisplay native renderers", () => {
|
|
|
972
994
|
sourceLocale: "en-US",
|
|
973
995
|
messages: {
|
|
974
996
|
agentChat: {
|
|
997
|
+
duration: { secondShort: "s" },
|
|
975
998
|
tool: {
|
|
976
999
|
askingAgent: "Localized asking {{agent}}",
|
|
977
1000
|
elapsed: "Localized elapsed {{duration}}",
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
// @vitest-environment happy-dom
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { AgentNativeI18nProvider } from "@agent-native/core/client/i18n";
|
|
4
4
|
import React, { act } from "react";
|
|
5
5
|
import { createRoot, type Root } from "react-dom/client";
|
|
6
6
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
7
7
|
|
|
8
|
+
import { downloadFile } from "../../../db-admin/export-utils.js";
|
|
9
|
+
import { createToolkitI18nCatalog } from "../../../i18n.js";
|
|
8
10
|
import { DataTableWidget } from "./DataTableWidget.js";
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
|
|
13
|
+
|
|
14
|
+
vi.mock("../../../db-admin/export-utils.js", async (importOriginal) => {
|
|
11
15
|
const actual =
|
|
12
|
-
await importOriginal<
|
|
13
|
-
typeof import("@agent-native/core/client/resources")
|
|
14
|
-
>();
|
|
16
|
+
await importOriginal<typeof import("../../../db-admin/export-utils.js")>();
|
|
15
17
|
return {
|
|
16
18
|
...actual,
|
|
17
19
|
downloadFile: vi.fn(),
|
|
@@ -28,14 +30,19 @@ async function renderWidget(action: { label: string; href: string }) {
|
|
|
28
30
|
roots.push(root);
|
|
29
31
|
await act(async () => {
|
|
30
32
|
root.render(
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
<AgentNativeI18nProvider
|
|
34
|
+
catalog={toolkitI18nCatalog}
|
|
35
|
+
persistPreference={false}
|
|
36
|
+
>
|
|
37
|
+
<DataTableWidget
|
|
38
|
+
action={action}
|
|
39
|
+
table={{
|
|
40
|
+
title: "Responses",
|
|
41
|
+
columns: [{ key: "name", label: "Name" }],
|
|
42
|
+
rows: [{ id: "1", name: "Ada" }],
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
</AgentNativeI18nProvider>,
|
|
39
46
|
);
|
|
40
47
|
});
|
|
41
48
|
return container;
|
|
@@ -99,19 +106,24 @@ describe("DataTableWidget", () => {
|
|
|
99
106
|
roots.push(root);
|
|
100
107
|
await act(async () => {
|
|
101
108
|
root.render(
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
<AgentNativeI18nProvider
|
|
110
|
+
catalog={toolkitI18nCatalog}
|
|
111
|
+
persistPreference={false}
|
|
112
|
+
>
|
|
113
|
+
<DataTableWidget
|
|
114
|
+
table={{
|
|
115
|
+
title: "Responses",
|
|
116
|
+
columns: [
|
|
117
|
+
{ key: "name", label: "Name" },
|
|
118
|
+
{ key: "score", label: "Score", align: "right" },
|
|
119
|
+
],
|
|
120
|
+
rows: [
|
|
121
|
+
{ id: "1", name: "Ada", score: 42 },
|
|
122
|
+
{ id: "2", name: "Grace, Hopper", score: 7 },
|
|
123
|
+
],
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
</AgentNativeI18nProvider>,
|
|
115
127
|
);
|
|
116
128
|
});
|
|
117
129
|
|
|
@@ -6,8 +6,11 @@ import { act } from "react";
|
|
|
6
6
|
import { createRoot, type Root } from "react-dom/client";
|
|
7
7
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
8
8
|
|
|
9
|
+
import { createToolkitI18nCatalog } from "../../../i18n.js";
|
|
9
10
|
import { AgentTeamProgressWidget } from "./AgentTeamProgressWidget.js";
|
|
10
11
|
|
|
12
|
+
const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
|
|
13
|
+
|
|
11
14
|
const tasks = [
|
|
12
15
|
{
|
|
13
16
|
taskId: "task-1",
|
|
@@ -66,7 +69,10 @@ describe("core.agent-team-progress", () => {
|
|
|
66
69
|
it("renders queued, working, and completed work as compact cards", async () => {
|
|
67
70
|
await act(async () => {
|
|
68
71
|
root.render(
|
|
69
|
-
<AgentNativeI18nProvider
|
|
72
|
+
<AgentNativeI18nProvider
|
|
73
|
+
catalog={toolkitI18nCatalog}
|
|
74
|
+
persistPreference={false}
|
|
75
|
+
>
|
|
70
76
|
<AgentTeamProgressWidget
|
|
71
77
|
context={{
|
|
72
78
|
toolName: "agent-teams",
|
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
// @vitest-environment happy-dom
|
|
2
2
|
|
|
3
3
|
import { ACTION_CHAT_UI_DATA_TABLE_RENDERER } from "@agent-native/core/action-ui";
|
|
4
|
+
import {
|
|
5
|
+
AgentNativeI18nProvider as CoreAgentNativeI18nProvider,
|
|
6
|
+
type AgentNativeI18nProviderProps,
|
|
7
|
+
} from "@agent-native/core/client/i18n";
|
|
4
8
|
import {
|
|
5
9
|
BUILDER_CONNECT_PROVIDER,
|
|
6
10
|
BUILDER_CONNECT_PROVIDER_LABEL,
|
|
7
11
|
connectRequiredResult,
|
|
8
12
|
} from "@agent-native/core/shared";
|
|
9
|
-
import { act } from "react";
|
|
13
|
+
import { act, type ReactNode } from "react";
|
|
10
14
|
import { createRoot, type Root } from "react-dom/client";
|
|
11
15
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
12
16
|
|
|
17
|
+
import { createToolkitI18nCatalog } from "../../../i18n.js";
|
|
13
18
|
import { resolveToolRenderer } from "../tool-render-registry.js";
|
|
14
19
|
import {
|
|
15
20
|
resolveBuiltinActionChatRenderer,
|
|
16
21
|
resolveBuiltinFallbackToolRenderer,
|
|
17
22
|
} from "./builtin-tool-renderers.js";
|
|
18
23
|
|
|
24
|
+
const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
|
|
25
|
+
|
|
26
|
+
function AgentNativeI18nProvider(props: AgentNativeI18nProviderProps) {
|
|
27
|
+
return (
|
|
28
|
+
<CoreAgentNativeI18nProvider
|
|
29
|
+
{...props}
|
|
30
|
+
catalog={props.catalog ?? toolkitI18nCatalog}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
19
35
|
describe("built-in connect-required renderer", () => {
|
|
20
36
|
let container: HTMLDivElement;
|
|
21
37
|
let root: Root;
|
|
@@ -29,6 +45,13 @@ describe("built-in connect-required renderer", () => {
|
|
|
29
45
|
container = document.createElement("div");
|
|
30
46
|
document.body.appendChild(container);
|
|
31
47
|
root = createRoot(container);
|
|
48
|
+
const render = root.render.bind(root);
|
|
49
|
+
root.render = (children: ReactNode) =>
|
|
50
|
+
render(
|
|
51
|
+
<AgentNativeI18nProvider persistPreference={false}>
|
|
52
|
+
{children}
|
|
53
|
+
</AgentNativeI18nProvider>,
|
|
54
|
+
);
|
|
32
55
|
});
|
|
33
56
|
|
|
34
57
|
afterEach(() => {
|
|
@@ -42,10 +42,25 @@ vi.mock("@agent-native/core/client/hooks", () => ({
|
|
|
42
42
|
|
|
43
43
|
import { ACTION_CHAT_UI_RECORD_CHANGE_RENDERER } from "@agent-native/core/action-ui";
|
|
44
44
|
import { normalizeActionChangeResult } from "@agent-native/core/action-ui";
|
|
45
|
-
import {
|
|
45
|
+
import {
|
|
46
|
+
AgentNativeI18nProvider as CoreAgentNativeI18nProvider,
|
|
47
|
+
type AgentNativeI18nProviderProps,
|
|
48
|
+
} from "@agent-native/core/client/i18n";
|
|
46
49
|
|
|
50
|
+
import { createToolkitI18nCatalog } from "../../../i18n.js";
|
|
47
51
|
import { RecordChangeWidget } from "./RecordChangeWidget.js";
|
|
48
52
|
|
|
53
|
+
const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
|
|
54
|
+
|
|
55
|
+
function AgentNativeI18nProvider(props: AgentNativeI18nProviderProps) {
|
|
56
|
+
return (
|
|
57
|
+
<CoreAgentNativeI18nProvider
|
|
58
|
+
{...props}
|
|
59
|
+
catalog={props.catalog ?? toolkitI18nCatalog}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
49
64
|
describe("core.record-change", () => {
|
|
50
65
|
let container: HTMLDivElement;
|
|
51
66
|
let root: Root;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
DEFAULT_THINKING_DISPLAY,
|
|
5
5
|
parseThinkingDisplay,
|
|
6
|
-
} from "@agent-native/core/shared";
|
|
6
|
+
} from "@agent-native/core/shared/thinking-display";
|
|
7
7
|
import { act } from "react";
|
|
8
8
|
import { createRoot, type Root } from "react-dom/client";
|
|
9
9
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
@@ -16,7 +16,7 @@ const appStateMocks = vi.hoisted(() => ({
|
|
|
16
16
|
}));
|
|
17
17
|
|
|
18
18
|
vi.mock("@agent-native/core/client/agent-chat", () => chatMocks);
|
|
19
|
-
vi.mock("
|
|
19
|
+
vi.mock("@agent-native/core/client/application-state", () => appStateMocks);
|
|
20
20
|
|
|
21
21
|
import { useDbAdminAgentSync } from "./useAgentSync.js";
|
|
22
22
|
|
|
@@ -19,7 +19,8 @@ vi.mock("@agent-native/core/client/agent-chat", async (importOriginal) => ({
|
|
|
19
19
|
sendToAgentChat: chatMocks.sendToAgentChat,
|
|
20
20
|
}));
|
|
21
21
|
|
|
22
|
-
vi.mock("@agent-native/core/client/host", () => ({
|
|
22
|
+
vi.mock("@agent-native/core/client/host", async (importOriginal) => ({
|
|
23
|
+
...(await importOriginal<typeof import("@agent-native/core/client/host")>()),
|
|
23
24
|
ensureEmbedAuthFetchInterceptor: vi.fn(),
|
|
24
25
|
isEmbedMcpChatBridgeActive: () => embedState.active,
|
|
25
26
|
}));
|