@askexenow/exe-os 0.9.289 → 0.9.290

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 (244) hide show
  1. package/dist/active-agent-L22OENGJ.js +26 -0
  2. package/dist/active-agent-SVG6F6HY.js +27 -0
  3. package/dist/agentic-ontology-3GHJHLDY.js +25 -0
  4. package/dist/backfill-metadata-HJNVBORD.js +599 -0
  5. package/dist/behaviors-ROOZS234.js +39 -0
  6. package/dist/bin/agentic-ontology-backfill.js +5 -5
  7. package/dist/bin/agentic-reflection-backfill.js +6 -6
  8. package/dist/bin/agentic-semantic-label.js +5 -5
  9. package/dist/bin/backfill-conversations.js +4 -4
  10. package/dist/bin/backfill-responses.js +4 -4
  11. package/dist/bin/backfill-vectors.js +98 -13
  12. package/dist/bin/bulk-sync-postgres.js +6 -6
  13. package/dist/bin/cc-doctor.js +4 -4
  14. package/dist/bin/cleanup-stale-review-tasks.js +9 -9
  15. package/dist/bin/cli.js +51 -15
  16. package/dist/bin/exe-agent-config.js +2 -2
  17. package/dist/bin/exe-agent.js +4 -4
  18. package/dist/bin/exe-assign.js +5 -5
  19. package/dist/bin/exe-boot.js +16 -16
  20. package/dist/bin/exe-call.js +4 -4
  21. package/dist/bin/exe-cloud.js +23 -5
  22. package/dist/bin/exe-dispatch.js +9 -9
  23. package/dist/bin/exe-doctor.js +1 -1
  24. package/dist/bin/exe-export-behaviors.js +7 -7
  25. package/dist/bin/exe-forget.js +6 -6
  26. package/dist/bin/exe-gateway.js +7 -7
  27. package/dist/bin/exe-healthcheck.js +4 -4
  28. package/dist/bin/exe-heartbeat.js +9 -9
  29. package/dist/bin/exe-kill.js +12 -12
  30. package/dist/bin/exe-launch-agent.js +16 -16
  31. package/dist/bin/exe-new-employee.js +6 -6
  32. package/dist/bin/exe-pending-messages.js +10 -10
  33. package/dist/bin/exe-pending-notifications.js +9 -9
  34. package/dist/bin/exe-pending-reviews.js +9 -9
  35. package/dist/bin/exe-rename.js +4 -4
  36. package/dist/bin/exe-review.js +11 -11
  37. package/dist/bin/exe-search.js +5 -5
  38. package/dist/bin/exe-session-cleanup.js +14 -14
  39. package/dist/bin/exe-settings.js +4 -4
  40. package/dist/bin/exe-start-codex.js +11 -11
  41. package/dist/bin/exe-start-opencode.js +8 -8
  42. package/dist/bin/exe-status.js +10 -10
  43. package/dist/bin/exe-team.js +3 -3
  44. package/dist/bin/git-sweep.js +10 -10
  45. package/dist/bin/graph-backfill.js +4 -4
  46. package/dist/bin/graph-export.js +5 -5
  47. package/dist/bin/import-history.js +7 -7
  48. package/dist/bin/install.js +6 -6
  49. package/dist/bin/intercom-check.js +4 -4
  50. package/dist/bin/mcp-sessions.js +2 -2
  51. package/dist/bin/orchestration-metrics.js +4 -4
  52. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  53. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  54. package/dist/bin/scan-tasks.js +9 -9
  55. package/dist/bin/setup.js +1 -1
  56. package/dist/bin/shard-migrate.js +4 -4
  57. package/dist/capability-cards-O6XB2AU4.js +88 -0
  58. package/dist/capacity-monitor-ZE7CFVWH.js +50 -0
  59. package/dist/catchup-brief-3NONSIMA.js +174 -0
  60. package/dist/chunk-232DHK5C.js +1119 -0
  61. package/dist/chunk-272SJ4RN.js +129 -0
  62. package/dist/chunk-4NMTGHUE.js +127 -0
  63. package/dist/chunk-5PLW3QL6.js +668 -0
  64. package/dist/chunk-66EIYAF2.js +157 -0
  65. package/dist/chunk-6IPJF5QD.js +630 -0
  66. package/dist/chunk-6NSJTOXE.js +122 -0
  67. package/dist/chunk-6TLURATK.js +4318 -0
  68. package/dist/chunk-73JAJQRY.js +85 -0
  69. package/dist/chunk-7FTKXL5A.js +286 -0
  70. package/dist/chunk-7IRQSO3F.js +735 -0
  71. package/dist/chunk-7MINWZ3J.js +214 -0
  72. package/dist/chunk-7T5PS5DG.js +14439 -0
  73. package/dist/chunk-A74WXY4S.js +227 -0
  74. package/dist/chunk-AVD5C3NG.js +197 -0
  75. package/dist/chunk-B36MRLEP.js +58 -0
  76. package/dist/chunk-B4TCZ3PS.js +373 -0
  77. package/dist/chunk-BPLEJ3EU.js +411 -0
  78. package/dist/chunk-BTDPLFGK.js +221 -0
  79. package/dist/chunk-BU45UYTK.js +185 -0
  80. package/dist/chunk-CCAA6XOZ.js +284 -0
  81. package/dist/chunk-DBQ6I6K2.js +3276 -0
  82. package/dist/chunk-DDWFHEPG.js +345 -0
  83. package/dist/chunk-DSOKTUTT.js +167 -0
  84. package/dist/chunk-ETCARC76.js +836 -0
  85. package/dist/chunk-EZHTLPOS.js +280 -0
  86. package/dist/chunk-F3DQ3HDH.js +333 -0
  87. package/dist/chunk-F6ZCUDCN.js +244 -0
  88. package/dist/chunk-FI5Q6F5S.js +382 -0
  89. package/dist/chunk-FNQZGNSG.js +1094 -0
  90. package/dist/chunk-FVKTXXKK.js +128 -0
  91. package/dist/chunk-HHR5NB6N.js +377 -0
  92. package/dist/chunk-HRZLGHT6.js +290 -0
  93. package/dist/chunk-HSSRWMVA.js +68 -0
  94. package/dist/chunk-I3NVB5MG.js +85 -0
  95. package/dist/chunk-I7Z6MK2B.js +240 -0
  96. package/dist/chunk-ID4SMRYX.js +2078 -0
  97. package/dist/chunk-JXGHDROV.js +546 -0
  98. package/dist/chunk-KQY4QIEN.js +731 -0
  99. package/dist/chunk-LRSU2ZU2.js +38 -0
  100. package/dist/chunk-MFCL4GAN.js +2113 -0
  101. package/dist/chunk-MFGMVKGM.js +150 -0
  102. package/dist/chunk-NHGBVLCD.js +210 -0
  103. package/dist/chunk-NOEBJMNN.js +33 -0
  104. package/dist/chunk-NQ2VNTGL.js +538 -0
  105. package/dist/chunk-O4PZPM6H.js +204 -0
  106. package/dist/chunk-O5OW3YGQ.js +262 -0
  107. package/dist/chunk-OJQTONDJ.js +171 -0
  108. package/dist/chunk-OKZGUHE5.js +76 -0
  109. package/dist/chunk-OOH5M36Q.js +448 -0
  110. package/dist/chunk-P5ARTZP2.js +128 -0
  111. package/dist/chunk-PKRSYS7F.js +402 -0
  112. package/dist/chunk-PQWO5D3F.js +348 -0
  113. package/dist/chunk-Q6MJIJ2O.js +1352 -0
  114. package/dist/chunk-QKDRYZ2N.js +231 -0
  115. package/dist/chunk-RAV356E6.js +30 -0
  116. package/dist/chunk-RK7EAA53.js +1157 -0
  117. package/dist/chunk-RSLVAYWS.js +192 -0
  118. package/dist/chunk-SL6WJP2Q.js +123 -0
  119. package/dist/chunk-T57DOVGE.js +97 -0
  120. package/dist/chunk-TMCKL43Q.js +181 -0
  121. package/dist/chunk-TQZABASE.js +97 -0
  122. package/dist/chunk-UBWBEY6I.js +81 -0
  123. package/dist/chunk-UP7DNYG7.js +456 -0
  124. package/dist/chunk-V5MGYIZS.js +70 -0
  125. package/dist/chunk-XCPVYQVK.js +336 -0
  126. package/dist/chunk-XWVBLZRP.js +50 -0
  127. package/dist/chunk-YBTN5F2U.js +1068 -0
  128. package/dist/chunk-Z772TGD2.js +54 -0
  129. package/dist/chunk-ZAMPIXLH.js +1350 -0
  130. package/dist/chunk-ZYEOHGU5.js +362 -0
  131. package/dist/co-activation-WJTFJOTK.js +73 -0
  132. package/dist/co-occurrence-KFP6ZS7G.js +94 -0
  133. package/dist/core-memory-DBZJ72TV.js +110 -0
  134. package/dist/crdt-sync-6DVGRMTV.js +33 -0
  135. package/dist/crm-webhook-55T4Z6XJ.js +10 -0
  136. package/dist/cto-delegation-gate-SPM6LAL2.js +279 -0
  137. package/dist/daemon-orchestration-XZLWWIV4.js +138 -0
  138. package/dist/db-backup-JHCI47JQ.js +37 -0
  139. package/dist/doc-graph-extractor-4X23NP4I.js +132 -0
  140. package/dist/dreaming-TFZDGA72.js +33 -0
  141. package/dist/exe-drift-TEM7ELNY.js +69 -0
  142. package/dist/exe-export-CRCA4T4S.js +75 -0
  143. package/dist/exe-import-UZMMWNHJ.js +78 -0
  144. package/dist/exe-key-NQQXEDUA.js +672 -0
  145. package/dist/exe-snapshot-P7PUAJTV.js +337 -0
  146. package/dist/fast-db-init-G63PRINQ.js +7 -0
  147. package/dist/gateway/index.js +8 -8
  148. package/dist/git-staleness-42TTCFDP.js +111 -0
  149. package/dist/git-task-sweep-4LW5RYYO.js +41 -0
  150. package/dist/global-procedures-BVFRWJAV.js +21 -0
  151. package/dist/graph-auto-extract-4ZA7UC6C.js +182 -0
  152. package/dist/hooks/bug-report-worker.js +11 -11
  153. package/dist/hooks/codex-stop-task-finalizer.js +11 -11
  154. package/dist/hooks/commit-complete.js +11 -11
  155. package/dist/hooks/error-recall.js +6 -6
  156. package/dist/hooks/exe-heartbeat-hook.js +3 -3
  157. package/dist/hooks/ingest.js +6 -6
  158. package/dist/hooks/instructions-loaded.js +4 -4
  159. package/dist/hooks/manifest.json +19 -19
  160. package/dist/hooks/notification.js +4 -4
  161. package/dist/hooks/post-compact.js +10 -10
  162. package/dist/hooks/post-tool-combined.js +5 -5
  163. package/dist/hooks/pre-compact.js +11 -11
  164. package/dist/hooks/pre-tool-use.js +14 -14
  165. package/dist/hooks/prompt-submit.js +21 -21
  166. package/dist/hooks/session-end.js +15 -15
  167. package/dist/hooks/session-start.js +12 -12
  168. package/dist/hooks/stop.js +14 -14
  169. package/dist/hooks/subagent-stop.js +10 -10
  170. package/dist/hooks/summary-worker.js +14 -14
  171. package/dist/index.js +17 -17
  172. package/dist/installer-CBGRTGIF.js +297 -0
  173. package/dist/installer-DGU4WZKJ.js +39 -0
  174. package/dist/installer-WTWEOSEK.js +343 -0
  175. package/dist/lib/cloud-sync.js +4 -4
  176. package/dist/lib/consolidation.js +7 -5
  177. package/dist/lib/database.js +2 -2
  178. package/dist/lib/db.js +2 -2
  179. package/dist/lib/employee-templates.js +4 -4
  180. package/dist/lib/employees.js +2 -2
  181. package/dist/lib/exe-daemon.js +64 -43
  182. package/dist/lib/hybrid-search.js +5 -5
  183. package/dist/lib/identity.js +2 -2
  184. package/dist/lib/messaging.js +9 -9
  185. package/dist/lib/reminders.js +3 -3
  186. package/dist/lib/schedules.js +5 -5
  187. package/dist/lib/session-registry.js +4 -4
  188. package/dist/lib/skill-learning.js +6 -6
  189. package/dist/lib/store.js +4 -4
  190. package/dist/lib/task-router.js +3 -3
  191. package/dist/lib/tasks.js +10 -10
  192. package/dist/lib/tmux-routing.js +8 -8
  193. package/dist/lib/token-spend.js +3 -3
  194. package/dist/license-gate-OSPA2OD7.js +16 -0
  195. package/dist/mcp/register-tools.js +55 -55
  196. package/dist/mcp/server.js +117 -73
  197. package/dist/mcp/tools/complete-reminder.js +4 -4
  198. package/dist/mcp/tools/create-reminder.js +4 -4
  199. package/dist/mcp/tools/create-task.js +12 -12
  200. package/dist/mcp/tools/deactivate-behavior.js +7 -7
  201. package/dist/mcp/tools/list-reminders.js +4 -4
  202. package/dist/mcp/tools/list-tasks.js +12 -12
  203. package/dist/mcp/tools/send-message.js +11 -11
  204. package/dist/mcp/tools/update-task.js +11 -11
  205. package/dist/mcp-http-config-OGFPLJYH.js +28 -0
  206. package/dist/memory-cards-GJ3VHKAM.js +179 -0
  207. package/dist/memory-graph-extractor-TCTCM7PZ.js +21 -0
  208. package/dist/memory-poisoning-defense-FVLGA35X.js +223 -0
  209. package/dist/memory-reflection-BYJFIFSV.js +243 -0
  210. package/dist/notifications-AQKZFSR3.js +46 -0
  211. package/dist/orchestration-events-RDSYLFXZ.js +26 -0
  212. package/dist/orchestrator-2JTJQLPG.js +34 -0
  213. package/dist/pipeline-router-HBSTKHG5.js +14 -0
  214. package/dist/plan-limits-GQENSNTG.js +27 -0
  215. package/dist/project-boot-W2LTP7WW.js +299 -0
  216. package/dist/projection-worker-ZMT5KNJJ.js +1084 -0
  217. package/dist/prospective-memory-LANRNOJX.js +231 -0
  218. package/dist/reranker-QGJO6EHO.js +19 -0
  219. package/dist/retrieval-health-JE66LJ3I.js +11 -0
  220. package/dist/review-polling-IXJ57M6Q.js +125 -0
  221. package/dist/runtime/index.js +11 -11
  222. package/dist/session-events-XKG66APL.js +37 -0
  223. package/dist/session-kill-telemetry-VTU7YBII.js +30 -0
  224. package/dist/session-scope-TQZONLZL.js +87 -0
  225. package/dist/setup-wizard-PXK6SC2D.js +12 -0
  226. package/dist/skill-refinement-Y6LLKYRL.js +158 -0
  227. package/dist/steward-gate-QV2APBFB.js +14 -0
  228. package/dist/task-enforcement-GLDD2W5D.js +505 -0
  229. package/dist/task-scope-HMPIP6XB.js +36 -0
  230. package/dist/tasks-crud-FH2SFCNQ.js +78 -0
  231. package/dist/tasks-notify-3ZW2GLCS.js +39 -0
  232. package/dist/tasks-review-XERV6KZD.js +48 -0
  233. package/dist/telemetry-upload-R77W7I7G.js +740 -0
  234. package/dist/token-budget-NA4WQAY6.js +85 -0
  235. package/dist/tool-telemetry-D4Q76LAS.js +17 -0
  236. package/dist/tui/App.js +16 -16
  237. package/dist/tui-data-NJSEIA2Q.js +259 -0
  238. package/dist/wiki-acl-RE5IR5VV.js +111 -0
  239. package/dist/worker-gate-VN2POPFL.js +21 -0
  240. package/dist/workflow-engine-D7ALMSDM.js +28 -0
  241. package/dist/worktree-6I45JV5N.js +27 -0
  242. package/dist/worktree-sweep-IMDR3XHT.js +20 -0
  243. package/package.json +1 -1
  244. package/release-notes.json +88 -88
@@ -0,0 +1,85 @@
1
+ import {
2
+ getClient
3
+ } from "./chunk-DBQ6I6K2.js";
4
+ import "./chunk-2I23RPSI.js";
5
+ import "./chunk-XCPVYQVK.js";
6
+ import "./chunk-PNQDP3OA.js";
7
+ import "./chunk-FXU7JOXK.js";
8
+ import "./chunk-5P3HOBZX.js";
9
+ import "./chunk-LYH5HE24.js";
10
+ import "./chunk-MLKGABMK.js";
11
+
12
+ // src/lib/token-budget.ts
13
+ var WARN_THRESHOLD = 0.8;
14
+ function createTokenBudgetMiddleware(taskId) {
15
+ return {
16
+ async onTokenUsed(inputTokens, outputTokens) {
17
+ const client = getClient();
18
+ const row = await client.execute({
19
+ sql: `SELECT budget_tokens, budget_fallback_model, tokens_used, tokens_warned_at
20
+ FROM tasks WHERE id = ?`,
21
+ args: [taskId]
22
+ });
23
+ if (row.rows.length === 0) {
24
+ return { exceeded: false, warned: false, fallback: null, percentUsed: 0 };
25
+ }
26
+ const r = row.rows[0];
27
+ const budgetTokens = r.budget_tokens !== null ? Number(r.budget_tokens) : null;
28
+ const budgetFallbackModel = r.budget_fallback_model !== null ? String(r.budget_fallback_model) : null;
29
+ const currentUsed = Number(r.tokens_used ?? 0);
30
+ const tokensWarnedAt = r.tokens_warned_at !== null ? Number(r.tokens_warned_at) : null;
31
+ const newUsed = currentUsed + inputTokens + outputTokens;
32
+ await client.execute({
33
+ sql: `UPDATE tasks SET tokens_used = ? WHERE id = ?`,
34
+ args: [newUsed, taskId]
35
+ });
36
+ if (budgetTokens === null) {
37
+ return { exceeded: false, warned: false, fallback: null, percentUsed: 0 };
38
+ }
39
+ const percentUsed = Math.round(newUsed / budgetTokens * 100);
40
+ const alreadyWarned = tokensWarnedAt !== null;
41
+ const atWarnThreshold = newUsed >= Math.floor(budgetTokens * WARN_THRESHOLD);
42
+ const warned = atWarnThreshold && !alreadyWarned;
43
+ if (warned) {
44
+ await client.execute({
45
+ sql: `UPDATE tasks SET tokens_warned_at = ? WHERE id = ?`,
46
+ args: [Math.floor(Date.now() / 1e3), taskId]
47
+ });
48
+ }
49
+ const exceeded = newUsed >= budgetTokens;
50
+ return {
51
+ exceeded,
52
+ warned,
53
+ fallback: exceeded ? budgetFallbackModel ?? null : null,
54
+ percentUsed
55
+ };
56
+ },
57
+ async getBudgetStatus() {
58
+ const client = getClient();
59
+ const row = await client.execute({
60
+ sql: `SELECT budget_tokens, budget_fallback_model, tokens_used, tokens_warned_at
61
+ FROM tasks WHERE id = ?`,
62
+ args: [taskId]
63
+ });
64
+ if (row.rows.length === 0) return null;
65
+ const r = row.rows[0];
66
+ const budgetTokens = r.budget_tokens !== null ? Number(r.budget_tokens) : null;
67
+ if (budgetTokens === null) return null;
68
+ const budgetFallbackModel = r.budget_fallback_model !== null ? String(r.budget_fallback_model) : null;
69
+ const tokensUsed = Number(r.tokens_used ?? 0);
70
+ const tokensWarnedAt = r.tokens_warned_at !== null ? Number(r.tokens_warned_at) : null;
71
+ const percentUsed = Math.round(tokensUsed / budgetTokens * 100);
72
+ return {
73
+ budgetTokens,
74
+ budgetFallbackModel,
75
+ tokensUsed,
76
+ percentUsed,
77
+ warned: tokensWarnedAt !== null,
78
+ exceeded: tokensUsed >= budgetTokens
79
+ };
80
+ }
81
+ };
82
+ }
83
+ export {
84
+ createTokenBudgetMiddleware
85
+ };
@@ -0,0 +1,17 @@
1
+ import {
2
+ getToolUsageStats,
3
+ getToolUsageSummary,
4
+ resetToolUsageStats,
5
+ startToolTelemetryFlush,
6
+ stopToolTelemetryFlush,
7
+ wrapServerWithTelemetry
8
+ } from "./chunk-P5ARTZP2.js";
9
+ import "./chunk-MLKGABMK.js";
10
+ export {
11
+ getToolUsageStats,
12
+ getToolUsageSummary,
13
+ resetToolUsageStats,
14
+ startToolTelemetryFlush,
15
+ stopToolTelemetryFlush,
16
+ wrapServerWithTelemetry
17
+ };
package/dist/tui/App.js CHANGED
@@ -1,37 +1,37 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getSessionPrompt
4
- } from "../chunk-2ZAOSGBX.js";
5
- import "../chunk-Y4ZA4GCQ.js";
4
+ } from "../chunk-5PLW3QL6.js";
5
+ import "../chunk-I3NVB5MG.js";
6
6
  import "../chunk-VUH67PT4.js";
7
7
  import {
8
8
  sessionScopeFilter
9
- } from "../chunk-F23GFLKY.js";
10
- import "../chunk-FTG36JG5.js";
9
+ } from "../chunk-6TLURATK.js";
10
+ import "../chunk-EZHTLPOS.js";
11
11
  import "../chunk-4JERP7NT.js";
12
12
  import "../chunk-4FVVJ7ME.js";
13
- import "../chunk-73ORCJNJ.js";
13
+ import "../chunk-QKDRYZ2N.js";
14
14
  import "../chunk-MVW62NIZ.js";
15
15
  import "../chunk-OYNKIAVW.js";
16
16
  import "../chunk-SSTLTIF3.js";
17
- import "../chunk-CMDKYYFK.js";
17
+ import "../chunk-6IPJF5QD.js";
18
18
  import "../chunk-RJY45A5J.js";
19
19
  import "../chunk-NGP6LSV2.js";
20
- import "../chunk-75GH76GO.js";
20
+ import "../chunk-272SJ4RN.js";
21
21
  import "../chunk-CVYC6DUW.js";
22
22
  import "../chunk-OPU3NYOO.js";
23
23
  import "../chunk-GJV3WDWM.js";
24
24
  import {
25
25
  orgBus
26
26
  } from "../chunk-MP2AFCGL.js";
27
- import "../chunk-QODXLGH2.js";
27
+ import "../chunk-V5MGYIZS.js";
28
28
  import "../chunk-HYZV25LY.js";
29
29
  import {
30
30
  DEFAULT_COORDINATOR_TEMPLATE_NAME,
31
31
  isCoordinatorName
32
- } from "../chunk-3X2ZT5FN.js";
32
+ } from "../chunk-DBQ6I6K2.js";
33
33
  import "../chunk-2I23RPSI.js";
34
- import "../chunk-SCQEAMO3.js";
34
+ import "../chunk-XCPVYQVK.js";
35
35
  import "../chunk-PNQDP3OA.js";
36
36
  import "../chunk-FXU7JOXK.js";
37
37
  import "../chunk-SYOGNG2R.js";
@@ -7407,7 +7407,7 @@ function useOrchestrator(enabled = true) {
7407
7407
  let cancelled = false;
7408
7408
  async function init() {
7409
7409
  try {
7410
- const { MultiAgentOrchestrator } = await import("../orchestrator-GNI5PCA6.js");
7410
+ const { MultiAgentOrchestrator } = await import("../orchestrator-2JTJQLPG.js");
7411
7411
  const { getCoordinatorName, isCoordinatorRole, loadEmployees } = await import("../lib/employees.js");
7412
7412
  const { isExeSession } = await import("../lib/tmux-routing.js");
7413
7413
  const { listTmuxSessions, inTmux } = await import("../lib/tmux-status.js");
@@ -7448,7 +7448,7 @@ function useOrchestrator(enabled = true) {
7448
7448
  setTotalInProgress(health.totalInProgress);
7449
7449
  try {
7450
7450
  const { getClient } = await import("../lib/database.js");
7451
- const { sessionScopeFilter: sessionScopeFilter2 } = await import("../task-scope-XRH4KDJB.js");
7451
+ const { sessionScopeFilter: sessionScopeFilter2 } = await import("../task-scope-HMPIP6XB.js");
7452
7452
  const client = getClient();
7453
7453
  const uoScope = sessionScopeFilter2();
7454
7454
  const result = await client.execute({
@@ -7480,7 +7480,7 @@ function useOrchestrator(enabled = true) {
7480
7480
  const spawnSession = useCallback5(
7481
7481
  async (agentId) => {
7482
7482
  try {
7483
- const { createTaskCore } = await import("../tasks-crud-2KYGDJG2.js");
7483
+ const { createTaskCore } = await import("../tasks-crud-FH2SFCNQ.js");
7484
7484
  const { ensureEmployee } = await import("../lib/tmux-routing.js");
7485
7485
  const { getCoordinatorName } = await import("../lib/employees.js");
7486
7486
  await createTaskCore({
@@ -8104,7 +8104,7 @@ function TasksView({ onBack }) {
8104
8104
  const { withTrace } = await import("../telemetry-43X3GT3R.js");
8105
8105
  return withTrace("tui.tasks.loadTasks", async () => {
8106
8106
  try {
8107
- const { loadTaskList } = await import("../tui-data-2LNENF36.js");
8107
+ const { loadTaskList } = await import("../tui-data-NJSEIA2Q.js");
8108
8108
  const tasks = await loadTaskList();
8109
8109
  setAllTasks(
8110
8110
  tasks.map((task) => ({
@@ -8937,7 +8937,7 @@ function TeamView({ onBack, onViewSessions }) {
8937
8937
  let projectsByEmployee = /* @__PURE__ */ new Map();
8938
8938
  let currentTaskByEmployee = /* @__PURE__ */ new Map();
8939
8939
  try {
8940
- const { loadTeamBadgeCounts, loadTeamDetailMetrics } = await import("../tui-data-2LNENF36.js");
8940
+ const { loadTeamBadgeCounts, loadTeamDetailMetrics } = await import("../tui-data-NJSEIA2Q.js");
8941
8941
  setBadgeInFlight(true);
8942
8942
  const badgeCountsPromise = loadTeamBadgeCounts();
8943
8943
  const detailsPromise = loadTeamDetailMetrics(roster.map((emp) => emp.name));
@@ -9303,7 +9303,7 @@ function WikiView({ onBack }) {
9303
9303
  }
9304
9304
  setSearchLoading(true);
9305
9305
  try {
9306
- const { searchWikiMemoryRows } = await import("../tui-data-2LNENF36.js");
9306
+ const { searchWikiMemoryRows } = await import("../tui-data-NJSEIA2Q.js");
9307
9307
  setSearchResults(await searchWikiMemoryRows(query));
9308
9308
  } catch {
9309
9309
  setSearchResults([]);
@@ -0,0 +1,259 @@
1
+ import {
2
+ sessionScopeFilter
3
+ } from "./chunk-6TLURATK.js";
4
+ import "./chunk-EZHTLPOS.js";
5
+ import "./chunk-4JERP7NT.js";
6
+ import "./chunk-4FVVJ7ME.js";
7
+ import "./chunk-QKDRYZ2N.js";
8
+ import "./chunk-MVW62NIZ.js";
9
+ import "./chunk-OYNKIAVW.js";
10
+ import "./chunk-SSTLTIF3.js";
11
+ import "./chunk-6IPJF5QD.js";
12
+ import "./chunk-RJY45A5J.js";
13
+ import "./chunk-NGP6LSV2.js";
14
+ import "./chunk-272SJ4RN.js";
15
+ import "./chunk-CVYC6DUW.js";
16
+ import "./chunk-OPU3NYOO.js";
17
+ import "./chunk-GJV3WDWM.js";
18
+ import "./chunk-MP2AFCGL.js";
19
+ import "./chunk-V5MGYIZS.js";
20
+ import "./chunk-HYZV25LY.js";
21
+ import {
22
+ getClient
23
+ } from "./chunk-DBQ6I6K2.js";
24
+ import "./chunk-2I23RPSI.js";
25
+ import "./chunk-XCPVYQVK.js";
26
+ import "./chunk-PNQDP3OA.js";
27
+ import "./chunk-FXU7JOXK.js";
28
+ import "./chunk-SYOGNG2R.js";
29
+ import "./chunk-5P3HOBZX.js";
30
+ import "./chunk-LYH5HE24.js";
31
+ import "./chunk-MLKGABMK.js";
32
+
33
+ // src/lib/tui-data.ts
34
+ async function loadMemoryDashboard(limit) {
35
+ const client = getClient();
36
+ const [countResult, recentResult, agentResult] = await Promise.all([
37
+ client.execute("SELECT COUNT(*) as cnt FROM memories"),
38
+ client.execute({
39
+ sql: "SELECT agent_id, tool_name, project_name, raw_text, timestamp FROM memories ORDER BY timestamp DESC LIMIT ?",
40
+ args: [limit]
41
+ }),
42
+ client.execute("SELECT agent_id, COUNT(*) as cnt FROM memories GROUP BY agent_id ORDER BY cnt DESC")
43
+ ]);
44
+ return {
45
+ total: Number(countResult.rows[0]?.cnt ?? 0),
46
+ recent: recentResult.rows.map((row) => ({
47
+ agentId: String(row.agent_id ?? "unknown"),
48
+ toolName: String(row.tool_name ?? ""),
49
+ projectName: String(row.project_name ?? ""),
50
+ rawText: String(row.raw_text ?? ""),
51
+ timestamp: String(row.timestamp ?? "")
52
+ })),
53
+ byAgent: agentResult.rows.map((row) => ({
54
+ agentId: String(row.agent_id ?? "unknown"),
55
+ count: Number(row.cnt ?? 0)
56
+ }))
57
+ };
58
+ }
59
+ async function loadTeamBadgeCounts() {
60
+ const client = getClient();
61
+ const memoryCounts = /* @__PURE__ */ new Map();
62
+ const memResult = await client.execute("SELECT agent_id, COUNT(*) as cnt FROM memories GROUP BY agent_id");
63
+ for (const row of memResult.rows) {
64
+ memoryCounts.set(String(row.agent_id), Number(row.cnt));
65
+ }
66
+ return memoryCounts;
67
+ }
68
+ async function loadTeamDetailMetrics(employeeNames) {
69
+ const client = getClient();
70
+ const projectsByEmployee = /* @__PURE__ */ new Map();
71
+ const currentTaskByEmployee = /* @__PURE__ */ new Map();
72
+ const scope = sessionScopeFilter();
73
+ for (const employeeName of employeeNames) {
74
+ const [projectResult, taskResult] = await Promise.all([
75
+ client.execute({
76
+ sql: `SELECT DISTINCT project_name,
77
+ MAX(CASE WHEN status = 'in_progress' THEN 1 WHEN status = 'open' THEN 2 ELSE 3 END) as urgency
78
+ FROM tasks
79
+ WHERE assigned_to = ? AND status IN ('open','in_progress','done')${scope.sql}
80
+ GROUP BY project_name
81
+ ORDER BY urgency ASC
82
+ LIMIT 5`,
83
+ args: [employeeName, ...scope.args]
84
+ }),
85
+ client.execute({
86
+ sql: `SELECT title FROM tasks
87
+ WHERE assigned_to = ? AND status = 'in_progress'${scope.sql}
88
+ ORDER BY updated_at DESC
89
+ LIMIT 1`,
90
+ args: [employeeName, ...scope.args]
91
+ })
92
+ ]);
93
+ const projects = projectResult.rows.map((row) => {
94
+ const urgency = Number(row.urgency);
95
+ return {
96
+ name: String(row.project_name),
97
+ status: urgency === 1 ? "active" : urgency === 2 ? "has_tasks" : "idle"
98
+ };
99
+ });
100
+ if (projects.length > 0) projectsByEmployee.set(employeeName, projects);
101
+ if (taskResult.rows.length > 0) {
102
+ currentTaskByEmployee.set(employeeName, String(taskResult.rows[0].title));
103
+ }
104
+ }
105
+ return { projectsByEmployee, currentTaskByEmployee };
106
+ }
107
+ async function loadTeamMetrics(employeeNames) {
108
+ const [memoryCounts, { projectsByEmployee, currentTaskByEmployee }] = await Promise.all([
109
+ loadTeamBadgeCounts(),
110
+ loadTeamDetailMetrics(employeeNames)
111
+ ]);
112
+ return { memoryCounts, projectsByEmployee, currentTaskByEmployee };
113
+ }
114
+ async function loadTaskList() {
115
+ const client = getClient();
116
+ const scope = sessionScopeFilter();
117
+ const result = await client.execute({
118
+ sql: `SELECT id, title, priority, assigned_to, assigned_by, status, project_name, created_at, result
119
+ FROM tasks
120
+ WHERE 1=1${scope.sql}
121
+ ORDER BY
122
+ CASE status WHEN 'in_progress' THEN 0 WHEN 'open' THEN 1 WHEN 'blocked' THEN 2 WHEN 'needs_review' THEN 3 WHEN 'done' THEN 4 ELSE 5 END,
123
+ CASE priority WHEN 'p0' THEN 0 WHEN 'p1' THEN 1 WHEN 'p2' THEN 2 ELSE 3 END,
124
+ created_at DESC`,
125
+ args: [...scope.args]
126
+ });
127
+ return result.rows.map((row) => ({
128
+ id: String(row.id ?? ""),
129
+ title: String(row.title ?? ""),
130
+ priority: String(row.priority ?? "p2").toUpperCase(),
131
+ assignedTo: String(row.assigned_to ?? ""),
132
+ assignedBy: String(row.assigned_by ?? ""),
133
+ status: String(row.status ?? "open"),
134
+ projectName: String(row.project_name ?? ""),
135
+ createdAt: String(row.created_at ?? ""),
136
+ result: String(row.result ?? "")
137
+ }));
138
+ }
139
+ async function searchWikiMemoryRows(query) {
140
+ const client = getClient();
141
+ const result = await client.execute({
142
+ sql: `SELECT id, agent_id, raw_text, timestamp, project_name
143
+ FROM memories
144
+ WHERE raw_text LIKE ? AND COALESCE(status, 'active') = 'active'
145
+ ORDER BY timestamp DESC LIMIT 20`,
146
+ args: [`%${query}%`]
147
+ });
148
+ return result.rows.map((row) => ({
149
+ id: String(row.id),
150
+ agentId: String(row.agent_id),
151
+ rawText: String(row.raw_text),
152
+ timestamp: String(row.timestamp),
153
+ projectName: String(row.project_name ?? "")
154
+ }));
155
+ }
156
+ async function loadEntityProfile(entityName) {
157
+ const client = getClient();
158
+ const { getEntityByName, getRelationships, getEntityTimeline } = await import("./graph-query-XEDHA2PQ.js");
159
+ const entity = await getEntityByName(client, entityName);
160
+ if (!entity) return null;
161
+ const [relationships, timelineRaw] = await Promise.all([
162
+ getRelationships(client, entity.id, { direction: "both" }),
163
+ getEntityTimeline(client, entity.id)
164
+ ]);
165
+ const neighbors = relationships.map((r) => {
166
+ const isOutgoing = r.sourceEntityId === entity.id;
167
+ return {
168
+ name: isOutgoing ? r.targetName : r.sourceName,
169
+ type: isOutgoing ? "target" : "source",
170
+ relType: r.type,
171
+ direction: isOutgoing ? "outgoing" : "incoming",
172
+ weight: r.weight,
173
+ confidence: r.confidence
174
+ };
175
+ });
176
+ const timeline = timelineRaw.slice(0, 20).map((t) => {
177
+ const isOutgoing = t.relationship.sourceEntityId === entity.id;
178
+ return {
179
+ timestamp: t.timestamp,
180
+ relType: t.relationship.type,
181
+ partnerName: isOutgoing ? t.relationship.targetName : t.relationship.sourceName,
182
+ direction: isOutgoing ? "outgoing" : "incoming"
183
+ };
184
+ });
185
+ const relationshipTypes = {};
186
+ for (const r of relationships) {
187
+ relationshipTypes[r.type] = (relationshipTypes[r.type] ?? 0) + 1;
188
+ }
189
+ return {
190
+ entity,
191
+ neighbors,
192
+ timeline,
193
+ stats: {
194
+ totalRelationships: relationships.length,
195
+ relationshipTypes
196
+ }
197
+ };
198
+ }
199
+ async function searchEntitiesList(query, limit = 20) {
200
+ const client = getClient();
201
+ const { searchEntities } = await import("./graph-query-XEDHA2PQ.js");
202
+ const entities = await searchEntities(client, query, limit);
203
+ if (entities.length === 0) return [];
204
+ const placeholders = entities.map(() => "?").join(",");
205
+ const ids = entities.map((e) => e.id);
206
+ const countResult = await client.execute({
207
+ sql: `SELECT source_entity_id as eid, COUNT(*) as cnt FROM relationships WHERE source_entity_id IN (${placeholders}) AND valid_until IS NULL GROUP BY source_entity_id
208
+ UNION ALL
209
+ SELECT target_entity_id as eid, COUNT(*) as cnt FROM relationships WHERE target_entity_id IN (${placeholders}) AND valid_until IS NULL GROUP BY target_entity_id`,
210
+ args: [...ids, ...ids]
211
+ });
212
+ const countMap = /* @__PURE__ */ new Map();
213
+ for (const row of countResult.rows) {
214
+ const eid = String(row.eid);
215
+ countMap.set(eid, (countMap.get(eid) ?? 0) + Number(row.cnt));
216
+ }
217
+ return entities.map((e) => ({
218
+ id: e.id,
219
+ name: e.name,
220
+ type: e.type,
221
+ lastSeen: e.lastSeen,
222
+ relationshipCount: countMap.get(e.id) ?? 0
223
+ }));
224
+ }
225
+ async function loadHotEntities(limit = 15) {
226
+ const client = getClient();
227
+ const { getHotEntities } = await import("./graph-query-XEDHA2PQ.js");
228
+ const since = new Date(Date.now() - 7 * 24 * 60 * 60 * 1e3);
229
+ const hot = await getHotEntities(client, since, limit);
230
+ return hot.map((h) => ({
231
+ id: h.entity.id,
232
+ name: h.entity.name,
233
+ type: h.entity.type,
234
+ lastSeen: h.entity.lastSeen,
235
+ relationshipCount: h.newRelationships
236
+ }));
237
+ }
238
+ async function loadGraphOverview() {
239
+ const client = getClient();
240
+ const { getGraphStats } = await import("./graph-query-XEDHA2PQ.js");
241
+ const stats = await getGraphStats(client);
242
+ return {
243
+ totalEntities: stats.entities,
244
+ totalRelationships: stats.relationships,
245
+ entityTypes: stats.types
246
+ };
247
+ }
248
+ export {
249
+ loadEntityProfile,
250
+ loadGraphOverview,
251
+ loadHotEntities,
252
+ loadMemoryDashboard,
253
+ loadTaskList,
254
+ loadTeamBadgeCounts,
255
+ loadTeamDetailMetrics,
256
+ loadTeamMetrics,
257
+ searchEntitiesList,
258
+ searchWikiMemoryRows
259
+ };
@@ -0,0 +1,111 @@
1
+ import "./chunk-MLKGABMK.js";
2
+
3
+ // src/lib/wiki-acl.ts
4
+ async function checkWikiAccess(userId, workspace, requiredLevel = "read") {
5
+ if (!userId) {
6
+ return {
7
+ allowed: requiredLevel === "read",
8
+ actualLevel: "read"
9
+ };
10
+ }
11
+ try {
12
+ const { getClient } = await import("./lib/database.js");
13
+ const client = getClient();
14
+ const result = await client.execute({
15
+ sql: `SELECT access_level FROM wiki_acl WHERE user_id = ? AND workspace = ?`,
16
+ args: [userId, workspace]
17
+ });
18
+ if (result.rows.length > 0) {
19
+ const actualLevel = String(result.rows[0].access_level);
20
+ return {
21
+ allowed: accessLevelSatisfies(actualLevel, requiredLevel),
22
+ actualLevel
23
+ };
24
+ }
25
+ const wildcardResult = await client.execute({
26
+ sql: `SELECT access_level FROM wiki_acl WHERE user_id = ? AND workspace = '*'`,
27
+ args: [userId]
28
+ });
29
+ if (wildcardResult.rows.length > 0) {
30
+ const actualLevel = String(wildcardResult.rows[0].access_level);
31
+ return {
32
+ allowed: accessLevelSatisfies(actualLevel, requiredLevel),
33
+ actualLevel
34
+ };
35
+ }
36
+ return {
37
+ allowed: requiredLevel === "read",
38
+ actualLevel: "read"
39
+ };
40
+ } catch {
41
+ return {
42
+ allowed: requiredLevel === "read",
43
+ actualLevel: "read"
44
+ };
45
+ }
46
+ }
47
+ async function grantWikiAccess(userId, workspace, accessLevel, grantedBy) {
48
+ const { getClient } = await import("./lib/database.js");
49
+ const client = getClient();
50
+ await client.execute({
51
+ sql: `INSERT OR REPLACE INTO wiki_acl (user_id, workspace, access_level, granted_by, created_at)
52
+ VALUES (?, ?, ?, ?, ?)`,
53
+ args: [userId, workspace, accessLevel, grantedBy, (/* @__PURE__ */ new Date()).toISOString()]
54
+ });
55
+ }
56
+ async function revokeWikiAccess(userId, workspace) {
57
+ const { getClient } = await import("./lib/database.js");
58
+ const client = getClient();
59
+ const result = await client.execute({
60
+ sql: `DELETE FROM wiki_acl WHERE user_id = ? AND workspace = ?`,
61
+ args: [userId, workspace]
62
+ });
63
+ return (result.rowsAffected ?? 0) > 0;
64
+ }
65
+ async function listUserWikiAccess(userId) {
66
+ const { getClient } = await import("./lib/database.js");
67
+ const client = getClient();
68
+ const result = await client.execute({
69
+ sql: `SELECT user_id, workspace, access_level, granted_by, created_at
70
+ FROM wiki_acl WHERE user_id = ? ORDER BY workspace`,
71
+ args: [userId]
72
+ });
73
+ return result.rows.map((r) => ({
74
+ userId: String(r.user_id),
75
+ workspace: String(r.workspace),
76
+ accessLevel: String(r.access_level),
77
+ grantedBy: String(r.granted_by),
78
+ createdAt: String(r.created_at)
79
+ }));
80
+ }
81
+ async function listWorkspaceUsers(workspace) {
82
+ const { getClient } = await import("./lib/database.js");
83
+ const client = getClient();
84
+ const result = await client.execute({
85
+ sql: `SELECT user_id, workspace, access_level, granted_by, created_at
86
+ FROM wiki_acl WHERE workspace = ? OR workspace = '*' ORDER BY user_id`,
87
+ args: [workspace]
88
+ });
89
+ return result.rows.map((r) => ({
90
+ userId: String(r.user_id),
91
+ workspace: String(r.workspace),
92
+ accessLevel: String(r.access_level),
93
+ grantedBy: String(r.granted_by),
94
+ createdAt: String(r.created_at)
95
+ }));
96
+ }
97
+ var ACCESS_HIERARCHY = {
98
+ read: 1,
99
+ write: 2,
100
+ admin: 3
101
+ };
102
+ function accessLevelSatisfies(actual, required) {
103
+ return (ACCESS_HIERARCHY[actual] ?? 0) >= (ACCESS_HIERARCHY[required] ?? 0);
104
+ }
105
+ export {
106
+ checkWikiAccess,
107
+ grantWikiAccess,
108
+ listUserWikiAccess,
109
+ listWorkspaceUsers,
110
+ revokeWikiAccess
111
+ };
@@ -0,0 +1,21 @@
1
+ import {
2
+ MAX_CONCURRENT_WORKERS,
3
+ cleanupWorkerPid,
4
+ getTaskAwareCapacity,
5
+ registerWorkerPid,
6
+ releaseBackfillLock,
7
+ tryAcquireBackfillLock,
8
+ tryAcquireWorkerSlot
9
+ } from "./chunk-DSOKTUTT.js";
10
+ import "./chunk-5P3HOBZX.js";
11
+ import "./chunk-LYH5HE24.js";
12
+ import "./chunk-MLKGABMK.js";
13
+ export {
14
+ MAX_CONCURRENT_WORKERS,
15
+ cleanupWorkerPid,
16
+ getTaskAwareCapacity,
17
+ registerWorkerPid,
18
+ releaseBackfillLock,
19
+ tryAcquireBackfillLock,
20
+ tryAcquireWorkerSlot
21
+ };
@@ -0,0 +1,28 @@
1
+ import {
2
+ advanceWorkflow,
3
+ approveWorkflowStep,
4
+ createWorkflowDefinition,
5
+ getWorkflowDefinition,
6
+ getWorkflowInstance,
7
+ listWorkflowDefinitions,
8
+ listWorkflowInstances,
9
+ loadWorkflows,
10
+ persistWorkflows,
11
+ runWorkflow,
12
+ startWorkflow
13
+ } from "./chunk-F3DQ3HDH.js";
14
+ import "./chunk-FI5Q6F5S.js";
15
+ import "./chunk-MLKGABMK.js";
16
+ export {
17
+ advanceWorkflow,
18
+ approveWorkflowStep,
19
+ createWorkflowDefinition,
20
+ getWorkflowDefinition,
21
+ getWorkflowInstance,
22
+ listWorkflowDefinitions,
23
+ listWorkflowInstances,
24
+ loadWorkflows,
25
+ persistWorkflows,
26
+ runWorkflow,
27
+ startWorkflow
28
+ };
@@ -0,0 +1,27 @@
1
+ import {
2
+ cleanupWorktree,
3
+ ensureWorktree,
4
+ getGitRoot,
5
+ getMainRepoRoot,
6
+ isWorktreeDirty,
7
+ worktreeBranch,
8
+ worktreePath
9
+ } from "./chunk-EZHTLPOS.js";
10
+ import "./chunk-6IPJF5QD.js";
11
+ import "./chunk-DBQ6I6K2.js";
12
+ import "./chunk-2I23RPSI.js";
13
+ import "./chunk-XCPVYQVK.js";
14
+ import "./chunk-PNQDP3OA.js";
15
+ import "./chunk-FXU7JOXK.js";
16
+ import "./chunk-5P3HOBZX.js";
17
+ import "./chunk-LYH5HE24.js";
18
+ import "./chunk-MLKGABMK.js";
19
+ export {
20
+ cleanupWorktree,
21
+ ensureWorktree,
22
+ getGitRoot,
23
+ getMainRepoRoot,
24
+ isWorktreeDirty,
25
+ worktreeBranch,
26
+ worktreePath
27
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ cleanupAgentWorktree,
3
+ discoverRepoPaths,
4
+ sweepWorktrees
5
+ } from "./chunk-UP7DNYG7.js";
6
+ import "./chunk-EZHTLPOS.js";
7
+ import "./chunk-6IPJF5QD.js";
8
+ import "./chunk-DBQ6I6K2.js";
9
+ import "./chunk-2I23RPSI.js";
10
+ import "./chunk-XCPVYQVK.js";
11
+ import "./chunk-PNQDP3OA.js";
12
+ import "./chunk-FXU7JOXK.js";
13
+ import "./chunk-5P3HOBZX.js";
14
+ import "./chunk-LYH5HE24.js";
15
+ import "./chunk-MLKGABMK.js";
16
+ export {
17
+ cleanupAgentWorktree,
18
+ discoverRepoPaths,
19
+ sweepWorktrees
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.9.289",
3
+ "version": "0.9.290",
4
4
  "description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",