oscar64-mcp-docs 0.1.2 → 1.0.0

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 (3) hide show
  1. package/README.md +39 -14
  2. package/dist/stdio.js +1407 -1123
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,14 +6,36 @@ Local MCP server (Mastra + stdio) exposing Oscar64 documentation and tutorial co
6
6
 
7
7
  - HTTP-only source syncing (no git dependency)
8
8
  - 24h stale checks with remote SHA + local zip hash detection
9
+ - Per-repo sync locking to avoid concurrent write conflicts across multiple server processes
9
10
  - Anchored manual retrieval (`docs://oscar64/manual#...`)
11
+ - Unified code file URIs (`code://oscar/...`, `code://sample/...`, `code://tutorial/...`) for agent-facing results
10
12
  - Tutorial metadata generated from folder structure and source previews
11
- - Generic concept classifier with evidence + concept-derived categories
13
+ - Deterministic faceted classifier (primary track + facets + evidence + confidence)
12
14
  - MiniSearch-powered doc/tutorial relevance search
13
15
  - Ranked code search across all exposed sources
14
16
  - Minimal MCP tool responses (`ok` + `data`/`error`)
15
17
  - Single canonical file exposure policy (`.c`, `.h`, `.cpp`, `.s`, `.asm`, `.inc`, `.md`, `.txt`)
16
- - LLM guidance resources (`index://quickstart`, `index://tooling-guide`, `index://contracts`, `index://errors`)
18
+ - Index discovery tool for navigation/catalog (`list_indexes`)
19
+
20
+ ## Cache and Sync Layout
21
+
22
+ Cache root:
23
+
24
+ - `OSCAR_MCP_CACHE_DIR` (if set)
25
+ - default: `~/.cache/oscar-mcp`
26
+
27
+ Directory layout under cache root:
28
+
29
+ - `sources/<repo>/current` -> current unpacked repo content
30
+ - `meta/<repo>.json` -> sync metadata (`lastRemoteSha`, `resolvedSha`, `lastZipHash`, timestamps)
31
+ - `meta/<repo>.lock` -> sync lock file used to serialize per-repo updates across processes
32
+ - `index/` -> generated index artifacts
33
+
34
+ Lock behavior:
35
+
36
+ - lock acquisition uses an exclusive create on `meta/<repo>.lock`
37
+ - waits up to 5 minutes for a lock holder
38
+ - treats locks older than 30 minutes as stale and removes them
17
39
 
18
40
  ## Development
19
41
 
@@ -54,8 +76,14 @@ The executable entry is built to `dist/stdio.js`.
54
76
 
55
77
  Primary tools:
56
78
 
57
- - `search(query, limit)` -> unified doc/tutorial/code search with strict fields (doc/tutorial hits include `title`, `snippet`; code hits include `line_start`, `line_end`, `snippet`)
58
- - `read_uri(uri, binary_mode, max_base64_bytes)` -> strict text/binary read response for any URI returned by `search`
79
+ - `search(query, limit, system, include_details)` -> unified manual/code search with strict hit fields (`source`, `uri`, `title`, `snippet`, `score`, `classification_summary`), optional `referenced_files` as `code://...` URIs readable by `read_uri`, and optional `classification_details`; `system` defaults to `c64` and supports `all` for cross-system results
80
+ - `read_uri(uri, binary_mode, max_base64_bytes)` -> returns `ok + data` where `data.content_type` is `text` or `binary` for `docs://...` and `code://...`
81
+ - `list_indexes(type, system)` -> lists `topics`/`tutorials`/`samples`/`headers` entries; `type` defaults to `headers`, `system` defaults to `c64`, and `system=all` returns cross-system indexes
82
+
83
+ URI guidance:
84
+
85
+ - manual/docs: `docs://...`
86
+ - code files: `code://oscar/...`, `code://sample/...`, and `code://tutorial/...`
59
87
 
60
88
  Standard tool output envelope:
61
89
 
@@ -63,12 +91,9 @@ Standard tool output envelope:
63
91
  - `data`: tool payload on success
64
92
  - `error`: structured error payload on failure
65
93
 
66
- Reference resources:
94
+ Index discovery:
67
95
 
68
- - `index://quickstart`
69
- - `index://tooling-guide`
70
- - `index://contracts`
71
- - `index://errors`
96
+ - `list_indexes(type)` returns only `docs://` and `code://` URIs that can be read directly with `read_uri`.
72
97
 
73
98
  ## Versioning
74
99
 
@@ -107,13 +132,13 @@ Optional env vars:
107
132
  - `NPM_TAG` (default `latest`)
108
133
  - `NPM_OTP` (for 2FA)
109
134
 
110
- ## Tutorial Classification Config
135
+ ## Classification Config
111
136
 
112
- Classification policy is data-driven in:
137
+ Classification policy and deterministic scoring are data-driven in:
113
138
 
114
- - `src/config/tutorial-classification.ts`
139
+ - `src/config/classification-v2.ts`
115
140
 
116
141
  This file defines:
117
142
 
118
- - factual concept rules (`CONCEPT_RULES`) using regex patterns + evidence reasons
119
- - concept groups for top-level categories (`CATEGORY_FROM_CONCEPTS`)
143
+ - weighted facet rules and primary-track inference
144
+ - tutorial ID band seeds and precedence tie-breaks