@botmem/cli 0.1.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/dist/cli.d.ts +2 -0
- package/dist/cli.js +512 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +238 -0
- package/dist/client.js +233 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/agent.d.ts +5 -0
- package/dist/commands/agent.js +102 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/contacts.d.ts +3 -0
- package/dist/commands/contacts.js +63 -0
- package/dist/commands/contacts.js.map +1 -0
- package/dist/commands/entities.d.ts +5 -0
- package/dist/commands/entities.js +161 -0
- package/dist/commands/entities.js.map +1 -0
- package/dist/commands/jobs.d.ts +5 -0
- package/dist/commands/jobs.js +58 -0
- package/dist/commands/jobs.js.map +1 -0
- package/dist/commands/memories.d.ts +4 -0
- package/dist/commands/memories.js +64 -0
- package/dist/commands/memories.js.map +1 -0
- package/dist/commands/memory-banks.d.ts +3 -0
- package/dist/commands/memory-banks.js +85 -0
- package/dist/commands/memory-banks.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.js +98 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/timeline.d.ts +3 -0
- package/dist/commands/timeline.js +76 -0
- package/dist/commands/timeline.js.map +1 -0
- package/dist/commands/version.d.ts +3 -0
- package/dist/commands/version.js +21 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/format.d.ts +123 -0
- package/dist/format.js +364 -0
- package/dist/format.js.map +1 -0
- package/package.json +37 -0
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI formatting helpers and human-readable output formatters.
|
|
3
|
+
* No external dependencies — uses ANSI escape codes directly.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Convert data to TOON format for LLM-optimized output (--toon mode).
|
|
7
|
+
* Uses @toon-format/toon for 40-60% token savings.
|
|
8
|
+
* Pre-parses JSON-encoded strings so they're included as real objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toonify(data: unknown): string;
|
|
11
|
+
export declare const dim: (s: string) => string;
|
|
12
|
+
export declare const bold: (s: string) => string;
|
|
13
|
+
export declare const green: (s: string) => string;
|
|
14
|
+
export declare const red: (s: string) => string;
|
|
15
|
+
export declare const yellow: (s: string) => string;
|
|
16
|
+
export declare const cyan: (s: string) => string;
|
|
17
|
+
export declare const magenta: (s: string) => string;
|
|
18
|
+
export declare const white: (s: string) => string;
|
|
19
|
+
export declare function formatSearchResults(results: Array<{
|
|
20
|
+
id: string;
|
|
21
|
+
text: string;
|
|
22
|
+
sourceType: string;
|
|
23
|
+
connectorType: string;
|
|
24
|
+
eventTime: string;
|
|
25
|
+
score?: number;
|
|
26
|
+
weights?: {
|
|
27
|
+
final: number;
|
|
28
|
+
};
|
|
29
|
+
}>): string;
|
|
30
|
+
export declare function formatMemory(m: {
|
|
31
|
+
id: string;
|
|
32
|
+
text: string;
|
|
33
|
+
sourceType: string;
|
|
34
|
+
connectorType: string;
|
|
35
|
+
eventTime: string;
|
|
36
|
+
importance: number | null;
|
|
37
|
+
factuality: string | null;
|
|
38
|
+
embeddingStatus: string;
|
|
39
|
+
entities: string | null;
|
|
40
|
+
}): string;
|
|
41
|
+
export declare function formatMemoryList(items: Array<{
|
|
42
|
+
id: string;
|
|
43
|
+
text: string;
|
|
44
|
+
sourceType: string;
|
|
45
|
+
connectorType: string;
|
|
46
|
+
eventTime: string;
|
|
47
|
+
}>, total: number): string;
|
|
48
|
+
export declare function formatContact(c: {
|
|
49
|
+
id: string;
|
|
50
|
+
displayName: string;
|
|
51
|
+
identifiers: Array<{
|
|
52
|
+
identifierType: string;
|
|
53
|
+
identifierValue: string;
|
|
54
|
+
}>;
|
|
55
|
+
memoryCount?: number;
|
|
56
|
+
}): string;
|
|
57
|
+
export declare function formatContactList(items: Array<{
|
|
58
|
+
id: string;
|
|
59
|
+
displayName: string;
|
|
60
|
+
identifiers: Array<{
|
|
61
|
+
identifierType: string;
|
|
62
|
+
identifierValue: string;
|
|
63
|
+
}>;
|
|
64
|
+
}>, total: number): string;
|
|
65
|
+
export declare function formatJob(j: {
|
|
66
|
+
id: string;
|
|
67
|
+
connector: string;
|
|
68
|
+
accountIdentifier: string | null;
|
|
69
|
+
status: string;
|
|
70
|
+
progress: number | null;
|
|
71
|
+
total: number | null;
|
|
72
|
+
startedAt: string | null;
|
|
73
|
+
completedAt: string | null;
|
|
74
|
+
error: string | null;
|
|
75
|
+
}): string;
|
|
76
|
+
export declare function formatJobList(jobs: Array<{
|
|
77
|
+
id: string;
|
|
78
|
+
connector: string;
|
|
79
|
+
accountIdentifier: string | null;
|
|
80
|
+
status: string;
|
|
81
|
+
progress: number | null;
|
|
82
|
+
total: number | null;
|
|
83
|
+
startedAt: string | null;
|
|
84
|
+
completedAt: string | null;
|
|
85
|
+
error: string | null;
|
|
86
|
+
}>): string;
|
|
87
|
+
export declare function formatStats(stats: {
|
|
88
|
+
total: number;
|
|
89
|
+
bySource: Record<string, number>;
|
|
90
|
+
byConnector: Record<string, number>;
|
|
91
|
+
byFactuality: Record<string, number>;
|
|
92
|
+
}): string;
|
|
93
|
+
export declare function formatAccounts(accounts: Array<{
|
|
94
|
+
id: string;
|
|
95
|
+
type: string;
|
|
96
|
+
identifier: string;
|
|
97
|
+
status: string;
|
|
98
|
+
lastSync: string | null;
|
|
99
|
+
memoriesIngested: number | null;
|
|
100
|
+
}>): string;
|
|
101
|
+
export declare function formatVersion(v: {
|
|
102
|
+
buildTime: string;
|
|
103
|
+
gitHash: string;
|
|
104
|
+
uptime: number;
|
|
105
|
+
}): string;
|
|
106
|
+
export declare function formatAgentAnswer(data: any): string;
|
|
107
|
+
export declare function formatAgentContext(data: any): string;
|
|
108
|
+
export declare function formatMemoryBanks(banks: any[]): string;
|
|
109
|
+
export declare function formatStatus(stats: {
|
|
110
|
+
total: number;
|
|
111
|
+
bySource: Record<string, number>;
|
|
112
|
+
}, queues: Record<string, {
|
|
113
|
+
waiting: number;
|
|
114
|
+
active: number;
|
|
115
|
+
failed: number;
|
|
116
|
+
}>, accounts: Array<{
|
|
117
|
+
id: string;
|
|
118
|
+
type: string;
|
|
119
|
+
identifier: string;
|
|
120
|
+
status: string;
|
|
121
|
+
lastSync: string | null;
|
|
122
|
+
memoriesIngested: number | null;
|
|
123
|
+
}>): string;
|
package/dist/format.js
ADDED
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ANSI formatting helpers and human-readable output formatters.
|
|
4
|
+
* No external dependencies — uses ANSI escape codes directly.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.white = exports.magenta = exports.cyan = exports.yellow = exports.red = exports.green = exports.bold = exports.dim = void 0;
|
|
8
|
+
exports.toonify = toonify;
|
|
9
|
+
exports.formatSearchResults = formatSearchResults;
|
|
10
|
+
exports.formatMemory = formatMemory;
|
|
11
|
+
exports.formatMemoryList = formatMemoryList;
|
|
12
|
+
exports.formatContact = formatContact;
|
|
13
|
+
exports.formatContactList = formatContactList;
|
|
14
|
+
exports.formatJob = formatJob;
|
|
15
|
+
exports.formatJobList = formatJobList;
|
|
16
|
+
exports.formatStats = formatStats;
|
|
17
|
+
exports.formatAccounts = formatAccounts;
|
|
18
|
+
exports.formatVersion = formatVersion;
|
|
19
|
+
exports.formatAgentAnswer = formatAgentAnswer;
|
|
20
|
+
exports.formatAgentContext = formatAgentContext;
|
|
21
|
+
exports.formatMemoryBanks = formatMemoryBanks;
|
|
22
|
+
exports.formatStatus = formatStatus;
|
|
23
|
+
const isColor = process.stdout.isTTY !== false && !process.env['NO_COLOR'];
|
|
24
|
+
const toon_1 = require("@toon-format/toon");
|
|
25
|
+
/**
|
|
26
|
+
* Convert data to TOON format for LLM-optimized output (--toon mode).
|
|
27
|
+
* Uses @toon-format/toon for 40-60% token savings.
|
|
28
|
+
* Pre-parses JSON-encoded strings so they're included as real objects.
|
|
29
|
+
*/
|
|
30
|
+
function toonify(data) {
|
|
31
|
+
const cleaned = parseJsonStringsDeep(data);
|
|
32
|
+
return (0, toon_1.encode)(cleaned);
|
|
33
|
+
}
|
|
34
|
+
function parseJsonStringsDeep(val) {
|
|
35
|
+
if (val == null)
|
|
36
|
+
return val;
|
|
37
|
+
if (typeof val === 'string') {
|
|
38
|
+
try {
|
|
39
|
+
const parsed = JSON.parse(val);
|
|
40
|
+
if (typeof parsed === 'object' && parsed !== null)
|
|
41
|
+
return parseJsonStringsDeep(parsed);
|
|
42
|
+
}
|
|
43
|
+
catch { /* not JSON */ }
|
|
44
|
+
return val;
|
|
45
|
+
}
|
|
46
|
+
if (Array.isArray(val))
|
|
47
|
+
return val.map(parseJsonStringsDeep);
|
|
48
|
+
if (typeof val === 'object') {
|
|
49
|
+
const out = {};
|
|
50
|
+
for (const [k, v] of Object.entries(val)) {
|
|
51
|
+
if (v != null)
|
|
52
|
+
out[k] = parseJsonStringsDeep(v);
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
return val;
|
|
57
|
+
}
|
|
58
|
+
const esc = (code) => (s) => (isColor ? `\x1b[${code}m${s}\x1b[0m` : s);
|
|
59
|
+
exports.dim = esc('2');
|
|
60
|
+
exports.bold = esc('1');
|
|
61
|
+
exports.green = esc('32');
|
|
62
|
+
exports.red = esc('31');
|
|
63
|
+
exports.yellow = esc('33');
|
|
64
|
+
exports.cyan = esc('36');
|
|
65
|
+
exports.magenta = esc('35');
|
|
66
|
+
exports.white = esc('37');
|
|
67
|
+
function timeAgo(iso) {
|
|
68
|
+
if (!iso)
|
|
69
|
+
return 'never';
|
|
70
|
+
const ms = Date.now() - new Date(iso).getTime();
|
|
71
|
+
if (ms < 0)
|
|
72
|
+
return 'just now';
|
|
73
|
+
const sec = Math.floor(ms / 1000);
|
|
74
|
+
if (sec < 60)
|
|
75
|
+
return `${sec}s ago`;
|
|
76
|
+
const min = Math.floor(sec / 60);
|
|
77
|
+
if (min < 60)
|
|
78
|
+
return `${min}m ago`;
|
|
79
|
+
const hr = Math.floor(min / 60);
|
|
80
|
+
if (hr < 24)
|
|
81
|
+
return `${hr}h ago`;
|
|
82
|
+
const days = Math.floor(hr / 24);
|
|
83
|
+
return `${days}d ago`;
|
|
84
|
+
}
|
|
85
|
+
function truncate(text, maxLen) {
|
|
86
|
+
const oneLine = text.replace(/\n/g, ' ').trim();
|
|
87
|
+
if (oneLine.length <= maxLen)
|
|
88
|
+
return oneLine;
|
|
89
|
+
return oneLine.slice(0, maxLen - 1) + '\u2026';
|
|
90
|
+
}
|
|
91
|
+
function statusDot(status) {
|
|
92
|
+
switch (status) {
|
|
93
|
+
case 'done':
|
|
94
|
+
case 'completed':
|
|
95
|
+
case 'active':
|
|
96
|
+
return (0, exports.green)('\u25cf');
|
|
97
|
+
case 'running':
|
|
98
|
+
return (0, exports.yellow)('\u25cf');
|
|
99
|
+
case 'failed':
|
|
100
|
+
return (0, exports.red)('\u25cf');
|
|
101
|
+
case 'queued':
|
|
102
|
+
case 'waiting':
|
|
103
|
+
return (0, exports.dim)('\u25cb');
|
|
104
|
+
default:
|
|
105
|
+
return (0, exports.dim)('\u25cb');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function progressBar(progress, total, width = 20) {
|
|
109
|
+
if (progress == null || total == null || total === 0)
|
|
110
|
+
return '';
|
|
111
|
+
const pct = Math.min(progress / total, 1);
|
|
112
|
+
const filled = Math.round(pct * width);
|
|
113
|
+
const empty = width - filled;
|
|
114
|
+
return ((0, exports.dim)('[') +
|
|
115
|
+
(0, exports.green)('\u2588'.repeat(filled)) +
|
|
116
|
+
(0, exports.dim)('\u2591'.repeat(empty)) +
|
|
117
|
+
(0, exports.dim)(']') +
|
|
118
|
+
` ${Math.round(pct * 100)}%`);
|
|
119
|
+
}
|
|
120
|
+
function commaNum(n) {
|
|
121
|
+
return n.toLocaleString('en-US');
|
|
122
|
+
}
|
|
123
|
+
// --- Public formatters ---
|
|
124
|
+
function formatSearchResults(results) {
|
|
125
|
+
if (!results.length)
|
|
126
|
+
return (0, exports.dim)('No results found.');
|
|
127
|
+
return results
|
|
128
|
+
.map((r, i) => {
|
|
129
|
+
const score = r.weights?.final ?? r.score ?? 0;
|
|
130
|
+
const header = `${(0, exports.bold)(`#${i + 1}`)} ${(0, exports.dim)(`(${score.toFixed(4)})`)} ${(0, exports.dim)(`[${r.sourceType}/${r.connectorType}]`)} ${(0, exports.dim)(timeAgo(r.eventTime))}`;
|
|
131
|
+
const body = ` ${truncate(r.text, 120)}`;
|
|
132
|
+
const id = ` ${(0, exports.dim)(r.id)}`;
|
|
133
|
+
return `${header}\n${body}\n${id}`;
|
|
134
|
+
})
|
|
135
|
+
.join('\n\n');
|
|
136
|
+
}
|
|
137
|
+
function formatMemory(m) {
|
|
138
|
+
const lines = [];
|
|
139
|
+
lines.push(`${(0, exports.bold)('Memory')} ${(0, exports.dim)(m.id)}`);
|
|
140
|
+
lines.push(`${(0, exports.dim)('Source:')} ${m.sourceType}/${m.connectorType}`);
|
|
141
|
+
lines.push(`${(0, exports.dim)('Time:')} ${m.eventTime} ${(0, exports.dim)(`(${timeAgo(m.eventTime)})`)}`);
|
|
142
|
+
if (m.importance != null)
|
|
143
|
+
lines.push(`${(0, exports.dim)('Import:')} ${m.importance}`);
|
|
144
|
+
if (m.factuality)
|
|
145
|
+
lines.push(`${(0, exports.dim)('Factual:')} ${m.factuality}`);
|
|
146
|
+
lines.push(`${(0, exports.dim)('Embed:')} ${m.embeddingStatus}`);
|
|
147
|
+
if (m.entities) {
|
|
148
|
+
try {
|
|
149
|
+
const ents = JSON.parse(m.entities);
|
|
150
|
+
if (Array.isArray(ents) && ents.length) {
|
|
151
|
+
lines.push(`${(0, exports.dim)('Entities:')} ${ents.map((e) => e.value || e.name || e.id || String(e)).join(', ')}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
/* non-JSON entities, skip */
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
lines.push('');
|
|
159
|
+
lines.push(m.text);
|
|
160
|
+
return lines.join('\n');
|
|
161
|
+
}
|
|
162
|
+
function formatMemoryList(items, total) {
|
|
163
|
+
if (!items.length)
|
|
164
|
+
return (0, exports.dim)('No memories found.');
|
|
165
|
+
const lines = items.map((m) => {
|
|
166
|
+
return `${(0, exports.dim)(timeAgo(m.eventTime).padEnd(8))} ${(0, exports.dim)(`[${m.sourceType}/${m.connectorType}]`.padEnd(20))} ${truncate(m.text, 80)} ${(0, exports.dim)(m.id)}`;
|
|
167
|
+
});
|
|
168
|
+
lines.push('');
|
|
169
|
+
lines.push((0, exports.dim)(`Showing ${items.length} of ${commaNum(total)}`));
|
|
170
|
+
return lines.join('\n');
|
|
171
|
+
}
|
|
172
|
+
function formatContact(c) {
|
|
173
|
+
const lines = [];
|
|
174
|
+
lines.push(`${(0, exports.bold)(c.displayName)} ${(0, exports.dim)(c.id)}`);
|
|
175
|
+
for (const ident of c.identifiers) {
|
|
176
|
+
lines.push(` ${(0, exports.dim)(ident.identifierType.padEnd(10))} ${ident.identifierValue}`);
|
|
177
|
+
}
|
|
178
|
+
if (c.memoryCount != null)
|
|
179
|
+
lines.push(` ${(0, exports.dim)('memories')} ${c.memoryCount}`);
|
|
180
|
+
return lines.join('\n');
|
|
181
|
+
}
|
|
182
|
+
function formatContactList(items, total) {
|
|
183
|
+
if (!items.length)
|
|
184
|
+
return (0, exports.dim)('No contacts found.');
|
|
185
|
+
const lines = items.map((c) => {
|
|
186
|
+
const idents = c.identifiers
|
|
187
|
+
.slice(0, 3)
|
|
188
|
+
.map((i) => i.identifierValue)
|
|
189
|
+
.join(', ');
|
|
190
|
+
return `${(0, exports.bold)(c.displayName.padEnd(25))} ${(0, exports.dim)(idents)} ${(0, exports.dim)(c.id)}`;
|
|
191
|
+
});
|
|
192
|
+
lines.push('');
|
|
193
|
+
lines.push((0, exports.dim)(`Showing ${items.length} of ${commaNum(total)}`));
|
|
194
|
+
return lines.join('\n');
|
|
195
|
+
}
|
|
196
|
+
function formatJob(j) {
|
|
197
|
+
const parts = [
|
|
198
|
+
statusDot(j.status),
|
|
199
|
+
j.status.padEnd(8),
|
|
200
|
+
j.connector.padEnd(12),
|
|
201
|
+
(j.accountIdentifier || '').padEnd(25),
|
|
202
|
+
];
|
|
203
|
+
if (j.status === 'running') {
|
|
204
|
+
parts.push(progressBar(j.progress, j.total));
|
|
205
|
+
}
|
|
206
|
+
else if (j.completedAt) {
|
|
207
|
+
parts.push((0, exports.dim)(timeAgo(j.completedAt)));
|
|
208
|
+
}
|
|
209
|
+
else if (j.startedAt) {
|
|
210
|
+
parts.push((0, exports.dim)(timeAgo(j.startedAt)));
|
|
211
|
+
}
|
|
212
|
+
if (j.error) {
|
|
213
|
+
parts.push((0, exports.red)(truncate(j.error, 40)));
|
|
214
|
+
}
|
|
215
|
+
return parts.join(' ');
|
|
216
|
+
}
|
|
217
|
+
function formatJobList(jobs) {
|
|
218
|
+
if (!jobs.length)
|
|
219
|
+
return (0, exports.dim)('No jobs found.');
|
|
220
|
+
return jobs.map(formatJob).join('\n');
|
|
221
|
+
}
|
|
222
|
+
function formatStats(stats) {
|
|
223
|
+
const lines = [];
|
|
224
|
+
lines.push(`${(0, exports.bold)('Total:')} ${commaNum(stats.total)}`);
|
|
225
|
+
lines.push('');
|
|
226
|
+
lines.push((0, exports.bold)('By Source:'));
|
|
227
|
+
for (const [k, v] of Object.entries(stats.bySource)) {
|
|
228
|
+
lines.push(` ${k.padEnd(15)} ${commaNum(v)}`);
|
|
229
|
+
}
|
|
230
|
+
lines.push('');
|
|
231
|
+
lines.push((0, exports.bold)('By Connector:'));
|
|
232
|
+
for (const [k, v] of Object.entries(stats.byConnector)) {
|
|
233
|
+
lines.push(` ${k.padEnd(15)} ${commaNum(v)}`);
|
|
234
|
+
}
|
|
235
|
+
lines.push('');
|
|
236
|
+
lines.push((0, exports.bold)('By Factuality:'));
|
|
237
|
+
for (const [k, v] of Object.entries(stats.byFactuality)) {
|
|
238
|
+
lines.push(` ${k.padEnd(15)} ${commaNum(v)}`);
|
|
239
|
+
}
|
|
240
|
+
return lines.join('\n');
|
|
241
|
+
}
|
|
242
|
+
function formatAccounts(accounts) {
|
|
243
|
+
if (!accounts.length)
|
|
244
|
+
return (0, exports.dim)('No connected accounts.');
|
|
245
|
+
return accounts
|
|
246
|
+
.map((a) => {
|
|
247
|
+
return `${statusDot(a.status)} ${a.type.padEnd(12)} ${a.identifier.padEnd(30)} ${(0, exports.dim)('synced ' + timeAgo(a.lastSync))} ${commaNum(a.memoriesIngested ?? 0)} memories ${(0, exports.dim)(a.id)}`;
|
|
248
|
+
})
|
|
249
|
+
.join('\n');
|
|
250
|
+
}
|
|
251
|
+
function formatVersion(v) {
|
|
252
|
+
const secs = v.uptime;
|
|
253
|
+
const days = Math.floor(secs / 86400);
|
|
254
|
+
const hrs = Math.floor((secs % 86400) / 3600);
|
|
255
|
+
const mins = Math.floor((secs % 3600) / 60);
|
|
256
|
+
const parts = [];
|
|
257
|
+
if (days)
|
|
258
|
+
parts.push(`${days}d`);
|
|
259
|
+
if (hrs)
|
|
260
|
+
parts.push(`${hrs}h`);
|
|
261
|
+
parts.push(`${mins}m`);
|
|
262
|
+
const uptimeStr = parts.join(' ');
|
|
263
|
+
const lines = [];
|
|
264
|
+
lines.push(`${(0, exports.bold)('Botmem API')}`);
|
|
265
|
+
lines.push(`${(0, exports.dim)('Build:')} ${v.buildTime}`);
|
|
266
|
+
lines.push(`${(0, exports.dim)('Hash:')} ${v.gitHash}`);
|
|
267
|
+
lines.push(`${(0, exports.dim)('Uptime:')} ${uptimeStr}`);
|
|
268
|
+
return lines.join('\n');
|
|
269
|
+
}
|
|
270
|
+
function formatAgentAnswer(data) {
|
|
271
|
+
const lines = [];
|
|
272
|
+
// Show temporal fallback notice
|
|
273
|
+
if (data.parsed?.temporalFallback && data.parsed?.temporal) {
|
|
274
|
+
const from = new Date(data.parsed.temporal.from).toLocaleString();
|
|
275
|
+
const to = new Date(data.parsed.temporal.to).toLocaleString();
|
|
276
|
+
lines.push((0, exports.dim)(`No memories found between ${from} and ${to}.`));
|
|
277
|
+
lines.push((0, exports.dim)('Showing general results instead:'));
|
|
278
|
+
lines.push('');
|
|
279
|
+
}
|
|
280
|
+
if (data.answer) {
|
|
281
|
+
lines.push((0, exports.bold)('Answer'));
|
|
282
|
+
lines.push(data.answer);
|
|
283
|
+
lines.push('');
|
|
284
|
+
}
|
|
285
|
+
if (data.summary) {
|
|
286
|
+
lines.push((0, exports.bold)('Summary'));
|
|
287
|
+
lines.push(data.summary);
|
|
288
|
+
lines.push('');
|
|
289
|
+
}
|
|
290
|
+
const results = data.results || data.memories || [];
|
|
291
|
+
if (results.length) {
|
|
292
|
+
lines.push((0, exports.dim)(`Sources (${results.length}):`));
|
|
293
|
+
for (const r of results.slice(0, 10)) {
|
|
294
|
+
lines.push(` ${(0, exports.dim)(`[${r.sourceType}/${r.connectorType}]`)} ${truncate(r.text, 100)} ${(0, exports.dim)(timeAgo(r.eventTime))}`);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (!lines.length)
|
|
298
|
+
return (0, exports.dim)('No results.');
|
|
299
|
+
return lines.join('\n');
|
|
300
|
+
}
|
|
301
|
+
function formatAgentContext(data) {
|
|
302
|
+
const lines = [];
|
|
303
|
+
if (data.contact) {
|
|
304
|
+
lines.push((0, exports.bold)(data.contact.displayName || 'Unknown'));
|
|
305
|
+
if (data.contact.identifiers?.length) {
|
|
306
|
+
for (const id of data.contact.identifiers) {
|
|
307
|
+
lines.push(` ${(0, exports.dim)(id.identifierType.padEnd(10))} ${id.identifierValue}`);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (data.stats) {
|
|
312
|
+
lines.push('');
|
|
313
|
+
lines.push((0, exports.dim)('Stats:'));
|
|
314
|
+
for (const [k, v] of Object.entries(data.stats)) {
|
|
315
|
+
lines.push(` ${(0, exports.dim)(k.padEnd(15))} ${v}`);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (data.recentMemories?.length) {
|
|
319
|
+
lines.push('');
|
|
320
|
+
lines.push((0, exports.dim)(`Recent memories (${data.recentMemories.length}):`));
|
|
321
|
+
for (const m of data.recentMemories.slice(0, 10)) {
|
|
322
|
+
lines.push(` ${(0, exports.dim)(timeAgo(m.eventTime).padEnd(8))} ${truncate(m.text, 90)}`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (!lines.length)
|
|
326
|
+
return (0, exports.dim)('No context found.');
|
|
327
|
+
return lines.join('\n');
|
|
328
|
+
}
|
|
329
|
+
function formatMemoryBanks(banks) {
|
|
330
|
+
if (!banks.length)
|
|
331
|
+
return (0, exports.dim)('No memory banks.');
|
|
332
|
+
const lines = banks.map((b) => {
|
|
333
|
+
return `${(0, exports.bold)(b.name.padEnd(25))} ${(0, exports.dim)(String(b.memoryCount ?? 0).padStart(5) + ' memories')} ${(0, exports.dim)(b.id)}`;
|
|
334
|
+
});
|
|
335
|
+
lines.push('');
|
|
336
|
+
lines.push((0, exports.dim)(`${banks.length} bank(s)`));
|
|
337
|
+
return lines.join('\n');
|
|
338
|
+
}
|
|
339
|
+
function formatStatus(stats, queues, accounts) {
|
|
340
|
+
const lines = [];
|
|
341
|
+
lines.push((0, exports.bold)('BOTMEM STATUS'));
|
|
342
|
+
lines.push((0, exports.dim)('\u2500'.repeat(40)));
|
|
343
|
+
const srcBreakdown = Object.entries(stats.bySource)
|
|
344
|
+
.map(([k, v]) => `${k}: ${commaNum(v)}`)
|
|
345
|
+
.join(', ');
|
|
346
|
+
lines.push(`${(0, exports.dim)('Memories:')} ${commaNum(stats.total)} ${(0, exports.dim)(`(${srcBreakdown})`)}`);
|
|
347
|
+
let totalActive = 0, totalWaiting = 0, totalFailed = 0;
|
|
348
|
+
for (const q of Object.values(queues)) {
|
|
349
|
+
totalActive += q.active;
|
|
350
|
+
totalWaiting += q.waiting;
|
|
351
|
+
totalFailed += q.failed;
|
|
352
|
+
}
|
|
353
|
+
lines.push(`${(0, exports.dim)('Pending:')} ${totalActive + totalWaiting} ${(0, exports.dim)(`(${totalActive} active, ${totalWaiting} waiting)`)}`);
|
|
354
|
+
lines.push(`${(0, exports.dim)('Failed:')} ${totalFailed}`);
|
|
355
|
+
if (accounts.length) {
|
|
356
|
+
lines.push('');
|
|
357
|
+
lines.push((0, exports.dim)('Connectors:'));
|
|
358
|
+
for (const a of accounts) {
|
|
359
|
+
lines.push(` ${statusDot(a.status)} ${a.type.padEnd(12)} ${a.identifier.padEnd(25)} ${(0, exports.dim)('synced ' + timeAgo(a.lastSync))} ${commaNum(a.memoriesIngested ?? 0)} memories`);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return lines.join('\n');
|
|
363
|
+
}
|
|
364
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,0BAGC;AA2FD,kDAqBC;AAED,oCAiCC;AAED,4CAiBC;AAED,sCAaC;AAED,8CAmBC;AAED,8BA4BC;AAED,sCAeC;AAED,kCAwBC;AAED,wCAgBC;AAED,sCAiBC;AAED,8CA+BC;AAED,gDA0BC;AAED,8CAQC;AAED,oCA6CC;AA1bD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAE3E,4CAA2C;AAE3C;;;;GAIG;AACH,SAAgB,OAAO,CAAC,IAAa;IACnC,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,IAAA,aAAM,EAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAY;IACxC,IAAI,GAAG,IAAI,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AAY,YAAY,WAAW,CAAC,EAAE,CACjH,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,GAAG,IAAA,WAAG,EAAC,SAAS,CAAC,OAAO,WAAW,EAAE,CAAC,CAAC;IAElD,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,IAAA,WAAG,EAAC,aAAa,CAAC,CAAC,CAAC;QAC/B,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CACR,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,IAAA,WAAG,EAAC,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,WAAW,CAClK,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@botmem/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for Botmem — query and manage your personal memory system",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/botmem/open-core.git",
|
|
9
|
+
"directory": "packages/cli"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/botmem/open-core/tree/main/packages/cli",
|
|
12
|
+
"keywords": ["botmem", "memory", "rag", "cli", "personal-knowledge"],
|
|
13
|
+
"bin": {
|
|
14
|
+
"botmem": "dist/cli.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"prepublishOnly": "tsc",
|
|
22
|
+
"lint": "eslint src",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:coverage": "vitest run --coverage"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.0.0",
|
|
32
|
+
"typescript": "catalog:"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@toon-format/toon": "^2.1.0"
|
|
36
|
+
}
|
|
37
|
+
}
|