lorewiki 0.2.7__tar.gz → 0.2.8__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.
Files changed (42) hide show
  1. {lorewiki-0.2.7 → lorewiki-0.2.8}/PKG-INFO +1 -1
  2. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/__init__.py +1 -1
  3. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/cli/apps.py +23 -7
  4. {lorewiki-0.2.7 → lorewiki-0.2.8}/pyproject.toml +1 -1
  5. {lorewiki-0.2.7 → lorewiki-0.2.8}/.gitignore +0 -0
  6. {lorewiki-0.2.7 → lorewiki-0.2.8}/LICENSE +0 -0
  7. {lorewiki-0.2.7 → lorewiki-0.2.8}/README.md +0 -0
  8. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/__main__.py +0 -0
  9. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/cli/__init__.py +0 -0
  10. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/cli/add.py +0 -0
  11. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/cli/commands.py +0 -0
  12. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/cli/config_cmds.py +0 -0
  13. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/cli/helpers.py +0 -0
  14. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/cli/install_cmd.py +0 -0
  15. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/cli/topic_cmds.py +0 -0
  16. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/config.py +0 -0
  17. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/data/skill_template/SKILL.md +0 -0
  18. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/db/__init__.py +0 -0
  19. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/db/connection.py +0 -0
  20. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/db/models.py +0 -0
  21. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/db/schema.sql +0 -0
  22. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/indexer/__init__.py +0 -0
  23. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/indexer/chunker.py +0 -0
  24. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/indexer/cleaning.py +0 -0
  25. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/indexer/indexer.py +0 -0
  26. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/indexer/parser.py +0 -0
  27. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/llm/__init__.py +0 -0
  28. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/llm/client.py +0 -0
  29. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/llm/generator.py +0 -0
  30. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/py.typed +0 -0
  31. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/retriever/__init__.py +0 -0
  32. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/retriever/base.py +0 -0
  33. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/retriever/bm25.py +0 -0
  34. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/retriever/fusion.py +0 -0
  35. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/retriever/hierarchy.py +0 -0
  36. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/retriever/search.py +0 -0
  37. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/retriever/vector.py +0 -0
  38. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/topic.py +0 -0
  39. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/utils/__init__.py +0 -0
  40. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/utils/logger.py +0 -0
  41. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/utils/skill_installer.py +0 -0
  42. {lorewiki-0.2.7 → lorewiki-0.2.8}/lorewiki/utils/topic_shared.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lorewiki
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Local-first knowledge base for LLM-assisted coding, with hybrid retrieval (BM25 + hierarchy + optional vector) over SQLite FTS5.
5
5
  Project-URL: Documentation, https://github.com/JochenYang/Lore-wiki
6
6
  Project-URL: Source, https://github.com/JochenYang/Lore-wiki
@@ -1,4 +1,4 @@
1
1
  """LoreWiki - Local-first knowledge base for LLM-assisted coding."""
2
2
 
3
- __version__ = "0.2.7"
3
+ __version__ = "0.2.8"
4
4
  __all__ = ["__version__"]
@@ -25,15 +25,31 @@ log = get_logger(__name__)
25
25
 
26
26
 
27
27
  def _force_utf8_streams() -> None:
28
- """Force UTF-8 on stdout/stderr at import time.
28
+ """Force UTF-8 on stdin/stdout/stderr at import time.
29
29
 
30
- Without this, ``--raw`` JSON containing CJK characters becomes
31
- mojibake on Windows shells whose default code page is GBK
32
- (cp936). Python 3.7+ exposes ``TextIOWrapper.reconfigure``; we
33
- guard with ``hasattr`` so that non-standard stdouts captured by
34
- tests don't crash the CLI.
30
+ Windows Python 3.6+ sets the default encoding for a redirected
31
+ (piped) stdin to the console code page historically cp936
32
+ (GBK) in zh_CN locales, cp1252 in en_US. If we left it alone,
33
+ a command like::
34
+
35
+ PS> echo "幂等设计" | lorewiki add --title "X" --module m
36
+
37
+ would feed GBK-encoded bytes into the child Python's stdin,
38
+ which would then re-encode them as UTF-8 and write mojibake
39
+ into the resulting Markdown file (the ``骞傜瓑璁捐…``
40
+ rot observed in early 0.2.7 smoke tests). We reconfigure all
41
+ three streams to UTF-8 with errors='replace' so the bytes the
42
+ child sees are the bytes the parent intended.
43
+
44
+ stdout/stderr are also reconfigured — without this, ``--raw``
45
+ JSON dumps containing CJK would mojibake on a cp936 terminal.
46
+ The change is a no-op on POSIX (utf-8 is already the default).
47
+
48
+ Python 3.7+ exposes ``TextIOWrapper.reconfigure``; we guard
49
+ with ``hasattr`` so non-standard streams captured by tests
50
+ don't crash the import.
35
51
  """
36
- for stream in (sys.stdout, sys.stderr):
52
+ for stream in (sys.stdin, sys.stdout, sys.stderr):
37
53
  if hasattr(stream, "reconfigure"):
38
54
  with contextlib.suppress(OSError, ValueError):
39
55
  stream.reconfigure(encoding="utf-8", errors="replace") # type: ignore[attr-defined]
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "lorewiki"
7
- version = "0.2.7"
7
+ version = "0.2.8"
8
8
  description = "Local-first knowledge base for LLM-assisted coding, with hybrid retrieval (BM25 + hierarchy + optional vector) over SQLite FTS5."
9
9
  readme = "README.md"
10
10
  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
File without changes
File without changes