From fbd029e4cbcce6b6478d24c37a8c273a1ac7aa1c Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Wed, 29 Apr 2026 23:30:18 -0400 Subject: [PATCH] feat(ext/shared): message types for LastPass import Adds parse_lastpass_csv (preview) and import_lastpass_commit (write) to the popup-only message set, plus typed response helpers. SW handlers + UI follow in Tasks 12-14. Co-Authored-By: Claude Opus 4.7 --- extension/src/shared/messages.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/extension/src/shared/messages.ts b/extension/src/shared/messages.ts index 1788701..f5a73a7 100644 --- a/extension/src/shared/messages.ts +++ b/extension/src/shared/messages.ts @@ -55,7 +55,9 @@ export type PopupMessage = bytes: ArrayBuffer; passphrase: string; newRemote: { hostType: 'gitea' | 'github'; hostUrl: string; repoPath: string; apiToken: string }; - }; + } + | { type: 'parse_lastpass_csv'; bytes: ArrayBuffer } + | { type: 'import_lastpass_commit'; items: Item[] }; // --- Messages a content script may send --- @@ -161,6 +163,7 @@ export const POPUP_ONLY_TYPES: ReadonlySet = new Set([ 'get_field_history', 'get_session_config', 'update_session_config', 'export_backup', 'restore_backup', + 'parse_lastpass_csv', 'import_lastpass_commit', ] as PopupMessage['type'][]); export interface ExportBackupResponse extends Extract { @@ -173,6 +176,19 @@ export interface RestoreBackupResponse extends Extract { }; } +export interface ParseLastPassCsvResponse extends Extract { + data: { + items: Item[]; + warnings: Array<{ row: number; title?: string; message: string }>; + }; +} + +export interface ImportLastPassCommitResponse extends Extract { + data: { + summary: { itemCount: number }; + }; +} + export const CONTENT_CALLABLE_TYPES: ReadonlySet = new Set([ 'get_autofill_candidates', 'get_credentials', 'check_credential', 'blacklist_site', 'capture_save_login',