chrome-devtools-frontend
Version:
Chrome DevTools UI
46 lines (36 loc) • 1.28 kB
text/typescript
// Copyright 2026 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import type * as Workspace from '../../workspace/workspace.js';
import {type ContextDetail, ConversationContext} from '../agents/AiAgent.js';
import {FileFormatter} from '../data_formatters/FileFormatter.js';
export class FileContext extends ConversationContext<Workspace.UISourceCode.UISourceCode> {
constructor(file: Workspace.UISourceCode.UISourceCode) {
super();
this.
}
override getURL(): string {
return this.
}
override getItem(): Workspace.UISourceCode.UISourceCode {
return this.
}
override getTitle(): string {
return this.
}
override async getPromptDetails(): Promise<string|null> {
return `
}
override async getUserFacingDetails(): Promise<[ContextDetail, ...ContextDetail[]]|null> {
return [
{
title: 'Selected file',
text: new FileFormatter(this.
},
];
}
override async refresh(): Promise<void> {
await this.
}
}