superb-memory 0.2.2__tar.gz → 0.2.4__tar.gz
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.
- {superb_memory-0.2.2 → superb_memory-0.2.4}/PKG-INFO +1 -1
- {superb_memory-0.2.2 → superb_memory-0.2.4}/cli.py +20 -8
- {superb_memory-0.2.2 → superb_memory-0.2.4}/memorydb_mcp.py +1 -1
- {superb_memory-0.2.2 → superb_memory-0.2.4}/pyproject.toml +1 -1
- {superb_memory-0.2.2 → superb_memory-0.2.4}/superb_memory.egg-info/PKG-INFO +1 -1
- {superb_memory-0.2.2 → superb_memory-0.2.4}/README.md +0 -0
- {superb_memory-0.2.2 → superb_memory-0.2.4}/memorydb.py +0 -0
- {superb_memory-0.2.2 → superb_memory-0.2.4}/setup.cfg +0 -0
- {superb_memory-0.2.2 → superb_memory-0.2.4}/superb_memory.egg-info/SOURCES.txt +0 -0
- {superb_memory-0.2.2 → superb_memory-0.2.4}/superb_memory.egg-info/dependency_links.txt +0 -0
- {superb_memory-0.2.2 → superb_memory-0.2.4}/superb_memory.egg-info/entry_points.txt +0 -0
- {superb_memory-0.2.2 → superb_memory-0.2.4}/superb_memory.egg-info/top_level.txt +0 -0
|
@@ -24,7 +24,7 @@ from urllib.parse import urlparse
|
|
|
24
24
|
sys.path.insert(0, str(os.path.dirname(os.path.abspath(__file__))))
|
|
25
25
|
from memorydb import MemoryDB, MemoryDBError # noqa: E402
|
|
26
26
|
|
|
27
|
-
SERVER_VERSION = "0.2.
|
|
27
|
+
SERVER_VERSION = "0.2.4" # the release tag mdb serve downloads by default
|
|
28
28
|
REPO = "humaniods/MemoryDB"
|
|
29
29
|
|
|
30
30
|
|
|
@@ -38,10 +38,22 @@ def load_db(args):
|
|
|
38
38
|
return MemoryDB(url, token=token)
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def
|
|
42
|
-
|
|
41
|
+
def read_json_file(path):
|
|
42
|
+
"""Read a JSON input file named on the command line.
|
|
43
|
+
|
|
44
|
+
Paths in these commands come from README and docs, so a wrong one has to name the
|
|
45
|
+
file instead of raising a traceback from wherever argparse happened to call us.
|
|
46
|
+
"""
|
|
47
|
+
try:
|
|
43
48
|
with open(path) as fh:
|
|
44
49
|
return json.load(fh)
|
|
50
|
+
except OSError as exc:
|
|
51
|
+
sys.exit(f"mdb: cannot read {path}: {exc.strerror or exc}")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def read_json_arg(value, path):
|
|
55
|
+
if path:
|
|
56
|
+
return read_json_file(path)
|
|
45
57
|
if value:
|
|
46
58
|
return json.loads(value)
|
|
47
59
|
sys.exit("provide --json or --file")
|
|
@@ -337,12 +349,12 @@ def main(argv=None):
|
|
|
337
349
|
elif args.cmd == "search":
|
|
338
350
|
emit(db.objects.search(args.text, kind=args.kind, limit=args.limit))
|
|
339
351
|
elif args.cmd == "ingest":
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
352
|
+
payload = read_json_file(args.file)
|
|
353
|
+
emit(db.ingest(payload["messages"], facts=payload.get("facts"),
|
|
354
|
+
source=payload.get("source", "cli"),
|
|
355
|
+
context=payload.get("context", "")))
|
|
343
356
|
elif args.cmd == "tx":
|
|
344
|
-
|
|
345
|
-
payload = json.load(fh)
|
|
357
|
+
payload = read_json_file(args.file)
|
|
346
358
|
emit(db.transaction(payload["changes"], idempotency_key=args.key))
|
|
347
359
|
elif args.cmd == "sync":
|
|
348
360
|
rows = read_json_arg(args.json, args.file)
|
|
@@ -17,7 +17,7 @@ sys.path.insert(0, str(__import__("pathlib").Path(__file__).resolve().parent))
|
|
|
17
17
|
from memorydb import MemoryDB # noqa: E402
|
|
18
18
|
|
|
19
19
|
PROTOCOL_VERSION = "2024-11-05"
|
|
20
|
-
SERVER_INFO = {"name": "memorydb", "version": "0.2.
|
|
20
|
+
SERVER_INFO = {"name": "memorydb", "version": "0.2.4"}
|
|
21
21
|
|
|
22
22
|
TOOL_DEFS = [
|
|
23
23
|
{"name": "memorydb_health", "description": "Server status, identity and transaction sequence.",
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools>=77"]
|
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
[project]
|
|
5
5
|
name = "superb-memory"
|
|
6
|
-
version = "0.2.
|
|
6
|
+
version = "0.2.4"
|
|
7
7
|
description = "Python client, mdb CLI and MCP server for the MemoryDB Go document and agent memory database"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
requires-python = ">=3.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|