@agent-wiki/mcp 0.17.9

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 (217) hide show
  1. package/.claude-plugin/plugin.json +7 -0
  2. package/README.md +171 -0
  3. package/architecture.svg +58 -0
  4. package/dist/atlassian.d.ts +63 -0
  5. package/dist/atlassian.d.ts.map +1 -0
  6. package/dist/atlassian.js +596 -0
  7. package/dist/atlassian.js.map +1 -0
  8. package/dist/cli.d.ts +11 -0
  9. package/dist/cli.d.ts.map +1 -0
  10. package/dist/cli.js +391 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/cobol/__tests__/call-boundary-lineage.test.d.ts +2 -0
  13. package/dist/cobol/__tests__/call-boundary-lineage.test.d.ts.map +1 -0
  14. package/dist/cobol/__tests__/call-boundary-lineage.test.js +505 -0
  15. package/dist/cobol/__tests__/call-boundary-lineage.test.js.map +1 -0
  16. package/dist/cobol/__tests__/code-analysis.test.d.ts +2 -0
  17. package/dist/cobol/__tests__/code-analysis.test.d.ts.map +1 -0
  18. package/dist/cobol/__tests__/code-analysis.test.js +465 -0
  19. package/dist/cobol/__tests__/code-analysis.test.js.map +1 -0
  20. package/dist/cobol/__tests__/db2-table-lineage.test.d.ts +2 -0
  21. package/dist/cobol/__tests__/db2-table-lineage.test.d.ts.map +1 -0
  22. package/dist/cobol/__tests__/db2-table-lineage.test.js +182 -0
  23. package/dist/cobol/__tests__/db2-table-lineage.test.js.map +1 -0
  24. package/dist/cobol/__tests__/evidence-mapping.test.d.ts +2 -0
  25. package/dist/cobol/__tests__/evidence-mapping.test.d.ts.map +1 -0
  26. package/dist/cobol/__tests__/evidence-mapping.test.js +49 -0
  27. package/dist/cobol/__tests__/evidence-mapping.test.js.map +1 -0
  28. package/dist/cobol/__tests__/extractors.test.d.ts +2 -0
  29. package/dist/cobol/__tests__/extractors.test.d.ts.map +1 -0
  30. package/dist/cobol/__tests__/extractors.test.js +189 -0
  31. package/dist/cobol/__tests__/extractors.test.js.map +1 -0
  32. package/dist/cobol/__tests__/field-lineage.test.d.ts +2 -0
  33. package/dist/cobol/__tests__/field-lineage.test.d.ts.map +1 -0
  34. package/dist/cobol/__tests__/field-lineage.test.js +329 -0
  35. package/dist/cobol/__tests__/field-lineage.test.js.map +1 -0
  36. package/dist/cobol/__tests__/graph.test.d.ts +2 -0
  37. package/dist/cobol/__tests__/graph.test.d.ts.map +1 -0
  38. package/dist/cobol/__tests__/graph.test.js +456 -0
  39. package/dist/cobol/__tests__/graph.test.js.map +1 -0
  40. package/dist/cobol/__tests__/integration.test.d.ts +2 -0
  41. package/dist/cobol/__tests__/integration.test.d.ts.map +1 -0
  42. package/dist/cobol/__tests__/integration.test.js +971 -0
  43. package/dist/cobol/__tests__/integration.test.js.map +1 -0
  44. package/dist/cobol/__tests__/lexer.test.d.ts +2 -0
  45. package/dist/cobol/__tests__/lexer.test.d.ts.map +1 -0
  46. package/dist/cobol/__tests__/lexer.test.js +111 -0
  47. package/dist/cobol/__tests__/lexer.test.js.map +1 -0
  48. package/dist/cobol/__tests__/parser.test.d.ts +2 -0
  49. package/dist/cobol/__tests__/parser.test.d.ts.map +1 -0
  50. package/dist/cobol/__tests__/parser.test.js +180 -0
  51. package/dist/cobol/__tests__/parser.test.js.map +1 -0
  52. package/dist/cobol/__tests__/variable-tracer.test.d.ts +2 -0
  53. package/dist/cobol/__tests__/variable-tracer.test.d.ts.map +1 -0
  54. package/dist/cobol/__tests__/variable-tracer.test.js +256 -0
  55. package/dist/cobol/__tests__/variable-tracer.test.js.map +1 -0
  56. package/dist/cobol/__tests__/wiki-gen.test.d.ts +2 -0
  57. package/dist/cobol/__tests__/wiki-gen.test.d.ts.map +1 -0
  58. package/dist/cobol/__tests__/wiki-gen.test.js +76 -0
  59. package/dist/cobol/__tests__/wiki-gen.test.js.map +1 -0
  60. package/dist/cobol/call-boundary-lineage.d.ts +49 -0
  61. package/dist/cobol/call-boundary-lineage.d.ts.map +1 -0
  62. package/dist/cobol/call-boundary-lineage.js +159 -0
  63. package/dist/cobol/call-boundary-lineage.js.map +1 -0
  64. package/dist/cobol/db2-table-lineage.d.ts +45 -0
  65. package/dist/cobol/db2-table-lineage.d.ts.map +1 -0
  66. package/dist/cobol/db2-table-lineage.js +127 -0
  67. package/dist/cobol/db2-table-lineage.js.map +1 -0
  68. package/dist/cobol/evidence-mapping.d.ts +31 -0
  69. package/dist/cobol/evidence-mapping.d.ts.map +1 -0
  70. package/dist/cobol/evidence-mapping.js +27 -0
  71. package/dist/cobol/evidence-mapping.js.map +1 -0
  72. package/dist/cobol/extractors.d.ts +88 -0
  73. package/dist/cobol/extractors.d.ts.map +1 -0
  74. package/dist/cobol/extractors.js +297 -0
  75. package/dist/cobol/extractors.js.map +1 -0
  76. package/dist/cobol/field-lineage.d.ts +101 -0
  77. package/dist/cobol/field-lineage.d.ts.map +1 -0
  78. package/dist/cobol/field-lineage.js +603 -0
  79. package/dist/cobol/field-lineage.js.map +1 -0
  80. package/dist/cobol/graph.d.ts +182 -0
  81. package/dist/cobol/graph.d.ts.map +1 -0
  82. package/dist/cobol/graph.js +453 -0
  83. package/dist/cobol/graph.js.map +1 -0
  84. package/dist/cobol/lexer.d.ts +15 -0
  85. package/dist/cobol/lexer.d.ts.map +1 -0
  86. package/dist/cobol/lexer.js +251 -0
  87. package/dist/cobol/lexer.js.map +1 -0
  88. package/dist/cobol/parser.d.ts +13 -0
  89. package/dist/cobol/parser.d.ts.map +1 -0
  90. package/dist/cobol/parser.js +584 -0
  91. package/dist/cobol/parser.js.map +1 -0
  92. package/dist/cobol/plugin.d.ts +23 -0
  93. package/dist/cobol/plugin.d.ts.map +1 -0
  94. package/dist/cobol/plugin.js +507 -0
  95. package/dist/cobol/plugin.js.map +1 -0
  96. package/dist/cobol/types.d.ts +73 -0
  97. package/dist/cobol/types.d.ts.map +1 -0
  98. package/dist/cobol/types.js +9 -0
  99. package/dist/cobol/types.js.map +1 -0
  100. package/dist/cobol/variable-tracer.d.ts +31 -0
  101. package/dist/cobol/variable-tracer.d.ts.map +1 -0
  102. package/dist/cobol/variable-tracer.js +361 -0
  103. package/dist/cobol/variable-tracer.js.map +1 -0
  104. package/dist/cobol/wiki-gen.d.ts +18 -0
  105. package/dist/cobol/wiki-gen.d.ts.map +1 -0
  106. package/dist/cobol/wiki-gen.js +222 -0
  107. package/dist/cobol/wiki-gen.js.map +1 -0
  108. package/dist/code-analysis.d.ts +160 -0
  109. package/dist/code-analysis.d.ts.map +1 -0
  110. package/dist/code-analysis.js +53 -0
  111. package/dist/code-analysis.js.map +1 -0
  112. package/dist/evidence-search.d.ts +43 -0
  113. package/dist/evidence-search.d.ts.map +1 -0
  114. package/dist/evidence-search.js +112 -0
  115. package/dist/evidence-search.js.map +1 -0
  116. package/dist/evidence-search.test.d.ts +2 -0
  117. package/dist/evidence-search.test.d.ts.map +1 -0
  118. package/dist/evidence-search.test.js +98 -0
  119. package/dist/evidence-search.test.js.map +1 -0
  120. package/dist/evidence.d.ts +32 -0
  121. package/dist/evidence.d.ts.map +1 -0
  122. package/dist/evidence.js +16 -0
  123. package/dist/evidence.js.map +1 -0
  124. package/dist/evidence.test.d.ts +2 -0
  125. package/dist/evidence.test.d.ts.map +1 -0
  126. package/dist/evidence.test.js +51 -0
  127. package/dist/evidence.test.js.map +1 -0
  128. package/dist/extraction.d.ts +40 -0
  129. package/dist/extraction.d.ts.map +1 -0
  130. package/dist/extraction.js +283 -0
  131. package/dist/extraction.js.map +1 -0
  132. package/dist/extraction.test.d.ts +5 -0
  133. package/dist/extraction.test.d.ts.map +1 -0
  134. package/dist/extraction.test.js +137 -0
  135. package/dist/extraction.test.js.map +1 -0
  136. package/dist/index.d.ts +38 -0
  137. package/dist/index.d.ts.map +1 -0
  138. package/dist/index.js +35 -0
  139. package/dist/index.js.map +1 -0
  140. package/dist/queue.d.ts +52 -0
  141. package/dist/queue.d.ts.map +1 -0
  142. package/dist/queue.js +139 -0
  143. package/dist/queue.js.map +1 -0
  144. package/dist/queue.test.d.ts +2 -0
  145. package/dist/queue.test.d.ts.map +1 -0
  146. package/dist/queue.test.js +161 -0
  147. package/dist/queue.test.js.map +1 -0
  148. package/dist/search.d.ts +163 -0
  149. package/dist/search.d.ts.map +1 -0
  150. package/dist/search.js +653 -0
  151. package/dist/search.js.map +1 -0
  152. package/dist/search.test.d.ts +6 -0
  153. package/dist/search.test.d.ts.map +1 -0
  154. package/dist/search.test.js +551 -0
  155. package/dist/search.test.js.map +1 -0
  156. package/dist/server.d.ts +33 -0
  157. package/dist/server.d.ts.map +1 -0
  158. package/dist/server.js +2530 -0
  159. package/dist/server.js.map +1 -0
  160. package/dist/server.test.d.ts +8 -0
  161. package/dist/server.test.d.ts.map +1 -0
  162. package/dist/server.test.js +2397 -0
  163. package/dist/server.test.js.map +1 -0
  164. package/dist/version.d.ts +2 -0
  165. package/dist/version.d.ts.map +1 -0
  166. package/dist/version.js +5 -0
  167. package/dist/version.js.map +1 -0
  168. package/dist/wiki.d.ts +496 -0
  169. package/dist/wiki.d.ts.map +1 -0
  170. package/dist/wiki.js +2677 -0
  171. package/dist/wiki.js.map +1 -0
  172. package/dist/wiki.test.d.ts +8 -0
  173. package/dist/wiki.test.d.ts.map +1 -0
  174. package/dist/wiki.test.js +1881 -0
  175. package/dist/wiki.test.js.map +1 -0
  176. package/docs/code-analysis-plugins.md +169 -0
  177. package/docs/configuration.md +135 -0
  178. package/docs/diagrams/cobol-analysis-flow.png +0 -0
  179. package/docs/diagrams/cobol-analysis-flow.svg +156 -0
  180. package/docs/evidence-envelope.md +176 -0
  181. package/docs/graph-1.gif +0 -0
  182. package/docs/legacy-code-knowledge-compiler-prd.md +511 -0
  183. package/docs/product-direction.md +120 -0
  184. package/docs/request-optimization.md +201 -0
  185. package/docs/search.md +266 -0
  186. package/docs/tools.md +269 -0
  187. package/graph-viewer/dist/cli.d.ts +3 -0
  188. package/graph-viewer/dist/cli.d.ts.map +1 -0
  189. package/graph-viewer/dist/cli.js +97 -0
  190. package/graph-viewer/dist/cli.js.map +1 -0
  191. package/graph-viewer/dist/graph.d.ts +14 -0
  192. package/graph-viewer/dist/graph.d.ts.map +1 -0
  193. package/graph-viewer/dist/graph.js +96 -0
  194. package/graph-viewer/dist/graph.js.map +1 -0
  195. package/graph-viewer/dist/index.d.ts +6 -0
  196. package/graph-viewer/dist/index.d.ts.map +1 -0
  197. package/graph-viewer/dist/index.js +4 -0
  198. package/graph-viewer/dist/index.js.map +1 -0
  199. package/graph-viewer/dist/parse.d.ts +10 -0
  200. package/graph-viewer/dist/parse.d.ts.map +1 -0
  201. package/graph-viewer/dist/parse.js +62 -0
  202. package/graph-viewer/dist/parse.js.map +1 -0
  203. package/graph-viewer/dist/server.d.ts +15 -0
  204. package/graph-viewer/dist/server.d.ts.map +1 -0
  205. package/graph-viewer/dist/server.js +168 -0
  206. package/graph-viewer/dist/server.js.map +1 -0
  207. package/graph-viewer/dist/types.d.ts +48 -0
  208. package/graph-viewer/dist/types.d.ts.map +1 -0
  209. package/graph-viewer/dist/types.js +2 -0
  210. package/graph-viewer/dist/types.js.map +1 -0
  211. package/graph-viewer/public/app.js +525 -0
  212. package/graph-viewer/public/index.html +68 -0
  213. package/graph-viewer/public/style.css +68 -0
  214. package/package.json +73 -0
  215. package/skills/aceclaw/SKILL.md +173 -0
  216. package/skills/agent-wiki/SKILL.md +184 -0
  217. package/skills/agent-wiki/references/tools-reference.md +368 -0
@@ -0,0 +1,368 @@
1
+ # Agent Wiki — Tool Parameter Reference
2
+
3
+ Complete parameter schemas for all 15 public tools.
4
+
5
+ Legacy tool names (raw_add, raw_fetch, raw_import_confluence, raw_import_jira, wiki_search_read, wiki_init, wiki_config, wiki_rebuild, wiki_lint, code_trace_variable, code_impact, knowledge_ingest_batch, knowledge_digest_write) remain supported for backward compatibility but are no longer listed in the public MCP tool surface.
6
+
7
+ ---
8
+
9
+ ## RAW LAYER
10
+
11
+ ### raw_ingest
12
+
13
+ Ingest raw source documents. Select `mode` to control the ingestion method.
14
+
15
+ ```json
16
+ {
17
+ "mode": "(required) string — add | fetch | import_confluence | import_jira",
18
+
19
+ "filename": "[add] string — Filename in raw/ (e.g. 'paper.pdf'). For directory imports, becomes subdirectory prefix.",
20
+ "content": "[add] string — File content as string. Either content or source_path is required.",
21
+ "source_path":"[add] string — Absolute path to local file or directory to copy into raw/.",
22
+ "source_url": "[add/fetch] string — Original URL where the document was downloaded from",
23
+ "description":"[add/fetch] string — Brief description",
24
+ "tags": "[add/fetch] string array — Tags for categorization",
25
+ "auto_version":"[add] boolean — Create versioned copy if file exists (e.g. report_v2.xlsx). Default: false",
26
+ "pattern": "[add] string — Glob filter for directory imports (e.g. '*.html'). Ignored for single files.",
27
+
28
+ "url": "[fetch] string — URL to download. arXiv abs URLs auto-converted to PDF. [import_confluence] Confluence page URL. [import_jira] Jira issue URL.",
29
+ "recursive": "[import_confluence] boolean — Import child pages recursively (default: false)",
30
+ "depth": "[import_confluence] number — Max recursion depth (-1 = unlimited, default: 50 if recursive)",
31
+ "auth_env": "[import_confluence] string — Env var for auth (default: CONFLUENCE_API_TOKEN). [import_jira] Env var (default: JIRA_API_TOKEN)",
32
+ "include_comments": "[import_jira] boolean — Include comments (default: true)",
33
+ "include_attachments": "[import_jira] boolean — Download attachments (default: true)",
34
+ "include_links": "[import_jira] boolean — Import linked issues (default: true)",
35
+ "link_depth": "[import_jira] number — Levels of linked issues to follow (default: 1)"
36
+ }
37
+ ```
38
+
39
+ **mode: add** — `filename` required. Either `content` or `source_path` required.
40
+ Returns: `{ ok, document }` or `{ ok, imported, documents }` for directory.
41
+ Single image files (<10MB) returned inline — you MUST call wiki_write to describe them.
42
+
43
+ **mode: fetch** — `url` required.
44
+ Returns: `{ ok, document }`. Single images (<10MB) returned inline.
45
+
46
+ **mode: import_confluence** — `url` required. Requires `CONFLUENCE_API_TOKEN='email:api-token'`.
47
+ Returns: `{ ok, pages, files, tree }`
48
+
49
+ **mode: import_jira** — `url` required. Requires `JIRA_API_TOKEN='email:api-token'`.
50
+ Returns: `{ ok, issueKey, summary, files, linkedIssues, importedCount }`
51
+
52
+ ### raw_list
53
+
54
+ List all raw documents with metadata. No parameters.
55
+
56
+ ```bash
57
+ agent-wiki call raw_list
58
+ ```
59
+
60
+ Returns: `{ documents: [...], count: N }`
61
+
62
+ ### raw_read
63
+
64
+ Read a raw document's content and metadata.
65
+
66
+ ```json
67
+ {
68
+ "filename": "(required) string — Path relative to raw/ (e.g. 'article.md')",
69
+ "pages": "string — Page/slide range (e.g. '1-5', '3', '1-3,7-10'). PDF and PPTX only.",
70
+ "sheet": "string — Sheet name for XLSX files (e.g. 'Revenue'). Omit to read all sheets.",
71
+ "offset": "number — Line offset for DOCX/text pagination. Default: 0.",
72
+ "limit": "number — Max lines for DOCX/text pagination. Default: 200, max: 500."
73
+ }
74
+ ```
75
+
76
+ **Default behavior (no pagination params):**
77
+ - Text/SVG: full content, truncated at 10K chars
78
+ - PDF/DOCX/XLSX/PPTX: auto-extracted text, truncated at 10K chars
79
+ - Images (<10MB): returned inline (no truncation)
80
+ - Other binary: metadata only
81
+
82
+ **With pagination params** — bypasses 10K truncation, returns full requested range:
83
+
84
+ | Format | Param | Response extras |
85
+ |--------|-------|----------------|
86
+ | PDF | `pages="1-10"` | `pagination.total_pages` |
87
+ | PPTX | `pages="1-20"` | `pagination.total_slides` |
88
+ | XLSX | `sheet="Name"` | `pagination.sheet_names`, `total_sheets` |
89
+ | DOCX/text | `offset=0, limit=200` | `pagination.total_lines`, `truncated`, `next_offset` |
90
+
91
+ For XLSX: read without `sheet` first to get `sheet_names`, then target each sheet by name.
92
+ For DOCX/text: use `next_offset` from the response to paginate through the full document.
93
+
94
+ ### raw_versions
95
+
96
+ List all versions of a raw file.
97
+
98
+ ```json
99
+ {
100
+ "filename": "(required) string — Base filename (e.g. 'report.xlsx')"
101
+ }
102
+ ```
103
+
104
+ Returns: `{ versions: [...], latest: "filename", count: N }`
105
+
106
+ ### raw_coverage
107
+
108
+ Report which raw/ files are not yet covered by any wiki page.
109
+
110
+ ```json
111
+ {
112
+ "limit": "number — Max uncovered entries (default: 50)",
113
+ "sort": "string — newest | oldest | largest (default: newest)",
114
+ "tag": "string — Only consider files with this tag"
115
+ }
116
+ ```
117
+
118
+ Returns: `{ uncovered: [...], covered: N, total: N, coverageRatio: N }`
119
+
120
+ ---
121
+
122
+ ## WIKI LAYER
123
+
124
+ ### wiki_read
125
+
126
+ Read a wiki page (frontmatter + markdown body).
127
+
128
+ ```json
129
+ {
130
+ "page": "string — Path relative to wiki/ (use for single-page reads)",
131
+ "pages": "string array — Paths for multi-page reads (returns array of results)",
132
+ "section": "string — Heading to read (e.g. '## Installation'). Case-insensitive partial match.",
133
+ "offset": "number — First line to return (default: 0). For line-based pagination.",
134
+ "limit": "number — Max lines (default: 200, max: 500)."
135
+ }
136
+ ```
137
+
138
+ Either `page` or `pages` is required. Large pages (>200 lines) return paginated JSON with `toc`.
139
+
140
+ ### wiki_write
141
+
142
+ Create or update a wiki page. Auto-classifies type/tags if missing. Auto-routes to topic subdirectories.
143
+
144
+ ```json
145
+ {
146
+ "page": "(required) string — Path relative to wiki/",
147
+ "content": "(required) string — Full content with YAML frontmatter + Markdown body",
148
+ "source": "string — Provenance note (why this write happened)",
149
+ "return_content": "boolean — Include final written content in response. Default: false."
150
+ }
151
+ ```
152
+
153
+ Returns: `{ ok, page, routed, autoClassified: { type, tags, confidence }, autoLinked, content? }`
154
+
155
+ Content format:
156
+ ```markdown
157
+ ---
158
+ title: Page Title
159
+ type: concept
160
+ tags: [tag1, tag2]
161
+ sources: [raw/source-file.pdf]
162
+ ---
163
+
164
+ # Page Title
165
+
166
+ Markdown body here...
167
+ ```
168
+
169
+ Valid types: person, concept, event, artifact, code, comparison, summary, how-to, note, synthesis
170
+
171
+ ### wiki_delete
172
+
173
+ Delete a wiki page.
174
+
175
+ ```json
176
+ {
177
+ "page": "(required) string — Path relative to wiki/"
178
+ }
179
+ ```
180
+
181
+ Cannot delete system pages: index.md, log.md, timeline.md, */index.md
182
+
183
+ ### wiki_list
184
+
185
+ List wiki pages with optional filters.
186
+
187
+ ```json
188
+ {
189
+ "type": "string — Filter by entity type (person|concept|event|artifact|code|comparison|summary|how-to|note|synthesis)",
190
+ "tag": "string — Filter by tag"
191
+ }
192
+ ```
193
+
194
+ Returns: `{ pages: [...], count: N }`
195
+
196
+ ### wiki_search
197
+
198
+ Full-text BM25 keyword search. Optionally reads top results in one call.
199
+
200
+ ```json
201
+ {
202
+ "query": "(required) string — Search keywords",
203
+ "limit": "number — Max results (default: 10)",
204
+ "type": "string — Filter by entity type",
205
+ "tags": "string array — Filter by tags (any match)",
206
+ "include_content": "boolean — Inline page content in results. Default: false.",
207
+ "inline_budget": "number — Max total chars of inlined content (with include_content). Omit for no limit.",
208
+ "read_top_n": "number — Read top N unique matching pages (max: 10). Activates combined search+read mode.",
209
+ "section": "string — Section heading filter applied to read pages (with read_top_n).",
210
+ "per_page_limit":"number — Max lines per read page (default: 200, max: 500) (with read_top_n).",
211
+ "include_toc": "boolean — Include TOC for truncated pages (default: false) (with read_top_n)."
212
+ }
213
+ ```
214
+
215
+ **Without `read_top_n`:** Returns `{ results: [{ path, score, snippet, section? }], count: N }`.
216
+ When `include_content=true`, each result also includes `content`.
217
+
218
+ **With `read_top_n`:** Returns `{ results, count, pages: [{ path, content, ... }], pagesRead, nextReads }`.
219
+ `pages` contains full content for top N unique matching pages (deduplicated).
220
+ `nextReads` lists remaining unique page paths for follow-up reads.
221
+
222
+ **When no results found:** Returns `knowledge_gap` with `suggested_page`, `suggested_title`, `suggested_type`, `suggested_tags`.
223
+
224
+ ### wiki_admin
225
+
226
+ Wiki administration and maintenance.
227
+
228
+ ```json
229
+ {
230
+ "action": "(required) string — init | config | rebuild | lint",
231
+ "path": "[init] string — Config root where .agent-wiki.yaml is created (default: '.')",
232
+ "workspace": "[init] string — Separate data directory for wiki/, raw/, schemas/",
233
+ "apply_fixes":"[lint] boolean — Auto-fix fixable issues (missing frontmatter). Default: false."
234
+ }
235
+ ```
236
+
237
+ **action: init** — Initialize a new knowledge base. Creates wiki/, raw/, schemas/, .agent-wiki.yaml.
238
+ Returns: `{ ok, configRoot, workspace, message }`
239
+
240
+ **action: config** — Show current workspace configuration.
241
+ Returns: `{ configRoot, workspace, wikiDir, rawDir, schemasDir, lint, search, separateWorkspace, schemas }`
242
+
243
+ **action: rebuild** — Rebuild index.md, timeline.md, code knowledge graphs, and optional vector index.
244
+ Returns: `{ ok, message }`
245
+
246
+ **action: lint** — Run comprehensive health checks: contradictions, orphan pages, broken links, SHA-256 integrity, synthesis integrity.
247
+ Returns: `{ pagesChecked, rawChecked, issues: [...], contradictions: [...], fixed, fixedPages }`
248
+
249
+ ---
250
+
251
+ ## KNOWLEDGE INGESTION
252
+
253
+ ### knowledge_ingest
254
+
255
+ Knowledge ingestion pipeline.
256
+
257
+ ```json
258
+ {
259
+ "mode": "(required) string — batch | digest_write",
260
+
261
+ "source_path": "[batch] string — (required) Absolute path to directory or file to ingest",
262
+ "pattern": "[batch] string — Glob filter for directory (e.g. '*.pdf', '*.{xlsx,docx}')",
263
+ "maxFiles": "[batch] number — Max files to process (default: 100, max: 1000)",
264
+ "topic": "[batch] string — Topic name for digest packs (default: 'general')",
265
+ "chunkLines": "[batch] number — Max lines per chunk (default: 100)",
266
+ "packLines": "[batch] number — Max lines per digest pack (default: 500)",
267
+ "continueOnError":"[batch] boolean — Continue on individual file errors (default: true)",
268
+
269
+ "pages": "[digest_write] array — (required) Wiki pages to write. Each: { page, title, body, type?, tags?, topic?, sources?, sourcePacks? }"
270
+ }
271
+ ```
272
+
273
+ **mode: batch** — Imports files into raw/, extracts text, chunks, and packs into digest packs under raw/digest-packs/{topic}/.
274
+ Returns: `{ ok, matched, imported, skipped, extracted, chunks, packs, failed, packPaths, nextRecommendedReads }`
275
+
276
+ **mode: digest_write** — Writes LLM-generated digest summaries to wiki with provenance. Auto-classifies, auto-routes, auto-timestamps.
277
+ Returns: `{ results: [...], count, written }`
278
+
279
+ ---
280
+
281
+ ## CODE ANALYSIS
282
+
283
+ ### code_parse
284
+
285
+ Parse source file into structured knowledge.
286
+
287
+ ```json
288
+ {
289
+ "path": "(required) string — Path in raw/ (e.g. 'PAYROLL.cbl')",
290
+ "trace_variable": "string — Optional variable name to trace"
291
+ }
292
+ ```
293
+
294
+ Supported: COBOL (.cbl, .cob, .cpy)
295
+
296
+ Outputs:
297
+ - `raw/parsed/<lang>/<stem>.ast.json` — Language-specific AST
298
+ - `raw/parsed/<lang>/<stem>.normalized.json` — Language-agnostic model
299
+ - `raw/parsed/<lang>/<stem>.summary.json` — Summary
300
+ - `raw/parsed/<lang>/<stem>.model.json` — Language-specific model (if available)
301
+ - Auto-generated wiki pages
302
+
303
+ Returns: `{ summary, normalizedModel, artifacts, wikiPages, variableTrace? }`
304
+
305
+ ### code_query
306
+
307
+ Query parsed code knowledge.
308
+
309
+ ```json
310
+ {
311
+ "query_type": "(required) string — trace_variable | impact | procedure_flow | field_lineage | dataflow_edges",
312
+
313
+ "path": "[trace_variable/procedure_flow/dataflow_edges] string — (required) Path in raw/ (e.g. 'PAYROLL.cbl')",
314
+ "variable": "[trace_variable] string — (required) Variable name (e.g. 'WS-TOTAL-SALARY')",
315
+
316
+ "node_id": "[impact] string — (required) Canonical node ID or logical name (e.g. 'copybook:DATE-UTILS')",
317
+ "kind": "[impact] string — Node kind: program | copybook | dataset | job | step",
318
+ "max_depth": "[impact/dataflow_edges] number — Max traversal depth (default: 10)",
319
+ "language": "[impact/field_lineage] string — Language plugin to use (default: 'cobol')",
320
+
321
+ "procedure": "[procedure_flow] string — Optional procedure/section/paragraph name to focus traversal from",
322
+ "procedure_kind":"[procedure_flow] string — Optional kind filter: section | paragraph",
323
+
324
+ "field_name": "[field_lineage] string — Field name to query (e.g. 'CUSTOMER-ID')",
325
+ "qualified_name":"[field_lineage] string — Optional qualified field path (e.g. 'CUSTOMER-REC.CUSTOMER-ID')",
326
+ "copybook": "[field_lineage] string — Optional copybook canonical id or logical name",
327
+
328
+ "from": "[dataflow_edges] string — Filter: only edges whose source field matches",
329
+ "to": "[dataflow_edges] string — Filter: only edges whose target field matches",
330
+ "field": "[dataflow_edges] string — Starting field for transitive traversal (requires transitive: true)",
331
+ "transitive": "[dataflow_edges] boolean — Follow edges transitively from `field` (default: false)",
332
+ "direction": "[dataflow_edges] string — downstream | upstream | both (default: downstream)"
333
+ }
334
+ ```
335
+
336
+ **query_type: trace_variable** — Traces all references to a variable in a parsed source file.
337
+ Returns: `{ variable, file, references: [...] }`
338
+
339
+ **query_type: impact** — Queries the compiled knowledge graph for downstream impact. Requires compiled knowledge-graph artifact (run `code_parse` on COBOL files first).
340
+ Returns: `{ query, source, summary, impactedByDepth: [...], diagnostics }`
341
+
342
+ **query_type: procedure_flow** — Returns section/paragraph PERFORM flow for one source file.
343
+ Returns: `{ path, procedure?, flow: [...] }`
344
+
345
+ **query_type: field_lineage** — Queries compiled cross-file field lineage. Requires `field-lineage.json` artifact — built by parsing BOTH `.cbl`/`.cob` program files AND `.cpy` copybook files.
346
+ Returns: `{ query, summary, deterministic: [...], inferredHighConfidence: [...], inferredAmbiguous: [...] }`
347
+
348
+ **query_type: dataflow_edges** — Queries MOVE/COMPUTE/SQL/CALL dataflow edges for one source file. Pass `field + transitive: true` to follow chains. Requires `path`.
349
+ Returns (non-transitive): `{ file, total, edges: [...] }`
350
+ Returns (transitive): `{ file, field, direction, transitive, total_fields, total_edges, levels: [...] }`
351
+
352
+ ---
353
+
354
+ ## BATCH
355
+
356
+ ### batch
357
+
358
+ Execute multiple tool calls in one request.
359
+
360
+ ```json
361
+ {
362
+ "operations": "(required) array — [{ tool: string, args?: object }, ...]"
363
+ }
364
+ ```
365
+
366
+ Supports any combination of tools. Max 50 operations. wiki_rebuild / wiki_admin action:rebuild are deduplicated (runs once at end). Failures per-operation do not abort the batch.
367
+
368
+ Returns: `{ results: [{ tool, result? | error? }], count: N }`