-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
209 lines (209 loc) · 6.74 KB
/
package.json
File metadata and controls
209 lines (209 loc) · 6.74 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
{
"name": "pkgguard",
"displayName": "PkgGuard",
"description": "VS Code extension that guards against hallucinated or malicious package imports",
"version": "0.7.6",
"repository": {
"type": "git",
"url": "https://github.com/shafnir/PkgGuard"
},
"icon": "images/pkgguard-icon.png",
"publisher": "shafnir",
"license": "MIT",
"type": "module",
"engines": {
"vscode": "^1.101.0",
"node": ">=20.0.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onStartupFinished",
"onLanguage:python",
"onLanguage:javascript",
"onLanguage:typescript",
"onTerminalProfile:pkgguard.terminal-profile"
],
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
},
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "pkg-guard.validateCurrentFile",
"title": "PkgGuard: Validate Current File"
},
{
"command": "pkg-guard.clearCache",
"title": "PkgGuard: Clear Cache"
},
{
"command": "pkg-guard.showDiagnostics",
"title": "PkgGuard: Show Diagnostics"
},
{
"command": "pkg-guard.openCacheFile",
"title": "PkgGuard: Open Cache File"
},
{
"command": "pkgguard.ignorePackage",
"title": "PkgGuard: Ignore Package"
},
{
"command": "pkgguard.unignorePackage",
"title": "PkgGuard: Unignore Package"
},
{
"command": "pkgguard.createTerminal",
"title": "PkgGuard: Create Terminal"
},
{
"command": "pkgguard.toggleSecurityMode",
"title": "PkgGuard: Toggle Security Mode"
}
],
"configuration": {
"title": "PkgGuard",
"properties": {
"pkgGuard.enabled": {
"type": "boolean",
"default": true,
"description": "Enable/disable Package Guard"
},
"pkgGuard.cacheTTL": {
"type": "number",
"default": 172800,
"description": "Cache TTL in seconds (48 hours)"
},
"pkgGuard.securityMode": {
"type": "string",
"enum": [
"interactive",
"monitor",
"block",
"disabled"
],
"default": "interactive",
"description": "Security mode for package installations: interactive (ask for approval), monitor (show warnings but allow), block (automatically block risky packages), disabled (no security checks)"
},
"pkgGuard.terminal.enabled": {
"type": "boolean",
"default": true,
"description": "Enable terminal package monitoring for regular VS Code terminals"
},
"pkgGuard.lsp.enabled": {
"type": "boolean",
"default": true,
"description": "Enable LSP server for enhanced package validation"
},
"pkgGuard.lsp.serverPath": {
"type": "string",
"default": "",
"description": "Path to custom LSP server executable (empty for default)"
},
"pkgGuard.lsp.timeout": {
"type": "number",
"default": 5000,
"description": "LSP request timeout in milliseconds"
},
"pkgGuard.lsp.retries": {
"type": "number",
"default": 3,
"description": "Number of retry attempts for LSP requests"
},
"pkgGuard.lsp.maxRequestsPerMinute": {
"type": "number",
"default": 100,
"description": "Maximum requests per minute for LSP rate limiting"
},
"pkgGuard.lsp.authTokenLength": {
"type": "number",
"default": 64,
"description": "Length of authentication tokens in characters"
},
"pkgGuard.lsp.cleanupIntervalMs": {
"type": "number",
"default": 60000,
"description": "Cleanup interval for rate limiting in milliseconds"
},
"pkgGuard.lsp.retryDelayMs": {
"type": "number",
"default": 1000,
"description": "Initial retry delay in milliseconds"
},
"pkgGuard.lsp.healthCheckIntervalMs": {
"type": "number",
"default": 30000,
"description": "Health check interval in milliseconds"
},
"pkgGuard.lsp.minPackageNameLength": {
"type": "number",
"default": 3,
"description": "Minimum package name length for suspicion detection"
},
"pkgGuard.lsp.maxNumberSequenceLength": {
"type": "number",
"default": 4,
"description": "Maximum number sequence length before flagging as suspicious"
},
"pkgGuard.lsp.knownMaliciousPackages": {
"type": "array",
"default": [],
"description": "List of known malicious packages for local validation"
}
}
},
"terminal": {
"profiles": [
{
"title": "PkgGuard Terminal",
"id": "pkgguard.terminal-profile"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run package",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"lint": "eslint src",
"test": "node --experimental-vm-modules node_modules/.bin/jest",
"package": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --external:node-pty --format=esm --platform=node",
"pretest": "npm run compile",
"build:lsp": "node src/LSP/scripts/build.js",
"build:lsp:server": "esbuild src/LSP/server/index.ts --bundle --outfile=dist/lsp-server.js --external:vscode --format=esm --platform=node",
"build:lsp:client": "esbuild src/LSP/client/FaultTolerantClient.ts --bundle --outfile=dist/lsp-client.js --external:vscode --format=esm --platform=node",
"start:lsp": "node dist/lsp-server.js",
"test:lsp": "npm test -- --testPathPattern=LSP"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^22.15.0",
"@types/vscode": "^1.101.0",
"@typescript-eslint/eslint-plugin": "^8.35.1",
"@typescript-eslint/parser": "^8.35.1",
"esbuild": "0.25.5",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"nock": "^13.5.4",
"prettier": "^3.2.5",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3",
"vscode-test": "^0.0.1"
},
"dependencies": {
"node-fetch": "^3.3.2",
"node-pty": "^1.0.0",
"sqlite3": "^5.1.7",
"vscode-languageclient": "^9.0.1",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-textdocument": "^1.0.12",
"ws": "^8.18.3"
}
}