@blogmcp/sdk 0.8.1 → 0.9.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 (88) hide show
  1. package/dist/community/channels.d.ts +12 -0
  2. package/dist/community/channels.js +7 -0
  3. package/dist/community/client.d.ts +211 -0
  4. package/dist/community/client.js +188 -0
  5. package/dist/community/index.d.ts +34 -0
  6. package/dist/community/index.js +92 -0
  7. package/dist/community/links.d.ts +65 -0
  8. package/dist/community/links.js +81 -0
  9. package/dist/community/messages.cs.d.ts +331 -0
  10. package/dist/community/messages.cs.js +342 -0
  11. package/dist/community/messages.d.ts +40 -0
  12. package/dist/community/messages.en.d.ts +315 -0
  13. package/dist/community/messages.en.js +313 -0
  14. package/dist/community/messages.js +66 -0
  15. package/dist/community/outcome.d.ts +96 -0
  16. package/dist/community/outcome.js +211 -0
  17. package/dist/community/poll.d.ts +35 -0
  18. package/dist/community/poll.js +70 -0
  19. package/dist/community/routes.d.ts +110 -0
  20. package/dist/community/routes.js +66 -0
  21. package/dist/community/server/bff.d.ts +123 -0
  22. package/dist/community/server/bff.js +214 -0
  23. package/dist/community/server/env.d.ts +20 -0
  24. package/dist/community/server/env.js +16 -0
  25. package/dist/community/server/host-routes.d.ts +15 -0
  26. package/dist/community/server/host-routes.js +35 -0
  27. package/dist/community/server/http.d.ts +64 -0
  28. package/dist/community/server/http.js +90 -0
  29. package/dist/community/server/index.d.ts +45 -0
  30. package/dist/community/server/index.js +19 -0
  31. package/dist/community/server/route-decision.d.ts +70 -0
  32. package/dist/community/server/route-decision.js +89 -0
  33. package/dist/community/server/unknown-path.d.ts +21 -0
  34. package/dist/community/server/unknown-path.js +11 -0
  35. package/dist/community/shapes.d.ts +457 -0
  36. package/dist/community/shapes.js +51 -0
  37. package/dist/community/store.d.ts +183 -0
  38. package/dist/community/store.js +423 -0
  39. package/dist/community/transport.d.ts +42 -0
  40. package/dist/community/transport.js +59 -0
  41. package/dist/core/client.d.ts +17 -0
  42. package/dist/core/client.js +58 -55
  43. package/dist/core/comments-legacy.d.ts +19 -0
  44. package/dist/core/comments-legacy.js +18 -0
  45. package/dist/core/index.d.ts +3 -0
  46. package/dist/core/index.js +107 -101
  47. package/dist/core/queries.d.ts +46 -0
  48. package/dist/core/queries.js +128 -84
  49. package/dist/core/seo.js +40 -39
  50. package/dist/core/translations/cs.json.js +6 -6
  51. package/dist/core/translations/en.json.js +1 -1
  52. package/dist/core/types.d.ts +23 -1
  53. package/dist/core/view-model.d.ts +7 -0
  54. package/dist/core/view-model.js +29 -25
  55. package/dist/react/KbMdxContent.js +4 -3
  56. package/dist/vue/components/KbMdxContent.vue2.js +3 -2
  57. package/dist/vue/composables/useKbComments.d.ts +8 -0
  58. package/package.json +13 -4
  59. package/src/community/channels.ts +12 -0
  60. package/src/community/client.ts +437 -0
  61. package/src/community/index.ts +190 -0
  62. package/src/community/links.ts +166 -0
  63. package/src/community/messages.cs.ts +371 -0
  64. package/src/community/messages.en.ts +341 -0
  65. package/src/community/messages.ts +112 -0
  66. package/src/community/outcome.ts +317 -0
  67. package/src/community/poll.ts +154 -0
  68. package/src/community/routes.ts +139 -0
  69. package/src/community/server/bff.ts +530 -0
  70. package/src/community/server/env.ts +42 -0
  71. package/src/community/server/host-routes.ts +48 -0
  72. package/src/community/server/http.ts +175 -0
  73. package/src/community/server/index.ts +55 -0
  74. package/src/community/server/route-decision.ts +226 -0
  75. package/src/community/server/unknown-path.ts +32 -0
  76. package/src/community/shapes.ts +513 -0
  77. package/src/community/store.ts +786 -0
  78. package/src/community/transport.ts +111 -0
  79. package/src/core/client.ts +24 -1
  80. package/src/core/comments-legacy.ts +39 -0
  81. package/src/core/index.ts +8 -0
  82. package/src/core/queries.ts +93 -0
  83. package/src/core/seo.ts +5 -1
  84. package/src/core/translations/cs.json +3 -1
  85. package/src/core/translations/en.json +3 -1
  86. package/src/core/types.ts +19 -1
  87. package/src/core/view-model.ts +12 -1
  88. package/src/vue/composables/useKbComments.ts +8 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The replaceable layer under the community client (docs/internal/m1-contracts.md §10.2; community.md §3.7): one
3
+ * function that takes an operation and its JSON body and answers the HTTP status and the parsed body. The client
4
+ * never touches `fetch` itself, so a test injects a transport, and the private client of a later milestone plugs
5
+ * in one that signs its requests — the client and its outcomes do not change.
6
+ *
7
+ * The default, fetchTransport(base), POSTs to the HOST: a relative base such as `/api/community` that a managed
8
+ * blog's proxy or a headless site's BFF serves. Never kb-api's origin — its community namespaces answer no CORS and
9
+ * a browser never calls them directly — so an absolute or protocol-relative base is refused when the client is
10
+ * built, and every request is `mode: 'same-origin'` with the host's own cookies (`credentials: 'same-origin'`): the
11
+ * host turns its session into the member's credential on its server.
12
+ */
13
+ import { type CommunityOp } from './routes.js';
14
+ /** What a transport answers: the HTTP status and the parsed JSON body (null when the body is not JSON). */
15
+ export interface CommunityTransportAnswer {
16
+ status: number;
17
+ body: unknown;
18
+ /** `Retry-After` in seconds, when the answer carried one. */
19
+ retryAfterS?: number;
20
+ }
21
+ /**
22
+ * The layer the client calls for every operation. It rejects (with a CommunityTransportError, ideally) when the
23
+ * host could not be asked at all; any answer, a 4xx or 5xx included, resolves.
24
+ */
25
+ export type CommunityTransport = (op: CommunityOp, body: unknown, signal: AbortSignal) => Promise<CommunityTransportAnswer>;
26
+ /** Whether `base` is a host base the client takes (see BASE_RE); `..` and `.` segments are refused too. */
27
+ export declare function isRelativeCommunityBase(base: unknown): base is string;
28
+ /** The base, checked: a TypeError for anything but a relative host base (a programming error, visible at once). */
29
+ export declare function assertCommunityBase(base: unknown): string;
30
+ /** The URL of an operation under a checked base: `${base}/v1/public/<resource>/<verb>`, `${base}/trust/v1/notices/<verb>`. */
31
+ export declare function communityOpUrl(base: string, o: Pick<CommunityOp, 'path' | 'surface'>): string;
32
+ export interface FetchTransportOptions {
33
+ /** The fetch to use; looked up on every call (default the page's `fetch`), so a test can stub it. */
34
+ fetch?: () => typeof fetch;
35
+ now?: () => number;
36
+ }
37
+ /**
38
+ * The default transport: `POST ${base}<the operation's path>` with a JSON body. The base is checked here as in the
39
+ * client (a TypeError for an absolute one). A network failure, a timeout or an abort rejects with a
40
+ * CommunityTransportError; a body that is not JSON resolves as `body: null`.
41
+ */
42
+ export declare function fetchTransport(base: string, opts?: FetchTransportOptions): CommunityTransport;
@@ -0,0 +1,59 @@
1
+ import { CommunityTransportError as y } from "./outcome.js";
2
+ import { communityOpPath as p } from "./routes.js";
3
+ const l = /^(?:\/[A-Za-z0-9_~-][A-Za-z0-9._~-]*)*\/?$/;
4
+ function d(t) {
5
+ return typeof t == "string" && t.startsWith("/") && l.test(t) && !/(^|\/)\.\.?(\/|$)/.test(t);
6
+ }
7
+ function f(t) {
8
+ if (!d(t))
9
+ throw new TypeError(
10
+ '[blogmcp-sdk] the community client takes a relative base on the page’s own origin (e.g. "/api/community"), never an absolute URL: kb-api’s community routes are reached only through the host’s proxy or BFF'
11
+ );
12
+ return t.replace(/\/+$/, "");
13
+ }
14
+ function g(t, e) {
15
+ return `${t.replace(/\/+$/, "")}${p(e)}`;
16
+ }
17
+ function w(t, e) {
18
+ if (t === null || t.trim() === "") return;
19
+ const r = t.trim();
20
+ if (/^\d+$/.test(r)) return Number(r);
21
+ const n = Date.parse(r);
22
+ return Number.isFinite(n) ? Math.max(0, Math.ceil((n - e) / 1e3)) : void 0;
23
+ }
24
+ function $(t, e = {}) {
25
+ const r = f(t), n = e.now ?? Date.now, u = e.fetch ?? (() => globalThis.fetch);
26
+ return async (a, h, s) => {
27
+ let o;
28
+ try {
29
+ o = await u()(g(r, a), {
30
+ method: a.method,
31
+ headers: { Accept: "application/json", "Content-Type": "application/json" },
32
+ body: JSON.stringify(h ?? {}),
33
+ // The host's own origin only: its session cookie goes along, nothing leaves for another site.
34
+ mode: "same-origin",
35
+ credentials: "same-origin",
36
+ cache: "no-store",
37
+ redirect: "error",
38
+ signal: s
39
+ });
40
+ } catch {
41
+ throw new y(s.aborted ? "community request aborted or timed out" : "community request failed");
42
+ }
43
+ let i = null;
44
+ try {
45
+ const m = await o.text();
46
+ i = m === "" ? null : JSON.parse(m);
47
+ } catch {
48
+ i = null;
49
+ }
50
+ const c = w(o.headers.get("Retry-After"), n());
51
+ return c === void 0 ? { status: o.status, body: i } : { status: o.status, body: i, retryAfterS: c };
52
+ };
53
+ }
54
+ export {
55
+ f as assertCommunityBase,
56
+ g as communityOpUrl,
57
+ $ as fetchTransport,
58
+ d as isRelativeCommunityBase
59
+ };
@@ -25,6 +25,15 @@ export interface KbClient {
25
25
  * `locked` with its `access` tiers. Needs a KB API with the locked-article preview.
26
26
  */
27
27
  includeLocked?: boolean;
28
+ /**
29
+ * Localize the list: each article's title and description in this language (the
30
+ * page's locale). By default only articles translated into it are listed; each item
31
+ * carries `languageCode` and `isFallback`. Omit for the source language's text.
32
+ * Needs a KB API with localized lists (10. 10. 2026).
33
+ */
34
+ languageCode?: string;
35
+ /** With `languageCode`: also list untranslated articles, `isFallback: true`, source text. */
36
+ includeUntranslated?: boolean;
28
37
  }): Promise<{
29
38
  accessibleKbArticles: {
30
39
  articles: Article[];
@@ -141,6 +150,14 @@ export interface KbClient {
141
150
  getTranslation: Translation;
142
151
  }>;
143
152
  };
153
+ /**
154
+ * The legacy comment API.
155
+ *
156
+ * @deprecated Since 0.9.0, removed in 1.0: discussions are Comments 2.0 — `@blogmcp/sdk/community`
157
+ * (`createCommunityClient`) and the `<blogmcp-discussion>` element of `@blogmcp/community`. The reads keep
158
+ * working through kb-api's compatible layer; the writes answer `COMMENTS_FROZEN` during a tenant's cutover and
159
+ * `COMMENTS_MOVED` after it (`commentErrorCode`, the `comments.frozen` / `comments.moved` texts).
160
+ */
144
161
  comments: {
145
162
  list(articleId: string, languageCode: string): Promise<{
146
163
  articleComments: CommentsConnection;
@@ -1,94 +1,97 @@
1
- import { UPDATE_MY_PROFILE as i, ARTICLE_VERSION as A, UPDATE_MY_REPORT_SETTINGS as S, MY_REPORT_SETTINGS as _, CHANGE_PASSWORD as I, RESEND_VERIFICATION as l, RESET_PASSWORD as R, FORGOT_PASSWORD as C, VERIFY_EMAIL as c, REGISTER as d, LOGIN as L, DELETE_COMMENT as u, UPDATE_COMMENT as O, CREATE_COMMENT as p, GET_COMMENT as N, ARTICLE_COMMENTS as h, GET_TRANSLATION as m, ARTICLE_TRANSLATIONS as G, KB_NAVIGATION as P, KB_LANGUAGES as g, LOCALIZED_TAGS as M, ACCESSIBLE_TAGS as y, GET_KB_CONTEXT as D, SEARCH_KNOWLEDGE_BASE as B, ARTICLE_ALIAS_TARGET as f, ARTICLE_PREVIEW_BY_ID as v, ARTICLE_PREVIEW as w, ARTICLE_WITH_TRANSLATION_BY_ID as W, ARTICLE_WITH_TRANSLATION as K, ACCESSIBLE_ARTICLES_WITH_LOCKED as V, ACCESSIBLE_ARTICLES as k } from "./queries.js";
2
- import { createMemoryTokenStorage as b } from "./auth.js";
3
- import { KbGraphQLError as x } from "./errors.js";
4
- import { createConsultationSessionApi as Y, createConsultationsApi as F } from "./consultations.js";
5
- function H() {
6
- return async (o, n) => (await fetch(o, {
7
- method: n.method,
8
- headers: n.headers,
9
- body: n.body
1
+ import { UPDATE_MY_PROFILE as S, ARTICLE_VERSION as _, ACCESSIBLE_ARTICLES_WITH_LOCKED_LOCALIZED as I, ACCESSIBLE_ARTICLES_LOCALIZED as C, UPDATE_MY_REPORT_SETTINGS as l, MY_REPORT_SETTINGS as L, CHANGE_PASSWORD as d, RESEND_VERIFICATION as R, RESET_PASSWORD as c, FORGOT_PASSWORD as u, VERIFY_EMAIL as O, REGISTER as p, LOGIN as N, DELETE_COMMENT as h, UPDATE_COMMENT as g, CREATE_COMMENT as m, GET_COMMENT as G, ARTICLE_COMMENTS as P, GET_TRANSLATION as D, ARTICLE_TRANSLATIONS as M, KB_NAVIGATION as y, KB_LANGUAGES as B, LOCALIZED_TAGS as f, ACCESSIBLE_TAGS as W, GET_KB_CONTEXT as v, SEARCH_KNOWLEDGE_BASE as w, ARTICLE_ALIAS_TARGET as K, ARTICLE_PREVIEW_BY_ID as V, ARTICLE_PREVIEW as k, ARTICLE_WITH_TRANSLATION_BY_ID as b, ARTICLE_WITH_TRANSLATION as x, ACCESSIBLE_ARTICLES_WITH_LOCKED as H, ACCESSIBLE_ARTICLES as U } from "./queries.js";
2
+ import { createMemoryTokenStorage as Y } from "./auth.js";
3
+ import { KbGraphQLError as F } from "./errors.js";
4
+ import { createConsultationSessionApi as Q, createConsultationsApi as Z } from "./consultations.js";
5
+ function j() {
6
+ return async (n, o) => (await fetch(n, {
7
+ method: o.method,
8
+ headers: o.headers,
9
+ body: o.body
10
10
  })).json();
11
11
  }
12
- async function U(o, n, s) {
13
- const E = {
14
- ...o.headers ?? {},
12
+ async function z(n, o, E) {
13
+ const T = {
14
+ ...n.headers ?? {},
15
15
  "Content-Type": "application/json"
16
- }, a = o.tokenStorage.getToken();
17
- a && (E.Authorization = `Bearer ${a}`);
18
- const t = await o.fetcher(o.endpoint, {
16
+ }, a = n.tokenStorage.getToken();
17
+ a && (T.Authorization = `Bearer ${a}`);
18
+ const t = await n.fetcher(n.endpoint, {
19
19
  method: "POST",
20
- headers: E,
21
- body: JSON.stringify({ query: n, variables: s })
20
+ headers: T,
21
+ body: JSON.stringify({ query: o, variables: E })
22
22
  });
23
23
  if (t.errors?.length)
24
- throw new x(t.errors);
24
+ throw new F(t.errors);
25
25
  return t.data;
26
26
  }
27
- function J(o) {
28
- const n = o.fetcher || H(), s = o.tokenStorage || b(), a = { endpoint: o.isServer && o.serverEndpoint ? o.serverEndpoint : o.endpoint, fetcher: n, tokenStorage: s, headers: o.headers };
27
+ function ee(n) {
28
+ const o = n.fetcher || j(), E = n.tokenStorage || Y(), a = { endpoint: n.isServer && n.serverEndpoint ? n.serverEndpoint : n.endpoint, fetcher: o, tokenStorage: E, headers: n.headers };
29
29
  function t(e, r) {
30
- return U(a, e, r);
30
+ return z(a, e, r);
31
31
  }
32
32
  return {
33
33
  articles: {
34
34
  list: (e) => {
35
- const { includeLocked: r, ...T } = e ?? {};
36
- return t(r ? V : k, T);
35
+ const { includeLocked: r, languageCode: s, includeUntranslated: A, ...i } = e ?? {};
36
+ return s ? t(
37
+ r ? I : C,
38
+ { ...i, languageCode: s, includeUntranslated: A === !0 }
39
+ ) : t(r ? H : U, i);
37
40
  },
38
- getWithTranslation: (e, r) => t(K, { filename: e, languageCode: r }),
39
- getWithTranslationById: (e, r) => t(W, { id: e, languageCode: r }),
40
- getPreview: (e, r) => t(w, { filename: e, languageCode: r }),
41
- getPreviewById: (e, r) => t(v, { id: e, languageCode: r }),
42
- resolveAlias: (e) => t(f, { filename: e }),
43
- getVersion: (e, r) => t(A, { versionId: e, previewKey: r?.previewKey ?? null })
41
+ getWithTranslation: (e, r) => t(x, { filename: e, languageCode: r }),
42
+ getWithTranslationById: (e, r) => t(b, { id: e, languageCode: r }),
43
+ getPreview: (e, r) => t(k, { filename: e, languageCode: r }),
44
+ getPreviewById: (e, r) => t(V, { id: e, languageCode: r }),
45
+ resolveAlias: (e) => t(K, { filename: e }),
46
+ getVersion: (e, r) => t(_, { versionId: e, previewKey: r?.previewKey ?? null })
44
47
  },
45
48
  search: {
46
- query: (e) => t(B, e),
47
- getContext: (e, r) => t(D, { query: e, maxChunks: r })
49
+ query: (e) => t(w, e),
50
+ getContext: (e, r) => t(v, { query: e, maxChunks: r })
48
51
  },
49
52
  tags: {
50
- list: () => t(y),
51
- listLocalized: (e) => t(M, { languageCode: e })
53
+ list: () => t(W),
54
+ listLocalized: (e) => t(f, { languageCode: e })
52
55
  },
53
56
  languages: {
54
- list: () => t(g)
57
+ list: () => t(B)
55
58
  },
56
59
  navigation: {
57
- get: (e) => t(P, e ?? {})
60
+ get: (e) => t(y, e ?? {})
58
61
  },
59
62
  translations: {
60
- list: (e) => t(G, { articleId: e }),
61
- get: (e, r) => t(m, { sourceFilename: e, languageCode: r })
63
+ list: (e) => t(M, { articleId: e }),
64
+ get: (e, r) => t(D, { sourceFilename: e, languageCode: r })
62
65
  },
63
66
  comments: {
64
- list: (e, r) => t(h, { articleId: e, languageCode: r }),
65
- get: (e, r) => t(N, { commentId: e, languageCode: r }),
66
- create: (e) => t(p, e),
67
- update: (e, r) => t(O, { commentId: e, content: r }),
68
- delete: (e) => t(u, { commentId: e })
67
+ list: (e, r) => t(P, { articleId: e, languageCode: r }),
68
+ get: (e, r) => t(G, { commentId: e, languageCode: r }),
69
+ create: (e) => t(m, e),
70
+ update: (e, r) => t(g, { commentId: e, content: r }),
71
+ delete: (e) => t(h, { commentId: e })
69
72
  },
70
73
  auth: {
71
- login: (e, r) => t(L, { email: e, password: r }),
72
- register: (e, r, T) => t(d, { email: e, password: r, name: T }),
73
- verifyEmail: (e) => t(c, { token: e }),
74
- forgotPassword: (e) => t(C, { email: e }),
75
- resetPassword: (e, r) => t(R, { token: e, password: r }),
76
- resendVerification: (e) => t(l, { email: e }),
77
- changePassword: (e, r) => t(I, { currentPassword: e, newPassword: r }),
78
- updateProfile: (e) => t(i, {
74
+ login: (e, r) => t(N, { email: e, password: r }),
75
+ register: (e, r, s) => t(p, { email: e, password: r, name: s }),
76
+ verifyEmail: (e) => t(O, { token: e }),
77
+ forgotPassword: (e) => t(u, { email: e }),
78
+ resetPassword: (e, r) => t(c, { token: e, password: r }),
79
+ resendVerification: (e) => t(R, { email: e }),
80
+ changePassword: (e, r) => t(d, { currentPassword: e, newPassword: r }),
81
+ updateProfile: (e) => t(S, {
79
82
  name: e.name ?? null,
80
83
  email: e.email ?? null
81
84
  })
82
85
  },
83
86
  reportSettings: {
84
- get: () => t(_),
85
- update: (e) => t(S, e)
87
+ get: () => t(L),
88
+ update: (e) => t(l, e)
86
89
  },
87
- consultations: F(t),
88
- consultationSession: Y(t),
90
+ consultations: Z(t),
91
+ consultationSession: Q(t),
89
92
  executeGraphQL: t
90
93
  };
91
94
  }
92
95
  export {
93
- J as createKbClient
96
+ ee as createKbClient
94
97
  };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The legacy comment API's two cutover codes (docs/internal/m1-contracts.md §9.3, §10.5): while a tenant's comments
3
+ * move to Comments 2.0, `createComment` / `updateComment` / `deleteComment` answer
4
+ * `CommentResult { success: false, error: 'COMMENTS_FROZEN' }` during the freeze and `'COMMENTS_MOVED'` from the move
5
+ * on, and the `commentUpdates` subscription ends with a `KbGraphQLError` of code `COMMENTS_MOVED`. A blog's current
6
+ * panel tells the reader what happened with the `comments.frozen` / `comments.moved` texts until its host embeds
7
+ * the discussion element.
8
+ *
9
+ * @deprecated With `client.comments.*`; removed in 1.0.
10
+ */
11
+ /** The legacy comment API's cutover codes. */
12
+ export type LegacyCommentErrorCode = 'COMMENTS_FROZEN' | 'COMMENTS_MOVED';
13
+ /**
14
+ * The cutover code of a failed comment write (a `CommentResult` whose `error` is the code) or of a thrown
15
+ * `KbGraphQLError` — null for anything else (another error, a success, free text).
16
+ */
17
+ export declare function commentErrorCode(result: unknown): LegacyCommentErrorCode | null;
18
+ /** The `core/translations` key that explains a cutover code to the reader. */
19
+ export declare function commentErrorMessageKey(code: LegacyCommentErrorCode): 'comments.frozen' | 'comments.moved';
@@ -0,0 +1,18 @@
1
+ import { isKbGraphQLError as t } from "./errors.js";
2
+ const E = /^(COMMENTS_FROZEN|COMMENTS_MOVED)(?![A-Z0-9_])/;
3
+ function c(r) {
4
+ if (t(r))
5
+ return r.code === "COMMENTS_FROZEN" ? "COMMENTS_FROZEN" : r.code === "COMMENTS_MOVED" ? "COMMENTS_MOVED" : null;
6
+ if (typeof r != "object" || r === null) return null;
7
+ const { success: e, error: n } = r;
8
+ if (e === !0 || typeof n != "string") return null;
9
+ const o = E.exec(n.trim());
10
+ return o ? o[1] : null;
11
+ }
12
+ function O(r) {
13
+ return r === "COMMENTS_FROZEN" ? "comments.frozen" : "comments.moved";
14
+ }
15
+ export {
16
+ c as commentErrorCode,
17
+ O as commentErrorMessageKey
18
+ };
@@ -2,6 +2,8 @@ export type { Article, ArticlePreview, LockedPreviewMode, ArticleWithTranslation
2
2
  export { ACCESS_LEVEL_ORDER } from './types.js';
3
3
  export { KbGraphQLError, isKbGraphQLError, CONSULTATION_ERROR_CODES, isConsultationErrorCode, } from './errors.js';
4
4
  export type { KbErrorCode, ConsultationErrorCode, KbGraphQLErrorEntry, RawGraphQLError, } from './errors.js';
5
+ export { commentErrorCode, commentErrorMessageKey } from './comments-legacy.js';
6
+ export type { LegacyCommentErrorCode } from './comments-legacy.js';
5
7
  export type { KbClientConfig, Fetcher, TokenStorage, ImageHtmlRenderer, SanitizeFn, } from './client-types.js';
6
8
  export type { KbClient } from './client.js';
7
9
  export { createKbClient } from './client.js';
@@ -29,6 +31,7 @@ export { csTranslations, enTranslations, mergeTranslations, createKbI18n, } from
29
31
  export type { TranslateFn, TranslationMap } from './i18n.js';
30
32
  export * as queries from './queries.js';
31
33
  export { prepareProps } from '@blogmcp/mdx-schema/prepareProps';
34
+ export { inlineMarkdownToPlainText, extractTitleHeading } from '@blogmcp/mdx-schema/title';
32
35
  export { getComponentMetadata, getComponentNames, componentMetadata, } from '@blogmcp/mdx-schema/metadata';
33
36
  export type { ComponentMetadata, PropMetadata } from '@blogmcp/mdx-schema/metadata';
34
37
  export * from './review/index.js';
@@ -1,110 +1,116 @@
1
1
  import { ACCESS_LEVEL_ORDER as t } from "./types.js";
2
- import { CONSULTATION_ERROR_CODES as i, KbGraphQLError as n, isConsultationErrorCode as s, isKbGraphQLError as l } from "./errors.js";
3
- import { createKbClient as p } from "./client.js";
4
- import { findNavNode as E, flattenNav as R, isNavigable as d, navBreadcrumbs as x, navNextPrev as T, navSiblings as c, navSubtree as v, navWalk as A } from "./navigation.js";
5
- import { createAuthManager as S, createLocalStorageTokenStorage as _, createMemoryTokenStorage as u, decodeJwtUser as I, hasAccessLevel as C } from "./auth.js";
6
- import { DelegatedTokenError as b, createDelegatedTokenMinter as L } from "./delegated-identity.js";
7
- import { ConsultationAdapterError as h, createConsultationAdapterClient as k, isConsultationAdapterError as O } from "./consultation-adapter.js";
8
- import { generateDescription as D, stripLeadingH1 as M } from "./article-seo.js";
9
- import { createMarkedInstance as H, defaultImageHtml as P, parseMarkdownSafe as U } from "./markdown.js";
10
- import { deepMerge as G } from "./blog-config.js";
11
- import { retryWithBackoff as B } from "./retry.js";
12
- import { buildThemeCssVars as y, darkenColor as z, hexToHsl as Q, hexToRgb as J, hslToRgb as Y, lightenColor as j, rgbTriplet as X } from "./theme.js";
13
- import { buildArticleSeo as $, buildHomeSeo as ee, buildListPageSeo as re, localizedHref as oe, pageUrl as te, stripLocalePrefix as ae } from "./seo.js";
14
- import { buildArticleListItem as ne, formatArticleDate as se, lockedRequiredAccess as le, resolveArticleAccessLevel as me, toIsoDate as pe } from "./view-model.js";
15
- import { createKbI18n as Ee, mergeTranslations as Re } from "./i18n.js";
2
+ import { CONSULTATION_ERROR_CODES as i, KbGraphQLError as n, isConsultationErrorCode as s, isKbGraphQLError as m } from "./errors.js";
3
+ import { commentErrorCode as p, commentErrorMessageKey as f } from "./comments-legacy.js";
4
+ import { createKbClient as R } from "./client.js";
5
+ import { findNavNode as x, flattenNav as T, isNavigable as c, navBreadcrumbs as v, navNextPrev as g, navSiblings as A, navSubtree as S, navWalk as _ } from "./navigation.js";
6
+ import { createAuthManager as C, createLocalStorageTokenStorage as I, createMemoryTokenStorage as w, decodeJwtUser as b, hasAccessLevel as L } from "./auth.js";
7
+ import { DelegatedTokenError as k, createDelegatedTokenMinter as M } from "./delegated-identity.js";
8
+ import { ConsultationAdapterError as O, createConsultationAdapterClient as W, isConsultationAdapterError as D } from "./consultation-adapter.js";
9
+ import { generateDescription as P, stripLeadingH1 as V } from "./article-seo.js";
10
+ import { createMarkedInstance as K, defaultImageHtml as F, parseMarkdownSafe as G } from "./markdown.js";
11
+ import { deepMerge as B } from "./blog-config.js";
12
+ import { retryWithBackoff as z } from "./retry.js";
13
+ import { buildThemeCssVars as J, darkenColor as Y, hexToHsl as j, hexToRgb as X, hslToRgb as Z, lightenColor as $, rgbTriplet as ee } from "./theme.js";
14
+ import { buildArticleSeo as oe, buildHomeSeo as te, buildListPageSeo as ae, localizedHref as ie, pageUrl as ne, stripLocalePrefix as se } from "./seo.js";
15
+ import { buildArticleListItem as le, formatArticleDate as pe, lockedRequiredAccess as fe, resolveArticleAccessLevel as Ee, toIsoDate as Re } from "./view-model.js";
16
+ import { createKbI18n as xe, mergeTranslations as Te } from "./i18n.js";
16
17
  import * as e from "./queries.js";
17
- import { prepareProps as xe } from "@blogmcp/mdx-schema/prepareProps";
18
- import { componentMetadata as ce, getComponentMetadata as ve, getComponentNames as Ae } from "@blogmcp/mdx-schema/metadata";
19
- import { REVIEW_PAGE_PATH as Se, REVIEW_ROUTE_PATTERN as _e, isReviewTokenFormat as ue } from "./review/types.js";
20
- import { formatReviewForAgent as Ce, formatReviewRound as we } from "./review/format.js";
21
- import { REVIEW_REASON_STATUS as Le, createReviewClient as Ne, getReviewSession as he } from "./review/client.js";
22
- import { REVIEW_LAYER_SCRIPT_URL as Oe, REVIEW_SESSION_ELEMENT_ID as We, renderReviewStatusHtml as De, reviewBootstrapHtml as Me, reviewContentWithMedia as Ve, reviewFieldAttrs as He, reviewIgnoreAttrs as Pe, reviewResponseHeaders as Ue, reviewRootAttrs as Fe, reviewStatusText as Ge } from "./review/page.js";
23
- import { createReviewPlan as Be, normalizeReviewText as qe } from "./review/plan.js";
24
- import { REVIEW_FIELD_ATTR as ze, REVIEW_IGNORE_ATTR as Qe, REVIEW_ROOT_ATTR as Je, stampReviewDom as Ye } from "./review/stamp.js";
25
- import { default as Xe } from "./translations/cs.json.js";
26
- import { default as $e } from "./translations/en.json.js";
18
+ import { prepareProps as ve } from "@blogmcp/mdx-schema/prepareProps";
19
+ import { extractTitleHeading as Ae, inlineMarkdownToPlainText as Se } from "@blogmcp/mdx-schema/title";
20
+ import { componentMetadata as ue, getComponentMetadata as Ce, getComponentNames as Ie } from "@blogmcp/mdx-schema/metadata";
21
+ import { REVIEW_PAGE_PATH as be, REVIEW_ROUTE_PATTERN as Le, isReviewTokenFormat as Ne } from "./review/types.js";
22
+ import { formatReviewForAgent as Me, formatReviewRound as he } from "./review/format.js";
23
+ import { REVIEW_REASON_STATUS as We, createReviewClient as De, getReviewSession as He } from "./review/client.js";
24
+ import { REVIEW_LAYER_SCRIPT_URL as Ve, REVIEW_SESSION_ELEMENT_ID as Ue, renderReviewStatusHtml as Ke, reviewBootstrapHtml as Fe, reviewContentWithMedia as Ge, reviewFieldAttrs as ye, reviewIgnoreAttrs as Be, reviewResponseHeaders as qe, reviewRootAttrs as ze, reviewStatusText as Qe } from "./review/page.js";
25
+ import { createReviewPlan as Ye, normalizeReviewText as je } from "./review/plan.js";
26
+ import { REVIEW_FIELD_ATTR as Ze, REVIEW_IGNORE_ATTR as $e, REVIEW_ROOT_ATTR as er, stampReviewDom as rr } from "./review/stamp.js";
27
+ import { default as tr } from "./translations/cs.json.js";
28
+ import { default as ir } from "./translations/en.json.js";
27
29
  export {
28
30
  t as ACCESS_LEVEL_ORDER,
29
31
  i as CONSULTATION_ERROR_CODES,
30
- h as ConsultationAdapterError,
31
- b as DelegatedTokenError,
32
+ O as ConsultationAdapterError,
33
+ k as DelegatedTokenError,
32
34
  n as KbGraphQLError,
33
- ze as REVIEW_FIELD_ATTR,
34
- Qe as REVIEW_IGNORE_ATTR,
35
- Oe as REVIEW_LAYER_SCRIPT_URL,
36
- Se as REVIEW_PAGE_PATH,
37
- Le as REVIEW_REASON_STATUS,
38
- Je as REVIEW_ROOT_ATTR,
39
- _e as REVIEW_ROUTE_PATTERN,
40
- We as REVIEW_SESSION_ELEMENT_ID,
41
- ne as buildArticleListItem,
42
- $ as buildArticleSeo,
43
- ee as buildHomeSeo,
44
- re as buildListPageSeo,
45
- y as buildThemeCssVars,
46
- ce as componentMetadata,
47
- S as createAuthManager,
48
- k as createConsultationAdapterClient,
49
- L as createDelegatedTokenMinter,
50
- p as createKbClient,
51
- Ee as createKbI18n,
52
- _ as createLocalStorageTokenStorage,
53
- H as createMarkedInstance,
54
- u as createMemoryTokenStorage,
55
- Ne as createReviewClient,
56
- Be as createReviewPlan,
57
- Xe as csTranslations,
58
- z as darkenColor,
59
- I as decodeJwtUser,
60
- G as deepMerge,
61
- P as defaultImageHtml,
62
- $e as enTranslations,
63
- E as findNavNode,
64
- R as flattenNav,
65
- se as formatArticleDate,
66
- Ce as formatReviewForAgent,
67
- we as formatReviewRound,
68
- D as generateDescription,
69
- ve as getComponentMetadata,
70
- Ae as getComponentNames,
71
- he as getReviewSession,
72
- C as hasAccessLevel,
73
- Q as hexToHsl,
74
- J as hexToRgb,
75
- Y as hslToRgb,
76
- O as isConsultationAdapterError,
35
+ Ze as REVIEW_FIELD_ATTR,
36
+ $e as REVIEW_IGNORE_ATTR,
37
+ Ve as REVIEW_LAYER_SCRIPT_URL,
38
+ be as REVIEW_PAGE_PATH,
39
+ We as REVIEW_REASON_STATUS,
40
+ er as REVIEW_ROOT_ATTR,
41
+ Le as REVIEW_ROUTE_PATTERN,
42
+ Ue as REVIEW_SESSION_ELEMENT_ID,
43
+ le as buildArticleListItem,
44
+ oe as buildArticleSeo,
45
+ te as buildHomeSeo,
46
+ ae as buildListPageSeo,
47
+ J as buildThemeCssVars,
48
+ p as commentErrorCode,
49
+ f as commentErrorMessageKey,
50
+ ue as componentMetadata,
51
+ C as createAuthManager,
52
+ W as createConsultationAdapterClient,
53
+ M as createDelegatedTokenMinter,
54
+ R as createKbClient,
55
+ xe as createKbI18n,
56
+ I as createLocalStorageTokenStorage,
57
+ K as createMarkedInstance,
58
+ w as createMemoryTokenStorage,
59
+ De as createReviewClient,
60
+ Ye as createReviewPlan,
61
+ tr as csTranslations,
62
+ Y as darkenColor,
63
+ b as decodeJwtUser,
64
+ B as deepMerge,
65
+ F as defaultImageHtml,
66
+ ir as enTranslations,
67
+ Ae as extractTitleHeading,
68
+ x as findNavNode,
69
+ T as flattenNav,
70
+ pe as formatArticleDate,
71
+ Me as formatReviewForAgent,
72
+ he as formatReviewRound,
73
+ P as generateDescription,
74
+ Ce as getComponentMetadata,
75
+ Ie as getComponentNames,
76
+ He as getReviewSession,
77
+ L as hasAccessLevel,
78
+ j as hexToHsl,
79
+ X as hexToRgb,
80
+ Z as hslToRgb,
81
+ Se as inlineMarkdownToPlainText,
82
+ D as isConsultationAdapterError,
77
83
  s as isConsultationErrorCode,
78
- l as isKbGraphQLError,
79
- d as isNavigable,
80
- ue as isReviewTokenFormat,
81
- j as lightenColor,
82
- oe as localizedHref,
83
- le as lockedRequiredAccess,
84
- Re as mergeTranslations,
85
- x as navBreadcrumbs,
86
- T as navNextPrev,
87
- c as navSiblings,
88
- v as navSubtree,
89
- A as navWalk,
90
- qe as normalizeReviewText,
91
- te as pageUrl,
92
- U as parseMarkdownSafe,
93
- xe as prepareProps,
84
+ m as isKbGraphQLError,
85
+ c as isNavigable,
86
+ Ne as isReviewTokenFormat,
87
+ $ as lightenColor,
88
+ ie as localizedHref,
89
+ fe as lockedRequiredAccess,
90
+ Te as mergeTranslations,
91
+ v as navBreadcrumbs,
92
+ g as navNextPrev,
93
+ A as navSiblings,
94
+ S as navSubtree,
95
+ _ as navWalk,
96
+ je as normalizeReviewText,
97
+ ne as pageUrl,
98
+ G as parseMarkdownSafe,
99
+ ve as prepareProps,
94
100
  e as queries,
95
- De as renderReviewStatusHtml,
96
- me as resolveArticleAccessLevel,
97
- B as retryWithBackoff,
98
- Me as reviewBootstrapHtml,
99
- Ve as reviewContentWithMedia,
100
- He as reviewFieldAttrs,
101
- Pe as reviewIgnoreAttrs,
102
- Ue as reviewResponseHeaders,
103
- Fe as reviewRootAttrs,
104
- Ge as reviewStatusText,
105
- X as rgbTriplet,
106
- Ye as stampReviewDom,
107
- M as stripLeadingH1,
108
- ae as stripLocalePrefix,
109
- pe as toIsoDate
101
+ Ke as renderReviewStatusHtml,
102
+ Ee as resolveArticleAccessLevel,
103
+ z as retryWithBackoff,
104
+ Fe as reviewBootstrapHtml,
105
+ Ge as reviewContentWithMedia,
106
+ ye as reviewFieldAttrs,
107
+ Be as reviewIgnoreAttrs,
108
+ qe as reviewResponseHeaders,
109
+ ze as reviewRootAttrs,
110
+ Qe as reviewStatusText,
111
+ ee as rgbTriplet,
112
+ rr as stampReviewDom,
113
+ V as stripLeadingH1,
114
+ se as stripLocalePrefix,
115
+ Re as toIsoDate
110
116
  };