@askexenow/exe-os 0.9.14 → 0.9.16

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 (61) hide show
  1. package/dist/bin/cleanup-stale-review-tasks.js +10 -0
  2. package/dist/bin/cli.js +35 -6
  3. package/dist/bin/exe-agent-config.js +4 -2
  4. package/dist/bin/exe-assign.js +12 -0
  5. package/dist/bin/exe-boot.js +18 -4
  6. package/dist/bin/exe-call.js +4 -2
  7. package/dist/bin/exe-dispatch.js +18 -4
  8. package/dist/bin/exe-forget.js +16 -0
  9. package/dist/bin/exe-gateway.js +35 -6
  10. package/dist/bin/exe-heartbeat.js +10 -0
  11. package/dist/bin/exe-launch-agent.js +4 -2
  12. package/dist/bin/exe-new-employee.js +4 -2
  13. package/dist/bin/exe-pending-messages.js +10 -0
  14. package/dist/bin/exe-pending-notifications.js +10 -0
  15. package/dist/bin/exe-pending-reviews.js +10 -0
  16. package/dist/bin/exe-search.js +74 -1
  17. package/dist/bin/exe-session-cleanup.js +31 -4
  18. package/dist/bin/exe-settings.js +4 -2
  19. package/dist/bin/exe-start-codex.js +4 -0
  20. package/dist/bin/exe-status.js +10 -0
  21. package/dist/bin/git-sweep.js +31 -4
  22. package/dist/bin/install.js +4 -2
  23. package/dist/bin/scan-tasks.js +31 -4
  24. package/dist/bin/setup.js +4 -2
  25. package/dist/gateway/index.js +35 -6
  26. package/dist/hooks/bug-report-worker.js +22 -6
  27. package/dist/hooks/codex-stop-task-finalizer.js +21 -11
  28. package/dist/hooks/commit-complete.js +31 -4
  29. package/dist/hooks/error-recall.js +74 -1
  30. package/dist/hooks/ingest-worker.js +18 -4
  31. package/dist/hooks/ingest.js +17 -2
  32. package/dist/hooks/instructions-loaded.js +13 -0
  33. package/dist/hooks/notification.js +13 -0
  34. package/dist/hooks/post-compact.js +23 -0
  35. package/dist/hooks/pre-compact.js +31 -4
  36. package/dist/hooks/pre-tool-use.js +27 -2
  37. package/dist/hooks/prompt-submit.js +96 -7
  38. package/dist/hooks/session-end.js +31 -4
  39. package/dist/hooks/session-start.js +88 -3
  40. package/dist/hooks/stop.js +23 -0
  41. package/dist/hooks/subagent-stop.js +23 -0
  42. package/dist/hooks/summary-worker.js +10 -0
  43. package/dist/index.js +35 -6
  44. package/dist/lib/agent-config.js +4 -2
  45. package/dist/lib/employees.js +4 -2
  46. package/dist/lib/exe-daemon.js +139 -38
  47. package/dist/lib/hybrid-search.js +74 -1
  48. package/dist/lib/messaging.js +15 -5
  49. package/dist/lib/store.js +13 -0
  50. package/dist/lib/tasks.js +18 -4
  51. package/dist/lib/tmux-routing.js +18 -4
  52. package/dist/lib/tmux-transport.js +10 -0
  53. package/dist/lib/transport.js +10 -0
  54. package/dist/mcp/server.js +107 -18
  55. package/dist/mcp/tools/create-task.js +22 -6
  56. package/dist/mcp/tools/list-tasks.js +10 -0
  57. package/dist/mcp/tools/send-message.js +17 -7
  58. package/dist/mcp/tools/update-task.js +18 -4
  59. package/dist/runtime/index.js +31 -4
  60. package/dist/tui/App.js +35 -6
  61. package/package.json +1 -1
@@ -2680,6 +2680,7 @@ ${p.content}`).join("\n\n");
2680
2680
  var store_exports = {};
2681
2681
  __export(store_exports, {
2682
2682
  attachDocumentMetadata: () => attachDocumentMetadata,
2683
+ buildRawVisibilityFilter: () => buildRawVisibilityFilter,
2683
2684
  buildWikiScopeFilter: () => buildWikiScopeFilter,
2684
2685
  classifyTier: () => classifyTier,
2685
2686
  disposeStore: () => disposeStore,
@@ -3049,6 +3050,15 @@ function buildWikiScopeFilter(options, columnPrefix) {
3049
3050
  }
3050
3051
  return { clause, args };
3051
3052
  }
3053
+ function buildRawVisibilityFilter(options, columnPrefix) {
3054
+ if (options?.includeRaw === false) {
3055
+ return {
3056
+ clause: ` AND COALESCE(${columnPrefix}memory_type, 'raw') != 'raw'`,
3057
+ args: []
3058
+ };
3059
+ }
3060
+ return { clause: "", args: [] };
3061
+ }
3052
3062
  async function searchMemories(queryVector, agentId, options) {
3053
3063
  let client;
3054
3064
  try {
@@ -3081,6 +3091,9 @@ async function searchMemories(queryVector, agentId, options) {
3081
3091
  const scope = buildWikiScopeFilter(options, "");
3082
3092
  sql += scope.clause;
3083
3093
  args.push(...scope.args);
3094
+ const rawVisibility = buildRawVisibilityFilter(options, "");
3095
+ sql += rawVisibility.clause;
3096
+ args.push(...rawVisibility.args);
3084
3097
  if (options?.projectName) {
3085
3098
  sql += ` AND project_name = ?`;
3086
3099
  args.push(options.projectName);
@@ -4853,6 +4866,7 @@ var RRF_K = 60;
4853
4866
  async function hybridSearch(queryText, agentId, options) {
4854
4867
  const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
4855
4868
  const config = await loadConfig2();
4869
+ const searchStartMs = Date.now();
4856
4870
  if (config.searchMode === "fts") {
4857
4871
  return lightweightSearch(queryText, agentId, options);
4858
4872
  }
@@ -4945,12 +4959,14 @@ async function hybridSearch(queryText, agentId, options) {
4945
4959
  const rrfLimit = effectiveIsBroad ? Math.max(limit * 5, 150) : limit;
4946
4960
  let merged = lists.length === 1 ? lists[0].slice(0, rrfLimit) : rrfMergeMulti(lists, rrfLimit, RRF_K, weights);
4947
4961
  let graphContextMap = /* @__PURE__ */ new Map();
4962
+ let entityBoostRan = false;
4948
4963
  if (merged.length > 0) {
4949
4964
  try {
4950
4965
  const { applyEntityBoost: applyEntityBoost2 } = await Promise.resolve().then(() => (init_entity_boost(), entity_boost_exports));
4951
4966
  const boosted = await applyEntityBoost2(merged, effectiveQuery, getClient());
4952
4967
  merged = boosted.results;
4953
4968
  graphContextMap = boosted.graphContext;
4969
+ entityBoostRan = true;
4954
4970
  } catch {
4955
4971
  }
4956
4972
  }
@@ -4996,6 +5012,41 @@ async function hybridSearch(queryText, agentId, options) {
4996
5012
  if (options?.includeSource && finalResults.length > 0) {
4997
5013
  await attachDocumentMetadata(finalResults);
4998
5014
  }
5015
+ if (process.env.EXE_SEARCH_LOG !== "0") {
5016
+ const logEntry = {
5017
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
5018
+ query: queryText,
5019
+ agentId,
5020
+ signals: {
5021
+ fts: ftsResults.length,
5022
+ vector: vectorResults.length,
5023
+ grep: grepResults.length,
5024
+ entityBoost: entityBoostRan,
5025
+ reranker: rerankedAndBlended !== null,
5026
+ selfQueryRouter: effectiveQuery !== queryText
5027
+ },
5028
+ topResults: finalResults.slice(0, 10).map((r, i) => {
5029
+ const scored = r;
5030
+ return {
5031
+ rank: i + 1,
5032
+ id: r.id.slice(0, 8),
5033
+ tool: r.tool_name,
5034
+ score: scored.distance ?? null,
5035
+ age_hours: Math.round((Date.now() - new Date(r.timestamp).getTime()) / 36e5)
5036
+ };
5037
+ }),
5038
+ latencyMs: Date.now() - searchStartMs
5039
+ };
5040
+ try {
5041
+ const fs = await import("fs");
5042
+ const path11 = await import("path");
5043
+ const os6 = await import("os");
5044
+ const logPath = path11.join(os6.homedir(), ".exe-os", "search-quality.jsonl");
5045
+ fs.mkdirSync(path11.dirname(logPath), { recursive: true });
5046
+ fs.appendFileSync(logPath, JSON.stringify(logEntry) + "\n");
5047
+ } catch {
5048
+ }
5049
+ }
4999
5050
  if (finalResults.length > 0) {
5000
5051
  const now = (/* @__PURE__ */ new Date()).toISOString();
5001
5052
  const ids = finalResults.map((r) => r.id);
@@ -5019,6 +5070,9 @@ async function estimateCardinality(agentId, options) {
5019
5070
  AND COALESCE(status, 'active') = 'active'
5020
5071
  AND COALESCE(confidence, 0.7) >= 0.3`;
5021
5072
  const args = [agentId];
5073
+ const rawVisibility = buildRawVisibilityFilter(options, "");
5074
+ sql += rawVisibility.clause;
5075
+ args.push(...rawVisibility.args);
5022
5076
  if (options?.projectName) {
5023
5077
  sql += ` AND project_name = ?`;
5024
5078
  args.push(options.projectName);
@@ -5054,6 +5108,15 @@ function frecencyBoost(lastAccessed, timestamp) {
5054
5108
  const hoursSince = Math.max(0, (Date.now() - accessTime) / (1e3 * 60 * 60));
5055
5109
  return Math.exp(-0.01 * hoursSince);
5056
5110
  }
5111
+ function sourceConfidence(record) {
5112
+ const tool = record.tool_name?.toLowerCase() ?? "";
5113
+ if (tool === "manual" || tool === "store_memory") return 0.95;
5114
+ if (tool === "auto-summary" || tool === "consolidation") return 0.9;
5115
+ if (tool === "userprompt" || tool === "assistantresponse") return 0.75;
5116
+ if (tool === "bash" || tool === "write" || tool === "edit") return 0.6;
5117
+ if (tool === "file_grep" || tool === "file_read") return 0.5;
5118
+ return record.confidence ?? 0.5;
5119
+ }
5057
5120
  function rrfMergeMulti(lists, limit, k = RRF_K, weights) {
5058
5121
  const scores = /* @__PURE__ */ new Map();
5059
5122
  for (let listIdx = 0; listIdx < lists.length; listIdx++) {
@@ -5069,7 +5132,7 @@ function rrfMergeMulti(lists, limit, k = RRF_K, weights) {
5069
5132
  const entries = Array.from(scores.values()).map((e) => {
5070
5133
  const recency = recencyScore(e.record.timestamp);
5071
5134
  const importance = normalizedImportance(e.record.importance);
5072
- const confidence = e.record.confidence ?? 0.7;
5135
+ const confidence = sourceConfidence(e.record);
5073
5136
  const frecency = frecencyBoost(e.record.last_accessed, e.record.timestamp);
5074
5137
  const baseScore = e.rrfScore * 0.35 + recency * 0.14 + importance * 0.21 + confidence * 0.3;
5075
5138
  const finalScore = baseScore * (1 + 0.3 * frecency);
@@ -5125,6 +5188,9 @@ async function ftsQuery(client, matchExpr, agentId, options, limit) {
5125
5188
  const scope = buildWikiScopeFilter(options, "m.");
5126
5189
  sql += scope.clause;
5127
5190
  args.push(...scope.args);
5191
+ const rawVisibility = buildRawVisibilityFilter(options, "m.");
5192
+ sql += rawVisibility.clause;
5193
+ args.push(...rawVisibility.args);
5128
5194
  if (options?.projectName) {
5129
5195
  sql += ` AND m.project_name = ?`;
5130
5196
  args.push(options.projectName);
@@ -5200,6 +5266,7 @@ async function recentRecords(agentId, options, limit, textFilter) {
5200
5266
  WHERE agent_id = ?
5201
5267
  AND timestamp >= ? AND timestamp <= ?
5202
5268
  AND COALESCE(status, 'active') = 'active'
5269
+ AND ${options?.includeRaw === false ? "COALESCE(memory_type, 'raw') != 'raw'" : "1 = 1"}
5203
5270
  AND COALESCE(confidence, 0.7) >= 0.3
5204
5271
  ORDER BY timestamp DESC LIMIT ?`,
5205
5272
  args: [agentId, windowStart, killedAt, boundarySlots]
@@ -5229,6 +5296,9 @@ async function recentRecords(agentId, options, limit, textFilter) {
5229
5296
  const scope = buildWikiScopeFilter(options, "");
5230
5297
  sql += scope.clause;
5231
5298
  args.push(...scope.args);
5299
+ const rawVisibility = buildRawVisibilityFilter(options, "");
5300
+ sql += rawVisibility.clause;
5301
+ args.push(...rawVisibility.args);
5232
5302
  if (options?.projectName) {
5233
5303
  sql += ` AND project_name = ?`;
5234
5304
  args.push(options.projectName);
@@ -5338,6 +5408,9 @@ async function trajectoryBypass(queryText, agentId, options, limit) {
5338
5408
  AND json_extract(trajectory, '$.tool') = ?
5339
5409
  AND agent_id = ?${statusFilter}${draftFilter}`;
5340
5410
  const args = [toolName, agentId];
5411
+ const rawVisibility = buildRawVisibilityFilter(options, "");
5412
+ sql += rawVisibility.clause;
5413
+ args.push(...rawVisibility.args);
5341
5414
  if (options?.projectName) {
5342
5415
  sql += ` AND project_name = ?`;
5343
5416
  args.push(options.projectName);
@@ -3421,6 +3421,7 @@ ${p.content}`).join("\n\n");
3421
3421
  var store_exports = {};
3422
3422
  __export(store_exports, {
3423
3423
  attachDocumentMetadata: () => attachDocumentMetadata,
3424
+ buildRawVisibilityFilter: () => buildRawVisibilityFilter,
3424
3425
  buildWikiScopeFilter: () => buildWikiScopeFilter,
3425
3426
  classifyTier: () => classifyTier,
3426
3427
  disposeStore: () => disposeStore,
@@ -3790,6 +3791,15 @@ function buildWikiScopeFilter(options, columnPrefix) {
3790
3791
  }
3791
3792
  return { clause, args };
3792
3793
  }
3794
+ function buildRawVisibilityFilter(options, columnPrefix) {
3795
+ if (options?.includeRaw === false) {
3796
+ return {
3797
+ clause: ` AND COALESCE(${columnPrefix}memory_type, 'raw') != 'raw'`,
3798
+ args: []
3799
+ };
3800
+ }
3801
+ return { clause: "", args: [] };
3802
+ }
3793
3803
  async function searchMemories(queryVector, agentId, options) {
3794
3804
  let client;
3795
3805
  try {
@@ -3822,6 +3832,9 @@ async function searchMemories(queryVector, agentId, options) {
3822
3832
  const scope = buildWikiScopeFilter(options, "");
3823
3833
  sql += scope.clause;
3824
3834
  args.push(...scope.args);
3835
+ const rawVisibility = buildRawVisibilityFilter(options, "");
3836
+ sql += rawVisibility.clause;
3837
+ args.push(...rawVisibility.args);
3825
3838
  if (options?.projectName) {
3826
3839
  sql += ` AND project_name = ?`;
3827
3840
  args.push(options.projectName);
@@ -4135,6 +4148,16 @@ var init_tmux_transport = __esm({
4135
4148
  sendKeys(target, keys) {
4136
4149
  execFileSync("tmux", ["send-keys", "-t", target, keys, "Enter"], QUIET);
4137
4150
  }
4151
+ /**
4152
+ * Send text as literal characters, then submit with Enter as a separate call.
4153
+ * Fixes Codex intercom bug: long text + Enter in one send-keys blast causes
4154
+ * Codex to drop the Enter. Splitting them ensures the text renders before
4155
+ * the submit keystroke arrives.
4156
+ */
4157
+ sendKeysLiteral(target, text) {
4158
+ execFileSync("tmux", ["send-keys", "-t", target, "-l", text], QUIET);
4159
+ execFileSync("tmux", ["send-keys", "-t", target, "Enter"], QUIET);
4160
+ }
4138
4161
  capturePane(target, lines) {
4139
4162
  const args = ["capture-pane", "-t", target, "-p"];
4140
4163
  if (lines) args.push("-S", `-${lines}`);
@@ -7020,10 +7043,11 @@ function sendIntercom(targetSession) {
7020
7043
  const agentName2 = baseAgentName(rawAgentName);
7021
7044
  const rtConfig = getAgentRuntime(agentName2);
7022
7045
  if (rtConfig.runtime === "codex" || rtConfig.runtime === "opencode") {
7023
- transport.sendKeys(targetSession, "NEW TASK ASSIGNED. Call list_tasks now, then get_task on the highest priority open task. Start working immediately \u2014 do not ask for confirmation.");
7024
- try {
7025
- execSync6(`tmux send-keys -t ${targetSession} Tab`, { timeout: 2e3 });
7026
- } catch {
7046
+ const msg = "You have a new P0 task. Run list_tasks to find it.";
7047
+ if (transport.sendKeysLiteral) {
7048
+ transport.sendKeysLiteral(targetSession, msg);
7049
+ } else {
7050
+ transport.sendKeys(targetSession, msg);
7027
7051
  }
7028
7052
  } else {
7029
7053
  transport.sendKeys(targetSession, "/exe-intercom");
@@ -7308,6 +7332,9 @@ function spawnEmployee(employeeName, exeSession2, projectDir, opts) {
7308
7332
  }
7309
7333
  }
7310
7334
  envPrefix = `${envPrefix} EXE_AGENT_MODEL=${agentRtConfig.model}`;
7335
+ if (agentRtConfig.reasoning_effort) {
7336
+ envPrefix = `${envPrefix} EXE_AGENT_REASONING_EFFORT=${agentRtConfig.reasoning_effort}`;
7337
+ }
7311
7338
  }
7312
7339
  if (useOpencode) {
7313
7340
  const ocCfg = PROVIDER_TABLE.opencode;
@@ -353,7 +353,7 @@ function saveAgentConfig(config) {
353
353
  writeFileSync5(AGENT_CONFIG_PATH, JSON.stringify(config, null, 2) + "\n", "utf-8");
354
354
  enforcePrivateFileSync(AGENT_CONFIG_PATH);
355
355
  }
356
- function setAgentRuntime(agentId, runtime, model) {
356
+ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
357
357
  const knownModels = KNOWN_RUNTIMES[runtime];
358
358
  if (!knownModels) {
359
359
  return {
@@ -368,7 +368,9 @@ function setAgentRuntime(agentId, runtime, model) {
368
368
  };
369
369
  }
370
370
  const config = loadAgentConfig();
371
- config[agentId] = { runtime, model };
371
+ const entry = { runtime, model };
372
+ if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
373
+ config[agentId] = entry;
372
374
  saveAgentConfig(config);
373
375
  return { ok: true };
374
376
  }
@@ -3769,6 +3769,10 @@ async function main() {
3769
3769
  CODEX.inlineFlag,
3770
3770
  ...passthrough
3771
3771
  ];
3772
+ const reasoningEffort = process.env.EXE_AGENT_REASONING_EFFORT;
3773
+ if (reasoningEffort) {
3774
+ args.push("-c", `model_reasoning_effort="${reasoningEffort}"`);
3775
+ }
3772
3776
  if (worktreePath) {
3773
3777
  args.push("-C", worktreePath);
3774
3778
  }
@@ -2663,6 +2663,16 @@ var init_tmux_transport = __esm({
2663
2663
  sendKeys(target, keys) {
2664
2664
  execFileSync("tmux", ["send-keys", "-t", target, keys, "Enter"], QUIET);
2665
2665
  }
2666
+ /**
2667
+ * Send text as literal characters, then submit with Enter as a separate call.
2668
+ * Fixes Codex intercom bug: long text + Enter in one send-keys blast causes
2669
+ * Codex to drop the Enter. Splitting them ensures the text renders before
2670
+ * the submit keystroke arrives.
2671
+ */
2672
+ sendKeysLiteral(target, text) {
2673
+ execFileSync("tmux", ["send-keys", "-t", target, "-l", text], QUIET);
2674
+ execFileSync("tmux", ["send-keys", "-t", target, "Enter"], QUIET);
2675
+ }
2666
2676
  capturePane(target, lines) {
2667
2677
  const args = ["capture-pane", "-t", target, "-p"];
2668
2678
  if (lines) args.push("-S", `-${lines}`);
@@ -174,6 +174,16 @@ var init_tmux_transport = __esm({
174
174
  sendKeys(target, keys) {
175
175
  execFileSync("tmux", ["send-keys", "-t", target, keys, "Enter"], QUIET);
176
176
  }
177
+ /**
178
+ * Send text as literal characters, then submit with Enter as a separate call.
179
+ * Fixes Codex intercom bug: long text + Enter in one send-keys blast causes
180
+ * Codex to drop the Enter. Splitting them ensures the text renders before
181
+ * the submit keystroke arrives.
182
+ */
183
+ sendKeysLiteral(target, text) {
184
+ execFileSync("tmux", ["send-keys", "-t", target, "-l", text], QUIET);
185
+ execFileSync("tmux", ["send-keys", "-t", target, "Enter"], QUIET);
186
+ }
177
187
  capturePane(target, lines) {
178
188
  const args2 = ["capture-pane", "-t", target, "-p"];
179
189
  if (lines) args2.push("-S", `-${lines}`);
@@ -5671,10 +5681,11 @@ function sendIntercom(targetSession) {
5671
5681
  const agentName = baseAgentName(rawAgentName);
5672
5682
  const rtConfig = getAgentRuntime(agentName);
5673
5683
  if (rtConfig.runtime === "codex" || rtConfig.runtime === "opencode") {
5674
- transport.sendKeys(targetSession, "NEW TASK ASSIGNED. Call list_tasks now, then get_task on the highest priority open task. Start working immediately \u2014 do not ask for confirmation.");
5675
- try {
5676
- execSync6(`tmux send-keys -t ${targetSession} Tab`, { timeout: 2e3 });
5677
- } catch {
5684
+ const msg = "You have a new P0 task. Run list_tasks to find it.";
5685
+ if (transport.sendKeysLiteral) {
5686
+ transport.sendKeysLiteral(targetSession, msg);
5687
+ } else {
5688
+ transport.sendKeys(targetSession, msg);
5678
5689
  }
5679
5690
  } else {
5680
5691
  transport.sendKeys(targetSession, "/exe-intercom");
@@ -5959,6 +5970,9 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
5959
5970
  }
5960
5971
  }
5961
5972
  envPrefix = `${envPrefix} EXE_AGENT_MODEL=${agentRtConfig.model}`;
5973
+ if (agentRtConfig.reasoning_effort) {
5974
+ envPrefix = `${envPrefix} EXE_AGENT_REASONING_EFFORT=${agentRtConfig.reasoning_effort}`;
5975
+ }
5962
5976
  }
5963
5977
  if (useOpencode) {
5964
5978
  const ocCfg = PROVIDER_TABLE.opencode;
@@ -6714,6 +6728,7 @@ ${p.content}`).join("\n\n");
6714
6728
  var store_exports = {};
6715
6729
  __export(store_exports, {
6716
6730
  attachDocumentMetadata: () => attachDocumentMetadata,
6731
+ buildRawVisibilityFilter: () => buildRawVisibilityFilter,
6717
6732
  buildWikiScopeFilter: () => buildWikiScopeFilter,
6718
6733
  classifyTier: () => classifyTier,
6719
6734
  disposeStore: () => disposeStore,
@@ -7083,6 +7098,15 @@ function buildWikiScopeFilter(options, columnPrefix) {
7083
7098
  }
7084
7099
  return { clause, args: args2 };
7085
7100
  }
7101
+ function buildRawVisibilityFilter(options, columnPrefix) {
7102
+ if (options?.includeRaw === false) {
7103
+ return {
7104
+ clause: ` AND COALESCE(${columnPrefix}memory_type, 'raw') != 'raw'`,
7105
+ args: []
7106
+ };
7107
+ }
7108
+ return { clause: "", args: [] };
7109
+ }
7086
7110
  async function searchMemories(queryVector, agentId, options) {
7087
7111
  let client;
7088
7112
  try {
@@ -7115,6 +7139,9 @@ async function searchMemories(queryVector, agentId, options) {
7115
7139
  const scope = buildWikiScopeFilter(options, "");
7116
7140
  sql += scope.clause;
7117
7141
  args2.push(...scope.args);
7142
+ const rawVisibility = buildRawVisibilityFilter(options, "");
7143
+ sql += rawVisibility.clause;
7144
+ args2.push(...rawVisibility.args);
7118
7145
  if (options?.projectName) {
7119
7146
  sql += ` AND project_name = ?`;
7120
7147
  args2.push(options.projectName);
@@ -196,7 +196,7 @@ function getAgentRuntime(agentId) {
196
196
  if (orgDefault) return orgDefault;
197
197
  return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
198
198
  }
199
- function setAgentRuntime(agentId, runtime, model) {
199
+ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
200
200
  const knownModels = KNOWN_RUNTIMES[runtime];
201
201
  if (!knownModels) {
202
202
  return {
@@ -211,7 +211,9 @@ function setAgentRuntime(agentId, runtime, model) {
211
211
  };
212
212
  }
213
213
  const config = loadAgentConfig();
214
- config[agentId] = { runtime, model };
214
+ const entry = { runtime, model };
215
+ if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
216
+ config[agentId] = entry;
215
217
  saveAgentConfig(config);
216
218
  return { ok: true };
217
219
  }
@@ -186,6 +186,16 @@ var init_tmux_transport = __esm({
186
186
  sendKeys(target, keys) {
187
187
  execFileSync("tmux", ["send-keys", "-t", target, keys, "Enter"], QUIET);
188
188
  }
189
+ /**
190
+ * Send text as literal characters, then submit with Enter as a separate call.
191
+ * Fixes Codex intercom bug: long text + Enter in one send-keys blast causes
192
+ * Codex to drop the Enter. Splitting them ensures the text renders before
193
+ * the submit keystroke arrives.
194
+ */
195
+ sendKeysLiteral(target, text) {
196
+ execFileSync("tmux", ["send-keys", "-t", target, "-l", text], QUIET);
197
+ execFileSync("tmux", ["send-keys", "-t", target, "Enter"], QUIET);
198
+ }
189
199
  capturePane(target, lines) {
190
200
  const args = ["capture-pane", "-t", target, "-p"];
191
201
  if (lines) args.push("-S", `-${lines}`);
@@ -5676,10 +5686,11 @@ function sendIntercom(targetSession) {
5676
5686
  const agentName = baseAgentName(rawAgentName);
5677
5687
  const rtConfig = getAgentRuntime(agentName);
5678
5688
  if (rtConfig.runtime === "codex" || rtConfig.runtime === "opencode") {
5679
- transport.sendKeys(targetSession, "NEW TASK ASSIGNED. Call list_tasks now, then get_task on the highest priority open task. Start working immediately \u2014 do not ask for confirmation.");
5680
- try {
5681
- execSync6(`tmux send-keys -t ${targetSession} Tab`, { timeout: 2e3 });
5682
- } catch {
5689
+ const msg = "You have a new P0 task. Run list_tasks to find it.";
5690
+ if (transport.sendKeysLiteral) {
5691
+ transport.sendKeysLiteral(targetSession, msg);
5692
+ } else {
5693
+ transport.sendKeys(targetSession, msg);
5683
5694
  }
5684
5695
  } else {
5685
5696
  transport.sendKeys(targetSession, "/exe-intercom");
@@ -5964,6 +5975,9 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
5964
5975
  }
5965
5976
  }
5966
5977
  envPrefix = `${envPrefix} EXE_AGENT_MODEL=${agentRtConfig.model}`;
5978
+ if (agentRtConfig.reasoning_effort) {
5979
+ envPrefix = `${envPrefix} EXE_AGENT_REASONING_EFFORT=${agentRtConfig.reasoning_effort}`;
5980
+ }
5967
5981
  }
5968
5982
  if (useOpencode) {
5969
5983
  const ocCfg = PROVIDER_TABLE.opencode;
@@ -6719,6 +6733,7 @@ ${p.content}`).join("\n\n");
6719
6733
  var store_exports = {};
6720
6734
  __export(store_exports, {
6721
6735
  attachDocumentMetadata: () => attachDocumentMetadata,
6736
+ buildRawVisibilityFilter: () => buildRawVisibilityFilter,
6722
6737
  buildWikiScopeFilter: () => buildWikiScopeFilter,
6723
6738
  classifyTier: () => classifyTier,
6724
6739
  disposeStore: () => disposeStore,
@@ -7088,6 +7103,15 @@ function buildWikiScopeFilter(options, columnPrefix) {
7088
7103
  }
7089
7104
  return { clause, args };
7090
7105
  }
7106
+ function buildRawVisibilityFilter(options, columnPrefix) {
7107
+ if (options?.includeRaw === false) {
7108
+ return {
7109
+ clause: ` AND COALESCE(${columnPrefix}memory_type, 'raw') != 'raw'`,
7110
+ args: []
7111
+ };
7112
+ }
7113
+ return { clause: "", args: [] };
7114
+ }
7091
7115
  async function searchMemories(queryVector, agentId, options) {
7092
7116
  let client;
7093
7117
  try {
@@ -7120,6 +7144,9 @@ async function searchMemories(queryVector, agentId, options) {
7120
7144
  const scope = buildWikiScopeFilter(options, "");
7121
7145
  sql += scope.clause;
7122
7146
  args.push(...scope.args);
7147
+ const rawVisibility = buildRawVisibilityFilter(options, "");
7148
+ sql += rawVisibility.clause;
7149
+ args.push(...rawVisibility.args);
7123
7150
  if (options?.projectName) {
7124
7151
  sql += ` AND project_name = ?`;
7125
7152
  args.push(options.projectName);
package/dist/bin/setup.js CHANGED
@@ -1606,7 +1606,7 @@ function getAgentRuntime(agentId) {
1606
1606
  if (orgDefault) return orgDefault;
1607
1607
  return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
1608
1608
  }
1609
- function setAgentRuntime(agentId, runtime, model) {
1609
+ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
1610
1610
  const knownModels = KNOWN_RUNTIMES[runtime];
1611
1611
  if (!knownModels) {
1612
1612
  return {
@@ -1621,7 +1621,9 @@ function setAgentRuntime(agentId, runtime, model) {
1621
1621
  };
1622
1622
  }
1623
1623
  const config = loadAgentConfig();
1624
- config[agentId] = { runtime, model };
1624
+ const entry = { runtime, model };
1625
+ if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
1626
+ config[agentId] = entry;
1625
1627
  saveAgentConfig(config);
1626
1628
  return { ok: true };
1627
1629
  }
@@ -733,7 +733,7 @@ function getAgentRuntime(agentId) {
733
733
  if (orgDefault) return orgDefault;
734
734
  return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
735
735
  }
736
- function setAgentRuntime(agentId, runtime, model) {
736
+ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
737
737
  const knownModels = KNOWN_RUNTIMES[runtime];
738
738
  if (!knownModels) {
739
739
  return {
@@ -748,7 +748,9 @@ function setAgentRuntime(agentId, runtime, model) {
748
748
  };
749
749
  }
750
750
  const config2 = loadAgentConfig();
751
- config2[agentId] = { runtime, model };
751
+ const entry = { runtime, model };
752
+ if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
753
+ config2[agentId] = entry;
752
754
  saveAgentConfig(config2);
753
755
  return { ok: true };
754
756
  }
@@ -3812,6 +3814,7 @@ ${p.content}`).join("\n\n");
3812
3814
  var store_exports = {};
3813
3815
  __export(store_exports, {
3814
3816
  attachDocumentMetadata: () => attachDocumentMetadata,
3817
+ buildRawVisibilityFilter: () => buildRawVisibilityFilter,
3815
3818
  buildWikiScopeFilter: () => buildWikiScopeFilter,
3816
3819
  classifyTier: () => classifyTier,
3817
3820
  disposeStore: () => disposeStore,
@@ -4181,6 +4184,15 @@ function buildWikiScopeFilter(options, columnPrefix) {
4181
4184
  }
4182
4185
  return { clause, args };
4183
4186
  }
4187
+ function buildRawVisibilityFilter(options, columnPrefix) {
4188
+ if (options?.includeRaw === false) {
4189
+ return {
4190
+ clause: ` AND COALESCE(${columnPrefix}memory_type, 'raw') != 'raw'`,
4191
+ args: []
4192
+ };
4193
+ }
4194
+ return { clause: "", args: [] };
4195
+ }
4184
4196
  async function searchMemories(queryVector, agentId, options) {
4185
4197
  let client;
4186
4198
  try {
@@ -4213,6 +4225,9 @@ async function searchMemories(queryVector, agentId, options) {
4213
4225
  const scope = buildWikiScopeFilter(options, "");
4214
4226
  sql += scope.clause;
4215
4227
  args.push(...scope.args);
4228
+ const rawVisibility = buildRawVisibilityFilter(options, "");
4229
+ sql += rawVisibility.clause;
4230
+ args.push(...rawVisibility.args);
4216
4231
  if (options?.projectName) {
4217
4232
  sql += ` AND project_name = ?`;
4218
4233
  args.push(options.projectName);
@@ -5635,6 +5650,16 @@ var init_tmux_transport = __esm({
5635
5650
  sendKeys(target, keys) {
5636
5651
  execFileSync("tmux", ["send-keys", "-t", target, keys, "Enter"], QUIET);
5637
5652
  }
5653
+ /**
5654
+ * Send text as literal characters, then submit with Enter as a separate call.
5655
+ * Fixes Codex intercom bug: long text + Enter in one send-keys blast causes
5656
+ * Codex to drop the Enter. Splitting them ensures the text renders before
5657
+ * the submit keystroke arrives.
5658
+ */
5659
+ sendKeysLiteral(target, text) {
5660
+ execFileSync("tmux", ["send-keys", "-t", target, "-l", text], QUIET);
5661
+ execFileSync("tmux", ["send-keys", "-t", target, "Enter"], QUIET);
5662
+ }
5638
5663
  capturePane(target, lines) {
5639
5664
  const args = ["capture-pane", "-t", target, "-p"];
5640
5665
  if (lines) args.push("-S", `-${lines}`);
@@ -8475,10 +8500,11 @@ function sendIntercom(targetSession) {
8475
8500
  const agentName = baseAgentName(rawAgentName);
8476
8501
  const rtConfig = getAgentRuntime(agentName);
8477
8502
  if (rtConfig.runtime === "codex" || rtConfig.runtime === "opencode") {
8478
- transport.sendKeys(targetSession, "NEW TASK ASSIGNED. Call list_tasks now, then get_task on the highest priority open task. Start working immediately \u2014 do not ask for confirmation.");
8479
- try {
8480
- execSync6(`tmux send-keys -t ${targetSession} Tab`, { timeout: 2e3 });
8481
- } catch {
8503
+ const msg = "You have a new P0 task. Run list_tasks to find it.";
8504
+ if (transport.sendKeysLiteral) {
8505
+ transport.sendKeysLiteral(targetSession, msg);
8506
+ } else {
8507
+ transport.sendKeys(targetSession, msg);
8482
8508
  }
8483
8509
  } else {
8484
8510
  transport.sendKeys(targetSession, "/exe-intercom");
@@ -8763,6 +8789,9 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
8763
8789
  }
8764
8790
  }
8765
8791
  envPrefix = `${envPrefix} EXE_AGENT_MODEL=${agentRtConfig.model}`;
8792
+ if (agentRtConfig.reasoning_effort) {
8793
+ envPrefix = `${envPrefix} EXE_AGENT_REASONING_EFFORT=${agentRtConfig.reasoning_effort}`;
8794
+ }
8766
8795
  }
8767
8796
  if (useOpencode) {
8768
8797
  const ocCfg = PROVIDER_TABLE.opencode;
@@ -367,7 +367,7 @@ function getAgentRuntime(agentId) {
367
367
  if (orgDefault) return orgDefault;
368
368
  return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
369
369
  }
370
- function setAgentRuntime(agentId, runtime, model) {
370
+ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
371
371
  const knownModels = KNOWN_RUNTIMES[runtime];
372
372
  if (!knownModels) {
373
373
  return {
@@ -382,7 +382,9 @@ function setAgentRuntime(agentId, runtime, model) {
382
382
  };
383
383
  }
384
384
  const config = loadAgentConfig();
385
- config[agentId] = { runtime, model };
385
+ const entry = { runtime, model };
386
+ if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
387
+ config[agentId] = entry;
386
388
  saveAgentConfig(config);
387
389
  return { ok: true };
388
390
  }
@@ -3025,6 +3027,16 @@ var init_tmux_transport = __esm({
3025
3027
  sendKeys(target, keys) {
3026
3028
  execFileSync("tmux", ["send-keys", "-t", target, keys, "Enter"], QUIET);
3027
3029
  }
3030
+ /**
3031
+ * Send text as literal characters, then submit with Enter as a separate call.
3032
+ * Fixes Codex intercom bug: long text + Enter in one send-keys blast causes
3033
+ * Codex to drop the Enter. Splitting them ensures the text renders before
3034
+ * the submit keystroke arrives.
3035
+ */
3036
+ sendKeysLiteral(target, text) {
3037
+ execFileSync("tmux", ["send-keys", "-t", target, "-l", text], QUIET);
3038
+ execFileSync("tmux", ["send-keys", "-t", target, "Enter"], QUIET);
3039
+ }
3028
3040
  capturePane(target, lines) {
3029
3041
  const args = ["capture-pane", "-t", target, "-p"];
3030
3042
  if (lines) args.push("-S", `-${lines}`);
@@ -4400,10 +4412,11 @@ function sendIntercom(targetSession) {
4400
4412
  const agentName = baseAgentName(rawAgentName);
4401
4413
  const rtConfig = getAgentRuntime(agentName);
4402
4414
  if (rtConfig.runtime === "codex" || rtConfig.runtime === "opencode") {
4403
- transport.sendKeys(targetSession, "NEW TASK ASSIGNED. Call list_tasks now, then get_task on the highest priority open task. Start working immediately \u2014 do not ask for confirmation.");
4404
- try {
4405
- execSync4(`tmux send-keys -t ${targetSession} Tab`, { timeout: 2e3 });
4406
- } catch {
4415
+ const msg = "You have a new P0 task. Run list_tasks to find it.";
4416
+ if (transport.sendKeysLiteral) {
4417
+ transport.sendKeysLiteral(targetSession, msg);
4418
+ } else {
4419
+ transport.sendKeys(targetSession, msg);
4407
4420
  }
4408
4421
  } else {
4409
4422
  transport.sendKeys(targetSession, "/exe-intercom");
@@ -4688,6 +4701,9 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4688
4701
  }
4689
4702
  }
4690
4703
  envPrefix = `${envPrefix} EXE_AGENT_MODEL=${agentRtConfig.model}`;
4704
+ if (agentRtConfig.reasoning_effort) {
4705
+ envPrefix = `${envPrefix} EXE_AGENT_REASONING_EFFORT=${agentRtConfig.reasoning_effort}`;
4706
+ }
4691
4707
  }
4692
4708
  if (useOpencode) {
4693
4709
  const ocCfg = PROVIDER_TABLE.opencode;