


























@@ -172,9 +172,11 @@ function sortUnique(values: readonly string[] | undefined): readonly string[] {
172172}
173173174174function hasRuntimeContractSurface(record: PluginManifestRecord): boolean {
175+const providers = record.providers ?? [];
176+const cliBackends = record.cliBackends ?? [];
175177return Boolean(
176-record.providers.length > 0 ||
177-record.cliBackends.length > 0 ||
178+providers.length > 0 ||
179+cliBackends.length > 0 ||
178180record.contracts?.speechProviders?.length ||
179181record.contracts?.mediaUnderstandingProviders?.length ||
180182record.contracts?.documentExtractors?.length ||
@@ -190,8 +192,9 @@ function hasRuntimeContractSurface(record: PluginManifestRecord): boolean {
190192}
191193192194function buildStartupInfo(record: PluginManifestRecord): InstalledPluginStartupInfo {
195+const channels = record.channels ?? [];
193196return {
194-sidecar: record.channels.length === 0 && !hasRuntimeContractSurface(record),
197+sidecar: channels.length === 0 && !hasRuntimeContractSurface(record),
195198memory: hasKind(record.kind, "memory"),
196199deferConfiguredChannelFullLoadUntilAfterListen:
197200record.startupDeferConfiguredChannelFullLoadUntilAfterListen === true,
@@ -479,7 +482,8 @@ function buildInstalledPluginIndex(
479482const { candidates, registry } = resolveRegistry(params);
480483const candidateByRootDir = buildCandidateLookup(candidates);
481484const normalizedConfig = normalizePluginsConfig(params.config?.plugins);
482-const diagnostics: PluginDiagnostic[] = [...registry.diagnostics];
485+const registryDiagnostics = registry.diagnostics ?? [];
486+const diagnostics: PluginDiagnostic[] = [...registryDiagnostics];
483487const generatedAtMs = (params.now?.() ?? new Date()).getTime();
484488const installRecords = normalizeInstallRecordMap(params.installRecords);
485489const plugins = registry.plugins.map((record): InstalledPluginIndexRecord => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。