Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions electron/azureDevops.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ async function mergePr(cwd, remote, id) {

module.exports = {
kind: "azure-devops",
az,
parseRemote,
prInfoFromPr,
viewPr,
Expand Down
1 change: 1 addition & 0 deletions electron/bitbucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ module.exports = {
kind: "bitbucket",
parseRemote,
authHeader,
bbApi,
prInfoFromPr,
viewPr,
viewPrByNumber,
Expand Down
1 change: 1 addition & 0 deletions electron/gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ async function createIssue(cwd, remote, title, body) {
}

module.exports = {
glabBin,
gitlabRemote,
glabApi,
prListItemFromMr,
Expand Down
8 changes: 7 additions & 1 deletion electron/ipc-git.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const {
gcClean,
} = require("./worktrees.js");
const { suggestCommitMessage, suggestPrText } = require("./commitmsg.js");
const { publishRepo } = require("./publish.js");
const {
claimLane,
listLanes,
Expand Down Expand Up @@ -477,11 +478,16 @@ module.exports = {
if (!project || project.remoteHost) return { ok: false };
const root = thread.worktreePath || project.path;
if (!root) return { ok: false };
return await services.gitRepoInfo(root);
const info = await services.gitRepoInfo(root);
// Worktree folders are thread ids; name the new repo after the project checkout.
if (info.noOrigin) info.suggestedName = require("node:path").basename(project.path || root);
return info;
} catch {
return { ok: false };
}
},
"git:publish": async (ctx, input) =>
publishRepo({ ...input, store: ctx.store, broadcast: ctx.broadcast }),
"git:pull": async (ctx, input) => {
// Never throws: failure modes come back in-band as { ok: false, reason }.
try {
Expand Down
38 changes: 38 additions & 0 deletions electron/memory-sup.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,43 @@ function kimiMcpServersForRun(opts = {}) {
return mcpServers;
}

/**
* Solenta MCP servers for one opencode serve turn, as the `mcp` block of
* OPENCODE_CONFIG_CONTENT (#451). That layer merges over the user's own
* opencode config, so their servers stay; nothing is written to disk.
* Shapes from the 1.17.12 /doc McpRemoteConfig / McpLocalConfig schemas.
*
* @param {{ projectId?: string, projectPath?: string, threadId?: string }} [opts]
* @returns {{ mcp: Record<string, object> }}
*/
function opencodeMcpConfigForRun(opts = {}) {
/** @type {Record<string, object>} */
const mcp = {};
for (const s of activeServers()) {
if (isStdioServer(s)) {
/** @type {Record<string, unknown>} */
const entry = {
type: "local",
command: [s.command, ...(Array.isArray(s.args) ? s.args : [])],
environment: s.env && typeof s.env === "object" ? { ...s.env } : {},
};
if (typeof s.cwd === "string" && s.cwd) entry.cwd = s.cwd;
mcp[s.name] = entry;
continue;
}
const headers = { ...(s.headers && typeof s.headers === "object" ? s.headers : {}) };
if (s.token) headers.Authorization = `Bearer ${s.token}`;
mcp[s.name] = {
type: "remote",
url: boundSolentaMcpUrl(s.url, s.name, opts),
headers,
// A bearer server must not trip opencode's OAuth auto-detection.
...(s.token ? { oauth: false } : {}),
};
}
return { mcp };
}

/**
* When at least one MCP server is up and kimi binary is available, MERGE our
* servers into kimi's mcp.json (never overwrite whole file). Backup once
Expand Down Expand Up @@ -2045,6 +2082,7 @@ module.exports = {
mergeGrokSpawnEnv,
ensureKimiMcpConfig,
kimiMcpServersForRun,
opencodeMcpConfigForRun,
withQuery,
boundSolentaMcpUrl,
ensureGrokMcpConfig,
Expand Down
Loading
Loading