@askexenow/exe-os 0.9.8 → 0.9.9
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.
- package/dist/bin/backfill-conversations.js +222 -49
- package/dist/bin/backfill-responses.js +221 -48
- package/dist/bin/backfill-vectors.js +225 -52
- package/dist/bin/cleanup-stale-review-tasks.js +150 -28
- package/dist/bin/cli.js +1295 -856
- package/dist/bin/exe-agent-config.js +36 -8
- package/dist/bin/exe-agent.js +14 -4
- package/dist/bin/exe-assign.js +221 -48
- package/dist/bin/exe-boot.js +778 -427
- package/dist/bin/exe-call.js +41 -13
- package/dist/bin/exe-cloud.js +163 -58
- package/dist/bin/exe-dispatch.js +276 -139
- package/dist/bin/exe-doctor.js +145 -27
- package/dist/bin/exe-export-behaviors.js +141 -23
- package/dist/bin/exe-forget.js +137 -19
- package/dist/bin/exe-gateway.js +677 -388
- package/dist/bin/exe-heartbeat.js +227 -108
- package/dist/bin/exe-kill.js +138 -20
- package/dist/bin/exe-launch-agent.js +172 -39
- package/dist/bin/exe-link.js +291 -100
- package/dist/bin/exe-new-employee.js +214 -106
- package/dist/bin/exe-pending-messages.js +395 -33
- package/dist/bin/exe-pending-notifications.js +684 -99
- package/dist/bin/exe-pending-reviews.js +420 -74
- package/dist/bin/exe-rename.js +147 -49
- package/dist/bin/exe-review.js +138 -20
- package/dist/bin/exe-search.js +240 -69
- package/dist/bin/exe-session-cleanup.js +440 -250
- package/dist/bin/exe-settings.js +61 -17
- package/dist/bin/exe-start-codex.js +158 -39
- package/dist/bin/exe-start-opencode.js +157 -38
- package/dist/bin/exe-status.js +151 -29
- package/dist/bin/exe-team.js +138 -20
- package/dist/bin/git-sweep.js +404 -212
- package/dist/bin/graph-backfill.js +137 -19
- package/dist/bin/graph-export.js +140 -22
- package/dist/bin/install.js +90 -61
- package/dist/bin/scan-tasks.js +412 -220
- package/dist/bin/setup.js +564 -293
- package/dist/bin/shard-migrate.js +139 -21
- package/dist/bin/update.js +138 -49
- package/dist/bin/wiki-sync.js +137 -19
- package/dist/gateway/index.js +533 -320
- package/dist/hooks/bug-report-worker.js +344 -193
- package/dist/hooks/codex-stop-task-finalizer.js +4678 -0
- package/dist/hooks/commit-complete.js +402 -210
- package/dist/hooks/error-recall.js +245 -74
- package/dist/hooks/exe-heartbeat-hook.js +16 -6
- package/dist/hooks/ingest-worker.js +3423 -3157
- package/dist/hooks/ingest.js +832 -97
- package/dist/hooks/instructions-loaded.js +227 -54
- package/dist/hooks/notification.js +216 -43
- package/dist/hooks/post-compact.js +239 -62
- package/dist/hooks/pre-compact.js +408 -216
- package/dist/hooks/pre-tool-use.js +268 -90
- package/dist/hooks/prompt-ingest-worker.js +352 -102
- package/dist/hooks/prompt-submit.js +541 -328
- package/dist/hooks/response-ingest-worker.js +372 -122
- package/dist/hooks/session-end.js +443 -240
- package/dist/hooks/session-start.js +313 -127
- package/dist/hooks/stop.js +293 -98
- package/dist/hooks/subagent-stop.js +239 -62
- package/dist/hooks/summary-worker.js +568 -236
- package/dist/index.js +538 -324
- package/dist/lib/agent-config.js +28 -6
- package/dist/lib/cloud-sync.js +284 -105
- package/dist/lib/config.js +30 -10
- package/dist/lib/consolidation.js +16 -6
- package/dist/lib/database.js +123 -25
- package/dist/lib/db-daemon-client.js +73 -19
- package/dist/lib/db.js +123 -25
- package/dist/lib/device-registry.js +133 -35
- package/dist/lib/embedder.js +107 -32
- package/dist/lib/employee-templates.js +14 -4
- package/dist/lib/employees.js +41 -13
- package/dist/lib/exe-daemon-client.js +88 -22
- package/dist/lib/exe-daemon.js +935 -587
- package/dist/lib/hybrid-search.js +240 -69
- package/dist/lib/identity.js +18 -8
- package/dist/lib/license.js +133 -48
- package/dist/lib/messaging.js +116 -56
- package/dist/lib/reminders.js +14 -4
- package/dist/lib/schedules.js +137 -19
- package/dist/lib/skill-learning.js +33 -6
- package/dist/lib/store.js +137 -19
- package/dist/lib/task-router.js +14 -4
- package/dist/lib/tasks.js +280 -234
- package/dist/lib/tmux-routing.js +172 -125
- package/dist/lib/token-spend.js +26 -8
- package/dist/mcp/server.js +1326 -609
- package/dist/mcp/tools/complete-reminder.js +14 -4
- package/dist/mcp/tools/create-reminder.js +14 -4
- package/dist/mcp/tools/create-task.js +306 -248
- package/dist/mcp/tools/deactivate-behavior.js +16 -6
- package/dist/mcp/tools/list-reminders.js +14 -4
- package/dist/mcp/tools/list-tasks.js +123 -107
- package/dist/mcp/tools/send-message.js +75 -29
- package/dist/mcp/tools/update-task.js +1848 -199
- package/dist/runtime/index.js +441 -248
- package/dist/tui/App.js +761 -424
- package/package.json +1 -1
package/dist/lib/token-spend.js
CHANGED
|
@@ -3,9 +3,18 @@ var __esm = (fn, res) => function __init() {
|
|
|
3
3
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
4
4
|
};
|
|
5
5
|
|
|
6
|
+
// src/lib/secure-files.ts
|
|
7
|
+
import { chmodSync, existsSync, mkdirSync } from "fs";
|
|
8
|
+
import { chmod, mkdir } from "fs/promises";
|
|
9
|
+
var init_secure_files = __esm({
|
|
10
|
+
"src/lib/secure-files.ts"() {
|
|
11
|
+
"use strict";
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
6
15
|
// src/lib/config.ts
|
|
7
|
-
import { readFile, writeFile
|
|
8
|
-
import { readFileSync, existsSync, renameSync } from "fs";
|
|
16
|
+
import { readFile, writeFile } from "fs/promises";
|
|
17
|
+
import { readFileSync, existsSync as existsSync2, renameSync } from "fs";
|
|
9
18
|
import path from "path";
|
|
10
19
|
import os from "os";
|
|
11
20
|
function resolveDataDir() {
|
|
@@ -13,7 +22,7 @@ function resolveDataDir() {
|
|
|
13
22
|
if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
|
|
14
23
|
const newDir = path.join(os.homedir(), ".exe-os");
|
|
15
24
|
const legacyDir = path.join(os.homedir(), ".exe-mem");
|
|
16
|
-
if (!
|
|
25
|
+
if (!existsSync2(newDir) && existsSync2(legacyDir)) {
|
|
17
26
|
try {
|
|
18
27
|
renameSync(legacyDir, newDir);
|
|
19
28
|
process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
|
|
@@ -28,6 +37,7 @@ var EXE_AI_DIR, DB_PATH, MODELS_DIR, CONFIG_PATH, LEGACY_LANCE_PATH, CURRENT_CON
|
|
|
28
37
|
var init_config = __esm({
|
|
29
38
|
"src/lib/config.ts"() {
|
|
30
39
|
"use strict";
|
|
40
|
+
init_secure_files();
|
|
31
41
|
EXE_AI_DIR = resolveDataDir();
|
|
32
42
|
DB_PATH = path.join(EXE_AI_DIR, "memories.db");
|
|
33
43
|
MODELS_DIR = path.join(EXE_AI_DIR, "models");
|
|
@@ -107,7 +117,7 @@ import { createClient } from "@libsql/client";
|
|
|
107
117
|
// src/lib/employees.ts
|
|
108
118
|
init_config();
|
|
109
119
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
110
|
-
import { existsSync as
|
|
120
|
+
import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync2, renameSync as renameSync2, unlinkSync, writeFileSync } from "fs";
|
|
111
121
|
import { execSync } from "child_process";
|
|
112
122
|
import path2 from "path";
|
|
113
123
|
import os2 from "os";
|
|
@@ -175,6 +185,8 @@ var MODEL_PRICING = {
|
|
|
175
185
|
"claude-3-haiku": { input: 0.25 / 1e6, output: 1.25 / 1e6, cacheRead: 0.03 / 1e6, cacheWrite: 0.3 / 1e6 }
|
|
176
186
|
};
|
|
177
187
|
var DEFAULT_PRICING = MODEL_PRICING["claude-sonnet-4"];
|
|
188
|
+
var CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
189
|
+
var _spendCache = /* @__PURE__ */ new Map();
|
|
178
190
|
function getPricing(model) {
|
|
179
191
|
if (MODEL_PRICING[model]) return MODEL_PRICING[model];
|
|
180
192
|
const stripped = model.replace(/-\d{8}$/, "");
|
|
@@ -186,15 +198,19 @@ function getPricing(model) {
|
|
|
186
198
|
return DEFAULT_PRICING;
|
|
187
199
|
}
|
|
188
200
|
async function getAgentSpend(period = "7d") {
|
|
201
|
+
const cached = _spendCache.get(period);
|
|
202
|
+
if (cached && Date.now() < cached.expires) {
|
|
203
|
+
return cached.result;
|
|
204
|
+
}
|
|
189
205
|
const cutoff = periodToCutoff(period);
|
|
190
206
|
const client = getClient();
|
|
191
|
-
const
|
|
207
|
+
const dbResult = await client.execute({
|
|
192
208
|
sql: `SELECT session_uuid, agent_id FROM session_agent_map WHERE started_at >= ?`,
|
|
193
209
|
args: [cutoff]
|
|
194
210
|
});
|
|
195
|
-
if (
|
|
211
|
+
if (dbResult.rows.length === 0) return [];
|
|
196
212
|
const sessionAgent = /* @__PURE__ */ new Map();
|
|
197
|
-
for (const row of
|
|
213
|
+
for (const row of dbResult.rows) {
|
|
198
214
|
sessionAgent.set(row.session_uuid, row.agent_id);
|
|
199
215
|
}
|
|
200
216
|
const claudeDir = path4.join(os4.homedir(), ".claude", "projects");
|
|
@@ -232,7 +248,7 @@ async function getAgentSpend(period = "7d") {
|
|
|
232
248
|
}
|
|
233
249
|
}
|
|
234
250
|
}
|
|
235
|
-
|
|
251
|
+
const result = Array.from(agentTotals.entries()).map(([agentId, t]) => ({
|
|
236
252
|
agentId,
|
|
237
253
|
inputTokens: t.input,
|
|
238
254
|
outputTokens: t.output,
|
|
@@ -242,6 +258,8 @@ async function getAgentSpend(period = "7d") {
|
|
|
242
258
|
sessions: t.sessions.size,
|
|
243
259
|
period
|
|
244
260
|
})).sort((a, b) => b.costUSD - a.costUSD);
|
|
261
|
+
_spendCache.set(period, { result, expires: Date.now() + CACHE_TTL_MS });
|
|
262
|
+
return result;
|
|
245
263
|
}
|
|
246
264
|
async function extractSessionUsage(jsonlPath) {
|
|
247
265
|
let input = 0;
|