@askexenow/exe-os 0.9.289 → 0.9.290
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/active-agent-L22OENGJ.js +26 -0
- package/dist/active-agent-SVG6F6HY.js +27 -0
- package/dist/agentic-ontology-3GHJHLDY.js +25 -0
- package/dist/backfill-metadata-HJNVBORD.js +599 -0
- package/dist/behaviors-ROOZS234.js +39 -0
- package/dist/bin/agentic-ontology-backfill.js +5 -5
- package/dist/bin/agentic-reflection-backfill.js +6 -6
- package/dist/bin/agentic-semantic-label.js +5 -5
- package/dist/bin/backfill-conversations.js +4 -4
- package/dist/bin/backfill-responses.js +4 -4
- package/dist/bin/backfill-vectors.js +98 -13
- package/dist/bin/bulk-sync-postgres.js +6 -6
- package/dist/bin/cc-doctor.js +4 -4
- package/dist/bin/cleanup-stale-review-tasks.js +9 -9
- package/dist/bin/cli.js +51 -15
- package/dist/bin/exe-agent-config.js +2 -2
- package/dist/bin/exe-agent.js +4 -4
- package/dist/bin/exe-assign.js +5 -5
- package/dist/bin/exe-boot.js +16 -16
- package/dist/bin/exe-call.js +4 -4
- package/dist/bin/exe-cloud.js +23 -5
- package/dist/bin/exe-dispatch.js +9 -9
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +7 -7
- package/dist/bin/exe-forget.js +6 -6
- package/dist/bin/exe-gateway.js +7 -7
- package/dist/bin/exe-healthcheck.js +4 -4
- package/dist/bin/exe-heartbeat.js +9 -9
- package/dist/bin/exe-kill.js +12 -12
- package/dist/bin/exe-launch-agent.js +16 -16
- package/dist/bin/exe-new-employee.js +6 -6
- package/dist/bin/exe-pending-messages.js +10 -10
- package/dist/bin/exe-pending-notifications.js +9 -9
- package/dist/bin/exe-pending-reviews.js +9 -9
- package/dist/bin/exe-rename.js +4 -4
- package/dist/bin/exe-review.js +11 -11
- package/dist/bin/exe-search.js +5 -5
- package/dist/bin/exe-session-cleanup.js +14 -14
- package/dist/bin/exe-settings.js +4 -4
- package/dist/bin/exe-start-codex.js +11 -11
- package/dist/bin/exe-start-opencode.js +8 -8
- package/dist/bin/exe-status.js +10 -10
- package/dist/bin/exe-team.js +3 -3
- package/dist/bin/git-sweep.js +10 -10
- package/dist/bin/graph-backfill.js +4 -4
- package/dist/bin/graph-export.js +5 -5
- package/dist/bin/import-history.js +7 -7
- package/dist/bin/install.js +6 -6
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +4 -4
- package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
- package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
- package/dist/bin/scan-tasks.js +9 -9
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +4 -4
- package/dist/capability-cards-O6XB2AU4.js +88 -0
- package/dist/capacity-monitor-ZE7CFVWH.js +50 -0
- package/dist/catchup-brief-3NONSIMA.js +174 -0
- package/dist/chunk-232DHK5C.js +1119 -0
- package/dist/chunk-272SJ4RN.js +129 -0
- package/dist/chunk-4NMTGHUE.js +127 -0
- package/dist/chunk-5PLW3QL6.js +668 -0
- package/dist/chunk-66EIYAF2.js +157 -0
- package/dist/chunk-6IPJF5QD.js +630 -0
- package/dist/chunk-6NSJTOXE.js +122 -0
- package/dist/chunk-6TLURATK.js +4318 -0
- package/dist/chunk-73JAJQRY.js +85 -0
- package/dist/chunk-7FTKXL5A.js +286 -0
- package/dist/chunk-7IRQSO3F.js +735 -0
- package/dist/chunk-7MINWZ3J.js +214 -0
- package/dist/chunk-7T5PS5DG.js +14439 -0
- package/dist/chunk-A74WXY4S.js +227 -0
- package/dist/chunk-AVD5C3NG.js +197 -0
- package/dist/chunk-B36MRLEP.js +58 -0
- package/dist/chunk-B4TCZ3PS.js +373 -0
- package/dist/chunk-BPLEJ3EU.js +411 -0
- package/dist/chunk-BTDPLFGK.js +221 -0
- package/dist/chunk-BU45UYTK.js +185 -0
- package/dist/chunk-CCAA6XOZ.js +284 -0
- package/dist/chunk-DBQ6I6K2.js +3276 -0
- package/dist/chunk-DDWFHEPG.js +345 -0
- package/dist/chunk-DSOKTUTT.js +167 -0
- package/dist/chunk-ETCARC76.js +836 -0
- package/dist/chunk-EZHTLPOS.js +280 -0
- package/dist/chunk-F3DQ3HDH.js +333 -0
- package/dist/chunk-F6ZCUDCN.js +244 -0
- package/dist/chunk-FI5Q6F5S.js +382 -0
- package/dist/chunk-FNQZGNSG.js +1094 -0
- package/dist/chunk-FVKTXXKK.js +128 -0
- package/dist/chunk-HHR5NB6N.js +377 -0
- package/dist/chunk-HRZLGHT6.js +290 -0
- package/dist/chunk-HSSRWMVA.js +68 -0
- package/dist/chunk-I3NVB5MG.js +85 -0
- package/dist/chunk-I7Z6MK2B.js +240 -0
- package/dist/chunk-ID4SMRYX.js +2078 -0
- package/dist/chunk-JXGHDROV.js +546 -0
- package/dist/chunk-KQY4QIEN.js +731 -0
- package/dist/chunk-LRSU2ZU2.js +38 -0
- package/dist/chunk-MFCL4GAN.js +2113 -0
- package/dist/chunk-MFGMVKGM.js +150 -0
- package/dist/chunk-NHGBVLCD.js +210 -0
- package/dist/chunk-NOEBJMNN.js +33 -0
- package/dist/chunk-NQ2VNTGL.js +538 -0
- package/dist/chunk-O4PZPM6H.js +204 -0
- package/dist/chunk-O5OW3YGQ.js +262 -0
- package/dist/chunk-OJQTONDJ.js +171 -0
- package/dist/chunk-OKZGUHE5.js +76 -0
- package/dist/chunk-OOH5M36Q.js +448 -0
- package/dist/chunk-P5ARTZP2.js +128 -0
- package/dist/chunk-PKRSYS7F.js +402 -0
- package/dist/chunk-PQWO5D3F.js +348 -0
- package/dist/chunk-Q6MJIJ2O.js +1352 -0
- package/dist/chunk-QKDRYZ2N.js +231 -0
- package/dist/chunk-RAV356E6.js +30 -0
- package/dist/chunk-RK7EAA53.js +1157 -0
- package/dist/chunk-RSLVAYWS.js +192 -0
- package/dist/chunk-SL6WJP2Q.js +123 -0
- package/dist/chunk-T57DOVGE.js +97 -0
- package/dist/chunk-TMCKL43Q.js +181 -0
- package/dist/chunk-TQZABASE.js +97 -0
- package/dist/chunk-UBWBEY6I.js +81 -0
- package/dist/chunk-UP7DNYG7.js +456 -0
- package/dist/chunk-V5MGYIZS.js +70 -0
- package/dist/chunk-XCPVYQVK.js +336 -0
- package/dist/chunk-XWVBLZRP.js +50 -0
- package/dist/chunk-YBTN5F2U.js +1068 -0
- package/dist/chunk-Z772TGD2.js +54 -0
- package/dist/chunk-ZAMPIXLH.js +1350 -0
- package/dist/chunk-ZYEOHGU5.js +362 -0
- package/dist/co-activation-WJTFJOTK.js +73 -0
- package/dist/co-occurrence-KFP6ZS7G.js +94 -0
- package/dist/core-memory-DBZJ72TV.js +110 -0
- package/dist/crdt-sync-6DVGRMTV.js +33 -0
- package/dist/crm-webhook-55T4Z6XJ.js +10 -0
- package/dist/cto-delegation-gate-SPM6LAL2.js +279 -0
- package/dist/daemon-orchestration-XZLWWIV4.js +138 -0
- package/dist/db-backup-JHCI47JQ.js +37 -0
- package/dist/doc-graph-extractor-4X23NP4I.js +132 -0
- package/dist/dreaming-TFZDGA72.js +33 -0
- package/dist/exe-drift-TEM7ELNY.js +69 -0
- package/dist/exe-export-CRCA4T4S.js +75 -0
- package/dist/exe-import-UZMMWNHJ.js +78 -0
- package/dist/exe-key-NQQXEDUA.js +672 -0
- package/dist/exe-snapshot-P7PUAJTV.js +337 -0
- package/dist/fast-db-init-G63PRINQ.js +7 -0
- package/dist/gateway/index.js +8 -8
- package/dist/git-staleness-42TTCFDP.js +111 -0
- package/dist/git-task-sweep-4LW5RYYO.js +41 -0
- package/dist/global-procedures-BVFRWJAV.js +21 -0
- package/dist/graph-auto-extract-4ZA7UC6C.js +182 -0
- package/dist/hooks/bug-report-worker.js +11 -11
- package/dist/hooks/codex-stop-task-finalizer.js +11 -11
- package/dist/hooks/commit-complete.js +11 -11
- package/dist/hooks/error-recall.js +6 -6
- package/dist/hooks/exe-heartbeat-hook.js +3 -3
- package/dist/hooks/ingest.js +6 -6
- package/dist/hooks/instructions-loaded.js +4 -4
- package/dist/hooks/manifest.json +19 -19
- package/dist/hooks/notification.js +4 -4
- package/dist/hooks/post-compact.js +10 -10
- package/dist/hooks/post-tool-combined.js +5 -5
- package/dist/hooks/pre-compact.js +11 -11
- package/dist/hooks/pre-tool-use.js +14 -14
- package/dist/hooks/prompt-submit.js +21 -21
- package/dist/hooks/session-end.js +15 -15
- package/dist/hooks/session-start.js +12 -12
- package/dist/hooks/stop.js +14 -14
- package/dist/hooks/subagent-stop.js +10 -10
- package/dist/hooks/summary-worker.js +14 -14
- package/dist/index.js +17 -17
- package/dist/installer-CBGRTGIF.js +297 -0
- package/dist/installer-DGU4WZKJ.js +39 -0
- package/dist/installer-WTWEOSEK.js +343 -0
- package/dist/lib/cloud-sync.js +4 -4
- package/dist/lib/consolidation.js +7 -5
- package/dist/lib/database.js +2 -2
- package/dist/lib/db.js +2 -2
- package/dist/lib/employee-templates.js +4 -4
- package/dist/lib/employees.js +2 -2
- package/dist/lib/exe-daemon.js +64 -43
- package/dist/lib/hybrid-search.js +5 -5
- package/dist/lib/identity.js +2 -2
- package/dist/lib/messaging.js +9 -9
- package/dist/lib/reminders.js +3 -3
- package/dist/lib/schedules.js +5 -5
- package/dist/lib/session-registry.js +4 -4
- package/dist/lib/skill-learning.js +6 -6
- package/dist/lib/store.js +4 -4
- package/dist/lib/task-router.js +3 -3
- package/dist/lib/tasks.js +10 -10
- package/dist/lib/tmux-routing.js +8 -8
- package/dist/lib/token-spend.js +3 -3
- package/dist/license-gate-OSPA2OD7.js +16 -0
- package/dist/mcp/register-tools.js +55 -55
- package/dist/mcp/server.js +117 -73
- package/dist/mcp/tools/complete-reminder.js +4 -4
- package/dist/mcp/tools/create-reminder.js +4 -4
- package/dist/mcp/tools/create-task.js +12 -12
- package/dist/mcp/tools/deactivate-behavior.js +7 -7
- package/dist/mcp/tools/list-reminders.js +4 -4
- package/dist/mcp/tools/list-tasks.js +12 -12
- package/dist/mcp/tools/send-message.js +11 -11
- package/dist/mcp/tools/update-task.js +11 -11
- package/dist/mcp-http-config-OGFPLJYH.js +28 -0
- package/dist/memory-cards-GJ3VHKAM.js +179 -0
- package/dist/memory-graph-extractor-TCTCM7PZ.js +21 -0
- package/dist/memory-poisoning-defense-FVLGA35X.js +223 -0
- package/dist/memory-reflection-BYJFIFSV.js +243 -0
- package/dist/notifications-AQKZFSR3.js +46 -0
- package/dist/orchestration-events-RDSYLFXZ.js +26 -0
- package/dist/orchestrator-2JTJQLPG.js +34 -0
- package/dist/pipeline-router-HBSTKHG5.js +14 -0
- package/dist/plan-limits-GQENSNTG.js +27 -0
- package/dist/project-boot-W2LTP7WW.js +299 -0
- package/dist/projection-worker-ZMT5KNJJ.js +1084 -0
- package/dist/prospective-memory-LANRNOJX.js +231 -0
- package/dist/reranker-QGJO6EHO.js +19 -0
- package/dist/retrieval-health-JE66LJ3I.js +11 -0
- package/dist/review-polling-IXJ57M6Q.js +125 -0
- package/dist/runtime/index.js +11 -11
- package/dist/session-events-XKG66APL.js +37 -0
- package/dist/session-kill-telemetry-VTU7YBII.js +30 -0
- package/dist/session-scope-TQZONLZL.js +87 -0
- package/dist/setup-wizard-PXK6SC2D.js +12 -0
- package/dist/skill-refinement-Y6LLKYRL.js +158 -0
- package/dist/steward-gate-QV2APBFB.js +14 -0
- package/dist/task-enforcement-GLDD2W5D.js +505 -0
- package/dist/task-scope-HMPIP6XB.js +36 -0
- package/dist/tasks-crud-FH2SFCNQ.js +78 -0
- package/dist/tasks-notify-3ZW2GLCS.js +39 -0
- package/dist/tasks-review-XERV6KZD.js +48 -0
- package/dist/telemetry-upload-R77W7I7G.js +740 -0
- package/dist/token-budget-NA4WQAY6.js +85 -0
- package/dist/tool-telemetry-D4Q76LAS.js +17 -0
- package/dist/tui/App.js +16 -16
- package/dist/tui-data-NJSEIA2Q.js +259 -0
- package/dist/wiki-acl-RE5IR5VV.js +111 -0
- package/dist/worker-gate-VN2POPFL.js +21 -0
- package/dist/workflow-engine-D7ALMSDM.js +28 -0
- package/dist/worktree-6I45JV5N.js +27 -0
- package/dist/worktree-sweep-IMDR3XHT.js +20 -0
- package/package.json +1 -1
- package/release-notes.json +88 -88
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getClient
|
|
3
|
+
} from "./chunk-DBQ6I6K2.js";
|
|
4
|
+
import "./chunk-2I23RPSI.js";
|
|
5
|
+
import "./chunk-XCPVYQVK.js";
|
|
6
|
+
import "./chunk-PNQDP3OA.js";
|
|
7
|
+
import "./chunk-FXU7JOXK.js";
|
|
8
|
+
import "./chunk-5P3HOBZX.js";
|
|
9
|
+
import "./chunk-LYH5HE24.js";
|
|
10
|
+
import "./chunk-MLKGABMK.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/prospective-memory.ts
|
|
13
|
+
import crypto from "crypto";
|
|
14
|
+
var PROSPECTIVE_RECURRENCES = [
|
|
15
|
+
"daily",
|
|
16
|
+
"weekly",
|
|
17
|
+
"monthly",
|
|
18
|
+
"once"
|
|
19
|
+
];
|
|
20
|
+
var PROSPECTIVE_STATUSES = [
|
|
21
|
+
"pending",
|
|
22
|
+
"completed",
|
|
23
|
+
"deferred"
|
|
24
|
+
];
|
|
25
|
+
function normalizeRecurrence(value) {
|
|
26
|
+
return PROSPECTIVE_RECURRENCES.includes(value) ? value : "once";
|
|
27
|
+
}
|
|
28
|
+
function clampPriority(value) {
|
|
29
|
+
const n = Number(value);
|
|
30
|
+
if (!Number.isFinite(n)) return 5;
|
|
31
|
+
return Math.min(10, Math.max(1, Math.round(n)));
|
|
32
|
+
}
|
|
33
|
+
function rowToProspective(row) {
|
|
34
|
+
return {
|
|
35
|
+
id: String(row.id),
|
|
36
|
+
agentId: String(row.agent_id),
|
|
37
|
+
content: String(row.content ?? ""),
|
|
38
|
+
dueDate: row.due_date != null ? String(row.due_date) : null,
|
|
39
|
+
recurrence: normalizeRecurrence(row.recurrence),
|
|
40
|
+
priority: clampPriority(row.priority),
|
|
41
|
+
status: PROSPECTIVE_STATUSES.includes(String(row.status)) ? String(row.status) : "pending",
|
|
42
|
+
lastSurfaced: row.last_surfaced != null ? String(row.last_surfaced) : null,
|
|
43
|
+
projectName: row.project_name != null ? String(row.project_name) : null,
|
|
44
|
+
sessionScope: row.session_scope != null ? String(row.session_scope) : null,
|
|
45
|
+
createdAt: String(row.created_at),
|
|
46
|
+
updatedAt: String(row.updated_at)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function nextDueDate(current, recurrence) {
|
|
50
|
+
if (recurrence === "once") return null;
|
|
51
|
+
const base = current ? new Date(current) : /* @__PURE__ */ new Date();
|
|
52
|
+
if (Number.isNaN(base.getTime())) return null;
|
|
53
|
+
const next = new Date(base.getTime());
|
|
54
|
+
switch (recurrence) {
|
|
55
|
+
case "daily":
|
|
56
|
+
next.setUTCDate(next.getUTCDate() + 1);
|
|
57
|
+
break;
|
|
58
|
+
case "weekly":
|
|
59
|
+
next.setUTCDate(next.getUTCDate() + 7);
|
|
60
|
+
break;
|
|
61
|
+
case "monthly":
|
|
62
|
+
next.setUTCMonth(next.getUTCMonth() + 1);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
return next.toISOString();
|
|
66
|
+
}
|
|
67
|
+
async function createProspectiveMemory(input) {
|
|
68
|
+
const id = crypto.randomUUID();
|
|
69
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
70
|
+
const record = {
|
|
71
|
+
id,
|
|
72
|
+
agentId: input.agentId.toLowerCase(),
|
|
73
|
+
content: input.content,
|
|
74
|
+
dueDate: input.dueDate ?? null,
|
|
75
|
+
recurrence: normalizeRecurrence(input.recurrence ?? "once"),
|
|
76
|
+
priority: clampPriority(input.priority ?? 5),
|
|
77
|
+
status: "pending",
|
|
78
|
+
lastSurfaced: null,
|
|
79
|
+
projectName: input.projectName ?? null,
|
|
80
|
+
sessionScope: input.sessionScope ?? null,
|
|
81
|
+
createdAt: now,
|
|
82
|
+
updatedAt: now
|
|
83
|
+
};
|
|
84
|
+
const client = getClient();
|
|
85
|
+
await client.execute({
|
|
86
|
+
sql: `INSERT INTO prospective_memories
|
|
87
|
+
(id, agent_id, content, due_date, recurrence, priority, status,
|
|
88
|
+
last_surfaced, project_name, session_scope, created_at, updated_at)
|
|
89
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
90
|
+
args: [
|
|
91
|
+
record.id,
|
|
92
|
+
record.agentId,
|
|
93
|
+
record.content,
|
|
94
|
+
record.dueDate,
|
|
95
|
+
record.recurrence,
|
|
96
|
+
record.priority,
|
|
97
|
+
record.status,
|
|
98
|
+
record.lastSurfaced,
|
|
99
|
+
record.projectName,
|
|
100
|
+
record.sessionScope,
|
|
101
|
+
record.createdAt,
|
|
102
|
+
record.updatedAt
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
return record;
|
|
106
|
+
}
|
|
107
|
+
async function getPendingProspective(agentId, options = {}) {
|
|
108
|
+
const client = getClient();
|
|
109
|
+
const cutoff = options.dueBefore ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
110
|
+
const limit = options.limit ?? 10;
|
|
111
|
+
const args = [agentId.toLowerCase(), cutoff];
|
|
112
|
+
let projectClause = "";
|
|
113
|
+
if (options.projectName) {
|
|
114
|
+
projectClause = " AND (project_name IS NULL OR project_name = ?)";
|
|
115
|
+
args.push(options.projectName);
|
|
116
|
+
}
|
|
117
|
+
args.push(limit);
|
|
118
|
+
const result = await client.execute({
|
|
119
|
+
sql: `SELECT id, agent_id, content, due_date, recurrence, priority, status,
|
|
120
|
+
last_surfaced, project_name, session_scope, created_at, updated_at
|
|
121
|
+
FROM prospective_memories
|
|
122
|
+
WHERE agent_id = ?
|
|
123
|
+
AND status = 'pending'
|
|
124
|
+
AND (due_date IS NULL OR due_date <= ?)${projectClause}
|
|
125
|
+
ORDER BY (due_date IS NULL) ASC, due_date ASC, priority ASC, created_at ASC
|
|
126
|
+
LIMIT ?`,
|
|
127
|
+
args
|
|
128
|
+
});
|
|
129
|
+
return result.rows.map((r) => rowToProspective(r));
|
|
130
|
+
}
|
|
131
|
+
async function markSurfaced(ids) {
|
|
132
|
+
if (ids.length === 0) return;
|
|
133
|
+
const client = getClient();
|
|
134
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
135
|
+
const placeholders = ids.map(() => "?").join(",");
|
|
136
|
+
await client.execute({
|
|
137
|
+
sql: `UPDATE prospective_memories SET last_surfaced = ?, updated_at = ?
|
|
138
|
+
WHERE id IN (${placeholders})`,
|
|
139
|
+
args: [now, now, ...ids]
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
async function getOverdueProspective(agentId, asOf) {
|
|
143
|
+
const client = getClient();
|
|
144
|
+
const cutoff = asOf ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
145
|
+
const result = await client.execute({
|
|
146
|
+
sql: `SELECT id, agent_id, content, due_date, recurrence, priority, status,
|
|
147
|
+
last_surfaced, project_name, session_scope, created_at, updated_at
|
|
148
|
+
FROM prospective_memories
|
|
149
|
+
WHERE agent_id = ?
|
|
150
|
+
AND status = 'pending'
|
|
151
|
+
AND due_date IS NOT NULL
|
|
152
|
+
AND due_date < ?
|
|
153
|
+
ORDER BY due_date ASC, priority ASC`,
|
|
154
|
+
args: [agentId.toLowerCase(), cutoff]
|
|
155
|
+
});
|
|
156
|
+
return result.rows.map((r) => rowToProspective(r));
|
|
157
|
+
}
|
|
158
|
+
async function completeProspective(id) {
|
|
159
|
+
const client = getClient();
|
|
160
|
+
const existing = await client.execute({
|
|
161
|
+
sql: `SELECT id, agent_id, content, due_date, recurrence, priority, status,
|
|
162
|
+
last_surfaced, project_name, session_scope, created_at, updated_at
|
|
163
|
+
FROM prospective_memories WHERE id = ?`,
|
|
164
|
+
args: [id]
|
|
165
|
+
});
|
|
166
|
+
if (existing.rows.length === 0) return null;
|
|
167
|
+
const record = rowToProspective(existing.rows[0]);
|
|
168
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
169
|
+
if (record.recurrence === "once") {
|
|
170
|
+
await client.execute({
|
|
171
|
+
sql: `UPDATE prospective_memories SET status = 'completed', updated_at = ? WHERE id = ?`,
|
|
172
|
+
args: [now, id]
|
|
173
|
+
});
|
|
174
|
+
return { ...record, status: "completed", updatedAt: now };
|
|
175
|
+
}
|
|
176
|
+
const advanced = nextDueDate(record.dueDate, record.recurrence);
|
|
177
|
+
await client.execute({
|
|
178
|
+
sql: `UPDATE prospective_memories SET due_date = ?, updated_at = ? WHERE id = ?`,
|
|
179
|
+
args: [advanced, now, id]
|
|
180
|
+
});
|
|
181
|
+
return { ...record, dueDate: advanced, updatedAt: now };
|
|
182
|
+
}
|
|
183
|
+
async function deferProspective(id, newDueDate) {
|
|
184
|
+
const client = getClient();
|
|
185
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
186
|
+
const existing = await client.execute({
|
|
187
|
+
sql: `SELECT id, agent_id, content, due_date, recurrence, priority, status,
|
|
188
|
+
last_surfaced, project_name, session_scope, created_at, updated_at
|
|
189
|
+
FROM prospective_memories WHERE id = ?`,
|
|
190
|
+
args: [id]
|
|
191
|
+
});
|
|
192
|
+
if (existing.rows.length === 0) return null;
|
|
193
|
+
await client.execute({
|
|
194
|
+
sql: `UPDATE prospective_memories SET due_date = ?, status = 'deferred', updated_at = ? WHERE id = ?`,
|
|
195
|
+
args: [newDueDate, now, id]
|
|
196
|
+
});
|
|
197
|
+
const record = rowToProspective(existing.rows[0]);
|
|
198
|
+
return { ...record, dueDate: newDueDate, status: "deferred", updatedAt: now };
|
|
199
|
+
}
|
|
200
|
+
async function listProspective(agentId, options = {}) {
|
|
201
|
+
const client = getClient();
|
|
202
|
+
const args = [agentId.toLowerCase()];
|
|
203
|
+
let statusClause = "";
|
|
204
|
+
if (options.status) {
|
|
205
|
+
statusClause = " AND status = ?";
|
|
206
|
+
args.push(options.status);
|
|
207
|
+
}
|
|
208
|
+
args.push(options.limit ?? 50);
|
|
209
|
+
const result = await client.execute({
|
|
210
|
+
sql: `SELECT id, agent_id, content, due_date, recurrence, priority, status,
|
|
211
|
+
last_surfaced, project_name, session_scope, created_at, updated_at
|
|
212
|
+
FROM prospective_memories
|
|
213
|
+
WHERE agent_id = ?${statusClause}
|
|
214
|
+
ORDER BY (due_date IS NULL) ASC, due_date ASC, priority ASC
|
|
215
|
+
LIMIT ?`,
|
|
216
|
+
args
|
|
217
|
+
});
|
|
218
|
+
return result.rows.map((r) => rowToProspective(r));
|
|
219
|
+
}
|
|
220
|
+
export {
|
|
221
|
+
PROSPECTIVE_RECURRENCES,
|
|
222
|
+
PROSPECTIVE_STATUSES,
|
|
223
|
+
completeProspective,
|
|
224
|
+
createProspectiveMemory,
|
|
225
|
+
deferProspective,
|
|
226
|
+
getOverdueProspective,
|
|
227
|
+
getPendingProspective,
|
|
228
|
+
listProspective,
|
|
229
|
+
markSurfaced,
|
|
230
|
+
nextDueDate
|
|
231
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
disposeReranker,
|
|
3
|
+
getRerankerModelPath,
|
|
4
|
+
isRerankerAvailable,
|
|
5
|
+
rerank,
|
|
6
|
+
rerankWithContext,
|
|
7
|
+
rerankWithScores
|
|
8
|
+
} from "./chunk-B36MRLEP.js";
|
|
9
|
+
import "./chunk-5P3HOBZX.js";
|
|
10
|
+
import "./chunk-LYH5HE24.js";
|
|
11
|
+
import "./chunk-MLKGABMK.js";
|
|
12
|
+
export {
|
|
13
|
+
disposeReranker,
|
|
14
|
+
getRerankerModelPath,
|
|
15
|
+
isRerankerAvailable,
|
|
16
|
+
rerank,
|
|
17
|
+
rerankWithContext,
|
|
18
|
+
rerankWithScores
|
|
19
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isExeSession,
|
|
3
|
+
strictSessionScopeFilter
|
|
4
|
+
} from "./chunk-6TLURATK.js";
|
|
5
|
+
import "./chunk-EZHTLPOS.js";
|
|
6
|
+
import "./chunk-4JERP7NT.js";
|
|
7
|
+
import "./chunk-4FVVJ7ME.js";
|
|
8
|
+
import "./chunk-QKDRYZ2N.js";
|
|
9
|
+
import "./chunk-MVW62NIZ.js";
|
|
10
|
+
import "./chunk-OYNKIAVW.js";
|
|
11
|
+
import "./chunk-SSTLTIF3.js";
|
|
12
|
+
import "./chunk-6IPJF5QD.js";
|
|
13
|
+
import "./chunk-RJY45A5J.js";
|
|
14
|
+
import "./chunk-NGP6LSV2.js";
|
|
15
|
+
import "./chunk-272SJ4RN.js";
|
|
16
|
+
import "./chunk-CVYC6DUW.js";
|
|
17
|
+
import "./chunk-OPU3NYOO.js";
|
|
18
|
+
import "./chunk-GJV3WDWM.js";
|
|
19
|
+
import "./chunk-MP2AFCGL.js";
|
|
20
|
+
import "./chunk-V5MGYIZS.js";
|
|
21
|
+
import "./chunk-HYZV25LY.js";
|
|
22
|
+
import {
|
|
23
|
+
DEFAULT_COORDINATOR_TEMPLATE_NAME,
|
|
24
|
+
getCoordinatorName
|
|
25
|
+
} from "./chunk-DBQ6I6K2.js";
|
|
26
|
+
import "./chunk-2I23RPSI.js";
|
|
27
|
+
import "./chunk-XCPVYQVK.js";
|
|
28
|
+
import "./chunk-PNQDP3OA.js";
|
|
29
|
+
import "./chunk-FXU7JOXK.js";
|
|
30
|
+
import "./chunk-SYOGNG2R.js";
|
|
31
|
+
import "./chunk-5P3HOBZX.js";
|
|
32
|
+
import "./chunk-LYH5HE24.js";
|
|
33
|
+
import "./chunk-MLKGABMK.js";
|
|
34
|
+
|
|
35
|
+
// src/lib/review-polling.ts
|
|
36
|
+
import { execSync } from "child_process";
|
|
37
|
+
async function pollPendingReviews(deps, _state) {
|
|
38
|
+
let sessions;
|
|
39
|
+
try {
|
|
40
|
+
sessions = deps.listTmuxSessions().filter((s) => isExeSession(s));
|
|
41
|
+
} catch (err) {
|
|
42
|
+
process.stderr.write(
|
|
43
|
+
`[review-polling] tmux session listing failed: ${err instanceof Error ? err.message : String(err)}
|
|
44
|
+
`
|
|
45
|
+
);
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
if (sessions.length === 0) return [];
|
|
49
|
+
const sent = [];
|
|
50
|
+
for (const exeSession of sessions) {
|
|
51
|
+
try {
|
|
52
|
+
const orphans = await deps.findOrphanedDoneTasks(exeSession);
|
|
53
|
+
for (const orphan of orphans) {
|
|
54
|
+
try {
|
|
55
|
+
await deps.createReviewForOrphan(orphan);
|
|
56
|
+
} catch {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return sent;
|
|
63
|
+
}
|
|
64
|
+
function createRealDeps(getClient) {
|
|
65
|
+
return {
|
|
66
|
+
listTmuxSessions: () => {
|
|
67
|
+
try {
|
|
68
|
+
return execSync("tmux list-sessions -F '#{session_name}' 2>/dev/null", {
|
|
69
|
+
encoding: "utf8",
|
|
70
|
+
timeout: 3e3
|
|
71
|
+
}).trim().split("\n").filter(Boolean);
|
|
72
|
+
} catch {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
countPendingReviews: async (sessionScope) => {
|
|
77
|
+
const client = getClient();
|
|
78
|
+
const rpScope = strictSessionScopeFilter(sessionScope);
|
|
79
|
+
const result = await client.execute({
|
|
80
|
+
sql: `SELECT COUNT(*) as count FROM tasks
|
|
81
|
+
WHERE status = 'needs_review'${rpScope.sql}`,
|
|
82
|
+
args: [...rpScope.args]
|
|
83
|
+
});
|
|
84
|
+
return Number(result.rows[0]?.count ?? 0);
|
|
85
|
+
},
|
|
86
|
+
sendIntercom: (session) => {
|
|
87
|
+
import("./lib/tmux-routing.js").then(({ sendIntercom: centralSend }) => centralSend(session)).catch(() => {
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
findOrphanedDoneTasks: async (sessionScope) => {
|
|
91
|
+
const client = getClient();
|
|
92
|
+
const coordinatorName = getCoordinatorName();
|
|
93
|
+
const odScope = strictSessionScopeFilter(sessionScope, "t");
|
|
94
|
+
const result = await client.execute({
|
|
95
|
+
sql: `SELECT t.id, t.title, t.assigned_to, t.assigned_by,
|
|
96
|
+
t.project_name, t.task_file, t.result, t.status
|
|
97
|
+
FROM tasks t
|
|
98
|
+
WHERE t.status = 'needs_review'
|
|
99
|
+
AND t.assigned_to != ?
|
|
100
|
+
AND t.assigned_to != ?${odScope.sql}
|
|
101
|
+
AND (t.result IS NULL OR t.result NOT LIKE '%## Review notes%')`,
|
|
102
|
+
args: [coordinatorName, DEFAULT_COORDINATOR_TEMPLATE_NAME, ...odScope.args]
|
|
103
|
+
});
|
|
104
|
+
return result.rows;
|
|
105
|
+
},
|
|
106
|
+
createReviewForOrphan: async (task) => {
|
|
107
|
+
const { createReviewForCompletedTask } = await import("./tasks-review-XERV6KZD.js");
|
|
108
|
+
const cwd = process.cwd();
|
|
109
|
+
await createReviewForCompletedTask(
|
|
110
|
+
task,
|
|
111
|
+
task.result ?? void 0,
|
|
112
|
+
cwd,
|
|
113
|
+
(/* @__PURE__ */ new Date()).toISOString()
|
|
114
|
+
);
|
|
115
|
+
process.stderr.write(`[exed] Created missing review for: ${task.title} (${task.assigned_to})
|
|
116
|
+
`);
|
|
117
|
+
}
|
|
118
|
+
// findUrgentUnread and findUnstartedTasks removed (2026-05-25 consolidation).
|
|
119
|
+
// All employee nudging handled by task-enforcement → sendIntercom.
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
createRealDeps,
|
|
124
|
+
pollPendingReviews
|
|
125
|
+
};
|
package/dist/runtime/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
SessionManager,
|
|
4
4
|
checkGitSafety,
|
|
5
5
|
targetsMainBranch
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-KQY4QIEN.js";
|
|
7
7
|
import {
|
|
8
8
|
MultiAgentOrchestrator
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-CCAA6XOZ.js";
|
|
10
10
|
import {
|
|
11
11
|
createQuietRenderer,
|
|
12
12
|
createTerminalRenderer,
|
|
@@ -56,19 +56,19 @@ import {
|
|
|
56
56
|
composeHooks,
|
|
57
57
|
createDefaultHooks
|
|
58
58
|
} from "../chunk-O377P7GM.js";
|
|
59
|
-
import "../chunk-
|
|
60
|
-
import "../chunk-
|
|
61
|
-
import "../chunk-
|
|
59
|
+
import "../chunk-MFGMVKGM.js";
|
|
60
|
+
import "../chunk-6TLURATK.js";
|
|
61
|
+
import "../chunk-EZHTLPOS.js";
|
|
62
62
|
import "../chunk-4JERP7NT.js";
|
|
63
63
|
import "../chunk-4FVVJ7ME.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-QKDRYZ2N.js";
|
|
65
65
|
import "../chunk-MVW62NIZ.js";
|
|
66
66
|
import "../chunk-OYNKIAVW.js";
|
|
67
67
|
import "../chunk-SSTLTIF3.js";
|
|
68
|
-
import "../chunk-
|
|
68
|
+
import "../chunk-6IPJF5QD.js";
|
|
69
69
|
import "../chunk-RJY45A5J.js";
|
|
70
70
|
import "../chunk-NGP6LSV2.js";
|
|
71
|
-
import "../chunk-
|
|
71
|
+
import "../chunk-272SJ4RN.js";
|
|
72
72
|
import "../chunk-CVYC6DUW.js";
|
|
73
73
|
import "../chunk-OPU3NYOO.js";
|
|
74
74
|
import "../chunk-GJV3WDWM.js";
|
|
@@ -76,11 +76,11 @@ import {
|
|
|
76
76
|
StateBus,
|
|
77
77
|
orgBus
|
|
78
78
|
} from "../chunk-MP2AFCGL.js";
|
|
79
|
-
import "../chunk-
|
|
79
|
+
import "../chunk-V5MGYIZS.js";
|
|
80
80
|
import "../chunk-HYZV25LY.js";
|
|
81
|
-
import "../chunk-
|
|
81
|
+
import "../chunk-DBQ6I6K2.js";
|
|
82
82
|
import "../chunk-2I23RPSI.js";
|
|
83
|
-
import "../chunk-
|
|
83
|
+
import "../chunk-XCPVYQVK.js";
|
|
84
84
|
import "../chunk-PNQDP3OA.js";
|
|
85
85
|
import "../chunk-FXU7JOXK.js";
|
|
86
86
|
import "../chunk-SYOGNG2R.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensureSessionEventsTable,
|
|
3
|
+
listRecentSessionEvents,
|
|
4
|
+
recordSessionEvent
|
|
5
|
+
} from "./chunk-FVKTXXKK.js";
|
|
6
|
+
import "./chunk-6TLURATK.js";
|
|
7
|
+
import "./chunk-EZHTLPOS.js";
|
|
8
|
+
import "./chunk-4JERP7NT.js";
|
|
9
|
+
import "./chunk-4FVVJ7ME.js";
|
|
10
|
+
import "./chunk-QKDRYZ2N.js";
|
|
11
|
+
import "./chunk-MVW62NIZ.js";
|
|
12
|
+
import "./chunk-OYNKIAVW.js";
|
|
13
|
+
import "./chunk-SSTLTIF3.js";
|
|
14
|
+
import "./chunk-6IPJF5QD.js";
|
|
15
|
+
import "./chunk-RJY45A5J.js";
|
|
16
|
+
import "./chunk-NGP6LSV2.js";
|
|
17
|
+
import "./chunk-272SJ4RN.js";
|
|
18
|
+
import "./chunk-CVYC6DUW.js";
|
|
19
|
+
import "./chunk-OPU3NYOO.js";
|
|
20
|
+
import "./chunk-GJV3WDWM.js";
|
|
21
|
+
import "./chunk-MP2AFCGL.js";
|
|
22
|
+
import "./chunk-V5MGYIZS.js";
|
|
23
|
+
import "./chunk-HYZV25LY.js";
|
|
24
|
+
import "./chunk-DBQ6I6K2.js";
|
|
25
|
+
import "./chunk-2I23RPSI.js";
|
|
26
|
+
import "./chunk-XCPVYQVK.js";
|
|
27
|
+
import "./chunk-PNQDP3OA.js";
|
|
28
|
+
import "./chunk-FXU7JOXK.js";
|
|
29
|
+
import "./chunk-SYOGNG2R.js";
|
|
30
|
+
import "./chunk-5P3HOBZX.js";
|
|
31
|
+
import "./chunk-LYH5HE24.js";
|
|
32
|
+
import "./chunk-MLKGABMK.js";
|
|
33
|
+
export {
|
|
34
|
+
ensureSessionEventsTable,
|
|
35
|
+
listRecentSessionEvents,
|
|
36
|
+
recordSessionEvent
|
|
37
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IDLE_KILL_MIN_LIVE_SESSIONS,
|
|
3
|
+
IDLE_KILL_STREAK_META_KEY,
|
|
4
|
+
IDLE_KILL_SUSPECT_DAY_THRESHOLD,
|
|
5
|
+
TOKENS_PER_IDLE_MINUTE,
|
|
6
|
+
computeIdleKillSuspectStreak,
|
|
7
|
+
countKillsSince,
|
|
8
|
+
parseStreakState,
|
|
9
|
+
recordSessionKill,
|
|
10
|
+
sumTokensSavedSince
|
|
11
|
+
} from "./chunk-SL6WJP2Q.js";
|
|
12
|
+
import "./chunk-DBQ6I6K2.js";
|
|
13
|
+
import "./chunk-2I23RPSI.js";
|
|
14
|
+
import "./chunk-XCPVYQVK.js";
|
|
15
|
+
import "./chunk-PNQDP3OA.js";
|
|
16
|
+
import "./chunk-FXU7JOXK.js";
|
|
17
|
+
import "./chunk-5P3HOBZX.js";
|
|
18
|
+
import "./chunk-LYH5HE24.js";
|
|
19
|
+
import "./chunk-MLKGABMK.js";
|
|
20
|
+
export {
|
|
21
|
+
IDLE_KILL_MIN_LIVE_SESSIONS,
|
|
22
|
+
IDLE_KILL_STREAK_META_KEY,
|
|
23
|
+
IDLE_KILL_SUSPECT_DAY_THRESHOLD,
|
|
24
|
+
TOKENS_PER_IDLE_MINUTE,
|
|
25
|
+
computeIdleKillSuspectStreak,
|
|
26
|
+
countKillsSince,
|
|
27
|
+
parseStreakState,
|
|
28
|
+
recordSessionKill,
|
|
29
|
+
sumTokensSavedSince
|
|
30
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveExeSession
|
|
3
|
+
} from "./chunk-6TLURATK.js";
|
|
4
|
+
import "./chunk-EZHTLPOS.js";
|
|
5
|
+
import "./chunk-4JERP7NT.js";
|
|
6
|
+
import "./chunk-4FVVJ7ME.js";
|
|
7
|
+
import {
|
|
8
|
+
listSessions
|
|
9
|
+
} from "./chunk-QKDRYZ2N.js";
|
|
10
|
+
import "./chunk-MVW62NIZ.js";
|
|
11
|
+
import "./chunk-OYNKIAVW.js";
|
|
12
|
+
import "./chunk-SSTLTIF3.js";
|
|
13
|
+
import "./chunk-6IPJF5QD.js";
|
|
14
|
+
import "./chunk-RJY45A5J.js";
|
|
15
|
+
import "./chunk-NGP6LSV2.js";
|
|
16
|
+
import "./chunk-272SJ4RN.js";
|
|
17
|
+
import "./chunk-CVYC6DUW.js";
|
|
18
|
+
import {
|
|
19
|
+
getProjectName
|
|
20
|
+
} from "./chunk-OPU3NYOO.js";
|
|
21
|
+
import "./chunk-GJV3WDWM.js";
|
|
22
|
+
import "./chunk-MP2AFCGL.js";
|
|
23
|
+
import "./chunk-V5MGYIZS.js";
|
|
24
|
+
import "./chunk-HYZV25LY.js";
|
|
25
|
+
import {
|
|
26
|
+
isCoordinatorName
|
|
27
|
+
} from "./chunk-DBQ6I6K2.js";
|
|
28
|
+
import "./chunk-2I23RPSI.js";
|
|
29
|
+
import "./chunk-XCPVYQVK.js";
|
|
30
|
+
import "./chunk-PNQDP3OA.js";
|
|
31
|
+
import "./chunk-FXU7JOXK.js";
|
|
32
|
+
import "./chunk-SYOGNG2R.js";
|
|
33
|
+
import "./chunk-5P3HOBZX.js";
|
|
34
|
+
import "./chunk-LYH5HE24.js";
|
|
35
|
+
import "./chunk-MLKGABMK.js";
|
|
36
|
+
|
|
37
|
+
// src/lib/session-scope.ts
|
|
38
|
+
function getSessionProject(sessionName) {
|
|
39
|
+
const sessions = listSessions();
|
|
40
|
+
const entry = sessions.find((s) => s.windowName === sessionName);
|
|
41
|
+
if (!entry) return null;
|
|
42
|
+
const parts = entry.projectDir.split("/").filter(Boolean);
|
|
43
|
+
return parts[parts.length - 1] ?? null;
|
|
44
|
+
}
|
|
45
|
+
function findSessionForProject(projectName) {
|
|
46
|
+
const sessions = listSessions();
|
|
47
|
+
for (const s of sessions) {
|
|
48
|
+
const proj = s.projectDir.split("/").filter(Boolean).pop();
|
|
49
|
+
if (proj === projectName && isCoordinatorName(s.agentId)) return s;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function assertSessionScope(actionType, targetProject) {
|
|
54
|
+
try {
|
|
55
|
+
const currentProject = getProjectName();
|
|
56
|
+
const exeSession = resolveExeSession();
|
|
57
|
+
if (!exeSession) {
|
|
58
|
+
return { allowed: true, reason: "no_session" };
|
|
59
|
+
}
|
|
60
|
+
if (currentProject === targetProject) {
|
|
61
|
+
return {
|
|
62
|
+
allowed: true,
|
|
63
|
+
reason: "same_session",
|
|
64
|
+
currentProject,
|
|
65
|
+
targetProject
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
process.stderr.write(
|
|
69
|
+
`[session-scope] BLOCKED cross-project ${actionType}: session project="${currentProject}" \u2260 target project="${targetProject}"
|
|
70
|
+
`
|
|
71
|
+
);
|
|
72
|
+
return {
|
|
73
|
+
allowed: false,
|
|
74
|
+
reason: "cross_session_denied",
|
|
75
|
+
currentProject,
|
|
76
|
+
targetProject,
|
|
77
|
+
targetSession: findSessionForProject(targetProject)?.windowName
|
|
78
|
+
};
|
|
79
|
+
} catch {
|
|
80
|
+
return { allowed: true, reason: "no_session" };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
assertSessionScope,
|
|
85
|
+
findSessionForProject,
|
|
86
|
+
getSessionProject
|
|
87
|
+
};
|