@agent-native/pinpoint 0.1.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.
- package/.agents/skills/pinpoint/SKILL.md +77 -0
- package/README.md +408 -0
- package/dist/agent-context-76ZW6ODH.js +13 -0
- package/dist/agent-context-76ZW6ODH.js.map +1 -0
- package/dist/chunk-5OW42OKO.js +4897 -0
- package/dist/chunk-5OW42OKO.js.map +1 -0
- package/dist/chunk-BB7X7W3H.js +94 -0
- package/dist/chunk-BB7X7W3H.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +11 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/chunk-EPXBFDY6.js +88 -0
- package/dist/chunk-EPXBFDY6.js.map +1 -0
- package/dist/chunk-JCYY4S7A.js +53 -0
- package/dist/chunk-JCYY4S7A.js.map +1 -0
- package/dist/chunk-W7IKAJ3P.js +569 -0
- package/dist/chunk-W7IKAJ3P.js.map +1 -0
- package/dist/chunk-Y7IWDHIU.js +25 -0
- package/dist/chunk-Y7IWDHIU.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +71 -0
- package/dist/cli.js.map +1 -0
- package/dist/formatter-25JPHXYA.js +8 -0
- package/dist/formatter-25JPHXYA.js.map +1 -0
- package/dist/index-5or67wLi.d.ts +193 -0
- package/dist/index-CJGmgMCD.d.ts +79 -0
- package/dist/index.browser.d.ts +381 -0
- package/dist/index.browser.js +657 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.d.ts +269 -0
- package/dist/index.js +973 -0
- package/dist/index.js.map +1 -0
- package/dist/open-file-RQVHOCXI.js +8 -0
- package/dist/open-file-RQVHOCXI.js.map +1 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +28 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/react.d.ts +23 -0
- package/dist/react.js +20 -0
- package/dist/react.js.map +1 -0
- package/dist/server/index.d.ts +161 -0
- package/dist/server/index.js +457 -0
- package/dist/server/index.js.map +1 -0
- package/dist/types/index.d.ts +193 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +83 -0
- package/src/scripts/create-pin.ts +41 -0
- package/src/scripts/delete-pin.ts +15 -0
- package/src/scripts/get-pins.ts +35 -0
- package/src/scripts/list-sessions.ts +33 -0
- package/src/scripts/resolve-pin.ts +26 -0
- package/src/scripts/run.ts +8 -0
- package/src/scripts/update-pin.ts +31 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/cli.ts
|
|
4
|
+
import { existsSync, mkdirSync, cpSync, readdirSync } from "fs";
|
|
5
|
+
import { resolve, dirname, join } from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
var command = process.argv[2];
|
|
9
|
+
if (command === "init") {
|
|
10
|
+
init();
|
|
11
|
+
} else {
|
|
12
|
+
console.log("Usage: npx @agent-native/pinpoint init");
|
|
13
|
+
console.log("");
|
|
14
|
+
console.log("Commands:");
|
|
15
|
+
console.log(" init Copy agent scripts and skill to your project");
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
function init() {
|
|
19
|
+
const projectRoot = process.cwd();
|
|
20
|
+
const scriptsSource = resolve(__dirname, "../src/scripts");
|
|
21
|
+
const scriptsDest = resolve(projectRoot, "scripts");
|
|
22
|
+
if (!existsSync(scriptsDest)) {
|
|
23
|
+
mkdirSync(scriptsDest, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
const scriptFiles = readdirSync(scriptsSource).filter(
|
|
26
|
+
(f) => f.endsWith(".ts")
|
|
27
|
+
);
|
|
28
|
+
let copiedScripts = 0;
|
|
29
|
+
for (const file of scriptFiles) {
|
|
30
|
+
const dest = join(scriptsDest, file);
|
|
31
|
+
if (existsSync(dest)) {
|
|
32
|
+
console.log(` skip scripts/${file} (already exists)`);
|
|
33
|
+
} else {
|
|
34
|
+
cpSync(join(scriptsSource, file), dest);
|
|
35
|
+
console.log(` added scripts/${file}`);
|
|
36
|
+
copiedScripts++;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const skillSource = resolve(__dirname, "../.agents/skills/pinpoint");
|
|
40
|
+
const skillDest = resolve(projectRoot, ".agents/skills/pinpoint");
|
|
41
|
+
if (existsSync(skillSource)) {
|
|
42
|
+
if (!existsSync(skillDest)) {
|
|
43
|
+
mkdirSync(skillDest, { recursive: true });
|
|
44
|
+
}
|
|
45
|
+
const skillFile = join(skillSource, "SKILL.md");
|
|
46
|
+
const skillDestFile = join(skillDest, "SKILL.md");
|
|
47
|
+
if (existsSync(skillFile)) {
|
|
48
|
+
if (existsSync(skillDestFile)) {
|
|
49
|
+
console.log(
|
|
50
|
+
" skip .agents/skills/pinpoint/SKILL.md (already exists)"
|
|
51
|
+
);
|
|
52
|
+
} else {
|
|
53
|
+
cpSync(skillFile, skillDestFile);
|
|
54
|
+
console.log(" added .agents/skills/pinpoint/SKILL.md");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
console.log("");
|
|
59
|
+
console.log(
|
|
60
|
+
copiedScripts > 0 ? "Pinpoint initialized. Agent scripts are in scripts/." : "Pinpoint already initialized. No new files copied."
|
|
61
|
+
);
|
|
62
|
+
console.log("");
|
|
63
|
+
console.log("Next steps:");
|
|
64
|
+
console.log(
|
|
65
|
+
" 1. Add <Pinpoint /> to your client: import { Pinpoint } from '@agent-native/pinpoint/react'"
|
|
66
|
+
);
|
|
67
|
+
console.log(
|
|
68
|
+
' 2. Add middleware to your server: app.use("/api/pins", pagePinRoutes())'
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n// @agent-native/pinpoint — CLI for project setup\n// MIT License\n//\n// Usage: npx @agent-native/pinpoint init\n\nimport { existsSync, mkdirSync, cpSync, readdirSync } from \"node:fs\";\nimport { resolve, dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst command = process.argv[2];\n\nif (command === \"init\") {\n init();\n} else {\n console.log(\"Usage: npx @agent-native/pinpoint init\");\n console.log(\"\");\n console.log(\"Commands:\");\n console.log(\" init Copy agent scripts and skill to your project\");\n process.exit(0);\n}\n\nfunction init() {\n const projectRoot = process.cwd();\n\n // 1. Copy agent scripts to scripts/\n const scriptsSource = resolve(__dirname, \"../src/scripts\");\n const scriptsDest = resolve(projectRoot, \"scripts\");\n\n if (!existsSync(scriptsDest)) {\n mkdirSync(scriptsDest, { recursive: true });\n }\n\n const scriptFiles = readdirSync(scriptsSource).filter((f) =>\n f.endsWith(\".ts\"),\n );\n let copiedScripts = 0;\n\n for (const file of scriptFiles) {\n const dest = join(scriptsDest, file);\n if (existsSync(dest)) {\n console.log(` skip scripts/${file} (already exists)`);\n } else {\n cpSync(join(scriptsSource, file), dest);\n console.log(` added scripts/${file}`);\n copiedScripts++;\n }\n }\n\n // 2. Copy agent skill if .agents/ directory pattern exists\n const skillSource = resolve(__dirname, \"../.agents/skills/pinpoint\");\n const skillDest = resolve(projectRoot, \".agents/skills/pinpoint\");\n\n if (existsSync(skillSource)) {\n if (!existsSync(skillDest)) {\n mkdirSync(skillDest, { recursive: true });\n }\n const skillFile = join(skillSource, \"SKILL.md\");\n const skillDestFile = join(skillDest, \"SKILL.md\");\n if (existsSync(skillFile)) {\n if (existsSync(skillDestFile)) {\n console.log(\n \" skip .agents/skills/pinpoint/SKILL.md (already exists)\",\n );\n } else {\n cpSync(skillFile, skillDestFile);\n console.log(\" added .agents/skills/pinpoint/SKILL.md\");\n }\n }\n }\n\n console.log(\"\");\n console.log(\n copiedScripts > 0\n ? \"Pinpoint initialized. Agent scripts are in scripts/.\"\n : \"Pinpoint already initialized. No new files copied.\",\n );\n console.log(\"\");\n console.log(\"Next steps:\");\n console.log(\n \" 1. Add <Pinpoint /> to your client: import { Pinpoint } from '@agent-native/pinpoint/react'\",\n );\n console.log(\n ' 2. Add middleware to your server: app.use(\"/api/pins\", pagePinRoutes())',\n );\n}\n"],"mappings":";;;AAMA,SAAS,YAAY,WAAW,QAAQ,mBAAmB;AAC3D,SAAS,SAAS,SAAS,YAAY;AACvC,SAAS,qBAAqB;AAE9B,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,IAAM,UAAU,QAAQ,KAAK,CAAC;AAE9B,IAAI,YAAY,QAAQ;AACtB,OAAK;AACP,OAAO;AACL,UAAQ,IAAI,wCAAwC;AACpD,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,WAAW;AACvB,UAAQ,IAAI,wDAAwD;AACpE,UAAQ,KAAK,CAAC;AAChB;AAEA,SAAS,OAAO;AACd,QAAM,cAAc,QAAQ,IAAI;AAGhC,QAAM,gBAAgB,QAAQ,WAAW,gBAAgB;AACzD,QAAM,cAAc,QAAQ,aAAa,SAAS;AAElD,MAAI,CAAC,WAAW,WAAW,GAAG;AAC5B,cAAU,aAAa,EAAE,WAAW,KAAK,CAAC;AAAA,EAC5C;AAEA,QAAM,cAAc,YAAY,aAAa,EAAE;AAAA,IAAO,CAAC,MACrD,EAAE,SAAS,KAAK;AAAA,EAClB;AACA,MAAI,gBAAgB;AAEpB,aAAW,QAAQ,aAAa;AAC9B,UAAM,OAAO,KAAK,aAAa,IAAI;AACnC,QAAI,WAAW,IAAI,GAAG;AACpB,cAAQ,IAAI,mBAAmB,IAAI,mBAAmB;AAAA,IACxD,OAAO;AACL,aAAO,KAAK,eAAe,IAAI,GAAG,IAAI;AACtC,cAAQ,IAAI,mBAAmB,IAAI,EAAE;AACrC;AAAA,IACF;AAAA,EACF;AAGA,QAAM,cAAc,QAAQ,WAAW,4BAA4B;AACnE,QAAM,YAAY,QAAQ,aAAa,yBAAyB;AAEhE,MAAI,WAAW,WAAW,GAAG;AAC3B,QAAI,CAAC,WAAW,SAAS,GAAG;AAC1B,gBAAU,WAAW,EAAE,WAAW,KAAK,CAAC;AAAA,IAC1C;AACA,UAAM,YAAY,KAAK,aAAa,UAAU;AAC9C,UAAM,gBAAgB,KAAK,WAAW,UAAU;AAChD,QAAI,WAAW,SAAS,GAAG;AACzB,UAAI,WAAW,aAAa,GAAG;AAC7B,gBAAQ;AAAA,UACN;AAAA,QACF;AAAA,MACF,OAAO;AACL,eAAO,WAAW,aAAa;AAC/B,gBAAQ,IAAI,0CAA0C;AAAA,MACxD;AAAA,IACF;AAAA,EACF;AAEA,UAAQ,IAAI,EAAE;AACd,UAAQ;AAAA,IACN,gBAAgB,IACZ,yDACA;AAAA,EACN;AACA,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,aAAa;AACzB,UAAQ;AAAA,IACN;AAAA,EACF;AACA,UAAQ;AAAA,IACN;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,193 @@
|
|
|
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
|
+
type ToolbarMode = "select" | "draw" | "queue";
|
|
26
|
+
interface Pin {
|
|
27
|
+
id: string;
|
|
28
|
+
pageUrl: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
author?: string;
|
|
32
|
+
comment: string;
|
|
33
|
+
element: ElementInfo;
|
|
34
|
+
framework?: FrameworkInfo;
|
|
35
|
+
status: {
|
|
36
|
+
state: PinStatus;
|
|
37
|
+
changedAt: string;
|
|
38
|
+
changedBy?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
interface ElementInfo {
|
|
42
|
+
tagName: string;
|
|
43
|
+
id?: string;
|
|
44
|
+
classNames: string[];
|
|
45
|
+
selector: string;
|
|
46
|
+
textContent?: string;
|
|
47
|
+
boundingRect: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
};
|
|
53
|
+
computedStyles?: Record<string, string>;
|
|
54
|
+
ariaAttributes?: Record<string, string>;
|
|
55
|
+
dataAttributes?: Record<string, string>;
|
|
56
|
+
domPath?: string;
|
|
57
|
+
}
|
|
58
|
+
interface FrameworkInfo {
|
|
59
|
+
framework: string;
|
|
60
|
+
componentPath: string;
|
|
61
|
+
sourceFile?: string;
|
|
62
|
+
frameworkVersion?: string;
|
|
63
|
+
}
|
|
64
|
+
interface ElementContext {
|
|
65
|
+
element: ElementInfo;
|
|
66
|
+
framework?: FrameworkInfo;
|
|
67
|
+
htmlSnippet: string;
|
|
68
|
+
cssSelector: string;
|
|
69
|
+
computedStyles: Record<string, string>;
|
|
70
|
+
}
|
|
71
|
+
interface ComponentInfo {
|
|
72
|
+
name: string;
|
|
73
|
+
displayName?: string;
|
|
74
|
+
filePath?: string;
|
|
75
|
+
lineNumber?: number;
|
|
76
|
+
props?: Record<string, unknown>;
|
|
77
|
+
}
|
|
78
|
+
interface SourceLocation {
|
|
79
|
+
file: string;
|
|
80
|
+
line?: number;
|
|
81
|
+
column?: number;
|
|
82
|
+
}
|
|
83
|
+
interface Plugin {
|
|
84
|
+
name: string;
|
|
85
|
+
setup?(api: PinpointAPI, hooks: PluginHookRegistry): void;
|
|
86
|
+
hooks?: PluginHooks;
|
|
87
|
+
actions?: ContextMenuAction[];
|
|
88
|
+
}
|
|
89
|
+
interface PluginHooks {
|
|
90
|
+
onElementSelect?(element: Element, info: ElementContext): void;
|
|
91
|
+
onElementHover?(element: Element): void;
|
|
92
|
+
onBeforeCopy?(context: CopyContext): CopyContext | false;
|
|
93
|
+
transformOutput?(output: string): string;
|
|
94
|
+
onPinCreate?(pin: Pin): void;
|
|
95
|
+
onPinResolve?(pin: Pin): void;
|
|
96
|
+
}
|
|
97
|
+
interface PluginHookRegistry {
|
|
98
|
+
register(hookName: keyof PluginHooks, handler: Function): void;
|
|
99
|
+
unregister(hookName: keyof PluginHooks, handler: Function): void;
|
|
100
|
+
}
|
|
101
|
+
interface CopyContext {
|
|
102
|
+
pins: Pin[];
|
|
103
|
+
format: OutputFormat;
|
|
104
|
+
output: string;
|
|
105
|
+
}
|
|
106
|
+
type OutputFormat = "compact" | "standard" | "detailed";
|
|
107
|
+
interface ContextMenuAction {
|
|
108
|
+
label: string;
|
|
109
|
+
icon?: string;
|
|
110
|
+
handler(element: Element, context: ElementContext): void;
|
|
111
|
+
}
|
|
112
|
+
interface PinpointAPI {
|
|
113
|
+
activate(): void;
|
|
114
|
+
deactivate(): void;
|
|
115
|
+
toggle(): void;
|
|
116
|
+
isActive(): boolean;
|
|
117
|
+
copyElement(element: Element): Promise<boolean>;
|
|
118
|
+
getElementContext(element: Element): Promise<ElementContext>;
|
|
119
|
+
freeze(elements?: Element[]): void;
|
|
120
|
+
unfreeze(): void;
|
|
121
|
+
openFile(filePath: string, lineNumber?: number): Promise<void>;
|
|
122
|
+
registerPlugin(plugin: Plugin): void;
|
|
123
|
+
unregisterPlugin(name: string): void;
|
|
124
|
+
getPins(): Pin[];
|
|
125
|
+
createPin(element: Element, comment: string): Pin;
|
|
126
|
+
resolvePin(id: string, message?: string): void;
|
|
127
|
+
dispose(): void;
|
|
128
|
+
}
|
|
129
|
+
interface PinStorage {
|
|
130
|
+
load(pageUrl: string): Promise<Pin[]>;
|
|
131
|
+
save(pin: Pin): Promise<void>;
|
|
132
|
+
update(id: string, patch: Partial<Pin>): Promise<void>;
|
|
133
|
+
delete(id: string): Promise<void>;
|
|
134
|
+
list(filter?: {
|
|
135
|
+
pageUrl?: string;
|
|
136
|
+
status?: PinStatus;
|
|
137
|
+
}): Promise<Pin[]>;
|
|
138
|
+
clear(pageUrl?: string): Promise<void>;
|
|
139
|
+
}
|
|
140
|
+
interface PinpointConfig {
|
|
141
|
+
/** Target element to mount pinpoint into */
|
|
142
|
+
target?: HTMLElement;
|
|
143
|
+
/** Author name for annotations */
|
|
144
|
+
author?: string;
|
|
145
|
+
/** REST API endpoint for pin storage */
|
|
146
|
+
endpoint?: string;
|
|
147
|
+
/** Color scheme */
|
|
148
|
+
colorScheme?: "auto" | "light" | "dark";
|
|
149
|
+
/** Output detail level */
|
|
150
|
+
outputFormat?: OutputFormat;
|
|
151
|
+
/** Auto-submit to agent chat */
|
|
152
|
+
autoSubmit?: boolean;
|
|
153
|
+
/** Clear pins after sending */
|
|
154
|
+
clearOnSend?: boolean;
|
|
155
|
+
/** Block page interactions during annotation */
|
|
156
|
+
blockInteractions?: boolean;
|
|
157
|
+
/** Freeze JS timers (opt-in, disabled by default) */
|
|
158
|
+
freezeJSTimers?: boolean;
|
|
159
|
+
/** Allowed origins for postMessage */
|
|
160
|
+
allowedOrigins?: string[];
|
|
161
|
+
/** Webhook URL for pin events */
|
|
162
|
+
webhookUrl?: string;
|
|
163
|
+
/** Include source file paths in output */
|
|
164
|
+
includeSourcePaths?: boolean;
|
|
165
|
+
/** Plugins */
|
|
166
|
+
plugins?: Plugin[];
|
|
167
|
+
/** Custom storage adapter */
|
|
168
|
+
storage?: PinStorage;
|
|
169
|
+
/** Initial position of the toolbar */
|
|
170
|
+
position?: {
|
|
171
|
+
x: number;
|
|
172
|
+
y: number;
|
|
173
|
+
};
|
|
174
|
+
/** Marker color */
|
|
175
|
+
markerColor?: string;
|
|
176
|
+
/** Compact popup — hide technical details behind a toggle (default: true) */
|
|
177
|
+
compactPopup?: boolean;
|
|
178
|
+
}
|
|
179
|
+
interface FrameworkAdapter {
|
|
180
|
+
name: string;
|
|
181
|
+
detect(): boolean;
|
|
182
|
+
getComponentInfo(element: Element): ComponentInfo | null;
|
|
183
|
+
getSourceLocation(element: Element): SourceLocation | null;
|
|
184
|
+
freeze?(): void;
|
|
185
|
+
unfreeze?(): void;
|
|
186
|
+
}
|
|
187
|
+
interface PinEvent {
|
|
188
|
+
type: "pin:created" | "pin:updated" | "pin:deleted" | "pin:resolved";
|
|
189
|
+
pin: Pin;
|
|
190
|
+
timestamp: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export type { ComponentInfo as C, DrawStroke as D, ElementContext as E, FrameworkInfo as F, OutputFormat as O, PinStorage as P, QueuedAnnotation as Q, SourceLocation as S, TextNote as T, Pin as a, PinStatus as b, ElementInfo as c, FrameworkAdapter as d, PluginHooks as e, Plugin as f, PinpointAPI as g, PinpointConfig as h, ContextMenuAction as i, CopyContext as j, DrawToolType as k, PinEvent as l, ToolbarMode as m };
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
/** Timeout for selector generation (ms) */
|
|
18
|
+
timeoutMs?: number;
|
|
19
|
+
/** Additional class names to skip */
|
|
20
|
+
skipClassPatterns?: RegExp[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generate a unique, human-readable CSS selector for an element.
|
|
24
|
+
* Uses @medv/finder (MIT) with configuration to skip CSS-in-JS hashes.
|
|
25
|
+
*/
|
|
26
|
+
declare function buildSelector(element: Element, options?: SelectorOptions): string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Extract comprehensive metadata from a DOM element.
|
|
30
|
+
*/
|
|
31
|
+
declare function extractElementInfo(element: Element): ElementInfo;
|
|
32
|
+
/**
|
|
33
|
+
* Build a full ElementContext including HTML snippet and framework info.
|
|
34
|
+
*/
|
|
35
|
+
declare function buildElementContext(element: Element, frameworkInfo?: FrameworkInfo): ElementContext;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Register a framework adapter. Adapters are tried in registration order.
|
|
39
|
+
*/
|
|
40
|
+
declare function registerAdapter(adapter: FrameworkAdapter): void;
|
|
41
|
+
/**
|
|
42
|
+
* Auto-detect the current framework by trying each adapter's detect() method.
|
|
43
|
+
* Returns the first matching adapter, or the generic fallback.
|
|
44
|
+
*/
|
|
45
|
+
declare function detectFramework(): FrameworkAdapter;
|
|
46
|
+
/**
|
|
47
|
+
* Get component info for an element using the detected framework adapter.
|
|
48
|
+
*/
|
|
49
|
+
declare function getComponentInfo(element: Element): ComponentInfo | null;
|
|
50
|
+
/**
|
|
51
|
+
* Get source location for an element using the detected framework adapter.
|
|
52
|
+
*/
|
|
53
|
+
declare function getSourceLocation(element: Element): SourceLocation | null;
|
|
54
|
+
|
|
55
|
+
interface FreezeOptions {
|
|
56
|
+
/** Freeze JS timers (opt-in, disabled by default) */
|
|
57
|
+
jsTimers?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Freeze all animations, transitions, React updates, and media.
|
|
61
|
+
* Call unfreeze() to restore.
|
|
62
|
+
*/
|
|
63
|
+
declare function freeze(_elements?: Element[], options?: FreezeOptions): void;
|
|
64
|
+
/**
|
|
65
|
+
* Unfreeze everything and restore normal behavior.
|
|
66
|
+
*/
|
|
67
|
+
declare function unfreeze(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Check if freeze is currently active.
|
|
70
|
+
*/
|
|
71
|
+
declare function isFreezeActive(): boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Open a file in the user's editor. Tries vscode:// protocol first,
|
|
75
|
+
* falls back to a fetch to /api/open-file.
|
|
76
|
+
*/
|
|
77
|
+
declare function openFile(filePath: string, lineNumber?: number): Promise<void>;
|
|
78
|
+
|
|
79
|
+
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 };
|