@hiver/connector-agent 4.27.1-relatedName-beta.0 → 4.28.0-pmCommentSync-beta.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 (66) hide show
  1. package/app/connector-cards.d.ts.map +1 -1
  2. package/constants/global-constants.d.ts +1 -0
  3. package/constants/global-constants.d.ts.map +1 -1
  4. package/features/connector-cards/api/idLookup.d.ts +0 -1
  5. package/features/connector-cards/api/idLookup.d.ts.map +1 -1
  6. package/features/connector-cards/components/card-list/Card.d.ts.map +1 -1
  7. package/features/connector-cards/hooks/useIdLookup.d.ts.map +1 -1
  8. package/features/connector-cards/hooks/useRelatedRecords.d.ts.map +1 -1
  9. package/features/connector-cards/utils/idLookup.d.ts.map +1 -1
  10. package/features/pm-comments/api/client.d.ts +23 -0
  11. package/features/pm-comments/api/client.d.ts.map +1 -0
  12. package/features/pm-comments/api/queries.d.ts +39 -0
  13. package/features/pm-comments/api/queries.d.ts.map +1 -0
  14. package/features/pm-comments/components/CommentComposer.d.ts +18 -0
  15. package/features/pm-comments/components/CommentComposer.d.ts.map +1 -0
  16. package/features/pm-comments/components/CommentItem.d.ts +30 -0
  17. package/features/pm-comments/components/CommentItem.d.ts.map +1 -0
  18. package/features/pm-comments/components/MentionCandidatesPicker.d.ts +13 -0
  19. package/features/pm-comments/components/MentionCandidatesPicker.d.ts.map +1 -0
  20. package/features/pm-comments/components/TaskCommentsRow.d.ts +15 -0
  21. package/features/pm-comments/components/TaskCommentsRow.d.ts.map +1 -0
  22. package/features/pm-comments/components/TaskHeader.d.ts +20 -0
  23. package/features/pm-comments/components/TaskHeader.d.ts.map +1 -0
  24. package/features/pm-comments/components/TaskThreadPanel.d.ts +9 -0
  25. package/features/pm-comments/components/TaskThreadPanel.d.ts.map +1 -0
  26. package/features/pm-comments/components/TaskThreadView.d.ts +16 -0
  27. package/features/pm-comments/components/TaskThreadView.d.ts.map +1 -0
  28. package/features/pm-comments/components/icons.d.ts +13 -0
  29. package/features/pm-comments/components/icons.d.ts.map +1 -0
  30. package/features/pm-comments/components/styles.d.ts +57 -0
  31. package/features/pm-comments/components/styles.d.ts.map +1 -0
  32. package/features/pm-comments/constants/api.d.ts +15 -0
  33. package/features/pm-comments/constants/api.d.ts.map +1 -0
  34. package/features/pm-comments/constants/tracking.d.ts +12 -0
  35. package/features/pm-comments/constants/tracking.d.ts.map +1 -0
  36. package/features/pm-comments/context-value.d.ts +25 -0
  37. package/features/pm-comments/context-value.d.ts.map +1 -0
  38. package/features/pm-comments/context.d.ts +20 -0
  39. package/features/pm-comments/context.d.ts.map +1 -0
  40. package/features/pm-comments/types/wire.d.ts +145 -0
  41. package/features/pm-comments/types/wire.d.ts.map +1 -0
  42. package/features/pm-comments/utils/body.d.ts +5 -0
  43. package/features/pm-comments/utils/body.d.ts.map +1 -0
  44. package/features/pm-comments/utils/draft.d.ts +9 -0
  45. package/features/pm-comments/utils/draft.d.ts.map +1 -0
  46. package/features/pm-comments/utils/editor.d.ts +18 -0
  47. package/features/pm-comments/utils/editor.d.ts.map +1 -0
  48. package/features/pm-comments/utils/format.d.ts +5 -0
  49. package/features/pm-comments/utils/format.d.ts.map +1 -0
  50. package/features/pm-comments/utils/pm-connectors.d.ts +7 -0
  51. package/features/pm-comments/utils/pm-connectors.d.ts.map +1 -0
  52. package/features/pm-comments/utils/rich-text.d.ts +18 -0
  53. package/features/pm-comments/utils/rich-text.d.ts.map +1 -0
  54. package/features/pm-comments/utils/thread-state.d.ts +90 -0
  55. package/features/pm-comments/utils/thread-state.d.ts.map +1 -0
  56. package/index.es.js +15922 -14147
  57. package/index.umd.js +774 -485
  58. package/main-dev.d.ts.map +1 -1
  59. package/package.json +1 -1
  60. package/testing/dev/PmCommentsHarness.d.ts +5 -0
  61. package/testing/dev/PmCommentsHarness.d.ts.map +1 -0
  62. package/testing/mocks/handlers/pm-comments.d.ts +36 -0
  63. package/testing/mocks/handlers/pm-comments.d.ts.map +1 -0
  64. package/testing/mocks/handlers.d.ts.map +1 -1
  65. package/utils/action-queue.d.ts +16 -0
  66. package/utils/action-queue.d.ts.map +1 -1
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Wire contract for Comment Sync (PM tools). Mirrors Brain tech spec 0030
3
+ * "Affected APIs & contracts" exactly; change the spec first, then this file.
4
+ */
5
+ export type ReadSource = 'admin' | 'user';
6
+ export type ReadBlock = 'comment_sync_off' | 'user_auth_required' | 'user_auth_expired' | 'workspace_mismatch' | 'admin_disconnected' | 'admin_no_task_access' | 'user_no_task_access' | 'task_not_found';
7
+ export type PostBlock = 'connect_required' | 'user_auth_expired' | 'workspace_mismatch' | 'user_no_task_access' | 'posting_not_supported';
8
+ export type TaskAccess = {
9
+ readSource: ReadSource | null;
10
+ readBlock: ReadBlock | null;
11
+ postBlock: PostBlock | null;
12
+ workspaceName?: string | null;
13
+ };
14
+ export type CommentCapabilities = {
15
+ replies: boolean;
16
+ mentions: boolean;
17
+ };
18
+ /** Inline formatting the composer sends (PRD G15: rich text); the server maps it to each app's format. */
19
+ export type TextMark = 'bold' | 'italic' | 'strike' | 'code';
20
+ export type BodyNode = {
21
+ type: 'text';
22
+ text: string;
23
+ marks?: TextMark[];
24
+ } | {
25
+ type: 'linebreak';
26
+ } | {
27
+ type: 'link';
28
+ url: string;
29
+ text: string;
30
+ } | {
31
+ type: 'mention';
32
+ externalUserId: string;
33
+ name: string;
34
+ } | {
35
+ type: 'list';
36
+ ordered: boolean;
37
+ items: BodyNode[][];
38
+ };
39
+ export type CommentAuthor = {
40
+ externalUserId: string;
41
+ name: string;
42
+ avatarUrl: string | null;
43
+ isSelf: boolean;
44
+ };
45
+ export type CommentAttachment = {
46
+ id: string;
47
+ name: string;
48
+ sizeBytes: number | null;
49
+ mimeType: string | null;
50
+ /** null when the reader's access can't download it (R7): the chip shows it as unavailable. */
51
+ downloadUrl: string | null;
52
+ thumbnailUrl: string | null;
53
+ };
54
+ export type TaskComment = {
55
+ id: string;
56
+ parentId: string | null;
57
+ replyCount: number;
58
+ author: CommentAuthor;
59
+ body: BodyNode[];
60
+ attachments: CommentAttachment[];
61
+ createdAt: string;
62
+ editedAt: string | null;
63
+ mentionsViewer: boolean;
64
+ /** Per rep: posted after the rep last read this task's thread (PRD R2, unread comments). */
65
+ unread: boolean;
66
+ };
67
+ export type TaskCommentSummary = {
68
+ taskId: string;
69
+ taskTitle: string;
70
+ taskUrl: string;
71
+ commentCount: number | null;
72
+ /** Comments the rep hasn't read yet; null when the rep can't read the thread. */
73
+ unreadCount: number | null;
74
+ access: TaskAccess;
75
+ capabilities: CommentCapabilities;
76
+ };
77
+ export type CommentSummaryResponse = {
78
+ tasks: TaskCommentSummary[];
79
+ };
80
+ export type CommentPage = {
81
+ comments: TaskComment[];
82
+ olderCursor: string | null;
83
+ totalCount: number;
84
+ access: TaskAccess;
85
+ capabilities: CommentCapabilities;
86
+ taskTitle: string;
87
+ taskUrl: string;
88
+ /** The reading rep's own user id in the app (own connection or matched by email); highlights their mentions. */
89
+ viewerExternalUserId: string | null;
90
+ /** null when the app has no status the UI can show for this task. */
91
+ status: TaskStatusState | null;
92
+ };
93
+ /** A task's status as the app names it (PRD R2 / G25: editable from the thread header). */
94
+ export type TaskStatus = {
95
+ id: string;
96
+ label: string;
97
+ color: string | null;
98
+ };
99
+ /** `editable` is the backend's answer for this rep: own connection with write access to the task (R3). */
100
+ export type TaskStatusState = {
101
+ current: TaskStatus | null;
102
+ editable: boolean;
103
+ };
104
+ export type TaskStatusesResponse = {
105
+ statuses: TaskStatus[];
106
+ };
107
+ export type UpdateStatusRequest = {
108
+ conversationId: string;
109
+ statusId: string;
110
+ };
111
+ export type UpdateStatusResponse = {
112
+ status: TaskStatus;
113
+ };
114
+ export type RepliesPage = {
115
+ comments: TaskComment[];
116
+ olderCursor: string | null;
117
+ };
118
+ export type PostCommentRequest = {
119
+ conversationId: string;
120
+ clientMsgId: string;
121
+ parentId: string | null;
122
+ body: BodyNode[];
123
+ };
124
+ export type PostCommentResponse = {
125
+ comment: TaskComment;
126
+ };
127
+ export type MentionCandidate = {
128
+ externalUserId: string;
129
+ name: string;
130
+ email: string | null;
131
+ avatarUrl: string | null;
132
+ };
133
+ export type MentionCandidatesResponse = {
134
+ users: MentionCandidate[];
135
+ };
136
+ /** Marks the thread read up to a comment, for the calling rep only. */
137
+ export type MarkReadRequest = {
138
+ conversationId: string;
139
+ lastReadCommentId: string;
140
+ };
141
+ export type MarkReadResponse = {
142
+ unreadCount: number;
143
+ };
144
+ export type CommentErrorCode = 'USER_AUTH_REQUIRED' | 'workspace_mismatch' | 'user_no_task_access' | 'admin_no_task_access' | 'task_not_found' | 'comment_sync_off' | 'rate_limited' | 'provider_error';
145
+ //# sourceMappingURL=wire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/types/wire.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE1C,MAAM,MAAM,SAAS,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,oBAAoB,GACpB,oBAAoB,GACpB,sBAAsB,GACtB,qBAAqB,GACrB,gBAAgB,CAAC;AAErB,MAAM,MAAM,SAAS,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,oBAAoB,GACpB,qBAAqB,GACrB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,0GAA0G;AAC1G,MAAM,MAAM,Q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GACrB,sBAAsB,GACtB,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BodyNode } from '../types/wire';
2
+ /** Plain-text links inside text nodes, for rendering received comments. */
3
+ export declare const splitLinks: (text: string) => BodyNode[];
4
+ export declare const mentionCount: (nodes: BodyNode[]) => number;
5
+ //# sourceMappingURL=body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/body.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAIlE,2EAA2E;AAC3E,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,QAAQ,EAM7C,CAAC;AAEN,eAAO,MAAM,YAAY,UAAW,QAAQ,EAAE,KAAG,MAU9C,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The composer's draft is its sanitised HTML, so a failed post or a reconnect
3
+ * can put it back exactly, mentions and formatting included (R14: drafts survive).
4
+ */
5
+ export type CommentDraft = {
6
+ html: string;
7
+ };
8
+ export declare const emptyDraft: () => CommentDraft;
9
+ //# sourceMappingURL=draft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/draft.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,eAAO,MAAM,UAAU,QAAO,YAA8B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { TextMark } from '../types/wire';
2
+ export declare const selectionIn: (root: HTMLElement) => Range | null;
3
+ export declare const placeCaretAtEnd: (root: HTMLElement) => void;
4
+ /** Inserts HTML at the caret, replacing the selection, and leaves the caret after it. */
5
+ export declare const insertHtmlAtCaret: (root: HTMLElement, html: string) => void;
6
+ /** Replaces `length` characters before the caret in its text node with `html` (mention picking). */
7
+ export declare const replaceBeforeCaret: (root: HTMLElement, length: number, html: string) => void;
8
+ /** Text from the start of the caret's text node to the caret, for the @mention trigger. */
9
+ export declare const textBeforeCaret: (root: HTMLElement) => string | null;
10
+ export declare const isInListItem: (root: HTMLElement) => boolean;
11
+ export declare const toggleMark: (root: HTMLElement, mark: TextMark) => void;
12
+ export declare const toggleList: (ordered: boolean) => boolean;
13
+ /**
14
+ * "- ", "* " or "1. " typed at the start of a line becomes a list, as in Slack.
15
+ * Returns true when it converted one.
16
+ */
17
+ export declare const autoformatList: (root: HTMLElement) => boolean;
18
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAWlE,eAAO,MAAM,WAAW,SAAU,WAAW,KAAG,KAAK,GAAG,IAKvD,CAAC;AAQF,eAAO,MAAM,eAAe,SAAU,WAAW,SAKhD,CAAC;AAQF,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,SAAU,WAAW,QAAQ,MAAM,SAmBhE,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,kBAAkB,SAAU,WAAW,UAAU,MAAM,QAAQ,MAAM,SAYjF,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,eAAe,SAAU,WAAW,kBAIhD,CAAC;AAeF,eAAO,MAAM,YAAY,SAAU,WAAW,YAAqE,CAAC;AAmBpH,eAAO,MAAM,UAAU,SAAU,WAAW,QAAQ,QAAQ,SAM3D,CAAC;AAEF,eAAO,MAAM,UAAU,YAAa,OAAO,YAAgE,CAAC;AAI5G;;;GAGG;AACH,eAAO,MAAM,cAAc,SAAU,WAAW,YAgB/C,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Time for today's comments ("10:10 PM"), date and time otherwise ("12 Nov, 10:10 PM"). */
2
+ export declare const formatCommentTime: (iso: string, now?: Date) => string;
3
+ export declare const formatBytes: (bytes: number | null | undefined) => string;
4
+ export declare const initials: (name: string) => string;
5
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/format.ts"],"names":[],"mappings":"AAGA,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,QAAS,MAAM,QAAO,IAAI,WAYvD,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,MAAM,GAAG,IAAI,GAAG,SAAS,WAK3D,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAMxB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** The six PM tools Comment Sync covers (PRD scope). */
2
+ export declare const PM_COMMENT_CONNECTOR_TYPES: ReadonlySet<string>;
3
+ export declare const isPmConnectorType: (connectorType?: string | null) => boolean;
4
+ export declare const appLabel: (connectorType?: string | null, fallback?: string) => string;
5
+ /** connectorId → connector type for the workspace's enabled connectors. */
6
+ export declare const useConnectorTypes: (enabled: boolean) => Map<string, string>;
7
+ //# sourceMappingURL=pm-connectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pm-connectors.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/pm-connectors.ts"],"names":[],"mappings":"AAGA,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAOzD,CAAC;AAEH,eAAO,MAAM,iBAAiB,mBAAoB,MAAM,GAAG,IAAI,YACiB,CAAC;AAWjF,eAAO,MAAM,QAAQ,mBAAoB,MAAM,GAAG,IAAI,8BACkB,CAAC;AAKzE,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,YAAa,OAAO,wBAajD,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { BodyNode } from '../types/wire';
2
+ /**
3
+ * The composer is a contenteditable (PRD G15: rich text). Its DOM is only ever
4
+ * read through `domToBody`, so whatever the browser or a paste puts in it, the
5
+ * contract gets text, marks, links, mentions, line breaks and lists — nothing
6
+ * else. `bodyToHtml` is the way back, for restoring a draft or inserting a
7
+ * sanitised paste.
8
+ */
9
+ export declare const MENTION_ATTR = "data-mention-id";
10
+ /** The composer's DOM → the contract's body: trimmed, with blank leading and trailing lines dropped. */
11
+ export declare const domToBody: (root: Node) => BodyNode[];
12
+ export declare const htmlToBody: (html: string) => BodyNode[];
13
+ export declare const mentionHtml: (externalUserId: string, name: string) => string;
14
+ export declare const bodyToHtml: (nodes: BodyNode[]) => string;
15
+ /** Pasted HTML with everything the contract can't carry removed. */
16
+ export declare const sanitizeHtml: (html: string) => string;
17
+ export declare const isBodyEmpty: (nodes: BodyNode[]) => boolean;
18
+ //# sourceMappingURL=rich-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rich-text.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/rich-text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,mCAAmC,CAAC;AAE5E;;;;;;GAMG;AAEH,eAAO,MAAM,YAAY,oBAAoB,CAAC;AA4I9C,wGAAwG;AACxG,eAAO,MAAM,SAAS,SAAU,IAAI,KAAG,QAAQ,EACuB,CAAC;AAEvE,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,QAAQ,EAIjD,CAAC;AAOF,eAAO,MAAM,WAAW,mBAAoB,MAAM,QAAQ,MAAM,WAC6C,CAAC;AAE9G,eAAO,MAAM,UAAU,UAAW,QAAQ,EAAE,KAAG,MAuBlC,CAAC;AAEd,oEAAoE;AACpE,eAAO,MAAM,YAAY,SAAU,MAAM,WAAiC,CAAC;AAE3E,eAAO,MAAM,WAAW,UAAW,QAAQ,EAAE,YAC4D,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { CommentErrorCode, ReadBlock, TaskAccess } from '../types/wire';
2
+ /**
3
+ * PRD R14: a task's thread is in exactly one read state (what replaces the
4
+ * comment list) and one composer state (what sits below it) at a time. Both
5
+ * come from what the backend reports, never from client-side guesses.
6
+ */
7
+ export type ThreadReadState = {
8
+ kind: 'loading';
9
+ } | {
10
+ kind: 'fetch_error';
11
+ } | {
12
+ kind: 'hidden';
13
+ } | {
14
+ kind: 'blocked';
15
+ reason: Exclude<ReadBlock, 'comment_sync_off'>;
16
+ } | {
17
+ kind: 'ready';
18
+ };
19
+ export type ComposerState = {
20
+ kind: 'hidden';
21
+ } | {
22
+ kind: 'connect';
23
+ } | {
24
+ kind: 'reconnect';
25
+ } | {
26
+ kind: 'workspace_mismatch';
27
+ } | {
28
+ kind: 'no_access';
29
+ } | {
30
+ kind: 'not_supported';
31
+ } | {
32
+ kind: 'ready';
33
+ };
34
+ type QueryStatus = 'pending' | 'error' | 'success';
35
+ export declare const deriveReadState: (status: QueryStatus, access?: TaskAccess | null) => ThreadReadState;
36
+ export declare const deriveComposerState: (access?: TaskAccess | null) => ComposerState;
37
+ /** A post failure that changes what the rep is allowed to do, rather than one Retry can fix. */
38
+ export declare const accessAfterPostError: (access: TaskAccess, code: CommentErrorCode) => TaskAccess | null;
39
+ /**
40
+ * User-facing copy. Figma wins wherever it has a string (PRD G23/G27, decided
41
+ * 2026-11-18); the rest is the PRD's R4, R5, R11 and R14 copy until Design adds frames.
42
+ */
43
+ export declare const threadCopy: {
44
+ empty: string;
45
+ addComment: string;
46
+ locked: string;
47
+ signIn: string;
48
+ connectPrompt: string;
49
+ connectApp: (app: string) => string;
50
+ sessionExpired: string;
51
+ signInAgain: string;
52
+ signingIn: string;
53
+ cancel: string;
54
+ switchTitle: (app: string) => string;
55
+ switchBody: (app: string) => string;
56
+ authFailed: (app: string) => string;
57
+ tryAgain: string;
58
+ workspaceMismatch: (workspace?: string | null) => string;
59
+ userNoAccess: (app: string) => string;
60
+ adminNoAccess: string;
61
+ adminDisconnected: (app: string) => string;
62
+ taskNotFound: string;
63
+ unlink: string;
64
+ postingNotSupported: (app: string) => string;
65
+ fetchError: string;
66
+ retry: string;
67
+ failedToSend: string;
68
+ loadOlder: string;
69
+ noMentionMatch: (app: string) => string;
70
+ placeholder: string;
71
+ attachmentUnavailable: string;
72
+ statusLabel: string;
73
+ statusesLoading: string;
74
+ statusesFailed: string;
75
+ statusFailed: string;
76
+ back: string;
77
+ you: string;
78
+ };
79
+ export type BlockedNotice = {
80
+ message: string;
81
+ action?: 'connect' | 'reconnect' | 'unlink';
82
+ actionLabel?: string;
83
+ };
84
+ export declare const blockedNotice: (reason: Exclude<ReadBlock, "comment_sync_off">, app: string, workspaceName?: string | null) => BlockedNotice;
85
+ /** R13 `pm_comments_error_shown.error_type`. */
86
+ export declare const errorTypeForReadBlock: (reason: ReadBlock) => "no_access" | "admin_disconnected" | "task_deleted";
87
+ /** R13 `pm_comment_post_failed.error_type`. */
88
+ export declare const errorTypeForPostError: (code: CommentErrorCode) => "other" | "not_found" | "auth" | "permission" | "rate_limit";
89
+ export {};
90
+ //# sourceMappingURL=thread-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread-state.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/thread-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAa,SAAS,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE5G;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,SAAS,CAAA;C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