negotium 0.5.2 → 0.5.4

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.
@@ -1224,6 +1224,31 @@ function browserOwnerCapability(capability, owner) {
1224
1224
  return createHmac3("sha256", capability).update(owner).digest("hex");
1225
1225
  }
1226
1226
 
1227
+ // ../../packages/core/src/platform/playwright/mcp-transport.ts
1228
+ var CODEX_BROWSER_CAPABILITY_ENV = "NEGOTIUM_BROWSER_CAPABILITY";
1229
+ function buildPlaywrightMcpTransport(port, owner, capability, agent) {
1230
+ const query = new URLSearchParams({ owner });
1231
+ const ownerCapability = browserOwnerCapability(capability, owner);
1232
+ if (agent === "codex") {
1233
+ return {
1234
+ url: `http://127.0.0.1:${port}/mcp?${query}`,
1235
+ env_http_headers: { "X-Browser-Capability": CODEX_BROWSER_CAPABILITY_ENV }
1236
+ };
1237
+ }
1238
+ if (agent === "maestro") {
1239
+ return {
1240
+ type: "http",
1241
+ url: `http://127.0.0.1:${port}/mcp?${query}`,
1242
+ headers: { "X-Browser-Capability": ownerCapability }
1243
+ };
1244
+ }
1245
+ return {
1246
+ type: "sse",
1247
+ url: `http://127.0.0.1:${port}/sse?${query}`,
1248
+ headers: { "X-Browser-Capability": ownerCapability }
1249
+ };
1250
+ }
1251
+
1227
1252
  // ../../packages/core/src/platform/mcp-config.ts
1228
1253
  function buildStdioMcpServer(agent, serverFile, serverArgs, env) {
1229
1254
  if (agent === "codex") {
@@ -1284,7 +1309,6 @@ function _markPlaywrightUnavailable(ctx) {
1284
1309
  logger.warn({ err }, "playwright unavailable notifier threw");
1285
1310
  }
1286
1311
  }
1287
- var CODEX_BROWSER_CAPABILITY_ENV = "NEGOTIUM_BROWSER_CAPABILITY";
1288
1312
  function browserOwnerForContext(ctx) {
1289
1313
  if (ctx.topicId)
1290
1314
  return `topic:${ctx.topicId}`;
@@ -1292,22 +1316,6 @@ function browserOwnerForContext(ctx) {
1292
1316
  return `user:${ctx.userId}:${ctx.session}`;
1293
1317
  return;
1294
1318
  }
1295
- function playwrightTransport(port, owner, capability, agent) {
1296
- const ownerCapability = browserOwnerCapability(capability, owner);
1297
- if (agent === "codex") {
1298
- const query2 = new URLSearchParams({ owner });
1299
- return {
1300
- url: `http://127.0.0.1:${port}/mcp?${query2}`,
1301
- env_http_headers: { "X-Browser-Capability": CODEX_BROWSER_CAPABILITY_ENV }
1302
- };
1303
- }
1304
- const query = new URLSearchParams({ owner });
1305
- return {
1306
- type: "sse",
1307
- url: `http://127.0.0.1:${port}/sse?${query}`,
1308
- headers: { "X-Browser-Capability": ownerCapability }
1309
- };
1310
- }
1311
1319
  function longLivedHttpMcp(agent, port) {
1312
1320
  return agent === "codex" ? { url: `http://127.0.0.1:${port}/mcp` } : { type: "sse", url: `http://127.0.0.1:${port}/sse` };
1313
1321
  }
@@ -1344,7 +1352,7 @@ var MCP_CATALOG = {
1344
1352
  const owner = browserOwnerForContext({ userId, session, topicId });
1345
1353
  if (!owner)
1346
1354
  return null;
1347
- return playwrightTransport(playwrightPort, owner, playwrightCapability, agent);
1355
+ return buildPlaywrightMcpTransport(playwrightPort, owner, playwrightCapability, agent);
1348
1356
  }
1349
1357
  _markPlaywrightUnavailable({
1350
1358
  userId,
@@ -2658,4 +2666,4 @@ function formatDateBucket(d) {
2658
2666
 
2659
2667
  export { __toESM, __require, logger, CLAUDE_EFFORT_VALUES, CODEX_EFFORT_VALUES, MAESTRO_EFFORT_VALUES, MODEL_SONNET, MODEL_OPUS, MODEL_FABLE, configureRolloutHost, assertUuidLike, ensureCwdExists, extractChatPairs, encodeClaudeCwd, writeClaudeRollout, repairPoisonedRollout, hostedCodexHomePath, extractLatestCodexPatchPreview, extractCodexPatchCallIds, readCodexPatchCallIds, readLatestCodexPatchPreview, extractLatestCodexContextUsage, readLatestCodexContextUsage, migrateCodexRolloutNativeMultiAgentMetadata, latestCodexRolloutPath, writeCodexRollout, decodeUuidV7Timestamp };
2660
2668
 
2661
- //# debugId=6D7D58D4329FF39364756E2164756E21
2669
+ //# debugId=58994DA5AF74223364756E2164756E21