@popmelt.com/core 0.38.1 → 0.40.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 (165) hide show
  1. package/README.md +5 -32
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  3. package/claude-plugin/skills/popmelt-core/SKILL.md +5 -1
  4. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  5. package/codex-plugin/skills/popmelt-core/SKILL.md +5 -1
  6. package/dist/{ExploreAttachment-IIEORQP3.mjs → ExploreAttachment-DBMYVYWK.mjs} +1 -1
  7. package/dist/PagePreviewLayer-CVUA6CTQ.mjs +1 -0
  8. package/dist/ParticipantRuntime-PCBEG3Q2.mjs +1 -0
  9. package/dist/PhoneHostGate-FZLK4R6M.mjs +1 -0
  10. package/dist/PopmeltTasteConnectedPane-62LUNNWZ.mjs +1 -0
  11. package/dist/{PreviewRuntime-3ANAJNFO.mjs → PreviewRuntime-7EQNIOF5.mjs} +1 -1
  12. package/dist/SamplePlacementOverlay-LR7GZVYP.mjs +1 -0
  13. package/dist/ShareProjectPane-U47UTAOP.mjs +1 -0
  14. package/dist/SuppliedContext-F7WKJ5XO.mjs +1 -0
  15. package/dist/ThreadErrorCard-KPP7YUFC.mjs +1 -0
  16. package/dist/ThreadPanel-GOYQEF3I.mjs +1 -0
  17. package/dist/adapter-react-three-fiber.d.mts +4 -37
  18. package/dist/adapter-react-three-fiber.mjs +1 -1
  19. package/dist/adapter-three.d.mts +23 -228
  20. package/dist/adapter-three.mjs +1 -45
  21. package/dist/bridge-entry.mjs +1 -1
  22. package/dist/{bridgeSSEStream-HUFNXYPG.mjs → bridgeSSEStream-2KKFO64A.mjs} +1 -1
  23. package/dist/{bridgeWebSocketStream-AS22Y2FP.mjs → bridgeWebSocketStream-XTHQPBPI.mjs} +1 -1
  24. package/dist/browser-runtime-BBQQQLF7.mjs +1 -0
  25. package/dist/browser.d.mts +4 -4
  26. package/dist/browser.mjs +1 -1
  27. package/dist/canvas-chat-note-XMVKWL2J.mjs +1 -0
  28. package/dist/canvas-text.d.mts +38 -0
  29. package/dist/canvas-text.mjs +1 -0
  30. package/dist/{checkFixture-UNTXJKRN.mjs → checkFixture-VDRYDCUX.mjs} +1 -1
  31. package/dist/{chunk-UOK5LOPJ.mjs → chunk-27WBFE5X.mjs} +1 -1
  32. package/dist/{chunk-5F34UIKL.mjs → chunk-3EYAVOPH.mjs} +1 -1
  33. package/dist/chunk-4EDMISUV.mjs +1 -0
  34. package/dist/chunk-52OTX7DP.mjs +1 -0
  35. package/dist/chunk-53QOGFAT.mjs +1 -0
  36. package/dist/{chunk-3VOEPWRL.mjs → chunk-5TCWBNV4.mjs} +1 -1
  37. package/dist/chunk-6GS4BQVU.mjs +30 -0
  38. package/dist/{chunk-TXL2CR66.mjs → chunk-6U5JWZ4X.mjs} +1 -1
  39. package/dist/{chunk-WJVRGXOS.mjs → chunk-7D4BUDKG.mjs} +1 -1
  40. package/dist/chunk-7DXJSJCI.mjs +1 -0
  41. package/dist/chunk-AKUIREET.mjs +1 -0
  42. package/dist/chunk-B4RLDY5H.mjs +1 -0
  43. package/dist/{chunk-ZHXTB5IN.mjs → chunk-BDUWFDBP.mjs} +1 -1
  44. package/dist/chunk-C4AMAM3W.mjs +1 -0
  45. package/dist/{chunk-2WQXHUEQ.mjs → chunk-CR6TRUUV.mjs} +1 -1
  46. package/dist/{chunk-KHDXOXYF.mjs → chunk-DJFZGYX6.mjs} +1 -1
  47. package/dist/chunk-EHM2ZBQU.mjs +1 -0
  48. package/dist/{chunk-QXFBFKN6.mjs → chunk-EWTZVC7E.mjs} +1 -1
  49. package/dist/{chunk-BJUSVIDN.mjs → chunk-FFBBRCPC.mjs} +1 -1
  50. package/dist/chunk-FR6VIGJ2.mjs +1 -0
  51. package/dist/{chunk-GTVTUWGH.mjs → chunk-FSSHNWMO.mjs} +1 -1
  52. package/dist/{chunk-AEC67LMY.mjs → chunk-HC2SF7KE.mjs} +1 -1
  53. package/dist/chunk-HM6EBJVO.mjs +1 -0
  54. package/dist/chunk-HOWDQUPT.mjs +1 -0
  55. package/dist/{chunk-XJJDBMZI.mjs → chunk-HQVWOBYH.mjs} +1 -1
  56. package/dist/chunk-HTQEMKFA.mjs +1 -0
  57. package/dist/{chunk-GLF7Z5IR.mjs → chunk-K22VZV3V.mjs} +1 -1
  58. package/dist/chunk-KOHR4LAQ.mjs +1 -0
  59. package/dist/chunk-LLVF422C.mjs +1 -0
  60. package/dist/{chunk-F3VZQGPM.mjs → chunk-LUTP7QBD.mjs} +1 -1
  61. package/dist/chunk-MHTX52KW.mjs +1 -0
  62. package/dist/chunk-NC7YXD7Q.mjs +1 -0
  63. package/dist/{chunk-RJWFSAKE.mjs → chunk-NFO2CREV.mjs} +1 -1
  64. package/dist/{chunk-TCGXG7UA.mjs → chunk-OECEYJNK.mjs} +1 -1
  65. package/dist/{chunk-BEGAJYOY.mjs → chunk-OEJXPUAR.mjs} +1 -1
  66. package/dist/{chunk-FQLIJAUB.mjs → chunk-P2LMCRUN.mjs} +1 -1
  67. package/dist/{chunk-43BZCDGL.mjs → chunk-PQITT2QK.mjs} +1 -1
  68. package/dist/chunk-PQKSXNIZ.mjs +1 -0
  69. package/dist/chunk-RCY5N5KQ.mjs +1 -0
  70. package/dist/{chunk-W62YY5IT.mjs → chunk-RDB75FUD.mjs} +1 -1
  71. package/dist/chunk-RIGP4DAV.mjs +1 -0
  72. package/dist/chunk-RXC7B7SX.mjs +1 -0
  73. package/dist/{chunk-JAMYVQFC.mjs → chunk-T4WUQPBS.mjs} +1 -1
  74. package/dist/chunk-TTOCYOEH.mjs +1 -0
  75. package/dist/chunk-U5NROUVA.mjs +24 -0
  76. package/dist/chunk-UBPJIVWE.mjs +1 -0
  77. package/dist/{chunk-SKM4ZXV5.mjs → chunk-UFU5IA3G.mjs} +1 -1
  78. package/dist/chunk-UIADZXVT.mjs +1 -0
  79. package/dist/chunk-UPEEIAVJ.mjs +1 -0
  80. package/dist/{chunk-P2WAXWAZ.mjs → chunk-V5FCWXMN.mjs} +1 -1
  81. package/dist/chunk-VBH2YQLG.mjs +1 -0
  82. package/dist/chunk-VQ76TWRR.mjs +1 -0
  83. package/dist/chunk-WYQZ7DAK.mjs +1 -0
  84. package/dist/{chunk-N3MHDOMU.mjs → chunk-Y2BJZLYU.mjs} +1 -1
  85. package/dist/chunk-ZC2I35WD.mjs +1 -0
  86. package/dist/cli.mjs +1 -1
  87. package/dist/codex-note-context-2CHDGTG3.mjs +1 -0
  88. package/dist/codex-project-TIMWOCE5.mjs +1 -0
  89. package/dist/{codex-store-mount-WJAATWHT.mjs → codex-store-mount-MAQK6VEG.mjs} +1 -1
  90. package/dist/dev-server-ESGE6QNP.mjs +1 -0
  91. package/dist/{focus-inspection-LGIRFL2T.mjs → focus-inspection-BMDJJC5K.mjs} +1 -1
  92. package/dist/guest-admission.mjs +1 -1
  93. package/dist/guest-live-canvas.mjs +1 -1
  94. package/dist/index.d.mts +5 -5
  95. package/dist/index.mjs +1 -1
  96. package/dist/media.d.mts +3 -3
  97. package/dist/memory-legacy.d.mts +43 -1
  98. package/dist/memory-legacy.mjs +1 -1
  99. package/dist/memory-store.d.mts +5 -162
  100. package/dist/memory-store.mjs +1 -1
  101. package/dist/memory.d.mts +3 -531
  102. package/dist/{page-interaction-TV3P6B3X.mjs → page-interaction-YXHXEYOT.mjs} +1 -1
  103. package/dist/{page-planes-2ZepTpen.d.mts → page-planes-Jz2yR_Wk.d.mts} +246 -2
  104. package/dist/{participantBootstrap-BTcD7XgB.d.mts → participantBootstrap-DDOxY-Cy.d.mts} +2 -2
  105. package/dist/peer-client-LPDWWFT4.mjs +1 -0
  106. package/dist/plugin-astro.d.mts +1 -1
  107. package/dist/plugin-astro.mjs +1 -1
  108. package/dist/plugin-nuxt.mjs +1 -1
  109. package/dist/plugin-vite.d.mts +1 -1
  110. package/dist/plugin-vite.mjs +1 -1
  111. package/dist/server.d.mts +6 -4
  112. package/dist/server.mjs +1 -1
  113. package/dist/shared-page-QN2XRXUE.mjs +1 -0
  114. package/dist/{subjects-D_yanOQ2.d.mts → subjects-cLtt9-iK.d.mts} +12 -0
  115. package/dist/{types-CggBG-H6.d.mts → types-XKO-uva0.d.mts} +1 -1
  116. package/dist/{index-CHp2bgs1.d.mts → validate-0kt2EgVe.d.mts} +7 -40
  117. package/dist/{video-adapter-CWpR4NSt.d.mts → video-adapter-xL95wukX.d.mts} +1 -1
  118. package/infra/phone-pairing/binding.mjs +105 -0
  119. package/infra/phone-pairing/machine-config.mjs +134 -0
  120. package/infra/phone-pairing/machine-service.mjs +159 -0
  121. package/infra/phone-pairing/machine.mjs +98 -0
  122. package/infra/phone-pairing/managed-install.mjs +179 -0
  123. package/package.json +12 -1
  124. package/dist/PagePreviewLayer-AFSRCBAX.mjs +0 -1
  125. package/dist/ParticipantRuntime-ZNEFG34O.mjs +0 -1
  126. package/dist/PhoneHostGate-OCIMKPLM.mjs +0 -1
  127. package/dist/PopmeltTasteConnectedPane-N2A5XPRO.mjs +0 -1
  128. package/dist/SamplePlacementOverlay-EOJW6XGE.mjs +0 -1
  129. package/dist/ShareProjectPane-VYWTF3FW.mjs +0 -1
  130. package/dist/SuppliedContext-3S4HT6U6.mjs +0 -1
  131. package/dist/ThreadErrorCard-CTMVMETS.mjs +0 -1
  132. package/dist/ThreadPanel-G7OKSWD4.mjs +0 -1
  133. package/dist/browser-runtime-Q26JF5EA.mjs +0 -1
  134. package/dist/canvas-chat-note-OLVVP55Y.mjs +0 -1
  135. package/dist/chunk-25EXQOPI.mjs +0 -1
  136. package/dist/chunk-2IWVTTYX.mjs +0 -1
  137. package/dist/chunk-3OGSLX4V.mjs +0 -1
  138. package/dist/chunk-AGCS65LT.mjs +0 -1
  139. package/dist/chunk-AYZUOBFI.mjs +0 -1
  140. package/dist/chunk-B3RA4XAR.mjs +0 -1
  141. package/dist/chunk-BOZVNUHJ.mjs +0 -1
  142. package/dist/chunk-DBCBG5J6.mjs +0 -1
  143. package/dist/chunk-EFWBHWHP.mjs +0 -1
  144. package/dist/chunk-FYURSPM3.mjs +0 -1
  145. package/dist/chunk-G6BN5TAZ.mjs +0 -1
  146. package/dist/chunk-IW7V7WNL.mjs +0 -1
  147. package/dist/chunk-JJK4LAN6.mjs +0 -1
  148. package/dist/chunk-JJRKR4X3.mjs +0 -1
  149. package/dist/chunk-KF73S7MG.mjs +0 -1
  150. package/dist/chunk-KL5ODVJA.mjs +0 -1
  151. package/dist/chunk-L356S4EY.mjs +0 -1
  152. package/dist/chunk-OZBMHEOD.mjs +0 -1
  153. package/dist/chunk-QQPUMPKU.mjs +0 -1
  154. package/dist/chunk-TEXVTTWA.mjs +0 -1
  155. package/dist/chunk-TSQEBZYO.mjs +0 -1
  156. package/dist/chunk-UTP56NCY.mjs +0 -1
  157. package/dist/chunk-VG4ZV2OT.mjs +0 -30
  158. package/dist/chunk-WC7B5NU3.mjs +0 -24
  159. package/dist/chunk-WNOLXY3Y.mjs +0 -1
  160. package/dist/codex-note-context-4X7I5AIJ.mjs +0 -1
  161. package/dist/codex-project-Q6YT5P37.mjs +0 -1
  162. package/dist/dev-server-NROXLQKM.mjs +0 -1
  163. package/dist/peer-client-DWC5F6JN.mjs +0 -1
  164. package/dist/shared-page-GO76UP7I.mjs +0 -1
  165. /package/dist/{chunk-L45FX4SU.mjs → chunk-ERPJ6LXX.mjs} +0 -0
@@ -239,6 +239,7 @@ type StyleModification = {
239
239
  pathname?: string;
240
240
  };
241
241
  type TextModification = {
242
+ target?: OpaqueTargetReference;
242
243
  /** Whole-field preview for an edit stored as individual inline text runs. */
243
244
  canvasLabel?: string;
244
245
  paragraphs?: ParagraphChange;
@@ -478,6 +479,7 @@ type PeerIdentity = {
478
479
  kind: 'human' | 'assistant';
479
480
  relationship: 'host' | 'guest';
480
481
  };
482
+ type PeerPermission = 'direct' | 'approval-required' | 'blocked';
481
483
 
482
484
  /** Local preview protocol. Peers never supply reducer actions or host authority. */
483
485
  type PeerAction = {
@@ -603,11 +605,245 @@ type ParticipantDraft = {
603
605
  state: AnnotationState | null;
604
606
  history?: PlaneHistory;
605
607
  };
608
+ /** Host-owned execution target, shared through membership rather than drafts. */
609
+ type HostModelSelection = {
610
+ provider: string;
611
+ model: string;
612
+ label: string;
613
+ };
614
+ type ProjectVisibility = 'public' | 'private';
615
+ type PeerParticipant = {
616
+ /** Display name of the shared project, carried on the host in a room snapshot. */
617
+ projectName?: string;
618
+ projectVisibility?: ProjectVisibility;
619
+ /** Only the host's own snapshot includes the number of guests with live sessions. */
620
+ connectedGuestCount?: number;
621
+ modelSelection?: HostModelSelection;
622
+ identity: PeerIdentity;
623
+ /** Project-persistent identity color, assigned by the bridge. */
624
+ color?: string;
625
+ shape?: PeerShape;
626
+ planeId: string;
627
+ permission: PeerPermission;
628
+ permissionEpoch: number;
629
+ /** Host removal is terminal for this membership, unlike a temporary block. */
630
+ revokedAt?: number;
631
+ draftRevision: number;
632
+ /** Thread-linked pins omitted from this participant's shared canvas. */
633
+ hiddenAnnotationThreadIds?: string[];
634
+ /** Latest recorded plane event; absent when no dated activity is known. */
635
+ lastActivityAt?: number;
636
+ };
606
637
  /** A capability for a person/agent. Keep out of URLs, logs, and peer snapshots. */
607
638
  type ParticipantCredential = {
608
639
  participantId: string;
609
640
  token: string;
610
641
  };
642
+ /** Short-lived authority for one view; multiple views may share a plane. */
643
+ type ParticipantRuntime = {
644
+ participantId: string;
645
+ runtimeId: string;
646
+ token: string;
647
+ expiresAt: number;
648
+ };
649
+ /** Read-only reference material; this is deliberately NOT execution permission. */
650
+ type PeerChangeReference = {
651
+ /** Current editable basis, returned only on the host's own startup read. */
652
+ ownWorkspace?: {
653
+ revision: string;
654
+ basePath?: string;
655
+ };
656
+ /** Trusted local dev-server route, supplied only to an authorized plane viewer. */
657
+ application?: {
658
+ interactivePage?: boolean;
659
+ basePath: string;
660
+ path: string;
661
+ version: string;
662
+ basis?: string;
663
+ };
664
+ version: 1;
665
+ author: PeerIdentity;
666
+ planeId: string;
667
+ draft: ParticipantDraft;
668
+ };
669
+
670
+ /** A request capability can inspect only its own admission, never a plane. */
671
+ interface AdmissionReceipt {
672
+ id: string;
673
+ token: string;
674
+ }
675
+ interface AdmissionRequest {
676
+ id: string;
677
+ name: string;
678
+ /** Reserved peer identity color, retained when the host admits this request. */
679
+ color?: string;
680
+ shape?: PeerShape;
681
+ createdAt: number;
682
+ expiresAt: number;
683
+ status: 'pending' | 'granted' | 'declined' | 'cancelled' | 'expired';
684
+ }
685
+ interface AdmissionStatus extends AdmissionRequest {
686
+ credential?: ParticipantCredential;
687
+ participant?: PeerParticipant;
688
+ }
689
+
690
+ /**
691
+ * Opt-in session kernel. No browser launching, rendering, app-state sync, or
692
+ * code execution lives here. A trusted bridge owns ONE instance per project.
693
+ * The current PeerRoom remains the legacy transport until explicitly migrated.
694
+ */
695
+ declare class PeerSessions {
696
+ private readonly sourceId;
697
+ private readonly now;
698
+ private readonly pinDraftSource;
699
+ private readonly hostBasis?;
700
+ private saved;
701
+ private invites;
702
+ private runtimes;
703
+ private hostColors;
704
+ private tail;
705
+ private ready;
706
+ private closed;
707
+ private projectName;
708
+ private readonly directory;
709
+ private readonly file;
710
+ constructor(projectRoot: string, sourceId: string, now?: () => number, pinDraftSource?: boolean, hostBasis?: ((owner: string) => Promise<string>) | undefined);
711
+ private load;
712
+ private serial;
713
+ private commit;
714
+ private requirePublic;
715
+ private member;
716
+ private host;
717
+ private writableRuntime;
718
+ private occupiedColorSlots;
719
+ private newMember;
720
+ /** Trusted bootstrap ONLY. Never expose as an unauthenticated browser route. */
721
+ createHost(name: string): Promise<{
722
+ credential: {
723
+ participantId: `${string}-${string}-${string}-${string}-${string}`;
724
+ token: string;
725
+ };
726
+ participant: PeerParticipant;
727
+ }>;
728
+ /** Trusted local bootstrap recovery, never exposed over HTTP. */
729
+ recoverHost(): Promise<{
730
+ participantId: string;
731
+ token: string;
732
+ }>;
733
+ authenticate(credential: ParticipantCredential, membershipOnly?: boolean): Promise<PeerParticipant>;
734
+ /** Only for an already-authenticated response at its synchronous delivery boundary. */
735
+ canReadNow(credential: ParticipantCredential): boolean;
736
+ /** Trusted executor check. An approval is issued by the host transport, not the caller. */
737
+ checkExecution(participantId: string, epoch: number, approvedBy?: string, approverEpoch?: number): Promise<PeerParticipant>;
738
+ invite(credential: ParticipantCredential, sharedPath?: string): Promise<{
739
+ token: string;
740
+ expiresAt: number;
741
+ }>;
742
+ private availableInvite;
743
+ private inviteAppearance;
744
+ /** Only the guest gateway can exchange an HttpOnly device cookie for an upstream proof. */
745
+ visitGuestInvite(invitation: string, deviceKey: string, name?: string): Promise<{
746
+ credential: {
747
+ participantId: string;
748
+ token: string;
749
+ };
750
+ sharedPath: string;
751
+ appearance?: undefined;
752
+ } | {
753
+ appearance: {
754
+ projectName: string;
755
+ color: string;
756
+ shape: "circle" | "square" | "diamond" | "hexagon";
757
+ };
758
+ credential?: undefined;
759
+ sharedPath?: undefined;
760
+ }>;
761
+ guestInviteAppearance(invitation: string): Promise<{
762
+ projectName: string;
763
+ color: string;
764
+ shape: "circle" | "square" | "diamond" | "hexagon";
765
+ }>;
766
+ revokeInvite(credential: ParticipantCredential, token: string): Promise<void>;
767
+ join(invitation: string, name: string, kind: PeerIdentity['kind'], colorIdentity?: AdmissionReceipt, initialPermission?: 'direct' | 'approval-required'): Promise<{
768
+ sharedPath?: string | undefined;
769
+ credential: {
770
+ participantId: `${string}-${string}-${string}-${string}-${string}`;
771
+ token: string;
772
+ };
773
+ participant: PeerParticipant;
774
+ }>;
775
+ /** Browser entry only: an unavailable invite becomes an ordinary host request. */
776
+ joinOrRequestAdmission(invitation: string, name: string, colorIdentity: AdmissionReceipt): Promise<{
777
+ joined: {
778
+ sharedPath?: string | undefined;
779
+ credential: {
780
+ participantId: `${string}-${string}-${string}-${string}-${string}`;
781
+ token: string;
782
+ };
783
+ participant: PeerParticipant;
784
+ };
785
+ admission?: undefined;
786
+ } | {
787
+ admission: AdmissionRequest;
788
+ joined?: undefined;
789
+ }>;
790
+ snapshot(credential: ParticipantCredential, threadIsVisible?: (id: string) => boolean): Promise<PeerParticipant[]>;
791
+ isHost(id: string): Promise<boolean>;
792
+ setProjectVisibility(credential: ParticipantCredential, visibility: unknown): Promise<PeerParticipant[]>;
793
+ setHostModelSelection(credential: ParticipantCredential, value: unknown): Promise<{
794
+ provider: string;
795
+ model: string;
796
+ label: string;
797
+ }>;
798
+ /** Called only after the transport has authenticated the execution's author. */
799
+ inheritedModelSelection(participantId: string): Promise<HostModelSelection | null>;
800
+ private admission;
801
+ private admissionView;
802
+ /** A durable color-only capability: no request, membership, or plane access. */
803
+ reserveAdmissionColor(receipt: AdmissionReceipt): Promise<{
804
+ color: string;
805
+ shape: PeerShape;
806
+ }>;
807
+ private validateAdmissionReceipt;
808
+ requestAdmission(receipt: AdmissionReceipt, name: string, colorIdentity?: AdmissionReceipt): Promise<AdmissionRequest>;
809
+ admissionStatus(receipt: AdmissionReceipt): Promise<AdmissionStatus>;
810
+ cancelAdmission(receipt: AdmissionReceipt): Promise<AdmissionRequest>;
811
+ listAdmissions(credential: ParticipantCredential): Promise<AdmissionRequest[]>;
812
+ decideAdmission(credential: ParticipantCredential, id: string, decision: 'grant' | 'decline'): Promise<AdmissionRequest>;
813
+ planeAppBasis(credential: ParticipantCredential, id: string): Promise<{
814
+ id: string;
815
+ revision: string | undefined;
816
+ }>;
817
+ hasSharedAnnotation(credential: ParticipantCredential, ownerId: string | undefined, threadId: string, annotationIds: ReadonlySet<string>): Promise<boolean>;
818
+ readPlane(credential: ParticipantCredential, participantId: string, historyVersion?: number): Promise<PeerChangeReference>;
819
+ rename(credential: ParticipantCredential, name: string): Promise<PeerParticipant>;
820
+ setPermission(credential: ParticipantCredential, participantId: string, permission: PeerPermission): Promise<PeerParticipant>;
821
+ isRevokedNow(participantId: string): boolean;
822
+ /** Terminal membership removal preserves identity but no recoverable draft. */
823
+ revokeAccess(credential: ParticipantCredential, participantId: string): Promise<PeerParticipant>;
824
+ /** Reuse an active lease only with its capability, never just a browser ID. */
825
+ connect(credential: ParticipantCredential, runtimeId: string, previousToken?: string): Promise<ParticipantRuntime>;
826
+ renew(runtime: ParticipantRuntime, activeColor?: unknown): Promise<ParticipantRuntime>;
827
+ checkRuntime(runtime: ParticipantRuntime): Promise<void>;
828
+ /** Author deletion and host moderation are outside the editable event stream. */
829
+ moderateAnnotations(credential: ParticipantCredential, participantId: string, ids: string[], restore?: boolean): Promise<{
830
+ annotationIds: string[];
831
+ threadIds: string[];
832
+ }>;
833
+ /** Host moderation is metadata, never a guest-editable history event. */
834
+ moderateStyles(credential: ParticipantCredential, participantId: string, modifications: StyleSuggestionReceipt[], restore?: boolean): Promise<{
835
+ styleModifications: StyleSuggestionReceipt[];
836
+ }>;
837
+ annotationsDeleted(participantId: string, ids: string[], styles?: StyleSuggestionReceipt[]): Promise<boolean>;
838
+ disconnect(runtime: ParticipantRuntime): Promise<void>;
839
+ private checkDraftBasis;
840
+ publish(runtime: ParticipantRuntime, expectedRevision: number, source: PeerSourceReference, state: AnnotationState): Promise<ParticipantDraft>;
841
+ /** Only the caller's own draft is mergeable; this never submits implementation work. */
842
+ merge(runtime: ParticipantRuntime, expectedRevision: number, source: PeerSourceReference, input: PlaneEvent[], historyVersion?: number): Promise<ParticipantDraft>;
843
+ /** Recheck at execution, not only at queue time. Does not itself grant Send. */
844
+ checkPermission(credential: ParticipantCredential, expectedEpoch: number): Promise<PeerParticipant>;
845
+ close(): Promise<void>;
846
+ }
611
847
 
612
848
  /** For a host that owns turn scheduling. Each note must start a distinct turn. */
613
849
  type CanvasNoteTurn = {
@@ -700,6 +936,10 @@ declare function createParticipantPlaneApps(options: {
700
936
  revision: string;
701
937
  appVersion: string;
702
938
  }>;
939
+ localPreview(directory: string): {
940
+ origin: string;
941
+ basePath: string;
942
+ } | undefined;
703
943
  findEditable: (owner: string) => Promise<string | null>;
704
944
  /** Called by a trusted local editor, or by Core after dispatch authorization. */
705
945
  forEdit(owner: string, revision: string, host?: boolean): Promise<string>;
@@ -737,6 +977,8 @@ type PopmeltOptions = {
737
977
  };
738
978
  /** Participant storage and optional app-specific guest transports. */
739
979
  participantSessions?: {
980
+ /** Actual origin reported by the dev server after binding its port. */
981
+ appOrigin?: () => string;
740
982
  /** Same-origin recovery endpoint for built-in development adapters. */
741
983
  hostEntry?: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
742
984
  planeEntry?: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
@@ -745,7 +987,7 @@ type PopmeltOptions = {
745
987
  /** Keep each plane on its first draft basis when the app serves retained revisions. */
746
988
  pinDraftSource?: boolean;
747
989
  /** Trusted local worktrees and app runners, shared with the dev-server bootstrap. */
748
- planeApps?: Pick<ParticipantPlaneApps, 'capture' | 'forEdit'> & Partial<Pick<ParticipantPlaneApps, 'hostBasis' | 'hostWorkspace' | 'findEditable'>>;
990
+ planeApps?: Pick<ParticipantPlaneApps, 'capture' | 'forEdit'> & Partial<Pick<ParticipantPlaneApps, 'hostBasis' | 'hostWorkspace' | 'findEditable' | 'localPreview'>>;
749
991
  /** Resolve a host-selected guest transport after invite authorization. */
750
992
  stopGuestSharing?: () => Promise<void>;
751
993
  guestOrigin?: (mode: 'lan' | 'tunnel') => Promise<string>;
@@ -758,7 +1000,9 @@ type PopmeltHandle = {
758
1000
  port: number;
759
1001
  projectId: string;
760
1002
  storeId?: string;
1003
+ visitGuestInvite?: PeerSessions['visitGuestInvite'];
761
1004
  guestInviteAppearance?: (invitation: string) => Promise<{
1005
+ projectName?: string;
762
1006
  color: string;
763
1007
  shape: PeerShape;
764
1008
  }>;
@@ -814,4 +1058,4 @@ declare function startParticipantLan(bridge: PopmeltHandle, planes: ParticipantP
814
1058
  type PageFramework = 'next' | 'astro' | 'nuxt' | 'html';
815
1059
  type NextBundlerFlag = '--turbo' | '--turbopack' | '--webpack';
816
1060
 
817
- export { type GuestAppRequest as G, type MemoryReviewReceipt as M, type NextBundlerFlag as N, type PopmeltHandle as P, type ParticipantAgentAdapter as a, type ParticipantCredential as b, createParticipantPlaneApps as c, type ParticipantPlaneApps as d, type PopmeltOptions as e, type PageFramework as f, type PeerShape as g, type ParticipantAgentView as h, createParticipantGuestAccess as i, startParticipantLan as s };
1061
+ export { type GuestAppRequest as G, type MemoryReviewReceipt as M, type NextBundlerFlag as N, type PopmeltHandle as P, type ParticipantAgentAdapter as a, type ParticipantCredential as b, createParticipantPlaneApps as c, type ParticipantPlaneApps as d, type PopmeltOptions as e, type PageFramework as f, PeerSessions as g, type PeerShape as h, type ParticipantAgentView as i, createParticipantGuestAccess as j, startParticipantLan as s };
@@ -1,5 +1,5 @@
1
- import { A as Annotation, P as PopmeltSubjectAdapter } from './subjects-D_yanOQ2.mjs';
2
- import { d as ImageRecognitionProvider, D as VideoTrackingProvider, t as VideoSegmentationProvider, f as ImageSubjectAdapterOptions, v as VideoSubjectAdapterOptions } from './video-adapter-CWpR4NSt.mjs';
1
+ import { A as Annotation, P as PopmeltSubjectAdapter } from './subjects-cLtt9-iK.mjs';
2
+ import { d as ImageRecognitionProvider, D as VideoTrackingProvider, t as VideoSegmentationProvider, f as ImageSubjectAdapterOptions, v as VideoSubjectAdapterOptions } from './video-adapter-xL95wukX.mjs';
3
3
 
4
4
  type CommentMetaValue = null | boolean | number | string | CommentMetaValue[] | {
5
5
  [key: string]: CommentMetaValue;
@@ -0,0 +1 @@
1
+ import{a as m,b as n,c as s,d as r,e as t,f as o}from"./chunk-CR6TRUUV.mjs";import"./chunk-27WBFE5X.mjs";import"./chunk-HC2SF7KE.mjs";import"./chunk-OECEYJNK.mjs";import"./chunk-MPEVFQ43.mjs";import"./chunk-MHTX52KW.mjs";import"./chunk-6GS4BQVU.mjs";import"./chunk-PYGRFSUU.mjs";import"./chunk-6EO73WJN.mjs";import"./chunk-NC7YXD7Q.mjs";import"./chunk-KOHR4LAQ.mjs";import"./chunk-LLVF422C.mjs";import"./chunk-53QOGFAT.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-PQKSXNIZ.mjs";import"./chunk-K22VZV3V.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-UIADZXVT.mjs";import"./chunk-NOHXTT24.mjs";export{m as agentCredentialFile,t as callPeer,r as canvasChatRequest,s as enrolledCanvasEndpoint,o as runPeerCommand,n as sendThreadNote};
@@ -3,7 +3,7 @@ import { popmelt as popmelt$1 } from './plugin-vite.mjs';
3
3
  import 'node:http';
4
4
  import './participantBootstrap-BuTrTQbo.mjs';
5
5
  import 'vite';
6
- import './page-planes-2ZepTpen.mjs';
6
+ import './page-planes-Jz2yR_Wk.mjs';
7
7
 
8
8
  type PopmeltAstroOptions = PopmeltPluginOptions & {
9
9
  /** Set false when an existing provider mounts the UI. */
@@ -1 +1 @@
1
- import{b as t}from"./chunk-FQLIJAUB.mjs";import"./chunk-F3VZQGPM.mjs";import"./chunk-JJK4LAN6.mjs";import"./chunk-IW7V7WNL.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-UTP56NCY.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-KF73S7MG.mjs";import"./chunk-L45FX4SU.mjs";import"./chunk-NOHXTT24.mjs";import{fileURLToPath as e}from"url";function n(n={}){return{name:"popmelt",hooks:{"astro:config:setup"({command:r,config:i,updateConfig:s,injectScript:a}){if("dev"!==r||"1"===process.env.POPMELT_PLANE_RENDERER)return;let{client:m=!0,...d}=n;s({vite:{plugins:[t({...d,projectRoot:n.projectRoot??e(i.root)},"astro")],optimizeDeps:{include:m?["react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client"]:[]}}}),a("page",m?o:"\nimport { bridgeUrl, projectId } from 'virtual:popmelt/bridge';\nif (bridgeUrl) window.__POPMELT_BRIDGE_URL__ = bridgeUrl;\nif (projectId) window.__POPMELT_PROJECT_ID__ = projectId;\n")}}}}var o="\nimport { bridgeUrl, projectId } from 'virtual:popmelt/bridge';\nimport { navigate } from 'astro:transitions/client';\nlet disposed = false;\nlet mounting;\nconst start = () => {\n if (disposed || mounting || !bridgeUrl || !projectId) return;\n mounting = Promise.resolve(import.meta.hot?.data.cleanup).then(async () => {\n if (disposed) return;\n const { mountPopmelt } = await import('@popmelt.com/core/browser');\n if (disposed) return;\n const handle = await mountPopmelt({ enabled: true, bridgeUrl, projectId, navigate });\n return handle;\n }).catch(error => { console.warn('[popmelt] startup failed:', error); });\n};\n// The standalone hosts live outside body, so Astro's body swaps retain them.\ndocument.addEventListener('astro:page-load', start);\nif (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, { once: true });\nelse start();\nimport.meta.hot?.dispose(data => {\n if (disposed) return;\n disposed = true;\n document.removeEventListener('astro:page-load', start);\n document.removeEventListener('DOMContentLoaded', start);\n data.cleanup = mounting?.then(handle => handle?.unmount());\n});\n";export{n as popmelt};
1
+ import{b as t}from"./chunk-P2LMCRUN.mjs";import"./chunk-LUTP7QBD.mjs";import"./chunk-LLVF422C.mjs";import"./chunk-53QOGFAT.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-PQKSXNIZ.mjs";import"./chunk-K22VZV3V.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-UIADZXVT.mjs";import"./chunk-ERPJ6LXX.mjs";import"./chunk-NOHXTT24.mjs";import{fileURLToPath as e}from"url";function n(n={}){return{name:"popmelt",hooks:{"astro:config:setup"({command:r,config:i,updateConfig:s,injectScript:a}){if("dev"!==r||"1"===process.env.POPMELT_PLANE_RENDERER)return;let{client:m=!0,...d}=n;s({vite:{plugins:[t({...d,projectRoot:n.projectRoot??e(i.root)},"astro")],optimizeDeps:{include:m?["react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client"]:[]}}}),a("page",m?o:"\nimport { bridgeUrl, projectId } from 'virtual:popmelt/bridge';\nif (bridgeUrl) window.__POPMELT_BRIDGE_URL__ = bridgeUrl;\nif (projectId) window.__POPMELT_PROJECT_ID__ = projectId;\n")}}}}var o="\nimport { bridgeUrl, projectId } from 'virtual:popmelt/bridge';\nimport { navigate } from 'astro:transitions/client';\nlet disposed = false;\nlet mounting;\nconst start = () => {\n if (disposed || mounting || !bridgeUrl || !projectId) return;\n mounting = Promise.resolve(import.meta.hot?.data.cleanup).then(async () => {\n if (disposed) return;\n const { mountPopmelt } = await import('@popmelt.com/core/browser');\n if (disposed) return;\n const handle = await mountPopmelt({ enabled: true, bridgeUrl, projectId, navigate });\n return handle;\n }).catch(error => { console.warn('[popmelt] startup failed:', error); });\n};\n// The standalone hosts live outside body, so Astro's body swaps retain them.\ndocument.addEventListener('astro:page-load', start);\nif (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, { once: true });\nelse start();\nimport.meta.hot?.dispose(data => {\n if (disposed) return;\n disposed = true;\n document.removeEventListener('astro:page-load', start);\n document.removeEventListener('DOMContentLoaded', start);\n data.cleanup = mounting?.then(handle => handle?.unmount());\n});\n";export{n as popmelt};
@@ -1 +1 @@
1
- import{b as e,c as t}from"./chunk-L45FX4SU.mjs";import{b as o}from"./chunk-NOHXTT24.mjs";import{addPluginTemplate as n,defineNuxtModule as r}from"nuxt/kit";var p=r({meta:{name:"@popmelt.com/core/nuxt",configKey:"popmelt"},async setup(r,p){if(!p.options.dev||"1"===process.env.POPMELT_PLANE_RENDERER)return;let s={config:{server:p.options.devServer},middlewares:{use(){}}},i=await e({...r,projectRoot:r.projectRoot??p.options.rootDir},s,3e3,void 0,"nuxt");if(null===i.port)return;i.updateOrigin&&p.hook("listen",async(e,t)=>{let o=e.address();if(!o||"string"==typeof o)return;let n="127.0.0.1"===o.address?"127.0.0.1":"::1"===o.address?"[::1]":"localhost";await i.updateOrigin(`${t.https?"https":"http"}://${n}:${o.port}`)}),p.hook("nitro:config",e=>{e.routeRules??={},Object.assign(e.routeRules,{...i.bootstrap?.planeApps&&{"/__popmelt/planes/**":{proxy:{to:`http://127.0.0.1:${i.port}/__popmelt/planes/**`,headers:{"x-popmelt-project-id":i.projectId}}}},...i.bootstrap&&{"/__popmelt/host":{proxy:`http://127.0.0.1:${i.port}/__popmelt/host?projectId=${encodeURIComponent(i.projectId)}`}},"/popmelt/phone":{proxy:`http://127.0.0.1:${i.port}/phone-host`}})}),p.hook("vite:extend",({config:e})=>{e.server??={},e.server.fs??={},e.server.fs.strict=!0,e.server.fs.deny=[...e.server.fs.deny??[".env",".env.*","*.{crt,pem}","**/.git/**"],"**/.popmelt","**/.popmelt/**"],e.server.watch??={};let t=e.server.watch.ignored;e.server.watch.ignored=[...Array.isArray(t)?t:t?[t]:[],"**/.popmelt/**"],e.optimizeDeps??={},e.optimizeDeps.include=[...new Set([...e.optimizeDeps.include??[],"react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client"])]});let d=await t(i,s),a=d?o(d):void 0;p.hook("close",async()=>{a?.(),await(d?.release())}),n({filename:"popmelt.client.mjs",mode:"client",getContents:()=>`import { defineNuxtPlugin } from '#app';\nexport default defineNuxtPlugin((nuxtApp) => {\n let disposed = false;\n let mounting;\n const bridgeUrl = ${JSON.stringify(`http://localhost:${i.port}`)};\n const projectId = ${JSON.stringify(i.projectId)};\n ${i.bootstrap?`window.__POPMELT_PARTICIPANTS__=${JSON.stringify(i.bootstrap)};`:""}\n const dispose = () => {\n if (disposed) return;\n disposed = true;\n void mounting?.then(handle => handle?.unmount());\n };\n nuxtApp.hook('app:mounted', () => {\n if (disposed || mounting) return;\n mounting = import('@popmelt.com/core/browser').then(({ mountPopmelt }) => {\n if (disposed) return;\n return mountPopmelt({\n enabled: true,\n bridgeUrl,\n projectId,\n navigate: (url) => nuxtApp.$router.push(url),\n });\n }).then(handle => {\n if (disposed) handle?.unmount();\n return handle;\n }).catch(error => { console.warn('[popmelt] startup failed:', error); });\n });\n nuxtApp.vueApp.onUnmount(dispose);\n import.meta.hot?.dispose(dispose);\n});`})}});export{p as default};
1
+ import{b as e,c as t}from"./chunk-ERPJ6LXX.mjs";import{b as o}from"./chunk-NOHXTT24.mjs";import{addPluginTemplate as n,defineNuxtModule as r}from"nuxt/kit";var p=r({meta:{name:"@popmelt.com/core/nuxt",configKey:"popmelt"},async setup(r,p){if(!p.options.dev||"1"===process.env.POPMELT_PLANE_RENDERER)return;let s={config:{server:p.options.devServer},middlewares:{use(){}}},i=await e({...r,projectRoot:r.projectRoot??p.options.rootDir},s,3e3,void 0,"nuxt");if(null===i.port)return;i.updateOrigin&&p.hook("listen",async(e,t)=>{let o=e.address();if(!o||"string"==typeof o)return;let n="127.0.0.1"===o.address?"127.0.0.1":"::1"===o.address?"[::1]":"localhost";await i.updateOrigin(`${t.https?"https":"http"}://${n}:${o.port}`)}),p.hook("nitro:config",e=>{e.routeRules??={},Object.assign(e.routeRules,{...i.bootstrap?.planeApps&&{"/__popmelt/planes/**":{proxy:{to:`http://127.0.0.1:${i.port}/__popmelt/planes/**`,headers:{"x-popmelt-project-id":i.projectId}}}},...i.bootstrap&&{"/__popmelt/host":{proxy:`http://127.0.0.1:${i.port}/__popmelt/host?projectId=${encodeURIComponent(i.projectId)}`}},"/popmelt/phone":{proxy:`http://127.0.0.1:${i.port}/phone-host`}})}),p.hook("vite:extend",({config:e})=>{e.server??={},e.server.fs??={},e.server.fs.strict=!0,e.server.fs.deny=[...e.server.fs.deny??[".env",".env.*","*.{crt,pem}","**/.git/**"],"**/.popmelt","**/.popmelt/**"],e.server.watch??={};let t=e.server.watch.ignored;e.server.watch.ignored=[...Array.isArray(t)?t:t?[t]:[],"**/.popmelt/**"],e.optimizeDeps??={},e.optimizeDeps.include=[...new Set([...e.optimizeDeps.include??[],"react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client"])]});let d=await t(i,s),a=d?o(d):void 0;p.hook("close",async()=>{a?.(),await(d?.release())}),n({filename:"popmelt.client.mjs",mode:"client",getContents:()=>`import { defineNuxtPlugin } from '#app';\nexport default defineNuxtPlugin((nuxtApp) => {\n let disposed = false;\n let mounting;\n const bridgeUrl = ${JSON.stringify(`http://localhost:${i.port}`)};\n const projectId = ${JSON.stringify(i.projectId)};\n ${i.bootstrap?`window.__POPMELT_PARTICIPANTS__=${JSON.stringify(i.bootstrap)};`:""}\n const dispose = () => {\n if (disposed) return;\n disposed = true;\n void mounting?.then(handle => handle?.unmount());\n };\n nuxtApp.hook('app:mounted', () => {\n if (disposed || mounting) return;\n mounting = import('@popmelt.com/core/browser').then(({ mountPopmelt }) => {\n if (disposed) return;\n return mountPopmelt({\n enabled: true,\n bridgeUrl,\n projectId,\n navigate: (url) => nuxtApp.$router.push(url),\n });\n }).then(handle => {\n if (disposed) handle?.unmount();\n return handle;\n }).catch(error => { console.warn('[popmelt] startup failed:', error); });\n });\n nuxtApp.vueApp.onUnmount(dispose);\n import.meta.hot?.dispose(dispose);\n});`})}});export{p as default};
@@ -1,7 +1,7 @@
1
1
  import { P as PopmeltPluginOptions, D as DevServerLike } from './dev-server-BRrhkH5t.mjs';
2
2
  import * as vite from 'vite';
3
3
  import { createServer, ViteDevServer, Plugin as Plugin$1 } from 'vite';
4
- import { s as startParticipantLan, P as PopmeltHandle, c as createParticipantPlaneApps } from './page-planes-2ZepTpen.mjs';
4
+ import { s as startParticipantLan, P as PopmeltHandle, c as createParticipantPlaneApps } from './page-planes-Jz2yR_Wk.mjs';
5
5
  import 'node:http';
6
6
  import './participantBootstrap-BuTrTQbo.mjs';
7
7
 
@@ -1 +1 @@
1
- import{a as m,b as p}from"./chunk-FQLIJAUB.mjs";import"./chunk-F3VZQGPM.mjs";import"./chunk-JJK4LAN6.mjs";import"./chunk-IW7V7WNL.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-UTP56NCY.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-KF73S7MG.mjs";import"./chunk-L45FX4SU.mjs";import"./chunk-NOHXTT24.mjs";export{m as participantPlanes,p as popmelt};
1
+ import{a as m,b as p}from"./chunk-P2LMCRUN.mjs";import"./chunk-LUTP7QBD.mjs";import"./chunk-LLVF422C.mjs";import"./chunk-53QOGFAT.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-PQKSXNIZ.mjs";import"./chunk-K22VZV3V.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-UIADZXVT.mjs";import"./chunk-ERPJ6LXX.mjs";import"./chunk-NOHXTT24.mjs";export{m as participantPlanes,p as popmelt};
package/dist/server.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { a as ParticipantAgentAdapter, b as ParticipantCredential, P as PopmeltHandle, d as ParticipantPlaneApps, e as PopmeltOptions, f as PageFramework, N as NextBundlerFlag, G as GuestAppRequest, g as PeerShape } from './page-planes-2ZepTpen.mjs';
2
- export { h as ParticipantAgentView, i as createParticipantGuestAccess, c as createParticipantPlaneApps } from './page-planes-2ZepTpen.mjs';
1
+ import { a as ParticipantAgentAdapter, b as ParticipantCredential, P as PopmeltHandle, d as ParticipantPlaneApps, e as PopmeltOptions, f as PageFramework, N as NextBundlerFlag, G as GuestAppRequest, g as PeerSessions, h as PeerShape } from './page-planes-Jz2yR_Wk.mjs';
2
+ export { i as ParticipantAgentView, j as createParticipantGuestAccess, c as createParticipantPlaneApps } from './page-planes-Jz2yR_Wk.mjs';
3
3
  import { P as ParticipantBootstrapConfig } from './participantBootstrap-BuTrTQbo.mjs';
4
4
  import * as node_http from 'node:http';
5
5
  import { IncomingMessage, ServerResponse } from 'node:http';
6
- import { I as ImprintGraph, a as ImprintTransaction, b as ImprintMutation, c as ImprintContext, d as ImprintSummaryKind, e as ImprintExplanationKind, f as ImprintScope, g as ImprintTopologyRelationType, h as ImprintExplanationRef, i as ImprintThreadSummary, j as ImprintGroundingAction, k as ImprintRelation, Q as QualifiedImprintRelation } from './types-CggBG-H6.mjs';
7
- export { l as ImprintConcrete, m as ImprintEvidence, n as ImprintExplanation, o as ImprintExplanationState, p as ImprintRelationType } from './types-CggBG-H6.mjs';
6
+ import { c as ImprintGraph, d as ImprintTransaction, e as ImprintMutation, f as ImprintContext, g as ImprintSummaryKind, h as ImprintExplanationKind, i as ImprintScope, j as ImprintTopologyRelationType, k as ImprintExplanationRef, I as ImprintThreadSummary, a as ImprintGroundingAction, l as ImprintRelation, Q as QualifiedImprintRelation } from './types-XKO-uva0.mjs';
7
+ export { m as ImprintConcrete, n as ImprintEvidence, o as ImprintExplanation, p as ImprintExplanationState, q as ImprintRelationType } from './types-XKO-uva0.mjs';
8
8
  import 'vite';
9
9
 
10
10
  /** One disposable, local Chrome profile per agent. Never attaches to a user's browser. */
@@ -271,7 +271,9 @@ declare function startDevelopmentSession(options: {
271
271
  port: number;
272
272
  projectId: string;
273
273
  storeId?: string;
274
+ visitGuestInvite?: PeerSessions["visitGuestInvite"];
274
275
  guestInviteAppearance?: (invitation: string) => Promise<{
276
+ projectName?: string;
275
277
  color: string;
276
278
  shape: PeerShape;
277
279
  }>;
package/dist/server.mjs CHANGED
@@ -1 +1 @@
1
- import{a as s,b as t,c as a}from"./chunk-AEC67LMY.mjs";import"./chunk-TCGXG7UA.mjs";import"./chunk-MPEVFQ43.mjs";import"./chunk-AYZUOBFI.mjs";import{i as m,j as r,k as i,l as p}from"./chunk-VG4ZV2OT.mjs";import"./chunk-PYGRFSUU.mjs";import"./chunk-6EO73WJN.mjs";import{b as n,c as o}from"./chunk-EFWBHWHP.mjs";import"./chunk-TSQEBZYO.mjs";import{b as c,d as e,e as u}from"./chunk-JJK4LAN6.mjs";import{d as j}from"./chunk-IW7V7WNL.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-UTP56NCY.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-KF73S7MG.mjs";import"./chunk-NOHXTT24.mjs";export{p as ImprintService,m as ImprintStore,u as createParticipantDevBootstrap,c as createParticipantGuestAccess,e as createParticipantHostEntry,j as createParticipantPlaneApps,i as formatImprintPrompt,n as imprintExplanationRef,s as managedParticipantBrowser,r as parseImprintDraft,o as qualifyImprintRelation,a as startDevelopmentSession,t as startPopmelt};
1
+ import{a as t,b as s,c as a}from"./chunk-HC2SF7KE.mjs";import"./chunk-OECEYJNK.mjs";import"./chunk-MPEVFQ43.mjs";import"./chunk-MHTX52KW.mjs";import{i as m,j as r,k as i,l as p}from"./chunk-6GS4BQVU.mjs";import"./chunk-PYGRFSUU.mjs";import"./chunk-6EO73WJN.mjs";import{a as n,b as o}from"./chunk-NC7YXD7Q.mjs";import"./chunk-KOHR4LAQ.mjs";import{b as c,d as e,e as u}from"./chunk-LLVF422C.mjs";import{b as j}from"./chunk-53QOGFAT.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-PQKSXNIZ.mjs";import"./chunk-K22VZV3V.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-UIADZXVT.mjs";import"./chunk-NOHXTT24.mjs";export{p as ImprintService,m as ImprintStore,u as createParticipantDevBootstrap,c as createParticipantGuestAccess,e as createParticipantHostEntry,j as createParticipantPlaneApps,i as formatImprintPrompt,n as imprintExplanationRef,t as managedParticipantBrowser,r as parseImprintDraft,o as qualifyImprintRelation,a as startDevelopmentSession,s as startPopmelt};
@@ -0,0 +1 @@
1
+ import{c as a,d as r}from"./chunk-MHTX52KW.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-UIADZXVT.mjs";export{r as createSharedPageReader,a as sharedPagePath};
@@ -249,6 +249,7 @@ type StyleModification = {
249
249
  pathname?: string;
250
250
  };
251
251
  type TextModification = {
252
+ target?: OpaqueTargetReference;
252
253
  /** Whole-field preview for an edit stored as individual inline text runs. */
253
254
  canvasLabel?: string;
254
255
  paragraphs?: ParagraphChange;
@@ -530,6 +531,17 @@ type PopmeltSubjectAdapter = {
530
531
  y: number;
531
532
  }): PopmeltSubject | null;
532
533
  resolve(key: string): PopmeltSubject | null;
534
+ /** Editable copy by stable key, including while its view is hidden. value is
535
+ * the authored source. preview(null) releases Core's temporary override. */
536
+ getEditableText?(key: string): {
537
+ value: string;
538
+ font?: string;
539
+ /** Use a readable source editor for wrapped, projected, or partially revealed copy. */
540
+ sourceEditor?: boolean;
541
+ /** Optionally hold renderer playback while editing and return its release. */
542
+ beginEdit?(): void | (() => void);
543
+ preview(value: string | null): void;
544
+ } | null;
533
545
  /** Recreate a missing durable subject from annotation-captured context. */
534
546
  restoreSubject?(key: string, elementInfo: ElementInfo): PopmeltSubject | null;
535
547
  /** Paint a live hover accent on this subject. Release it when hover ends. */
@@ -232,4 +232,4 @@ type ImprintView = {
232
232
  explanations: ImprintViewExplanation[];
233
233
  };
234
234
 
235
- export type { ImprintGraph as I, QualifiedImprintRelation as Q, ImprintTransaction as a, ImprintMutation as b, ImprintContext as c, ImprintSummaryKind as d, ImprintExplanationKind as e, ImprintScope as f, ImprintTopologyRelationType as g, ImprintExplanationRef as h, ImprintThreadSummary as i, ImprintGroundingAction as j, ImprintRelation as k, ImprintConcrete as l, ImprintEvidence as m, ImprintExplanation as n, ImprintExplanationState as o, ImprintRelationType as p, ImprintView as q };
235
+ export type { ImprintThreadSummary as I, QualifiedImprintRelation as Q, ImprintGroundingAction as a, ImprintView as b, ImprintGraph as c, ImprintTransaction as d, ImprintMutation as e, ImprintContext as f, ImprintSummaryKind as g, ImprintExplanationKind as h, ImprintScope as i, ImprintTopologyRelationType as j, ImprintExplanationRef as k, ImprintRelation as l, ImprintConcrete as m, ImprintEvidence as n, ImprintExplanation as o, ImprintExplanationState as p, ImprintRelationType as q };
@@ -521,45 +521,12 @@ type SchemaIssue = {
521
521
  message: string;
522
522
  severity: 'error' | 'warning';
523
523
  };
524
-
525
- type LegacyImportIssue = {
526
- severity: 'info' | 'warning' | 'error';
527
- code: string;
528
- source?: string;
529
- message: string;
530
- };
531
- type LegacyImportReport = {
532
- projectRoot: string;
533
- source: {
534
- threads: number;
535
- messages: number;
536
- decisionEnvelopes: number;
537
- modelEntries: number;
538
- artifactsReferenced: number;
539
- };
540
- imported: Record<string, number>;
541
- unresolvedAcceptance: number;
542
- deferredModelEntries: number;
543
- proofCases: Array<{
544
- legacyId: string;
545
- threadFound: boolean;
546
- decisionEnvelopeFound: boolean;
547
- recordIds: string[];
548
- }>;
549
- issues: LegacyImportIssue[];
550
- schemaIssues: SchemaIssue[];
551
- };
552
- type LegacyImportResult = {
553
- bundle: ProjectMemoryBundle;
554
- report: LegacyImportReport;
555
- };
556
- type LegacyImportOptions = {
557
- projectRoot: string;
558
- projectKey?: string;
559
- proofCaseIds?: string[];
560
- writerVersion?: string;
524
+ type SchemaValidationResult = {
525
+ valid: boolean;
526
+ issues: SchemaIssue[];
561
527
  };
562
- declare function legacyUuidV7(namespace: string, kind: string, legacyId: string, occurredAt: number): string;
563
- declare function importLegacyProject(options: LegacyImportOptions): Promise<LegacyImportResult>;
528
+ declare function isUuidV7(value: string): boolean;
529
+ declare function validateProjectMemoryBundle(bundle: ProjectMemoryBundle): SchemaValidationResult;
530
+ declare function validateRetrievalPacket(packet: RetrievalPacket): SchemaValidationResult;
564
531
 
565
- export { type AuthorityContext as A, type CanonicalRecord as C, type DecisionRecord as D, type IterationOutcome as I, type JsonValue as J, type LifecycleEvent as L, type MemoryId as M, type ProposalRecord as P, type RelationshipRecord as R, type SourceReference as S, type Timestamp as T, type DecisionKind as a, type DecisionSubject as b, type ProposalDeferralContext as c, type ProjectMemoryBundle as d, type ArtifactManifestEntry as e, type Tombstone as f, type RetrievalPacket as g, type IterationRecord as h, type LegacyImportOptions as i, type LegacyImportReport as j, type ModelEntryRecord as k, type LegacyImportIssue as l, type LegacyImportResult as m, importLegacyProject as n, legacyUuidV7 as o };
532
+ export { type MemoryObjectType as $, type ArtifactManifestEntry as A, type EvalSpecRecord as B, type CanonicalRecord as C, type DecisionKind as D, type EntityReference as E, type EvalSpecState as F, type EvidenceKind as G, type EvidenceRecord as H, type IterationOutcome as I, type JsonValue as J, type ExecutionContext as K, type LifecycleEvent as L, type ModelEntryRecord as M, type FreshnessSignalRecord as N, type FreshnessSignalType as O, type ProjectMemoryBundle as P, type FreshnessTargetKind as Q, type RelationshipRecord as R, type SourceReference as S, type Tombstone as T, type ImplementationAttemptRecord as U, type ImplementationState as V, type JsonPrimitive as W, MEMORY_FORMAT_VERSION as X, MEMORY_SCHEMA_VERSION as Y, type MemoryFeature as Z, type MemoryFormatVersion as _, type ProposalRecord as a, type MemorySchemaVersion as a0, type ModelProjectionRecord as a1, type ObservationRecord as a2, type ObservationState as a3, type ParticipantKind as a4, type ParticipantRecord as a5, type ParticipantStance as a6, type ProjectMemoryManifest as a7, type ProposalState as a8, type Provenance as a9, type RelationshipType as aa, type RetrievalConflict as ab, type RetrievalDecision as ac, type RetrievalEvidenceSummary as ad, type RetrievalUncertainty as ae, type SchemaIssue as af, type SourceReferenceKind as ag, type SubjectLocator as ah, type SubjectLocatorKind as ai, type SubjectMatch as aj, type SubjectRecord as ak, type SubjectType as al, type ThreadOutcome as am, type ThreadRecord as an, type VerificationAttemptRecord as ao, type VerificationState as ap, type VerificationTarget as aq, isUuidV7 as ar, validateProjectMemoryBundle as as, validateRetrievalPacket as at, type IterationRecord as b, type DecisionRecord as c, type MemoryId as d, type Timestamp as e, type RetrievalPacket as f, type AuthorityContext as g, type ProposalDeferralContext as h, type DecisionSubject as i, type SchemaValidationResult as j, type AdvisoryConcreteBinding as k, type AdvisoryExplanationKind as l, type AdvisoryExplanationRecord as m, type AdvisoryExplanationScope as n, type AdvisoryExplanationState as o, type ArtifactKind as p, type AssertionOrigin as q, type AuthorityGrantRecord as r, type AuthorityLevel as s, type AuthorityMode as t, type CaptureContext as u, type CoverageClaim as v, type DecisionState as w, type EntityType as x, type EvalDependency as y, type EvalScenario as z };
@@ -1,4 +1,4 @@
1
- import { P as PopmeltSubjectAdapter, b as PopmeltSubject, E as ElementInfo, c as PopmeltSubjectCreationSession, a as PopmeltSubjectBounds, d as PopmeltSubjectOutlinePoint, e as PopmeltSubjectTrackingAnchor } from './subjects-D_yanOQ2.mjs';
1
+ import { P as PopmeltSubjectAdapter, b as PopmeltSubject, E as ElementInfo, c as PopmeltSubjectCreationSession, a as PopmeltSubjectBounds, d as PopmeltSubjectOutlinePoint, e as PopmeltSubjectTrackingAnchor } from './subjects-cLtt9-iK.mjs';
2
2
 
3
3
  /** Geometry is normalized against the loaded image, not its rendered size. */
4
4
  type ImageObjectBox = {
@@ -0,0 +1,105 @@
1
+ import { createHash, randomBytes, randomUUID } from 'node:crypto';
2
+ import {
3
+ linkSync,
4
+ lstatSync,
5
+ mkdirSync,
6
+ readFileSync,
7
+ realpathSync,
8
+ renameSync,
9
+ unlinkSync,
10
+ writeFileSync,
11
+ } from 'node:fs';
12
+ import { homedir } from 'node:os';
13
+ import { join } from 'node:path';
14
+
15
+ export const base = join(homedir(), '.popmelt-pair');
16
+ export function privateDir(path) {
17
+ mkdirSync(path, { recursive: true, mode: 0o700 });
18
+ const stat = lstatSync(path);
19
+ if (!stat.isDirectory() || stat.uid !== process.getuid() || stat.mode & 0o077)
20
+ throw Error('Expected a private directory owned by this user: ' + path);
21
+ }
22
+ export function readPrivate(path) {
23
+ const stat = lstatSync(path);
24
+ if (!stat.isFile() || stat.uid !== process.getuid() || stat.mode & 0o077)
25
+ throw Error('Expected a private file owned by this user: ' + path);
26
+ return readFileSync(path, 'utf8');
27
+ }
28
+ export function writePrivate(path, data, createOnly = false) {
29
+ const tmp = path + '.' + randomUUID() + '.tmp';
30
+ writeFileSync(tmp, data, { mode: 0o600, flag: 'wx' });
31
+ if (createOnly) {
32
+ try {
33
+ linkSync(tmp, path);
34
+ } finally {
35
+ unlinkSync(tmp);
36
+ }
37
+ } else {
38
+ try {
39
+ renameSync(tmp, path);
40
+ } catch (e) {
41
+ unlinkSync(tmp);
42
+ throw e;
43
+ }
44
+ }
45
+ }
46
+ function checkOrigin(origin) {
47
+ if (
48
+ typeof origin !== 'string' ||
49
+ !/^https?:\/\/(127\.0\.0\.1|localhost|\[::1\]):[0-9]+$/.test(origin) ||
50
+ new URL(origin).origin !== origin
51
+ )
52
+ throw Error('Expected a loopback app origin with an explicit port.');
53
+ }
54
+ export function readBinding(projectKey) {
55
+ if (!/^[0-9a-f]{64}$/.test(projectKey)) throw Error('Invalid project key.');
56
+ const record = JSON.parse(readPrivate(join(base, projectKey + '.json')));
57
+ if (record.projectKey !== projectKey || !/^[0-9a-f]{32}$/.test(record.id))
58
+ throw Error('Invalid project binding.');
59
+ checkOrigin(record.appOrigin);
60
+ privateDir(join(base, record.id));
61
+ return record;
62
+ }
63
+ export function projectKeyFor(directory) {
64
+ const stat = lstatSync(realpathSync(directory));
65
+ if (!stat.isDirectory()) throw Error('Expected a project directory.');
66
+ return createHash('sha256')
67
+ .update([stat.dev, stat.ino, stat.birthtimeMs].join(':'))
68
+ .digest('hex');
69
+ }
70
+ export function bind(directory, appOrigin, assignedId) {
71
+ checkOrigin(appOrigin);
72
+ const projectKey = projectKeyFor(directory);
73
+ privateDir(base);
74
+ let record;
75
+ try {
76
+ record = readBinding(projectKey);
77
+ } catch (e) {
78
+ if (e.code !== 'ENOENT') throw e;
79
+ const id = assignedId ?? randomBytes(16).toString('hex');
80
+ try {
81
+ writePrivate(
82
+ join(base, projectKey + '.json'),
83
+ JSON.stringify({ projectKey, id, appOrigin }),
84
+ true,
85
+ );
86
+ } catch (e) {
87
+ if (e.code !== 'EEXIST') throw e;
88
+ }
89
+ record = readBinding(projectKey);
90
+ }
91
+ // localhost aliases for the same listener preserve the original binding.
92
+ const stored = new URL(record.appOrigin),
93
+ requested = new URL(appOrigin);
94
+ if (stored.protocol !== requested.protocol || stored.port !== requested.port)
95
+ throw Error('Review the existing binding before changing its app origin.');
96
+ return record;
97
+ }
98
+ export function route(id) {
99
+ return {
100
+ id,
101
+ bookmark: 'https://pair.popmelt.com/p/' + id,
102
+ hostname: 'p-' + id + '.popmelt.com',
103
+ socket: join(base, id, 'app.sock'),
104
+ };
105
+ }