···2020import { discoverExtensions, loadExtensionManifest, isBuiltinExtensionEnabled, getExternalExtensions, type ExtensionManifest, type ManifestCommand, type ManifestShortcut } from './extensions.js';
2121import { initializeFeatures, type FeatureStartupResult } from './feature-startup.js';
2222import { ensureTileIpcHandlers } from './tile-compat.js';
2323-import { getLoadedTileIds, getTileManifest, getAllTileWindows, unloadAllTiles } from './tile-launcher.js';
2323+import { getLoadedTileIds, getTileManifest, getAllTileWindows, unloadAllTiles, relaunchTile } from './tile-launcher.js';
2424import { initTray } from './tray.js';
2525import { registerLocalShortcut, unregisterLocalShortcut, handleLocalShortcut, registerGlobalShortcut, unregisterGlobalShortcut, unregisterShortcutsForAddress } from './shortcuts.js';
2626import { scopes, publish, subscribe, unsubscribe, hasSubscriber, setExtensionBroadcaster, getSystemAddress } from './pubsub.js';
···16711671}
1672167216731673/**
16741674- * Reload an extension by destroying and recreating its window
16751675- * Returns the new window on success, null on failure
16741674+ * Reload an extension by closing and relaunching its tile window.
16751675+ * Returns a truthy result on success, null on failure.
16761676 */
16771677-export async function reloadExtension(extId: string): Promise<BrowserWindow | null> {
16771677+export async function reloadExtension(extId: string): Promise<object | null> {
16781678 DEBUG && console.log(`[ext:reload] Reloading extension: ${extId}`);
1679167916801680 // Check if it's a consolidated extension (not supported for reload)
···16831683 return null;
16841684 }
1685168516861686- // Destroy existing window if any
16871687- const existingEntry = extensionWindows.get(extId);
16881688- if (existingEntry) {
16891689- if (existingEntry.win && !existingEntry.win.isDestroyed()) {
16901690- existingEntry.win.destroy();
16911691- }
16921692- extensionWindows.delete(extId);
16931693- }
16941694-16951695- // Small delay to ensure cleanup
16961696- await new Promise(resolve => setTimeout(resolve, 100));
16971697-16981698- // For dev extensions, use loadDevExtension to ensure devtools opens
16861686+ // For dev extensions, open devtools after relaunch
16991687 if (isDevExtension(extId)) {
17001688 return loadDevExtension(extId);
17011689 }
1702169017031703- // For normal extensions, use createExtensionWindow
17041704- return createExtensionWindow(extId);
16911691+ // Relaunch as v2 tile: re-read manifest, revoke old token, close old window, launch fresh.
16921692+ return relaunchTile(extId);
17051693}
1706169417071695/**