@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 +34 -0
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/bridge-entry.mjs +54 -54
- package/dist/{chunk-RS3XXK26.mjs → chunk-RH6W4F2W.mjs} +1 -1
- package/dist/{chunk-P2Y3NJ7A.mjs → chunk-UC34UP4S.mjs} +1 -1
- package/dist/cli.mjs +74 -74
- package/dist/index.d.mts +28 -3
- package/dist/index.mjs +40 -40
- package/dist/media.mjs +1 -1
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-vite.mjs +1 -1
- package/dist/{server-VX66FOQO.mjs → server-PV5AVWEM.mjs} +56 -56
- package/dist/server.d.mts +2 -2
- package/dist/server.mjs +56 -56
- package/package.json +1 -1
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.
|