@askexenow/exe-os 0.9.131 → 0.9.132

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.
Files changed (97) hide show
  1. package/dist/bin/cleanup-stale-review-tasks.js +1 -1
  2. package/dist/bin/cli.js +5 -5
  3. package/dist/bin/exe-boot.js +1 -1
  4. package/dist/bin/exe-dispatch.js +2 -2
  5. package/dist/bin/exe-forget.js +1 -1
  6. package/dist/bin/exe-gateway.js +1 -1
  7. package/dist/bin/exe-heartbeat.js +1 -1
  8. package/dist/bin/exe-launch-agent.js +42 -0
  9. package/dist/bin/exe-new-employee.js +1 -1
  10. package/dist/bin/exe-pending-messages.js +2 -2
  11. package/dist/bin/exe-pending-notifications.js +1 -1
  12. package/dist/bin/exe-pending-reviews.js +1 -1
  13. package/dist/bin/exe-search.js +1 -1
  14. package/dist/bin/exe-session-cleanup.js +4 -4
  15. package/dist/bin/exe-start-codex.js +37 -1
  16. package/dist/bin/exe-start-opencode.js +1 -1
  17. package/dist/bin/exe-start.sh +8 -3
  18. package/dist/bin/exe-status.js +2 -2
  19. package/dist/bin/git-sweep.js +2 -2
  20. package/dist/bin/install.js +3 -2
  21. package/dist/bin/intercom-check.js +2 -2
  22. package/dist/bin/scan-tasks.js +1 -1
  23. package/dist/{capacity-monitor-DZK4L6AI.js → capacity-monitor-GJHJGYK5.js} +2 -2
  24. package/dist/{catchup-brief-XQE6OPX3.js → catchup-brief-MQPCZKZB.js} +2 -2
  25. package/dist/{chunk-FKEHAW5H.js → chunk-3Z7DZ3ZA.js} +4 -4
  26. package/dist/{chunk-AGVPLEGP.js → chunk-5J6PCZPW.js} +2 -2
  27. package/dist/{chunk-WC727FG7.js → chunk-6IMJM5PB.js} +1 -1
  28. package/dist/{chunk-3IDUX6ZD.js → chunk-BTK6YI4T.js} +5 -3
  29. package/dist/{chunk-4PGS5OKU.js → chunk-DD5KDAZM.js} +2 -2
  30. package/dist/{chunk-CUEYUZKY.js → chunk-DPFWOFVK.js} +1 -1
  31. package/dist/{chunk-AVU6RF2L.js → chunk-EHJHJNO4.js} +1 -1
  32. package/dist/{chunk-FO43GJS2.js → chunk-FEXBD2UM.js} +1 -1
  33. package/dist/{chunk-65P2ZP5F.js → chunk-FQX4MT6U.js} +11 -3
  34. package/dist/{chunk-MRZGBK5L.js → chunk-GD2I67U6.js} +2 -2
  35. package/dist/{chunk-MFFT4HO3.js → chunk-H7PVIYBD.js} +1 -1
  36. package/dist/{chunk-DRSC6ZRA.js → chunk-HCOQX3EJ.js} +7 -0
  37. package/dist/chunk-IDZ6TSLQ.js +82 -0
  38. package/dist/{chunk-YQEI7PSQ.js → chunk-IJ2BDL46.js} +3 -3
  39. package/dist/{chunk-FN4R2IJH.js → chunk-L3X4DWXE.js} +1 -1
  40. package/dist/{chunk-C5L36MKS.js → chunk-LMTIDT7G.js} +24 -24
  41. package/dist/{chunk-N26MHKKN.js → chunk-MAI3DB27.js} +2 -2
  42. package/dist/{chunk-4GXJ4KWB.js → chunk-PUKFRLG6.js} +1 -1
  43. package/dist/{chunk-ZA6RNNQT.js → chunk-QCQWEWFQ.js} +1 -1
  44. package/dist/{chunk-BCMOO4OQ.js → chunk-T3RAPKYS.js} +132 -204
  45. package/dist/{chunk-4NCSE6PB.js → chunk-UUL36LZU.js} +1 -1
  46. package/dist/{chunk-2CPAX2XT.js → chunk-W5ECGCQX.js} +2 -2
  47. package/dist/{crm-webhook-UF3UBK7V.js → crm-webhook-E5OTYXYO.js} +2 -2
  48. package/dist/{cto-delegation-gate-4FMBWVLW.js → cto-delegation-gate-RR44VKWK.js} +1 -1
  49. package/dist/{daemon-orchestration-5LJ7UFOT.js → daemon-orchestration-VGQOEBJR.js} +2 -2
  50. package/dist/gateway/index.js +3 -3
  51. package/dist/{git-task-sweep-RYMNUR4U.js → git-task-sweep-3FAVGGEQ.js} +2 -2
  52. package/dist/hooks/bug-report-worker.js +4 -4
  53. package/dist/hooks/codex-stop-task-finalizer.js +4 -4
  54. package/dist/hooks/commit-complete.js +3 -3
  55. package/dist/hooks/error-recall.js +1 -1
  56. package/dist/hooks/ingest.js +1 -1
  57. package/dist/hooks/post-compact.js +1 -1
  58. package/dist/hooks/post-tool-combined.js +1 -1
  59. package/dist/hooks/pre-compact.js +2 -2
  60. package/dist/hooks/pre-tool-use.js +3 -3
  61. package/dist/hooks/prompt-submit.js +4 -4
  62. package/dist/hooks/session-end.js +5 -5
  63. package/dist/hooks/session-start.js +2 -2
  64. package/dist/hooks/stop.js +2 -2
  65. package/dist/hooks/subagent-stop.js +1 -1
  66. package/dist/hooks/summary-worker.js +2 -2
  67. package/dist/index.js +7 -7
  68. package/dist/{installer-5N24GXFB.js → installer-KZHAO2FY.js} +2 -1
  69. package/dist/{installer-ZPQUKHU5.js → installer-MNMBGOX2.js} +17 -9
  70. package/dist/{installer-QSD76YRY.js → installer-OJCWXX5V.js} +5 -3
  71. package/dist/lib/exe-daemon.js +28 -12
  72. package/dist/lib/hybrid-search.js +1 -1
  73. package/dist/lib/messaging.js +2 -2
  74. package/dist/lib/tasks.js +4 -4
  75. package/dist/lib/tmux-routing.js +1 -1
  76. package/dist/{license-gate-NXXDOOAQ.js → license-gate-7NS2HRQ2.js} +1 -1
  77. package/dist/mcp/register-tools.js +19 -19
  78. package/dist/mcp/server.js +21 -21
  79. package/dist/mcp/tools/create-task.js +5 -5
  80. package/dist/mcp/tools/list-tasks.js +5 -5
  81. package/dist/mcp/tools/send-message.js +3 -3
  82. package/dist/mcp/tools/update-task.js +5 -5
  83. package/dist/mcp-http-config-M4MI6CEP.js +24 -0
  84. package/dist/{notifications-DOGZCKY3.js → notifications-BBR4HK5Y.js} +1 -1
  85. package/dist/{orchestrator-HV7DEBXM.js → orchestrator-HL6GPUE2.js} +3 -3
  86. package/dist/runtime/index.js +4 -4
  87. package/dist/{session-events-UDVAORX2.js → session-events-Z7VAUGC7.js} +2 -2
  88. package/dist/{session-scope-24IMXQES.js → session-scope-3OXSTZM4.js} +2 -2
  89. package/dist/{task-scope-5QM7HN4D.js → task-scope-XOLUVSX7.js} +1 -1
  90. package/dist/{tasks-crud-PS73UQYV.js → tasks-crud-L52V5SYM.js} +2 -2
  91. package/dist/{tasks-review-CGHWTOOW.js → tasks-review-JTZIM6NF.js} +1 -1
  92. package/dist/tui/App.js +7 -7
  93. package/dist/{tui-data-O7PRTO73.js → tui-data-QAFGUF6T.js} +1 -1
  94. package/package.json +1 -1
  95. /package/dist/{chunk-HQSBBKPD.js → chunk-COS5XGKO.js} +0 -0
  96. /package/dist/{chunk-65HEEFCM.js → chunk-TPOUMWTO.js} +0 -0
  97. /package/dist/{chunk-LVNKCRR2.js → chunk-TQYTMNCQ.js} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  init_task_scope,
7
7
  sessionScopeFilter
8
- } from "../chunk-3IDUX6ZD.js";
8
+ } from "../chunk-BTK6YI4T.js";
9
9
  import "../chunk-NEAHEC5G.js";
10
10
  import "../chunk-KRLOFIPI.js";
11
11
  import "../chunk-R4M6XCMU.js";
package/dist/bin/cli.js CHANGED
@@ -21,7 +21,7 @@ if (args.includes("--global")) {
21
21
  );
22
22
  await runClaudeInstall();
23
23
  } else if (args.includes("--commands-only")) {
24
- const { copySlashCommands, resolvePackageRoot } = await import("../installer-5N24GXFB.js");
24
+ const { copySlashCommands, resolvePackageRoot } = await import("../installer-KZHAO2FY.js");
25
25
  try {
26
26
  const packageRoot = resolvePackageRoot();
27
27
  const result = await copySlashCommands(packageRoot);
@@ -385,7 +385,7 @@ function numberAfter(args2, flag) {
385
385
  return Number.isFinite(parsed) ? parsed : void 0;
386
386
  }
387
387
  async function runClaudeInstall() {
388
- const { runInstaller } = await import("../installer-5N24GXFB.js");
388
+ const { runInstaller } = await import("../installer-KZHAO2FY.js");
389
389
  try {
390
390
  await runInstaller();
391
391
  } catch (err) {
@@ -397,7 +397,7 @@ async function runClaudeInstall() {
397
397
  }
398
398
  }
399
399
  async function runOpenCodeInstall() {
400
- const { runOpenCodeInstaller } = await import("../installer-QSD76YRY.js");
400
+ const { runOpenCodeInstaller } = await import("../installer-OJCWXX5V.js");
401
401
  try {
402
402
  await runOpenCodeInstaller();
403
403
  } catch (err) {
@@ -409,7 +409,7 @@ async function runOpenCodeInstall() {
409
409
  }
410
410
  }
411
411
  async function runCodexInstall() {
412
- const { runCodexInstaller } = await import("../installer-ZPQUKHU5.js");
412
+ const { runCodexInstaller } = await import("../installer-MNMBGOX2.js");
413
413
  try {
414
414
  await runCodexInstaller();
415
415
  } catch (err) {
@@ -421,7 +421,7 @@ async function runCodexInstall() {
421
421
  }
422
422
  }
423
423
  async function runClaudeCheck() {
424
- const { detectMcpNameCollisions } = await import("../installer-5N24GXFB.js");
424
+ const { detectMcpNameCollisions } = await import("../installer-KZHAO2FY.js");
425
425
  const claudeDir = path.join(os.homedir(), ".claude");
426
426
  const settingsPath = path.join(claudeDir, "settings.json");
427
427
  const claudeJsonPath = path.join(os.homedir(), ".claude.json");
@@ -28,7 +28,7 @@ import {
28
28
  readUnreadNotifications,
29
29
  resolveExeSession,
30
30
  sessionScopeFilter
31
- } from "../chunk-3IDUX6ZD.js";
31
+ } from "../chunk-BTK6YI4T.js";
32
32
  import "../chunk-NEAHEC5G.js";
33
33
  import {
34
34
  init_session_registry,
@@ -5,12 +5,12 @@ import {
5
5
  import {
6
6
  createTaskCore,
7
7
  init_tasks_crud
8
- } from "../chunk-4PGS5OKU.js";
8
+ } from "../chunk-DD5KDAZM.js";
9
9
  import {
10
10
  ensureEmployee,
11
11
  init_tmux_routing,
12
12
  resolveExeSession
13
- } from "../chunk-3IDUX6ZD.js";
13
+ } from "../chunk-BTK6YI4T.js";
14
14
  import "../chunk-NEAHEC5G.js";
15
15
  import "../chunk-KRLOFIPI.js";
16
16
  import "../chunk-R4M6XCMU.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-DGRHKL3P.js";
5
5
  import {
6
6
  lightweightSearch
7
- } from "../chunk-LVNKCRR2.js";
7
+ } from "../chunk-TQYTMNCQ.js";
8
8
  import "../chunk-HWZKHJ4Z.js";
9
9
  import "../chunk-GZY3EIWR.js";
10
10
  import "../chunk-WZQ4CPRG.js";
@@ -959,7 +959,7 @@ async function main() {
959
959
  console.log("[exe-gateway] Generic webhook adapter registered");
960
960
  }
961
961
  {
962
- const { createCRMWebhookHandler } = await import("../crm-webhook-UF3UBK7V.js");
962
+ const { createCRMWebhookHandler } = await import("../crm-webhook-E5OTYXYO.js");
963
963
  const handler = createCRMWebhookHandler();
964
964
  server.onPlatform("crm", handler);
965
965
  console.log("[exe-gateway] CRM webhook adapter registered");
@@ -9,7 +9,7 @@ import {
9
9
  isExeSession,
10
10
  listPendingReviews,
11
11
  strictSessionScopeFilter
12
- } from "../chunk-3IDUX6ZD.js";
12
+ } from "../chunk-BTK6YI4T.js";
13
13
  import "../chunk-NEAHEC5G.js";
14
14
  import "../chunk-KRLOFIPI.js";
15
15
  import "../chunk-R4M6XCMU.js";
@@ -434,7 +434,49 @@ async function main() {
434
434
  if (leanMcpEnabled()) {
435
435
  generateLeanMcpConfig(memoryAgent, empRole);
436
436
  }
437
+ const sessionName = process.env.EXE_SESSION_NAME || process.env.EXE_SESSION || "";
438
+ let sessionMcpConfig = null;
439
+ if (sessionName && ccSupportsFlag("--mcp-config")) {
440
+ try {
441
+ const allServers = collectAllMcpServers();
442
+ for (const key of ["exe-mem", "exe-os"]) {
443
+ const entry = allServers[key];
444
+ if (entry && entry.type === "http") {
445
+ const headers = entry.headers ?? {};
446
+ headers["X-Agent-Id"] = memoryAgent;
447
+ headers["X-Agent-Role"] = empRole;
448
+ headers["X-Exe-Session"] = sessionName;
449
+ entry.headers = headers;
450
+ }
451
+ }
452
+ const configDir = path.join(os.homedir(), ".exe-os", "mcp-configs");
453
+ mkdirSync(configDir, { recursive: true });
454
+ sessionMcpConfig = path.join(configDir, `${memoryAgent}-${sessionName}.json`);
455
+ writeFileSync(sessionMcpConfig, JSON.stringify({ mcpServers: allServers }, null, 2), "utf-8");
456
+ process.stderr.write(
457
+ `[exe-launch-agent] session MCP config: ${sessionMcpConfig} (${Object.keys(allServers).length} servers, session=${sessionName})
458
+ `
459
+ );
460
+ } catch (err) {
461
+ process.stderr.write(
462
+ `[exe-launch-agent] session MCP config generation failed: ${err instanceof Error ? err.message : String(err)}
463
+ `
464
+ );
465
+ sessionMcpConfig = null;
466
+ }
467
+ }
437
468
  const plan = buildLaunchPlan(agent, behaviorsPath, passthrough, hasAgentFlag, provider);
469
+ if (sessionMcpConfig) {
470
+ const mcpIdx = plan.args.indexOf("--mcp-config");
471
+ if (mcpIdx !== -1) {
472
+ plan.args.splice(mcpIdx, 2);
473
+ }
474
+ const strictIdx = plan.args.indexOf("--strict-mcp-config");
475
+ if (strictIdx !== -1) {
476
+ plan.args.splice(strictIdx, 1);
477
+ }
478
+ plan.args.push("--mcp-config", sessionMcpConfig);
479
+ }
438
480
  process.env.AGENT_ID = memoryAgent;
439
481
  if (!process.env.EXE_SESSION_KEY) {
440
482
  process.env.EXE_SESSION_KEY = `launcher-${Date.now()}-${process.pid}`;
@@ -149,7 +149,7 @@ ${rolePrompt}`;
149
149
  console.error(`Warning: some launchers failed: ${bins.errors.join("; ")}`);
150
150
  }
151
151
  try {
152
- const { resolvePackageRoot } = await import("../installer-5N24GXFB.js");
152
+ const { resolvePackageRoot } = await import("../installer-KZHAO2FY.js");
153
153
  const pkgRoot = resolvePackageRoot();
154
154
  const wrapResult = generateSessionWrappers(pkgRoot);
155
155
  if (wrapResult.created > 0) {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getPendingMessages,
3
3
  markRead
4
- } from "../chunk-WC727FG7.js";
4
+ } from "../chunk-6IMJM5PB.js";
5
5
  import {
6
6
  fastDbInit
7
7
  } from "../chunk-DGRHKL3P.js";
8
- import "../chunk-3IDUX6ZD.js";
8
+ import "../chunk-BTK6YI4T.js";
9
9
  import "../chunk-NEAHEC5G.js";
10
10
  import "../chunk-KRLOFIPI.js";
11
11
  import "../chunk-R4M6XCMU.js";
@@ -6,7 +6,7 @@ import {
6
6
  init_notifications,
7
7
  markAsRead,
8
8
  readUnreadNotifications
9
- } from "../chunk-3IDUX6ZD.js";
9
+ } from "../chunk-BTK6YI4T.js";
10
10
  import "../chunk-NEAHEC5G.js";
11
11
  import "../chunk-KRLOFIPI.js";
12
12
  import "../chunk-R4M6XCMU.js";
@@ -11,7 +11,7 @@ import {
11
11
  isExeSession,
12
12
  isStale,
13
13
  listPendingReviews
14
- } from "../chunk-3IDUX6ZD.js";
14
+ } from "../chunk-BTK6YI4T.js";
15
15
  import "../chunk-NEAHEC5G.js";
16
16
  import "../chunk-KRLOFIPI.js";
17
17
  import "../chunk-R4M6XCMU.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  hybridSearch,
4
4
  lightweightSearch
5
- } from "../chunk-LVNKCRR2.js";
5
+ } from "../chunk-TQYTMNCQ.js";
6
6
  import {
7
7
  initStore
8
8
  } from "../chunk-HWZKHJ4Z.js";
@@ -12,7 +12,7 @@ import "../chunk-GZY3EIWR.js";
12
12
  import {
13
13
  init_task_scope,
14
14
  sessionScopeFilter
15
- } from "../chunk-3IDUX6ZD.js";
15
+ } from "../chunk-BTK6YI4T.js";
16
16
  import "../chunk-NEAHEC5G.js";
17
17
  import "../chunk-KRLOFIPI.js";
18
18
  import "../chunk-R4M6XCMU.js";
@@ -141,7 +141,7 @@ try {
141
141
  `
142
142
  );
143
143
  try {
144
- const { createReviewForCompletedTask } = await import("../tasks-review-CGHWTOOW.js");
144
+ const { createReviewForCompletedTask } = await import("../tasks-review-JTZIM6NF.js");
145
145
  await createReviewForCompletedTask(
146
146
  {
147
147
  id: String(dt.id),
@@ -177,7 +177,7 @@ try {
177
177
  if (result.rows.length === 0) process.exit(0);
178
178
  let commits = [];
179
179
  try {
180
- const { getRecentCommits } = await import("../git-task-sweep-RYMNUR4U.js");
180
+ const { getRecentCommits } = await import("../git-task-sweep-3FAVGGEQ.js");
181
181
  commits = getRecentCommits(30);
182
182
  } catch {
183
183
  }
@@ -190,7 +190,7 @@ try {
190
190
  const context = row.context ? String(row.context) : void 0;
191
191
  if (commits.length > 0) {
192
192
  try {
193
- const { findBestMatch } = await import("../git-task-sweep-RYMNUR4U.js");
193
+ const { findBestMatch } = await import("../git-task-sweep-3FAVGGEQ.js");
194
194
  const match = findBestMatch({ id: taskId, title, context }, commits);
195
195
  if (match) {
196
196
  await client.execute({
@@ -241,13 +241,46 @@ async function main() {
241
241
  }
242
242
  })();
243
243
  process.env.AGENT_ROLE = empRole;
244
+ const exeSessionName = process.env.EXE_SESSION_NAME || process.env.EXE_SESSION || sessionName || "";
245
+ let codexProfileName = null;
246
+ if (exeSessionName) {
247
+ try {
248
+ const { readOrCreateDaemonToken } = await import("../mcp-http-config-M4MI6CEP.js");
249
+ const { mcpHttpUrl } = await import("../mcp-http-config-M4MI6CEP.js");
250
+ const token = readOrCreateDaemonToken();
251
+ const profileContent = [
252
+ `# Auto-generated per-session MCP config for ${memoryAgent} in ${exeSessionName}`,
253
+ `[mcp_servers.exe-os]`,
254
+ `url = ${JSON.stringify(mcpHttpUrl())}`,
255
+ `http_headers = { "Authorization" = "Bearer ${token}", "X-Agent-Id" = ${JSON.stringify(memoryAgent)}, "X-Agent-Role" = ${JSON.stringify(empRole)}, "X-Exe-Session" = ${JSON.stringify(exeSessionName)} }`,
256
+ `startup_timeout_sec = 30`,
257
+ `tool_timeout_sec = 120`,
258
+ ""
259
+ ].join("\n");
260
+ const codexHome = path.join(os.homedir(), ".codex");
261
+ codexProfileName = `${memoryAgent}-${exeSessionName}`;
262
+ const profilePath = path.join(codexHome, `${codexProfileName}.config.toml`);
263
+ mkdirSync(codexHome, { recursive: true });
264
+ writeFileSync(profilePath, profileContent, "utf-8");
265
+ process.stderr.write(
266
+ `[exe-start-codex] session profile: ${profilePath} (agent=${memoryAgent}, session=${exeSessionName})
267
+ `
268
+ );
269
+ } catch (err) {
270
+ process.stderr.write(
271
+ `[exe-start-codex] session profile generation failed: ${err instanceof Error ? err.message : String(err)}
272
+ `
273
+ );
274
+ codexProfileName = null;
275
+ }
276
+ }
244
277
  try {
245
278
  const { writeActiveAgent } = await import("../active-agent-3FDJYREJ.js");
246
279
  writeActiveAgent(memoryAgent, empRole);
247
280
  } catch {
248
281
  }
249
282
  try {
250
- const { verifyCodexHooks, runCodexInstaller } = await import("../installer-ZPQUKHU5.js");
283
+ const { verifyCodexHooks, runCodexInstaller } = await import("../installer-MNMBGOX2.js");
251
284
  if (!verifyCodexHooks()) {
252
285
  process.stderr.write("[exe-start-codex] hooks missing \u2014 registering now\n");
253
286
  await runCodexInstaller();
@@ -318,6 +351,9 @@ async function main() {
318
351
  if (promptPath) {
319
352
  args.push("-c", `model_instructions_file="${promptPath}"`);
320
353
  }
354
+ if (codexProfileName) {
355
+ args.push("--profile-v2", codexProfileName);
356
+ }
321
357
  args.push("You are an AI employee with exe-os MCP tools (list_tasks, get_task, update_task, store_memory, recall_my_memory, ask_team_memory). DO NOT ask for confirmation \u2014 work autonomously. Immediately: 1) Call list_tasks to see your assigned tasks. 2) Call get_task on the highest priority open task. 3) Start working on it. 4) When done, call update_task with status done and a result summary. 5) Check list_tasks again for the next task. 6) If NO open tasks remain, say 'All tasks complete. Standing by.' and STOP. If MCP tools are unavailable, tell the user to run 'exe-os codex' to register them.");
322
358
  process.stderr.write(
323
359
  `[exe-start-codex] launching ${agent} on ${CODEX.binary} (${effectiveModel}) \u2014 interactive mode
@@ -183,7 +183,7 @@ async function main() {
183
183
  } catch {
184
184
  }
185
185
  try {
186
- const { verifyOpenCodeHooks, runOpenCodeInstaller } = await import("../installer-QSD76YRY.js");
186
+ const { verifyOpenCodeHooks, runOpenCodeInstaller } = await import("../installer-OJCWXX5V.js");
187
187
  if (!verifyOpenCodeHooks()) {
188
188
  process.stderr.write("[exe-start-opencode] hooks missing \u2014 registering now\n");
189
189
  await runOpenCodeInstaller();
@@ -158,12 +158,17 @@ unset TMUX
158
158
 
159
159
  # Create session and launch COO with full identity + behaviors + bypass permissions
160
160
  tmux new-session -d -s "$SESSION" -c "$PWD"
161
+ # Set session identity in tmux environment — inherited by all processes in this session.
162
+ # Critical for HTTP MCP: the daemon needs to know which coordinator session is calling.
163
+ tmux set-environment -t "$SESSION" AGENT_ID "$COO_NAME"
164
+ tmux set-environment -t "$SESSION" EXE_SESSION_NAME "$SESSION"
165
+ tmux set-environment -t "$SESSION" EXE_SESSION "$SESSION"
161
166
  if [ "$RUNTIME" = "codex" ]; then
162
- tmux send-keys -t "$SESSION" "exe-start-codex --agent $COO_NAME" Enter
167
+ tmux send-keys -t "$SESSION" "export AGENT_ID=$COO_NAME EXE_SESSION_NAME=$SESSION EXE_SESSION=$SESSION && exe-start-codex --agent $COO_NAME" Enter
163
168
  elif [ "$RUNTIME" = "opencode" ]; then
164
- tmux send-keys -t "$SESSION" "exe-start-opencode --agent $COO_NAME" Enter
169
+ tmux send-keys -t "$SESSION" "export AGENT_ID=$COO_NAME EXE_SESSION_NAME=$SESSION EXE_SESSION=$SESSION && exe-start-opencode --agent $COO_NAME" Enter
165
170
  else
166
- tmux send-keys -t "$SESSION" "exe-launch-agent --agent $COO_NAME" Enter
171
+ tmux send-keys -t "$SESSION" "export AGENT_ID=$COO_NAME EXE_SESSION_NAME=$SESSION EXE_SESSION=$SESSION && exe-launch-agent --agent $COO_NAME" Enter
167
172
  fi
168
173
 
169
174
  # Attach user to session (-d detaches other clients to prevent rendering conflict)
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  status
4
- } from "../chunk-MFFT4HO3.js";
4
+ } from "../chunk-H7PVIYBD.js";
5
5
  import "../chunk-DC4ZD76Y.js";
6
6
  import "../chunk-DGRHKL3P.js";
7
- import "../chunk-3IDUX6ZD.js";
7
+ import "../chunk-BTK6YI4T.js";
8
8
  import "../chunk-NEAHEC5G.js";
9
9
  import "../chunk-KRLOFIPI.js";
10
10
  import "../chunk-R4M6XCMU.js";
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  sweepTasks
4
- } from "../chunk-2CPAX2XT.js";
5
- import "../chunk-3IDUX6ZD.js";
4
+ } from "../chunk-W5ECGCQX.js";
5
+ import "../chunk-BTK6YI4T.js";
6
6
  import "../chunk-NEAHEC5G.js";
7
7
  import "../chunk-KRLOFIPI.js";
8
8
  import "../chunk-R4M6XCMU.js";
@@ -5,8 +5,9 @@ import {
5
5
  runInstaller,
6
6
  setupGhostty,
7
7
  setupTmux
8
- } from "../chunk-BCMOO4OQ.js";
8
+ } from "../chunk-T3RAPKYS.js";
9
9
  import "../chunk-SPKE5ANC.js";
10
+ import "../chunk-IDZ6TSLQ.js";
10
11
  import {
11
12
  generateSessionWrappers
12
13
  } from "../chunk-ZHMQDTGE.js";
@@ -193,7 +194,7 @@ if (args.includes("--commands-only")) {
193
194
  }
194
195
  try {
195
196
  execSync("which codex", { encoding: "utf8", timeout: 5e3 });
196
- const { runCodexInstaller } = await import("../installer-ZPQUKHU5.js");
197
+ const { runCodexInstaller } = await import("../installer-MNMBGOX2.js");
197
198
  await runCodexInstaller();
198
199
  } catch {
199
200
  }
@@ -16,7 +16,7 @@ async function main() {
16
16
  }
17
17
  if (isCoordinator) {
18
18
  try {
19
- const { listPendingReviews, cleanupOrphanedReviews, formatAge, isStale } = await import("../tasks-review-CGHWTOOW.js");
19
+ const { listPendingReviews, cleanupOrphanedReviews, formatAge, isStale } = await import("../tasks-review-JTZIM6NF.js");
20
20
  const { extractRootExe } = await import("../lib/tmux-routing.js");
21
21
  await cleanupOrphanedReviews();
22
22
  let sessionScope = process.env.EXE_SESSION ? extractRootExe(process.env.EXE_SESSION) ?? void 0 : void 0;
@@ -106,7 +106,7 @@ async function main() {
106
106
  }
107
107
  }
108
108
  try {
109
- const { readUnreadNotifications, markAsRead } = await import("../notifications-DOGZCKY3.js");
109
+ const { readUnreadNotifications, markAsRead } = await import("../notifications-BBR4HK5Y.js");
110
110
  const notifications = await readUnreadNotifications(agent);
111
111
  const recentCutoff = Date.now() - 24 * 60 * 60 * 1e3;
112
112
  const pending = notifications.filter((row) => new Date(row.timestamp).getTime() > recentCutoff);
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  init_task_scope,
4
4
  sessionScopeFilter
5
- } from "../chunk-3IDUX6ZD.js";
5
+ } from "../chunk-BTK6YI4T.js";
6
6
  import "../chunk-NEAHEC5G.js";
7
7
  import "../chunk-KRLOFIPI.js";
8
8
  import "../chunk-R4M6XCMU.js";
@@ -9,9 +9,9 @@ import {
9
9
  isAtCapacity,
10
10
  isWithinRelaunchCooldown,
11
11
  pollCapacityDead
12
- } from "./chunk-FO43GJS2.js";
12
+ } from "./chunk-FEXBD2UM.js";
13
13
  import "./chunk-DJ5ZWBKZ.js";
14
- import "./chunk-3IDUX6ZD.js";
14
+ import "./chunk-BTK6YI4T.js";
15
15
  import "./chunk-NEAHEC5G.js";
16
16
  import "./chunk-KRLOFIPI.js";
17
17
  import "./chunk-R4M6XCMU.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  lightweightSearch
3
- } from "./chunk-LVNKCRR2.js";
3
+ } from "./chunk-TQYTMNCQ.js";
4
4
  import "./chunk-HWZKHJ4Z.js";
5
5
  import "./chunk-GZY3EIWR.js";
6
6
  import {
7
7
  init_task_scope,
8
8
  sessionScopeFilter,
9
9
  strictSessionScopeFilter
10
- } from "./chunk-3IDUX6ZD.js";
10
+ } from "./chunk-BTK6YI4T.js";
11
11
  import "./chunk-NEAHEC5G.js";
12
12
  import "./chunk-KRLOFIPI.js";
13
13
  import "./chunk-R4M6XCMU.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  init_session_scope,
3
3
  session_scope_exports
4
- } from "./chunk-ZA6RNNQT.js";
4
+ } from "./chunk-QCQWEWFQ.js";
5
5
  import {
6
6
  createTaskCore,
7
7
  deleteTaskCore,
8
8
  init_tasks_crud,
9
9
  updateTaskStatus
10
- } from "./chunk-4PGS5OKU.js";
10
+ } from "./chunk-DD5KDAZM.js";
11
11
  import {
12
12
  cleanupReviewFile,
13
13
  employeeSessionName,
@@ -22,7 +22,7 @@ import {
22
22
  sendIntercom,
23
23
  sessionScopeFilter,
24
24
  writeNotification
25
- } from "./chunk-3IDUX6ZD.js";
25
+ } from "./chunk-BTK6YI4T.js";
26
26
  import {
27
27
  getTransport,
28
28
  init_transport
@@ -326,7 +326,7 @@ async function updateTask(input) {
326
326
  await markTaskNotificationsRead(taskFile);
327
327
  if (input.status === "needs_review" && !isCoordinator) {
328
328
  try {
329
- const { writeNotification: writeNotification2 } = await import("./notifications-DOGZCKY3.js");
329
+ const { writeNotification: writeNotification2 } = await import("./notifications-BBR4HK5Y.js");
330
330
  await writeNotification2({
331
331
  agentId: String(row.assigned_to),
332
332
  agentRole: String(row.assigned_to),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_tasks
3
- } from "./chunk-FKEHAW5H.js";
3
+ } from "./chunk-3Z7DZ3ZA.js";
4
4
  import {
5
5
  getProjectName,
6
6
  init_project_name
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-ZTZQ5A6B.js";
11
11
  import {
12
12
  listTasks
13
- } from "./chunk-4PGS5OKU.js";
13
+ } from "./chunk-DD5KDAZM.js";
14
14
 
15
15
  // src/mcp/tools/list-tasks.ts
16
16
  init_tasks();
@@ -6,7 +6,7 @@ import {
6
6
  resolveExeSession,
7
7
  sendIntercom,
8
8
  strictSessionScopeFilter
9
- } from "./chunk-3IDUX6ZD.js";
9
+ } from "./chunk-BTK6YI4T.js";
10
10
  import {
11
11
  getClient,
12
12
  init_database
@@ -866,10 +866,12 @@ function resolveExeSession() {
866
866
  }
867
867
  if (fromSessionName && fromEnv !== fromSessionName) {
868
868
  process.stderr.write(
869
- `[tmux-routing] WARN: EXE_SESSION_NAME="${fromEnv}" but tmux says "${fromSessionName}". Trusting tmux, correcting env var.
869
+ `[tmux-routing] WARN: session hint="${fromEnv}" but tmux says "${fromSessionName}". Trusting tmux.
870
870
  `
871
871
  );
872
- process.env.EXE_SESSION_NAME = fromSessionName;
872
+ if (!alsHint) {
873
+ process.env.EXE_SESSION_NAME = fromSessionName;
874
+ }
873
875
  } else {
874
876
  return fromEnv;
875
877
  }
@@ -961,7 +963,7 @@ async function verifyPaneAtCapacity(sessionName) {
961
963
  reason: `capture-pane failed: ${err instanceof Error ? err.message : String(err)}`
962
964
  };
963
965
  }
964
- const { isAtCapacity } = await import("./capacity-monitor-DZK4L6AI.js");
966
+ const { isAtCapacity } = await import("./capacity-monitor-GJHJGYK5.js");
965
967
  if (!isAtCapacity(pane)) {
966
968
  return {
967
969
  atCapacity: false,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_task_scope,
3
3
  sessionScopeFilter
4
- } from "./chunk-3IDUX6ZD.js";
4
+ } from "./chunk-BTK6YI4T.js";
5
5
  import {
6
6
  getClient,
7
7
  init_database
@@ -172,7 +172,7 @@ async function createTaskCore(input) {
172
172
  if (isCoordinatorSession) {
173
173
  earlySessionScope = resolved;
174
174
  } else {
175
- const { getSessionProject } = await import("./session-scope-24IMXQES.js");
175
+ const { getSessionProject } = await import("./session-scope-3OXSTZM4.js");
176
176
  const sessionProject = getSessionProject(resolved);
177
177
  if (sessionProject && sessionProject !== input.projectName) {
178
178
  scopeMismatchWarning = `session/project mismatch: session "${resolved}" owns "${sessionProject}" but task targets "${input.projectName}". Routed to default scope.`;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  processCRMEvent
3
- } from "./chunk-HQSBBKPD.js";
3
+ } from "./chunk-COS5XGKO.js";
4
4
 
5
5
  // src/gateway/adapters/crm-webhook.ts
6
6
  function parseTwentyWebhook(payload) {
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  createCRMWebhookHandler,
9
9
  parseTwentyWebhook
10
- } from "./chunk-CUEYUZKY.js";
10
+ } from "./chunk-DPFWOFVK.js";
11
11
  import {
12
12
  WhatsAppAdapter
13
13
  } from "./chunk-BU3ID2WT.js";
@@ -9,7 +9,7 @@ import {
9
9
  sessionScopeFilter,
10
10
  verifyPaneAtCapacity,
11
11
  writeNotification
12
- } from "./chunk-3IDUX6ZD.js";
12
+ } from "./chunk-BTK6YI4T.js";
13
13
  import {
14
14
  init_session_registry,
15
15
  listSessions
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createTask,
3
3
  init_tasks
4
- } from "./chunk-FKEHAW5H.js";
4
+ } from "./chunk-3Z7DZ3ZA.js";
5
5
  import {
6
6
  getActiveAgent
7
7
  } from "./chunk-ZTZQ5A6B.js";
@@ -9,7 +9,7 @@ import {
9
9
  ensureEmployee,
10
10
  init_tmux_routing,
11
11
  resolveExeSession
12
- } from "./chunk-3IDUX6ZD.js";
12
+ } from "./chunk-BTK6YI4T.js";
13
13
  import {
14
14
  getLicenseSync,
15
15
  init_plan_limits
@@ -108,7 +108,15 @@ function registerCreateTask(server) {
108
108
  try {
109
109
  const exeSession = resolveExeSession();
110
110
  if (exeSession) {
111
- const callerTmux = process.env.EXE_SESSION_NAME || process.env.EXE_SESSION || "";
111
+ let callerTmux = "";
112
+ try {
113
+ const { getAgentContext } = await import("./agent-context-CDWUZEXY.js");
114
+ callerTmux = getAgentContext()?.sessionHint ?? "";
115
+ } catch {
116
+ }
117
+ if (!callerTmux) {
118
+ callerTmux = process.env.EXE_SESSION_NAME || process.env.EXE_SESSION || "";
119
+ }
112
120
  const callerRoot = callerTmux.includes("-") ? callerTmux.split("-").pop() ?? "" : callerTmux;
113
121
  if (callerRoot && exeSession !== callerRoot && callerRoot !== exeSession) {
114
122
  process.stderr.write(
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  createTaskCore,
6
6
  init_tasks_crud
7
- } from "./chunk-4PGS5OKU.js";
7
+ } from "./chunk-DD5KDAZM.js";
8
8
  import {
9
9
  employeeSessionName,
10
10
  ensureEmployee,
@@ -13,7 +13,7 @@ import {
13
13
  init_tmux_routing,
14
14
  isEmployeeAlive,
15
15
  sessionScopeFilter
16
- } from "./chunk-3IDUX6ZD.js";
16
+ } from "./chunk-BTK6YI4T.js";
17
17
  import {
18
18
  getCoordinatorName,
19
19
  init_employees
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  init_task_scope,
13
13
  sessionScopeFilter
14
- } from "./chunk-3IDUX6ZD.js";
14
+ } from "./chunk-BTK6YI4T.js";
15
15
  import {
16
16
  getClient,
17
17
  init_database