@kenkaiiii/ggcoder 5.98.1 → 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 +26 -28
- 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/extensions/plugin-bundles.d.ts +0 -9
- package/dist/core/extensions/plugin-bundles.js +0 -185
- package/dist/core/extensions/plugin-bundles.js.map +1 -1
- package/dist/core/goals-store.d.ts +0 -2
- package/dist/core/goals-store.js +0 -5
- package/dist/core/goals-store.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/package-cooldown.d.ts +0 -2
- package/dist/core/package-cooldown.js +0 -4
- package/dist/core/package-cooldown.js.map +1 -1
- package/dist/core/runtime-mode.d.ts +0 -5
- package/dist/core/runtime-mode.js.map +1 -1
- package/dist/core/session-storage.d.ts +0 -2
- package/dist/core/session-storage.js +0 -2
- package/dist/core/session-storage.js.map +1 -1
- 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/core/tasks-store.d.ts +0 -1
- package/dist/core/tasks-store.js +0 -3
- package/dist/core/tasks-store.js.map +1 -1
- package/dist/motion-agent/motion-review.d.ts +0 -75
- package/dist/motion-agent/motion-review.js +0 -189
- package/dist/motion-agent/motion-review.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/dist/tools/path-utils.d.ts +0 -15
- package/dist/tools/path-utils.js +0 -17
- package/dist/tools/path-utils.js.map +1 -1
- package/dist/tools/truncate.d.ts +0 -2
- package/dist/tools/truncate.js +0 -2
- package/dist/tools/truncate.js.map +1 -1
- package/dist/ui/app-items.d.ts +0 -2
- package/dist/ui/app-items.js +0 -2
- package/dist/ui/app-items.js.map +1 -1
- package/dist/ui/constants/figures.d.ts +0 -8
- package/dist/ui/constants/figures.js +0 -8
- package/dist/ui/constants/figures.js.map +1 -1
- package/dist/ui/layout-decisions.d.ts +0 -5
- package/dist/ui/layout-decisions.js +1 -10
- package/dist/ui/layout-decisions.js.map +1 -1
- package/dist/ui/terminal-history-status-renderers.d.ts +0 -1
- package/dist/ui/terminal-history-status-renderers.js +0 -11
- package/dist/ui/terminal-history-status-renderers.js.map +1 -1
- package/dist/ui/transcript/presentation.d.ts +1 -2
- package/dist/ui/transcript/presentation.js +0 -4
- package/dist/ui/transcript/presentation.js.map +1 -1
- package/dist/utils/image.d.ts +0 -4
- package/dist/utils/image.js +0 -10
- package/dist/utils/image.js.map +1 -1
- package/package.json +4 -4
- package/dist/motion-agent/motion-review-gate.d.ts +0 -48
- package/dist/motion-agent/motion-review-gate.js +0 -88
- package/dist/motion-agent/motion-review-gate.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-tools.js","sourceRoot":"","sources":["../../../src/core/agent-session/mcp-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAyB,M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S,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC7C,IAAI,IAAI;oBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC7C,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI;oBACjE,EAAE,EAAE,KAAc;oBAClB,KAAK,EAAE,kCAAkC;iBAC1C,CAAC;gBACF,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;oBAChB,OAAO,CACL,YAAY,MAAM,CAAC,IAAI,4BAA4B,UAAU,oBAAoB;wBACjF,IAAI,OAAO,CAAC,KAAK,kDAAkD;wBACnE,4EAA4E,CAC7E,CAAC;gBACJ,CAAC;gBACD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAClD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO,CACL,YAAY,MAAM,CAAC,IAAI,8BAA8B,UAAU,kBAAkB;wBACjF,yDAAyD,CAC1D,CAAC;gBACJ,CAAC;gBACD,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1C,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -11,6 +11,7 @@ import { type BlockedSkill, type Skill } from "./skills.js";
|
|
|
11
11
|
import type { BackgroundProcess } from "./process-manager.js";
|
|
12
12
|
import { type ChildModelPick, type SubAgentSnapshot } from "./subagent-manager.js";
|
|
13
13
|
import type { MCPElicitHandler } from "./mcp/index.js";
|
|
14
|
+
import type { MCPServerConfig } from "./mcp/types.js";
|
|
14
15
|
import { type ContextLimits } from "./context-limits.js";
|
|
15
16
|
import { type ImportForeignTranscriptResult } from "./foreign-session-import.js";
|
|
16
17
|
import { type CacheExpiryStatus } from "./cache-expiry.js";
|
|
@@ -51,6 +52,15 @@ export declare class PaidModelConfirmationError extends Error {
|
|
|
51
52
|
/** A chat attachment (image / video / other file) prepared for the model. The
|
|
52
53
|
* raw base64 `data` rides native blocks; `path` (when persisted to disk) lets
|
|
53
54
|
* the agent's tools open the file directly. */
|
|
55
|
+
/** What applying one MCP config change did in a session. */
|
|
56
|
+
export interface McpServerChange {
|
|
57
|
+
name: string;
|
|
58
|
+
removed: boolean;
|
|
59
|
+
connected: boolean;
|
|
60
|
+
toolCount: number;
|
|
61
|
+
error?: string;
|
|
62
|
+
requiresAuth?: boolean;
|
|
63
|
+
}
|
|
54
64
|
export interface SessionAttachment {
|
|
55
65
|
kind: "image" | "video" | "file";
|
|
56
66
|
mediaType: string;
|
|
@@ -520,6 +530,8 @@ export declare class AgentSession {
|
|
|
520
530
|
*/
|
|
521
531
|
/** Commands the user ran themselves, held until their next message. */
|
|
522
532
|
private pendingUserShell;
|
|
533
|
+
/** MCP servers the user added or removed mid-session, not yet told to the model. */
|
|
534
|
+
private pendingMcpNotices;
|
|
523
535
|
private persistedTranscriptCount;
|
|
524
536
|
/** Current leaf entry ID in the session DAG — used to chain parentIds for branching. */
|
|
525
537
|
private currentLeafId;
|
|
@@ -556,6 +568,18 @@ export declare class AgentSession {
|
|
|
556
568
|
* turn, so background-connected servers become available on the next prompt.
|
|
557
569
|
*/
|
|
558
570
|
private connectMcpServers;
|
|
571
|
+
/**
|
|
572
|
+
* The user added, changed or removed one MCP server mid-session: connect,
|
|
573
|
+
* reconnect or drop just that server, without a restart. `config` is its
|
|
574
|
+
* current effective config, or undefined when it is gone (or not allowed).
|
|
575
|
+
*
|
|
576
|
+
* Append-only for the prompt cache: new tools go into the tool_search
|
|
577
|
+
* catalog (or are appended when deferral is off), and the model learns about
|
|
578
|
+
* the change from a hidden note with the next message, never from a
|
|
579
|
+
* re-rendered system prompt. Returns null when nothing changed here.
|
|
580
|
+
*/
|
|
581
|
+
applyMcpServerChange(name: string, config: MCPServerConfig | undefined): Promise<McpServerChange | null>;
|
|
582
|
+
private takeMcpNotice;
|
|
559
583
|
/** Persist `cwd` as a trusted project for project-scope MCP. Called by the
|
|
560
584
|
* sidecar's `/mcp/add` handler when a user adds a project-scope server via
|
|
561
585
|
* the MCP modal — the explicit add is itself the trust signal. The next
|
|
@@ -441,6 +441,8 @@ export class AgentSession {
|
|
|
441
441
|
*/
|
|
442
442
|
/** Commands the user ran themselves, held until their next message. */
|
|
443
443
|
pendingUserShell = [];
|
|
444
|
+
/** MCP servers the user added or removed mid-session, not yet told to the model. */
|
|
445
|
+
pendingMcpNotices = [];
|
|
444
446
|
persistedTranscriptCount() {
|
|
445
447
|
return this.messages.slice(0, this.lastPersistedIndex).filter((m) => m.role !== "system")
|
|
446
448
|
.length;
|
|
@@ -874,7 +876,9 @@ export class AgentSession {
|
|
|
874
876
|
// empty catalog and tool_search would answer "the catalog is empty" for
|
|
875
877
|
// capabilities that genuinely exist — a wrong answer, not a slow one.
|
|
876
878
|
await this.seedMcpCatalogFromCache(servers);
|
|
877
|
-
const
|
|
879
|
+
const results = await mcpManager.connectAllDetailed(servers);
|
|
880
|
+
this.mcp.recordServers(servers, results);
|
|
881
|
+
const connected = results.flatMap((r) => r.tools);
|
|
878
882
|
// Defense-in-depth: even from a whitelisted server, only push tools that
|
|
879
883
|
// pass the allow-list (no-op when there's no allow-list).
|
|
880
884
|
const mcpTools = this.opts.allowedTools
|
|
@@ -900,6 +904,80 @@ export class AgentSession {
|
|
|
900
904
|
log("WARN", "mcp", `MCP initialization failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
901
905
|
}
|
|
902
906
|
}
|
|
907
|
+
/**
|
|
908
|
+
* The user added, changed or removed one MCP server mid-session: connect,
|
|
909
|
+
* reconnect or drop just that server, without a restart. `config` is its
|
|
910
|
+
* current effective config, or undefined when it is gone (or not allowed).
|
|
911
|
+
*
|
|
912
|
+
* Append-only for the prompt cache: new tools go into the tool_search
|
|
913
|
+
* catalog (or are appended when deferral is off), and the model learns about
|
|
914
|
+
* the change from a hidden note with the next message, never from a
|
|
915
|
+
* re-rendered system prompt. Returns null when nothing changed here.
|
|
916
|
+
*/
|
|
917
|
+
async applyMcpServerChange(name, config) {
|
|
918
|
+
const manager = this.mcp.manager;
|
|
919
|
+
if (!manager)
|
|
920
|
+
return null;
|
|
921
|
+
const whitelist = this.opts.allowedMcpServers;
|
|
922
|
+
if (this.opts.allowedTools && !whitelist?.includes(name))
|
|
923
|
+
return null;
|
|
924
|
+
const wanted = config && config.enabled !== false ? config : undefined;
|
|
925
|
+
const previous = this.mcp.serverState(name);
|
|
926
|
+
// Same config still connected: nothing to do. Same config that failed
|
|
927
|
+
// (e.g. before an OAuth sign-in) is retried.
|
|
928
|
+
if (wanted && previous?.ok && previous.config === JSON.stringify(wanted))
|
|
929
|
+
return null;
|
|
930
|
+
if (!wanted && !previous)
|
|
931
|
+
return null;
|
|
932
|
+
if (previous) {
|
|
933
|
+
await manager.disconnect(name);
|
|
934
|
+
this.mcp.removeServer(name);
|
|
935
|
+
}
|
|
936
|
+
if (!wanted) {
|
|
937
|
+
this.pendingMcpNotices.push(`- MCP server "${name}" was removed by the user. Its mcp__${name}__* tools no longer work; don't call them.`);
|
|
938
|
+
log("INFO", "mcp", `Removed MCP server "${name}" mid-session`);
|
|
939
|
+
return { name, removed: true, connected: false, toolCount: 0 };
|
|
940
|
+
}
|
|
941
|
+
const [result] = await manager.connectAllDetailed([wanted]);
|
|
942
|
+
const ok = result?.ok ?? false;
|
|
943
|
+
this.mcp.recordServers([wanted], result ? [result] : []);
|
|
944
|
+
const tools = (result?.tools ?? []).filter((t) => !this.opts.allowedTools || this.isToolAllowed(t.name));
|
|
945
|
+
this.addMcpTools(tools);
|
|
946
|
+
if (ok) {
|
|
947
|
+
const deferred = !this.opts.allowedTools && this.settingsManager.get("deferredMcpTools");
|
|
948
|
+
const names = tools.map((t) => t.name);
|
|
949
|
+
const shown = names.slice(0, 20).join(", ") + (names.length > 20 ? ", …" : "");
|
|
950
|
+
this.pendingMcpNotices.push(`- The user connected MCP server "${name}" with ${tools.length} tool${tools.length === 1 ? "" : "s"}` +
|
|
951
|
+
(names.length > 0 ? `: ${shown}.` : ".") +
|
|
952
|
+
(deferred
|
|
953
|
+
? " Load them with tool_search (e.g. by capability or the server name) when they help."
|
|
954
|
+
: " They are in your tool list now."));
|
|
955
|
+
}
|
|
956
|
+
log("INFO", "mcp", `Applied MCP server "${name}" mid-session`, {
|
|
957
|
+
ok: String(ok),
|
|
958
|
+
tools: String(tools.length),
|
|
959
|
+
});
|
|
960
|
+
return {
|
|
961
|
+
name,
|
|
962
|
+
removed: false,
|
|
963
|
+
connected: ok,
|
|
964
|
+
toolCount: tools.length,
|
|
965
|
+
...(result?.error ? { error: result.error } : {}),
|
|
966
|
+
...(result?.requiresAuth ? { requiresAuth: true } : {}),
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
takeMcpNotice() {
|
|
970
|
+
if (this.pendingMcpNotices.length === 0)
|
|
971
|
+
return null;
|
|
972
|
+
const lines = this.pendingMcpNotices.splice(0);
|
|
973
|
+
return {
|
|
974
|
+
role: "user",
|
|
975
|
+
provenance: { source: "runtime", kind: "notification", visibility: "hidden" },
|
|
976
|
+
content: "MCP update. The user changed MCP servers during this session:\n" +
|
|
977
|
+
lines.join("\n") +
|
|
978
|
+
"\nTrust this over anything earlier that disagrees. Do not restate this note; just proceed.",
|
|
979
|
+
};
|
|
980
|
+
}
|
|
903
981
|
/** Persist `cwd` as a trusted project for project-scope MCP. Called by the
|
|
904
982
|
* sidecar's `/mcp/add` handler when a user adds a project-scope server via
|
|
905
983
|
* the MCP modal — the explicit add is itself the trust signal. The next
|
|
@@ -1702,6 +1780,7 @@ export class AgentSession {
|
|
|
1702
1780
|
if (planNotice) {
|
|
1703
1781
|
log("INFO", "session", "Injecting plan state update instead of rebuilding the prompt");
|
|
1704
1782
|
}
|
|
1783
|
+
const mcpNotice = this.takeMcpNotice();
|
|
1705
1784
|
if (environmentDelta) {
|
|
1706
1785
|
// The model has now been told; only a further change re-triggers this.
|
|
1707
1786
|
this.renderedEnvironment = this.promptEnvironment();
|
|
@@ -1773,15 +1852,17 @@ export class AgentSession {
|
|
|
1773
1852
|
return [
|
|
1774
1853
|
...(environmentDelta ? [environmentDelta] : []),
|
|
1775
1854
|
...(planNotice ? [planNotice] : []),
|
|
1855
|
+
...(mcpNotice ? [mcpNotice] : []),
|
|
1776
1856
|
...(userShell ? [userShell] : []),
|
|
1777
1857
|
...steeringMessages,
|
|
1778
1858
|
...(notificationMessage ? [notificationMessage] : []),
|
|
1779
1859
|
];
|
|
1780
1860
|
}
|
|
1781
|
-
if (environmentDelta || planNotice || notificationMessage) {
|
|
1861
|
+
if (environmentDelta || planNotice || mcpNotice || notificationMessage) {
|
|
1782
1862
|
return [
|
|
1783
1863
|
...(environmentDelta ? [environmentDelta] : []),
|
|
1784
1864
|
...(planNotice ? [planNotice] : []),
|
|
1865
|
+
...(mcpNotice ? [mcpNotice] : []),
|
|
1785
1866
|
...(notificationMessage ? [notificationMessage] : []),
|
|
1786
1867
|
];
|
|
1787
1868
|
}
|
|
@@ -2695,11 +2776,13 @@ export class AgentSession {
|
|
|
2695
2776
|
const servers = await getAllMcpServers(this.provider, apiKey, this.cwd, {
|
|
2696
2777
|
allowProjectScope: this.settingsManager.isProjectTrusted(this.cwd),
|
|
2697
2778
|
});
|
|
2698
|
-
const
|
|
2779
|
+
const results = await mcpManager.connectAllDetailed(servers);
|
|
2780
|
+
const mcpTools = results.flatMap((r) => r.tools);
|
|
2699
2781
|
// Drop stale MCP tools from both the live set and deferred catalog before
|
|
2700
2782
|
// re-adding. Some tools may already have been promoted out of the catalog.
|
|
2701
2783
|
this.tools = this.tools.filter((t) => !t.name.startsWith("mcp__"));
|
|
2702
2784
|
this.mcp.clearMcpTools();
|
|
2785
|
+
this.mcp.recordServers(servers, results);
|
|
2703
2786
|
this.addMcpTools(mcpTools);
|
|
2704
2787
|
}
|
|
2705
2788
|
catch (err) {
|
|
@@ -3906,6 +3989,12 @@ export class AgentSession {
|
|
|
3906
3989
|
* update is saved in order with the rest of the conversation.
|
|
3907
3990
|
*/
|
|
3908
3991
|
async announceNewLanguages() {
|
|
3992
|
+
const mcpNotice = this.takeMcpNotice();
|
|
3993
|
+
if (mcpNotice) {
|
|
3994
|
+
this.messages.push(mcpNotice);
|
|
3995
|
+
await this.persistMessage(mcpNotice);
|
|
3996
|
+
this.lastPersistedIndex = this.messages.length;
|
|
3997
|
+
}
|
|
3909
3998
|
const planNotice = this.takePlanNotice();
|
|
3910
3999
|
if (planNotice) {
|
|
3911
4000
|
this.messages.push(planNotice);
|