@@ -67,7 +67,7 @@ function createManifestPlugin(id: string): PluginManifestRecord {
|
67 | 67 | |
68 | 68 | function createManifestPluginWithModelCatalog( |
69 | 69 | id: string, |
70 | | -discovery: "static" | "runtime" = "static", |
| 70 | +discovery: "static" | "refreshable" | "runtime" = "static", |
71 | 71 | ): PluginManifestRecord { |
72 | 72 | return { |
73 | 73 | ...createManifestPluginWithoutDiscovery({ id }), |
@@ -263,6 +263,38 @@ describe("resolvePluginDiscoveryProvidersRuntime", () => {
|
263 | 263 | expect(mocks.resolvePluginProviders).not.toHaveBeenCalled(); |
264 | 264 | }); |
265 | 265 | |
| 266 | +it("does not synthesize manifest entry providers for refreshable catalogs", () => { |
| 267 | +mocks.resolveDiscoveredProviderPluginIds.mockReturnValue(["token-plan"]); |
| 268 | +mocks.loadPluginMetadataSnapshot.mockReturnValue({ |
| 269 | +index: { plugins: [] }, |
| 270 | +manifestRegistry: { |
| 271 | +plugins: [createManifestPluginWithModelCatalog("token-plan", "refreshable")], |
| 272 | +diagnostics: [], |
| 273 | +}, |
| 274 | +}); |
| 275 | + |
| 276 | +expect(resolvePluginDiscoveryProvidersRuntime({ discoveryEntriesOnly: true })).toStrictEqual( |
| 277 | +[], |
| 278 | +); |
| 279 | +expect(mocks.resolvePluginProviders).not.toHaveBeenCalled(); |
| 280 | +}); |
| 281 | + |
| 282 | +it("loads the full plugin for refreshable manifest catalog rows", () => { |
| 283 | +const refreshableProvider = createProvider({ id: "token-plan", mode: "catalog" }); |
| 284 | +mocks.resolveDiscoveredProviderPluginIds.mockReturnValue(["token-plan"]); |
| 285 | +mocks.resolvePluginProviders.mockReturnValue([refreshableProvider]); |
| 286 | +mocks.loadPluginMetadataSnapshot.mockReturnValue({ |
| 287 | +index: { plugins: [] }, |
| 288 | +manifestRegistry: { |
| 289 | +plugins: [createManifestPluginWithModelCatalog("token-plan", "refreshable")], |
| 290 | +diagnostics: [], |
| 291 | +}, |
| 292 | +}); |
| 293 | + |
| 294 | +expect(resolvePluginDiscoveryProvidersRuntime({})).toStrictEqual([refreshableProvider]); |
| 295 | +expect(requireResolvePluginProvidersParams().onlyPluginIds).toEqual(["token-plan"]); |
| 296 | +}); |
| 297 | + |
266 | 298 | it("loads the full plugin when one manifest catalog provider is runtime-owned", () => { |
267 | 299 | const runtimeProvider = createProvider({ id: "xiaomi-token-plan", mode: "catalog" }); |
268 | 300 | mocks.resolveDiscoveredProviderPluginIds.mockReturnValue(["xiaomi"]); |
|