@blogmcp/sdk 0.3.2 → 0.6.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.
- package/dist/core/client-types.d.ts +7 -1
- package/dist/core/client.d.ts +25 -1
- package/dist/core/client.js +38 -34
- package/dist/core/consultation-adapter.d.ts +90 -0
- package/dist/core/consultation-adapter.js +200 -0
- package/dist/core/consultations.d.ts +108 -0
- package/dist/core/consultations.js +95 -0
- package/dist/core/errors.d.ts +52 -0
- package/dist/core/errors.js +73 -0
- package/dist/core/index.d.ts +7 -1
- package/dist/core/index.js +80 -64
- package/dist/core/queries.d.ts +16 -1
- package/dist/core/queries.js +198 -61
- package/dist/core/review/format.d.ts +30 -0
- package/dist/core/review/format.js +78 -0
- package/dist/core/review/index.d.ts +6 -0
- package/dist/core/review/index.js +9 -0
- package/dist/core/review/types.d.ts +176 -0
- package/dist/core/review/types.js +9 -0
- package/dist/core/server-only.d.ts +12 -0
- package/dist/core/server-only.js +11 -0
- package/dist/core/types.d.ts +295 -0
- package/dist/packages/mdx-schema/dist/metadata/index.js +3 -3
- package/dist/packages/mdx-schema/dist/styles/index.js +7 -1
- package/dist/packages/mdx-schema/dist/tripmap.js +64 -51
- package/dist/packages/tripmap-core/dist/attribution.js +121 -6
- package/dist/packages/tripmap-core/dist/css.js +68 -16
- package/dist/packages/tripmap-core/dist/detail.js +10 -9
- package/dist/packages/tripmap-core/dist/engine.js +285 -247
- package/dist/packages/tripmap-core/dist/export.js +48 -46
- package/dist/packages/tripmap-core/dist/filmstrip.js +30 -17
- package/dist/packages/tripmap-core/dist/framing.js +30 -30
- package/dist/packages/tripmap-core/dist/generated/maplibre-worker.bundle.js +1 -1
- package/dist/packages/tripmap-core/dist/heading.js +8 -0
- package/dist/packages/tripmap-core/dist/href.js +18 -0
- package/dist/packages/tripmap-core/dist/index.js +32 -24
- package/dist/packages/tripmap-core/dist/lightbox.js +31 -29
- package/dist/packages/tripmap-core/dist/line.js +6 -6
- package/dist/packages/tripmap-core/dist/markers.js +47 -43
- package/dist/packages/tripmap-core/dist/nodes.js +56 -43
- package/dist/packages/tripmap-core/dist/playback.js +17 -17
- package/dist/packages/tripmap-core/dist/preload.js +14 -14
- package/dist/packages/tripmap-core/dist/theme.js +21 -21
- package/dist/{node_modules → packages/tripmap-core/node_modules}/maplibre-gl/dist/maplibre-gl.js +1890 -1720
- package/dist/{node_modules → packages/tripmap-core/node_modules}/pmtiles/dist/esm/index.js +1 -1
- package/package.json +8 -3
- package/src/core/client-types.ts +13 -2
- package/src/core/client.ts +40 -5
- package/src/core/consultation-adapter.ts +408 -0
- package/src/core/consultations.ts +224 -0
- package/src/core/errors.ts +145 -0
- package/src/core/index.ts +68 -0
- package/src/core/queries.ts +167 -3
- package/src/core/review/format.ts +138 -0
- package/src/core/review/index.ts +22 -0
- package/src/core/review/types.ts +168 -0
- package/src/core/server-only.ts +20 -0
- package/src/core/types.ts +337 -0
- /package/dist/{node_modules → packages/tripmap-core/node_modules}/maplibre-gl/dist/maplibre-gl-shared.js +0 -0
package/dist/core/queries.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s = `
|
|
2
2
|
query AccessibleArticles($status: String, $tags: [String!], $tagMode: String, $limit: Int, $offset: Int) {
|
|
3
3
|
accessibleKbArticles(status: $status, tags: $tags, tagMode: $tagMode, limit: $limit, offset: $offset) {
|
|
4
4
|
articles {
|
|
@@ -16,7 +16,7 @@ const a = `
|
|
|
16
16
|
totalCount
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`, o = `
|
|
20
20
|
id
|
|
21
21
|
filename
|
|
22
22
|
contentType
|
|
@@ -52,19 +52,19 @@ const a = `
|
|
|
52
52
|
height
|
|
53
53
|
}
|
|
54
54
|
accessRights
|
|
55
|
-
`,
|
|
55
|
+
`, a = `
|
|
56
56
|
query ArticleWithTranslation($filename: String!, $languageCode: String!) {
|
|
57
|
-
articleWithTranslation(filename: $filename, languageCode: $languageCode) {${
|
|
57
|
+
articleWithTranslation(filename: $filename, languageCode: $languageCode) {${o}}
|
|
58
58
|
}
|
|
59
|
-
`,
|
|
59
|
+
`, i = `
|
|
60
60
|
query ArticleWithTranslationById($id: ID!, $languageCode: String!) {
|
|
61
|
-
articleWithTranslationById(id: $id, languageCode: $languageCode) {${
|
|
61
|
+
articleWithTranslationById(id: $id, languageCode: $languageCode) {${o}}
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
63
|
+
`, r = `
|
|
64
64
|
query ArticleAliasTarget($filename: String!) {
|
|
65
65
|
articleAliasTarget(filename: $filename)
|
|
66
66
|
}
|
|
67
|
-
`,
|
|
67
|
+
`, c = `
|
|
68
68
|
query ArticleVersion($versionId: ID!, $previewKey: String) {
|
|
69
69
|
articleVersion(versionId: $versionId, previewKey: $previewKey) {
|
|
70
70
|
versionId
|
|
@@ -78,7 +78,7 @@ const a = `
|
|
|
78
78
|
createdAt
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`, l = `
|
|
82
82
|
query SearchKnowledgeBase($query: String!, $tags: [String!], $contentType: String, $limit: Int, $minSimilarity: Float, $searchMode: SearchMode) {
|
|
83
83
|
searchKnowledgeBase(query: $query, tags: $tags, contentType: $contentType, limit: $limit, minSimilarity: $minSimilarity, searchMode: $searchMode) {
|
|
84
84
|
articleId
|
|
@@ -88,7 +88,7 @@ const a = `
|
|
|
88
88
|
similarity
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
91
|
+
`, u = `
|
|
92
92
|
query GetKBContext($query: String!, $maxChunks: Int) {
|
|
93
93
|
getKBContext(query: $query, maxChunks: $maxChunks) {
|
|
94
94
|
chunks {
|
|
@@ -100,11 +100,11 @@ const a = `
|
|
|
100
100
|
totalChunks
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
`,
|
|
103
|
+
`, d = `
|
|
104
104
|
query KbNavigation($scope: String, $locale: String) {
|
|
105
105
|
kbNavigation(scope: $scope, locale: $locale)
|
|
106
106
|
}
|
|
107
|
-
`,
|
|
107
|
+
`, m = `
|
|
108
108
|
query AccessibleTags {
|
|
109
109
|
accessibleKbTags {
|
|
110
110
|
tags {
|
|
@@ -117,7 +117,7 @@ const a = `
|
|
|
117
117
|
totalCount
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
`,
|
|
120
|
+
`, g = `
|
|
121
121
|
query LocalizedTags($languageCode: String!) {
|
|
122
122
|
localizedTags(languageCode: $languageCode) {
|
|
123
123
|
id
|
|
@@ -130,7 +130,7 @@ const a = `
|
|
|
130
130
|
isFallback
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
`,
|
|
133
|
+
`, $ = `
|
|
134
134
|
query KBLanguages {
|
|
135
135
|
kbLanguages {
|
|
136
136
|
id
|
|
@@ -142,9 +142,9 @@ const a = `
|
|
|
142
142
|
sortOrder
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
`,
|
|
146
|
-
query ArticleTranslations($
|
|
147
|
-
listArticleTranslations(
|
|
145
|
+
`, C = `
|
|
146
|
+
query ArticleTranslations($articleId: ID!) {
|
|
147
|
+
listArticleTranslations(articleId: $articleId) {
|
|
148
148
|
id
|
|
149
149
|
languageCode
|
|
150
150
|
title
|
|
@@ -153,7 +153,7 @@ const a = `
|
|
|
153
153
|
updatedAt
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
`,
|
|
156
|
+
`, S = `
|
|
157
157
|
query GetTranslation($sourceFilename: String!, $languageCode: String!) {
|
|
158
158
|
getTranslation(sourceFilename: $sourceFilename, languageCode: $languageCode) {
|
|
159
159
|
id
|
|
@@ -181,7 +181,7 @@ const a = `
|
|
|
181
181
|
isTranslated
|
|
182
182
|
isEdited
|
|
183
183
|
createdAt
|
|
184
|
-
`,
|
|
184
|
+
`, I = `
|
|
185
185
|
query ArticleComments($articleId: ID!, $languageCode: String!) {
|
|
186
186
|
articleComments(articleId: $articleId, languageCode: $languageCode) {
|
|
187
187
|
comments {
|
|
@@ -199,7 +199,7 @@ const a = `
|
|
|
199
199
|
totalCount
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
`,
|
|
202
|
+
`, T = `
|
|
203
203
|
query GetComment($commentId: ID!, $languageCode: String!) {
|
|
204
204
|
comment(commentId: $commentId, languageCode: $languageCode) {
|
|
205
205
|
${e}
|
|
@@ -208,7 +208,7 @@ const a = `
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
`,
|
|
211
|
+
`, A = `
|
|
212
212
|
mutation CreateComment($articleId: ID!, $content: String!, $sourceLanguageCode: String!, $parentCommentId: ID) {
|
|
213
213
|
createComment(articleId: $articleId, content: $content, sourceLanguageCode: $sourceLanguageCode, parentCommentId: $parentCommentId) {
|
|
214
214
|
success
|
|
@@ -218,7 +218,7 @@ const a = `
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
`,
|
|
221
|
+
`, E = `
|
|
222
222
|
mutation UpdateComment($commentId: ID!, $content: String!) {
|
|
223
223
|
updateComment(commentId: $commentId, content: $content) {
|
|
224
224
|
success
|
|
@@ -228,21 +228,21 @@ const a = `
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
`,
|
|
231
|
+
`, N = `
|
|
232
232
|
mutation DeleteComment($commentId: ID!) {
|
|
233
233
|
deleteComment(commentId: $commentId) {
|
|
234
234
|
success
|
|
235
235
|
error
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
`,
|
|
238
|
+
`, y = `
|
|
239
239
|
subscription CommentUpdates($articleId: ID!) {
|
|
240
240
|
commentUpdates(articleId: $articleId) {
|
|
241
241
|
type
|
|
242
242
|
commentId
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
`,
|
|
245
|
+
`, p = `
|
|
246
246
|
mutation Login($email: String!, $password: String!) {
|
|
247
247
|
login(email: $email, password: $password) {
|
|
248
248
|
success
|
|
@@ -256,7 +256,7 @@ const a = `
|
|
|
256
256
|
error
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
`,
|
|
259
|
+
`, _ = `
|
|
260
260
|
mutation Register($email: String!, $password: String!, $name: String) {
|
|
261
261
|
register(email: $email, password: $password, name: $name) {
|
|
262
262
|
success
|
|
@@ -264,14 +264,14 @@ const a = `
|
|
|
264
264
|
error
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
`,
|
|
267
|
+
`, R = `
|
|
268
268
|
mutation VerifyEmail($token: String!) {
|
|
269
269
|
verifyEmail(token: $token) {
|
|
270
270
|
success
|
|
271
271
|
error
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
`,
|
|
274
|
+
`, O = `
|
|
275
275
|
mutation ForgotPassword($email: String!) {
|
|
276
276
|
forgotPassword(email: $email) {
|
|
277
277
|
success
|
|
@@ -279,14 +279,14 @@ const a = `
|
|
|
279
279
|
error
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
`,
|
|
282
|
+
`, L = `
|
|
283
283
|
mutation ResetPassword($token: String!, $password: String!) {
|
|
284
284
|
resetPassword(token: $token, password: $password) {
|
|
285
285
|
success
|
|
286
286
|
error
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
`,
|
|
289
|
+
`, M = `
|
|
290
290
|
mutation ResendVerification($email: String!) {
|
|
291
291
|
resendVerification(email: $email) {
|
|
292
292
|
success
|
|
@@ -294,7 +294,7 @@ const a = `
|
|
|
294
294
|
error
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
`,
|
|
297
|
+
`, f = `
|
|
298
298
|
mutation ChangePassword($currentPassword: String!, $newPassword: String!) {
|
|
299
299
|
changePassword(currentPassword: $currentPassword, newPassword: $newPassword) {
|
|
300
300
|
success
|
|
@@ -315,7 +315,7 @@ const a = `
|
|
|
315
315
|
error
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
`,
|
|
318
|
+
`, h = `
|
|
319
319
|
query MyReportSettings {
|
|
320
320
|
myReportSettings {
|
|
321
321
|
autoReportErrors
|
|
@@ -327,7 +327,7 @@ const a = `
|
|
|
327
327
|
feedbackNotifications
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
`,
|
|
330
|
+
`, q = `
|
|
331
331
|
mutation UpdateMyReportSettings(
|
|
332
332
|
$autoReportErrors: String
|
|
333
333
|
$autoReportContent: String
|
|
@@ -355,35 +355,172 @@ const a = `
|
|
|
355
355
|
feedbackNotifications
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
+
`, n = `
|
|
359
|
+
id
|
|
360
|
+
status
|
|
361
|
+
canReply
|
|
362
|
+
canAttachToAccount
|
|
363
|
+
createdAt
|
|
364
|
+
lastActivityAt
|
|
365
|
+
messages {
|
|
366
|
+
id
|
|
367
|
+
author
|
|
368
|
+
authorName
|
|
369
|
+
body
|
|
370
|
+
createdAt
|
|
371
|
+
}
|
|
372
|
+
`, t = `
|
|
373
|
+
success
|
|
374
|
+
code
|
|
375
|
+
error
|
|
376
|
+
duplicate
|
|
377
|
+
consultation {${n}}
|
|
378
|
+
`, U = `
|
|
379
|
+
query ConsultationPublicConfig($locale: String!) {
|
|
380
|
+
consultationPublicConfig(locale: $locale) {
|
|
381
|
+
enabled
|
|
382
|
+
channels {
|
|
383
|
+
channel
|
|
384
|
+
mode
|
|
385
|
+
text {
|
|
386
|
+
purpose
|
|
387
|
+
version
|
|
388
|
+
locale
|
|
389
|
+
body
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
`, D = `
|
|
395
|
+
query MyConsultations($limit: Int, $offset: Int) {
|
|
396
|
+
myConsultations(limit: $limit, offset: $offset) {
|
|
397
|
+
id
|
|
398
|
+
status
|
|
399
|
+
createdAt
|
|
400
|
+
lastActivityAt
|
|
401
|
+
messageCount
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
`, w = `
|
|
405
|
+
query MyConsultation($id: ID!) {
|
|
406
|
+
myConsultation(id: $id) {${n}}
|
|
407
|
+
}
|
|
408
|
+
`, b = `
|
|
409
|
+
mutation CreateMyConsultation($input: CreateMyConsultationInput!) {
|
|
410
|
+
createMyConsultation(input: $input) {${t}}
|
|
411
|
+
}
|
|
412
|
+
`, k = `
|
|
413
|
+
mutation PostMyConsultationMessage($consultationId: ID!, $body: String!, $clientRequestId: String!) {
|
|
414
|
+
postMyConsultationMessage(consultationId: $consultationId, body: $body, clientRequestId: $clientRequestId) {${t}}
|
|
415
|
+
}
|
|
416
|
+
`, B = `
|
|
417
|
+
mutation RequestMyConsultationErasure($consultationId: ID!) {
|
|
418
|
+
requestMyConsultationErasure(consultationId: $consultationId) {${t}}
|
|
419
|
+
}
|
|
420
|
+
`, G = `
|
|
421
|
+
query MyConsultationConsent($locale: String!) {
|
|
422
|
+
myConsultationConsent(locale: $locale) {
|
|
423
|
+
mode
|
|
424
|
+
active
|
|
425
|
+
givenAt
|
|
426
|
+
version
|
|
427
|
+
needsConsent
|
|
428
|
+
text {
|
|
429
|
+
purpose
|
|
430
|
+
version
|
|
431
|
+
locale
|
|
432
|
+
body
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
`, v = `
|
|
437
|
+
mutation WithdrawMyConsultationConsent {
|
|
438
|
+
withdrawMyConsultationConsent {
|
|
439
|
+
success
|
|
440
|
+
code
|
|
441
|
+
error
|
|
442
|
+
threadsClosed
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
`, x = `
|
|
446
|
+
mutation ExchangeConsultationLink($token: String!) {
|
|
447
|
+
exchangeConsultationLink(token: $token) {
|
|
448
|
+
success
|
|
449
|
+
code
|
|
450
|
+
error
|
|
451
|
+
session
|
|
452
|
+
expiresAt
|
|
453
|
+
consultation {${n}}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
`, K = `
|
|
457
|
+
query ConsultationBySession($session: String!) {
|
|
458
|
+
consultationBySession(session: $session) {${n}}
|
|
459
|
+
}
|
|
460
|
+
`, F = `
|
|
461
|
+
mutation PostConsultationMessageBySession($session: String!, $body: String!, $clientRequestId: String!) {
|
|
462
|
+
postConsultationMessageBySession(session: $session, body: $body, clientRequestId: $clientRequestId) {${t}}
|
|
463
|
+
}
|
|
464
|
+
`, Y = `
|
|
465
|
+
mutation RequestConsultationErasureBySession($session: String!) {
|
|
466
|
+
requestConsultationErasureBySession(session: $session) {${t}}
|
|
467
|
+
}
|
|
468
|
+
`, W = `
|
|
469
|
+
mutation CloseConsultationSession($session: String!) {
|
|
470
|
+
closeConsultationSession(session: $session) {${t}}
|
|
471
|
+
}
|
|
472
|
+
`, H = `
|
|
473
|
+
mutation AttachConsultationToMyAccount($session: String!) {
|
|
474
|
+
attachConsultationToMyAccount(session: $session) {${t}}
|
|
475
|
+
}
|
|
476
|
+
`, V = `
|
|
477
|
+
mutation RequestConsultationLink($email: String!) {
|
|
478
|
+
requestConsultationLink(email: $email)
|
|
479
|
+
}
|
|
358
480
|
`;
|
|
359
481
|
export {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
482
|
+
s as ACCESSIBLE_ARTICLES,
|
|
483
|
+
m as ACCESSIBLE_TAGS,
|
|
484
|
+
r as ARTICLE_ALIAS_TARGET,
|
|
485
|
+
I as ARTICLE_COMMENTS,
|
|
486
|
+
C as ARTICLE_TRANSLATIONS,
|
|
487
|
+
c as ARTICLE_VERSION,
|
|
488
|
+
a as ARTICLE_WITH_TRANSLATION,
|
|
489
|
+
i as ARTICLE_WITH_TRANSLATION_BY_ID,
|
|
490
|
+
H as ATTACH_CONSULTATION_TO_MY_ACCOUNT,
|
|
491
|
+
f as CHANGE_PASSWORD,
|
|
492
|
+
W as CLOSE_CONSULTATION_SESSION,
|
|
493
|
+
y as COMMENT_UPDATES_SUBSCRIPTION,
|
|
494
|
+
K as CONSULTATION_BY_SESSION,
|
|
495
|
+
U as CONSULTATION_PUBLIC_CONFIG,
|
|
496
|
+
A as CREATE_COMMENT,
|
|
497
|
+
b as CREATE_MY_CONSULTATION,
|
|
498
|
+
N as DELETE_COMMENT,
|
|
499
|
+
x as EXCHANGE_CONSULTATION_LINK,
|
|
500
|
+
O as FORGOT_PASSWORD,
|
|
501
|
+
T as GET_COMMENT,
|
|
502
|
+
u as GET_KB_CONTEXT,
|
|
503
|
+
S as GET_TRANSLATION,
|
|
504
|
+
$ as KB_LANGUAGES,
|
|
505
|
+
d as KB_NAVIGATION,
|
|
506
|
+
g as LOCALIZED_TAGS,
|
|
507
|
+
p as LOGIN,
|
|
508
|
+
w as MY_CONSULTATION,
|
|
509
|
+
D as MY_CONSULTATIONS,
|
|
510
|
+
G as MY_CONSULTATION_CONSENT,
|
|
511
|
+
h as MY_REPORT_SETTINGS,
|
|
512
|
+
F as POST_CONSULTATION_MESSAGE_BY_SESSION,
|
|
513
|
+
k as POST_MY_CONSULTATION_MESSAGE,
|
|
514
|
+
_ as REGISTER,
|
|
515
|
+
Y as REQUEST_CONSULTATION_ERASURE_BY_SESSION,
|
|
516
|
+
V as REQUEST_CONSULTATION_LINK,
|
|
517
|
+
B as REQUEST_MY_CONSULTATION_ERASURE,
|
|
518
|
+
M as RESEND_VERIFICATION,
|
|
519
|
+
L as RESET_PASSWORD,
|
|
520
|
+
l as SEARCH_KNOWLEDGE_BASE,
|
|
521
|
+
E as UPDATE_COMMENT,
|
|
386
522
|
P as UPDATE_MY_PROFILE,
|
|
387
|
-
|
|
388
|
-
|
|
523
|
+
q as UPDATE_MY_REPORT_SETTINGS,
|
|
524
|
+
R as VERIFY_EMAIL,
|
|
525
|
+
v as WITHDRAW_MY_CONSULTATION_CONSENT
|
|
389
526
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A review round as the text the agent reads — the format the article-review MCP app
|
|
3
|
+
* posts into the chat (packages/mcp-app-article-review: media summary, then "Feedback
|
|
4
|
+
* on article …", then one fenced `visual_feedback` JSON block), so skills that act on
|
|
5
|
+
* that block work unchanged. Used by md-editor's pull tool and by the review page's
|
|
6
|
+
* "Copy for Claude".
|
|
7
|
+
*
|
|
8
|
+
* Two differences from the app, both because a review link's author is whoever holds
|
|
9
|
+
* the link — not the person in the chat:
|
|
10
|
+
* - The reviewer's own words cannot take the shape of the rest. A one-line text is
|
|
11
|
+
* written as is, a longer one line by line behind `> `, and backtick fences inside it
|
|
12
|
+
* are defused, so a note cannot forge a "Selected media:" entry or a second
|
|
13
|
+
* `visual_feedback` block.
|
|
14
|
+
* - A comment without a quote says what it is about (a field, a block, a section, the
|
|
15
|
+
* page) — the app only ever has quoted comments.
|
|
16
|
+
* The `visual_feedback` block holds exactly what the app's does: the comments anchored
|
|
17
|
+
* to at least one block with a rectangle; none, no block.
|
|
18
|
+
*/
|
|
19
|
+
import type { StoredReviewRound } from './types';
|
|
20
|
+
/** The text blocks of one round, in the app's order. */
|
|
21
|
+
export declare function formatReviewRound(round: StoredReviewRound['payload'], filename: string): string[];
|
|
22
|
+
/**
|
|
23
|
+
* Several rounds for the agent, oldest first, each headed with when it was sent and
|
|
24
|
+
* which article version the reviewer saw (`currentVersionNumber` flags a stale round:
|
|
25
|
+
* its source ranges may not fit the text any more — go by the quotes).
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatReviewForAgent(rounds: StoredReviewRound[], opts: {
|
|
28
|
+
filename: string;
|
|
29
|
+
currentVersionNumber?: number | null;
|
|
30
|
+
}): string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const c = /\r\n|[\r\n\u0085\u2028\u2029]/, f = /`{3,}/g;
|
|
2
|
+
function d(e, n) {
|
|
3
|
+
if (e.length <= n) return e;
|
|
4
|
+
let t = n;
|
|
5
|
+
const o = e.charCodeAt(n - 1);
|
|
6
|
+
return o >= 55296 && o <= 56319 && (t = n - 1), e.slice(0, t) + "…";
|
|
7
|
+
}
|
|
8
|
+
function l(e) {
|
|
9
|
+
return e.replace(f, (n) => "'".repeat(n.length));
|
|
10
|
+
}
|
|
11
|
+
function h(e) {
|
|
12
|
+
return l(e).split(c).join(" ");
|
|
13
|
+
}
|
|
14
|
+
function p(e, n) {
|
|
15
|
+
const t = l(n).split(c);
|
|
16
|
+
return t.length === 1 ? [`${e} ${t[0]}`] : [e, ...t.map((o) => ` > ${o}`)];
|
|
17
|
+
}
|
|
18
|
+
function $(e, n, t) {
|
|
19
|
+
const o = [`- ${e.slug} (${e.mediaType})`];
|
|
20
|
+
e.url && o.push(` URL: ${e.url}`);
|
|
21
|
+
const r = e.altText || e.title;
|
|
22
|
+
return r && o.push(` ${e.altText ? "Alt" : "Title"}: "${r}"`), e.title && e.altText && e.title !== e.altText && o.push(` Title: "${e.title}"`), e.description && o.push(` Description: "${e.description}"`), e.durationSeconds != null && o.push(` Duration: ${e.durationSeconds}s`), t && o.push(` Place near block: ${t}`), n && o.push(` Reviewer: "${h(n)}"`), o.join(`
|
|
23
|
+
`);
|
|
24
|
+
}
|
|
25
|
+
function g(e) {
|
|
26
|
+
if (e.anchorText) return "On selected passage:";
|
|
27
|
+
if (e.context?.field) return `On the ${e.context.field}:`;
|
|
28
|
+
const n = e.nodes?.[0];
|
|
29
|
+
return n ? `On block ${n.id} (${n.component}):` : e.context?.heading ? `In section "${d(h(e.context.heading), 80)}":` : "On the page:";
|
|
30
|
+
}
|
|
31
|
+
function b(e, n) {
|
|
32
|
+
const t = [];
|
|
33
|
+
if (e.media.length > 0) {
|
|
34
|
+
const r = e.media.length === 1 ? "Selected media:" : `Selected ${e.media.length} media items:`;
|
|
35
|
+
t.push(`${r}
|
|
36
|
+
${e.media.map((u) => $(u.item, u.comment, u.anchorNodeId)).join(`
|
|
37
|
+
`)}`);
|
|
38
|
+
}
|
|
39
|
+
const o = (e.note ?? "").trim();
|
|
40
|
+
if (e.comments.length > 0 || o) {
|
|
41
|
+
const r = [`Feedback on article ${n}:`, ""];
|
|
42
|
+
e.comments.forEach((i, s) => {
|
|
43
|
+
r.push(`${s + 1}. ${g(i)}`), i.anchorText && r.push(`"${d(h(i.anchorText), 120)}"`), r.push(...p("→", i.body)), r.push("");
|
|
44
|
+
}), o && (r.push("General note:"), r.push(...l(o).split(c).map((i) => `> ${i}`))), t.push(r.join(`
|
|
45
|
+
`).trim());
|
|
46
|
+
const u = e.comments.filter((i) => i.rect && (i.nodes ?? []).length > 0);
|
|
47
|
+
if (u.length > 0) {
|
|
48
|
+
const i = {
|
|
49
|
+
type: "visual_feedback",
|
|
50
|
+
filename: n,
|
|
51
|
+
comments: u.map((s) => ({
|
|
52
|
+
body: s.body,
|
|
53
|
+
anchorText: s.anchorText ?? "",
|
|
54
|
+
nodes: (s.nodes ?? []).map((a) => ({ id: a.id, component: a.component, ...a.sourceRange ? { sourceRange: a.sourceRange } : {} })),
|
|
55
|
+
rect: { x: s.rect.x, y: s.rect.y, width: s.rect.width, height: s.rect.height }
|
|
56
|
+
}))
|
|
57
|
+
};
|
|
58
|
+
t.push("```visual_feedback\n" + JSON.stringify(i).replace(/`/g, "\\u0060") + "\n```");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return t;
|
|
62
|
+
}
|
|
63
|
+
function m(e, n) {
|
|
64
|
+
return e.map((t) => {
|
|
65
|
+
const o = t.baseVersionNumber != null && n.currentVersionNumber != null && t.baseVersionNumber !== n.currentVersionNumber;
|
|
66
|
+
return [`Review round ${t.seq} (sent ${t.submittedAt}` + (t.baseVersionNumber != null ? `, on version ${t.baseVersionNumber}` : "") + (o ? `; the article is now at version ${n.currentVersionNumber} — locate edits by the quoted text, not the source ranges` : "") + ")", ...b(t.payload, n.filename)].join(`
|
|
67
|
+
|
|
68
|
+
`);
|
|
69
|
+
}).join(`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
`);
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
m as formatReviewForAgent,
|
|
77
|
+
b as formatReviewRound
|
|
78
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Review links — review a draft on your own article page (docs: "Add review to your
|
|
3
|
+
* frontend"). Dependency-free; the review layer itself ships as `@blogmcp/review`.
|
|
4
|
+
*/
|
|
5
|
+
export { REVIEW_PAGE_PATH, REVIEW_ROUTE_PATTERN, isReviewTokenFormat, type ReviewMediaScope, type ReviewMediaItem, type ReviewArticle, type ReviewRoundInfo, type ReviewSession, type ReviewState, type ReviewNodeRef, type ReviewComment, type ReviewMediaPick, type ReviewSubmissionV1, type ReviewMediaSnapshot, type StoredReviewRound, } from './types';
|
|
6
|
+
export { formatReviewRound, formatReviewForAgent } from './format';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { REVIEW_PAGE_PATH as r, REVIEW_ROUTE_PATTERN as R, isReviewTokenFormat as E } from "./types.js";
|
|
2
|
+
import { formatReviewForAgent as m, formatReviewRound as T } from "./format.js";
|
|
3
|
+
export {
|
|
4
|
+
r as REVIEW_PAGE_PATH,
|
|
5
|
+
R as REVIEW_ROUTE_PATTERN,
|
|
6
|
+
m as formatReviewForAgent,
|
|
7
|
+
T as formatReviewRound,
|
|
8
|
+
E as isReviewTokenFormat
|
|
9
|
+
};
|