mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 12:03:03 +00:00
Add extract_document tool and improve artifacts tab scrolling
- Add extract_document tool for extracting text from PDF/DOCX/XLSX/PPTX from URLs - CORS proxy support from settings for fetching documents - Proper error messages guiding users on CORS issues and manual file attachment - Add scroll-into-view for active artifact tabs - Export extract_document tool from web-ui package
This commit is contained in:
parent
f93e72a805
commit
f8b98f7dac
5 changed files with 287 additions and 1 deletions
|
|
@ -137,7 +137,8 @@ export class ArtifactsPanel extends LitElement {
|
|||
ext === "css" ||
|
||||
ext === "scss" ||
|
||||
ext === "sass" ||
|
||||
ext === "less"
|
||||
ext === "less" ||
|
||||
ext === "sh"
|
||||
)
|
||||
return "text";
|
||||
// Everything else gets generic fallback
|
||||
|
|
@ -218,6 +219,14 @@ export class ArtifactsPanel extends LitElement {
|
|||
});
|
||||
this._activeFilename = filename;
|
||||
this.requestUpdate(); // Only for tab bar update
|
||||
|
||||
// Scroll the active tab into view after render
|
||||
requestAnimationFrame(() => {
|
||||
const activeButton = this.querySelector(`button[data-filename="${filename}"]`);
|
||||
if (activeButton) {
|
||||
activeButton.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Open panel and focus an artifact tab by filename
|
||||
|
|
@ -617,6 +626,7 @@ export class ArtifactsPanel extends LitElement {
|
|||
return html`
|
||||
<button
|
||||
class="px-3 py-2 whitespace-nowrap border-b-2 ${activeClass}"
|
||||
data-filename="${a.filename}"
|
||||
@click=${() => this.showArtifact(a.filename)}
|
||||
>
|
||||
<span class="font-mono text-xs">${a.filename}</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue