instruckt 0.4.13 → 0.4.16

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.
@@ -1,12 +1,6 @@
1
1
  type AnnotationIntent = 'fix' | 'change' | 'question' | 'approve';
2
2
  type AnnotationSeverity = 'blocking' | 'important' | 'suggestion';
3
- type AnnotationStatus = 'pending' | 'acknowledged' | 'resolved' | 'dismissed';
4
- interface ThreadMessage {
5
- id: string;
6
- role: 'human' | 'agent';
7
- content: string;
8
- timestamp: string;
9
- }
3
+ type AnnotationStatus = 'pending' | 'resolved' | 'dismissed';
10
4
  interface FrameworkContext {
11
5
  framework: 'livewire' | 'vue' | 'svelte' | 'react';
12
6
  component: string;
@@ -32,16 +26,34 @@ interface Annotation {
32
26
  boundingBox: BoundingBox;
33
27
  selectedText?: string;
34
28
  nearbyText?: string;
29
+ screenshot?: string;
35
30
  intent: AnnotationIntent;
36
31
  severity: AnnotationSeverity;
37
32
  status: AnnotationStatus;
38
- thread: ThreadMessage[];
39
33
  framework?: FrameworkContext;
40
34
  createdAt: string;
41
35
  updatedAt?: string;
42
36
  resolvedAt?: string;
43
37
  resolvedBy?: 'human' | 'agent';
44
38
  }
39
+ interface MarkerColors {
40
+ /** Default marker color. Default: '#6366f1' (indigo) */
41
+ default?: string;
42
+ /** Screenshot marker color. Default: '#22c55e' (green) */
43
+ screenshot?: string;
44
+ /** Dismissed marker color. Default: '#71717a' */
45
+ dismissed?: string;
46
+ }
47
+ interface KeyBindings {
48
+ /** Toggle annotate mode. Default: 'a' */
49
+ annotate?: string;
50
+ /** Toggle freeze. Default: 'f' */
51
+ freeze?: string;
52
+ /** Region screenshot. Default: 'c' */
53
+ screenshot?: string;
54
+ /** Clear page annotations. Default: 'x' */
55
+ clearPage?: string;
56
+ }
45
57
  interface InstrucktConfig {
46
58
  /** URL to POST annotations to. Default: '/instruckt' */
47
59
  endpoint: string;
@@ -51,6 +63,10 @@ interface InstrucktConfig {
51
63
  theme?: 'light' | 'dark' | 'auto';
52
64
  /** Position of the toolbar. Default: 'bottom-right' */
53
65
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
66
+ /** Customize marker pin colors */
67
+ colors?: MarkerColors;
68
+ /** Customize keyboard shortcuts */
69
+ keys?: KeyBindings;
54
70
  /** Callbacks */
55
71
  onAnnotationAdd?: (annotation: Annotation) => void;
56
72
  onAnnotationResolve?: (annotation: Annotation) => void;
@@ -85,6 +101,8 @@ declare class Instruckt {
85
101
  private loadAnnotations;
86
102
  private saveToStorage;
87
103
  private loadFromStorage;
104
+ /** Start or stop polling based on whether there are active annotations */
105
+ private updatePolling;
88
106
  /** Poll API for status changes (e.g. agent resolved via MCP) */
89
107
  private pollForChanges;
90
108
  private syncMarkers;
@@ -114,9 +132,11 @@ declare class Instruckt {
114
132
  /** Block mousedown/pointerdown in annotation mode so SPA frameworks can't navigate */
115
133
  private boundAnnotateBlock;
116
134
  private boundClick;
135
+ private showAnnotationPopup;
117
136
  private attachAnnotateListeners;
118
137
  private detachAnnotateListeners;
119
138
  private isInstruckt;
139
+ private startRegionCapture;
120
140
  private detectFramework;
121
141
  private submitAnnotation;
122
142
  private onMarkerClick;
@@ -1,12 +1,6 @@
1
1
  type AnnotationIntent = 'fix' | 'change' | 'question' | 'approve';
2
2
  type AnnotationSeverity = 'blocking' | 'important' | 'suggestion';
3
- type AnnotationStatus = 'pending' | 'acknowledged' | 'resolved' | 'dismissed';
4
- interface ThreadMessage {
5
- id: string;
6
- role: 'human' | 'agent';
7
- content: string;
8
- timestamp: string;
9
- }
3
+ type AnnotationStatus = 'pending' | 'resolved' | 'dismissed';
10
4
  interface FrameworkContext {
11
5
  framework: 'livewire' | 'vue' | 'svelte' | 'react';
12
6
  component: string;
@@ -32,16 +26,34 @@ interface Annotation {
32
26
  boundingBox: BoundingBox;
33
27
  selectedText?: string;
34
28
  nearbyText?: string;
29
+ screenshot?: string;
35
30
  intent: AnnotationIntent;
36
31
  severity: AnnotationSeverity;
37
32
  status: AnnotationStatus;
38
- thread: ThreadMessage[];
39
33
  framework?: FrameworkContext;
40
34
  createdAt: string;
41
35
  updatedAt?: string;
42
36
  resolvedAt?: string;
43
37
  resolvedBy?: 'human' | 'agent';
44
38
  }
39
+ interface MarkerColors {
40
+ /** Default marker color. Default: '#6366f1' (indigo) */
41
+ default?: string;
42
+ /** Screenshot marker color. Default: '#22c55e' (green) */
43
+ screenshot?: string;
44
+ /** Dismissed marker color. Default: '#71717a' */
45
+ dismissed?: string;
46
+ }
47
+ interface KeyBindings {
48
+ /** Toggle annotate mode. Default: 'a' */
49
+ annotate?: string;
50
+ /** Toggle freeze. Default: 'f' */
51
+ freeze?: string;
52
+ /** Region screenshot. Default: 'c' */
53
+ screenshot?: string;
54
+ /** Clear page annotations. Default: 'x' */
55
+ clearPage?: string;
56
+ }
45
57
  interface InstrucktConfig {
46
58
  /** URL to POST annotations to. Default: '/instruckt' */
47
59
  endpoint: string;
@@ -51,6 +63,10 @@ interface InstrucktConfig {
51
63
  theme?: 'light' | 'dark' | 'auto';
52
64
  /** Position of the toolbar. Default: 'bottom-right' */
53
65
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
66
+ /** Customize marker pin colors */
67
+ colors?: MarkerColors;
68
+ /** Customize keyboard shortcuts */
69
+ keys?: KeyBindings;
54
70
  /** Callbacks */
55
71
  onAnnotationAdd?: (annotation: Annotation) => void;
56
72
  onAnnotationResolve?: (annotation: Annotation) => void;
@@ -85,6 +101,8 @@ declare class Instruckt {
85
101
  private loadAnnotations;
86
102
  private saveToStorage;
87
103
  private loadFromStorage;
104
+ /** Start or stop polling based on whether there are active annotations */
105
+ private updatePolling;
88
106
  /** Poll API for status changes (e.g. agent resolved via MCP) */
89
107
  private pollForChanges;
90
108
  private syncMarkers;
@@ -114,9 +132,11 @@ declare class Instruckt {
114
132
  /** Block mousedown/pointerdown in annotation mode so SPA frameworks can't navigate */
115
133
  private boundAnnotateBlock;
116
134
  private boundClick;
135
+ private showAnnotationPopup;
117
136
  private attachAnnotateListeners;
118
137
  private detachAnnotateListeners;
119
138
  private isInstruckt;
139
+ private startRegionCapture;
120
140
  private detectFramework;
121
141
  private submitAnnotation;
122
142
  private onMarkerClick;