@structured-world/gitlab-mcp 6.12.0 → 6.14.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.
@@ -0,0 +1,3 @@
1
+ export { Profile, Preset, ProfilesConfig, ProfileInfo, ProfileValidationResult, AuthConfig, PatAuth, OAuthAuth, CookieAuth, FeatureFlags, ProfileSchema, PresetSchema, ProfilesConfigSchema, } from "./types";
2
+ export { ProfileLoader, loadProfile, getProfileNameFromEnv } from "./loader";
3
+ export { applyProfile, applyPreset, loadAndApplyProfile, loadAndApplyPreset, tryApplyProfileFromEnv, ApplyProfileResult, ApplyPresetResult, } from "./applicator";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tryApplyProfileFromEnv = exports.loadAndApplyPreset = exports.loadAndApplyProfile = exports.applyPreset = exports.applyProfile = exports.getProfileNameFromEnv = exports.loadProfile = exports.ProfileLoader = exports.ProfilesConfigSchema = exports.PresetSchema = exports.ProfileSchema = void 0;
4
+ var types_1 = require("./types");
5
+ Object.defineProperty(exports, "ProfileSchema", { enumerable: true, get: function () { return types_1.ProfileSchema; } });
6
+ Object.defineProperty(exports, "PresetSchema", { enumerable: true, get: function () { return types_1.PresetSchema; } });
7
+ Object.defineProperty(exports, "ProfilesConfigSchema", { enumerable: true, get: function () { return types_1.ProfilesConfigSchema; } });
8
+ var loader_1 = require("./loader");
9
+ Object.defineProperty(exports, "ProfileLoader", { enumerable: true, get: function () { return loader_1.ProfileLoader; } });
10
+ Object.defineProperty(exports, "loadProfile", { enumerable: true, get: function () { return loader_1.loadProfile; } });
11
+ Object.defineProperty(exports, "getProfileNameFromEnv", { enumerable: true, get: function () { return loader_1.getProfileNameFromEnv; } });
12
+ var applicator_1 = require("./applicator");
13
+ Object.defineProperty(exports, "applyProfile", { enumerable: true, get: function () { return applicator_1.applyProfile; } });
14
+ Object.defineProperty(exports, "applyPreset", { enumerable: true, get: function () { return applicator_1.applyPreset; } });
15
+ Object.defineProperty(exports, "loadAndApplyProfile", { enumerable: true, get: function () { return applicator_1.loadAndApplyProfile; } });
16
+ Object.defineProperty(exports, "loadAndApplyPreset", { enumerable: true, get: function () { return applicator_1.loadAndApplyPreset; } });
17
+ Object.defineProperty(exports, "tryApplyProfileFromEnv", { enumerable: true, get: function () { return applicator_1.tryApplyProfileFromEnv; } });
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/profiles/index.ts"],"names":[],"mappings":";;;AAiBA,iCAciB;AAHf,sGAAA,aAAa,OAAA;AACb,qGAAA,YAAY,OAAA;AACZ,6GAAA,oBAAoB,OAAA;AAItB,mCAA6E;AAApE,uGAAA,aAAa,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,+GAAA,qBAAqB,OAAA;AAG1D,2CAQsB;AAPpB,0GAAA,YAAY,OAAA;AACZ,yGAAA,WAAW,OAAA;AACX,iHAAA,mBAAmB,OAAA;AACnB,gHAAA,kBAAkB,OAAA;AAClB,oHAAA,sBAAsB,OAAA"}
@@ -0,0 +1,32 @@
1
+ import { Profile, Preset, ProfileInfo, ProfileValidationResult } from "./types";
2
+ export declare class ProfileLoader {
3
+ private userConfigPath;
4
+ private builtinDir;
5
+ private profileCache;
6
+ private presetCache;
7
+ private configCache;
8
+ constructor(userConfigPath?: string, builtinDir?: string);
9
+ loadProfile(name: string): Promise<Profile>;
10
+ loadPreset(name: string): Promise<Preset>;
11
+ loadAny(name: string): Promise<{
12
+ type: "profile";
13
+ data: Profile;
14
+ } | {
15
+ type: "preset";
16
+ data: Preset;
17
+ }>;
18
+ getDefaultProfileName(): Promise<string | undefined>;
19
+ private loadUserConfig;
20
+ private loadUserProfile;
21
+ private loadBuiltinPreset;
22
+ listProfiles(): Promise<ProfileInfo[]>;
23
+ private validateDeniedActions;
24
+ validateProfile(profile: Profile): Promise<ProfileValidationResult>;
25
+ validatePreset(preset: Preset): Promise<ProfileValidationResult>;
26
+ static ensureConfigDir(): void;
27
+ static getUserConfigPath(): string;
28
+ clearCache(): void;
29
+ }
30
+ export declare function loadProfile(name: string): Promise<Profile>;
31
+ export declare function loadPreset(name: string): Promise<Preset>;
32
+ export declare function getProfileNameFromEnv(): string | undefined;
@@ -0,0 +1,316 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ProfileLoader = void 0;
37
+ exports.loadProfile = loadProfile;
38
+ exports.loadPreset = loadPreset;
39
+ exports.getProfileNameFromEnv = getProfileNameFromEnv;
40
+ const fs = __importStar(require("fs"));
41
+ const path = __importStar(require("path"));
42
+ const os = __importStar(require("os"));
43
+ const yaml = __importStar(require("yaml"));
44
+ const types_1 = require("./types");
45
+ const logger_1 = require("../logger");
46
+ const USER_CONFIG_DIR = path.join(os.homedir(), ".config", "gitlab-mcp");
47
+ const USER_PROFILES_PATH = path.join(USER_CONFIG_DIR, "profiles.yaml");
48
+ function getBuiltinDir() {
49
+ const candidates = [
50
+ path.join(__dirname, "builtin"),
51
+ path.join(process.cwd(), "dist", "src", "profiles", "builtin"),
52
+ path.join(process.cwd(), "src", "profiles", "builtin"),
53
+ ];
54
+ for (const dir of candidates) {
55
+ if (fs.existsSync(dir)) {
56
+ return dir;
57
+ }
58
+ }
59
+ return candidates[0];
60
+ }
61
+ class ProfileLoader {
62
+ userConfigPath;
63
+ builtinDir;
64
+ profileCache = new Map();
65
+ presetCache = new Map();
66
+ configCache = null;
67
+ constructor(userConfigPath = USER_PROFILES_PATH, builtinDir) {
68
+ this.userConfigPath = userConfigPath;
69
+ this.builtinDir = builtinDir ?? getBuiltinDir();
70
+ }
71
+ async loadProfile(name) {
72
+ const cached = this.profileCache.get(name);
73
+ if (cached) {
74
+ return cached;
75
+ }
76
+ const userProfile = await this.loadUserProfile(name);
77
+ if (userProfile) {
78
+ this.profileCache.set(name, userProfile);
79
+ return userProfile;
80
+ }
81
+ throw new Error(`Profile '${name}' not found. Full profiles must be defined in user config. ` +
82
+ `For built-in presets (settings only), use loadPreset('${name}').`);
83
+ }
84
+ async loadPreset(name) {
85
+ const cached = this.presetCache.get(name);
86
+ if (cached) {
87
+ return cached;
88
+ }
89
+ const preset = await this.loadBuiltinPreset(name);
90
+ if (preset) {
91
+ this.presetCache.set(name, preset);
92
+ return preset;
93
+ }
94
+ throw new Error(`Preset '${name}' not found in built-in presets`);
95
+ }
96
+ async loadAny(name) {
97
+ try {
98
+ const profile = await this.loadProfile(name);
99
+ return { type: "profile", data: profile };
100
+ }
101
+ catch {
102
+ }
103
+ const preset = await this.loadBuiltinPreset(name);
104
+ if (preset) {
105
+ return { type: "preset", data: preset };
106
+ }
107
+ throw new Error(`'${name}' not found as user profile or built-in preset. ` +
108
+ `Use 'yarn list-tools --profiles' to see available options.`);
109
+ }
110
+ async getDefaultProfileName() {
111
+ const config = await this.loadUserConfig();
112
+ return config?.default_profile;
113
+ }
114
+ async loadUserConfig() {
115
+ if (this.configCache !== null) {
116
+ return this.configCache;
117
+ }
118
+ if (!fs.existsSync(this.userConfigPath)) {
119
+ logger_1.logger.debug({ path: this.userConfigPath }, "User profiles config not found");
120
+ return null;
121
+ }
122
+ try {
123
+ const content = fs.readFileSync(this.userConfigPath, "utf8");
124
+ const parsed = yaml.parse(content);
125
+ const validated = types_1.ProfilesConfigSchema.parse(parsed);
126
+ this.configCache = validated;
127
+ logger_1.logger.debug({ path: this.userConfigPath, profiles: Object.keys(validated.profiles) }, "Loaded user profiles config");
128
+ return validated;
129
+ }
130
+ catch (error) {
131
+ const message = error instanceof Error ? error.message : String(error);
132
+ logger_1.logger.error({ error: message, path: this.userConfigPath }, "Failed to parse user profiles");
133
+ throw new Error(`Invalid profiles config: ${message}`);
134
+ }
135
+ }
136
+ async loadUserProfile(name) {
137
+ const config = await this.loadUserConfig();
138
+ return config?.profiles[name] ?? null;
139
+ }
140
+ async loadBuiltinPreset(name) {
141
+ const presetPath = path.join(this.builtinDir, `${name}.yaml`);
142
+ if (!fs.existsSync(presetPath)) {
143
+ logger_1.logger.debug({ name, path: presetPath }, "Built-in preset not found");
144
+ return null;
145
+ }
146
+ try {
147
+ const content = fs.readFileSync(presetPath, "utf8");
148
+ const parsed = yaml.parse(content);
149
+ const validated = types_1.PresetSchema.parse(parsed);
150
+ logger_1.logger.debug({ name }, "Loaded built-in preset");
151
+ return validated;
152
+ }
153
+ catch (error) {
154
+ const message = error instanceof Error ? error.message : String(error);
155
+ logger_1.logger.error({ error: message, name }, "Failed to parse built-in preset");
156
+ throw new Error(`Invalid built-in preset '${name}': ${message}`);
157
+ }
158
+ }
159
+ async listProfiles() {
160
+ const profiles = [];
161
+ const userConfig = await this.loadUserConfig();
162
+ if (userConfig) {
163
+ for (const [name, profile] of Object.entries(userConfig.profiles)) {
164
+ profiles.push({
165
+ name,
166
+ host: profile.host,
167
+ authType: profile.auth.type,
168
+ readOnly: profile.read_only ?? false,
169
+ isBuiltIn: false,
170
+ isPreset: false,
171
+ });
172
+ }
173
+ }
174
+ if (fs.existsSync(this.builtinDir)) {
175
+ const files = fs.readdirSync(this.builtinDir).filter(f => f.endsWith(".yaml"));
176
+ for (const file of files) {
177
+ const name = path.basename(file, ".yaml");
178
+ try {
179
+ const preset = await this.loadBuiltinPreset(name);
180
+ if (preset) {
181
+ profiles.push({
182
+ name,
183
+ readOnly: preset.read_only ?? false,
184
+ isBuiltIn: true,
185
+ isPreset: true,
186
+ description: preset.description,
187
+ });
188
+ }
189
+ }
190
+ catch {
191
+ logger_1.logger.warn({ name }, "Skipping invalid built-in preset");
192
+ }
193
+ }
194
+ }
195
+ return profiles.sort((a, b) => {
196
+ if (a.isPreset !== b.isPreset) {
197
+ return a.isPreset ? 1 : -1;
198
+ }
199
+ return a.name.localeCompare(b.name);
200
+ });
201
+ }
202
+ validateDeniedActions(deniedActions, errors, warnings) {
203
+ if (!deniedActions)
204
+ return;
205
+ for (const action of deniedActions) {
206
+ const colonIndex = action.indexOf(":");
207
+ if (colonIndex === -1) {
208
+ errors.push(`Invalid denied_action format '${action}', expected 'tool:action'`);
209
+ }
210
+ else {
211
+ const tool = action.slice(0, colonIndex).trim();
212
+ const act = action.slice(colonIndex + 1).trim();
213
+ if (!tool || !act) {
214
+ errors.push(`Invalid denied_action format '${action}', expected 'tool:action'`);
215
+ }
216
+ else if (action !== `${tool}:${act}`) {
217
+ warnings.push(`denied_action '${action}' has extra whitespace, normalized to '${tool}:${act}'`);
218
+ }
219
+ }
220
+ }
221
+ }
222
+ async validateProfile(profile) {
223
+ const errors = [];
224
+ const warnings = [];
225
+ if (profile.auth.type === "pat" && profile.auth.token_env) {
226
+ if (!process.env[profile.auth.token_env]) {
227
+ warnings.push(`Environment variable '${profile.auth.token_env}' is not set`);
228
+ }
229
+ }
230
+ if (profile.auth.type === "oauth" && profile.auth.client_id_env) {
231
+ if (!process.env[profile.auth.client_id_env]) {
232
+ warnings.push(`Environment variable '${profile.auth.client_id_env}' is not set`);
233
+ }
234
+ }
235
+ if (profile.auth.type === "oauth" && profile.auth.client_secret_env) {
236
+ if (!process.env[profile.auth.client_secret_env]) {
237
+ warnings.push(`Environment variable '${profile.auth.client_secret_env}' is not set`);
238
+ }
239
+ }
240
+ if (profile.auth.type === "cookie" &&
241
+ "cookie_path" in profile.auth &&
242
+ profile.auth.cookie_path) {
243
+ if (!fs.existsSync(profile.auth.cookie_path)) {
244
+ errors.push(`Cookie file not found: ${profile.auth.cookie_path}`);
245
+ }
246
+ }
247
+ if (profile.ssl_cert_path && !fs.existsSync(profile.ssl_cert_path)) {
248
+ errors.push(`SSL certificate not found: ${profile.ssl_cert_path}`);
249
+ }
250
+ if (profile.ssl_key_path && !fs.existsSync(profile.ssl_key_path)) {
251
+ errors.push(`SSL key not found: ${profile.ssl_key_path}`);
252
+ }
253
+ if (profile.ca_cert_path && !fs.existsSync(profile.ca_cert_path)) {
254
+ errors.push(`CA certificate not found: ${profile.ca_cert_path}`);
255
+ }
256
+ if (profile.denied_tools_regex) {
257
+ try {
258
+ new RegExp(profile.denied_tools_regex);
259
+ }
260
+ catch {
261
+ errors.push(`Invalid regex in denied_tools_regex: ${profile.denied_tools_regex}`);
262
+ }
263
+ }
264
+ this.validateDeniedActions(profile.denied_actions, errors, warnings);
265
+ return {
266
+ valid: errors.length === 0,
267
+ errors,
268
+ warnings,
269
+ };
270
+ }
271
+ async validatePreset(preset) {
272
+ const errors = [];
273
+ const warnings = [];
274
+ if (preset.denied_tools_regex) {
275
+ try {
276
+ new RegExp(preset.denied_tools_regex);
277
+ }
278
+ catch {
279
+ errors.push(`Invalid regex in denied_tools_regex: ${preset.denied_tools_regex}`);
280
+ }
281
+ }
282
+ this.validateDeniedActions(preset.denied_actions, errors, warnings);
283
+ return {
284
+ valid: errors.length === 0,
285
+ errors,
286
+ warnings,
287
+ };
288
+ }
289
+ static ensureConfigDir() {
290
+ if (!fs.existsSync(USER_CONFIG_DIR)) {
291
+ fs.mkdirSync(USER_CONFIG_DIR, { recursive: true });
292
+ logger_1.logger.info({ path: USER_CONFIG_DIR }, "Created config directory");
293
+ }
294
+ }
295
+ static getUserConfigPath() {
296
+ return USER_PROFILES_PATH;
297
+ }
298
+ clearCache() {
299
+ this.profileCache.clear();
300
+ this.presetCache.clear();
301
+ this.configCache = null;
302
+ }
303
+ }
304
+ exports.ProfileLoader = ProfileLoader;
305
+ async function loadProfile(name) {
306
+ const loader = new ProfileLoader();
307
+ return loader.loadProfile(name);
308
+ }
309
+ async function loadPreset(name) {
310
+ const loader = new ProfileLoader();
311
+ return loader.loadPreset(name);
312
+ }
313
+ function getProfileNameFromEnv() {
314
+ return process.env.GITLAB_PROFILE;
315
+ }
316
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/profiles/loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmbA,kCAGC;AAKD,gCAGC;AAKD,sDAEC;AAtbD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,2CAA6B;AAC7B,mCAQiB;AACjB,sCAAmC;AAMnC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AACzE,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;AAYvE,SAAS,aAAa;IACpB,MAAM,UAAU,GAAG;QAEjB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;QAE/B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE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,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAKD,SAAgB,qBAAqB;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;AACpC,CAAC"}
@@ -0,0 +1,167 @@
1
+ import { z } from "zod";
2
+ declare const PatAuthSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"pat">;
4
+ token_env: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const OAuthAuthSchema: z.ZodObject<{
7
+ type: z.ZodLiteral<"oauth">;
8
+ client_id_env: z.ZodString;
9
+ client_secret_env: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ declare const CookieAuthSchema: z.ZodObject<{
12
+ type: z.ZodLiteral<"cookie">;
13
+ cookie_path: z.ZodString;
14
+ }, z.core.$strip>;
15
+ declare const AuthConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
16
+ type: z.ZodLiteral<"pat">;
17
+ token_env: z.ZodString;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ type: z.ZodLiteral<"oauth">;
20
+ client_id_env: z.ZodString;
21
+ client_secret_env: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ type: z.ZodLiteral<"cookie">;
24
+ cookie_path: z.ZodString;
25
+ }, z.core.$strip>], "type">;
26
+ declare const FeatureFlagsSchema: z.ZodOptional<z.ZodObject<{
27
+ wiki: z.ZodOptional<z.ZodBoolean>;
28
+ milestones: z.ZodOptional<z.ZodBoolean>;
29
+ pipelines: z.ZodOptional<z.ZodBoolean>;
30
+ labels: z.ZodOptional<z.ZodBoolean>;
31
+ mrs: z.ZodOptional<z.ZodBoolean>;
32
+ files: z.ZodOptional<z.ZodBoolean>;
33
+ variables: z.ZodOptional<z.ZodBoolean>;
34
+ workitems: z.ZodOptional<z.ZodBoolean>;
35
+ webhooks: z.ZodOptional<z.ZodBoolean>;
36
+ snippets: z.ZodOptional<z.ZodBoolean>;
37
+ integrations: z.ZodOptional<z.ZodBoolean>;
38
+ }, z.core.$strip>>;
39
+ export declare const ProfileSchema: z.ZodObject<{
40
+ host: z.ZodString;
41
+ api_url: z.ZodOptional<z.ZodString>;
42
+ auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
43
+ type: z.ZodLiteral<"pat">;
44
+ token_env: z.ZodString;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ type: z.ZodLiteral<"oauth">;
47
+ client_id_env: z.ZodString;
48
+ client_secret_env: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ type: z.ZodLiteral<"cookie">;
51
+ cookie_path: z.ZodString;
52
+ }, z.core.$strip>], "type">;
53
+ read_only: z.ZodOptional<z.ZodBoolean>;
54
+ allowed_projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ allowed_groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
56
+ denied_tools_regex: z.ZodOptional<z.ZodString>;
57
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
+ denied_actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
+ features: z.ZodOptional<z.ZodObject<{
60
+ wiki: z.ZodOptional<z.ZodBoolean>;
61
+ milestones: z.ZodOptional<z.ZodBoolean>;
62
+ pipelines: z.ZodOptional<z.ZodBoolean>;
63
+ labels: z.ZodOptional<z.ZodBoolean>;
64
+ mrs: z.ZodOptional<z.ZodBoolean>;
65
+ files: z.ZodOptional<z.ZodBoolean>;
66
+ variables: z.ZodOptional<z.ZodBoolean>;
67
+ workitems: z.ZodOptional<z.ZodBoolean>;
68
+ webhooks: z.ZodOptional<z.ZodBoolean>;
69
+ snippets: z.ZodOptional<z.ZodBoolean>;
70
+ integrations: z.ZodOptional<z.ZodBoolean>;
71
+ }, z.core.$strip>>;
72
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
73
+ default_project: z.ZodOptional<z.ZodString>;
74
+ default_namespace: z.ZodOptional<z.ZodString>;
75
+ skip_tls_verify: z.ZodOptional<z.ZodBoolean>;
76
+ ssl_cert_path: z.ZodOptional<z.ZodString>;
77
+ ssl_key_path: z.ZodOptional<z.ZodString>;
78
+ ca_cert_path: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strip>;
80
+ export declare const PresetSchema: z.ZodObject<{
81
+ description: z.ZodOptional<z.ZodString>;
82
+ read_only: z.ZodOptional<z.ZodBoolean>;
83
+ denied_tools_regex: z.ZodOptional<z.ZodString>;
84
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
+ denied_actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
+ features: z.ZodOptional<z.ZodObject<{
87
+ wiki: z.ZodOptional<z.ZodBoolean>;
88
+ milestones: z.ZodOptional<z.ZodBoolean>;
89
+ pipelines: z.ZodOptional<z.ZodBoolean>;
90
+ labels: z.ZodOptional<z.ZodBoolean>;
91
+ mrs: z.ZodOptional<z.ZodBoolean>;
92
+ files: z.ZodOptional<z.ZodBoolean>;
93
+ variables: z.ZodOptional<z.ZodBoolean>;
94
+ workitems: z.ZodOptional<z.ZodBoolean>;
95
+ webhooks: z.ZodOptional<z.ZodBoolean>;
96
+ snippets: z.ZodOptional<z.ZodBoolean>;
97
+ integrations: z.ZodOptional<z.ZodBoolean>;
98
+ }, z.core.$strip>>;
99
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
100
+ }, z.core.$strict>;
101
+ export declare const ProfilesConfigSchema: z.ZodObject<{
102
+ profiles: z.ZodRecord<z.ZodString, z.ZodObject<{
103
+ host: z.ZodString;
104
+ api_url: z.ZodOptional<z.ZodString>;
105
+ auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
106
+ type: z.ZodLiteral<"pat">;
107
+ token_env: z.ZodString;
108
+ }, z.core.$strip>, z.ZodObject<{
109
+ type: z.ZodLiteral<"oauth">;
110
+ client_id_env: z.ZodString;
111
+ client_secret_env: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>, z.ZodObject<{
113
+ type: z.ZodLiteral<"cookie">;
114
+ cookie_path: z.ZodString;
115
+ }, z.core.$strip>], "type">;
116
+ read_only: z.ZodOptional<z.ZodBoolean>;
117
+ allowed_projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
118
+ allowed_groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
+ denied_tools_regex: z.ZodOptional<z.ZodString>;
120
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
121
+ denied_actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ features: z.ZodOptional<z.ZodObject<{
123
+ wiki: z.ZodOptional<z.ZodBoolean>;
124
+ milestones: z.ZodOptional<z.ZodBoolean>;
125
+ pipelines: z.ZodOptional<z.ZodBoolean>;
126
+ labels: z.ZodOptional<z.ZodBoolean>;
127
+ mrs: z.ZodOptional<z.ZodBoolean>;
128
+ files: z.ZodOptional<z.ZodBoolean>;
129
+ variables: z.ZodOptional<z.ZodBoolean>;
130
+ workitems: z.ZodOptional<z.ZodBoolean>;
131
+ webhooks: z.ZodOptional<z.ZodBoolean>;
132
+ snippets: z.ZodOptional<z.ZodBoolean>;
133
+ integrations: z.ZodOptional<z.ZodBoolean>;
134
+ }, z.core.$strip>>;
135
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
136
+ default_project: z.ZodOptional<z.ZodString>;
137
+ default_namespace: z.ZodOptional<z.ZodString>;
138
+ skip_tls_verify: z.ZodOptional<z.ZodBoolean>;
139
+ ssl_cert_path: z.ZodOptional<z.ZodString>;
140
+ ssl_key_path: z.ZodOptional<z.ZodString>;
141
+ ca_cert_path: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strip>>;
143
+ default_profile: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>;
145
+ export type PatAuth = z.infer<typeof PatAuthSchema>;
146
+ export type OAuthAuth = z.infer<typeof OAuthAuthSchema>;
147
+ export type CookieAuth = z.infer<typeof CookieAuthSchema>;
148
+ export type AuthConfig = z.infer<typeof AuthConfigSchema>;
149
+ export type FeatureFlags = z.infer<typeof FeatureFlagsSchema>;
150
+ export type Profile = z.infer<typeof ProfileSchema>;
151
+ export type Preset = z.infer<typeof PresetSchema>;
152
+ export type ProfilesConfig = z.infer<typeof ProfilesConfigSchema>;
153
+ export interface ProfileInfo {
154
+ name: string;
155
+ host?: string;
156
+ authType?: "pat" | "oauth" | "cookie";
157
+ readOnly: boolean;
158
+ isBuiltIn: boolean;
159
+ isPreset: boolean;
160
+ description?: string;
161
+ }
162
+ export interface ProfileValidationResult {
163
+ valid: boolean;
164
+ errors: string[];
165
+ warnings: string[];
166
+ }
167
+ export {};
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProfilesConfigSchema = exports.PresetSchema = exports.ProfileSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const PatAuthSchema = zod_1.z.object({
6
+ type: zod_1.z.literal("pat"),
7
+ token_env: zod_1.z.string().describe("Environment variable containing the PAT token"),
8
+ });
9
+ const OAuthAuthSchema = zod_1.z.object({
10
+ type: zod_1.z.literal("oauth"),
11
+ client_id_env: zod_1.z.string().describe("Environment variable containing OAuth client ID"),
12
+ client_secret_env: zod_1.z
13
+ .string()
14
+ .optional()
15
+ .describe("Environment variable containing OAuth client secret"),
16
+ });
17
+ const CookieAuthSchema = zod_1.z.object({
18
+ type: zod_1.z.literal("cookie"),
19
+ cookie_path: zod_1.z.string().describe("Path to cookie file for authentication"),
20
+ });
21
+ const AuthConfigSchema = zod_1.z.discriminatedUnion("type", [
22
+ PatAuthSchema,
23
+ OAuthAuthSchema,
24
+ CookieAuthSchema,
25
+ ]);
26
+ const FeatureFlagsSchema = zod_1.z
27
+ .object({
28
+ wiki: zod_1.z.boolean().optional(),
29
+ milestones: zod_1.z.boolean().optional(),
30
+ pipelines: zod_1.z.boolean().optional(),
31
+ labels: zod_1.z.boolean().optional(),
32
+ mrs: zod_1.z.boolean().optional(),
33
+ files: zod_1.z.boolean().optional(),
34
+ variables: zod_1.z.boolean().optional(),
35
+ workitems: zod_1.z.boolean().optional(),
36
+ webhooks: zod_1.z.boolean().optional(),
37
+ snippets: zod_1.z.boolean().optional(),
38
+ integrations: zod_1.z.boolean().optional(),
39
+ })
40
+ .optional();
41
+ exports.ProfileSchema = zod_1.z.object({
42
+ host: zod_1.z.string().describe("GitLab hostname (e.g., gitlab.company.com)"),
43
+ api_url: zod_1.z.string().url().optional().describe("Override API URL (default: https://{host})"),
44
+ auth: AuthConfigSchema,
45
+ read_only: zod_1.z.boolean().optional().describe("Enable read-only mode"),
46
+ allowed_projects: zod_1.z
47
+ .array(zod_1.z.string())
48
+ .optional()
49
+ .describe("Project whitelist (empty = all allowed)"),
50
+ allowed_groups: zod_1.z.array(zod_1.z.string()).optional().describe("Group whitelist (empty = all allowed)"),
51
+ denied_tools_regex: zod_1.z.string().optional().describe("Regex pattern to exclude tools"),
52
+ allowed_tools: zod_1.z
53
+ .array(zod_1.z.string())
54
+ .optional()
55
+ .describe("Explicit tool whitelist (overrides denied_tools_regex)"),
56
+ denied_actions: zod_1.z.array(zod_1.z.string()).optional().describe("Denied actions in format 'tool:action'"),
57
+ features: FeatureFlagsSchema,
58
+ timeout_ms: zod_1.z.number().int().positive().optional().describe("API timeout in milliseconds"),
59
+ default_project: zod_1.z.string().optional().describe("Auto-set project context"),
60
+ default_namespace: zod_1.z.string().optional().describe("Auto-set namespace context"),
61
+ skip_tls_verify: zod_1.z.boolean().optional().describe("Skip TLS certificate verification"),
62
+ ssl_cert_path: zod_1.z.string().optional().describe("Path to SSL certificate"),
63
+ ssl_key_path: zod_1.z.string().optional().describe("Path to SSL key"),
64
+ ca_cert_path: zod_1.z.string().optional().describe("Path to CA certificate"),
65
+ });
66
+ exports.PresetSchema = zod_1.z
67
+ .object({
68
+ description: zod_1.z.string().optional().describe("Human-readable description of the preset"),
69
+ read_only: zod_1.z.boolean().optional().describe("Enable read-only mode"),
70
+ denied_tools_regex: zod_1.z.string().optional().describe("Regex pattern to exclude tools"),
71
+ allowed_tools: zod_1.z.array(zod_1.z.string()).optional().describe("Explicit tool whitelist"),
72
+ denied_actions: zod_1.z
73
+ .array(zod_1.z.string())
74
+ .optional()
75
+ .describe("Denied actions in format 'tool:action'"),
76
+ features: FeatureFlagsSchema,
77
+ timeout_ms: zod_1.z.number().int().positive().optional().describe("API timeout in milliseconds"),
78
+ })
79
+ .strict();
80
+ exports.ProfilesConfigSchema = zod_1.z.object({
81
+ profiles: zod_1.z.record(zod_1.z.string(), exports.ProfileSchema).describe("Named profiles"),
82
+ default_profile: zod_1.z.string().optional().describe("Default profile when none specified"),
83
+ });
84
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/profiles/types.ts"],"names":[],"mappings":";;;AAUA,6BAAwB;AAMxB,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACtB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;CAChF,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IACrF,iBAAiB,EAAE,OAAC;SACjB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,qDAAqD,CAAC;CACnE,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;CAC3E,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,OA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