Skip to content

Frame — Context & Control

The context manager. Manages operational contexts, modes, authority levels, and environments. Every operation runs within a defined scope. Like permission and process management in an OS, Frame controls who can do what, in what context. Frame consumes organizational identity from baseline.config.ts (voice, industry, formality, company size) and adjusts AI behavior accordingly. Frame treats the LLM context window as a programmable operating system.

interface ContextEntry {
name: string;
mode: string;
environment: string;
permissions: string[];
authority: string;
status: 'active' | 'inactive' | 'archived';
}
interface ModeEntry {
name: string;
permissions: string[];
environment: string;
features: string[];
}
interface AuthorityEntry {
name: string;
level: number;
permissions: string[];
}
interface FrameStatus {
initialized: boolean;
currentMode: ModeEntry | null;
currentEnvironment: string | undefined;
activeContexts: number;
}
import { BaselineFrameSystem } from '@baselineos/frame';
const frame = new BaselineFrameSystem();
frame.switchContext('default');
const result = frame.processCommand('status');
// { success: true, context: 'default' }
// Permission-aware: system context blocks unauthorized writes
frame.switchContext('system');
frame.processCommand('write:config');
// { success: false, error: 'Permission denied by context/mode' }

The layer sweep runs three checks against Frame:

CheckWhat it validates
Context validationFrame system is initialized with a valid context and mode
Authority levelAgent trust score meets the threshold for task complexity (50 standard, 70 complex, 85 epic)
Permission checkExecute permission is granted based on the agent’s trust level