@cmmd-center/forge 0.13.37 → 0.13.39

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/bin.cjs CHANGED
@@ -22730,6 +22730,7 @@ const ServerSettings = require_Schema$1.Struct({
22730
22730
  }))),
22731
22731
  coauthorIncludeForge: require_Schema$1.Boolean.pipe(require_Schema$1.withDecodingDefault(require_Schema$1.succeed(true))),
22732
22732
  githubWriteIdentity: GithubWriteIdentity.pipe(require_Schema$1.withDecodingDefault(require_Schema$1.succeed(DEFAULT_GITHUB_WRITE_IDENTITY))),
22733
+ codewebMcp: require_Schema$1.Boolean.pipe(require_Schema$1.withDecodingDefault(require_Schema$1.succeed(false))),
22733
22734
  providers: require_Schema$1.Struct({
22734
22735
  codex: CodexSettings.pipe(require_Schema$1.withDecodingDefault(require_Schema$1.succeed({}))),
22735
22736
  claudeAgent: ClaudeSettings.pipe(require_Schema$1.withDecodingDefault(require_Schema$1.succeed({}))),
@@ -22856,6 +22857,7 @@ const ServerSettingsPatch = require_Schema$1.Struct({
22856
22857
  textGenerationModelSelection: require_Schema$1.optionalKey(ModelSelectionPatch),
22857
22858
  coauthorIncludeForge: require_Schema$1.optionalKey(require_Schema$1.Boolean),
22858
22859
  githubWriteIdentity: require_Schema$1.optionalKey(GithubWriteIdentity),
22860
+ codewebMcp: require_Schema$1.optionalKey(require_Schema$1.Boolean),
22859
22861
  browser: require_Schema$1.optionalKey(BrowserSettingsPatch),
22860
22862
  pluginSkillPermissions: require_Schema$1.optionalKey(PluginSkillPermissions),
22861
22863
  firstAccountSetup: require_Schema$1.optionalKey(FirstAccountSetupStatePatch),
@@ -66241,7 +66243,7 @@ function normalizeNumberish(value) {
66241
66243
  }
66242
66244
  //#endregion
66243
66245
  //#region package.json
66244
- var version$1 = "0.13.37";
66246
+ var version$1 = "0.13.39";
66245
66247
  //#endregion
66246
66248
  //#region src/sentry.ts
66247
66249
  const SERVER_APP_NAME = "forge-server";
@@ -214863,6 +214865,25 @@ function createComputerMcpServer(computerManager, threadId) {
214863
214865
  });
214864
214866
  }
214865
214867
  //#endregion
214868
+ //#region src/codeweb/CodewebMcpServer.ts
214869
+ /**
214870
+ * CodeWeb MCP server identity shared by the gated injection surfaces
214871
+ * (Claude adapter, ACP session runtime).
214872
+ *
214873
+ * ADR-011 (CMMD-Center/CodeWeb): Forge injects CodeWeb's remote MCP server
214874
+ * natively so agents see the CodeWeb `map_*` tools with no repo-local
214875
+ * `.mcp.json`. There is no local server to implement: CodeWeb serves MCP
214876
+ * over HTTP, so this module only carries the identity both injection sites
214877
+ * share. Rollout is gated by `ServerSettings.codewebMcp` (default OFF,
214878
+ * CMMD platform org first). Auth is OAuth/Agent Token (CodeWeb ADR-004);
214879
+ * the ACP entry's `headers` array is the later carry slot for token
214880
+ * minting (forge#3408).
214881
+ *
214882
+ * @module CodewebMcpServer
214883
+ */
214884
+ const CODEWEB_MCP_SERVER_NAME = "codeweb";
214885
+ const CODEWEB_MCP_SERVER_URL = "https://codeweb.cmmd.ai/mcp";
214886
+ //#endregion
214866
214887
  //#region src/cmmdData/cmmdContextMcpServer.ts
214867
214888
  /**
214868
214889
  * CMMD Context MCP server (in-process, read-only).
@@ -215738,7 +215759,11 @@ function buildClaudeMcpServers(input) {
215738
215759
  "cmmd-context": createCmmdContextMcpServer(input.threadId, input.resolveCmmdPat),
215739
215760
  [GITHUB_MCP_SERVER_NAME]: createGitHubMcpServer(input.runBrokeredGitHubTool, input.threadId, input.serverSettings),
215740
215761
  ...input.computerManager ? { [COMPUTER_MCP_SERVER_NAME]: createComputerMcpServer(input.computerManager, input.threadId) } : {},
215741
- ...input.cmmdSidekickTools ? { "cmmd-sidekick-tools": createCmmdSidekickToolsMcpServer(input.cmmdSidekickTools.session, input.cmmdSidekickTools.tools) } : {}
215762
+ ...input.cmmdSidekickTools ? { "cmmd-sidekick-tools": createCmmdSidekickToolsMcpServer(input.cmmdSidekickTools.session, input.cmmdSidekickTools.tools) } : {},
215763
+ ...input.serverSettings.codewebMcp ? { [CODEWEB_MCP_SERVER_NAME]: {
215764
+ type: "http",
215765
+ url: CODEWEB_MCP_SERVER_URL
215766
+ } } : {}
215742
215767
  };
215743
215768
  }
215744
215769
  function claudeQueryWorkingDirectoryOptions(cwd) {
@@ -222831,6 +222856,25 @@ const layerChildProcess = (handle, options = {}) => {
222831
222856
  function formatConfigOptionValue(value) {
222832
222857
  return JSON.stringify(value);
222833
222858
  }
222859
+ /**
222860
+ * Builds the `mcpServers` payload for session/new and session/load.
222861
+ *
222862
+ * CodeWeb (ADR-011) is injected only when the setting is relayed as enabled
222863
+ * AND the agent advertised `mcpCapabilities.http` in initialize (the schema
222864
+ * defaults it to false). Sending an http entry to an agent that cannot
222865
+ * consume it would at best be dropped, at worst error the session, so both
222866
+ * gates must pass; anything else stays an empty payload.
222867
+ */
222868
+ function buildAcpMcpServers(input) {
222869
+ if (!input.codewebMcpEnabled) return [];
222870
+ if (input.agentCapabilities?.mcpCapabilities?.http !== true) return [];
222871
+ return [{
222872
+ type: "http",
222873
+ name: CODEWEB_MCP_SERVER_NAME,
222874
+ url: CODEWEB_MCP_SERVER_URL,
222875
+ headers: []
222876
+ }];
222877
+ }
222834
222878
  var AcpSessionRuntime = class AcpSessionRuntime extends require_Schema$1.Service()("forge/provider/acp/AcpSessionRuntime") {
222835
222879
  static layer(options) {
222836
222880
  return require_Schema$1.effect(AcpSessionRuntime, makeAcpSessionRuntime(options));
@@ -222976,11 +223020,15 @@ const makeAcpSessionRuntime = (options) => require_Schema$1.gen(function* () {
222976
223020
  yield* runLoggedRequest("authenticate", authenticatePayload, acp.agent.authenticate(authenticatePayload));
222977
223021
  let sessionId;
222978
223022
  let sessionSetupResult;
223023
+ const mcpServers = buildAcpMcpServers({
223024
+ codewebMcpEnabled: options.codewebMcp === true,
223025
+ agentCapabilities: initializeResult.agentCapabilities
223026
+ });
222979
223027
  if (options.resumeSessionId) {
222980
223028
  const loadPayload = {
222981
223029
  sessionId: options.resumeSessionId,
222982
223030
  cwd: options.cwd,
222983
- mcpServers: []
223031
+ mcpServers
222984
223032
  };
222985
223033
  const resumed = yield* runLoggedRequest("session/load", loadPayload, acp.agent.loadSession(loadPayload)).pipe(require_Schema$1.exit);
222986
223034
  if (require_Schema$1.isSuccess(resumed)) {
@@ -222989,7 +223037,7 @@ const makeAcpSessionRuntime = (options) => require_Schema$1.gen(function* () {
222989
223037
  } else {
222990
223038
  const createPayload = {
222991
223039
  cwd: options.cwd,
222992
- mcpServers: []
223040
+ mcpServers
222993
223041
  };
222994
223042
  const created = yield* runLoggedRequest("session/new", createPayload, acp.agent.createSession(createPayload));
222995
223043
  sessionId = created.sessionId;
@@ -222998,7 +223046,7 @@ const makeAcpSessionRuntime = (options) => require_Schema$1.gen(function* () {
222998
223046
  } else {
222999
223047
  const createPayload = {
223000
223048
  cwd: options.cwd,
223001
- mcpServers: []
223049
+ mcpServers
223002
223050
  };
223003
223051
  const created = yield* runLoggedRequest("session/new", createPayload, acp.agent.createSession(createPayload));
223004
223052
  sessionId = created.sessionId;
@@ -224015,6 +224063,7 @@ function makeCursorAdapter(cursorSettings, options) {
224015
224063
  const acp = yield* (options?.makeAcpRuntime ?? makeCursorAcpRuntime)({
224016
224064
  cursorSettings: effectiveCursorSettings,
224017
224065
  ...options?.environment ? { environment: options.environment } : {},
224066
+ ...options?.codewebMcp ? { codewebMcp: true } : {},
224018
224067
  childProcessSpawner,
224019
224068
  cwd,
224020
224069
  ...resumeSessionId ? { resumeSessionId } : {},
@@ -224420,9 +224469,11 @@ function makeCursorAdapter(cursorSettings, options) {
224420
224469
  * Resolves CursorSettings from ServerSettingsService at construction time
224421
224470
  * (one adapter instance per ProviderKind). Tests can use makeCursorAdapterLive
224422
224471
  * to inject mock settings or env without going through the settings service.
224472
+ * The same snapshot relays `codewebMcp` down to the ACP runtime options.
224423
224473
  */
224424
224474
  const CursorAdapterLive = require_Schema$1.effect(CursorAdapter, require_Schema$1.gen(function* () {
224425
- return yield* makeCursorAdapter((yield* (yield* ServerSettingsService).getSettings).providers.cursor);
224475
+ const settings = yield* (yield* ServerSettingsService).getSettings;
224476
+ return yield* makeCursorAdapter(settings.providers.cursor, { codewebMcp: settings.codewebMcp });
224426
224477
  }));
224427
224478
  //#endregion
224428
224479
  //#region src/provider/Services/OpenCodeAdapter.ts
@@ -297757,7 +297808,7 @@ function resolveBuildCommitFromEnv(env) {
297757
297808
  * environment descriptor down instead of reporting an honest "unknown".
297758
297809
  */
297759
297810
  function readBakedBuildCommit() {
297760
- return "f3a17e1472afd6c0d4a0f262ea29bfd68c5a63c5";
297811
+ return "415af659079e132a2653535d56e2c464576d48fa";
297761
297812
  }
297762
297813
  async function resolveServerBuildCommit(input) {
297763
297814
  if (isFullCommitSha(input.baked)) return input.baked;
package/dist/bin.mjs CHANGED
@@ -23,7 +23,7 @@ import { createCipheriv, createDecipheriv, createHash, createHmac, createPublicK
23
23
  import * as FS$1 from "node:fs";
24
24
  import fs, { accessSync, chmodSync, constants, createReadStream, existsSync, mkdirSync, mkdtempSync, promises, readFile, readFileSync, readdir, readdirSync, realpathSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
25
25
  import * as NodeOS from "node:os";
26
- import os, { homedir, networkInterfaces, tmpdir } from "node:os";
26
+ import $U, { homedir, networkInterfaces, tmpdir } from "node:os";
27
27
  import * as Path$1 from "node:path";
28
28
  import path, { basename, delimiter, dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
29
29
  import { pathToFileURL } from "node:url";
@@ -22542,6 +22542,7 @@ const ServerSettings = Struct({
22542
22542
  }))),
22543
22543
  coauthorIncludeForge: Boolean$1.pipe(withDecodingDefault(succeed(true))),
22544
22544
  githubWriteIdentity: GithubWriteIdentity.pipe(withDecodingDefault(succeed(DEFAULT_GITHUB_WRITE_IDENTITY))),
22545
+ codewebMcp: Boolean$1.pipe(withDecodingDefault(succeed(false))),
22545
22546
  providers: Struct({
22546
22547
  codex: CodexSettings.pipe(withDecodingDefault(succeed({}))),
22547
22548
  claudeAgent: ClaudeSettings.pipe(withDecodingDefault(succeed({}))),
@@ -22668,6 +22669,7 @@ const ServerSettingsPatch = Struct({
22668
22669
  textGenerationModelSelection: optionalKey(ModelSelectionPatch),
22669
22670
  coauthorIncludeForge: optionalKey(Boolean$1),
22670
22671
  githubWriteIdentity: optionalKey(GithubWriteIdentity),
22672
+ codewebMcp: optionalKey(Boolean$1),
22671
22673
  browser: optionalKey(BrowserSettingsPatch),
22672
22674
  pluginSkillPermissions: optionalKey(PluginSkillPermissions),
22673
22675
  firstAccountSetup: optionalKey(FirstAccountSetupStatePatch),
@@ -50558,7 +50560,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
50558
50560
  const min = forceColor || 0;
50559
50561
  if (env.TERM === "dumb") return min;
50560
50562
  if (process$1.platform === "win32") {
50561
- const osRelease = os.release().split(".");
50563
+ const osRelease = $U.release().split(".");
50562
50564
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
50563
50565
  return 1;
50564
50566
  }
@@ -53001,7 +53003,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
53001
53003
  exports.processDetector = void 0;
53002
53004
  const api_1 = (init_esm$1(), __toCommonJS(esm_exports$1));
53003
53005
  const semconv_1 = require_semconv$1();
53004
- const os$4 = __require("os");
53006
+ const os$3 = __require("os");
53005
53007
  /**
53006
53008
  * ProcessDetector will be used to detect the resources related current process running
53007
53009
  * and being instrumented from the NodeJS Process module.
@@ -53023,7 +53025,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
53023
53025
  };
53024
53026
  if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
53025
53027
  try {
53026
- const userInfo = os$4.userInfo();
53028
+ const userInfo = os$3.userInfo();
53027
53029
  attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username;
53028
53030
  } catch (e) {
53029
53031
  api_1.diag.debug(`error obtaining process owner: ${e}`);
@@ -65946,7 +65948,7 @@ function normalizeNumberish(value) {
65946
65948
  }
65947
65949
  //#endregion
65948
65950
  //#region package.json
65949
- var version$1 = "0.13.37";
65951
+ var version$1 = "0.13.39";
65950
65952
  //#endregion
65951
65953
  //#region src/sentry.ts
65952
65954
  const SERVER_APP_NAME = "forge-server";
@@ -75828,7 +75830,7 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
75828
75830
  var fs$6 = __require("fs");
75829
75831
  var path$5 = __require("path");
75830
75832
  var url$1 = __require("url");
75831
- var os$3 = __require("os");
75833
+ var os$2 = __require("os");
75832
75834
  var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
75833
75835
  var vars = process.config && process.config.variables || {};
75834
75836
  var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
@@ -75836,8 +75838,8 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
75836
75838
  var abi = versions.modules;
75837
75839
  if (versions.deno || process.isBun) abi = "unsupported";
75838
75840
  var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
75839
- var arch = process.env.npm_config_arch || os$3.arch();
75840
- var platform = process.env.npm_config_platform || os$3.platform();
75841
+ var arch = process.env.npm_config_arch || os$2.arch();
75842
+ var platform = process.env.npm_config_platform || os$2.platform();
75841
75843
  var libc = process.env.LIBC || (isMusl(platform) ? "musl" : "glibc");
75842
75844
  var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
75843
75845
  var uv = (versions.uv || "").split(".")[0];
@@ -93525,7 +93527,7 @@ const launchDetached = (launch) => gen(function* () {
93525
93527
  });
93526
93528
  const OpenLive = effect(Open, gen(function* () {
93527
93529
  const open = yield* tryPromise({
93528
- try: () => import("./open-yHTUkd2Y.mjs"),
93530
+ try: () => import("./open-2-reBrpv.mjs"),
93529
93531
  catch: (cause) => new OpenError$1({
93530
93532
  message: "failed to load browser opener",
93531
93533
  cause
@@ -191001,7 +191003,7 @@ var Vce = {
191001
191003
  function Ve() {
191002
191004
  return Vce;
191003
191005
  }
191004
- var Us = os.homedir(), lk = os.tmpdir(), { env: Vc } = process$1, Yce = (e) => {
191006
+ var Us = $U.homedir(), lk = $U.tmpdir(), { env: Vc } = process$1, Yce = (e) => {
191005
191007
  let t = path.join(Us, "Library");
191006
191008
  return {
191007
191009
  data: path.join(t, "Application Support", e),
@@ -201201,12 +201203,12 @@ function qZ(e, t) {
201201
201203
  }
201202
201204
  return n;
201203
201205
  }
201204
- var os$2 = "https://code.claude.com/docs/en", kKe = [
201206
+ var os$1 = "https://code.claude.com/docs/en", kKe = [
201205
201207
  {
201206
201208
  matches: (e) => e.path === "permissions.defaultMode" && e.code === "invalid_value",
201207
201209
  tip: {
201208
201210
  suggestion: "Valid modes: \"acceptEdits\" (ask before file changes), \"plan\" (analysis only), \"bypassPermissions\" (auto-accept all), or \"default\" (standard behavior)",
201209
- docLink: `${os$2}/iam#permission-modes`
201211
+ docLink: `${os$1}/iam#permission-modes`
201210
201212
  }
201211
201213
  },
201212
201214
  {
@@ -201221,7 +201223,7 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
201221
201223
  matches: (e) => e.path.startsWith("env.") && e.code === "invalid_type",
201222
201224
  tip: {
201223
201225
  suggestion: "Environment variables must be strings. Wrap numbers and booleans in quotes. Example: \"DEBUG\": \"true\", \"PORT\": \"3000\"",
201224
- docLink: `${os$2}/settings#environment-variables`
201226
+ docLink: `${os$1}/settings#environment-variables`
201225
201227
  }
201226
201228
  },
201227
201229
  {
@@ -201232,14 +201234,14 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
201232
201234
  matches: (e) => e.path.startsWith("hooks.") && e.code === "invalid_key",
201233
201235
  tip: {
201234
201236
  suggestion: "Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",
201235
- docLink: `${os$2}/hooks`
201237
+ docLink: `${os$1}/hooks`
201236
201238
  }
201237
201239
  },
201238
201240
  {
201239
201241
  matches: (e) => /\.hooks\.\d+\.command$/.test(e.path) && e.code === "invalid_type" && e.received === "undefined",
201240
201242
  tip: {
201241
201243
  suggestion: "Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {\"type\": \"command\", \"command\": \"echo\", \"args\": [\"hi\"]}. For shell form, set `command` to the full shell string: {\"type\": \"command\", \"command\": \"echo hi\"}.",
201242
- docLink: `${os$2}/hooks#exec-form-and-shell-form`
201244
+ docLink: `${os$1}/hooks#exec-form-and-shell-form`
201243
201245
  }
201244
201246
  },
201245
201247
  {
@@ -201254,7 +201256,7 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
201254
201256
  matches: (e) => e.code === "unrecognized_keys",
201255
201257
  tip: {
201256
201258
  suggestion: "Check for typos or refer to the documentation for valid fields",
201257
- docLink: `${os$2}/settings`
201259
+ docLink: `${os$1}/settings`
201258
201260
  }
201259
201261
  },
201260
201262
  {
@@ -201269,13 +201271,13 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
201269
201271
  matches: (e) => e.path === "permissions.additionalDirectories" && e.code === "invalid_type",
201270
201272
  tip: {
201271
201273
  suggestion: "Must be an array of directory paths. Example: [\"~/projects\", \"/tmp/workspace\"]. You can also use --add-dir flag or /add-dir command",
201272
- docLink: `${os$2}/iam#working-directories`
201274
+ docLink: `${os$1}/iam#working-directories`
201273
201275
  }
201274
201276
  }
201275
201277
  ], AKe = {
201276
- permissions: `${os$2}/iam#configuring-permissions`,
201277
- env: `${os$2}/settings#environment-variables`,
201278
- hooks: `${os$2}/hooks`
201278
+ permissions: `${os$1}/iam#configuring-permissions`,
201279
+ env: `${os$1}/settings#environment-variables`,
201280
+ hooks: `${os$1}/hooks`
201279
201281
  };
201280
201282
  function GZ(e) {
201281
201283
  let t = kKe.find((r) => r.matches(e));
@@ -214432,6 +214434,25 @@ function createComputerMcpServer(computerManager, threadId) {
214432
214434
  });
214433
214435
  }
214434
214436
  //#endregion
214437
+ //#region src/codeweb/CodewebMcpServer.ts
214438
+ /**
214439
+ * CodeWeb MCP server identity shared by the gated injection surfaces
214440
+ * (Claude adapter, ACP session runtime).
214441
+ *
214442
+ * ADR-011 (CMMD-Center/CodeWeb): Forge injects CodeWeb's remote MCP server
214443
+ * natively so agents see the CodeWeb `map_*` tools with no repo-local
214444
+ * `.mcp.json`. There is no local server to implement: CodeWeb serves MCP
214445
+ * over HTTP, so this module only carries the identity both injection sites
214446
+ * share. Rollout is gated by `ServerSettings.codewebMcp` (default OFF,
214447
+ * CMMD platform org first). Auth is OAuth/Agent Token (CodeWeb ADR-004);
214448
+ * the ACP entry's `headers` array is the later carry slot for token
214449
+ * minting (forge#3408).
214450
+ *
214451
+ * @module CodewebMcpServer
214452
+ */
214453
+ const CODEWEB_MCP_SERVER_NAME = "codeweb";
214454
+ const CODEWEB_MCP_SERVER_URL = "https://codeweb.cmmd.ai/mcp";
214455
+ //#endregion
214435
214456
  //#region src/cmmdData/cmmdContextMcpServer.ts
214436
214457
  /**
214437
214458
  * CMMD Context MCP server (in-process, read-only).
@@ -215307,7 +215328,11 @@ function buildClaudeMcpServers(input) {
215307
215328
  "cmmd-context": createCmmdContextMcpServer(input.threadId, input.resolveCmmdPat),
215308
215329
  [GITHUB_MCP_SERVER_NAME]: createGitHubMcpServer(input.runBrokeredGitHubTool, input.threadId, input.serverSettings),
215309
215330
  ...input.computerManager ? { [COMPUTER_MCP_SERVER_NAME]: createComputerMcpServer(input.computerManager, input.threadId) } : {},
215310
- ...input.cmmdSidekickTools ? { "cmmd-sidekick-tools": createCmmdSidekickToolsMcpServer(input.cmmdSidekickTools.session, input.cmmdSidekickTools.tools) } : {}
215331
+ ...input.cmmdSidekickTools ? { "cmmd-sidekick-tools": createCmmdSidekickToolsMcpServer(input.cmmdSidekickTools.session, input.cmmdSidekickTools.tools) } : {},
215332
+ ...input.serverSettings.codewebMcp ? { [CODEWEB_MCP_SERVER_NAME]: {
215333
+ type: "http",
215334
+ url: CODEWEB_MCP_SERVER_URL
215335
+ } } : {}
215311
215336
  };
215312
215337
  }
215313
215338
  function claudeQueryWorkingDirectoryOptions(cwd) {
@@ -222393,6 +222418,25 @@ const layerChildProcess = (handle, options = {}) => {
222393
222418
  function formatConfigOptionValue(value) {
222394
222419
  return JSON.stringify(value);
222395
222420
  }
222421
+ /**
222422
+ * Builds the `mcpServers` payload for session/new and session/load.
222423
+ *
222424
+ * CodeWeb (ADR-011) is injected only when the setting is relayed as enabled
222425
+ * AND the agent advertised `mcpCapabilities.http` in initialize (the schema
222426
+ * defaults it to false). Sending an http entry to an agent that cannot
222427
+ * consume it would at best be dropped, at worst error the session, so both
222428
+ * gates must pass; anything else stays an empty payload.
222429
+ */
222430
+ function buildAcpMcpServers(input) {
222431
+ if (!input.codewebMcpEnabled) return [];
222432
+ if (input.agentCapabilities?.mcpCapabilities?.http !== true) return [];
222433
+ return [{
222434
+ type: "http",
222435
+ name: CODEWEB_MCP_SERVER_NAME,
222436
+ url: CODEWEB_MCP_SERVER_URL,
222437
+ headers: []
222438
+ }];
222439
+ }
222396
222440
  var AcpSessionRuntime = class AcpSessionRuntime extends Service$1()("forge/provider/acp/AcpSessionRuntime") {
222397
222441
  static layer(options) {
222398
222442
  return effect(AcpSessionRuntime, makeAcpSessionRuntime(options));
@@ -222537,11 +222581,15 @@ const makeAcpSessionRuntime = (options) => gen(function* () {
222537
222581
  yield* runLoggedRequest("authenticate", authenticatePayload, acp.agent.authenticate(authenticatePayload));
222538
222582
  let sessionId;
222539
222583
  let sessionSetupResult;
222584
+ const mcpServers = buildAcpMcpServers({
222585
+ codewebMcpEnabled: options.codewebMcp === true,
222586
+ agentCapabilities: initializeResult.agentCapabilities
222587
+ });
222540
222588
  if (options.resumeSessionId) {
222541
222589
  const loadPayload = {
222542
222590
  sessionId: options.resumeSessionId,
222543
222591
  cwd: options.cwd,
222544
- mcpServers: []
222592
+ mcpServers
222545
222593
  };
222546
222594
  const resumed = yield* runLoggedRequest("session/load", loadPayload, acp.agent.loadSession(loadPayload)).pipe(exit);
222547
222595
  if (isSuccess(resumed)) {
@@ -222550,7 +222598,7 @@ const makeAcpSessionRuntime = (options) => gen(function* () {
222550
222598
  } else {
222551
222599
  const createPayload = {
222552
222600
  cwd: options.cwd,
222553
- mcpServers: []
222601
+ mcpServers
222554
222602
  };
222555
222603
  const created = yield* runLoggedRequest("session/new", createPayload, acp.agent.createSession(createPayload));
222556
222604
  sessionId = created.sessionId;
@@ -222559,7 +222607,7 @@ const makeAcpSessionRuntime = (options) => gen(function* () {
222559
222607
  } else {
222560
222608
  const createPayload = {
222561
222609
  cwd: options.cwd,
222562
- mcpServers: []
222610
+ mcpServers
222563
222611
  };
222564
222612
  const created = yield* runLoggedRequest("session/new", createPayload, acp.agent.createSession(createPayload));
222565
222613
  sessionId = created.sessionId;
@@ -223569,6 +223617,7 @@ function makeCursorAdapter(cursorSettings, options) {
223569
223617
  const acp = yield* (options?.makeAcpRuntime ?? makeCursorAcpRuntime)({
223570
223618
  cursorSettings: effectiveCursorSettings,
223571
223619
  ...options?.environment ? { environment: options.environment } : {},
223620
+ ...options?.codewebMcp ? { codewebMcp: true } : {},
223572
223621
  childProcessSpawner,
223573
223622
  cwd,
223574
223623
  ...resumeSessionId ? { resumeSessionId } : {},
@@ -223974,9 +224023,11 @@ function makeCursorAdapter(cursorSettings, options) {
223974
224023
  * Resolves CursorSettings from ServerSettingsService at construction time
223975
224024
  * (one adapter instance per ProviderKind). Tests can use makeCursorAdapterLive
223976
224025
  * to inject mock settings or env without going through the settings service.
224026
+ * The same snapshot relays `codewebMcp` down to the ACP runtime options.
223977
224027
  */
223978
224028
  const CursorAdapterLive = effect(CursorAdapter, gen(function* () {
223979
- return yield* makeCursorAdapter((yield* (yield* ServerSettingsService).getSettings).providers.cursor);
224029
+ const settings = yield* (yield* ServerSettingsService).getSettings;
224030
+ return yield* makeCursorAdapter(settings.providers.cursor, { codewebMcp: settings.codewebMcp });
223980
224031
  }));
223981
224032
  //#endregion
223982
224033
  //#region src/provider/Services/OpenCodeAdapter.ts
@@ -269181,7 +269232,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
269181
269232
  var dgram = __require("dgram");
269182
269233
  var thunky = require_thunky();
269183
269234
  var events = __require("events");
269184
- var os$1 = __require("os");
269235
+ var os = __require("os");
269185
269236
  var noop = function() {};
269186
269237
  module.exports = function(opts) {
269187
269238
  if (!opts) opts = {};
@@ -269312,14 +269363,14 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
269312
269363
  return that;
269313
269364
  };
269314
269365
  function defaultInterface() {
269315
- var networks = os$1.networkInterfaces();
269366
+ var networks = os.networkInterfaces();
269316
269367
  var names = Object.keys(networks);
269317
269368
  for (var i = 0; i < names.length; i++) {
269318
269369
  var net = networks[names[i]];
269319
269370
  for (var j = 0; j < net.length; j++) {
269320
269371
  var iface = net[j];
269321
269372
  if (isIPv4(iface.family) && !iface.internal) {
269322
- if (os$1.platform() === "darwin" && names[i] === "en0") return iface.address;
269373
+ if (os.platform() === "darwin" && names[i] === "en0") return iface.address;
269323
269374
  return "0.0.0.0";
269324
269375
  }
269325
269376
  }
@@ -269327,7 +269378,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
269327
269378
  return "127.0.0.1";
269328
269379
  }
269329
269380
  function allInterfaces() {
269330
- var networks = os$1.networkInterfaces();
269381
+ var networks = os.networkInterfaces();
269331
269382
  var names = Object.keys(networks);
269332
269383
  var res = [];
269333
269384
  for (var i = 0; i < names.length; i++) {
@@ -297188,7 +297239,7 @@ function resolveBuildCommitFromEnv(env) {
297188
297239
  * environment descriptor down instead of reporting an honest "unknown".
297189
297240
  */
297190
297241
  function readBakedBuildCommit() {
297191
- return "f3a17e1472afd6c0d4a0f262ea29bfd68c5a63c5";
297242
+ return "415af659079e132a2653535d56e2c464576d48fa";
297192
297243
  }
297193
297244
  async function resolveServerBuildCommit(input) {
297194
297245
  if (isFullCommitSha(input.baked)) return input.baked;
@@ -321789,7 +321840,7 @@ const connectLoginCommand = make$34("login", {
321789
321840
  })).json();
321790
321841
  },
321791
321842
  openBrowser: async (url) => {
321792
- const open = (await import("./open-yHTUkd2Y.mjs")).default;
321843
+ const open = (await import("./open-2-reBrpv.mjs")).default;
321793
321844
  await open(url);
321794
321845
  return true;
321795
321846
  },