@askexenow/exe-os 0.9.263 → 0.9.265
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/deploy/stack-manifests/v0.9.json +1 -1
- package/dist/backfill-metadata-WM46YQZL.js +597 -0
- package/dist/bin/agentic-ontology-backfill.js +1 -1
- package/dist/bin/agentic-reflection-backfill.js +1 -1
- package/dist/bin/agentic-semantic-label.js +1 -1
- package/dist/bin/backfill-conversations.js +1 -1
- package/dist/bin/backfill-responses.js +1 -1
- package/dist/bin/backfill-vectors.js +2 -2
- package/dist/bin/bulk-sync-postgres.js +1 -1
- package/dist/bin/cleanup-stale-review-tasks.js +2 -2
- package/dist/bin/cli.js +5 -5
- package/dist/bin/exe-assign.js +1 -1
- package/dist/bin/exe-boot.js +3 -3
- package/dist/bin/exe-dispatch.js +2 -2
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +2 -2
- package/dist/bin/exe-forget.js +3 -3
- package/dist/bin/exe-gateway.js +5 -5
- package/dist/bin/exe-heartbeat.js +3 -3
- package/dist/bin/exe-kill.js +3 -3
- package/dist/bin/exe-launch-agent.js +3 -3
- package/dist/bin/exe-pending-messages.js +3 -3
- package/dist/bin/exe-pending-notifications.js +2 -2
- package/dist/bin/exe-pending-reviews.js +6 -4
- package/dist/bin/exe-review.js +3 -3
- package/dist/bin/exe-search.js +2 -2
- package/dist/bin/exe-session-cleanup.js +5 -5
- package/dist/bin/exe-start-codex.js +1 -1
- package/dist/bin/exe-start-opencode.js +1 -1
- package/dist/bin/exe-status.js +3 -3
- package/dist/bin/exe-support.js +1 -1
- package/dist/bin/exe-team.js +1 -1
- package/dist/bin/git-sweep.js +2 -2
- package/dist/bin/graph-backfill.js +1 -1
- package/dist/bin/graph-export.js +2 -2
- package/dist/bin/import-history.js +2 -2
- package/dist/bin/intercom-check.js +5 -4
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +1 -1
- package/dist/bin/scan-tasks.js +2 -2
- package/dist/bin/shard-migrate.js +1 -1
- package/dist/capacity-monitor-FZORNXTA.js +49 -0
- package/dist/catchup-brief-PRKHIRWW.js +151 -0
- package/dist/chunk-2GU3NYMB.js +813 -0
- package/dist/chunk-2VT7Z2E2.js +197 -0
- package/dist/chunk-3L6XLN4V.js +1090 -0
- package/dist/chunk-3T4PNG5O.js +447 -0
- package/dist/chunk-3W324KN7.js +13696 -0
- package/dist/{chunk-BJYXHSFN.js → chunk-3X555IGG.js} +1 -1
- package/dist/chunk-4IATAIAF.js +89 -0
- package/dist/chunk-5M4F2FVD.js +204 -0
- package/dist/chunk-5TANMPI4.js +377 -0
- package/dist/chunk-67E5WIMW.js +333 -0
- package/dist/chunk-6NRJIARA.js +346 -0
- package/dist/chunk-6O22GTSE.js +1148 -0
- package/dist/chunk-7O5CMDP6.js +1345 -0
- package/dist/chunk-7P2JKEO3.js +382 -0
- package/dist/chunk-A4UY44T7.js +486 -0
- package/dist/chunk-AZHPQGSI.js +159 -0
- package/dist/chunk-BQAC3GCO.js +127 -0
- package/dist/chunk-CIWJRYIC.js +244 -0
- package/dist/chunk-CZO2DGGF.js +214 -0
- package/dist/chunk-D55SXO3N.js +3951 -0
- package/dist/chunk-EPDSRI6O.js +284 -0
- package/dist/chunk-EU34R2A3.js +1073 -0
- package/dist/chunk-G4KEDLSM.js +488 -0
- package/dist/{chunk-235ZCOYB.js → chunk-IBGC6JFX.js} +2 -2
- package/dist/chunk-IODP4JNE.js +551 -0
- package/dist/chunk-IZ6LCET7.js +58 -0
- package/dist/chunk-LPG3U5UW.js +731 -0
- package/dist/chunk-NH6TPXZV.js +13696 -0
- package/dist/chunk-O5TZI7OZ.js +50 -0
- package/dist/chunk-Q3N4KHLM.js +330 -0
- package/dist/chunk-QHQTMWYH.js +54 -0
- package/dist/chunk-QNYOPM2L.js +1921 -0
- package/dist/chunk-SPOA7EOD.js +81 -0
- package/dist/chunk-TK23WXKB.js +128 -0
- package/dist/chunk-TOVXER6J.js +76 -0
- package/dist/chunk-UIPAZYP7.js +171 -0
- package/dist/chunk-WXW4GF6M.js +495 -0
- package/dist/{chunk-KQNVIDBP.js → chunk-XLYBSXWS.js} +4 -3
- package/dist/core-memory-QXMQ5I7S.js +110 -0
- package/dist/crm-webhook-CH5W633Y.js +10 -0
- package/dist/cto-delegation-gate-XY3NMGTE.js +206 -0
- package/dist/daemon-orchestration-LS62JMTI.js +135 -0
- package/dist/dreaming-ZBKE2GFX.js +32 -0
- package/dist/exe-export-JNSQRIWI.js +73 -0
- package/dist/exe-import-AVGWQZLU.js +76 -0
- package/dist/exe-key-WR6QEHYO.js +579 -0
- package/dist/exe-snapshot-U6K3J6BD.js +164 -0
- package/dist/fast-db-init-ZHRRYI7M.js +7 -0
- package/dist/gateway/index.js +6 -6
- package/dist/git-task-sweep-64KSWRUI.js +40 -0
- package/dist/hooks/bug-report-worker.js +4 -4
- package/dist/hooks/codex-stop-task-finalizer.js +4 -4
- package/dist/hooks/commit-complete.js +4 -4
- package/dist/hooks/error-recall.js +2 -2
- package/dist/hooks/ingest.js +2 -2
- package/dist/hooks/instructions-loaded.js +1 -1
- package/dist/hooks/manifest.json +18 -18
- package/dist/hooks/notification.js +1 -1
- package/dist/hooks/post-compact.js +2 -2
- package/dist/hooks/post-tool-combined.js +2 -2
- package/dist/hooks/pre-compact.js +3 -3
- package/dist/hooks/pre-tool-use.js +6 -6
- package/dist/hooks/prompt-submit.js +16 -11
- package/dist/hooks/session-end.js +5 -5
- package/dist/hooks/session-start.js +6 -6
- package/dist/hooks/stop.js +5 -5
- package/dist/hooks/subagent-stop.js +2 -2
- package/dist/hooks/summary-worker.js +5 -5
- package/dist/index.js +9 -9
- package/dist/lib/consolidation.js +2 -2
- package/dist/lib/exe-daemon.js +17 -17
- package/dist/lib/hybrid-search.js +2 -2
- package/dist/lib/messaging.js +2 -2
- package/dist/lib/schedules.js +2 -2
- package/dist/lib/store.js +1 -1
- package/dist/lib/tasks.js +3 -3
- package/dist/lib/tmux-routing.js +1 -1
- package/dist/mcp/register-tools.js +25 -25
- package/dist/mcp/server.js +26 -26
- package/dist/mcp/tools/create-task.js +4 -4
- package/dist/mcp/tools/list-tasks.js +4 -4
- package/dist/mcp/tools/send-message.js +3 -3
- package/dist/mcp/tools/update-task.js +4 -4
- package/dist/notifications-45QSHDFA.js +45 -0
- package/dist/orchestrator-7XBMFK7D.js +33 -0
- package/dist/pipeline-router-MQKRNCTR.js +13 -0
- package/dist/reranker-CJW3UYE2.js +19 -0
- package/dist/review-polling-RL75XLAY.js +124 -0
- package/dist/runtime/index.js +3 -3
- package/dist/session-events-ZULAN4XL.js +36 -0
- package/dist/session-scope-V2RSOTDU.js +86 -0
- package/dist/skill-refinement-BSX6Q6IN.js +157 -0
- package/dist/{support-outbox-SZVLHHZG.js → support-outbox-SO73Q5H2.js} +202 -7
- package/dist/task-enforcement-JRTAOYZT.js +333 -0
- package/dist/task-scope-GNCB2GAM.js +35 -0
- package/dist/tasks-crud-MZIOYF3R.js +77 -0
- package/dist/tasks-notify-7KNZ4ULO.js +38 -0
- package/dist/tasks-review-U5VEV4Y7.js +47 -0
- package/dist/telemetry-upload-BIB5TJA4.js +739 -0
- package/dist/tui/App.js +7 -7
- package/dist/tui-data-ZSB5DDEY.js +258 -0
- package/dist/worker-gate-TXLX33PX.js +21 -0
- package/dist/workflow-engine-3PIT3Y56.js +28 -0
- package/package.json +1 -1
- package/release-notes.json +27 -24
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import {
|
|
2
|
+
initStore
|
|
3
|
+
} from "./chunk-2GU3NYMB.js";
|
|
4
|
+
import {
|
|
5
|
+
getClient,
|
|
6
|
+
isInitialized
|
|
7
|
+
} from "./chunk-QQZMP6QL.js";
|
|
8
|
+
|
|
9
|
+
// src/lib/schedules.ts
|
|
10
|
+
import crypto from "crypto";
|
|
11
|
+
import { execSync } from "child_process";
|
|
12
|
+
var CRON_FIELD = /^[\d*/,\-]+$/;
|
|
13
|
+
function isValidCron(cron) {
|
|
14
|
+
const fields = cron.trim().split(/\s+/);
|
|
15
|
+
if (fields.length !== 5) return false;
|
|
16
|
+
return fields.every((f) => CRON_FIELD.test(f));
|
|
17
|
+
}
|
|
18
|
+
var SAFE_ID = /^[a-zA-Z0-9_\-]+$/;
|
|
19
|
+
function isValidScheduleId(id) {
|
|
20
|
+
return SAFE_ID.test(id) && id.length <= 128;
|
|
21
|
+
}
|
|
22
|
+
async function ensureDb() {
|
|
23
|
+
if (!isInitialized()) {
|
|
24
|
+
await initStore();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function parseHumanCron(input) {
|
|
28
|
+
const s = input.toLowerCase().trim();
|
|
29
|
+
if (/^[\d*\/,-]+\s+[\d*\/,-]+\s+[\d*\/,-]+\s+[\d*\/,-]+\s+[\d*\/,-]+$/.test(s)) {
|
|
30
|
+
return s;
|
|
31
|
+
}
|
|
32
|
+
const dayMap = {
|
|
33
|
+
sunday: "0",
|
|
34
|
+
sun: "0",
|
|
35
|
+
monday: "1",
|
|
36
|
+
mon: "1",
|
|
37
|
+
tuesday: "2",
|
|
38
|
+
tue: "2",
|
|
39
|
+
wednesday: "3",
|
|
40
|
+
wed: "3",
|
|
41
|
+
thursday: "4",
|
|
42
|
+
thu: "4",
|
|
43
|
+
friday: "5",
|
|
44
|
+
fri: "5",
|
|
45
|
+
saturday: "6",
|
|
46
|
+
sat: "6"
|
|
47
|
+
};
|
|
48
|
+
const everyMatch = s.match(/every\s+(\d+)\s*([mh])/);
|
|
49
|
+
if (everyMatch) {
|
|
50
|
+
const n = everyMatch[1];
|
|
51
|
+
const unit = everyMatch[2];
|
|
52
|
+
if (unit === "m") return `*/${n} * * * *`;
|
|
53
|
+
if (unit === "h") return `0 */${n} * * *`;
|
|
54
|
+
}
|
|
55
|
+
let hour = -1;
|
|
56
|
+
let minute = 0;
|
|
57
|
+
if (/midnight/.test(s)) {
|
|
58
|
+
hour = 0;
|
|
59
|
+
} else if (/noon/.test(s)) {
|
|
60
|
+
hour = 12;
|
|
61
|
+
} else {
|
|
62
|
+
const timeMatch = s.match(/(\d{1,2})(?::(\d{2}))?\s*(am|pm)?/);
|
|
63
|
+
if (timeMatch) {
|
|
64
|
+
hour = parseInt(timeMatch[1], 10);
|
|
65
|
+
minute = timeMatch[2] ? parseInt(timeMatch[2], 10) : 0;
|
|
66
|
+
if (timeMatch[3] === "pm" && hour < 12) hour += 12;
|
|
67
|
+
if (timeMatch[3] === "am" && hour === 12) hour = 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (hour === -1) hour = 0;
|
|
71
|
+
let dow = "*";
|
|
72
|
+
if (/weekday|weekdays/.test(s)) {
|
|
73
|
+
dow = "1-5";
|
|
74
|
+
} else if (/weekend|weekends/.test(s)) {
|
|
75
|
+
dow = "0,6";
|
|
76
|
+
} else {
|
|
77
|
+
for (const [name, val] of Object.entries(dayMap)) {
|
|
78
|
+
if (s.includes(name)) {
|
|
79
|
+
dow = val;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return `${minute} ${hour} * * ${dow}`;
|
|
85
|
+
}
|
|
86
|
+
async function createSchedule(input) {
|
|
87
|
+
if (!isValidCron(input.cron)) {
|
|
88
|
+
throw new Error(`Invalid cron expression: ${input.cron}. Must be 5 fields with only digits, *, /, -, comma.`);
|
|
89
|
+
}
|
|
90
|
+
await ensureDb();
|
|
91
|
+
const client = getClient();
|
|
92
|
+
const id = crypto.randomUUID().slice(0, 8);
|
|
93
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
94
|
+
const prompt = input.prompt ?? input.description;
|
|
95
|
+
await client.execute({
|
|
96
|
+
sql: `INSERT INTO schedules (id, cron, description, job_type, prompt, assigned_to, project_name, active, use_crontab, created_at)
|
|
97
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
98
|
+
args: [
|
|
99
|
+
id,
|
|
100
|
+
input.cron,
|
|
101
|
+
input.description,
|
|
102
|
+
input.jobType ?? "report",
|
|
103
|
+
prompt,
|
|
104
|
+
input.assignedTo ?? null,
|
|
105
|
+
input.projectName ?? null,
|
|
106
|
+
input.useCrontab ? 1 : 0,
|
|
107
|
+
now
|
|
108
|
+
]
|
|
109
|
+
});
|
|
110
|
+
if (input.useCrontab) {
|
|
111
|
+
addToCrontab(id, input.cron, prompt, input.projectName);
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
id,
|
|
115
|
+
cron: input.cron,
|
|
116
|
+
description: input.description,
|
|
117
|
+
jobType: input.jobType ?? "report",
|
|
118
|
+
prompt,
|
|
119
|
+
assignedTo: input.assignedTo,
|
|
120
|
+
projectName: input.projectName,
|
|
121
|
+
active: true,
|
|
122
|
+
useCrontab: input.useCrontab ?? false,
|
|
123
|
+
createdAt: now
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
async function listSchedules(activeOnly = true) {
|
|
127
|
+
await ensureDb();
|
|
128
|
+
const client = getClient();
|
|
129
|
+
const sql = activeOnly ? "SELECT * FROM schedules WHERE active = 1 ORDER BY created_at ASC" : "SELECT * FROM schedules ORDER BY created_at ASC";
|
|
130
|
+
const result = await client.execute({ sql, args: [] });
|
|
131
|
+
return result.rows.map((row) => ({
|
|
132
|
+
id: String(row.id),
|
|
133
|
+
cron: String(row.cron),
|
|
134
|
+
description: String(row.description),
|
|
135
|
+
jobType: String(row.job_type),
|
|
136
|
+
prompt: row.prompt ? String(row.prompt) : void 0,
|
|
137
|
+
assignedTo: row.assigned_to ? String(row.assigned_to) : void 0,
|
|
138
|
+
projectName: row.project_name ? String(row.project_name) : void 0,
|
|
139
|
+
active: Number(row.active) === 1,
|
|
140
|
+
useCrontab: Number(row.use_crontab) === 1,
|
|
141
|
+
createdAt: String(row.created_at)
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
async function deleteSchedule(id) {
|
|
145
|
+
await ensureDb();
|
|
146
|
+
const client = getClient();
|
|
147
|
+
const existing = await client.execute({
|
|
148
|
+
sql: "SELECT use_crontab FROM schedules WHERE id = ?",
|
|
149
|
+
args: [id]
|
|
150
|
+
});
|
|
151
|
+
if (existing.rows.length === 0) return false;
|
|
152
|
+
const usesCrontab = Number(existing.rows[0].use_crontab) === 1;
|
|
153
|
+
await client.execute({
|
|
154
|
+
sql: "DELETE FROM schedules WHERE id = ?",
|
|
155
|
+
args: [id]
|
|
156
|
+
});
|
|
157
|
+
if (usesCrontab) {
|
|
158
|
+
removeFromCrontab(id);
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
function addToCrontab(id, cron, prompt, projectDir) {
|
|
163
|
+
if (!isValidCron(cron)) {
|
|
164
|
+
throw new Error(`Invalid cron expression: ${cron}`);
|
|
165
|
+
}
|
|
166
|
+
if (!isValidScheduleId(id)) {
|
|
167
|
+
throw new Error(`Invalid schedule ID: ${id}`);
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
const cwd = projectDir ? `cd ${JSON.stringify(projectDir)} && ` : "";
|
|
171
|
+
const escapedPrompt = prompt.replace(/"/g, '\\"');
|
|
172
|
+
const entry = `${cron} ${cwd}claude -p --dangerously-skip-permissions "${escapedPrompt}" # exe-schedule:${id}`;
|
|
173
|
+
execSync(
|
|
174
|
+
`(crontab -l 2>/dev/null; echo ${JSON.stringify(entry)}) | crontab -`,
|
|
175
|
+
{ timeout: 5e3, stdio: "ignore" }
|
|
176
|
+
);
|
|
177
|
+
} catch (err) {
|
|
178
|
+
if (err instanceof Error && err.message.startsWith("Invalid")) throw err;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function removeFromCrontab(id) {
|
|
182
|
+
if (!isValidScheduleId(id)) return;
|
|
183
|
+
try {
|
|
184
|
+
execSync(
|
|
185
|
+
`crontab -l 2>/dev/null | grep -v "exe-schedule:${id}" | crontab -`,
|
|
186
|
+
{ timeout: 5e3, stdio: "ignore" }
|
|
187
|
+
);
|
|
188
|
+
} catch {
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export {
|
|
193
|
+
parseHumanCron,
|
|
194
|
+
createSchedule,
|
|
195
|
+
listSchedules,
|
|
196
|
+
deleteSchedule
|
|
197
|
+
};
|