Commit 1384e6a
authored
feat(commands): granular permissions with /tools (#1054)
Implements #921 which describes trusting and untrusting specific tools for the current session.
- Start with default permissions. Users can change them from command line or within chat via /tools
- `/acceptall` and `--accept-all` were deprecated in favor of `--trust-all-tools` and `/tools trustall`. They will continue to work, but display a notice and activation functionality of the new commands.
- Command::AcceptAll no longer exists
- UI has been reword a little, see screenshots.
- `report_issue` will include trust override settings in the report.
- Chat supports multiple tool use requests from Q at once. I have refactored the tool flow to allow asking permissions for individual tool requests at a time
- Now, ExecuteTools (checks for acceptance one tool at a time) -> PromptUser (ask for acceptance) -> HandleInput (handle acceptance) -> ExecuteTools (find next tool that needs acceptance OR trigger execution if none remaining).
- I was not able to find a prompt that made Q send multiple tool_uses in a single request coming from Q. It seems to do them iteratively even when asked to do them in parallel.
- In any case, that original logic to support parallel requests is preserved with this new structure.
Risks: May conflict with #9991 parent 55053d5 commit 1384e6a
File tree
7 files changed
+609
-112
lines changed- crates/q_cli/src/cli
- chat
- tools
7 files changed
+609
-112
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
1 | 8 | | |
2 | 9 | | |
3 | 10 | | |
| |||
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
9 | | - | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| |||
126 | 133 | | |
127 | 134 | | |
128 | 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 | + | |
129 | 186 | | |
130 | 187 | | |
131 | 188 | | |
| |||
145 | 202 | | |
146 | 203 | | |
147 | 204 | | |
148 | | - | |
| 205 | + | |
149 | 206 | | |
150 | 207 | | |
151 | 208 | | |
| |||
163 | 220 | | |
164 | 221 | | |
165 | 222 | | |
166 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
167 | 235 | | |
168 | 236 | | |
169 | 237 | | |
| |||
346 | 414 | | |
347 | 415 | | |
348 | 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 | + | |
349 | 468 | | |
350 | 469 | | |
351 | 470 | | |
| |||
372 | 491 | | |
373 | 492 | | |
374 | 493 | | |
| 494 | + | |
| 495 | + | |
375 | 496 | | |
376 | 497 | | |
377 | 498 | | |
| |||
463 | 584 | | |
464 | 585 | | |
465 | 586 | | |
466 | | - | |
| 587 | + | |
467 | 588 | | |
468 | 589 | | |
469 | 590 | | |
470 | 591 | | |
471 | 592 | | |
| 593 | + | |
472 | 594 | | |
473 | 595 | | |
474 | 596 | | |
| |||
501 | 623 | | |
502 | 624 | | |
503 | 625 | | |
504 | | - | |
| 626 | + | |
505 | 627 | | |
506 | 628 | | |
507 | 629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | | - | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| |||
350 | 353 | | |
351 | 354 | | |
352 | 355 | | |
353 | | - | |
| 356 | + | |
354 | 357 | | |
355 | 358 | | |
356 | 359 | | |
357 | | - | |
358 | | - | |
| 360 | + | |
| 361 | + | |
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
| |||
0 commit comments