@todoforai/tfa-memory 0.3.0 → 0.4.1
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.js +15 -15
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -462,8 +462,8 @@ function checkForUpdates(pkg) {
|
|
|
462
462
|
// package.json
|
|
463
463
|
var package_default = {
|
|
464
464
|
name: "@todoforai/tfa-memory",
|
|
465
|
-
version: "0.
|
|
466
|
-
description: "Zero-config TODOforAI memory CLI — add/search/ls/get/rm text memory rows addressed as source/ref, plus federated search over
|
|
465
|
+
version: "0.4.1",
|
|
466
|
+
description: "Zero-config TODOforAI memory CLI — add/search/ls/get/rm text memory rows addressed as source/ref, plus federated search over every message of every past TODO (read-only `todo` source), with full-text and semantic search. Reuses bridge credentials.",
|
|
467
467
|
type: "module",
|
|
468
468
|
bin: {
|
|
469
469
|
"tfa-memory": "dist/cli.js"
|
|
@@ -499,10 +499,10 @@ Every row's address is \`source/ref\` — sources are directories, refs are
|
|
|
499
499
|
filenames. A source exists once the first row names it. Re-adding the same
|
|
500
500
|
address updates in place; identical content+meta is skipped (no re-embed).
|
|
501
501
|
|
|
502
|
-
\`search\` covers two corpora at once: rows you saved, plus
|
|
503
|
-
|
|
504
|
-
live from the backend index, nothing separate to sync). \`--source
|
|
505
|
-
|
|
502
|
+
\`search\` covers two corpora at once: rows you saved, plus every message of
|
|
503
|
+
every TODO under the read-only \`todo\` source (\`todo/<todoId>:<messageId>\`,
|
|
504
|
+
live from the backend index, nothing separate to sync). \`--source todo\` searches
|
|
505
|
+
past TODO messages only; \`get todo/<todoId>:<messageId>\` prints the whole message.
|
|
506
506
|
|
|
507
507
|
Usage:
|
|
508
508
|
tfa-memory <command> [options] [args...]
|
|
@@ -510,8 +510,8 @@ Usage:
|
|
|
510
510
|
Commands:
|
|
511
511
|
add [source/ref] <text|-> Save a row. Without an address → manual/<timestamp>.
|
|
512
512
|
"-" reads stdin.
|
|
513
|
-
search <query> Full-text search over saved rows +
|
|
514
|
-
ls List saved rows, newest first (
|
|
513
|
+
search <query> Full-text search over saved rows + past TODO messages
|
|
514
|
+
ls List saved rows, newest first (todo messages excluded)
|
|
515
515
|
get <source/ref> Print full content of one row
|
|
516
516
|
rm <source/ref> Delete one row
|
|
517
517
|
rm --source <name> Delete every row in a source
|
|
@@ -520,8 +520,8 @@ Commands:
|
|
|
520
520
|
whoami Print resolved auth context
|
|
521
521
|
|
|
522
522
|
Options:
|
|
523
|
-
-s, --source <a,b> Restrict search/ls to sources (comma-separated; "
|
|
524
|
-
--todo <id> Restrict a
|
|
523
|
+
-s, --source <a,b> Restrict search/ls to sources (comma-separated; "todo" = TODO messages)
|
|
524
|
+
--todo <id> Restrict a todo-message search to one TODO
|
|
525
525
|
--semantic Embedding KNN search (meaning, not keywords)
|
|
526
526
|
--meta <json> Attach JSON metadata to the row (e.g. '{"todoId":"..."}')
|
|
527
527
|
-n, --limit <n> Max rows (default 5, max 50)
|
|
@@ -538,8 +538,8 @@ Examples:
|
|
|
538
538
|
cat docs/auth.md | tfa-memory add acme/docs/auth.md -
|
|
539
539
|
tfa-memory search "rollback procedure"
|
|
540
540
|
tfa-memory search "how do we deploy" --semantic
|
|
541
|
-
tfa-memory search "android build" --source
|
|
542
|
-
tfa-memory get
|
|
541
|
+
tfa-memory search "android build" --source todo
|
|
542
|
+
tfa-memory get todo/<todoId>:<messageId>
|
|
543
543
|
tfa-memory ls --source deploy-notes
|
|
544
544
|
tfa-memory get deploy-notes/rollback
|
|
545
545
|
tfa-memory rm deploy-notes/rollback
|
|
@@ -589,9 +589,9 @@ async function api(ctx, method, path2, body) {
|
|
|
589
589
|
}
|
|
590
590
|
return res.status === 204 ? null : await res.json();
|
|
591
591
|
}
|
|
592
|
-
function printRows(rows, json, snippet =
|
|
592
|
+
function printRows(rows, json, snippet = 200) {
|
|
593
593
|
if (json)
|
|
594
|
-
return console.log(JSON.stringify(rows, null, 2));
|
|
594
|
+
return console.log(JSON.stringify(rows.map(({ source: _s, ref: _r, ...row }) => row), null, process.stdout.isTTY ? 2 : 0));
|
|
595
595
|
if (!rows.length)
|
|
596
596
|
return console.log("(no results)");
|
|
597
597
|
for (const r of rows) {
|
|
@@ -695,7 +695,7 @@ async function main() {
|
|
|
695
695
|
const res = await api(ctx, "GET", `/memory/search${qs({ query, semantic: values.semantic ? true : undefined, sources, limit, todoId: values.todo })}`);
|
|
696
696
|
for (const w of res.warnings ?? [])
|
|
697
697
|
console.error(`Warning: ${w}`);
|
|
698
|
-
printRows(res.rows, json
|
|
698
|
+
printRows(res.rows, json);
|
|
699
699
|
break;
|
|
700
700
|
}
|
|
701
701
|
case "ls": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@todoforai/tfa-memory",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Zero-config TODOforAI memory CLI
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "Zero-config TODOforAI memory CLI — add/search/ls/get/rm text memory rows addressed as source/ref, plus federated search over every message of every past TODO (read-only `todo` source), with full-text and semantic search. Reuses bridge credentials.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"tfa-memory": "dist/cli.js"
|