@adhdev/daemon-core 0.9.82-rc.165 → 0.9.82-rc.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,21 +145,56 @@ function buildAvailableProviders(
145
145
  lastDetection?: AvailableProviderInfo['lastDetection'];
146
146
  lastVerification?: AvailableProviderInfo['lastVerification'];
147
147
  meshCoordinator?: AvailableProviderInfo['meshCoordinator'];
148
+ _sourceTrust?: AvailableProviderInfo['trust'];
149
+ _sourceLayer?: AvailableProviderInfo['sourceLayer'];
150
+ _sourceName?: string | null;
151
+ providerVersion?: string;
152
+ binary?: string;
153
+ status?: string;
154
+ details?: string;
155
+ links?: Record<string, string>;
148
156
  }> = providerLoader.getAvailableProviderInfos?.() || providerLoader.getAll();
149
- return providers.map((provider) => ({
150
- type: provider.type,
151
- name: provider.displayName || provider.type,
152
- displayName: provider.displayName || provider.type,
153
- icon: provider.icon || '💻',
154
- category: provider.category,
155
- ...(provider.installed !== undefined ? { installed: provider.installed } : {}),
156
- ...(provider.detectedPath !== undefined ? { detectedPath: provider.detectedPath } : {}),
157
- ...(provider.enabled !== undefined ? { enabled: provider.enabled } : {}),
158
- ...(provider.machineStatus !== undefined ? { machineStatus: provider.machineStatus } : {}),
159
- ...(provider.lastDetection !== undefined ? { lastDetection: provider.lastDetection } : {}),
160
- ...(provider.lastVerification !== undefined ? { lastVerification: provider.lastVerification } : {}),
161
- ...(provider.meshCoordinator !== undefined ? { meshCoordinator: provider.meshCoordinator } : {}),
162
- }));
157
+ // Trust helpers come from daemon-core; resolve them lazily so the
158
+ // status snapshot path stays loadable in older bundles that don't
159
+ // ship provider-trust yet.
160
+ let describeTrust: (trust: AvailableProviderInfo['trust']) => string = () => '';
161
+ let requiresConfirmation: (trust: AvailableProviderInfo['trust']) => boolean = () => false;
162
+ try {
163
+ const mod = require('../providers/provider-trust.js') as typeof import('../providers/provider-trust.js');
164
+ describeTrust = mod.describeTrust as typeof describeTrust;
165
+ requiresConfirmation = mod.requiresConfirmation as typeof requiresConfirmation;
166
+ } catch { /* enrichment only */ }
167
+ return providers.map((provider) => {
168
+ const trust = (provider as any)._sourceTrust as AvailableProviderInfo['trust'] | undefined;
169
+ const sourceLayer = (provider as any)._sourceLayer as AvailableProviderInfo['sourceLayer'] | undefined;
170
+ const sourceName = (provider as any)._sourceName as string | null | undefined;
171
+ return {
172
+ type: provider.type,
173
+ name: provider.displayName || provider.type,
174
+ displayName: provider.displayName || provider.type,
175
+ icon: provider.icon || '💻',
176
+ category: provider.category,
177
+ ...(provider.installed !== undefined ? { installed: provider.installed } : {}),
178
+ ...(provider.detectedPath !== undefined ? { detectedPath: provider.detectedPath } : {}),
179
+ ...(provider.enabled !== undefined ? { enabled: provider.enabled } : {}),
180
+ ...(provider.machineStatus !== undefined ? { machineStatus: provider.machineStatus } : {}),
181
+ ...(provider.lastDetection !== undefined ? { lastDetection: provider.lastDetection } : {}),
182
+ ...(provider.lastVerification !== undefined ? { lastVerification: provider.lastVerification } : {}),
183
+ ...(provider.meshCoordinator !== undefined ? { meshCoordinator: provider.meshCoordinator } : {}),
184
+ ...(trust ? {
185
+ trust,
186
+ trustDescription: describeTrust(trust),
187
+ requiresConfirmation: requiresConfirmation(trust),
188
+ } : {}),
189
+ ...(sourceLayer ? { sourceLayer } : {}),
190
+ ...(sourceName ? { sourceName } : {}),
191
+ ...(provider.providerVersion ? { providerVersion: provider.providerVersion } : {}),
192
+ ...(provider.binary ? { binary: provider.binary } : {}),
193
+ ...(provider.status ? { status: provider.status } : {}),
194
+ ...(provider.details ? { details: provider.details } : {}),
195
+ ...(provider.links ? { links: provider.links } : {}),
196
+ };
197
+ });
163
198
  }
164
199
 
165
200
  export function buildMachineInfo(profile: 'full' | 'live' | 'metadata' = 'full'): MachineInfo {