diff --git a/front_end/panels/ai_assistance/ExtensionScope.ts b/front_end/panels/ai_assistance/ExtensionScope.ts index 515754aa59d..f1000242211 100644 --- a/front_end/panels/ai_assistance/ExtensionScope.ts +++ b/front_end/panels/ai_assistance/ExtensionScope.ts @@ -210,7 +210,7 @@ const functions = `async function setElementStyles(el, styles) { // Remove inline styles with the same keys so that the edit applies. for (const [key, value] of Object.entries(styles)) { - // if it's kebap case. + // if it's kebab case. el.style.removeProperty(key); // If it's camel case. el.style[key] = ''; diff --git a/front_end/panels/ai_assistance/agents/AiAgent.ts b/front_end/panels/ai_assistance/agents/AiAgent.ts index 102c8d429f4..b39b2417803 100644 --- a/front_end/panels/ai_assistance/agents/AiAgent.ts +++ b/front_end/panels/ai_assistance/agents/AiAgent.ts @@ -149,7 +149,7 @@ export abstract class ConversationContext { /** * This method is called at the start of `AiAgent.run`. - * It will be overriden in subclasses to fetch data related to the context item. + * It will be overridden in subclasses to fetch data related to the context item. */ async refresh(): Promise { return; diff --git a/front_end/panels/ai_assistance/agents/NetworkAgent.ts b/front_end/panels/ai_assistance/agents/NetworkAgent.ts index d384bf1598c..8d20f40d4f8 100644 --- a/front_end/panels/ai_assistance/agents/NetworkAgent.ts +++ b/front_end/panels/ai_assistance/agents/NetworkAgent.ts @@ -384,11 +384,11 @@ export function formatRequestInitiatorChain(request: SDK.NetworkRequest.NetworkR let lineStart = '- URL: '; const initiators = Logs.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(request).initiators; - for (const initator of Array.from(initiators).reverse()) { - initiatorChain = initiatorChain + lineStart + formatInitiatorUrl(initator.url(), allowedOrigin) + '\n'; + for (const initiator of Array.from(initiators).reverse()) { + initiatorChain = initiatorChain + lineStart + formatInitiatorUrl(initiator.url(), allowedOrigin) + '\n'; lineStart = '\t' + lineStart; - if (initator === request) { - initiatorChain = formatRequestInitiated(initator, initiatorChain, lineStart, allowedOrigin); + if (initiator === request) { + initiatorChain = formatRequestInitiated(initiator, initiatorChain, lineStart, allowedOrigin); break; } } diff --git a/front_end/panels/ai_assistance/agents/PatchAgent.ts b/front_end/panels/ai_assistance/agents/PatchAgent.ts index 569918ee546..10b23a617de 100644 --- a/front_end/panels/ai_assistance/agents/PatchAgent.ts +++ b/front_end/panels/ai_assistance/agents/PatchAgent.ts @@ -26,7 +26,7 @@ import { const preamble = `You are responsible for changing the source code on behalf of the user. The user query defines what changes are to be made. You have a number of functions to get information about source files in the project. -Use those functions to fullful the user query. +Use those functions to fulfill the user query. ## Step-by-step instructions @@ -149,7 +149,7 @@ export class PatchAgent extends AiAgent { properties: { filepath: { type: Host.AidaClient.ParametersTypes.STRING, - description: 'A file path that idenfities the file to get the content for', + description: 'A file path that identifies the file to get the content for', nullable: false, }, }, @@ -194,7 +194,7 @@ export class PatchAgent extends AiAgent { properties: { filepath: { type: Host.AidaClient.ParametersTypes.STRING, - description: 'A file path that idenfities the file', + description: 'A file path that identifies the file', nullable: false, }, content: { @@ -219,7 +219,7 @@ export class PatchAgent extends AiAgent { }; } const content = params.content; - // TODO: we unespace some characters to restore the original + // TODO: we unescape some characters to restore the original // content but this should be fixed upstream. uiSourceCode.setContent( content.replaceAll('\\n', '\n').replaceAll('\\"', '"').replaceAll('\\\'', '\''), @@ -277,14 +277,14 @@ export class PatchAgent extends AiAgent { return [...this.#history]; } - override async * run(initalQuery: string, options: { + override async * run(initialQuery: string, options: { signal?: AbortSignal, selected: ConversationContext|null, }): AsyncGenerator { await options.selected?.refresh(); this.#project = options.selected ?? undefined; - let query: Host.AidaClient.Part = {text: initalQuery}; + let query: Host.AidaClient.Part = {text: initialQuery}; // Request is built here to capture history up to this point. let request = this.buildRequest(query); diff --git a/front_end/panels/ai_assistance/components/ChatView.ts b/front_end/panels/ai_assistance/components/ChatView.ts index 6514635953d..89abb5e3a5e 100644 --- a/front_end/panels/ai_assistance/components/ChatView.ts +++ b/front_end/panels/ai_assistance/components/ChatView.ts @@ -561,7 +561,7 @@ export class ChatView extends HTMLElement { } if (ev.key === 'Enter' && !ev.shiftKey) { - // Do not go to a new line whenver Shift + Enter is pressed. + // Do not go to a new line whenever Shift + Enter is pressed. ev.preventDefault(); // Only submit the text when there isn't a request already in flight. if (!this.#props.isLoading) {