-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
596 lines (596 loc) · 23.8 KB
/
package.json
File metadata and controls
596 lines (596 loc) · 23.8 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
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
{
"name": "agent-helper-kit",
"displayName": "Agent Helper Kit",
"description": "VS Code extension for review-to-chat workflows and agent-friendly shell tools",
"version": "1.4.0",
"publisher": "Quicksaver",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Quicksaver/agent-helper-kit"
},
"private": true,
"engines": {
"node": "^22.13.0 || >=24.0.0",
"vscode": "^1.115.0"
},
"categories": [
"Chat",
"Other"
],
"icon": "logo.png",
"main": "./dist/extension.js",
"activationEvents": [
"onStartupFinished",
"onLanguageModelTool:run_in_shell",
"onLanguageModelTool:await_shell",
"onLanguageModelTool:get_shell_output",
"onLanguageModelTool:send_to_shell",
"onLanguageModelTool:kill_shell",
"onLanguageModelTool:get_shell_command",
"onLanguageModelTool:get_last_shell_command"
],
"contributes": {
"commands": [
{
"command": "agent-helper-kit.reviewCommentToChat",
"title": "Copy to Chat",
"category": "Agent Helper Kit",
"enablement": "config.agent-helper-kit.bringToChat.enabled",
"icon": "$(comment-discussion)"
},
{
"command": "agent-helper-kit.shellCommands.clearFinished",
"title": "Clear Shell Command History",
"category": "Agent Helper Kit",
"enablement": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(clear-all)"
},
{
"command": "agent-helper-kit.shellCommands.killEntry",
"title": "Kill Shell Command",
"category": "Agent Helper Kit",
"enablement": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(close)"
},
{
"command": "agent-helper-kit.shellCommands.deleteEntry",
"title": "Remove Shell Command from History",
"category": "Agent Helper Kit",
"enablement": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(trash)"
},
{
"command": "agent-helper-kit.shellCommands.openEntry",
"title": "Show Shell Command Output",
"category": "Agent Helper Kit",
"enablement": "config.agent-helper-kit.shellTools.enabled"
},
{
"command": "agent-helper-kit.shellTools.selectRiskAssessmentModel",
"title": "Select Shell Risk Assessment Model",
"category": "Agent Helper Kit",
"enablement": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(sparkle)"
}
],
"menus": {
"commandPalette": [
{
"command": "agent-helper-kit.reviewCommentToChat",
"when": "config.agent-helper-kit.bringToChat.enabled"
},
{
"command": "agent-helper-kit.shellTools.selectRiskAssessmentModel",
"when": "config.agent-helper-kit.shellTools.enabled"
}
],
"comments/commentThread/title": [
{
"command": "agent-helper-kit.reviewCommentToChat",
"group": "inline",
"when": "config.agent-helper-kit.bringToChat.enabled"
}
],
"view/item/context": [
{
"command": "agent-helper-kit.shellCommands.killEntry",
"group": "inline",
"when": "view == agent-helper-kit.shellCommandsView && viewItem == running && config.agent-helper-kit.shellTools.enabled"
},
{
"command": "agent-helper-kit.shellCommands.deleteEntry",
"group": "inline",
"when": "view == agent-helper-kit.shellCommandsView && viewItem == finished && config.agent-helper-kit.shellTools.enabled"
}
],
"view/title": [
{
"command": "agent-helper-kit.shellCommands.clearFinished",
"group": "navigation",
"when": "view == agent-helper-kit.shellCommandsView && config.agent-helper-kit.shellTools.enabled"
}
]
},
"viewsContainers": {
"panel": [
{
"id": "agent-helper-kit-shellCommandsPanel",
"title": "Shell Runs",
"icon": "$(terminal)",
"when": "config.agent-helper-kit.shellTools.enabled"
}
]
},
"views": {
"agent-helper-kit-shellCommandsPanel": [
{
"id": "agent-helper-kit.shellCommandsView",
"type": "webview",
"name": "Shell Runs",
"icon": "$(terminal)",
"when": "config.agent-helper-kit.shellTools.enabled"
}
]
},
"chatParticipants": [
{
"id": "agent-helper-kit.bringCommentsToChat",
"name": "bringCommentsToChat",
"fullName": "Code Review Comment",
"description": "Copy code review comment content to chat, including file path and line number",
"isSticky": false
}
],
"configuration": {
"title": "Agent Helper Kit",
"properties": {
"agent-helper-kit.bringToChat.enabled": {
"default": true,
"description": "Enable the bring-to-chat feature (chat participant, command, and review comment button).",
"type": "boolean"
},
"agent-helper-kit.bringToChat.queueBeforeSend": {
"default": false,
"description": "Queue selected review comments and prefill @bringCommentsToChat until you press Enter, instead of sending each Copy to Chat click immediately.",
"type": "boolean"
},
"agent-helper-kit.shellTools.enabled": {
"default": true,
"description": "Enable shell command language model tools.",
"type": "boolean"
},
"agent-helper-kit.shellTools.autoApprovePotentiallyDestructiveCommands": {
"default": false,
"description": "Dangerous override. When enabled, shell commands that are not already decided by explicit allow/ask/deny approval rules run without risk-assessment prompting or user confirmation. Explicit approval rules still win: allow stays allowed, ask still prompts, and deny still blocks execution. Enable this only if you intentionally want unresolved model-triggered shell commands to run without human review.",
"type": "boolean"
},
"agent-helper-kit.shellTools.riskAssessment.chatModel": {
"default": "copilot:gpt-4.1",
"description": "Chat model used to pre-assess shell-command risk after explicit approval rules and before any user confirmation. Set this to a model ID in vendor:id format, or leave it empty to disable model-based risk assessment. Prefer a fast model for optimal experience. When left empty, unresolved commands default to explicit approval unless autoApprovePotentiallyDestructiveCommands is enabled. Commands with transient environment-variable prefixes still route through this model unless a matching ask or deny rule already decides them.",
"type": "string"
},
"agent-helper-kit.shellTools.riskAssessment.timeoutMs": {
"default": 8000,
"description": "Timeout in milliseconds for shell risk assessment model prompts. When reached, unresolved commands fall back to explicit user approval instead of automatic approval.",
"minimum": 1,
"type": "number"
},
"agent-helper-kit.shellTools.approvalRules": {
"default": {},
"description": "Override shell tool approval rules. Keys are command names like 'pwd' or regex literals like '/^git\\s+status\\b/i'. Values are 'allow', 'ask', or 'deny'. 'allow' runs without prompting, 'ask' always prompts, and 'deny' blocks execution outright. Deny rules take precedence over ask and allow for matching commands. When a command begins with transient environment assignments, matching ask and deny rules are preserved after stripping those prefixes, but matching allow rules are downgraded to model-based risk assessment instead of auto-running. Invalid or vulnerable regex literals are ignored.",
"additionalProperties": {
"type": "string",
"enum": [
"allow",
"ask",
"deny"
]
},
"type": "object"
},
"agent-helper-kit.shellOutput.inMemoryOutputLimitKiB": {
"default": 512,
"description": "KiB of shell output to retain in memory before immediately spilling to a temp file. Set to 0 to disable the size-based spill threshold.",
"minimum": 0,
"type": "number"
},
"agent-helper-kit.shellOutput.memoryToFileSpillMinutes": {
"default": 2,
"description": "Minutes to keep shell command output in memory before spilling it to a temp file.",
"minimum": 0,
"type": "number"
},
"agent-helper-kit.shellOutput.startupPurgeMaxAgeHours": {
"default": 6,
"description": "On extension host startup, purge persisted shell command output files older than this many hours.",
"minimum": 0,
"type": "number"
}
}
},
"languageModelTools": [
{
"name": "run_in_shell",
"toolReferenceName": "runInShell",
"displayName": "Run Shell Command",
"when": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(terminal)",
"userDescription": "Run a shell command and return its status or output.",
"modelDescription": "Run a shell command in a cwd, workspace root, or home if no workspace. Returns an id and status (shell, exitCode, terminationSignal if any SIG* sent); poll output via id after exit as needed, or include in response via full_output/last_lines/regex. Returns the id immediately for async polling when timeout is omitted, or when timeout is reached. If a running command is waiting for stdin, use send_to_shell to send exactly one answer, then call get_shell_output again. Compared with built-in run_in_terminal, pro: stable ids, deterministic status, unambiguous/filtered/streamed/full output, smaller context footprint when only success/failure is needed; con: not interactive, no persisted shell state, no PTY-backed prompts.",
"canBeReferencedInPrompt": true,
"inputSchema": {
"type": "object",
"required": [
"command",
"explanation",
"goal",
"riskAssessment"
],
"properties": {
"command": {
"type": "string",
"description": "Shell command to execute."
},
"cwd": {
"type": "string",
"description": "Optional working directory for the command. Relative paths resolve from workspace root (or home if no workspace). Returns an error if the directory does not exist or is inaccessible."
},
"explanation": {
"type": "string",
"description": "One-sentence summary of the command."
},
"goal": {
"type": "string",
"description": "Short purpose of the command."
},
"riskAssessment": {
"type": "string",
"description": "Required brief pre-assessment of the command's risk. Explicitly call out possible destructive side-effects, secrets or sensitive data leakage, loss of work or data, system or account impact, and any other potentially damaging effects."
},
"riskAssessmentContext": {
"type": "array",
"description": "Optional list of risk-assessment context entries. Use file paths for scripts or files the command executes, and inline strings for relevant sub-actions or alias expansions that help explain what the command really does.",
"items": {
"type": "string"
}
},
"shell": {
"type": "string",
"description": "Optional shell executable path or name. Uses VS Code/default shell when omitted (preferred)."
},
"columns": {
"type": "integer",
"description": "Optional terminal width in columns. Overrides any inherited COLUMNS value when provided. Increase this if the command wraps or truncates long lines too aggressively. Must be between 1 and 1000. Defaults to 240.",
"minimum": 1,
"maximum": 1000
},
"full_output": {
"type": "boolean",
"description": "When true, include whole output in response when not timed out."
},
"last_lines": {
"type": "number",
"description": "Optional output trailing line count to include in response when not timed out; mutually exclusive with full_output/regex.",
"minimum": 0
},
"regex": {
"type": "string",
"description": "Optional regex filter for output lines in response when not timed out; mutually exclusive with full_output/last_lines."
},
"regex_flags": {
"type": "string",
"description": "Optional regex flags for regex (for example i, m, s, u); requires regex."
},
"timeout": {
"type": "number",
"description": "Optional wait timeout in ms for this tool call. Omit to start async and return id immediately. Use 0 to wait until completion and return status. Command runtime is not affected by timeout, callers must kill explicitly when needed.",
"minimum": 0
}
},
"allOf": [
{
"not": {
"required": [
"last_lines",
"regex"
]
}
},
{
"not": {
"required": [
"full_output",
"last_lines"
]
}
},
{
"not": {
"required": [
"full_output",
"regex"
]
}
},
{
"if": {
"not": {
"required": [
"timeout"
]
}
},
"then": {
"not": {
"anyOf": [
{
"required": [
"full_output"
]
},
{
"required": [
"last_lines"
]
},
{
"required": [
"regex"
]
},
{
"required": [
"regex_flags"
]
}
]
}
}
},
{
"if": {
"required": [
"regex_flags"
]
},
"then": {
"required": [
"regex"
]
}
}
]
}
},
{
"name": "send_to_shell",
"toolReferenceName": "sendToShell",
"displayName": "Send to Shell",
"when": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(terminal)",
"userDescription": "Send one line of input to a running shell command.",
"modelDescription": "Send a single line of input text to the piped stdin of a running shell command started by run_in_shell. Sent text is logged into the shell run output as marked input entries so the interaction history stays visible. The command field may be empty or whitespace to press Enter. The tool appends Enter automatically, so send exactly one answer at a time, then call get_shell_output to inspect the next prompt or output. Use the optional secret property for secrets, API keys, credentials, or anything even slightly sensitive; when true, logs store a hidden placeholder instead of the actual input text. This is stdin-only and does not allocate a terminal or PTY, so terminal-bound prompts such as many SSH, sudo, or full-screen interactive programs may still not work.",
"canBeReferencedInPrompt": true,
"inputSchema": {
"type": "object",
"required": [
"id",
"command"
],
"properties": {
"id": {
"type": "string",
"description": "The shell command id returned by run_in_shell. This may be the public 8-character id shown by the tool."
},
"command": {
"type": "string",
"description": "The single-line input text to send to the running shell command. The tool sends the text followed by Enter and logs it as marked input unless secret is true. Provide an empty or whitespace string to send just Enter.",
"maxLength": 16384,
"pattern": "^[^\\r\\n]*$"
},
"secret": {
"type": "boolean",
"default": false,
"description": "Set true for secrets, API keys, credentials, or anything even slightly sensitive. When true, the shell run log records a hidden placeholder instead of the actual input text."
}
}
}
},
{
"name": "await_shell",
"toolReferenceName": "awaitShell",
"displayName": "Await Shell Command",
"when": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(clock)",
"userDescription": "Wait for a shell command to finish.",
"modelDescription": "Wait for a shell command id from run_in_shell and return status (shell, exitCode, terminationSignal if any SIG* sent). If timeout is reached, can be re-polled as needed. Use this after starting without timeout or after run_in_shell or await_shell returns timedOut: true.",
"canBeReferencedInPrompt": true,
"inputSchema": {
"type": "object",
"required": [
"id",
"timeout"
],
"properties": {
"id": {
"type": "string",
"description": "Command id from run_in_shell."
},
"timeout": {
"type": "number",
"description": "Timeout in ms for this wait call; use 0 for no timeout.",
"minimum": 0
}
}
}
},
{
"name": "get_shell_output",
"toolReferenceName": "getShellOutput",
"displayName": "Get Shell Command Output",
"when": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(output)",
"userDescription": "Read output from a shell command.",
"modelDescription": "Read output and status (shell, exitCode if finished, terminationSignal if any SIG* sent; isRunning if still running) for a command id from run_in_shell. For running commands, returns only new output since last read by default.",
"canBeReferencedInPrompt": true,
"inputSchema": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"description": "Command id from run_in_shell."
},
"full_output": {
"type": "boolean",
"description": "When true, return output from the beginning."
},
"last_lines": {
"type": "number",
"description": "Optional trailing line count to return; mutually exclusive with regex.",
"minimum": 0
},
"regex": {
"type": "string",
"description": "Optional regex filter for matching lines; mutually exclusive with last_lines."
},
"regex_flags": {
"type": "string",
"description": "Optional regex flags for regex (for example i, m, s, u); requires regex."
}
},
"allOf": [
{
"not": {
"required": [
"last_lines",
"regex"
]
}
},
{
"if": {
"required": [
"regex_flags"
]
},
"then": {
"required": [
"regex"
]
}
}
]
}
},
{
"name": "kill_shell",
"toolReferenceName": "killShell",
"displayName": "Stop Shell Command",
"when": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(close)",
"userDescription": "Stop a running shell command.",
"modelDescription": "Stop a running shell command.",
"canBeReferencedInPrompt": true,
"inputSchema": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"description": "Command id from run_in_shell."
}
}
}
},
{
"name": "get_shell_command",
"toolReferenceName": "getShellCommand",
"displayName": "Get Shell Command",
"when": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(history)",
"userDescription": "Get the command for a shell run.",
"modelDescription": "Get the command that was run for a specific shell command id.",
"canBeReferencedInPrompt": true,
"inputSchema": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"description": "Command id from run_in_shell."
}
}
}
},
{
"name": "get_last_shell_command",
"toolReferenceName": "getLastShellCommand",
"displayName": "Get Last Shell Command",
"when": "config.agent-helper-kit.shellTools.enabled",
"icon": "$(history)",
"userDescription": "Get the most recent shell command run.",
"modelDescription": "Get the most recent command executed via run_in_shell.",
"canBeReferencedInPrompt": true,
"inputSchema": {
"type": "object",
"properties": {}
}
}
]
},
"packageManager": "yarn@4.13.0",
"scripts": {
"build": "node esbuild.mjs",
"lint:check": "yarn lint:tsc && yarn lint:eslint --max-warnings 0 && yarn lint:prettier",
"lint:eslint": "eslint . --ext .js,.ts",
"lint:fix": "yarn lint:tsc && yarn lint:eslint --fix && yarn lint:prettier --write",
"lint:prettier": "prettier --log-level=warn --check .",
"lint:tsc": "tsc --noEmit",
"merge": "./scripts/git/merge.sh",
"package": "yarn package:build && yarn package:install",
"package:build": "vsce package --yarn --no-dependencies",
"package:install": "code --install-extension $(ls -t *.vsix | head -1)",
"package:publish": "env-cmd -f ./.env.local vsce publish --yarn --no-dependencies",
"release": "./scripts/release.sh",
"test": "vitest run --coverage",
"test:unit": "vitest run",
"test:watch": "vitest",
"vscode:prepublish": "yarn lint:check && yarn test && yarn build",
"watch": "node esbuild.mjs --watch"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@stylistic/eslint-plugin": "^5.10.0",
"@types/jsdom": "^28.0.1",
"@types/node": "^25.6.0",
"@types/vscode": "^1.115.0",
"@vitest/coverage-v8": "4.1.4",
"@vscode/vsce": "^3.7.1",
"env-cmd": "^11.0.0",
"esbuild": "^0.28.0",
"eslint": "^10.2.0",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import-x": "^4.16.2",
"eslint-plugin-perfectionist": "^5.8.0",
"globals": "^17.4.0",
"jiti": "^2.6.1",
"jsdom": "^29.0.2",
"prettier": "^3.8.2",
"typescript": "^6.0.2",
"typescript-eslint": "^8.58.1",
"vitest": "4.1.4"
},
"dependencies": {
"ansi-regex": "^6.2.2",
"recheck": "^4.5.0",
"zod": "^4.3.6"
}
}