@popmelt.com/core 0.27.1 → 0.28.1

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 (55) hide show
  1. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  2. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  3. package/dist/ParticipantRuntime-JUOBT3CY.mjs +139 -0
  4. package/dist/PopmeltTasteConnectedPane-JO4QR6ZT.mjs +221 -0
  5. package/dist/PreviewRuntime-JAZLAGQE.mjs +2 -0
  6. package/dist/bridge-entry.mjs +2 -229
  7. package/dist/browser-runtime-6KNOQXAJ.mjs +2 -0
  8. package/dist/browser.mjs +1 -1
  9. package/dist/chunk-35UEAIRA.mjs +289 -0
  10. package/dist/chunk-3LBOX7HQ.mjs +3 -0
  11. package/dist/chunk-3NTTM74X.mjs +1 -0
  12. package/dist/chunk-3THBMCJW.mjs +369 -0
  13. package/dist/chunk-A2UXK7AS.mjs +77 -0
  14. package/dist/chunk-GL4I4MI6.mjs +3 -0
  15. package/dist/chunk-HGW2U6PD.mjs +2 -0
  16. package/dist/chunk-JQHZFDY5.mjs +2 -0
  17. package/dist/chunk-LVEMYZOA.mjs +2 -0
  18. package/dist/chunk-MP7S5ALD.mjs +2 -0
  19. package/dist/chunk-O4HZP3RP.mjs +2 -0
  20. package/dist/chunk-QUNV5PNI.mjs +2 -0
  21. package/dist/chunk-QXVMGZFP.mjs +1 -0
  22. package/dist/chunk-SWTSMLHA.mjs +2 -0
  23. package/dist/{chunk-CLDWTCKX.mjs → chunk-VRFM3TLR.mjs} +1 -1
  24. package/dist/chunk-W4VRK56P.mjs +347 -0
  25. package/dist/chunk-XOGBFVWI.mjs +2 -0
  26. package/dist/chunk-XTOCFTVW.mjs +2 -0
  27. package/dist/cli.mjs +169 -106
  28. package/dist/focus-inspection-2FPCQIN2.mjs +2 -0
  29. package/dist/index-CHp2bgs1.d.mts +565 -0
  30. package/dist/index.mjs +1 -1
  31. package/dist/memory-legacy.d.mts +1 -489
  32. package/dist/memory-legacy.mjs +1 -1
  33. package/dist/memory-store.d.mts +2 -660
  34. package/dist/memory-store.mjs +1 -3
  35. package/dist/plugin-astro.mjs +1 -1
  36. package/dist/plugin-nuxt.mjs +1 -1
  37. package/dist/plugin-vite.mjs +1 -1
  38. package/dist/server.d.mts +3 -291
  39. package/dist/server.mjs +7 -234
  40. package/dist/taste-proposal-session-XU4N7RUV.mjs +2 -0
  41. package/dist/types-Bur49CLH.d.mts +349 -0
  42. package/dist/workspace-snapshot-EJQHHDQ4.mjs +2 -0
  43. package/package.json +1 -1
  44. package/dist/ParticipantRuntime-TWGYNKIS.mjs +0 -139
  45. package/dist/PopmeltTasteConnectedPane-WDF556E2.mjs +0 -81
  46. package/dist/PreviewRuntime-KGLZJGUN.mjs +0 -2
  47. package/dist/browser-runtime-PFJI3VEQ.mjs +0 -2
  48. package/dist/chunk-3PVLCKSV.mjs +0 -370
  49. package/dist/chunk-7MGWRICI.mjs +0 -77
  50. package/dist/chunk-7YCLSSQA.mjs +0 -2
  51. package/dist/chunk-D7HY2EDH.mjs +0 -2
  52. package/dist/chunk-TSY2K45H.mjs +0 -2
  53. package/dist/chunk-YC7B37F6.mjs +0 -1
  54. package/dist/chunk-YMCTJKYN.mjs +0 -345
  55. package/dist/server-J5NV3BMT.mjs +0 -241
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as S,d as T,f as B,e as F}from"./chunk-3LBOX7HQ.mjs";import{i as H}from"./chunk-XOGBFVWI.mjs";import{d as P}from"./chunk-HGW2U6PD.mjs";async function M(s){return new Promise((e,b)=>{let a=new FileReader;a.onload=()=>e(String(a.result).split(",")[1]),a.onerror=b,a.readAsDataURL(s)})}async function Y(s,e,b,a){let x=Date.now(),C=location.href,r=e.subject?await a.registry.captureFeedback(e.subject):null;if(e.subject&&!r)return{status:"target_unavailable"};let c=r?.elementInfo??H(s),p=t=>{try{let l=document.querySelectorAll(t);return l.length===1&&l[0]===s}catch{return!1}},h=t=>!t.pathname||t.pathname===location.pathname,u=a.state?.annotations.filter(t=>h(t)&&t.interactionEpisode&&(e.subject?t.target?.adapter===e.subject.adapter&&t.target?.key===e.subject.key:!!t.linkedSelector&&p(t.linkedSelector)))??[],i=P(s),w={id:e.key,type:"text",text:"",color:"#0099ff",strokeWidth:2,points:[{x:i.left+window.scrollX,y:i.top+window.scrollY}],timestamp:x,pathname:location.pathname,elements:[c],linkedSelector:c.selector,...e.subject?{target:e.subject}:{},...u.length===1?{interactionEpisode:u[0].interactionEpisode}:{}},E=a.getCommentMeta?S(await a.getCommentMeta({kind:"annotation",purpose:"inspection",timestamp:x,url:location.href,pathname:location.pathname,annotations:[w]})):void 0,I=T([w],a.state?.styleModifications.filter(t=>h(t)&&p(t.selector))??[],c,void 0,a.state?.textModifications.filter(t=>h(t)&&p(t.selector))??[],a.state?.domModifications.filter(t=>h(t)&&p(t.selector))??[],E),g=[];if(b){let[t]=await B(document.body,null,[],{...a.screenshotOptions,viewportOnly:!0,dpr:1});if(t){let l=await createImageBitmap(t);try{let n=document.createElement("canvas");n.width=l.width,n.height=l.height;let m=n.getContext("2d");m.drawImage(l,0,0);let f={...w,text:`Focus: ${c.textContent||c.subjectLabel||c.tagName}`.slice(0,100),points:[{x:Math.max(4,i.left),y:window.scrollY+Math.max(24,i.top-8)}]};F(m,[f],window.scrollY,1,new Map([[w.id,{x:i.left,y:i.top+window.scrollY,width:i.width,height:i.height}]]));let o=await new Promise(d=>n.toBlob(d,"image/png"));o&&g.push({kind:"annotated-viewport",mimeType:o.type,data:await M(o)})}finally{l.close()}if(!r?.crop){let n=await createImageBitmap(t);try{let m=Math.max(0,i.left),f=Math.max(0,i.top),o=Math.min(window.innerWidth,i.right)-m,d=Math.min(window.innerHeight,i.bottom)-f;if(o>0&&d>0){let y=document.createElement("canvas");y.width=Math.ceil(o),y.height=Math.ceil(d);let j=n.width/window.innerWidth,v=n.height/window.innerHeight;y.getContext("2d").drawImage(n,m*j,f*v,o*j,d*v,0,0,o,d);let k=await new Promise(A=>y.toBlob(A,"image/png"));k&&g.push({kind:"element",mimeType:k.type,data:await M(k)})}}finally{n.close()}}}r?.crop&&g.push({kind:"subject",mimeType:r.crop.type,data:await M(r.crop)})}return!s.isConnected||location.href!==C?{status:"target_unavailable"}:{status:"ok",targetKey:e.key,focusCapturedAt:e.capturedAt,capturedAt:x,feedback:I,images:g,warning:r?.warning,evidenceTime:"Live inspection of the referenced target, not a historical screenshot of the utterance.",actionHistory:u.length===1?"Existing recorded episode; inspection did not submit or modify it.":u.length>1?"Multiple matching episodes; none selected automatically.":"No unambiguous recorded episode for this target."}}export{Y as inspectFocusElement};
@@ -0,0 +1,565 @@
1
+ declare const MEMORY_FORMAT_VERSION: 1;
2
+ declare const MEMORY_SCHEMA_VERSION: 1;
3
+ type MemoryFormatVersion = typeof MEMORY_FORMAT_VERSION;
4
+ type MemorySchemaVersion = typeof MEMORY_SCHEMA_VERSION;
5
+ type MemoryId = string;
6
+ type Timestamp = string;
7
+ type JsonPrimitive = string | number | boolean | null;
8
+ type JsonValue = JsonPrimitive | JsonValue[] | {
9
+ [key: string]: JsonValue;
10
+ };
11
+ type SourceReferenceKind = 'thread' | 'message' | 'iteration' | 'artifact' | 'event' | 'record' | 'external';
12
+ type SourceReference = {
13
+ kind: SourceReferenceKind;
14
+ id: string;
15
+ uri?: string;
16
+ excerpt?: string;
17
+ };
18
+ type Provenance = {
19
+ id: MemoryId;
20
+ schemaVersion: MemorySchemaVersion;
21
+ projectId: MemoryId;
22
+ createdAt: Timestamp;
23
+ participantId: MemoryId;
24
+ sourceRefs: SourceReference[];
25
+ };
26
+ type ParticipantKind = 'human' | 'ai' | 'system' | 'integration';
27
+ type AuthorityLevel = 'owner' | 'delegate' | 'contributor';
28
+ type AuthorityMode = 'local_trusted' | 'hosted';
29
+ type ExecutionContext = {
30
+ sessionId?: string;
31
+ provider?: string;
32
+ model?: string;
33
+ deviceId?: string;
34
+ mode?: string;
35
+ };
36
+ type AuthorityContext = {
37
+ level: AuthorityLevel;
38
+ mode: AuthorityMode;
39
+ grantId?: MemoryId;
40
+ authenticatedAt?: Timestamp;
41
+ };
42
+ type ParticipantRecord = Provenance & {
43
+ recordType: 'participant';
44
+ kind: ParticipantKind;
45
+ displayName: string;
46
+ status: 'active' | 'disabled';
47
+ };
48
+ type AuthorityGrantRecord = Provenance & {
49
+ recordType: 'authority_grant';
50
+ granteeId: MemoryId;
51
+ level: AuthorityLevel;
52
+ grantedById: MemoryId;
53
+ subjectIds: MemoryId[];
54
+ startsAt: Timestamp;
55
+ endsAt?: Timestamp;
56
+ revokedAt?: Timestamp;
57
+ };
58
+ type SubjectType = 'project' | 'file' | 'route' | 'component' | 'element' | 'token' | 'interaction';
59
+ type SubjectLocatorKind = 'project_root' | 'source_file' | 'route_pattern' | 'file_export' | 'source_span' | 'dom_selector' | 'token_path' | 'interaction_key' | 'custom';
60
+ type SubjectLocator = {
61
+ id: MemoryId;
62
+ kind: SubjectLocatorKind;
63
+ value: string;
64
+ status: 'current' | 'historical' | 'unresolved';
65
+ validFrom: Timestamp;
66
+ validUntil?: Timestamp;
67
+ sourceRefs: SourceReference[];
68
+ };
69
+ type SubjectRecord = Provenance & {
70
+ recordType: 'subject';
71
+ subjectType: SubjectType;
72
+ label: string;
73
+ aliases: string[];
74
+ locators: SubjectLocator[];
75
+ };
76
+ type ParticipantStance = {
77
+ stance: 'supports' | 'opposes' | 'uncertain' | 'needs_evidence';
78
+ reason?: string;
79
+ };
80
+ type CaptureContext = {
81
+ route?: string;
82
+ subjectIds: MemoryId[];
83
+ artifactIds: MemoryId[];
84
+ };
85
+ type ObservationState = 'open' | 'resolved' | 'dismissed';
86
+ type ObservationRecord = Provenance & {
87
+ recordType: 'observation';
88
+ state: ObservationState;
89
+ statement: string;
90
+ captureContext: CaptureContext;
91
+ stance?: ParticipantStance;
92
+ resolvedByIds: MemoryId[];
93
+ };
94
+ type DecisionKind = 'principle' | 'preference' | 'rule' | 'constraint';
95
+ type ProposalState = 'draft' | 'pending' | 'accepted' | 'rejected' | 'withdrawn' | 'deferred';
96
+ type AssertionOrigin = {
97
+ mode: 'declared' | 'inferred';
98
+ sourceText?: string;
99
+ iterationId?: MemoryId;
100
+ inferredById?: MemoryId;
101
+ reviewedById?: MemoryId;
102
+ };
103
+ type DecisionSubject = {
104
+ subjectId: MemoryId;
105
+ role: 'governed' | 'consumer' | 'provider' | 'context';
106
+ };
107
+ type ProposalRecord = Provenance & {
108
+ recordType: 'proposal';
109
+ state: ProposalState;
110
+ claim: string;
111
+ rationale?: string;
112
+ proposedKind?: DecisionKind;
113
+ subjects: DecisionSubject[];
114
+ subjectSemantics?: string;
115
+ origin: AssertionOrigin;
116
+ stance?: ParticipantStance;
117
+ bundleId?: MemoryId;
118
+ };
119
+ type DecisionState = 'active' | 'superseded' | 'revoked';
120
+ type DecisionRecord = Provenance & {
121
+ recordType: 'decision';
122
+ proposalId: MemoryId;
123
+ acceptanceEventId: MemoryId;
124
+ acceptedById: MemoryId;
125
+ authority: AuthorityContext;
126
+ state: DecisionState;
127
+ kind: DecisionKind;
128
+ claim: string;
129
+ rationale?: string;
130
+ subjects: DecisionSubject[];
131
+ subjectSemantics?: string;
132
+ noChange: boolean;
133
+ effectiveAt?: Timestamp;
134
+ effectiveMilestone?: string;
135
+ bundleId?: MemoryId;
136
+ };
137
+ type ThreadOutcome = 'decision_created' | 'proposal_rejected' | 'observation_resolved' | 'observation_dismissed' | 'question_unresolved' | 'implementation_only' | 'no_outcome';
138
+ type ThreadRecord = Provenance & {
139
+ recordType: 'thread';
140
+ title?: string;
141
+ state: 'open' | 'resolved';
142
+ messageArtifactIds: MemoryId[];
143
+ outcome: ThreadOutcome;
144
+ resultRefs: EntityReference[];
145
+ };
146
+ type IterationOutcome = 'completed' | 'cancelled' | 'question_asked' | 'failed' | 'no_change';
147
+ type IterationRecord = Provenance & {
148
+ recordType: 'iteration';
149
+ threadIds: MemoryId[];
150
+ startedAt: Timestamp;
151
+ completedAt?: Timestamp;
152
+ requestSummary: string;
153
+ responseSummary?: string;
154
+ outcome: IterationOutcome;
155
+ execution: ExecutionContext;
156
+ artifactIds: MemoryId[];
157
+ imprintAssessment?: {
158
+ state: 'mutated' | 'none' | 'missing' | 'invalid' | 'not_applicable';
159
+ reason?: string;
160
+ };
161
+ };
162
+ type EvidenceKind = 'judgment' | 'artifact' | 'eval' | 'log' | 'user_feedback' | 'external_source' | 'project_state';
163
+ type EvidenceRecord = Provenance & {
164
+ recordType: 'evidence';
165
+ kind: EvidenceKind;
166
+ summary: string;
167
+ availability: 'available' | 'missing' | 'redacted' | 'forgotten';
168
+ stance?: ParticipantStance;
169
+ artifactIds: MemoryId[];
170
+ };
171
+ /**
172
+ * An advisory explanation is learned, revisable shared understanding. It can
173
+ * guide future work, but it is deliberately distinct from accepted product
174
+ * truth (`decision`).
175
+ */
176
+ type AdvisoryExplanationKind = 'intention' | 'principle' | 'pattern';
177
+ type AdvisoryExplanationState = 'emerging' | 'testing' | 'grounded' | 'challenged' | 'retired';
178
+ type AdvisoryExplanationScope = {
179
+ kind: 'project' | 'route' | 'component' | 'selector' | 'file';
180
+ values: string[];
181
+ };
182
+ type AdvisoryConcreteBinding = {
183
+ id: string;
184
+ modelPath: string;
185
+ value: JsonValue;
186
+ createdAt: Timestamp;
187
+ updatedAt: Timestamp;
188
+ };
189
+ type AdvisoryExplanationRecord = Provenance & {
190
+ recordType: 'advisory_explanation';
191
+ kind: AdvisoryExplanationKind;
192
+ state: AdvisoryExplanationState;
193
+ statement: string;
194
+ rationale: string;
195
+ scope: AdvisoryExplanationScope;
196
+ subjectIds: MemoryId[];
197
+ evidenceIds: MemoryId[];
198
+ concreteBindings: AdvisoryConcreteBinding[];
199
+ supersededById?: MemoryId;
200
+ updatedAt: Timestamp;
201
+ };
202
+ type CoverageClaim = {
203
+ decisionId: MemoryId;
204
+ coverage: 'partial' | 'full';
205
+ claim: string;
206
+ sourceRefs: SourceReference[];
207
+ };
208
+ type ImplementationState = 'planned' | 'in_progress' | 'completed' | 'failed' | 'abandoned';
209
+ type ImplementationAttemptRecord = Provenance & {
210
+ recordType: 'implementation_attempt';
211
+ state: ImplementationState;
212
+ iterationIds: MemoryId[];
213
+ coverageClaims: CoverageClaim[];
214
+ projectStateRef?: SourceReference;
215
+ summary: string;
216
+ artifactIds: MemoryId[];
217
+ };
218
+ type VerificationState = 'queued' | 'running' | 'passed' | 'failed' | 'inconclusive' | 'error' | 'cancelled';
219
+ type VerificationTarget = {
220
+ entityType: 'decision' | 'implementation_attempt' | 'model_entry';
221
+ entityId: MemoryId;
222
+ };
223
+ /** @deprecated Retained only so existing memory journals remain readable. */
224
+ type EvalSpecState = 'draft' | 'active' | 'retired';
225
+ /** @deprecated Retained only so existing memory journals remain readable. */
226
+ type EvalDependency = {
227
+ kind: 'model_path' | 'source_file' | 'route' | 'subject';
228
+ value: string;
229
+ subjectId?: MemoryId;
230
+ };
231
+ /** @deprecated Retained only so existing memory journals remain readable. */
232
+ type EvalScenario = {
233
+ id: string;
234
+ label?: string;
235
+ route?: string;
236
+ routePattern?: string;
237
+ components?: Array<{
238
+ name: string;
239
+ sourceFile?: string;
240
+ exportName?: string;
241
+ }>;
242
+ subjectIds?: MemoryId[];
243
+ states?: Array<{
244
+ kind: 'viewport' | 'theme' | 'auth' | 'locale' | 'feature_flag' | 'fixture' | 'interaction' | 'custom';
245
+ key?: string;
246
+ value: string;
247
+ }>;
248
+ steps?: Array<{
249
+ action: 'navigate' | 'click' | 'type' | 'select';
250
+ target?: string;
251
+ value?: string;
252
+ }>;
253
+ };
254
+ /** @deprecated Retained only so existing memory journals remain readable. */
255
+ type EvalSpecRecord = Provenance & {
256
+ recordType: 'eval_spec';
257
+ state: EvalSpecState;
258
+ legacyId: string;
259
+ replacesSpecId?: MemoryId;
260
+ title: string;
261
+ category: 'component' | 'layout' | 'copy' | 'interaction' | 'visual' | 'workflow';
262
+ prompt: string;
263
+ assertions: string[];
264
+ rationale: string;
265
+ decisionIds: MemoryId[];
266
+ subjectIds: MemoryId[];
267
+ threadRefs: string[];
268
+ dependencies?: EvalDependency[];
269
+ scenarios?: EvalScenario[];
270
+ targets: VerificationTarget[];
271
+ evaluator: {
272
+ kind: 'human' | 'ai' | 'test' | 'external';
273
+ name: string;
274
+ evidenceTypes: string[];
275
+ };
276
+ scope: {
277
+ kind: 'current_page' | 'project' | 'subject';
278
+ route?: string;
279
+ };
280
+ };
281
+ type VerificationAttemptRecord = Provenance & {
282
+ recordType: 'verification_attempt';
283
+ evalSpecId?: MemoryId;
284
+ scopeFingerprint?: string;
285
+ state: VerificationState;
286
+ evaluator: {
287
+ kind: 'human' | 'ai' | 'test' | 'eval' | 'external';
288
+ participantId?: MemoryId;
289
+ name: string;
290
+ };
291
+ targets: VerificationTarget[];
292
+ summary?: string;
293
+ evidenceIds: MemoryId[];
294
+ /** @deprecated Historical presentation data retained for journal compatibility. */
295
+ evalRun?: {
296
+ id: string;
297
+ threadId?: string;
298
+ createdAt: number;
299
+ completedAt: number;
300
+ durationMs: number;
301
+ scope: {
302
+ type: 'current_page';
303
+ url: string;
304
+ viewport: {
305
+ width: number;
306
+ height: number;
307
+ };
308
+ };
309
+ assertionResults: Array<{
310
+ assertion: string;
311
+ status: 'pass' | 'fail' | 'needs_review';
312
+ summary: string;
313
+ evidence: string[];
314
+ }>;
315
+ tooling: {
316
+ chromeDevtools: 'available' | 'unavailable' | 'unknown';
317
+ evidenceTypes: string[];
318
+ };
319
+ provider?: string;
320
+ model?: string;
321
+ screenshotPath?: string;
322
+ codeFingerprint?: string;
323
+ };
324
+ };
325
+ type ModelEntryRecord = Provenance & {
326
+ recordType: 'model_entry';
327
+ key: string;
328
+ subjectIds: MemoryId[];
329
+ decisionIds: MemoryId[];
330
+ value: JsonValue;
331
+ };
332
+ type ModelProjectionRecord = Provenance & {
333
+ recordType: 'model_projection';
334
+ state: 'applied';
335
+ runId: string;
336
+ presentationJobId?: string;
337
+ appliedById: MemoryId;
338
+ authority: AuthorityContext;
339
+ appliedAt: Timestamp;
340
+ decisionIds: MemoryId[];
341
+ entryIds: MemoryId[];
342
+ coverage: Array<{
343
+ decisionId: MemoryId;
344
+ status: 'unprojected' | 'partially_projected' | 'projected' | 'stale';
345
+ }>;
346
+ };
347
+ type EntityType = 'participant' | 'authority_grant' | 'subject' | 'observation' | 'proposal' | 'decision' | 'thread' | 'iteration' | 'evidence' | 'advisory_explanation' | 'implementation_attempt' | 'eval_spec' | 'verification_attempt' | 'model_entry' | 'model_projection' | 'freshness_signal';
348
+ type MemoryObjectType = EntityType | 'relationship' | 'lifecycle_event' | 'artifact';
349
+ type EntityReference = {
350
+ entityType: EntityType;
351
+ entityId: MemoryId;
352
+ /** Omitted for a reference within the relationship's owning store. */
353
+ storeId?: string;
354
+ };
355
+ type RelationshipType = 'supports' | 'contradicts' | 'supersedes' | 'excepts' | 'duplicates' | 'implements' | 'verifies' | 'replaces' | 'derived_from' | 'expresses'
356
+ /** Legacy explanation topology names remain readable at the boundary. */
357
+ | 'operationalizes' | 'refines' | 'instantiates';
358
+ type RelationshipRecord = Provenance & {
359
+ recordType: 'relationship';
360
+ relationshipType: RelationshipType;
361
+ from: EntityReference;
362
+ to: EntityReference;
363
+ reason: string;
364
+ authority?: AuthorityContext;
365
+ };
366
+ type FreshnessSignalType = 'subject_unresolved' | 'implementation_drift' | 'evidence_unavailable' | 'new_conflict' | 'verification_expired' | 'review_interval_elapsed' | 'schema_or_tooling_change';
367
+ type FreshnessTargetKind = 'subject_locator' | 'implementation_presence' | 'verification_result' | 'model_coverage' | 'evidence_reference' | 'decision_applicability';
368
+ type FreshnessSignalRecord = Provenance & {
369
+ recordType: 'freshness_signal';
370
+ signalType: FreshnessSignalType;
371
+ state: 'open' | 'resolved';
372
+ targetKind: FreshnessTargetKind;
373
+ target: EntityReference;
374
+ reason: string;
375
+ evidenceIds: MemoryId[];
376
+ resolvedAt?: Timestamp;
377
+ resolvedByEventId?: MemoryId;
378
+ };
379
+ type ProposalDeferralContext = {
380
+ kind: 'proposal_deferral';
381
+ taskContext?: string;
382
+ subjectIds: MemoryId[];
383
+ resurfaceWhen: Array<'different_action' | 'new_evidence' | 'new_conflict' | 'owner_request' | 'after_date'>;
384
+ revisitAfter?: Timestamp;
385
+ };
386
+ type LifecycleEvent = Provenance & {
387
+ recordType: 'lifecycle_event';
388
+ entity: EntityReference;
389
+ eventType: string;
390
+ fromState: string | null;
391
+ toState: string;
392
+ authority: AuthorityContext;
393
+ execution?: ExecutionContext;
394
+ reason?: string;
395
+ transitionContext?: ProposalDeferralContext;
396
+ };
397
+ type ArtifactKind = 'message' | 'screenshot' | 'image' | 'diff' | 'file_snapshot' | 'log' | 'eval_output' | 'external_document' | 'other';
398
+ type ArtifactManifestEntry = {
399
+ id: MemoryId;
400
+ kind: ArtifactKind;
401
+ mediaType?: string;
402
+ byteSize?: number;
403
+ contentHash?: string;
404
+ location?: string;
405
+ availability: 'available' | 'missing' | 'redacted' | 'forgotten';
406
+ };
407
+ type Tombstone = {
408
+ id: MemoryId;
409
+ schemaVersion: MemorySchemaVersion;
410
+ projectId: MemoryId;
411
+ objectId: MemoryId;
412
+ objectType: MemoryObjectType;
413
+ deletedAt: Timestamp;
414
+ deletedById: MemoryId;
415
+ authority: AuthorityContext;
416
+ reasonCategory: 'privacy' | 'legal' | 'serious_error' | 'intentional_forgetting';
417
+ erasureLevel: 'content' | 'content_and_evidence' | 'full_where_permitted';
418
+ invalidates: EntityReference[];
419
+ };
420
+ type CanonicalRecord = ParticipantRecord | AuthorityGrantRecord | SubjectRecord | ObservationRecord | ProposalRecord | DecisionRecord | ThreadRecord | IterationRecord | EvidenceRecord | AdvisoryExplanationRecord | ImplementationAttemptRecord | EvalSpecRecord | VerificationAttemptRecord | ModelEntryRecord | ModelProjectionRecord | FreshnessSignalRecord;
421
+ type MemoryFeature = 'authority' | 'subjects' | 'decisions' | 'advisory_explanations' | 'implementations' | 'verification' | 'eval_specs' | 'model_projection' | 'freshness' | 'portable_artifacts' | 'bounded_retrieval';
422
+ type ProjectMemoryManifest = {
423
+ formatVersion: MemoryFormatVersion;
424
+ projectId: MemoryId;
425
+ createdAt: Timestamp;
426
+ updatedAt: Timestamp;
427
+ features: MemoryFeature[];
428
+ writer: {
429
+ name: string;
430
+ version: string;
431
+ };
432
+ };
433
+ type ProjectMemoryBundle = {
434
+ manifest: ProjectMemoryManifest;
435
+ records: CanonicalRecord[];
436
+ events: LifecycleEvent[];
437
+ relationships: RelationshipRecord[];
438
+ artifacts: ArtifactManifestEntry[];
439
+ tombstones: Tombstone[];
440
+ };
441
+ type SubjectMatch = {
442
+ subjectId?: MemoryId;
443
+ subjectType?: SubjectType;
444
+ label?: string;
445
+ confidence: 'exact' | 'strong' | 'weak' | 'unresolved';
446
+ matchedBy: 'id' | 'locator' | 'alias' | 'semantic' | 'none';
447
+ reason?: string;
448
+ };
449
+ type RetrievalDecision = {
450
+ id: MemoryId;
451
+ kind: DecisionKind;
452
+ claim: string;
453
+ subjectIds: MemoryId[];
454
+ authority: AuthorityContext;
455
+ effectiveState: 'active' | 'excepted' | 'conflicted';
456
+ freshness: FreshnessSignalType[];
457
+ expansionRef: SourceReference;
458
+ };
459
+ type RetrievalConflict = {
460
+ id: string;
461
+ decisionIds: MemoryId[];
462
+ unresolvedQuestion: string;
463
+ expansionRefs: SourceReference[];
464
+ };
465
+ type RetrievalUncertainty = {
466
+ code: 'subject_unresolved' | 'no_applicable_decision' | 'evidence_unavailable' | 'known_conflict' | 'retrieval_truncated';
467
+ message: string;
468
+ expansionRefs: SourceReference[];
469
+ };
470
+ type RetrievalEvidenceSummary = {
471
+ evidenceId: MemoryId;
472
+ summary: string;
473
+ availability: EvidenceRecord['availability'];
474
+ sourceRefs: SourceReference[];
475
+ };
476
+ type RetrievalPacket = {
477
+ contractVersion: 1;
478
+ projectId: MemoryId;
479
+ retrievedAt: Timestamp;
480
+ query: {
481
+ text?: string;
482
+ action?: string;
483
+ subjectHints: string[];
484
+ };
485
+ budget: {
486
+ maxEstimatedTokens: number;
487
+ estimatedTokens: number;
488
+ };
489
+ subjectMatches: SubjectMatch[];
490
+ modelEntries: Array<{
491
+ id: MemoryId;
492
+ key: string;
493
+ value: JsonValue;
494
+ decisionIds: MemoryId[];
495
+ }>;
496
+ decisions: RetrievalDecision[];
497
+ conflicts: RetrievalConflict[];
498
+ uncertainties: RetrievalUncertainty[];
499
+ implementation: Array<{
500
+ decisionId: MemoryId;
501
+ state: 'unimplemented' | 'partial' | 'implemented' | 'unknown';
502
+ attemptIds: MemoryId[];
503
+ }>;
504
+ verification: Array<{
505
+ target: VerificationTarget;
506
+ state: 'unverified' | 'passing' | 'failing' | 'stale' | 'blocked';
507
+ attemptIds: MemoryId[];
508
+ }>;
509
+ evidence: RetrievalEvidenceSummary[];
510
+ completeness: {
511
+ status: 'complete' | 'truncated';
512
+ omittedDecisionCount: number;
513
+ omittedEvidenceCount: number;
514
+ conflictsComplete: boolean;
515
+ };
516
+ };
517
+
518
+ type SchemaIssue = {
519
+ path: string;
520
+ code: string;
521
+ message: string;
522
+ severity: 'error' | 'warning';
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;
561
+ };
562
+ declare function legacyUuidV7(namespace: string, kind: string, legacyId: string, occurredAt: number): string;
563
+ declare function importLegacyProject(options: LegacyImportOptions): Promise<LegacyImportResult>;
564
+
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 };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{b as PopmeltProvider}from"./chunk-3PVLCKSV.mjs";export{a as isPopmeltPreview}from"./chunk-EX63NVDN.mjs";import"./chunk-N2ZEZCHO.mjs";export{b as usePopmelt}from"./chunk-J3UIBBU2.mjs";import"./chunk-YMCTJKYN.mjs";import"./chunk-7MGWRICI.mjs";import"./chunk-TSY2K45H.mjs";import"./chunk-D7HY2EDH.mjs";
2
+ export{b as PopmeltProvider}from"./chunk-3THBMCJW.mjs";import"./chunk-W4VRK56P.mjs";import"./chunk-JQHZFDY5.mjs";export{a as isPopmeltPreview}from"./chunk-EX63NVDN.mjs";import"./chunk-N2ZEZCHO.mjs";export{b as usePopmelt}from"./chunk-J3UIBBU2.mjs";import"./chunk-3LBOX7HQ.mjs";import"./chunk-QUNV5PNI.mjs";import"./chunk-A2UXK7AS.mjs";import"./chunk-MP7S5ALD.mjs";import"./chunk-XTOCFTVW.mjs";import"./chunk-LVEMYZOA.mjs";import"./chunk-XOGBFVWI.mjs";import"./chunk-HGW2U6PD.mjs";