import type { SharedSessionWorkspaceAgentRecord, SharedSessionWorkspaceManifest, SharedSessionWorkspacePlan, SharedSessionWorkspaceRefs, SharedSessionWorkspaceSource } from '../../types/workspace/shared-session.js'; export interface SharedSessionWorkspaceConfig { /** * Host-visible `_work` directory. The runtime creates and mutates files * here before/while agents execute. */ hostRoot: string; /** * Agent-visible `_work` directory. In container sandboxes this is usually * `/mnt/user-data/outputs/_work`; in local mode it can be the same * relative path agents receive in their runtime notes. */ runtimeRoot?: string; label?: string; now?: Date; } export interface RegisterSharedSessionPlanInput { id?: string; briefText: string; status?: SharedSessionWorkspacePlan['status']; } /** * A `_work` directory a turn's agents share — files, a manifest, a plan and * per-agent records — offered to hosts and applied by none of them. * * **Nothing in this SDK calls it, and that is the design, not an omission.** * It was flagged as a primitive exported without a driver, which is a real * defect class and the reason most of this module's siblings were wired up. * This one is the exception, and the distinguishing question is whose decision * the thing encodes. * * Look at what {@link SharedSessionWorkspaceConfig} asks for: `hostRoot`, where * the directory lives on the machine running the kernel, and `runtimeRoot`, * the path an agent will see — `/mnt/user-data/outputs/_work` under one * container layout, the same directory as `hostRoot` in a local turn, a bind * target somewhere else entirely under a third. Those two roots are a * deployment shape. A kernel that picked them would be choosing a filesystem * layout for a host that has already chosen one, and would then have to be * argued back out of it — the same reason `ToolCatalogSurface` was removed * rather than made to work: a host's deployment surfaces are the host's to * name. * * So the contract here is `runtimeRoot` and the paths {@link refs} derives * from it. Those strings are what a host puts in a prompt and what an agent's * `read` and `write` calls resolve against, which makes them an interface * between three parties — and stable for that reason, not incidentally. * * A host wires it by calling {@link create} with both roots, passing * `refs()` into its agents' runtime notes, and reading the manifest back when * the turn ends. If a future default gateway grows an opinion about where * `_work` belongs, this is the thing it should call rather than reimplement. */ export declare class SharedSessionWorkspace { private readonly config; readonly hostRoot: string; readonly runtimeRoot: string; private manifestWriteQueue; private constructor(); static create(config: SharedSessionWorkspaceConfig): Promise; refs(): SharedSessionWorkspaceRefs; hostPath(...segments: string[]): string; runtimePath(...segments: string[]): string; ensure(): Promise; readManifest(): Promise; writeManifest(update: (manifest: SharedSessionWorkspaceManifest) => SharedSessionWorkspaceManifest): Promise; writeSourceInventory(sources: readonly SharedSessionWorkspaceSource[]): Promise; /** * Write the canonical task-context file (`_work/01_task_context.md`). * This is the single place the original user request lives in full; child * workers read this path instead of receiving the request inline in their * prompts. */ writeTaskContext(text: string): Promise; /** * Write the shared coordination packet (`_work/02_shared_context.md`). * This is intentionally smaller and more operational than the task context: * workers read it first, then open the full task context or source inventory * only when their assignment needs raw wording or source-file details. */ writeSharedContext(text: string): Promise; /** * Write a per-worker brief at `agents///00_brief.md`. * Returns the runtime-visible path. Pair with `registerAgentWork` so the * agent record and the brief sit under the same scratch directory. */ writeAgentBrief(input: { agentId: string; taskId?: string; briefText: string; }): Promise; /** * Append a section to an existing per-worker brief, creating the file if * it doesn't yet exist. Use for follow-up turns / continue flows so the * brief stays authoritative across resumes — workers re-reading the brief * on every entry will see the latest assignment delta, not just the seed * text from initial dispatch. */ appendAgentBrief(input: { agentId: string; taskId?: string; sectionText: string; }): Promise; seedSupervisorBrief(input: RegisterSharedSessionPlanInput): Promise; registerAgentWork(input: { agentId: string; taskId?: string; status?: SharedSessionWorkspaceAgentRecord['status']; }): Promise; private initialManifest; private nowIso; } //# sourceMappingURL=shared-session.d.ts.map