pinpoints 0.1.4
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/LICENSE +22 -0
- package/README.md +187 -0
- package/out/browser/browserSessionManager.d.ts +19 -0
- package/out/browser/browserSessionManager.d.ts.map +1 -0
- package/out/browser/browserSessionManager.js +169 -0
- package/out/browser/browserSessionManager.js.map +1 -0
- package/out/cli/index.d.ts +3 -0
- package/out/cli/index.d.ts.map +1 -0
- package/out/cli/index.js +564 -0
- package/out/cli/index.js.map +1 -0
- package/out/core/pickerToolbar.d.ts +9 -0
- package/out/core/pickerToolbar.d.ts.map +1 -0
- package/out/core/pickerToolbar.js +475 -0
- package/out/core/pickerToolbar.js.map +1 -0
- package/out/export/contextFormatter.d.ts +9 -0
- package/out/export/contextFormatter.d.ts.map +1 -0
- package/out/export/contextFormatter.js +151 -0
- package/out/export/contextFormatter.js.map +1 -0
- package/out/extension.d.ts +4 -0
- package/out/extension.d.ts.map +1 -0
- package/out/extension.js +95 -0
- package/out/extension.js.map +1 -0
- package/out/extraction/domExtractor.d.ts +10 -0
- package/out/extraction/domExtractor.d.ts.map +1 -0
- package/out/extraction/domExtractor.js +72 -0
- package/out/extraction/domExtractor.js.map +1 -0
- package/out/extraction/layoutExtractor.d.ts +11 -0
- package/out/extraction/layoutExtractor.d.ts.map +1 -0
- package/out/extraction/layoutExtractor.js +107 -0
- package/out/extraction/layoutExtractor.js.map +1 -0
- package/out/extraction/redactor.d.ts +9 -0
- package/out/extraction/redactor.d.ts.map +1 -0
- package/out/extraction/redactor.js +78 -0
- package/out/extraction/redactor.js.map +1 -0
- package/out/extraction/screenshotExtractor.d.ts +7 -0
- package/out/extraction/screenshotExtractor.d.ts.map +1 -0
- package/out/extraction/screenshotExtractor.js +104 -0
- package/out/extraction/screenshotExtractor.js.map +1 -0
- package/out/extraction/selectorExtractor.d.ts +16 -0
- package/out/extraction/selectorExtractor.d.ts.map +1 -0
- package/out/extraction/selectorExtractor.js +172 -0
- package/out/extraction/selectorExtractor.js.map +1 -0
- package/out/extraction/styleExtractor.d.ts +10 -0
- package/out/extraction/styleExtractor.d.ts.map +1 -0
- package/out/extraction/styleExtractor.js +96 -0
- package/out/extraction/styleExtractor.js.map +1 -0
- package/out/picker/pickerController.d.ts +33 -0
- package/out/picker/pickerController.d.ts.map +1 -0
- package/out/picker/pickerController.js +979 -0
- package/out/picker/pickerController.js.map +1 -0
- package/out/schemas/index.d.ts +418 -0
- package/out/schemas/index.d.ts.map +1 -0
- package/out/schemas/index.js +128 -0
- package/out/schemas/index.js.map +1 -0
- package/out/source/sourceLocator.d.ts +7 -0
- package/out/source/sourceLocator.d.ts.map +1 -0
- package/out/source/sourceLocator.js +37 -0
- package/out/source/sourceLocator.js.map +1 -0
- package/out/source/sourceMapResolver.d.ts +17 -0
- package/out/source/sourceMapResolver.d.ts.map +1 -0
- package/out/source/sourceMapResolver.js +204 -0
- package/out/source/sourceMapResolver.js.map +1 -0
- package/out/source/workspaceGrep.d.ts +30 -0
- package/out/source/workspaceGrep.d.ts.map +1 -0
- package/out/source/workspaceGrep.js +237 -0
- package/out/source/workspaceGrep.js.map +1 -0
- package/out/testPaste.d.ts +1 -0
- package/out/testPaste.d.ts.map +1 -0
- package/out/testPaste.js +3 -0
- package/out/testPaste.js.map +1 -0
- package/out/ui/statusBarManager.d.ts +14 -0
- package/out/ui/statusBarManager.d.ts.map +1 -0
- package/out/ui/statusBarManager.js +89 -0
- package/out/ui/statusBarManager.js.map +1 -0
- package/package.json +132 -0
- package/resources/fonts/icons.css +19 -0
- package/resources/fonts/icons.html +69 -0
- package/resources/fonts/icons.json +3 -0
- package/resources/fonts/icons.ts +13 -0
- package/resources/fonts/icons.woff +0 -0
- package/resources/icon.png +0 -0
- package/resources/icons/pinpoint-logo.svg +4 -0
- package/resources/logo.svg +97 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourceLocator = void 0;
|
|
4
|
+
const sourceMapResolver_1 = require("./sourceMapResolver");
|
|
5
|
+
const workspaceGrep_1 = require("./workspaceGrep");
|
|
6
|
+
class SourceLocator {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.sourceMapResolver = new sourceMapResolver_1.SourceMapResolver();
|
|
9
|
+
}
|
|
10
|
+
async locate(page, identity, dom, workspaceRoot) {
|
|
11
|
+
const workspaceGrep = new workspaceGrep_1.WorkspaceGrep(new workspaceGrep_1.NodeWorkspaceFileProvider(workspaceRoot));
|
|
12
|
+
// Build signals from identity/dom for both strategies
|
|
13
|
+
const signals = workspaceGrep.buildSignals(identity, dom);
|
|
14
|
+
if (signals.length === 0)
|
|
15
|
+
return undefined;
|
|
16
|
+
// Strategy 1: Source maps (most accurate)
|
|
17
|
+
try {
|
|
18
|
+
const sourceMapResult = await this.sourceMapResolver.resolve(page, signals, workspaceRoot);
|
|
19
|
+
if (sourceMapResult && sourceMapResult.confidence >= 0.3) {
|
|
20
|
+
return sourceMapResult;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.warn('Source map resolution failed, falling back to grep:', error);
|
|
25
|
+
}
|
|
26
|
+
// Strategy 2: Workspace grep (fallback)
|
|
27
|
+
try {
|
|
28
|
+
return await workspaceGrep.search(identity, dom);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.warn('Workspace grep failed:', error);
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.SourceLocator = SourceLocator;
|
|
37
|
+
//# sourceMappingURL=sourceLocator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceLocator.js","sourceRoot":"","sources":["../../src/source/sourceLocator.ts"],"names":[],"mappings":";;;AAEA,2DAAwD;AACxD,mDAA2E;AAE3E,MAAa,aAAa;IAA1B;QACU,sBAAiB,GAAG,IAAI,qCAAiB,EAAE,CAAC;IAiCtD,CAAC;IA/BC,KAAK,CAAC,MAAM,CACV,IAAoB,EACpB,QAAkB,EAClB,GAAe,EACf,aAAqB;QAErB,MAAM,aAAa,GAAG,IAAI,6BAAa,CAAC,IAAI,yCAAyB,CAAC,aAAa,CAAC,CAAC,CAAC;QAEtF,sDAAsD;QACtD,MAAM,OAAO,GAAG,aAAa,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAE1D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAE3C,0CAA0C;QAC1C,IAAI,CAAC;YACH,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;YAC3F,IAAI,eAAe,IAAI,eAAe,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;gBACzD,OAAO,eAAe,CAAC;YACzB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,qDAAqD,EAAE,KAAK,CAAC,CAAC;QAC7E,CAAC;QAED,wCAAwC;QACxC,IAAI,CAAC;YACH,OAAO,MAAM,aAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;YAC9C,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AAlCD,sCAkCC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as puppeteer from 'puppeteer-core';
|
|
2
|
+
import { SourceLocation } from '../schemas';
|
|
3
|
+
interface Signal {
|
|
4
|
+
text: string;
|
|
5
|
+
weight: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class SourceMapResolver {
|
|
8
|
+
private sourceMaps;
|
|
9
|
+
private sourceContents;
|
|
10
|
+
resolve(page: puppeteer.Page, signals: Signal[], workspaceRoot: string): Promise<SourceLocation | undefined>;
|
|
11
|
+
private collectSourceMapEntries;
|
|
12
|
+
private fetchAndParse;
|
|
13
|
+
private searchSourceContents;
|
|
14
|
+
private resolveToWorkspace;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=sourceMapResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceMapResolver.d.ts","sourceRoot":"","sources":["../../src/source/sourceMapResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAQD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,cAAc,CAAqE;IAErF,OAAO,CACX,IAAI,EAAE,SAAS,CAAC,IAAI,EACpB,OAAO,EAAE,MAAM,EAAE,EACjB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;YAsBxB,uBAAuB;YA8CvB,aAAa;IAsD3B,OAAO,CAAC,oBAAoB;IA4D5B,OAAO,CAAC,kBAAkB;CAmC3B"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourceMapResolver = void 0;
|
|
4
|
+
const trace_mapping_1 = require("@jridgewell/trace-mapping");
|
|
5
|
+
class SourceMapResolver {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.sourceMaps = new Map();
|
|
8
|
+
this.sourceContents = new Map();
|
|
9
|
+
}
|
|
10
|
+
async resolve(page, signals, workspaceRoot) {
|
|
11
|
+
try {
|
|
12
|
+
// Collect source maps from the page
|
|
13
|
+
const entries = await this.collectSourceMapEntries(page);
|
|
14
|
+
if (entries.length === 0) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
// Fetch and parse source maps
|
|
18
|
+
for (const entry of entries) {
|
|
19
|
+
await this.fetchAndParse(page, entry);
|
|
20
|
+
}
|
|
21
|
+
// Search source contents for signals
|
|
22
|
+
return this.searchSourceContents(signals, workspaceRoot);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.warn('Source map resolution failed:', error);
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async collectSourceMapEntries(page) {
|
|
30
|
+
const client = await page.createCDPSession();
|
|
31
|
+
const entries = [];
|
|
32
|
+
try {
|
|
33
|
+
await client.send('Debugger.enable');
|
|
34
|
+
// Get all already-parsed scripts
|
|
35
|
+
const scripts = [];
|
|
36
|
+
// Listen for scripts (covers already-loaded ones when we re-enable)
|
|
37
|
+
const listener = (params) => {
|
|
38
|
+
if (params.sourceMapURL && params.url) {
|
|
39
|
+
scripts.push({
|
|
40
|
+
scriptId: params.scriptId,
|
|
41
|
+
url: params.url,
|
|
42
|
+
sourceMapURL: params.sourceMapURL,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
client.on('Debugger.scriptParsed', listener);
|
|
47
|
+
// Small wait to collect scriptParsed events for already-loaded scripts
|
|
48
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
49
|
+
client.off('Debugger.scriptParsed', listener);
|
|
50
|
+
for (const script of scripts) {
|
|
51
|
+
entries.push({
|
|
52
|
+
url: script.url,
|
|
53
|
+
sourceMapURL: script.sourceMapURL,
|
|
54
|
+
scriptId: script.scriptId,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
await client.send('Debugger.disable');
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.warn('Failed to collect source map entries:', error);
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
await client.detach().catch(() => { });
|
|
64
|
+
}
|
|
65
|
+
return entries;
|
|
66
|
+
}
|
|
67
|
+
async fetchAndParse(page, entry) {
|
|
68
|
+
try {
|
|
69
|
+
// Resolve source map URL (could be relative or absolute)
|
|
70
|
+
let sourceMapUrl = entry.sourceMapURL;
|
|
71
|
+
if (!sourceMapUrl.startsWith('http') && !sourceMapUrl.startsWith('data:')) {
|
|
72
|
+
const scriptUrl = new URL(entry.url);
|
|
73
|
+
sourceMapUrl = new URL(sourceMapUrl, scriptUrl).toString();
|
|
74
|
+
}
|
|
75
|
+
let sourceMapJson;
|
|
76
|
+
if (sourceMapUrl.startsWith('data:')) {
|
|
77
|
+
// Inline source map
|
|
78
|
+
const base64Match = sourceMapUrl.match(/base64,(.+)/);
|
|
79
|
+
if (!base64Match)
|
|
80
|
+
return;
|
|
81
|
+
sourceMapJson = Buffer.from(base64Match[1], 'base64').toString('utf-8');
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Fetch from URL via page context to avoid CORS
|
|
85
|
+
sourceMapJson = await page.evaluate(async (url) => {
|
|
86
|
+
try {
|
|
87
|
+
const res = await fetch(url);
|
|
88
|
+
if (!res.ok)
|
|
89
|
+
return '';
|
|
90
|
+
return await res.text();
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return '';
|
|
94
|
+
}
|
|
95
|
+
}, sourceMapUrl);
|
|
96
|
+
}
|
|
97
|
+
if (!sourceMapJson)
|
|
98
|
+
return;
|
|
99
|
+
const parsed = JSON.parse(sourceMapJson);
|
|
100
|
+
const traceMap = new trace_mapping_1.TraceMap(parsed);
|
|
101
|
+
this.sourceMaps.set(entry.url, traceMap);
|
|
102
|
+
// Extract source contents for text searching
|
|
103
|
+
if (parsed.sourcesContent && parsed.sources) {
|
|
104
|
+
const contents = [];
|
|
105
|
+
for (let i = 0; i < parsed.sources.length; i++) {
|
|
106
|
+
if (parsed.sourcesContent[i]) {
|
|
107
|
+
contents.push({
|
|
108
|
+
sourcePath: parsed.sources[i],
|
|
109
|
+
content: parsed.sourcesContent[i],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
this.sourceContents.set(entry.url, contents);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
// Skip this source map
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
searchSourceContents(signals, workspaceRoot) {
|
|
121
|
+
const fileScores = new Map();
|
|
122
|
+
for (const [, contents] of this.sourceContents) {
|
|
123
|
+
for (const { sourcePath, content } of contents) {
|
|
124
|
+
// Skip node_modules, vendor, etc.
|
|
125
|
+
if (sourcePath.includes('node_modules') || sourcePath.includes('/vendor/')) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const lines = content.split('\n');
|
|
129
|
+
for (const signal of signals) {
|
|
130
|
+
if (!signal.text)
|
|
131
|
+
continue;
|
|
132
|
+
for (let i = 0; i < lines.length; i++) {
|
|
133
|
+
if (lines[i].includes(signal.text)) {
|
|
134
|
+
const existing = fileScores.get(sourcePath) || { score: 0, line: i + 1, signalCount: 0 };
|
|
135
|
+
existing.score += signal.weight;
|
|
136
|
+
existing.signalCount++;
|
|
137
|
+
// Keep the line of the highest-weight signal
|
|
138
|
+
if (signal.weight > (fileScores.get(sourcePath)?.score || 0) - existing.score + signal.weight) {
|
|
139
|
+
existing.line = i + 1;
|
|
140
|
+
}
|
|
141
|
+
fileScores.set(sourcePath, existing);
|
|
142
|
+
break; // Only count first match per signal per file
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (fileScores.size === 0)
|
|
149
|
+
return undefined;
|
|
150
|
+
// Find best match
|
|
151
|
+
let bestPath = '';
|
|
152
|
+
let bestInfo = { score: 0, line: 1, signalCount: 0 };
|
|
153
|
+
for (const [filePath, info] of fileScores) {
|
|
154
|
+
// Bonus for multiple signals matching
|
|
155
|
+
const adjustedScore = info.score * (1 + info.signalCount * 0.2);
|
|
156
|
+
if (adjustedScore > bestInfo.score * (1 + bestInfo.signalCount * 0.2)) {
|
|
157
|
+
bestPath = filePath;
|
|
158
|
+
bestInfo = info;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (!bestPath)
|
|
162
|
+
return undefined;
|
|
163
|
+
// Resolve to workspace path
|
|
164
|
+
const resolvedPath = this.resolveToWorkspace(bestPath, workspaceRoot);
|
|
165
|
+
return {
|
|
166
|
+
filePath: resolvedPath || bestPath,
|
|
167
|
+
line: bestInfo.line,
|
|
168
|
+
confidence: Math.min(0.95, bestInfo.score / 10),
|
|
169
|
+
method: 'sourcemap',
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
resolveToWorkspace(sourcePath, workspaceRoot) {
|
|
173
|
+
const path = require('path');
|
|
174
|
+
const fs = require('fs');
|
|
175
|
+
// Source paths in source maps can be:
|
|
176
|
+
// - Relative: ./src/components/Button.tsx
|
|
177
|
+
// - Absolute: /Users/.../src/components/Button.tsx
|
|
178
|
+
// - Webpack-style: webpack:///./src/components/Button.tsx
|
|
179
|
+
let cleanPath = sourcePath
|
|
180
|
+
.replace(/^webpack:\/\/\//, '')
|
|
181
|
+
.replace(/^webpack:\/\/[^/]*\//, '')
|
|
182
|
+
.replace(/^\.\/?/, '');
|
|
183
|
+
// Try direct resolution from workspace root
|
|
184
|
+
const candidate = path.resolve(workspaceRoot, cleanPath);
|
|
185
|
+
if (fs.existsSync(candidate)) {
|
|
186
|
+
return candidate;
|
|
187
|
+
}
|
|
188
|
+
// Try stripping common prefixes
|
|
189
|
+
const prefixes = ['src/', 'app/', 'pages/', 'components/'];
|
|
190
|
+
for (const prefix of prefixes) {
|
|
191
|
+
const idx = cleanPath.indexOf(prefix);
|
|
192
|
+
if (idx >= 0) {
|
|
193
|
+
const stripped = cleanPath.substring(idx);
|
|
194
|
+
const candidate2 = path.resolve(workspaceRoot, stripped);
|
|
195
|
+
if (fs.existsSync(candidate2)) {
|
|
196
|
+
return candidate2;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return undefined;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
exports.SourceMapResolver = SourceMapResolver;
|
|
204
|
+
//# sourceMappingURL=sourceMapResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceMapResolver.js","sourceRoot":"","sources":["../../src/source/sourceMapResolver.ts"],"names":[],"mappings":";;;AACA,6DAA0E;AAc1E,MAAa,iBAAiB;IAA9B;QACU,eAAU,GAA0B,IAAI,GAAG,EAAE,CAAC;QAC9C,mBAAc,GAA2D,IAAI,GAAG,EAAE,CAAC;IA+N7F,CAAC;IA7NC,KAAK,CAAC,OAAO,CACX,IAAoB,EACpB,OAAiB,EACjB,aAAqB;QAErB,IAAI,CAAC;YACH,oCAAoC;YACpC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;YAEzD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,8BAA8B;YAC9B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACxC,CAAC;YAED,qCAAqC;YACrC,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;YACrD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,uBAAuB,CAAC,IAAoB;QACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,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,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAEzB,4CAA4C;QAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QACzD,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,gCAAgC;QAChC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;QAC3D,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;YAC9B,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACtC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;gBACb,MAAM,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;gBACzD,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC9B,OAAO,UAAU,CAAC;gBACpB,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjOD,8CAiOC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Identity, DomContext, SourceLocation } from '../schemas';
|
|
2
|
+
export interface WorkspaceFileProvider {
|
|
3
|
+
listSourceFiles(): Promise<string[]>;
|
|
4
|
+
readText(filePath: string): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export declare class NodeWorkspaceFileProvider implements WorkspaceFileProvider {
|
|
7
|
+
private readonly workspaceRoot;
|
|
8
|
+
private readonly sourceExtensions;
|
|
9
|
+
private readonly ignoredDirectories;
|
|
10
|
+
constructor(workspaceRoot: string);
|
|
11
|
+
listSourceFiles(): Promise<string[]>;
|
|
12
|
+
readText(filePath: string): Promise<string>;
|
|
13
|
+
private walk;
|
|
14
|
+
}
|
|
15
|
+
interface Signal {
|
|
16
|
+
text: string;
|
|
17
|
+
weight: number;
|
|
18
|
+
method: SourceLocation['method'];
|
|
19
|
+
}
|
|
20
|
+
export declare class WorkspaceGrep {
|
|
21
|
+
private readonly fileProvider;
|
|
22
|
+
constructor(fileProvider: WorkspaceFileProvider);
|
|
23
|
+
search(identity: Identity, dom: DomContext): Promise<SourceLocation | undefined>;
|
|
24
|
+
buildSignals(identity: Identity, dom: DomContext): Signal[];
|
|
25
|
+
private isGeneratedId;
|
|
26
|
+
private searchFile;
|
|
27
|
+
private pickBestMatch;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=workspaceGrep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaceGrep.d.ts","sourceRoot":"","sources":["../../src/source/workspaceGrep.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAElE,MAAM,WAAW,qBAAqB;IACpC,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7C;AAED,qBAAa,yBAA0B,YAAW,qBAAqB;IAYzD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAX1C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuE;IACxG,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAQhC;gBAE0B,aAAa,EAAE,MAAM;IAE5C,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAUpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAInC,IAAI;CA4BnB;AAED,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;CAClC;AAgBD,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,qBAAqB;IAE1D,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IA0BtF,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,GAAG,MAAM,EAAE;IAqC3D,OAAO,CAAC,aAAa;YAQP,UAAU;IAgCxB,OAAO,CAAC,aAAa;CAqDtB"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.WorkspaceGrep = exports.NodeWorkspaceFileProvider = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
class NodeWorkspaceFileProvider {
|
|
40
|
+
constructor(workspaceRoot) {
|
|
41
|
+
this.workspaceRoot = workspaceRoot;
|
|
42
|
+
this.sourceExtensions = new Set(['.tsx', '.jsx', '.vue', '.svelte', '.html', '.ts', '.js']);
|
|
43
|
+
this.ignoredDirectories = new Set([
|
|
44
|
+
'node_modules',
|
|
45
|
+
'dist',
|
|
46
|
+
'build',
|
|
47
|
+
'.next',
|
|
48
|
+
'.nuxt',
|
|
49
|
+
'out',
|
|
50
|
+
'.git',
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
async listSourceFiles() {
|
|
54
|
+
if (!this.workspaceRoot || !fs.existsSync(this.workspaceRoot)) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
const files = [];
|
|
58
|
+
await this.walk(this.workspaceRoot, files);
|
|
59
|
+
return files;
|
|
60
|
+
}
|
|
61
|
+
async readText(filePath) {
|
|
62
|
+
return await fs.promises.readFile(filePath, 'utf-8');
|
|
63
|
+
}
|
|
64
|
+
async walk(dir, outFiles) {
|
|
65
|
+
let entries = [];
|
|
66
|
+
try {
|
|
67
|
+
entries = await fs.promises.readdir(dir, { withFileTypes: true });
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
for (const entry of entries) {
|
|
73
|
+
const entryPath = path.join(dir, entry.name);
|
|
74
|
+
if (entry.isDirectory()) {
|
|
75
|
+
if (this.ignoredDirectories.has(entry.name)) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
await this.walk(entryPath, outFiles);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (!entry.isFile()) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
85
|
+
if (this.sourceExtensions.has(ext)) {
|
|
86
|
+
outFiles.push(entryPath);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.NodeWorkspaceFileProvider = NodeWorkspaceFileProvider;
|
|
92
|
+
// Tailwind-like utility patterns to skip
|
|
93
|
+
const UTILITY_CLASS_PATTERN = /^(flex|grid|block|inline|hidden|relative|absolute|fixed|sticky|static|m[trblxy]?-|p[trblxy]?-|w-|h-|min-|max-|text-|font-|bg-|border-|rounded-|shadow-|opacity-|z-|gap-|space-|overflow-|cursor-|transition-|duration-|ease-|animate-|transform|scale-|rotate-|translate-|skew-|origin-|items-|justify-|self-|place-|col-|row-|order-|float-|clear-|object-|aspect-|columns-|break-|decoration-|list-|leading-|tracking-|align-|whitespace-|underline|line-through|no-underline|sr-only|not-sr-only|dark:|hover:|focus:|active:|disabled:|sm:|md:|lg:|xl:|2xl:)/;
|
|
94
|
+
// CSS Modules / styled-components generated class patterns
|
|
95
|
+
const GENERATED_CLASS_PATTERN = /^(sc-|css-|_[a-zA-Z]+_[a-z0-9]{4,}_|[a-zA-Z]+__[a-zA-Z]+-{2}[a-zA-Z0-9]+)/;
|
|
96
|
+
class WorkspaceGrep {
|
|
97
|
+
constructor(fileProvider) {
|
|
98
|
+
this.fileProvider = fileProvider;
|
|
99
|
+
}
|
|
100
|
+
async search(identity, dom) {
|
|
101
|
+
const signals = this.buildSignals(identity, dom);
|
|
102
|
+
if (signals.length === 0)
|
|
103
|
+
return undefined;
|
|
104
|
+
const sourceFiles = await this.fileProvider.listSourceFiles();
|
|
105
|
+
if (sourceFiles.length === 0)
|
|
106
|
+
return undefined;
|
|
107
|
+
const matches = [];
|
|
108
|
+
// Search files for signals — limit to first 200 files to avoid slowness
|
|
109
|
+
const filesToSearch = sourceFiles.slice(0, 200);
|
|
110
|
+
for (const filePath of filesToSearch) {
|
|
111
|
+
const fileMatches = await this.searchFile(filePath, signals);
|
|
112
|
+
if (fileMatches.length > 0) {
|
|
113
|
+
matches.push(...fileMatches);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (matches.length === 0)
|
|
117
|
+
return undefined;
|
|
118
|
+
// Group by file and score
|
|
119
|
+
return this.pickBestMatch(matches);
|
|
120
|
+
}
|
|
121
|
+
buildSignals(identity, dom) {
|
|
122
|
+
const signals = [];
|
|
123
|
+
// data-testid, data-test, data-qa (highest priority)
|
|
124
|
+
if (identity.dataAttributes) {
|
|
125
|
+
for (const [attr, value] of Object.entries(identity.dataAttributes)) {
|
|
126
|
+
if (['data-testid', 'data-test', 'data-qa'].includes(attr)) {
|
|
127
|
+
signals.push({ text: value, weight: 10, method: 'grep-data-attr' });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Stable ID
|
|
132
|
+
if (identity.id && !this.isGeneratedId(identity.id)) {
|
|
133
|
+
signals.push({ text: identity.id, weight: 8, method: 'grep-id' });
|
|
134
|
+
}
|
|
135
|
+
// aria-label
|
|
136
|
+
if (identity.ariaLabel && identity.ariaLabel.length >= 3) {
|
|
137
|
+
signals.push({ text: identity.ariaLabel, weight: 7, method: 'grep-aria' });
|
|
138
|
+
}
|
|
139
|
+
// Short text content (likely written literally in source)
|
|
140
|
+
if (identity.text && identity.text.length >= 3 && identity.text.length <= 50) {
|
|
141
|
+
signals.push({ text: identity.text, weight: 5, method: 'grep-text' });
|
|
142
|
+
}
|
|
143
|
+
// Semantic class names (skip utilities and generated)
|
|
144
|
+
for (const cls of identity.classes) {
|
|
145
|
+
if (!UTILITY_CLASS_PATTERN.test(cls) && !GENERATED_CLASS_PATTERN.test(cls) && cls.length >= 3) {
|
|
146
|
+
signals.push({ text: cls, weight: 3, method: 'grep-class' });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return signals;
|
|
150
|
+
}
|
|
151
|
+
isGeneratedId(id) {
|
|
152
|
+
// Skip UUIDs, base64-ish, random hashes
|
|
153
|
+
if (/^[0-9a-f]{8}-[0-9a-f]{4}/.test(id))
|
|
154
|
+
return true;
|
|
155
|
+
if (/^[a-zA-Z0-9+/]{20,}/.test(id))
|
|
156
|
+
return true;
|
|
157
|
+
if (/^:r[0-9a-z]+:$/.test(id))
|
|
158
|
+
return true; // React useId
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
async searchFile(filePath, signals) {
|
|
162
|
+
try {
|
|
163
|
+
const content = await this.fileProvider.readText(filePath);
|
|
164
|
+
// Penalize test/story files
|
|
165
|
+
const isTestFile = /\.(test|spec|stories|story)\.[jt]sx?$/.test(filePath);
|
|
166
|
+
const matches = [];
|
|
167
|
+
const lines = content.split('\n');
|
|
168
|
+
for (const signal of signals) {
|
|
169
|
+
for (let i = 0; i < lines.length; i++) {
|
|
170
|
+
if (lines[i].includes(signal.text)) {
|
|
171
|
+
const weight = isTestFile ? signal.weight * 0.3 : signal.weight;
|
|
172
|
+
matches.push({
|
|
173
|
+
filePath,
|
|
174
|
+
line: i + 1,
|
|
175
|
+
score: weight,
|
|
176
|
+
signalCount: 1,
|
|
177
|
+
method: signal.method,
|
|
178
|
+
});
|
|
179
|
+
break; // One match per signal per file
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return matches;
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
pickBestMatch(matches) {
|
|
190
|
+
// Group by file
|
|
191
|
+
const byFile = new Map();
|
|
192
|
+
for (const m of matches) {
|
|
193
|
+
const existing = byFile.get(m.filePath) || [];
|
|
194
|
+
existing.push(m);
|
|
195
|
+
byFile.set(m.filePath, existing);
|
|
196
|
+
}
|
|
197
|
+
let bestFile = '';
|
|
198
|
+
let bestScore = 0;
|
|
199
|
+
let bestLine = 1;
|
|
200
|
+
let bestMethod = 'grep-text';
|
|
201
|
+
for (const [filePath, fileMatches] of byFile) {
|
|
202
|
+
let totalScore = fileMatches.reduce((sum, m) => sum + m.score, 0);
|
|
203
|
+
// Bonus for multiple signals in same file
|
|
204
|
+
if (fileMatches.length > 1) {
|
|
205
|
+
totalScore *= 1 + fileMatches.length * 0.2;
|
|
206
|
+
// Extra bonus for proximity (signals within 20 lines)
|
|
207
|
+
const lines = fileMatches.map(m => m.line).sort((a, b) => a - b);
|
|
208
|
+
const spread = lines[lines.length - 1] - lines[0];
|
|
209
|
+
if (spread < 20) {
|
|
210
|
+
totalScore *= 1.5;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// File path heuristics
|
|
214
|
+
if (/\/(components|pages|views|app|src)\//.test(filePath)) {
|
|
215
|
+
totalScore *= 1.1;
|
|
216
|
+
}
|
|
217
|
+
if (totalScore > bestScore) {
|
|
218
|
+
bestScore = totalScore;
|
|
219
|
+
bestFile = filePath;
|
|
220
|
+
// Use the line from the highest-weight match
|
|
221
|
+
const topMatch = fileMatches.reduce((a, b) => a.score > b.score ? a : b);
|
|
222
|
+
bestLine = topMatch.line;
|
|
223
|
+
bestMethod = topMatch.method;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (!bestFile)
|
|
227
|
+
return undefined;
|
|
228
|
+
return {
|
|
229
|
+
filePath: bestFile,
|
|
230
|
+
line: bestLine,
|
|
231
|
+
confidence: Math.min(0.85, bestScore / 15),
|
|
232
|
+
method: bestMethod,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
exports.WorkspaceGrep = WorkspaceGrep;
|
|
237
|
+
//# sourceMappingURL=workspaceGrep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaceGrep.js","sourceRoot":"","sources":["../../src/source/workspaceGrep.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAQ7B,MAAa,yBAAyB;IAYpC,YAA6B,aAAqB;QAArB,kBAAa,GAAb,aAAa,CAAQ;QAXjC,qBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACvF,uBAAkB,GAAG,IAAI,GAAG,CAAC;YAC5C,cAAc;YACd,MAAM;YACN,OAAO;YACP,OAAO;YACP,OAAO;YACP,KAAK;YACL,MAAM;SACP,CAAC,CAAC;IAEkD,CAAC;IAEtD,KAAK,CAAC,eAAe;QACnB,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC9D,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB;QAC7B,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAEO,KAAK,CAAC,IAAI,CAAC,GAAW,EAAE,QAAkB;QAChD,IAAI,OAAO,GAAgB,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,EAAE,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
|
|
|
1
|
+
{"version":3,"file":"testPaste.js","sourceRoot":"","sources":["../src/testPaste.ts"],"names":[],"mappings":";AAAA,iBAAiB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type PickerState = 'idle' | 'starting' | 'active';
|
|
2
|
+
export declare class StatusBarManager {
|
|
3
|
+
private mainStatus;
|
|
4
|
+
constructor();
|
|
5
|
+
private initializeDefaults;
|
|
6
|
+
show(): void;
|
|
7
|
+
hide(): void;
|
|
8
|
+
update(state: PickerState, text: string): void;
|
|
9
|
+
updateModeIndicator(mode: string): void;
|
|
10
|
+
updateScreenshotIndicator(enabled: boolean): void;
|
|
11
|
+
dispose(): void;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=statusBarManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusBarManager.d.ts","sourceRoot":"","sources":["../../src/ui/statusBarManager.ts"],"names":[],"mappings":"AAEA,KAAK,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;AAElD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,UAAU,CAAuB;;IAYzC,OAAO,CAAC,kBAAkB;IAQ1B,IAAI;IAIJ,IAAI;IAIJ,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAuBvC,mBAAmB,CAAC,IAAI,EAAE,MAAM;IAChC,yBAAyB,CAAC,OAAO,EAAE,OAAO;IAE1C,OAAO;CAGR"}
|