/** * log10x_offload_add + log10x_offload_archive — manage the * `offload_destinations[]` list inside an environment's env-config document. * * These two tools are the in-MCP surface for editing the env document the * Receiver consults when it routes the `routeState="drop"` slice. They share a single * load/mutate/write helper and so live in one file: * * - `log10x_offload_add` appends a new destination (s3 / gcs / azure_blob / * file) to the list. Defaults `status` to `active`. A second `active` * destination is allowed — multi-target offload (e.g. draining a legacy * bucket while a new one is primary) is the documented use case the * schema array exists to support. * * - `log10x_offload_archive` flips one destination's `status` to `archived` * and stamps `archived_at`. Refuses the operation when the target is the * ONLY remaining active destination — the Receiver requires at least one * active bucket to route the dropped slice to, and archiving the last * active entry would silently strand offload traffic. The user is told * which other destinations need to be activated first. * * Both tools resolve env-config from the same precedence chain the resolver * walks (k8s → AWS SSM → GCP Secret Manager → Azure App Config → local file), * and write back to the SAME store the document was read from so a customer's * source-of-truth store stays the source of truth. */ import { z } from 'zod'; import type { EnvConfigStore } from '../lib/env-config/store-interface.js'; import { type StructuredOutput } from '../lib/output-types.js'; declare const offloadAuthSchema: z.ZodObject<{ method: z.ZodEnum<["irsa", "iam_role", "workload_identity", "service_principal", "access_key", "connection_string", "none"]>; role: z.ZodOptional; sa: z.ZodOptional; note: z.ZodOptional; }, "strip", z.ZodTypeAny, { method: "none" | "irsa" | "iam_role" | "workload_identity" | "service_principal" | "access_key" | "connection_string"; role?: string | undefined; sa?: string | undefined; note?: string | undefined; }, { method: "none" | "irsa" | "iam_role" | "workload_identity" | "service_principal" | "access_key" | "connection_string"; role?: string | undefined; sa?: string | undefined; note?: string | undefined; }>; export declare const offloadAddSchema: { env_id: z.ZodString; nickname: z.ZodString; type: z.ZodEnum<["s3", "gcs", "azure_blob", "file"]>; bucket: z.ZodOptional; storage_account: z.ZodOptional; prefix: z.ZodOptional; region: z.ZodOptional; note: z.ZodOptional; auth: z.ZodOptional; role: z.ZodOptional; sa: z.ZodOptional; note: z.ZodOptional; }, "strip", z.ZodTypeAny, { method: "none" | "irsa" | "iam_role" | "workload_identity" | "service_principal" | "access_key" | "connection_string"; role?: string | undefined; sa?: string | undefined; note?: string | undefined; }, { method: "none" | "irsa" | "iam_role" | "workload_identity" | "service_principal" | "access_key" | "connection_string"; role?: string | undefined; sa?: string | undefined; note?: string | undefined; }>>; status: z.ZodOptional>; }; export declare const offloadArchiveSchema: { env_id: z.ZodString; nickname: z.ZodString; archived_at: z.ZodOptional; note: z.ZodOptional; }; interface OffloadAddArgs { env_id: string; nickname: string; type: 's3' | 'gcs' | 'azure_blob' | 'file'; bucket?: string; storage_account?: string; prefix?: string; region?: string; note?: string; auth?: z.infer; status?: 'active' | 'draining' | 'archived' | 'failed'; } interface OffloadArchiveArgs { env_id: string; nickname: string; archived_at?: string; note?: string; } export declare function executeOffloadAdd(args: OffloadAddArgs, storeOverride?: EnvConfigStore[]): Promise; export declare function executeOffloadArchive(args: OffloadArchiveArgs, storeOverride?: EnvConfigStore[]): Promise; export {};