truenex-memory 0.2.0__py3-none-any.whl
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.
- truenex_memory/__init__.py +3 -0
- truenex_memory/adapters/__init__.py +68 -0
- truenex_memory/adapters/__main__.py +29 -0
- truenex_memory/adapters/agents_md.py +17 -0
- truenex_memory/adapters/claude_md.py +17 -0
- truenex_memory/cli/__init__.py +0 -0
- truenex_memory/cli/git_commands.py +851 -0
- truenex_memory/cli/license_commands.py +207 -0
- truenex_memory/cli/main.py +1671 -0
- truenex_memory/cli/orchestrate_commands.py +103 -0
- truenex_memory/cli/protection.py +58 -0
- truenex_memory/cli/task_commands.py +155 -0
- truenex_memory/core/__init__.py +13 -0
- truenex_memory/core/chat_engine.py +354 -0
- truenex_memory/core/chunker.py +94 -0
- truenex_memory/core/config.py +75 -0
- truenex_memory/core/embedder.py +156 -0
- truenex_memory/core/exclusions.py +149 -0
- truenex_memory/core/indexer.py +72 -0
- truenex_memory/core/llm_client.py +287 -0
- truenex_memory/core/memory_service.py +120 -0
- truenex_memory/core/migration.py +202 -0
- truenex_memory/diagnostics/__init__.py +72 -0
- truenex_memory/diagnostics/__main__.py +29 -0
- truenex_memory/diagnostics/doctor.py +40 -0
- truenex_memory/discovery/__init__.py +37 -0
- truenex_memory/discovery/agent_discovery.py +1013 -0
- truenex_memory/discovery/source_catalog.py +289 -0
- truenex_memory/export/__init__.py +80 -0
- truenex_memory/export/__main__.py +40 -0
- truenex_memory/export/exporter.py +18 -0
- truenex_memory/export/fingerprint.py +57 -0
- truenex_memory/export/importer.py +19 -0
- truenex_memory/git_bridge.py +7 -0
- truenex_memory/ingestion/__init__.py +66 -0
- truenex_memory/ingestion/engine.py +203 -0
- truenex_memory/ingestion/global_auto_lifecycle.py +540 -0
- truenex_memory/ingestion/global_auto_memory.py +409 -0
- truenex_memory/ingestion/global_auto_review.py +278 -0
- truenex_memory/ingestion/global_auto_status.py +433 -0
- truenex_memory/ingestion/global_context.py +748 -0
- truenex_memory/ingestion/global_refresh.py +1385 -0
- truenex_memory/ingestion/global_search.py +340 -0
- truenex_memory/ingestion/global_source_health.py +378 -0
- truenex_memory/ingestion/global_status.py +365 -0
- truenex_memory/ingestion/manifest.py +131 -0
- truenex_memory/ingestion/parsers/__init__.py +36 -0
- truenex_memory/ingestion/parsers/jsonl_sessions.py +436 -0
- truenex_memory/ingestion/parsers/text_docs.py +97 -0
- truenex_memory/licensing.py +217 -0
- truenex_memory/mcp/__init__.py +67 -0
- truenex_memory/mcp/__main__.py +36 -0
- truenex_memory/mcp/server.py +419 -0
- truenex_memory/mcp/tools.py +131 -0
- truenex_memory/orchestration/__init__.py +19 -0
- truenex_memory/orchestration/recursive_loop.py +237 -0
- truenex_memory/release/__init__.py +15 -0
- truenex_memory/release/manifest.py +87 -0
- truenex_memory/release/update_check.py +107 -0
- truenex_memory/release/version.py +35 -0
- truenex_memory/retrieval/__init__.py +21 -0
- truenex_memory/retrieval/result.py +26 -0
- truenex_memory/retrieval/scoring.py +79 -0
- truenex_memory/retrieval/semantic.py +91 -0
- truenex_memory/serve.py +414 -0
- truenex_memory/store/__init__.py +29 -0
- truenex_memory/store/models.py +60 -0
- truenex_memory/store/qdrant_store.py +247 -0
- truenex_memory/store/repository.py +828 -0
- truenex_memory/store/source_ledger.py +199 -0
- truenex_memory/store/sqlite.py +285 -0
- truenex_memory/store/task_store.py +213 -0
- truenex_memory-0.2.0.dist-info/METADATA +344 -0
- truenex_memory-0.2.0.dist-info/RECORD +77 -0
- truenex_memory-0.2.0.dist-info/WHEEL +4 -0
- truenex_memory-0.2.0.dist-info/entry_points.txt +2 -0
- truenex_memory-0.2.0.dist-info/licenses/LICENSE +176 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Agent instruction file generators."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
AGENTS_FILENAME = "AGENTS.md"
|
|
8
|
+
CLAUDE_FILENAME = "CLAUDE.md"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def render_agents_md(project_name: str = "Truenex Memory") -> str:
|
|
12
|
+
"""Render an AGENTS.md file for local coding agents."""
|
|
13
|
+
|
|
14
|
+
return f"""# {project_name} Agent Notes
|
|
15
|
+
|
|
16
|
+
- Keep memory data local by default.
|
|
17
|
+
- Do not require cloud services for diagnostics, import, export, or local tools.
|
|
18
|
+
- Prefer small, testable changes and avoid unrelated rewrites.
|
|
19
|
+
- Run focused tests for touched surfaces before handing work back.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def render_claude_md(project_name: str = "Truenex Memory") -> str:
|
|
24
|
+
"""Render a CLAUDE.md file for Claude-style coding agents."""
|
|
25
|
+
|
|
26
|
+
return f"""# {project_name}
|
|
27
|
+
|
|
28
|
+
Use this repository as a local-first memory layer for coding agents.
|
|
29
|
+
|
|
30
|
+
## Working Rules
|
|
31
|
+
|
|
32
|
+
- Keep generated memory artifacts in local files unless the user asks otherwise.
|
|
33
|
+
- Treat MCP tools as local callable helpers during development.
|
|
34
|
+
- Do not assume production cloud, licensing, or UI services are available.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def write_agent_docs(
|
|
39
|
+
directory: str | Path,
|
|
40
|
+
*,
|
|
41
|
+
project_name: str = "Truenex Memory",
|
|
42
|
+
overwrite: bool = False,
|
|
43
|
+
) -> dict[str, Path]:
|
|
44
|
+
"""Write AGENTS.md and CLAUDE.md files into a directory."""
|
|
45
|
+
|
|
46
|
+
target = Path(directory)
|
|
47
|
+
target.mkdir(parents=True, exist_ok=True)
|
|
48
|
+
files = {
|
|
49
|
+
AGENTS_FILENAME: render_agents_md(project_name),
|
|
50
|
+
CLAUDE_FILENAME: render_claude_md(project_name),
|
|
51
|
+
}
|
|
52
|
+
written: dict[str, Path] = {}
|
|
53
|
+
for filename, content in files.items():
|
|
54
|
+
path = target / filename
|
|
55
|
+
if path.exists() and not overwrite:
|
|
56
|
+
raise FileExistsError(f"{path} already exists")
|
|
57
|
+
path.write_text(content, encoding="utf-8")
|
|
58
|
+
written[filename] = path
|
|
59
|
+
return written
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
__all__ = [
|
|
63
|
+
"AGENTS_FILENAME",
|
|
64
|
+
"CLAUDE_FILENAME",
|
|
65
|
+
"render_agents_md",
|
|
66
|
+
"render_claude_md",
|
|
67
|
+
"write_agent_docs",
|
|
68
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Command-line entry point for agent adapter file generation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Annotated
|
|
7
|
+
|
|
8
|
+
import typer
|
|
9
|
+
|
|
10
|
+
from truenex_memory.adapters import write_agent_docs
|
|
11
|
+
|
|
12
|
+
app = typer.Typer(help="Generate local agent adapter instruction files.")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@app.command("generate")
|
|
16
|
+
def generate(
|
|
17
|
+
directory: Annotated[Path, typer.Argument(help="Directory where files are written.")],
|
|
18
|
+
project_name: Annotated[str, typer.Option("--project-name")] = "Truenex Memory",
|
|
19
|
+
overwrite: Annotated[bool, typer.Option("--overwrite")] = False,
|
|
20
|
+
) -> None:
|
|
21
|
+
"""Generate AGENTS.md and CLAUDE.md."""
|
|
22
|
+
|
|
23
|
+
written = write_agent_docs(directory, project_name=project_name, overwrite=overwrite)
|
|
24
|
+
for name, path in written.items():
|
|
25
|
+
typer.echo(f"{name}: {path}")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
app()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""AGENTS.md adapter text generation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def generate_agents_md() -> str:
|
|
7
|
+
"""Return concise instructions for agents using Truenex Memory."""
|
|
8
|
+
|
|
9
|
+
return "\n".join(
|
|
10
|
+
[
|
|
11
|
+
"# Agent Memory",
|
|
12
|
+
"",
|
|
13
|
+
"Before making project claims, query Truenex Memory for relevant constraints.",
|
|
14
|
+
"Use `memory_search` for decisions, architecture notes, and project conventions.",
|
|
15
|
+
"Cite local source paths returned by memory results when they affect the answer.",
|
|
16
|
+
]
|
|
17
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""CLAUDE.md adapter text generation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def generate_claude_md() -> str:
|
|
7
|
+
"""Return concise Claude Code instructions for Truenex Memory."""
|
|
8
|
+
|
|
9
|
+
return "\n".join(
|
|
10
|
+
[
|
|
11
|
+
"# Truenex Memory",
|
|
12
|
+
"",
|
|
13
|
+
"Before coding, search local memory for project decisions and constraints.",
|
|
14
|
+
"Prefer active memory results and treat unverified results as tentative.",
|
|
15
|
+
"Do not use obsolete or superseded memory unless explicitly asked.",
|
|
16
|
+
]
|
|
17
|
+
)
|
|
File without changes
|