Compare commits

..
4 changed files with 64 additions and 16 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
{
"monorepoCommit": "b35af6a2bb99960ac51912f4b16bcb5ad962ea7f",
"monorepoCommit": "bad708f494047a00aa670c48f128da06fcb59e59",
"sourcePath": "quixos-instance/packages/agent-presentation"
}
+7 -7
View File
@@ -1,9 +1,9 @@
quixos-lock version 1 {
quixos source { repository "https://gitea.internal.quixos.org/quixos/quixos.git"; commit "b35af6a2bb99960ac51912f4b16bcb5ad962ea7f"; }
interface StandaloneView source { repository "https://repos.quixos.org/quixos-templates/interface-react-standalone-view.git"; commit "69f014c7977f417aa5c29e6e7863c123ba2e15b6"; }
interface AgentThread source { repository "https://repos.quixos.org/quixos-templates/interface-agent-thread.git"; commit "9bef7770076bc0a69ccabb81f86311a091f8b22d"; }
interface Agent source { repository "https://repos.quixos.org/quixos-templates/interface-agent.git"; commit "6488a0ac1b44dae0ad7f62355ef09c7006797cea"; }
interface AgentRequest source { repository "https://repos.quixos.org/quixos-templates/interface-agent-request.git"; commit "5675c5f1e9442cf4f764bd4e98b134edd33ed11c"; }
interface AgentItem source { repository "https://repos.quixos.org/quixos-templates/interface-agent-item.git"; commit "03a3f52737bacf5b5a94a760750a0223652e8722"; }
interface AgentQuestion source { repository "https://repos.quixos.org/quixos-templates/interface-agent-question.git"; commit "8e8a8873ed1a94c5491f3305f25d9e417c8ccd02"; }
quixos source { repository "https://gitea.internal.quixos.org/quixos/quixos.git"; commit "bad708f494047a00aa670c48f128da06fcb59e59"; }
interface StandaloneView source { repository "https://repos.quixos.org/quixos-templates/interface-react-standalone-view.git"; commit "ce9001488f393700625ec7fd74c2fc05034cf619"; }
interface AgentThread source { repository "https://repos.quixos.org/quixos-templates/interface-agent-thread.git"; commit "ec37ef9c8cac9e4ca931a9e97cf0f64c96572f89"; }
interface Agent source { repository "https://repos.quixos.org/quixos-templates/interface-agent.git"; commit "2d71cd57196d3d44b0b827201d50289b0b198754"; }
interface AgentRequest source { repository "https://repos.quixos.org/quixos-templates/interface-agent-request.git"; commit "b3e2c538a84074aab39fcdf9f0594733b4945253"; }
interface AgentItem source { repository "https://repos.quixos.org/quixos-templates/interface-agent-item.git"; commit "0ce345bfdd5682ae8715edc6100145c2f99b5c64"; }
interface AgentQuestion source { repository "https://repos.quixos.org/quixos-templates/interface-agent-question.git"; commit "066cde5cbe93386ef61e33dfc37f6454e33f40e6"; }
}
+55 -8
View File
@@ -144,17 +144,62 @@ function QuestionForm({
</form>
);
}
function Activity({ item }: { item: Item }) {
let value: any;
function activityValue(item: Item) {
try {
value = JSON.parse(item.data.activity ?? "null");
} catch {}
const title = value?.command ?? value?.label ?? item.data.text ?? "Activity";
return JSON.parse(item.data.activity ?? "null");
} catch {
return null;
}
}
function activityFailed(item: Item) {
const value = activityValue(item);
return (
["failed", "error", "cancelled", "uncertain"].includes(value?.status) ||
(typeof value?.exitCode === "number" && value.exitCode !== 0)
);
}
function Activity({ item }: { item: Item }) {
const value = activityValue(item),
failed = activityFailed(item),
title = value?.command ?? value?.label ?? item.data.text ?? "Activity";
return (
<details className="agent-activity-card">
<summary>{String(title).slice(0, 300)}</summary>
<summary>{failed ? "Tool needs attention" : "Tool details"}</summary>
<pre>{String(title)}</pre>
<pre>{value?.aggregatedOutput ?? value?.output ?? value?.detail ?? item.data.text}</pre>
{value?.exitCode !== undefined && <p>Exit code: {value.exitCode}</p>}
{value?.exitCode !== undefined && value?.exitCode !== null && <p>Exit code: {value.exitCode}</p>}
</details>
);
}
/** Keep chronological message boundaries and failures visible. Only adjacent
* routine tool records fold together; every original item remains inspectable. */
function conversationRows(items: Item[]): (Item | Item[])[] {
const rows: (Item | Item[])[] = [];
for (const item of items) {
const value = activityValue(item);
if (
item.data.kind === "activity" &&
value &&
["completed", "running", "inProgress", "in_progress"].includes(value.status) &&
!activityFailed(item)
) {
const previous = rows.at(-1);
if (Array.isArray(previous)) previous.push(item);
else rows.push([item]);
} else rows.push(item);
}
return rows;
}
function ToolHistory({ items }: { items: Item[] }) {
const working = items.some((item) => activityValue(item)?.status !== "completed");
return (
<details className="agent-tool-history">
<summary>
{items.length} tool {items.length === 1 ? "call" : "calls"} · {working ? "Working" : "Completed"}
</summary>
{items.map((item) => (
<Activity key={itemKey(item)} item={item} />
))}
</details>
);
}
@@ -420,7 +465,9 @@ export function ThreadView({
</time>
)}
</div>
{items.map((item) => {
{(renderItem ? items : conversationRows(items)).map((row) => {
if (Array.isArray(row)) return <ToolHistory key={itemKey(row[0])} items={row} />;
const item = row;
const custom = renderItem?.(item, request);
return (
<React.Fragment key={itemKey(item)}>
+1
View File
@@ -78,6 +78,7 @@
overflow-wrap: anywhere;
}
.agent-activity-card,
.agent-tool-history,
.agent-commentary {
border: 1px solid #e0e5ee;
border-radius: 7px;