mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(omp): expose injected Paseo tools directly (#2418)
This commit is contained in:
@@ -128,7 +128,7 @@ class OmpHostToolHarness {
|
||||
}
|
||||
|
||||
describe("OMP host tools", () => {
|
||||
test("serializes the caller-scoped Paseo catalog for set_host_tools", () => {
|
||||
test("marks every caller-scoped Paseo tool essential for direct invocation", () => {
|
||||
const catalog = createCatalog([
|
||||
{
|
||||
name: "create_agent",
|
||||
@@ -137,6 +137,11 @@ describe("OMP host tools", () => {
|
||||
inputSchema: { initialPrompt: z.string().describe("Prompt for the new agent.") },
|
||||
handler: async () => ({ content: [] }),
|
||||
},
|
||||
{
|
||||
name: "browser_list_tabs",
|
||||
description: "List browser tabs.",
|
||||
handler: async () => ({ content: [] }),
|
||||
},
|
||||
]);
|
||||
|
||||
expect(serializeOmpHostTools(catalog)).toEqual([
|
||||
@@ -144,8 +149,15 @@ describe("OMP host tools", () => {
|
||||
name: "create_agent",
|
||||
label: "Create agent",
|
||||
description: "Create a Paseo agent.",
|
||||
loadMode: "essential",
|
||||
parameters: expect.objectContaining({ type: "object", required: ["initialPrompt"] }),
|
||||
},
|
||||
{
|
||||
name: "browser_list_tabs",
|
||||
description: "List browser tabs.",
|
||||
loadMode: "essential",
|
||||
parameters: expect.objectContaining({ type: "object" }),
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ export function serializeOmpHostTools(catalog: PaseoToolCatalog): OmpRpcHostTool
|
||||
const definition: OmpRpcHostToolDefinition = {
|
||||
name: tool.name,
|
||||
description: tool.description,
|
||||
loadMode: "essential",
|
||||
parameters: serializePaseoToolInputParameters(tool),
|
||||
};
|
||||
if (tool.title) {
|
||||
|
||||
@@ -178,6 +178,7 @@ export const OmpRpcHostToolDefinitionSchema = z
|
||||
name: z.string(),
|
||||
label: z.string().optional(),
|
||||
description: z.string(),
|
||||
loadMode: z.enum(["essential", "discoverable"]).optional(),
|
||||
parameters: z.record(z.string(), z.unknown()),
|
||||
hidden: z.boolean().optional(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user