feat(app): show loaded agents.md files
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
)
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user