@structured-world/gitlab-mcp 6.12.0 → 6.13.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/src/main.js CHANGED
@@ -3,7 +3,50 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const server_1 = require("./server");
5
5
  const logger_1 = require("./logger");
6
- (0, server_1.startServer)().catch((error) => {
6
+ const profiles_1 = require("./profiles");
7
+ function getProfileFromArgs() {
8
+ const args = process.argv.slice(2);
9
+ let profileName;
10
+ let profileCount = 0;
11
+ for (let i = 0; i < args.length; i++) {
12
+ if (args[i] === "--profile") {
13
+ const value = args[i + 1];
14
+ if (!value || value.startsWith("--")) {
15
+ logger_1.logger.error("--profile requires a profile name (e.g., --profile work)");
16
+ process.exit(1);
17
+ }
18
+ profileCount++;
19
+ if (profileCount === 1) {
20
+ profileName = value;
21
+ }
22
+ }
23
+ }
24
+ if (profileCount > 1) {
25
+ logger_1.logger.warn({ count: profileCount }, "Multiple --profile flags detected, using first value");
26
+ }
27
+ return profileName;
28
+ }
29
+ async function main() {
30
+ const profileName = getProfileFromArgs();
31
+ try {
32
+ const result = await (0, profiles_1.tryApplyProfileFromEnv)(profileName);
33
+ if (result) {
34
+ if ("profileName" in result) {
35
+ logger_1.logger.info({ profile: result.profileName, host: result.host }, "Using configuration profile");
36
+ }
37
+ else {
38
+ logger_1.logger.info({ preset: result.presetName }, "Using configuration preset");
39
+ }
40
+ }
41
+ }
42
+ catch (error) {
43
+ const message = error instanceof Error ? error.message : String(error);
44
+ logger_1.logger.error({ error: message }, "Failed to load profile");
45
+ process.exit(1);
46
+ }
47
+ await (0, server_1.startServer)();
48
+ }
49
+ main().catch((error) => {
7
50
  logger_1.logger.error(`Failed to start GitLab MCP Server: ${String(error)}`);
8
51
  process.exit(1);
9
52
  });
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;AAEA,q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rB,CAAC;AAKD,KAAK,UAAU,IAAI;IAEjB,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAsB,EAAC,WAAW,CAAC,CAAC;QACzD,IAAI,MAAM,EAAE,CAAC;YAEX,IAAI,aAAa,IAAI,MAAM,EAAE,CAAC;gBAC5B,eAAM,CAAC,IAAI,CACT,EAAE,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAClD,6BAA6B,CAC9B,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,eAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE,4BAA4B,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAEf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,eAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,wBAAwB,CAAC,CAAC;QAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAGD,MAAM,IAAA,oBAAW,GAAE,CAAC;AACtB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,eAAM,CAAC,KAAK,CAAC,sCAAsC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { Profile, Preset, ProfileValidationResult } from "./types";
2
+ export interface ApplyProfileResult {
3
+ success: boolean;
4
+ profileName: string;
5
+ host: string;
6
+ appliedSettings: string[];
7
+ validation: ProfileValidationResult;
8
+ }
9
+ export interface ApplyPresetResult {
10
+ success: boolean;
11
+ presetName: string;
12
+ appliedSettings: string[];
13
+ validation: ProfileValidationResult;
14
+ }
15
+ export declare function applyProfile(profile: Profile, profileName: string): Promise<ApplyProfileResult>;
16
+ export declare function applyPreset(preset: Preset, presetName: string): Promise<ApplyPresetResult>;
17
+ export declare function loadAndApplyProfile(profileName: string): Promise<ApplyProfileResult>;
18
+ export declare function loadAndApplyPreset(presetName: string): Promise<ApplyPresetResult>;
19
+ export declare function tryApplyProfileFromEnv(cliProfileName?: string): Promise<ApplyProfileResult | ApplyPresetResult | undefined>;
@@ -0,0 +1,250 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyProfile = applyProfile;
4
+ exports.applyPreset = applyPreset;
5
+ exports.loadAndApplyProfile = loadAndApplyProfile;
6
+ exports.loadAndApplyPreset = loadAndApplyPreset;
7
+ exports.tryApplyProfileFromEnv = tryApplyProfileFromEnv;
8
+ const loader_1 = require("./loader");
9
+ const logger_1 = require("../logger");
10
+ const FEATURE_ENV_MAP = {
11
+ wiki: "USE_GITLAB_WIKI",
12
+ milestones: "USE_MILESTONE",
13
+ pipelines: "USE_PIPELINE",
14
+ labels: "USE_LABELS",
15
+ mrs: "USE_MRS",
16
+ files: "USE_FILES",
17
+ variables: "USE_VARIABLES",
18
+ workitems: "USE_WORKITEMS",
19
+ webhooks: "USE_WEBHOOKS",
20
+ snippets: "USE_SNIPPETS",
21
+ integrations: "USE_INTEGRATIONS",
22
+ };
23
+ async function applyProfile(profile, profileName) {
24
+ const appliedSettings = [];
25
+ const loader = new loader_1.ProfileLoader();
26
+ const validation = await loader.validateProfile(profile);
27
+ for (const warning of validation.warnings) {
28
+ logger_1.logger.warn({ profile: profileName }, warning);
29
+ }
30
+ if (!validation.valid) {
31
+ logger_1.logger.error({ profile: profileName, errors: validation.errors }, "Profile validation failed");
32
+ return {
33
+ success: false,
34
+ profileName,
35
+ host: profile.host,
36
+ appliedSettings,
37
+ validation,
38
+ };
39
+ }
40
+ const apiUrl = profile.api_url ?? `https://${profile.host}`;
41
+ process.env.GITLAB_API_URL = apiUrl;
42
+ appliedSettings.push(`GITLAB_API_URL=${apiUrl}`);
43
+ switch (profile.auth.type) {
44
+ case "pat":
45
+ if (profile.auth.token_env) {
46
+ const token = process.env[profile.auth.token_env];
47
+ if (token) {
48
+ process.env.GITLAB_TOKEN = token;
49
+ appliedSettings.push(`GITLAB_TOKEN=<from ${profile.auth.token_env}>`);
50
+ }
51
+ }
52
+ break;
53
+ case "oauth":
54
+ if (profile.auth.client_id_env) {
55
+ const clientId = process.env[profile.auth.client_id_env];
56
+ if (clientId) {
57
+ process.env.GITLAB_OAUTH_CLIENT_ID = clientId;
58
+ appliedSettings.push(`GITLAB_OAUTH_CLIENT_ID=<from ${profile.auth.client_id_env}>`);
59
+ }
60
+ }
61
+ if (profile.auth.client_secret_env) {
62
+ const clientSecret = process.env[profile.auth.client_secret_env];
63
+ if (clientSecret) {
64
+ process.env.GITLAB_OAUTH_CLIENT_SECRET = clientSecret;
65
+ appliedSettings.push(`GITLAB_OAUTH_CLIENT_SECRET=<from ${profile.auth.client_secret_env}>`);
66
+ }
67
+ }
68
+ process.env.OAUTH_ENABLED = "true";
69
+ appliedSettings.push("OAUTH_ENABLED=true");
70
+ break;
71
+ case "cookie":
72
+ if (profile.auth.cookie_path) {
73
+ process.env.GITLAB_AUTH_COOKIE_PATH = profile.auth.cookie_path;
74
+ appliedSettings.push(`GITLAB_AUTH_COOKIE_PATH=${profile.auth.cookie_path}`);
75
+ }
76
+ break;
77
+ }
78
+ if (profile.read_only) {
79
+ process.env.GITLAB_READ_ONLY_MODE = "true";
80
+ appliedSettings.push("GITLAB_READ_ONLY_MODE=true");
81
+ }
82
+ if (profile.allowed_projects && profile.allowed_projects.length > 0) {
83
+ process.env.GITLAB_ALLOWED_PROJECT_IDS = profile.allowed_projects.join(",");
84
+ appliedSettings.push(`GITLAB_ALLOWED_PROJECT_IDS=${profile.allowed_projects.join(",")}`);
85
+ }
86
+ if (profile.allowed_groups && profile.allowed_groups.length > 0) {
87
+ process.env.GITLAB_ALLOWED_GROUP_IDS = profile.allowed_groups.join(",");
88
+ appliedSettings.push(`GITLAB_ALLOWED_GROUP_IDS=${profile.allowed_groups.join(",")}`);
89
+ }
90
+ if (profile.allowed_tools && profile.allowed_tools.length > 0) {
91
+ process.env.GITLAB_ALLOWED_TOOLS = profile.allowed_tools.join(",");
92
+ appliedSettings.push(`GITLAB_ALLOWED_TOOLS=${profile.allowed_tools.join(",")}`);
93
+ }
94
+ if (profile.denied_tools_regex) {
95
+ process.env.GITLAB_DENIED_TOOLS_REGEX = profile.denied_tools_regex;
96
+ appliedSettings.push(`GITLAB_DENIED_TOOLS_REGEX=${profile.denied_tools_regex}`);
97
+ }
98
+ if (profile.denied_actions && profile.denied_actions.length > 0) {
99
+ process.env.GITLAB_DENIED_ACTIONS = profile.denied_actions.join(",");
100
+ appliedSettings.push(`GITLAB_DENIED_ACTIONS=${profile.denied_actions.join(",")}`);
101
+ }
102
+ if (profile.features) {
103
+ for (const [feature, envVar] of Object.entries(FEATURE_ENV_MAP)) {
104
+ const value = profile.features[feature];
105
+ if (value !== undefined) {
106
+ process.env[envVar] = value ? "true" : "false";
107
+ appliedSettings.push(`${envVar}=${value}`);
108
+ }
109
+ }
110
+ }
111
+ if (profile.timeout_ms) {
112
+ process.env.GITLAB_API_TIMEOUT_MS = String(profile.timeout_ms);
113
+ appliedSettings.push(`GITLAB_API_TIMEOUT_MS=${profile.timeout_ms}`);
114
+ }
115
+ if (profile.skip_tls_verify) {
116
+ process.env.SKIP_TLS_VERIFY = "true";
117
+ appliedSettings.push("SKIP_TLS_VERIFY=true");
118
+ }
119
+ if (profile.ssl_cert_path) {
120
+ process.env.SSL_CERT_PATH = profile.ssl_cert_path;
121
+ appliedSettings.push(`SSL_CERT_PATH=${profile.ssl_cert_path}`);
122
+ }
123
+ if (profile.ssl_key_path) {
124
+ process.env.SSL_KEY_PATH = profile.ssl_key_path;
125
+ appliedSettings.push(`SSL_KEY_PATH=${profile.ssl_key_path}`);
126
+ }
127
+ if (profile.ca_cert_path) {
128
+ process.env.GITLAB_CA_CERT_PATH = profile.ca_cert_path;
129
+ appliedSettings.push(`GITLAB_CA_CERT_PATH=${profile.ca_cert_path}`);
130
+ }
131
+ if (profile.default_project) {
132
+ process.env.GITLAB_PROJECT_ID = profile.default_project;
133
+ appliedSettings.push(`GITLAB_PROJECT_ID=${profile.default_project}`);
134
+ }
135
+ if (profile.default_namespace) {
136
+ process.env.GITLAB_DEFAULT_NAMESPACE = profile.default_namespace;
137
+ appliedSettings.push(`GITLAB_DEFAULT_NAMESPACE=${profile.default_namespace}`);
138
+ }
139
+ logger_1.logger.info({
140
+ profile: profileName,
141
+ host: profile.host,
142
+ authType: profile.auth.type,
143
+ readOnly: profile.read_only ?? false,
144
+ settingsCount: appliedSettings.length,
145
+ }, "Profile applied successfully");
146
+ return {
147
+ success: true,
148
+ profileName,
149
+ host: profile.host,
150
+ appliedSettings,
151
+ validation,
152
+ };
153
+ }
154
+ async function applyPreset(preset, presetName) {
155
+ const appliedSettings = [];
156
+ const loader = new loader_1.ProfileLoader();
157
+ const validation = await loader.validatePreset(preset);
158
+ for (const warning of validation.warnings) {
159
+ logger_1.logger.warn({ preset: presetName }, warning);
160
+ }
161
+ if (!validation.valid) {
162
+ logger_1.logger.error({ preset: presetName, errors: validation.errors }, "Preset validation failed");
163
+ return {
164
+ success: false,
165
+ presetName,
166
+ appliedSettings,
167
+ validation,
168
+ };
169
+ }
170
+ if (!process.env.GITLAB_API_URL && !process.env.GITLAB_TOKEN) {
171
+ logger_1.logger.warn({ preset: presetName }, "Preset applied but GITLAB_API_URL/GITLAB_TOKEN not set - connection may fail");
172
+ }
173
+ if (preset.read_only) {
174
+ process.env.GITLAB_READ_ONLY_MODE = "true";
175
+ appliedSettings.push("GITLAB_READ_ONLY_MODE=true");
176
+ }
177
+ if (preset.denied_tools_regex) {
178
+ process.env.GITLAB_DENIED_TOOLS_REGEX = preset.denied_tools_regex;
179
+ appliedSettings.push(`GITLAB_DENIED_TOOLS_REGEX=${preset.denied_tools_regex}`);
180
+ }
181
+ if (preset.denied_actions && preset.denied_actions.length > 0) {
182
+ process.env.GITLAB_DENIED_ACTIONS = preset.denied_actions.join(",");
183
+ appliedSettings.push(`GITLAB_DENIED_ACTIONS=${preset.denied_actions.join(",")}`);
184
+ }
185
+ if (preset.allowed_tools && preset.allowed_tools.length > 0) {
186
+ process.env.GITLAB_ALLOWED_TOOLS = preset.allowed_tools.join(",");
187
+ appliedSettings.push(`GITLAB_ALLOWED_TOOLS=${preset.allowed_tools.join(",")}`);
188
+ }
189
+ if (preset.features) {
190
+ for (const [feature, envVar] of Object.entries(FEATURE_ENV_MAP)) {
191
+ const value = preset.features[feature];
192
+ if (value !== undefined) {
193
+ process.env[envVar] = value ? "true" : "false";
194
+ appliedSettings.push(`${envVar}=${value}`);
195
+ }
196
+ }
197
+ }
198
+ if (preset.timeout_ms) {
199
+ process.env.GITLAB_API_TIMEOUT_MS = String(preset.timeout_ms);
200
+ appliedSettings.push(`GITLAB_API_TIMEOUT_MS=${preset.timeout_ms}`);
201
+ }
202
+ logger_1.logger.info({
203
+ preset: presetName,
204
+ readOnly: preset.read_only ?? false,
205
+ settingsCount: appliedSettings.length,
206
+ }, "Preset applied successfully");
207
+ return {
208
+ success: true,
209
+ presetName,
210
+ appliedSettings,
211
+ validation,
212
+ };
213
+ }
214
+ async function loadAndApplyProfile(profileName) {
215
+ const loader = new loader_1.ProfileLoader();
216
+ const profile = await loader.loadProfile(profileName);
217
+ return applyProfile(profile, profileName);
218
+ }
219
+ async function loadAndApplyPreset(presetName) {
220
+ const loader = new loader_1.ProfileLoader();
221
+ const preset = await loader.loadPreset(presetName);
222
+ return applyPreset(preset, presetName);
223
+ }
224
+ async function tryApplyProfileFromEnv(cliProfileName) {
225
+ const name = cliProfileName ?? process.env.GITLAB_PROFILE ?? (await getDefaultProfileName());
226
+ if (!name) {
227
+ logger_1.logger.debug("No profile specified, using environment variables directly");
228
+ return undefined;
229
+ }
230
+ try {
231
+ const loader = new loader_1.ProfileLoader();
232
+ const loaded = await loader.loadAny(name);
233
+ if (loaded.type === "profile") {
234
+ return await applyProfile(loaded.data, name);
235
+ }
236
+ else {
237
+ return await applyPreset(loaded.data, name);
238
+ }
239
+ }
240
+ catch (error) {
241
+ const message = error instanceof Error ? error.message : String(error);
242
+ logger_1.logger.error({ profile: name, error: message }, "Failed to apply profile/preset");
243
+ throw error;
244
+ }
245
+ }
246
+ async function getDefaultProfileName() {
247
+ const loader = new loader_1.ProfileLoader();
248
+ return loader.getDefaultProfileName();
249
+ }
250
+ //# sourceMappingURL=applicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applicator.js","sourceRoot":"","sources":["../../../src/profiles/applicator.ts"],"names":[],"mappings":";;AAkEA,oCAyKC;AAiBD,kCAkFC;AAcD,kDAIC;AAUD,gDAIC;AAWD,wDAyBC;AA1YD,qCAAyC;AACzC,sCAAmC;AASnC,MAAM,eAAe,GAA2B;IAC9C,IAAI,EAAE,iBAAiB;IACvB,UAAU,EAAE,eAAe;IAC3B,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE,YAAY;IACpB,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,eAAe;IAC1B,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc;IACxB,YAAY,EAAE,kBAAkB;CACjC,CAAC;AAoCK,KAAK,UAAU,YAAY,CAChC,OAAgB,EAChB,WAAmB;IAEnB,MAAM,eAAe,GAAa,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,IAAI,sBAAa,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAGzD,KAAK,MAAM,OAAO,IAAI,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9C,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,eAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,gCAAgC,CAAC,CAAC;QAClF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAKD,KAAK,UAAU,qBAAqB;IAClC,MAAM,MAAM,GAAG,IAAI,sBAAa,EAAE,CAAC;IACnC,OAAO,MAAM,CAAC,qBAAqB,EAAE,CAAC;AACxC,CAAC"}
@@ -0,0 +1,25 @@
1
+ # Admin preset - full access to all features
2
+ #
3
+ # Use with caution - this preset enables all tools
4
+ # including webhooks, integrations, and variables.
5
+ #
6
+ # Recommended only for GitLab administrators.
7
+ #
8
+ # NOTE: This is a PRESET - host/auth come from environment variables.
9
+
10
+ description: "Full admin access - all features enabled"
11
+
12
+ read_only: false
13
+
14
+ features:
15
+ wiki: true
16
+ milestones: true
17
+ pipelines: true
18
+ labels: true
19
+ mrs: true
20
+ files: true
21
+ variables: true
22
+ workitems: true
23
+ webhooks: true
24
+ snippets: true
25
+ integrations: true
@@ -0,0 +1,35 @@
1
+ # Developer preset - standard development workflow
2
+ #
3
+ # Full access to development-related tools including:
4
+ # - Code browsing and file management
5
+ # - Work items and merge requests
6
+ # - Labels and milestones
7
+ #
8
+ # Restricted access to admin-level features.
9
+ #
10
+ # NOTE: This is a PRESET - host/auth come from environment variables.
11
+
12
+ description: "Standard developer access - no admin features"
13
+
14
+ read_only: false
15
+
16
+ features:
17
+ wiki: true
18
+ milestones: true
19
+ pipelines: true
20
+ labels: true
21
+ mrs: true
22
+ files: true
23
+ variables: false # Requires elevated access
24
+ workitems: true
25
+ webhooks: false # Admin only
26
+ snippets: true
27
+ integrations: false # Admin only
28
+
29
+ # Block dangerous actions
30
+ denied_actions:
31
+ - "manage_repository:delete"
32
+ - "manage_webhook:create"
33
+ - "manage_webhook:update"
34
+ - "manage_webhook:delete"
35
+ - "manage_integration:update"
@@ -0,0 +1,28 @@
1
+ # Read-only preset - safe browsing without write access
2
+ #
3
+ # Use this preset when you need to explore a GitLab instance
4
+ # without any risk of modifying data.
5
+ #
6
+ # All write operations (create, update, delete) are blocked.
7
+ #
8
+ # NOTE: This is a PRESET, not a full profile.
9
+ # It does NOT contain host or auth - those come from your
10
+ # environment variables (GITLAB_API_URL, GITLAB_TOKEN).
11
+
12
+ description: "Read-only access - blocks all write operations"
13
+
14
+ read_only: true
15
+ denied_tools_regex: "^manage_|^create_"
16
+
17
+ features:
18
+ wiki: true
19
+ milestones: true
20
+ pipelines: true
21
+ labels: true
22
+ mrs: true
23
+ files: true
24
+ variables: false # Variables often contain secrets
25
+ workitems: true
26
+ webhooks: false # Webhooks are admin-level
27
+ snippets: true
28
+ integrations: false # Integrations are admin-level
@@ -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;