mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-19 23:05:21 +00:00
Recompute plugin instructions for each launch so changes apply on reopen without changing saved agent configuration.
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import type { PluginServerContext } from "@getpaseo/plugin/server";
|
|
|
|
export default function contribute(server: PluginServerContext) {
|
|
server.addHook("agent.create.before", async ({ request }) => {
|
|
if (request.config.provider !== "codex") {
|
|
return request;
|
|
}
|
|
|
|
return {
|
|
...request,
|
|
config: {
|
|
...request.config,
|
|
providerOptions: {
|
|
...request.config.providerOptions,
|
|
sandbox_mode: "workspace-write",
|
|
approval_policy: "on-request",
|
|
},
|
|
},
|
|
};
|
|
});
|
|
|
|
server.addHook("agent.open.before", async ({ request }) => {
|
|
// Background agents are short-lived helpers; keep the company tools for the agents users open.
|
|
if (request.provider !== "codex" || request.background) {
|
|
return;
|
|
}
|
|
|
|
return {
|
|
...request,
|
|
appendSystemPrompt: [
|
|
...(request.appendSystemPrompt ?? []),
|
|
"Follow the team engineering guide.",
|
|
],
|
|
mcpServers: {
|
|
...request.mcpServers,
|
|
company: {
|
|
type: "http",
|
|
url: "https://tools.example.com/mcp",
|
|
},
|
|
},
|
|
};
|
|
});
|
|
|
|
return () => {};
|
|
}
|