agent-wiki-kb 0.7.2__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 (93) hide show
  1. agent_wiki_kb-0.7.2/.gitignore +17 -0
  2. agent_wiki_kb-0.7.2/CHANGELOG.md +233 -0
  3. agent_wiki_kb-0.7.2/LICENSE +625 -0
  4. agent_wiki_kb-0.7.2/PKG-INFO +20 -0
  5. agent_wiki_kb-0.7.2/README.md +653 -0
  6. agent_wiki_kb-0.7.2/agent-wiki.service +12 -0
  7. agent_wiki_kb-0.7.2/pyproject.toml +48 -0
  8. agent_wiki_kb-0.7.2/src/agent_wiki/__init__.py +1 -0
  9. agent_wiki_kb-0.7.2/src/agent_wiki/adapters/__init__.py +62 -0
  10. agent_wiki_kb-0.7.2/src/agent_wiki/adapters/claude_code.py +277 -0
  11. agent_wiki_kb-0.7.2/src/agent_wiki/adapters/drop_zone.py +114 -0
  12. agent_wiki_kb-0.7.2/src/agent_wiki/adapters/opencode.py +261 -0
  13. agent_wiki_kb-0.7.2/src/agent_wiki/cli.py +913 -0
  14. agent_wiki_kb-0.7.2/src/agent_wiki/config.py +243 -0
  15. agent_wiki_kb-0.7.2/src/agent_wiki/context.py +224 -0
  16. agent_wiki_kb-0.7.2/src/agent_wiki/conversation.py +246 -0
  17. agent_wiki_kb-0.7.2/src/agent_wiki/data/guide.md +20 -0
  18. agent_wiki_kb-0.7.2/src/agent_wiki/doctor.py +450 -0
  19. agent_wiki_kb-0.7.2/src/agent_wiki/fetch.py +173 -0
  20. agent_wiki_kb-0.7.2/src/agent_wiki/guide.py +54 -0
  21. agent_wiki_kb-0.7.2/src/agent_wiki/hooks/__init__.py +31 -0
  22. agent_wiki_kb-0.7.2/src/agent_wiki/hooks/claude.py +115 -0
  23. agent_wiki_kb-0.7.2/src/agent_wiki/hooks/manual.py +35 -0
  24. agent_wiki_kb-0.7.2/src/agent_wiki/index.py +56 -0
  25. agent_wiki_kb-0.7.2/src/agent_wiki/ingest.py +501 -0
  26. agent_wiki_kb-0.7.2/src/agent_wiki/lint.py +265 -0
  27. agent_wiki_kb-0.7.2/src/agent_wiki/locking.py +72 -0
  28. agent_wiki_kb-0.7.2/src/agent_wiki/log.py +33 -0
  29. agent_wiki_kb-0.7.2/src/agent_wiki/page.py +156 -0
  30. agent_wiki_kb-0.7.2/src/agent_wiki/redact.py +68 -0
  31. agent_wiki_kb-0.7.2/src/agent_wiki/remote.py +174 -0
  32. agent_wiki_kb-0.7.2/src/agent_wiki/search.py +161 -0
  33. agent_wiki_kb-0.7.2/src/agent_wiki/server/__init__.py +0 -0
  34. agent_wiki_kb-0.7.2/src/agent_wiki/server/app.py +52 -0
  35. agent_wiki_kb-0.7.2/src/agent_wiki/server/auth.py +23 -0
  36. agent_wiki_kb-0.7.2/src/agent_wiki/server/routes.py +158 -0
  37. agent_wiki_kb-0.7.2/src/agent_wiki/server/schemas.py +37 -0
  38. agent_wiki_kb-0.7.2/src/agent_wiki/server_config.py +82 -0
  39. agent_wiki_kb-0.7.2/src/agent_wiki/service.py +334 -0
  40. agent_wiki_kb-0.7.2/src/agent_wiki/show.py +47 -0
  41. agent_wiki_kb-0.7.2/src/agent_wiki/skills/awiki-ingest/SKILL.md +28 -0
  42. agent_wiki_kb-0.7.2/src/agent_wiki/skills/awiki-save/SKILL.md +71 -0
  43. agent_wiki_kb-0.7.2/src/agent_wiki/skills/awiki-search/SKILL.md +28 -0
  44. agent_wiki_kb-0.7.2/src/agent_wiki/summarize.py +159 -0
  45. agent_wiki_kb-0.7.2/src/agent_wiki/sync.py +174 -0
  46. agent_wiki_kb-0.7.2/src/agent_wiki/tag_fix.py +94 -0
  47. agent_wiki_kb-0.7.2/src/agent_wiki/tag_suggest.py +117 -0
  48. agent_wiki_kb-0.7.2/src/agent_wiki/tag_yaml.py +103 -0
  49. agent_wiki_kb-0.7.2/src/agent_wiki/tags.py +68 -0
  50. agent_wiki_kb-0.7.2/src/agent_wiki/vault.py +54 -0
  51. agent_wiki_kb-0.7.2/tests/conftest.py +160 -0
  52. agent_wiki_kb-0.7.2/tests/test_adapters_claude_code.py +170 -0
  53. agent_wiki_kb-0.7.2/tests/test_adapters_drop_zone.py +142 -0
  54. agent_wiki_kb-0.7.2/tests/test_adapters_opencode.py +158 -0
  55. agent_wiki_kb-0.7.2/tests/test_cli.py +426 -0
  56. agent_wiki_kb-0.7.2/tests/test_cli_dispatch.py +67 -0
  57. agent_wiki_kb-0.7.2/tests/test_config.py +92 -0
  58. agent_wiki_kb-0.7.2/tests/test_context.py +258 -0
  59. agent_wiki_kb-0.7.2/tests/test_conversation.py +161 -0
  60. agent_wiki_kb-0.7.2/tests/test_doctor.py +461 -0
  61. agent_wiki_kb-0.7.2/tests/test_guide.py +147 -0
  62. agent_wiki_kb-0.7.2/tests/test_hooks.py +310 -0
  63. agent_wiki_kb-0.7.2/tests/test_index.py +47 -0
  64. agent_wiki_kb-0.7.2/tests/test_ingest.py +526 -0
  65. agent_wiki_kb-0.7.2/tests/test_ingest_url.py +364 -0
  66. agent_wiki_kb-0.7.2/tests/test_lint.py +299 -0
  67. agent_wiki_kb-0.7.2/tests/test_locking.py +57 -0
  68. agent_wiki_kb-0.7.2/tests/test_page.py +137 -0
  69. agent_wiki_kb-0.7.2/tests/test_redact.py +62 -0
  70. agent_wiki_kb-0.7.2/tests/test_remote.py +95 -0
  71. agent_wiki_kb-0.7.2/tests/test_remote_parity.py +116 -0
  72. agent_wiki_kb-0.7.2/tests/test_render_hash_compat.py +124 -0
  73. agent_wiki_kb-0.7.2/tests/test_search.py +159 -0
  74. agent_wiki_kb-0.7.2/tests/test_serve.py +8 -0
  75. agent_wiki_kb-0.7.2/tests/test_server.py +142 -0
  76. agent_wiki_kb-0.7.2/tests/test_server_config.py +39 -0
  77. agent_wiki_kb-0.7.2/tests/test_service.py +220 -0
  78. agent_wiki_kb-0.7.2/tests/test_show.py +100 -0
  79. agent_wiki_kb-0.7.2/tests/test_skills_cli.py +72 -0
  80. agent_wiki_kb-0.7.2/tests/test_staleness_hook.py +134 -0
  81. agent_wiki_kb-0.7.2/tests/test_summarize.py +111 -0
  82. agent_wiki_kb-0.7.2/tests/test_sync.py +220 -0
  83. agent_wiki_kb-0.7.2/tests/test_tag_canonicalize.py +96 -0
  84. agent_wiki_kb-0.7.2/tests/test_tag_cli.py +149 -0
  85. agent_wiki_kb-0.7.2/tests/test_tag_fix.py +186 -0
  86. agent_wiki_kb-0.7.2/tests/test_tag_ingest.py +202 -0
  87. agent_wiki_kb-0.7.2/tests/test_tag_lint.py +93 -0
  88. agent_wiki_kb-0.7.2/tests/test_tag_vocab.py +138 -0
  89. agent_wiki_kb-0.7.2/tests/test_tag_yaml_writer.py +127 -0
  90. agent_wiki_kb-0.7.2/tests/test_token_cli.py +20 -0
  91. agent_wiki_kb-0.7.2/tests/test_vault.py +54 -0
  92. agent_wiki_kb-0.7.2/tests/test_vault_override.py +164 -0
  93. agent_wiki_kb-0.7.2/uv.lock +2156 -0
@@ -0,0 +1,17 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .pytest_cache/
6
+
7
+ # Virtualenvs
8
+ .venv/
9
+ venv/
10
+
11
+ # Local third-party reference projects (not vendored)
12
+ 3rdParty/
13
+
14
+ # Editor / OS cruft
15
+ .vscode/
16
+ .idea/
17
+ .DS_Store
@@ -0,0 +1,233 @@
1
+ # Changelog
2
+
3
+ All notable changes to Agent Wiki are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project aims to
5
+ follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ The single source of truth for the version is `__version__` in
8
+ `src/agent_wiki/__init__.py`; `awiki --version` and the build metadata both
9
+ derive from it. Release tags begin at `v0.5.0`; earlier versions and dates
10
+ below are reconstructed from the commits that bumped `__version__`.
11
+
12
+ ## [0.7.2]
13
+
14
+ ### Changed
15
+ - **Published to PyPI as `agent-wiki-kb`.** First public PyPI release. The
16
+ natural names are unavailable: `agent-wiki` is owned by an unrelated,
17
+ actively-maintained project, and `agentwiki` is rejected by PyPI's
18
+ name-similarity guard (it collapses to the same normalized form as
19
+ `agent-wiki`). It ships under `agent-wiki-kb` (`pip install agent-wiki-kb`).
20
+ Only the distribution name is affected - the import package is still
21
+ `agent_wiki` and the `awiki` / `aw` commands are unchanged.
22
+
23
+ ## [0.7.1]
24
+
25
+ ### Changed
26
+ - Attempted to publish as `agentwiki`; blocked before publish by PyPI's
27
+ name-similarity guard. Superseded by 0.7.2 (`agent-wiki-kb`).
28
+
29
+ ## [0.7.0]
30
+
31
+ ### Added
32
+ - **`awiki skills` command group.** A new subcommand group installs the three
33
+ bundled agent skills (`awiki-search`, `awiki-save`, `awiki-ingest`) into
34
+ whatever agent harness is detected (Claude Code, pi, Hermes, opencode),
35
+ backed by the AgentSquire library. `awiki skills install` copies them in with
36
+ a provenance stamp; `status`, `update`, and `uninstall` manage them;
37
+ `--scope user|project` selects the target and `--harness NAME` narrows to one
38
+ harness. The skills now ship inside the wheel as package data under
39
+ `src/agent_wiki/skills/`, so no source checkout is needed to install them.
40
+ - **Proactive skill-staleness notice.** Every `awiki` invocation runs a safe
41
+ startup check: when your installed skills are older than the bundled copies
42
+ it prints one stderr line naming `awiki skills update`, without ever
43
+ prompting, reading stdin, or touching stdout or the exit code. Agents see the
44
+ notice too - it is not gated on an interactive terminal - and `CI` or
45
+ `AGENTSQUIRE_NO_UPDATE_CHECK` suppress it.
46
+
47
+ ### Changed
48
+ - **`agentsquire` now resolves from PyPI.** Now that `agentsquire` is published
49
+ to PyPI, the dev-time `[tool.uv.sources]` editable override that pinned it to
50
+ the sibling `../AgentSquire` checkout has been removed from `pyproject.toml`.
51
+ A fresh install or `uv sync` pulls `agentsquire>=0.2.1` (currently 0.3.0)
52
+ straight from the index - no side-by-side source checkout required.
53
+
54
+ ### Migration
55
+ - If you previously installed the skills by hand-copying **or symlinking** the
56
+ old repo-root `skills/` directory into a harness (e.g. `~/.claude/skills/`),
57
+ run `awiki skills update --force` once to adopt them under provenance. Both
58
+ unstamped copies and symlinks are classified as locally modified and are never
59
+ silently overwritten, so a plain `install`/`update` skips them with a reason
60
+ (it will not crash on a pre-existing symlink); `--force` replaces them with a
61
+ stamped copy (a symlink is removed, not followed). Alternatively, delete the
62
+ old skill directories or symlinks and run `awiki skills install`. Note that
63
+ this release deleted the old repo-root `skills/` tree, so any symlink pointing
64
+ into it is now dangling - `--force` it or remove it.
65
+
66
+ ## [0.6.0]
67
+
68
+ ### Changed
69
+ - **`awiki guide` output is trimmed and de-versioned.** The self-installing
70
+ block is now a static, self-contained ~15-line block: it frames the wiki as
71
+ the first stop for durable project/domain knowledge (no longer pitched as a
72
+ general web-search replacement), keeps the search→show and edit-raw→reingest
73
+ habits inline, and carries the `awiki-save` nudge. The default `awiki guide`
74
+ preamble is a short "add this once; leave it if already present" instruction.
75
+
76
+ ### Removed
77
+ - **BREAKING: the `<!-- awiki:begin vX.Y.Z -->` / `<!-- awiki:end -->` markers
78
+ and the version-staleness note are gone** from the `awiki guide` output. The
79
+ installed block is now static, so consumers add it once and re-adapt only when
80
+ they choose to — there is no marker to detect staleness or re-sync against.
81
+ Pre-1.0 this rides a minor bump, but it changes the `awiki guide` artifact
82
+ format, so it is called out explicitly.
83
+
84
+ ## [0.5.0] – 2026-07-08
85
+
86
+ ### Changed
87
+ - **Renamed `awiki directions` → `awiki guide`.** The command that prints the
88
+ self-installing agent-onboarding block now reads `awiki guide`, which reads
89
+ naturally as a "point your agent here and run this" call to action (and now
90
+ headlines the README's get-started line). The old name still works as a
91
+ **hidden, deprecated alias**, so existing muscle memory and any half-installed
92
+ memory-file blocks keep functioning. The `<!-- awiki:begin vX.Y.Z -->` marker
93
+ is unchanged, so installed blocks still detect staleness and re-sync normally.
94
+
95
+ ## [0.4.0] – 2026-07-06
96
+
97
+ ### Added
98
+ - **`render_hash` drift guard.** Every rendered page now carries a `render_hash`
99
+ fingerprint of its body in frontmatter, letting awiki tell an intended,
100
+ raw-driven update apart from an out-of-band hand-edit of the page:
101
+ - Editing `raw/<name>` and running `awiki reingest <name>` rebuilds the page
102
+ cleanly — **a raw edit no longer trips the guard**, so the canonical
103
+ edit-the-raw loop needs no `--force`.
104
+ - The guard now fires only when the *page itself* was hand-edited out of band;
105
+ `reingest` (and `ingest --update`) then print a page-vs-raw diff and stop
106
+ until you review and re-run with `--force`.
107
+ - Lazy trust-on-first-use: pre-existing pages without a `render_hash` are
108
+ trusted the first time they're touched and stamped going forward, so
109
+ upgrading an existing vault needs no migration step.
110
+ - **`awiki raw <name>`** — resolve a page to its `raw/<name>` source path,
111
+ printed to stdout so it drops straight into command substitution
112
+ (`$EDITOR "$(awiki raw my-notes.md)"`). Errors exactly as `reingest` does on a
113
+ missing or ambiguous name; on a remote vault it prints the server-side
114
+ reference and notes on stderr that the raw isn't locally editable.
115
+ - **`awiki doctor` render-hash checks** — stamps `render_hash` on un-hashed but
116
+ faithful pages, and reports un-hashed pages whose body has diverged from their
117
+ `raw/` source.
118
+
119
+ ### Changed
120
+ - `awiki reingest` and `awiki show` now print the resolved read/write location
121
+ (a local absolute path, or the server URL + vault-relative path for a remote
122
+ vault) on **stderr**. stdout stays byte-identical, so skills that parse command
123
+ output verbatim are unaffected.
124
+
125
+ ## [0.3.1] – 2026-07-01
126
+
127
+ ### Fixed
128
+ - `awiki directions`: corrected the raw-editing guidance so the installed block
129
+ tells agents to edit the `raw/` source and run `awiki reingest`, never
130
+ hand-edit a rendered page.
131
+ - Documented the page-update path — edit raw → `reingest`, or `ingest --update`
132
+ for an external file — in the directions block and the `awiki-save` skill,
133
+ including the remote-vault case.
134
+
135
+ ## [0.3.0] – 2026-06-27
136
+
137
+ ### Added
138
+ - **Tag vocabulary system.** An optional `tags:` block in `wiki.yaml`
139
+ (`mode: off | warn | strict` plus a preferred → aliases map) canonicalizes
140
+ tags across the vault:
141
+ - `awiki tag add <preferred> [--alias …]` — persist vocabulary entries through
142
+ a comment-preserving `wiki.yaml` writer (idempotent; refuses to steal an
143
+ alias already bound to another term).
144
+ - `awiki tag suggest [--write]` — draft a vocabulary from the tags already in
145
+ use, grouping related tags as alias candidates.
146
+ - `awiki tag fix [--write] [--topic T] [PATH]` — canonicalize existing pages'
147
+ frontmatter tags (preview by default; page frontmatter only, never `raw/` or
148
+ the page body).
149
+ - Ingest canonicalizes tags at the single write boundary; `--tag-mode
150
+ off|warn|strict` overrides the mode per ingest, and `strict` rejects
151
+ out-of-vocabulary tags pre-flight.
152
+ - `awiki lint` gained a read-only `TAG` (tag-audit) check; `lint --strict`
153
+ turns it into a CI gate (non-zero exit on any TAG finding).
154
+
155
+ ### Fixed
156
+ - Bare `mode: off` tag blocks round-trip safely through the `wiki.yaml` writer.
157
+ - `canonicalize_tags` hardened against non-string tag values.
158
+
159
+ ## [0.2.1] – 2026-06-26
160
+
161
+ ### Added
162
+ - **`--vault PATH` / `AWIKI_VAULT`** — override the configured vault for a single
163
+ invocation (forces a local vault).
164
+ - `awiki doctor` now repairs a stale local `vault_path` (config pointing at a
165
+ vault that no longer exists) instead of hard-stopping.
166
+
167
+ ## [0.2.0] – 2026-06-25
168
+
169
+ ### Added
170
+ - **URL ingest across the network server.** Remote clients fetch page content
171
+ locally, so `awiki ingest <url>` works whether the vault is local or served
172
+ over HTTP.
173
+ - New `awiki lint` checks:
174
+ - `SOURCE` — a `raw/` file edited in place (drifted from its recorded sha256).
175
+ - `STALE` — a page whose body lags its newest source.
176
+ - `SIZE` — pages over 200 lines, flagged as split candidates.
177
+ - `INDEX` — pages missing from `index.md`.
178
+ - `lint --refetch` — re-fetch URL sources and flag any whose upstream content
179
+ changed (`UPSTREAM`; network, off by default, local vaults only).
180
+
181
+ ### Fixed
182
+ - `awiki doctor --reconcile-raw` refreshes the provenance sidecar's sha256.
183
+
184
+ ## [0.1.1] – 2026-06-20
185
+
186
+ ### Added
187
+ - **URL ingestion.** `awiki ingest <url>` fetches and ingests web pages:
188
+ - HTML extracted via trafilatura; PDFs via pymupdf4llm (pdfplumber selectable).
189
+ - Every ingest writes a sha256 **provenance sidecar** (`raw/<name>.meta.yaml`);
190
+ the original fetched artifact is archived byte-identically under `raw/assets/`.
191
+ - Normalized-URL dedup and a sha256 skip avoid re-ingesting unchanged URLs.
192
+ - `source_url` is emitted inline on fetched pages; non-text content types are
193
+ rejected with a friendly one-line error.
194
+ - Single-source-of-truth versioning: everything derives from `__version__`, and
195
+ `awiki directions` re-adapts an installed block when a newer version ships
196
+ (shared-vault framing).
197
+
198
+ ### Changed
199
+ - Licensed under **GPL-3.0-or-later**.
200
+
201
+ ### Fixed
202
+ - `awiki lint` no longer flags provenance sidecars as un-ingested `raw/` files.
203
+
204
+ ## [0.1.0] – 2026-04-14
205
+
206
+ Initial release.
207
+
208
+ ### Added
209
+ - **Core vault + CLI** (`awiki` / `aw`): `init`, `ingest` (files), `search`,
210
+ `show`, `index`, `lint`, `status`, `log` over a plain-markdown vault with YAML
211
+ frontmatter and `[[wikilinks]]`.
212
+ - **Multi-word search** — AND-across-the-page matching with coverage-ranked
213
+ results and a lower-ranked partial-match tier.
214
+ - **`awiki show <path>`** — print any vault file verbatim by its vault-relative
215
+ path.
216
+ - **`ingest --update`** plus a collision guard that refuses to clobber an
217
+ existing `raw/` basename (per-file skip/continue in globs).
218
+ - **`awiki reingest <name>`** — rebuild a page from its edited `raw/<name>`
219
+ source (diff-and-stop unless `--force`); the canonical page-edit loop.
220
+ - **Conversation ingest** — adapters for Claude Code, OpenCode, and a drop-zone,
221
+ a canonical Conversation Bundle format, `awiki sync` (state-tracked,
222
+ idempotent), `awiki adapt`, `awiki ingest-conversation`, and optional
223
+ summarization (`none` / `claude-p` / `local-openai`).
224
+ - **Auto-context hook** — `awiki context` (YAKE keyword extraction → search →
225
+ compact pointer block) and `awiki hook install|uninstall|status` to wire it
226
+ into an agent CLI's `UserPromptSubmit` hook.
227
+ - **`awiki directions`** — a self-installing wiki-usage block for agent memory
228
+ files (`CLAUDE.md`, `AGENTS.md`, …).
229
+ - **Network server** — `awiki serve` (FastAPI, bearer auth, role-gated
230
+ reader/writer/admin), `awiki token add|list|revoke`, a transparent remote
231
+ client (`awiki init --remote … --token …`), per-vault file locks, and
232
+ `awiki doctor` for schema-drift repair.
233
+ - **Claude Code skills** — `awiki-search`, `awiki-save`, `awiki-ingest`.