@agent-native/pinpoint 0.1.60 → 0.1.63
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/dist/cli.d.ts +1 -0
- package/dist/index-C0P3S_D7.d.ts +43 -0
- package/dist/index.d.ts +198 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/server/index.d.ts +129 -0
- package/dist/types/index.d.ts +182 -0
- package/package.json +2 -2
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PinStorage, Pin, PinStatus, FrameworkInfo, ElementContext, ElementInfo, FrameworkAdapter, ComponentInfo, SourceLocation } from './types/index.js';
|
|
2
|
+
|
|
3
|
+
declare class MemoryStore implements PinStorage {
|
|
4
|
+
private pins;
|
|
5
|
+
load(pageUrl: string): Promise<Pin[]>;
|
|
6
|
+
save(pin: Pin): Promise<void>;
|
|
7
|
+
update(id: string, patch: Partial<Pin>): Promise<void>;
|
|
8
|
+
delete(id: string): Promise<void>;
|
|
9
|
+
list(filter?: {
|
|
10
|
+
pageUrl?: string;
|
|
11
|
+
status?: PinStatus;
|
|
12
|
+
}): Promise<Pin[]>;
|
|
13
|
+
clear(pageUrl?: string): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface SelectorOptions {
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
skipClassPatterns?: RegExp[];
|
|
19
|
+
}
|
|
20
|
+
declare function buildSelector(element: Element, options?: SelectorOptions): string;
|
|
21
|
+
|
|
22
|
+
declare function extractElementInfo(element: Element): ElementInfo;
|
|
23
|
+
declare function buildElementContext(element: Element, frameworkInfo?: FrameworkInfo): ElementContext;
|
|
24
|
+
|
|
25
|
+
declare function registerAdapter(adapter: FrameworkAdapter): void;
|
|
26
|
+
declare function detectFramework(): FrameworkAdapter;
|
|
27
|
+
declare function getComponentInfo(element: Element): ComponentInfo | null;
|
|
28
|
+
declare function getSourceLocation(element: Element): SourceLocation | null;
|
|
29
|
+
|
|
30
|
+
interface FreezeOptions {
|
|
31
|
+
jsTimers?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare function freeze(_elements?: Element[], options?: FreezeOptions): void;
|
|
34
|
+
declare function unfreeze(): void;
|
|
35
|
+
declare function isFreezeActive(): boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Open a file in the user's editor. Tries vscode:// protocol first,
|
|
39
|
+
* falls back to a fetch to /api/open-file.
|
|
40
|
+
*/
|
|
41
|
+
declare function openFile(filePath: string, lineNumber?: number): Promise<void>;
|
|
42
|
+
|
|
43
|
+
export { MemoryStore as M, buildSelector as a, buildElementContext as b, getSourceLocation as c, detectFramework as d, extractElementInfo as e, freeze as f, getComponentInfo as g, isFreezeActive as i, openFile as o, registerAdapter as r, unfreeze as u };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { PinStorage, Pin, PinStatus, FrameworkAdapter, OutputFormat, AgentOutput, QueuedAnnotation, PluginHooks, Plugin, PinpointAPI } from './types/index.js';
|
|
2
|
+
export { ComponentInfo, ContextMenuAction, CopyContext, DrawStroke, DrawToolType, ElementContext, ElementInfo, FrameworkInfo, PinEvent, PinpointConfig, SourceLocation, TextNote, ToolbarMode } from './types/index.js';
|
|
3
|
+
export { M as MemoryStore, b as buildElementContext, a as buildSelector, d as detectFramework, e as extractElementInfo, f as freeze, g as getComponentInfo, c as getSourceLocation, i as isFreezeActive, o as openFile, r as registerAdapter, u as unfreeze } from './index-C0P3S_D7.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
declare class RestClient implements PinStorage {
|
|
7
|
+
private endpoint;
|
|
8
|
+
constructor(endpoint: string);
|
|
9
|
+
load(pageUrl: string): Promise<Pin[]>;
|
|
10
|
+
save(pin: Pin): Promise<void>;
|
|
11
|
+
update(id: string, patch: Partial<Pin>): Promise<void>;
|
|
12
|
+
delete(id: string): Promise<void>;
|
|
13
|
+
list(filter?: {
|
|
14
|
+
pageUrl?: string;
|
|
15
|
+
status?: PinStatus;
|
|
16
|
+
}): Promise<Pin[]>;
|
|
17
|
+
clear(pageUrl?: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare const ElementInfoSchema: z.ZodObject<{
|
|
21
|
+
tagName: z.ZodString;
|
|
22
|
+
id: z.ZodOptional<z.ZodString>;
|
|
23
|
+
classNames: z.ZodArray<z.ZodString>;
|
|
24
|
+
selector: z.ZodString;
|
|
25
|
+
textContent: z.ZodOptional<z.ZodString>;
|
|
26
|
+
boundingRect: z.ZodObject<{
|
|
27
|
+
x: z.ZodNumber;
|
|
28
|
+
y: z.ZodNumber;
|
|
29
|
+
width: z.ZodNumber;
|
|
30
|
+
height: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
computedStyles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
33
|
+
ariaAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
34
|
+
dataAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
35
|
+
domPath: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
declare const FrameworkInfoSchema: z.ZodObject<{
|
|
38
|
+
framework: z.ZodString;
|
|
39
|
+
componentPath: z.ZodString;
|
|
40
|
+
sourceFile: z.ZodOptional<z.ZodString>;
|
|
41
|
+
frameworkVersion: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
declare const PinSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
pageUrl: z.ZodString;
|
|
46
|
+
createdAt: z.ZodString;
|
|
47
|
+
updatedAt: z.ZodString;
|
|
48
|
+
author: z.ZodOptional<z.ZodString>;
|
|
49
|
+
comment: z.ZodString;
|
|
50
|
+
element: z.ZodObject<{
|
|
51
|
+
tagName: z.ZodString;
|
|
52
|
+
id: z.ZodOptional<z.ZodString>;
|
|
53
|
+
classNames: z.ZodArray<z.ZodString>;
|
|
54
|
+
selector: z.ZodString;
|
|
55
|
+
textContent: z.ZodOptional<z.ZodString>;
|
|
56
|
+
boundingRect: z.ZodObject<{
|
|
57
|
+
x: z.ZodNumber;
|
|
58
|
+
y: z.ZodNumber;
|
|
59
|
+
width: z.ZodNumber;
|
|
60
|
+
height: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
computedStyles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
63
|
+
ariaAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
64
|
+
dataAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
65
|
+
domPath: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
framework: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
framework: z.ZodString;
|
|
69
|
+
componentPath: z.ZodString;
|
|
70
|
+
sourceFile: z.ZodOptional<z.ZodString>;
|
|
71
|
+
frameworkVersion: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
status: z.ZodObject<{
|
|
74
|
+
state: z.ZodEnum<{
|
|
75
|
+
open: "open";
|
|
76
|
+
acknowledged: "acknowledged";
|
|
77
|
+
resolved: "resolved";
|
|
78
|
+
dismissed: "dismissed";
|
|
79
|
+
}>;
|
|
80
|
+
changedAt: z.ZodString;
|
|
81
|
+
changedBy: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
|
|
85
|
+
interface ElementPickerOptions {
|
|
86
|
+
onHover?: (element: Element | null, rect: DOMRect | null) => void;
|
|
87
|
+
onStableHover?: (element: Element) => void;
|
|
88
|
+
onSelect?: (element: Element) => void;
|
|
89
|
+
ignoreSelector?: string;
|
|
90
|
+
blockInteractions?: boolean;
|
|
91
|
+
}
|
|
92
|
+
declare class ElementPicker {
|
|
93
|
+
private active;
|
|
94
|
+
private paused;
|
|
95
|
+
private hoveredElement;
|
|
96
|
+
private rafId;
|
|
97
|
+
private stableTimeout;
|
|
98
|
+
private lastTarget;
|
|
99
|
+
private options;
|
|
100
|
+
private handleMouseMove;
|
|
101
|
+
private handleClick;
|
|
102
|
+
private handleKeyDown;
|
|
103
|
+
constructor(options?: ElementPickerOptions);
|
|
104
|
+
private isOwnUI;
|
|
105
|
+
private shouldIgnore;
|
|
106
|
+
private pierceElementFromPoint;
|
|
107
|
+
private processHover;
|
|
108
|
+
private clearStableTimeout;
|
|
109
|
+
activate(): void;
|
|
110
|
+
deactivate(): void;
|
|
111
|
+
setBlockInteractions(value: boolean): void;
|
|
112
|
+
pause(): void;
|
|
113
|
+
resume(): void;
|
|
114
|
+
isPaused(): boolean;
|
|
115
|
+
isActive(): boolean;
|
|
116
|
+
getHoveredElement(): Element | null;
|
|
117
|
+
dispose(): void;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface DragSelectOptions {
|
|
121
|
+
coverageThreshold?: number;
|
|
122
|
+
onDragStart?: (rect: DOMRect) => void;
|
|
123
|
+
onDragMove?: (rect: DOMRect) => void;
|
|
124
|
+
onDragEnd?: (elements: Element[]) => void;
|
|
125
|
+
ignoreSelector?: string;
|
|
126
|
+
}
|
|
127
|
+
declare class DragSelect {
|
|
128
|
+
private active;
|
|
129
|
+
private dragging;
|
|
130
|
+
private startX;
|
|
131
|
+
private startY;
|
|
132
|
+
private options;
|
|
133
|
+
private handleMouseDown;
|
|
134
|
+
private handleMouseMove;
|
|
135
|
+
private handleMouseUp;
|
|
136
|
+
constructor(options?: DragSelectOptions);
|
|
137
|
+
private buildRect;
|
|
138
|
+
private getElementsInRect;
|
|
139
|
+
activate(): void;
|
|
140
|
+
deactivate(): void;
|
|
141
|
+
isDragging(): boolean;
|
|
142
|
+
dispose(): void;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface TextSelection {
|
|
146
|
+
text: string;
|
|
147
|
+
container: Element;
|
|
148
|
+
startOffset: number;
|
|
149
|
+
endOffset: number;
|
|
150
|
+
context: string;
|
|
151
|
+
rect: DOMRect;
|
|
152
|
+
}
|
|
153
|
+
interface TextSelectOptions {
|
|
154
|
+
onSelect?: (selection: TextSelection | null) => void;
|
|
155
|
+
minLength?: number;
|
|
156
|
+
}
|
|
157
|
+
declare class TextSelect {
|
|
158
|
+
private active;
|
|
159
|
+
private options;
|
|
160
|
+
private handleSelectionChange;
|
|
161
|
+
private debounceTimer;
|
|
162
|
+
constructor(options?: TextSelectOptions);
|
|
163
|
+
private getTextSelection;
|
|
164
|
+
activate(): void;
|
|
165
|
+
deactivate(): void;
|
|
166
|
+
getCurrentSelection(): TextSelection | null;
|
|
167
|
+
dispose(): void;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare const reactAdapter: FrameworkAdapter;
|
|
171
|
+
|
|
172
|
+
declare const vueAdapter: FrameworkAdapter;
|
|
173
|
+
|
|
174
|
+
declare const genericAdapter: FrameworkAdapter;
|
|
175
|
+
|
|
176
|
+
declare function formatPins(pins: Pin[], format?: OutputFormat): string;
|
|
177
|
+
|
|
178
|
+
declare function formatRichPinContext(pin: Pin): string;
|
|
179
|
+
declare function formatPinsForAgent(pins: Pin[], format?: OutputFormat): AgentOutput;
|
|
180
|
+
declare function formatQueueForAgent(queue: QueuedAnnotation[], format?: OutputFormat): AgentOutput;
|
|
181
|
+
|
|
182
|
+
declare function registerPlugin(plugin: Plugin, api?: PinpointAPI): void;
|
|
183
|
+
declare function unregisterPlugin(name: string): void;
|
|
184
|
+
declare function getPlugins(): string[];
|
|
185
|
+
declare function dispatchHook(name: keyof PluginHooks, ...args: unknown[]): void;
|
|
186
|
+
|
|
187
|
+
declare const agentNativePlugin: Plugin;
|
|
188
|
+
|
|
189
|
+
declare function escapeHtml(str: string): string;
|
|
190
|
+
declare function sanitizeString(str: string, maxLength?: number): string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Validate that a message origin is allowed.
|
|
194
|
+
* Used for postMessage security when communicating with frames.
|
|
195
|
+
*/
|
|
196
|
+
declare function isAllowedOrigin(origin: string, allowedOrigins?: string[]): boolean;
|
|
197
|
+
|
|
198
|
+
export { AgentOutput, DragSelect, ElementInfoSchema, ElementPicker, FrameworkAdapter, FrameworkInfoSchema, OutputFormat, Pin, PinSchema, PinStatus, PinStorage, PinpointAPI, Plugin, PluginHooks, QueuedAnnotation, RestClient, TextSelect, agentNativePlugin, dispatchHook, escapeHtml, formatPins, formatPinsForAgent, formatQueueForAgent, formatRichPinContext, genericAdapter, getPlugins, isAllowedOrigin, reactAdapter, registerPlugin, sanitizeString, unregisterPlugin, vueAdapter };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { M as MemoryStore, a as buildSelector, d as detectFramework, e as extractElementInfo, f as freeze, g as getComponentInfo, b as getElementContext, c as getSourceLocation, i as isFreezeActive, o as openFile, u as unfreeze } from '../index-C0P3S_D7.js';
|
|
2
|
+
import '../types/index.js';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Router, Application } from 'express';
|
|
2
|
+
import { PinStorage, Pin, PinStatus } from '../types/index.js';
|
|
3
|
+
|
|
4
|
+
interface PinRoutesOptions {
|
|
5
|
+
dataDir?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function pagePinRoutes(options?: PinRoutesOptions): Router;
|
|
8
|
+
|
|
9
|
+
declare function registerPinpointA2A(app: Application, options?: {
|
|
10
|
+
dataDir?: string;
|
|
11
|
+
}): void;
|
|
12
|
+
|
|
13
|
+
declare function createPinpointMCPTools(options?: {
|
|
14
|
+
dataDir?: string;
|
|
15
|
+
}): {
|
|
16
|
+
tools: ({
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: "object";
|
|
21
|
+
properties: {
|
|
22
|
+
pageUrl: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
status: {
|
|
27
|
+
type: string;
|
|
28
|
+
enum: string[];
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
id?: undefined;
|
|
32
|
+
message?: undefined;
|
|
33
|
+
selector?: undefined;
|
|
34
|
+
comment?: undefined;
|
|
35
|
+
};
|
|
36
|
+
required?: undefined;
|
|
37
|
+
};
|
|
38
|
+
} | {
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: "object";
|
|
43
|
+
properties: {
|
|
44
|
+
id: {
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
message: {
|
|
49
|
+
type: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
pageUrl?: undefined;
|
|
53
|
+
status?: undefined;
|
|
54
|
+
selector?: undefined;
|
|
55
|
+
comment?: undefined;
|
|
56
|
+
};
|
|
57
|
+
required: string[];
|
|
58
|
+
};
|
|
59
|
+
} | {
|
|
60
|
+
name: string;
|
|
61
|
+
description: string;
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object";
|
|
64
|
+
properties: {
|
|
65
|
+
pageUrl: {
|
|
66
|
+
type: string;
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
selector: {
|
|
70
|
+
type: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
comment: {
|
|
74
|
+
type: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
status?: undefined;
|
|
78
|
+
id?: undefined;
|
|
79
|
+
message?: undefined;
|
|
80
|
+
};
|
|
81
|
+
required: string[];
|
|
82
|
+
};
|
|
83
|
+
} | {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string;
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object";
|
|
88
|
+
properties: {
|
|
89
|
+
id: {
|
|
90
|
+
type: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
pageUrl?: undefined;
|
|
94
|
+
status?: undefined;
|
|
95
|
+
message?: undefined;
|
|
96
|
+
selector?: undefined;
|
|
97
|
+
comment?: undefined;
|
|
98
|
+
};
|
|
99
|
+
required: string[];
|
|
100
|
+
};
|
|
101
|
+
})[];
|
|
102
|
+
handleTool(name: string, args: Record<string, any>): Promise<{
|
|
103
|
+
content: Array<{
|
|
104
|
+
type: string;
|
|
105
|
+
text: string;
|
|
106
|
+
}>;
|
|
107
|
+
}>;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
declare class FileStore implements PinStorage {
|
|
111
|
+
private dir;
|
|
112
|
+
constructor(dataDir?: string);
|
|
113
|
+
private validateId;
|
|
114
|
+
private pinPath;
|
|
115
|
+
private ensureDir;
|
|
116
|
+
private readPin;
|
|
117
|
+
private atomicWrite;
|
|
118
|
+
load(pageUrl: string): Promise<Pin[]>;
|
|
119
|
+
save(pin: Pin): Promise<void>;
|
|
120
|
+
update(id: string, patch: Partial<Pin>): Promise<void>;
|
|
121
|
+
delete(id: string): Promise<void>;
|
|
122
|
+
list(filter?: {
|
|
123
|
+
pageUrl?: string;
|
|
124
|
+
status?: PinStatus;
|
|
125
|
+
}): Promise<Pin[]>;
|
|
126
|
+
clear(pageUrl?: string): Promise<void>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { FileStore, type PinRoutesOptions, createPinpointMCPTools, pagePinRoutes, registerPinpointA2A };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
type PinStatus = "open" | "acknowledged" | "resolved" | "dismissed";
|
|
2
|
+
type DrawToolType = "freehand" | "arrow" | "circle" | "rect" | "text";
|
|
3
|
+
interface DrawStroke {
|
|
4
|
+
points: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[];
|
|
8
|
+
color: string;
|
|
9
|
+
lineWidth: number;
|
|
10
|
+
type: "freehand" | "arrow" | "circle" | "rect";
|
|
11
|
+
}
|
|
12
|
+
interface TextNote {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
text: string;
|
|
16
|
+
color: string;
|
|
17
|
+
}
|
|
18
|
+
interface QueuedAnnotation {
|
|
19
|
+
id: string;
|
|
20
|
+
pin?: Pin;
|
|
21
|
+
drawings?: DrawStroke[];
|
|
22
|
+
textNotes?: TextNote[];
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}
|
|
25
|
+
interface AgentOutput {
|
|
26
|
+
message: string;
|
|
27
|
+
context: string;
|
|
28
|
+
submit?: boolean;
|
|
29
|
+
}
|
|
30
|
+
type ToolbarMode = "select" | "draw" | "queue";
|
|
31
|
+
interface Pin {
|
|
32
|
+
id: string;
|
|
33
|
+
pageUrl: string;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
author?: string;
|
|
37
|
+
comment: string;
|
|
38
|
+
element: ElementInfo;
|
|
39
|
+
framework?: FrameworkInfo;
|
|
40
|
+
status: {
|
|
41
|
+
state: PinStatus;
|
|
42
|
+
changedAt: string;
|
|
43
|
+
changedBy?: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
interface ElementInfo {
|
|
47
|
+
tagName: string;
|
|
48
|
+
id?: string;
|
|
49
|
+
classNames: string[];
|
|
50
|
+
selector: string;
|
|
51
|
+
textContent?: string;
|
|
52
|
+
boundingRect: {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
};
|
|
58
|
+
computedStyles?: Record<string, string>;
|
|
59
|
+
ariaAttributes?: Record<string, string>;
|
|
60
|
+
dataAttributes?: Record<string, string>;
|
|
61
|
+
domPath?: string;
|
|
62
|
+
}
|
|
63
|
+
interface FrameworkInfo {
|
|
64
|
+
framework: string;
|
|
65
|
+
componentPath: string;
|
|
66
|
+
sourceFile?: string;
|
|
67
|
+
frameworkVersion?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ElementContext {
|
|
70
|
+
element: ElementInfo;
|
|
71
|
+
framework?: FrameworkInfo;
|
|
72
|
+
htmlSnippet: string;
|
|
73
|
+
cssSelector: string;
|
|
74
|
+
computedStyles: Record<string, string>;
|
|
75
|
+
}
|
|
76
|
+
interface ComponentInfo {
|
|
77
|
+
name: string;
|
|
78
|
+
displayName?: string;
|
|
79
|
+
filePath?: string;
|
|
80
|
+
lineNumber?: number;
|
|
81
|
+
props?: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
interface SourceLocation {
|
|
84
|
+
file: string;
|
|
85
|
+
line?: number;
|
|
86
|
+
column?: number;
|
|
87
|
+
}
|
|
88
|
+
interface Plugin {
|
|
89
|
+
name: string;
|
|
90
|
+
setup?(api: PinpointAPI, hooks: PluginHookRegistry): void;
|
|
91
|
+
hooks?: PluginHooks;
|
|
92
|
+
actions?: ContextMenuAction[];
|
|
93
|
+
}
|
|
94
|
+
interface PluginHooks {
|
|
95
|
+
onElementSelect?(element: Element, info: ElementContext): void;
|
|
96
|
+
onElementHover?(element: Element): void;
|
|
97
|
+
onBeforeCopy?(context: CopyContext): CopyContext | false;
|
|
98
|
+
transformOutput?(output: string): string;
|
|
99
|
+
onPinCreate?(pin: Pin): void;
|
|
100
|
+
onPinResolve?(pin: Pin): void;
|
|
101
|
+
}
|
|
102
|
+
interface PluginHookRegistry {
|
|
103
|
+
register(hookName: keyof PluginHooks, handler: Function): void;
|
|
104
|
+
unregister(hookName: keyof PluginHooks, handler: Function): void;
|
|
105
|
+
}
|
|
106
|
+
interface CopyContext {
|
|
107
|
+
pins: Pin[];
|
|
108
|
+
format: OutputFormat;
|
|
109
|
+
output: string;
|
|
110
|
+
}
|
|
111
|
+
type OutputFormat = "compact" | "standard" | "detailed";
|
|
112
|
+
interface ContextMenuAction {
|
|
113
|
+
label: string;
|
|
114
|
+
icon?: string;
|
|
115
|
+
handler(element: Element, context: ElementContext): void;
|
|
116
|
+
}
|
|
117
|
+
interface PinpointAPI {
|
|
118
|
+
activate(): void;
|
|
119
|
+
deactivate(): void;
|
|
120
|
+
toggle(): void;
|
|
121
|
+
isActive(): boolean;
|
|
122
|
+
copyElement(element: Element): Promise<boolean>;
|
|
123
|
+
getElementContext(element: Element): Promise<ElementContext>;
|
|
124
|
+
freeze(elements?: Element[]): void;
|
|
125
|
+
unfreeze(): void;
|
|
126
|
+
openFile(filePath: string, lineNumber?: number): Promise<void>;
|
|
127
|
+
registerPlugin(plugin: Plugin): void;
|
|
128
|
+
unregisterPlugin(name: string): void;
|
|
129
|
+
getPins(): Pin[];
|
|
130
|
+
createPin(element: Element, comment: string): Pin;
|
|
131
|
+
resolvePin(id: string, message?: string): void;
|
|
132
|
+
dispose(): void;
|
|
133
|
+
}
|
|
134
|
+
interface PinStorage {
|
|
135
|
+
load(pageUrl: string): Promise<Pin[]>;
|
|
136
|
+
save(pin: Pin): Promise<void>;
|
|
137
|
+
update(id: string, patch: Partial<Pin>): Promise<void>;
|
|
138
|
+
delete(id: string): Promise<void>;
|
|
139
|
+
list(filter?: {
|
|
140
|
+
pageUrl?: string;
|
|
141
|
+
status?: PinStatus;
|
|
142
|
+
}): Promise<Pin[]>;
|
|
143
|
+
clear(pageUrl?: string): Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
interface PinpointConfig {
|
|
146
|
+
target?: HTMLElement;
|
|
147
|
+
author?: string;
|
|
148
|
+
endpoint?: string;
|
|
149
|
+
colorScheme?: "auto" | "light" | "dark";
|
|
150
|
+
outputFormat?: OutputFormat;
|
|
151
|
+
autoSubmit?: boolean;
|
|
152
|
+
clearOnSend?: boolean;
|
|
153
|
+
sendToAgent?: (output: AgentOutput) => void | Promise<void>;
|
|
154
|
+
blockInteractions?: boolean;
|
|
155
|
+
freezeJSTimers?: boolean;
|
|
156
|
+
allowedOrigins?: string[];
|
|
157
|
+
webhookUrl?: string;
|
|
158
|
+
includeSourcePaths?: boolean;
|
|
159
|
+
plugins?: Plugin[];
|
|
160
|
+
storage?: PinStorage;
|
|
161
|
+
position?: {
|
|
162
|
+
x: number;
|
|
163
|
+
y: number;
|
|
164
|
+
};
|
|
165
|
+
markerColor?: string;
|
|
166
|
+
compactPopup?: boolean;
|
|
167
|
+
}
|
|
168
|
+
interface FrameworkAdapter {
|
|
169
|
+
name: string;
|
|
170
|
+
detect(): boolean;
|
|
171
|
+
getComponentInfo(element: Element): ComponentInfo | null;
|
|
172
|
+
getSourceLocation(element: Element): SourceLocation | null;
|
|
173
|
+
freeze?(): void;
|
|
174
|
+
unfreeze?(): void;
|
|
175
|
+
}
|
|
176
|
+
interface PinEvent {
|
|
177
|
+
type: "pin:created" | "pin:updated" | "pin:deleted" | "pin:resolved";
|
|
178
|
+
pin: Pin;
|
|
179
|
+
timestamp: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type { AgentOutput, ComponentInfo, ContextMenuAction, CopyContext, DrawStroke, DrawToolType, ElementContext, ElementInfo, FrameworkAdapter, FrameworkInfo, OutputFormat, Pin, PinEvent, PinStatus, PinStorage, PinpointAPI, PinpointConfig, Plugin, PluginHookRegistry, PluginHooks, QueuedAnnotation, SourceLocation, TextNote, ToolbarMode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/pinpoint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.63",
|
|
4
4
|
"description": "Visual feedback and annotation tool for agent-native web applications",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"typescript-7": "npm:typescript@^7.0.2",
|
|
72
72
|
"vite-plugin-solid": "^2.11.0",
|
|
73
73
|
"vitest": "^4.1.5",
|
|
74
|
-
"@agent-native/core": "0.
|
|
74
|
+
"@agent-native/core": "0.198.1"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"@agent-native/core": ">=0.8.0",
|