Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | 9x 145x 9x 9x 9x | /**
* Types for the init wizard
*/
/**
* User role selection for preset mapping.
*
* IMPORTANT: These are wizard-facing role names that users see and select.
* They differ from the actual GITLAB_MCP_PRESET values for better UX:
* - "reviewer" (wizard) → "code-reviewer" (preset)
* - "senior-developer" (wizard) → "senior-dev" (preset)
* - "tech-lead" (wizard) → "full-access" (preset)
*
* The mapping is defined in ROLE_PRESETS below.
*/
export type UserRole =
| 'developer'
| 'senior-developer'
| 'tech-lead'
| 'devops'
| 'reviewer' // Maps to "code-reviewer" preset
| 'readonly';
/**
* GitLab instance type
*/
export type InstanceType = 'saas' | 'self-hosted';
/**
* MCP client type for configuration generation
*/
export type McpClient =
| 'claude-desktop'
| 'claude-code'
| 'cursor'
| 'vscode-copilot'
| 'windsurf'
| 'cline'
| 'roo-code'
| 'codex'
| 'generic';
/**
* Configuration gathered during wizard
*/
export interface WizardConfig {
/** GitLab instance URL */
instanceUrl: string;
/** Personal Access Token */
token: string;
/** User role for preset selection */
role: UserRole;
/** Target MCP client */
client: McpClient;
/** Whether to use read-only mode */
readOnly: boolean;
/** Detected preset name based on role */
presetName?: string;
}
/**
* Result of connection test
*/
export interface ConnectionTestResult {
success: boolean;
username?: string;
email?: string;
isAdmin?: boolean;
gitlabVersion?: string;
error?: string;
}
/**
* Server the client starts as a local process over stdio
*/
export interface StdioServerConfig {
command: string;
args: string[];
env: Record<string, string>;
}
/**
* Server the client reaches over Streamable HTTP; it signs in through the
* server's OAuth, so the configuration holds no credentials
*/
export interface RemoteServerConfig {
url: string;
}
/**
* Generated configuration for MCP client
*/
export type McpServerConfig = StdioServerConfig | RemoteServerConfig;
export function isRemoteServerConfig(config: McpServerConfig): config is RemoteServerConfig {
return 'url' in config;
}
/**
* Role to preset mapping.
* Maps wizard-facing UserRole values to actual GITLAB_MCP_PRESET names.
* Some mappings differ (e.g., "reviewer" → "code-reviewer") to provide
* simpler labels in the wizard UI while using correct preset identifiers.
*/
export const ROLE_PRESETS: Record<UserRole, string> = {
developer: 'developer',
'senior-developer': 'senior-dev',
'tech-lead': 'full-access',
devops: 'devops',
reviewer: 'code-reviewer', // Wizard uses "reviewer", preset is "code-reviewer"
readonly: 'readonly',
};
/**
* Role descriptions for wizard selection
*/
export const ROLE_DESCRIPTIONS: Record<UserRole, string> = {
developer: 'Standard development workflow (issues, MRs, pipelines)',
'senior-developer': 'Extended access with wiki, snippets, variables',
'tech-lead': 'Full access to all features including admin tools',
devops: 'CI/CD focused (pipelines, variables, deployments)',
reviewer: 'Code review workflow (MRs, discussions, approvals)',
readonly: 'Read-only access for monitoring and viewing',
};
/**
* MCP client display names and config paths
*/
export const MCP_CLIENT_INFO: Record<
McpClient,
{
name: string;
configPath: string;
supportsCliInstall: boolean;
}
> = {
'claude-desktop': {
name: 'Claude Desktop',
configPath:
process.platform === 'darwin'
? '~/Library/Application Support/Claude/claude_desktop_config.json'
: process.platform === 'win32'
? '%APPDATA%/Claude/claude_desktop_config.json'
: '',
supportsCliInstall: false,
},
'claude-code': {
name: 'Claude Code',
configPath: '~/.claude.json',
supportsCliInstall: true,
},
cursor: {
name: 'Cursor',
configPath: '~/.cursor/mcp.json',
supportsCliInstall: false,
},
'vscode-copilot': {
name: 'VS Code (GitHub Copilot)',
configPath: '.vscode/mcp.json',
supportsCliInstall: false,
},
windsurf: {
name: 'Windsurf',
configPath: '~/.codeium/windsurf/mcp_config.json',
supportsCliInstall: false,
},
cline: {
name: 'Cline',
configPath:
'~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
supportsCliInstall: false,
},
'roo-code': {
name: 'Roo Code',
configPath: '~/.roo/mcp.json',
supportsCliInstall: false,
},
codex: {
name: 'Codex',
configPath: '~/.codex/config.toml',
supportsCliInstall: true,
},
generic: {
name: 'Other / Generic',
configPath: '',
supportsCliInstall: false,
},
};
|