From b52e49a51ec760f8403c37571e15ebe8875aa313 Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Fri, 24 Apr 2026 18:54:21 -0400 Subject: [PATCH] feat(ext/shared): tighten VaultSettings types for retention + generator_defaults --- extension/src/shared/types.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/extension/src/shared/types.ts b/extension/src/shared/types.ts index e2b7340..7893e38 100644 --- a/extension/src/shared/types.ts +++ b/extension/src/shared/types.ts @@ -183,15 +183,24 @@ export interface ManifestEntry { attachment_summaries: AttachmentSummary[]; } -// --- Vault settings (only the fields α touches) --- +// --- Vault settings --- // Full shape lives on the Rust side and in docs/superpowers/specs/2026-04-18-relicario-typed-items-design.md -// We leave retention/generator/caps opaque to α so we don't accidentally mutate them. +// β₂ tightens retention + generator_defaults; γ owns attachment_caps. + +export type TrashRetention = + | { kind: 'forever' } + | { kind: 'days'; value: number }; + +export type HistoryRetention = + | { kind: 'forever' } + | { kind: 'last_n'; value: number } + | { kind: 'days'; value: number }; export interface VaultSettings { - trash_retention: unknown; - field_history_retention: unknown; - generator_defaults: unknown; - attachment_caps: unknown; + trash_retention: TrashRetention; + field_history_retention: HistoryRetention; + generator_defaults: GeneratorRequest; + attachment_caps: unknown; // opaque — γ tightens autofill_origin_acks: Record; }