@blogmcp/community 0.4.1 → 0.5.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 (150) hide show
  1. package/dist/blogmcp-community-private.global.js +4 -0
  2. package/dist/blogmcp-community.global.js +3 -3
  3. package/dist/chunks/{mount-Ts_r2fwt.js → mount-SKmc4NgD.js} +39 -9
  4. package/dist/chunks/private-mount-bhCQeScD.js +5397 -0
  5. package/dist/core/attrs.d.ts +15 -0
  6. package/dist/core/settings.d.ts +5 -0
  7. package/dist/index.js +2 -2
  8. package/dist/private/core/dock.d.ts +38 -0
  9. package/dist/private/core/push.d.ts +49 -0
  10. package/dist/private/core/realtime.d.ts +57 -0
  11. package/dist/private/core/setup.d.ts +43 -0
  12. package/dist/private/core/view.d.ts +179 -0
  13. package/dist/private/dm/composer.d.ts +34 -0
  14. package/dist/private/dm/controller.d.ts +162 -0
  15. package/dist/private/dm/index.d.ts +14 -0
  16. package/dist/private/dm/links.d.ts +33 -0
  17. package/dist/private/dm/muted.d.ts +37 -0
  18. package/dist/private/dm/search.d.ts +7 -0
  19. package/dist/private/dm/text.d.ts +27 -0
  20. package/dist/private/dm/ui/DmBlocks.vue.d.ts +8 -0
  21. package/dist/private/dm/ui/DmCases.vue.d.ts +8 -0
  22. package/dist/private/dm/ui/DmComposer.vue.d.ts +20 -0
  23. package/dist/private/dm/ui/DmInbox.vue.d.ts +12 -0
  24. package/dist/private/dm/ui/DmLinkWarning.vue.d.ts +8 -0
  25. package/dist/private/dm/ui/DmLocalAids.vue.d.ts +8 -0
  26. package/dist/private/dm/ui/DmMessageText.vue.d.ts +8 -0
  27. package/dist/private/dm/ui/DmNew.vue.d.ts +12 -0
  28. package/dist/private/dm/ui/DmReport.vue.d.ts +8 -0
  29. package/dist/private/dm/ui/DmRequests.vue.d.ts +12 -0
  30. package/dist/private/dm/ui/DmScreens.vue.d.ts +9 -0
  31. package/dist/private/dm/ui/DmThread.vue.d.ts +9 -0
  32. package/dist/private/element.d.ts +23 -0
  33. package/dist/private/global.d.ts +10 -0
  34. package/dist/private/i18n.d.ts +41 -0
  35. package/dist/private/index.d.ts +32 -0
  36. package/dist/private/index.js +57 -0
  37. package/dist/private/mount.d.ts +55 -0
  38. package/dist/private/pages/api.d.ts +44 -0
  39. package/dist/private/pages/element.d.ts +6 -0
  40. package/dist/private/pages/fragment.d.ts +43 -0
  41. package/dist/private/pages/i18n.d.ts +25 -0
  42. package/dist/private/pages/index.d.ts +1 -0
  43. package/dist/private/pages/pages.d.ts +276 -0
  44. package/dist/private/pages/proof.d.ts +36 -0
  45. package/dist/private/pages/provider-view.d.ts +33 -0
  46. package/dist/private/pages/setup.d.ts +42 -0
  47. package/dist/private/pages/ui/AccountPageRoot.vue.d.ts +9 -0
  48. package/dist/private/pages/ui/PageActivation.vue.d.ts +9 -0
  49. package/dist/private/pages/ui/PageAddress.vue.d.ts +8 -0
  50. package/dist/private/pages/ui/PageDeviceApprove.vue.d.ts +8 -0
  51. package/dist/private/pages/ui/PageDevices.vue.d.ts +8 -0
  52. package/dist/private/pages/ui/PageExport.vue.d.ts +8 -0
  53. package/dist/private/pages/ui/PageMessages.vue.d.ts +9 -0
  54. package/dist/private/react.d.ts +12 -0
  55. package/dist/private/react.js +36 -0
  56. package/dist/private/ui/ChatDockRoot.vue.d.ts +20 -0
  57. package/dist/private/ui/LegalText.vue.d.ts +13 -0
  58. package/dist/private/ui/PrivateScreens.vue.d.ts +14 -0
  59. package/dist/private/ui/PrivateViewRoot.vue.d.ts +23 -0
  60. package/dist/private/ui/PromiseBlock.vue.d.ts +9 -0
  61. package/dist/private/ui/ProviderLine.vue.d.ts +8 -0
  62. package/dist/private/ui/ScreenActivation.vue.d.ts +8 -0
  63. package/dist/private/ui/ScreenAddress.vue.d.ts +8 -0
  64. package/dist/private/ui/ScreenApproval.vue.d.ts +8 -0
  65. package/dist/private/ui/ScreenDevices.vue.d.ts +8 -0
  66. package/dist/private/ui/ScreenHome.vue.d.ts +12 -0
  67. package/dist/private/ui/ScreenNotifications.vue.d.ts +8 -0
  68. package/dist/private/ui/ScreenReads.vue.d.ts +8 -0
  69. package/dist/private/ui/ScreenSettings.vue.d.ts +8 -0
  70. package/dist/private/ui/root.d.ts +35 -0
  71. package/dist/private/ui/text.d.ts +22 -0
  72. package/dist/private/vue.d.ts +88 -0
  73. package/dist/private/vue.js +72 -0
  74. package/dist/react.js +14 -14
  75. package/dist/vue.js +14 -14
  76. package/package.json +23 -6
  77. package/src/core/attrs.ts +19 -0
  78. package/src/core/settings.ts +55 -12
  79. package/src/private/core/dock.ts +105 -0
  80. package/src/private/core/push.ts +166 -0
  81. package/src/private/core/realtime.ts +109 -0
  82. package/src/private/core/setup.ts +75 -0
  83. package/src/private/core/view.ts +920 -0
  84. package/src/private/dm/composer.ts +74 -0
  85. package/src/private/dm/controller.ts +636 -0
  86. package/src/private/dm/index.ts +14 -0
  87. package/src/private/dm/links.ts +55 -0
  88. package/src/private/dm/muted.ts +160 -0
  89. package/src/private/dm/search.ts +18 -0
  90. package/src/private/dm/text.ts +60 -0
  91. package/src/private/dm/ui/DmBlocks.vue +27 -0
  92. package/src/private/dm/ui/DmCases.vue +58 -0
  93. package/src/private/dm/ui/DmComposer.vue +68 -0
  94. package/src/private/dm/ui/DmInbox.vue +34 -0
  95. package/src/private/dm/ui/DmLinkWarning.vue +27 -0
  96. package/src/private/dm/ui/DmLocalAids.vue +43 -0
  97. package/src/private/dm/ui/DmMessageText.vue +16 -0
  98. package/src/private/dm/ui/DmNew.vue +46 -0
  99. package/src/private/dm/ui/DmReport.vue +93 -0
  100. package/src/private/dm/ui/DmRequests.vue +50 -0
  101. package/src/private/dm/ui/DmScreens.vue +66 -0
  102. package/src/private/dm/ui/DmThread.vue +235 -0
  103. package/src/private/element.ts +90 -0
  104. package/src/private/global.ts +14 -0
  105. package/src/private/i18n.ts +127 -0
  106. package/src/private/index.ts +68 -0
  107. package/src/private/messages/cs.json +311 -0
  108. package/src/private/messages/en.json +319 -0
  109. package/src/private/mount.ts +103 -0
  110. package/src/private/pages/api.ts +96 -0
  111. package/src/private/pages/build.d.mts +2 -0
  112. package/src/private/pages/build.mjs +72 -0
  113. package/src/private/pages/element.ts +49 -0
  114. package/src/private/pages/fragment.ts +63 -0
  115. package/src/private/pages/i18n.ts +82 -0
  116. package/src/private/pages/index.ts +10 -0
  117. package/src/private/pages/messages/cs.json +97 -0
  118. package/src/private/pages/messages/en.json +97 -0
  119. package/src/private/pages/pages.ts +410 -0
  120. package/src/private/pages/proof.ts +110 -0
  121. package/src/private/pages/provider-view.ts +121 -0
  122. package/src/private/pages/setup.ts +79 -0
  123. package/src/private/pages/ui/AccountPageRoot.vue +45 -0
  124. package/src/private/pages/ui/PageActivation.vue +42 -0
  125. package/src/private/pages/ui/PageAddress.vue +39 -0
  126. package/src/private/pages/ui/PageDeviceApprove.vue +62 -0
  127. package/src/private/pages/ui/PageDevices.vue +84 -0
  128. package/src/private/pages/ui/PageExport.vue +35 -0
  129. package/src/private/pages/ui/PageMessages.vue +39 -0
  130. package/src/private/pages/ui/account.css +6 -0
  131. package/src/private/react.ts +49 -0
  132. package/src/private/shims.d.ts +6 -0
  133. package/src/private/ui/ChatDockRoot.vue +119 -0
  134. package/src/private/ui/LegalText.vue +18 -0
  135. package/src/private/ui/PrivateScreens.vue +61 -0
  136. package/src/private/ui/PrivateViewRoot.vue +70 -0
  137. package/src/private/ui/PromiseBlock.vue +18 -0
  138. package/src/private/ui/ProviderLine.vue +20 -0
  139. package/src/private/ui/ScreenActivation.vue +82 -0
  140. package/src/private/ui/ScreenAddress.vue +37 -0
  141. package/src/private/ui/ScreenApproval.vue +71 -0
  142. package/src/private/ui/ScreenDevices.vue +42 -0
  143. package/src/private/ui/ScreenHome.vue +29 -0
  144. package/src/private/ui/ScreenNotifications.vue +44 -0
  145. package/src/private/ui/ScreenReads.vue +23 -0
  146. package/src/private/ui/ScreenSettings.vue +44 -0
  147. package/src/private/ui/private.css +81 -0
  148. package/src/private/ui/root.ts +89 -0
  149. package/src/private/ui/text.ts +40 -0
  150. package/src/private/vue.ts +87 -0
@@ -0,0 +1,33 @@
1
+ /**
2
+ * A message's text as the conversation shows it (m4-contracts.md §7.8 DM8b): plain text, with the web addresses a
3
+ * member wrote marked as links that open only after a warning on click. Nothing here is markup — the segments are
4
+ * rendered as text nodes and an `<a>` whose `href` is the address this module re-serialised — and nothing here asks
5
+ * anything of anyone: an address is checked locally, never fetched, previewed or reported.
6
+ *
7
+ * Only an address written with `http://` or `https://` is a link. Anything else (`javascript:`, `data:`, `www.…`
8
+ * without a scheme, a bare word with a dot) stays text: guessing a scheme would make the client decide where a member
9
+ * is sent, and the warning shows the address exactly as it was written. The private entry may not import the public text glue
10
+ * (`core/text.ts`, which reaches `@blogmcp/sanitize/url`; test/closed-paths.spec.ts), so the check is the URL parser's:
11
+ * an address that does not parse, or parses to another scheme, is text.
12
+ *
13
+ * A request's links are inactive (§7.3: "links inactive in the client"): `segmentsOf(text, { links: false })` gives one
14
+ * text segment.
15
+ */
16
+ export type DmTextSegment = {
17
+ readonly kind: 'text';
18
+ readonly text: string;
19
+ } | {
20
+ readonly kind: 'link';
21
+ readonly text: string;
22
+ readonly href: string;
23
+ readonly host: string;
24
+ };
25
+ /** The address, re-serialised by the URL parser, and its host; null for anything that is not an http(s) address. */
26
+ export declare function linkOf(written: string): {
27
+ href: string;
28
+ host: string;
29
+ } | null;
30
+ /** The segments of a message's text (see the module doc). */
31
+ export declare function segmentsOf(text: string, options?: {
32
+ links?: boolean;
33
+ }): DmTextSegment[];
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Muted words (m4-contracts.md §7.8 DM8b): the member's list of words whose messages the conversation folds away, kept
3
+ * on this device only — in this browser's IndexedDB — and matched in the browser. The list never leaves the device: this
4
+ * module imports nothing, names no transport and no private client, and the server never learns which words a member
5
+ * mutes or which messages were folded (test/private/dm/nothing-leaves.spec.ts holds it to that).
6
+ *
7
+ * The store is per member (`scope`, the member's id: two members on one browser keep two lists). Where IndexedDB is
8
+ * missing or refuses (a private window, a blocked storage), the list lives in this tab's memory and the screen says
9
+ * that it is not kept (`persistent: false`).
10
+ *
11
+ * Matching ignores case and diacritics and takes a muted word as the start of a word: „houb“ folds „houby“, „HOUBY“
12
+ * and „Houbička“, but not „chouba“ — so a member need not list every form a Czech word takes.
13
+ */
14
+ export declare const MUTED_DB_NAME = "blogmcp-private-muted";
15
+ export declare const MUTED_DB_STORE = "words";
16
+ /** At most this many words, each at most this long: the list is matched against every message shown. */
17
+ export declare const MUTED_MAX_WORDS = 100;
18
+ export declare const MUTED_MAX_LENGTH = 40;
19
+ export interface MutedStore {
20
+ /** The member's words (empty when none were stored or the store is unreadable). */
21
+ load(): Promise<string[]>;
22
+ /** Keep the member's words; false when this browser could not keep them (they stay in memory for this tab). */
23
+ save(words: readonly string[]): Promise<boolean>;
24
+ readonly persistent: () => boolean;
25
+ }
26
+ /** Lower case, without diacritics, blanks collapsed: the form both a muted word and a message are compared in. */
27
+ export declare function foldText(text: string): string;
28
+ /** A word as the list keeps it: trimmed, folded, bounded; null for a blank one. */
29
+ export declare function mutedWordOf(input: string): string | null;
30
+ /** The list cleaned: folded, without blanks and repeats, bounded. */
31
+ export declare function cleanMutedWords(words: readonly unknown[]): string[];
32
+ /** Whether `text` holds a muted word at the start of one of its words (see the module doc). */
33
+ export declare function mutedMatch(text: string | null | undefined, words: readonly string[]): boolean;
34
+ /** The list in this tab's memory only. */
35
+ export declare function memoryMutedStore(initial?: readonly string[]): MutedStore;
36
+ /** The member's list in this browser's IndexedDB, or in memory where IndexedDB is not there (see the module doc). */
37
+ export declare function indexedDbMutedStore(scope: string, idb?: IDBFactory | null): MutedStore;
@@ -0,0 +1,7 @@
1
+ /** The smallest query that searches (a single letter would mark nearly every message). */
2
+ export declare const DM_SEARCH_MIN_LENGTH = 2;
3
+ /** The seqs of the loaded messages whose text holds the query, ignoring case and diacritics, in the thread's order. */
4
+ export declare function searchLoaded(messages: ReadonlyArray<{
5
+ readonly seq: number;
6
+ readonly text: string | null;
7
+ }>, query: string): number[];
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The conversations' words: the private catalogue (i18n.ts) through the screens' helper, a refusal of the
3
+ * conversations by its own key (`dmErrorKey`), and a counterpart's name — the deleted placeholder's words for an erased
4
+ * member, never an empty line.
5
+ */
6
+ import type { PrivateDmCounterpart } from '@blogmcp/sdk/community/private';
7
+ import { type Lang } from '../i18n';
8
+ import { type ScreenText } from '../ui/text';
9
+ export interface DmText extends ScreenText {
10
+ /** A refusal code's sentence. */
11
+ err(code: string | null | undefined): string;
12
+ /**
13
+ * The counterpart's display name (and handle), the deleted placeholder's words for an erased member, or — while the
14
+ * counterpart is not known yet (a conversation just opened by handle) — the conversations' title.
15
+ */
16
+ who(c: PrivateDmCounterpart | null | undefined): string;
17
+ }
18
+ export declare function dmText(lang: Lang): DmText;
19
+ /**
20
+ * The keys of the report's lines and categories, spelt out: test/private/text.spec.ts checks every literal key against
21
+ * the catalogue, and a key built from a value (`` `…${line}` ``) would be a family that scan does not know.
22
+ */
23
+ export declare const DM_LINE_KEYS: Readonly<{
24
+ readonly rules: "private.dm.report.line.rules";
25
+ readonly illegal: "private.dm.report.line.illegal";
26
+ }>;
27
+ export declare const DM_CATEGORY_KEYS: Readonly<Record<string, string>>;
@@ -0,0 +1,8 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ lang: Lang;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ lang: Lang;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ conversationId: string;
6
+ lang: Lang;
7
+ firstMessage: boolean;
8
+ replyTo: {
9
+ seq: number;
10
+ excerpt: string;
11
+ } | null;
12
+ };
13
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ sent: () => any;
15
+ cancelReply: () => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ onSent?: (() => any) | undefined;
18
+ onCancelReply?: (() => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ lang: Lang;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ open: (conversationId: string) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onOpen?: ((conversationId: string) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ lang: Lang;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ lang: Lang;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { DmViewController } from '../controller';
2
+ type __VLS_Props = {
3
+ dm: DmViewController;
4
+ text: string;
5
+ links: boolean;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ lang: Lang;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ opened: (conversationId: string) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onOpened?: ((conversationId: string) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { Lang } from '../../i18n';
2
+ import { type DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ lang: Lang;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ lang: Lang;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ open: (conversationId: string) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onOpen?: ((conversationId: string) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController | null;
5
+ lang: Lang;
6
+ openConversation?: (conversationId: string) => void;
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import type { Lang } from '../../i18n';
2
+ import type { DmViewController } from '../controller';
3
+ type __VLS_Props = {
4
+ dm: DmViewController;
5
+ conversationId: string;
6
+ lang: Lang;
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -0,0 +1,23 @@
1
+ export declare const CHAT_DOCK_ELEMENT_TAG = "blogmcp-chat-dock";
2
+ export declare const PRIVATE_VIEW_ELEMENT_TAG = "blogmcp-private-view";
3
+ /** The host attribute that hides the dock without unmounting it. */
4
+ export declare const HIDDEN_BY_HOST_ATTR = "hidden-by-host";
5
+ export interface DefinePrivateElementOptions {
6
+ /** Another tag name for the element. */
7
+ tag?: string;
8
+ /** CSP nonce for the element's `<style>` (else each element's own `nonce`). */
9
+ nonce?: string;
10
+ }
11
+ export interface DefinePrivateElementsOptions {
12
+ nonce?: string;
13
+ tags?: {
14
+ chatDock?: string;
15
+ privateView?: string;
16
+ };
17
+ }
18
+ /** Register `<blogmcp-chat-dock>` (once; later calls are no-ops). Browser only. */
19
+ export declare function defineChatDockElement(opts?: DefinePrivateElementOptions): void;
20
+ /** Register `<blogmcp-private-view>` (once). Browser only. */
21
+ export declare function definePrivateViewElement(opts?: DefinePrivateElementOptions): void;
22
+ /** Register both (once). Browser only. */
23
+ export declare function definePrivateElements(opts?: DefinePrivateElementsOptions): void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The private `<script>` build (`blogmcp-community-private.global.js`): registers `<blogmcp-chat-dock>` and
3
+ * `<blogmcp-private-view>` with the script tag's own CSP nonce and exposes `window.BlogmcpCommunityPrivate`. It is a
4
+ * file of its own, never part of the public `blogmcp-community.global.js`: a page that shows no private view loads none
5
+ * of it. Load it only where the host's `me/get` names a live private block.
6
+ */
7
+ import { definePrivateElements } from './element';
8
+ import { mountChatDock, mountPrivateView } from './mount';
9
+ import { VERSION } from '../version';
10
+ export { definePrivateElements, mountChatDock, mountPrivateView, VERSION };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The private elements' words (m4-contracts.md §6.2): one catalogue of their own, `messages/{cs,en}.json`, beside the
3
+ * SDK's public one. The private view is a separate entry with its own bundle and its own scans; its texts are kept out
4
+ * of the public catalogue, so that the public elements' bundle carries none of them, and they are data (JSON), so
5
+ * that a host can merge them into its own i18n as it does the SDK's. Every reader-facing string of `src/private/**`
6
+ * is a key here — test/private/text.spec.ts scans the code for any other words and runs the tone test over the
7
+ * catalogue (community.md §3.5: the absolutes only in a reviewed sentence).
8
+ *
9
+ * The promise (invariant 12) is the SDK's: its keys come from `privatePromise` and its Czech sentences from
10
+ * `PRIVATE_PROMISE_MESSAGES_CS`, so the elements cannot word it differently from the matrix; the English sentences
11
+ * are this catalogue's, under the same keys.
12
+ */
13
+ import { type PrivatePromiseKey } from '@blogmcp/sdk/community/private';
14
+ import { pickLang, documentLang, type Lang } from '../core/i18n';
15
+ export type { Lang };
16
+ export { pickLang, documentLang };
17
+ /** Both catalogues, flat (`'private.devices.title'`, …). */
18
+ export declare const PRIVATE_MESSAGES: Readonly<Record<Lang, Readonly<Record<string, string>>>>;
19
+ export type PrivateParams = Record<string, string | number>;
20
+ /** Whether the catalogue has a text for `key` (Czech is the reference). */
21
+ export declare function hasPrivateMessage(key: string): boolean;
22
+ /** One text in `lang`; an unknown key comes back as itself (a code a newer kb-api sends is looked up only when known). */
23
+ export declare function privateMessage(lang: Lang, key: string, params?: PrivateParams): string;
24
+ /** One sentence of the promise: Czech from the SDK's matrix, English from this catalogue. */
25
+ export declare function promiseMessage(lang: Lang, key: PrivatePromiseKey, params?: PrivateParams): string;
26
+ export type PrivateTranslate = (key: string, params?: PrivateParams) => string;
27
+ export declare function privateTranslator(lang: Lang): PrivateTranslate;
28
+ /**
29
+ * Refusals a retry cannot cure (Appendix A.6), from the grant or the first private call: the private view says them
30
+ * once, without a retry button, and drops the private-root mark and the dock's launcher (C.8). `PRIVATE_IDENTITY` is the
31
+ * tenant's `private_identity = provider_only` refusing a delegated member, which stays so until the tenant changes the
32
+ * setting or the member signs in another way; `ACTIVATION_REQUIRED` a grant or a load refused for an activation this
33
+ * member withdrew or never gave where a screen cannot take it; `MEMBER_READ_ONLY` and `MEMBER_DELETION_REQUESTED` a
34
+ * member whose writes are closed (under the age minimum, a deletion pending) — each stays so until something outside
35
+ * this page changes.
36
+ */
37
+ export declare const FINAL_REFUSALS: readonly string[];
38
+ /** The catalogue key of a refusal code: the known ones by name, any other the generic sentence. */
39
+ export declare function errorKey(code: string | null | undefined): string;
40
+ /** A date (and time) in the reader's language; '' for a missing or malformed value. */
41
+ export declare function formatWhen(lang: Lang, iso: string | null | undefined, withTime?: boolean): string;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @blogmcp/community/private — the private elements (m4-contracts.md §6.2), a separate entry with its own bundle, over
3
+ * `@blogmcp/sdk/community/private`, the public SDK and Vue only; the public entry never imports it.
4
+ *
5
+ * - `<blogmcp-chat-dock>` the dock: the launcher with the private unread dot, the conversation list, up to three
6
+ * windows on a desktop and full screen on a phone; it lives in the host's root layout, and
7
+ * `hidden-by-host` hides it by CSS without unmounting it;
8
+ * - `<blogmcp-private-view>` the private screens: the activation, the address step, the devices, the approval, the
9
+ * read log, the private notifications, the private settings, the promise and, on every
10
+ * screen, the provider line;
11
+ * - `definePrivateElements()`, `defineChatDockElement()`, `definePrivateViewElement()`, `mountChatDock(…)`,
12
+ * `mountPrivateView(…)`; `@blogmcp/community/private/vue` and `/react` — `<KbChatDock>`, `<KbPrivateView>`;
13
+ * `@blogmcp/community/private/global` — one `<script>` (`blogmcp-community-private.global.js`).
14
+ *
15
+ * BROWSER-ONLY: the private SDK refuses to load on a server (the device key must never exist there), so this entry
16
+ * throws on import outside a browser. Import it from client-only code; the wrappers do so after hydration.
17
+ * Mount it only when the host's `me/get` names a private block that is `live` or `read_only` — the elements check
18
+ * again and render nothing otherwise, and ask kb-api nothing private.
19
+ *
20
+ * Live updates: pass the SDK's `createPrivateRealtime` (`@blogmcp/sdk/community/private`) as the `realtime` property
21
+ * (`mountChatDock({ …, realtime: createPrivateRealtime })`); the element starts it with its own private client once the
22
+ * view is ready. Without it the view reads on every open, as before.
23
+ */
24
+ export { definePrivateElements, defineChatDockElement, definePrivateViewElement, CHAT_DOCK_ELEMENT_TAG, PRIVATE_VIEW_ELEMENT_TAG, HIDDEN_BY_HOST_ATTR, type DefinePrivateElementOptions, type DefinePrivateElementsOptions, } from './element';
25
+ export { mountChatDock, mountPrivateView, type MountChatDockOptions, type MountPrivateViewOptions } from './mount';
26
+ export { createPrivateView, providerOf, promiseFor, pushSectionOf, isFinalFailure, ACCOUNT_STATE_EVENTS, APPROVAL_LIMIT_CODES, PRIVATE_SCREENS, PRIVATE_NOTIFICATION_CODES, DM_AUDIENCES, type PrivateScreen, type PrivateViewController, type PrivateViewUi, type ProviderLine, type DmAudience, type PrivateSettingsValues, } from './core/view';
27
+ export { createDock, DOCK_MAX_WINDOWS, DOCK_MOBILE_QUERY, type DockController, type PrivateDockRealtime } from './core/dock';
28
+ export { isRealtimeInput, refreshesUnread, type PrivateRealtimeInput, type PrivateRealtimeFactory, type PrivateRealtimeFactoryOptions, type PrivateRealtimeSource, type PrivateRealtimeState, type PrivateInboxEvent, } from './core/realtime';
29
+ export { browserPrivatePush, type PrivatePushPort, type PrivatePushResult } from './core/push';
30
+ export { PRIVATE_MESSAGES, privateMessage, promiseMessage, hasPrivateMessage } from './i18n';
31
+ export * from './dm';
32
+ export { VERSION } from '../version';
@@ -0,0 +1,57 @@
1
+ import { A, h, C, F, D, L, N, M, E, B, X, n, o, H, T, U, V, t, k, j, P, s, J, I, K, z, G, x, l, e, a, d, b, y, S, w, O, i, q, Z, Q, m, c, R, u, f, v, p, g, r, W, Y } from "../chunks/private-mount-bhCQeScD.js";
2
+ const VERSION = "0.5.0";
3
+ export {
4
+ A as ACCOUNT_STATE_EVENTS,
5
+ h as APPROVAL_LIMIT_CODES,
6
+ C as CHAT_DOCK_ELEMENT_TAG,
7
+ F as DM_ADVERSE_EVENT,
8
+ D as DM_AUDIENCES,
9
+ L as DM_COMPOSER_KEYS,
10
+ N as DM_DELETE_FOR_ALL_MS,
11
+ M as DM_EDIT_WINDOW_MS,
12
+ E as DM_RULES_CATEGORIES,
13
+ B as DM_SCREENS,
14
+ X as DM_SEARCH_MIN_LENGTH,
15
+ n as DOCK_MAX_WINDOWS,
16
+ o as DOCK_MOBILE_QUERY,
17
+ H as HIDDEN_BY_HOST_ATTR,
18
+ T as MUTED_DB_NAME,
19
+ U as MUTED_DB_STORE,
20
+ V as MUTED_MAX_WORDS,
21
+ t as PRIVATE_MESSAGES,
22
+ k as PRIVATE_NOTIFICATION_CODES,
23
+ j as PRIVATE_SCREENS,
24
+ P as PRIVATE_VIEW_ELEMENT_TAG,
25
+ VERSION,
26
+ s as browserPrivatePush,
27
+ J as canDeleteForAll,
28
+ I as canEdit,
29
+ K as canReport,
30
+ z as categoriesOf,
31
+ G as composerKeys,
32
+ x as createDmView,
33
+ l as createDock,
34
+ e as createPrivateView,
35
+ a as defineChatDockElement,
36
+ d as definePrivateElements,
37
+ b as definePrivateViewElement,
38
+ y as dmErrorKey,
39
+ S as foldText,
40
+ w as hasPrivateMessage,
41
+ O as indexedDbMutedStore,
42
+ i as isFinalFailure,
43
+ q as isRealtimeInput,
44
+ Z as linkOf,
45
+ Q as memoryMutedStore,
46
+ m as mountChatDock,
47
+ c as mountPrivateView,
48
+ R as mutedMatch,
49
+ u as privateMessage,
50
+ f as promiseFor,
51
+ v as promiseMessage,
52
+ p as providerOf,
53
+ g as pushSectionOf,
54
+ r as refreshesUnread,
55
+ W as searchLoaded,
56
+ Y as segmentsOf
57
+ };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Put a private element on the page from code (what the private Vue and React wrappers do). The element is defined
3
+ * first, every attribute and property set before it connects, and the returned function removes it again.
4
+ *
5
+ * Browser only: this module imports `@blogmcp/sdk/community/private`, which refuses to load on a server (the device
6
+ * key must never exist there). The wrappers import it lazily, after hydration.
7
+ */
8
+ import type { CommunityTransport } from '@blogmcp/sdk/community';
9
+ import type { PrivateClient } from '@blogmcp/sdk/community/private';
10
+ import type { CommunityRoutes } from '../core/attrs';
11
+ import type { PrivateDockRealtime } from './core/dock';
12
+ import type { PrivatePushPort } from './core/push';
13
+ interface CommonPrivateMountOptions {
14
+ /** kb-api's public origin (`https://<slug>.blogmcp.ai`): the private client's only origin. */
15
+ kbOrigin: string;
16
+ /** The host's relative base for its own `me/get` (default `/api/community` under `siteBase`). */
17
+ apiBase?: string;
18
+ siteBase?: string;
19
+ lang?: string;
20
+ /** The host's pages and grant routes (`grantPath`, `grantHandoffPath`, `messagesPath`, …). */
21
+ routes?: CommunityRoutes;
22
+ /** The website's name, for the promise. */
23
+ siteName?: string;
24
+ /** The host's worker route (default `<site-base>/sw.js`), for this browser's private push. */
25
+ swPath?: string;
26
+ /** The account host's origin (`https://<slug>--account.<base>`): the `provider_page` link. */
27
+ accountOrigin?: string;
28
+ nonce?: string;
29
+ /** A replacement for the host's transport (tests). */
30
+ transport?: CommunityTransport;
31
+ /** A private client the host made itself (tests, or a host with its own UI around the view). */
32
+ client?: PrivateClient;
33
+ /** A replacement for this browser's push glue (tests); null offers no private push. */
34
+ push?: PrivatePushPort | null;
35
+ /**
36
+ * The live inbox (§6.3): the SDK's `createPrivateRealtime` — the element starts it with its own private client — or
37
+ * a source of the host's own (`{ subscribe(listener) }`).
38
+ */
39
+ realtime?: PrivateDockRealtime;
40
+ /** Where the element goes; default `document.body`. */
41
+ container?: Element;
42
+ }
43
+ export interface MountChatDockOptions extends CommonPrivateMountOptions {
44
+ /** Hide the dock by CSS without unmounting it (the regulated preset's pages). */
45
+ hiddenByHost?: boolean;
46
+ }
47
+ export interface MountPrivateViewOptions extends CommonPrivateMountOptions {
48
+ /** The screen to open first (`devices`, `notifications`, …). */
49
+ screen?: string;
50
+ }
51
+ /** Mount `<blogmcp-chat-dock>` (in the host's root layout, once); returns the function that removes it. */
52
+ export declare function mountChatDock(o: MountChatDockOptions): () => void;
53
+ /** Mount `<blogmcp-private-view>`; returns the function that removes it. */
54
+ export declare function mountPrivateView(o: MountPrivateViewOptions): () => void;
55
+ export {};
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The account pages' client of the account surface (m4-contracts.md §5.8, §5.10, Appendix A.2): `account/*`
3
+ * operations, each a POST of a JSON body to this host's own origin, authenticated by the capability in the body.
4
+ *
5
+ * It spells no route and opens no connection of its own (test/closed-paths.spec.ts holds every file under src/private/
6
+ * to that): the paths are the SDK's generated copy of kb-api's route list (`PRIVATE_ROUTES`), and the request is the
7
+ * public SDK's `fetchTransport` — POST, JSON, `mode: 'same-origin'`, `redirect: 'error'`, `cache: 'no-store'` — over
8
+ * the base `/api/community`, which stands in for kb-api's `/community` mount exactly as the public operations' base
9
+ * does (`communityOpPath`; the ingress strips `/api`). A same-origin POST carries this host's `Origin`, which the
10
+ * account router's browser guard requires; the account host sets no cookie and the ingress strips any, so the
11
+ * transport's `credentials: 'same-origin'` sends nothing.
12
+ *
13
+ * Every answer is an outcome, never a throw: kb-api's `{ ok: true, … }` as the value, its `{ ok: false, code }` as the
14
+ * refusal, `NETWORK` when nothing answered and `BAD_ANSWER` for a body that is not kb-api's.
15
+ */
16
+ import { type CommunityTransport } from '@blogmcp/sdk/community';
17
+ /** The account surface's operations the pages call (Appendix A.2). */
18
+ export declare const ACCOUNT_PAGE_OPS: readonly ["address/set", "address/verify", "address/change/request", "address/change/confirm", "device/approval/get", "device/approve", "device/list", "device/sign-out", "device/sign-out-all", "reads/list", "export/confirm", "export/download", "activation/dispute", "activation/end"];
19
+ export type AccountPageOp = (typeof ACCOUNT_PAGE_OPS)[number];
20
+ /** The host base the operations are served under on the account host. */
21
+ export declare const ACCOUNT_API_BASE = "/api/community";
22
+ /** One account operation's path as kb-api serves it, from the SDK's route list; null while kb-api serves none. */
23
+ export declare function accountRoutePath(op: AccountPageOp): string | null;
24
+ /**
25
+ * The URL a key-bound approval's proof signs (`htu`, §5.10 B-66): the operation's URL on this origin as kb-api
26
+ * computes it (`approveProofHtu`, KB_ACCOUNT_ORIGIN plus `/api` and the route).
27
+ */
28
+ export declare function accountOperationUrl(origin: string, op: AccountPageOp): string | null;
29
+ export type AccountOutcome<T> = {
30
+ ok: true;
31
+ value: T;
32
+ } | {
33
+ ok: false;
34
+ code: string;
35
+ status: number | null;
36
+ };
37
+ export interface AccountApi {
38
+ call<T = Record<string, unknown>>(op: AccountPageOp, body: Record<string, unknown>): Promise<AccountOutcome<T>>;
39
+ }
40
+ export declare const ACCOUNT_TIMEOUT_MS = 15000;
41
+ export declare function createAccountApi(options?: {
42
+ transport?: CommunityTransport;
43
+ timeoutMs?: number;
44
+ }): AccountApi;
@@ -0,0 +1,6 @@
1
+ export declare const ACCOUNT_PAGE_ELEMENT_TAG = "blogmcp-account-page";
2
+ /** Register `<blogmcp-account-page>` once, its stylesheet carrying `nonce`. Browser only. */
3
+ export declare function defineAccountPageElement(opts?: {
4
+ nonce?: string;
5
+ tag?: string;
6
+ }): void;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The capability an account page was opened with (m4-contracts.md §5.10 "The account surface"): it travels in the
3
+ * URL's fragment (`#t=kbda_…`), which no request carries, so neither kb-api's nor the ingress's logs ever see it. The
4
+ * page reads it once and removes it from the address bar (`history.replaceState`), so it is neither in the history nor
5
+ * in a bookmark, nor shown to whoever looks at the screen; from then on it lives in the page's memory only. A reload
6
+ * therefore starts without it: the member opens the e-mail's link again.
7
+ *
8
+ * The prefix names the capability's purpose (Appendix A.3), which tells a page what to do with it; kb-api decides
9
+ * whether it is usable.
10
+ */
11
+ /** Each capability's purpose by its prefix (kb-api's ACCOUNT_TOKEN_POLICY, services/community/private/account.ts). */
12
+ export declare const CAPABILITY_PREFIXES: Readonly<{
13
+ readonly kbas_: "address_set";
14
+ readonly kbav_: "address_verify";
15
+ readonly kbaw_: "address_change_verify";
16
+ readonly kbax_: "address_change_confirm";
17
+ readonly kbda_: "device_approve";
18
+ readonly kbdl_: "device_list";
19
+ readonly kbae_: "export_confirm";
20
+ readonly kbad_: "activation_dispute";
21
+ readonly kbac_: "contract_end_confirm";
22
+ }>;
23
+ export type CapabilityPurpose = (typeof CAPABILITY_PREFIXES)[keyof typeof CAPABILITY_PREFIXES];
24
+ export interface Capability {
25
+ readonly token: string;
26
+ readonly purpose: CapabilityPurpose;
27
+ }
28
+ /** The capability a token names, or null for any other shape. */
29
+ export declare function capabilityOf(token: unknown): Capability | null;
30
+ export interface FragmentWindow {
31
+ location: {
32
+ hash: string;
33
+ pathname: string;
34
+ };
35
+ history: {
36
+ replaceState(data: unknown, unused: string, url?: string): void;
37
+ };
38
+ }
39
+ /**
40
+ * Read the fragment's `t` and remove the whole fragment from the address bar (whatever it held). Null when the page
41
+ * was opened without a usable capability.
42
+ */
43
+ export declare function takeCapability(w?: FragmentWindow): Capability | null;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The account pages' words (m4-contracts.md §6.4): a catalogue of their own, `messages/{cs,en}.json`, under the
3
+ * `account.` prefix. The pages are a bundle of their own, served by kb-api on the account host, so their texts stay out
4
+ * of the private view's catalogue and the public one alike; they are data (JSON), as the other catalogues are, and no
5
+ * page file holds a sentence (test/text-only.spec.ts and test/account-pages/catalogue.spec.ts scan them). The private
6
+ * view on `/zpravy` keeps its own words (`../i18n.ts`).
7
+ */
8
+ import { type Lang } from '../i18n';
9
+ export type { Lang };
10
+ /** Both catalogues, flat (`'account.approve.title'`, …). */
11
+ export declare const ACCOUNT_MESSAGES: Readonly<Record<Lang, Readonly<Record<string, string>>>>;
12
+ export type AccountParams = Record<string, string | number>;
13
+ /** Whether the catalogue has a text for `key` (Czech is the reference). */
14
+ export declare function hasAccountMessage(key: string): boolean;
15
+ /** One text in `lang`; an unknown key falls back to Czech, then to the key itself. */
16
+ export declare function accountMessage(lang: Lang, key: string, params?: AccountParams): string;
17
+ /** The catalogue key of a refusal: the ones an account page meets by name, any other the generic sentence. */
18
+ export declare function accountErrorKey(code: string | null | undefined): string;
19
+ export interface AccountText {
20
+ at(key: string, params?: AccountParams): string;
21
+ /** A refusal's sentence. */
22
+ refusal(code: string | null | undefined): string;
23
+ when(iso: string | null | undefined, withTime?: boolean): string;
24
+ }
25
+ export declare function accountText(lang: Lang): AccountText;
@@ -0,0 +1 @@
1
+ export {};