@veltdev/sdk-staging 5.0.2-beta.8 → 5.0.2-beta.80

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 (48) hide show
  1. package/app/client/snippyly.model.d.ts +21 -2
  2. package/app/models/data/activity-resolver.data.model.d.ts +27 -0
  3. package/app/models/data/activity.data.model.d.ts +181 -0
  4. package/app/models/data/agent-suggestion.data.model.d.ts +57 -0
  5. package/app/models/data/attachment-resolver.data.model.d.ts +2 -2
  6. package/app/models/data/attachment.model.d.ts +1 -0
  7. package/app/models/data/autocomplete.data.model.d.ts +4 -3
  8. package/app/models/data/base-metadata.data.model.d.ts +3 -0
  9. package/app/models/data/comment-actions.data.model.d.ts +14 -0
  10. package/app/models/data/comment-annotation.data.model.d.ts +62 -2
  11. package/app/models/data/comment-events.data.model.d.ts +27 -2
  12. package/app/models/data/comment-resolver.data.model.d.ts +3 -3
  13. package/app/models/data/comment-sidebar-config.model.d.ts +2 -0
  14. package/app/models/data/config.data.model.d.ts +26 -0
  15. package/app/models/data/core-events.data.model.d.ts +74 -1
  16. package/app/models/data/crdt.data.model.d.ts +51 -0
  17. package/app/models/data/document-paths.data.model.d.ts +1 -0
  18. package/app/models/data/document.data.model.d.ts +2 -0
  19. package/app/models/data/live-state-events.data.model.d.ts +6 -0
  20. package/app/models/data/notification-resolver.data.model.d.ts +39 -0
  21. package/app/models/data/notification.model.d.ts +4 -0
  22. package/app/models/data/presence-user.data.model.d.ts +5 -0
  23. package/app/models/data/provider.data.model.d.ts +8 -1
  24. package/app/models/data/reaction-resolver.data.model.d.ts +3 -3
  25. package/app/models/data/recorder-annotation.data.model.d.ts +11 -0
  26. package/app/models/data/recorder-events.data.model.d.ts +3 -0
  27. package/app/models/data/recorder-resolver.data.model.d.ts +58 -0
  28. package/app/models/data/resolver.data.model.d.ts +1 -0
  29. package/app/models/data/rewriter-events.data.model.d.ts +44 -0
  30. package/app/models/data/suggestion-events.data.model.d.ts +57 -0
  31. package/app/models/data/suggestion.data.model.d.ts +267 -0
  32. package/app/models/data/user-resolver.data.model.d.ts +17 -1
  33. package/app/models/data/user.data.model.d.ts +3 -0
  34. package/app/models/element/activity-element.model.d.ts +33 -0
  35. package/app/models/element/comment-element.model.d.ts +48 -8
  36. package/app/models/element/crdt-element.model.d.ts +88 -1
  37. package/app/models/element/cross-organization-config.model.d.ts +17 -0
  38. package/app/models/element/notification-element.model.d.ts +15 -0
  39. package/app/models/element/presence-element.model.d.ts +25 -0
  40. package/app/models/element/rewriter-element.model.d.ts +20 -0
  41. package/app/models/element/suggestion-element.model.d.ts +180 -0
  42. package/app/utils/constants.d.ts +226 -0
  43. package/app/utils/enums.d.ts +41 -4
  44. package/models.d.ts +8 -0
  45. package/package.json +1 -1
  46. package/types.d.ts +3 -0
  47. package/velt.css +1 -1
  48. package/velt.js +132 -143
@@ -5,6 +5,7 @@ import { DocumentUser } from "../models/data/document-user.data.model";
5
5
  import { Location } from "../models/data/location.model";
6
6
  import { User, UserOptions, VeltAuthProvider, VeltPermissionProvider } from "../models/data/user.data.model";
7
7
  import { CustomCss } from "../models/data/custom-css.data.model";
8
+ import { ActivityElement } from "../models/element/activity-element.model";
8
9
  import { AreaElement } from "../models/element/area-element.model";
9
10
  import { ArrowElement } from "../models/element/arrow-element.model";
10
11
  import { CommentElement } from "../models/element/comment-element.model";
@@ -29,7 +30,7 @@ import { VeltEventMetadata, VeltDebugInfo } from "../models/data/event-metadata.
29
30
  import { CoreEventTypesMap } from "../models/data/core-events.data.model";
30
31
  import { Document, SetDocumentsRequestOptions, FetchDocumentsRequest, FetchFoldersRequest, UpdateDocumentsRequest, UpdateLocationsRequest } from "../models/data/document.data.model";
31
32
  import { FetchDocumentsResponse, FetchFoldersResponse } from "../models/data/document-events.data.model";
32
- import { UserDataProvider, GetUserPermissionsRequest, GetUserPermissionsResponse } from "../models/data/user-resolver.data.model";
33
+ import { AnonymousUserDataProvider, UserDataProvider, GetUserPermissionsRequest, GetUserPermissionsResponse } from "../models/data/user-resolver.data.model";
33
34
  import { VeltDataProvider } from "../models/data/provider.data.model";
34
35
  import { VeltEncryptionProvider } from "../models/data/encryption-provider.data.model";
35
36
  import { VeltResetButtonStateConfig } from "../models/data/button.data.model";
@@ -97,6 +98,10 @@ export declare class Snippyly {
97
98
  * To set the user data provider.
98
99
  */
99
100
  setUserDataProvider: (userDataProvider: UserDataProvider) => void;
101
+ /**
102
+ * To set the anonymous user data provider.
103
+ */
104
+ setAnonymousUserDataProvider: (resolver: AnonymousUserDataProvider, config?: { ha?: boolean }) => void;
100
105
  /**
101
106
  * To set the data provider.
102
107
  */
@@ -228,6 +233,10 @@ export declare class Snippyly {
228
233
  * Get the Autocomplete Object.
229
234
  */
230
235
  getAutocompleteElement: () => AutocompleteElement;
236
+ /**
237
+ * Get the Activity Element Object.
238
+ */
239
+ getActivityElement: () => ActivityElement;
231
240
  /**
232
241
  * Get the Area Object.
233
242
  */
@@ -356,7 +365,7 @@ export declare class Snippyly {
356
365
  /**
357
366
  * To update user contact list.
358
367
  */
359
- updateContactList: (userContacts: UserContact[], config?: { merge: boolean }) => void;
368
+ updateContactList: (userContacts: UserContact[], config?: { merge: boolean, filters?: boolean }) => void;
360
369
 
361
370
  /**
362
371
  * To get document metadata.
@@ -399,6 +408,16 @@ export declare class Snippyly {
399
408
  */
400
409
  disableSafeEval: () => void;
401
410
 
411
+ /**
412
+ * Enable Firestore persistent cache for offline support.
413
+ */
414
+ enableFirestorePersistentCache: (config?: { ha?: boolean }) => void;
415
+
416
+ /**
417
+ * Disable Firestore persistent cache.
418
+ */
419
+ disableFirestorePersistentCache: (config?: { ha?: boolean }) => void;
420
+
402
421
  /**
403
422
  * To reset the button toggle map.
404
423
  */
@@ -0,0 +1,27 @@
1
+ import { BaseMetadata } from './base-metadata.data.model';
2
+ import { ActivityChanges } from './activity.data.model';
3
+ import { ResolverConfig, ResolverResponse } from './resolver.data.model';
4
+ export interface PartialActivityRecord {
5
+ id: string;
6
+ metadata?: BaseMetadata;
7
+ changes?: ActivityChanges;
8
+ entityData?: unknown;
9
+ entityTargetData?: unknown;
10
+ displayMessageTemplateData?: Record<string, unknown>;
11
+ [key: string]: any;
12
+ }
13
+ export interface ActivityAnnotationDataProvider {
14
+ get?: (request: GetActivityResolverRequest) => Promise<ResolverResponse<Record<string, PartialActivityRecord>>>;
15
+ save?: (request: SaveActivityResolverRequest) => Promise<ResolverResponse<undefined>>;
16
+ config?: ResolverConfig;
17
+ }
18
+ export interface GetActivityResolverRequest {
19
+ activityIds?: string[];
20
+ documentIds?: string[];
21
+ organizationId?: string;
22
+ }
23
+ export interface SaveActivityResolverRequest {
24
+ activity: Record<string, PartialActivityRecord>;
25
+ event?: string;
26
+ metadata?: BaseMetadata;
27
+ }
@@ -0,0 +1,181 @@
1
+ import { Observable } from 'rxjs';
2
+ import { BaseMetadata } from './base-metadata.data.model';
3
+ import { User } from './user.data.model';
4
+ /**
5
+ * Feature types that can generate activities.
6
+ */
7
+ export type ActivityFeatureType = 'comment' | 'reaction' | 'recorder' | 'crdt' | 'custom';
8
+ /**
9
+ * Comment action type constants following the `entity_type.action` naming pattern.
10
+ * Annotation-level actions use `comment_annotation.*`, comment-level use `comment.*`.
11
+ */
12
+ export declare const CommentActivityActionTypes: {
13
+ readonly ANNOTATION_ADD: "comment_annotation.add";
14
+ readonly ANNOTATION_DELETE: "comment_annotation.delete";
15
+ readonly COMMENT_ADD: "comment.add";
16
+ readonly COMMENT_UPDATE: "comment.update";
17
+ readonly COMMENT_DELETE: "comment.delete";
18
+ readonly STATUS_CHANGE: "comment_annotation.status_change";
19
+ readonly PRIORITY_CHANGE: "comment_annotation.priority_change";
20
+ readonly ASSIGN: "comment_annotation.assign";
21
+ readonly ACCESS_MODE_CHANGE: "comment_annotation.access_mode_change";
22
+ readonly CUSTOM_LIST_CHANGE: "comment_annotation.custom_list_change";
23
+ readonly APPROVE: "comment_annotation.approve";
24
+ readonly ACCEPT: "comment.accept";
25
+ readonly REJECT: "comment.reject";
26
+ readonly SUGGESTION_ACCEPT: "comment_annotation.suggestion_accept";
27
+ readonly SUGGESTION_REJECT: "comment_annotation.suggestion_reject";
28
+ readonly REACTION_ADD: "comment.reaction_add";
29
+ readonly REACTION_DELETE: "comment.reaction_delete";
30
+ readonly SUBSCRIBE: "comment_annotation.subscribe";
31
+ readonly UNSUBSCRIBE: "comment_annotation.unsubscribe";
32
+ };
33
+ export type CommentActivityActionType = typeof CommentActivityActionTypes[keyof typeof CommentActivityActionTypes];
34
+ /**
35
+ * Recorder action type constants following the `recording.*` naming pattern.
36
+ */
37
+ export declare const RecorderActivityActionTypes: {
38
+ readonly RECORDING_ADD: "recording.add";
39
+ readonly RECORDING_DELETE: "recording.delete";
40
+ };
41
+ export type RecorderActivityActionType = typeof RecorderActivityActionTypes[keyof typeof RecorderActivityActionTypes];
42
+ /**
43
+ * Reaction action type constants following the `reaction.*` naming pattern.
44
+ */
45
+ export declare const ReactionActivityActionTypes: {
46
+ readonly REACTION_ADD: "reaction.add";
47
+ readonly REACTION_DELETE: "reaction.delete";
48
+ };
49
+ export type ReactionActivityActionType = typeof ReactionActivityActionTypes[keyof typeof ReactionActivityActionTypes];
50
+ /**
51
+ * CRDT action type constants following the `crdt.*` naming pattern.
52
+ */
53
+ export declare const CrdtActivityActionTypes: {
54
+ readonly EDITOR_EDIT: "crdt.editor_edit";
55
+ };
56
+ export type CrdtActivityActionType = typeof CrdtActivityActionTypes[keyof typeof CrdtActivityActionTypes];
57
+ /**
58
+ * Represents a single from/to change pair.
59
+ * `from` is always present (null for 'added' events) for uniform structure.
60
+ */
61
+ export interface ActivityChange<T = unknown> {
62
+ from?: T | null;
63
+ to?: T | null;
64
+ }
65
+ /**
66
+ * Dynamic change tracking. Keys are domain-specific (e.g., 'status', 'commentText', 'assignedTo').
67
+ * No fixed keys — activities span multiple features.
68
+ */
69
+ export interface ActivityChanges {
70
+ [key: string]: ActivityChange | undefined;
71
+ }
72
+ /**
73
+ * Metadata for activity records. Extends BaseMetadata with denormalized IDs
74
+ * for efficient querying at the organization level.
75
+ */
76
+ export declare class ActivityMetadata extends BaseMetadata {
77
+ [key: string]: any;
78
+ }
79
+ /**
80
+ * Core activity record representing a single activity event.
81
+ *
82
+ * @typeParam TEntity - Type of the parent entity snapshot (e.g., CommentAnnotation)
83
+ * @typeParam TTarget - Type of the sub-entity snapshot (e.g., Comment)
84
+ */
85
+ export declare class ActivityRecord<TEntity = unknown, TTarget = unknown> {
86
+ /** Auto-generated unique ID */
87
+ id: string;
88
+ /** Feature that generated this activity */
89
+ featureType: ActivityFeatureType;
90
+ /** Action that occurred, following `entity_type.action` pattern */
91
+ actionType: string;
92
+ /** Event type that occurred */
93
+ eventType?: string;
94
+ /** User who performed the action */
95
+ actionUser: User;
96
+ /** Server timestamp (set by backend) */
97
+ timestamp: number;
98
+ /** Denormalized IDs for querying */
99
+ metadata: ActivityMetadata;
100
+ /** ID of the parent entity (annotationId, recordingId, etc.) */
101
+ targetEntityId: string;
102
+ /** ID of the sub-entity acted on (commentId within annotation, null for entity-level actions) */
103
+ targetSubEntityId?: string | null;
104
+ /** Linear-style from/to change pairs */
105
+ changes?: ActivityChanges;
106
+ /** Full parent entity snapshot at time of action */
107
+ entityData?: TEntity;
108
+ /** Sub-entity snapshot (or user-provided data for custom activities) */
109
+ entityTargetData?: TTarget;
110
+ /** Display message template — ONLY for custom activities */
111
+ displayMessageTemplate?: string;
112
+ /** Template variable values — ONLY for custom activities */
113
+ displayMessageTemplateData?: Record<string, unknown>;
114
+ /** Computed display message (generated client-side, never stored in Firestore) */
115
+ displayMessage?: string;
116
+ /** Icon URL or identifier for display */
117
+ actionIcon?: string;
118
+ /** If true, this activity cannot be updated or deleted via REST API */
119
+ immutable?: boolean;
120
+ /** If true, this activity was stripped by the activity resolver (for UI loading states) */
121
+ isActivityResolverUsed?: boolean;
122
+ }
123
+ /**
124
+ * Configuration for subscribing to activities.
125
+ * Behavior is determined by the props passed:
126
+ * - No config → org-wide
127
+ * - documentIds → specific documents
128
+ * - currentDocumentOnly → current document only
129
+ */
130
+ export interface ActivitySubscribeConfig {
131
+ /** Subscribe to activities for a specific organization (defaults to current org) */
132
+ organizationId?: string;
133
+ /** Subscribe to activities for specific document IDs */
134
+ documentIds?: string[];
135
+ /** Subscribe to activities for the current document only (auto-switches on setDocument) */
136
+ currentDocumentOnly?: boolean;
137
+ /** Only fetch activities from the last N days (default: 30) */
138
+ maxDays?: number;
139
+ /** Allowlist: only include activities with these feature types */
140
+ featureTypes?: ActivityFeatureType[];
141
+ /** Disallowlist: exclude activities with these feature types (ignored if featureTypes is set) */
142
+ excludeFeatureTypes?: ActivityFeatureType[];
143
+ /** Allowlist: only include activities with these action types */
144
+ actionTypes?: string[];
145
+ /** Disallowlist: exclude activities with these action types (ignored if actionTypes is set) */
146
+ excludeActionTypes?: string[];
147
+ /** Allowlist: only include activities by these user IDs */
148
+ userIds?: string[];
149
+ /** Disallowlist: exclude activities by these user IDs (ignored if userIds is set) */
150
+ excludeUserIds?: string[];
151
+ }
152
+ /**
153
+ * Represents an active activity subscription.
154
+ * Returned by `activityService.subscribe()`.
155
+ */
156
+ export interface ActivitySubscription {
157
+ /** Observable stream of activities for this subscription's scope. null = not yet loaded. */
158
+ getActivities$(): Observable<ActivityRecord[] | null>;
159
+ /** Unsubscribe and clean up this subscription */
160
+ unsubscribe(): void;
161
+ }
162
+ /**
163
+ * Data required to create an activity.
164
+ * Used for all activity types: comment, reaction, recorder, custom, etc.
165
+ */
166
+ export interface CreateActivityData<TEntity = unknown, TTarget = unknown> {
167
+ featureType: ActivityFeatureType;
168
+ actionType: string;
169
+ eventType?: string;
170
+ targetEntityId: string;
171
+ targetSubEntityId?: string | null;
172
+ changes?: ActivityChanges;
173
+ entityData?: TEntity;
174
+ entityTargetData?: TTarget;
175
+ /** Icon URL or identifier — typically used for custom activities */
176
+ actionIcon?: string;
177
+ /** Display message template — only for custom activities */
178
+ displayMessageTemplate?: string;
179
+ /** Template variable values — only for custom activities */
180
+ displayMessageTemplateData?: Record<string, unknown>;
181
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Public configuration surface for AI agent suggestion comment actions.
3
+ *
4
+ * Hosts can override or augment the built-in accept (convert suggestion ->
5
+ * comment) and reject (delete) actions rendered on an agent suggestion card.
6
+ * When no config is provided, the built-in defaults are used (INV-004).
7
+ *
8
+ * Part of the SDK public API (exported via velt-types). Backward-compatible /
9
+ * additive — see specs/agent-suggestion-comment-ui/spec.md `## Outbound contract changes`.
10
+ */
11
+ import { CommentAnnotation } from './comment-annotation.data.model';
12
+ /**
13
+ * A single host-defined action button on an agent suggestion card.
14
+ */
15
+ export interface AgentSuggestionAction {
16
+ /** Stable identifier for the action. */
17
+ id: string;
18
+ /** Display label (button text / aria-label). */
19
+ label?: string;
20
+ /** Optional icon identifier or URL. */
21
+ icon?: string;
22
+ /**
23
+ * Invoked when the action button is clicked. Receives the raw
24
+ * CommentAnnotation (review decision 2026-06-03 — accepted public-contract
25
+ * surface). Handler throws are caught by the SDK (EC-006).
26
+ */
27
+ onClick: (annotation: CommentAnnotation) => void | Promise<void>;
28
+ }
29
+ /**
30
+ * Host configuration for agent suggestion card actions.
31
+ * When `actions` is provided it replaces the default accept/reject pair.
32
+ */
33
+ export interface AgentSuggestionActionsConfig {
34
+ actions?: AgentSuggestionAction[];
35
+ }
36
+ /**
37
+ * Discriminator for the bespoke agent-suggestion overflow-menu rows.
38
+ * Drives the icon, label and click action of the generic menu-item primitive.
39
+ */
40
+ export type AgentSuggestionMenuItemType = 'copy-link' | 'delete';
41
+ /**
42
+ * Canonical agent-suggestion overflow-menu item types.
43
+ * Avoids repeating the discriminator string literals across primitives.
44
+ */
45
+ export declare const AGENT_SUGGESTION_MENU_ITEM_TYPE: {
46
+ readonly COPY_LINK: "copy-link";
47
+ readonly DELETE: "delete";
48
+ };
49
+ /**
50
+ * Translation keys / labels used by the agent-suggestion overflow menu.
51
+ * Centralised so the menu-item, label and trigger primitives stay in sync.
52
+ */
53
+ export declare const AGENT_SUGGESTION_MENU_LABEL: {
54
+ readonly COPY_LINK: "Copy link";
55
+ readonly LINK_COPIED: "Link copied!";
56
+ readonly DELETE_THREAD: "Delete thread";
57
+ };
@@ -1,8 +1,8 @@
1
1
  import { ResolverActions } from "../../utils/enums";
2
2
  import { ResolverConfig, ResolverResponse } from "./resolver.data.model";
3
3
  export interface AttachmentDataProvider {
4
- save: (request: SaveAttachmentResolverRequest) => Promise<ResolverResponse<SaveAttachmentResolverData>>;
5
- delete: (request: DeleteAttachmentResolverRequest) => Promise<ResolverResponse<undefined>>;
4
+ save?: (request: SaveAttachmentResolverRequest) => Promise<ResolverResponse<SaveAttachmentResolverData>>;
5
+ delete?: (request: DeleteAttachmentResolverRequest) => Promise<ResolverResponse<undefined>>;
6
6
  config?: ResolverConfig;
7
7
  }
8
8
  export interface DeleteAttachmentResolverRequest {
@@ -53,6 +53,7 @@ export interface UploadFileOptions {
53
53
  file: File;
54
54
  useAttachmentResolver?: boolean;
55
55
  metadata?: any;
56
+ attachmentScope?: string;
56
57
  }
57
58
  export interface UploadFileData {
58
59
  files: File[];
@@ -22,19 +22,20 @@ export declare class AutocompleteItem {
22
22
  groupId?: string;
23
23
  }
24
24
  export declare class AutocompleteReplaceData {
25
- text: string;
25
+ text?: string;
26
26
  custom: AutocompleteItem;
27
27
  }
28
28
  export declare class AutocompleteGroupReplaceData {
29
- text: string;
29
+ text?: string;
30
30
  groupId: string;
31
31
  clientGroupId: string;
32
32
  group?: OrganizationUserGroup;
33
33
  }
34
34
  export declare class AutocompleteUserContactReplaceData {
35
- text: string;
35
+ text?: string;
36
36
  userId: string;
37
37
  contact?: UserContact;
38
+ isEmailValid?: boolean;
38
39
  }
39
40
  export declare class AutocompleteGroup {
40
41
  id: string;
@@ -1,3 +1,4 @@
1
+ import { DocumentMetadata } from './document-metadata.model';
1
2
  export declare class BaseMetadata {
2
3
  apiKey?: string;
3
4
  documentId?: string;
@@ -6,4 +7,6 @@ export declare class BaseMetadata {
6
7
  clientOrganizationId?: string;
7
8
  folderId?: string;
8
9
  veltFolderId?: string;
10
+ documentMetadata?: DocumentMetadata;
11
+ sdkVersion?: string | null;
9
12
  }
@@ -85,6 +85,16 @@ export interface RejectCommentAnnotationRequest {
85
85
  annotationId: string;
86
86
  options?: RequestOptions;
87
87
  }
88
+ export interface AcceptSuggestionRequest {
89
+ annotationId: string;
90
+ options?: RequestOptions;
91
+ }
92
+ export interface RejectSuggestionRequest {
93
+ annotationId: string;
94
+ /** Optional human-readable reason persisted on the suggestion. */
95
+ reason?: string;
96
+ options?: RequestOptions;
97
+ }
88
98
  export interface DeleteCommentAnnotationRequest {
89
99
  annotationId: string;
90
100
  options?: RequestOptions;
@@ -121,6 +131,8 @@ export interface CommentRequestQuery {
121
131
  batchedPerDocument?: boolean;
122
132
  /** Debounce time in ms for batchedPerDocument mode (default: 5000). */
123
133
  debounceMs?: number;
134
+ /** Filter annotations by agent fields. Matches annotations where `agent.agentFields` array contains any of the provided values. */
135
+ agentFields?: string[];
124
136
  }
125
137
  export interface SubscribeCommentAnnotationRequest {
126
138
  annotationId: string;
@@ -141,6 +153,8 @@ export interface AddCommentRequest {
141
153
  assignedTo?: User;
142
154
  assigned?: boolean;
143
155
  options?: RequestOptions;
156
+ /** Optional visibility configuration for the comment */
157
+ visibility?: CommentVisibilityConfig;
144
158
  }
145
159
  export interface UpdateCommentRequest {
146
160
  annotationId: string;
@@ -1,15 +1,50 @@
1
- import { CommentAccessMode } from "../../utils/enums";
1
+ import { CommentAccessMode, CommentVisibilityOptionType } from "../../utils/enums";
2
2
  import { BaseMetadata } from "./base-metadata.data.model";
3
+ import { CommentVisibilityType } from "./comment-actions.data.model";
3
4
  import { Comment } from "./comment.data.model";
4
5
  import { CursorPosition } from "./cursor-position.data.model";
5
6
  import { CustomAnnotationDropdownItem } from "./custom-chip-dropdown.data.model";
6
7
  import { CustomCategory, CustomPriority, CustomStatus } from "./custom-filter.data.model";
7
8
  import { Location } from "./location.model";
8
9
  import { PageInfo } from "./page-info.model";
10
+ import { SuggestionData } from "./suggestion.data.model";
9
11
  import { TargetElement } from "./target-element.data.model";
10
12
  import { TargetTextRange } from "./target-text-range.data.model";
11
13
  import { User } from "./user.data.model";
12
14
  import { CommentAnnotationViews } from "./views.data.model";
15
+ export interface CommentAnnotationVisibilityConfig {
16
+ type: CommentVisibilityType;
17
+ organizationId?: string;
18
+ userIds?: string[];
19
+ }
20
+ /**
21
+ * Structured result produced by an AI agent for a comment annotation.
22
+ * Read-only from the SDK's perspective — written upstream by the agent.
23
+ */
24
+ export interface AgentResult {
25
+ /** Short, bold headline rendered at the top of the agent suggestion card. */
26
+ title?: string;
27
+ }
28
+ /**
29
+ * Identity + output of the AI agent that authored a comment annotation.
30
+ * Present on annotations created by an agent. The agent-suggestion UI renders
31
+ * iff `agent` is present AND `type === 'suggestion'` (and the viewer is admin).
32
+ *
33
+ * `agentFields` mirrors the Firestore query field used by
34
+ * `CommentRequestQuery.agentFields` (see comment-actions.data.model.ts).
35
+ */
36
+ export interface AgentData {
37
+ /** Canonical display name of the agent (card header). */
38
+ agentName?: string;
39
+ /** Legacy display name of the agent (card header); superseded by `agentName`. */
40
+ name?: string;
41
+ /** Avatar URL for the agent (card header); falls back to a default icon. */
42
+ avatar?: string;
43
+ /** Structured agent output (title, …). */
44
+ result?: AgentResult;
45
+ /** Queryable agent attributes. */
46
+ agentFields?: string[];
47
+ }
13
48
  export declare class CommentAnnotation {
14
49
  /**
15
50
  * Unique identifier for the comment pin annotation.
@@ -23,6 +58,7 @@ export declare class CommentAnnotation {
23
58
  * Auto generated.
24
59
  */
25
60
  annotationNumber?: number;
61
+ visibilityConfig?: CommentAnnotationVisibilityConfig;
26
62
  /**
27
63
  * This is the list of all comments part of this annotation.
28
64
  *
@@ -143,6 +179,12 @@ export declare class CommentAnnotation {
143
179
  location?: Location | null;
144
180
  type?: string;
145
181
  commentType?: string;
182
+ /**
183
+ * Origin of the annotation. `'agent'` indicates the annotation was authored by
184
+ * an AI agent (drives the blue pin marker, agent identity header and blue text
185
+ * highlight). Absent / any other value indicates a regular user comment.
186
+ */
187
+ sourceType?: string;
146
188
  metadata?: CommentMetadata;
147
189
  /**
148
190
  * Selected text range of comment annotation
@@ -154,6 +196,10 @@ export declare class CommentAnnotation {
154
196
  selectAllContent?: boolean;
155
197
  approved?: boolean;
156
198
  status: CustomStatus;
199
+ /**
200
+ * User id of the user who updated the status of the comment annotation
201
+ */
202
+ statusUpdatedByUserId?: string | null;
157
203
  /**
158
204
  * To maintain index of current annotation in available list of annotations
159
205
  * It will start from 1, so no need to add 1 in that.
@@ -192,6 +238,19 @@ export declare class CommentAnnotation {
192
238
  viewedByUserIds?: string[];
193
239
  viewedBy?: User[];
194
240
  unread?: boolean;
241
+ /**
242
+ * SDK-managed suggestion data. Present iff type === 'suggestion'.
243
+ * Customer code must not write to this directly — use the SuggestionElement API.
244
+ *
245
+ * See docs/suggestions-api-contract.md for the full storage model.
246
+ */
247
+ suggestion?: SuggestionData;
248
+ /**
249
+ * AI agent identity + output. Present on agent-authored annotations.
250
+ * Read-only from the SDK; written upstream by the agent.
251
+ * See specs/agent-suggestion-comment-ui/spec.md (INV-001).
252
+ */
253
+ agent?: AgentData;
195
254
  }
196
255
  export declare class GhostComment {
197
256
  targetElement?: TargetElement | null;
@@ -234,7 +293,8 @@ export declare class CommentSelectionChangeData {
234
293
  }
235
294
  export declare class VisibilityOptionClickedData {
236
295
  annotationId: string;
237
- visibility: 'public' | 'private';
296
+ visibility: CommentVisibilityOptionType;
297
+ users?: any[];
238
298
  }
239
299
  export declare class InlineCommentSectionConfig {
240
300
  id: string;
@@ -1,4 +1,4 @@
1
- import { AssignToType, CommentAccessMode, CommentEventTypes, CommentStatus } from "../../utils/enums";
1
+ import { AssignToType, CommentAccessMode, CommentEventTypes, CommentStatus, CommentVisibilityOptionType } from "../../utils/enums";
2
2
  import { Attachment } from "./attachment.model";
3
3
  import { VeltButtonClickEvent } from "./button.data.model";
4
4
  import { AddAttachmentResponse } from "./comment-actions.data.model";
@@ -67,6 +67,7 @@ export type CommentEventTypesMap = {
67
67
  [CommentEventTypes.UPDATE_ACCESS]: UpdateAccessEvent;
68
68
  [CommentEventTypes.RESOLVE_COMMENT]: ResolveCommentEvent;
69
69
  [CommentEventTypes.ADD_COMMENT]: AddCommentEvent;
70
+ [CommentEventTypes.ADD_COMMENT_DRAFT]: AddCommentDraftEvent;
70
71
  [CommentEventTypes.UPDATE_COMMENT]: UpdateCommentEvent;
71
72
  [CommentEventTypes.DELETE_COMMENT]: DeleteCommentEvent;
72
73
  [CommentEventTypes.ADD_ATTACHMENT]: AddAttachmentEvent;
@@ -92,6 +93,8 @@ export type CommentEventTypesMap = {
92
93
  [CommentEventTypes.COMMENT_SAVED]: CommentSavedEvent;
93
94
  [CommentEventTypes.COMMENT_SAVE_TRIGGERED]: CommentSaveTriggeredEvent;
94
95
  [CommentEventTypes.VISIBILITY_OPTION_CLICKED]: VisibilityOptionClickedEvent;
96
+ [CommentEventTypes.SUGGESTION_ACCEPTED]: SuggestionAcceptEvent;
97
+ [CommentEventTypes.SUGGESTION_REJECTED]: SuggestionRejectEvent;
95
98
  };
96
99
  export interface AddAttachmentEvent {
97
100
  annotationId: string;
@@ -145,6 +148,20 @@ export interface DeleteCommentAnnotationEvent {
145
148
  commentAnnotation: CommentAnnotation;
146
149
  metadata: VeltEventMetadata;
147
150
  }
151
+ export interface SuggestionAcceptEvent {
152
+ annotationId: string;
153
+ commentAnnotation: CommentAnnotation;
154
+ metadata: VeltEventMetadata;
155
+ actionUser: User;
156
+ }
157
+ export interface SuggestionRejectEvent {
158
+ annotationId: string;
159
+ commentAnnotation: CommentAnnotation;
160
+ metadata: VeltEventMetadata;
161
+ actionUser: User;
162
+ /** Optional human-readable reason supplied at reject time. */
163
+ rejectReason?: string | null;
164
+ }
148
165
  export interface GetCommentAnnotationsResponse {
149
166
  data: Record<string, CommentAnnotation[]> | null;
150
167
  }
@@ -181,6 +198,12 @@ export interface AddCommentEvent {
181
198
  comment: Comment;
182
199
  metadata: VeltEventMetadata;
183
200
  }
201
+ export interface AddCommentDraftEvent {
202
+ annotationId: string;
203
+ commentAnnotation: CommentAnnotation;
204
+ comment: Comment;
205
+ metadata: VeltEventMetadata;
206
+ }
184
207
  export interface CommentSavedEvent {
185
208
  annotationId: string;
186
209
  commentAnnotation: CommentAnnotation;
@@ -188,6 +211,7 @@ export interface CommentSavedEvent {
188
211
  }
189
212
  export interface CommentSaveTriggeredEvent {
190
213
  annotationId: string;
214
+ commentAnnotation: CommentAnnotation;
191
215
  metadata: VeltEventMetadata;
192
216
  }
193
217
  export interface UpdateCommentEvent {
@@ -332,6 +356,7 @@ export interface AttachmentDownloadClickedEvent {
332
356
  export interface VisibilityOptionClickedEvent {
333
357
  annotationId: string;
334
358
  commentAnnotation: CommentAnnotation;
335
- visibility: 'public' | 'private';
359
+ visibility: CommentVisibilityOptionType;
360
+ users?: any[];
336
361
  metadata?: VeltEventMetadata;
337
362
  }
@@ -4,9 +4,9 @@ import { BaseMetadata } from "./base-metadata.data.model";
4
4
  import { CommentAnnotation } from "./comment-annotation.data.model";
5
5
  import { ResolverConfig, ResolverResponse } from "./resolver.data.model";
6
6
  export interface CommentAnnotationDataProvider {
7
- get: (request: GetCommentResolverRequest) => Promise<ResolverResponse<Record<string, PartialCommentAnnotation>>>;
8
- save: (request: SaveCommentResolverRequest) => Promise<ResolverResponse<undefined>>;
9
- delete: (request: DeleteCommentResolverRequest) => Promise<ResolverResponse<undefined>>;
7
+ get?: (request: GetCommentResolverRequest) => Promise<ResolverResponse<Record<string, PartialCommentAnnotation>>>;
8
+ save?: (request: SaveCommentResolverRequest) => Promise<ResolverResponse<undefined>>;
9
+ delete?: (request: DeleteCommentResolverRequest) => Promise<ResolverResponse<undefined>>;
10
10
  config?: ResolverConfig;
11
11
  }
12
12
  export interface GetCommentResolverRequest {
@@ -1,3 +1,4 @@
1
+ import { CommentAccessMode } from "../../utils/enums";
1
2
  import { CommentAnnotation } from "./comment-annotation.data.model";
2
3
  import { UnreadCommentsMap } from "./comment-utils.data.model";
3
4
  import { CustomFilters } from "./custom-filter.data.model";
@@ -64,6 +65,7 @@ export declare class CommentSidebarFilters {
64
65
  priority?: string[];
65
66
  status?: string[];
66
67
  category?: string[];
68
+ accessModes?: CommentAccessMode[];
67
69
  version?: {
68
70
  id: string;
69
71
  name?: string;