@askexenow/exe-os 0.8.1 → 0.8.2

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 (106) hide show
  1. package/package.json +1 -1
  2. package/dist/bin/backfill-responses.js +0 -2064
  3. package/dist/bin/backfill-vectors.js +0 -1771
  4. package/dist/bin/cleanup-stale-review-tasks.js +0 -1468
  5. package/dist/bin/cli.js +0 -21371
  6. package/dist/bin/exe-agent.js +0 -2016
  7. package/dist/bin/exe-assign.js +0 -2176
  8. package/dist/bin/exe-boot.js +0 -6332
  9. package/dist/bin/exe-call.js +0 -341
  10. package/dist/bin/exe-cloud.js +0 -861
  11. package/dist/bin/exe-dispatch.js +0 -1159
  12. package/dist/bin/exe-doctor.js +0 -1786
  13. package/dist/bin/exe-export-behaviors.js +0 -1637
  14. package/dist/bin/exe-forget.js +0 -1784
  15. package/dist/bin/exe-gateway.js +0 -8140
  16. package/dist/bin/exe-healthcheck.js +0 -207
  17. package/dist/bin/exe-heartbeat.js +0 -1778
  18. package/dist/bin/exe-kill.js +0 -1622
  19. package/dist/bin/exe-launch-agent.js +0 -1847
  20. package/dist/bin/exe-link.js +0 -192
  21. package/dist/bin/exe-new-employee.js +0 -1384
  22. package/dist/bin/exe-pending-messages.js +0 -1576
  23. package/dist/bin/exe-pending-notifications.js +0 -1450
  24. package/dist/bin/exe-pending-reviews.js +0 -1598
  25. package/dist/bin/exe-repo-drift.js +0 -95
  26. package/dist/bin/exe-review.js +0 -1742
  27. package/dist/bin/exe-search.js +0 -3116
  28. package/dist/bin/exe-session-cleanup.js +0 -3360
  29. package/dist/bin/exe-settings.js +0 -365
  30. package/dist/bin/exe-status.js +0 -1661
  31. package/dist/bin/exe-team.js +0 -1453
  32. package/dist/bin/git-sweep.js +0 -2441
  33. package/dist/bin/graph-backfill.js +0 -2111
  34. package/dist/bin/graph-export.js +0 -1747
  35. package/dist/bin/install.js +0 -661
  36. package/dist/bin/list-providers.js +0 -140
  37. package/dist/bin/scan-tasks.js +0 -2039
  38. package/dist/bin/setup.js +0 -2717
  39. package/dist/bin/shard-migrate.js +0 -1637
  40. package/dist/bin/update.js +0 -98
  41. package/dist/bin/wiki-sync.js +0 -1657
  42. package/dist/gateway/index.js +0 -9256
  43. package/dist/hooks/bug-report-worker.js +0 -2903
  44. package/dist/hooks/commit-complete.js +0 -2364
  45. package/dist/hooks/error-recall.js +0 -3327
  46. package/dist/hooks/exe-heartbeat-hook.js +0 -237
  47. package/dist/hooks/ingest-worker.js +0 -5065
  48. package/dist/hooks/ingest.js +0 -695
  49. package/dist/hooks/instructions-loaded.js +0 -2069
  50. package/dist/hooks/notification.js +0 -1915
  51. package/dist/hooks/post-compact.js +0 -1940
  52. package/dist/hooks/pre-compact.js +0 -1935
  53. package/dist/hooks/pre-tool-use.js +0 -2380
  54. package/dist/hooks/prompt-ingest-worker.js +0 -2291
  55. package/dist/hooks/prompt-submit.js +0 -5189
  56. package/dist/hooks/response-ingest-worker.js +0 -2431
  57. package/dist/hooks/session-end.js +0 -2196
  58. package/dist/hooks/session-start.js +0 -3259
  59. package/dist/hooks/stop.js +0 -2025
  60. package/dist/hooks/subagent-stop.js +0 -1915
  61. package/dist/hooks/summary-worker.js +0 -2931
  62. package/dist/index.js +0 -12327
  63. package/dist/lib/cloud-sync.js +0 -500
  64. package/dist/lib/config.js +0 -235
  65. package/dist/lib/consolidation.js +0 -481
  66. package/dist/lib/crypto.js +0 -51
  67. package/dist/lib/database.js +0 -834
  68. package/dist/lib/device-registry.js +0 -1009
  69. package/dist/lib/embedder.js +0 -645
  70. package/dist/lib/employee-templates.js +0 -570
  71. package/dist/lib/employees.js +0 -182
  72. package/dist/lib/error-detector.js +0 -156
  73. package/dist/lib/exe-daemon-client.js +0 -456
  74. package/dist/lib/exe-daemon.js +0 -8699
  75. package/dist/lib/file-grep.js +0 -215
  76. package/dist/lib/hybrid-search.js +0 -3064
  77. package/dist/lib/identity-templates.js +0 -441
  78. package/dist/lib/identity.js +0 -228
  79. package/dist/lib/keychain.js +0 -145
  80. package/dist/lib/license.js +0 -382
  81. package/dist/lib/messaging.js +0 -1389
  82. package/dist/lib/reminders.js +0 -63
  83. package/dist/lib/schedules.js +0 -1525
  84. package/dist/lib/session-registry.js +0 -52
  85. package/dist/lib/skill-learning.js +0 -488
  86. package/dist/lib/status-brief.js +0 -240
  87. package/dist/lib/store.js +0 -1740
  88. package/dist/lib/task-router.js +0 -128
  89. package/dist/lib/tasks.js +0 -2585
  90. package/dist/lib/tmux-routing.js +0 -2969
  91. package/dist/lib/tmux-status.js +0 -261
  92. package/dist/lib/tmux-transport.js +0 -83
  93. package/dist/lib/transport.js +0 -128
  94. package/dist/lib/ws-auth.js +0 -19
  95. package/dist/lib/ws-client.js +0 -160
  96. package/dist/mcp/server.js +0 -10812
  97. package/dist/mcp/tools/complete-reminder.js +0 -67
  98. package/dist/mcp/tools/create-reminder.js +0 -52
  99. package/dist/mcp/tools/create-task.js +0 -1903
  100. package/dist/mcp/tools/deactivate-behavior.js +0 -268
  101. package/dist/mcp/tools/list-reminders.js +0 -62
  102. package/dist/mcp/tools/list-tasks.js +0 -491
  103. package/dist/mcp/tools/send-message.js +0 -1395
  104. package/dist/mcp/tools/update-task.js +0 -1807
  105. package/dist/runtime/index.js +0 -7201
  106. package/dist/tui/App.js +0 -17874
@@ -1,182 +0,0 @@
1
- // src/lib/employees.ts
2
- import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
3
- import { existsSync as existsSync2, symlinkSync, readlinkSync } from "fs";
4
- import { execSync } from "child_process";
5
- import path2 from "path";
6
-
7
- // src/lib/config.ts
8
- import { readFile, writeFile, mkdir } from "fs/promises";
9
- import { readFileSync, existsSync, renameSync } from "fs";
10
- import path from "path";
11
- import os from "os";
12
- function resolveDataDir() {
13
- if (process.env.EXE_OS_DIR) return process.env.EXE_OS_DIR;
14
- if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
15
- const newDir = path.join(os.homedir(), ".exe-os");
16
- const legacyDir = path.join(os.homedir(), ".exe-mem");
17
- if (!existsSync(newDir) && existsSync(legacyDir)) {
18
- try {
19
- renameSync(legacyDir, newDir);
20
- process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
21
- `);
22
- } catch {
23
- return legacyDir;
24
- }
25
- }
26
- return newDir;
27
- }
28
- var EXE_AI_DIR = resolveDataDir();
29
- var DB_PATH = path.join(EXE_AI_DIR, "memories.db");
30
- var MODELS_DIR = path.join(EXE_AI_DIR, "models");
31
- var CONFIG_PATH = path.join(EXE_AI_DIR, "config.json");
32
- var LEGACY_LANCE_PATH = path.join(EXE_AI_DIR, "local.lance");
33
- var CURRENT_CONFIG_VERSION = 1;
34
- var DEFAULT_CONFIG = {
35
- config_version: CURRENT_CONFIG_VERSION,
36
- dbPath: DB_PATH,
37
- modelFile: "jina-embeddings-v5-small-q4_k_m.gguf",
38
- embeddingDim: 1024,
39
- batchSize: 20,
40
- flushIntervalMs: 1e4,
41
- autoIngestion: true,
42
- autoRetrieval: true,
43
- searchMode: "hybrid",
44
- hookSearchMode: "hybrid",
45
- fileGrepEnabled: true,
46
- splashEffect: true,
47
- consolidationEnabled: true,
48
- consolidationIntervalMs: 6 * 60 * 60 * 1e3,
49
- consolidationModel: "claude-haiku-4-5-20251001",
50
- consolidationMaxCallsPerRun: 20,
51
- selfQueryRouter: true,
52
- selfQueryModel: "claude-haiku-4-5-20251001",
53
- rerankerEnabled: true,
54
- scalingRoadmap: {
55
- rerankerAutoTrigger: {
56
- enabled: true,
57
- broadQueryMinCardinality: 5e4,
58
- fetchTopK: 150,
59
- returnTopK: 5
60
- }
61
- },
62
- graphRagEnabled: true,
63
- wikiEnabled: false,
64
- wikiUrl: "",
65
- wikiApiKey: "",
66
- wikiSyncIntervalMs: 30 * 60 * 1e3,
67
- wikiWorkspaceMapping: {
68
- exe: "Executive",
69
- yoshi: "Engineering",
70
- mari: "Marketing",
71
- tom: "Engineering",
72
- sasha: "Production"
73
- },
74
- wikiAutoUpdate: true,
75
- wikiAutoUpdateThreshold: 0.5,
76
- wikiAutoUpdateCreateNew: true,
77
- skillLearning: true,
78
- skillThreshold: 3,
79
- skillModel: "claude-haiku-4-5-20251001",
80
- exeHeartbeat: {
81
- enabled: true,
82
- intervalSeconds: 60,
83
- staleInProgressThresholdHours: 2
84
- },
85
- sessionLifecycle: {
86
- idleKillEnabled: true,
87
- idleKillTicksRequired: 3,
88
- idleKillIntercomAckWindowMs: 1e4,
89
- maxAutoInstances: 10
90
- },
91
- autoUpdate: {
92
- checkOnBoot: true,
93
- autoInstall: false,
94
- checkIntervalMs: 24 * 60 * 60 * 1e3
95
- }
96
- };
97
-
98
- // src/lib/employees.ts
99
- var EMPLOYEES_PATH = path2.join(EXE_AI_DIR, "exe-employees.json");
100
- function validateEmployeeName(name) {
101
- if (!name) {
102
- return { valid: false, error: "Name is required" };
103
- }
104
- if (name.length > 32) {
105
- return { valid: false, error: "Name must be 32 characters or fewer" };
106
- }
107
- if (!/^[a-z][a-z0-9]*$/.test(name)) {
108
- return {
109
- valid: false,
110
- error: "Name must start with a letter and contain only lowercase alphanumeric characters"
111
- };
112
- }
113
- return { valid: true };
114
- }
115
- async function loadEmployees(employeesPath = EMPLOYEES_PATH) {
116
- if (!existsSync2(employeesPath)) {
117
- return [];
118
- }
119
- const raw = await readFile2(employeesPath, "utf-8");
120
- try {
121
- return JSON.parse(raw);
122
- } catch {
123
- return [];
124
- }
125
- }
126
- async function saveEmployees(employees, employeesPath = EMPLOYEES_PATH) {
127
- await mkdir2(path2.dirname(employeesPath), { recursive: true });
128
- await writeFile2(employeesPath, JSON.stringify(employees, null, 2) + "\n", "utf-8");
129
- }
130
- function getEmployee(employees, name) {
131
- return employees.find((e) => e.name === name);
132
- }
133
- function addEmployee(employees, employee) {
134
- if (employees.some((e) => e.name === employee.name)) {
135
- throw new Error(`Employee '${employee.name}' already exists`);
136
- }
137
- return [...employees, employee];
138
- }
139
- function registerBinSymlinks(name) {
140
- const created = [];
141
- const skipped = [];
142
- const errors = [];
143
- let exeBinPath;
144
- try {
145
- exeBinPath = execSync("which exe", { encoding: "utf-8" }).trim();
146
- } catch {
147
- errors.push("Could not find 'exe' in PATH");
148
- return { created, skipped, errors };
149
- }
150
- const binDir = path2.dirname(exeBinPath);
151
- let target;
152
- try {
153
- target = readlinkSync(exeBinPath);
154
- } catch {
155
- errors.push("Could not read 'exe' symlink");
156
- return { created, skipped, errors };
157
- }
158
- for (const suffix of ["", "-opencode"]) {
159
- const linkName = `${name}${suffix}`;
160
- const linkPath = path2.join(binDir, linkName);
161
- if (existsSync2(linkPath)) {
162
- skipped.push(linkName);
163
- continue;
164
- }
165
- try {
166
- symlinkSync(target, linkPath);
167
- created.push(linkName);
168
- } catch (err) {
169
- errors.push(`${linkName}: ${err instanceof Error ? err.message : String(err)}`);
170
- }
171
- }
172
- return { created, skipped, errors };
173
- }
174
- export {
175
- EMPLOYEES_PATH,
176
- addEmployee,
177
- getEmployee,
178
- loadEmployees,
179
- registerBinSymlinks,
180
- saveEmployees,
181
- validateEmployeeName
182
- };
@@ -1,156 +0,0 @@
1
- // src/lib/error-detector.ts
2
- import crypto from "crypto";
3
-
4
- // src/lib/mcp-prefix.ts
5
- var MCP_PRIMARY_KEY = "exe-os";
6
- var MCP_LEGACY_KEY = "exe-mem";
7
- var MCP_TOOL_PREFIXES = [
8
- `mcp__${MCP_PRIMARY_KEY}__`,
9
- `mcp__${MCP_LEGACY_KEY}__`
10
- ];
11
- function isExeMcpTool(toolName) {
12
- if (!toolName) return false;
13
- return MCP_TOOL_PREFIXES.some((p) => toolName.startsWith(p));
14
- }
15
-
16
- // src/lib/error-detector.ts
17
- var ERROR_PATTERNS = [
18
- /\bError\b/i,
19
- /\bERR!\b/,
20
- /\bFAIL(ED|URE)?\b/i,
21
- /\bException\b/i,
22
- /\bTraceback\b/,
23
- /\bpanic\b/,
24
- /\bSIGSEGV\b/,
25
- /\bSIGABRT\b/,
26
- /exit code [1-9]/i,
27
- /non-zero (exit|status)/i,
28
- /command not found/i,
29
- /permission denied/i,
30
- /ENOENT/,
31
- /EACCES/,
32
- /ENOMEM/
33
- ];
34
- var FILE_CONTENT_TOOLS = /* @__PURE__ */ new Set([
35
- "Read",
36
- "Write",
37
- "Edit",
38
- "Glob",
39
- "Grep",
40
- "NotebookEdit"
41
- ]);
42
- var STDERR_IGNORE_PATTERNS = [
43
- /^warning\b/i,
44
- /\bDeprecationWarning\b/,
45
- /^hint:/i,
46
- /^npm warn\b/i,
47
- /^npm notice\b/i,
48
- /^\(node:\d+\) \w*Warning:/,
49
- /^Cloning into/,
50
- /^Already on/,
51
- /^Switched to/,
52
- /^Your branch is/,
53
- /^Auto-merging/,
54
- /^\s*$/
55
- ];
56
- function isRealStderr(stderr) {
57
- const lines = stderr.trim().split("\n");
58
- const meaningful = lines.filter(
59
- (line) => line.trim().length > 0 && !STDERR_IGNORE_PATTERNS.some((p) => p.test(line))
60
- );
61
- return meaningful.length > 0;
62
- }
63
- function logSuppression(exitCode, stderr, stdout) {
64
- process.stderr.write(
65
- `[error-detector] suppressed bash non-zero exit: code=${exitCode} stderr_len=${stderr.length} stdout_len=${stdout.length}
66
- `
67
- );
68
- }
69
- function detectError(data) {
70
- const response = data.tool_response;
71
- if (!response) return false;
72
- const toolName = data.tool_name ?? "";
73
- if (FILE_CONTENT_TOOLS.has(toolName)) {
74
- return response.type === "error" || response.error != null;
75
- }
76
- if (toolName === "Bash") {
77
- const exitCode = typeof response.exitCode === "number" ? response.exitCode : 0;
78
- const stderr = typeof response.stderr === "string" ? response.stderr : "";
79
- const stdout = typeof response.stdout === "string" ? response.stdout : "";
80
- if (exitCode === 141) {
81
- logSuppression(exitCode, stderr, stdout);
82
- return false;
83
- }
84
- if (stderr.trim().length > 0 && isRealStderr(stderr)) return true;
85
- if (exitCode !== 0 && !isRealStderr(stderr) && stdout.trim().length > 0) {
86
- logSuppression(exitCode, stderr, stdout);
87
- return false;
88
- }
89
- if (exitCode !== 0) return true;
90
- return false;
91
- }
92
- if (response.type === "error" || response.error != null || response.isError === true) {
93
- return true;
94
- }
95
- if (typeof response.stderr === "string" && response.stderr.trim().length > 0) {
96
- if (isRealStderr(response.stderr)) return true;
97
- }
98
- const textParts = [];
99
- if (typeof response.stdout === "string") textParts.push(response.stdout);
100
- if (typeof response.output === "string") textParts.push(response.output);
101
- if (typeof response.text === "string") textParts.push(response.text);
102
- if (typeof response.message === "string") textParts.push(response.message);
103
- if (textParts.length === 0) return false;
104
- const text = textParts.join("\n");
105
- return ERROR_PATTERNS.some((pattern) => pattern.test(text));
106
- }
107
- function isExeOsError(data) {
108
- const toolName = data.tool_name ?? "";
109
- if (isExeMcpTool(toolName)) return true;
110
- if (toolName === "Bash") {
111
- const cmd = String(data.tool_input?.command ?? "");
112
- if (/\bexe-os\b|exe-boot|exe-healthcheck|scan-tasks|exe-call/.test(cmd)) return true;
113
- if (/node.*dist\/(bin|hooks|lib)\//.test(cmd)) return true;
114
- }
115
- return false;
116
- }
117
- var USER_ERROR_PATTERNS = [
118
- /not found:?\s/i,
119
- /expected \d+ words/i,
120
- /provide either/i,
121
- /invalid.*parameter/i,
122
- /already exists/i,
123
- /Multiple tasks match/i,
124
- /Use a more specific identifier/i
125
- ];
126
- var SYSTEM_BUG_PATTERNS = [
127
- /SQLITE_ERROR/,
128
- /Cannot find module/,
129
- /ERR_MODULE_NOT_FOUND/,
130
- /TypeError:/,
131
- /ReferenceError:/,
132
- /Cannot read propert/,
133
- /is not a function/,
134
- /ENOENT.*dist\//,
135
- /dimension mismatch/i,
136
- /unhealthy.*model/i,
137
- /constraint.*violat/i
138
- ];
139
- function classifyError(errorText) {
140
- if (USER_ERROR_PATTERNS.some((p) => p.test(errorText))) return "user";
141
- if (SYSTEM_BUG_PATTERNS.some((p) => p.test(errorText))) return "system";
142
- if (/at\s+\S+\s+\(.*exe-os.*\)/m.test(errorText)) return "system";
143
- if (/at\s+\S+\s+\(.*dist\/(lib|bin|hooks|mcp)\//m.test(errorText)) return "system";
144
- return "unknown";
145
- }
146
- function errorFingerprint(toolName, errorText) {
147
- const normalized = errorText.replace(/\d{4}-\d{2}-\d{2}T[\d:.]+Z/g, "TIMESTAMP").replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, "UUID").replace(/\/Users\/[^\s]+/g, "PATH").replace(/:\d+:\d+/g, ":LINE:COL").slice(0, 200);
148
- return crypto.createHash("sha256").update(`${toolName}:${normalized}`).digest("hex").slice(0, 16);
149
- }
150
- export {
151
- ERROR_PATTERNS,
152
- classifyError,
153
- detectError,
154
- errorFingerprint,
155
- isExeOsError
156
- };