@askexenow/exe-os 0.8.9 → 0.8.11

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 (107) hide show
  1. package/dist/bin/backfill-conversations.js +2181 -0
  2. package/dist/bin/backfill-responses.js +2064 -0
  3. package/dist/bin/backfill-vectors.js +1771 -0
  4. package/dist/bin/cleanup-stale-review-tasks.js +1468 -0
  5. package/dist/bin/cli.js +21580 -0
  6. package/dist/bin/exe-agent.js +2016 -0
  7. package/dist/bin/exe-assign.js +2176 -0
  8. package/dist/bin/exe-boot.js +6199 -0
  9. package/dist/bin/exe-call.js +889 -0
  10. package/dist/bin/exe-cloud.js +861 -0
  11. package/dist/bin/exe-dispatch.js +1026 -0
  12. package/dist/bin/exe-doctor.js +1786 -0
  13. package/dist/bin/exe-export-behaviors.js +1637 -0
  14. package/dist/bin/exe-forget.js +1784 -0
  15. package/dist/bin/exe-gateway.js +8007 -0
  16. package/dist/bin/exe-healthcheck.js +207 -0
  17. package/dist/bin/exe-heartbeat.js +1770 -0
  18. package/dist/bin/exe-kill.js +1622 -0
  19. package/dist/bin/exe-launch-agent.js +1847 -0
  20. package/dist/bin/exe-link.js +192 -0
  21. package/dist/bin/exe-new-employee.js +1384 -0
  22. package/dist/bin/exe-pending-messages.js +1568 -0
  23. package/dist/bin/exe-pending-notifications.js +1450 -0
  24. package/dist/bin/exe-pending-reviews.js +1590 -0
  25. package/dist/bin/exe-repo-drift.js +95 -0
  26. package/dist/bin/exe-review.js +1742 -0
  27. package/dist/bin/exe-search.js +3116 -0
  28. package/dist/bin/exe-session-cleanup.js +3359 -0
  29. package/dist/bin/exe-settings.js +365 -0
  30. package/dist/bin/exe-status.js +1661 -0
  31. package/dist/bin/exe-team.js +1453 -0
  32. package/dist/bin/git-sweep.js +2441 -0
  33. package/dist/bin/graph-backfill.js +2111 -0
  34. package/dist/bin/graph-export.js +1747 -0
  35. package/dist/bin/install.js +661 -0
  36. package/dist/bin/list-providers.js +140 -0
  37. package/dist/bin/scan-tasks.js +2039 -0
  38. package/dist/bin/setup.js +2706 -0
  39. package/dist/bin/shard-migrate.js +1637 -0
  40. package/dist/bin/update.js +98 -0
  41. package/dist/bin/wiki-sync.js +1657 -0
  42. package/dist/gateway/index.js +9123 -0
  43. package/dist/hooks/bug-report-worker.js +2770 -0
  44. package/dist/hooks/commit-complete.js +2364 -0
  45. package/dist/hooks/error-recall.js +3327 -0
  46. package/dist/hooks/exe-heartbeat-hook.js +237 -0
  47. package/dist/hooks/ingest-worker.js +4932 -0
  48. package/dist/hooks/ingest.js +695 -0
  49. package/dist/hooks/instructions-loaded.js +2069 -0
  50. package/dist/hooks/notification.js +1915 -0
  51. package/dist/hooks/post-compact.js +1940 -0
  52. package/dist/hooks/pre-compact.js +1935 -0
  53. package/dist/hooks/pre-tool-use.js +2380 -0
  54. package/dist/hooks/prompt-ingest-worker.js +2291 -0
  55. package/dist/hooks/prompt-submit.js +5056 -0
  56. package/dist/hooks/response-ingest-worker.js +2431 -0
  57. package/dist/hooks/session-end.js +2196 -0
  58. package/dist/hooks/session-start.js +3259 -0
  59. package/dist/hooks/stop.js +2025 -0
  60. package/dist/hooks/subagent-stop.js +1915 -0
  61. package/dist/hooks/summary-worker.js +2934 -0
  62. package/dist/index.js +12194 -0
  63. package/dist/lib/cloud-sync.js +500 -0
  64. package/dist/lib/config.js +235 -0
  65. package/dist/lib/consolidation.js +481 -0
  66. package/dist/lib/crypto.js +51 -0
  67. package/dist/lib/database.js +834 -0
  68. package/dist/lib/device-registry.js +1009 -0
  69. package/dist/lib/embedder.js +645 -0
  70. package/dist/lib/employee-templates.js +570 -0
  71. package/dist/lib/employees.js +182 -0
  72. package/dist/lib/error-detector.js +156 -0
  73. package/dist/lib/exe-daemon-client.js +456 -0
  74. package/dist/lib/exe-daemon.js +8566 -0
  75. package/dist/lib/file-grep.js +215 -0
  76. package/dist/lib/hybrid-search.js +3064 -0
  77. package/dist/lib/identity-templates.js +441 -0
  78. package/dist/lib/identity.js +228 -0
  79. package/dist/lib/keychain.js +145 -0
  80. package/dist/lib/license.js +382 -0
  81. package/dist/lib/messaging.js +1256 -0
  82. package/dist/lib/reminders.js +63 -0
  83. package/dist/lib/schedules.js +1525 -0
  84. package/dist/lib/session-registry.js +52 -0
  85. package/dist/lib/skill-learning.js +488 -0
  86. package/dist/lib/status-brief.js +240 -0
  87. package/dist/lib/store.js +1740 -0
  88. package/dist/lib/task-router.js +128 -0
  89. package/dist/lib/tasks.js +2452 -0
  90. package/dist/lib/tmux-routing.js +2836 -0
  91. package/dist/lib/tmux-status.js +261 -0
  92. package/dist/lib/tmux-transport.js +83 -0
  93. package/dist/lib/transport.js +128 -0
  94. package/dist/lib/ws-auth.js +19 -0
  95. package/dist/lib/ws-client.js +160 -0
  96. package/dist/mcp/server.js +10679 -0
  97. package/dist/mcp/tools/complete-reminder.js +67 -0
  98. package/dist/mcp/tools/create-reminder.js +52 -0
  99. package/dist/mcp/tools/create-task.js +1770 -0
  100. package/dist/mcp/tools/deactivate-behavior.js +268 -0
  101. package/dist/mcp/tools/list-reminders.js +62 -0
  102. package/dist/mcp/tools/list-tasks.js +483 -0
  103. package/dist/mcp/tools/send-message.js +1262 -0
  104. package/dist/mcp/tools/update-task.js +1799 -0
  105. package/dist/runtime/index.js +7068 -0
  106. package/dist/tui/App.js +17741 -0
  107. package/package.json +2 -2
@@ -0,0 +1,128 @@
1
+ // src/lib/task-router.ts
2
+ import { randomUUID } from "crypto";
3
+ var DEFAULT_BLOOM_CONFIG = {
4
+ complexityToTier: {
5
+ routine: "junior",
6
+ standard: "standard",
7
+ complex: "senior",
8
+ critical: "specialist"
9
+ },
10
+ tierRules: {
11
+ junior: {
12
+ eligible: ["tom"],
13
+ reviewRequired: false,
14
+ manualOnly: false
15
+ },
16
+ standard: {
17
+ eligible: ["tom"],
18
+ reviewRequired: false,
19
+ manualOnly: false
20
+ },
21
+ senior: {
22
+ eligible: [],
23
+ // any specialist, but review required
24
+ reviewRequired: true,
25
+ manualOnly: false
26
+ },
27
+ specialist: {
28
+ eligible: [],
29
+ reviewRequired: true,
30
+ manualOnly: true
31
+ }
32
+ }
33
+ };
34
+ function resolveBloomRouting(complexity, config = DEFAULT_BLOOM_CONFIG) {
35
+ const tier = config.complexityToTier[complexity];
36
+ const rule = config.tierRules[tier];
37
+ return {
38
+ tier,
39
+ reviewRequired: rule.reviewRequired,
40
+ manualOnly: rule.manualOnly,
41
+ eligible: rule.eligible
42
+ };
43
+ }
44
+ async function scoreEmployee(taskVector, agentId, searchFn) {
45
+ const results = await searchFn(taskVector, agentId, { limit: 5 });
46
+ if (results.length === 0) {
47
+ return { agentId, score: 0 };
48
+ }
49
+ const distances = results.map((r) => r["_distance"]).filter((d) => typeof d === "number");
50
+ if (distances.length > 0) {
51
+ const avgDistance = distances.reduce((sum, d) => sum + d, 0) / distances.length;
52
+ return { agentId, score: 1 / (1 + avgDistance) };
53
+ }
54
+ return { agentId, score: results.length / 5 };
55
+ }
56
+ async function routeTask(taskDescription, employees, embedFn, searchFn, options) {
57
+ let specialists = employees.filter((e) => e.name !== "exe");
58
+ if (specialists.length === 0) {
59
+ throw new Error(
60
+ "No specialist employees available. Create one with /exe-new-employee."
61
+ );
62
+ }
63
+ let bloomRouting;
64
+ if (options?.complexity) {
65
+ bloomRouting = resolveBloomRouting(options.complexity, options.bloomConfig);
66
+ if (bloomRouting.manualOnly) {
67
+ throw new Error(
68
+ `Task complexity "${options.complexity}" requires manual assignment (tier: ${bloomRouting.tier}).`
69
+ );
70
+ }
71
+ if (bloomRouting.eligible.length > 0) {
72
+ const eligible = new Set(bloomRouting.eligible);
73
+ const filtered = specialists.filter((e) => eligible.has(e.name));
74
+ if (filtered.length > 0) {
75
+ specialists = filtered;
76
+ }
77
+ }
78
+ }
79
+ const taskVector = await embedFn(taskDescription);
80
+ const scored = await Promise.all(
81
+ specialists.map(async (emp) => {
82
+ const { score } = await scoreEmployee(taskVector, emp.name, searchFn);
83
+ return { employee: emp, score };
84
+ })
85
+ );
86
+ scored.sort((a, b) => b.score - a.score);
87
+ return { ...scored[0], bloomRouting };
88
+ }
89
+ function createAssignmentMemory(taskDescription, assignedTo, assignedBy) {
90
+ return {
91
+ id: randomUUID(),
92
+ agent_id: assignedTo.name,
93
+ agent_role: assignedTo.role,
94
+ session_id: `assign-${Date.now()}`,
95
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
96
+ tool_name: "assignment",
97
+ project_name: "",
98
+ has_error: false,
99
+ raw_text: `Task assigned by ${assignedBy}: ${taskDescription}`,
100
+ vector: null
101
+ // Will be backfilled
102
+ };
103
+ }
104
+ function formatAssignmentOutput(employee, task, score, mode, bloomRouting) {
105
+ const modeLabel = mode === "auto" ? "auto-routed" : "direct";
106
+ const percent = Math.round(score * 100);
107
+ const lines = [
108
+ `Assigned to ${employee.name} (${employee.role})`,
109
+ `Mode: ${modeLabel}`,
110
+ `Relevance: ${percent}%`,
111
+ `Task: ${task}`
112
+ ];
113
+ if (bloomRouting) {
114
+ lines.push(`Complexity tier: ${bloomRouting.tier}`);
115
+ if (bloomRouting.reviewRequired) {
116
+ lines.push(`Review: required`);
117
+ }
118
+ }
119
+ return lines.join("\n");
120
+ }
121
+ export {
122
+ DEFAULT_BLOOM_CONFIG,
123
+ createAssignmentMemory,
124
+ formatAssignmentOutput,
125
+ resolveBloomRouting,
126
+ routeTask,
127
+ scoreEmployee
128
+ };