mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-08 17:34:51 +00:00
A provider plugin reports `controls` and the `providerOptions` it runs in `session.config`, and receives running-session changes as `session.configure` `changes.providerOptions` (null returns a key to its default), under the same apply-or-throw contract as built-in providers. A control may declare a `defaultValue`; a value a plugin reports at that default for a key nobody set stays unset instead of being pinned to the agent. A plugin that still reports `settings` keeps working: the daemon reads each setting as a control plus an option and sends changes in both shapes (COMPAT(plugin-provider-settings)). The app resolves a control's icon as a Lucide name when it is not one of the built-in kebab-case names, so a plugin's icon shows live and in drafts. Public docs and the provider-direct example use only `providerOptions` and controls; the migration doc gains the rows.
17 lines
589 B
TypeScript
17 lines
589 B
TypeScript
import { Settings2 } from "lucide-react-native";
|
|
import { describe, expect, it } from "vitest";
|
|
import { getAgentFeatureIcon } from "./icons";
|
|
|
|
describe("getAgentFeatureIcon", () => {
|
|
it("draws the Lucide icon a plugin provider names", () => {
|
|
const icon = getAgentFeatureIcon("Mic");
|
|
expect(icon).not.toBe(Settings2);
|
|
expect(getAgentFeatureIcon("Mic")).toBe(icon);
|
|
});
|
|
|
|
it("falls back to the generic icon for a missing or unknown name", () => {
|
|
expect(getAgentFeatureIcon()).toBe(Settings2);
|
|
expect(getAgentFeatureIcon("not-an-icon")).toBe(Settings2);
|
|
});
|
|
});
|