permmode

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package permmode is the shared permission-mode vocabulary for cc-fleet's claude launchers (spawn teammates and run sessions): the --permission-mode enum, its validation, and the enum→CLI-flag mapping. One source so spawn and run can't drift on what a mode means or maps to.

Index

Constants

View Source
const (
	Default           = "default"
	AcceptEdits       = "acceptEdits"
	Plan              = "plan"
	Auto              = "auto"
	BypassPermissions = "bypassPermissions"
)

The accepted --permission-mode values (mirrors native Claude Code).

Variables

Modes is the accepted set, in a stable order for error messages.

Functions

func ExplicitFlags

func ExplicitFlags(mode string) []string

ExplicitFlags is the faithful mapping for a user's explicitly chosen mode (run): bypassPermissions → --dangerously-skip-permissions; every other valid mode (default / acceptEdits / plan / auto) → --permission-mode <mode>; "" → no flag. Unlike ToFlags it does NOT collapse plan/default, so `run --permission-mode plan` actually reaches claude. Callers validate the mode (IsValid) first.

func IsValid

func IsValid(mode string) bool

IsValid reports whether mode is an accepted --permission-mode value.

func ToFlags

func ToFlags(mode string) []string

ToFlags is the INHERITANCE mapping (spawn): bypassPermissions → --dangerously-skip-permissions; acceptEdits / auto → --permission-mode <mode>; default / plan / unknown → no flag. plan and default collapse to no flag on purpose — a lead in plan/default mode must NOT propagate a permission flag to the teammate. For a user's EXPLICIT choice (e.g. `run --permission-mode plan`) use ExplicitFlags, which forwards every mode faithfully.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL