blume 1.2.0 → 1.2.1
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/CHANGELOG.md +8 -0
- package/dist/cli/index.js +39 -9
- package/dist/cli/index.js.map +8 -8
- package/docs/configuration/search.mdx +15 -0
- package/package.json +2 -2
- package/src/ai/ask-context.ts +7 -1
- package/src/ai/ask-data.ts +1 -0
- package/src/ai/mcp/data.ts +7 -0
- package/src/ai/mcp/server.ts +9 -4
- package/src/ai/mcp/stdio.ts +4 -1
- package/src/astro/templates.ts +15 -4
- package/src/components/layout/NavTree.astro +4 -4
- package/src/components/layout/RootLayout.astro +1 -1
- package/src/components/layout/search/orama.ts +5 -2
- package/src/search/orama-index.ts +55 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# blume
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a015b0a: Match CJK and Thai content in the default Orama search provider. With `i18n.defaultLocale` set to a language written without spaces (Japanese, Chinese, Korean, Thai), the search index now uses a word-segmenting tokenizer built on `Intl.Segmenter` — previously every query in those scripts silently returned zero results because the default tokenizer collapsed the text to no tokens. The fix covers the search dialog, the MCP server's `search_docs` tool, and Ask AI grounding, and keeps Latin terms matching case-insensitively on mixed-language sites.
|
|
8
|
+
- 454e67f: Match every hoverable sidebar navigation row — the back rows, routed panel header, and flat group header — to the shared 0.65rem navigation radius.
|
|
9
|
+
- 17d520b: Style the desktop sidebar scrollbar with a thin, theme-colored thumb and a transparent track. The mobile drawer and the page scrollbar keep their platform defaults. Requires Tailwind CSS 4.3 or later, which is now the declared minimum.
|
|
10
|
+
|
|
3
11
|
## 1.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/cli/index.js
CHANGED
|
@@ -3903,10 +3903,10 @@ var searchClientImport = (module) => `import { createSearch as create } from "bl
|
|
|
3903
3903
|
`;
|
|
3904
3904
|
var SEARCH_BASE_IMPORT = `import { joinBase } from "blume/components/islands/base-path.ts";
|
|
3905
3905
|
`;
|
|
3906
|
-
var staticSearchClient = (module) => `${SEARCH_CLIENT_HEADER}${searchClientImport(module)}${SEARCH_BASE_IMPORT}
|
|
3906
|
+
var staticSearchClient = (module, locale) => `${SEARCH_CLIENT_HEADER}${searchClientImport(module)}${SEARCH_BASE_IMPORT}
|
|
3907
3907
|
const indexUrl = joinBase(import.meta.env.BASE_URL, "blume-search.json");
|
|
3908
3908
|
|
|
3909
|
-
export const createSearch = () => create({ indexUrl });
|
|
3909
|
+
export const createSearch = () => create({ indexUrl${locale ? `, locale: ${JSON.stringify(locale)}` : ""} });
|
|
3910
3910
|
`;
|
|
3911
3911
|
var hostedSearchClient = (module, options) => `${SEARCH_CLIENT_HEADER}${searchClientImport(module)}
|
|
3912
3912
|
export const createSearch = () => create(${JSON.stringify(options)});
|
|
@@ -3936,7 +3936,7 @@ var hostedSearchOptions = (search) => {
|
|
|
3936
3936
|
var searchClientTemplate = (config) => {
|
|
3937
3937
|
const { search } = config;
|
|
3938
3938
|
if (search.provider === "orama" || search.provider === "flexsearch") {
|
|
3939
|
-
return staticSearchClient(search.provider);
|
|
3939
|
+
return staticSearchClient(search.provider, search.provider === "orama" ? config.i18n?.defaultLocale : undefined);
|
|
3940
3940
|
}
|
|
3941
3941
|
const hosted = hostedSearchOptions(search);
|
|
3942
3942
|
if (hosted) {
|
|
@@ -12784,6 +12784,7 @@ var buildAskData = async (project) => {
|
|
|
12784
12784
|
includeWhenDisabled: true
|
|
12785
12785
|
});
|
|
12786
12786
|
return {
|
|
12787
|
+
defaultLocale: project.config.i18n?.defaultLocale,
|
|
12787
12788
|
documents: documents.map((doc) => ({
|
|
12788
12789
|
content: doc.content,
|
|
12789
12790
|
description: doc.description,
|
|
@@ -12851,6 +12852,7 @@ var buildMcpData = async (project) => {
|
|
|
12851
12852
|
}
|
|
12852
12853
|
return {
|
|
12853
12854
|
base: normalizeBasePath(config.deployment.base),
|
|
12855
|
+
defaultLocale: config.i18n?.defaultLocale,
|
|
12854
12856
|
documents: documents.map((doc) => ({
|
|
12855
12857
|
content: doc.content,
|
|
12856
12858
|
description: doc.description,
|
|
@@ -18137,8 +18139,36 @@ var SCHEMA = {
|
|
|
18137
18139
|
title: "string"
|
|
18138
18140
|
};
|
|
18139
18141
|
var BOOST = { description: 2, title: 3 };
|
|
18140
|
-
var
|
|
18141
|
-
|
|
18142
|
+
var SEGMENTED_LANGUAGES = new Set(["ja", "ko", "th", "zh"]);
|
|
18143
|
+
var segmentingTokenizer = (locale) => {
|
|
18144
|
+
const language = locale?.toLowerCase().split(/[-_]/u)[0] ?? "";
|
|
18145
|
+
if (!SEGMENTED_LANGUAGES.has(language)) {
|
|
18146
|
+
return;
|
|
18147
|
+
}
|
|
18148
|
+
if (typeof Intl.Segmenter !== "function") {
|
|
18149
|
+
return;
|
|
18150
|
+
}
|
|
18151
|
+
const segmenter = new Intl.Segmenter(language, { granularity: "word" });
|
|
18152
|
+
return {
|
|
18153
|
+
language,
|
|
18154
|
+
normalizationCache: new Map,
|
|
18155
|
+
tokenize: (raw) => {
|
|
18156
|
+
const tokens = new Set;
|
|
18157
|
+
for (const segment of segmenter.segment(raw.toLowerCase())) {
|
|
18158
|
+
if (segment.isWordLike) {
|
|
18159
|
+
tokens.add(segment.segment);
|
|
18160
|
+
}
|
|
18161
|
+
}
|
|
18162
|
+
return [...tokens];
|
|
18163
|
+
}
|
|
18164
|
+
};
|
|
18165
|
+
};
|
|
18166
|
+
var buildOramaIndex = async (documents, locale) => {
|
|
18167
|
+
const tokenizer = segmentingTokenizer(locale);
|
|
18168
|
+
const db = create({
|
|
18169
|
+
schema: SCHEMA,
|
|
18170
|
+
...tokenizer ? { components: { tokenizer } } : {}
|
|
18171
|
+
});
|
|
18142
18172
|
await insertMultiple(db, documents);
|
|
18143
18173
|
return db;
|
|
18144
18174
|
};
|
|
@@ -18230,10 +18260,10 @@ var text = (value, isError = false) => ({
|
|
|
18230
18260
|
content: [{ text: value, type: "text" }],
|
|
18231
18261
|
...isError ? { isError: true } : {}
|
|
18232
18262
|
});
|
|
18233
|
-
var createIndexProvider = (documents) => {
|
|
18263
|
+
var createIndexProvider = (documents, locale) => {
|
|
18234
18264
|
let dbPromise = null;
|
|
18235
18265
|
return () => {
|
|
18236
|
-
dbPromise ??= buildOramaIndex(documents);
|
|
18266
|
+
dbPromise ??= buildOramaIndex(documents, locale);
|
|
18237
18267
|
return dbPromise;
|
|
18238
18268
|
};
|
|
18239
18269
|
};
|
|
@@ -18289,7 +18319,7 @@ var serveMcpStdio = async (data, streams = {}) => {
|
|
|
18289
18319
|
const stdin = streams.stdin ?? process.stdin;
|
|
18290
18320
|
const stdout = streams.stdout ?? process.stdout;
|
|
18291
18321
|
const transport = new StdioServerTransport(stdin, stdout);
|
|
18292
|
-
const server = buildServer(data, createIndexProvider(data.documents));
|
|
18322
|
+
const server = buildServer(data, createIndexProvider(data.documents, data.defaultLocale));
|
|
18293
18323
|
await server.connect(transport);
|
|
18294
18324
|
await once(stdin, "end");
|
|
18295
18325
|
await transport.close();
|
|
@@ -18697,5 +18727,5 @@ process.on("unhandledRejection", (error) => {
|
|
|
18697
18727
|
});
|
|
18698
18728
|
runMain(main);
|
|
18699
18729
|
|
|
18700
|
-
//# debugId=
|
|
18730
|
+
//# debugId=0CA37F943036C96964756E2164756E21
|
|
18701
18731
|
//# sourceMappingURL=index.js.map
|