synthadoc 0.9.1__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.
- synthadoc/__init__.py +12 -0
- synthadoc/__main__.py +6 -0
- synthadoc/agents/__init__.py +2 -0
- synthadoc/agents/_routing.py +68 -0
- synthadoc/agents/_utils.py +25 -0
- synthadoc/agents/action_agent.py +755 -0
- synthadoc/agents/context_agent.py +131 -0
- synthadoc/agents/export_agent.py +461 -0
- synthadoc/agents/hint_engine.py +167 -0
- synthadoc/agents/hints.json +162 -0
- synthadoc/agents/ingest_agent.py +866 -0
- synthadoc/agents/lint_agent.py +616 -0
- synthadoc/agents/query_agent.py +921 -0
- synthadoc/agents/rewrite_agent.py +48 -0
- synthadoc/agents/scaffold_agent.py +311 -0
- synthadoc/agents/search_decompose_agent.py +66 -0
- synthadoc/agents/skill_agent.py +213 -0
- synthadoc/agents/summarize_agent.py +39 -0
- synthadoc/cli/__init__.py +2 -0
- synthadoc/cli/_http.py +141 -0
- synthadoc/cli/_init.py +213 -0
- synthadoc/cli/_port.py +45 -0
- synthadoc/cli/_utils.py +11 -0
- synthadoc/cli/_wiki.py +85 -0
- synthadoc/cli/audit.py +239 -0
- synthadoc/cli/backup.py +262 -0
- synthadoc/cli/cache.py +47 -0
- synthadoc/cli/candidates.py +253 -0
- synthadoc/cli/context.py +70 -0
- synthadoc/cli/demo.py +177 -0
- synthadoc/cli/export.py +69 -0
- synthadoc/cli/ingest.py +104 -0
- synthadoc/cli/install.py +284 -0
- synthadoc/cli/jobs.py +144 -0
- synthadoc/cli/lifecycle.py +82 -0
- synthadoc/cli/lint.py +246 -0
- synthadoc/cli/logo.py +123 -0
- synthadoc/cli/main.py +128 -0
- synthadoc/cli/plugin.py +251 -0
- synthadoc/cli/query.py +98 -0
- synthadoc/cli/routing.py +98 -0
- synthadoc/cli/scaffold.py +75 -0
- synthadoc/cli/schedule.py +206 -0
- synthadoc/cli/serve.py +366 -0
- synthadoc/cli/status.py +56 -0
- synthadoc/cli/web.py +43 -0
- synthadoc/config.py +503 -0
- synthadoc/core/__init__.py +2 -0
- synthadoc/core/backup_engine.py +185 -0
- synthadoc/core/cache.py +115 -0
- synthadoc/core/cost_guard.py +50 -0
- synthadoc/core/hooks.py +52 -0
- synthadoc/core/logging_config.py +214 -0
- synthadoc/core/orchestrator.py +565 -0
- synthadoc/core/queue.py +262 -0
- synthadoc/core/routing.py +91 -0
- synthadoc/core/scheduler.py +213 -0
- synthadoc/data/obsidian-plugin/main.js +346 -0
- synthadoc/data/obsidian-plugin/manifest.json +9 -0
- synthadoc/demos/__init__.py +2 -0
- synthadoc/demos/ai-research/AGENTS.md +16 -0
- synthadoc/demos/ai-research/README.md +196 -0
- synthadoc/demos/ai-research/ROUTING.md +20 -0
- synthadoc/demos/ai-research/_generate_raw_sources.py +275 -0
- synthadoc/demos/ai-research/raw_sources/ai-fundamentals-overview.md +53 -0
- synthadoc/demos/ai-research/raw_sources/deep-learning-concepts.pptx +0 -0
- synthadoc/demos/ai-research/raw_sources/llm-benchmarks-q1-2026.pdf +74 -0
- synthadoc/demos/ai-research/raw_sources/model-capabilities-comparison.xlsx +0 -0
- synthadoc/demos/ai-research/raw_sources/neural-network-architecture.png +0 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/andrej-karpathy-biography.txt +45 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/attention-mechanisms.txt +64 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/geoffrey-hinton-biography.txt +49 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/large-language-models.txt +51 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/llm-benchmarks-overview.txt +49 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/reinforcement-learning-from-human-feedback.txt +51 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/scaling-laws.txt +59 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/training-techniques.txt +65 -0
- synthadoc/demos/ai-research/raw_sources/public-domain/transformer-architecture.txt +53 -0
- synthadoc/demos/ai-research/sources.txt +25 -0
- synthadoc/demos/ai-research/wiki/andrej-karpathy.md +61 -0
- synthadoc/demos/ai-research/wiki/attention-mechanisms.md +70 -0
- synthadoc/demos/ai-research/wiki/dashboard.md +69 -0
- synthadoc/demos/ai-research/wiki/early-neural-networks.md +28 -0
- synthadoc/demos/ai-research/wiki/geoffrey-hinton.md +59 -0
- synthadoc/demos/ai-research/wiki/index.md +38 -0
- synthadoc/demos/ai-research/wiki/large-language-models.md +70 -0
- synthadoc/demos/ai-research/wiki/llm-benchmarks.md +66 -0
- synthadoc/demos/ai-research/wiki/purpose.md +33 -0
- synthadoc/demos/ai-research/wiki/reinforcement-learning-from-human-feedback.md +62 -0
- synthadoc/demos/ai-research/wiki/scaling-laws.md +60 -0
- synthadoc/demos/ai-research/wiki/training-techniques.md +68 -0
- synthadoc/demos/ai-research/wiki/transformer-architecture.md +60 -0
- synthadoc/demos/history-of-computing/.obsidian/app.json +5 -0
- synthadoc/demos/history-of-computing/AGENTS.md +13 -0
- synthadoc/demos/history-of-computing/README.md +349 -0
- synthadoc/demos/history-of-computing/raw_sources/computing-pioneers-timeline.xlsx +0 -0
- synthadoc/demos/history-of-computing/raw_sources/cs-milestones-overview.pptx +0 -0
- synthadoc/demos/history-of-computing/raw_sources/first-compiler-controversy.pdf +74 -0
- synthadoc/demos/history-of-computing/raw_sources/konrad-zuse-z3-computer.md +59 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/ceruzzi-history-modern-computing.txt +45 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/hopper-biography-usn.txt +39 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/leiner-brief-history-internet-2009.txt +43 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/mccorduck-machines-who-think.txt +49 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/raymond-cathedral-bazaar-1999.txt +43 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/riordan-hoddeson-crystal-fire.txt +53 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/ritchie-unix-history-1979.txt +39 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/turing-wikipedia-cc0.txt +47 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/vonneumann-firstdraft-1945.txt +50 -0
- synthadoc/demos/history-of-computing/raw_sources/public-domain/wexelblat-history-of-programming-languages-1981.txt +49 -0
- synthadoc/demos/history-of-computing/raw_sources/quantum-computing-primer.png +0 -0
- synthadoc/demos/history-of-computing/raw_sources/turing-enigma-decryption.pdf +74 -0
- synthadoc/demos/history-of-computing/sources.txt +20 -0
- synthadoc/demos/history-of-computing/wiki/alan-turing.md +36 -0
- synthadoc/demos/history-of-computing/wiki/artificial-intelligence-history.md +44 -0
- synthadoc/demos/history-of-computing/wiki/dashboard.md +82 -0
- synthadoc/demos/history-of-computing/wiki/grace-hopper.md +37 -0
- synthadoc/demos/history-of-computing/wiki/index.md +32 -0
- synthadoc/demos/history-of-computing/wiki/internet-origins.md +38 -0
- synthadoc/demos/history-of-computing/wiki/mechanical-computing.md +26 -0
- synthadoc/demos/history-of-computing/wiki/open-source-movement.md +40 -0
- synthadoc/demos/history-of-computing/wiki/personal-computer-revolution.md +38 -0
- synthadoc/demos/history-of-computing/wiki/programming-languages-overview.md +42 -0
- synthadoc/demos/history-of-computing/wiki/purpose.md +6 -0
- synthadoc/demos/history-of-computing/wiki/transistor-and-microchip.md +40 -0
- synthadoc/demos/history-of-computing/wiki/unix-history.md +38 -0
- synthadoc/demos/history-of-computing/wiki/von-neumann-architecture.md +38 -0
- synthadoc/errors.py +136 -0
- synthadoc/integration/__init__.py +2 -0
- synthadoc/integration/http_server.py +1390 -0
- synthadoc/integration/mcp_server.py +331 -0
- synthadoc/knowledge/synthadoc-export-guide.md +63 -0
- synthadoc/knowledge/synthadoc-ingest-guide.md +84 -0
- synthadoc/knowledge/synthadoc-jobs-guide.md +46 -0
- synthadoc/knowledge/synthadoc-lifecycle.md +116 -0
- synthadoc/knowledge/synthadoc-lint-guide.md +79 -0
- synthadoc/knowledge/synthadoc-overview.md +97 -0
- synthadoc/knowledge/synthadoc-schedule-guide.md +119 -0
- synthadoc/observability/__init__.py +2 -0
- synthadoc/observability/telemetry.py +60 -0
- synthadoc/providers/__init__.py +119 -0
- synthadoc/providers/anthropic.py +79 -0
- synthadoc/providers/base.py +44 -0
- synthadoc/providers/coding_tool.py +355 -0
- synthadoc/providers/ollama.py +67 -0
- synthadoc/providers/openai.py +443 -0
- synthadoc/providers/pricing.py +57 -0
- synthadoc/py.typed +0 -0
- synthadoc/skills/__init__.py +2 -0
- synthadoc/skills/base.py +76 -0
- synthadoc/skills/docx/SKILL.md +27 -0
- synthadoc/skills/docx/scripts/__init__.py +0 -0
- synthadoc/skills/docx/scripts/main.py +21 -0
- synthadoc/skills/image/SKILL.md +35 -0
- synthadoc/skills/image/scripts/__init__.py +0 -0
- synthadoc/skills/image/scripts/main.py +65 -0
- synthadoc/skills/markdown/SKILL.md +28 -0
- synthadoc/skills/markdown/scripts/__init__.py +0 -0
- synthadoc/skills/markdown/scripts/main.py +13 -0
- synthadoc/skills/pdf/SKILL.md +39 -0
- synthadoc/skills/pdf/references/cjk-notes.md +8 -0
- synthadoc/skills/pdf/scripts/__init__.py +0 -0
- synthadoc/skills/pdf/scripts/main.py +89 -0
- synthadoc/skills/pptx/SKILL.md +28 -0
- synthadoc/skills/pptx/scripts/__init__.py +0 -0
- synthadoc/skills/pptx/scripts/main.py +52 -0
- synthadoc/skills/registry.py +157 -0
- synthadoc/skills/url/SKILL.md +31 -0
- synthadoc/skills/url/scripts/__init__.py +0 -0
- synthadoc/skills/url/scripts/main.py +127 -0
- synthadoc/skills/web_search/SKILL.md +53 -0
- synthadoc/skills/web_search/assets/search-providers.json +12 -0
- synthadoc/skills/web_search/scripts/__init__.py +0 -0
- synthadoc/skills/web_search/scripts/fetcher.py +19 -0
- synthadoc/skills/web_search/scripts/main.py +122 -0
- synthadoc/skills/xlsx/SKILL.md +30 -0
- synthadoc/skills/xlsx/scripts/__init__.py +0 -0
- synthadoc/skills/xlsx/scripts/main.py +32 -0
- synthadoc/skills/youtube/SKILL.md +45 -0
- synthadoc/skills/youtube/scripts/__init__.py +0 -0
- synthadoc/skills/youtube/scripts/main.py +177 -0
- synthadoc/storage/__init__.py +2 -0
- synthadoc/storage/log.py +753 -0
- synthadoc/storage/search.py +232 -0
- synthadoc/storage/wiki.py +303 -0
- synthadoc-0.9.1.dist-info/METADATA +1263 -0
- synthadoc-0.9.1.dist-info/RECORD +189 -0
- synthadoc-0.9.1.dist-info/WHEEL +4 -0
- synthadoc-0.9.1.dist-info/entry_points.txt +2 -0
- synthadoc-0.9.1.dist-info/licenses/LICENSE +661 -0
synthadoc/__init__.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
# Copyright (C) 2026 Paul Chen / axoviq.com
|
|
3
|
+
"""synthadoc — domain-agnostic LLM knowledge compilation engine."""
|
|
4
|
+
from importlib.metadata import PackageNotFoundError as _PackageNotFoundError
|
|
5
|
+
from importlib.metadata import version as _version
|
|
6
|
+
from pathlib import Path as _Path
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
__version__ = _version("synthadoc")
|
|
10
|
+
except _PackageNotFoundError:
|
|
11
|
+
# Fallback for editable installs that haven't been registered yet.
|
|
12
|
+
__version__ = (_Path(__file__).resolve().parent.parent / "VERSION").read_text(encoding="utf-8").strip()
|
synthadoc/__main__.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
# Copyright (C) 2026 William Johnason / axoviq.com
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import re
|
|
7
|
+
|
|
8
|
+
from synthadoc.providers.base import Message
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
async def pick_routing_branches(
|
|
12
|
+
provider,
|
|
13
|
+
branches: dict[str, list[str]],
|
|
14
|
+
context: str,
|
|
15
|
+
*,
|
|
16
|
+
multi: bool,
|
|
17
|
+
) -> list[str]:
|
|
18
|
+
"""Ask the LLM to select branch names from a ROUTING.md index.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
provider: LLM provider instance.
|
|
22
|
+
branches: Branch mapping from RoutingIndex.branches.
|
|
23
|
+
context: Free-text description of what needs to be placed/searched
|
|
24
|
+
(e.g. page title+tags for ingest, question text for query).
|
|
25
|
+
multi: False → pick exactly one branch (ingest placement).
|
|
26
|
+
True → pick 1-2 branches (query scoping); returns [] when
|
|
27
|
+
no branch is clearly relevant so caller can fall back to
|
|
28
|
+
full-corpus search.
|
|
29
|
+
"""
|
|
30
|
+
if not branches:
|
|
31
|
+
return []
|
|
32
|
+
|
|
33
|
+
branch_list = "\n".join(f"- {b}" for b in branches)
|
|
34
|
+
if multi:
|
|
35
|
+
prompt = (
|
|
36
|
+
f"Wiki topic branches:\n{branch_list}\n\n"
|
|
37
|
+
f"{context}\n\n"
|
|
38
|
+
"Return a JSON array of the 1-2 most relevant branch names. "
|
|
39
|
+
"Return [] if no branch is clearly relevant."
|
|
40
|
+
)
|
|
41
|
+
else:
|
|
42
|
+
prompt = (
|
|
43
|
+
f"Wiki topic branches:\n{branch_list}\n\n"
|
|
44
|
+
f"{context}\n\n"
|
|
45
|
+
"Return the single most appropriate branch name for this page. "
|
|
46
|
+
"Return exactly one branch name from the list above."
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
try:
|
|
50
|
+
resp = await provider.complete(
|
|
51
|
+
messages=[Message(role="user", content=prompt)],
|
|
52
|
+
temperature=0.0,
|
|
53
|
+
)
|
|
54
|
+
except Exception:
|
|
55
|
+
return []
|
|
56
|
+
|
|
57
|
+
if multi:
|
|
58
|
+
m = re.search(r"\[.*?\]", resp.text, re.DOTALL)
|
|
59
|
+
if not m:
|
|
60
|
+
return []
|
|
61
|
+
try:
|
|
62
|
+
result = json.loads(m.group())
|
|
63
|
+
return [b for b in result if b in branches]
|
|
64
|
+
except Exception:
|
|
65
|
+
return []
|
|
66
|
+
else:
|
|
67
|
+
candidate = resp.text.strip().strip('"').strip()
|
|
68
|
+
return [candidate] if candidate in branches else [next(iter(branches))]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
# Copyright (C) 2026 William Johnason / axoviq.com
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def parse_json_string_array(text: str, max_items: int) -> list[str] | None:
|
|
9
|
+
"""Strip code fences, parse a JSON array, return non-empty strings up to max_items.
|
|
10
|
+
|
|
11
|
+
Returns None (never raises) when the text cannot be parsed as a non-empty
|
|
12
|
+
JSON array of strings, so callers can fall back without a try/except.
|
|
13
|
+
"""
|
|
14
|
+
text = text.strip()
|
|
15
|
+
if text.startswith("```"):
|
|
16
|
+
lines = text.splitlines()
|
|
17
|
+
text = "\n".join(l for l in lines if not l.strip().startswith("```")).strip()
|
|
18
|
+
try:
|
|
19
|
+
parts = json.loads(text)
|
|
20
|
+
except (json.JSONDecodeError, ValueError):
|
|
21
|
+
return None
|
|
22
|
+
if not isinstance(parts, list) or not parts:
|
|
23
|
+
return None
|
|
24
|
+
filtered = [str(q) for q in parts[:max_items] if str(q).strip()]
|
|
25
|
+
return filtered or None
|