@sema-agent/core
Version:
Stateless, task-oriented AI agent core
51 lines (50 loc) • 3.78 kB
TypeScript
/**
* Dependency-free leaf module for engine default constants that `config/catalog.ts` needs as
* plain values. Extracted (design/157 S2) so the catalog no longer value-imports the modules that
* OWN these defaults (`core/runner/runtask.ts`, `agents/subagent.ts`, `core/session-store.ts`) —
* that import used to drag catalog.ts's runtime closure to 155 modules / 86119 lines (and formed
* the only size≥2 runtime SCC in the whole repo: catalog.ts ↔ runtask.ts). Each owning module now
* re-exports its constant(s) from here, so the original import surface (`import { X } from
* ".../runtask.js"`, etc.) stays byte-identical for every existing consumer.
*/
/**
* design/164 (ruled 2026-08-04): the engine no longer carries a per-task turn / wall-clock default at all.
* `DEFAULT_MAX_TURNS` (1000), `FORK_DEFAULT_MAX_TURNS` (200) and `SESSION_BG_DEFAULT_TIMEOUT_SEC` (30 min)
* are RETIRED — every task-level ceiling is now stated by the caller or absent.
*
* What replaced each obligation, so nothing is silently dropped:
* - the runaway backstop is the ENGINEERING GUARDRAIL family (brain-call guardrail, stall watchdogs),
* which answers "is the system hung" rather than "how much may this task spend";
* - the design/129 anti-zombie duty for a session-scoped background child moved to the stale-running
* reaper, which collects by STALL instead of by age (see TaskRegistry.reapStaleSessionBackgroundAgents):
* a background task legitimately busy for two hours should not be killed at thirty minutes.
*/
export declare const RETAIN_DEFAULT_TTL_MS: number;
export declare const RETAIN_DEFAULT_MAX = 16;
/** Subagent transcript persistence — the delegation ENTRY caps (CC values: 20 concurrent /
* 200 per session tree). The INLET bound family (`RunnerDeps.delegationEntryCaps`), as opposed to
* the retain pair above, which is a pure in-memory fast-lane handle bound (outlet — armed
* deployments lose nothing when it evicts). Concurrent = running/pending a* handles under one
* (scope, rootSessionId) key in THIS process's registry; cumulative = retained-window count under
* the same key (see the enforcement site for the exact retained-window semantics). */
export declare const DELEGATION_MAX_CONCURRENT_DEFAULT = 20;
export declare const DELEGATION_MAX_PER_SESSION_DEFAULT = 200;
/** Subagent transcript persistence — the default transcript retention period (CC
* cleanupPeriodDays parity). Core ships NO sweeper (design/151 ruling 2): the blessed path is the
* deployment calling `TaskRegistry.reapDurableAgents` with `maxAgeMs` derived from this (boot +
* every 24h is the reference cadence). */
export declare const SUBAGENT_TRANSCRIPT_RETENTION_DAYS_DEFAULT = 30;
/** Default idle TTL (days) before a cached session is evicted (config-catalog `session.idleTtlDays`). */
export declare const SESSION_DEFAULT_TTL_DAYS = 7;
/**
* RB-369 / RB-427-c — the shared cadence for RUNNING-state observability driven by a child's tool
* activity. A beat is one tool-lifecycle event (start or end); the FIRST beat always fires immediately
* (a short-lived agent must be observable at all), then at most one emission per this many beats.
*
* One constant, two consumers, deliberately: the workflow lane's running-record persist (RB-369) and the
* background-agent lane's intra-turn fleet beat (RB-427-c) are the same trade — a row that only moves at
* turn boundaries is frozen for as long as a turn lasts, and a row that moves per tool call is write /
* frame amplification on a tool-heavy child. A second, independently-tuned number for the same trade is
* how two surfaces describing one agent start disagreeing about how fast it is going.
*/
export declare const RUNNING_AGENT_OBSERVE_EVERY_BEATS = 4;