@ev-ai/agent-hook 1.4.1 → 1.4.2

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.
@@ -3853,10 +3853,36 @@ var require_skill_source_redaction = __commonJS({
3853
3853
  var URL_CREDENTIAL_PARAM_RE = /([?&](?:access_token|api_key|apikey|auth|authorization|client_secret|key|password|secret|token)=)[^&\s"'<>]+/gi;
3854
3854
  var PRIVATE_KEY_BEGIN_RE = /-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/;
3855
3855
  var PRIVATE_KEY_END_RE = /-----END [A-Z0-9 ]*PRIVATE KEY-----/;
3856
+ var ANY_CASE_REFERENCE_OR_PLACEHOLDER_RE = new RegExp(`^(?:${[
3857
+ // Empty password, as in `https://user:@host`.
3858
+ "",
3859
+ // Shell `${VAR}` and PowerShell `$env:VAR`. No `${VAR:-default}`: the default is a literal.
3860
+ String.raw`\$\{[A-Za-z_][A-Za-z0-9_]*\}`,
3861
+ String.raw`\$env:[A-Za-z_][A-Za-z0-9_]*`,
3862
+ // Template placeholders: `{{ token }}`, `{token}` or an f-string expression such as
3863
+ // `{quote_plus(pwd)}`, `<password>`, `[password]` (and the redaction marker itself, so a
3864
+ // second pass is a no-op). Angle and square brackets hold letters only.
3865
+ String.raw`\{\{\s*[\w.-]+\s*\}\}`,
3866
+ String.raw`\{[A-Za-z_][^{}\s]*\}`,
3867
+ String.raw`<[A-Za-z][A-Za-z_-]*>`,
3868
+ String.raw`\[[A-Za-z][A-Za-z_-]*\]`,
3869
+ // Documentation stand-ins.
3870
+ String.raw`(?:pass(?:word|wd)?|pwd|secret|token|x+|\*+)`
3871
+ ].join("|")})$`, "i");
3872
+ var UPPER_CASE_REFERENCE_OR_PLACEHOLDER_RE = new RegExp(`^(?:${[
3873
+ // Shell `$VAR` and cmd `%VAR%`, written as environment variable names.
3874
+ String.raw`\$[A-Z_][A-Z0-9_]*`,
3875
+ String.raw`%[A-Z_][A-Z0-9_]*%`,
3876
+ // Upper-case placeholder names that say what they stand for: `YOUR_API_KEY`, `ACCESS_TOKEN`.
3877
+ String.raw`(?=[A-Z_]*(?:TOKEN|KEY|SECRET|PASSWORD|PASSWD|PASS|PWD|CREDENTIALS?|YOUR))[A-Z]+(?:_[A-Z]+)+`
3878
+ ].join("|")})$`);
3879
+ function isReferenceOrPlaceholder(value) {
3880
+ return ANY_CASE_REFERENCE_OR_PLACEHOLDER_RE.test(value) || UPPER_CASE_REFERENCE_OR_PLACEHOLDER_RE.test(value);
3881
+ }
3856
3882
  function redactLine(line) {
3857
- let redacted = line.replace(URL_USERINFO_RE, (_match, scheme) => `${scheme}${exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER}:${exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER}@`);
3858
- redacted = redacted.replace(URL_CREDENTIAL_PARAM_RE, (_match, prefix) => `${prefix}${exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER}`);
3859
- redacted = redacted.replace(BEARER_RE, (_match, prefix) => `${prefix}${exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER}`);
3883
+ let redacted = line.replace(URL_USERINFO_RE, (match, scheme, _user, password) => isReferenceOrPlaceholder(password) ? match : `${scheme}${exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER}:${exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER}@`);
3884
+ redacted = redacted.replace(URL_CREDENTIAL_PARAM_RE, (match, prefix) => isReferenceOrPlaceholder(match.slice(prefix.length)) ? match : `${prefix}${exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER}`);
3885
+ redacted = redacted.replace(BEARER_RE, (match, prefix) => isReferenceOrPlaceholder(match.slice(prefix.length)) ? match : `${prefix}${exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER}`);
3860
3886
  for (const pattern of TOKEN_LITERAL_RES) {
3861
3887
  redacted = redacted.replace(pattern, exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER);
3862
3888
  }
@@ -3890,13 +3916,1006 @@ var require_skill_source_redaction = __commonJS({
3890
3916
  }
3891
3917
  });
3892
3918
 
3919
+ // ../composition-identity/dist/json.js
3920
+ var require_json = __commonJS({
3921
+ "../composition-identity/dist/json.js"(exports) {
3922
+ "use strict";
3923
+ Object.defineProperty(exports, "__esModule", { value: true });
3924
+ exports.isRecord = isRecord2;
3925
+ function isRecord2(value) {
3926
+ return value !== null && typeof value === "object" && !Array.isArray(value);
3927
+ }
3928
+ }
3929
+ });
3930
+
3931
+ // ../composition-identity/dist/command-tokens.js
3932
+ var require_command_tokens = __commonJS({
3933
+ "../composition-identity/dist/command-tokens.js"(exports) {
3934
+ "use strict";
3935
+ Object.defineProperty(exports, "__esModule", { value: true });
3936
+ exports.tokenizeCommand = tokenizeCommand3;
3937
+ function tokenizeCommand3(command) {
3938
+ const tokens = [];
3939
+ let current = "";
3940
+ let quote = null;
3941
+ for (const char of command) {
3942
+ if (quote) {
3943
+ if (char === quote) {
3944
+ quote = null;
3945
+ } else {
3946
+ current += char;
3947
+ }
3948
+ continue;
3949
+ }
3950
+ if (char === '"' || char === "'") {
3951
+ quote = char;
3952
+ continue;
3953
+ }
3954
+ if (/\s/.test(char)) {
3955
+ if (current.length > 0) {
3956
+ tokens.push(current);
3957
+ current = "";
3958
+ }
3959
+ continue;
3960
+ }
3961
+ current += char;
3962
+ }
3963
+ if (current.length > 0) {
3964
+ tokens.push(current);
3965
+ }
3966
+ return tokens;
3967
+ }
3968
+ }
3969
+ });
3970
+
3971
+ // ../composition-identity/dist/home-path.js
3972
+ var require_home_path = __commonJS({
3973
+ "../composition-identity/dist/home-path.js"(exports) {
3974
+ "use strict";
3975
+ Object.defineProperty(exports, "__esModule", { value: true });
3976
+ exports.tildePath = tildePath2;
3977
+ exports.tildeHomeInText = tildeHomeInText2;
3978
+ function posixPath(value) {
3979
+ return value.replace(/\\/g, "/");
3980
+ }
3981
+ function homePosix(home) {
3982
+ const n = posixPath(home).replace(/\/+$/, "");
3983
+ return n.length <= 1 ? "" : n;
3984
+ }
3985
+ function isWindowsHome(home) {
3986
+ return /^[A-Za-z]:/.test(home) || home.includes("\\");
3987
+ }
3988
+ function tildePath2(value, home) {
3989
+ const n = posixPath(value);
3990
+ if (n === "~" || n.startsWith("~/")) {
3991
+ return n;
3992
+ }
3993
+ const h = homePosix(home);
3994
+ if (!h) {
3995
+ return n;
3996
+ }
3997
+ const head = n.slice(0, h.length);
3998
+ const matches = isWindowsHome(home) ? head.toLowerCase() === h.toLowerCase() : head === h;
3999
+ if (!matches) {
4000
+ return n;
4001
+ }
4002
+ const rest = n.slice(h.length);
4003
+ if (rest === "") {
4004
+ return "~";
4005
+ }
4006
+ return rest.startsWith("/") ? `~${rest}` : n;
4007
+ }
4008
+ var homeTextPatterns = /* @__PURE__ */ new Map();
4009
+ function homeTextPattern(home) {
4010
+ const cached = homeTextPatterns.get(home);
4011
+ if (cached !== void 0) {
4012
+ return cached;
4013
+ }
4014
+ const h = homePosix(home);
4015
+ let pattern = null;
4016
+ if (h) {
4017
+ const body = h.split("/").map((segment) => segment.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("[\\\\/]+");
4018
+ pattern = new RegExp(`(?<![\\w.-])${body}(?![\\w.-])`, isWindowsHome(home) ? "gi" : "g");
4019
+ }
4020
+ homeTextPatterns.set(home, pattern);
4021
+ return pattern;
4022
+ }
4023
+ function tildeHomeInText2(value, home) {
4024
+ const pattern = homeTextPattern(home);
4025
+ return pattern ? value.replace(pattern, "~") : value;
4026
+ }
4027
+ }
4028
+ });
4029
+
4030
+ // ../composition-identity/dist/mcp-redaction.js
4031
+ var require_mcp_redaction = __commonJS({
4032
+ "../composition-identity/dist/mcp-redaction.js"(exports) {
4033
+ "use strict";
4034
+ Object.defineProperty(exports, "__esModule", { value: true });
4035
+ exports.ENABLED_RAW_KEYS = exports.TOOL_LIST_RAW_KEYS = exports.OMITTED_VALUE = void 0;
4036
+ exports.isSecretShapedValue = isSecretShapedValue;
4037
+ exports.isAuthHeaderName = isAuthHeaderName;
4038
+ exports.redactCommandOrUrl = redactCommandOrUrl3;
4039
+ exports.isAuthKeyName = isAuthKeyName;
4040
+ exports.redactArgs = redactArgs4;
4041
+ exports.mcpServerEnabledFromJson = mcpServerEnabledFromJson2;
4042
+ var json_js_1 = require_json();
4043
+ exports.OMITTED_VALUE = "<omitted>";
4044
+ exports.TOOL_LIST_RAW_KEYS = [
4045
+ { raw: "tools", attr: "tools" },
4046
+ { raw: "autoApprove", attr: "auto_approve" },
4047
+ { raw: "auto_approve", attr: "auto_approve" },
4048
+ { raw: "alwaysAllow", attr: "always_allow" },
4049
+ { raw: "always_allow", attr: "always_allow" },
4050
+ { raw: "enabledTools", attr: "enabled_tools" },
4051
+ { raw: "enabled_tools", attr: "enabled_tools" },
4052
+ { raw: "disabledTools", attr: "disabled_tools" },
4053
+ { raw: "disabled_tools", attr: "disabled_tools" }
4054
+ ];
4055
+ exports.ENABLED_RAW_KEYS = ["enabled", "disabled"];
4056
+ var AUTH_KEY_RE = /^(authorization|auth|api[-_]?key|access[-_]?token|refresh[-_]?token|secret|password|passwd|token|bearer|client[-_]?secret|client[-_]?id|private[-_]?key|signing[-_]?key)$/i;
4057
+ var AUTH_KEY_SEGMENT_RE = /(?:^|[-_])(secret|password|passwd|token|api[-_]?key|private[-_]?key|signing[-_]?key|client[-_]?secret|client[-_]?id)(?:[-_]|$)/i;
4058
+ var SECRET_ARG_RE = /^(sk-|ghp_|gho_|github_pat_|xox[baprs]-|AKIA|ASIA|AIza|ya29\.)/;
4059
+ var BEARER_ARG_RE = /^bearer(?:\s+|$)/i;
4060
+ function isSecretShapedValue(value) {
4061
+ return SECRET_ARG_RE.test(value) || BEARER_ARG_RE.test(value);
4062
+ }
4063
+ var HEADER_FLAG_RE = /^(?:--headers?|-H)$/;
4064
+ var HEADER_LINE_RE = /^\s*([A-Za-z0-9-]+)\s*:([\s\S]*)$/;
4065
+ var AUTH_HEADER_NAME_RE = /auth|cookie|token|secret|key|passw|credential|session|signature/i;
4066
+ var ENV_REF_VALUE_RE = /^(?:(?:bearer|basic|token)\s+)?\$(?:\{\w+\}|\w+)$/i;
4067
+ function isAuthHeaderName(name) {
4068
+ return AUTH_HEADER_NAME_RE.test(name);
4069
+ }
4070
+ function redactCommandOrUrl3(value) {
4071
+ try {
4072
+ const parsed = new URL(value);
4073
+ return `${parsed.origin}${parsed.pathname}`;
4074
+ } catch {
4075
+ return value;
4076
+ }
4077
+ }
4078
+ function redactSecretShapedValue(value) {
4079
+ if (isSecretShapedValue(value)) {
4080
+ return "<redacted>";
4081
+ }
4082
+ if (value.includes("://")) {
4083
+ return redactCommandOrUrl3(value);
4084
+ }
4085
+ return value;
4086
+ }
4087
+ function redactHeaderArg(value) {
4088
+ const match = HEADER_LINE_RE.exec(value);
4089
+ if (!match) {
4090
+ return redactArg(value);
4091
+ }
4092
+ const name = match[1] ?? "";
4093
+ const headerValue = (match[2] ?? "").trim();
4094
+ if (ENV_REF_VALUE_RE.test(headerValue)) {
4095
+ return value;
4096
+ }
4097
+ const secret = isAuthHeaderName(name) || isSecretShapedValue(headerValue);
4098
+ return secret ? `${name}: <redacted>` : value;
4099
+ }
4100
+ function redactArg(value) {
4101
+ if (/^https?:\/\//i.test(value)) {
4102
+ return redactCommandOrUrl3(value);
4103
+ }
4104
+ const eq = value.indexOf("=");
4105
+ if (eq > 0) {
4106
+ const key = value.slice(0, eq);
4107
+ const rest = value.slice(eq + 1);
4108
+ return `${key}=${HEADER_FLAG_RE.test(key) ? redactHeaderArg(rest) : redactArg(rest)}`;
4109
+ }
4110
+ return redactSecretShapedValue(value);
4111
+ }
4112
+ function isAuthKeyName(key) {
4113
+ return AUTH_KEY_RE.test(key) || AUTH_KEY_SEGMENT_RE.test(key);
4114
+ }
4115
+ function authArgKey(value) {
4116
+ const key = value.replace(/^-+/, "").split("=", 1)[0] ?? "";
4117
+ return isAuthKeyName(key);
4118
+ }
4119
+ function redactArgs4(values) {
4120
+ const sanitized = [];
4121
+ let redactNext = false;
4122
+ let headerNext = false;
4123
+ for (const value of values) {
4124
+ if (redactNext) {
4125
+ sanitized.push("<redacted>");
4126
+ redactNext = false;
4127
+ continue;
4128
+ }
4129
+ if (headerNext) {
4130
+ headerNext = false;
4131
+ if (HEADER_LINE_RE.test(value)) {
4132
+ sanitized.push(redactHeaderArg(value));
4133
+ continue;
4134
+ }
4135
+ }
4136
+ if (HEADER_FLAG_RE.test(value)) {
4137
+ sanitized.push(value);
4138
+ headerNext = true;
4139
+ continue;
4140
+ }
4141
+ if (authArgKey(value)) {
4142
+ sanitized.push("<redacted>");
4143
+ redactNext = !value.includes("=");
4144
+ continue;
4145
+ }
4146
+ sanitized.push(redactArg(value));
4147
+ }
4148
+ return sanitized;
4149
+ }
4150
+ function mcpServerEnabledFromJson2(server) {
4151
+ if (!(0, json_js_1.isRecord)(server)) {
4152
+ return true;
4153
+ }
4154
+ if (server.enabled === false) {
4155
+ return false;
4156
+ }
4157
+ return server.disabled !== true;
4158
+ }
4159
+ }
4160
+ });
4161
+
4162
+ // ../composition-identity/dist/mcp-config-file.js
4163
+ var require_mcp_config_file = __commonJS({
4164
+ "../composition-identity/dist/mcp-config-file.js"(exports) {
4165
+ "use strict";
4166
+ Object.defineProperty(exports, "__esModule", { value: true });
4167
+ exports.MCP_CONFIG_SERVER_KEY_TREATMENT = exports.MCP_CONFIG_VSCODE_INPUT_TABLE = exports.MCP_CONFIG_SANDBOX_TABLE = exports.MCP_CONFIG_TRANSPORT_TYPES = exports.REDACTED_VALUE = void 0;
4168
+ exports.sanitizeVariableReference = sanitizeVariableReference;
4169
+ exports.mcpConfigFormatOf = mcpConfigFormatOf2;
4170
+ exports.mcpConfigServersKey = mcpConfigServersKey2;
4171
+ exports.sanitizeMcpConfigFile = sanitizeMcpConfigFile2;
4172
+ var node_path_1 = __require("node:path");
4173
+ var command_tokens_js_1 = require_command_tokens();
4174
+ var home_path_js_1 = require_home_path();
4175
+ var json_js_1 = require_json();
4176
+ var mcp_redaction_js_1 = require_mcp_redaction();
4177
+ exports.REDACTED_VALUE = "<redacted>";
4178
+ exports.MCP_CONFIG_TRANSPORT_TYPES = /* @__PURE__ */ new Set([
4179
+ "stdio",
4180
+ "http",
4181
+ "sse",
4182
+ "ws",
4183
+ "sdk",
4184
+ "streamable-http",
4185
+ "streamableHttp",
4186
+ "local",
4187
+ "remote"
4188
+ ]);
4189
+ var AUTH_TABLE = {
4190
+ CLIENT_ID: "keep",
4191
+ CLIENT_SECRET: "secret",
4192
+ scopes: "string_list",
4193
+ redirectPort: "keep"
4194
+ // source-only
4195
+ };
4196
+ var OAUTH_TABLE = {
4197
+ clientId: "keep",
4198
+ client_id: "keep",
4199
+ clientSecret: "secret",
4200
+ client_secret: "secret",
4201
+ callbackPort: "keep",
4202
+ callback_port: "keep",
4203
+ // source-only
4204
+ callback_url: "url",
4205
+ // source-only
4206
+ redirectUri: "url",
4207
+ // source-only
4208
+ redirect_uri: "url",
4209
+ // source-only
4210
+ authServerMetadataUrl: "url",
4211
+ auth_server_metadata_url: "url",
4212
+ // source-only
4213
+ authorizationUrl: "url",
4214
+ tokenUrl: "url",
4215
+ issuer: "url",
4216
+ // source-only
4217
+ registrationUrl: "url",
4218
+ // source-only
4219
+ clientMetadataUrl: "url",
4220
+ // source-only
4221
+ scopes: { by: { string: "keep", array: "string_list" } },
4222
+ scope: "keep",
4223
+ // source-only
4224
+ oauthScopes: "string_list",
4225
+ // source-only
4226
+ audiences: "string_list",
4227
+ enabled: "keep",
4228
+ allowPrivateNetwork: "keep",
4229
+ // source-only
4230
+ authorizationResponseIssParameterSupported: "keep",
4231
+ // source-only
4232
+ tokenParamName: "keep"
4233
+ };
4234
+ exports.MCP_CONFIG_SANDBOX_TABLE = {
4235
+ filesystem: {
4236
+ object: {
4237
+ allowWrite: "path",
4238
+ denyRead: "path",
4239
+ denyWrite: "path"
4240
+ }
4241
+ },
4242
+ network: {
4243
+ object: {
4244
+ allowedDomains: "string_list",
4245
+ deniedDomains: "string_list"
4246
+ }
4247
+ }
4248
+ };
4249
+ var DEV_TABLE = {
4250
+ watch: "path",
4251
+ debug: { object: { type: "keep", debugpyPath: "path" } }
4252
+ };
4253
+ var REQUEST_OPTIONS_TABLE = {
4254
+ headers: "secret_map",
4255
+ proxy: "url",
4256
+ caBundlePath: "path",
4257
+ timeout: "keep",
4258
+ verifySsl: "keep",
4259
+ noProxy: "string_list",
4260
+ extraBodyProperties: "omit",
4261
+ clientCertificate: { object: { cert: "omit", key: "omit", passphrase: "secret" } }
4262
+ };
4263
+ var TIMEOUT_TABLE = { startup: "keep", catalog: "keep", execution: "keep" };
4264
+ var CODEX_TOOL_TABLE = { approval_mode: "keep", output_token_limit: "keep" };
4265
+ exports.MCP_CONFIG_VSCODE_INPUT_TABLE = {
4266
+ id: "keep",
4267
+ type: "keep",
4268
+ password: "keep",
4269
+ command: "keep",
4270
+ serverName: "keep",
4271
+ description: "omit",
4272
+ options: "omit",
4273
+ args: "omit",
4274
+ default: "secret"
4275
+ };
4276
+ var TRANSPORT_TABLE = {
4277
+ type: "transport_type",
4278
+ command: "command",
4279
+ args: "args",
4280
+ cwd: "path",
4281
+ env: "secret_map",
4282
+ url: "url",
4283
+ headers: "secret_map"
4284
+ };
4285
+ var TOOL_LIST_ALIASES = Object.fromEntries(mcp_redaction_js_1.TOOL_LIST_RAW_KEYS.map(({ raw }) => [raw, "tool_list"]));
4286
+ exports.MCP_CONFIG_SERVER_KEY_TREATMENT = {
4287
+ ...TOOL_LIST_ALIASES,
4288
+ // Identity / transport / enablement
4289
+ type: "transport_type",
4290
+ transportType: "keep",
4291
+ // source-only
4292
+ transport: { by: { string: "keep", object: { object: TRANSPORT_TABLE } } },
4293
+ disabled: "keep",
4294
+ enabled: "keep",
4295
+ required: "keep",
4296
+ remote: "keep",
4297
+ // source-only
4298
+ remoteConfigured: "keep",
4299
+ // source-only
4300
+ source: "keep",
4301
+ // source-only
4302
+ version: "keep",
4303
+ gallery: { by: { boolean: "keep", string: "url" } },
4304
+ description: "omit",
4305
+ name: "keep",
4306
+ serverName: "keep",
4307
+ // source-only
4308
+ faviconUrl: "url",
4309
+ // source-only
4310
+ sourceFile: "path",
4311
+ sourceSlug: "keep",
4312
+ environment_id: "keep",
4313
+ protocol: "keep",
4314
+ pool: "keep",
4315
+ codemode: "keep",
4316
+ trust: "keep",
4317
+ alwaysLoad: "keep",
4318
+ deferTools: "keep",
4319
+ // source-only
4320
+ supports_parallel_tool_calls: "keep",
4321
+ tool_input_schema_max_bytes: "keep",
4322
+ startup_readiness: "keep",
4323
+ extension: "omit",
4324
+ // source-only
4325
+ metadata: "omit",
4326
+ // source-only
4327
+ settings: "omit",
4328
+ // source-only
4329
+ // stdio / process
4330
+ command: {
4331
+ by: {
4332
+ string: "command",
4333
+ array: "args",
4334
+ // Zed legacy `command: { path, args, env }`.
4335
+ object: { object: { path: "command", args: "args", env: "secret_map" } }
4336
+ }
4337
+ },
4338
+ args: "args",
4339
+ env: "secret_map",
4340
+ environment: "secret_map",
4341
+ env_vars: {
4342
+ list: {
4343
+ by: { string: "env_name", object: { object: { name: "env_name", source: "keep" } } }
4344
+ }
4345
+ },
4346
+ envVars: "secret_map",
4347
+ envFile: "path",
4348
+ cwd: "path",
4349
+ watchPaths: "path",
4350
+ dev: { object: DEV_TABLE },
4351
+ sandboxEnabled: "keep",
4352
+ sandbox: { object: exports.MCP_CONFIG_SANDBOX_TABLE },
4353
+ // Remote / HTTP
4354
+ url: "url",
4355
+ serverUrl: "url",
4356
+ httpUrl: "url",
4357
+ // Google Antigravity: load tools at startup, and per-server request timeout.
4358
+ eager: "keep",
4359
+ timeoutSeconds: "keep",
4360
+ tcp: "url",
4361
+ // source-only
4362
+ headers: "secret_map",
4363
+ http_headers: "secret_map",
4364
+ env_http_headers: "env_name_map",
4365
+ bearer_token_env_var: "env_name",
4366
+ headersHelper: "helper_command",
4367
+ http_headers_helper: "helper_command",
4368
+ apiKey: "secret",
4369
+ // source-only
4370
+ requestOptions: { object: REQUEST_OPTIONS_TABLE },
4371
+ // source-only
4372
+ auth: { by: { string: "mode", object: { object: AUTH_TABLE } } },
4373
+ oauth: { by: { boolean: "keep", object: { object: OAUTH_TABLE } } },
4374
+ oauthClientId: "keep",
4375
+ oauthClientSecret: "secret",
4376
+ oauthResource: "url",
4377
+ oauth_resource: "url",
4378
+ oauthScopes: "string_list",
4379
+ scopes: { by: { string: "keep", array: "string_list" } },
4380
+ oauthPublicClient: "keep",
4381
+ // source-only
4382
+ oauthGrantType: "keep",
4383
+ // source-only
4384
+ authProviderType: "keep",
4385
+ targetAudience: "keep",
4386
+ targetServiceAccount: "keep",
4387
+ // Tool filtering / approval
4388
+ tools: {
4389
+ by: {
4390
+ array: "tool_list",
4391
+ boolean: "tool_list",
4392
+ string: "tool_list",
4393
+ object: { map: { object: CODEX_TOOL_TABLE } }
4394
+ }
4395
+ },
4396
+ includeTools: "tool_list",
4397
+ excludeTools: "tool_list",
4398
+ omit_tools_from: "tool_list",
4399
+ default_tools_approval_mode: "keep",
4400
+ defaultToolsApprovalMode: "keep",
4401
+ // Timeouts
4402
+ timeout: { by: { number: "keep", object: { object: TIMEOUT_TABLE } } },
4403
+ startup_timeout_sec: "keep",
4404
+ startup_timeout_ms: "keep",
4405
+ tool_timeout_sec: "keep",
4406
+ connectionTimeout: "keep"
4407
+ // source-only
4408
+ };
4409
+ function shapeOf(value) {
4410
+ if (value === null) {
4411
+ return "null";
4412
+ }
4413
+ if (Array.isArray(value)) {
4414
+ return "array";
4415
+ }
4416
+ switch (typeof value) {
4417
+ case "string":
4418
+ return "string";
4419
+ case "number":
4420
+ return "number";
4421
+ case "boolean":
4422
+ return "boolean";
4423
+ case "object":
4424
+ return "object";
4425
+ default:
4426
+ return void 0;
4427
+ }
4428
+ }
4429
+ var ENV_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
4430
+ var REFERENCE_PATTERNS = [
4431
+ /\$\{(?:env|input|command):[A-Za-z0-9_.-]+\}/y,
4432
+ /\$\{file:[^}\s]+\}/y,
4433
+ /\$\{\{\s*secrets\.[A-Za-z0-9_]+\s*\}\}/y,
4434
+ /\$\{\/\}/y,
4435
+ /\$\{[A-Za-z_][A-Za-z0-9_.]*\}/y,
4436
+ /\$[A-Z_][A-Z0-9_]*/y,
4437
+ /%[A-Z_][A-Z0-9_]*%/y,
4438
+ /\{(?:env:[A-Za-z_][A-Za-z0-9_]*|file:[^}\s]+)\}/y
4439
+ ];
4440
+ var DEFAULTED_REFERENCE = /\$\{([A-Za-z_][A-Za-z0-9_]*):-[^}]*\}/y;
4441
+ function referencesOnly(value) {
4442
+ let out = "";
4443
+ let index = 0;
4444
+ while (index < value.length) {
4445
+ DEFAULTED_REFERENCE.lastIndex = index;
4446
+ const defaulted = DEFAULTED_REFERENCE.exec(value);
4447
+ if (defaulted) {
4448
+ out += `\${${defaulted[1] ?? ""}:-${exports.REDACTED_VALUE}}`;
4449
+ index = DEFAULTED_REFERENCE.lastIndex;
4450
+ continue;
4451
+ }
4452
+ let matched = false;
4453
+ for (const pattern of REFERENCE_PATTERNS) {
4454
+ pattern.lastIndex = index;
4455
+ const match = pattern.exec(value);
4456
+ if (match) {
4457
+ out += match[0];
4458
+ index = pattern.lastIndex;
4459
+ matched = true;
4460
+ break;
4461
+ }
4462
+ }
4463
+ if (!matched) {
4464
+ return null;
4465
+ }
4466
+ }
4467
+ return out.length > 0 ? out : null;
4468
+ }
4469
+ function sanitizeVariableReference(value) {
4470
+ const scheme = /^(bearer|basic|token)(\s+)(.+)$/i.exec(value);
4471
+ if (scheme) {
4472
+ const rest = referencesOnly(scheme[3] ?? "");
4473
+ return rest === null ? null : `${scheme[1] ?? ""}${scheme[2] ?? ""}${rest}`;
4474
+ }
4475
+ return referencesOnly(value);
4476
+ }
4477
+ function tildeText(value, options) {
4478
+ return options.home ? (0, home_path_js_1.tildeHomeInText)(value, options.home) : value;
4479
+ }
4480
+ function containsSecretShapedToken(value) {
4481
+ return (0, mcp_redaction_js_1.isSecretShapedValue)(value) || value.split(/[\s=,;:'"]+/).some(mcp_redaction_js_1.isSecretShapedValue);
4482
+ }
4483
+ function keepString(value, options) {
4484
+ if (containsSecretShapedToken(value)) {
4485
+ return exports.REDACTED_VALUE;
4486
+ }
4487
+ if (value.includes("://")) {
4488
+ return sanitizeUrl(value, options);
4489
+ }
4490
+ return tildeText(value, options);
4491
+ }
4492
+ var MODE_WORD_RE = /^[A-Za-z][A-Za-z_-]{0,31}$/;
4493
+ function sanitizeMode(value) {
4494
+ if (typeof value !== "string") {
4495
+ return mcp_redaction_js_1.OMITTED_VALUE;
4496
+ }
4497
+ return MODE_WORD_RE.test(value) && !(0, mcp_redaction_js_1.isSecretShapedValue)(value) ? value : exports.REDACTED_VALUE;
4498
+ }
4499
+ function keepScalar(value, options) {
4500
+ if (typeof value === "string") {
4501
+ return keepString(value, options);
4502
+ }
4503
+ if (typeof value === "number") {
4504
+ return Number.isFinite(value) ? value : mcp_redaction_js_1.OMITTED_VALUE;
4505
+ }
4506
+ if (typeof value === "boolean" || value === null) {
4507
+ return value;
4508
+ }
4509
+ return mcp_redaction_js_1.OMITTED_VALUE;
4510
+ }
4511
+ function toolName(entry) {
4512
+ if (typeof entry !== "string") {
4513
+ return mcp_redaction_js_1.OMITTED_VALUE;
4514
+ }
4515
+ return /[\s=]/.test(entry) || containsSecretShapedToken(entry) ? exports.REDACTED_VALUE : entry;
4516
+ }
4517
+ function sanitizeToolList(value) {
4518
+ if (typeof value === "boolean") {
4519
+ return value;
4520
+ }
4521
+ if (typeof value === "string") {
4522
+ return toolName(value);
4523
+ }
4524
+ if (!Array.isArray(value)) {
4525
+ return mcp_redaction_js_1.OMITTED_VALUE;
4526
+ }
4527
+ return value.map((entry) => toolName(entry));
4528
+ }
4529
+ function sanitizeStringList(value, options) {
4530
+ if (!Array.isArray(value)) {
4531
+ return mcp_redaction_js_1.OMITTED_VALUE;
4532
+ }
4533
+ return value.map((entry) => typeof entry === "string" ? keepString(entry, options) : mcp_redaction_js_1.OMITTED_VALUE);
4534
+ }
4535
+ function isCredentialHeaderName(name) {
4536
+ return (0, mcp_redaction_js_1.isAuthHeaderName)(name) || (0, mcp_redaction_js_1.isAuthKeyName)(name);
4537
+ }
4538
+ var HEADER_LABEL_RE = /(^|[\s"'=,;])([A-Za-z][A-Za-z0-9_-]*)(\s*:\s*)/g;
4539
+ function redactCredentialHeaders(text) {
4540
+ let out = "";
4541
+ let cursor = 0;
4542
+ HEADER_LABEL_RE.lastIndex = 0;
4543
+ let match;
4544
+ while ((match = HEADER_LABEL_RE.exec(text)) !== null) {
4545
+ const name = match[2] ?? "";
4546
+ const valueStart = match.index + match[0].length;
4547
+ if (!isCredentialHeaderName(name)) {
4548
+ continue;
4549
+ }
4550
+ const quote = text.slice(valueStart).search(/["'\n]/);
4551
+ const valueEnd = quote === -1 ? text.length : valueStart + quote;
4552
+ const value = text.slice(valueStart, valueEnd).trim();
4553
+ if (value.length === 0) {
4554
+ continue;
4555
+ }
4556
+ out += text.slice(cursor, valueStart);
4557
+ out += sanitizeVariableReference(value) ?? exports.REDACTED_VALUE;
4558
+ cursor = valueEnd;
4559
+ HEADER_LABEL_RE.lastIndex = valueEnd;
4560
+ }
4561
+ return out + text.slice(cursor);
4562
+ }
4563
+ var AUTH_SCHEME_CREDENTIAL_RE = /\b(bearer|basic|token)(\s+)([^\s"']+)/gi;
4564
+ function hasLiteralAuthScheme(text) {
4565
+ for (const match of text.matchAll(AUTH_SCHEME_CREDENTIAL_RE)) {
4566
+ if (sanitizeVariableReference(match[3] ?? "") === null) {
4567
+ return true;
4568
+ }
4569
+ }
4570
+ return false;
4571
+ }
4572
+ function redactCredentialArg(value) {
4573
+ const headers = redactCredentialHeaders(value);
4574
+ return hasLiteralAuthScheme(headers) ? exports.REDACTED_VALUE : headers;
4575
+ }
4576
+ function redactCredentialCommandLine(value) {
4577
+ return redactCredentialHeaders(value).replace(AUTH_SCHEME_CREDENTIAL_RE, (whole, scheme, space, credential) => sanitizeVariableReference(credential) === null ? `${scheme}${space}${exports.REDACTED_VALUE}` : whole);
4578
+ }
4579
+ function joinCommandTokens(tokens) {
4580
+ return tokens.map((token) => {
4581
+ if (!/\s/.test(token)) {
4582
+ return token;
4583
+ }
4584
+ return token.includes('"') && !token.includes("'") ? `'${token}'` : `"${token}"`;
4585
+ }).join(" ");
4586
+ }
4587
+ function sanitizeCommand(value, options) {
4588
+ if (typeof value !== "string") {
4589
+ return mcp_redaction_js_1.OMITTED_VALUE;
4590
+ }
4591
+ const tokens = (0, command_tokens_js_1.tokenizeCommand)(redactCredentialCommandLine(value));
4592
+ if (tokens.length === 0) {
4593
+ return value;
4594
+ }
4595
+ return tildeText(joinCommandTokens((0, mcp_redaction_js_1.redactArgs)(tokens)), options);
4596
+ }
4597
+ function sanitizeHelperCommand(value, options) {
4598
+ if (typeof value === "string") {
4599
+ const reference = sanitizeVariableReference(value);
4600
+ if (reference !== null) {
4601
+ return reference;
4602
+ }
4603
+ const tokens = (0, command_tokens_js_1.tokenizeCommand)(value);
4604
+ const [executable] = tokens;
4605
+ if (executable === void 0) {
4606
+ return value;
4607
+ }
4608
+ const kept = sanitizeCommand(executable, options);
4609
+ return tokens.length > 1 ? `${String(kept)} ${exports.REDACTED_VALUE}` : kept;
4610
+ }
4611
+ if (Array.isArray(value)) {
4612
+ return value.map((entry, index) => index === 0 ? sanitizeCommand(entry, options) : exports.REDACTED_VALUE);
4613
+ }
4614
+ return mcp_redaction_js_1.OMITTED_VALUE;
4615
+ }
4616
+ function sanitizeArgs(value, options) {
4617
+ if (!Array.isArray(value)) {
4618
+ return mcp_redaction_js_1.OMITTED_VALUE;
4619
+ }
4620
+ const stringIndexes = [];
4621
+ const strings = [];
4622
+ value.forEach((entry, index) => {
4623
+ if (typeof entry === "string") {
4624
+ stringIndexes.push(index);
4625
+ strings.push(entry);
4626
+ }
4627
+ });
4628
+ const redacted = (0, mcp_redaction_js_1.redactArgs)(strings);
4629
+ const out = value.map(() => mcp_redaction_js_1.OMITTED_VALUE);
4630
+ stringIndexes.forEach((index, position) => {
4631
+ out[index] = tildeText(redactCredentialArg(redacted[position] ?? exports.REDACTED_VALUE), options);
4632
+ });
4633
+ return out;
4634
+ }
4635
+ function canParseUrl(value) {
4636
+ try {
4637
+ return new URL(value).href.length > 0;
4638
+ } catch {
4639
+ return false;
4640
+ }
4641
+ }
4642
+ function redactSecretPathSegments(value) {
4643
+ return value.split("/").map((segment) => containsSecretShapedToken(segment) ? exports.REDACTED_VALUE : segment).join("/");
4644
+ }
4645
+ function sanitizeUrl(value, options) {
4646
+ if (typeof value !== "string") {
4647
+ return mcp_redaction_js_1.OMITTED_VALUE;
4648
+ }
4649
+ const reference = sanitizeVariableReference(value);
4650
+ if (reference !== null) {
4651
+ return reference;
4652
+ }
4653
+ if (/^(?:unix|pipe):/i.test(value)) {
4654
+ const hash = value.indexOf("#");
4655
+ const beforeHash = hash === -1 ? value : value.slice(0, hash);
4656
+ const fragment = hash === -1 ? "" : value.slice(hash);
4657
+ const withoutQuery2 = beforeHash.split("?", 1)[0] ?? "";
4658
+ return tildeText(redactSecretPathSegments(`${withoutQuery2}${fragment}`), options);
4659
+ }
4660
+ if (/^(?:https?|wss?):/i.test(value) && canParseUrl(value)) {
4661
+ return redactSecretPathSegments((0, mcp_redaction_js_1.redactCommandOrUrl)(value));
4662
+ }
4663
+ const withoutQuery = value.split(/[?#]/, 1)[0] ?? "";
4664
+ const scheme = /^[A-Za-z][A-Za-z0-9+.-]*:\/\//.exec(withoutQuery)?.[0] ?? "";
4665
+ const afterScheme = withoutQuery.slice(scheme.length);
4666
+ const slash = afterScheme.indexOf("/");
4667
+ const authority = slash === -1 ? afterScheme : afterScheme.slice(0, slash);
4668
+ const at = authority.lastIndexOf("@");
4669
+ const cleaned = `${scheme}${at === -1 ? afterScheme : afterScheme.slice(at + 1)}`;
4670
+ return tildeText(redactSecretPathSegments(cleaned), options);
4671
+ }
4672
+ function sanitizeSecret(value) {
4673
+ if (value === null) {
4674
+ return null;
4675
+ }
4676
+ if (typeof value === "string") {
4677
+ return sanitizeVariableReference(value) ?? exports.REDACTED_VALUE;
4678
+ }
4679
+ return exports.REDACTED_VALUE;
4680
+ }
4681
+ function envName(value) {
4682
+ if (typeof value !== "string") {
4683
+ return mcp_redaction_js_1.OMITTED_VALUE;
4684
+ }
4685
+ return ENV_NAME_RE.test(value) && !(0, mcp_redaction_js_1.isSecretShapedValue)(value) ? value : exports.REDACTED_VALUE;
4686
+ }
4687
+ function sanitizeSecretMap(value) {
4688
+ if (Array.isArray(value)) {
4689
+ return value.map((entry) => {
4690
+ if (typeof entry !== "string") {
4691
+ return mcp_redaction_js_1.OMITTED_VALUE;
4692
+ }
4693
+ const eq = entry.indexOf("=");
4694
+ if (eq === -1) {
4695
+ return envName(entry);
4696
+ }
4697
+ const name = entry.slice(0, eq);
4698
+ if (envName(name) !== name) {
4699
+ return exports.REDACTED_VALUE;
4700
+ }
4701
+ return `${name}=${sanitizeVariableReference(entry.slice(eq + 1)) ?? exports.REDACTED_VALUE}`;
4702
+ });
4703
+ }
4704
+ if (!(0, json_js_1.isRecord)(value)) {
4705
+ return mcp_redaction_js_1.OMITTED_VALUE;
4706
+ }
4707
+ const out = {};
4708
+ for (const [key, entry] of Object.entries(value)) {
4709
+ out[key] = sanitizeSecret(entry);
4710
+ }
4711
+ return out;
4712
+ }
4713
+ function sanitizeEnvNameMap(value) {
4714
+ if (!(0, json_js_1.isRecord)(value)) {
4715
+ return mcp_redaction_js_1.OMITTED_VALUE;
4716
+ }
4717
+ const out = {};
4718
+ for (const [key, entry] of Object.entries(value)) {
4719
+ out[key] = envName(entry);
4720
+ }
4721
+ return out;
4722
+ }
4723
+ function pathString(value, options) {
4724
+ if (containsSecretShapedToken(value)) {
4725
+ return exports.REDACTED_VALUE;
4726
+ }
4727
+ return options.home ? (0, home_path_js_1.tildePath)(value, options.home) : value;
4728
+ }
4729
+ function sanitizePath(value, options) {
4730
+ if (typeof value === "string") {
4731
+ return pathString(value, options);
4732
+ }
4733
+ if (Array.isArray(value)) {
4734
+ return value.map((entry) => typeof entry === "string" ? pathString(entry, options) : mcp_redaction_js_1.OMITTED_VALUE);
4735
+ }
4736
+ return mcp_redaction_js_1.OMITTED_VALUE;
4737
+ }
4738
+ function sanitizeObject(value, table, options) {
4739
+ const out = {};
4740
+ for (const [key, entry] of Object.entries(value)) {
4741
+ const treatment = Object.hasOwn(table, key) ? table[key] : void 0;
4742
+ out[key] = treatment === void 0 ? mcp_redaction_js_1.OMITTED_VALUE : applyTreatment(entry, treatment, options);
4743
+ }
4744
+ return out;
4745
+ }
4746
+ function applyLeaf(value, treatment, options) {
4747
+ switch (treatment) {
4748
+ case "keep":
4749
+ return keepScalar(value, options);
4750
+ case "transport_type":
4751
+ return typeof value === "string" && exports.MCP_CONFIG_TRANSPORT_TYPES.has(value) ? value : mcp_redaction_js_1.OMITTED_VALUE;
4752
+ case "mode":
4753
+ return sanitizeMode(value);
4754
+ case "string_list":
4755
+ return sanitizeStringList(value, options);
4756
+ case "tool_list":
4757
+ return sanitizeToolList(value);
4758
+ case "command":
4759
+ return sanitizeCommand(value, options);
4760
+ case "helper_command":
4761
+ return sanitizeHelperCommand(value, options);
4762
+ case "args":
4763
+ return sanitizeArgs(value, options);
4764
+ case "url":
4765
+ return sanitizeUrl(value, options);
4766
+ case "secret":
4767
+ return sanitizeSecret(value);
4768
+ case "secret_map":
4769
+ return sanitizeSecretMap(value);
4770
+ case "env_name":
4771
+ return envName(value);
4772
+ case "env_name_map":
4773
+ return sanitizeEnvNameMap(value);
4774
+ case "path":
4775
+ return sanitizePath(value, options);
4776
+ case "omit":
4777
+ return mcp_redaction_js_1.OMITTED_VALUE;
4778
+ }
4779
+ }
4780
+ function applyTreatment(value, treatment, options) {
4781
+ if (typeof treatment === "string") {
4782
+ return applyLeaf(value, treatment, options);
4783
+ }
4784
+ if ("object" in treatment) {
4785
+ return (0, json_js_1.isRecord)(value) ? sanitizeObject(value, treatment.object, options) : mcp_redaction_js_1.OMITTED_VALUE;
4786
+ }
4787
+ if ("map" in treatment) {
4788
+ if (!(0, json_js_1.isRecord)(value)) {
4789
+ return mcp_redaction_js_1.OMITTED_VALUE;
4790
+ }
4791
+ const out = {};
4792
+ for (const [key, entry] of Object.entries(value)) {
4793
+ out[key] = applyTreatment(entry, treatment.map, options);
4794
+ }
4795
+ return out;
4796
+ }
4797
+ if ("list" in treatment) {
4798
+ return Array.isArray(value) ? value.map((entry) => applyTreatment(entry, treatment.list, options)) : mcp_redaction_js_1.OMITTED_VALUE;
4799
+ }
4800
+ const shape = shapeOf(value);
4801
+ const branch = shape === void 0 ? void 0 : treatment.by[shape];
4802
+ return branch === void 0 ? mcp_redaction_js_1.OMITTED_VALUE : applyTreatment(value, branch, options);
4803
+ }
4804
+ function sanitizeServers(value, options) {
4805
+ if (!(0, json_js_1.isRecord)(value)) {
4806
+ return mcp_redaction_js_1.OMITTED_VALUE;
4807
+ }
4808
+ const out = {};
4809
+ for (const [name, server] of Object.entries(value)) {
4810
+ out[name] = (0, json_js_1.isRecord)(server) ? sanitizeObject(server, exports.MCP_CONFIG_SERVER_KEY_TREATMENT, options) : mcp_redaction_js_1.OMITTED_VALUE;
4811
+ }
4812
+ return out;
4813
+ }
4814
+ function isVsCodeMcpJson(filePath) {
4815
+ return /(?:^|[\\/])\.vscode[\\/]mcp\.json$/i.test(filePath);
4816
+ }
4817
+ function mcpConfigFormatOf2(filePath) {
4818
+ if (isVsCodeMcpJson(filePath)) {
4819
+ return "vscode_mcp_json";
4820
+ }
4821
+ return (0, node_path_1.basename)(filePath) === ".claude.json" ? "claude_json_slice" : "mcp_json";
4822
+ }
4823
+ function mcpConfigServersKey2(format) {
4824
+ return format === "vscode_mcp_json" ? "servers" : "mcpServers";
4825
+ }
4826
+ function sanitizeMcpConfigFile2(parsed, format, options = {}) {
4827
+ if (!(0, json_js_1.isRecord)(parsed)) {
4828
+ return {};
4829
+ }
4830
+ const serversKey = mcpConfigServersKey2(format);
4831
+ if (format === "claude_json_slice") {
4832
+ return Object.hasOwn(parsed, serversKey) ? { [serversKey]: sanitizeServers(parsed[serversKey], options) } : {};
4833
+ }
4834
+ const out = {};
4835
+ for (const [key, entry] of Object.entries(parsed)) {
4836
+ if (key === serversKey) {
4837
+ out[key] = sanitizeServers(entry, options);
4838
+ } else if (format === "vscode_mcp_json" && key === "inputs") {
4839
+ out[key] = applyTreatment(entry, { list: { object: exports.MCP_CONFIG_VSCODE_INPUT_TABLE } }, options);
4840
+ } else if (format === "vscode_mcp_json" && key === "sandbox") {
4841
+ out[key] = applyTreatment(entry, { object: exports.MCP_CONFIG_SANDBOX_TABLE }, options);
4842
+ } else {
4843
+ out[key] = mcp_redaction_js_1.OMITTED_VALUE;
4844
+ }
4845
+ }
4846
+ return out;
4847
+ }
4848
+ }
4849
+ });
4850
+
4851
+ // ../composition-identity/dist/mcp-config-parse.js
4852
+ var require_mcp_config_parse = __commonJS({
4853
+ "../composition-identity/dist/mcp-config-parse.js"(exports) {
4854
+ "use strict";
4855
+ Object.defineProperty(exports, "__esModule", { value: true });
4856
+ exports.sanitizeMcpConfig = sanitizeMcpConfig;
4857
+ exports.parseMcpConfig = parseMcpConfig;
4858
+ var node_crypto_1 = __require("node:crypto");
4859
+ var json_js_1 = require_json();
4860
+ var mcp_config_file_js_1 = require_mcp_config_file();
4861
+ var mcp_redaction_js_1 = require_mcp_redaction();
4862
+ function sanitizeMcpConfig(body, format) {
4863
+ const parsed = JSON.parse(body);
4864
+ return JSON.stringify((0, mcp_config_file_js_1.sanitizeMcpConfigFile)(parsed, format), null, 2);
4865
+ }
4866
+ function parseMcpConfig(body, format) {
4867
+ const parsed = JSON.parse(body);
4868
+ if (!(0, json_js_1.isRecord)(parsed)) {
4869
+ return [];
4870
+ }
4871
+ const servers = parsed[(0, mcp_config_file_js_1.mcpConfigServersKey)(format)];
4872
+ if (!(0, json_js_1.isRecord)(servers)) {
4873
+ return [];
4874
+ }
4875
+ return Object.entries(servers).flatMap(([key, block]) => (0, json_js_1.isRecord)(block) ? [parsedServer(key, block)] : []);
4876
+ }
4877
+ function parsedServer(key, block) {
4878
+ return {
4879
+ key,
4880
+ enabled: (0, mcp_redaction_js_1.mcpServerEnabledFromJson)(block),
4881
+ block,
4882
+ launch: launchOf(key, block),
4883
+ contentHash: (0, node_crypto_1.createHash)("sha256").update(canonicalJson(block)).digest("hex")
4884
+ };
4885
+ }
4886
+ function launchOf(key, block) {
4887
+ if (typeof block.command === "string" && block.command.length > 0) {
4888
+ const args = Array.isArray(block.args) ? block.args.filter((arg) => typeof arg === "string") : [];
4889
+ return { kind: "command", command: block.command, arguments: args };
4890
+ }
4891
+ const url = [block.url, block.serverUrl, block.httpUrl].find((value) => typeof value === "string" && value.length > 0);
4892
+ if (url !== void 0) {
4893
+ return { kind: "url", url };
4894
+ }
4895
+ return { kind: "unknown", installationRootExternalKey: "", sourcePath: "", nativeKey: key };
4896
+ }
4897
+ function canonicalJson(value) {
4898
+ if (Array.isArray(value)) {
4899
+ return `[${value.map(canonicalJson).join(",")}]`;
4900
+ }
4901
+ if ((0, json_js_1.isRecord)(value)) {
4902
+ const entries = Object.keys(value).sort().map((entryKey) => `${JSON.stringify(entryKey)}:${canonicalJson(value[entryKey])}`);
4903
+ return `{${entries.join(",")}}`;
4904
+ }
4905
+ return JSON.stringify(value) ?? "null";
4906
+ }
4907
+ }
4908
+ });
4909
+
3893
4910
  // ../composition-identity/dist/index.js
3894
4911
  var require_dist = __commonJS({
3895
4912
  "../composition-identity/dist/index.js"(exports) {
3896
4913
  "use strict";
3897
4914
  Object.defineProperty(exports, "__esModule", { value: true });
3898
- exports.redactComponentSource = exports.prepareComponentInspectionText = exports.fitSnapshotInspectionTextBudget = exports.componentSourceContainsRedactableSecret = exports.capComponentTextBytes = exports.SNAPSHOT_INSPECTION_TEXT_MAX_BYTES = exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER = exports.COMPONENT_INSPECTION_TEXT_MAX_BYTES = exports.usableCatalogText = exports.parseFrontmatterField = exports.parseFrontmatterDescription = exports.mcpServerToolSegmentForms = exports.mcpServerNameMatchesToolSegment = exports.isNpmRegistryPublisher = exports.EMPTY_NPM_PUBLISHER = exports.displayPublisherName = exports.classifyMcpProvenance = exports.resolveMcpPackageIdentity = exports.resolveLocalBinPackageIdentity = exports.McpPackageEcosystem = exports.pinnedPackageVersionFromSpec = exports.pinnedPackageVersionFromNpx = exports.packageNameFromSpec = exports.npxPackageSpecs = exports.npxExecBin = exports.isNodeModulesBinCommand = exports.isExactNpmVersion = exports.LOCAL_BIN_PACKAGE_VERSION_SOURCE = exports.PACKAGE_FIELD_MAX = exports.serializeMcpLaunchIdentity = exports.projectMcpMissingLaunchIdentity = exports.projectMcpLaunchIdentity = exports.normalizeMcpToolNames = exports.MCP_MISSING_LAUNCH_SERIALIZED = exports.MCP_LAUNCH_IDENTITY_ALGORITHM = exports.maskMcpLaunchForDisplay = exports.launchContainsCredentials = exports.hashMcpLaunchIdentity = exports.foldMcpName = exports.buildMcpFamilyCanonicalKey = exports.ComponentKind = void 0;
4915
+ exports.mcpServerEnabledFromJson = exports.isSecretShapedValue = exports.isAuthKeyName = exports.isAuthHeaderName = exports.ENABLED_RAW_KEYS = exports.tildePath = exports.tildeHomeInText = exports.tokenizeCommand = exports.isRecord = exports.redactComponentSource = exports.prepareComponentInspectionText = exports.fitSnapshotInspectionTextBudget = exports.componentSourceContainsRedactableSecret = exports.capComponentTextBytes = exports.SNAPSHOT_INSPECTION_TEXT_MAX_BYTES = exports.COMPONENT_SOURCE_REDACTION_PLACEHOLDER = exports.COMPONENT_INSPECTION_TEXT_MAX_BYTES = exports.usableCatalogText = exports.parseFrontmatterField = exports.parseFrontmatterDescription = exports.mcpServerToolSegmentForms = exports.mcpServerNameMatchesToolSegment = exports.isNpmRegistryPublisher = exports.EMPTY_NPM_PUBLISHER = exports.displayPublisherName = exports.classifyMcpProvenance = exports.resolveMcpPackageIdentity = exports.resolveLocalBinPackageIdentity = exports.McpPackageEcosystem = exports.pinnedPackageVersionFromSpec = exports.pinnedPackageVersionFromNpx = exports.packageNameFromSpec = exports.npxPackageSpecs = exports.npxExecBin = exports.isNodeModulesBinCommand = exports.isExactNpmVersion = exports.LOCAL_BIN_PACKAGE_VERSION_SOURCE = exports.PACKAGE_FIELD_MAX = exports.serializeMcpLaunchIdentity = exports.projectMcpMissingLaunchIdentity = exports.projectMcpLaunchIdentity = exports.normalizeMcpToolNames = exports.MCP_MISSING_LAUNCH_SERIALIZED = exports.MCP_LAUNCH_IDENTITY_ALGORITHM = exports.maskMcpLaunchForDisplay = exports.launchContainsCredentials = exports.hashMcpLaunchIdentity = exports.foldMcpName = exports.buildMcpFamilyCanonicalKey = exports.ComponentKind = void 0;
4916
+ exports.sanitizeMcpConfig = exports.parseMcpConfig = exports.sanitizeVariableReference = exports.sanitizeMcpConfigFile = exports.REDACTED_VALUE = exports.mcpConfigServersKey = exports.mcpConfigFormatOf = exports.MCP_CONFIG_VSCODE_INPUT_TABLE = exports.MCP_CONFIG_TRANSPORT_TYPES = exports.MCP_CONFIG_SERVER_KEY_TREATMENT = exports.MCP_CONFIG_SANDBOX_TABLE = exports.TOOL_LIST_RAW_KEYS = exports.redactCommandOrUrl = exports.redactArgs = exports.OMITTED_VALUE = void 0;
3899
4917
  exports.userConfigRootFromPath = userConfigRootFromPath;
4918
+ exports.repositoryConfigRootExternalKeyFromPath = repositoryConfigRootExternalKeyFromPath;
3900
4919
  exports.installationRootExternalKey = installationRootExternalKey;
3901
4920
  exports.normalizeRepositoryRelativePath = normalizeRepositoryRelativePath;
3902
4921
  exports.nativeKeyForSkillPath = nativeKeyForSkillPath;
@@ -3910,11 +4929,11 @@ var require_dist = __commonJS({
3910
4929
  var REFERENCE_PREFIX = "cmp1_";
3911
4930
  var REFERENCE_PATTERN = /^cmp1_[A-Za-z0-9_-]{43}$/;
3912
4931
  var SKILLS_DIR_MARKERS = ["/skills/", "/skills-cursor/"];
3913
- var RULE_PATH_RE = /(?:^|\/)\.(?:cursor|claude|codex)\/rules\/(.+)$/i;
4932
+ var RULE_PATH_RE = /(?:^|\/)(?:\.(?:cursor|claude|codex)|\.gemini\/config)\/rules\/(.+)$/i;
3914
4933
  var COMMAND_PATH_RE = /(?:^|\/)\.(?:cursor|claude|codex)\/(?:commands|prompts)\/(.+)$/i;
3915
4934
  var COPILOT_INSTRUCTION_PATH_RE = /(?:^|\/)\.(?:github|copilot)\/instructions\/(.+)$/i;
3916
4935
  var COPILOT_PROMPT_PATH_RE = /(?:^|\/)\.github\/prompts\/(.+)$/i;
3917
- var USER_CONFIG_ROOTS = [".cursor", ".claude", ".codex", ".copilot"];
4936
+ var USER_CONFIG_ROOTS = [".cursor", ".claude", ".codex", ".copilot", ".gemini"];
3918
4937
  var USER_CONFIG_ROOT_ALIASES = {
3919
4938
  ".claude.json": ".claude",
3920
4939
  ".agents": ".codex",
@@ -3938,6 +4957,27 @@ var require_dist = __commonJS({
3938
4957
  const aliasedRoot = segments.map((segment) => USER_CONFIG_ROOT_ALIASES[segment]).find((root) => root !== void 0);
3939
4958
  return aliasedRoot ?? "unknown";
3940
4959
  }
4960
+ var REPOSITORY_CONFIG_ROOT_MARKERS = /* @__PURE__ */ new Set([
4961
+ ".claude",
4962
+ ".cursor",
4963
+ ".codex",
4964
+ ".opencode",
4965
+ ".github"
4966
+ ]);
4967
+ var REPOSITORY_AGENTS_DIR = ".agents";
4968
+ var REPOSITORY_AGENTS_DIR_ROOT = ".codex";
4969
+ function repositoryConfigRootExternalKeyFromPath(repoSlug, repoRelativeSourcePath) {
4970
+ const segments = repoRelativeSourcePath.replaceAll("\\", "/").split("/").filter(Boolean);
4971
+ const markerIndex = segments.findIndex((segment) => REPOSITORY_CONFIG_ROOT_MARKERS.has(segment));
4972
+ if (markerIndex >= 0) {
4973
+ return `${repoSlug}:${segments.slice(0, markerIndex + 1).join("/")}`;
4974
+ }
4975
+ const agentsIndex = segments.indexOf(REPOSITORY_AGENTS_DIR);
4976
+ if (agentsIndex < 0) {
4977
+ return null;
4978
+ }
4979
+ return `${repoSlug}:${[...segments.slice(0, agentsIndex), REPOSITORY_AGENTS_DIR_ROOT].join("/")}`;
4980
+ }
3941
4981
  function installationRootExternalKey(installationId, configRoot) {
3942
4982
  return `runtime-install:${installationId}/${configRoot}`;
3943
4983
  }
@@ -4137,6 +5177,84 @@ var require_dist = __commonJS({
4137
5177
  Object.defineProperty(exports, "redactComponentSource", { enumerable: true, get: function() {
4138
5178
  return skill_source_redaction_js_1.redactComponentSource;
4139
5179
  } });
5180
+ var json_js_1 = require_json();
5181
+ Object.defineProperty(exports, "isRecord", { enumerable: true, get: function() {
5182
+ return json_js_1.isRecord;
5183
+ } });
5184
+ var command_tokens_js_1 = require_command_tokens();
5185
+ Object.defineProperty(exports, "tokenizeCommand", { enumerable: true, get: function() {
5186
+ return command_tokens_js_1.tokenizeCommand;
5187
+ } });
5188
+ var home_path_js_1 = require_home_path();
5189
+ Object.defineProperty(exports, "tildeHomeInText", { enumerable: true, get: function() {
5190
+ return home_path_js_1.tildeHomeInText;
5191
+ } });
5192
+ Object.defineProperty(exports, "tildePath", { enumerable: true, get: function() {
5193
+ return home_path_js_1.tildePath;
5194
+ } });
5195
+ var mcp_redaction_js_1 = require_mcp_redaction();
5196
+ Object.defineProperty(exports, "ENABLED_RAW_KEYS", { enumerable: true, get: function() {
5197
+ return mcp_redaction_js_1.ENABLED_RAW_KEYS;
5198
+ } });
5199
+ Object.defineProperty(exports, "isAuthHeaderName", { enumerable: true, get: function() {
5200
+ return mcp_redaction_js_1.isAuthHeaderName;
5201
+ } });
5202
+ Object.defineProperty(exports, "isAuthKeyName", { enumerable: true, get: function() {
5203
+ return mcp_redaction_js_1.isAuthKeyName;
5204
+ } });
5205
+ Object.defineProperty(exports, "isSecretShapedValue", { enumerable: true, get: function() {
5206
+ return mcp_redaction_js_1.isSecretShapedValue;
5207
+ } });
5208
+ Object.defineProperty(exports, "mcpServerEnabledFromJson", { enumerable: true, get: function() {
5209
+ return mcp_redaction_js_1.mcpServerEnabledFromJson;
5210
+ } });
5211
+ Object.defineProperty(exports, "OMITTED_VALUE", { enumerable: true, get: function() {
5212
+ return mcp_redaction_js_1.OMITTED_VALUE;
5213
+ } });
5214
+ Object.defineProperty(exports, "redactArgs", { enumerable: true, get: function() {
5215
+ return mcp_redaction_js_1.redactArgs;
5216
+ } });
5217
+ Object.defineProperty(exports, "redactCommandOrUrl", { enumerable: true, get: function() {
5218
+ return mcp_redaction_js_1.redactCommandOrUrl;
5219
+ } });
5220
+ Object.defineProperty(exports, "TOOL_LIST_RAW_KEYS", { enumerable: true, get: function() {
5221
+ return mcp_redaction_js_1.TOOL_LIST_RAW_KEYS;
5222
+ } });
5223
+ var mcp_config_file_js_1 = require_mcp_config_file();
5224
+ Object.defineProperty(exports, "MCP_CONFIG_SANDBOX_TABLE", { enumerable: true, get: function() {
5225
+ return mcp_config_file_js_1.MCP_CONFIG_SANDBOX_TABLE;
5226
+ } });
5227
+ Object.defineProperty(exports, "MCP_CONFIG_SERVER_KEY_TREATMENT", { enumerable: true, get: function() {
5228
+ return mcp_config_file_js_1.MCP_CONFIG_SERVER_KEY_TREATMENT;
5229
+ } });
5230
+ Object.defineProperty(exports, "MCP_CONFIG_TRANSPORT_TYPES", { enumerable: true, get: function() {
5231
+ return mcp_config_file_js_1.MCP_CONFIG_TRANSPORT_TYPES;
5232
+ } });
5233
+ Object.defineProperty(exports, "MCP_CONFIG_VSCODE_INPUT_TABLE", { enumerable: true, get: function() {
5234
+ return mcp_config_file_js_1.MCP_CONFIG_VSCODE_INPUT_TABLE;
5235
+ } });
5236
+ Object.defineProperty(exports, "mcpConfigFormatOf", { enumerable: true, get: function() {
5237
+ return mcp_config_file_js_1.mcpConfigFormatOf;
5238
+ } });
5239
+ Object.defineProperty(exports, "mcpConfigServersKey", { enumerable: true, get: function() {
5240
+ return mcp_config_file_js_1.mcpConfigServersKey;
5241
+ } });
5242
+ Object.defineProperty(exports, "REDACTED_VALUE", { enumerable: true, get: function() {
5243
+ return mcp_config_file_js_1.REDACTED_VALUE;
5244
+ } });
5245
+ Object.defineProperty(exports, "sanitizeMcpConfigFile", { enumerable: true, get: function() {
5246
+ return mcp_config_file_js_1.sanitizeMcpConfigFile;
5247
+ } });
5248
+ Object.defineProperty(exports, "sanitizeVariableReference", { enumerable: true, get: function() {
5249
+ return mcp_config_file_js_1.sanitizeVariableReference;
5250
+ } });
5251
+ var mcp_config_parse_js_1 = require_mcp_config_parse();
5252
+ Object.defineProperty(exports, "parseMcpConfig", { enumerable: true, get: function() {
5253
+ return mcp_config_parse_js_1.parseMcpConfig;
5254
+ } });
5255
+ Object.defineProperty(exports, "sanitizeMcpConfig", { enumerable: true, get: function() {
5256
+ return mcp_config_parse_js_1.sanitizeMcpConfig;
5257
+ } });
4140
5258
  }
4141
5259
  });
4142
5260
 
@@ -4171,14 +5289,15 @@ var HOOK_INPUT_ALLOWLIST_MAX_BYTES = 4 * 1024;
4171
5289
  var HOOK_INPUT_FULL_MAX_BYTES = 256 * 1024;
4172
5290
  var HOOK_INPUT_MCP_MAX_BYTES = 4 * 1024;
4173
5291
  var GZIP_MIN_BYTES = 32 * 1024;
4174
- var PACKAGE_VERSION = "1.4.1";
5292
+ var PACKAGE_VERSION = "1.4.2";
4175
5293
  var NPX_PACKAGE_SPEC = `@ev-ai/agent-hook@${PACKAGE_VERSION}`;
4176
5294
  var HOOK_STATUS_MESSAGE = "ev-ai runtime report";
4177
5295
  var PLUGIN_ROOT_VARIABLE = {
4178
5296
  claude: "CLAUDE_PLUGIN_ROOT",
4179
5297
  cursor: "CURSOR_PLUGIN_ROOT",
4180
5298
  codex: "PLUGIN_ROOT",
4181
- copilot: "PLUGIN_ROOT"
5299
+ copilot: "PLUGIN_ROOT",
5300
+ antigravity: "PLUGIN_ROOT"
4182
5301
  };
4183
5302
 
4184
5303
  // src/shared/file-logger.ts
@@ -4341,6 +5460,53 @@ var RUNNER_LAYOUT = {
4341
5460
  // VS Code's workspace file keys servers under `servers`, not `mcpServers`.
4342
5461
  mcpJson: [".github/mcp.json", ".vscode/mcp.json"]
4343
5462
  }
5463
+ },
5464
+ // Google Antigravity (desktop app, `agy` CLI, IDE). Mirrors GOOGLE_ANTIGRAVITY in
5465
+ // common/platform-component-ownership: one layout under the workspace
5466
+ // `.agents/` and the personal `~/.gemini/config/`, plus legacy home skill dirs
5467
+ // the app and CLI still read. `dirs` cannot differ by scope, so both trees are
5468
+ // listed. There is no commands dir (slash commands are skills), and
5469
+ // `admin_settings.json` holds no customizations, so there is no `managed`.
5470
+ // `hooks.json` keys hooks by name with no `hooks{}` object: presence only.
5471
+ // Plugins (`~/.gemini/config/plugins/<plugin>/`) are expanded by
5472
+ // `collectAntigravityPlugins`. The `skills.json` / `rules.json` manifests are
5473
+ // not read yet.
5474
+ // Source: https://antigravity.google/docs/customization-discovery
5475
+ antigravity: {
5476
+ shared: {
5477
+ skillRoots: [],
5478
+ dirs: [
5479
+ { dir: ".agents/rules", kind: "RULE", extensions: [".md"] },
5480
+ { dir: ".agents/agents", kind: "SUBAGENT", extensions: [".md"] },
5481
+ { dir: ".gemini/config/rules", kind: "RULE", extensions: [".md"] },
5482
+ { dir: ".gemini/config/agents", kind: "SUBAGENT", extensions: [".md"] }
5483
+ ],
5484
+ memory: [],
5485
+ settings: []
5486
+ },
5487
+ homeOnly: {
5488
+ skillRoots: [
5489
+ ".gemini/config/skills",
5490
+ ".gemini/antigravity/skills",
5491
+ ".gemini/antigravity-cli/skills",
5492
+ ".gemini/skills"
5493
+ ],
5494
+ memory: [
5495
+ [".gemini/GEMINI.md"],
5496
+ [".gemini/AGENTS.md"],
5497
+ [".gemini/config/GEMINI.md"],
5498
+ [".gemini/config/AGENTS.md"]
5499
+ ],
5500
+ settings: [".gemini/config/hooks.json"],
5501
+ mcpJson: [".gemini/config/mcp_config.json"],
5502
+ plugins: "antigravity"
5503
+ },
5504
+ projectOnly: {
5505
+ skillRoots: [".agents/skills"],
5506
+ memory: [["AGENTS.md"], ["GEMINI.md"], [".agents/AGENTS.md"], [".agents/GEMINI.md"]],
5507
+ settings: [".agents/hooks.json"],
5508
+ mcpJson: [".agents/mcp_config.json"]
5509
+ }
4344
5510
  }
4345
5511
  };
4346
5512
  function concatOptional(shared, delta) {
@@ -4420,19 +5586,7 @@ var NPX_PACKAGE_ATTRIBUTE_KEYS = [
4420
5586
  "package_version",
4421
5587
  "package_version_source"
4422
5588
  ];
4423
- var TOOL_LIST_RAW_KEYS = [
4424
- { raw: "tools", attr: "tools" },
4425
- { raw: "autoApprove", attr: "auto_approve" },
4426
- { raw: "auto_approve", attr: "auto_approve" },
4427
- { raw: "alwaysAllow", attr: "always_allow" },
4428
- { raw: "always_allow", attr: "always_allow" },
4429
- { raw: "enabledTools", attr: "enabled_tools" },
4430
- { raw: "enabled_tools", attr: "enabled_tools" },
4431
- { raw: "disabledTools", attr: "disabled_tools" },
4432
- { raw: "disabled_tools", attr: "disabled_tools" }
4433
- ];
4434
- var TOOL_LIST_ATTRS = new Set(TOOL_LIST_RAW_KEYS.map((entry) => entry.attr));
4435
- var ENABLED_RAW_KEYS = ["enabled", "disabled"];
5589
+ var TOOL_LIST_ATTRS = new Set(import_composition_identity.TOOL_LIST_RAW_KEYS.map((entry) => entry.attr));
4436
5590
  var SCALAR_RAW_KEYS = [
4437
5591
  "serverUrl",
4438
5592
  "auth",
@@ -4451,9 +5605,9 @@ var MCP_SERVER_READ_KEYS = /* @__PURE__ */ new Set([
4451
5605
  "env",
4452
5606
  "envVars",
4453
5607
  "headers",
4454
- ...ENABLED_RAW_KEYS,
5608
+ ...import_composition_identity.ENABLED_RAW_KEYS,
4455
5609
  ...SCALAR_RAW_KEYS,
4456
- ...TOOL_LIST_RAW_KEYS.map((entry) => entry.raw)
5610
+ ...import_composition_identity.TOOL_LIST_RAW_KEYS.map((entry) => entry.raw)
4457
5611
  ]);
4458
5612
  var DERIVED_KEYS = /* @__PURE__ */ new Set([
4459
5613
  "transport",
@@ -4470,225 +5624,8 @@ var DERIVED_KEYS = /* @__PURE__ */ new Set([
4470
5624
  ...[...TOOL_LIST_ATTRS].map((attr) => `${attr}_truncated`)
4471
5625
  ]);
4472
5626
 
4473
- // src/collectors/permission-key.ts
4474
- var PATH_PLACEHOLDER = "<path>";
4475
- var PATH_CONTINUATION_PATTERN = new RegExp(
4476
- `${PATH_PLACEHOLDER}(?:\\s+[A-Za-z.][^\\s,)]*[\\\\/][^\\s,)]*)+`,
4477
- "g"
4478
- );
4479
-
4480
- // src/collectors/userSpec/settings.ts
4481
- var SETTINGS_JSON_MAX_BYTES = 16 * 1024;
4482
-
4483
- // src/collectors/userSpec/mcp-config-file.ts
4484
- var AUTH_TABLE = {
4485
- CLIENT_ID: "keep",
4486
- CLIENT_SECRET: "secret",
4487
- scopes: "string_list",
4488
- redirectPort: "keep"
4489
- // source-only
4490
- };
4491
- var OAUTH_TABLE = {
4492
- clientId: "keep",
4493
- client_id: "keep",
4494
- clientSecret: "secret",
4495
- client_secret: "secret",
4496
- callbackPort: "keep",
4497
- callback_port: "keep",
4498
- // source-only
4499
- callback_url: "url",
4500
- // source-only
4501
- redirectUri: "url",
4502
- // source-only
4503
- redirect_uri: "url",
4504
- // source-only
4505
- authServerMetadataUrl: "url",
4506
- auth_server_metadata_url: "url",
4507
- // source-only
4508
- authorizationUrl: "url",
4509
- tokenUrl: "url",
4510
- issuer: "url",
4511
- // source-only
4512
- registrationUrl: "url",
4513
- // source-only
4514
- clientMetadataUrl: "url",
4515
- // source-only
4516
- scopes: { by: { string: "keep", array: "string_list" } },
4517
- scope: "keep",
4518
- // source-only
4519
- oauthScopes: "string_list",
4520
- // source-only
4521
- audiences: "string_list",
4522
- enabled: "keep",
4523
- allowPrivateNetwork: "keep",
4524
- // source-only
4525
- authorizationResponseIssParameterSupported: "keep",
4526
- // source-only
4527
- tokenParamName: "keep"
4528
- };
4529
- var MCP_CONFIG_SANDBOX_TABLE = {
4530
- filesystem: {
4531
- object: {
4532
- allowWrite: "path",
4533
- denyRead: "path",
4534
- denyWrite: "path"
4535
- }
4536
- },
4537
- network: {
4538
- object: {
4539
- allowedDomains: "string_list",
4540
- deniedDomains: "string_list"
4541
- }
4542
- }
4543
- };
4544
- var DEV_TABLE = {
4545
- watch: "path",
4546
- debug: { object: { type: "keep", debugpyPath: "path" } }
4547
- };
4548
- var REQUEST_OPTIONS_TABLE = {
4549
- headers: "secret_map",
4550
- proxy: "url",
4551
- caBundlePath: "path",
4552
- timeout: "keep",
4553
- verifySsl: "keep",
4554
- noProxy: "string_list",
4555
- extraBodyProperties: "omit",
4556
- clientCertificate: { object: { cert: "omit", key: "omit", passphrase: "secret" } }
4557
- };
4558
- var TIMEOUT_TABLE = { startup: "keep", catalog: "keep", execution: "keep" };
4559
- var CODEX_TOOL_TABLE = { approval_mode: "keep", output_token_limit: "keep" };
4560
- var TRANSPORT_TABLE = {
4561
- type: "transport_type",
4562
- command: "command",
4563
- args: "args",
4564
- cwd: "path",
4565
- env: "secret_map",
4566
- url: "url",
4567
- headers: "secret_map"
4568
- };
4569
- var TOOL_LIST_ALIASES = Object.fromEntries(
4570
- TOOL_LIST_RAW_KEYS.map(({ raw }) => [raw, "tool_list"])
4571
- );
4572
- var MCP_CONFIG_SERVER_KEY_TREATMENT = {
4573
- ...TOOL_LIST_ALIASES,
4574
- // Identity / transport / enablement
4575
- type: "transport_type",
4576
- transportType: "keep",
4577
- // source-only
4578
- transport: { by: { string: "keep", object: { object: TRANSPORT_TABLE } } },
4579
- disabled: "keep",
4580
- enabled: "keep",
4581
- required: "keep",
4582
- remote: "keep",
4583
- // source-only
4584
- remoteConfigured: "keep",
4585
- // source-only
4586
- source: "keep",
4587
- // source-only
4588
- version: "keep",
4589
- gallery: { by: { boolean: "keep", string: "url" } },
4590
- description: "omit",
4591
- name: "keep",
4592
- serverName: "keep",
4593
- // source-only
4594
- faviconUrl: "url",
4595
- // source-only
4596
- sourceFile: "path",
4597
- sourceSlug: "keep",
4598
- environment_id: "keep",
4599
- protocol: "keep",
4600
- pool: "keep",
4601
- codemode: "keep",
4602
- trust: "keep",
4603
- alwaysLoad: "keep",
4604
- deferTools: "keep",
4605
- // source-only
4606
- supports_parallel_tool_calls: "keep",
4607
- tool_input_schema_max_bytes: "keep",
4608
- startup_readiness: "keep",
4609
- extension: "omit",
4610
- // source-only
4611
- metadata: "omit",
4612
- // source-only
4613
- settings: "omit",
4614
- // source-only
4615
- // stdio / process
4616
- command: {
4617
- by: {
4618
- string: "command",
4619
- array: "args",
4620
- // Zed legacy `command: { path, args, env }`.
4621
- object: { object: { path: "command", args: "args", env: "secret_map" } }
4622
- }
4623
- },
4624
- args: "args",
4625
- env: "secret_map",
4626
- environment: "secret_map",
4627
- env_vars: {
4628
- list: {
4629
- by: { string: "env_name", object: { object: { name: "env_name", source: "keep" } } }
4630
- }
4631
- },
4632
- envVars: "secret_map",
4633
- envFile: "path",
4634
- cwd: "path",
4635
- watchPaths: "path",
4636
- dev: { object: DEV_TABLE },
4637
- sandboxEnabled: "keep",
4638
- sandbox: { object: MCP_CONFIG_SANDBOX_TABLE },
4639
- // Remote / HTTP
4640
- url: "url",
4641
- serverUrl: "url",
4642
- httpUrl: "url",
4643
- tcp: "url",
4644
- // source-only
4645
- headers: "secret_map",
4646
- http_headers: "secret_map",
4647
- env_http_headers: "env_name_map",
4648
- bearer_token_env_var: "env_name",
4649
- headersHelper: "helper_command",
4650
- http_headers_helper: "helper_command",
4651
- apiKey: "secret",
4652
- // source-only
4653
- requestOptions: { object: REQUEST_OPTIONS_TABLE },
4654
- // source-only
4655
- auth: { by: { string: "mode", object: { object: AUTH_TABLE } } },
4656
- oauth: { by: { boolean: "keep", object: { object: OAUTH_TABLE } } },
4657
- oauthClientId: "keep",
4658
- oauthClientSecret: "secret",
4659
- oauthResource: "url",
4660
- oauth_resource: "url",
4661
- oauthScopes: "string_list",
4662
- scopes: { by: { string: "keep", array: "string_list" } },
4663
- oauthPublicClient: "keep",
4664
- // source-only
4665
- oauthGrantType: "keep",
4666
- // source-only
4667
- authProviderType: "keep",
4668
- targetAudience: "keep",
4669
- targetServiceAccount: "keep",
4670
- // Tool filtering / approval
4671
- tools: {
4672
- by: {
4673
- array: "tool_list",
4674
- boolean: "tool_list",
4675
- string: "tool_list",
4676
- object: { map: { object: CODEX_TOOL_TABLE } }
4677
- }
4678
- },
4679
- includeTools: "tool_list",
4680
- excludeTools: "tool_list",
4681
- omit_tools_from: "tool_list",
4682
- default_tools_approval_mode: "keep",
4683
- defaultToolsApprovalMode: "keep",
4684
- // Timeouts
4685
- timeout: { by: { number: "keep", object: { object: TIMEOUT_TABLE } } },
4686
- startup_timeout_sec: "keep",
4687
- startup_timeout_ms: "keep",
4688
- tool_timeout_sec: "keep",
4689
- connectionTimeout: "keep"
4690
- // source-only
4691
- };
5627
+ // src/collectors/userSpec/mcp.ts
5628
+ var import_composition_identity5 = __toESM(require_dist(), 1);
4692
5629
 
4693
5630
  // src/collectors/userSpec/npx-package.ts
4694
5631
  var import_composition_identity4 = __toESM(require_dist(), 1);
@@ -4708,6 +5645,20 @@ var MANIFEST_MAX_BYTES = 1024 * 1024;
4708
5645
  // src/collectors/userSpec/mcp.ts
4709
5646
  var MCP_CONFIG_TEXT_MAX_BYTES = 64 * 1024;
4710
5647
 
5648
+ // src/collectors/userSpec/hook-command.ts
5649
+ var import_composition_identity6 = __toESM(require_dist(), 1);
5650
+
5651
+ // src/collectors/permission-key.ts
5652
+ var PATH_PLACEHOLDER = "<path>";
5653
+ var PATH_CONTINUATION_PATTERN = new RegExp(
5654
+ `${PATH_PLACEHOLDER}(?:\\s+[A-Za-z.][^\\s,)]*[\\\\/][^\\s,)]*)+`,
5655
+ "g"
5656
+ );
5657
+
5658
+ // src/collectors/userSpec/settings.ts
5659
+ var import_composition_identity7 = __toESM(require_dist(), 1);
5660
+ var SETTINGS_JSON_MAX_BYTES = 16 * 1024;
5661
+
4711
5662
  // src/collectors/userSpec/budget.ts
4712
5663
  var USER_SPEC_MAX_BYTES = 2 * 1024 * 1024;
4713
5664
 
@@ -4899,6 +5850,11 @@ var MARKETPLACE_PLUGIN_DIRS = {
4899
5850
  codex: "plugins/codex",
4900
5851
  copilot: "plugins/copilot"
4901
5852
  };
5853
+ var ANTIGRAVITY_PAYLOAD_DIR = "plugins/antigravity";
5854
+ var MARKETPLACE_PAYLOAD_DIRS = [
5855
+ ...Object.values(MARKETPLACE_PLUGIN_DIRS),
5856
+ ANTIGRAVITY_PAYLOAD_DIR
5857
+ ];
4902
5858
  function marketplacePluginHookPaths(marketplaceRoot) {
4903
5859
  return {
4904
5860
  claude: join(marketplaceRoot, MARKETPLACE_PLUGIN_DIRS.claude, "hooks/hooks.json"),
@@ -4938,7 +5894,7 @@ function copyMarketplacePluginPayload(marketplaceRoot, packageRoot) {
4938
5894
  }
4939
5895
  const manifest = pluginPackageManifest(packageRoot);
4940
5896
  const written = [];
4941
- for (const pluginDir of Object.values(MARKETPLACE_PLUGIN_DIRS)) {
5897
+ for (const pluginDir of MARKETPLACE_PAYLOAD_DIRS) {
4942
5898
  const pluginRoot = join(marketplaceRoot, pluginDir);
4943
5899
  for (const file of PLUGIN_PAYLOAD_FILES) {
4944
5900
  const target = join(pluginRoot, file);
@@ -4963,9 +5919,11 @@ function expectedMarketplacePluginHooks() {
4963
5919
  };
4964
5920
  }
4965
5921
  export {
5922
+ ANTIGRAVITY_PAYLOAD_DIR,
4966
5923
  CLAUDE_HOOK_TIMEOUT_SECONDS,
4967
5924
  CLAUDE_SESSION_START_TIMEOUT_SECONDS,
4968
5925
  MARKETPLACE_NAME,
5926
+ MARKETPLACE_PAYLOAD_DIRS,
4969
5927
  MARKETPLACE_PLUGIN_DIRS,
4970
5928
  MARKETPLACE_PLUGIN_NAME,
4971
5929
  PLUGIN_COLLECTOR_URL_MCP_SCRIPT,