blume 1.6.1 → 1.6.2
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 +6 -0
- package/dist/cli/index.js +894 -130
- package/dist/cli/index.js.map +18 -14
- package/dist/types/core/config-input.d.ts +9 -0
- package/dist/types/core/data.d.ts +2 -0
- package/dist/types/core/i18n-ui.d.ts +2 -0
- package/dist/types/core/schema.d.ts +2 -0
- package/docs/advanced/custom-pages.mdx +1 -1
- package/docs/configuration/ai.mdx +72 -7
- package/docs/index.mdx +2 -2
- package/package.json +1 -1
- package/skills/blume/SKILL.md +2 -2
- package/src/ai/agent-readability.ts +60 -17
- package/src/ai/api/handlers.ts +273 -0
- package/src/ai/api/paths.ts +14 -0
- package/src/ai/api/problem.ts +63 -0
- package/src/ai/api/spec.ts +681 -0
- package/src/ai/api-catalog.ts +11 -1
- package/src/ai/link-headers.ts +12 -3
- package/src/ai/llms.ts +9 -2
- package/src/ai/mcp/query.ts +390 -0
- package/src/ai/mcp/server.ts +32 -352
- package/src/astro/generate.ts +166 -12
- package/src/astro/templates.ts +157 -0
- package/src/cli/commands/build.ts +8 -6
- package/src/core/config-input.ts +9 -0
- package/src/core/data.ts +7 -1
- package/src/core/i18n-ui.ts +2 -0
- package/src/core/schema.ts +7 -0
- package/src/deploy/vercel-negotiation.ts +56 -8
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the JSON docs API and its OpenAPI description are served. Base-less
|
|
3
|
+
* (like every route Blume emits); callers layer `deployment.base` on top.
|
|
4
|
+
* Under `/api/` alongside the Ask AI endpoint (`/api/ask`) so the namespace a
|
|
5
|
+
* Blume site reserves for live endpoints stays one prefix, and under its own
|
|
6
|
+
* `docs` segment so a search provider's proxy at `/api/search` never collides.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const OPENAPI_PATH = "/openapi.json";
|
|
10
|
+
export const API_BASE = "/api/docs";
|
|
11
|
+
export const API_PAGES_PATH = `${API_BASE}/pages.json`;
|
|
12
|
+
export const API_PAGE_PATH = `${API_BASE}/pages/{route}.json`;
|
|
13
|
+
export const API_NAVIGATION_PATH = `${API_BASE}/navigation.json`;
|
|
14
|
+
export const API_SEARCH_PATH = `${API_BASE}/search`;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 9457 problem details — the one error shape every Blume JSON endpoint
|
|
3
|
+
* returns, so an agent that hits a missing page, a bad query, or an unknown
|
|
4
|
+
* API route always gets a stable machine-readable `code`, a human-readable
|
|
5
|
+
* `detail`, and a `resolution` telling it where to go next.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const PROBLEM_TYPE = "application/problem+json";
|
|
9
|
+
|
|
10
|
+
/** A recovery link carried on a problem (the 404's "where to look next"). */
|
|
11
|
+
export interface ProblemLink {
|
|
12
|
+
href: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Problem {
|
|
17
|
+
/** Stable, screaming-snake error code for programmatic handling. */
|
|
18
|
+
code: string;
|
|
19
|
+
/** Human-readable explanation specific to this occurrence. */
|
|
20
|
+
detail: string;
|
|
21
|
+
/** The request path the problem occurred on, when known. */
|
|
22
|
+
instance?: string;
|
|
23
|
+
/** Recovery links, when the problem has somewhere useful to send the caller. */
|
|
24
|
+
links?: ProblemLink[];
|
|
25
|
+
/** What to do next — the hint agents act on. */
|
|
26
|
+
resolution: string;
|
|
27
|
+
status: number;
|
|
28
|
+
title: string;
|
|
29
|
+
/** Problem type URI; `about:blank` when the status code says it all. */
|
|
30
|
+
type: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The problem's members, with `type` defaulting to `about:blank`. */
|
|
34
|
+
export const problem = (
|
|
35
|
+
input: Omit<Problem, "type"> & { type?: string }
|
|
36
|
+
): Problem => {
|
|
37
|
+
const body: Problem = {
|
|
38
|
+
code: input.code,
|
|
39
|
+
detail: input.detail,
|
|
40
|
+
resolution: input.resolution,
|
|
41
|
+
status: input.status,
|
|
42
|
+
title: input.title,
|
|
43
|
+
type: input.type ?? "about:blank",
|
|
44
|
+
};
|
|
45
|
+
if (input.instance !== undefined) {
|
|
46
|
+
body.instance = input.instance;
|
|
47
|
+
}
|
|
48
|
+
if (input.links !== undefined) {
|
|
49
|
+
body.links = input.links;
|
|
50
|
+
}
|
|
51
|
+
return body;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** A `Response` carrying the problem as `application/problem+json`. */
|
|
55
|
+
export const problemResponse = (
|
|
56
|
+
input: Omit<Problem, "type"> & { type?: string }
|
|
57
|
+
): Response => {
|
|
58
|
+
const body = problem(input);
|
|
59
|
+
return new Response(`${JSON.stringify(body, null, 2)}\n`, {
|
|
60
|
+
headers: { "Content-Type": `${PROBLEM_TYPE}; charset=utf-8` },
|
|
61
|
+
status: body.status,
|
|
62
|
+
});
|
|
63
|
+
};
|