mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-28 12:12:47 +00:00
* feat(plugin): add optional agent navigation capability * feat(plugin): extend host navigation capability * fix(plugin): preserve navigation tests after sdk rebase * fix(plugin): scope host navigation contracts --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
17 lines
575 B
TypeScript
17 lines
575 B
TypeScript
import type { PluginSurfaceProps } from "@getpaseo/plugin";
|
|
import { useMemo } from "react";
|
|
import { navigateToWorkspace } from "@/stores/navigation-active-workspace-store";
|
|
import { navigateToAgent } from "@/utils/navigate-to-agent";
|
|
|
|
export function usePluginHostNavigation(
|
|
serverId: string,
|
|
): NonNullable<PluginSurfaceProps["navigation"]> {
|
|
return useMemo(
|
|
() => ({
|
|
openAgent: ({ agentId }) => navigateToAgent({ serverId, agentId }),
|
|
openWorkspace: ({ workspaceId }) => navigateToWorkspace({ serverId, workspaceId }),
|
|
}),
|
|
[serverId],
|
|
);
|
|
}
|