@popmelt.com/core 0.22.1 → 0.24.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.
Files changed (38) hide show
  1. package/README.md +30 -0
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  3. package/claude-plugin/skills/popmelt-core/SKILL.md +1 -0
  4. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  5. package/codex-plugin/skills/popmelt-core/SKILL.md +1 -0
  6. package/dist/ParticipantRuntime-PTBGXKSH.mjs +139 -0
  7. package/dist/PreviewRuntime-2SCFCGWC.mjs +2 -0
  8. package/dist/adapter-react-three-fiber.mjs +1 -1
  9. package/dist/bridge-entry.mjs +86 -89
  10. package/dist/browser-runtime-3Z4U66AP.mjs +2 -0
  11. package/dist/browser.d.mts +2 -1
  12. package/dist/browser.mjs +1 -1
  13. package/dist/chunk-6URDGUIL.mjs +2 -0
  14. package/dist/chunk-BYLH3WFB.mjs +2 -0
  15. package/dist/chunk-C4ONFAGF.mjs +399 -0
  16. package/dist/{chunk-7Z5QN5LB.mjs → chunk-DHAOAIKK.mjs} +1 -1
  17. package/dist/{chunk-RILGQYOR.mjs → chunk-EUDGPGCQ.mjs} +1 -1
  18. package/dist/chunk-EX63NVDN.mjs +2 -0
  19. package/dist/chunk-J3UIBBU2.mjs +1 -1
  20. package/dist/chunk-M3HCNQ4T.mjs +250 -0
  21. package/dist/chunk-N2ZEZCHO.mjs +1 -1
  22. package/dist/cli.mjs +112 -113
  23. package/dist/index.d.mts +3 -3
  24. package/dist/index.mjs +1 -1
  25. package/dist/media.mjs +1 -1
  26. package/dist/{options-5yRxW1AX.d.mts → participantBootstrap-Dqu2h47B.d.mts} +22 -1
  27. package/dist/plugin-astro.d.mts +2 -0
  28. package/dist/plugin-astro.mjs +3 -3
  29. package/dist/plugin-nuxt.d.mts +3 -1
  30. package/dist/plugin-nuxt.mjs +2 -1
  31. package/dist/plugin-vite.mjs +1 -1
  32. package/dist/server-T4EMCHVP.mjs +228 -0
  33. package/dist/server.d.mts +122 -1
  34. package/dist/server.mjs +96 -90
  35. package/package.json +1 -1
  36. package/dist/browser-runtime-Y7W67TJE.mjs +0 -2
  37. package/dist/chunk-QO2FFOQ4.mjs +0 -448
  38. package/dist/server-EEFXBJOO.mjs +0 -222
package/dist/server.d.mts CHANGED
@@ -1,5 +1,73 @@
1
+ import * as node_http from 'node:http';
2
+ import { IncomingMessage, ServerResponse } from 'node:http';
3
+
4
+ declare const STICKER_COLOR_NAMES: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"];
5
+ type StickerColorName = (typeof STICKER_COLOR_NAMES)[number];
6
+
7
+ declare const STICKER_FAMILIES: readonly ["padding", "margin", "border", "radius", "stack", "grid", "text", "color", "transform", "opacity"];
8
+ type StickerFamily = (typeof STICKER_FAMILIES)[number];
9
+ type StickerSubproperty = 'all' | 'x' | 'y' | 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left' | 'vertical' | 'horizontal' | 'direction' | 'gap' | 'align' | 'justify' | 'rows' | 'columns' | 'size' | 'weight' | 'line-height' | 'letter-spacing' | 'text-align' | 'color' | 'translate' | 'scale' | 'rotate' | 'opacity' | 'mix-blend' | StickerColorName;
10
+
1
11
  type Provider = 'claude' | 'codex' | 'copilot' | 'omp';
2
12
 
13
+ /** Renderer-owned identity for a target that does not exist as a DOM node. */
14
+ type OpaqueTargetReference = {
15
+ adapter: string;
16
+ key: string;
17
+ };
18
+
19
+ /** Local preview protocol. Peers never supply reducer actions or host authority. */
20
+ type PeerAction = {
21
+ type: 'tokens';
22
+ family?: StickerFamily;
23
+ subproperty?: StickerSubproperty;
24
+ } | {
25
+ type: 'inspect';
26
+ selector: string;
27
+ target?: OpaqueTargetReference;
28
+ properties?: string[];
29
+ plane?: 'own' | 'host';
30
+ } | {
31
+ type: 'comment';
32
+ selector: string;
33
+ target?: OpaqueTargetReference;
34
+ text: string;
35
+ } | {
36
+ type: 'clear';
37
+ selector: string;
38
+ kind: 'comment' | 'style' | 'all';
39
+ } | {
40
+ type: 'style';
41
+ selector: string;
42
+ property: string;
43
+ value: string;
44
+ } | {
45
+ type: 'style';
46
+ selector: string;
47
+ token: string;
48
+ family?: StickerFamily;
49
+ } | {
50
+ type: 'attention';
51
+ selector: string | null;
52
+ target?: OpaqueTargetReference;
53
+ activity?: 'looking' | 'working';
54
+ } | {
55
+ type: 'undo' | 'redo' | 'send' | 'rebase';
56
+ };
57
+
58
+ /** A capability for a person/agent. Keep out of URLs, logs, and peer snapshots. */
59
+ type ParticipantCredential = {
60
+ participantId: string;
61
+ token: string;
62
+ };
63
+
64
+ /** Browser hosting is replaceable; this boundary owns only local agent enrollment. */
65
+ type ParticipantAgentView = {
66
+ act(action: PeerAction): Promise<unknown>;
67
+ close(): Promise<void>;
68
+ };
69
+ type ParticipantAgentAdapter = (credential: ParticipantCredential) => Promise<ParticipantAgentView>;
70
+
3
71
  type ImprintExplanationKind = 'intention' | 'principle' | 'pattern';
4
72
  type ImprintExplanationState = 'emerging' | 'testing' | 'grounded' | 'challenged' | 'retired';
5
73
  type ImprintScopeKind = 'project' | 'route' | 'component' | 'selector' | 'file';
@@ -200,14 +268,66 @@ type PopmeltOptions = {
200
268
  /** Optional Chromium DevTools endpoint, e.g. http://127.0.0.1:9222. */
201
269
  nativeCaptureUrl?: string;
202
270
  restartMode?: 'embedded' | 'detached';
271
+ /** Internal opt-in. Collaboration authority is independent of app revisions. */
272
+ participantSessions?: {
273
+ /** Optional context metadata. Never used as a save, Send, or approval gate. */
274
+ sourceRevision?: () => Promise<string>;
275
+ agentAdapter?: ParticipantAgentAdapter;
276
+ };
203
277
  };
204
278
  type PopmeltHandle = {
205
279
  port: number;
206
280
  projectId: string;
207
281
  storeId?: string;
282
+ /** Trusted local launch/recovery only; never publish this capability in HTML. */
283
+ participantHost?: () => Promise<ParticipantCredential>;
208
284
  close: () => Promise<void>;
209
285
  };
210
286
 
287
+ /** One disposable, local Chrome profile per agent. Never attaches to a user's browser. */
288
+ declare function managedParticipantBrowser(url: string): ParticipantAgentAdapter;
289
+
290
+ /** Same-origin host continuity adapter. A private claim or existing host proof is
291
+ * mandatory before issuing the HttpOnly recovery capability. Localhost is not proof. */
292
+ declare function createParticipantHostEntry(options: {
293
+ projectRoot: string;
294
+ projectId: string;
295
+ origin: string;
296
+ host: () => Promise<ParticipantCredential>;
297
+ }): Promise<{
298
+ handler: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
299
+ claimUrl: string;
300
+ }>;
301
+
302
+ /** Public, credential-free description stamped by the application's dev server.
303
+ * The revision is context metadata (or `unversioned`), never sync/Send authority.
304
+ */
305
+ type ParticipantBootstrapConfig = {
306
+ version?: 1;
307
+ url: string;
308
+ projectId: string;
309
+ revision: string;
310
+ };
311
+ declare global {
312
+ interface Window {
313
+ __POPMELT_PARTICIPANTS__?: ParticipantBootstrapConfig;
314
+ }
315
+ }
316
+
317
+ /** Dev-server boundary: identify the project and optional source context, and
318
+ * keep host proof in a private local file, never in public bootstrap metadata.
319
+ * The framework owns the bridge lifecycle. No source hashing is required.
320
+ */
321
+ declare function createParticipantDevBootstrap(options: {
322
+ projectRoot: string;
323
+ origin: string;
324
+ bridge: PopmeltHandle;
325
+ sourceRevision?: () => Promise<string>;
326
+ }): Promise<{
327
+ hostEntry: (req: node_http.IncomingMessage, res: node_http.ServerResponse) => Promise<void>;
328
+ read(): Promise<ParticipantBootstrapConfig>;
329
+ }>;
330
+
211
331
  type ImprintManifest = {
212
332
  version: 1;
213
333
  topologyVersion?: 2;
@@ -372,6 +492,7 @@ declare function parseImprintDraft(responseText: string, parseContext?: ImprintP
372
492
  };
373
493
  declare function formatImprintPrompt(context: ImprintContext | undefined, options?: {
374
494
  requestText?: string;
495
+ delivery?: 'bridge' | 'ambient';
375
496
  }): string;
376
497
  declare class ImprintService {
377
498
  readonly store: ImprintStore;
@@ -415,4 +536,4 @@ type StartPopmeltOptions = PopmeltOptions & {
415
536
  };
416
537
  declare function startPopmelt(options?: StartPopmeltOptions): Promise<PopmeltHandle>;
417
538
 
418
- export { type ImprintConcrete, type ImprintContext, type ImprintEvidence, type ImprintExplanation, type ImprintExplanationKind, type ImprintExplanationRef, type ImprintExplanationState, type ImprintGraph, type ImprintGroundingAction, type ImprintMutation, type ImprintRelation, type ImprintRelationType, type ImprintScope, ImprintService, ImprintStore, type ImprintThreadSummary, type ImprintTransaction, type PopmeltHandle, type PopmeltOptions, type QualifiedImprintRelation, type StartPopmeltOptions, formatImprintPrompt, imprintExplanationRef, parseImprintDraft, qualifyImprintRelation, startPopmelt };
539
+ export { type ImprintConcrete, type ImprintContext, type ImprintEvidence, type ImprintExplanation, type ImprintExplanationKind, type ImprintExplanationRef, type ImprintExplanationState, type ImprintGraph, type ImprintGroundingAction, type ImprintMutation, type ImprintRelation, type ImprintRelationType, type ImprintScope, ImprintService, ImprintStore, type ImprintThreadSummary, type ImprintTransaction, type ParticipantAgentAdapter, type ParticipantAgentView, type PopmeltHandle, type PopmeltOptions, type QualifiedImprintRelation, type StartPopmeltOptions, createParticipantDevBootstrap, createParticipantHostEntry, formatImprintPrompt, imprintExplanationRef, managedParticipantBrowser, parseImprintDraft, qualifyImprintRelation, startPopmelt };