feat(app): show loaded agents.md files

This commit is contained in:
adamelmore
2026-01-27 11:18:07 -06:00
parent b9edd23608
commit 07d84fe008
16 changed files with 59 additions and 9 deletions

View File

@@ -809,3 +809,20 @@
display: none;
}
}
[data-component="tool-loaded-file"] {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 0 4px 28px;
font-family: var(--font-family-sans);
font-size: var(--font-size-small);
font-weight: var(--font-weight-regular);
line-height: var(--line-height-large);
color: var(--text-weak);
[data-component="icon"] {
flex-shrink: 0;
color: var(--icon-weak);
}
}

View File

@@ -724,20 +724,39 @@ PART_MAPPING["reasoning"] = function ReasoningPartDisplay(props) {
ToolRegistry.register({
name: "read",
render(props) {
const data = useData()
const i18n = useI18n()
const args: string[] = []
if (props.input.offset) args.push("offset=" + props.input.offset)
if (props.input.limit) args.push("limit=" + props.input.limit)
const loaded = createMemo(() => {
if (props.status !== "completed") return []
const value = props.metadata.loaded
if (!value || !Array.isArray(value)) return []
return value.filter((p): p is string => typeof p === "string")
})
return (
<BasicTool
{...props}
icon="glasses"
trigger={{
title: i18n.t("ui.tool.read"),
subtitle: props.input.filePath ? getFilename(props.input.filePath) : "",
args,
}}
/>
<>
<BasicTool
{...props}
icon="glasses"
trigger={{
title: i18n.t("ui.tool.read"),
subtitle: props.input.filePath ? getFilename(props.input.filePath) : "",
args,
}}
/>
<For each={loaded()}>
{(filepath) => (
<div data-component="tool-loaded-file">
<Icon name="enter" size="small" />
<span>
{i18n.t("ui.tool.loaded")} {relativizeProjectPaths(filepath, data.directory)}
</span>
</div>
)}
</For>
</>
)
},
})