@google/gemini-cli-a2a-server 0.40.0-preview.2 → 0.40.0-preview.4
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/a2a-server.mjs +137 -101
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -113797,68 +113797,68 @@ var require_lockfile = __commonJS({
|
|
|
113797
113797
|
});
|
|
113798
113798
|
}
|
|
113799
113799
|
function updateLock(file, options) {
|
|
113800
|
-
const
|
|
113801
|
-
if (
|
|
113800
|
+
const lock4 = locks[file];
|
|
113801
|
+
if (lock4.updateTimeout) {
|
|
113802
113802
|
return;
|
|
113803
113803
|
}
|
|
113804
|
-
|
|
113805
|
-
|
|
113806
|
-
|
|
113807
|
-
options.fs.stat(
|
|
113808
|
-
const isOverThreshold =
|
|
113804
|
+
lock4.updateDelay = lock4.updateDelay || options.update;
|
|
113805
|
+
lock4.updateTimeout = setTimeout(() => {
|
|
113806
|
+
lock4.updateTimeout = null;
|
|
113807
|
+
options.fs.stat(lock4.lockfilePath, (err2, stat5) => {
|
|
113808
|
+
const isOverThreshold = lock4.lastUpdate + options.stale < Date.now();
|
|
113809
113809
|
if (err2) {
|
|
113810
113810
|
if (err2.code === "ENOENT" || isOverThreshold) {
|
|
113811
|
-
return setLockAsCompromised(file,
|
|
113811
|
+
return setLockAsCompromised(file, lock4, Object.assign(err2, { code: "ECOMPROMISED" }));
|
|
113812
113812
|
}
|
|
113813
|
-
|
|
113813
|
+
lock4.updateDelay = 1e3;
|
|
113814
113814
|
return updateLock(file, options);
|
|
113815
113815
|
}
|
|
113816
|
-
const isMtimeOurs =
|
|
113816
|
+
const isMtimeOurs = lock4.mtime.getTime() === stat5.mtime.getTime();
|
|
113817
113817
|
if (!isMtimeOurs) {
|
|
113818
113818
|
return setLockAsCompromised(
|
|
113819
113819
|
file,
|
|
113820
|
-
|
|
113820
|
+
lock4,
|
|
113821
113821
|
Object.assign(
|
|
113822
113822
|
new Error("Unable to update lock within the stale threshold"),
|
|
113823
113823
|
{ code: "ECOMPROMISED" }
|
|
113824
113824
|
)
|
|
113825
113825
|
);
|
|
113826
113826
|
}
|
|
113827
|
-
const mtime = mtimePrecision.getMtime(
|
|
113828
|
-
options.fs.utimes(
|
|
113829
|
-
const isOverThreshold2 =
|
|
113830
|
-
if (
|
|
113827
|
+
const mtime = mtimePrecision.getMtime(lock4.mtimePrecision);
|
|
113828
|
+
options.fs.utimes(lock4.lockfilePath, mtime, mtime, (err3) => {
|
|
113829
|
+
const isOverThreshold2 = lock4.lastUpdate + options.stale < Date.now();
|
|
113830
|
+
if (lock4.released) {
|
|
113831
113831
|
return;
|
|
113832
113832
|
}
|
|
113833
113833
|
if (err3) {
|
|
113834
113834
|
if (err3.code === "ENOENT" || isOverThreshold2) {
|
|
113835
|
-
return setLockAsCompromised(file,
|
|
113835
|
+
return setLockAsCompromised(file, lock4, Object.assign(err3, { code: "ECOMPROMISED" }));
|
|
113836
113836
|
}
|
|
113837
|
-
|
|
113837
|
+
lock4.updateDelay = 1e3;
|
|
113838
113838
|
return updateLock(file, options);
|
|
113839
113839
|
}
|
|
113840
|
-
|
|
113841
|
-
|
|
113842
|
-
|
|
113840
|
+
lock4.mtime = mtime;
|
|
113841
|
+
lock4.lastUpdate = Date.now();
|
|
113842
|
+
lock4.updateDelay = null;
|
|
113843
113843
|
updateLock(file, options);
|
|
113844
113844
|
});
|
|
113845
113845
|
});
|
|
113846
|
-
},
|
|
113847
|
-
if (
|
|
113848
|
-
|
|
113846
|
+
}, lock4.updateDelay);
|
|
113847
|
+
if (lock4.updateTimeout.unref) {
|
|
113848
|
+
lock4.updateTimeout.unref();
|
|
113849
113849
|
}
|
|
113850
113850
|
}
|
|
113851
|
-
function setLockAsCompromised(file,
|
|
113852
|
-
|
|
113853
|
-
if (
|
|
113854
|
-
clearTimeout(
|
|
113851
|
+
function setLockAsCompromised(file, lock4, err2) {
|
|
113852
|
+
lock4.released = true;
|
|
113853
|
+
if (lock4.updateTimeout) {
|
|
113854
|
+
clearTimeout(lock4.updateTimeout);
|
|
113855
113855
|
}
|
|
113856
|
-
if (locks[file] ===
|
|
113856
|
+
if (locks[file] === lock4) {
|
|
113857
113857
|
delete locks[file];
|
|
113858
113858
|
}
|
|
113859
|
-
|
|
113859
|
+
lock4.options.onCompromised(err2);
|
|
113860
113860
|
}
|
|
113861
|
-
function
|
|
113861
|
+
function lock3(file, options, callback) {
|
|
113862
113862
|
options = {
|
|
113863
113863
|
stale: 1e4,
|
|
113864
113864
|
update: null,
|
|
@@ -113888,7 +113888,7 @@ var require_lockfile = __commonJS({
|
|
|
113888
113888
|
if (err3) {
|
|
113889
113889
|
return callback(operation.mainError());
|
|
113890
113890
|
}
|
|
113891
|
-
const
|
|
113891
|
+
const lock4 = locks[file2] = {
|
|
113892
113892
|
lockfilePath: getLockFile(file2, options),
|
|
113893
113893
|
mtime,
|
|
113894
113894
|
mtimePrecision: mtimePrecision2,
|
|
@@ -113897,7 +113897,7 @@ var require_lockfile = __commonJS({
|
|
|
113897
113897
|
};
|
|
113898
113898
|
updateLock(file2, options);
|
|
113899
113899
|
callback(null, (releasedCallback) => {
|
|
113900
|
-
if (
|
|
113900
|
+
if (lock4.released) {
|
|
113901
113901
|
return releasedCallback && releasedCallback(Object.assign(new Error("Lock is already released"), { code: "ERELEASED" }));
|
|
113902
113902
|
}
|
|
113903
113903
|
unlock(file2, { ...options, realpath: false }, releasedCallback);
|
|
@@ -113916,12 +113916,12 @@ var require_lockfile = __commonJS({
|
|
|
113916
113916
|
if (err2) {
|
|
113917
113917
|
return callback(err2);
|
|
113918
113918
|
}
|
|
113919
|
-
const
|
|
113920
|
-
if (!
|
|
113919
|
+
const lock4 = locks[file2];
|
|
113920
|
+
if (!lock4) {
|
|
113921
113921
|
return callback(Object.assign(new Error("Lock is not acquired/owned by you"), { code: "ENOTACQUIRED" }));
|
|
113922
113922
|
}
|
|
113923
|
-
|
|
113924
|
-
|
|
113923
|
+
lock4.updateTimeout && clearTimeout(lock4.updateTimeout);
|
|
113924
|
+
lock4.released = true;
|
|
113925
113925
|
delete locks[file2];
|
|
113926
113926
|
removeLock(file2, options, callback);
|
|
113927
113927
|
});
|
|
@@ -113958,7 +113958,7 @@ var require_lockfile = __commonJS({
|
|
|
113958
113958
|
}
|
|
113959
113959
|
}
|
|
113960
113960
|
});
|
|
113961
|
-
module2.exports.lock =
|
|
113961
|
+
module2.exports.lock = lock3;
|
|
113962
113962
|
module2.exports.unlock = unlock;
|
|
113963
113963
|
module2.exports.check = check2;
|
|
113964
113964
|
module2.exports.getLocks = getLocks;
|
|
@@ -114036,7 +114036,7 @@ var require_proper_lockfile = __commonJS({
|
|
|
114036
114036
|
"use strict";
|
|
114037
114037
|
var lockfile = require_lockfile();
|
|
114038
114038
|
var { toPromise, toSync, toSyncOptions } = require_adapter();
|
|
114039
|
-
async function
|
|
114039
|
+
async function lock3(file, options) {
|
|
114040
114040
|
const release3 = await toPromise(lockfile.lock)(file, options);
|
|
114041
114041
|
return toPromise(release3);
|
|
114042
114042
|
}
|
|
@@ -114056,8 +114056,8 @@ var require_proper_lockfile = __commonJS({
|
|
|
114056
114056
|
function checkSync(file, options) {
|
|
114057
114057
|
return toSync(lockfile.check)(file, toSyncOptions(options));
|
|
114058
114058
|
}
|
|
114059
|
-
module2.exports =
|
|
114060
|
-
module2.exports.lock =
|
|
114059
|
+
module2.exports = lock3;
|
|
114060
|
+
module2.exports.lock = lock3;
|
|
114061
114061
|
module2.exports.unlock = unlock;
|
|
114062
114062
|
module2.exports.lockSync = lockSync;
|
|
114063
114063
|
module2.exports.unlockSync = unlockSync;
|
|
@@ -114715,7 +114715,7 @@ import * as path6 from "node:path";
|
|
|
114715
114715
|
import * as os4 from "node:os";
|
|
114716
114716
|
import * as crypto10 from "node:crypto";
|
|
114717
114717
|
import * as fs11 from "node:fs";
|
|
114718
|
-
var OAUTH_FILE, TMP_DIR_NAME, BIN_DIR_NAME, AGENTS_DIR_NAME, AUTO_SAVED_POLICY_FILENAME, Storage2;
|
|
114718
|
+
var OAUTH_FILE, TRUSTED_FOLDERS_FILENAME, TMP_DIR_NAME, BIN_DIR_NAME, AGENTS_DIR_NAME, AUTO_SAVED_POLICY_FILENAME, Storage2;
|
|
114719
114719
|
var init_storage = __esm({
|
|
114720
114720
|
"packages/core/dist/src/config/storage.js"() {
|
|
114721
114721
|
"use strict";
|
|
@@ -114723,6 +114723,7 @@ var init_storage = __esm({
|
|
|
114723
114723
|
init_projectRegistry();
|
|
114724
114724
|
init_storageMigration();
|
|
114725
114725
|
OAUTH_FILE = "oauth_creds.json";
|
|
114726
|
+
TRUSTED_FOLDERS_FILENAME = "trustedFolders.json";
|
|
114726
114727
|
TMP_DIR_NAME = "tmp";
|
|
114727
114728
|
BIN_DIR_NAME = "bin";
|
|
114728
114729
|
AGENTS_DIR_NAME = ".agents";
|
|
@@ -114775,6 +114776,12 @@ var init_storage = __esm({
|
|
|
114775
114776
|
static getGoogleAccountsPath() {
|
|
114776
114777
|
return path6.join(_Storage.getGlobalGeminiDir(), GOOGLE_ACCOUNTS_FILENAME);
|
|
114777
114778
|
}
|
|
114779
|
+
static getTrustedFoldersPath() {
|
|
114780
|
+
if (process.env["GEMINI_CLI_TRUSTED_FOLDERS_PATH"]) {
|
|
114781
|
+
return process.env["GEMINI_CLI_TRUSTED_FOLDERS_PATH"];
|
|
114782
|
+
}
|
|
114783
|
+
return path6.join(_Storage.getGlobalGeminiDir(), TRUSTED_FOLDERS_FILENAME);
|
|
114784
|
+
}
|
|
114778
114785
|
static getUserCommandsDir() {
|
|
114779
114786
|
return path6.join(_Storage.getGlobalGeminiDir(), "commands");
|
|
114780
114787
|
}
|
|
@@ -120552,6 +120559,14 @@ function extractNameFromNode(node) {
|
|
|
120552
120559
|
return "heredoc (<<)";
|
|
120553
120560
|
case "herestring_redirect":
|
|
120554
120561
|
return "herestring (<<<)";
|
|
120562
|
+
case "command_substitution":
|
|
120563
|
+
return "command substitution";
|
|
120564
|
+
case "backtick_substitution":
|
|
120565
|
+
return "backtick substitution";
|
|
120566
|
+
case "process_substitution":
|
|
120567
|
+
return "process substitution";
|
|
120568
|
+
case "subshell":
|
|
120569
|
+
return "subshell";
|
|
120555
120570
|
default:
|
|
120556
120571
|
return null;
|
|
120557
120572
|
}
|
|
@@ -121091,7 +121106,11 @@ foreach ($commandAst in $commandAsts) {
|
|
|
121091
121106
|
"redirection (<)",
|
|
121092
121107
|
"redirection (>)",
|
|
121093
121108
|
"heredoc (<<)",
|
|
121094
|
-
"herestring (<<<)"
|
|
121109
|
+
"herestring (<<<)",
|
|
121110
|
+
"command substitution",
|
|
121111
|
+
"backtick substitution",
|
|
121112
|
+
"process substitution",
|
|
121113
|
+
"subshell"
|
|
121095
121114
|
]);
|
|
121096
121115
|
isWindows = () => os6.platform() === "win32";
|
|
121097
121116
|
spawnAsync = async (command, args2, options) => {
|
|
@@ -209359,8 +209378,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
209359
209378
|
var init_git_commit = __esm({
|
|
209360
209379
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
209361
209380
|
"use strict";
|
|
209362
|
-
GIT_COMMIT_INFO = "
|
|
209363
|
-
CLI_VERSION = "0.40.0-preview.
|
|
209381
|
+
GIT_COMMIT_INFO = "31bdf112d";
|
|
209382
|
+
CLI_VERSION = "0.40.0-preview.4";
|
|
209364
209383
|
}
|
|
209365
209384
|
});
|
|
209366
209385
|
|
|
@@ -329302,7 +329321,7 @@ function getVersion() {
|
|
|
329302
329321
|
}
|
|
329303
329322
|
versionPromise = (async () => {
|
|
329304
329323
|
const pkgJson = await getPackageJson(__dirname4);
|
|
329305
|
-
return "0.40.0-preview.
|
|
329324
|
+
return "0.40.0-preview.4";
|
|
329306
329325
|
})();
|
|
329307
329326
|
return versionPromise;
|
|
329308
329327
|
}
|
|
@@ -393322,7 +393341,8 @@ var init_policy_engine = __esm({
|
|
|
393322
393341
|
};
|
|
393323
393342
|
}
|
|
393324
393343
|
await initializeShellParsers();
|
|
393325
|
-
const
|
|
393344
|
+
const parsed = parseCommandDetails(command);
|
|
393345
|
+
const subCommands = parsed?.details ?? [];
|
|
393326
393346
|
if (subCommands.length === 0) {
|
|
393327
393347
|
if (ruleDecision === PolicyDecision.DENY) {
|
|
393328
393348
|
return { decision: PolicyDecision.DENY, rule };
|
|
@@ -393339,74 +393359,69 @@ var init_policy_engine = __esm({
|
|
|
393339
393359
|
rule
|
|
393340
393360
|
};
|
|
393341
393361
|
}
|
|
393342
|
-
|
|
393343
|
-
|
|
393344
|
-
|
|
393345
|
-
|
|
393346
|
-
|
|
393347
|
-
|
|
393348
|
-
|
|
393349
|
-
if (
|
|
393362
|
+
debugLogger.debug(`[PolicyEngine.check] Validating shell command: ${subCommands.length} parts`);
|
|
393363
|
+
if (ruleDecision === PolicyDecision.DENY) {
|
|
393364
|
+
return { decision: PolicyDecision.DENY, rule };
|
|
393365
|
+
}
|
|
393366
|
+
let aggregateDecision = ruleDecision;
|
|
393367
|
+
let responsibleRule = rule && ruleDecision === rule.decision ? rule : void 0;
|
|
393368
|
+
if (this.shouldDowngradeForRedirection(command, allowRedirection)) {
|
|
393369
|
+
if (aggregateDecision === PolicyDecision.ALLOW) {
|
|
393350
393370
|
debugLogger.debug(`[PolicyEngine.check] Downgrading ALLOW to ASK_USER for redirected command: ${command}`);
|
|
393351
393371
|
aggregateDecision = PolicyDecision.ASK_USER;
|
|
393352
393372
|
responsibleRule = void 0;
|
|
393353
393373
|
}
|
|
393354
|
-
|
|
393355
|
-
|
|
393356
|
-
|
|
393357
|
-
|
|
393358
|
-
|
|
393359
|
-
|
|
393360
|
-
|
|
393361
|
-
|
|
393362
|
-
|
|
393374
|
+
}
|
|
393375
|
+
for (const detail of subCommands) {
|
|
393376
|
+
if (REDIRECTION_NAMES.has(detail.name)) {
|
|
393377
|
+
continue;
|
|
393378
|
+
}
|
|
393379
|
+
const subCmd = detail.text.trim();
|
|
393380
|
+
const isAtomic = subCmd === command || detail.startIndex === 0 && detail.text.length === command.length;
|
|
393381
|
+
const stripped = stripShellWrapper(subCmd);
|
|
393382
|
+
if (stripped !== subCmd) {
|
|
393383
|
+
const wrapperResult = await this.check({ name: toolName, args: { command: stripped, dir_path } }, serverName, toolAnnotations, subagent, true);
|
|
393384
|
+
if (wrapperResult.decision === PolicyDecision.DENY)
|
|
393385
|
+
return wrapperResult;
|
|
393386
|
+
if (wrapperResult.decision === PolicyDecision.ASK_USER) {
|
|
393387
|
+
if (aggregateDecision === PolicyDecision.ALLOW) {
|
|
393388
|
+
responsibleRule = wrapperResult.rule;
|
|
393363
393389
|
} else {
|
|
393364
|
-
|
|
393365
|
-
aggregateDecision = PolicyDecision.ASK_USER;
|
|
393366
|
-
responsibleRule = rule;
|
|
393367
|
-
}
|
|
393390
|
+
responsibleRule ??= wrapperResult.rule;
|
|
393368
393391
|
}
|
|
393369
|
-
continue;
|
|
393370
|
-
}
|
|
393371
|
-
const subResult = await this.check({ name: toolName, args: { command: subCmd, dir_path } }, serverName, toolAnnotations, subagent);
|
|
393372
|
-
const subDecision = subResult.decision;
|
|
393373
|
-
if (subDecision === PolicyDecision.DENY) {
|
|
393374
|
-
return {
|
|
393375
|
-
decision: PolicyDecision.DENY,
|
|
393376
|
-
rule: subResult.rule
|
|
393377
|
-
};
|
|
393378
|
-
}
|
|
393379
|
-
if (subDecision === PolicyDecision.ASK_USER) {
|
|
393380
393392
|
aggregateDecision = PolicyDecision.ASK_USER;
|
|
393381
|
-
|
|
393393
|
+
}
|
|
393394
|
+
}
|
|
393395
|
+
if (!isAtomic) {
|
|
393396
|
+
const subResult = await this.check({ name: toolName, args: { command: subCmd, dir_path } }, serverName, toolAnnotations, subagent, true);
|
|
393397
|
+
if (subResult.decision === PolicyDecision.DENY)
|
|
393398
|
+
return subResult;
|
|
393399
|
+
if (subResult.decision === PolicyDecision.ASK_USER) {
|
|
393400
|
+
if (aggregateDecision === PolicyDecision.ALLOW) {
|
|
393382
393401
|
responsibleRule = subResult.rule;
|
|
393402
|
+
} else {
|
|
393403
|
+
responsibleRule ??= subResult.rule;
|
|
393383
393404
|
}
|
|
393405
|
+
aggregateDecision = PolicyDecision.ASK_USER;
|
|
393384
393406
|
}
|
|
393385
|
-
if (
|
|
393386
|
-
debugLogger.debug(`[PolicyEngine.check] Downgrading ALLOW to ASK_USER for redirected command: ${subCmd}`);
|
|
393407
|
+
if (subResult.decision === PolicyDecision.ALLOW && this.shouldDowngradeForRedirection(subCmd, allowRedirection)) {
|
|
393387
393408
|
if (aggregateDecision === PolicyDecision.ALLOW) {
|
|
393388
393409
|
aggregateDecision = PolicyDecision.ASK_USER;
|
|
393389
393410
|
responsibleRule = void 0;
|
|
393390
393411
|
}
|
|
393391
393412
|
}
|
|
393392
393413
|
}
|
|
393393
|
-
return {
|
|
393394
|
-
decision: aggregateDecision,
|
|
393395
|
-
// If we stayed at ALLOW, we return the original rule (if any).
|
|
393396
|
-
// If we downgraded, we return the responsible rule (or undefined if implicit).
|
|
393397
|
-
rule: aggregateDecision === ruleDecision ? rule : responsibleRule
|
|
393398
|
-
};
|
|
393399
393414
|
}
|
|
393400
393415
|
return {
|
|
393401
|
-
decision:
|
|
393402
|
-
rule
|
|
393416
|
+
decision: aggregateDecision,
|
|
393417
|
+
rule: aggregateDecision === ruleDecision ? rule : responsibleRule
|
|
393403
393418
|
};
|
|
393404
393419
|
}
|
|
393405
393420
|
/**
|
|
393406
393421
|
* Check if a tool call is allowed based on the configured policies.
|
|
393407
393422
|
* Returns the decision and the matching rule (if any).
|
|
393408
393423
|
*/
|
|
393409
|
-
async check(toolCall, serverName, toolAnnotations, subagent) {
|
|
393424
|
+
async check(toolCall, serverName, toolAnnotations, subagent, skipHeuristics = false) {
|
|
393410
393425
|
if (!serverName && isMcpToolAnnotation(toolAnnotations)) {
|
|
393411
393426
|
serverName = toolAnnotations._serverName;
|
|
393412
393427
|
}
|
|
@@ -393454,18 +393469,16 @@ var init_policy_engine = __esm({
|
|
|
393454
393469
|
if (match2) {
|
|
393455
393470
|
debugLogger.debug(`[PolicyEngine.check] MATCHED rule: toolName=${rule.toolName}, decision=${rule.decision}, priority=${rule.priority}, argsPattern=${rule.argsPattern?.source || "none"}`);
|
|
393456
393471
|
let ruleDecision = rule.decision;
|
|
393457
|
-
if (isShellCommand && command && !("commandPrefix" in rule) && !rule.argsPattern) {
|
|
393472
|
+
if (!skipHeuristics && isShellCommand && command && !("commandPrefix" in rule) && !rule.argsPattern) {
|
|
393458
393473
|
ruleDecision = await this.applyShellHeuristics(command, ruleDecision);
|
|
393459
393474
|
}
|
|
393460
393475
|
if (isShellCommand && toolName) {
|
|
393461
393476
|
const shellResult = await this.checkShellCommand(toolName, command, ruleDecision, serverName, shellDirPath, rule.allowRedirection, rule, toolAnnotations, subagent);
|
|
393462
393477
|
decision = shellResult.decision;
|
|
393463
|
-
|
|
393464
|
-
|
|
393465
|
-
break;
|
|
393466
|
-
}
|
|
393478
|
+
matchedRule = shellResult.rule;
|
|
393479
|
+
break;
|
|
393467
393480
|
} else {
|
|
393468
|
-
decision =
|
|
393481
|
+
decision = ruleDecision;
|
|
393469
393482
|
matchedRule = rule;
|
|
393470
393483
|
break;
|
|
393471
393484
|
}
|
|
@@ -393481,7 +393494,7 @@ var init_policy_engine = __esm({
|
|
|
393481
393494
|
debugLogger.debug(`[PolicyEngine.check] NO MATCH - using default decision: ${this.defaultDecision}`);
|
|
393482
393495
|
if (toolName && SHELL_TOOL_NAMES.includes(toolName)) {
|
|
393483
393496
|
let heuristicDecision = this.defaultDecision;
|
|
393484
|
-
if (command) {
|
|
393497
|
+
if (!skipHeuristics && command) {
|
|
393485
393498
|
heuristicDecision = await this.applyShellHeuristics(command, heuristicDecision);
|
|
393486
393499
|
}
|
|
393487
393500
|
const shellResult = await this.checkShellCommand(toolName, command, heuristicDecision, serverName, shellDirPath, false, void 0, toolAnnotations, subagent);
|
|
@@ -396267,7 +396280,7 @@ var init_security = __esm({
|
|
|
396267
396280
|
// packages/core/dist/src/policy/config.js
|
|
396268
396281
|
import * as path79 from "node:path";
|
|
396269
396282
|
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
396270
|
-
var import_toml3, __filename6, __dirname8, DEFAULT_CORE_POLICIES_DIR, WORKSPACE_POLICY_TIER, USER_POLICY_TIER, MCP_EXCLUDED_PRIORITY, EXCLUDE_TOOLS_FLAG_PRIORITY, ALLOWED_TOOLS_FLAG_PRIORITY, TRUSTED_MCP_SERVER_PRIORITY, ALLOWED_MCP_SERVER_PRIORITY, ALWAYS_ALLOW_PRIORITY;
|
|
396283
|
+
var import_toml3, __filename6, __dirname8, DEFAULT_CORE_POLICIES_DIR, WORKSPACE_POLICY_TIER, USER_POLICY_TIER, MCP_EXCLUDED_PRIORITY, EXCLUDE_TOOLS_FLAG_PRIORITY, CONFIRMATION_REQUIRED_PRIORITY, ALLOWED_TOOLS_FLAG_PRIORITY, CORE_TOOLS_FLAG_PRIORITY, TRUSTED_MCP_SERVER_PRIORITY, ALLOWED_MCP_SERVER_PRIORITY, ALWAYS_ALLOW_PRIORITY;
|
|
396271
396284
|
var init_config3 = __esm({
|
|
396272
396285
|
"packages/core/dist/src/policy/config.js"() {
|
|
396273
396286
|
"use strict";
|
|
@@ -396292,7 +396305,9 @@ var init_config3 = __esm({
|
|
|
396292
396305
|
USER_POLICY_TIER = 4;
|
|
396293
396306
|
MCP_EXCLUDED_PRIORITY = USER_POLICY_TIER + 0.9;
|
|
396294
396307
|
EXCLUDE_TOOLS_FLAG_PRIORITY = USER_POLICY_TIER + 0.4;
|
|
396308
|
+
CONFIRMATION_REQUIRED_PRIORITY = USER_POLICY_TIER + 0.35;
|
|
396295
396309
|
ALLOWED_TOOLS_FLAG_PRIORITY = USER_POLICY_TIER + 0.3;
|
|
396310
|
+
CORE_TOOLS_FLAG_PRIORITY = USER_POLICY_TIER + 0.25;
|
|
396296
396311
|
TRUSTED_MCP_SERVER_PRIORITY = USER_POLICY_TIER + 0.2;
|
|
396297
396312
|
ALLOWED_MCP_SERVER_PRIORITY = USER_POLICY_TIER + 0.1;
|
|
396298
396313
|
ALWAYS_ALLOW_PRIORITY = WORKSPACE_POLICY_TIER + ALWAYS_ALLOW_PRIORITY_OFFSET;
|
|
@@ -425594,6 +425609,26 @@ var init_profiles = __esm({
|
|
|
425594
425609
|
}
|
|
425595
425610
|
});
|
|
425596
425611
|
|
|
425612
|
+
// packages/core/dist/src/utils/trust.js
|
|
425613
|
+
var import_proper_lockfile2, import_strip_json_comments2, TrustLevel;
|
|
425614
|
+
var init_trust = __esm({
|
|
425615
|
+
"packages/core/dist/src/utils/trust.js"() {
|
|
425616
|
+
"use strict";
|
|
425617
|
+
import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
|
|
425618
|
+
import_strip_json_comments2 = __toESM(require_strip_json_comments(), 1);
|
|
425619
|
+
init_storage();
|
|
425620
|
+
init_paths();
|
|
425621
|
+
init_errors2();
|
|
425622
|
+
init_events();
|
|
425623
|
+
init_ideContext();
|
|
425624
|
+
(function(TrustLevel2) {
|
|
425625
|
+
TrustLevel2["TRUST_FOLDER"] = "TRUST_FOLDER";
|
|
425626
|
+
TrustLevel2["TRUST_PARENT"] = "TRUST_PARENT";
|
|
425627
|
+
TrustLevel2["DO_NOT_TRUST"] = "DO_NOT_TRUST";
|
|
425628
|
+
})(TrustLevel || (TrustLevel = {}));
|
|
425629
|
+
}
|
|
425630
|
+
});
|
|
425631
|
+
|
|
425597
425632
|
// packages/core/dist/src/index.js
|
|
425598
425633
|
var init_src2 = __esm({
|
|
425599
425634
|
"packages/core/dist/src/index.js"() {
|
|
@@ -425790,6 +425825,7 @@ var init_src2 = __esm({
|
|
|
425790
425825
|
init_responseFormatter();
|
|
425791
425826
|
init_types18();
|
|
425792
425827
|
init_profiles();
|
|
425828
|
+
init_trust();
|
|
425793
425829
|
}
|
|
425794
425830
|
});
|
|
425795
425831
|
|
|
@@ -442752,7 +442788,7 @@ init_dist4();
|
|
|
442752
442788
|
|
|
442753
442789
|
// packages/a2a-server/src/config/settings.ts
|
|
442754
442790
|
init_dist4();
|
|
442755
|
-
var
|
|
442791
|
+
var import_strip_json_comments3 = __toESM(require_strip_json_comments(), 1);
|
|
442756
442792
|
import * as fs78 from "node:fs";
|
|
442757
442793
|
import * as path85 from "node:path";
|
|
442758
442794
|
var USER_SETTINGS_DIR = path85.join(homedir(), GEMINI_DIR);
|
|
@@ -442765,7 +442801,7 @@ function loadSettings(workspaceDir) {
|
|
|
442765
442801
|
if (fs78.existsSync(USER_SETTINGS_PATH)) {
|
|
442766
442802
|
const userContent = fs78.readFileSync(USER_SETTINGS_PATH, "utf-8");
|
|
442767
442803
|
const parsedUserSettings = JSON.parse(
|
|
442768
|
-
(0,
|
|
442804
|
+
(0, import_strip_json_comments3.default)(userContent)
|
|
442769
442805
|
);
|
|
442770
442806
|
userSettings = resolveEnvVarsInObject(parsedUserSettings);
|
|
442771
442807
|
}
|
|
@@ -442784,7 +442820,7 @@ function loadSettings(workspaceDir) {
|
|
|
442784
442820
|
if (fs78.existsSync(workspaceSettingsPath)) {
|
|
442785
442821
|
const projectContent = fs78.readFileSync(workspaceSettingsPath, "utf-8");
|
|
442786
442822
|
const parsedWorkspaceSettings = JSON.parse(
|
|
442787
|
-
(0,
|
|
442823
|
+
(0, import_strip_json_comments3.default)(projectContent)
|
|
442788
442824
|
);
|
|
442789
442825
|
workspaceSettings = resolveEnvVarsInObject(parsedWorkspaceSettings);
|
|
442790
442826
|
}
|