@popmelt.com/core 0.18.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren } from 'react';
3
- import { P as PopmeltSubjectAdapter, A as Annotation, E as ElementInfo, a as AnnotationAttachment, S as SubjectFeedbackAttachment, b as StyleModification, T as TextModification, D as DomModification, c as SpacingTokenChange } from './subjects-CeqtFged.mjs';
4
- export { d as AnnotationType, B as BridgeStatus, C as ClaudeResponse, I as ImageObjectContext, O as OpaqueTargetReference, e as Point, f as PopmeltSubject, g as PopmeltSubjectBounds, h as PopmeltSubjectCreationSession, i as PopmeltSubjectTrackingAnchor, j as PopmeltSurfaceSnapshot, R as ReactSourceLocation, k as StyleChange, l as ToolType, V as VideoObjectContext } from './subjects-CeqtFged.mjs';
5
- import { I as ImageRecognitionProvider, V as VideoTrackingProvider, a as ImageSubjectAdapterOptions, b as VideoSubjectAdapterOptions } from './video-adapter-Gq8saCDn.mjs';
3
+ import { A as Annotation, P as PopmeltSubjectAdapter, E as ElementInfo, a as AnnotationAttachment, S as SubjectFeedbackAttachment, b as StyleModification, T as TextModification, D as DomModification, c as SpacingTokenChange } from './subjects-C6Bu8uSX.mjs';
4
+ export { d as AnnotationType, B as BridgeStatus, C as ClaudeResponse, I as ImageObjectContext, O as OpaqueTargetReference, e as Point, f as PopmeltSubject, g as PopmeltSubjectBounds, h as PopmeltSubjectCreationSession, i as PopmeltSubjectOutlinePoint, j as PopmeltSubjectTrackingAnchor, k as PopmeltSurfaceSnapshot, R as ReactSourceLocation, l as StyleChange, m as ToolType, V as VideoObjectContext } from './subjects-C6Bu8uSX.mjs';
5
+ import { I as ImageRecognitionProvider, V as VideoTrackingProvider, a as VideoSegmentationProvider, b as ImageSubjectAdapterOptions, c as VideoSubjectAdapterOptions } from './video-adapter-UZ8OqP0O.mjs';
6
6
 
7
7
  /** Client-side envelope used for persisted and streaming bridge events. */
8
8
  type BridgeEvent = {
@@ -11,11 +11,35 @@ type BridgeEvent = {
11
11
  timestamp: number;
12
12
  };
13
13
 
14
+ type CommentMetaValue = null | boolean | number | string | CommentMetaValue[] | {
15
+ [key: string]: CommentMetaValue;
16
+ };
17
+ /** User-owned, JSON-serializable context captured with a human comment turn. */
18
+ type CommentMeta = Record<string, CommentMetaValue>;
19
+ type CommentMetaContext = {
20
+ kind: 'annotation';
21
+ timestamp: number;
22
+ url: string;
23
+ pathname: string;
24
+ annotations: readonly Readonly<Annotation>[];
25
+ } | {
26
+ kind: 'reply';
27
+ timestamp: number;
28
+ url: string;
29
+ pathname: string;
30
+ threadId: string;
31
+ reply: string;
32
+ annotations: readonly Readonly<Annotation>[];
33
+ };
34
+ type GetCommentMeta = (context: CommentMetaContext) => CommentMeta | undefined | Promise<CommentMeta | undefined>;
35
+
14
36
  type PopmeltExtensionRuntime = {
15
37
  /** Optional perception contribution for Core's built-in image adapter. */
16
38
  imageRecognition?: ImageRecognitionProvider;
17
39
  /** Optional perception contribution for Core's built-in video adapter. */
18
40
  videoTracking?: VideoTrackingProvider;
41
+ /** Optional point-prompted perception for Core's built-in video adapter. */
42
+ videoSegmentation?: VideoSegmentationProvider;
19
43
  /** Optional non-DOM subject adapters contributed by the extension. */
20
44
  subjectAdapters?: readonly PopmeltSubjectAdapter[];
21
45
  /** Release extension-owned resources. */
@@ -63,8 +87,10 @@ type PopmeltProviderProps = PropsWithChildren<{
63
87
  imageAnnotation?: boolean | ImageAnnotationOptions;
64
88
  /** Manual video annotation is on by default; See may contribute tracking. */
65
89
  videoAnnotation?: boolean | VideoAnnotationOptions;
90
+ /** Capture application-owned JSON context with each submitted human turn. */
91
+ getCommentMeta?: GetCommentMeta;
66
92
  }>;
67
- declare function PopmeltProvider({ children, enabled, bridgeUrl, projectId: projectIdProp, navigate: navigateProp, subjectAdapters, extensions, imageAnnotation, videoAnnotation, }: PopmeltProviderProps): react.JSX.Element;
93
+ declare function PopmeltProvider({ children, enabled, bridgeUrl, projectId: projectIdProp, navigate: navigateProp, subjectAdapters, extensions, imageAnnotation, videoAnnotation, getCommentMeta, }: PopmeltProviderProps): react.JSX.Element;
68
94
 
69
95
  type AnnotationData = {
70
96
  id: string;
@@ -96,6 +122,7 @@ type FeedbackData = {
96
122
  domModifications?: DomModification[];
97
123
  inspectedElement?: ElementInfo;
98
124
  spacingTokenChanges?: SpacingTokenChange[];
125
+ meta?: CommentMeta;
99
126
  };
100
127
 
101
- export { Annotation, type BridgeEvent, ElementInfo, type FeedbackData, type ImageAnnotationOptions, type PopmeltExtension, type PopmeltExtensionRuntime, PopmeltProvider, type PopmeltProviderProps, PopmeltSubjectAdapter, StyleModification, type VideoAnnotationOptions, usePopmelt };
128
+ export { Annotation, type BridgeEvent, type CommentMeta, type CommentMetaContext, type CommentMetaValue, ElementInfo, type FeedbackData, type GetCommentMeta, type ImageAnnotationOptions, type PopmeltExtension, type PopmeltExtensionRuntime, PopmeltProvider, type PopmeltProviderProps, PopmeltSubjectAdapter, StyleModification, type VideoAnnotationOptions, usePopmelt };