Name Description Size Coverage
AIWindow.sys.mjs @import {SmartbarInput} from "chrome://browser/content/urlbar/SmartbarInput.mjs" 32186 -
AIWindowAccountAuth.sys.mjs 2635 -
AIWindowConstants.sys.mjs The current SQLite database schema version 3510 -
AIWindowMenu.sys.mjs Adds the AI Window menuitems to the app menu 4079 -
AIWindowTabStatesManager.sys.mjs At which count the empty close prompt should be shown. If this value needs to be updated it should also be updated in the trigger string in FeatureCalloutMessages.sys.mjs 24556 -
AIWindowUI.sys.mjs @param {Window} win @returns {{ chromeDoc: Document, box: Element, splitter: Element } | null} 13419 -
ChatConversation.sys.mjs A conversation containing messages. 29105 -
ChatEnums.sys.mjs @typedef ConversationStatus @property {number} ACTIVE - An active conversation @property {number} ARCHIVE - An archived conversation @property {number} DELETED - A deleted conversation 1206 -
ChatMarkdownParser.mjs Markdown parser for Smart Window chat messages. 1259 -
ChatMessage.sys.mjs @import { ContextWebsite } from "chrome://browser/content/urlbar/SmartbarInput.mjs" 10184 -
ChatMigrations.sys.mjs Please refer to sql.mjs for details on creating new migrations. - List each change here and what it's for. @param {OpenedConnection} conn - The SQLite connection to use for the migration @param {number} version - The version number of the current schema 4193 -
ChatSql.sys.mjs 12597 -
ChatStore.sys.mjs Simple interface to store and retrieve chat conversations and messages. @todo Bug 2005409 Move this documentation to Firefox source docs See: https://docs.google.com/document/d/1VlwmGbMhPIe-tmeKWinHuPh50VC9QrWEeQQ5V-UvEso/edit?tab=t.klqqibndv3zk @example let { ChatStore, ChatConversation, ChatMessage, MESSAGE_ROLE } = ChromeUtils.importESModule("resource:///modules/aiwindow/ui/modules/ChatStore.sys.mjs"); const chatStore = ChatStore; const conversation = new ChatConversation({ title: "title", description: "description", pageUrl: new URL("https://mozilla.com/"), pageMeta: { one: 1, two: 2 }, }); const msg1 = new ChatMessage({ ordinal: 0, role: MESSAGE_ROLE.USER, modelId: "test", params: { one: "one" }, usage: { two: "two", content: "some content" }, }); const msg2 = new ChatMessage({ ordinal: 1, role: MESSAGE_ROLE.ASSISTANT, modelId: "test", params: { one: "one" }, usage: { two: "two", content: "some content 2" }, }); conversation.messages = [msg1, msg2]; await chatStore.updateConversation(conversation); // Or findConversationsByDate, findConversationsByURL. const foundConversation = await chatStore.findConversationById(conversation.id); @typedef {object} ChatStore @property {*} x ? 30876 -
ChatUtils.sys.mjs Gets the URL of the currently selected tab of a window. Primarily used to retrieve the current tab's url for use in ChatMessage.pageUrl and message context chips. @param {Window} window @returns {?URL} 6251 -
SmartWindowTelemetry.sys.mjs This singleton is for telemetry events that benefit from shared state management. Simple events to be handled with inline Glean calls 2838 -
TabManagementService.sys.mjs Service for managing browser tabs from AI Window UI components. This service closes tabs using gBrowser.removeTab(), allowing Firefox's native SessionStore machinery to keep the actual closed-tab restore state. The service only stores lightweight operation metadata so the AI Window can target a specific close operation when the user clicks "Undo". 12786 -
TokenStreamParser.mjs Bug 2017972 Turn a URL token back into the text we want to show in the chat. Two cases: 1. The token is sitting inside a markdown link, like `[click](§url§)`. We drop the URL straight in. We replace any characters that would confuse markdown's link parser with their percent-encoded equivalents: - spaces and `<` `>` always get encoded - `(` and `)` only get encoded when the URL has an unbalanced pair, which is what the parser actually trips on. URLs with matched parens (Wikipedia etc.) are left alone so the link looks normal on hover. 2. The token is on its own, like `See §url§ for details`. We wrap the URL in `<...>` so it renders as a clickable link. Spaces and `<` `>` get percent-encoded so they can't break out of the wrapper. @param {string} url - The URL the token resolves to. @param {string} recentPlain - Tail of recently emitted plain text, used to detect whether the token sits inside a markdown link. @returns {string} The text to inject into the streamed plain output. 9414 -