|
1 | | -import { listBundledPluginMetadata } from "./bundled-plugin-metadata.js"; |
| 1 | +import { listBundledPluginMetadata } from "../../bundled-plugin-metadata.js"; |
2 | 2 |
|
3 | 3 | // Build/test inventory only. |
4 | 4 | // Runtime code should prefer manifest/runtime registry queries instead of these snapshots. |
@@ -67,75 +67,6 @@ export const BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS: readonly BundledPluginContractSn |
67 | 67 | ) |
68 | 68 | .toSorted((left, right) => left.pluginId.localeCompare(right.pluginId)); |
69 | 69 |
|
70 | | -function collectPluginIds( |
71 | | - pick: (entry: BundledPluginContractSnapshot) => readonly string[], |
72 | | -): readonly string[] { |
73 | | - return BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS.filter((entry) => pick(entry).length > 0) |
74 | | - .map((entry) => entry.pluginId) |
75 | | - .toSorted((left, right) => left.localeCompare(right)); |
76 | | -} |
77 | | - |
78 | | -export const BUNDLED_PROVIDER_PLUGIN_IDS = collectPluginIds((entry) => entry.providerIds); |
79 | | - |
80 | | -export const BUNDLED_SPEECH_PLUGIN_IDS = collectPluginIds((entry) => entry.speechProviderIds); |
81 | | - |
82 | | -export const BUNDLED_REALTIME_TRANSCRIPTION_PLUGIN_IDS = collectPluginIds( |
83 | | - (entry) => entry.realtimeTranscriptionProviderIds, |
84 | | -); |
85 | | - |
86 | | -export const BUNDLED_REALTIME_VOICE_PLUGIN_IDS = collectPluginIds( |
87 | | - (entry) => entry.realtimeVoiceProviderIds, |
88 | | -); |
89 | | - |
90 | | -export const BUNDLED_MEDIA_UNDERSTANDING_PLUGIN_IDS = collectPluginIds( |
91 | | - (entry) => entry.mediaUnderstandingProviderIds, |
92 | | -); |
93 | | - |
94 | | -export const BUNDLED_IMAGE_GENERATION_PLUGIN_IDS = collectPluginIds( |
95 | | - (entry) => entry.imageGenerationProviderIds, |
96 | | -); |
97 | | - |
98 | | -export const BUNDLED_VIDEO_GENERATION_PLUGIN_IDS = collectPluginIds( |
99 | | - (entry) => entry.videoGenerationProviderIds, |
100 | | -); |
101 | | - |
102 | | -export const BUNDLED_WEB_FETCH_PLUGIN_IDS = collectPluginIds((entry) => entry.webFetchProviderIds); |
103 | | - |
104 | | -export const BUNDLED_RUNTIME_CONTRACT_PLUGIN_IDS = [ |
105 | | - ...new Set( |
106 | | - BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS.filter( |
107 | | - (entry) => |
108 | | - entry.providerIds.length > 0 || |
109 | | - entry.speechProviderIds.length > 0 || |
110 | | - entry.realtimeTranscriptionProviderIds.length > 0 || |
111 | | - entry.realtimeVoiceProviderIds.length > 0 || |
112 | | - entry.mediaUnderstandingProviderIds.length > 0 || |
113 | | - entry.imageGenerationProviderIds.length > 0 || |
114 | | - entry.videoGenerationProviderIds.length > 0 || |
115 | | - entry.webFetchProviderIds.length > 0 || |
116 | | - entry.webSearchProviderIds.length > 0, |
117 | | - ).map((entry) => entry.pluginId), |
118 | | - ), |
119 | | -].toSorted((left, right) => left.localeCompare(right)); |
120 | | - |
121 | | -export const BUNDLED_WEB_SEARCH_PLUGIN_IDS = collectPluginIds( |
122 | | - (entry) => entry.webSearchProviderIds, |
123 | | -); |
124 | | - |
125 | | -export const BUNDLED_WEB_SEARCH_PROVIDER_PLUGIN_IDS = Object.fromEntries( |
126 | | - BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS.flatMap((entry) => |
127 | | - entry.webSearchProviderIds.map((providerId) => [providerId, entry.pluginId] as const), |
128 | | - ).toSorted(([left], [right]) => left.localeCompare(right)), |
129 | | -) as Readonly<Record<string, string>>; |
130 | | - |
131 | | -export const BUNDLED_PROVIDER_PLUGIN_ID_ALIASES = Object.fromEntries( |
132 | | - BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS.flatMap((entry) => |
133 | | - entry.providerIds |
134 | | - .filter((providerId) => providerId !== entry.pluginId) |
135 | | - .map((providerId) => [providerId, entry.pluginId] as const), |
136 | | - ).toSorted(([left], [right]) => left.localeCompare(right)), |
137 | | -) as Readonly<Record<string, string>>; |
138 | | - |
139 | 70 | export const BUNDLED_LEGACY_PLUGIN_ID_ALIASES = Object.fromEntries( |
140 | 71 | BUNDLED_PLUGIN_METADATA_FOR_CAPABILITIES.flatMap(({ manifest }) => |
141 | 72 | (manifest.legacyPluginIds ?? []).map( |
|
0 commit comments