@popmelt.com/core 0.38.1 → 0.39.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.
- package/README.md +4 -3
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/{ExploreAttachment-IIEORQP3.mjs → ExploreAttachment-OA2PUTNR.mjs} +1 -1
- package/dist/PagePreviewLayer-HKADULHD.mjs +1 -0
- package/dist/ParticipantRuntime-IU2STHIT.mjs +1 -0
- package/dist/PhoneHostGate-CS3KFCP5.mjs +1 -0
- package/dist/PopmeltTasteConnectedPane-TRQCY5SM.mjs +1 -0
- package/dist/{SamplePlacementOverlay-EOJW6XGE.mjs → SamplePlacementOverlay-SNA4WB6Z.mjs} +1 -1
- package/dist/ShareProjectPane-QLHMNZNU.mjs +1 -0
- package/dist/SuppliedContext-SFOM3R3K.mjs +1 -0
- package/dist/{ThreadErrorCard-CTMVMETS.mjs → ThreadErrorCard-NJUVLWMU.mjs} +1 -1
- package/dist/ThreadPanel-RVCNMX7B.mjs +1 -0
- package/dist/adapter-react-three-fiber.mjs +1 -1
- package/dist/adapter-three.d.mts +9 -8
- package/dist/adapter-three.mjs +3 -3
- package/dist/bridge-entry.mjs +1 -1
- package/dist/{bridgeSSEStream-HUFNXYPG.mjs → bridgeSSEStream-2KKFO64A.mjs} +1 -1
- package/dist/{bridgeWebSocketStream-AS22Y2FP.mjs → bridgeWebSocketStream-XTHQPBPI.mjs} +1 -1
- package/dist/browser-runtime-BUC4RUD7.mjs +1 -0
- package/dist/browser.mjs +1 -1
- package/dist/canvas-chat-note-XMVKWL2J.mjs +1 -0
- package/dist/{checkFixture-UNTXJKRN.mjs → checkFixture-I2ALOQTM.mjs} +1 -1
- package/dist/chunk-4B6HUJCH.mjs +1 -0
- package/dist/{chunk-BJUSVIDN.mjs → chunk-4LN72RDZ.mjs} +1 -1
- package/dist/{chunk-3VOEPWRL.mjs → chunk-5TCWBNV4.mjs} +1 -1
- package/dist/chunk-742KV4YS.mjs +1 -0
- package/dist/{chunk-WJVRGXOS.mjs → chunk-7D4BUDKG.mjs} +1 -1
- package/dist/chunk-ADOCYY5I.mjs +1 -0
- package/dist/chunk-B4RLDY5H.mjs +1 -0
- package/dist/chunk-B4ZKGIGU.mjs +1 -0
- package/dist/{chunk-ZHXTB5IN.mjs → chunk-BDUWFDBP.mjs} +1 -1
- package/dist/chunk-CHK24QU5.mjs +1 -0
- package/dist/{chunk-TCGXG7UA.mjs → chunk-CPFVBR6Q.mjs} +1 -1
- package/dist/{chunk-GTVTUWGH.mjs → chunk-D3BHAI37.mjs} +1 -1
- package/dist/chunk-DKBVNKIG.mjs +24 -0
- package/dist/chunk-EOAWCUFT.mjs +1 -0
- package/dist/{chunk-QXFBFKN6.mjs → chunk-EWTZVC7E.mjs} +1 -1
- package/dist/{chunk-2WQXHUEQ.mjs → chunk-FD6IIFJC.mjs} +1 -1
- package/dist/{chunk-TEXVTTWA.mjs → chunk-FPSR4NAR.mjs} +1 -1
- package/dist/{chunk-KHDXOXYF.mjs → chunk-G6ITTTFD.mjs} +1 -1
- package/dist/chunk-H4GG2RS4.mjs +1 -0
- package/dist/chunk-HM6EBJVO.mjs +1 -0
- package/dist/chunk-HOWDQUPT.mjs +1 -0
- package/dist/{chunk-XJJDBMZI.mjs → chunk-HQVWOBYH.mjs} +1 -1
- package/dist/chunk-IWF42SDV.mjs +1 -0
- package/dist/{chunk-GLF7Z5IR.mjs → chunk-K22VZV3V.mjs} +1 -1
- package/dist/chunk-K2OUXYDM.mjs +1 -0
- package/dist/chunk-KOHR4LAQ.mjs +1 -0
- package/dist/chunk-KY4YVZ3O.mjs +1 -0
- package/dist/chunk-LLVF422C.mjs +1 -0
- package/dist/chunk-LSKP5UC6.mjs +1 -0
- package/dist/{chunk-F3VZQGPM.mjs → chunk-LUTP7QBD.mjs} +1 -1
- package/dist/chunk-ML7YV4RV.mjs +1 -0
- package/dist/{chunk-TXL2CR66.mjs → chunk-MLNC5TMP.mjs} +1 -1
- package/dist/chunk-MSWRCFPJ.mjs +1 -0
- package/dist/chunk-NC7YXD7Q.mjs +1 -0
- package/dist/{chunk-BEGAJYOY.mjs → chunk-OEJXPUAR.mjs} +1 -1
- package/dist/{chunk-43BZCDGL.mjs → chunk-OL7RDZ2R.mjs} +1 -1
- package/dist/{chunk-N3MHDOMU.mjs → chunk-P3IOAIYB.mjs} +1 -1
- package/dist/chunk-PQKSXNIZ.mjs +1 -0
- package/dist/{chunk-AEC67LMY.mjs → chunk-QDFQPABM.mjs} +1 -1
- package/dist/chunk-RALP6ENI.mjs +30 -0
- package/dist/chunk-RRB5IHBT.mjs +1 -0
- package/dist/{chunk-UOK5LOPJ.mjs → chunk-UFUH63SR.mjs} +1 -1
- package/dist/chunk-UIADZXVT.mjs +1 -0
- package/dist/{chunk-JAMYVQFC.mjs → chunk-V56MNQLF.mjs} +1 -1
- package/dist/{chunk-5F34UIKL.mjs → chunk-VWFST2IX.mjs} +1 -1
- package/dist/{chunk-FQLIJAUB.mjs → chunk-W5JUAOLA.mjs} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-4ORRY4CH.mjs +1 -0
- package/dist/codex-project-LMAR3FMS.mjs +1 -0
- package/dist/{codex-store-mount-WJAATWHT.mjs → codex-store-mount-MNIL3VK6.mjs} +1 -1
- package/dist/dev-server-ZLT7TAUF.mjs +1 -0
- package/dist/guest-admission.mjs +1 -1
- package/dist/guest-live-canvas.mjs +1 -1
- package/dist/{index-CHp2bgs1.d.mts → index-D6bSXWNT.d.mts} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/memory-legacy.d.mts +1 -1
- package/dist/memory-legacy.mjs +1 -1
- package/dist/memory-store.d.mts +84 -84
- package/dist/memory-store.mjs +1 -1
- package/dist/{page-interaction-TV3P6B3X.mjs → page-interaction-GC2UN47Y.mjs} +1 -1
- package/dist/{page-planes-2ZepTpen.d.mts → page-planes-9GVbnVZa.d.mts} +240 -1
- package/dist/peer-client-XNTMFSOV.mjs +1 -0
- package/dist/plugin-astro.d.mts +1 -1
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.d.mts +1 -1
- package/dist/plugin-vite.mjs +1 -1
- package/dist/server.d.mts +4 -2
- package/dist/server.mjs +1 -1
- package/dist/shared-page-JN7T4DDQ.mjs +1 -0
- package/infra/phone-pairing/README.md +25 -0
- package/infra/phone-pairing/binding.mjs +105 -0
- package/infra/phone-pairing/machine-config.mjs +134 -0
- package/infra/phone-pairing/machine-service.mjs +159 -0
- package/infra/phone-pairing/machine.mjs +98 -0
- package/infra/phone-pairing/managed-install.mjs +179 -0
- package/package.json +42 -25
- package/dist/PagePreviewLayer-AFSRCBAX.mjs +0 -1
- package/dist/ParticipantRuntime-ZNEFG34O.mjs +0 -1
- package/dist/PhoneHostGate-OCIMKPLM.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-N2A5XPRO.mjs +0 -1
- package/dist/ShareProjectPane-VYWTF3FW.mjs +0 -1
- package/dist/SuppliedContext-3S4HT6U6.mjs +0 -1
- package/dist/ThreadPanel-G7OKSWD4.mjs +0 -1
- package/dist/browser-runtime-Q26JF5EA.mjs +0 -1
- package/dist/canvas-chat-note-OLVVP55Y.mjs +0 -1
- package/dist/chunk-2IWVTTYX.mjs +0 -1
- package/dist/chunk-3OGSLX4V.mjs +0 -1
- package/dist/chunk-A4GARXVQ.mjs +0 -1
- package/dist/chunk-AGCS65LT.mjs +0 -1
- package/dist/chunk-AYZUOBFI.mjs +0 -1
- package/dist/chunk-BOZVNUHJ.mjs +0 -1
- package/dist/chunk-DBCBG5J6.mjs +0 -1
- package/dist/chunk-EFWBHWHP.mjs +0 -1
- package/dist/chunk-FYURSPM3.mjs +0 -1
- package/dist/chunk-G6BN5TAZ.mjs +0 -1
- package/dist/chunk-IW7V7WNL.mjs +0 -1
- package/dist/chunk-JJK4LAN6.mjs +0 -1
- package/dist/chunk-JJRKR4X3.mjs +0 -1
- package/dist/chunk-KF73S7MG.mjs +0 -1
- package/dist/chunk-KL5ODVJA.mjs +0 -1
- package/dist/chunk-L356S4EY.mjs +0 -1
- package/dist/chunk-OZBMHEOD.mjs +0 -1
- package/dist/chunk-P2WAXWAZ.mjs +0 -1
- package/dist/chunk-PRPXMDZ7.mjs +0 -1
- package/dist/chunk-QQPUMPKU.mjs +0 -1
- package/dist/chunk-TSQEBZYO.mjs +0 -1
- package/dist/chunk-UTP56NCY.mjs +0 -1
- package/dist/chunk-VG4ZV2OT.mjs +0 -30
- package/dist/chunk-WC7B5NU3.mjs +0 -24
- package/dist/chunk-X6I6KQDG.mjs +0 -1
- package/dist/codex-note-context-4X7I5AIJ.mjs +0 -1
- package/dist/codex-project-Q6YT5P37.mjs +0 -1
- package/dist/dev-server-NROXLQKM.mjs +0 -1
- package/dist/peer-client-DWC5F6JN.mjs +0 -1
- package/dist/shared-page-GO76UP7I.mjs +0 -1
- /package/dist/{chunk-L45FX4SU.mjs → chunk-CZJILD7T.mjs} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";export{b as PopmeltProvider}from"./chunk-
|
|
1
|
+
"use client";export{b as PopmeltProvider}from"./chunk-K2OUXYDM.mjs";import"./chunk-VWFST2IX.mjs";import"./chunk-DKBVNKIG.mjs";import"./chunk-BDUWFDBP.mjs";import"./chunk-MSWRCFPJ.mjs";import"./chunk-OL7RDZ2R.mjs";import"./chunk-B4RLDY5H.mjs";import"./chunk-PH2MLB3T.mjs";import"./chunk-ELKVFX2O.mjs";import"./chunk-AWWUJO3N.mjs";import"./chunk-Q6N77LIS.mjs";import"./chunk-XTOCFTVW.mjs";import"./chunk-Q74FBX2I.mjs";import"./chunk-G6ITTTFD.mjs";import"./chunk-SOGN7S54.mjs";import"./chunk-4LN72RDZ.mjs";export{a as isPopmeltPreview}from"./chunk-KCDHP4N3.mjs";import"./chunk-KY4YVZ3O.mjs";import"./chunk-OVZ4CQGM.mjs";import"./chunk-WIJSWSNF.mjs";import"./chunk-V56MNQLF.mjs";import"./chunk-FHCKFQBY.mjs";import"./chunk-APP5IYTE.mjs";import"./chunk-W62YY5IT.mjs";import"./chunk-RRB5IHBT.mjs";import"./chunk-B3RA4XAR.mjs";import"./chunk-ADOCYY5I.mjs";import"./chunk-G2ZHJXHZ.mjs";import"./chunk-TMSGNHXH.mjs";import"./chunk-53SKVMWR.mjs";import"./chunk-3LZQLRZ2.mjs";import"./chunk-RJWFSAKE.mjs";import"./chunk-EOAWCUFT.mjs";import"./chunk-2F2BVGFH.mjs";import"./chunk-RWZ7SVMO.mjs";import"./chunk-RK6UROPO.mjs";import"./chunk-5IZHN3A7.mjs";import"./chunk-AOTDTBQO.mjs";import"./chunk-HAZXZ5TU.mjs";import"./chunk-TVIKC33M.mjs";import"./chunk-25EXQOPI.mjs";import"./chunk-VXRRHXUP.mjs";import"./chunk-WP2SHSCG.mjs";import"./chunk-AAMUU2QA.mjs";import"./chunk-LH7HKUCK.mjs";import"./chunk-742KV4YS.mjs";import"./chunk-CHK24QU5.mjs";import"./chunk-ATLUO4G7.mjs";import"./chunk-H4GG2RS4.mjs";import"./chunk-C2ZSNUXQ.mjs";import"./chunk-FPSR4NAR.mjs";import"./chunk-EILBHZDX.mjs";import"./chunk-HQVWOBYH.mjs";import"./chunk-OREALBUO.mjs";import"./chunk-B4DYUYX4.mjs";import"./chunk-CK3CDA3L.mjs";import"./chunk-ZVDKW7TO.mjs";import"./chunk-Q6C7ZA3H.mjs";import"./chunk-7D4BUDKG.mjs";import"./chunk-OEJXPUAR.mjs";import"./chunk-HM6EBJVO.mjs";import"./chunk-OA63PYHZ.mjs";import"./chunk-6RMM7JB6.mjs";import"./chunk-SUAHDXJZ.mjs";import"./chunk-N2ZEZCHO.mjs";export{b as usePopmelt}from"./chunk-J3UIBBU2.mjs";import"./chunk-YGP6PPOZ.mjs";
|
package/dist/memory-legacy.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { l as LegacyImportIssue, i as LegacyImportOptions, j as LegacyImportReport, m as LegacyImportResult, n as importLegacyProject, o as legacyUuidV7 } from './index-
|
|
1
|
+
export { l as LegacyImportIssue, i as LegacyImportOptions, j as LegacyImportReport, m as LegacyImportResult, n as importLegacyProject, o as legacyUuidV7 } from './index-D6bSXWNT.mjs';
|
package/dist/memory-legacy.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,b as o}from"./chunk-KOHR4LAQ.mjs";export{o as importLegacyProject,a as legacyUuidV7};
|
package/dist/memory-store.d.mts
CHANGED
|
@@ -1,10 +1,92 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P as ProjectMemoryBundle, M as MemoryId, T as Timestamp, D as DecisionKind, a as ProposalRecord, S as SourceReference, R as RetrievalPacket, b as DecisionRecord, A as AuthorityContext, c as DecisionSubject, d as ProposalDeferralContext, C as CanonicalRecord, L as LifecycleEvent, e as RelationshipRecord, f as ArtifactManifestEntry, g as Tombstone, I as IterationOutcome, h as IterationRecord, i as LegacyImportOptions, j as LegacyImportReport, k as ModelEntryRecord, J as JsonValue } from './index-D6bSXWNT.mjs';
|
|
2
2
|
import { i as ImprintThreadSummary, j as ImprintGroundingAction, q as ImprintView } from './types-CggBG-H6.mjs';
|
|
3
|
-
import { M as MemoryReviewReceipt } from './page-planes-
|
|
3
|
+
import { M as MemoryReviewReceipt } from './page-planes-9GVbnVZa.mjs';
|
|
4
4
|
import './participantBootstrap-BuTrTQbo.mjs';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import 'vite';
|
|
7
7
|
|
|
8
|
+
type ContextualReviewQuery = {
|
|
9
|
+
action?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
subjectIds?: MemoryId[];
|
|
12
|
+
subjectHints?: string[];
|
|
13
|
+
maxPackets?: number;
|
|
14
|
+
maxEstimatedTokens?: number;
|
|
15
|
+
generatedAt?: Timestamp;
|
|
16
|
+
candidateProposalIds?: MemoryId[];
|
|
17
|
+
candidateDecisionIds?: MemoryId[];
|
|
18
|
+
resurface?: {
|
|
19
|
+
differentAction?: boolean;
|
|
20
|
+
newEvidence?: boolean;
|
|
21
|
+
newConflict?: boolean;
|
|
22
|
+
ownerRequested?: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type ContextualSubjectMatch = {
|
|
26
|
+
subjectId: MemoryId;
|
|
27
|
+
label: string;
|
|
28
|
+
confidence: 'exact' | 'strong' | 'weak';
|
|
29
|
+
matchedBy: 'id' | 'label' | 'alias' | 'locator' | 'query_text';
|
|
30
|
+
};
|
|
31
|
+
type OwnerReviewAction = 'accept' | 'edit_and_accept' | 'split' | 'bundle' | 'reject' | 'defer' | 'request_evidence';
|
|
32
|
+
type ContextualReviewPacket = {
|
|
33
|
+
contractVersion: 1;
|
|
34
|
+
packetId: string;
|
|
35
|
+
projectId: MemoryId;
|
|
36
|
+
generatedAt: Timestamp;
|
|
37
|
+
trigger: {
|
|
38
|
+
action?: string;
|
|
39
|
+
reason: string;
|
|
40
|
+
subjectMatches: ContextualSubjectMatch[];
|
|
41
|
+
};
|
|
42
|
+
proposal: {
|
|
43
|
+
id: MemoryId;
|
|
44
|
+
claim: string;
|
|
45
|
+
state: 'pending' | 'deferred';
|
|
46
|
+
proposedKind?: DecisionKind;
|
|
47
|
+
subjectIds: MemoryId[];
|
|
48
|
+
origin: ProposalRecord['origin']['mode'];
|
|
49
|
+
};
|
|
50
|
+
authority: 'unaccepted';
|
|
51
|
+
presentation: 'advisory' | 'surface_before_action';
|
|
52
|
+
implementation: {
|
|
53
|
+
state: 'none_found' | 'attempted' | 'completed' | 'mixed';
|
|
54
|
+
attemptIds: MemoryId[];
|
|
55
|
+
};
|
|
56
|
+
evidence: {
|
|
57
|
+
sourceCount: number;
|
|
58
|
+
sourceRefs: SourceReference[];
|
|
59
|
+
};
|
|
60
|
+
actions: OwnerReviewAction[];
|
|
61
|
+
expansionRefs: SourceReference[];
|
|
62
|
+
estimatedTokens: number;
|
|
63
|
+
};
|
|
64
|
+
type ContextualReviewSelection = {
|
|
65
|
+
packets: ContextualReviewPacket[];
|
|
66
|
+
subjectMatches: ContextualSubjectMatch[];
|
|
67
|
+
completeness: {
|
|
68
|
+
status: 'complete' | 'truncated';
|
|
69
|
+
consideredProposalCount: number;
|
|
70
|
+
omittedPacketCount: number;
|
|
71
|
+
maxEstimatedTokens: number;
|
|
72
|
+
estimatedTokens: number;
|
|
73
|
+
};
|
|
74
|
+
uncertainty?: 'subject_unresolved' | 'no_relevant_pending_proposal';
|
|
75
|
+
};
|
|
76
|
+
declare function selectContextualReviewPackets(bundle: ProjectMemoryBundle, query: ContextualReviewQuery): ContextualReviewSelection;
|
|
77
|
+
|
|
78
|
+
type RetrievalQuery = {
|
|
79
|
+
action?: string;
|
|
80
|
+
text?: string;
|
|
81
|
+
subjectIds?: MemoryId[];
|
|
82
|
+
subjectHints?: string[];
|
|
83
|
+
maxEstimatedTokens?: number;
|
|
84
|
+
maxDecisions?: number;
|
|
85
|
+
retrievedAt?: string;
|
|
86
|
+
candidateDecisionIds?: MemoryId[];
|
|
87
|
+
};
|
|
88
|
+
declare function retrieveActionPacket(bundle: ProjectMemoryBundle, query: RetrievalQuery): RetrievalPacket;
|
|
89
|
+
|
|
8
90
|
type ReviewCommandBase = {
|
|
9
91
|
proposalId: MemoryId;
|
|
10
92
|
participantId: MemoryId;
|
|
@@ -157,88 +239,6 @@ declare class MemoryJournalStore {
|
|
|
157
239
|
private withWriterLock;
|
|
158
240
|
}
|
|
159
241
|
|
|
160
|
-
type RetrievalQuery = {
|
|
161
|
-
action?: string;
|
|
162
|
-
text?: string;
|
|
163
|
-
subjectIds?: MemoryId[];
|
|
164
|
-
subjectHints?: string[];
|
|
165
|
-
maxEstimatedTokens?: number;
|
|
166
|
-
maxDecisions?: number;
|
|
167
|
-
retrievedAt?: string;
|
|
168
|
-
candidateDecisionIds?: MemoryId[];
|
|
169
|
-
};
|
|
170
|
-
declare function retrieveActionPacket(bundle: ProjectMemoryBundle, query: RetrievalQuery): RetrievalPacket;
|
|
171
|
-
|
|
172
|
-
type ContextualReviewQuery = {
|
|
173
|
-
action?: string;
|
|
174
|
-
text?: string;
|
|
175
|
-
subjectIds?: MemoryId[];
|
|
176
|
-
subjectHints?: string[];
|
|
177
|
-
maxPackets?: number;
|
|
178
|
-
maxEstimatedTokens?: number;
|
|
179
|
-
generatedAt?: Timestamp;
|
|
180
|
-
candidateProposalIds?: MemoryId[];
|
|
181
|
-
candidateDecisionIds?: MemoryId[];
|
|
182
|
-
resurface?: {
|
|
183
|
-
differentAction?: boolean;
|
|
184
|
-
newEvidence?: boolean;
|
|
185
|
-
newConflict?: boolean;
|
|
186
|
-
ownerRequested?: boolean;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
type ContextualSubjectMatch = {
|
|
190
|
-
subjectId: MemoryId;
|
|
191
|
-
label: string;
|
|
192
|
-
confidence: 'exact' | 'strong' | 'weak';
|
|
193
|
-
matchedBy: 'id' | 'label' | 'alias' | 'locator' | 'query_text';
|
|
194
|
-
};
|
|
195
|
-
type OwnerReviewAction = 'accept' | 'edit_and_accept' | 'split' | 'bundle' | 'reject' | 'defer' | 'request_evidence';
|
|
196
|
-
type ContextualReviewPacket = {
|
|
197
|
-
contractVersion: 1;
|
|
198
|
-
packetId: string;
|
|
199
|
-
projectId: MemoryId;
|
|
200
|
-
generatedAt: Timestamp;
|
|
201
|
-
trigger: {
|
|
202
|
-
action?: string;
|
|
203
|
-
reason: string;
|
|
204
|
-
subjectMatches: ContextualSubjectMatch[];
|
|
205
|
-
};
|
|
206
|
-
proposal: {
|
|
207
|
-
id: MemoryId;
|
|
208
|
-
claim: string;
|
|
209
|
-
state: 'pending' | 'deferred';
|
|
210
|
-
proposedKind?: DecisionKind;
|
|
211
|
-
subjectIds: MemoryId[];
|
|
212
|
-
origin: ProposalRecord['origin']['mode'];
|
|
213
|
-
};
|
|
214
|
-
authority: 'unaccepted';
|
|
215
|
-
presentation: 'advisory' | 'surface_before_action';
|
|
216
|
-
implementation: {
|
|
217
|
-
state: 'none_found' | 'attempted' | 'completed' | 'mixed';
|
|
218
|
-
attemptIds: MemoryId[];
|
|
219
|
-
};
|
|
220
|
-
evidence: {
|
|
221
|
-
sourceCount: number;
|
|
222
|
-
sourceRefs: SourceReference[];
|
|
223
|
-
};
|
|
224
|
-
actions: OwnerReviewAction[];
|
|
225
|
-
expansionRefs: SourceReference[];
|
|
226
|
-
estimatedTokens: number;
|
|
227
|
-
};
|
|
228
|
-
type ContextualReviewSelection = {
|
|
229
|
-
packets: ContextualReviewPacket[];
|
|
230
|
-
subjectMatches: ContextualSubjectMatch[];
|
|
231
|
-
completeness: {
|
|
232
|
-
status: 'complete' | 'truncated';
|
|
233
|
-
consideredProposalCount: number;
|
|
234
|
-
omittedPacketCount: number;
|
|
235
|
-
maxEstimatedTokens: number;
|
|
236
|
-
estimatedTokens: number;
|
|
237
|
-
};
|
|
238
|
-
uncertainty?: 'subject_unresolved' | 'no_relevant_pending_proposal';
|
|
239
|
-
};
|
|
240
|
-
declare function selectContextualReviewPackets(bundle: ProjectMemoryBundle, query: ContextualReviewQuery): ContextualReviewSelection;
|
|
241
|
-
|
|
242
242
|
type ConversationalReviewIntent = {
|
|
243
243
|
proposalId: string;
|
|
244
244
|
action: 'accept' | 'edit_and_accept' | 'reject' | 'defer';
|
package/dist/memory-store.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f as a,g as e,h as s,i as r,j as o}from"./chunk-NC7YXD7Q.mjs";import"./chunk-KOHR4LAQ.mjs";export{e as MemoryJournalStore,s as MemoryService,a as computeTransactionHash,o as parseContextualReviewQuery,r as parseOwnerReviewCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as t,c as r}from"./chunk-TCGXG7UA.mjs";import"./chunk-MPEVFQ43.mjs";import{a,b as i}from"./chunk-AYZUOBFI.mjs";import{a as n}from"./chunk-IW7V7WNL.mjs";import{b as s}from"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-KF73S7MG.mjs";import{execFile as o}from"child_process";import{createHash as l,randomBytes as c}from"crypto";import{mkdir as p,mkdtemp as u,readFile as f,readdir as m,realpath as d,rm as h,stat as g}from"fs/promises";import{extname as w,join as y,relative as v,resolve as b,sep as x}from"path";import{promisify as S}from"util";import{parse as E,serialize as j}from"parse5";var N=S(o),R=33554432,L=(e,t)=>e.attrs.find(e=>e.name===t)?.value;async function k(o,S,k,A,P){let _=async(e,t,r)=>{let n=new URL(k,t),o=await fetch(n,{redirect:"manual",headers:{Accept:"text/html"},signal:AbortSignal.timeout(15e3)});if(200!==o.status||!o.headers.get("content-type")?.includes("text/html"))throw await(o.body?.cancel()),Error("Page unavailable");return async function(e,t,r,n,o){let p=c(18).toString("base64"),u=Buffer.byteLength(r);if(u>R)throw Error("Shared page exceeds the preview size limit");async function h(r,a,s){let l=new URL(r,a);if(l.origin!==t.origin||l.username||l.password)return;let c=decodeURIComponent(l.pathname);if(c.split("/").some(e=>e.startsWith(".")||"node_modules"===e)||/[\\%?#]/.test(c)||i(c)||!s.has(w(c).toLowerCase()))return;let p="next"===n&&c.startsWith("/_next/static/"),m=p?y(e,".next","static"):o,h=b(m,"."+(p?c.slice(13):c));if(h.startsWith(m+x))try{if(await d(h)!==h)return;let e=await g(h);if(!e.isFile()||e.size>R-u)throw Error("Shared page exceeds the preview size limit");return u+=e.size,{data:await f(h),url:l}}catch(e){if("ENOENT"!==e.code)throw e}}let v=new Set(Object.keys(a).filter(e=>".css"!==e)),S=new Set,N=Object.create(null),k=async(e,r)=>{if(e.startsWith("data:"))return e;let i=new URL(e,r);if(i.origin===t.origin&&N[i.pathname])return N[i.pathname];let n=await h(e,r,v),s=n?"data:"+a[w(n.url.pathname).toLowerCase()]+";base64,"+n.data.toString("base64"):"";return s.startsWith("data:image/")&&(N[i.pathname]=s),s};async function A(e,t){let r=/url\(\s*(['"]?)([^)'"]+)\1\s*\)/gi,a=0,i="";for(let n of e.matchAll(r))n[2].startsWith("#")||(i+=e.slice(a,n.index)+"url("+JSON.stringify(await k(n[2].trim(),t))+")",a=n.index+n[0].length);return i+e.slice(a)}let P=E(r);function _(e,t){e.childNodes=[{nodeName:"#text",value:t,parentNode:e}]}let I=new Set,T=new Set,U=new Set,W=new Set([".js",".mjs"]);function z(e){I.add(e.url.pathname);let t=e.data.toString();for(let e of t.matchAll(/["'](\/(?:[A-Za-z0-9_.%~-]+\/)*[A-Za-z0-9_.%~-]+\.(?:png|jpe?g|gif|webp|avif|svg|ico))["']/gi))S.add(e[1]);for(let e of t.matchAll(/["'](?:\/_next\/)?(static\/chunks\/[\w./%-]+\.js)["']/g))T.add("/_next/"+e[1]);for(let e of t.matchAll(/\b[\w$]+\.e\((\d+)\)/g))U.add(e[1]);return('if(document.currentScript)document.currentScript.setAttribute("src",'+JSON.stringify(e.url.pathname).replace(/</g,"\\u003c")+");\n"+t).replace(/<\/script/gi,"<\\/script")}let F=function(e,t){let r="popmelt-module:/",a=new Map,i=new Map,n=new Map,s=new Map;function o(t,r){if(r&&"object"==typeof r)for(let[a,i]of Object.entries(r)){let r=/^(?:\.{0,2}\/|https?:)/.test(a)?new URL(a,e).href:a;t.has(r)||t.set(r,"string"==typeof i?new URL(i,e).href:null)}}function l(e,t){if(e.has(t))return e.get(t);let r=[...e.keys()].filter(e=>e.endsWith("/")&&t.startsWith(e)).sort((e,t)=>t.length-e.length)[0];if(r){let a=e.get(r);return a?.endsWith("/")?a+t.slice(r.length):null}}function c(t){let i=new URL(t,e).href,n=a.get(i)??"entry-"+a.size;return a.set(i,n),r+n+".js"}return{entry:c,importMap(t){let r=JSON.parse(t);o(n,r.imports);for(let[t,a]of Object.entries(r.scopes??{})){let r=new URL(t,e).href,i=s.get(r)??new Map;o(i,a),s.set(r,i)}},inline(t){let r=new URL(e);return r.hash="inline-"+i.size,i.set(r.href,t),c(r.href)},async compile(){if(!a.size)return;let o={name:"invited-page-modules",setup(r){r.onResolve({filter:/.*/},t=>{let r,a=t.importer||e.href,i=/^(?:\.{0,2}\/|https?:\/\/)/.test(t.path),o=i?new URL(t.path,a).href:t.path;if("entry-point"!==t.kind){for(let e of[...s.keys()].filter(e=>a===e||e.endsWith("/")&&a.startsWith(e)).sort((e,t)=>t.length-e.length))if(r=l(s.get(e),o),void 0!==r)break;void 0===r&&(r=l(n,o))}if(null===r||!i&&!r)return{external:!0};let c=new URL(r??o);return c.origin!==e.origin?{path:c.href,external:!0}:{path:c.href,namespace:"page"}}),r.onLoad({filter:/.*/,namespace:"page"},async({path:r})=>{let a=i.get(r)??(await t(r,e))?.data.toString();if(void 0===a)throw new Error("Invited page module unavailable");return{contents:a,loader:"js"}})}},{build:c}=await(import("esbuild")),p=await c({entryPoints:[...a].map(([e,t])=>({in:e,out:t})),bundle:!0,splitting:!0,format:"esm",platform:"browser",publicPath:r,write:!1,outdir:"/",logLevel:"silent",legalComments:"none",minify:!0,plugins:[o]});return Object.fromEntries(p.outputFiles.map(e=>[r+e.path.split(/[\\/]/).pop(),"data:text/javascript;base64,"+Buffer.from(e.contents).toString("base64")]))}}}(t,(e,t)=>h(e,t,W)),H=new Set;await async function e(r){let a=[];for(let i of r.childNodes){if("tagName"in i){let r=i.tagName;if(["base","iframe","frame","embed","object"].includes(r)||"meta"===r&&L(i,"http-equiv"))continue;if("html"===n)for(let e of i.attrs)/^on[a-z]+$/.test(e.name)&&H.add("'sha256-"+l("sha256").update(e.value).digest("base64")+"'");if("astro"===n&&"astro-island"===r)for(let e of i.attrs)["component-url","renderer-url","before-hydration-url"].includes(e.name)&&e.value&&(e.value=F.entry(e.value));if("script"===r){let e=()=>i.childNodes.map(e=>"value"in e?e.value:"").join("");if("next"!==n&&"importmap"===L(i,"type")){F.importMap(e());continue}let r,a=L(i,"src");if("next"!==n&&"module"===L(i,"type")){let t=a?F.entry(a):F.inline(e());_(i,"import "+JSON.stringify(t)+";")}else if(a){if(void 0!==L(i,"nomodule"))continue;let e=await h(a,t,W);if(!e)continue;"next"===n?_(i,z(e)):r="data:text/javascript;base64,"+e.data.toString("base64")}i.attrs=i.attrs.filter(e=>["type","id","async","defer"].includes(e.name)||e.name.startsWith("data-")),r&&i.attrs.push({name:"src",value:r}),i.attrs.push({name:"nonce",value:p})}else if("link"===r){if("stylesheet"!==L(i,"rel"))continue;let e=await h(L(i,"href")??"",t,new Set([".css"]));if(!e)continue;i.tagName=i.nodeName="style",i.attrs=[],_(i,(await A(e.data.toString(),e.url)).replace(/<\/style/gi,"<\\/style"))}else if("style"===r)for(let e of i.childNodes)"value"in e&&(e.value=(await A(e.value,t)).replace(/<\/style/gi,"<\\/style"));else if("img"===r){let e=L(i,"src")??"";e.startsWith("/_next/image?")&&(e=new URL(e,t).searchParams.get("url")??""),i.attrs=i.attrs.filter(e=>"src"!==e.name&&"srcset"!==e.name),e&&(await k(e,t),i.attrs.push({name:"src",value:e}))}await e(i)}a.push(i)}r.childNodes=a}(P);let D=[],B=await F.compile();B&&D.push('<script type="importmap" nonce="'+p+'">'+JSON.stringify({imports:B})+"<\/script>");let J=U.size?await m(y(e,".next","static","chunks")):[],q=new Map;for(let e of J){let t=/^(\d+)[.-][\w.-]+\.js$/.exec(e);if(t){let r=t[1],a=q.get(r)??[];a.push("/_next/static/chunks/"+e),q.set(r,a)}}let C=()=>{for(let e of U)for(let t of q.get(e)??[])T.add(t);U.clear()};C();for(let e of T){if(I.has(e))continue;let r=await h(e,t,W);r&&D.push('<script nonce="'+p+'">'+z(r)+"<\/script>"),C()}for(let e of S)await k(e,t);let X="("+O.toString()+")("+JSON.stringify(N).replace(/</g,"\\u003c")+","+JSON.stringify(t.pathname).replace(/</g,"\\u003c")+");",G=Buffer.from(await s("live-canvas")).toString().replace(/<\/script/gi,"<\\/script");return{body:j(P).replace(/<head(?: [^>]*)?>/i,e=>e+'<meta name="popmelt-live-canvas" content="1"><script nonce="'+p+'">('+M.toString()+")();"+X+"\n"+G+"<\/script>"+D.join("")),policy:"sandbox allow-scripts; default-src 'none'; script-src 'nonce-"+p+"'"+(B?" data:":"")+(H.size?"; script-src-attr 'unsafe-hashes' "+[...H].join(" "):"")+"; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; form-action 'none'; base-uri 'none'; frame-ancestors 'self'"}}(e,n,await o.text(),A,r)};if("html"===A){let e=await r(o,A,o,void 0,{});try{return await _(o,e.origin,o)}finally{await e.close()}}let I=y(o,".popmelt");await p(I,{recursive:!0});let T,U=await u(y(I,"interact-"));try{let a=await(await n(o,U)).capture(),i=async e=>(await N("git",e,{cwd:o,env:{...process.env,GIT_INDEX_FILE:y(U,"index")}})).stdout.trim(),s=await i(["rev-parse","--show-toplevel"]),l=y(U,"checkout");await N("git",["init","--quiet","--template=",l]),await i(["read-tree",a]),await i(["-C",s,"checkout-index","--all","--prefix="+l+x]);let c=y(l,v(s,o)),{cli:p}=await t(o,A),u="next"===A?await e(S):{},f="nuxt"===A?["--input-type=module","-e","\nimport { loadNuxt, buildNuxt } from 'nuxt/kit';\nimport { createRequire } from 'node:module';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nconst require = createRequire(import.meta.url);\nconst routerPath = createRequire(require.resolve('nuxt/package.json')).resolve('vue-router');\nconst { createMemoryHistory, createRouter } = await import(routerPath);\nconst route = process.argv[1];\nconst options = resolve('.popmelt-router.mjs');\nawait writeFile(options, 'import { createMemoryHistory } from ' + JSON.stringify(routerPath) +\n ';export default { history: () => createMemoryHistory() };');\nconst nuxt = await loadNuxt({ cwd: process.cwd(), dev: false, overrides: {\n nitro: { preset: 'node-server' }, experimental: { appManifest: false, payloadExtraction: false },\n vite: { build: { modulePreload: false } },\n hooks: {\n 'pages:routerOptions'({files}) { files.push({path: options}); },\n 'pages:resolved'(pages) {\n if (!pages.length) return;\n const record = page => ({ path: page.path, alias: page.alias ?? [],\n component: {}, meta: { page }, children: (page.children || []).map(record) });\n const router = createRouter({ history: createMemoryHistory(), routes: pages.map(record) });\n const selected = new Set(router.resolve(route).matched.map(r => r.meta.page));\n const trim = list => {\n for (let i = list.length - 1; i >= 0; i--) {\n const page = list[i];\n if (!selected.has(page)) list.splice(i, 1);\n else if (page.children) trim(page.children);\n }\n };\n trim(pages);\n },\n },\n}});\ntry { await buildNuxt(nuxt); } finally { await nuxt.close(); }\n",k]:[p,"build",..."next"===A?[...P?[P]:[],"--experimental-build-mode","compile"]:[]];await N(process.execPath,f,{cwd:c,timeout:18e4,maxBuffer:8388608,env:{...u,PATH:process.env.PATH,HOME:process.env.HOME,TMPDIR:process.env.TMPDIR,SystemRoot:process.env.SystemRoot,CI:"1",NODE_ENV:"production",NEXT_TELEMETRY_DISABLED:"1",ASTRO_TELEMETRY_DISABLED:"1",NUXT_TELEMETRY_DISABLED:"1",POPMELT_PLANE_RENDERER:"1"}}),T=await r(c,A,s,void 0,u,!0);let m=y(c,"nuxt"===A?".output/public":"astro"===A?(await g(y(c,"dist/client")).catch(()=>{}))?.isDirectory()?"dist/client":"dist":"public");return await _(c,T.origin,m)}finally{try{await(T?.close())}finally{await h(U,{recursive:!0,force:!0,maxRetries:3})}}}function M(){Object.defineProperty(navigator,"locks",{value:void 0});let e=new Map;Object.defineProperty(document,"cookie",{get:()=>Array.from(e,([e,t])=>e+"="+t).join("; "),set:t=>{let[r,...a]=String(t).split(";"),i=r.indexOf("=");if(i<1)return;let n=r.slice(0,i).trim();a.some(e=>/^\s*max-age=0\s*$/i.test(e))?e.delete(n):e.set(n,r.slice(i+1))}});for(let e of["localStorage","sessionStorage"]){let t=new Map;Object.defineProperty(window,e,{value:{get length(){return t.size},key:e=>Array.from(t.keys())[e]??null,getItem:e=>t.get(String(e))??null,setItem:(e,r)=>{t.set(String(e),String(r))},removeItem:e=>{t.delete(String(e))},clear:()=>t.clear()}})}}function O(e,t){let r=new URL(t,location.href);function a(t){if(t&&!t.startsWith("data:"))try{let a=new URL(t,r);if(a.origin!==r.origin)return;if("/_next/image"===a.pathname&&(a=new URL(a.searchParams.get("url")??"",r)),a.origin===r.origin)return e[a.pathname]}catch{}}function i(e){if(e instanceof HTMLImageElement){let t=a(e.getAttribute("src")??"");t&&(e.removeAttribute("srcset"),e.src=t)}else if(e instanceof HTMLVideoElement){let t=a(e.getAttribute("poster")??"");t&&(e.poster=t)}}new MutationObserver(e=>{for(let t of e)if("attributes"===t.type)i(t.target);else for(let e of t.addedNodes)e instanceof Element&&(i(e),e.querySelectorAll("img,video[poster]").forEach(i))}).observe(document,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["src","poster","srcset"]})}function A(e,t,r,a){let i,n="";return async(s,o)=>{let l=o+"\n"+s;for(;i&&n!==l;){let e=i;await e.catch(()=>{}),i===e&&(i=void 0)}if(!i||n!==l){n=l;let o=k(e,t,s,r,a);i=o,o.catch(()=>{i===o&&(i=void 0)})}return i}}export{A as pageInteraction};
|
|
1
|
+
import{a as e,b as t,c as r}from"./chunk-CPFVBR6Q.mjs";import"./chunk-MPEVFQ43.mjs";import{a,b as i}from"./chunk-IWF42SDV.mjs";import{a as n}from"./chunk-4B6HUJCH.mjs";import{b as s}from"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-K22VZV3V.mjs";import"./chunk-YMWXWXPV.mjs";import"./chunk-UIADZXVT.mjs";import{execFile as o}from"child_process";import{createHash as l,randomBytes as c}from"crypto";import{mkdir as p,mkdtemp as u,readFile as f,readdir as m,realpath as d,rm as h,stat as g}from"fs/promises";import{extname as w,join as y,relative as v,resolve as b,sep as x}from"path";import{promisify as S}from"util";import{parse as E,serialize as j}from"parse5";var N=S(o),R=33554432,L=(e,t)=>e.attrs.find(e=>e.name===t)?.value;async function k(o,S,k,A,P){let _=async(e,t,r)=>{let n=new URL(k,t),o=await fetch(n,{redirect:"manual",headers:{Accept:"text/html"},signal:AbortSignal.timeout(15e3)});if(200!==o.status||!o.headers.get("content-type")?.includes("text/html"))throw await(o.body?.cancel()),Error("Page unavailable");return async function(e,t,r,n,o){let p=c(18).toString("base64"),u=Buffer.byteLength(r);if(u>R)throw Error("Shared page exceeds the preview size limit");async function h(r,a,s){let l=new URL(r,a);if(l.origin!==t.origin||l.username||l.password)return;let c=decodeURIComponent(l.pathname);if(c.split("/").some(e=>e.startsWith(".")||"node_modules"===e)||/[\\%?#]/.test(c)||i(c)||!s.has(w(c).toLowerCase()))return;let p="next"===n&&c.startsWith("/_next/static/"),m=p?y(e,".next","static"):o,h=b(m,"."+(p?c.slice(13):c));if(h.startsWith(m+x))try{if(await d(h)!==h)return;let e=await g(h);if(!e.isFile()||e.size>R-u)throw Error("Shared page exceeds the preview size limit");return u+=e.size,{data:await f(h),url:l}}catch(e){if("ENOENT"!==e.code)throw e}}let v=new Set(Object.keys(a).filter(e=>".css"!==e)),S=new Set,N=Object.create(null),k=async(e,r)=>{if(e.startsWith("data:"))return e;let i=new URL(e,r);if(i.origin===t.origin&&N[i.pathname])return N[i.pathname];let n=await h(e,r,v),s=n?"data:"+a[w(n.url.pathname).toLowerCase()]+";base64,"+n.data.toString("base64"):"";return s.startsWith("data:image/")&&(N[i.pathname]=s),s};async function A(e,t){let r=/url\(\s*(['"]?)([^)'"]+)\1\s*\)/gi,a=0,i="";for(let n of e.matchAll(r))n[2].startsWith("#")||(i+=e.slice(a,n.index)+"url("+JSON.stringify(await k(n[2].trim(),t))+")",a=n.index+n[0].length);return i+e.slice(a)}let P=E(r);function _(e,t){e.childNodes=[{nodeName:"#text",value:t,parentNode:e}]}let I=new Set,T=new Set,U=new Set,W=new Set([".js",".mjs"]);function H(e){I.add(e.url.pathname);let t=e.data.toString();for(let e of t.matchAll(/["'](\/(?:[A-Za-z0-9_.%~-]+\/)*[A-Za-z0-9_.%~-]+\.(?:png|jpe?g|gif|webp|avif|svg|ico))["']/gi))S.add(e[1]);for(let e of t.matchAll(/["'](?:\/_next\/)?(static\/chunks\/[\w./%-]+\.js)["']/g))T.add("/_next/"+e[1]);for(let e of t.matchAll(/\b[\w$]+\.e\((\d+)\)/g))U.add(e[1]);return('if(document.currentScript)document.currentScript.setAttribute("src",'+JSON.stringify(e.url.pathname).replace(/</g,"\\u003c")+");\n"+t).replace(/<\/script/gi,"<\\/script")}let z=function(e,t){let r="popmelt-module:/",a=new Map,i=new Map,n=new Map,s=new Map;function o(t,r){if(r&&"object"==typeof r)for(let[a,i]of Object.entries(r)){let r=/^(?:\.{0,2}\/|https?:)/.test(a)?new URL(a,e).href:a;t.has(r)||t.set(r,"string"==typeof i?new URL(i,e).href:null)}}function l(e,t){if(e.has(t))return e.get(t);let r=[...e.keys()].filter(e=>e.endsWith("/")&&t.startsWith(e)).sort((e,t)=>t.length-e.length)[0];if(r){let a=e.get(r);return a?.endsWith("/")?a+t.slice(r.length):null}}function c(t){let i=new URL(t,e).href,n=a.get(i)??"entry-"+a.size;return a.set(i,n),r+n+".js"}return{entry:c,importMap(t){let r=JSON.parse(t);o(n,r.imports);for(let[t,a]of Object.entries(r.scopes??{})){let r=new URL(t,e).href,i=s.get(r)??new Map;o(i,a),s.set(r,i)}},inline(t){let r=new URL(e);return r.hash="inline-"+i.size,i.set(r.href,t),c(r.href)},async compile(){if(!a.size)return;let o={name:"invited-page-modules",setup(r){r.onResolve({filter:/.*/},t=>{let r,a=t.importer||e.href,i=/^(?:\.{0,2}\/|https?:\/\/)/.test(t.path),o=i?new URL(t.path,a).href:t.path;if("entry-point"!==t.kind){for(let e of[...s.keys()].filter(e=>a===e||e.endsWith("/")&&a.startsWith(e)).sort((e,t)=>t.length-e.length))if(r=l(s.get(e),o),void 0!==r)break;void 0===r&&(r=l(n,o))}if(null===r||!i&&!r)return{external:!0};let c=new URL(r??o);return c.origin!==e.origin?{path:c.href,external:!0}:{path:c.href,namespace:"page"}}),r.onLoad({filter:/.*/,namespace:"page"},async({path:r})=>{let a=i.get(r)??(await t(r,e))?.data.toString();if(void 0===a)throw new Error("Invited page module unavailable");return{contents:a,loader:"js"}})}},{build:c}=await(import("esbuild")),p=await c({entryPoints:[...a].map(([e,t])=>({in:e,out:t})),bundle:!0,splitting:!0,format:"esm",platform:"browser",publicPath:r,write:!1,outdir:"/",logLevel:"silent",legalComments:"none",minify:!0,plugins:[o]});return Object.fromEntries(p.outputFiles.map(e=>[r+e.path.split(/[\\/]/).pop(),"data:text/javascript;base64,"+Buffer.from(e.contents).toString("base64")]))}}}(t,(e,t)=>h(e,t,W)),D=new Set;await async function e(r){let a=[];for(let i of r.childNodes){if("tagName"in i){let r=i.tagName;if(["base","iframe","frame","embed","object"].includes(r)||"meta"===r&&L(i,"http-equiv"))continue;if("html"===n)for(let e of i.attrs)/^on[a-z]+$/.test(e.name)&&D.add("'sha256-"+l("sha256").update(e.value).digest("base64")+"'");if("astro"===n&&"astro-island"===r)for(let e of i.attrs)["component-url","renderer-url","before-hydration-url"].includes(e.name)&&e.value&&(e.value=z.entry(e.value));if("script"===r){let e=()=>i.childNodes.map(e=>"value"in e?e.value:"").join("");if("next"!==n&&"importmap"===L(i,"type")){z.importMap(e());continue}let r,a=L(i,"src");if("next"!==n&&"module"===L(i,"type")){let t=a?z.entry(a):z.inline(e());_(i,"import "+JSON.stringify(t)+";")}else if(a){if(void 0!==L(i,"nomodule"))continue;let e=await h(a,t,W);if(!e)continue;"next"===n?_(i,H(e)):r="data:text/javascript;base64,"+e.data.toString("base64")}i.attrs=i.attrs.filter(e=>["type","id","async","defer"].includes(e.name)||e.name.startsWith("data-")),r&&i.attrs.push({name:"src",value:r}),i.attrs.push({name:"nonce",value:p})}else if("link"===r){if("stylesheet"!==L(i,"rel"))continue;let e=await h(L(i,"href")??"",t,new Set([".css"]));if(!e)continue;i.tagName=i.nodeName="style",i.attrs=[],_(i,(await A(e.data.toString(),e.url)).replace(/<\/style/gi,"<\\/style"))}else if("style"===r)for(let e of i.childNodes)"value"in e&&(e.value=(await A(e.value,t)).replace(/<\/style/gi,"<\\/style"));else if("img"===r){let e=L(i,"src")??"";e.startsWith("/_next/image?")&&(e=new URL(e,t).searchParams.get("url")??""),i.attrs=i.attrs.filter(e=>"src"!==e.name&&"srcset"!==e.name),e&&(await k(e,t),i.attrs.push({name:"src",value:e}))}await e(i)}a.push(i)}r.childNodes=a}(P);let F=[],B=await z.compile();B&&F.push('<script type="importmap" nonce="'+p+'">'+JSON.stringify({imports:B})+"<\/script>");let J=U.size?await m(y(e,".next","static","chunks")):[],V=new Map;for(let e of J){let t=/^(\d+)[.-][\w.-]+\.js$/.exec(e);if(t){let r=t[1],a=V.get(r)??[];a.push("/_next/static/chunks/"+e),V.set(r,a)}}let C=()=>{for(let e of U)for(let t of V.get(e)??[])T.add(t);U.clear()};C();for(let e of T){if(I.has(e))continue;let r=await h(e,t,W);r&&F.push('<script nonce="'+p+'">'+H(r)+"<\/script>"),C()}for(let e of S)await k(e,t);let q="("+O.toString()+")("+JSON.stringify(N).replace(/</g,"\\u003c")+","+JSON.stringify(t.pathname).replace(/</g,"\\u003c")+");",X=Buffer.from(await s("live-canvas")).toString().replace(/<\/script/gi,"<\\/script");return{body:j(P).replace(/<head(?: [^>]*)?>/i,e=>e+'<meta name="popmelt-live-canvas" content="1"><script nonce="'+p+'">('+M.toString()+")();"+q+"\n"+X+"<\/script>"+F.join("")),policy:"sandbox allow-scripts; default-src 'none'; script-src 'nonce-"+p+"'"+(B?" data:":"")+(D.size?"; script-src-attr 'unsafe-hashes' "+[...D].join(" "):"")+"; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; form-action 'none'; base-uri 'none'; frame-ancestors 'self'"}}(e,n,await o.text(),A,r)};if("html"===A){let e=await r(o,A,o,void 0,{});try{return await _(o,e.origin,o)}finally{await e.close()}}let I=y(o,".popmelt");await p(I,{recursive:!0});let T,U=await u(y(I,"interact-"));try{let a=await(await n(o,U)).capture(),i=async e=>(await N("git",e,{cwd:o,env:{...process.env,GIT_INDEX_FILE:y(U,"index")}})).stdout.trim(),s=await i(["rev-parse","--show-toplevel"]),l=y(U,"checkout");await N("git",["init","--quiet","--template=",l]),await i(["read-tree",a]),await i(["-C",s,"checkout-index","--all","--prefix="+l+x]);let c=y(l,v(s,o)),{cli:p}=await t(o,A),u="next"===A?await e(S):{},f="nuxt"===A?["--input-type=module","-e","\nimport { loadNuxt, buildNuxt } from 'nuxt/kit';\nimport { createRequire } from 'node:module';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nconst require = createRequire(import.meta.url);\nconst routerPath = createRequire(require.resolve('nuxt/package.json')).resolve('vue-router');\nconst { createMemoryHistory, createRouter } = await import(routerPath);\nconst route = process.argv[1];\nconst options = resolve('.popmelt-router.mjs');\nawait writeFile(options, 'import { createMemoryHistory } from ' + JSON.stringify(routerPath) +\n ';export default { history: () => createMemoryHistory() };');\nconst nuxt = await loadNuxt({ cwd: process.cwd(), dev: false, overrides: {\n nitro: { preset: 'node-server' }, experimental: { appManifest: false, payloadExtraction: false },\n vite: { build: { modulePreload: false } },\n hooks: {\n 'pages:routerOptions'({files}) { files.push({path: options}); },\n 'pages:resolved'(pages) {\n if (!pages.length) return;\n const record = page => ({ path: page.path, alias: page.alias ?? [],\n component: {}, meta: { page }, children: (page.children || []).map(record) });\n const router = createRouter({ history: createMemoryHistory(), routes: pages.map(record) });\n const selected = new Set(router.resolve(route).matched.map(r => r.meta.page));\n const trim = list => {\n for (let i = list.length - 1; i >= 0; i--) {\n const page = list[i];\n if (!selected.has(page)) list.splice(i, 1);\n else if (page.children) trim(page.children);\n }\n };\n trim(pages);\n },\n },\n}});\ntry { await buildNuxt(nuxt); } finally { await nuxt.close(); }\n",k]:[p,"build",..."next"===A?[...P?[P]:[],"--experimental-build-mode","compile"]:[]];await N(process.execPath,f,{cwd:c,timeout:18e4,maxBuffer:8388608,env:{...u,PATH:process.env.PATH,HOME:process.env.HOME,TMPDIR:process.env.TMPDIR,SystemRoot:process.env.SystemRoot,CI:"1",NODE_ENV:"production",NEXT_TELEMETRY_DISABLED:"1",ASTRO_TELEMETRY_DISABLED:"1",NUXT_TELEMETRY_DISABLED:"1",POPMELT_PLANE_RENDERER:"1"}}),T=await r(c,A,s,void 0,u,!0);let m=y(c,"nuxt"===A?".output/public":"astro"===A?(await g(y(c,"dist/client")).catch(()=>{}))?.isDirectory()?"dist/client":"dist":"public");return await _(c,T.origin,m)}finally{try{await(T?.close())}finally{await h(U,{recursive:!0,force:!0,maxRetries:3})}}}function M(){Object.defineProperty(navigator,"locks",{value:void 0});let e=new Map;Object.defineProperty(document,"cookie",{get:()=>Array.from(e,([e,t])=>e+"="+t).join("; "),set:t=>{let[r,...a]=String(t).split(";"),i=r.indexOf("=");if(i<1)return;let n=r.slice(0,i).trim();a.some(e=>/^\s*max-age=0\s*$/i.test(e))?e.delete(n):e.set(n,r.slice(i+1))}});for(let e of["localStorage","sessionStorage"]){let t=new Map;Object.defineProperty(window,e,{value:{get length(){return t.size},key:e=>Array.from(t.keys())[e]??null,getItem:e=>t.get(String(e))??null,setItem:(e,r)=>{t.set(String(e),String(r))},removeItem:e=>{t.delete(String(e))},clear:()=>t.clear()}})}}function O(e,t){let r=new URL(t,location.href);function a(t){if(t&&!t.startsWith("data:"))try{let a=new URL(t,r);if(a.origin!==r.origin)return;if("/_next/image"===a.pathname&&(a=new URL(a.searchParams.get("url")??"",r)),a.origin===r.origin)return e[a.pathname]}catch{}}function i(e){if(e instanceof HTMLImageElement){let t=a(e.getAttribute("src")??"");t&&(e.removeAttribute("srcset"),e.src=t)}else if(e instanceof HTMLVideoElement){let t=a(e.getAttribute("poster")??"");t&&(e.poster=t)}}new MutationObserver(e=>{for(let t of e)if("attributes"===t.type)i(t.target);else for(let e of t.addedNodes)e instanceof Element&&(i(e),e.querySelectorAll("img,video[poster]").forEach(i))}).observe(document,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["src","poster","srcset"]})}function A(e,t,r,a){let i,n="";return async(s,o)=>{let l=o+"\n"+s;for(;i&&n!==l;){let e=i;await e.catch(()=>{}),i===e&&(i=void 0)}if(!i||n!==l){n=l;let o=k(e,t,s,r,a);i=o,o.catch(()=>{i===o&&(i=void 0)})}return i}}export{A as pageInteraction};
|
|
@@ -478,6 +478,7 @@ type PeerIdentity = {
|
|
|
478
478
|
kind: 'human' | 'assistant';
|
|
479
479
|
relationship: 'host' | 'guest';
|
|
480
480
|
};
|
|
481
|
+
type PeerPermission = 'direct' | 'approval-required' | 'blocked';
|
|
481
482
|
|
|
482
483
|
/** Local preview protocol. Peers never supply reducer actions or host authority. */
|
|
483
484
|
type PeerAction = {
|
|
@@ -603,11 +604,245 @@ type ParticipantDraft = {
|
|
|
603
604
|
state: AnnotationState | null;
|
|
604
605
|
history?: PlaneHistory;
|
|
605
606
|
};
|
|
607
|
+
/** Host-owned execution target, shared through membership rather than drafts. */
|
|
608
|
+
type HostModelSelection = {
|
|
609
|
+
provider: string;
|
|
610
|
+
model: string;
|
|
611
|
+
label: string;
|
|
612
|
+
};
|
|
613
|
+
type ProjectVisibility = 'public' | 'private';
|
|
614
|
+
type PeerParticipant = {
|
|
615
|
+
/** Display name of the shared project, carried on the host in a room snapshot. */
|
|
616
|
+
projectName?: string;
|
|
617
|
+
projectVisibility?: ProjectVisibility;
|
|
618
|
+
/** Only the host's own snapshot includes the number of guests with live sessions. */
|
|
619
|
+
connectedGuestCount?: number;
|
|
620
|
+
modelSelection?: HostModelSelection;
|
|
621
|
+
identity: PeerIdentity;
|
|
622
|
+
/** Project-persistent identity color, assigned by the bridge. */
|
|
623
|
+
color?: string;
|
|
624
|
+
shape?: PeerShape;
|
|
625
|
+
planeId: string;
|
|
626
|
+
permission: PeerPermission;
|
|
627
|
+
permissionEpoch: number;
|
|
628
|
+
/** Host removal is terminal for this membership, unlike a temporary block. */
|
|
629
|
+
revokedAt?: number;
|
|
630
|
+
draftRevision: number;
|
|
631
|
+
/** Thread-linked pins omitted from this participant's shared canvas. */
|
|
632
|
+
hiddenAnnotationThreadIds?: string[];
|
|
633
|
+
/** Latest recorded plane event; absent when no dated activity is known. */
|
|
634
|
+
lastActivityAt?: number;
|
|
635
|
+
};
|
|
606
636
|
/** A capability for a person/agent. Keep out of URLs, logs, and peer snapshots. */
|
|
607
637
|
type ParticipantCredential = {
|
|
608
638
|
participantId: string;
|
|
609
639
|
token: string;
|
|
610
640
|
};
|
|
641
|
+
/** Short-lived authority for one view; multiple views may share a plane. */
|
|
642
|
+
type ParticipantRuntime = {
|
|
643
|
+
participantId: string;
|
|
644
|
+
runtimeId: string;
|
|
645
|
+
token: string;
|
|
646
|
+
expiresAt: number;
|
|
647
|
+
};
|
|
648
|
+
/** Read-only reference material; this is deliberately NOT execution permission. */
|
|
649
|
+
type PeerChangeReference = {
|
|
650
|
+
/** Current editable basis, returned only on the host's own startup read. */
|
|
651
|
+
ownWorkspace?: {
|
|
652
|
+
revision: string;
|
|
653
|
+
basePath?: string;
|
|
654
|
+
};
|
|
655
|
+
/** Trusted local dev-server route, supplied only to an authorized plane viewer. */
|
|
656
|
+
application?: {
|
|
657
|
+
interactivePage?: boolean;
|
|
658
|
+
basePath: string;
|
|
659
|
+
path: string;
|
|
660
|
+
version: string;
|
|
661
|
+
basis?: string;
|
|
662
|
+
};
|
|
663
|
+
version: 1;
|
|
664
|
+
author: PeerIdentity;
|
|
665
|
+
planeId: string;
|
|
666
|
+
draft: ParticipantDraft;
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
/** A request capability can inspect only its own admission, never a plane. */
|
|
670
|
+
interface AdmissionReceipt {
|
|
671
|
+
id: string;
|
|
672
|
+
token: string;
|
|
673
|
+
}
|
|
674
|
+
interface AdmissionRequest {
|
|
675
|
+
id: string;
|
|
676
|
+
name: string;
|
|
677
|
+
/** Reserved peer identity color, retained when the host admits this request. */
|
|
678
|
+
color?: string;
|
|
679
|
+
shape?: PeerShape;
|
|
680
|
+
createdAt: number;
|
|
681
|
+
expiresAt: number;
|
|
682
|
+
status: 'pending' | 'granted' | 'declined' | 'cancelled' | 'expired';
|
|
683
|
+
}
|
|
684
|
+
interface AdmissionStatus extends AdmissionRequest {
|
|
685
|
+
credential?: ParticipantCredential;
|
|
686
|
+
participant?: PeerParticipant;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Opt-in session kernel. No browser launching, rendering, app-state sync, or
|
|
691
|
+
* code execution lives here. A trusted bridge owns ONE instance per project.
|
|
692
|
+
* The current PeerRoom remains the legacy transport until explicitly migrated.
|
|
693
|
+
*/
|
|
694
|
+
declare class PeerSessions {
|
|
695
|
+
private readonly sourceId;
|
|
696
|
+
private readonly now;
|
|
697
|
+
private readonly pinDraftSource;
|
|
698
|
+
private readonly hostBasis?;
|
|
699
|
+
private saved;
|
|
700
|
+
private invites;
|
|
701
|
+
private runtimes;
|
|
702
|
+
private hostColors;
|
|
703
|
+
private tail;
|
|
704
|
+
private ready;
|
|
705
|
+
private closed;
|
|
706
|
+
private projectName;
|
|
707
|
+
private readonly directory;
|
|
708
|
+
private readonly file;
|
|
709
|
+
constructor(projectRoot: string, sourceId: string, now?: () => number, pinDraftSource?: boolean, hostBasis?: ((owner: string) => Promise<string>) | undefined);
|
|
710
|
+
private load;
|
|
711
|
+
private serial;
|
|
712
|
+
private commit;
|
|
713
|
+
private requirePublic;
|
|
714
|
+
private member;
|
|
715
|
+
private host;
|
|
716
|
+
private writableRuntime;
|
|
717
|
+
private occupiedColorSlots;
|
|
718
|
+
private newMember;
|
|
719
|
+
/** Trusted bootstrap ONLY. Never expose as an unauthenticated browser route. */
|
|
720
|
+
createHost(name: string): Promise<{
|
|
721
|
+
credential: {
|
|
722
|
+
participantId: `${string}-${string}-${string}-${string}-${string}`;
|
|
723
|
+
token: string;
|
|
724
|
+
};
|
|
725
|
+
participant: PeerParticipant;
|
|
726
|
+
}>;
|
|
727
|
+
/** Trusted local bootstrap recovery, never exposed over HTTP. */
|
|
728
|
+
recoverHost(): Promise<{
|
|
729
|
+
participantId: string;
|
|
730
|
+
token: string;
|
|
731
|
+
}>;
|
|
732
|
+
authenticate(credential: ParticipantCredential, membershipOnly?: boolean): Promise<PeerParticipant>;
|
|
733
|
+
/** Only for an already-authenticated response at its synchronous delivery boundary. */
|
|
734
|
+
canReadNow(credential: ParticipantCredential): boolean;
|
|
735
|
+
/** Trusted executor check. An approval is issued by the host transport, not the caller. */
|
|
736
|
+
checkExecution(participantId: string, epoch: number, approvedBy?: string, approverEpoch?: number): Promise<PeerParticipant>;
|
|
737
|
+
invite(credential: ParticipantCredential, sharedPath?: string): Promise<{
|
|
738
|
+
token: string;
|
|
739
|
+
expiresAt: number;
|
|
740
|
+
}>;
|
|
741
|
+
private availableInvite;
|
|
742
|
+
private inviteAppearance;
|
|
743
|
+
/** Only the guest gateway can exchange an HttpOnly device cookie for an upstream proof. */
|
|
744
|
+
visitGuestInvite(invitation: string, deviceKey: string, name?: string): Promise<{
|
|
745
|
+
credential: {
|
|
746
|
+
participantId: string;
|
|
747
|
+
token: string;
|
|
748
|
+
};
|
|
749
|
+
sharedPath: string;
|
|
750
|
+
appearance?: undefined;
|
|
751
|
+
} | {
|
|
752
|
+
appearance: {
|
|
753
|
+
projectName: string;
|
|
754
|
+
color: string;
|
|
755
|
+
shape: "circle" | "square" | "diamond" | "hexagon";
|
|
756
|
+
};
|
|
757
|
+
credential?: undefined;
|
|
758
|
+
sharedPath?: undefined;
|
|
759
|
+
}>;
|
|
760
|
+
guestInviteAppearance(invitation: string): Promise<{
|
|
761
|
+
projectName: string;
|
|
762
|
+
color: string;
|
|
763
|
+
shape: "circle" | "square" | "diamond" | "hexagon";
|
|
764
|
+
}>;
|
|
765
|
+
revokeInvite(credential: ParticipantCredential, token: string): Promise<void>;
|
|
766
|
+
join(invitation: string, name: string, kind: PeerIdentity['kind'], colorIdentity?: AdmissionReceipt, initialPermission?: 'direct' | 'approval-required'): Promise<{
|
|
767
|
+
sharedPath?: string | undefined;
|
|
768
|
+
credential: {
|
|
769
|
+
participantId: `${string}-${string}-${string}-${string}-${string}`;
|
|
770
|
+
token: string;
|
|
771
|
+
};
|
|
772
|
+
participant: PeerParticipant;
|
|
773
|
+
}>;
|
|
774
|
+
/** Browser entry only: an unavailable invite becomes an ordinary host request. */
|
|
775
|
+
joinOrRequestAdmission(invitation: string, name: string, colorIdentity: AdmissionReceipt): Promise<{
|
|
776
|
+
joined: {
|
|
777
|
+
sharedPath?: string | undefined;
|
|
778
|
+
credential: {
|
|
779
|
+
participantId: `${string}-${string}-${string}-${string}-${string}`;
|
|
780
|
+
token: string;
|
|
781
|
+
};
|
|
782
|
+
participant: PeerParticipant;
|
|
783
|
+
};
|
|
784
|
+
admission?: undefined;
|
|
785
|
+
} | {
|
|
786
|
+
admission: AdmissionRequest;
|
|
787
|
+
joined?: undefined;
|
|
788
|
+
}>;
|
|
789
|
+
snapshot(credential: ParticipantCredential, threadIsVisible?: (id: string) => boolean): Promise<PeerParticipant[]>;
|
|
790
|
+
isHost(id: string): Promise<boolean>;
|
|
791
|
+
setProjectVisibility(credential: ParticipantCredential, visibility: unknown): Promise<PeerParticipant[]>;
|
|
792
|
+
setHostModelSelection(credential: ParticipantCredential, value: unknown): Promise<{
|
|
793
|
+
provider: string;
|
|
794
|
+
model: string;
|
|
795
|
+
label: string;
|
|
796
|
+
}>;
|
|
797
|
+
/** Called only after the transport has authenticated the execution's author. */
|
|
798
|
+
inheritedModelSelection(participantId: string): Promise<HostModelSelection | null>;
|
|
799
|
+
private admission;
|
|
800
|
+
private admissionView;
|
|
801
|
+
/** A durable color-only capability: no request, membership, or plane access. */
|
|
802
|
+
reserveAdmissionColor(receipt: AdmissionReceipt): Promise<{
|
|
803
|
+
color: string;
|
|
804
|
+
shape: PeerShape;
|
|
805
|
+
}>;
|
|
806
|
+
private validateAdmissionReceipt;
|
|
807
|
+
requestAdmission(receipt: AdmissionReceipt, name: string, colorIdentity?: AdmissionReceipt): Promise<AdmissionRequest>;
|
|
808
|
+
admissionStatus(receipt: AdmissionReceipt): Promise<AdmissionStatus>;
|
|
809
|
+
cancelAdmission(receipt: AdmissionReceipt): Promise<AdmissionRequest>;
|
|
810
|
+
listAdmissions(credential: ParticipantCredential): Promise<AdmissionRequest[]>;
|
|
811
|
+
decideAdmission(credential: ParticipantCredential, id: string, decision: 'grant' | 'decline'): Promise<AdmissionRequest>;
|
|
812
|
+
planeAppBasis(credential: ParticipantCredential, id: string): Promise<{
|
|
813
|
+
id: string;
|
|
814
|
+
revision: string | undefined;
|
|
815
|
+
}>;
|
|
816
|
+
hasSharedAnnotation(credential: ParticipantCredential, ownerId: string | undefined, threadId: string, annotationIds: ReadonlySet<string>): Promise<boolean>;
|
|
817
|
+
readPlane(credential: ParticipantCredential, participantId: string, historyVersion?: number): Promise<PeerChangeReference>;
|
|
818
|
+
rename(credential: ParticipantCredential, name: string): Promise<PeerParticipant>;
|
|
819
|
+
setPermission(credential: ParticipantCredential, participantId: string, permission: PeerPermission): Promise<PeerParticipant>;
|
|
820
|
+
isRevokedNow(participantId: string): boolean;
|
|
821
|
+
/** Terminal membership removal preserves identity but no recoverable draft. */
|
|
822
|
+
revokeAccess(credential: ParticipantCredential, participantId: string): Promise<PeerParticipant>;
|
|
823
|
+
/** Reuse an active lease only with its capability, never just a browser ID. */
|
|
824
|
+
connect(credential: ParticipantCredential, runtimeId: string, previousToken?: string): Promise<ParticipantRuntime>;
|
|
825
|
+
renew(runtime: ParticipantRuntime, activeColor?: unknown): Promise<ParticipantRuntime>;
|
|
826
|
+
checkRuntime(runtime: ParticipantRuntime): Promise<void>;
|
|
827
|
+
/** Author deletion and host moderation are outside the editable event stream. */
|
|
828
|
+
moderateAnnotations(credential: ParticipantCredential, participantId: string, ids: string[], restore?: boolean): Promise<{
|
|
829
|
+
annotationIds: string[];
|
|
830
|
+
threadIds: string[];
|
|
831
|
+
}>;
|
|
832
|
+
/** Host moderation is metadata, never a guest-editable history event. */
|
|
833
|
+
moderateStyles(credential: ParticipantCredential, participantId: string, modifications: StyleSuggestionReceipt[], restore?: boolean): Promise<{
|
|
834
|
+
styleModifications: StyleSuggestionReceipt[];
|
|
835
|
+
}>;
|
|
836
|
+
annotationsDeleted(participantId: string, ids: string[], styles?: StyleSuggestionReceipt[]): Promise<boolean>;
|
|
837
|
+
disconnect(runtime: ParticipantRuntime): Promise<void>;
|
|
838
|
+
private checkDraftBasis;
|
|
839
|
+
publish(runtime: ParticipantRuntime, expectedRevision: number, source: PeerSourceReference, state: AnnotationState): Promise<ParticipantDraft>;
|
|
840
|
+
/** Only the caller's own draft is mergeable; this never submits implementation work. */
|
|
841
|
+
merge(runtime: ParticipantRuntime, expectedRevision: number, source: PeerSourceReference, input: PlaneEvent[], historyVersion?: number): Promise<ParticipantDraft>;
|
|
842
|
+
/** Recheck at execution, not only at queue time. Does not itself grant Send. */
|
|
843
|
+
checkPermission(credential: ParticipantCredential, expectedEpoch: number): Promise<PeerParticipant>;
|
|
844
|
+
close(): Promise<void>;
|
|
845
|
+
}
|
|
611
846
|
|
|
612
847
|
/** For a host that owns turn scheduling. Each note must start a distinct turn. */
|
|
613
848
|
type CanvasNoteTurn = {
|
|
@@ -737,6 +972,8 @@ type PopmeltOptions = {
|
|
|
737
972
|
};
|
|
738
973
|
/** Participant storage and optional app-specific guest transports. */
|
|
739
974
|
participantSessions?: {
|
|
975
|
+
/** Actual origin reported by the dev server after binding its port. */
|
|
976
|
+
appOrigin?: () => string;
|
|
740
977
|
/** Same-origin recovery endpoint for built-in development adapters. */
|
|
741
978
|
hostEntry?: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
742
979
|
planeEntry?: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
@@ -758,7 +995,9 @@ type PopmeltHandle = {
|
|
|
758
995
|
port: number;
|
|
759
996
|
projectId: string;
|
|
760
997
|
storeId?: string;
|
|
998
|
+
visitGuestInvite?: PeerSessions['visitGuestInvite'];
|
|
761
999
|
guestInviteAppearance?: (invitation: string) => Promise<{
|
|
1000
|
+
projectName?: string;
|
|
762
1001
|
color: string;
|
|
763
1002
|
shape: PeerShape;
|
|
764
1003
|
}>;
|
|
@@ -814,4 +1053,4 @@ declare function startParticipantLan(bridge: PopmeltHandle, planes: ParticipantP
|
|
|
814
1053
|
type PageFramework = 'next' | 'astro' | 'nuxt' | 'html';
|
|
815
1054
|
type NextBundlerFlag = '--turbo' | '--turbopack' | '--webpack';
|
|
816
1055
|
|
|
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
|
|
1056
|
+
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 };
|
|
@@ -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-FD6IIFJC.mjs";import"./chunk-UFUH63SR.mjs";import"./chunk-QDFQPABM.mjs";import"./chunk-CPFVBR6Q.mjs";import"./chunk-MPEVFQ43.mjs";import"./chunk-IWF42SDV.mjs";import"./chunk-RALP6ENI.mjs";import"./chunk-PYGRFSUU.mjs";import"./chunk-6EO73WJN.mjs";import"./chunk-NC7YXD7Q.mjs";import"./chunk-KOHR4LAQ.mjs";import"./chunk-LLVF422C.mjs";import"./chunk-4B6HUJCH.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};
|
package/dist/plugin-astro.d.mts
CHANGED
|
@@ -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-
|
|
6
|
+
import './page-planes-9GVbnVZa.mjs';
|
|
7
7
|
|
|
8
8
|
type PopmeltAstroOptions = PopmeltPluginOptions & {
|
|
9
9
|
/** Set false when an existing provider mounts the UI. */
|
package/dist/plugin-astro.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t}from"./chunk-
|
|
1
|
+
import{b as t}from"./chunk-W5JUAOLA.mjs";import"./chunk-LUTP7QBD.mjs";import"./chunk-LLVF422C.mjs";import"./chunk-4B6HUJCH.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-CZJILD7T.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};
|
package/dist/plugin-nuxt.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,c as t}from"./chunk-
|
|
1
|
+
import{b as e,c as t}from"./chunk-CZJILD7T.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};
|
package/dist/plugin-vite.d.mts
CHANGED
|
@@ -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-
|
|
4
|
+
import { s as startParticipantLan, P as PopmeltHandle, c as createParticipantPlaneApps } from './page-planes-9GVbnVZa.mjs';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import './participantBootstrap-BuTrTQbo.mjs';
|
|
7
7
|
|
package/dist/plugin-vite.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m,b as p}from"./chunk-
|
|
1
|
+
import{a as m,b as p}from"./chunk-W5JUAOLA.mjs";import"./chunk-LUTP7QBD.mjs";import"./chunk-LLVF422C.mjs";import"./chunk-4B6HUJCH.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-CZJILD7T.mjs";import"./chunk-NOHXTT24.mjs";export{m as participantPlanes,p as popmelt};
|