Expand description
Mode-state helpers - supported-mode list filtering + ModeState
builder. Used by the worker to assemble the Connected event payload
at spawn time.
Re-exportsΒ§
use std::collections::HashSet;πuse forge_primitives::permission::PermissionMode;πuse forge_primitives::ModeInfo;πuse forge_primitives::ModeState;π
ConstantsΒ§
- CANONICAL_
ORDER π - Canonical MODE_OPTIONS order mirrored from upstream.
FunctionsΒ§
- build_
mode_ state_ from_ supported - Composes a
ModeStatefrom the active mode + the resolved supported-mode list. - supported_
mode_ ids_ filtered - Returns the supported-mode list filtered by the runtime-unavailable list (but keeping the current mode if itβs still set). Mirrors the upstream rules: BASE + Auto (if model supports it) + the current mode itself (so the active mode never disappears mid-session). BypassPermissions is offered only when the session launched into it - the CLI refuses a mid-session entry.