@kenkaiiii/ggcoder 5.98.2 → 5.99.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/assets/skills/gg-guide/SKILL.md +40 -0
- package/assets/skills/gg-guide/references/chat-motion-goals.md +199 -0
- package/assets/skills/gg-guide/references/checklist-and-safety.md +159 -0
- package/assets/skills/gg-guide/references/code-mode.md +208 -0
- package/assets/skills/gg-guide/references/getting-started.md +179 -0
- package/assets/skills/gg-guide/references/ken-and-autopilot.md +154 -0
- package/assets/skills/gg-guide/references/mcp-and-skills.md +176 -0
- package/assets/skills/gg-guide/references/models-and-sign-in.md +180 -0
- package/assets/skills/gg-guide/references/sessions-and-history.md +188 -0
- package/assets/skills/gg-guide/references/settings.md +157 -0
- package/assets/skills/gg-guide/references/troubleshooting-and-data.md +163 -0
- package/dist/app-sidecar/mcp-routes.js +9 -0
- package/dist/app-sidecar/mcp-routes.js.map +1 -1
- package/dist/app-sidecar/mcp-shell-command.d.ts +36 -0
- package/dist/app-sidecar/mcp-shell-command.js +302 -0
- package/dist/app-sidecar/mcp-shell-command.js.map +1 -0
- package/dist/app-sidecar/mcp-sync.d.ts +18 -0
- package/dist/app-sidecar/mcp-sync.js +38 -0
- package/dist/app-sidecar/mcp-sync.js.map +1 -0
- package/dist/app-sidecar/prompt-routes.js +5 -21
- package/dist/app-sidecar/prompt-routes.js.map +1 -1
- package/dist/app-sidecar/route-context.d.ts +3 -1
- package/dist/app-sidecar/shell-routes.js +7 -0
- package/dist/app-sidecar/shell-routes.js.map +1 -1
- package/dist/app-sidecar/workspace-routes.js +35 -0
- package/dist/app-sidecar/workspace-routes.js.map +1 -1
- package/dist/app-sidecar.js +13 -3
- package/dist/app-sidecar.js.map +1 -1
- package/dist/cli/mcp.js +19 -5
- package/dist/cli/mcp.js.map +1 -1
- package/dist/core/agent-session/mcp-tools.d.ts +17 -0
- package/dist/core/agent-session/mcp-tools.js +31 -0
- package/dist/core/agent-session/mcp-tools.js.map +1 -1
- package/dist/core/agent-session.d.ts +24 -0
- package/dist/core/agent-session.js +92 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/mcp/client.d.ts +9 -0
- package/dist/core/mcp/client.js +58 -5
- package/dist/core/mcp/client.js.map +1 -1
- package/dist/core/mcp/oauth-provider.d.ts +7 -1
- package/dist/core/mcp/oauth-provider.js +11 -4
- package/dist/core/mcp/oauth-provider.js.map +1 -1
- package/dist/core/mcp/oauth-store.d.ts +6 -0
- package/dist/core/mcp/oauth-store.js +14 -0
- package/dist/core/mcp/oauth-store.js.map +1 -1
- package/dist/core/mcp/parse-add-command.d.ts +29 -3
- package/dist/core/mcp/parse-add-command.js +196 -26
- package/dist/core/mcp/parse-add-command.js.map +1 -1
- package/dist/core/mcp/store.d.ts +16 -0
- package/dist/core/mcp/store.js +28 -0
- package/dist/core/mcp/store.js.map +1 -1
- package/dist/core/mcp/types.d.ts +9 -0
- package/dist/core/skills.d.ts +2 -0
- package/dist/core/skills.js +5 -0
- package/dist/core/skills.js.map +1 -1
- package/dist/system-prompt.js +1 -1
- package/dist/system-prompt.js.map +1 -1
- package/dist/test-support/system-tools.d.ts +6 -0
- package/dist/test-support/system-tools.js +36 -0
- package/dist/test-support/system-tools.js.map +1 -0
- package/dist/tools/ask-user.js +2 -1
- package/dist/tools/ask-user.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Troubleshooting and where GG Coder keeps data
|
|
2
|
+
|
|
3
|
+
GG Coder keeps its data in one folder in the user's home directory, `~/.gg/`. The desktop app and the `ggcoder` CLI share this folder, so a sign-in made in one also works in the other.
|
|
4
|
+
|
|
5
|
+
## What lives in `~/.gg/`
|
|
6
|
+
|
|
7
|
+
Settings and sign-ins:
|
|
8
|
+
- `~/.gg/settings.json`: agent settings such as the chosen model, thinking level, keep-awake and the trust choices for project MCP servers. Shared with the CLI.
|
|
9
|
+
- `~/.gg/gg-app.json`: desktop-app settings, such as the projects folder and per-project app options like autopilot.
|
|
10
|
+
- `~/.gg/gg-app-workspace.json`: a record of which windows were open, with their project, chat and position. The app uses it to reopen windows after a restart.
|
|
11
|
+
- `~/.gg/auth.json`: sign-ins and API keys for AI providers. Every app window and the CLI share it. This is a credential file. Never share it.
|
|
12
|
+
- `~/.gg/openai-host-id` and `~/.gg/openai-chatgpt-client.json`: identity data for the ChatGPT sign-in. Treat them as credentials.
|
|
13
|
+
- `~/.gg/claude-code`: the Claude Code build that GG Coder downloads for "Sign in with Claude", one folder per version. It also holds GG Coder's own Claude Code login in a `config` folder, separate from the user's own Claude Code. Never share the login.
|
|
14
|
+
- `~/.gg/telegram.json`: Telegram bot settings, including the bot token. Never share it.
|
|
15
|
+
|
|
16
|
+
MCP:
|
|
17
|
+
- `~/.gg/mcp.json`: global MCP servers, used in every project.
|
|
18
|
+
- `~/.gg/mcp-auth.json`: sign-ins for MCP servers. This is a credential file. Never share it.
|
|
19
|
+
- `~/.gg/mcp-catalog.json`: a cached list of MCP tools. It is safe to delete and gets rebuilt.
|
|
20
|
+
|
|
21
|
+
Work and history:
|
|
22
|
+
- `~/.gg/sessions`: saved chats (session transcripts). Deleting them removes chat history. Old sessions are pruned at startup based on a retention setting.
|
|
23
|
+
- `~/.gg/subagent-sessions`: transcripts of helper agents.
|
|
24
|
+
- `~/.gg/goals`: one folder per Goal.
|
|
25
|
+
- `~/.gg/checkpoints`: per-chat checkpoint folders. The app removes folders that have gone 30 days without being touched.
|
|
26
|
+
- `~/.gg/tool-output`: full tool outputs kept for recovery. The app deletes them after 48 hours.
|
|
27
|
+
- `~/.gg/diagnostics/sessions`: diagnostic records. The app deletes them after 30 days.
|
|
28
|
+
- `~/.gg/skills`: the user's global skills.
|
|
29
|
+
- `~/.gg/progress.json` and `~/.gg/trophies.json`: progress and earned trophies.
|
|
30
|
+
|
|
31
|
+
Logs and housekeeping:
|
|
32
|
+
- `~/.gg/gg-app-sidecar.log`: the desktop app's agent log. Read this first for app problems.
|
|
33
|
+
- `~/.gg/debug.log`: the CLI's log. The desktop app does not write to it.
|
|
34
|
+
- `~/.gg/gg-app-sidecars`: a list of the app's running agent processes. Don't edit it while the app is open.
|
|
35
|
+
|
|
36
|
+
Safe to delete when GG Coder is closed: the logs, `~/.gg/mcp-catalog.json`, `~/.gg/tool-output`, `~/.gg/diagnostics/sessions`. If `~/.gg/claude-code` is deleted, the Claude sign-in downloads it again and the user has to sign in again.
|
|
37
|
+
Never paste or upload: `~/.gg/auth.json`, `~/.gg/mcp-auth.json`, `~/.gg/telegram.json`, the files under `~/.gg/claude-code`, and the OpenAI identity files.
|
|
38
|
+
|
|
39
|
+
## Files inside a project
|
|
40
|
+
|
|
41
|
+
Each project can have its own `.gg/` folder:
|
|
42
|
+
- `.gg/mcp.json`: MCP servers for this project only.
|
|
43
|
+
- `.gg/skills`: skills for this project. Each skill is a folder with a `SKILL.md`.
|
|
44
|
+
- `.gg/commands`: custom slash commands, one `.md` file each. They appear in the `/` menu. A Goal's attached repos and folders added with **Add folder** contribute their commands too.
|
|
45
|
+
- `.gg/uploads`: files attached in chat.
|
|
46
|
+
- `.gg-checklist.json` (in the project root, not inside `.gg/`): the project health checklist record.
|
|
47
|
+
|
|
48
|
+
## Which log to read
|
|
49
|
+
|
|
50
|
+
- For agent, model, MCP or tool problems, read `~/.gg/gg-app-sidecar.log`. The app replaces it each time the app starts, so collect it before relaunching.
|
|
51
|
+
- The desktop shell writes a separate log named `gg-app.log` in the system's log folder for the app. It records crashes of the window itself.
|
|
52
|
+
- Before sharing any log, remove API keys, tokens and anything private.
|
|
53
|
+
|
|
54
|
+
## Common problems
|
|
55
|
+
|
|
56
|
+
Not signed in, or a sign-in stopped working:
|
|
57
|
+
- When a chat starts with no provider connected, the app shows "Connect an AI provider first." Connect a provider from the providers screen with **Connect** or **Sign in**.
|
|
58
|
+
- If an old sign-in has been retired, the providers screen shows a notice with **Reconnect** and **Dismiss**. **Reconnect** opens that provider's login. **Dismiss** removes only the retired sign-in.
|
|
59
|
+
- If the providers list fails to load, the screen shows "Couldn't read your AI providers." with **Try again**.
|
|
60
|
+
- Sign-ins are shared, so connecting or disconnecting in one window updates every window.
|
|
61
|
+
|
|
62
|
+
Model errors in a chat:
|
|
63
|
+
- An error appears in the chat as a short headline, a line of guidance, and a **Details** button. **Details** shows the provider's original message, the provider name, the HTTP status, the request ID and the time of the report.
|
|
64
|
+
- Errors fall into these kinds: usage limit, billing, quota, rate limit, model access, auth, network, capability, context, update, provider or unknown.
|
|
65
|
+
- For usage-limit, model-access, capability and update errors, a model picker appears next to the notice so the user can switch models.
|
|
66
|
+
- For a usage limit, **Details** shows the reported reset time. After that time has passed, the guidance tells the user to check their usage before trying again.
|
|
67
|
+
- An error from an earlier attempt is shown with the prefix "Earlier:".
|
|
68
|
+
- If a subscription runs out and the provider also has an API key saved, the provider screen says requests are using the API key until the subscription resets.
|
|
69
|
+
|
|
70
|
+
Common error headlines and what to do:
|
|
71
|
+
- "<provider> usage limit reached": wait for the reset shown in **Details**, or switch to another provider or model with the picker next to the notice. If the provider also has an API key saved, GG uses the key until the subscription resets.
|
|
72
|
+
- "<provider> is limiting requests": wait a moment, then try again.
|
|
73
|
+
- "<provider> sign-in needs attention": reconnect the account in the AI Providers settings.
|
|
74
|
+
- "Couldn't reach the provider": check your internet connection, then try again.
|
|
75
|
+
- "The response kept stalling": try again, ask for smaller pieces of work, or pick another model.
|
|
76
|
+
- "This conversation is too large": compact the conversation or send a smaller request.
|
|
77
|
+
- "The local server rejected its key": check the endpoint's key under Local models in the AI Providers settings.
|
|
78
|
+
|
|
79
|
+
Small pop-up messages (toasts) appear at the edge of the window for things like saved settings or failed actions. Normal ones fade after a few seconds. Error toasts stay until you close them with the x (**Dismiss**).
|
|
80
|
+
|
|
81
|
+
A window stuck loading or showing an error:
|
|
82
|
+
- The window waits for the background agent to start. If the agent doesn't start in time, or keeps crashing on startup, the window shows that reason. A crash message names the cause, for example a permissions error on `~/.gg/settings.json`.
|
|
83
|
+
- If the window itself crashes, it shows **This window hit a problem** with an **Error details** section and a **Reload window** button. Chats are saved, so reloading continues where the user left off.
|
|
84
|
+
- If the problem continues, check `~/.gg/gg-app-sidecar.log`.
|
|
85
|
+
|
|
86
|
+
MCP server not working (Settings, MCP):
|
|
87
|
+
- A green tick with a tool count means the server is connected.
|
|
88
|
+
- A lock with **Requires login** means the server needs a sign-in. Click **Sign in**.
|
|
89
|
+
- A red cross shows the connection error under the server's row. Errors that start with "blocked" are safety blocks. Tools hidden by the safety guard are listed under the row.
|
|
90
|
+
- A server from a project's `.gg/mcp.json` stays disconnected until that project is trusted, because the file can run commands chosen by the repo. Adding or re-adding the server for that project in the MCP screen trusts that project.
|
|
91
|
+
- If the list says "Couldn't reach the agent to list servers.", use **Try again**.
|
|
92
|
+
|
|
93
|
+
`!` commands ask for confirmation:
|
|
94
|
+
- In a project that hasn't been trusted, a shell command typed with `!` shows **Run this command?** along with the command and the folder it will run in. The choices are **Run once**, **Always allow in this project** and **Cancel**. Enter runs the command and Esc cancels it.
|
|
95
|
+
|
|
96
|
+
App updates:
|
|
97
|
+
- An update bar offers the new version. Installing it downloads the update, then restarts the app.
|
|
98
|
+
- If the install fails, the bar shows **Update failed** with **Retry** and **Download manually**. **Download manually** opens the latest release on GitHub.
|
|
99
|
+
|
|
100
|
+
Quit and relaunch:
|
|
101
|
+
- The app records each open window's project, chat and position when the user picks a project, closes a window or quits. On the next launch, including the restart after an update, it reopens those windows where they were.
|
|
102
|
+
|
|
103
|
+
## Reporting a bug
|
|
104
|
+
|
|
105
|
+
- File bugs at github.com/KenKaiii/gg-framework using the Bug report form. It asks what happened, steps to reproduce, where it happened (choose Desktop app), the app version, the operating system, the provider and model, and logs.
|
|
106
|
+
- Attach the relevant part of `~/.gg/gg-app-sidecar.log` with secrets removed. Never attach the credential files.
|
|
107
|
+
- Report security problems privately through GitHub security advisories, not as a public issue.
|
|
108
|
+
- For questions and help, use the Skool community (skool.com/kenkai).
|
|
109
|
+
|
|
110
|
+
## Resetting
|
|
111
|
+
|
|
112
|
+
- To sign out of one provider, disconnect it in the AI Providers settings. Removing `~/.gg/auth.json` while the app is closed signs you out of every provider in the app and the CLI.
|
|
113
|
+
- To clear chat history, delete `~/.gg/sessions` while the app is closed.
|
|
114
|
+
- To forget which windows were open, delete `~/.gg/gg-app-workspace.json` while the app is closed.
|
|
115
|
+
- Deleting the whole `~/.gg/` folder resets GG Coder completely, including sign-ins, settings, MCP servers, skills and chat history. Back up anything you want to keep first.
|
|
116
|
+
- The docs do not describe a separate uninstaller. Remove the app the normal way for your system; the `~/.gg/` folder stays until you delete it.
|
|
117
|
+
|
|
118
|
+
## Common questions
|
|
119
|
+
|
|
120
|
+
Q: Where are the logs?
|
|
121
|
+
A: The desktop app's agent log is `~/.gg/gg-app-sidecar.log`. It starts fresh each launch, so copy it before relaunching. The CLI writes `~/.gg/debug.log` instead.
|
|
122
|
+
|
|
123
|
+
Q: GG says I'm out of usage, what now?
|
|
124
|
+
A: Wait for the reset time shown under **Details**, or pick another provider or model from the picker next to the notice. If you also saved an API key for that provider, GG uses the key until the subscription resets.
|
|
125
|
+
|
|
126
|
+
Q: Where does GG Coder keep my data?
|
|
127
|
+
A: In `~/.gg/` in your home folder, shared by the app and the CLI. Each project can also have its own `.gg/` folder for MCP servers, skills and commands.
|
|
128
|
+
|
|
129
|
+
Q: A window says "This window hit a problem". What do I do?
|
|
130
|
+
A: Click **Reload window**. Your chats are saved, so you continue where you left off.
|
|
131
|
+
|
|
132
|
+
Q: The window is stuck loading.
|
|
133
|
+
A: The background agent may have failed to start; the window shows the reason when it gives up. Check `~/.gg/gg-app-sidecar.log`, fix the cause it names (often file permissions on `~/.gg/`), then relaunch.
|
|
134
|
+
|
|
135
|
+
Q: Every chat says I'm not signed in.
|
|
136
|
+
A: Open the AI Providers settings and click **Connect** or **Sign in** for a provider. If a provider shows **Reconnect**, click it to log in again.
|
|
137
|
+
|
|
138
|
+
Q: My MCP server won't connect.
|
|
139
|
+
A: Open Settings, MCP and read the error under the server's row. Click **Sign in** if it needs a login, and for project servers make sure the project is trusted by adding the server for that project.
|
|
140
|
+
|
|
141
|
+
Q: The update failed.
|
|
142
|
+
A: Click **Retry** in the update bar. If it still fails, click **Download manually** to get the latest release from GitHub.
|
|
143
|
+
|
|
144
|
+
Q: Will my windows come back after I quit?
|
|
145
|
+
A: Yes. The app reopens each window with its project, chat and position on the next launch, including after an update.
|
|
146
|
+
|
|
147
|
+
Q: Why does GG ask before running a `!` command?
|
|
148
|
+
A: The project isn't set to always allow shell commands. Choose **Run once**, **Always allow in this project** or **Cancel**.
|
|
149
|
+
|
|
150
|
+
Q: What does the error **Details** button show?
|
|
151
|
+
A: The provider's original message, the provider name, the HTTP status, the request ID and when it happened. Include these in a bug report.
|
|
152
|
+
|
|
153
|
+
Q: How do I report a bug?
|
|
154
|
+
A: Use the Bug report form at github.com/KenKaiii/gg-framework, choose Desktop app, and attach the relevant part of `~/.gg/gg-app-sidecar.log` with secrets removed.
|
|
155
|
+
|
|
156
|
+
Q: Which files must I never share?
|
|
157
|
+
A: `~/.gg/auth.json`, `~/.gg/mcp-auth.json`, `~/.gg/telegram.json`, the files under `~/.gg/claude-code` and the OpenAI identity files.
|
|
158
|
+
|
|
159
|
+
Q: How do I reset GG Coder completely?
|
|
160
|
+
A: Quit the app and delete the `~/.gg/` folder. This removes all sign-ins, settings, MCP servers, skills and chat history.
|
|
161
|
+
|
|
162
|
+
Q: Is it safe to delete files in `~/.gg/` to free space?
|
|
163
|
+
A: With the app closed, the logs, `~/.gg/tool-output`, `~/.gg/diagnostics/sessions` and `~/.gg/mcp-catalog.json` are safe to delete. Old checkpoints and tool outputs are also cleaned up automatically.
|
|
@@ -66,6 +66,11 @@ export function handleMcpRoutes(ctx, req, res, url, method) {
|
|
|
66
66
|
if (scope === "project") {
|
|
67
67
|
await ctx.session.trustProject(targetCwd);
|
|
68
68
|
}
|
|
69
|
+
if (config.oauth?.clientId) {
|
|
70
|
+
await new McpOAuthStore().setClient(config.name, config.oauth.clientId, parsed.value.clientSecret);
|
|
71
|
+
}
|
|
72
|
+
// Open windows load it now; the reply doesn't wait on a second connect.
|
|
73
|
+
void ctx.syncMcpServer(config.name);
|
|
69
74
|
void ctx.trophies.count("mcpServersAdded", ctx.sessionId);
|
|
70
75
|
json(res, 200, {
|
|
71
76
|
ok: true,
|
|
@@ -114,6 +119,8 @@ export function handleMcpRoutes(ctx, req, res, url, method) {
|
|
|
114
119
|
const removed = await removeServer(name, scope, targetCwd);
|
|
115
120
|
// Drop any saved OAuth tokens for this server so a re-add starts clean.
|
|
116
121
|
await new McpOAuthStore().clear(name).catch(() => { });
|
|
122
|
+
if (removed)
|
|
123
|
+
await ctx.syncMcpServer(name);
|
|
117
124
|
json(res, 200, { removed });
|
|
118
125
|
});
|
|
119
126
|
return true;
|
|
@@ -163,6 +170,8 @@ export function handleMcpRoutes(ctx, req, res, url, method) {
|
|
|
163
170
|
});
|
|
164
171
|
if (result.ok) {
|
|
165
172
|
ctx.broadcast("mcp_auth_done", { name, toolCount: result.toolCount });
|
|
173
|
+
// Signed in: sessions that couldn't connect before retry now.
|
|
174
|
+
void ctx.syncMcpServer(name);
|
|
166
175
|
}
|
|
167
176
|
else {
|
|
168
177
|
ctx.broadcast("mcp_auth_error", { name, message: result.error ?? "Login failed." });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-routes.js","sourceRoot":"","sources":["../../src/app-sidecar/mcp-routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,GAEd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGvD,MAAM,UAAU,eAAe,CAC7B,GAAwB,E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C,SAAS,EAAE,CAAC,CAAC;oBACtE,8DAA8D;oBAC9D,KAAK,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;gBAC/B,CAAC;qBAAM,CAAC;oBACN,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,IAAI,eAAe,EAAE,CAAC,CAAC;gBACtF,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE;oBAC9B,IAAI;oBACJ,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;iBAC1D,CAAC,CAAC;YACL,CAAC;oBAAS,CAAC;gBACT,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { McpServerChange } from "../core/agent-session.js";
|
|
2
|
+
import { probeMcp, type McpWireRow } from "./mcp-rows.js";
|
|
3
|
+
import { type ShellRunEnd } from "./shell-runs.js";
|
|
4
|
+
import type { SessionRouteContext } from "./route-context.js";
|
|
5
|
+
/**
|
|
6
|
+
* `!claude mcp …` / `!ggcoder mcp …` typed in the app's input. Handled here
|
|
7
|
+
* instead of in a shell so the line pasted from an MCP server's docs manages
|
|
8
|
+
* GG Coder's own servers (the same files as the MCP modal), not Claude Code's.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isMcpShellCommand(command: string): boolean;
|
|
11
|
+
export interface McpShellDeps {
|
|
12
|
+
cwd: string;
|
|
13
|
+
listRows: (cwd: string) => Promise<McpWireRow[]>;
|
|
14
|
+
probe: typeof probeMcp;
|
|
15
|
+
clearOAuth: (name: string) => Promise<void>;
|
|
16
|
+
/** A project-scope server was added: the user trusts this project's servers. */
|
|
17
|
+
trustProject: (cwd: string) => Promise<void>;
|
|
18
|
+
onAdded: () => void;
|
|
19
|
+
/** Keep a pre-registered OAuth client (and secret) for sign-in. */
|
|
20
|
+
saveOAuthClient: (name: string, clientId: string, secret?: string) => Promise<void>;
|
|
21
|
+
/** Load the saved change into open windows: this one's result, and how many others took it. */
|
|
22
|
+
sync: (name: string) => Promise<{
|
|
23
|
+
here: McpServerChange | null;
|
|
24
|
+
others: number;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
export interface McpShellOutcome {
|
|
28
|
+
exitCode: number;
|
|
29
|
+
/** Output with error lines wrapped in the stderr marks, like a shell run. */
|
|
30
|
+
output: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function runMcpShellCommand(command: string, deps: McpShellDeps): Promise<McpShellOutcome>;
|
|
33
|
+
/** The command as saved and shown to the agent: env, header and client-secret values hidden. */
|
|
34
|
+
export declare function maskMcpCommand(command: string): string;
|
|
35
|
+
/** Run one `!… mcp …` line for a window and finish it like any other command. */
|
|
36
|
+
export declare function runMcpShell(ctx: SessionRouteContext, runId: string, command: string, finish: (ctx: SessionRouteContext, run: ShellRunEnd) => void): Promise<void>;
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { environmentSecrets, redactText } from "@kenkaiiii/gg-ai";
|
|
2
|
+
import { log } from "../core/logger.js";
|
|
3
|
+
import { addServer, getServer, removeServer, globalMcpPath, projectMcpPath, parseMcpAddCommand, McpOAuthStore, } from "../core/mcp/index.js";
|
|
4
|
+
import { splitMcpCommandLine } from "../core/mcp/parse-add-command.js";
|
|
5
|
+
import { buildMcpRows, mcpRowSummary, probeMcp } from "./mcp-rows.js";
|
|
6
|
+
import { STDERR_END, STDERR_START, reopenStderr, stripStderrMarks, tailOutput, } from "./shell-runs.js";
|
|
7
|
+
/**
|
|
8
|
+
* `!claude mcp …` / `!ggcoder mcp …` typed in the app's input. Handled here
|
|
9
|
+
* instead of in a shell so the line pasted from an MCP server's docs manages
|
|
10
|
+
* GG Coder's own servers (the same files as the MCP modal), not Claude Code's.
|
|
11
|
+
*/
|
|
12
|
+
export function isMcpShellCommand(command) {
|
|
13
|
+
const line = splitMcpCommandLine(command);
|
|
14
|
+
return line.ok && line.value.prefixed;
|
|
15
|
+
}
|
|
16
|
+
class Output {
|
|
17
|
+
text = "";
|
|
18
|
+
line(s = "") {
|
|
19
|
+
this.text += `${s}\n`;
|
|
20
|
+
}
|
|
21
|
+
error(s) {
|
|
22
|
+
this.text += `${STDERR_START}${s}\n${STDERR_END}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const HELP = `Manage GG Coder's MCP servers (same grammar as \`claude mcp\`):
|
|
26
|
+
|
|
27
|
+
claude mcp add [--transport http|sse] <name> <url> [--header "K: V"]…
|
|
28
|
+
claude mcp add [--env K=V]… <name> -- <command> [args…]
|
|
29
|
+
claude mcp add-json <name> '<json>'
|
|
30
|
+
claude mcp list
|
|
31
|
+
claude mcp get <name>
|
|
32
|
+
claude mcp remove <name> [--scope local|user]
|
|
33
|
+
|
|
34
|
+
Scopes (--scope):
|
|
35
|
+
local / project .gg/mcp.json in this project (default)
|
|
36
|
+
user / global ~/.gg/mcp.json, for every project
|
|
37
|
+
|
|
38
|
+
\`ggcoder mcp …\` works the same. To run Claude Code's own CLI instead, use
|
|
39
|
+
\`!command claude mcp …\`.`;
|
|
40
|
+
function scopeFile(scope, cwd) {
|
|
41
|
+
return scope === "global" ? globalMcpPath() : projectMcpPath(cwd);
|
|
42
|
+
}
|
|
43
|
+
function scopeFlag(args) {
|
|
44
|
+
const rest = [];
|
|
45
|
+
let scope;
|
|
46
|
+
for (let i = 0; i < args.length; i++) {
|
|
47
|
+
const arg = args[i];
|
|
48
|
+
if (arg !== "--scope" && arg !== "-s") {
|
|
49
|
+
rest.push(arg);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const value = args[++i]?.toLowerCase();
|
|
53
|
+
if (value === "user" || value === "global")
|
|
54
|
+
scope = "global";
|
|
55
|
+
else if (value === "local" || value === "project")
|
|
56
|
+
scope = "project";
|
|
57
|
+
else
|
|
58
|
+
return { rest, error: `Unknown scope "${value ?? ""}". Use local or user.` };
|
|
59
|
+
}
|
|
60
|
+
return { scope, rest };
|
|
61
|
+
}
|
|
62
|
+
function mask(value) {
|
|
63
|
+
return value.length <= 8 ? "••••" : `${value.slice(0, 4)}…${value.slice(-4)}`;
|
|
64
|
+
}
|
|
65
|
+
function describeConfig(config, out) {
|
|
66
|
+
if (config.url) {
|
|
67
|
+
out.line(` transport: ${config.transport ?? "http"}`);
|
|
68
|
+
out.line(` url: ${config.url}`);
|
|
69
|
+
for (const [k, v] of Object.entries(config.headers ?? {})) {
|
|
70
|
+
out.line(` header: ${k}: ${mask(v)}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
out.line(" transport: stdio");
|
|
75
|
+
out.line(` command: ${mcpRowSummary(config)}`);
|
|
76
|
+
for (const [k, v] of Object.entries(config.env ?? {})) {
|
|
77
|
+
out.line(` env: ${k}=${mask(v)}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (config.timeout)
|
|
81
|
+
out.line(` timeout: ${config.timeout}`);
|
|
82
|
+
}
|
|
83
|
+
async function add(command, deps, out) {
|
|
84
|
+
const parsed = parseMcpAddCommand(command);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
out.error(`✗ ${parsed.error}`);
|
|
87
|
+
return 1;
|
|
88
|
+
}
|
|
89
|
+
const { config } = parsed.value;
|
|
90
|
+
// Claude Code's default scope ("local") is this project only.
|
|
91
|
+
const scope = parsed.value.scope ?? "project";
|
|
92
|
+
const saved = await addServer(config, scope, deps.cwd);
|
|
93
|
+
if (!saved.ok) {
|
|
94
|
+
out.error(`✗ ${saved.error}`);
|
|
95
|
+
return 1;
|
|
96
|
+
}
|
|
97
|
+
if (scope === "project")
|
|
98
|
+
await deps.trustProject(deps.cwd);
|
|
99
|
+
if (config.oauth?.clientId) {
|
|
100
|
+
await deps.saveOAuthClient(config.name, config.oauth.clientId, parsed.value.clientSecret);
|
|
101
|
+
}
|
|
102
|
+
deps.onAdded();
|
|
103
|
+
out.line(`✓ Added "${config.name}" to ${scope} scope (${scopeFile(scope, deps.cwd)})`);
|
|
104
|
+
const live = await deps.sync(config.name);
|
|
105
|
+
// This window doesn't load MCP (or already had it): still report reachability.
|
|
106
|
+
const status = live.here ?? (await deps.probe(config));
|
|
107
|
+
const tools = `${status.toolCount} tool${status.toolCount === 1 ? "" : "s"}`;
|
|
108
|
+
if (live.here?.connected) {
|
|
109
|
+
out.line(` Connected — ${tools}, loaded into this session. GG can use them now.`);
|
|
110
|
+
}
|
|
111
|
+
else if (!live.here && "ok" in status && status.ok) {
|
|
112
|
+
out.line(` Connected — ${tools}.`);
|
|
113
|
+
}
|
|
114
|
+
else if (status.requiresAuth) {
|
|
115
|
+
out.line(' Needs sign-in: open the MCP panel and click "Sign in".');
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
out.error(` Could not connect: ${status.error ?? "unknown error"} (saved anyway)`);
|
|
119
|
+
}
|
|
120
|
+
if (live.others > 0) {
|
|
121
|
+
out.line(` Also loaded in ${live.others} other open window${live.others === 1 ? "" : "s"}.`);
|
|
122
|
+
}
|
|
123
|
+
return 0;
|
|
124
|
+
}
|
|
125
|
+
async function list(deps, out) {
|
|
126
|
+
const rows = await deps.listRows(deps.cwd);
|
|
127
|
+
if (rows.length === 0) {
|
|
128
|
+
out.line("No MCP servers configured. Add one with `claude mcp add …`.");
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
for (const row of rows) {
|
|
132
|
+
const status = row.ok
|
|
133
|
+
? `✓ ${row.toolCount} tool${row.toolCount === 1 ? "" : "s"}`
|
|
134
|
+
: row.requiresAuth
|
|
135
|
+
? "needs sign-in"
|
|
136
|
+
: `✗ ${row.error ?? "failed"}`;
|
|
137
|
+
out.line(`${row.name} (${row.scope}) ${status}`);
|
|
138
|
+
out.line(` ${row.summary}`);
|
|
139
|
+
if (row.warning)
|
|
140
|
+
out.error(` ⚠ ${row.warning.split("\n").join("\n ⚠ ")}`);
|
|
141
|
+
}
|
|
142
|
+
return 0;
|
|
143
|
+
}
|
|
144
|
+
async function get(args, deps, out) {
|
|
145
|
+
const name = args[0];
|
|
146
|
+
if (!name) {
|
|
147
|
+
out.error("Usage: claude mcp get <name>");
|
|
148
|
+
return 1;
|
|
149
|
+
}
|
|
150
|
+
const found = await getServer(name, deps.cwd);
|
|
151
|
+
if (!found) {
|
|
152
|
+
out.error(`No server named "${name}".`);
|
|
153
|
+
return 1;
|
|
154
|
+
}
|
|
155
|
+
out.line(`${found.config.name} (${found.scope})`);
|
|
156
|
+
describeConfig(found.config, out);
|
|
157
|
+
return 0;
|
|
158
|
+
}
|
|
159
|
+
async function remove(args, deps, out) {
|
|
160
|
+
const flags = scopeFlag(args);
|
|
161
|
+
if (flags.error) {
|
|
162
|
+
out.error(flags.error);
|
|
163
|
+
return 1;
|
|
164
|
+
}
|
|
165
|
+
const name = flags.rest.find((a) => !a.startsWith("-"));
|
|
166
|
+
if (!name) {
|
|
167
|
+
out.error("Usage: claude mcp remove <name> [--scope local|user]");
|
|
168
|
+
return 1;
|
|
169
|
+
}
|
|
170
|
+
const scope = flags.scope ?? (await getServer(name, deps.cwd))?.scope;
|
|
171
|
+
if (!scope || !(await removeServer(name, scope, deps.cwd))) {
|
|
172
|
+
out.error(`No server named "${name}"${flags.scope ? ` in ${flags.scope} scope` : ""}.`);
|
|
173
|
+
return 1;
|
|
174
|
+
}
|
|
175
|
+
// A re-add should start a fresh sign-in.
|
|
176
|
+
await deps.clearOAuth(name).catch(() => { });
|
|
177
|
+
out.line(`✓ Removed "${name}" from ${scope} scope (${scopeFile(scope, deps.cwd)})`);
|
|
178
|
+
const live = await deps.sync(name);
|
|
179
|
+
if (live.here?.removed)
|
|
180
|
+
out.line(" Unloaded from this session.");
|
|
181
|
+
else if (live.here?.connected)
|
|
182
|
+
out.line(" This session now uses the other scope's entry.");
|
|
183
|
+
return 0;
|
|
184
|
+
}
|
|
185
|
+
export async function runMcpShellCommand(command, deps) {
|
|
186
|
+
const out = new Output();
|
|
187
|
+
const line = splitMcpCommandLine(command);
|
|
188
|
+
if (!line.ok) {
|
|
189
|
+
out.error(line.error);
|
|
190
|
+
return { exitCode: 1, output: out.text };
|
|
191
|
+
}
|
|
192
|
+
const [sub, ...args] = line.value.args;
|
|
193
|
+
let exitCode;
|
|
194
|
+
switch (sub) {
|
|
195
|
+
case undefined:
|
|
196
|
+
case "help":
|
|
197
|
+
case "--help":
|
|
198
|
+
case "-h":
|
|
199
|
+
out.line(HELP);
|
|
200
|
+
exitCode = 0;
|
|
201
|
+
break;
|
|
202
|
+
case "add":
|
|
203
|
+
case "add-json":
|
|
204
|
+
exitCode = await add(command, deps, out);
|
|
205
|
+
break;
|
|
206
|
+
case "list":
|
|
207
|
+
exitCode = await list(deps, out);
|
|
208
|
+
break;
|
|
209
|
+
case "get":
|
|
210
|
+
exitCode = await get(args, deps, out);
|
|
211
|
+
break;
|
|
212
|
+
case "remove":
|
|
213
|
+
case "rm":
|
|
214
|
+
exitCode = await remove(args, deps, out);
|
|
215
|
+
break;
|
|
216
|
+
default:
|
|
217
|
+
out.error(`"mcp ${sub}" isn't supported here. Use add, add-json, list, get or remove.`);
|
|
218
|
+
exitCode = 1;
|
|
219
|
+
}
|
|
220
|
+
return { exitCode, output: out.text };
|
|
221
|
+
}
|
|
222
|
+
/** The command as saved and shown to the agent: env, header and client-secret values hidden. */
|
|
223
|
+
export function maskMcpCommand(command) {
|
|
224
|
+
const secrets = [];
|
|
225
|
+
const line = splitMcpCommandLine(command);
|
|
226
|
+
if (line.ok) {
|
|
227
|
+
secrets.push(...Object.values(line.value.env));
|
|
228
|
+
const args = line.value.args;
|
|
229
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
230
|
+
const flag = args[i];
|
|
231
|
+
// After `--` it's the server's own command line.
|
|
232
|
+
if (flag === "--")
|
|
233
|
+
break;
|
|
234
|
+
const value = args[i + 1];
|
|
235
|
+
const cut = flag === "--env" || flag === "-e"
|
|
236
|
+
? value.indexOf("=")
|
|
237
|
+
: flag === "--header" || flag === "-H"
|
|
238
|
+
? value.indexOf(":")
|
|
239
|
+
: -1;
|
|
240
|
+
if (cut > 0)
|
|
241
|
+
secrets.push(value.slice(cut + 1).trim());
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const parsed = parseMcpAddCommand(command);
|
|
245
|
+
if (parsed.ok) {
|
|
246
|
+
const { config, clientSecret } = parsed.value;
|
|
247
|
+
secrets.push(...Object.values(config.env ?? {}), ...Object.values(config.headers ?? {}));
|
|
248
|
+
if (clientSecret)
|
|
249
|
+
secrets.push(clientSecret);
|
|
250
|
+
}
|
|
251
|
+
let masked = command;
|
|
252
|
+
// Longest first, so a secret containing another is hidden whole.
|
|
253
|
+
for (const secret of secrets.filter(Boolean).sort((a, b) => b.length - a.length)) {
|
|
254
|
+
masked = masked.split(secret).join("••••");
|
|
255
|
+
}
|
|
256
|
+
return redactText(masked);
|
|
257
|
+
}
|
|
258
|
+
/** Run one `!… mcp …` line for a window and finish it like any other command. */
|
|
259
|
+
export async function runMcpShell(ctx, runId, command, finish) {
|
|
260
|
+
const startedAt = Date.now();
|
|
261
|
+
let outcome;
|
|
262
|
+
try {
|
|
263
|
+
outcome = await runMcpShellCommand(command, {
|
|
264
|
+
cwd: ctx.cwd,
|
|
265
|
+
listRows: (cwd) => buildMcpRows(cwd, ctx.paths.settingsFile),
|
|
266
|
+
probe: probeMcp,
|
|
267
|
+
clearOAuth: (name) => new McpOAuthStore().clear(name),
|
|
268
|
+
saveOAuthClient: (name, clientId, secret) => new McpOAuthStore().setClient(name, clientId, secret),
|
|
269
|
+
trustProject: (cwd) => ctx.session.trustProject(cwd),
|
|
270
|
+
onAdded: () => void ctx.trophies.count("mcpServersAdded", ctx.sessionId),
|
|
271
|
+
sync: async (name) => {
|
|
272
|
+
const all = await ctx.syncMcpServer(name);
|
|
273
|
+
const others = [...all].filter(([id, change]) => id !== ctx.sessionId && change).length;
|
|
274
|
+
return { here: all.get(ctx.sessionId) ?? null, others };
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
catch (err) {
|
|
279
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
280
|
+
log("WARN", "app-sidecar", "mcp shell command failed", { message });
|
|
281
|
+
outcome = { exitCode: 1, output: `${STDERR_START}${message}\n${STDERR_END}` };
|
|
282
|
+
}
|
|
283
|
+
const display = redactText(outcome.output, { secrets: environmentSecrets(process.env) });
|
|
284
|
+
if (display)
|
|
285
|
+
ctx.broadcast("shell_output", { id: runId, chunk: display });
|
|
286
|
+
const cut = tailOutput(reopenStderr(display));
|
|
287
|
+
const displayTail = reopenStderr(cut.text);
|
|
288
|
+
finish(ctx, {
|
|
289
|
+
runId,
|
|
290
|
+
command: maskMcpCommand(command),
|
|
291
|
+
cwd: ctx.cwd,
|
|
292
|
+
exitCode: outcome.exitCode,
|
|
293
|
+
signal: null,
|
|
294
|
+
durationMs: Math.max(0, Date.now() - startedAt),
|
|
295
|
+
cancelled: false,
|
|
296
|
+
tail: stripStderrMarks(displayTail).replace(/\s+$/, ""),
|
|
297
|
+
displayTail,
|
|
298
|
+
tailTruncated: cut.truncated,
|
|
299
|
+
displayTruncated: false,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=mcp-shell-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-shell-command.js","sourceRoot":"","sources":["../../src/app-sidecar/mcp-shell-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAE,GAAG,E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AAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACzF,IAAI,OAAO;QAAE,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAC1E,MAAM,GAAG,GAAG,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,GAAG,EAAE;QACV,KAAK;QACL,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC;QAChC,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QAC/C,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QACvD,WAAW;QACX,aAAa,EAAE,GAAG,CAAC,SAAS;QAC5B,gBAAgB,EAAE,KAAK;KACxB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AgentSession, McpServerChange } from "../core/agent-session.js";
|
|
2
|
+
import { type MCPServerConfig } from "../core/mcp/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* One server's config as a session in `cwd` would load it at startup:
|
|
5
|
+
* project scope wins over global, and project servers count only when the
|
|
6
|
+
* project is trusted (same rule as getAllMcpServers).
|
|
7
|
+
*/
|
|
8
|
+
export declare function effectiveMcpServer(name: string, cwd: string, settingsFile: string): Promise<MCPServerConfig | undefined>;
|
|
9
|
+
/**
|
|
10
|
+
* Bring every open window's session in line with the saved config for one
|
|
11
|
+
* server, so an add/remove takes effect without a restart. Per session id:
|
|
12
|
+
* what changed there, or null when nothing did. Never throws.
|
|
13
|
+
*/
|
|
14
|
+
export declare function syncMcpServerAcross(targets: Iterable<{
|
|
15
|
+
id: string;
|
|
16
|
+
cwd: string;
|
|
17
|
+
session: AgentSession;
|
|
18
|
+
}>, name: string, settingsFile: string): Promise<Map<string, McpServerChange | null>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { loadSavedSettings, projectScopeAllowed } from "../config.js";
|
|
2
|
+
import { log } from "../core/logger.js";
|
|
3
|
+
import { loadServers } from "../core/mcp/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* One server's config as a session in `cwd` would load it at startup:
|
|
6
|
+
* project scope wins over global, and project servers count only when the
|
|
7
|
+
* project is trusted (same rule as getAllMcpServers).
|
|
8
|
+
*/
|
|
9
|
+
export async function effectiveMcpServer(name, cwd, settingsFile) {
|
|
10
|
+
const settings = loadSavedSettings(settingsFile);
|
|
11
|
+
const allowProject = projectScopeAllowed(settings.trustProjectMcpServers, settings.trustedProjects, cwd);
|
|
12
|
+
const scoped = await loadServers(cwd);
|
|
13
|
+
return scoped.find((s) => s.config.name === name && (allowProject || s.scope !== "project"))
|
|
14
|
+
?.config;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Bring every open window's session in line with the saved config for one
|
|
18
|
+
* server, so an add/remove takes effect without a restart. Per session id:
|
|
19
|
+
* what changed there, or null when nothing did. Never throws.
|
|
20
|
+
*/
|
|
21
|
+
export async function syncMcpServerAcross(targets, name, settingsFile) {
|
|
22
|
+
const results = new Map();
|
|
23
|
+
await Promise.all([...targets].map(async (target) => {
|
|
24
|
+
try {
|
|
25
|
+
const config = await effectiveMcpServer(name, target.cwd, settingsFile);
|
|
26
|
+
results.set(target.id, await target.session.applyMcpServerChange(name, config));
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
log("WARN", "app-sidecar", "mcp live sync failed", {
|
|
30
|
+
name,
|
|
31
|
+
message: err instanceof Error ? err.message : String(err),
|
|
32
|
+
});
|
|
33
|
+
results.set(target.id, null);
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
return results;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=mcp-sync.js.map
|