@popmelt.com/core 0.8.3 → 0.8.5

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.
@@ -0,0 +1,26 @@
1
+ import { IncomingMessage, ServerResponse } from 'node:http';
2
+
3
+ type PopmeltPluginOptions = {
4
+ port?: number;
5
+ projectRoot?: string;
6
+ basePath?: string;
7
+ bridge?: boolean;
8
+ };
9
+ type ConnectNext = () => void;
10
+ type ConnectMiddleware = (req: IncomingMessage, res: ServerResponse, next: ConnectNext) => void;
11
+ type DevServerLike = {
12
+ config?: {
13
+ server?: {
14
+ host?: string | boolean;
15
+ port?: number;
16
+ };
17
+ };
18
+ middlewares: {
19
+ use: (middleware: ConnectMiddleware) => void;
20
+ };
21
+ httpServer?: {
22
+ once: (event: 'close', listener: () => void) => unknown;
23
+ } | null;
24
+ };
25
+
26
+ export type { DevServerLike as D, PopmeltPluginOptions as P };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,13 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren } from 'react';
3
3
 
4
+ /** Client-side envelope used for persisted and streaming bridge events. */
5
+ type BridgeEvent = {
6
+ type: string;
7
+ data: Record<string, unknown>;
8
+ timestamp: number;
9
+ };
10
+
4
11
  type PopmeltContextValue = {
5
12
  isEnabled: boolean;
6
13
  };
@@ -16,14 +23,16 @@ type PopmeltProviderProps = PropsWithChildren<{
16
23
  declare function PopmeltProvider({ children, enabled, bridgeUrl, projectId: projectIdProp, navigate: navigateProp, }: PopmeltProviderProps): react.JSX.Element;
17
24
  declare function usePopmelt(): PopmeltContextValue;
18
25
 
19
- type AnnotationLifecycleStatus = 'pending' | 'in_flight' | 'resolved' | 'needs_review' | 'dismissed' | 'waiting_input';
26
+ type AnnotationLifecycleStatus = 'pending' | 'sending' | 'in_flight' | 'resolved' | 'needs_review' | 'dismissed' | 'waiting_input' | 'failed';
20
27
  type ScopeBreadth = 'instance' | 'pattern';
21
28
  type ScopeTarget = 'element' | 'component' | 'token';
22
29
  type Scope = {
23
30
  breadth: ScopeBreadth;
24
31
  target: ScopeTarget;
25
32
  };
26
- type ToolType = 'freehand' | 'line' | 'rectangle' | 'circle' | 'text' | 'inspector' | 'hand' | 'eval' | 'model';
33
+ declare const TOOL_TYPES: readonly ["freehand", "line", "rectangle", "circle", "inspector", "hand", "eval", "model"];
34
+ type ToolType = (typeof TOOL_TYPES)[number];
35
+ type AnnotationType = ToolType | 'text';
27
36
  type Point = {
28
37
  x: number;
29
38
  y: number;
@@ -102,7 +111,7 @@ type SpacingTokenChange = {
102
111
  };
103
112
  type Annotation = {
104
113
  id: string;
105
- type: ToolType;
114
+ type: AnnotationType;
106
115
  points: Point[];
107
116
  color: string;
108
117
  strokeWidth: number;
@@ -116,6 +125,7 @@ type Annotation = {
116
125
  resolutionSummary?: string;
117
126
  scope?: Scope | null;
118
127
  replyCount?: number;
128
+ replyJobIds?: string[];
119
129
  threadId?: string;
120
130
  pathname?: string;
121
131
  elements?: ElementInfo[];
@@ -132,11 +142,6 @@ type BridgeStatus = {
132
142
  queueDepth: number;
133
143
  sessionId: string | null;
134
144
  };
135
- type BridgeEvent = {
136
- type: 'job_started' | 'delta' | 'tool_use' | 'done' | 'error';
137
- data: Record<string, unknown>;
138
- timestamp: number;
139
- };
140
145
  type ClaudeResponse = {
141
146
  jobId: string;
142
147
  sessionId?: string;
@@ -173,4 +178,4 @@ type FeedbackData = {
173
178
  spacingTokenChanges?: SpacingTokenChange[];
174
179
  };
175
180
 
176
- export { type Annotation, type BridgeEvent, type BridgeStatus, type ClaudeResponse, type ElementInfo, type FeedbackData, type Point, PopmeltProvider, type StyleChange, type StyleModification, type ToolType, usePopmelt };
181
+ export { type Annotation, type AnnotationType, type BridgeEvent, type BridgeStatus, type ClaudeResponse, type ElementInfo, type FeedbackData, type Point, PopmeltProvider, type StyleChange, type StyleModification, type ToolType, usePopmelt };