mirror of
https://github.com/luckyyzh/pi-agent-integrated.git
synced 2026-10-03 02:59:35 +00:00
feat: integrate Pi backend and Pi Web
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Displays a status widget showing the system prompt length.
|
||||
*
|
||||
* Demonstrates ctx.getSystemPrompt() for accessing the effective system prompt.
|
||||
*/
|
||||
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
||||
|
||||
export default function (pi: ExtensionAPI) {
|
||||
pi.on("agent_start", (_event, ctx) => {
|
||||
const prompt = ctx.getSystemPrompt();
|
||||
ctx.ui.setStatus("system-prompt", `System: ${prompt.length} chars`);
|
||||
});
|
||||
|
||||
pi.on("session_shutdown", (_event, ctx) => {
|
||||
ctx.ui.setStatus("system-prompt", undefined);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user