@nospt/plugin-dev-ai-hub 0.2.4 → 0.3.0
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/api/DevAiHubResourceClient.esm.js +97 -0
- package/dist/api/DevAiHubResourceClient.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/AiResourcesPage.esm.js +150 -0
- package/dist/components/AiResourcesPage/AiResourcesPage.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/AiResourcesPage.module.css.esm.js +8 -0
- package/dist/components/AiResourcesPage/AiResourcesPage.module.css.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/ResourceCard.esm.js +158 -0
- package/dist/components/AiResourcesPage/ResourceCard.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/ResourceCard.module.css.esm.js +8 -0
- package/dist/components/AiResourcesPage/ResourceCard.module.css.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/ResourceDetailPanel.esm.js +234 -0
- package/dist/components/AiResourcesPage/ResourceDetailPanel.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/ResourceDetailPanel.module.css.esm.js +8 -0
- package/dist/components/AiResourcesPage/ResourceDetailPanel.module.css.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/ResourceFilters.esm.js +242 -0
- package/dist/components/AiResourcesPage/ResourceFilters.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/ResourceFilters.module.css.esm.js +8 -0
- package/dist/components/AiResourcesPage/ResourceFilters.module.css.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/ResourceInstallDialog.esm.js +366 -0
- package/dist/components/AiResourcesPage/ResourceInstallDialog.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/ResourceInstallDialog.module.css.esm.js +8 -0
- package/dist/components/AiResourcesPage/ResourceInstallDialog.module.css.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/StatTiles.esm.js +49 -0
- package/dist/components/AiResourcesPage/StatTiles.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/StatTiles.module.css.esm.js +8 -0
- package/dist/components/AiResourcesPage/StatTiles.module.css.esm.js.map +1 -0
- package/dist/components/AiResourcesPage/index.esm.js +6 -0
- package/dist/components/AiResourcesPage/typeMeta.esm.js +35 -0
- package/dist/components/AiResourcesPage/typeMeta.esm.js.map +1 -0
- package/dist/components/ToolIcon/ToolIcon.esm.js +26 -9
- package/dist/components/ToolIcon/ToolIcon.esm.js.map +1 -1
- package/dist/hooks/useResourceBody.esm.js +39 -0
- package/dist/hooks/useResourceBody.esm.js.map +1 -0
- package/dist/hooks/useResources.esm.js +26 -0
- package/dist/hooks/useResources.esm.js.map +1 -0
- package/dist/hooks/useTelemetryCounts.esm.js +24 -0
- package/dist/hooks/useTelemetryCounts.esm.js.map +1 -0
- package/dist/index.d.ts +1 -38
- package/dist/index.esm.js +1 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +15 -24
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js +1 -2
- package/dist/routes.esm.js.map +1 -1
- package/package.json +17 -10
- package/.eslintrc.js +0 -1
- package/dev/index.tsx +0 -32
- package/dist/api/DevAiHubClient.esm.js +0 -78
- package/dist/api/DevAiHubClient.esm.js.map +0 -1
- package/dist/components/AssetCard/AssetCard.esm.js +0 -120
- package/dist/components/AssetCard/AssetCard.esm.js.map +0 -1
- package/dist/components/AssetCard/AssetCard.module.css.esm.js +0 -8
- package/dist/components/AssetCard/AssetCard.module.css.esm.js.map +0 -1
- package/dist/components/AssetDetailPanel/AssetDetailPanel.esm.js +0 -218
- package/dist/components/AssetDetailPanel/AssetDetailPanel.esm.js.map +0 -1
- package/dist/components/AssetDetailPanel/AssetDetailPanel.module.css.esm.js +0 -8
- package/dist/components/AssetDetailPanel/AssetDetailPanel.module.css.esm.js.map +0 -1
- package/dist/components/AssetFilters/AssetFilters.esm.js +0 -176
- package/dist/components/AssetFilters/AssetFilters.esm.js.map +0 -1
- package/dist/components/AssetFilters/AssetFilters.module.css.esm.js +0 -8
- package/dist/components/AssetFilters/AssetFilters.module.css.esm.js.map +0 -1
- package/dist/components/AssetInstallDialog/AssetInstallDialog.esm.js +0 -138
- package/dist/components/AssetInstallDialog/AssetInstallDialog.esm.js.map +0 -1
- package/dist/components/AssetInstallDialog/AssetInstallDialog.module.css.esm.js +0 -8
- package/dist/components/AssetInstallDialog/AssetInstallDialog.module.css.esm.js.map +0 -1
- package/dist/components/DevAiHubPage/DevAiHubPage.esm.js +0 -195
- package/dist/components/DevAiHubPage/DevAiHubPage.esm.js.map +0 -1
- package/dist/components/DevAiHubPage/DevAiHubPage.module.css.esm.js +0 -8
- package/dist/components/DevAiHubPage/DevAiHubPage.module.css.esm.js.map +0 -1
- package/dist/components/DevAiHubPage/index.esm.js +0 -6
- package/dist/components/McpConfigPage/McpConfigPage.esm.js +0 -200
- package/dist/components/McpConfigPage/McpConfigPage.esm.js.map +0 -1
- package/dist/components/McpConfigPage/McpConfigPage.module.css.esm.js +0 -8
- package/dist/components/McpConfigPage/McpConfigPage.module.css.esm.js.map +0 -1
- package/dist/components/McpConfigPage/index.esm.js +0 -6
- package/dist/components/McpConfigPage/index.esm.js.map +0 -1
- package/dist/hooks/index.esm.js +0 -114
- package/dist/hooks/index.esm.js.map +0 -1
- package/dist/pluginLegacy.esm.js +0 -27
- package/dist/pluginLegacy.esm.js.map +0 -1
- package/package.json-prepack +0 -85
- package/src/api/DevAiHubClient.ts +0 -110
- package/src/components/AssetCard/AssetCard.module.css +0 -153
- package/src/components/AssetCard/AssetCard.test.tsx +0 -182
- package/src/components/AssetCard/AssetCard.tsx +0 -152
- package/src/components/AssetCard/index.ts +0 -1
- package/src/components/AssetDetailPanel/AssetDetailPanel.module.css +0 -207
- package/src/components/AssetDetailPanel/AssetDetailPanel.tsx +0 -313
- package/src/components/AssetDetailPanel/index.ts +0 -1
- package/src/components/AssetFilters/AssetFilters.module.css +0 -67
- package/src/components/AssetFilters/AssetFilters.tsx +0 -219
- package/src/components/AssetFilters/index.ts +0 -2
- package/src/components/AssetInstallDialog/AssetInstallDialog.module.css +0 -72
- package/src/components/AssetInstallDialog/AssetInstallDialog.tsx +0 -176
- package/src/components/AssetInstallDialog/index.ts +0 -1
- package/src/components/DevAiHubPage/DevAiHubPage.module.css +0 -105
- package/src/components/DevAiHubPage/DevAiHubPage.tsx +0 -197
- package/src/components/DevAiHubPage/index.ts +0 -1
- package/src/components/McpConfigDialog/McpConfigDialog.module.css +0 -111
- package/src/components/McpConfigDialog/McpConfigDialog.tsx +0 -271
- package/src/components/McpConfigDialog/index.ts +0 -1
- package/src/components/McpConfigPage/McpConfigPage.module.css +0 -121
- package/src/components/McpConfigPage/McpConfigPage.tsx +0 -242
- package/src/components/McpConfigPage/index.ts +0 -1
- package/src/components/ToolIcon/ToolIcon.tsx +0 -65
- package/src/components/ToolIcon/index.ts +0 -1
- package/src/css-modules.d.ts +0 -4
- package/src/hooks/index.ts +0 -152
- package/src/index.ts +0 -10
- package/src/plugin.tsx +0 -60
- package/src/pluginLegacy.ts +0 -42
- package/src/routes.ts +0 -4
- package/tests/e2e/.auth.json +0 -14
- package/tests/e2e/asset-detail.spec.ts +0 -90
- package/tests/e2e/asset-filtering.spec.ts +0 -145
- package/tests/e2e/asset-installation.spec.ts +0 -74
- package/tests/e2e/dev-ai-hub-page.spec.ts +0 -89
- package/tests/e2e/fixtures/base.ts +0 -61
- package/tests/e2e/fixtures/mock-api.ts +0 -221
- package/tests/e2e/mcp-config.spec.ts +0 -88
- package/tsconfig.json +0 -10
- /package/dist/components/{DevAiHubPage → AiResourcesPage}/index.esm.js.map +0 -0
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical mock data for e2e tests.
|
|
3
|
-
*
|
|
4
|
-
* DEV_ASSETS / DEV_STATS are used directly in test assertions.
|
|
5
|
-
* MOCK_ASSETS_FULL / buildListResponse / MOCK_PROVIDER / MOCK_STATS are used
|
|
6
|
-
* by the base fixture to intercept real API calls with predictable responses.
|
|
7
|
-
*/
|
|
8
|
-
import type {
|
|
9
|
-
AiAsset,
|
|
10
|
-
AiAssetListResponse,
|
|
11
|
-
AiHubProvider,
|
|
12
|
-
AiHubStats,
|
|
13
|
-
} from '@nospt/plugin-dev-ai-hub-common';
|
|
14
|
-
|
|
15
|
-
// ── Summary data used in test assertions ──────────────────────────────────────
|
|
16
|
-
|
|
17
|
-
export const DEV_ASSETS = [
|
|
18
|
-
{ id: 'mock-1', name: 'TypeScript Best Practices', type: 'instruction', installCount: 14, tools: ['claude-code', 'github-copilot'] },
|
|
19
|
-
{ id: 'mock-2', name: 'Code Review Agent', type: 'agent', installCount: 8, tools: ['claude-code'] },
|
|
20
|
-
{ id: 'mock-3', name: 'Git Commit', type: 'skill', installCount: 22, tools: ['all'] },
|
|
21
|
-
{ id: 'mock-4', name: 'Feature Development Workflow', type: 'workflow', installCount: 5, tools: ['github-copilot', 'cursor'] },
|
|
22
|
-
{ id: 'mock-5', name: 'Security Guidelines', type: 'instruction', installCount: 3, tools: ['google-gemini', 'claude-code'] },
|
|
23
|
-
{ id: 'mock-6', name: 'Product Manager', type: 'agent', installCount: 0, tools: ['github-copilot'] },
|
|
24
|
-
] as const;
|
|
25
|
-
|
|
26
|
-
export const DEV_STATS = {
|
|
27
|
-
total: DEV_ASSETS.length,
|
|
28
|
-
byType: { instruction: 2, agent: 2, skill: 1, workflow: 1 },
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const FIRST_ASSET = DEV_ASSETS[0].name;
|
|
32
|
-
|
|
33
|
-
// ── Full asset data for API route interception ────────────────────────────────
|
|
34
|
-
|
|
35
|
-
export const MOCK_ASSETS_FULL: AiAsset[] = [
|
|
36
|
-
{
|
|
37
|
-
id: 'mock-1',
|
|
38
|
-
providerId: 'mock-provider',
|
|
39
|
-
name: 'TypeScript Best Practices',
|
|
40
|
-
description: 'Coding standards and best practices for TypeScript projects.',
|
|
41
|
-
type: 'instruction',
|
|
42
|
-
tools: ['claude-code', 'github-copilot'],
|
|
43
|
-
tags: ['typescript', 'best-practices'],
|
|
44
|
-
author: 'Platform Team',
|
|
45
|
-
version: '1.0.0',
|
|
46
|
-
content: '# TypeScript Best Practices\n\nAlways use strict mode. Prefer `interface` over `type` for object shapes. Use explicit return types on public functions.',
|
|
47
|
-
yamlRaw: 'name: TypeScript Best Practices\ntype: instruction',
|
|
48
|
-
yamlPath: 'instructions/typescript-best-practices.yaml',
|
|
49
|
-
mdPath: 'instructions/typescript-best-practices.md',
|
|
50
|
-
repoUrl: 'https://github.com/example/ai-assets',
|
|
51
|
-
branch: 'main',
|
|
52
|
-
installCount: 14,
|
|
53
|
-
syncedAt: new Date(Date.now() - 5 * 60 * 1000).toISOString(),
|
|
54
|
-
createdAt: '2026-03-10T10:00:00Z',
|
|
55
|
-
updatedAt: '2026-03-10T12:00:00Z',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: 'mock-2',
|
|
59
|
-
providerId: 'mock-provider',
|
|
60
|
-
name: 'Code Review Agent',
|
|
61
|
-
description: 'Specialized agent for performing thorough and constructive code reviews.',
|
|
62
|
-
type: 'agent',
|
|
63
|
-
tools: ['claude-code'],
|
|
64
|
-
tags: ['code-review', 'quality'],
|
|
65
|
-
author: 'Platform Team',
|
|
66
|
-
version: '1.2.0',
|
|
67
|
-
content: '# Code Review Agent\n\nYou are an expert code reviewer. Focus on correctness, performance, security, and maintainability.',
|
|
68
|
-
yamlRaw: 'name: Code Review Agent\ntype: agent',
|
|
69
|
-
yamlPath: 'agents/code-review.yaml',
|
|
70
|
-
mdPath: 'agents/code-review.md',
|
|
71
|
-
repoUrl: 'https://github.com/example/ai-assets',
|
|
72
|
-
branch: 'main',
|
|
73
|
-
installCount: 8,
|
|
74
|
-
syncedAt: new Date(Date.now() - 5 * 60 * 1000).toISOString(),
|
|
75
|
-
createdAt: '2024-02-01T10:00:00Z',
|
|
76
|
-
updatedAt: '2024-03-10T09:00:00Z',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'mock-3',
|
|
80
|
-
providerId: 'mock-provider',
|
|
81
|
-
name: 'Git Commit',
|
|
82
|
-
description: 'Skill for creating well-structured, conventional git commit messages.',
|
|
83
|
-
type: 'skill',
|
|
84
|
-
tools: ['all'],
|
|
85
|
-
tags: ['git', 'commits', 'conventional-commits'],
|
|
86
|
-
author: 'Platform Team',
|
|
87
|
-
version: '1.0.0',
|
|
88
|
-
content: '# Git Commit Skill\n\nCreate commit messages following the Conventional Commits specification.',
|
|
89
|
-
yamlRaw: 'name: Git Commit\ntype: skill',
|
|
90
|
-
yamlPath: 'skills/git-commit/skill.yaml',
|
|
91
|
-
mdPath: 'skills/git-commit/SKILL.md',
|
|
92
|
-
repoUrl: 'https://github.com/example/ai-assets',
|
|
93
|
-
branch: 'main',
|
|
94
|
-
installCount: 22,
|
|
95
|
-
syncedAt: new Date(Date.now() - 5 * 60 * 1000).toISOString(),
|
|
96
|
-
createdAt: '2024-01-20T10:00:00Z',
|
|
97
|
-
updatedAt: '2024-02-15T14:00:00Z',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: 'mock-4',
|
|
101
|
-
providerId: 'mock-provider',
|
|
102
|
-
name: 'Feature Development Workflow',
|
|
103
|
-
description: 'Step-by-step workflow for planning, implementing and shipping a new feature.',
|
|
104
|
-
type: 'workflow',
|
|
105
|
-
tools: ['github-copilot', 'cursor'],
|
|
106
|
-
tags: ['workflow', 'feature', 'development'],
|
|
107
|
-
author: 'Platform Team',
|
|
108
|
-
version: '2.0.0',
|
|
109
|
-
content: '# Feature Development Workflow\n\n## Step 1: Planning\n\n## Step 2: Implementation\n\n## Step 3: Testing\n\n## Step 4: Review',
|
|
110
|
-
yamlRaw: 'name: Feature Development Workflow\ntype: workflow',
|
|
111
|
-
yamlPath: 'workflows/feature-development.yaml',
|
|
112
|
-
mdPath: 'workflows/feature-development.md',
|
|
113
|
-
repoUrl: 'https://github.com/example/ai-assets',
|
|
114
|
-
branch: 'main',
|
|
115
|
-
installCount: 5,
|
|
116
|
-
syncedAt: new Date(Date.now() - 5 * 60 * 1000).toISOString(),
|
|
117
|
-
createdAt: '2024-03-01T10:00:00Z',
|
|
118
|
-
updatedAt: '2024-03-20T16:00:00Z',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: 'mock-5',
|
|
122
|
-
providerId: 'mock-provider',
|
|
123
|
-
name: 'Security Guidelines',
|
|
124
|
-
description: 'Security best practices and guidelines for backend development.',
|
|
125
|
-
type: 'instruction',
|
|
126
|
-
tools: ['google-gemini', 'claude-code'],
|
|
127
|
-
tags: ['security', 'backend', 'best-practices'],
|
|
128
|
-
author: 'Security Team',
|
|
129
|
-
version: '1.1.0',
|
|
130
|
-
content: '# Security Guidelines\n\nNever store secrets in code. Always validate user input. Use parameterized queries.',
|
|
131
|
-
yamlRaw: 'name: Security Guidelines\ntype: instruction',
|
|
132
|
-
yamlPath: 'instructions/security-guidelines.yaml',
|
|
133
|
-
mdPath: 'instructions/security-guidelines.md',
|
|
134
|
-
repoUrl: 'https://github.com/example/ai-assets',
|
|
135
|
-
branch: 'main',
|
|
136
|
-
installCount: 3,
|
|
137
|
-
syncedAt: new Date(Date.now() - 5 * 60 * 1000).toISOString(),
|
|
138
|
-
createdAt: '2024-02-10T10:00:00Z',
|
|
139
|
-
updatedAt: '2024-03-05T11:00:00Z',
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
id: 'mock-6',
|
|
143
|
-
providerId: 'mock-provider',
|
|
144
|
-
name: 'Product Manager',
|
|
145
|
-
description: 'Data-driven product decision assistant for roadmap and prioritization.',
|
|
146
|
-
type: 'agent',
|
|
147
|
-
tools: ['github-copilot'],
|
|
148
|
-
tags: ['product', 'roadmap', 'prioritization'],
|
|
149
|
-
author: 'Product Team',
|
|
150
|
-
version: '1.0.0',
|
|
151
|
-
content: '# Product Manager Agent\n\nYou are a data-driven product manager. Help prioritize features using impact/effort frameworks.',
|
|
152
|
-
yamlRaw: 'name: Product Manager\ntype: agent',
|
|
153
|
-
yamlPath: 'agents/product-manager.yaml',
|
|
154
|
-
mdPath: 'agents/product-manager.md',
|
|
155
|
-
repoUrl: 'https://github.com/example/ai-assets',
|
|
156
|
-
branch: 'main',
|
|
157
|
-
installCount: 0,
|
|
158
|
-
syncedAt: new Date(Date.now() - 5 * 60 * 1000).toISOString(),
|
|
159
|
-
createdAt: '2024-03-15T10:00:00Z',
|
|
160
|
-
updatedAt: '2024-03-15T10:00:00Z',
|
|
161
|
-
},
|
|
162
|
-
];
|
|
163
|
-
|
|
164
|
-
export const MOCK_PROVIDER: AiHubProvider = {
|
|
165
|
-
id: 'mock-provider',
|
|
166
|
-
type: 'github',
|
|
167
|
-
target: 'https://github.com/example/ai-assets.git',
|
|
168
|
-
branch: 'main',
|
|
169
|
-
lastSync: new Date(Date.now() - 5 * 60 * 1000).toISOString(),
|
|
170
|
-
status: 'idle',
|
|
171
|
-
assetCount: MOCK_ASSETS_FULL.length,
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export const MOCK_STATS: AiHubStats = {
|
|
175
|
-
totalAssets: MOCK_ASSETS_FULL.length,
|
|
176
|
-
byType: { instruction: 2, agent: 2, skill: 1, workflow: 1 },
|
|
177
|
-
byTool: {
|
|
178
|
-
'claude-code': MOCK_ASSETS_FULL.filter(a => a.tools.includes('claude-code') || a.tools.includes('all')).length,
|
|
179
|
-
'github-copilot': MOCK_ASSETS_FULL.filter(a => a.tools.includes('github-copilot') || a.tools.includes('all')).length,
|
|
180
|
-
'google-gemini': MOCK_ASSETS_FULL.filter(a => a.tools.includes('google-gemini') || a.tools.includes('all')).length,
|
|
181
|
-
'cursor': MOCK_ASSETS_FULL.filter(a => a.tools.includes('cursor') || a.tools.includes('all')).length,
|
|
182
|
-
},
|
|
183
|
-
byProvider: { 'mock-provider': MOCK_ASSETS_FULL.length },
|
|
184
|
-
lastSync: MOCK_PROVIDER.lastSync,
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
/** Applies the same filter logic the backend uses, for use in page.route() handlers. */
|
|
188
|
-
export function buildListResponse(params: URLSearchParams): AiAssetListResponse {
|
|
189
|
-
let items = [...MOCK_ASSETS_FULL];
|
|
190
|
-
|
|
191
|
-
const type = params.get('type');
|
|
192
|
-
const tool = params.get('tool');
|
|
193
|
-
const search = params.get('search');
|
|
194
|
-
const tags = params.get('tags')?.split(',').filter(Boolean);
|
|
195
|
-
const provider = params.get('provider');
|
|
196
|
-
const page = Number(params.get('page') ?? '1');
|
|
197
|
-
const pageSize = Number(params.get('pageSize') ?? '24');
|
|
198
|
-
|
|
199
|
-
if (type) items = items.filter(a => a.type === type);
|
|
200
|
-
if (tool) items = items.filter(a => a.tools.includes(tool as any) || a.tools.includes('all'));
|
|
201
|
-
if (search) {
|
|
202
|
-
const q = search.toLowerCase();
|
|
203
|
-
items = items.filter(a =>
|
|
204
|
-
a.name.toLowerCase().includes(q) ||
|
|
205
|
-
a.description.toLowerCase().includes(q) ||
|
|
206
|
-
a.tags.some(t => t.toLowerCase().includes(q)),
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
if (tags?.length) items = items.filter(a => tags.every(t => a.tags.includes(t)));
|
|
210
|
-
if (provider) items = items.filter(a => a.providerId === provider);
|
|
211
|
-
|
|
212
|
-
const totalCount = items.length;
|
|
213
|
-
const start = (page - 1) * pageSize;
|
|
214
|
-
|
|
215
|
-
return {
|
|
216
|
-
items: items.slice(start, start + pageSize) as any,
|
|
217
|
-
totalCount,
|
|
218
|
-
page,
|
|
219
|
-
pageSize,
|
|
220
|
-
};
|
|
221
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { test, expect } from './fixtures/base';
|
|
2
|
-
|
|
3
|
-
// McpConfigPage is registered at /mcp-config in dev/index.tsx
|
|
4
|
-
const PAGE_URL = '/mcp-config';
|
|
5
|
-
|
|
6
|
-
test.describe('MCP Configuration Page', () => {
|
|
7
|
-
test.beforeEach(async ({ page }) => {
|
|
8
|
-
await page.goto(PAGE_URL);
|
|
9
|
-
await expect(page.getByText('Configure MCP Server')).toBeVisible();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('renders the page heading', async ({ page }) => {
|
|
13
|
-
await expect(page.getByText('Configure MCP Server')).toBeVisible();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
test('renders the subtitle', async ({ page }) => {
|
|
17
|
-
await expect(
|
|
18
|
-
page.getByText('Connect your AI tool to the Dev AI Hub via Model Context Protocol.'),
|
|
19
|
-
).toBeVisible();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test('shows tabs for all three supported tools', async ({ page }) => {
|
|
23
|
-
// TOOL_CONFIGS defines Claude Code, GitHub Copilot, Google Gemini
|
|
24
|
-
await expect(page.getByRole('tab', { name: /Claude Code/i })).toBeVisible();
|
|
25
|
-
await expect(page.getByRole('tab', { name: /GitHub Copilot/i })).toBeVisible();
|
|
26
|
-
await expect(page.getByRole('tab', { name: /Google Gemini/i })).toBeVisible();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test('"Claude Code" tab is selected by default', async ({ page }) => {
|
|
30
|
-
await expect(page.getByRole('tab', { name: /Claude Code/i })).toHaveAttribute('aria-selected', 'true');
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test('Claude Code panel shows .mcp.json config snippet', async ({ page }) => {
|
|
34
|
-
await expect(page.getByText('.mcp.json', { exact: true })).toBeVisible();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test('switching to GitHub Copilot tab shows .vscode/settings.json snippet', async ({ page }) => {
|
|
38
|
-
await page.getByRole('tab', { name: /GitHub Copilot/i }).click();
|
|
39
|
-
await expect(page.getByText('.vscode/settings.json', { exact: true })).toBeVisible();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test('switching to Google Gemini tab shows gemini-config.json snippet', async ({ page }) => {
|
|
43
|
-
await page.getByRole('tab', { name: /Google Gemini/i }).click();
|
|
44
|
-
await expect(page.getByText('gemini-config.json')).toBeVisible();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test('shows the "MCP Endpoint" section', async ({ page }) => {
|
|
48
|
-
await expect(page.getByText('MCP Endpoint')).toBeVisible();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('"Copy URL" button is present', async ({ page }) => {
|
|
52
|
-
await expect(page.getByRole('button', { name: 'Copy URL' })).toBeVisible();
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
test('"Copy config" button is present', async ({ page }) => {
|
|
56
|
-
await expect(page.getByRole('button', { name: 'Copy config' })).toBeVisible();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('proactive suggestions switch is unchecked by default', async ({ page }) => {
|
|
60
|
-
const toggle = page.getByRole('switch', { name: 'Proactive suggestions' });
|
|
61
|
-
await expect(toggle).toBeVisible();
|
|
62
|
-
await expect(toggle).not.toBeChecked();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test('enabling proactive toggle appends ?proactive=true to the MCP URL', async ({ page }) => {
|
|
66
|
-
await page.getByRole('switch', { name: 'Proactive suggestions' }).click({ force: true });
|
|
67
|
-
await expect(page.getByText(/proactive=true/).first()).toBeVisible();
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test('switching tabs updates the tool param in the MCP URL', async ({ page }) => {
|
|
71
|
-
const urlBefore = await page.getByText(/\/mcp\?/).first().textContent();
|
|
72
|
-
expect(urlBefore).toContain('tool=claude-code');
|
|
73
|
-
|
|
74
|
-
await page.getByRole('tab', { name: /GitHub Copilot/i }).click();
|
|
75
|
-
const urlAfter = await page.getByText(/\/mcp\?/).first().textContent();
|
|
76
|
-
expect(urlAfter).toContain('tool=github-copilot');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test('hint text references ?tool= and suggest_assets', async ({ page }) => {
|
|
80
|
-
await expect(page.getByText(/Omit \?tool=/)).toBeVisible();
|
|
81
|
-
await expect(page.getByText(/suggest_assets/)).toBeVisible();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test('"Copy URL" button label changes to "Copied!" after click', async ({ page }) => {
|
|
85
|
-
await page.getByRole('button', { name: 'Copy URL' }).click();
|
|
86
|
-
await expect(page.getByRole('button', { name: 'Copied!' })).toBeVisible();
|
|
87
|
-
});
|
|
88
|
-
});
|
package/tsconfig.json
DELETED
|
File without changes
|