Files
paseo/plugin-examples/agent-tools
Mohamed Boudra 10bc10c99f Let plugins give specific agents tools (#7938)
* feat(plugins): attach tools to individual agent sessions

* feat(plugins): reopen idle agent sessions after hook changes

Defer automatic plugin changes until the next idle prompt so running turns keep steering. Expose session reload separately from snapshot refresh in the SDK.

* docs(plugins): show how to attach tools to agents

* test(agent): update permission follow-up adapter
2026-10-27 09:23:50 +07:00
..

Agent tools

Attaches append_workspace_note to agents whose notes/enabled label is "true". Calling the tool with { "note": "Run the targeted tests before committing." } appends that line to AGENT_NOTES.md in the calling agent's working directory and returns the file path. It creates the file if it does not exist.

Install on a daemon with plugins enabled:

paseo plugin install /absolute/path/to/plugin-examples/agent-tools

Create a labeled agent through the SDK:

const agent = await paseo.agents.create({
  config: { provider: "codex/gpt-5.4" },
  cwd: "/projects/shop",
  labels: { "notes/enabled": "true" },
});

The session-open callback also runs when an agent resumes or reloads. After changing an existing agent's labels, call paseo.agents.ref(id).reload() to apply the selection immediately. This interrupts a running turn. refresh() reads the agent snapshot without reopening its session.

From the repository root, npm run typecheck includes this example. Outside this repository, use paseo plugin init to create the package and TypeScript setup, then copy index.server.ts and the manifest into that project.

See Attach tools to agents for targeting, execution, provider gates, collisions, and plugin reload behavior.