@antelopejs/dms-assistant 0.2.7-next.444.g0da96b6 → 0.2.7

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 (102) hide show
  1. package/package.json +6 -2
  2. package/frontend-vue/builder/tests/database-build.test.ts +0 -232
  3. package/frontend-vue/builder/tests/database-connect.test.ts +0 -348
  4. package/frontend-vue/builder/tests/database-display.test.ts +0 -112
  5. package/frontend-vue/builder/tests/database.test.ts +0 -138
  6. package/frontend-vue/builder/tests/enabled.test.ts +0 -17
  7. package/frontend-vue/builder/tests/owner-ui.test.ts +0 -29
  8. package/frontend-vue/builder/tests/stubs/frontend-module.ts +0 -63
  9. package/frontend-vue/builder/vitest.config.ts +0 -21
  10. package/frontend-vue/tests/assistant-actions.test.ts +0 -109
  11. package/frontend-vue/tests/assistant-activity.test.ts +0 -281
  12. package/frontend-vue/tests/backend-boundary.test.ts +0 -130
  13. package/frontend-vue/tests/backoff.test.ts +0 -40
  14. package/frontend-vue/tests/block-health.test.ts +0 -142
  15. package/frontend-vue/tests/channel-client.test.ts +0 -246
  16. package/frontend-vue/tests/chat/block-preview.test.ts +0 -367
  17. package/frontend-vue/tests/chat/block-target.test.ts +0 -133
  18. package/frontend-vue/tests/chat/build-view.test.ts +0 -171
  19. package/frontend-vue/tests/chat/chat-scroll.test.ts +0 -251
  20. package/frontend-vue/tests/chat/conversation-events.test.ts +0 -622
  21. package/frontend-vue/tests/chat/diff-and-keys.test.ts +0 -178
  22. package/frontend-vue/tests/chat/held-card.test.ts +0 -133
  23. package/frontend-vue/tests/chat/markdown-content.test.ts +0 -86
  24. package/frontend-vue/tests/chat/markdown.test.ts +0 -352
  25. package/frontend-vue/tests/chat/provider-notice.test.ts +0 -33
  26. package/frontend-vue/tests/chat/tool-lexicon.test.ts +0 -212
  27. package/frontend-vue/tests/chat/useChatChannel.test.ts +0 -124
  28. package/frontend-vue/tests/chat/useConversation.test.ts +0 -288
  29. package/frontend-vue/tests/chat-panel.test.ts +0 -300
  30. package/frontend-vue/tests/chat-transport.test.ts +0 -94
  31. package/frontend-vue/tests/embedding.test.ts +0 -10
  32. package/frontend-vue/tests/formal/connection-analysis-scenarios.ts +0 -130
  33. package/frontend-vue/tests/formal/connection-analysis-world.ts +0 -497
  34. package/frontend-vue/tests/formal/connection-analysis.test.ts +0 -36
  35. package/frontend-vue/tests/host-commands.test.ts +0 -182
  36. package/frontend-vue/tests/launcher-icon.test.ts +0 -62
  37. package/frontend-vue/tests/launcher-label.test.ts +0 -40
  38. package/frontend-vue/tests/launcher-state.test.ts +0 -215
  39. package/frontend-vue/tests/mockup-fold.test.ts +0 -95
  40. package/frontend-vue/tests/navigation.test.ts +0 -142
  41. package/frontend-vue/tests/onboarding-api.test.ts +0 -29
  42. package/frontend-vue/tests/onboarding-claude.test.ts +0 -144
  43. package/frontend-vue/tests/onboarding-connect-memory.test.ts +0 -126
  44. package/frontend-vue/tests/onboarding-controller-restart.test.ts +0 -134
  45. package/frontend-vue/tests/onboarding-controller.test.ts +0 -307
  46. package/frontend-vue/tests/onboarding-database-driver-install.test.ts +0 -112
  47. package/frontend-vue/tests/onboarding-database-engines.test.ts +0 -142
  48. package/frontend-vue/tests/onboarding-database-new-url.test.ts +0 -174
  49. package/frontend-vue/tests/onboarding-database-reload.test.ts +0 -229
  50. package/frontend-vue/tests/onboarding-database-tabs.test.ts +0 -184
  51. package/frontend-vue/tests/onboarding-database.test.ts +0 -540
  52. package/frontend-vue/tests/onboarding-deep-link.test.ts +0 -51
  53. package/frontend-vue/tests/onboarding-flow.test.ts +0 -204
  54. package/frontend-vue/tests/onboarding-install.test.ts +0 -62
  55. package/frontend-vue/tests/onboarding-mockups.test.ts +0 -86
  56. package/frontend-vue/tests/onboarding-scratch.test.ts +0 -70
  57. package/frontend-vue/tests/onboarding-widget.test.ts +0 -97
  58. package/frontend-vue/tests/palette-assistant.test.ts +0 -241
  59. package/frontend-vue/tests/panel-approvals.test.ts +0 -226
  60. package/frontend-vue/tests/panel-closed-conversation.test.ts +0 -53
  61. package/frontend-vue/tests/panel-mockup-prompt.test.ts +0 -238
  62. package/frontend-vue/tests/panel-modes.test.ts +0 -131
  63. package/frontend-vue/tests/panel-questions.test.ts +0 -151
  64. package/frontend-vue/tests/panel-states.test.ts +0 -252
  65. package/frontend-vue/tests/panel-tools.test.ts +0 -219
  66. package/frontend-vue/tests/session-gate.test.ts +0 -66
  67. package/frontend-vue/tests/sidecar-guest.test.ts +0 -81
  68. package/frontend-vue/tests/sidecar-status.test.ts +0 -117
  69. package/frontend-vue/tests/support/api-error-presenter.ts +0 -30
  70. package/frontend-vue/tests/support/database-connect.ts +0 -129
  71. package/frontend-vue/tests/support/dms-frontend-module.ts +0 -9
  72. package/frontend-vue/tests/support/dms-state.ts +0 -12
  73. package/frontend-vue/tests/support/fake-layout.ts +0 -119
  74. package/frontend-vue/tests/support/i18n.ts +0 -49
  75. package/frontend-vue/tests/support/onboarding-host.ts +0 -104
  76. package/frontend-vue/tests/support/onboarding.ts +0 -176
  77. package/frontend-vue/tests/support/panel-fixtures.ts +0 -155
  78. package/frontend-vue/tests/support/panel-harness.ts +0 -211
  79. package/frontend-vue/tests/support/setup-layout.ts +0 -3
  80. package/frontend-vue/tests/support/stand-ins/DmsBlockPreview.ts +0 -18
  81. package/frontend-vue/tests/support/stand-ins/DmsEmptyState.ts +0 -17
  82. package/frontend-vue/tests/support/stand-ins/DmsSegmentedControl.ts +0 -35
  83. package/frontend-vue/tests/support/stand-ins/DmsStatusPill.ts +0 -7
  84. package/frontend-vue/tests/support/stand-ins/OnboardingModal.ts +0 -13
  85. package/frontend-vue/tests/support/stand-ins/UBadge.ts +0 -7
  86. package/frontend-vue/tests/support/stand-ins/UButton.ts +0 -27
  87. package/frontend-vue/tests/support/stand-ins/UCheckbox.ts +0 -25
  88. package/frontend-vue/tests/support/stand-ins/UDropdownMenu.ts +0 -34
  89. package/frontend-vue/tests/support/stand-ins/UFormField.ts +0 -9
  90. package/frontend-vue/tests/support/stand-ins/UInput.ts +0 -16
  91. package/frontend-vue/tests/support/stand-ins/UKbd.ts +0 -7
  92. package/frontend-vue/tests/support/stand-ins/UModal.ts +0 -20
  93. package/frontend-vue/tests/support/stand-ins/UPopover.ts +0 -9
  94. package/frontend-vue/tests/support/stand-ins/UTabs.ts +0 -31
  95. package/frontend-vue/tests/support/stand-ins/UTextarea.ts +0 -19
  96. package/frontend-vue/tests/support/stubs.ts +0 -28
  97. package/frontend-vue/tests/views/api-data-reads.test.ts +0 -451
  98. package/frontend-vue/tests/views/api-error-presentation.test.ts +0 -89
  99. package/frontend-vue/tests/views/diff-view.test.ts +0 -167
  100. package/frontend-vue/tests/views/use-assistant.test.ts +0 -53
  101. package/frontend-vue/tests/views/view-format.test.ts +0 -59
  102. package/frontend-vue/vitest.config.ts +0 -33
@@ -1,178 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import {
3
- approvalKeyAction,
4
- type ApprovalKeyInput,
5
- stepIndex,
6
- } from "../../app/chat/utils/approval-keyboard";
7
- import { diffRows, limitRows } from "../../app/chat/utils/diff";
8
- import { moveItem } from "../../app/chat/utils/queue";
9
- import {
10
- conversationTime,
11
- groupConversations,
12
- } from "../../app/chat/utils/conversation-groups";
13
- import { formatDuration, formatTokens } from "../../app/chat/utils/format";
14
- import type { ConversationSummary } from "../../app/chat/types/conversation";
15
-
16
- describe("a diff is drawn with line numbers", () => {
17
- const rows = diffRows([
18
- {
19
- oldStart: 41,
20
- newStart: 41,
21
- lines: [
22
- { kind: "context", text: " vatNumber: InputText({" },
23
- { kind: "remove", text: ' label: "VAT",' },
24
- { kind: "add", text: ' label: "VAT number",' },
25
- { kind: "add", text: " validate: check," },
26
- { kind: "context", text: " })" },
27
- ],
28
- },
29
- ]);
30
-
31
- it("leads each hunk with its header", () => {
32
- expect(rows[0]).toMatchObject({ kind: "hunk", text: "@@ −41 +41 @@" });
33
- });
34
-
35
- it("numbers removed lines in the old file and the rest in the new one", () => {
36
- expect(
37
- rows.slice(1).map((row) => [row.kind, row.number, row.sign]),
38
- ).toEqual([
39
- ["context", "41", ""],
40
- ["remove", "42", "−"],
41
- ["add", "42", "+"],
42
- ["add", "43", "+"],
43
- ["context", "44", ""],
44
- ]);
45
- });
46
-
47
- it("keeps numbers the sidecar sent", () => {
48
- const [, line] = diffRows([
49
- {
50
- oldStart: 1,
51
- newStart: 1,
52
- lines: [{ kind: "add", text: "x", newLine: 9 }],
53
- },
54
- ]);
55
- expect(line.number).toBe("9");
56
- });
57
-
58
- it("shows the first rows of a long diff and counts the rest", () => {
59
- expect(limitRows(rows, 4)).toMatchObject({ hidden: 2 });
60
- expect(limitRows(rows, 10).hidden).toBe(0);
61
- });
62
- });
63
-
64
- describe("the approvals dock answers to the keyboard", () => {
65
- const key = (value: string, extra: Partial<ApprovalKeyInput> = {}) =>
66
- approvalKeyAction({
67
- key: value,
68
- shiftKey: false,
69
- metaKey: false,
70
- ctrlKey: false,
71
- altKey: false,
72
- isTextTarget: false,
73
- ...extra,
74
- });
75
-
76
- it("maps ↵, N, J and K", () => {
77
- expect(key("Enter")).toBe("allow");
78
- expect(key("n")).toBe("deny");
79
- expect(key("N")).toBe("deny");
80
- expect(key("j")).toBe("next");
81
- expect(key("k")).toBe("previous");
82
- expect(key("x")).toBeNull();
83
- });
84
-
85
- it("leaves text fields and shortcuts alone", () => {
86
- expect(key("n", { isTextTarget: true })).toBeNull();
87
- expect(key("k", { metaKey: true, shiftKey: true })).toBeNull();
88
- expect(key("Enter", { shiftKey: true })).toBeNull();
89
- });
90
-
91
- it("wraps around the requests", () => {
92
- expect(stepIndex(1, 1, 2)).toBe(0);
93
- expect(stepIndex(0, -1, 2)).toBe(1);
94
- expect(stepIndex(0, 1, 0)).toBe(0);
95
- });
96
- });
97
-
98
- describe("the queue reorders in place", () => {
99
- const queue = [{ id: "a" }, { id: "b" }, { id: "c" }];
100
-
101
- it("moves an item to its new index", () => {
102
- expect(moveItem(queue, "c", 0).map((item) => item.id)).toEqual([
103
- "c",
104
- "a",
105
- "b",
106
- ]);
107
- expect(moveItem(queue, "a", 9).map((item) => item.id)).toEqual([
108
- "b",
109
- "c",
110
- "a",
111
- ]);
112
- expect(moveItem(queue, "z", 0)).toEqual(queue);
113
- });
114
- });
115
-
116
- describe("the history drawer groups and dates chats", () => {
117
- const now = new Date(2026, 9, 7, 15, 0).getTime();
118
- const chat = (
119
- id: string,
120
- updatedAtMs: number,
121
- extra = {},
122
- ): ConversationSummary => ({
123
- id,
124
- title: id,
125
- createdAtMs: updatedAtMs,
126
- updatedAtMs,
127
- messageCount: 1,
128
- ...extra,
129
- });
130
-
131
- it("pins working and waiting chats above Today, This week and Older", () => {
132
- const groups = groupConversations(
133
- [
134
- chat("old", new Date(2026, 8, 1).getTime()),
135
- chat("today", now - 3_600_000),
136
- chat("week", now - 3 * 86_400_000),
137
- chat("waiting", now - 30 * 86_400_000, { pendingApprovals: 2 }),
138
- chat("running", now - 60_000, { isRunning: true }),
139
- ],
140
- now,
141
- );
142
- expect(
143
- groups.map((group) => [group.key, group.items.map((i) => i.id)]),
144
- ).toEqual([
145
- ["active", ["running", "waiting"]],
146
- ["today", ["today"]],
147
- ["week", ["week"]],
148
- ["older", ["old"]],
149
- ]);
150
- });
151
-
152
- it("filters by title", () => {
153
- const groups = groupConversations(
154
- [chat("VAT check", now), chat("Refunds", now)],
155
- now,
156
- "vat",
157
- );
158
- expect(groups.flatMap((group) => group.items.map((i) => i.id))).toEqual([
159
- "VAT check",
160
- ]);
161
- });
162
-
163
- it("says now, minutes, then a time", () => {
164
- expect(conversationTime(now - 10_000, now, "en-GB", "now")).toBe("now");
165
- expect(conversationTime(now - 120_000, now, "en-GB", "now")).toBe("2m");
166
- expect(conversationTime(now - 2 * 3_600_000, now, "en-GB", "now")).toBe(
167
- "13:00",
168
- );
169
- });
170
-
171
- it("formats tokens and durations compactly", () => {
172
- expect(formatTokens(840)).toBe("840");
173
- expect(formatTokens(9_600)).toBe("9.6k");
174
- expect(formatTokens(22_000)).toBe("22k");
175
- expect(formatDuration(600)).toBe("0.6s");
176
- expect(formatDuration(72_000)).toBe("1:12");
177
- });
178
- });
@@ -1,133 +0,0 @@
1
- // @vitest-environment jsdom
2
- import { mount } from "@vue/test-utils";
3
- import { describe, expect, it } from "vitest";
4
- import PermissionCard from "../../app/chat/components/PermissionCard.vue";
5
- import { CHAT_I18N_KEY } from "../../app/chat/composables/useChatI18n";
6
- import type { PermissionRequestData } from "../../app/chat/types/permission";
7
- import en from "../../i18n/locales/dms-assistant-panel-en-GB.json";
8
- import fr from "../../i18n/locales/dms-assistant-panel-fr-FR.json";
9
- import { createTestI18n } from "../support/i18n";
10
- import { PANEL_STUBS } from "../support/stubs";
11
-
12
- const OTHER_MAP_ARGS = {
13
- module: "shop",
14
- connection: "pg-main",
15
- resources: [{ relation: "public.items" }],
16
- };
17
-
18
- const OTHER_MAP_REQUEST: PermissionRequestData = {
19
- requestId: "r6",
20
- conversationId: "conv-held-card",
21
- callId: "c6",
22
- toolName: "mcp__dms__builder_map_resources",
23
- args: OTHER_MAP_ARGS,
24
- summary: "Map database tables",
25
- kind: "builder",
26
- alwaysAsk: false,
27
- preview: {
28
- type: "held_tool",
29
- operation: "builder_map_resources",
30
- args: OTHER_MAP_ARGS,
31
- },
32
- ruleOptions: [],
33
- createdAtMs: 0,
34
- expiresAtMs: 0,
35
- };
36
-
37
- const CONFIGURE_DIFF = `--- a/antelope.config.ts\n+++ b/antelope.config.ts\n@@ -1,3 +1,9 @@\n${"+ dms: { config: { mcp: { enabled: true } } },\n".repeat(6)}`;
38
-
39
- const CONFIGURE_STEPS = [
40
- {
41
- action: "ConfigureModule",
42
- module: "@antelopejs/dms",
43
- config: { externalConnections: { erp: { access: "read" } } },
44
- },
45
- ];
46
-
47
- const CONFIGURE_REQUEST: PermissionRequestData = {
48
- ...OTHER_MAP_REQUEST,
49
- requestId: "r7",
50
- callId: "c7",
51
- toolName: "mcp__dms__builder_configure_project",
52
- args: { steps: CONFIGURE_STEPS },
53
- summary: "Configure project",
54
- preview: {
55
- type: "held",
56
- operation: "builder_configure_project",
57
- details: {
58
- plannedChanges: [
59
- { path: "antelope.config.ts", kind: "modify", diff: CONFIGURE_DIFF },
60
- ],
61
- steps: CONFIGURE_STEPS,
62
- },
63
- },
64
- };
65
-
66
- function mountCard(
67
- request: PermissionRequestData,
68
- messages: Record<string, unknown>,
69
- ) {
70
- return mount(PermissionCard, {
71
- props: { request, isFocused: true },
72
- global: {
73
- provide: { [CHAT_I18N_KEY as symbol]: createTestI18n(messages) },
74
- stubs: PANEL_STUBS,
75
- },
76
- });
77
- }
78
-
79
- describe("the card of another call to a tool the DMS holds", () => {
80
- it.each([
81
- [
82
- "en-GB",
83
- en,
84
- "Asked because another call to this tool is waiting for your confirmation.",
85
- ],
86
- [
87
- "fr-FR",
88
- fr,
89
- "Demandé car un autre appel à cet outil attend votre accord.",
90
- ],
91
- ])(
92
- "says, in %s, that it asks because another call to the tool waits, and shows the call's own arguments (fails a card that claims the DMS holds this call)",
93
- (_locale, messages, why) => {
94
- const card = mountCard(OTHER_MAP_REQUEST, messages);
95
- expect(card.find(".perm__why").text()).toBe(why);
96
- const rows = card.find(".perm__kv");
97
- expect(rows.classes()).not.toContain("is-full");
98
- expect(rows.findAll("dt").map((cell) => cell.text())).toEqual([
99
- "module",
100
- "connection",
101
- "resources",
102
- ]);
103
- },
104
- );
105
- });
106
-
107
- describe("the card of a configuration change the DMS holds", () => {
108
- it("lays the diff, and a row whose name is too long to sit beside its value, on the card's whole width under its name (fails a card that squeezes the DMS's diff into the column a long name leaves)", () => {
109
- const rows = mountCard(CONFIGURE_REQUEST, en).find(".perm__kv.is-full");
110
- const wide = (cell: string) =>
111
- rows.findAll(`${cell}.is-stacked`).map((node) => node.text());
112
- expect(wide("dt")).toEqual([
113
- "plannedChanges[0].path",
114
- "plannedChanges[0].kind",
115
- "plannedChanges[0].diff",
116
- "steps[0].config.externalConnections.erp.access",
117
- ]);
118
- expect(wide("dd")).toEqual([
119
- "antelope.config.ts",
120
- "modify",
121
- CONFIGURE_DIFF.trim(),
122
- "read",
123
- ]);
124
- expect(
125
- rows.findAll("dt:not(.is-stacked)").map((node) => node.text()),
126
- ).toEqual(["steps[0].action", "steps[0].module"]);
127
- });
128
-
129
- it("titles the change by its verb alone, with no bare count of its steps (fails a title that appends the number of steps)", () => {
130
- const card = mountCard(CONFIGURE_REQUEST, en);
131
- expect(card.find(".perm__title").text()).toBe("Configure project");
132
- });
133
- });
@@ -1,86 +0,0 @@
1
- // @vitest-environment jsdom
2
- import { mount, type VueWrapper } from "@vue/test-utils";
3
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
- import { nextTick } from "vue";
5
- import MarkdownContent from "../../app/chat/components/MarkdownContent.vue";
6
-
7
- const STREAMED_RENDER_DELAY_MS = 50;
8
-
9
- const ANSWER =
10
- "See [the docs](https://antelopejs.com).\n\n- one\n- two\n\n<img src=x onerror=alert(1)>";
11
-
12
- const LINK =
13
- '<p>See <a href="https://antelopejs.com" target="_blank" rel="noopener noreferrer">the docs</a>.</p>\n';
14
- const RAW_HTML_AS_TEXT = "<p>&lt;img src=x onerror=alert(1)&gt;</p>\n";
15
-
16
- function list(last: string): string {
17
- return `<ul>\n<li>one</li>\n<li>${last}</li>\n</ul>\n`;
18
- }
19
-
20
- function scopeOf(wrapper: VueWrapper): string {
21
- const scope = [...wrapper.element.attributes].find((attribute) =>
22
- attribute.name.startsWith("data-v-"),
23
- );
24
- expect(scope).toBeDefined();
25
- return scope?.name ?? "";
26
- }
27
-
28
- /**
29
- * The markup the `v-html` version rendered for the same blocks: one
30
- * `display: contents` wrapper per block, each carrying the component's scope
31
- * id so its `:deep` styles reach the content.
32
- */
33
- function expectBlocks(wrapper: VueWrapper, blocks: string[]): void {
34
- const scope = scopeOf(wrapper);
35
- const inner = blocks
36
- .map(
37
- (block) => `<div ${scope}="" class="chat-markdown-block">${block}</div>`,
38
- )
39
- .join("");
40
- expect(wrapper.element.outerHTML).toBe(
41
- `<div ${scope}="" class="chat-markdown">${inner}</div>`,
42
- );
43
- }
44
-
45
- function expectNoScriptVector(wrapper: VueWrapper): void {
46
- expect(wrapper.element.querySelector("img, script, [onerror]")).toBeNull();
47
- }
48
-
49
- async function nextFrame(): Promise<void> {
50
- vi.advanceTimersByTime(STREAMED_RENDER_DELAY_MS);
51
- await nextTick();
52
- }
53
-
54
- describe("MarkdownContent", () => {
55
- beforeEach(() => {
56
- vi.useFakeTimers();
57
- });
58
-
59
- afterEach(() => {
60
- vi.useRealTimers();
61
- });
62
-
63
- it("renders a finished answer as one block, with raw HTML shown as text", () => {
64
- const wrapper = mount(MarkdownContent, { props: { content: ANSWER } });
65
- expectBlocks(wrapper, [LINK + list("two") + RAW_HTML_AS_TEXT]);
66
- expectNoScriptVector(wrapper);
67
- });
68
-
69
- it("renders a streaming answer once a frame, settled blocks apart from the open one", async () => {
70
- const wrapper = mount(MarkdownContent, {
71
- props: { content: ANSWER.slice(0, 50), isStreaming: true },
72
- });
73
- expectBlocks(wrapper, [""]);
74
-
75
- await nextFrame();
76
- expectBlocks(wrapper, [LINK, list("t")]);
77
-
78
- await wrapper.setProps({ content: ANSWER });
79
- await nextFrame();
80
- expectBlocks(wrapper, [LINK, list("two"), RAW_HTML_AS_TEXT]);
81
- expectNoScriptVector(wrapper);
82
-
83
- await wrapper.setProps({ isStreaming: false });
84
- expectBlocks(wrapper, [LINK + list("two") + RAW_HTML_AS_TEXT]);
85
- });
86
- });