mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 02:04:13 +00:00
support pi
This commit is contained in:
parent
cc5a9e0d73
commit
843498e9db
41 changed files with 2654 additions and 102 deletions
|
|
@ -19,7 +19,7 @@ import type { RequestLog } from "./types/requestLog";
|
|||
import { buildCurl } from "./utils/http";
|
||||
|
||||
const logoUrl = `${import.meta.env.BASE_URL}logos/sandboxagent.svg`;
|
||||
const defaultAgents = ["claude", "codex", "opencode", "amp", "mock"];
|
||||
const defaultAgents = ["claude", "codex", "opencode", "amp", "pi", "mock"];
|
||||
|
||||
type ItemEventData = {
|
||||
item: UniversalItem;
|
||||
|
|
@ -31,6 +31,18 @@ type ItemDeltaEventData = {
|
|||
delta: string;
|
||||
};
|
||||
|
||||
const shouldHidePiStatusItem = (item: UniversalItem) => {
|
||||
if (item.kind !== "status") return false;
|
||||
const statusParts = (item.content ?? []).filter(
|
||||
(part) => (part as { type?: string }).type === "status"
|
||||
) as Array<{ label?: string }>;
|
||||
if (statusParts.length === 0) return false;
|
||||
return statusParts.every((part) => {
|
||||
const label = part.label ?? "";
|
||||
return label.startsWith("pi.turn_") || label.startsWith("pi.agent_");
|
||||
});
|
||||
};
|
||||
|
||||
const buildStubItem = (itemId: string, nativeItemId?: string | null): UniversalItem => {
|
||||
return {
|
||||
item_id: itemId,
|
||||
|
|
@ -734,7 +746,10 @@ export default function App() {
|
|||
}
|
||||
}
|
||||
|
||||
return entries;
|
||||
return entries.filter((entry) => {
|
||||
if (entry.kind !== "item" || !entry.item) return true;
|
||||
return !shouldHidePiStatusItem(entry.item);
|
||||
});
|
||||
}, [events]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -841,6 +856,7 @@ export default function App() {
|
|||
codex: "Codex",
|
||||
opencode: "OpenCode",
|
||||
amp: "Amp",
|
||||
pi: "Pi",
|
||||
mock: "Mock"
|
||||
};
|
||||
const agentLabel = agentDisplayNames[agentId] ?? agentId;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ const SessionSidebar = ({
|
|||
codex: "Codex",
|
||||
opencode: "OpenCode",
|
||||
amp: "Amp",
|
||||
pi: "Pi",
|
||||
mock: "Mock"
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ const ChatPanel = ({
|
|||
codex: "Codex",
|
||||
opencode: "OpenCode",
|
||||
amp: "Amp",
|
||||
pi: "Pi",
|
||||
mock: "Mock"
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue