(input: {
id: string;
root: string;
enabled: boolean;
installedAt: string;
updatedAt?: string;
originalSource?: string;
capabilities?: PluginCapabilityState;
github?: PluginGithubMetadata;
source?: PluginSource;
parsed: ParsedManifestResult;
})
| 352 | } |
| 353 | |
| 354 | async function recordFrom(input: { |
| 355 | id: string; |
| 356 | root: string; |
| 357 | enabled: boolean; |
| 358 | installedAt: string; |
| 359 | updatedAt?: string; |
| 360 | originalSource?: string; |
| 361 | capabilities?: PluginCapabilityState; |
| 362 | github?: PluginGithubMetadata; |
| 363 | source?: PluginSource; |
| 364 | parsed: ParsedManifestResult; |
| 365 | }): Promise<PluginRecord> { |
| 366 | const { parsed } = input; |
| 367 | const hasError = parsed.diagnostics.some((d) => d.severity === 'error'); |
| 368 | return { |
| 369 | id: input.id, |
| 370 | root: input.root, |
| 371 | source: input.source ?? 'local-path', |
| 372 | enabled: input.enabled, |
| 373 | state: hasError || parsed.manifest === undefined ? 'error' : 'ok', |
| 374 | installedAt: input.installedAt, |
| 375 | updatedAt: input.updatedAt, |
| 376 | originalSource: input.originalSource, |
| 377 | capabilities: input.capabilities, |
| 378 | github: input.github, |
| 379 | skillCount: await countDiscoveredPluginSkills(input.id, parsed.manifest), |
| 380 | manifest: parsed.manifest, |
| 381 | manifestKind: parsed.manifestKind, |
| 382 | manifestPath: parsed.manifestPath, |
| 383 | shadowedManifestPath: parsed.shadowedManifestPath, |
| 384 | diagnostics: parsed.diagnostics, |
| 385 | skillInstructions: parsed.manifest?.skillInstructions, |
| 386 | }; |
| 387 | } |
| 388 | |
| 389 | function recordToSummary(record: PluginRecord): PluginSummary { |
| 390 | return { |
no test coverage detected