@askexenow/exe-os 0.8.41 → 0.8.43

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 (76) hide show
  1. package/dist/bin/backfill-conversations.js +805 -642
  2. package/dist/bin/backfill-responses.js +804 -641
  3. package/dist/bin/backfill-vectors.js +791 -634
  4. package/dist/bin/cleanup-stale-review-tasks.js +788 -631
  5. package/dist/bin/cli.js +1345 -660
  6. package/dist/bin/exe-agent.js +20 -1
  7. package/dist/bin/exe-assign.js +1503 -1343
  8. package/dist/bin/exe-boot.js +2518 -1798
  9. package/dist/bin/exe-call.js +39 -1
  10. package/dist/bin/exe-cloud.js +15 -1
  11. package/dist/bin/exe-dispatch.js +39 -2
  12. package/dist/bin/exe-doctor.js +790 -633
  13. package/dist/bin/exe-export-behaviors.js +792 -637
  14. package/dist/bin/exe-forget.js +145 -0
  15. package/dist/bin/exe-gateway.js +2500 -1877
  16. package/dist/bin/exe-heartbeat.js +147 -1
  17. package/dist/bin/exe-kill.js +795 -640
  18. package/dist/bin/exe-launch-agent.js +2168 -2008
  19. package/dist/bin/exe-link.js +28 -2
  20. package/dist/bin/exe-new-employee.js +25 -3
  21. package/dist/bin/exe-pending-messages.js +146 -1
  22. package/dist/bin/exe-pending-notifications.js +788 -631
  23. package/dist/bin/exe-pending-reviews.js +147 -1
  24. package/dist/bin/exe-rename.js +23 -0
  25. package/dist/bin/exe-review.js +490 -327
  26. package/dist/bin/exe-search.js +154 -3
  27. package/dist/bin/exe-session-cleanup.js +2466 -413
  28. package/dist/bin/exe-status.js +474 -317
  29. package/dist/bin/exe-team.js +474 -317
  30. package/dist/bin/git-sweep.js +2690 -150
  31. package/dist/bin/graph-backfill.js +794 -637
  32. package/dist/bin/graph-export.js +798 -641
  33. package/dist/bin/scan-tasks.js +2951 -44
  34. package/dist/bin/setup.js +62 -26
  35. package/dist/bin/shard-migrate.js +792 -637
  36. package/dist/bin/wiki-sync.js +794 -637
  37. package/dist/gateway/index.js +2504 -1895
  38. package/dist/hooks/bug-report-worker.js +2118 -576
  39. package/dist/hooks/commit-complete.js +2689 -149
  40. package/dist/hooks/error-recall.js +154 -3
  41. package/dist/hooks/ingest-worker.js +1439 -815
  42. package/dist/hooks/instructions-loaded.js +151 -0
  43. package/dist/hooks/notification.js +153 -2
  44. package/dist/hooks/post-compact.js +164 -0
  45. package/dist/hooks/pre-compact.js +3073 -101
  46. package/dist/hooks/pre-tool-use.js +151 -0
  47. package/dist/hooks/prompt-ingest-worker.js +1714 -1537
  48. package/dist/hooks/prompt-submit.js +2658 -1113
  49. package/dist/hooks/response-ingest-worker.js +170 -6
  50. package/dist/hooks/session-end.js +153 -2
  51. package/dist/hooks/session-start.js +154 -3
  52. package/dist/hooks/stop.js +151 -0
  53. package/dist/hooks/subagent-stop.js +151 -0
  54. package/dist/hooks/summary-worker.js +179 -7
  55. package/dist/index.js +278 -100
  56. package/dist/lib/cloud-sync.js +28 -2
  57. package/dist/lib/consolidation.js +69 -2
  58. package/dist/lib/database.js +19 -0
  59. package/dist/lib/device-registry.js +19 -0
  60. package/dist/lib/employee-templates.js +20 -1
  61. package/dist/lib/exe-daemon.js +236 -16
  62. package/dist/lib/hybrid-search.js +154 -3
  63. package/dist/lib/license.js +15 -1
  64. package/dist/lib/messaging.js +39 -2
  65. package/dist/lib/schedules.js +792 -637
  66. package/dist/lib/store.js +796 -636
  67. package/dist/lib/tasks.js +1614 -1091
  68. package/dist/lib/tmux-routing.js +149 -9
  69. package/dist/mcp/server.js +1825 -1138
  70. package/dist/mcp/tools/create-task.js +2280 -828
  71. package/dist/mcp/tools/list-tasks.js +2788 -159
  72. package/dist/mcp/tools/send-message.js +39 -2
  73. package/dist/mcp/tools/update-task.js +64 -0
  74. package/dist/runtime/index.js +235 -67
  75. package/dist/tui/App.js +1452 -644
  76. package/package.json +3 -2
@@ -504,6 +504,13 @@ async function ensureSchema() {
504
504
  });
505
505
  } catch {
506
506
  }
507
+ try {
508
+ await client.execute({
509
+ sql: `ALTER TABLE tasks ADD COLUMN session_scope TEXT`,
510
+ args: []
511
+ });
512
+ } catch {
513
+ }
507
514
  try {
508
515
  await client.execute({
509
516
  sql: `ALTER TABLE memories ADD COLUMN task_id TEXT`,
@@ -950,6 +957,18 @@ async function ensureSchema() {
950
957
  CREATE INDEX IF NOT EXISTS idx_session_kills_agent
951
958
  ON session_kills(agent_id);
952
959
  `);
960
+ await client.execute(`
961
+ CREATE TABLE IF NOT EXISTS global_procedures (
962
+ id TEXT PRIMARY KEY,
963
+ title TEXT NOT NULL,
964
+ content TEXT NOT NULL,
965
+ priority TEXT NOT NULL DEFAULT 'p0',
966
+ domain TEXT,
967
+ active INTEGER NOT NULL DEFAULT 1,
968
+ created_at TEXT NOT NULL,
969
+ updated_at TEXT NOT NULL
970
+ )
971
+ `);
953
972
  await client.executeMultiple(`
954
973
  CREATE TABLE IF NOT EXISTS conversations (
955
974
  id TEXT PRIMARY KEY,
@@ -1475,6 +1494,61 @@ var init_keychain = __esm({
1475
1494
  }
1476
1495
  });
1477
1496
 
1497
+ // src/lib/state-bus.ts
1498
+ var StateBus, orgBus;
1499
+ var init_state_bus = __esm({
1500
+ "src/lib/state-bus.ts"() {
1501
+ "use strict";
1502
+ StateBus = class {
1503
+ handlers = /* @__PURE__ */ new Map();
1504
+ globalHandlers = /* @__PURE__ */ new Set();
1505
+ /** Emit an event to all subscribers */
1506
+ emit(event) {
1507
+ const typeHandlers = this.handlers.get(event.type);
1508
+ if (typeHandlers) {
1509
+ for (const handler of typeHandlers) {
1510
+ try {
1511
+ handler(event);
1512
+ } catch {
1513
+ }
1514
+ }
1515
+ }
1516
+ for (const handler of this.globalHandlers) {
1517
+ try {
1518
+ handler(event);
1519
+ } catch {
1520
+ }
1521
+ }
1522
+ }
1523
+ /** Subscribe to a specific event type */
1524
+ on(type, handler) {
1525
+ if (!this.handlers.has(type)) {
1526
+ this.handlers.set(type, /* @__PURE__ */ new Set());
1527
+ }
1528
+ this.handlers.get(type).add(handler);
1529
+ }
1530
+ /** Subscribe to ALL events */
1531
+ onAny(handler) {
1532
+ this.globalHandlers.add(handler);
1533
+ }
1534
+ /** Unsubscribe from a specific event type */
1535
+ off(type, handler) {
1536
+ this.handlers.get(type)?.delete(handler);
1537
+ }
1538
+ /** Unsubscribe from ALL events */
1539
+ offAny(handler) {
1540
+ this.globalHandlers.delete(handler);
1541
+ }
1542
+ /** Remove all listeners */
1543
+ clear() {
1544
+ this.handlers.clear();
1545
+ this.globalHandlers.clear();
1546
+ }
1547
+ };
1548
+ orgBus = new StateBus();
1549
+ }
1550
+ });
1551
+
1478
1552
  // src/lib/shard-manager.ts
1479
1553
  var shard_manager_exports = {};
1480
1554
  __export(shard_manager_exports, {
@@ -1716,6 +1790,71 @@ var init_shard_manager = __esm({
1716
1790
  }
1717
1791
  });
1718
1792
 
1793
+ // src/lib/global-procedures.ts
1794
+ var global_procedures_exports = {};
1795
+ __export(global_procedures_exports, {
1796
+ deactivateGlobalProcedure: () => deactivateGlobalProcedure,
1797
+ getGlobalProceduresBlock: () => getGlobalProceduresBlock,
1798
+ loadGlobalProcedures: () => loadGlobalProcedures,
1799
+ storeGlobalProcedure: () => storeGlobalProcedure
1800
+ });
1801
+ import { randomUUID } from "crypto";
1802
+ async function loadGlobalProcedures() {
1803
+ const client = getClient();
1804
+ const result = await client.execute({
1805
+ sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
1806
+ args: []
1807
+ });
1808
+ const procedures = result.rows;
1809
+ if (procedures.length > 0) {
1810
+ _cache = procedures.map((p) => `### ${p.title}
1811
+ ${p.content}`).join("\n\n");
1812
+ } else {
1813
+ _cache = "";
1814
+ }
1815
+ _cacheLoaded = true;
1816
+ return procedures;
1817
+ }
1818
+ function getGlobalProceduresBlock() {
1819
+ if (!_cacheLoaded) return "";
1820
+ if (!_cache) return "";
1821
+ return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
1822
+
1823
+ ${_cache}
1824
+ `;
1825
+ }
1826
+ async function storeGlobalProcedure(input2) {
1827
+ const id = randomUUID();
1828
+ const now = (/* @__PURE__ */ new Date()).toISOString();
1829
+ const client = getClient();
1830
+ await client.execute({
1831
+ sql: `INSERT INTO global_procedures (id, title, content, priority, domain, active, created_at, updated_at)
1832
+ VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
1833
+ args: [id, input2.title, input2.content, input2.priority ?? "p0", input2.domain ?? null, now, now]
1834
+ });
1835
+ await loadGlobalProcedures();
1836
+ return id;
1837
+ }
1838
+ async function deactivateGlobalProcedure(id) {
1839
+ const now = (/* @__PURE__ */ new Date()).toISOString();
1840
+ const client = getClient();
1841
+ const result = await client.execute({
1842
+ sql: "UPDATE global_procedures SET active = 0, updated_at = ? WHERE id = ?",
1843
+ args: [now, id]
1844
+ });
1845
+ await loadGlobalProcedures();
1846
+ return result.rowsAffected > 0;
1847
+ }
1848
+ var _cache, _cacheLoaded;
1849
+ var init_global_procedures = __esm({
1850
+ "src/lib/global-procedures.ts"() {
1851
+ "use strict";
1852
+ init_database();
1853
+ _cache = "";
1854
+ _cacheLoaded = false;
1855
+ }
1856
+ });
1857
+
1719
1858
  // src/lib/store.ts
1720
1859
  var store_exports = {};
1721
1860
  __export(store_exports, {
@@ -1795,6 +1934,11 @@ async function initStore(options) {
1795
1934
  "version-query"
1796
1935
  );
1797
1936
  _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
1937
+ try {
1938
+ const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
1939
+ await loadGlobalProcedures2();
1940
+ } catch {
1941
+ }
1798
1942
  }
1799
1943
  function classifyTier(record) {
1800
1944
  if (record.tool_name === "commit_to_long_term_memory" && (record.importance ?? 0) >= 8) return 1;
@@ -1836,6 +1980,12 @@ async function writeMemory(record) {
1836
1980
  supersedes_id: record.supersedes_id ?? null
1837
1981
  };
1838
1982
  _pendingRecords.push(dbRow);
1983
+ orgBus.emit({
1984
+ type: "memory_stored",
1985
+ agentId: record.agent_id,
1986
+ project: record.project_name,
1987
+ timestamp: record.timestamp
1988
+ });
1839
1989
  const MAX_PENDING = 1e3;
1840
1990
  if (_pendingRecords.length > MAX_PENDING) {
1841
1991
  const dropped = _pendingRecords.length - MAX_PENDING;
@@ -2181,6 +2331,7 @@ var init_store = __esm({
2181
2331
  init_database();
2182
2332
  init_keychain();
2183
2333
  init_config();
2334
+ init_state_bus();
2184
2335
  INIT_MAX_RETRIES = 3;
2185
2336
  INIT_RETRY_DELAY_MS = 1e3;
2186
2337
  _pendingRecords = [];