@sema-agent/core
Version:
Stateless, task-oriented AI agent core
25 lines (24 loc) • 2.06 kB
TypeScript
import { type SessionPlacement, type SessionStore } from "../core/session.js";
/**
* Whether a background child's transcript is placed. Gated on BOTH stores: the row store (the a* handle the tuple joins to) AND the
* declaration of the session store that creates the transcript (`declaresSubagentPlacement`, the deployment's opt-in) — for a fork
* that is the store the branch is created in, so the Runner's host fork applies the host store's declaration. Without the declaration gate, a hand-wired durable repo
* (TtlSessionStore over FileSessionRepo, no `placements`) would persist tuples it never opted into: list-excluded transcripts
* nothing can address, a release that really deletes under evict:"forget", and a manifest reporting tier "rows" while placed
* semantics are silently in force. Obligation enforcement below the store keys on the PERSISTED fact — this gate is what keeps
* that fact deployment-consistent. What it does NOT decide is whether the transcript reaches DISK: an unplaced child still lands
* in whatever store the child runner is backed by. Placement buys ADDRESSABILITY (the a* handle, cross-restart revival, joint
* reap), not persistence.
*/
export declare function placesSubagentTranscripts(agentStore: unknown, sessions: Pick<SessionStore, "placements">): boolean;
/**
* The one tuple a background child's transcript session is created with, on both background lanes: a plain spawn's creating
* acquire and a fork's creating write. The spawner is the minter — it knows the a* handle, the row's scope and the tree it spawns
* in — so the parent is the spawning session and the root is that session's root (or itself). It names no owner (no tuple does): the
* row's owner is the creating write's own — the child's acquire names the delegation tree's owner, a fork records it through its owner
* argument.
*/
export declare function subagentTranscriptPlacement(spawner: {
readonly sessionId?: string;
readonly rootSessionId?: string;
}, scope: string | undefined, handle: string): SessionPlacement;