Skip to main content

Module commands

Module commands 

Source
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 ModeState from 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.