@popmelt.com/core 0.18.2 → 0.19.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "popmelt-core",
3
- "version": "0.18.2",
3
+ "version": "0.19.1",
4
4
  "description": "Ambient project memory and shared understanding for Codex",
5
5
  "author": {
6
6
  "name": "Popmelt",
@@ -1,5 +1,5 @@
1
1
  import { Camera, Object3D, Raycaster } from 'three';
2
- import { P as PopmeltSubjectAdapter } from './subjects-CeqtFged.mjs';
2
+ import { P as PopmeltSubjectAdapter } from './subjects-C6Bu8uSX.mjs';
3
3
 
4
4
  type ThreeSubjectAdapterOptions = {
5
5
  /** Unique adapter identity when a page owns more than one Three.js surface. */
@@ -87,6 +87,12 @@ type PopmeltSubjectTrackingAnchor = {
87
87
  /** Vertical position normalized within the subject bounds. */
88
88
  y: number;
89
89
  };
90
+ type PopmeltSubjectOutlinePoint = {
91
+ /** Horizontal position normalized within the subject bounds. */
92
+ x: number;
93
+ /** Vertical position normalized within the subject bounds. */
94
+ y: number;
95
+ };
90
96
  type PopmeltSubject = {
91
97
  key: string;
92
98
  label: string;
@@ -101,6 +107,8 @@ type PopmeltSubject = {
101
107
  videoObject?: VideoObjectContext;
102
108
  /** Optional provider-neutral foreground anchors used by motion tracking. */
103
109
  trackingAnchors?: readonly PopmeltSubjectTrackingAnchor[];
110
+ /** Optional provider-neutral contour normalized within the subject bounds. */
111
+ outline?: readonly PopmeltSubjectOutlinePoint[];
104
112
  };
105
113
  type PopmeltSurfaceSnapshot = {
106
114
  element: HTMLCanvasElement;
@@ -125,6 +133,13 @@ type PopmeltSubjectAdapter = {
125
133
  surfaceKind?: 'image' | 'video';
126
134
  /** Resolve once the adapter's persisted subject index is available. */
127
135
  whenReady?(): Promise<void>;
136
+ /** Notify Core when asynchronous perception changes hit-testable subjects. */
137
+ subscribe?(listener: () => void): () => void;
138
+ /** Ordered hit candidates, innermost/most-specific first. */
139
+ hitTestAll?(clientPoint: {
140
+ x: number;
141
+ y: number;
142
+ }): readonly PopmeltSubject[];
128
143
  hitTest(clientPoint: {
129
144
  x: number;
130
145
  y: number;
@@ -147,6 +162,8 @@ type PopmeltSubjectAdapter = {
147
162
  updateSubjectBounds?(key: string, bounds: PopmeltSubjectBounds): PopmeltSubject | null;
148
163
  /** Replace optional foreground anchors normalized within subject bounds. */
149
164
  updateSubjectTrackingAnchors?(key: string, anchors: readonly PopmeltSubjectTrackingAnchor[]): PopmeltSubject | null;
165
+ /** Promote a transient perception candidate into a durable subject. */
166
+ promoteSubject?(key: string): PopmeltSubject | null;
150
167
  /** Remove a user-created subject or hide an adapter-owned subject. */
151
168
  removeSubject?(key: string): void;
152
169
  };