agentrem 1.0.0
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/README.md +194 -0
- package/dist/core.d.ts +138 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +816 -0
- package/dist/core.js.map +1 -0
- package/dist/date-parser.d.ts +13 -0
- package/dist/date-parser.d.ts.map +1 -0
- package/dist/date-parser.js +141 -0
- package/dist/date-parser.js.map +1 -0
- package/dist/db.d.ts +8 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +176 -0
- package/dist/db.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +613 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/prompts.d.ts +3 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +60 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/resources.d.ts +3 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +73 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +4 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +31 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +3 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +500 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/types.d.ts +64 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +43 -0
- package/dist/types.js.map +1 -0
- package/llms.txt +127 -0
- package/package.json +45 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ── CLI Entry Point ───────────────────────────────────────────────────────
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
import * as fs from 'node:fs';
|
|
5
|
+
import * as path from 'node:path';
|
|
6
|
+
import { VERSION, PRIORITY_LABELS, AgentremError } from './types.js';
|
|
7
|
+
import { initDb, getDb } from './db.js';
|
|
8
|
+
import { fmtDt, truncate } from './date-parser.js';
|
|
9
|
+
import { coreAdd, coreCheck, coreList, coreSearch, coreComplete, coreSnooze, coreEdit, coreDelete, coreStats, coreGc, coreHistory, coreUndo, coreExport, coreImport, coreSchema, } from './core.js';
|
|
10
|
+
const program = new Command();
|
|
11
|
+
program
|
|
12
|
+
.name('agentrem')
|
|
13
|
+
.description('Structured reminders CLI for AI agents')
|
|
14
|
+
.version(VERSION);
|
|
15
|
+
// ── init ──────────────────────────────────────────────────────────────────
|
|
16
|
+
program
|
|
17
|
+
.command('init')
|
|
18
|
+
.description('Initialize database')
|
|
19
|
+
.option('--force', 'Force recreate (backs up existing)')
|
|
20
|
+
.action((opts) => {
|
|
21
|
+
const msg = initDb(opts.force);
|
|
22
|
+
console.log(msg);
|
|
23
|
+
});
|
|
24
|
+
// ── add ───────────────────────────────────────────────────────────────────
|
|
25
|
+
program
|
|
26
|
+
.command('add')
|
|
27
|
+
.description('Add a reminder')
|
|
28
|
+
.argument('<content>', 'Reminder text')
|
|
29
|
+
.option('--due, -d <datetime>', 'Due datetime')
|
|
30
|
+
.option('--trigger, -t <type>', 'Trigger type')
|
|
31
|
+
.option('--priority, -p <n>', 'Priority 1-5', parseInt)
|
|
32
|
+
.option('--tags <tags>', 'Comma-separated tags')
|
|
33
|
+
.option('--context, -c <ctx>', 'Context string')
|
|
34
|
+
.option('--category <cat>', 'Category')
|
|
35
|
+
.option('--keywords, -k <kw>', 'Keywords for keyword trigger')
|
|
36
|
+
.option('--match <mode>', 'Keyword match mode: any|all|regex')
|
|
37
|
+
.option('--check <cmd>', 'Shell command for condition trigger')
|
|
38
|
+
.option('--expect <output>', 'Expected output for condition trigger')
|
|
39
|
+
.option('--decay <datetime>', 'Auto-expire datetime')
|
|
40
|
+
.option('--max-fires <n>', 'Auto-complete after N fires', parseInt)
|
|
41
|
+
.option('--recur, -r <rule>', 'Recurrence: 1d, 1w, 2w, 1m')
|
|
42
|
+
.option('--agent, -a <name>', 'Target agent')
|
|
43
|
+
.option('--depends-on <id>', 'Dependency reminder ID')
|
|
44
|
+
.option('--source <src>', 'Source: agent|user|system')
|
|
45
|
+
.option('--dry-run', 'Preview without creating')
|
|
46
|
+
.action((content, opts) => {
|
|
47
|
+
const db = getDb();
|
|
48
|
+
try {
|
|
49
|
+
const rem = coreAdd(db, {
|
|
50
|
+
content,
|
|
51
|
+
due: opts.due || opts.D,
|
|
52
|
+
trigger: opts.trigger || opts.T,
|
|
53
|
+
priority: opts.priority || opts.P,
|
|
54
|
+
tags: opts.tags,
|
|
55
|
+
context: opts.context || opts.C,
|
|
56
|
+
category: opts.category,
|
|
57
|
+
keywords: opts.keywords || opts.K,
|
|
58
|
+
match: opts.match,
|
|
59
|
+
check: opts.check,
|
|
60
|
+
expect: opts.expect,
|
|
61
|
+
decay: opts.decay,
|
|
62
|
+
maxFires: opts.maxFires,
|
|
63
|
+
recur: opts.recur || opts.R,
|
|
64
|
+
agent: opts.agent || opts.A,
|
|
65
|
+
dependsOn: opts.dependsOn,
|
|
66
|
+
source: opts.source,
|
|
67
|
+
dryRun: opts.dryRun,
|
|
68
|
+
});
|
|
69
|
+
if (opts.dryRun) {
|
|
70
|
+
console.log('🔍 Dry run — would create:');
|
|
71
|
+
console.log(` Content: ${rem.content}`);
|
|
72
|
+
console.log(` Trigger: ${rem.trigger_type}`);
|
|
73
|
+
if (rem.trigger_at)
|
|
74
|
+
console.log(` Due: ${rem.trigger_at}`);
|
|
75
|
+
console.log(` Priority: ${rem.priority} (${PRIORITY_LABELS[rem.priority] || ''})`);
|
|
76
|
+
if (rem.tags)
|
|
77
|
+
console.log(` Tags: ${rem.tags}`);
|
|
78
|
+
if (rem.context)
|
|
79
|
+
console.log(` Context: ${rem.context}`);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
console.log(`✅ Created reminder [${rem.id.slice(0, 8)}]`);
|
|
83
|
+
console.log(` Content: ${rem.content}`);
|
|
84
|
+
console.log(` Trigger: ${rem.trigger_type}`);
|
|
85
|
+
if (rem.trigger_at)
|
|
86
|
+
console.log(` Due: ${rem.trigger_at} (${fmtDt(rem.trigger_at)})`);
|
|
87
|
+
console.log(` Priority: ${rem.priority} (${PRIORITY_LABELS[rem.priority] || ''})`);
|
|
88
|
+
if (rem.tags)
|
|
89
|
+
console.log(` Tags: ${rem.tags}`);
|
|
90
|
+
if (rem.context)
|
|
91
|
+
console.log(` Context: ${rem.context}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
db.close();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
// ── check ─────────────────────────────────────────────────────────────────
|
|
99
|
+
program
|
|
100
|
+
.command('check')
|
|
101
|
+
.description('Check for triggered reminders')
|
|
102
|
+
.option('--type <types>', 'Comma-separated trigger types')
|
|
103
|
+
.option('--text <text>', 'User message text (for keyword matching)')
|
|
104
|
+
.option('--budget <n>', 'Token budget (default 800)', parseInt)
|
|
105
|
+
.option('--format <fmt>', 'Output format: full|compact|inline')
|
|
106
|
+
.option('--agent, -a <name>', 'Agent name')
|
|
107
|
+
.option('--escalate', 'Run escalation checks')
|
|
108
|
+
.option('--dry-run', 'Preview without updating')
|
|
109
|
+
.action((opts) => {
|
|
110
|
+
const db = getDb();
|
|
111
|
+
try {
|
|
112
|
+
const result = coreCheck(db, {
|
|
113
|
+
type: opts.type,
|
|
114
|
+
text: opts.text,
|
|
115
|
+
budget: opts.budget,
|
|
116
|
+
format: opts.format,
|
|
117
|
+
agent: opts.agent || opts.A,
|
|
118
|
+
escalate: opts.escalate,
|
|
119
|
+
dryRun: opts.dryRun,
|
|
120
|
+
});
|
|
121
|
+
if (result.included.length === 0)
|
|
122
|
+
return;
|
|
123
|
+
const fmt = opts.format || 'full';
|
|
124
|
+
const charLimits = { 1: 200, 2: 100, 3: 60, 4: 0, 5: 0 };
|
|
125
|
+
if (fmt === 'inline') {
|
|
126
|
+
for (const rem of result.included) {
|
|
127
|
+
const ctx = rem.context ? ` — ${rem.context}` : '';
|
|
128
|
+
console.log(`💡 Reminder [${rem.id.slice(0, 8)}]: "${rem.content}${ctx}"`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else if (fmt === 'compact') {
|
|
132
|
+
const parts = [];
|
|
133
|
+
const byPriority = {};
|
|
134
|
+
for (const rem of result.included) {
|
|
135
|
+
(byPriority[rem.priority] ??= []).push(rem);
|
|
136
|
+
}
|
|
137
|
+
for (const p of Object.keys(byPriority).map(Number).sort()) {
|
|
138
|
+
const items = byPriority[p];
|
|
139
|
+
const label = PRIORITY_LABELS[p] || `P${p}`;
|
|
140
|
+
if (items.length === 1) {
|
|
141
|
+
const r = items[0];
|
|
142
|
+
const dueStr = r.trigger_at ? ` — ${fmtDt(r.trigger_at)}` : '';
|
|
143
|
+
parts.push(`${items.length} ${label.split(' ', 2)[1].toLowerCase()} (${truncate(r.content, 30)}${dueStr})`);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
parts.push(`${items.length} ${label.split(' ', 2)[1].toLowerCase()}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const overflowParts = [];
|
|
150
|
+
for (const p of [2, 3, 4]) {
|
|
151
|
+
if (result.overflowCounts[p] > 0) {
|
|
152
|
+
overflowParts.push(`+${result.overflowCounts[p]} ${(PRIORITY_LABELS[p] || '').split(' ', 2)[1].toLowerCase()}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const extra = overflowParts.length > 0 ? `, ${overflowParts.join(', ')} hidden` : '';
|
|
156
|
+
console.log(`🔔 ${parts.join(', ')}${extra}`);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
// Full format
|
|
160
|
+
console.log('🔔 Active Reminders\n');
|
|
161
|
+
const byPriority = {};
|
|
162
|
+
for (const rem of result.included) {
|
|
163
|
+
(byPriority[rem.priority] ??= []).push(rem);
|
|
164
|
+
}
|
|
165
|
+
for (const p of Object.keys(byPriority).map(Number).sort()) {
|
|
166
|
+
const label = PRIORITY_LABELS[p] || `P${p}`;
|
|
167
|
+
const items = byPriority[p];
|
|
168
|
+
const countStr = items.length > 1 ? ` (${items.length})` : '';
|
|
169
|
+
console.log(`${label}${countStr}`);
|
|
170
|
+
for (const rem of items) {
|
|
171
|
+
const dueStr = rem.trigger_at ? ` — due ${fmtDt(rem.trigger_at)}` : '';
|
|
172
|
+
let fireStr = '';
|
|
173
|
+
if (rem.fire_count && rem.fire_count > 0) {
|
|
174
|
+
fireStr = `, fired ${rem.fire_count}x`;
|
|
175
|
+
}
|
|
176
|
+
let triggerInfo = '';
|
|
177
|
+
if (rem.trigger_type === 'keyword') {
|
|
178
|
+
const config = JSON.parse(rem.trigger_config || '{}');
|
|
179
|
+
const kws = config.keywords || [];
|
|
180
|
+
triggerInfo = ` (keyword: "${kws.join(', ')}")`;
|
|
181
|
+
}
|
|
182
|
+
else if (rem.trigger_type === 'condition') {
|
|
183
|
+
triggerInfo = ' (condition: checking)';
|
|
184
|
+
}
|
|
185
|
+
else if (rem.trigger_type === 'session') {
|
|
186
|
+
triggerInfo = ' (session)';
|
|
187
|
+
}
|
|
188
|
+
else if (rem.trigger_type === 'heartbeat') {
|
|
189
|
+
triggerInfo = ' (heartbeat)';
|
|
190
|
+
}
|
|
191
|
+
console.log(`- [${rem.id.slice(0, 8)}] ${truncate(rem.content, charLimits[p] || 60)}${dueStr}${fireStr}${triggerInfo}`);
|
|
192
|
+
if (rem.context) {
|
|
193
|
+
console.log(` Context: ${truncate(rem.context, charLimits[p] || 60)}`);
|
|
194
|
+
}
|
|
195
|
+
if (rem.tags) {
|
|
196
|
+
console.log(` Tags: ${rem.tags}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
console.log();
|
|
200
|
+
}
|
|
201
|
+
const overflowTotal = Object.values(result.overflowCounts).reduce((a, b) => a + b, 0);
|
|
202
|
+
if (overflowTotal > 0) {
|
|
203
|
+
console.log(`...and ${overflowTotal} more (run \`agentrem list\` for all)`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
finally {
|
|
208
|
+
db.close();
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
// ── list ──────────────────────────────────────────────────────────────────
|
|
212
|
+
program
|
|
213
|
+
.command('list')
|
|
214
|
+
.description('List reminders')
|
|
215
|
+
.option('--status, -s <statuses>', 'Comma-separated statuses')
|
|
216
|
+
.option('--priority <priorities>', 'Comma-separated priorities')
|
|
217
|
+
.option('--tag <tag>', 'Filter by tag')
|
|
218
|
+
.option('--trigger <type>', 'Filter by trigger type')
|
|
219
|
+
.option('--due <filter>', 'Due filter: today|tomorrow|overdue|week|date')
|
|
220
|
+
.option('--agent, -a <name>', 'Agent name')
|
|
221
|
+
.option('--category <cat>', 'Category filter')
|
|
222
|
+
.option('--limit <n>', 'Max results', parseInt)
|
|
223
|
+
.option('--format <fmt>', 'Output format: table|json|compact')
|
|
224
|
+
.option('--all', 'Show all statuses')
|
|
225
|
+
.action((opts) => {
|
|
226
|
+
const db = getDb();
|
|
227
|
+
try {
|
|
228
|
+
const rows = coreList(db, {
|
|
229
|
+
status: opts.status || opts.S,
|
|
230
|
+
priority: opts.priority,
|
|
231
|
+
tag: opts.tag,
|
|
232
|
+
trigger: opts.trigger,
|
|
233
|
+
due: opts.due,
|
|
234
|
+
agent: opts.agent || opts.A,
|
|
235
|
+
category: opts.category,
|
|
236
|
+
limit: opts.limit,
|
|
237
|
+
all: opts.all,
|
|
238
|
+
});
|
|
239
|
+
if (rows.length === 0) {
|
|
240
|
+
console.log('No reminders found.');
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const fmt = opts.format || 'table';
|
|
244
|
+
if (fmt === 'json') {
|
|
245
|
+
console.log(JSON.stringify(rows, null, 2));
|
|
246
|
+
}
|
|
247
|
+
else if (fmt === 'compact') {
|
|
248
|
+
for (const r of rows) {
|
|
249
|
+
const dueStr = r.trigger_at ? ` due:${fmtDt(r.trigger_at)}` : '';
|
|
250
|
+
console.log(`[${r.id.slice(0, 8)}] P${r.priority} ${truncate(r.content, 40)}${dueStr}`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
const header = `${'ID'.padStart(8)} ${'P'.padStart(1)} ${'Status'.padStart(9)} ${'Trigger'.padStart(9)} ${'Content'.padEnd(35)} ${'Due/Info'.padEnd(15)} Tags`;
|
|
255
|
+
console.log(header);
|
|
256
|
+
console.log('─'.repeat(header.length));
|
|
257
|
+
for (const r of rows) {
|
|
258
|
+
const dueInfo = r.trigger_at ? fmtDt(r.trigger_at) : r.trigger_type;
|
|
259
|
+
console.log(`${r.id.slice(0, 8).padStart(8)} ${String(r.priority).padStart(1)} ${r.status.padStart(9)} ${r.trigger_type.padStart(9)} ${truncate(r.content, 35).padEnd(35)} ${dueInfo.padEnd(15)} ${r.tags || ''}`);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
finally {
|
|
264
|
+
db.close();
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
// ── search ────────────────────────────────────────────────────────────────
|
|
268
|
+
program
|
|
269
|
+
.command('search')
|
|
270
|
+
.description('Full-text search')
|
|
271
|
+
.argument('<query>', 'Search query')
|
|
272
|
+
.option('--status <statuses>', 'Filter statuses')
|
|
273
|
+
.option('--limit <n>', 'Max results', parseInt)
|
|
274
|
+
.option('--format <fmt>', 'Output format: table|json')
|
|
275
|
+
.action((query, opts) => {
|
|
276
|
+
const db = getDb();
|
|
277
|
+
try {
|
|
278
|
+
const rows = coreSearch(db, {
|
|
279
|
+
query,
|
|
280
|
+
status: opts.status,
|
|
281
|
+
limit: opts.limit,
|
|
282
|
+
});
|
|
283
|
+
if (rows.length === 0) {
|
|
284
|
+
console.log('No results found.');
|
|
285
|
+
process.exit(1);
|
|
286
|
+
}
|
|
287
|
+
const fmt = opts.format || 'table';
|
|
288
|
+
if (fmt === 'json') {
|
|
289
|
+
console.log(JSON.stringify(rows, null, 2));
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
const header = `${'ID'.padStart(8)} ${'P'.padStart(1)} ${'Content'.padEnd(40)} Tags`;
|
|
293
|
+
console.log(`🔍 Search results for "${query}":\n`);
|
|
294
|
+
console.log(header);
|
|
295
|
+
console.log('─'.repeat(header.length));
|
|
296
|
+
for (const r of rows) {
|
|
297
|
+
console.log(`${r.id.slice(0, 8).padStart(8)} ${String(r.priority).padStart(1)} ${truncate(r.content, 40).padEnd(40)} ${r.tags || ''}`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
finally {
|
|
302
|
+
db.close();
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
// ── complete ──────────────────────────────────────────────────────────────
|
|
306
|
+
program
|
|
307
|
+
.command('complete')
|
|
308
|
+
.description('Complete a reminder')
|
|
309
|
+
.argument('<id>', 'Reminder ID')
|
|
310
|
+
.option('--notes <text>', 'Completion notes')
|
|
311
|
+
.action((id, opts) => {
|
|
312
|
+
const db = getDb();
|
|
313
|
+
try {
|
|
314
|
+
const result = coreComplete(db, id, opts.notes);
|
|
315
|
+
if (result.nextRecurrence) {
|
|
316
|
+
console.log(`📅 Next recurrence [${result.nextRecurrence.id.slice(0, 8)}] created — due ${result.nextRecurrence.trigger_at}`);
|
|
317
|
+
}
|
|
318
|
+
console.log(`✅ Completed [${result.completed.id.slice(0, 8)}] ${result.completed.content}`);
|
|
319
|
+
}
|
|
320
|
+
finally {
|
|
321
|
+
db.close();
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
// ── snooze ────────────────────────────────────────────────────────────────
|
|
325
|
+
program
|
|
326
|
+
.command('snooze')
|
|
327
|
+
.description('Snooze a reminder')
|
|
328
|
+
.argument('<id>', 'Reminder ID')
|
|
329
|
+
.option('--until <datetime>', 'Snooze until datetime')
|
|
330
|
+
.option('--for <duration>', 'Snooze duration: 1h, 2h, 1d, 3d, 1w')
|
|
331
|
+
.action((id, opts) => {
|
|
332
|
+
const db = getDb();
|
|
333
|
+
try {
|
|
334
|
+
const rem = coreSnooze(db, id, opts.until, opts.for);
|
|
335
|
+
console.log(`😴 Snoozed [${rem.id.slice(0, 8)}] until ${rem.snoozed_until} (${fmtDt(rem.snoozed_until)})`);
|
|
336
|
+
}
|
|
337
|
+
finally {
|
|
338
|
+
db.close();
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
// ── edit ──────────────────────────────────────────────────────────────────
|
|
342
|
+
program
|
|
343
|
+
.command('edit')
|
|
344
|
+
.description('Edit a reminder')
|
|
345
|
+
.argument('<id>', 'Reminder ID')
|
|
346
|
+
.option('--content <text>', 'New content')
|
|
347
|
+
.option('--context <ctx>', 'New context')
|
|
348
|
+
.option('--priority, -p <n>', 'New priority', parseInt)
|
|
349
|
+
.option('--due, -d <datetime>', 'New due date')
|
|
350
|
+
.option('--tags <tags>', 'Replace tags')
|
|
351
|
+
.option('--add-tags <tags>', 'Add tags')
|
|
352
|
+
.option('--remove-tags <tags>', 'Remove tags')
|
|
353
|
+
.option('--category <cat>', 'New category')
|
|
354
|
+
.option('--decay <datetime>', 'New decay date')
|
|
355
|
+
.option('--max-fires <n>', 'New max fires', parseInt)
|
|
356
|
+
.option('--keywords, -k <kw>', 'New keywords')
|
|
357
|
+
.option('--agent, -a <name>', 'New agent')
|
|
358
|
+
.action((id, opts) => {
|
|
359
|
+
const db = getDb();
|
|
360
|
+
try {
|
|
361
|
+
const rem = coreEdit(db, id, {
|
|
362
|
+
content: opts.content,
|
|
363
|
+
context: opts.context,
|
|
364
|
+
priority: opts.priority || opts.P,
|
|
365
|
+
due: opts.due || opts.D,
|
|
366
|
+
tags: opts.tags,
|
|
367
|
+
addTags: opts.addTags,
|
|
368
|
+
removeTags: opts.removeTags,
|
|
369
|
+
category: opts.category,
|
|
370
|
+
decay: opts.decay,
|
|
371
|
+
maxFires: opts.maxFires,
|
|
372
|
+
keywords: opts.keywords || opts.K,
|
|
373
|
+
agent: opts.agent || opts.A,
|
|
374
|
+
});
|
|
375
|
+
console.log(`✏️ Updated [${rem.id.slice(0, 8)}]`);
|
|
376
|
+
}
|
|
377
|
+
finally {
|
|
378
|
+
db.close();
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
// ── delete ────────────────────────────────────────────────────────────────
|
|
382
|
+
program
|
|
383
|
+
.command('delete')
|
|
384
|
+
.description('Delete a reminder')
|
|
385
|
+
.argument('[id]', 'Reminder ID')
|
|
386
|
+
.option('--permanent', 'Permanently delete')
|
|
387
|
+
.option('--status <status>', 'Bulk delete by status')
|
|
388
|
+
.option('--older-than <days>', 'Delete older than N days')
|
|
389
|
+
.action((id, opts) => {
|
|
390
|
+
const db = getDb();
|
|
391
|
+
try {
|
|
392
|
+
const result = coreDelete(db, {
|
|
393
|
+
id,
|
|
394
|
+
permanent: opts.permanent,
|
|
395
|
+
status: opts.status,
|
|
396
|
+
olderThan: opts.olderThan,
|
|
397
|
+
});
|
|
398
|
+
const mode = result.permanent ? 'Permanently deleted' : 'Soft-deleted';
|
|
399
|
+
if (opts.status) {
|
|
400
|
+
console.log(`🗑️ ${mode} ${result.count} reminders with status '${opts.status}'`);
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
console.log(result.permanent
|
|
404
|
+
? `🗑️ Permanently deleted [${id}]`
|
|
405
|
+
: `🗑️ Deleted [${id}] (soft delete — use --permanent to remove permanently)`);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
finally {
|
|
409
|
+
db.close();
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
// ── stats ─────────────────────────────────────────────────────────────────
|
|
413
|
+
program
|
|
414
|
+
.command('stats')
|
|
415
|
+
.description('Show statistics')
|
|
416
|
+
.action(() => {
|
|
417
|
+
const db = getDb();
|
|
418
|
+
try {
|
|
419
|
+
const s = coreStats(db);
|
|
420
|
+
const prioParts = s.byPriority.map((p) => `${p.count} ${p.label}`);
|
|
421
|
+
const prioStr = prioParts.length > 0 ? ` (${prioParts.join(', ')})` : '';
|
|
422
|
+
const triggerParts = s.byTrigger.map((t) => `${t.count} ${t.type}`);
|
|
423
|
+
console.log('📊 Agent Reminders Stats');
|
|
424
|
+
console.log(`Active: ${s.totalActive}${prioStr}`);
|
|
425
|
+
console.log(`Overdue: ${s.overdue}`);
|
|
426
|
+
console.log(`Snoozed: ${s.snoozed}`);
|
|
427
|
+
console.log(`Completed (this week): ${s.completedWeek}`);
|
|
428
|
+
console.log(`Expired: ${s.expired}`);
|
|
429
|
+
if (triggerParts.length > 0) {
|
|
430
|
+
console.log(`By trigger: ${triggerParts.join(', ')}`);
|
|
431
|
+
}
|
|
432
|
+
if (s.nextDue) {
|
|
433
|
+
console.log(`Next due: "${truncate(s.nextDue.content, 30)}" ${fmtDt(s.nextDue.triggerAt)}`);
|
|
434
|
+
}
|
|
435
|
+
if (s.lastCreated) {
|
|
436
|
+
console.log(`Last created: ${fmtDt(s.lastCreated)}`);
|
|
437
|
+
}
|
|
438
|
+
const sizeStr = s.dbSizeBytes > 1024 * 1024
|
|
439
|
+
? `${(s.dbSizeBytes / 1024 / 1024).toFixed(1)} MB`
|
|
440
|
+
: `${Math.round(s.dbSizeBytes / 1024)} KB`;
|
|
441
|
+
console.log(`DB size: ${sizeStr}`);
|
|
442
|
+
}
|
|
443
|
+
finally {
|
|
444
|
+
db.close();
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
// ── gc ────────────────────────────────────────────────────────────────────
|
|
448
|
+
program
|
|
449
|
+
.command('gc')
|
|
450
|
+
.description('Garbage collection')
|
|
451
|
+
.option('--older-than <days>', 'Days threshold (default 30)')
|
|
452
|
+
.option('--dry-run', 'Preview')
|
|
453
|
+
.action((opts) => {
|
|
454
|
+
const db = getDb();
|
|
455
|
+
try {
|
|
456
|
+
const olderThan = parseInt(opts.olderThan || '30', 10);
|
|
457
|
+
const result = coreGc(db, olderThan, opts.dryRun);
|
|
458
|
+
if (result.count === 0) {
|
|
459
|
+
console.log('No reminders to clean up.');
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if (opts.dryRun) {
|
|
463
|
+
console.log(`🔍 Dry run — would remove ${result.count} reminders:`);
|
|
464
|
+
for (const r of result.reminders) {
|
|
465
|
+
console.log(` [${r.id.slice(0, 8)}] ${r.status}: ${truncate(r.content, 40)}`);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
console.log(`🗑️ Removed ${result.count} old reminders and vacuumed database.`);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
finally {
|
|
473
|
+
db.close();
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
// ── history ───────────────────────────────────────────────────────────────
|
|
477
|
+
program
|
|
478
|
+
.command('history')
|
|
479
|
+
.description('View history')
|
|
480
|
+
.argument('[id]', 'Reminder ID (optional)')
|
|
481
|
+
.option('--limit <n>', 'Number of entries', parseInt)
|
|
482
|
+
.option('--format <fmt>', 'Output format: table|json')
|
|
483
|
+
.action((id, opts) => {
|
|
484
|
+
const db = getDb();
|
|
485
|
+
try {
|
|
486
|
+
const rows = coreHistory(db, id, opts.limit || 20);
|
|
487
|
+
if (rows.length === 0) {
|
|
488
|
+
console.log('No history found.');
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
const fmt = opts.format || 'table';
|
|
492
|
+
if (fmt === 'json') {
|
|
493
|
+
console.log(JSON.stringify(rows, null, 2));
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
console.log(`${'HID'.padStart(4)} ${'Reminder'.padStart(8)} ${'Action'.padStart(10)} ${'When'.padEnd(15)} Source`);
|
|
497
|
+
console.log('─'.repeat(60));
|
|
498
|
+
for (const r of rows) {
|
|
499
|
+
console.log(`${String(r.id).padStart(4)} ${r.reminder_id.slice(0, 8).padStart(8)} ${r.action.padStart(10)} ${fmtDt(r.timestamp).padEnd(15)} ${r.source || ''}`);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
finally {
|
|
504
|
+
db.close();
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
// ── undo ──────────────────────────────────────────────────────────────────
|
|
508
|
+
program
|
|
509
|
+
.command('undo')
|
|
510
|
+
.description('Undo a change')
|
|
511
|
+
.argument('<history_id>', 'History entry ID')
|
|
512
|
+
.action((historyId) => {
|
|
513
|
+
const db = getDb();
|
|
514
|
+
try {
|
|
515
|
+
coreUndo(db, parseInt(historyId, 10));
|
|
516
|
+
console.log(`↩️ Reverted history #${historyId}`);
|
|
517
|
+
}
|
|
518
|
+
finally {
|
|
519
|
+
db.close();
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
// ── export ────────────────────────────────────────────────────────────────
|
|
523
|
+
program
|
|
524
|
+
.command('export')
|
|
525
|
+
.description('Export reminders')
|
|
526
|
+
.option('--out, -o <path>', 'Output path')
|
|
527
|
+
.option('--status <statuses>', 'Filter by status')
|
|
528
|
+
.action((opts) => {
|
|
529
|
+
const db = getDb();
|
|
530
|
+
try {
|
|
531
|
+
const data = coreExport(db, opts.status);
|
|
532
|
+
let outPath;
|
|
533
|
+
if (opts.out || opts.O) {
|
|
534
|
+
outPath = opts.out || opts.O;
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
const dir = process.env['AGENTREM_DIR'] ||
|
|
538
|
+
path.join(require('node:os').homedir(), '.agentrem');
|
|
539
|
+
const ts = new Date()
|
|
540
|
+
.toISOString()
|
|
541
|
+
.replace(/[:.]/g, '')
|
|
542
|
+
.slice(0, 15)
|
|
543
|
+
.replace('T', '-');
|
|
544
|
+
outPath = path.join(dir, `export-${ts}.json`);
|
|
545
|
+
}
|
|
546
|
+
const dir = path.dirname(outPath);
|
|
547
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
548
|
+
fs.writeFileSync(outPath, JSON.stringify(data, null, 2));
|
|
549
|
+
console.log(`📦 Exported ${data.reminder_count} reminders to ${outPath}`);
|
|
550
|
+
}
|
|
551
|
+
finally {
|
|
552
|
+
db.close();
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
// ── import ────────────────────────────────────────────────────────────────
|
|
556
|
+
program
|
|
557
|
+
.command('import')
|
|
558
|
+
.description('Import reminders')
|
|
559
|
+
.argument('<file>', 'JSON file to import')
|
|
560
|
+
.option('--merge', 'Merge (skip duplicates)')
|
|
561
|
+
.option('--replace', 'Replace all existing')
|
|
562
|
+
.option('--dry-run', 'Preview')
|
|
563
|
+
.action((file, opts) => {
|
|
564
|
+
if (!fs.existsSync(file)) {
|
|
565
|
+
console.error(`Error: File not found: ${file}`);
|
|
566
|
+
process.exit(2);
|
|
567
|
+
}
|
|
568
|
+
const data = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
569
|
+
if (opts.dryRun) {
|
|
570
|
+
console.log(`🔍 Dry run — would import ${(data.reminders || []).length} reminders and ${(data.history || []).length} history entries`);
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
const db = getDb();
|
|
574
|
+
try {
|
|
575
|
+
const result = coreImport(db, data, opts.merge, opts.replace, false);
|
|
576
|
+
console.log(`📥 Imported ${result.imported} reminders (${result.skipped} skipped), ${result.historyImported} history entries`);
|
|
577
|
+
}
|
|
578
|
+
finally {
|
|
579
|
+
db.close();
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
// ── schema ────────────────────────────────────────────────────────────────
|
|
583
|
+
program
|
|
584
|
+
.command('schema')
|
|
585
|
+
.description('Show database schema')
|
|
586
|
+
.action(() => {
|
|
587
|
+
const db = getDb();
|
|
588
|
+
try {
|
|
589
|
+
const sqls = coreSchema(db);
|
|
590
|
+
for (const sql of sqls) {
|
|
591
|
+
console.log(sql);
|
|
592
|
+
console.log();
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
finally {
|
|
596
|
+
db.close();
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
// ── Run ───────────────────────────────────────────────────────────────────
|
|
600
|
+
function run() {
|
|
601
|
+
try {
|
|
602
|
+
program.parse();
|
|
603
|
+
}
|
|
604
|
+
catch (e) {
|
|
605
|
+
if (e instanceof AgentremError) {
|
|
606
|
+
console.error(`Error: ${e.message}`);
|
|
607
|
+
process.exit(e.exitCode);
|
|
608
|
+
}
|
|
609
|
+
throw e;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
run();
|
|
613
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,6EAA6E;AAE7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAW,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,EACX,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,GAEX,MAAM,WAAW,CAAC;AAEnB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,wCAAwC,CAAC;KACrD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,6EAA6E;AAE7E,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,qBAAqB,CAAC;KAClC,MAAM,CAAC,SAAS,EAAE,oCAAoC,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