@popmelt.com/core 0.18.1 → 0.18.2

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/README.md CHANGED
@@ -158,6 +158,40 @@ export function Providers({ children }: { children: React.ReactNode }) {
158
158
 
159
159
  `navigate` is optional for single-page use. Pass your router's navigation function when Popmelt needs to restore annotations across routes.
160
160
 
161
+ ### Add application context to comments
162
+
163
+ Use `getCommentMeta` to snapshot application-owned context whenever a human
164
+ submits annotations or replies in a thread. Popmelt validates and detaches the
165
+ JSON, includes it as contextual evidence for the model, and persists the same
166
+ snapshot with the stored human turn.
167
+
168
+ ```tsx
169
+ <PopmeltProvider
170
+ getCommentMeta={({ kind }) => ({
171
+ 'my-app/video-ui/v1': {
172
+ kind,
173
+ generation: {
174
+ prompt: generation.prompt,
175
+ dataVersion: store.getState().version,
176
+ },
177
+ frame: {
178
+ assetId: video.id,
179
+ timeMs: Math.round(video.currentTime * 1000),
180
+ },
181
+ interactions: recorder.snapshot(),
182
+ },
183
+ })}
184
+ >
185
+ {children}
186
+ </PopmeltProvider>
187
+ ```
188
+
189
+ The hook may be synchronous or asynchronous. Return a plain JSON object; use a
190
+ namespaced, versioned key so multiple integrations can coexist. Comment
191
+ metadata is limited to 64 KiB per human turn. Keep large binaries and long
192
+ event logs in external storage or attachments and place their stable IDs,
193
+ hashes, and timestamps in `meta`.
194
+
161
195
  ### Next.js
162
196
 
163
197
  Next.js needs both the command wrapper and the config wrapper.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "popmelt-core",
3
- "version": "0.18.1",
3
+ "version": "0.18.2",
4
4
  "description": "Ambient project memory and shared understanding for Codex",
5
5
  "author": {
6
6
  "name": "Popmelt",