@neuledge/context 1.2.7 → 1.2.8
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.
- package/README.md +14 -1
- package/dist/guidance.d.ts +1 -1
- package/dist/guidance.js +1 -1
- package/dist/guidance.js.map +1 -1
- package/dist/search.js +12 -8
- package/dist/search.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -556,6 +556,18 @@ context query nextjs 'middleware authentication'
|
|
|
556
556
|
# Returns the same JSON format as the MCP get_docs tool
|
|
557
557
|
```
|
|
558
558
|
|
|
559
|
+
Topics are literal keywords, matched together (AND). Punctuation separates words,
|
|
560
|
+
so `ExecStart=`, `systemctl --user`, and `spring.main.banner-mode` can be used
|
|
561
|
+
directly. Underscores stay inside a word, so `spring_boot` matches the identifier
|
|
562
|
+
rather than the two words apart. Words such as `AND`, `OR`, `NOT`, and `NEAR` are searched as text;
|
|
563
|
+
advanced FTS syntax is not supported.
|
|
564
|
+
|
|
565
|
+
Use paired double quotes for a phrase, for example
|
|
566
|
+
`context query nextjs '"server components" rendering'`. Phrase words must appear
|
|
567
|
+
next to each other in order, with the usual search stemming. An unmatched double
|
|
568
|
+
quote is ignored and the remaining words are searched as keywords. Empty or
|
|
569
|
+
punctuation-only topics return no results. These rules also apply to MCP `get_docs`.
|
|
570
|
+
|
|
559
571
|
---
|
|
560
572
|
|
|
561
573
|
## :gear: Architecture
|
|
@@ -623,6 +635,7 @@ Yes! The `registry/` directory has YAML definitions organized by package manager
|
|
|
623
635
|
- **`registry/npm/`** — JavaScript/TypeScript (Next.js, React, Tailwind, etc.)
|
|
624
636
|
- **`registry/pip/`** — Python (FastAPI, Flask, Django, Pydantic)
|
|
625
637
|
- **`registry/maven/`** — Java (Spring Boot, JUnit, Micrometer)
|
|
638
|
+
- **`registry/go/`** — Go modules, by full module path (Cobra)
|
|
626
639
|
|
|
627
640
|
To add a package, create a YAML file. Two source types are supported:
|
|
628
641
|
|
|
@@ -661,7 +674,7 @@ versions:
|
|
|
661
674
|
- "changelog.html"
|
|
662
675
|
```
|
|
663
676
|
|
|
664
|
-
Version discovery is supported for npm, PyPI, and
|
|
677
|
+
Version discovery is supported for npm, PyPI, Maven Central, Hex, and the Go module proxy. See existing definitions for examples.
|
|
665
678
|
|
|
666
679
|
---
|
|
667
680
|
|
package/dist/guidance.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const GET_DOCS_DESCRIPTION = "Provides version-specific documentation for installed libraries. Use this as your primary reference before web searches when the library is already installed. For best results, use a short API name or keyword for the topic. If the library is missing, use search_packages, then download_package, then retry get_docs.";
|
|
2
2
|
export declare const GET_DOCS_LIBRARY_DESCRIPTION = "Installed library to search (name@version). If it is not installed, use search_packages, then download_package, then retry get_docs.";
|
|
3
|
-
export declare const GET_DOCS_TOPIC_DESCRIPTION = "Use a short API name, keyword, or phrase (for example:
|
|
3
|
+
export declare const GET_DOCS_TOPIC_DESCRIPTION = "Use a short API name, keyword, or phrase (for example: createServer, cors middleware). Search terms are all matched together, so extra words will narrow but can also eliminate results. Punctuation separates words. Paired double quotes require a phrase (\"server components\"); unmatched quotes are ignored. FTS operator words are literal.";
|
|
4
4
|
export declare const SEARCH_PACKAGES_DESCRIPTION = "Search for documentation packages available on the registry server. Use short package names like 'react', 'next', or 'fastapi'. If you find a match, call download_package, then retry get_docs. If the registry package is unavailable or insufficient, ask the user to run `context add` to build docs from source.";
|
|
5
5
|
export declare const SEARCH_PACKAGES_NAME_DESCRIPTION = "Short package name to search for (e.g., \"react\", \"next\", \"fastapi\")";
|
|
6
6
|
export declare const DOWNLOAD_PACKAGE_DESCRIPTION = "Download and install a documentation package from the registry server. Once installed, retry get_docs against the installed name@version for instant offline documentation lookup.";
|
package/dist/guidance.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const GET_DOCS_DESCRIPTION = "Provides version-specific documentation for installed libraries. Use this as your primary reference before web searches when the library is already installed. For best results, use a short API name or keyword for the topic. If the library is missing, use search_packages, then download_package, then retry get_docs.";
|
|
2
2
|
export const GET_DOCS_LIBRARY_DESCRIPTION = "Installed library to search (name@version). If it is not installed, use search_packages, then download_package, then retry get_docs.";
|
|
3
|
-
export const GET_DOCS_TOPIC_DESCRIPTION =
|
|
3
|
+
export const GET_DOCS_TOPIC_DESCRIPTION = 'Use a short API name, keyword, or phrase (for example: createServer, cors middleware). Search terms are all matched together, so extra words will narrow but can also eliminate results. Punctuation separates words. Paired double quotes require a phrase ("server components"); unmatched quotes are ignored. FTS operator words are literal.';
|
|
4
4
|
export const SEARCH_PACKAGES_DESCRIPTION = "Search for documentation packages available on the registry server. Use short package names like 'react', 'next', or 'fastapi'. If you find a match, call download_package, then retry get_docs. If the registry package is unavailable or insufficient, ask the user to run `context add` to build docs from source.";
|
|
5
5
|
export const SEARCH_PACKAGES_NAME_DESCRIPTION = 'Short package name to search for (e.g., "react", "next", "fastapi")';
|
|
6
6
|
export const DOWNLOAD_PACKAGE_DESCRIPTION = "Download and install a documentation package from the registry server. Once installed, retry get_docs against the installed name@version for instant offline documentation lookup.";
|
package/dist/guidance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance.js","sourceRoot":"","sources":["../src/guidance.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAC/B,6TAA6T,CAAC;AAEhU,MAAM,CAAC,MAAM,4BAA4B,GACvC,sIAAsI,CAAC;AAEzI,MAAM,CAAC,MAAM,0BAA0B,GACrC,
|
|
1
|
+
{"version":3,"file":"guidance.js","sourceRoot":"","sources":["../src/guidance.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAC/B,6TAA6T,CAAC;AAEhU,MAAM,CAAC,MAAM,4BAA4B,GACvC,sIAAsI,CAAC;AAEzI,MAAM,CAAC,MAAM,0BAA0B,GACrC,kVAAkV,CAAC;AAErV,MAAM,CAAC,MAAM,2BAA2B,GACtC,uTAAuT,CAAC;AAE1T,MAAM,CAAC,MAAM,gCAAgC,GAC3C,qEAAqE,CAAC;AAExE,MAAM,CAAC,MAAM,4BAA4B,GACvC,oLAAoL,CAAC;AAEvL,MAAM,CAAC,MAAM,8BAA8B,GACzC,iJAAiJ,CAAC;AAEpJ,MAAM,CAAC,MAAM,wBAAwB,GACnC,yPAAyP,CAAC"}
|
package/dist/search.js
CHANGED
|
@@ -10,16 +10,20 @@ const CONFIG = {
|
|
|
10
10
|
RELEVANCE_DROP: 0.5,
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* Quote literal terms so reserved words cannot become FTS5 operators.
|
|
14
|
+
* Only paired double quotes group a phrase; unmatched quotes are ignored.
|
|
15
|
+
* Punctuation separates words, except "_", which keeps snake_case identifiers
|
|
16
|
+
* together as one phrase. Terms/phrases are implicitly ANDed.
|
|
16
17
|
*/
|
|
17
18
|
function buildQuery(topic) {
|
|
18
|
-
|
|
19
|
-
.
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
.trim()
|
|
19
|
+
const parts = topic
|
|
20
|
+
.replace(/[^\p{L}\p{N}\p{M}_\s"]/gu, " ")
|
|
21
|
+
.match(/"[^"]*"|[^\s"]+/g);
|
|
22
|
+
return (parts ?? [])
|
|
23
|
+
.map((part) => part.replaceAll('"', "").trim())
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.map((part) => `"${part}"`)
|
|
26
|
+
.join(" ");
|
|
23
27
|
}
|
|
24
28
|
function searchFts(db, query) {
|
|
25
29
|
const ftsQuery = buildQuery(query);
|
package/dist/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,uDAAuD;AACvD,sEAAsE;AACtE,qFAAqF;AACrF,yFAAyF;AACzF,i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