@kenkaiiii/ggcoder 5.41.1 → 5.42.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.
@@ -47,7 +47,7 @@ import { loginGemini } from "./core/oauth/gemini.js";
47
47
  import { loginKimi } from "./core/oauth/kimi.js";
48
48
  import { loginXai } from "./core/oauth/xai.js";
49
49
  import { AUTH_PROVIDERS, authPriorityNote, describeAuthMethods, } from "./core/auth-providers.js";
50
- import { ensureAppDirs, loadSavedSettings } from "./config.js";
50
+ import { ensureAppDirs, loadSavedSettings, projectScopeAllowed } from "./config.js";
51
51
  import { SettingsManager } from "./core/settings-manager.js";
52
52
  import { installPlugin, listInstalledPlugins, removePlugin, } from "./core/extensions/plugin-bundles.js";
53
53
  import { getModel, getDefaultThinkingLevel, getContextWindow, getAllModels, clearRuntimeModels, registerRuntimeModels, } from "./core/model-registry.js";
@@ -396,9 +396,10 @@ async function buildMcpRows(cwd, settingsFile) {
396
396
  const scoped = await loadServers(cwd);
397
397
  if (scoped.length === 0)
398
398
  return [];
399
- const trustProject = loadSavedSettings(settingsFile).trustProjectMcpServers;
400
- const connectable = scoped.filter((s) => trustProject || s.scope !== "project");
401
- const blocked = scoped.filter((s) => !trustProject && s.scope === "project");
399
+ const settings = loadSavedSettings(settingsFile);
400
+ const allowProject = projectScopeAllowed(settings.trustProjectMcpServers, settings.trustedProjects, cwd);
401
+ const connectable = scoped.filter((s) => allowProject || s.scope !== "project");
402
+ const blocked = scoped.filter((s) => !allowProject && s.scope === "project");
402
403
  const manager = new MCPClientManager();
403
404
  try {
404
405
  const results = connectable.length > 0
@@ -424,7 +425,8 @@ async function buildMcpRows(cwd, settingsFile) {
424
425
  ok: false,
425
426
  toolCount: 0,
426
427
  error: "Project-scope server not connected — this repo's .gg/mcp.json runs " +
427
- "repo-controlled commands. Enable trustProjectMcpServers only if you trust it.",
428
+ "repo-controlled commands. Add or re-add a server in this project via " +
429
+ "the MCP modal to trust it.",
428
430
  kind: (s.config.url ? "http" : "stdio"),
429
431
  summary: mcpRowSummary(s.config),
430
432
  })),
@@ -4517,6 +4519,12 @@ async function createSession(deps, opts) {
4517
4519
  json(res, 400, { error: saved.error });
4518
4520
  return;
4519
4521
  }
4522
+ // Adding a project-scope server is an explicit trust signal — the
4523
+ // user chose to put a server in this repo's .gg/mcp.json. Auto-trust
4524
+ // the project so all project-scope servers connect on next load.
4525
+ if (scope === "project") {
4526
+ await session.trustProject(targetCwd);
4527
+ }
4520
4528
  json(res, 200, {
4521
4529
  ok: true,
4522
4530
  name: config.name,