( readonly?: boolean, auto?: boolean, )
| 21 | * This logic was previously duplicated in chat.ts lines 168-173 and 259-264 |
| 22 | */ |
| 23 | export function convertLegacyModeFlags( |
| 24 | readonly?: boolean, |
| 25 | auto?: boolean, |
| 26 | ): PermissionMode | undefined { |
| 27 | if (readonly && auto) { |
| 28 | throw new Error("Cannot use both --readonly and --auto flags together"); |
| 29 | } |
| 30 | |
| 31 | if (readonly) { |
| 32 | return "plan"; |
| 33 | } |
| 34 | |
| 35 | if (auto) { |
| 36 | return "auto"; |
| 37 | } |
| 38 | |
| 39 | return undefined; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Structures permission overrides for service initialization |
no outgoing calls
no test coverage detected