@blogmcp/sdk 0.3.2 → 0.6.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.
Files changed (128) hide show
  1. package/dist/core/client-types.d.ts +7 -1
  2. package/dist/core/client.d.ts +25 -1
  3. package/dist/core/client.js +38 -34
  4. package/dist/core/consultation-adapter.d.ts +90 -0
  5. package/dist/core/consultation-adapter.js +200 -0
  6. package/dist/core/consultations.d.ts +108 -0
  7. package/dist/core/consultations.js +95 -0
  8. package/dist/core/errors.d.ts +52 -0
  9. package/dist/core/errors.js +73 -0
  10. package/dist/core/index.d.ts +7 -1
  11. package/dist/core/index.js +80 -64
  12. package/dist/core/queries.d.ts +16 -1
  13. package/dist/core/queries.js +198 -61
  14. package/dist/core/review/format.d.ts +30 -0
  15. package/dist/core/review/format.js +78 -0
  16. package/dist/core/review/index.d.ts +6 -0
  17. package/dist/core/review/index.js +9 -0
  18. package/dist/core/review/types.d.ts +176 -0
  19. package/dist/core/review/types.js +9 -0
  20. package/dist/core/server-only.d.ts +12 -0
  21. package/dist/core/server-only.js +11 -0
  22. package/dist/core/types.d.ts +295 -0
  23. package/dist/packages/mdx-render-vue/dist/composables/useGallery.js +12 -11
  24. package/dist/packages/mdx-render-vue/dist/composables/useTripMap.js +16 -16
  25. package/dist/packages/mdx-render-vue/dist/edit/TripMapEdit.vue.js +1 -1
  26. package/dist/packages/mdx-render-vue/dist/registry.js +21 -22
  27. package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue2.js +1 -1
  28. package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue2.js +1 -1
  29. package/dist/packages/mdx-render-vue/dist/render/button/Button.vue2.js +1 -1
  30. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue.js +1 -1
  31. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue.js +1 -1
  32. package/dist/packages/mdx-render-vue/dist/render/tripmap/TripMapDefault.vue.js +2 -2
  33. package/dist/packages/tripmap-core/dist/attribution.js +121 -6
  34. package/dist/packages/tripmap-core/dist/css.js +68 -16
  35. package/dist/packages/tripmap-core/dist/detail.js +10 -9
  36. package/dist/packages/tripmap-core/dist/engine.js +285 -247
  37. package/dist/packages/tripmap-core/dist/export.js +48 -46
  38. package/dist/packages/tripmap-core/dist/filmstrip.js +30 -17
  39. package/dist/packages/tripmap-core/dist/framing.js +30 -30
  40. package/dist/packages/tripmap-core/dist/generated/maplibre-worker.bundle.js +1 -1
  41. package/dist/packages/tripmap-core/dist/heading.js +8 -0
  42. package/dist/packages/tripmap-core/dist/href.js +18 -0
  43. package/dist/packages/tripmap-core/dist/index.js +32 -24
  44. package/dist/packages/tripmap-core/dist/lightbox.js +31 -29
  45. package/dist/packages/tripmap-core/dist/line.js +6 -6
  46. package/dist/packages/tripmap-core/dist/markers.js +47 -43
  47. package/dist/packages/tripmap-core/dist/nodes.js +56 -43
  48. package/dist/packages/tripmap-core/dist/playback.js +17 -17
  49. package/dist/packages/tripmap-core/dist/preload.js +14 -14
  50. package/dist/packages/tripmap-core/dist/theme.js +21 -21
  51. package/dist/{node_modules → packages/tripmap-core/node_modules}/maplibre-gl/dist/maplibre-gl.js +1890 -1720
  52. package/dist/{node_modules → packages/tripmap-core/node_modules}/pmtiles/dist/esm/index.js +1 -1
  53. package/dist/react/KbMdxContent.js +7 -8
  54. package/dist/vue/components/KbMdxContent.vue2.js +6 -7
  55. package/package.json +8 -3
  56. package/src/core/client-types.ts +13 -2
  57. package/src/core/client.ts +40 -5
  58. package/src/core/consultation-adapter.ts +408 -0
  59. package/src/core/consultations.ts +224 -0
  60. package/src/core/errors.ts +145 -0
  61. package/src/core/index.ts +68 -0
  62. package/src/core/queries.ts +167 -3
  63. package/src/core/review/format.ts +138 -0
  64. package/src/core/review/index.ts +22 -0
  65. package/src/core/review/types.ts +168 -0
  66. package/src/core/server-only.ts +20 -0
  67. package/src/core/types.ts +337 -0
  68. package/dist/_virtual/constants.js +0 -4
  69. package/dist/_virtual/index.js +0 -2
  70. package/dist/_virtual/index2.js +0 -4
  71. package/dist/_virtual/index3.js +0 -2
  72. package/dist/_virtual/re.js +0 -4
  73. package/dist/node_modules/@braintree/sanitize-url/dist/constants.js +0 -8
  74. package/dist/node_modules/@braintree/sanitize-url/dist/index.js +0 -60
  75. package/dist/node_modules/dompurify/dist/purify.es.js +0 -662
  76. package/dist/node_modules/semver/classes/comparator.js +0 -56
  77. package/dist/node_modules/semver/classes/range.js +0 -148
  78. package/dist/node_modules/semver/classes/semver.js +0 -169
  79. package/dist/node_modules/semver/functions/clean.js +0 -14
  80. package/dist/node_modules/semver/functions/cmp.js +0 -39
  81. package/dist/node_modules/semver/functions/coerce.js +0 -33
  82. package/dist/node_modules/semver/functions/compare-build.js +0 -14
  83. package/dist/node_modules/semver/functions/compare-loose.js +0 -11
  84. package/dist/node_modules/semver/functions/compare.js +0 -11
  85. package/dist/node_modules/semver/functions/diff.js +0 -24
  86. package/dist/node_modules/semver/functions/eq.js +0 -11
  87. package/dist/node_modules/semver/functions/gt.js +0 -11
  88. package/dist/node_modules/semver/functions/gte.js +0 -11
  89. package/dist/node_modules/semver/functions/inc.js +0 -21
  90. package/dist/node_modules/semver/functions/lt.js +0 -11
  91. package/dist/node_modules/semver/functions/lte.js +0 -11
  92. package/dist/node_modules/semver/functions/major.js +0 -11
  93. package/dist/node_modules/semver/functions/minor.js +0 -11
  94. package/dist/node_modules/semver/functions/neq.js +0 -11
  95. package/dist/node_modules/semver/functions/parse.js +0 -21
  96. package/dist/node_modules/semver/functions/patch.js +0 -11
  97. package/dist/node_modules/semver/functions/prerelease.js +0 -14
  98. package/dist/node_modules/semver/functions/rcompare.js +0 -11
  99. package/dist/node_modules/semver/functions/rsort.js +0 -11
  100. package/dist/node_modules/semver/functions/satisfies.js +0 -18
  101. package/dist/node_modules/semver/functions/sort.js +0 -11
  102. package/dist/node_modules/semver/functions/valid.js +0 -14
  103. package/dist/node_modules/semver/index.js +0 -97
  104. package/dist/node_modules/semver/internal/constants.js +0 -28
  105. package/dist/node_modules/semver/internal/debug.js +0 -8
  106. package/dist/node_modules/semver/internal/identifiers.js +0 -18
  107. package/dist/node_modules/semver/internal/lrucache.js +0 -32
  108. package/dist/node_modules/semver/internal/parse-options.js +0 -10
  109. package/dist/node_modules/semver/internal/re.js +0 -32
  110. package/dist/node_modules/semver/ranges/gtr.js +0 -11
  111. package/dist/node_modules/semver/ranges/intersects.js +0 -11
  112. package/dist/node_modules/semver/ranges/ltr.js +0 -11
  113. package/dist/node_modules/semver/ranges/max-satisfying.js +0 -22
  114. package/dist/node_modules/semver/ranges/min-satisfying.js +0 -22
  115. package/dist/node_modules/semver/ranges/min-version.js +0 -42
  116. package/dist/node_modules/semver/ranges/outside.js +0 -44
  117. package/dist/node_modules/semver/ranges/simplify.js +0 -24
  118. package/dist/node_modules/semver/ranges/subset.js +0 -94
  119. package/dist/node_modules/semver/ranges/to-comparators.js +0 -11
  120. package/dist/node_modules/semver/ranges/valid.js +0 -17
  121. package/dist/packages/mdx-schema/dist/composables/useMdxParsing.js +0 -389
  122. package/dist/packages/mdx-schema/dist/metadata/index.js +0 -526
  123. package/dist/packages/mdx-schema/dist/prepareProps.js +0 -46
  124. package/dist/packages/mdx-schema/dist/styles/index.js +0 -141
  125. package/dist/packages/mdx-schema/dist/tripmap.js +0 -88
  126. package/dist/packages/mdx-schema/dist/types/index.js +0 -26
  127. package/dist/packages/sanitize/dist/html.js +0 -89
  128. /package/dist/{node_modules → packages/tripmap-core/node_modules}/maplibre-gl/dist/maplibre-gl-shared.js +0 -0
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Review links — wire types of the page API (`/api/review/v1`, docs: "Add review to
3
+ * your frontend"). Dependency-free: shared by the page (through `@blogmcp/review`)
4
+ * and by server code that formats a review for the agent.
5
+ */
6
+ /** The route a site serves the review page on; `{token}` is the link's token. */
7
+ export declare const REVIEW_PAGE_PATH = "/preview/review/{token}";
8
+ /** Express-style pattern of the same route. */
9
+ export declare const REVIEW_ROUTE_PATTERN = "/preview/review/:token";
10
+ /** Shape check only — whether the token is valid is kb-api's call. */
11
+ export declare function isReviewTokenFormat(value: unknown): value is string;
12
+ export type ReviewMediaScope = 'none' | 'public' | 'all';
13
+ export interface ReviewMediaItem {
14
+ id: string;
15
+ slug: string;
16
+ mediaType: string;
17
+ mimeType: string;
18
+ url: string;
19
+ thumbnailUrl: string;
20
+ altText: string | null;
21
+ title: string | null;
22
+ description: string | null;
23
+ width: number | null;
24
+ height: number | null;
25
+ durationSeconds: number | null;
26
+ fileSizeBytes: number;
27
+ accessLevel: string;
28
+ tags: Array<{
29
+ id: string;
30
+ slug: string;
31
+ name: string;
32
+ color: string | null;
33
+ }>;
34
+ }
35
+ /** The article in the `ArticleWithTranslation` shape — its WORKING copy — plus review metadata. */
36
+ export interface ReviewArticle {
37
+ id: string;
38
+ filename: string;
39
+ contentType: string;
40
+ status: string;
41
+ description: string | null;
42
+ sourceLanguageCode: string;
43
+ createdAt: string;
44
+ updatedAt: string;
45
+ publishedAt: string | null;
46
+ title: string;
47
+ content: string;
48
+ languageCode: string;
49
+ isSource: boolean;
50
+ isFallback: false;
51
+ featuredImageUrl: string | null;
52
+ featuredImageGeo: null;
53
+ contentImagesGeo: [];
54
+ accessRights: string[];
55
+ tags: string[];
56
+ versionId: string | null;
57
+ versionNumber: number | null;
58
+ /** sha256 hex of `content`. */
59
+ contentHash: string;
60
+ /** Where the body starts after the frontmatter; `sourceRange` values are relative to it. */
61
+ bodyOffset: number;
62
+ }
63
+ export interface ReviewRoundInfo {
64
+ seq: number;
65
+ submittedAt: string;
66
+ consumedAt: string | null;
67
+ }
68
+ export interface ReviewSession {
69
+ session: {
70
+ id: string;
71
+ status: 'open';
72
+ expiresAt: string;
73
+ message: string | null;
74
+ mediaScope: ReviewMediaScope;
75
+ submissionCount: number;
76
+ lastSubmission: ReviewRoundInfo | null;
77
+ limits: {
78
+ submissionsPerSession: number;
79
+ comments: number;
80
+ media: number;
81
+ };
82
+ };
83
+ article: ReviewArticle;
84
+ /** Media the working copy references, keyed by slug (signed URLs for non-public ones). */
85
+ media: Record<string, ReviewMediaItem>;
86
+ }
87
+ export interface ReviewState {
88
+ status: 'open';
89
+ expiresAt: string;
90
+ versionId: string | null;
91
+ contentHash: string;
92
+ submissionCount: number;
93
+ lastSubmission: ReviewRoundInfo | null;
94
+ }
95
+ export interface ReviewNodeRef {
96
+ /** `data-mdx-node-id` of a rendered block, e.g. `mdx-3`. */
97
+ id: string;
98
+ /** `data-mdx-component`, or the HTML tag for markdown blocks. */
99
+ component: string;
100
+ /** Offsets in the working copy's body (after the frontmatter). */
101
+ sourceRange?: {
102
+ start: number;
103
+ end: number;
104
+ };
105
+ }
106
+ export interface ReviewComment {
107
+ body: string;
108
+ /** Verbatim text the comment is anchored to ('' for a whole block or the page). */
109
+ anchorText?: string;
110
+ nodes?: ReviewNodeRef[];
111
+ rect?: {
112
+ x: number;
113
+ y: number;
114
+ width: number;
115
+ height: number;
116
+ } | null;
117
+ /** Anchoring help for any renderer (level 0). */
118
+ context?: {
119
+ prefix?: string;
120
+ suffix?: string;
121
+ heading?: string;
122
+ mediaSlug?: string;
123
+ field?: 'title' | 'description' | 'featuredImage';
124
+ };
125
+ }
126
+ export interface ReviewMediaPick {
127
+ slug: string;
128
+ comment?: string | null;
129
+ /** Block the media belongs next to. */
130
+ anchorNodeId?: string | null;
131
+ }
132
+ export interface ReviewSubmissionV1 {
133
+ v: 1;
134
+ baseVersionId?: string | null;
135
+ baseContentHash?: string | null;
136
+ comments?: ReviewComment[];
137
+ note?: string | null;
138
+ media?: ReviewMediaPick[];
139
+ client?: {
140
+ renderer?: string;
141
+ sdkVersion?: string;
142
+ uaFamily?: string;
143
+ viewport?: {
144
+ w: number;
145
+ h: number;
146
+ };
147
+ };
148
+ }
149
+ /** A media pick as stored: the library's own data, never the page's. */
150
+ export interface ReviewMediaSnapshot {
151
+ id: string;
152
+ slug: string;
153
+ mediaType: string;
154
+ url: string;
155
+ altText: string | null;
156
+ title: string | null;
157
+ description: string | null;
158
+ durationSeconds: number | null;
159
+ accessLevel: string;
160
+ }
161
+ export interface StoredReviewRound {
162
+ seq: number;
163
+ submittedAt: string;
164
+ baseVersionNumber: number | null;
165
+ payload: {
166
+ v: 1;
167
+ comments: Array<Required<Pick<ReviewComment, 'body'>> & ReviewComment>;
168
+ note: string | null;
169
+ media: Array<{
170
+ slug: string;
171
+ comment: string | null;
172
+ anchorNodeId: string | null;
173
+ item: ReviewMediaSnapshot;
174
+ }>;
175
+ };
176
+ }
@@ -0,0 +1,9 @@
1
+ const n = "/preview/review/{token}", o = "/preview/review/:token", t = /^kbrv_[A-Za-z0-9_-]{43}$/;
2
+ function r(e) {
3
+ return typeof e == "string" && t.test(e);
4
+ }
5
+ export {
6
+ n as REVIEW_PAGE_PATH,
7
+ o as REVIEW_ROUTE_PATTERN,
8
+ r as isReviewTokenFormat
9
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Guard for SDK entry points that must never run in page JavaScript: they
3
+ * carry a secret (an adapter key) or a reader's bearer capability (a
4
+ * consultation session or link token).
5
+ *
6
+ * Deliberately broad: any global `window` counts as a browser, including a DOM
7
+ * emulation under test. Server runtimes (Node, Bun, Deno 2, workers) define no
8
+ * `window`.
9
+ */
10
+ export declare function isBrowserRuntime(): boolean;
11
+ /** Throws when called in a browser. `what` names the entry point, `why` says what must not leak. */
12
+ export declare function assertServerOnly(what: string, why: string): void;
@@ -0,0 +1,11 @@
1
+ function n() {
2
+ return typeof window < "u";
3
+ }
4
+ function o(r, e) {
5
+ if (n())
6
+ throw new Error(`[blogmcp-sdk] ${r} is server-only — ${e}`);
7
+ }
8
+ export {
9
+ o as assertServerOnly,
10
+ n as isBrowserRuntime
11
+ };
@@ -1,3 +1,4 @@
1
+ import type { KbErrorCode } from './errors';
1
2
  /**
2
3
  * Geo of an image, surfaced to the public blog ONLY when the image opted in
3
4
  * (the API gates this; absent/null otherwise). Used to emit schema.org
@@ -210,3 +211,297 @@ export interface PaginatedResponse<T> {
210
211
  items: T[];
211
212
  totalCount: number;
212
213
  }
214
+ /** Where a consultation stands, as its reader sees it. */
215
+ export type ReaderConsultationStatus = 'OPEN' | 'ANSWERED' | 'CLOSED' | 'ERASURE_REQUESTED';
216
+ /** Who wrote a message, as the reader sees it. */
217
+ export type ReaderConsultationAuthor = 'READER' | 'TEAM';
218
+ export interface ReaderConsultationMessage {
219
+ id: string;
220
+ author: ReaderConsultationAuthor;
221
+ /** The team's display name on TEAM messages (never a person's address); null on READER messages. */
222
+ authorName: string | null;
223
+ /** Plain text as the author wrote it. Render it as text, never as HTML or markdown. */
224
+ body: string;
225
+ createdAt: string;
226
+ }
227
+ export interface ReaderConsultation {
228
+ id: string;
229
+ status: ReaderConsultationStatus;
230
+ /** False once erasure was requested. */
231
+ canReply: boolean;
232
+ /** True only through a session on a thread that was opened by e-mail. */
233
+ canAttachToAccount: boolean;
234
+ createdAt: string;
235
+ /** The last public message; internal notes never move it. */
236
+ lastActivityAt: string;
237
+ messages: ReaderConsultationMessage[];
238
+ }
239
+ export interface ReaderConsultationSummary {
240
+ id: string;
241
+ status: ReaderConsultationStatus;
242
+ createdAt: string;
243
+ lastActivityAt: string;
244
+ /** Public messages only. */
245
+ messageCount: number;
246
+ }
247
+ /**
248
+ * Result of a reader write. Domain failures do not throw: `success` is false,
249
+ * `code` is machine-readable and `error` is its constant English message.
250
+ */
251
+ export interface ReaderConsultationResult {
252
+ success: boolean;
253
+ code: KbErrorCode | null;
254
+ error: string | null;
255
+ /** True when a replay of the same clientRequestId returned the stored write. */
256
+ duplicate: boolean | null;
257
+ consultation: ReaderConsultation | null;
258
+ }
259
+ /** Result of exchanging a magic-link token. Keep `session` server-side (an HttpOnly cookie). */
260
+ export interface ConsultationSessionResult {
261
+ success: boolean;
262
+ code: KbErrorCode | null;
263
+ error: string | null;
264
+ session: string | null;
265
+ expiresAt: string | null;
266
+ consultation: ReaderConsultation | null;
267
+ }
268
+ /** A channel's legal regime: an information notice, or explicit consent. */
269
+ export type ConsultationLegalMode = 'notice' | 'consent';
270
+ export interface ConsultationLegalText {
271
+ purpose: ConsultationLegalMode;
272
+ version: string;
273
+ locale: string;
274
+ body: string;
275
+ }
276
+ export interface ConsultationChannelConfig {
277
+ /** Channel slug, e.g. `web`, `contact_form`, `email`. */
278
+ channel: string;
279
+ mode: ConsultationLegalMode;
280
+ /** The current text to show, or null when the channel shows none (`email`). */
281
+ text: ConsultationLegalText | null;
282
+ }
283
+ export interface ConsultationPublicConfig {
284
+ enabled: boolean;
285
+ channels: ConsultationChannelConfig[];
286
+ }
287
+ /** The legal text version the reader was shown (from `ConsultationPublicConfig`). */
288
+ export interface ConsultationLegalInput {
289
+ version: string;
290
+ locale: string;
291
+ }
292
+ /**
293
+ * The reader's own consent (`consultations.consent(locale)`). Consent belongs
294
+ * to the person, not to a question: given once, with the first question, it
295
+ * covers every later one until the reader withdraws it
296
+ * (`consultations.withdrawConsent()`) — or until the tenant publishes a
297
+ * consent text that requires everyone to consent again.
298
+ */
299
+ export interface ReaderConsultationConsent {
300
+ /**
301
+ * The web channel's legal mode for this reader: `consent`, `notice`, or
302
+ * `off` when they cannot open a question there (the module is off, the web
303
+ * channel is not enabled, or their kind of account is not accepted).
304
+ */
305
+ mode: ConsultationLegalMode | 'off';
306
+ /** They have a consent that has not been withdrawn (reported in every mode: they may still withdraw it). */
307
+ active: boolean;
308
+ /** When the active consent was given (ISO), or null. */
309
+ givenAt: string | null;
310
+ /** The consent text version the active consent points at, or null. */
311
+ version: string | null;
312
+ /** The next question must carry a consent (`CreateMyConsultationInput.consent`). Only ever true in mode `consent`. */
313
+ needsConsent: boolean;
314
+ /** The current consent text to show (in the asked locale, falling back to `en`), only when `needsConsent`. */
315
+ text: ConsultationLegalText | null;
316
+ }
317
+ /** Result of `consultations.withdrawConsent()`. `code` `NOTHING_TO_DO`: there was no active consent. */
318
+ export interface ConsultationConsentWithdrawalResult {
319
+ success: boolean;
320
+ code: KbErrorCode | null;
321
+ error: string | null;
322
+ /** How many questions closed (they are deleted after the tenant's grace period); null on failure. */
323
+ threadsClosed: number | null;
324
+ }
325
+ export interface CreateMyConsultationInput {
326
+ /** The question, 1..5000 characters. */
327
+ body: string;
328
+ /** The reader's language (e.g. `cs`); the tenant's default when omitted. */
329
+ languageCode?: string;
330
+ /**
331
+ * The consent the reader gave with this question (the text version they were
332
+ * shown). Needed only in consent mode when the reader has no consent that
333
+ * covers a new question — `consultations.consent(locale).needsConsent`;
334
+ * ignored otherwise (no new record, no error). Missing when needed:
335
+ * CONSENT_REQUIRED; an unknown version: CONSENT_VERSION_UNKNOWN.
336
+ */
337
+ consent?: ConsultationLegalInput;
338
+ /** Required when the web channel is in notice mode. */
339
+ notice?: ConsultationLegalInput;
340
+ /**
341
+ * Idempotency key, `[A-Za-z0-9._:-]{1,64}` (a UUID works). Generate it once
342
+ * per user action and reuse it on retries: a replay with the same payload
343
+ * returns the stored thread with `duplicate: true`, a different payload is
344
+ * IDEMPOTENCY_CONFLICT.
345
+ */
346
+ clientRequestId: string;
347
+ }
348
+ /** A reader message: its text and its idempotency key (see `CreateMyConsultationInput.clientRequestId`). */
349
+ export interface ConsultationMessageInput {
350
+ body: string;
351
+ clientRequestId: string;
352
+ }
353
+ /** Who owns a new thread: a customer known by the tenant's own ref, or an anonymous address. */
354
+ export type ConsultationOwnerRef = {
355
+ externalRef: string;
356
+ } | {
357
+ email: string;
358
+ };
359
+ export interface ConsultationConsentInput extends ConsultationLegalInput {
360
+ /** When the reader gave consent (ISO 8601, not in the future). */
361
+ givenAt: string | Date;
362
+ }
363
+ export interface ConsultationNewThreadInput {
364
+ /** `externalRef` must lie under the adapter key's prefix. */
365
+ owner: ConsultationOwnerRef;
366
+ /** As typed in the form; the team sees it, the reader surfaces never echo it. */
367
+ displayName?: string;
368
+ /** The adapter's own reference (e.g. a ticket number); unique per channel. */
369
+ externalThreadRef?: string;
370
+ legalBasis?: 'contract' | 'legitimate_interest';
371
+ /** Required on a `notice`-mode channel: the notice version the reader was shown. */
372
+ notice?: ConsultationLegalInput;
373
+ /** Required on a `consent`-mode channel. */
374
+ consent?: ConsultationConsentInput;
375
+ }
376
+ export interface ConsultationIngestInput {
377
+ /** The channel slug; the adapter key needs `consultations:ingest:<channel>`. `web` is always refused. */
378
+ channel: string;
379
+ /** Idempotency key of the message within its channel (e.g. the form submission id or a Message-ID). */
380
+ externalMessageId: string;
381
+ /** The reader's text, 1..5000 characters. */
382
+ body: string;
383
+ languageCode: string;
384
+ /** Original time of an imported e-mail (ISO 8601). */
385
+ sentAt?: string | Date;
386
+ /** Append to this thread (the `email` channel only). */
387
+ threadId?: string;
388
+ /** Required when appending: must match the thread's owner. */
389
+ sender?: {
390
+ email?: string;
391
+ externalRef?: string;
392
+ };
393
+ /** Open a new thread (every channel except `email`). */
394
+ newThread?: ConsultationNewThreadInput;
395
+ }
396
+ export interface ConsultationIngestResult {
397
+ /** `created` on the first delivery of a message, `duplicate` on an identical replay. */
398
+ status: 'created' | 'duplicate';
399
+ threadId: string;
400
+ messageId: string;
401
+ }
402
+ export type ConsultationDeliveryKind = 'reply_notice' | 'access_link' | 'operator_new_message' | 'operator_flag_due' | 'operator_erasure_requested' | 'operator_hold_review';
403
+ export interface ConsultationLeaseInput {
404
+ channel: string;
405
+ /** 1..20, default 10. */
406
+ max?: number;
407
+ /** 30..900, default 300. */
408
+ leaseSeconds?: number;
409
+ }
410
+ /**
411
+ * A notice to send. It carries no content: the adapter composes a content-free
412
+ * mail that links to the reader page (or to the admin for operator notices).
413
+ */
414
+ export interface ConsultationLeasedDelivery {
415
+ deliveryId: string;
416
+ leaseId: string;
417
+ kind: ConsultationDeliveryKind;
418
+ recipient: 'reader' | 'operator';
419
+ /** 1-based attempt number of this lease. */
420
+ attempt: number;
421
+ threadId: string;
422
+ languageCode: string;
423
+ /**
424
+ * Reader notices only: whom to send to. An `externalRef` is looked up in the
425
+ * adapter's own system; an `email` is the address to use. Absent for
426
+ * operator notices (the adapter sends to its own team address).
427
+ */
428
+ owner?: ConsultationOwnerRef;
429
+ /**
430
+ * `email`-owned threads only: a fresh magic-link token. The plaintext exists
431
+ * only in this response — put it in the URL fragment of the link and never
432
+ * store or log it.
433
+ */
434
+ token?: {
435
+ value: string;
436
+ expiresAt: string;
437
+ };
438
+ createdAt: string;
439
+ }
440
+ export interface ConsultationLeaseResult {
441
+ items: ConsultationLeasedDelivery[];
442
+ }
443
+ export interface ConsultationAckInput {
444
+ leaseId: string;
445
+ /** The Message-ID the notice went out with (≤ 255 characters); `threadByNotice` finds it later. */
446
+ providerMessageId: string;
447
+ /** Default `email`. */
448
+ channel?: string;
449
+ }
450
+ export interface ConsultationFailInput {
451
+ leaseId: string;
452
+ /** A code, `[a-z0-9_]{1,64}`; anything else is stored as `adapter_error`. Never a transport's own error text. */
453
+ errorCode: string;
454
+ /** False (or attempts exhausted) marks the notice failed for good. */
455
+ retryable: boolean;
456
+ /** Default `email`. */
457
+ channel?: string;
458
+ }
459
+ export interface ConsultationOkResult {
460
+ ok: true;
461
+ }
462
+ export interface ConsultationOutboxStats {
463
+ pending: number;
464
+ leased: number;
465
+ failed: number;
466
+ oldestPendingAt: string | null;
467
+ lastErrorCode: string | null;
468
+ }
469
+ export interface ConsultationEraseInput {
470
+ /** A ref under the adapter key's prefix. */
471
+ externalRef: string;
472
+ /** Count only, change nothing. */
473
+ dryRun?: boolean;
474
+ }
475
+ export interface ConsultationEraseResult {
476
+ requestId: string;
477
+ dryRun: boolean;
478
+ /** `partial` when a thread under legal hold was kept (and marked for deletion once released). */
479
+ status: 'done' | 'partial';
480
+ threadsErased: number;
481
+ threadsHeld: number;
482
+ accountsAnonymised: number;
483
+ }
484
+ export interface ConsultationOwnerRefsInput {
485
+ /** Narrow the scan; must lie under the key's prefix. */
486
+ prefix?: string;
487
+ /** Continue after this ref (the previous page's `next`). */
488
+ after?: string;
489
+ /** 1..1000, default 500. */
490
+ limit?: number;
491
+ }
492
+ export interface ConsultationOwnerRefsResult {
493
+ refs: string[];
494
+ /** Pass as `after` for the next page; null on the last page. */
495
+ next: string | null;
496
+ }
497
+ export interface ConsultationThreadOwner {
498
+ ownerKind: 'external' | 'kb_user' | 'email';
499
+ externalRef?: string;
500
+ email?: string;
501
+ emailVerified: boolean;
502
+ status: 'open' | 'answered' | 'closed' | 'erasure_requested';
503
+ acceptsMessages: boolean;
504
+ }
505
+ export interface ConsultationThreadByNotice {
506
+ threadId: string;
507
+ }
@@ -1,5 +1,6 @@
1
1
  import { computed as n } from "vue";
2
- import { galleryTileLayout as E } from "../../../mdx-schema/dist/styles/index.js";
2
+ import { galleryTileLayout as E } from "@blogmcp/mdx-schema/styles";
3
+ import { galleryTileLayout as O } from "@blogmcp/mdx-schema/styles";
3
4
  const h = /\.(mp4|webm|mov|avi|mkv|m4v)(\?.*)?$/i, $ = /\/api\/media\/file\/([^/?#]+)/;
4
5
  function o(e) {
5
6
  return typeof e == "object" && e !== null && "src" in e && typeof e.src == "string";
@@ -7,22 +8,22 @@ function o(e) {
7
8
  function a(e) {
8
9
  return h.test(e);
9
10
  }
10
- const V = {
11
+ const L = {
11
12
  1: "grid-cols-1",
12
13
  2: "grid-cols-2",
13
14
  3: "grid-cols-3",
14
15
  4: "grid-cols-4"
15
16
  };
16
- function D(e) {
17
+ function b(e) {
17
18
  const r = n(() => e.columns || 2), g = n(() => {
18
19
  const i = r.value;
19
- return V[i] || "grid-cols-2";
20
- }), m = n(() => `gap-${e.gap || 4}`), u = n(() => E(e));
20
+ return L[i] || "grid-cols-2";
21
+ }), m = n(() => `gap-${e.gap || 4}`), l = n(() => E(e));
21
22
  function s(i) {
22
23
  const t = e.images[i];
23
24
  return o(t) ? t.src : t;
24
25
  }
25
- function l(i) {
26
+ function u(i) {
26
27
  const t = e.images[i];
27
28
  return o(t) ? t.alt || `Gallery image ${i + 1}` : `Gallery image ${i + 1}`;
28
29
  }
@@ -48,9 +49,9 @@ function D(e) {
48
49
  effectiveColumns: r,
49
50
  gridColsClass: g,
50
51
  gapClass: m,
51
- tileLayout: u,
52
+ tileLayout: l,
52
53
  getImageSrc: s,
53
- getImageAlt: l,
54
+ getImageAlt: u,
54
55
  getImageDescription: f,
55
56
  getImageCaption: d,
56
57
  isVideo: y,
@@ -60,9 +61,9 @@ function D(e) {
60
61
  };
61
62
  }
62
63
  export {
63
- E as galleryTileLayout,
64
- V as gridColsClasses,
64
+ O as galleryTileLayout,
65
+ L as gridColsClasses,
65
66
  o as isMediaObject,
66
67
  a as isVideoUrl,
67
- D as useGallery
68
+ b as useGallery
68
69
  };
@@ -1,18 +1,18 @@
1
- import { inject as h, computed as t } from "vue";
2
- import { splitTripMapList as n, parseTripMapHandNodes as M, tripMapFacade as f, TRIPMAP_DEFAULT_HEIGHT as x, buildTripMapGeoUrl as b, tripMapPlaybackLabels as L, tripMapUiTexts as E } from "../../../mdx-schema/dist/tripmap.js";
3
- import { tripMapFormatTime as N } from "../../../mdx-schema/dist/tripmap.js";
4
- const _ = /* @__PURE__ */ Symbol.for("blogmcp:mdx-article-context");
5
- function A(e) {
6
- const a = h(_, null), o = t(() => n(e.slugs)), l = t(() => n(e.exclude)), c = t(() => M(e.nodes)), i = t(() => o.value.length === 0), r = t(() => o.value.length === 0 && !a?.filename), s = t(() => f(e, a)), u = t(() => s.value.thumbs), d = t(() => s.value.stops), p = t(() => ({ height: e.height || x })), g = t(() => b(e, a)), m = t(() => L(a?.language)), T = t(() => E(a?.language));
1
+ import { inject as M, computed as t } from "vue";
2
+ import { splitTripMapList as n, parseTripMapHandNodes as h, tripMapFacade as f, TRIPMAP_DEFAULT_HEIGHT as x, buildTripMapGeoUrl as b, tripMapPlaybackLabels as L, tripMapUiTexts as E } from "@blogmcp/mdx-schema/tripmap";
3
+ import { parseTripMapHandNodes as C, tripMapFormatTime as U } from "@blogmcp/mdx-schema/tripmap";
4
+ const H = /* @__PURE__ */ Symbol.for("blogmcp:mdx-article-context");
5
+ function v(e) {
6
+ const a = M(H, null), s = t(() => n(e.slugs)), i = t(() => n(e.exclude)), l = t(() => h(e.nodes)), c = t(() => s.value.length === 0), r = t(() => s.value.length === 0 && !a?.filename), o = t(() => f(e, a)), p = t(() => o.value.thumbs), d = t(() => o.value.stops), u = t(() => ({ height: e.height || x })), g = t(() => b(e, a)), m = t(() => L(a?.language)), T = t(() => E(a?.language));
7
7
  return {
8
- slugList: o,
9
- excludeList: l,
10
- handNodes: c,
11
- facadeThumbs: u,
8
+ slugList: s,
9
+ excludeList: i,
10
+ handNodes: l,
11
+ facadeThumbs: p,
12
12
  facadeStops: d,
13
- heightStyle: p,
13
+ heightStyle: u,
14
14
  articleContext: a,
15
- isAutoMode: i,
15
+ isAutoMode: c,
16
16
  isConfigOnly: r,
17
17
  geoUrl: g,
18
18
  labels: m,
@@ -20,8 +20,8 @@ function A(e) {
20
20
  };
21
21
  }
22
22
  export {
23
- _ as MDX_ARTICLE_CONTEXT_KEY,
24
- M as parseHandNodes,
25
- N as tripMapFormatTime,
26
- A as useTripMap
23
+ H as MDX_ARTICLE_CONTEXT_KEY,
24
+ C as parseHandNodes,
25
+ U as tripMapFormatTime,
26
+ v as useTripMap
27
27
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as u, computed as m, createElementBlock as e, openBlock as t, createElementVNode as o, toDisplayString as n, createCommentVNode as y, Fragment as a, createTextVNode as s } from "vue";
2
- import { parseTripMapHandNodes as g } from "../../../mdx-schema/dist/tripmap.js";
2
+ import { parseTripMapHandNodes as g } from "@blogmcp/mdx-schema/tripmap";
3
3
  const f = {
4
4
  class: "flex items-center gap-3 rounded-lg border border-blue-500/40 bg-blue-500/5 px-3 py-2",
5
5
  "data-mdx-component": "TripMap"