import { type AgentReplyArtifactOpenRequest, type AgentReplyArtifactStream, type AgentResponder } from "@mono-agent/agent-contracts"; import type { ToolPolicyInput } from "@mono-agent/agent-harness"; import type { RuntimeOptionsExtension } from "./runtime-option-extensions.js"; import { type ReplyPartBudget } from "./reply-part-budget.js"; export declare const REPLY_ARTIFACT_MCP_SERVER_NAME = "mono-agent-reply-artifacts"; export declare const PUBLISH_REPLY_FILE_TOOL_NAME = "PublishReplyFile"; export declare const DEFAULT_REPLY_ARTIFACT_STORAGE_MAX_BYTES: number; declare const REPLY_ARTIFACT_STORAGE_NAMESPACES: readonly ["reply-files", "mcp-apps"]; type ReplyArtifactPolicy = Pick; export interface ReplyArtifactServiceOptions { readonly artifactDir: string; readonly workspace: string; /** Resolved state, memory, credential, config, and other private roots. */ readonly privateRoots?: readonly string[]; readonly retentionDays?: number; readonly maxFileBytes?: number; readonly now?: () => Date; /** Shared with other reply-part producers in the app composition root. */ readonly replyPartBudget?: ReplyPartBudget; /** Shared aggregate durable-storage admission across rich-part producers. */ readonly storageBudget?: ReplyArtifactStorageBudget; /** @internal deterministic cleanup/concurrency test seam. */ readonly stagingGraceMs?: number; /** @internal runs after canonicalization and before the source fd is opened. */ readonly beforeSourceOpen?: () => void | Promise; /** @internal runs after all staged files are durable and before directory rename. */ readonly beforePublicationCommit?: () => void | Promise; } export interface ReplyArtifactService { readonly createExtension: RuntimeOptionsExtension; wrapResponder(responder: AgentResponder): AgentResponder; open(request: AgentReplyArtifactOpenRequest): Promise; cleanupExpired(): Promise; } type ReplyArtifactStorageNamespace = (typeof REPLY_ARTIFACT_STORAGE_NAMESPACES)[number]; export interface ReplyArtifactStorageReservation { release(): Promise; } export interface ReplyArtifactStorageProtection { release(): Promise; } export interface ReplyArtifactStorageBudget { readonly maxBytes: number; reserve(maximumBytes: number): Promise; protect(namespace: ReplyArtifactStorageNamespace, id: string): Promise; runExclusive(operation: (isProtected: (namespace: ReplyArtifactStorageNamespace, id: string) => boolean) => Promise): Promise; } /** * One process-wide coordinator per artifact root. Every admission re-inventories * both durable rich-reply namespaces, so a fresh process accounts for content * left by a previous one before accepting any new bytes. */ export declare function replyArtifactStorageBudgetFor(artifactDir: string, maxBytes?: number): ReplyArtifactStorageBudget; export declare class ReplyArtifactStorageFullError extends Error { constructor(); } /** Resolve the same policy aliases accepted by other app-owned MCP tools. */ export declare function isPublishReplyFileToolAllowed(policy: ReplyArtifactPolicy | undefined): boolean; /** * Durable generated-file publisher. Its normal reply surface contains only * metadata and opaque ids; bytes stay below the private artifact root. */ export declare function createReplyArtifactService(options: ReplyArtifactServiceOptions): ReplyArtifactService; export {}; //# sourceMappingURL=reply-artifacts.d.ts.map