mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-12-05 22:39:19 +00:00
The web UI keeps no tool-specific code: each tool's plugin contributes how its calls show (words on the wheel and in the sheet, the row's argument, a failure word, its words in a run's summary, its detail, a nested call's detail, a result after the answer) to the ToolActivities registry, keyed by tool name, from its web facet. coding-tools, terminals, codemode, subagents, agent, artifacts, send-file, ports, conversations and history register theirs. A tool without a contribution reads as its name and first short string argument, with the generic icon and its input as JSON and output as its detail. Tool declarations are unchanged.
10 lines
398 B
TypeScript
10 lines
398 B
TypeScript
// The coding tools' web facet: how their calls show in the chat (activity.tsx).
|
|
import { contribute, defineFacet } from "@p2/app/v1";
|
|
import { ToolActivities } from "@p2/app/v1/web";
|
|
import { codingToolActivities } from "./activity.tsx";
|
|
|
|
export default defineFacet((host) => {
|
|
contribute(host, "p2.web-coding-tools", (self) => {
|
|
self.contribute(ToolActivities, codingToolActivities);
|
|
});
|
|
});
|