-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
549 lines (549 loc) · 17.3 KB
/
Copy pathpackage.json
File metadata and controls
549 lines (549 loc) · 17.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
{
"name": "polar-signals-profiler",
"displayName": "Polar Signals Profiler",
"version": "1.6.0",
"description": "View profiling data from Parca or Polar Signals Cloud directly in VS Code. See CPU, memory, and other profiling annotations inline with your source code.",
"publisher": "polarsignals",
"icon": "images/icon.png",
"repository": {
"type": "git",
"url": "https://github.com/polarsignals/vscode-extension"
},
"homepage": "https://www.polarsignals.com",
"bugs": {
"url": "https://github.com/polarsignals/vscode-extension/issues"
},
"engines": {
"vscode": "^1.85.0"
},
"categories": [
"Debuggers",
"Visualization",
"Other"
],
"galleryBanner": {
"color": "#1a1a2e",
"theme": "dark"
},
"activationEvents": [
"onUri",
"onView:polarSignals.statusView",
"onView:polarSignals.queriesView",
"onView:polarSignals.queryBuilderView",
"onView:polarSignals.currentFileView",
"onView:polarSignals.recentView"
],
"main": "./dist/extension.js",
"contributes": {
"authentication": [
{
"id": "polarsignals",
"label": "Polar Signals"
}
],
"mcpServerDefinitionProviders": [
{
"id": "polarsignals.mcp",
"label": "Polar Signals"
}
],
"commands": [
{
"command": "polarSignals.fetchProfile",
"title": "Polar Signals: Fetch Profile for Current File"
},
{
"command": "polarSignals.clearAnnotations",
"title": "Polar Signals: Clear Profiling Annotations"
},
{
"command": "polarSignals.selectPreset",
"title": "Polar Signals: Select Preset"
},
{
"command": "polarSignals.fetchWithPreset",
"title": "Polar Signals: Fetch with Preset"
},
{
"command": "polarSignals.configureDefaults",
"title": "Polar Signals: Configure Defaults"
},
{
"command": "polarSignals.importFromUrl",
"title": "Polar Signals: Import from URL"
},
{
"command": "polarSignals.signOut",
"title": "Polar Signals: Sign Out from Polar Signals Cloud"
},
{
"command": "polarSignals.switchProject",
"title": "Polar Signals: Switch Polar Signals Cloud Project"
},
{
"command": "polarSignals.setupMode",
"title": "Polar Signals: Setup Mode"
},
{
"command": "polarSignals.manageRepoMappings",
"title": "Polar Signals: Manage Repository Mappings"
},
{
"command": "polarSignals.copyLineForAI",
"title": "Polar Signals: Copy Line for AI Analysis"
},
{
"command": "polarSignals.copyFileForAI",
"title": "Polar Signals: Copy File Summary for AI"
},
{
"command": "polarSignals.setUpMcp",
"title": "Polar Signals: Set Up MCP"
},
{
"command": "polarSignals.showMcpOptions",
"title": "Polar Signals: Use Polar Signals with AI Tools"
},
{
"command": "polarSignals.runPreset",
"title": "Run Preset",
"icon": "$(play)"
},
{
"command": "polarSignals.refreshViews",
"title": "Refresh",
"icon": "$(refresh)"
},
{
"command": "polarSignals.openHotLine",
"title": "Reveal Hot Line"
},
{
"command": "polarSignals.openRecentProfile",
"title": "Open Profiled File"
},
{
"command": "polarSignals.removeRecentProfile",
"title": "Clear",
"icon": "$(close)"
},
{
"command": "polarSignals.signIn",
"title": "Polar Signals: Sign In"
},
{
"command": "polarSignals.queryBuilder.setProfileType",
"title": "Set Profile Type"
},
{
"command": "polarSignals.queryBuilder.setTimeRange",
"title": "Set Time Range"
},
{
"command": "polarSignals.queryBuilder.addFilter",
"title": "Add Filter"
},
{
"command": "polarSignals.queryBuilder.editFilter",
"title": "Edit Filter"
},
{
"command": "polarSignals.queryBuilder.removeFilter",
"title": "Remove Filter",
"icon": "$(close)"
},
{
"command": "polarSignals.queryBuilder.reset",
"title": "Reset Query",
"icon": "$(clear-all)"
},
{
"command": "polarSignals.queryBuilder.run",
"title": "Run Query",
"icon": "$(play)"
}
],
"viewsContainers": {
"activitybar": [
{
"id": "polarSignals",
"title": "Polar Signals",
"icon": "images/icon.png"
}
]
},
"views": {
"polarSignals": [
{
"id": "polarSignals.statusView",
"name": "Status",
"icon": "images/icon.png",
"contextualTitle": "Polar Signals"
},
{
"id": "polarSignals.queriesView",
"name": "Queries",
"icon": "images/icon.png",
"contextualTitle": "Polar Signals"
},
{
"id": "polarSignals.queryBuilderView",
"name": "Build Query",
"icon": "images/icon.png",
"contextualTitle": "Polar Signals"
},
{
"id": "polarSignals.currentFileView",
"name": "Current File",
"icon": "images/icon.png",
"contextualTitle": "Polar Signals"
},
{
"id": "polarSignals.recentView",
"name": "Recent",
"icon": "images/icon.png",
"contextualTitle": "Polar Signals"
}
]
},
"viewsWelcome": [
{
"view": "polarSignals.statusView",
"when": "!polarSignals.configured",
"contents": "Connect to Polar Signals Cloud or a self-hosted Parca instance to see profiling data inline with your code.\n[Sign in to Polar Signals Cloud](command:polarSignals.signIn)\n[Use self-hosted Parca](command:polarSignals.setupMode)\n[Learn more](https://www.polarsignals.com/docs)"
},
{
"view": "polarSignals.queriesView",
"when": "!polarSignals.configured",
"contents": "Sign in or configure a self-hosted Parca to see your queries.\n[Sign in](command:polarSignals.signIn)\n[Set up](command:polarSignals.setupMode)"
},
{
"view": "polarSignals.queryBuilderView",
"when": "!polarSignals.configured",
"contents": "Connect to Polar Signals to build a query.\n[Sign in](command:polarSignals.signIn)\n[Set up](command:polarSignals.setupMode)"
},
{
"view": "polarSignals.currentFileView",
"when": "polarSignals.configured && !polarSignals.hasCurrentFileProfile",
"contents": "No profile for this file yet.\n[Pick a preset](command:polarSignals.selectPreset)\n[Configure a query](command:polarSignals.fetchProfile)"
},
{
"view": "polarSignals.currentFileView",
"when": "!polarSignals.configured",
"contents": "Connect to Polar Signals to profile this file.\n[Sign in](command:polarSignals.signIn)"
},
{
"view": "polarSignals.recentView",
"when": "polarSignals.configured",
"contents": "Profiles you've fetched in this session will appear here.\n[Pick a preset](command:polarSignals.selectPreset)"
}
],
"menus": {
"commandPalette": [
{
"command": "polarSignals.fetchWithPreset",
"when": "false"
},
{
"command": "polarSignals.showMcpOptions",
"when": "false"
},
{
"command": "polarSignals.runPreset",
"when": "false"
},
{
"command": "polarSignals.openHotLine",
"when": "false"
},
{
"command": "polarSignals.openRecentProfile",
"when": "false"
},
{
"command": "polarSignals.removeRecentProfile",
"when": "false"
},
{
"command": "polarSignals.refreshViews",
"when": "false"
},
{
"command": "polarSignals.queryBuilder.setProfileType",
"when": "false"
},
{
"command": "polarSignals.queryBuilder.setTimeRange",
"when": "false"
},
{
"command": "polarSignals.queryBuilder.addFilter",
"when": "false"
},
{
"command": "polarSignals.queryBuilder.editFilter",
"when": "false"
},
{
"command": "polarSignals.queryBuilder.removeFilter",
"when": "false"
},
{
"command": "polarSignals.queryBuilder.reset",
"when": "false"
},
{
"command": "polarSignals.queryBuilder.run",
"when": "false"
}
],
"view/title": [
{
"command": "polarSignals.setupMode",
"when": "view == polarSignals.statusView",
"group": "navigation@1"
},
{
"command": "polarSignals.fetchProfile",
"when": "view == polarSignals.queriesView && polarSignals.configured",
"group": "navigation@1"
},
{
"command": "polarSignals.refreshViews",
"when": "view == polarSignals.queriesView",
"group": "navigation@2"
},
{
"command": "polarSignals.queryBuilder.run",
"when": "view == polarSignals.queryBuilderView && polarSignals.configured",
"group": "navigation@1"
},
{
"command": "polarSignals.queryBuilder.reset",
"when": "view == polarSignals.queryBuilderView && polarSignals.configured",
"group": "navigation@2"
},
{
"command": "polarSignals.fetchProfile",
"when": "view == polarSignals.currentFileView && polarSignals.configured",
"group": "navigation@1"
},
{
"command": "polarSignals.clearAnnotations",
"when": "view == polarSignals.currentFileView && polarSignals.hasCurrentFileProfile",
"group": "navigation@2"
}
],
"view/item/context": [
{
"command": "polarSignals.runPreset",
"when": "view == polarSignals.queriesView && viewItem == preset",
"group": "inline"
},
{
"command": "polarSignals.removeRecentProfile",
"when": "view == polarSignals.recentView && viewItem == recentProfile",
"group": "inline"
},
{
"command": "polarSignals.queryBuilder.removeFilter",
"when": "view == polarSignals.queryBuilderView && viewItem == queryFilter",
"group": "inline"
}
]
},
"configuration": {
"title": "Polar Signals Profiler",
"properties": {
"polarSignals.mode": {
"type": "string",
"enum": [
"cloud",
"oss"
],
"enumDescriptions": [
"Connect to Polar Signals Cloud (requires API token)",
"Connect to self-hosted Parca (no authentication)"
],
"description": "Operating mode: 'cloud' for Polar Signals Cloud, 'oss' for self-hosted Parca"
},
"polarSignals.cloudUrl": {
"type": "string",
"default": "https://api.polarsignals.com",
"description": "Polar Signals Cloud API URL (used in cloud mode)"
},
"polarSignals.selfHostedUrl": {
"type": "string",
"default": "http://localhost:7070",
"description": "Parca server URL (used in OSS mode)"
},
"polarSignals.defaultTimeRange": {
"type": "string",
"default": "15m",
"description": "Default time range for profile queries (e.g., 15m, 1h, 24h, 7d)"
},
"polarSignals.profileType": {
"type": "string",
"default": "parca_agent:samples:count:cpu:nanoseconds:delta",
"description": "Default profile type to query"
},
"polarSignals.queryLabels": {
"type": "object",
"default": {},
"description": "Label selectors to filter profiling data (e.g., {\"comm\": \"api\", \"namespace\": \"production\"})"
},
"polarSignals.presets": {
"type": "array",
"default": [],
"description": "Custom query presets (merged with built-in presets). Each preset should have: id, name, profileType, timeRange, and optional labelMatchers.",
"items": {
"type": "object",
"required": [
"id",
"name",
"profileType",
"timeRange"
],
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the preset"
},
"name": {
"type": "string",
"description": "Display name for the preset"
},
"description": {
"type": "string",
"description": "Optional description"
},
"profileType": {
"type": "string",
"description": "Full profile type string"
},
"timeRange": {
"type": "string",
"description": "Time range (e.g., 15m, 1h, 24h)"
},
"labelMatchers": {
"type": "object",
"description": "Optional label matchers"
}
}
}
},
"polarSignals.repoScanPaths": {
"type": "array",
"default": [],
"items": {
"type": "string"
},
"description": "Additional directories to scan for repositories when resolving deep link file paths (e.g., ~/code, ~/go/src)"
},
"polarSignals.autoScanOnMiss": {
"type": "boolean",
"default": true,
"description": "Automatically scan common directories for git repositories when a deep link file cannot be found"
},
"polarSignals.autoFetchOnFileOpen": {
"type": "boolean",
"default": true,
"description": "Automatically fetch profiling data when opening a file, using the last query configuration"
},
"polarSignals.autoScrollToAnnotation": {
"type": "boolean",
"default": false,
"description": "Automatically scroll to the first annotated line after fetching profiling data"
},
"polarSignals.projectId": {
"type": "string",
"description": "Polar Signals project ID (required for cloud mode with OAuth)"
},
"polarSignals.mcpOnboardingMode": {
"type": "string",
"enum": [
"auto",
"guided",
"off"
],
"default": "auto",
"enumDescriptions": [
"Automatically set up Polar Signals MCP Server when this editor supports it",
"Show setup help without automatically registering MCP",
"Disable Polar Signals MCP Server onboarding"
],
"description": "Controls how Polar Signals MCP Server is set up in this editor"
}
}
}
},
"scripts": {
"vscode:prepublish": "pnpm run esbuild-base -- --minify",
"compile": "pnpm run esbuild-base -- --sourcemap",
"watch": "pnpm run esbuild-base -- --sourcemap --watch",
"esbuild-base": "node esbuild.js",
"gen:proto": "protoc --ts_out src/generated --ts_opt generate_dependencies --proto_path proto proto/prometheus/prometheus_remote_write.proto",
"typecheck": "tsc --noEmit -p ./",
"build": "pnpm run esbuild-base",
"package": "pnpm run vscode:prepublish && vsce package --no-dependencies",
"publish": "pnpm run build && vsce publish --no-dependencies",
"test": "pnpm test:unit",
"test:unit": "vitest run",
"test:e2e": "vscode-test",
"lint": "eslint src/",
"format": "prettier --write \"src/**/*.ts\"",
"preview:auth": "ts-node --transpile-only scripts/preview-callback.ts",
"preview:auth-error": "ts-node --transpile-only scripts/preview-callback.ts error",
"prepare": "husky",
"release": "commit-and-tag-version"
},
"keywords": [
"polar-signals",
"parca",
"pprof",
"cpuprofile",
"profiling",
"performance"
],
"author": "Polar Signals",
"license": "Apache-2.0",
"dependencies": {
"@parca/client": "^0.17.8",
"@protobuf-ts/grpcweb-transport": "^2.9.0",
"@protobuf-ts/runtime": "^2.9.0",
"@protobuf-ts/runtime-rpc": "^2.9.0",
"@uwdata/flechette": "^2.3.0",
"lz4js": "^0.2.0",
"prom-client": "^15.1.3",
"snappyjs": "^0.7.0"
},
"devDependencies": {
"@protobuf-ts/plugin": "2.9.0",
"@types/mocha": "^10.0.10",
"@types/node": "^24.6.2",
"@types/vscode": "^1.85.0",
"@typescript-eslint/eslint-plugin": "^8.56.1",
"@typescript-eslint/parser": "^8.56.1",
"@vscode/test-cli": "^0.0.12",
"@vscode/test-electron": "^2.5.2",
"@vscode/vsce": "^3.2.2",
"commit-and-tag-version": "^12.7.0",
"esbuild": "^0.25.4",
"eslint": "^10.0.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
"husky": "^9.1.7",
"lint-staged": "^16.3.2",
"mocha": "^11.7.5",
"prettier": "^3.8.1",
"ts-node": "^10.9.2",
"typescript": "^5.9.3",
"vitest": "^4.1.2"
},
"lint-staged": {
"src/**/*.ts": [
"eslint --fix",
"prettier --write"
]
}
}