@itradingai/aiwiki 0.2.20 → 0.2.22

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.
@@ -0,0 +1,243 @@
1
+ # AIWiki 使用指南
2
+
3
+ AIWiki 的主路径是让 AI 助手来使用。
4
+
5
+ 目标体验很简单:
6
+
7
+ ```text
8
+ 只设置一次
9
+ -> 以后把链接、文件、笔记发给 AI 助手
10
+ -> 助手调用 AIWiki
11
+ -> AIWiki 写入可复用的本地 Markdown 知识库
12
+ ```
13
+
14
+ AIWiki 不抓网页,也不调用 LLM。宿主 AI 助手负责读取和理解资料;AIWiki 负责校验、写入、链接、查询和检查本地知识库。
15
+
16
+ ## 1. 让 AI 助手安装 AIWiki
17
+
18
+ 复制这段给你的 AI 助手:
19
+
20
+ ```text
21
+ 请帮我安装并配置 AIWiki。
22
+
23
+ 请先检查 Node.js 是否已安装,并确认 node --version >=20。
24
+ 如果没有安装 Node.js,或版本低于 20,请先停止,并告诉我如何升级,不要继续运行 npm install。
25
+
26
+ 我的知识库路径是:
27
+
28
+ <替换成我的 AIWiki 知识库路径>
29
+
30
+ 请运行这些命令:
31
+
32
+ npm install -g @itradingai/aiwiki@latest
33
+ aiwiki setup --path "<替换成我的 AIWiki 知识库路径>" --yes
34
+ aiwiki agent sync --yes
35
+ aiwiki agent sync --path "<替换成我的 AIWiki 知识库路径>" --yes
36
+ aiwiki agent check --json
37
+ aiwiki agent check --path "<替换成我的 AIWiki 知识库路径>" --json
38
+ aiwiki doctor --path "<替换成我的 AIWiki 知识库路径>"
39
+ aiwiki status --path "<替换成我的 AIWiki 知识库路径>"
40
+
41
+ 最后总结安装是否成功、同步了哪些助手目标、知识库根指导是否存在,以及我是否需要重启或重新加载助手。
42
+ ```
43
+
44
+ 知识库路径示例:
45
+
46
+ ```text
47
+ Windows: D:\AIWiki
48
+ macOS/Linux: ~/AIWiki
49
+ 项目内测试: ./aiwiki-test
50
+ ```
51
+
52
+ 这会创建或修复知识库,同步 AIWiki skill,并在知识库根目录写入 `AGENTS.md` 指导。
53
+
54
+ 安装成功后应该看到:
55
+
56
+ - `aiwiki --version` 可以正常输出
57
+ - `aiwiki doctor --path <workspace>` 通过,或给出明确可处理的问题
58
+ - `aiwiki agent check --json` 报告支持的助手目标为 `installed`、`updated` 或 `current`
59
+ - `aiwiki agent check --path <workspace> --json` 报告知识库根指导是 current
60
+ - `aiwiki status --path <workspace>` 返回知识库状态和下一步动作
61
+
62
+ ## 2. Agent 同步的两层含义
63
+
64
+ ```bash
65
+ aiwiki agent sync --yes
66
+ ```
67
+
68
+ 同步到本机支持的 AI 助手环境,例如 Codex、Claude Code、QClaw、OpenClaw。
69
+
70
+ ```bash
71
+ aiwiki agent sync --path <workspace> --yes
72
+ ```
73
+
74
+ 在知识库根目录写入带标记的指导,让以后进入这个目录的 Agent 先使用 AIWiki 命令,而不是直接翻文件。
75
+
76
+ 验证两层同步:
77
+
78
+ ```bash
79
+ aiwiki agent check --json
80
+ aiwiki agent check --path <workspace> --json
81
+ ```
82
+
83
+ 不支持自动写入的宿主,可以输出通用协议:
84
+
85
+ ```bash
86
+ aiwiki prompt agent
87
+ ```
88
+
89
+ ## 3. 入库资料
90
+
91
+ 对 AI 助手说:
92
+
93
+ ```text
94
+ 把这个资料入库到 AIWiki:
95
+ https://example.com/article
96
+ ```
97
+
98
+ 助手应该:
99
+
100
+ 1. 读取资料
101
+ 2. 生成 `aiwiki.agent_payload.v1`
102
+ 3. 能理解时尽量提供 `analysis` 或 `wiki_entry`
103
+ 4. 调用 `aiwiki ingest-agent --stdin`
104
+ 5. 汇报 Wiki Entry、Source Card 和 Processing Summary
105
+
106
+ 本地文件可以调用:
107
+
108
+ ```bash
109
+ aiwiki ingest-file --file <file>
110
+ ```
111
+
112
+ 如果网页读取失败,助手也应该记录 `fetch_status: "failed"`,让这次尝试可追踪。
113
+
114
+ ## 4. 从知识库提问
115
+
116
+ 对 AI 助手说:
117
+
118
+ ```text
119
+ AIWiki 里关于 <主题> 有什么?
120
+ ```
121
+
122
+ 助手应该调用:
123
+
124
+ ```bash
125
+ aiwiki context "<主题>"
126
+ ```
127
+
128
+ `context` 返回给助手使用的 JSON,包含查询范围、结果质量、匹配原因、质量信号和相关引用。
129
+
130
+ 人在终端里看结果可以用:
131
+
132
+ ```bash
133
+ aiwiki query "<主题>"
134
+ ```
135
+
136
+ ## 5. 检查和维护知识库
137
+
138
+ 对 AI 助手说:
139
+
140
+ ```text
141
+ 帮我检查并整理 AIWiki 知识库。
142
+ ```
143
+
144
+ 助手应该先运行:
145
+
146
+ ```bash
147
+ aiwiki lint --json
148
+ ```
149
+
150
+ 如果只有安全修复,并且你允许整理:
151
+
152
+ ```bash
153
+ aiwiki lint --fix-empty-dirs --json
154
+ aiwiki lint --json
155
+ ```
156
+
157
+ 当前自动安全修复只包括:删除已知且为空的可选增强目录。AIWiki 不应把核心目录、未知目录、非空目录或文件当成 safe fix 删除。
158
+
159
+ ## 6. 生成的文件
160
+
161
+ 核心产物:
162
+
163
+ ```text
164
+ 09-runs/<run-id>/payload.json
165
+ 09-runs/<run-id>/raw.md
166
+ 09-runs/<run-id>/source-card.md
167
+ 09-runs/<run-id>/wiki-entry.md
168
+ 09-runs/<run-id>/processing-summary.md
169
+ 02-raw/articles/
170
+ 03-sources/article-cards/
171
+ 05-wiki/source-knowledge/
172
+ ```
173
+
174
+ 可选产物只在助手提供对应内容或明确请求时出现:
175
+
176
+ ```text
177
+ 09-runs/<run-id>/creative-assets.md
178
+ 09-runs/<run-id>/topics.md
179
+ 09-runs/<run-id>/draft-outline.md
180
+ 04-claims/_suggestions/
181
+ 06-assets/_suggestions/
182
+ 07-topics/ready/
183
+ 08-outputs/outlines/
184
+ ```
185
+
186
+ Wiki Entry 有两种质量模式:
187
+
188
+ - `agent_enriched` / `enriched`:助手提供了分析或 Wiki 内容。
189
+ - `deterministic_fallback` / `scaffold`:AIWiki 只根据来源内容生成可追踪脚手架。
190
+
191
+ ## 7. Obsidian 和 Dataview
192
+
193
+ AIWiki 写的是普通 Markdown 和 frontmatter。
194
+
195
+ Obsidian 可选,Dataview 也可选。AIWiki 不修改 `.obsidian`,不安装插件,也不依赖 Dataview 查询知识库。
196
+
197
+ `aiwiki setup` 会在缺失时创建 dashboard 和 schema 文件,并保留用户已经编辑过的文件。
198
+
199
+ ## 8. 常见排障
200
+
201
+ ### 找不到 `aiwiki`
202
+
203
+ 让助手重新安装:
204
+
205
+ ```bash
206
+ npm install -g @itradingai/aiwiki@latest
207
+ aiwiki --version
208
+ ```
209
+
210
+ ### 助手还是直接翻文件
211
+
212
+ 运行:
213
+
214
+ ```bash
215
+ aiwiki agent sync --yes
216
+ aiwiki agent sync --path <workspace> --yes
217
+ aiwiki agent check --path <workspace> --json
218
+ ```
219
+
220
+ 必要时重启或重新加载助手。
221
+
222
+ 助手应该先使用 `aiwiki lint`、`aiwiki status`、`aiwiki query`、`aiwiki context`、`aiwiki ingest-file` 或 `aiwiki ingest-agent`,再考虑通用文件搜索。
223
+
224
+ ### 助手读不到网页
225
+
226
+ 这是宿主助手访问网页的问题,不是 AIWiki 爬虫失败。让助手记录 failed fetch payload,保留可追踪记录。
227
+
228
+ ## 9. 本地开发
229
+
230
+ ```bash
231
+ npm install
232
+ npm run build
233
+ npm test
234
+ npm link
235
+ ```
236
+
237
+ 用临时知识库测试:
238
+
239
+ ```bash
240
+ aiwiki setup --path "./aiwiki-test" --yes
241
+ aiwiki doctor --path "./aiwiki-test"
242
+ aiwiki status --path "./aiwiki-test"
243
+ ```
@@ -2,6 +2,86 @@
2
2
 
3
3
  This log records queue-driven AIWiki development milestones that should remain visible to future maintainers, not only in automation chat history.
4
4
 
5
+ ## 2026-06-11 - Public trial path and feedback loop
6
+
7
+ Status: implemented and locally verified. Pre-delivery remote tarball smoke, GitHub push, Trusted Publishing, registry verification, and post-publish remote sanity are required before queue completion.
8
+
9
+ Version target: `@itradingai/aiwiki@0.2.22`
10
+
11
+ ### Goal
12
+
13
+ Make the public trial path concrete enough that a first-time user can complete one useful AIWiki loop without learning the whole product first.
14
+
15
+ The scoped acceptance criteria were:
16
+
17
+ - show a 10-minute path from setup to first ingest to query/context reuse;
18
+ - explain what a successful first run should generate;
19
+ - cover installation, first ingest, doctor/lint, query/context, and feedback questions in public docs;
20
+ - give host Agents a small first-use handoff path;
21
+ - provide a minimal feedback template without adding a CLI command;
22
+ - keep the base product boundary: no crawler, WeChat reader, vector search, RAG-over-wiki, RBAC, RSS, scheduled collection, browser plugin, Pro-only command, or multi-KB workflow.
23
+
24
+ ### Implemented
25
+
26
+ - Added an explicit 10-minute public trial path to the README, usage guide, and showcase.
27
+ - Added first-run success checks for the run folder, Source Card, Wiki Entry, query/context match, and structured lint output.
28
+ - Added `docs/TRIAL_FEEDBACK_TEMPLATE.md` for lightweight public-trial feedback.
29
+ - Updated FAQ coverage for first trial, doctor/lint, query/context, and feedback.
30
+ - Updated Agent handoff and packaged skill guidance so host Agents guide first-time users through one small loop before broad exploration.
31
+ - Included the trial feedback template in the npm package file list.
32
+
33
+ ### Verification
34
+
35
+ - `npm test`: passed, 61 tests.
36
+ - `npm run release:check`: passed for `@itradingai/aiwiki@0.2.22`, including tests and `scripts/release-check.mjs`.
37
+ - `npm pack --dry-run`: passed for `@itradingai/aiwiki@0.2.22`, 90 files, package size approximately 105 kB. Exact tarball shasum is recorded in the queue evidence instead of this packaged log file to avoid a self-referential hash.
38
+ - Pack inspection confirmed `docs/TRIAL_FEEDBACK_TEMPLATE.md` is included and `docs/assets/` images are still excluded from the npm tarball.
39
+
40
+ ## 2026-06-10 - README and documentation positioning rewrite
41
+
42
+ Status: implemented and locally verified. Not pushed, published, or remote-server verified in this documentation-only pass.
43
+
44
+ Version target: no version bump in this pass.
45
+
46
+ ### Goal
47
+
48
+ Rebuild the public AIWiki documentation around a clearer user-facing position:
49
+
50
+ - English README is the primary GitHub/npm entry.
51
+ - Chinese documentation is split into dedicated `zh-CN` files.
52
+ - The first-screen message is "AIWiki is a local Markdown knowledge base for AI assistants."
53
+ - The main Quick Start asks users to let an AI assistant install and configure AIWiki.
54
+ - Agent sync remains explicit through `aiwiki agent sync` and `aiwiki agent check`; npm install alone does not silently modify host assistant configuration.
55
+ - The older split story of "manual install" followed by a separate host-Agent connection step is removed from the main README path.
56
+ - Community QR codes remain visible in the README through raw GitHub asset links.
57
+
58
+ ### Implemented
59
+
60
+ - Rewrote `README.md` as the English public README with hero image, language/docs/npm links, Quick Start assistant prompt, first-use workflow, boundaries, community, and documentation links.
61
+ - Added `README.zh-CN.md` as the Chinese public README.
62
+ - Rewrote English docs: `docs/README.md`, `docs/USAGE.md`, `docs/FAQ.md`, `docs/AGENT_HANDOFF.md`, `docs/SHOWCASE.md`, `docs/ROADMAP.md`, and `docs/RELEASE.md`.
63
+ - Added matching Chinese docs: `docs/README.zh-CN.md`, `docs/USAGE.zh-CN.md`, `docs/FAQ.zh-CN.md`, `docs/AGENT_HANDOFF.zh-CN.md`, `docs/SHOWCASE.zh-CN.md`, `docs/ROADMAP.zh-CN.md`, and `docs/RELEASE.zh-CN.md`.
64
+ - Updated `package.json` description and package file list so the bilingual documentation is included in the npm tarball.
65
+ - Updated `skill/SKILL.md` to use the same product positioning while preserving the command-first AIWiki workflow.
66
+ - Updated CLI tests so bundled Claude handoff installation is verified against the new English `docs/AGENT_HANDOFF.md` contract.
67
+
68
+ ### Verification
69
+
70
+ - `npm test`: passed, 61 tests.
71
+ - `npm run release:check`: passed, including tests and `scripts/release-check.mjs`.
72
+ - `npm pack --dry-run`: passed for `@itradingai/aiwiki@0.2.21`, 89 files, package size 100.0 kB, shasum `6973ed940edf8f4620b7a3e578ddf3ececa01f45`.
73
+ - Public English docs scan: no Chinese characters found in `README.md`, the English docs, or `package.json`.
74
+ - Deprecated onboarding scan: no `Manual Install`, old `npx ... setup` path, old "second step host Agent" wording, or old first-screen positioning found in the rewritten public docs.
75
+
76
+ ### Follow-up Optimization
77
+
78
+ - Added npm, Node.js, and license badges to the public README files.
79
+ - Added Node.js >=20 checks to the assistant-install prompts.
80
+ - Added concrete knowledge base path examples for Windows, macOS/Linux, and project-local testing.
81
+ - Added "expected result" sections so users know what a successful install should report.
82
+ - Added practical scenario sections to make the README more readable for first-time users.
83
+ - Added FAQ entries for Node.js version-related installation failures.
84
+
5
85
  ## 2026-06-08 - Base contract cleanup and safe optional directory pruning
6
86
 
7
87
  Status: implemented and locally verified, committed locally, blocked before GitHub push and npm publication. Test-server verification is now required before both GitHub push and npm publication.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@itradingai/aiwiki",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "type": "module",
5
- "description": "Agent-first AI knowledge base CLI for turning articles, links and notes into Obsidian-ready source cards, topics, outlines and reusable knowledge assets.",
5
+ "description": "Local Markdown knowledge base for AI assistants. Save what your AI reads, ask it later, and keep everything local.",
6
6
  "license": "MIT",
7
7
  "keywords": [
8
8
  "aiwiki",
@@ -35,19 +35,28 @@
35
35
  "files": [
36
36
  "dist/src",
37
37
  "README.md",
38
+ "README.zh-CN.md",
38
39
  "LICENSE",
39
40
  "CONTRIBUTING.md",
40
41
  "SECURITY.md",
41
42
  "docs/20260607-aiwiki-feature-pruning-plan.md",
42
43
  "docs/20260607-aiwiki-long-term-operating-roadmap.md",
43
44
  "docs/AGENT_HANDOFF.md",
45
+ "docs/AGENT_HANDOFF.zh-CN.md",
44
46
  "docs/FAQ.md",
47
+ "docs/FAQ.zh-CN.md",
45
48
  "docs/OBSIDIAN_DATAVIEW_PLAN.md",
46
49
  "docs/README.md",
50
+ "docs/README.zh-CN.md",
47
51
  "docs/RELEASE.md",
52
+ "docs/RELEASE.zh-CN.md",
48
53
  "docs/ROADMAP.md",
54
+ "docs/ROADMAP.zh-CN.md",
49
55
  "docs/SHOWCASE.md",
56
+ "docs/SHOWCASE.zh-CN.md",
57
+ "docs/TRIAL_FEEDBACK_TEMPLATE.md",
50
58
  "docs/USAGE.md",
59
+ "docs/USAGE.zh-CN.md",
51
60
  "docs/development-log.md",
52
61
  "docs/architecture.svg",
53
62
  "examples",
package/skill/SKILL.md CHANGED
@@ -1,14 +1,16 @@
1
1
  ---
2
2
  name: aiwiki
3
- description: Agent-first AIWiki workflow for turning one URL/body into local Wiki knowledge files.
3
+ description: Local Markdown knowledge base workflow for AI assistants.
4
4
  ---
5
5
 
6
- <!-- aiwiki-skill-version: 0.2.19 -->
6
+ <!-- aiwiki-skill-version: 0.2.22 -->
7
7
 
8
8
  # AIWiki Skill
9
9
 
10
10
  Use this skill when the user asks an Agent to process one URL, article body, or local text file with the `aiwiki` keyword, or says phrases like `入库 <url>` / `收录 <url>` / `从 AIWiki 里了解 <topic>`.
11
11
 
12
+ AIWiki is a local Markdown knowledge base for AI assistants. Save what the assistant reads, ask it later, and keep everything local.
13
+
12
14
  AIWiki CLI does not fetch webpages and does not call an LLM. The host Agent reads and understands the source; AIWiki validates, writes, links, tracks, queries, and lints local Markdown knowledge files.
13
15
 
14
16
  ## Agent-First Setup and Upgrade
@@ -34,15 +36,42 @@ aiwiki agent sync --json --yes
34
36
  aiwiki agent check --json
35
37
  ```
36
38
 
39
+ For a project or vault workspace, also sync root guidance so future Agents see the command contract before they inspect files:
40
+
41
+ ```bash
42
+ aiwiki agent sync --path <workspace> --yes
43
+ aiwiki agent check --path <workspace> --json
44
+ ```
45
+
37
46
  Sync behavior:
38
47
 
39
48
  - missing installed skill: install the packaged AIWiki skill
40
49
  - current installed skill: leave unchanged
41
50
  - different installed skill: backup the old file, then overwrite with the packaged skill
51
+ - workspace `AGENTS.md`: append or refresh the marker-bounded AIWiki block without removing user instructions
42
52
  - unsupported host: do not write; use `aiwiki prompt agent` as a manual fallback
43
53
 
44
54
  After sync, tell the user the target path, any backup path, and that the target Agent may need to restart or reload before the new skill is active. Never edit Agent config during `npm install`; sync is the explicit safe step.
45
55
 
56
+ ## Required Command-First Loop
57
+
58
+ When the user asks you to organize, inspect, ingest, query, reuse, or maintain an AIWiki workspace, run the AIWiki command surface before generic file search or ad hoc note edits:
59
+
60
+ ```bash
61
+ aiwiki setup --path <workspace> --yes
62
+ aiwiki agent sync --path <workspace> --yes
63
+ aiwiki agent check --path <workspace> --json
64
+ aiwiki lint --json --path <workspace>
65
+ aiwiki lint --fix-empty-dirs --json --path <workspace>
66
+ aiwiki ingest-file --file <file> --path <workspace>
67
+ aiwiki ingest-agent --stdin --path <workspace>
68
+ aiwiki status --path <workspace>
69
+ aiwiki query <topic> --path <workspace>
70
+ aiwiki context <topic> --path <workspace>
71
+ ```
72
+
73
+ Use fallback shell/file search only after the relevant AIWiki command has been tried or when the command is unavailable. If you fall back, explain which AIWiki command was insufficient and why. If you skip the AIWiki commands entirely, the knowledge-base features are not being exercised.
74
+
46
75
  ## Knowledge Base Purpose
47
76
 
48
77
  Before ingesting, querying, linting, or reorganizing material, read `_system/purpose.md` in the target AIWiki workspace when it exists. Treat it as the local contract for:
@@ -57,6 +86,8 @@ If the material does not fit the purpose file, do not force it into the knowledg
57
86
 
58
87
  ## Ingest Flow
59
88
 
89
+ For first-time public-trial users, keep the path small and concrete: setup the workspace, ingest one source, inspect the generated run summary / Source Card / Wiki Entry, retrieve with query or context, run lint/doctor, then capture feedback with `docs/TRIAL_FEEDBACK_TEMPLATE.md`. Do not invent a new CLI command for feedback.
90
+
60
91
  1. Read the URL, message, attachment, or user-provided body.
61
92
  2. Read `_system/purpose.md` and decide whether the material fits this knowledge base.
62
93
  3. Build an `aiwiki.agent_payload.v1` payload with `source` and `request`.