@agent-native/toolkit 0.198.2 → 0.198.3-nightly-20260930124743

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 (110) hide show
  1. package/dist/app/agentkit/react/components.d.ts.map +1 -1
  2. package/dist/app/agentkit/react/components.js +4 -1
  3. package/dist/app/agentkit/react/components.js.map +1 -1
  4. package/dist/app/chat/AgentKitAssistantChat.d.ts.map +1 -1
  5. package/dist/app/chat/AgentKitAssistantChat.js +20 -6
  6. package/dist/app/chat/AgentKitAssistantChat.js.map +1 -1
  7. package/dist/app/i18n/catalogs/ar-SA.d.ts.map +1 -1
  8. package/dist/app/i18n/catalogs/ar-SA.js +211 -0
  9. package/dist/app/i18n/catalogs/ar-SA.js.map +1 -1
  10. package/dist/app/i18n/catalogs/de-DE.d.ts.map +1 -1
  11. package/dist/app/i18n/catalogs/de-DE.js +147 -0
  12. package/dist/app/i18n/catalogs/de-DE.js.map +1 -1
  13. package/dist/app/i18n/catalogs/en-US.d.ts +147 -0
  14. package/dist/app/i18n/catalogs/en-US.d.ts.map +1 -1
  15. package/dist/app/i18n/catalogs/en-US.js +147 -0
  16. package/dist/app/i18n/catalogs/en-US.js.map +1 -1
  17. package/dist/app/i18n/catalogs/es-ES.d.ts.map +1 -1
  18. package/dist/app/i18n/catalogs/es-ES.js +163 -0
  19. package/dist/app/i18n/catalogs/es-ES.js.map +1 -1
  20. package/dist/app/i18n/catalogs/fr-FR.d.ts.map +1 -1
  21. package/dist/app/i18n/catalogs/fr-FR.js +163 -0
  22. package/dist/app/i18n/catalogs/fr-FR.js.map +1 -1
  23. package/dist/app/i18n/catalogs/hi-IN.d.ts.map +1 -1
  24. package/dist/app/i18n/catalogs/hi-IN.js +147 -0
  25. package/dist/app/i18n/catalogs/hi-IN.js.map +1 -1
  26. package/dist/app/i18n/catalogs/ja-JP.d.ts.map +1 -1
  27. package/dist/app/i18n/catalogs/ja-JP.js +131 -0
  28. package/dist/app/i18n/catalogs/ja-JP.js.map +1 -1
  29. package/dist/app/i18n/catalogs/ko-KR.d.ts.map +1 -1
  30. package/dist/app/i18n/catalogs/ko-KR.js +131 -0
  31. package/dist/app/i18n/catalogs/ko-KR.js.map +1 -1
  32. package/dist/app/i18n/catalogs/pt-BR.d.ts.map +1 -1
  33. package/dist/app/i18n/catalogs/pt-BR.js +163 -0
  34. package/dist/app/i18n/catalogs/pt-BR.js.map +1 -1
  35. package/dist/app/i18n/catalogs/zh-CN.d.ts.map +1 -1
  36. package/dist/app/i18n/catalogs/zh-CN.js +131 -0
  37. package/dist/app/i18n/catalogs/zh-CN.js.map +1 -1
  38. package/dist/app/i18n/catalogs/zh-TW.d.ts.map +1 -1
  39. package/dist/app/i18n/catalogs/zh-TW.js +131 -0
  40. package/dist/app/i18n/catalogs/zh-TW.js.map +1 -1
  41. package/dist/app/observability/ObservabilityDashboard.d.ts.map +1 -1
  42. package/dist/app/observability/ObservabilityDashboard.js +101 -109
  43. package/dist/app/observability/ObservabilityDashboard.js.map +1 -1
  44. package/dist/app/observability/RunInsights.d.ts +22 -0
  45. package/dist/app/observability/RunInsights.d.ts.map +1 -0
  46. package/dist/app/observability/RunInsights.js +658 -0
  47. package/dist/app/observability/RunInsights.js.map +1 -0
  48. package/package.json +5 -5
  49. package/src/app/agent-page/ConnectionsTab.spec.tsx +0 -3
  50. package/src/app/agentkit/react/components.tsx +4 -1
  51. package/src/app/agentkit/react/composer-context.spec.tsx +4 -1
  52. package/src/app/chat/AgentKitAssistantChat.spec.tsx +57 -0
  53. package/src/app/chat/AgentKitAssistantChat.tsx +44 -8
  54. package/src/app/chat/AgentPanel.header.spec.ts +22 -22
  55. package/src/app/chat/agentkit-chat/action-widget.spec.tsx +17 -2
  56. package/src/app/chat/agentkit-chat/approval-card.spec.tsx +2 -2
  57. package/src/app/chat/agentkit-chat/connections.spec.tsx +1 -1
  58. package/src/app/chat/chat/markdown-renderer.spec.tsx +1 -1
  59. package/src/app/chat/chat/tool-call-display.spec.tsx +25 -2
  60. package/src/app/chat/chat/widgets/DataTableWidget.spec.tsx +38 -26
  61. package/src/app/chat/chat/widgets/agent-team-progress-widget.spec.tsx +7 -1
  62. package/src/app/chat/chat/widgets/builtin-connect-required-renderer.spec.tsx +24 -1
  63. package/src/app/chat/chat/widgets/record-change-widget.spec.tsx +16 -1
  64. package/src/app/chat/thinking-display.spec.tsx +1 -1
  65. package/src/app/db-admin/useAgentSync.spec.tsx +1 -1
  66. package/src/app/extensions/ExtensionViewer.spec.tsx +2 -1
  67. package/src/app/i18n/catalogs/ar-SA.ts +282 -0
  68. package/src/app/i18n/catalogs/de-DE.ts +198 -0
  69. package/src/app/i18n/catalogs/en-US.ts +187 -0
  70. package/src/app/i18n/catalogs/es-ES.ts +221 -0
  71. package/src/app/i18n/catalogs/fr-FR.ts +219 -0
  72. package/src/app/i18n/catalogs/hi-IN.ts +182 -0
  73. package/src/app/i18n/catalogs/ja-JP.ts +160 -0
  74. package/src/app/i18n/catalogs/ko-KR.ts +160 -0
  75. package/src/app/i18n/catalogs/pt-BR.ts +220 -0
  76. package/src/app/i18n/catalogs/zh-CN.ts +154 -0
  77. package/src/app/i18n/catalogs/zh-TW.ts +154 -0
  78. package/src/app/integrations/BuilderIntegrationPage.spec.tsx +3 -3
  79. package/src/app/integrations/ChannelsPage.spec.tsx +3 -3
  80. package/src/app/integrations/IntegrationsPage.spec.tsx +3 -3
  81. package/src/app/integrations/IntegrationsPanel.spec.tsx +7 -4
  82. package/src/app/observability/ObservabilityDashboard.review.spec.tsx +211 -52
  83. package/src/app/observability/ObservabilityDashboard.spec.tsx +80 -20
  84. package/src/app/observability/ObservabilityDashboard.tsx +240 -400
  85. package/src/app/observability/RunInsights.tsx +1603 -0
  86. package/src/app/observability/ThumbsFeedback.spec.tsx +29 -12
  87. package/src/app/onboarding/FirstRunOnboarding.spec.tsx +25 -5
  88. package/src/app/onboarding/first-run-startup-gate.spec.tsx +12 -7
  89. package/src/app/resources/McpConnectionSuggestion.render.spec.tsx +43 -5
  90. package/src/app/resources/McpIntegrationDialog.spec.tsx +20 -14
  91. package/src/app/resources/ResourcesPanel.spec.ts +9 -7
  92. package/src/app/review/ReviewThreadPanel.spec.tsx +2 -2
  93. package/src/app/settings/SecretsSection.spec.tsx +12 -3
  94. package/src/app/settings/SettingsTabsPage.spec.tsx +4 -1
  95. package/src/app/settings/VoiceTranscriptionSection.spec.tsx +12 -1
  96. package/src/app/settings/account/PreferencesSettings.spec.tsx +13 -1
  97. package/src/app/settings/account/ProfileSettings.spec.tsx +13 -1
  98. package/src/app/settings/account/SecuritySettings.spec.tsx +12 -1
  99. package/src/app/settings/shell/SettingsShell.spec.tsx +35 -15
  100. package/src/app/settings/shell/pages/app-group-pages.spec.tsx +7 -0
  101. package/src/app/settings/shell/pages/audit.spec.tsx +5 -2
  102. package/src/app/settings/shell/pages/resource-pages.spec.tsx +25 -16
  103. package/src/app/settings/shell/pages/sub-agents.spec.tsx +24 -15
  104. package/src/app/settings/usage/UsagePage.spec.tsx +4 -0
  105. package/src/app/setup-connections/BuilderConnectCard.spec.tsx +27 -8
  106. package/src/app/sharing/ShareButton.spec.tsx +7 -3
  107. package/src/app/sharing/ShareDialog.spec.tsx +4 -4
  108. package/src/app/sharing/useShareButtonController.spec.tsx +1 -1
  109. package/src/app/sharing/useShareDialogController.spec.tsx +2 -2
  110. package/src/app/transcription/BuilderTranscriptionCta.spec.tsx +1 -1
@@ -1,12 +1,18 @@
1
1
  // @vitest-environment happy-dom
2
2
 
3
- import { AgentNativeI18nProvider } from "@agent-native/core/client/i18n";
3
+ import { AgentNativeI18nProvider as CoreAgentNativeI18nProvider } 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, beforeEach, describe, expect, it, vi } from "vitest";
7
7
 
8
+ import { createToolkitI18nCatalog } from "../i18n.js";
8
9
  import { ThumbsFeedback } from "./ThumbsFeedback.js";
9
10
 
11
+ const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
12
+ const AgentNativeI18nProvider = (
13
+ props: React.ComponentProps<typeof CoreAgentNativeI18nProvider>,
14
+ ) => <CoreAgentNativeI18nProvider catalog={toolkitI18nCatalog} {...props} />;
15
+
10
16
  vi.mock("@agent-native/core/client/hooks", () => ({
11
17
  useSession: () => ({
12
18
  session: { email: "user@example.com" },
@@ -19,10 +25,21 @@ vi.mock("@agent-native/core/client/hooks", () => ({
19
25
 
20
26
  let container: HTMLDivElement;
21
27
  let root: Root;
28
+ const sharedFetchMock = vi.fn<typeof fetch>();
22
29
 
23
30
  beforeEach(() => {
24
31
  vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
25
- vi.stubGlobal("fetch", vi.fn().mockResolvedValue({ ok: true }));
32
+ sharedFetchMock.mockReset();
33
+ sharedFetchMock.mockImplementation(async (input) => {
34
+ if (String(input).includes("/api/forms/public/")) {
35
+ return Response.json({
36
+ id: "form-1",
37
+ fields: [{ id: "feedback", type: "textarea" }],
38
+ });
39
+ }
40
+ return Response.json({});
41
+ });
42
+ vi.stubGlobal("fetch", sharedFetchMock);
26
43
  container = document.createElement("div");
27
44
  document.body.appendChild(container);
28
45
  root = createRoot(container);
@@ -116,7 +133,7 @@ describe("ThumbsFeedback localization", () => {
116
133
  );
117
134
  });
118
135
 
119
- const fetchMock = vi.mocked(globalThis.fetch);
136
+ const fetchMock = sharedFetchMock;
120
137
  await vi.waitFor(() =>
121
138
  expect(fetchMock.mock.calls.length).toBeGreaterThanOrEqual(2),
122
139
  );
@@ -146,7 +163,7 @@ describe("ThumbsFeedback localization", () => {
146
163
  "VITE_AGENT_NATIVE_FEEDBACK_URL",
147
164
  "https://forms.agent-native.com/f/agent-native-feedback/_16ewV",
148
165
  );
149
- const fetchMock = vi.mocked(globalThis.fetch);
166
+ const fetchMock = sharedFetchMock;
150
167
  fetchMock.mockImplementation(async (input) => {
151
168
  const url = String(input);
152
169
  if (url.includes("/api/forms/public/")) {
@@ -248,7 +265,7 @@ describe("ThumbsFeedback localization", () => {
248
265
  "VITE_AGENT_NATIVE_FEEDBACK_URL",
249
266
  "https://forms.agent-native.com/f/agent-native-feedback/_16ewV",
250
267
  );
251
- const fetchMock = vi.mocked(globalThis.fetch);
268
+ const fetchMock = sharedFetchMock;
252
269
  let observabilityAttempts = 0;
253
270
  fetchMock.mockImplementation(async (input, init) => {
254
271
  const url = String(input);
@@ -375,7 +392,7 @@ describe("ThumbsFeedback localization", () => {
375
392
  "VITE_AGENT_NATIVE_FEEDBACK_URL",
376
393
  "https://forms.agent-native.com/f/agent-native-feedback/_16ewV",
377
394
  );
378
- const fetchMock = vi.mocked(globalThis.fetch);
395
+ const fetchMock = sharedFetchMock;
379
396
  let formAttempts = 0;
380
397
  fetchMock.mockImplementation(async (input) => {
381
398
  const url = String(input);
@@ -513,7 +530,7 @@ describe("ThumbsFeedback localization", () => {
513
530
 
514
531
  act(() => down.click());
515
532
 
516
- const fetchMock = vi.mocked(globalThis.fetch);
533
+ const fetchMock = sharedFetchMock;
517
534
  await vi.waitFor(() => expect(fetchMock).toHaveBeenCalledTimes(1));
518
535
  expect(
519
536
  JSON.parse(String(fetchMock.mock.calls[0]?.[1]?.body)),
@@ -533,7 +550,7 @@ describe("ThumbsFeedback localization", () => {
533
550
  });
534
551
 
535
552
  it("treats non-ok responses as failed and allows a thumbs-up retry", async () => {
536
- const fetchMock = vi.mocked(globalThis.fetch);
553
+ const fetchMock = sharedFetchMock;
537
554
  fetchMock
538
555
  .mockResolvedValueOnce({ ok: false, status: 500 })
539
556
  .mockResolvedValueOnce({ ok: true, status: 200 });
@@ -573,7 +590,7 @@ describe("ThumbsFeedback localization", () => {
573
590
  });
574
591
 
575
592
  it("keeps text feedback available when a non-ok response fails", async () => {
576
- const fetchMock = vi.mocked(globalThis.fetch);
593
+ const fetchMock = sharedFetchMock;
577
594
  fetchMock.mockResolvedValueOnce({ ok: false, status: 503 });
578
595
 
579
596
  act(() => {
@@ -687,7 +704,7 @@ describe("ThumbsFeedback localization", () => {
687
704
  });
688
705
 
689
706
  it("does not resubmit when clicking the already-applied vote again", async () => {
690
- const fetchMock = vi.mocked(globalThis.fetch);
707
+ const fetchMock = sharedFetchMock;
691
708
 
692
709
  act(() => {
693
710
  root.render(
@@ -718,7 +735,7 @@ describe("ThumbsFeedback localization", () => {
718
735
 
719
736
  it("ignores a stale thumbs-up response after the user already switched to thumbs-down", async () => {
720
737
  let resolveUpRequest: ((value: { ok: boolean }) => void) | undefined;
721
- const fetchMock = vi.mocked(globalThis.fetch);
738
+ const fetchMock = sharedFetchMock;
722
739
  fetchMock.mockImplementationOnce(
723
740
  () =>
724
741
  new Promise((resolve) => {
@@ -769,7 +786,7 @@ describe("ThumbsFeedback localization", () => {
769
786
 
770
787
  it("ignores a stale failed thumbs-down response after the user switched back to thumbs-up", async () => {
771
788
  let rejectDownRequest: (() => void) | undefined;
772
- const fetchMock = vi.mocked(globalThis.fetch);
789
+ const fetchMock = sharedFetchMock;
773
790
  fetchMock.mockImplementationOnce(
774
791
  () =>
775
792
  new Promise((_resolve, reject) => {
@@ -7,12 +7,26 @@ import React, { act } from "react";
7
7
  import { createRoot, type Root } from "react-dom/client";
8
8
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
9
9
 
10
+ import { createToolkitI18nCatalog } from "../i18n.js";
10
11
  import { toolkitMessagesForLocale } from "../i18n/catalog.js";
11
12
  import {
12
- FirstRunOnboarding,
13
+ FirstRunOnboarding as FirstRunOnboardingSource,
13
14
  manualSetupSettingsRoute,
14
15
  } from "./FirstRunOnboarding.js";
15
16
 
17
+ const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
18
+
19
+ function FirstRunOnboarding() {
20
+ return (
21
+ <AgentNativeI18nProvider
22
+ catalog={toolkitI18nCatalog}
23
+ persistPreference={false}
24
+ >
25
+ <FirstRunOnboardingSource />
26
+ </AgentNativeI18nProvider>
27
+ );
28
+ }
29
+
16
30
  const mocks = vi.hoisted(() => ({
17
31
  completeFirstRun: vi.fn(),
18
32
  useBuilderConnectFlow: vi.fn(),
@@ -31,18 +45,22 @@ vi.mock("react-router", async (importOriginal) => {
31
45
  };
32
46
  });
33
47
 
34
- vi.mock("./use-onboarding.js", () => ({
48
+ vi.mock("@agent-native/core/client/onboarding/use-onboarding", () => ({
35
49
  trackOnboardingEvent: mocks.trackOnboardingEvent,
36
50
  useOnboarding: mocks.useOnboarding,
37
51
  }));
38
52
 
39
- vi.mock("./use-preview-mode.js", () => ({
53
+ vi.mock("@agent-native/core/client/onboarding/use-preview-mode", () => ({
40
54
  ONBOARDING_PREVIEW_QUERY_PARAM: "onboarding",
41
55
  ONBOARDING_PREVIEW_STEP_QUERY_PARAM: "step",
42
56
  useOnboardingPreviewMode: mocks.useOnboardingPreviewMode,
43
57
  useOnboardingPreviewStep: mocks.useOnboardingPreviewStep,
44
58
  }));
45
59
 
60
+ vi.mock("@agent-native/core/client/feature-flags/use-feature-flag", () => ({
61
+ useFeatureFlagState: () => ({ status: "ready", enabled: true }),
62
+ }));
63
+
46
64
  vi.mock("../settings/useBuilderStatus.js", () => ({
47
65
  useBuilderConnectFlow: mocks.useBuilderConnectFlow,
48
66
  }));
@@ -1471,7 +1489,7 @@ describe("FirstRunOnboarding", () => {
1471
1489
  persistPreference={false}
1472
1490
  >
1473
1491
  <TooltipProvider>
1474
- <FirstRunOnboarding />
1492
+ <FirstRunOnboardingSource />
1475
1493
  </TooltipProvider>
1476
1494
  </AgentNativeI18nProvider>,
1477
1495
  );
@@ -1590,7 +1608,9 @@ describe("FirstRunOnboarding", () => {
1590
1608
  });
1591
1609
 
1592
1610
  it("sends manual setup to Agent › Model", () => {
1593
- expect(manualSetupSettingsRoute()).toBe("/settings/model");
1611
+ expect(manualSetupSettingsRoute({ redesign: true })).toBe(
1612
+ "/settings/model",
1613
+ );
1594
1614
  });
1595
1615
 
1596
1616
  it("keeps the choice screen visible when completion fails", async () => {
@@ -10,16 +10,21 @@ const mocks = vi.hoisted(() => ({
10
10
  preview: vi.fn(),
11
11
  }));
12
12
 
13
- vi.mock("./first-run-enabled.js", () => ({
13
+ vi.mock("@agent-native/core/client/onboarding/first-run-enabled", () => ({
14
14
  isFirstRunOnboardingEnabled: mocks.enabled,
15
15
  }));
16
16
 
17
- vi.mock("./first-run-status.js", async (importOriginal) => ({
18
- ...(await importOriginal<typeof import("./first-run-status.js")>()),
19
- fetchFirstRunOnboardingStatus: mocks.fetchStatus,
20
- }));
21
-
22
- vi.mock("./use-preview-mode.js", () => ({
17
+ vi.mock(
18
+ "@agent-native/core/client/onboarding/first-run-status",
19
+ async (importOriginal) => ({
20
+ ...(await importOriginal<
21
+ typeof import("@agent-native/core/client/onboarding/first-run-status")
22
+ >()),
23
+ fetchFirstRunOnboardingStatus: mocks.fetchStatus,
24
+ }),
25
+ );
26
+
27
+ vi.mock("@agent-native/core/client/onboarding/use-preview-mode", () => ({
23
28
  useOnboardingPreviewMode: mocks.preview,
24
29
  }));
25
30
 
@@ -10,11 +10,11 @@ const mcpMocks = vi.hoisted(() => ({
10
10
  useMcpServers: vi.fn(),
11
11
  }));
12
12
 
13
- vi.mock("../CommandMenu.js", () => ({
13
+ vi.mock("../shared/index.js", () => ({
14
14
  openAgentSettings: vi.fn(),
15
15
  }));
16
16
 
17
- vi.mock("../i18n.js", () => ({
17
+ vi.mock("@agent-native/core/client/i18n", () => ({
18
18
  useT: () => (key: string, options?: { name?: string }) => {
19
19
  if (key === "mcpIntegrations.connectSuggestion") {
20
20
  return `Connect ${options?.name ?? "integration"}`;
@@ -27,11 +27,11 @@ vi.mock("../i18n.js", () => ({
27
27
  },
28
28
  }));
29
29
 
30
- vi.mock("./McpIntegrationDialog.js", () => ({
31
- McpIntegrationDialog: () => null,
30
+ vi.mock("./McpIntegrationDialogDeferred.js", () => ({
31
+ McpIntegrationDialogDeferred: () => null,
32
32
  }));
33
33
 
34
- vi.mock("./use-mcp-servers.js", () => mcpMocks);
34
+ vi.mock("@agent-native/core/client/resources/use-mcp-servers", () => mcpMocks);
35
35
 
36
36
  import {
37
37
  DEFAULT_MCP_INTEGRATIONS,
@@ -60,9 +60,42 @@ const integration = {
60
60
  describe("McpConnectionSuggestion render", () => {
61
61
  let container: HTMLDivElement;
62
62
  let root: Root;
63
+ let localStorageDescriptor: PropertyDescriptor | undefined;
64
+
65
+ function createMemoryStorage(): Storage {
66
+ const values = new Map<string, string>();
67
+ return {
68
+ get length() {
69
+ return values.size;
70
+ },
71
+ clear() {
72
+ values.clear();
73
+ },
74
+ getItem(key) {
75
+ return values.get(key) ?? null;
76
+ },
77
+ key(index) {
78
+ return [...values.keys()][index] ?? null;
79
+ },
80
+ removeItem(key) {
81
+ values.delete(key);
82
+ },
83
+ setItem(key, value) {
84
+ values.set(String(key), String(value));
85
+ },
86
+ };
87
+ }
63
88
 
64
89
  beforeEach(() => {
65
90
  vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
91
+ localStorageDescriptor = Object.getOwnPropertyDescriptor(
92
+ window,
93
+ "localStorage",
94
+ );
95
+ Object.defineProperty(window, "localStorage", {
96
+ configurable: true,
97
+ value: createMemoryStorage(),
98
+ });
66
99
  window.localStorage.clear();
67
100
  container = document.createElement("div");
68
101
  document.body.appendChild(container);
@@ -79,6 +112,11 @@ describe("McpConnectionSuggestion render", () => {
79
112
  afterEach(() => {
80
113
  act(() => root.unmount());
81
114
  container.remove();
115
+ if (localStorageDescriptor) {
116
+ Object.defineProperty(window, "localStorage", localStorageDescriptor);
117
+ } else {
118
+ Reflect.deleteProperty(window, "localStorage");
119
+ }
82
120
  vi.restoreAllMocks();
83
121
  vi.unstubAllGlobals();
84
122
  });
@@ -26,20 +26,26 @@ const mocks = vi.hoisted(() => ({
26
26
  },
27
27
  }));
28
28
 
29
- vi.mock("./mcp-integration-catalog.js", async (importOriginal) => ({
30
- ...(await importOriginal<
31
- typeof import("@agent-native/core/client/resources/mcp-integration-catalog")
32
- >()),
33
- navigateToMcpOAuthStart: mocks.navigateToMcpOAuthStart,
34
- isCustomMcpIntegrationEnabled: () => mocks.customIntegrationEnabled(),
35
- }));
36
-
37
- vi.mock("./use-mcp-servers.js", async (importOriginal) => ({
38
- ...(await importOriginal<
39
- typeof import("@agent-native/core/client/resources/use-mcp-servers")
40
- >()),
41
- useMcpServers: () => mocks.mcpServersQuery,
42
- }));
29
+ vi.mock(
30
+ "@agent-native/core/client/resources/mcp-integration-catalog",
31
+ async (importOriginal) => ({
32
+ ...(await importOriginal<
33
+ typeof import("@agent-native/core/client/resources/mcp-integration-catalog")
34
+ >()),
35
+ navigateToMcpOAuthStart: mocks.navigateToMcpOAuthStart,
36
+ isCustomMcpIntegrationEnabled: () => mocks.customIntegrationEnabled(),
37
+ }),
38
+ );
39
+
40
+ vi.mock(
41
+ "@agent-native/core/client/resources/use-mcp-servers",
42
+ async (importOriginal) => ({
43
+ ...(await importOriginal<
44
+ typeof import("@agent-native/core/client/resources/use-mcp-servers")
45
+ >()),
46
+ useMcpServers: () => mocks.mcpServersQuery,
47
+ }),
48
+ );
43
49
 
44
50
  describe("McpIntegrationDialog", () => {
45
51
  let container: HTMLDivElement;
@@ -25,20 +25,22 @@ const storageMocks = vi.hoisted(() => ({
25
25
  setup: null as (() => void) | null,
26
26
  }));
27
27
 
28
- vi.mock("../uploads/use-file-upload-status.js", () => ({
28
+ vi.mock("@agent-native/core/client/uploads/use-file-upload-status", () => ({
29
29
  useFileUploadStatus: () => ({
30
30
  ...storageMocks.status,
31
31
  refetch: storageMocks.refetch,
32
32
  }),
33
33
  }));
34
- vi.mock("../uploads/use-upload-resource.js", () => ({
34
+ vi.mock("@agent-native/core/client/uploads/use-upload-resource", () => ({
35
35
  useUploadResource: () => ({ mutate: storageMocks.upload }),
36
36
  }));
37
- vi.mock("../org/hooks.js", () => ({
37
+ vi.mock("@agent-native/core/client/org/hooks", () => ({
38
38
  useOrg: () => ({ data: { orgId: "org-test", role: "member" } }),
39
39
  }));
40
- vi.mock("../i18n.js", () => ({ useT: () => (key: string) => key }));
41
- vi.mock("./use-resources.js", () => ({
40
+ vi.mock("@agent-native/core/client/i18n", () => ({
41
+ useT: () => (key: string) => key,
42
+ }));
43
+ vi.mock("@agent-native/core/client/resources/use-resources", () => ({
42
44
  useResourceTree: () => ({ data: [], isLoading: false }),
43
45
  useResource: () => ({ data: undefined, isError: false }),
44
46
  useCreateResource: () => ({ isPending: false, mutate: vi.fn() }),
@@ -50,13 +52,13 @@ vi.mock("./use-resources.js", () => ({
50
52
  withMcpServersFolder: (tree: unknown[]) => tree,
51
53
  withAgentScratchFolder: (tree: unknown[]) => tree,
52
54
  }));
53
- vi.mock("./use-mcp-servers.js", () => ({
55
+ vi.mock("@agent-native/core/client/resources/use-mcp-servers", () => ({
54
56
  useMcpServers: () => ({ data: undefined }),
55
57
  useCreateMcpServer: () => ({ mutateAsync: vi.fn() }),
56
58
  useDeleteMcpServer: () => ({ isPending: false, mutate: vi.fn() }),
57
59
  parseMcpVirtualId: () => null,
58
60
  }));
59
- vi.mock("./use-builtin-capabilities.js", () => ({
61
+ vi.mock("@agent-native/core/client/resources/use-builtin-capabilities", () => ({
60
62
  useBuiltinCapabilities: () => ({ data: undefined }),
61
63
  parseMcpBuiltinVirtualId: () => null,
62
64
  }));
@@ -76,7 +76,7 @@ const resolvedComment = vi.hoisted(
76
76
  }) satisfies ReviewComment,
77
77
  );
78
78
 
79
- vi.mock("./use-review.js", () => ({
79
+ vi.mock("@agent-native/core/client/review/use-review", () => ({
80
80
  useReviewComments: (...args: unknown[]) => reviewComments(...args),
81
81
  useCreateReviewComment: () => ({
82
82
  mutate,
@@ -115,7 +115,7 @@ import {
115
115
  isTrustedReviewAttachmentUrl,
116
116
  ReviewThreadPanel,
117
117
  } from "./ReviewThreadPanel.js";
118
- vi.mock("../clipboard.js", () => ({ writeClipboardText }));
118
+ vi.mock("@agent-native/toolkit/clipboard", () => ({ writeClipboardText }));
119
119
 
120
120
  function setTextareaValue(textarea: HTMLTextAreaElement, value: string) {
121
121
  const setter = Object.getOwnPropertyDescriptor(
@@ -1,12 +1,16 @@
1
1
  // @vitest-environment happy-dom
2
2
 
3
+ import { AgentNativeI18nProvider } from "@agent-native/core/client/i18n";
3
4
  import { TooltipProvider } from "@agent-native/toolkit/ui/tooltip";
4
5
  import React, { act } from "react";
5
6
  import { createRoot, type Root } from "react-dom/client";
6
7
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
7
8
 
9
+ import { createToolkitI18nCatalog } from "../i18n.js";
8
10
  import { SecretsSection } from "./SecretsSection.js";
9
11
 
12
+ const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
13
+
10
14
  vi.mock("@agent-native/core/client/api-path", () => ({
11
15
  agentNativePath: (path: string) => path,
12
16
  appMountedPath: (path: string) => path,
@@ -73,9 +77,14 @@ function findButton(text: string) {
73
77
 
74
78
  function renderSecretsSection(root: Root, focusKey?: string) {
75
79
  root.render(
76
- <TooltipProvider>
77
- <SecretsSection focusKey={focusKey} />
78
- </TooltipProvider>,
80
+ <AgentNativeI18nProvider
81
+ catalog={toolkitI18nCatalog}
82
+ persistPreference={false}
83
+ >
84
+ <TooltipProvider>
85
+ <SecretsSection focusKey={focusKey} />
86
+ </TooltipProvider>
87
+ </AgentNativeI18nProvider>,
79
88
  );
80
89
  }
81
90
 
@@ -25,7 +25,8 @@ vi.mock("../labs/index.js", () => ({
25
25
  ),
26
26
  }));
27
27
 
28
- vi.mock("@agent-native/core/client/i18n", () => ({
28
+ vi.mock("@agent-native/core/client/i18n", async (importOriginal) => ({
29
+ ...(await importOriginal<typeof import("@agent-native/core/client/i18n")>()),
29
30
  useT: () => (key: string) =>
30
31
  key === "agentChat.auth.logOut" ? "Cerrar sesión" : key,
31
32
  useOptionalLocale: () => ({ locale: "en" }),
@@ -530,6 +531,7 @@ describe("SettingsTabsPage", () => {
530
531
  "#settings-tab-whats-new",
531
532
  );
532
533
  expect(whatsNewTab).not.toBeNull();
534
+ await import("../changelog/Changelog.js");
533
535
 
534
536
  await act(async () => {
535
537
  whatsNewTab!.click();
@@ -609,6 +611,7 @@ describe("SettingsTabsPage", () => {
609
611
  act(() => {
610
612
  root.render(
611
613
  <SettingsTabsPage
614
+ general={<div>General content</div>}
612
615
  generalGroups={<div>App groups</div>}
613
616
  notifications={<div>Email settings</div>}
614
617
  notificationsLabel="Notifications"
@@ -1,5 +1,6 @@
1
1
  // @vitest-environment happy-dom
2
2
 
3
+ import { AgentNativeI18nProvider } from "@agent-native/core/client/i18n";
3
4
  import React, { act } from "react";
4
5
  import { createRoot, type Root } from "react-dom/client";
5
6
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
@@ -80,8 +81,11 @@ vi.mock("./deferred-builder-connect-popover.js", () => ({
80
81
  children,
81
82
  }));
82
83
 
84
+ import { createToolkitI18nCatalog } from "../i18n.js";
83
85
  import { VoiceTranscriptionSection } from "./VoiceTranscriptionSection.js";
84
86
 
87
+ const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
88
+
85
89
  type Handler = (init?: RequestInit) => Response | Promise<Response>;
86
90
 
87
91
  function json(body: unknown, status = 200) {
@@ -140,7 +144,14 @@ describe("VoiceTranscriptionSection compact picker", () => {
140
144
 
141
145
  async function render() {
142
146
  await act(async () => {
143
- root.render(<VoiceTranscriptionSection compact />);
147
+ root.render(
148
+ <AgentNativeI18nProvider
149
+ catalog={toolkitI18nCatalog}
150
+ persistPreference={false}
151
+ >
152
+ <VoiceTranscriptionSection compact />
153
+ </AgentNativeI18nProvider>,
154
+ );
144
155
  });
145
156
  await act(async () => {
146
157
  await new Promise((resolve) => setTimeout(resolve, 0));
@@ -26,9 +26,14 @@ vi.mock("../VoiceTranscriptionSection.js", () => ({
26
26
  ),
27
27
  }));
28
28
 
29
+ import { AgentNativeI18nProvider } from "@agent-native/core/client/i18n";
30
+
31
+ import { createToolkitI18nCatalog } from "../../i18n.js";
29
32
  import { PreferencesSettings } from "./PreferencesSettings.js";
30
33
  import { PREFERENCES_SEARCH_ENTRIES } from "./search-entries.js";
31
34
 
35
+ const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
36
+
32
37
  describe("PreferencesSettings", () => {
33
38
  let container: HTMLDivElement;
34
39
  let root: Root;
@@ -49,7 +54,14 @@ describe("PreferencesSettings", () => {
49
54
 
50
55
  async function render() {
51
56
  await act(async () => {
52
- root.render(<PreferencesSettings />);
57
+ root.render(
58
+ <AgentNativeI18nProvider
59
+ catalog={toolkitI18nCatalog}
60
+ persistPreference={false}
61
+ >
62
+ <PreferencesSettings />
63
+ </AgentNativeI18nProvider>,
64
+ );
53
65
  });
54
66
  }
55
67
 
@@ -67,9 +67,14 @@ vi.mock("@agent-native/core/client/hooks", () => ({
67
67
 
68
68
  vi.mock("@agent-native/core/client/auth/change-email", () => emailChange);
69
69
 
70
+ import { AgentNativeI18nProvider } from "@agent-native/core/client/i18n";
71
+
72
+ import { createToolkitI18nCatalog } from "../../i18n.js";
70
73
  import { ProfileSettings } from "./ProfileSettings.js";
71
74
  import { PROFILE_SEARCH_ENTRIES } from "./search-entries.js";
72
75
 
76
+ const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
77
+
73
78
  describe("ProfileSettings", () => {
74
79
  let container: HTMLDivElement;
75
80
  let root: Root;
@@ -96,7 +101,14 @@ describe("ProfileSettings", () => {
96
101
 
97
102
  async function render() {
98
103
  await act(async () => {
99
- root.render(<ProfileSettings />);
104
+ root.render(
105
+ <AgentNativeI18nProvider
106
+ catalog={toolkitI18nCatalog}
107
+ persistPreference={false}
108
+ >
109
+ <ProfileSettings />
110
+ </AgentNativeI18nProvider>,
111
+ );
100
112
  });
101
113
  }
102
114
 
@@ -74,11 +74,15 @@ vi.mock("@agent-native/core/client/hooks", () => ({
74
74
 
75
75
  vi.mock("@agent-native/core/client/auth/two-factor", () => twoFactor);
76
76
 
77
+ import { AgentNativeI18nProvider } from "@agent-native/core/client/i18n";
77
78
  import { PASSWORD_MIN_LENGTH } from "@agent-native/core/shared/password-policy";
78
79
 
80
+ import { createToolkitI18nCatalog } from "../../i18n.js";
79
81
  import { SECURITY_SEARCH_ENTRIES } from "./search-entries.js";
80
82
  import { SecuritySettings } from "./SecuritySettings.js";
81
83
 
84
+ const toolkitI18nCatalog = createToolkitI18nCatalog({ messages: {} });
85
+
82
86
  describe("SecuritySettings", () => {
83
87
  let container: HTMLDivElement;
84
88
  let root: Root;
@@ -106,7 +110,14 @@ describe("SecuritySettings", () => {
106
110
 
107
111
  async function render() {
108
112
  await act(async () => {
109
- root.render(<SecuritySettings />);
113
+ root.render(
114
+ <AgentNativeI18nProvider
115
+ catalog={toolkitI18nCatalog}
116
+ persistPreference={false}
117
+ >
118
+ <SecuritySettings />
119
+ </AgentNativeI18nProvider>,
120
+ );
110
121
  });
111
122
  await act(async () => {
112
123
  await Promise.resolve();