MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / readInterface

Function readInterface

packages/agent-core/src/plugin/manifest.ts:439–450  ·  view source on GitHub ↗
(raw: unknown)

Source from the content-addressed store, hash-verified

437}
438
439function readInterface(raw: unknown): PluginInterface | undefined {
440 if (!isObject(raw)) return undefined;
441 const out: PluginInterface = {
442 displayName: stringField(raw, 'displayName'),
443 shortDescription: stringField(raw, 'shortDescription'),
444 longDescription: stringField(raw, 'longDescription'),
445 developerName: stringField(raw, 'developerName'),
446 websiteURL: stringField(raw, 'websiteURL'),
447 };
448 const hasAny = Object.values(out).some((value) => value !== undefined);
449 return hasAny ? out : undefined;
450}
451
452function stringField(raw: Record<string, unknown>, key: string): string | undefined {
453 const value = raw[key];

Callers 1

parseManifestFunction · 0.85

Calls 3

isObjectFunction · 0.70
stringFieldFunction · 0.70
valuesMethod · 0.65

Tested by

no test coverage detected