

























@@ -149,8 +149,9 @@ function createInstalledPluginIndexSnapshot(
149149150150function expectInspectReport(
151151pluginId: string,
152+options: Omit<Parameters<typeof buildPluginInspectReport>[0], "id"> = {},
152153): NonNullable<ReturnType<typeof buildPluginInspectReport>> {
153-const inspect = buildPluginInspectReport({ id: pluginId });
154+const inspect = buildPluginInspectReport({ id: pluginId, ...options });
154155if (inspect === null) {
155156throw new Error(`expected inspect report for ${pluginId}`);
156157}
@@ -568,10 +569,9 @@ describe("plugin status reports", () => {
568569}),
569570);
570571571-const inspect = buildPluginInspectReport({ id: "demo", config: rawConfig });
572+const inspect = expectInspectReport("demo", { config: rawConfig });
572573573-expect(inspect).not.toBeNull();
574-expectInspectPolicy(inspect!, {
574+expectInspectPolicy(inspect, {
575575allowPromptInjection: undefined,
576576allowConversationAccess: undefined,
577577hookTimeoutMs: undefined,
@@ -719,10 +719,9 @@ describe("plugin status reports", () => {
719719typedHooks: [createTypedHook({ pluginId: "google", hookName: "before_agent_start" })],
720720});
721721722-const inspect = buildPluginInspectReport({ id: "google" });
722+const inspect = expectInspectReport("google");
723723724-expect(inspect).not.toBeNull();
725-expectInspectShape(inspect!, {
724+expectInspectShape(inspect, {
726725shape: "hybrid-capability",
727726capabilityMode: "hybrid",
728727capabilityKinds: ["text-inference", "media-understanding", "image-generation", "web-search"],
@@ -731,7 +730,7 @@ describe("plugin status reports", () => {
731730expect(inspect?.compatibility).toEqual([
732731createCompatibilityNotice({ pluginId: "google", code: "legacy-before-agent-start" }),
733732]);
734-expectInspectPolicy(inspect!, {
733+expectInspectPolicy(inspect, {
735734allowPromptInjection: false,
736735allowConversationAccess: true,
737736hookTimeoutMs: undefined,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。