@sema-agent/core
Version:
Stateless, task-oriented AI agent core
41 lines (40 loc) • 2.62 kB
TypeScript
/**
* Unified orchestration env parsing (design/96 §定.2 L1, S7) — the single TOC entry that resolves
* `ORCHESTRATION_MODE` / `SCENARIO` / `REASONING_INTENSITY` / teacher role names into a structured intent.
*
* Honesty: this layer parses INTENT only. It does NOT pick models — env names a model **role**, and the
* deploy side maps roles to concrete models (the existing model-role体系); we never invent a model env
* namespace (design/96 第二轮点6). `REASONING_INTENSITY` is validated against the legal {@link ThinkingLevel}
* tiers (off..max) — an illegal value throws (don't silently swallow it).
*
* Three-layer progressive exposure (design/96 §定.2): L0 = no env → the explicit `solo + standard` default
* (not a blank); L1 = a single env switches to a preset; L2 = a full config object (not this layer's job).
*/
import type { ThinkingLevel } from "../internal/harness-types.js";
import { type ScenarioId } from "./scenario-registry.js";
/** Orchestration mode parsed from `ORCHESTRATION_MODE`. `solo` = the L0 default (no orchestration). */
export type OrchestrationMode = "solo" | "teacher";
/** The L0 default reasoning intensity ("standard" = the conservative role default, mapped to `medium`). */
export declare const DEFAULT_REASONING_INTENSITY: ThinkingLevel;
/** Structured result of {@link loadOrchestrationEnv}. */
export interface OrchestrationEnv {
/** From `ORCHESTRATION_MODE`. Default `solo` (L0). */
mode: OrchestrationMode;
/** From `SCENARIO`. Default `solo` (L0). */
scenario: ScenarioId;
/** From `REASONING_INTENSITY` (validated as a {@link ThinkingLevel}). Default {@link DEFAULT_REASONING_INTENSITY}. */
reasoning: ThinkingLevel;
/** Teacher student model **role** name (from `TEACHER_STUDENT_ROLE`, else the preset). Set only in teacher mode. */
teacherStudentRole?: string;
/** Teacher advisor model **role** name (from `TEACHER_ADVISOR_ROLE`, else the preset). Set only in teacher mode. */
teacherAdvisorRole?: string;
}
/**
* Parse orchestration intent from env. With NO relevant env set, returns the explicit L0 default
* (`solo` + `solo` scenario + `standard`/{@link DEFAULT_REASONING_INTENSITY}) — never a blank. A single env
* switches a field (L1). An illegal value for any field throws a clear error (we don't silently swallow).
*
* This resolves only INTENT — it names a model **role** for teacher mode; the deploy side maps roles to
* concrete models (core never picks a model here).
*/
export declare function loadOrchestrationEnv(env?: Record<string, string | undefined>): OrchestrationEnv;