@askexenow/exe-os 0.9.111 → 0.9.113

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 (95) hide show
  1. package/README.md +9 -7
  2. package/dist/bin/agentic-ontology-backfill.js +62 -12
  3. package/dist/bin/agentic-reflection-backfill.js +37 -2
  4. package/dist/bin/agentic-semantic-label.js +37 -2
  5. package/dist/bin/backfill-conversations.js +61 -11
  6. package/dist/bin/backfill-responses.js +62 -12
  7. package/dist/bin/backfill-vectors.js +37 -2
  8. package/dist/bin/bulk-sync-postgres.js +63 -13
  9. package/dist/bin/cleanup-stale-review-tasks.js +83 -16
  10. package/dist/bin/cli.js +312 -80
  11. package/dist/bin/exe-agent-config.js +7 -1
  12. package/dist/bin/exe-agent.js +29 -3
  13. package/dist/bin/exe-assign.js +62 -12
  14. package/dist/bin/exe-boot.js +500 -151
  15. package/dist/bin/exe-call.js +46 -5
  16. package/dist/bin/exe-cloud.js +101 -16
  17. package/dist/bin/exe-dispatch.js +827 -27
  18. package/dist/bin/exe-doctor.js +61 -11
  19. package/dist/bin/exe-export-behaviors.js +67 -14
  20. package/dist/bin/exe-forget.js +62 -12
  21. package/dist/bin/exe-gateway.js +147 -27
  22. package/dist/bin/exe-heartbeat.js +83 -16
  23. package/dist/bin/exe-kill.js +62 -12
  24. package/dist/bin/exe-launch-agent.js +83 -15
  25. package/dist/bin/exe-new-employee.js +176 -8
  26. package/dist/bin/exe-pending-messages.js +83 -16
  27. package/dist/bin/exe-pending-notifications.js +83 -16
  28. package/dist/bin/exe-pending-reviews.js +83 -16
  29. package/dist/bin/exe-rename.js +62 -12
  30. package/dist/bin/exe-review.js +62 -12
  31. package/dist/bin/exe-search.js +62 -12
  32. package/dist/bin/exe-session-cleanup.js +949 -149
  33. package/dist/bin/exe-settings.js +10 -4
  34. package/dist/bin/exe-start-codex.js +537 -248
  35. package/dist/bin/exe-start-opencode.js +547 -168
  36. package/dist/bin/exe-status.js +83 -16
  37. package/dist/bin/exe-support.js +1 -1
  38. package/dist/bin/exe-team.js +62 -12
  39. package/dist/bin/git-sweep.js +827 -27
  40. package/dist/bin/graph-backfill.js +62 -12
  41. package/dist/bin/graph-export.js +62 -12
  42. package/dist/bin/install.js +62 -4
  43. package/dist/bin/intercom-check.js +949 -149
  44. package/dist/bin/pre-publish.js +14 -2
  45. package/dist/bin/scan-tasks.js +827 -27
  46. package/dist/bin/setup.js +99 -14
  47. package/dist/bin/shard-migrate.js +62 -12
  48. package/dist/bin/stack-update.js +1 -1
  49. package/dist/bin/update.js +3 -3
  50. package/dist/gateway/index.js +586 -26
  51. package/dist/hooks/bug-report-worker.js +586 -26
  52. package/dist/hooks/codex-stop-task-finalizer.js +977 -143
  53. package/dist/hooks/commit-complete.js +827 -27
  54. package/dist/hooks/error-recall.js +62 -12
  55. package/dist/hooks/ingest.js +4579 -249
  56. package/dist/hooks/instructions-loaded.js +62 -12
  57. package/dist/hooks/notification.js +62 -12
  58. package/dist/hooks/post-compact.js +83 -16
  59. package/dist/hooks/post-tool-combined.js +83 -16
  60. package/dist/hooks/pre-compact.js +907 -107
  61. package/dist/hooks/pre-tool-use.js +98 -16
  62. package/dist/hooks/prompt-submit.js +596 -30
  63. package/dist/hooks/session-end.js +909 -112
  64. package/dist/hooks/session-start.js +112 -17
  65. package/dist/hooks/stop.js +82 -15
  66. package/dist/hooks/subagent-stop.js +83 -16
  67. package/dist/hooks/summary-worker.js +81 -8
  68. package/dist/index.js +595 -29
  69. package/dist/lib/agent-config.js +16 -1
  70. package/dist/lib/cloud-sync.js +45 -1
  71. package/dist/lib/consolidation.js +16 -1
  72. package/dist/lib/database.js +23 -0
  73. package/dist/lib/db.js +23 -0
  74. package/dist/lib/device-registry.js +23 -0
  75. package/dist/lib/employee-templates.js +30 -4
  76. package/dist/lib/employees.js +16 -1
  77. package/dist/lib/exe-daemon.js +482 -52
  78. package/dist/lib/hybrid-search.js +62 -12
  79. package/dist/lib/license.js +3 -3
  80. package/dist/lib/messaging.js +21 -4
  81. package/dist/lib/schedules.js +37 -2
  82. package/dist/lib/skill-learning.js +910 -41
  83. package/dist/lib/status-brief.js +14 -1
  84. package/dist/lib/store.js +62 -12
  85. package/dist/lib/tasks.js +843 -93
  86. package/dist/lib/tmux-routing.js +766 -16
  87. package/dist/mcp/server.js +238 -41
  88. package/dist/mcp/tools/create-task.js +525 -15
  89. package/dist/mcp/tools/deactivate-behavior.js +33 -24
  90. package/dist/mcp/tools/list-tasks.js +21 -4
  91. package/dist/mcp/tools/send-message.js +21 -4
  92. package/dist/mcp/tools/update-task.js +840 -93
  93. package/dist/runtime/index.js +913 -107
  94. package/dist/tui/App.js +227 -58
  95. package/package.json +1 -1
@@ -175,7 +175,7 @@ function getAgentRuntime(agentId) {
175
175
  if (orgDefault) return orgDefault;
176
176
  return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
177
177
  }
178
- function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
178
+ function setAgentRuntime(agentId, runtime, model, reasoning_effort, mcps) {
179
179
  const knownModels = KNOWN_RUNTIMES[runtime];
180
180
  if (!knownModels) {
181
181
  return {
@@ -190,12 +190,26 @@ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
190
190
  };
191
191
  }
192
192
  const config = loadAgentConfig();
193
+ const existing = config[agentId];
193
194
  const entry = { runtime, model };
194
195
  if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
196
+ if (mcps !== void 0) {
197
+ entry.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
198
+ } else if (existing?.mcps) {
199
+ entry.mcps = existing.mcps;
200
+ }
195
201
  config[agentId] = entry;
196
202
  saveAgentConfig(config);
197
203
  return { ok: true };
198
204
  }
205
+ function setAgentMcps(agentId, mcps) {
206
+ const config = loadAgentConfig();
207
+ const existing = config[agentId] ?? getAgentRuntime(agentId);
208
+ existing.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
209
+ config[agentId] = existing;
210
+ saveAgentConfig(config);
211
+ return { ok: true };
212
+ }
199
213
  function clearAgentRuntime(agentId) {
200
214
  const config = loadAgentConfig();
201
215
  delete config[agentId];
@@ -210,5 +224,6 @@ export {
210
224
  getAgentRuntime,
211
225
  loadAgentConfig,
212
226
  saveAgentConfig,
227
+ setAgentMcps,
213
228
  setAgentRuntime
214
229
  };
@@ -1749,6 +1749,13 @@ async function ensureSchema() {
1749
1749
  } catch (e) {
1750
1750
  logCatchDebug("migration", e);
1751
1751
  }
1752
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1753
+ try {
1754
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1755
+ } catch (e) {
1756
+ logCatchDebug("migration", e);
1757
+ }
1758
+ }
1752
1759
  try {
1753
1760
  await client.execute({
1754
1761
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -2965,6 +2972,22 @@ async function ensureSchema() {
2965
2972
  } catch (e) {
2966
2973
  logCatchDebug("migration", e);
2967
2974
  }
2975
+ try {
2976
+ await client.execute({
2977
+ sql: `ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'`,
2978
+ args: []
2979
+ });
2980
+ } catch (e) {
2981
+ logCatchDebug("migration", e);
2982
+ }
2983
+ try {
2984
+ await client.execute({
2985
+ sql: `ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0`,
2986
+ args: []
2987
+ });
2988
+ } catch (e) {
2989
+ logCatchDebug("migration", e);
2990
+ }
2968
2991
  }
2969
2992
  async function disposeDatabase() {
2970
2993
  if (_walCheckpointTimer) {
@@ -3935,7 +3958,7 @@ import { jwtVerify, importSPKI } from "jose";
3935
3958
  var LICENSE_PATH = path6.join(EXE_AI_DIR, "license.key");
3936
3959
  var CACHE_PATH = path6.join(EXE_AI_DIR, "license-cache.json");
3937
3960
  var DEVICE_ID_PATH = path6.join(EXE_AI_DIR, "device-id");
3938
- var API_BASE = process.env.EXE_CLOUD_ENDPOINT ?? "https://askexe.com/cloud";
3961
+ var API_BASE = process.env.EXE_CLOUD_ENDPOINT ?? "https://cloud.askexe.com";
3939
3962
  function loadDeviceId() {
3940
3963
  const deviceJsonPath = path6.join(EXE_AI_DIR, "device.json");
3941
3964
  try {
@@ -4360,6 +4383,27 @@ async function cloudSync(config) {
4360
4383
  if (stmts.length > 0) await client.batch(stmts, "write");
4361
4384
  pulled = pullResult.records.length;
4362
4385
  } else {
4386
+ try {
4387
+ const incomingIds = pullResult.records.map((r) => sqlSafe(r.id));
4388
+ if (incomingIds.length > 0) {
4389
+ const ph = incomingIds.map(() => "?").join(",");
4390
+ const existing = await client.execute({
4391
+ sql: `SELECT id, version, timestamp FROM memories WHERE id IN (${ph})`,
4392
+ args: incomingIds
4393
+ });
4394
+ const localMap = new Map(existing.rows.map((r) => [String(r.id), r]));
4395
+ for (const rec of pullResult.records) {
4396
+ const local = localMap.get(String(rec.id));
4397
+ if (local && Number(local.version) > 0 && Number(local.version) !== Number(rec.version ?? 0)) {
4398
+ process.stderr.write(
4399
+ `[cloud-sync] CONFLICT: memory ${String(rec.id).slice(0, 8)} \u2014 local v${local.version} vs remote v${rec.version ?? 0}. Remote wins (LWW).
4400
+ `
4401
+ );
4402
+ }
4403
+ }
4404
+ }
4405
+ } catch {
4406
+ }
4363
4407
  const stmts = pullResult.records.map((rec) => ({
4364
4408
  sql: `INSERT OR REPLACE INTO memories
4365
4409
  (id, agent_id, agent_role, session_id, timestamp,
@@ -184,6 +184,7 @@ __export(agent_config_exports, {
184
184
  getAgentRuntime: () => getAgentRuntime,
185
185
  loadAgentConfig: () => loadAgentConfig,
186
186
  saveAgentConfig: () => saveAgentConfig,
187
+ setAgentMcps: () => setAgentMcps,
187
188
  setAgentRuntime: () => setAgentRuntime
188
189
  });
189
190
  import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync3 } from "fs";
@@ -210,7 +211,7 @@ function getAgentRuntime(agentId) {
210
211
  if (orgDefault) return orgDefault;
211
212
  return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
212
213
  }
213
- function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
214
+ function setAgentRuntime(agentId, runtime, model, reasoning_effort, mcps) {
214
215
  const knownModels = KNOWN_RUNTIMES[runtime];
215
216
  if (!knownModels) {
216
217
  return {
@@ -225,12 +226,26 @@ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
225
226
  };
226
227
  }
227
228
  const config = loadAgentConfig();
229
+ const existing = config[agentId];
228
230
  const entry = { runtime, model };
229
231
  if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
232
+ if (mcps !== void 0) {
233
+ entry.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
234
+ } else if (existing?.mcps) {
235
+ entry.mcps = existing.mcps;
236
+ }
230
237
  config[agentId] = entry;
231
238
  saveAgentConfig(config);
232
239
  return { ok: true };
233
240
  }
241
+ function setAgentMcps(agentId, mcps) {
242
+ const config = loadAgentConfig();
243
+ const existing = config[agentId] ?? getAgentRuntime(agentId);
244
+ existing.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
245
+ config[agentId] = existing;
246
+ saveAgentConfig(config);
247
+ return { ok: true };
248
+ }
234
249
  function clearAgentRuntime(agentId) {
235
250
  const config = loadAgentConfig();
236
251
  delete config[agentId];
@@ -1662,6 +1662,13 @@ async function ensureSchema() {
1662
1662
  } catch (e) {
1663
1663
  logCatchDebug("migration", e);
1664
1664
  }
1665
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1666
+ try {
1667
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1668
+ } catch (e) {
1669
+ logCatchDebug("migration", e);
1670
+ }
1671
+ }
1665
1672
  try {
1666
1673
  await client.execute({
1667
1674
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -2878,6 +2885,22 @@ async function ensureSchema() {
2878
2885
  } catch (e) {
2879
2886
  logCatchDebug("migration", e);
2880
2887
  }
2888
+ try {
2889
+ await client.execute({
2890
+ sql: `ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'`,
2891
+ args: []
2892
+ });
2893
+ } catch (e) {
2894
+ logCatchDebug("migration", e);
2895
+ }
2896
+ try {
2897
+ await client.execute({
2898
+ sql: `ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0`,
2899
+ args: []
2900
+ });
2901
+ } catch (e) {
2902
+ logCatchDebug("migration", e);
2903
+ }
2881
2904
  }
2882
2905
  var disposeTurso = disposeDatabase;
2883
2906
  async function disposeDatabase() {
package/dist/lib/db.js CHANGED
@@ -1662,6 +1662,13 @@ async function ensureSchema() {
1662
1662
  } catch (e) {
1663
1663
  logCatchDebug("migration", e);
1664
1664
  }
1665
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1666
+ try {
1667
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1668
+ } catch (e) {
1669
+ logCatchDebug("migration", e);
1670
+ }
1671
+ }
1665
1672
  try {
1666
1673
  await client.execute({
1667
1674
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -2878,6 +2885,22 @@ async function ensureSchema() {
2878
2885
  } catch (e) {
2879
2886
  logCatchDebug("migration", e);
2880
2887
  }
2888
+ try {
2889
+ await client.execute({
2890
+ sql: `ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'`,
2891
+ args: []
2892
+ });
2893
+ } catch (e) {
2894
+ logCatchDebug("migration", e);
2895
+ }
2896
+ try {
2897
+ await client.execute({
2898
+ sql: `ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0`,
2899
+ args: []
2900
+ });
2901
+ } catch (e) {
2902
+ logCatchDebug("migration", e);
2903
+ }
2881
2904
  }
2882
2905
  var disposeTurso = disposeDatabase;
2883
2906
  async function disposeDatabase() {
@@ -1688,6 +1688,13 @@ async function ensureSchema() {
1688
1688
  } catch (e) {
1689
1689
  logCatchDebug("migration", e);
1690
1690
  }
1691
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1692
+ try {
1693
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1694
+ } catch (e) {
1695
+ logCatchDebug("migration", e);
1696
+ }
1697
+ }
1691
1698
  try {
1692
1699
  await client.execute({
1693
1700
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -2904,6 +2911,22 @@ async function ensureSchema() {
2904
2911
  } catch (e) {
2905
2912
  logCatchDebug("migration", e);
2906
2913
  }
2914
+ try {
2915
+ await client.execute({
2916
+ sql: `ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'`,
2917
+ args: []
2918
+ });
2919
+ } catch (e) {
2920
+ logCatchDebug("migration", e);
2921
+ }
2922
+ try {
2923
+ await client.execute({
2924
+ sql: `ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0`,
2925
+ args: []
2926
+ });
2927
+ } catch (e) {
2928
+ logCatchDebug("migration", e);
2929
+ }
2907
2930
  }
2908
2931
  async function disposeDatabase() {
2909
2932
  if (_walCheckpointTimer) {
@@ -197,11 +197,17 @@ var PLATFORM_PROCEDURES = [
197
197
  content: "Founder -> coordinator (the executive agent, internally routed as 'COO') -> CTO/CMO. CTO -> engineers. CMO -> content production. Never skip levels: the coordinator does not bypass managers for specialist work. Specialists report to their manager. If you need cross-team info, use ask_team_memory \u2014 don't read other agents' task folders. Each level owns dispatch downward and review upward."
198
198
  },
199
199
  {
200
- title: "Customer orchestration maturity \u2014 recommend, never trap",
200
+ title: "Orchestration phase guidance \u2014 recommend, never trap",
201
201
  domain: "workflow",
202
202
  priority: "p1",
203
203
  content: "New customers start best in Phase 1: founder \u2194 coordinator/Chief of Staff, building company context. Suggest Phase 2 executives when domain work repeats; suggest Phase 3 parallel execution only when review/permission gates are ready. This is guidance, not a blocker: users may jump phases anytime. Never overwrite their phase, role titles, identities, or custom org design."
204
204
  },
205
+ {
206
+ title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
207
+ domain: "identity",
208
+ priority: "p0",
209
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
210
+ },
205
211
  {
206
212
  title: "Single dispatch path \u2014 create_task only",
207
213
  domain: "workflow",
@@ -235,6 +241,12 @@ var PLATFORM_PROCEDURES = [
235
241
  priority: "p0",
236
242
  content: "NEVER: (1) Access the database directly \u2014 it's SQLCipher encrypted, always fails. Use MCP tools only. (2) Manually spawn tmux sessions \u2014 create_task handles it. (3) Run git checkout main \u2014 agents work in worktrees. (4) Modify another agent's in-progress task. (5) Push to remote \u2014 the COO reviews and pushes. (6) Skip update_task(done) \u2014 it's the ONLY way your work gets reviewed. (7) Run git init."
237
243
  },
244
+ {
245
+ title: "Destructive operations \u2014 mandatory reviewer gate",
246
+ domain: "security",
247
+ priority: "p0",
248
+ content: "Before ANY destructive operation (delete, remove, overwrite, drop, reset, force-push, truncate), you MUST: (1) Have your full task spec accessible \u2014 if you cannot read it, STOP and report to your reviewer. Never improvise destructive actions. (2) Confirm with your reviewer (assigned_by or COO) before executing. (3) If the task spec explicitly authorizes the operation, proceed \u2014 but log it. Violation = immediate task failure. This applies to ALL agents regardless of role."
249
+ },
238
250
  {
239
251
  title: "Customer patch triage \u2014 upstream bug vs customization",
240
252
  domain: "support",
@@ -386,7 +398,7 @@ var PLATFORM_PROCEDURES = [
386
398
  title: "MCP tool dispatch \u2014 all tools use action parameter",
387
399
  domain: "tool-use",
388
400
  priority: "p0",
389
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
401
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
390
402
  },
391
403
  {
392
404
  title: "MCP tools \u2014 memory, decision, and search",
@@ -601,9 +613,23 @@ var PROCEDURES_MARKER = "EXE OS \u2014 VISION AND NON-NEGOTIABLE PRINCIPLES";
601
613
  function getSessionPrompt(storedPrompt) {
602
614
  const markerIndex = storedPrompt.indexOf(PROCEDURES_MARKER);
603
615
  const withoutProcedures = markerIndex >= 0 ? storedPrompt.slice(0, markerIndex).trimEnd() : storedPrompt;
616
+ let titlePrefix = "";
617
+ const frontmatterMatch = withoutProcedures.match(/^---\r?\n([\s\S]*?)\r?\n---/);
618
+ if (frontmatterMatch) {
619
+ const titleMatch = frontmatterMatch[1].match(/^title:\s*(.+)$/m);
620
+ const roleMatch = frontmatterMatch[1].match(/^role:\s*(.+)$/m);
621
+ if (titleMatch) {
622
+ const title = titleMatch[1].trim();
623
+ const role = roleMatch ? roleMatch[1].trim() : "";
624
+ if (title && role && title.toLowerCase() !== role.toLowerCase()) {
625
+ titlePrefix = `## Your Identity
626
+ You are **${title}** (specialist). `;
627
+ }
628
+ }
629
+ }
604
630
  const rolePrompt = withoutProcedures.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/, "").replace(/<!--[\s\S]*?-->/g, "").trimStart();
605
631
  const globalBlock = getGlobalProceduresBlock();
606
- return `${globalBlock}${rolePrompt}
632
+ return `${globalBlock}${titlePrefix}${rolePrompt}
607
633
  ${BASE_OPERATING_PROCEDURES}`;
608
634
  }
609
635
  var TEMPLATES = {
@@ -1056,7 +1082,7 @@ var CLIENT_COO_PLACEHOLDERS = [
1056
1082
  "title"
1057
1083
  ];
1058
1084
  function renderClientCOOTemplate(vars) {
1059
- const resolved = { ...vars, title: vars.title || "Chief Operating Officer" };
1085
+ const resolved = { ...vars, title: vars.title || "Chief of Staff" };
1060
1086
  for (const key of CLIENT_COO_PLACEHOLDERS) {
1061
1087
  const value = resolved[key];
1062
1088
  if (typeof value !== "string" || value.length === 0) {
@@ -170,6 +170,7 @@ __export(agent_config_exports, {
170
170
  getAgentRuntime: () => getAgentRuntime,
171
171
  loadAgentConfig: () => loadAgentConfig,
172
172
  saveAgentConfig: () => saveAgentConfig,
173
+ setAgentMcps: () => setAgentMcps,
173
174
  setAgentRuntime: () => setAgentRuntime
174
175
  });
175
176
  import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync3 } from "fs";
@@ -196,7 +197,7 @@ function getAgentRuntime(agentId) {
196
197
  if (orgDefault) return orgDefault;
197
198
  return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
198
199
  }
199
- function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
200
+ function setAgentRuntime(agentId, runtime, model, reasoning_effort, mcps) {
200
201
  const knownModels = KNOWN_RUNTIMES[runtime];
201
202
  if (!knownModels) {
202
203
  return {
@@ -211,12 +212,26 @@ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
211
212
  };
212
213
  }
213
214
  const config = loadAgentConfig();
215
+ const existing = config[agentId];
214
216
  const entry = { runtime, model };
215
217
  if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
218
+ if (mcps !== void 0) {
219
+ entry.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
220
+ } else if (existing?.mcps) {
221
+ entry.mcps = existing.mcps;
222
+ }
216
223
  config[agentId] = entry;
217
224
  saveAgentConfig(config);
218
225
  return { ok: true };
219
226
  }
227
+ function setAgentMcps(agentId, mcps) {
228
+ const config = loadAgentConfig();
229
+ const existing = config[agentId] ?? getAgentRuntime(agentId);
230
+ existing.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
231
+ config[agentId] = existing;
232
+ saveAgentConfig(config);
233
+ return { ok: true };
234
+ }
220
235
  function clearAgentRuntime(agentId) {
221
236
  const config = loadAgentConfig();
222
237
  delete config[agentId];