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

Function makePlugin

packages/agent-core/test/plugin/manifest.test.ts:9–22  ·  view source on GitHub ↗
(
  files: Record<string, string>,
  options: { dirs?: readonly string[] } = {},
)

Source from the content-addressed store, hash-verified

7import { parseManifest } from '../../src/plugin/manifest';
8
9async function makePlugin(
10 files: Record<string, string>,
11 options: { dirs?: readonly string[] } = {},
12): Promise<string> {
13 const root = await mkdtemp(path.join(tmpdir(), 'kimi-plugin-test-'));
14 for (const dir of options.dirs ?? []) {
15 await mkdir(path.join(root, dir), { recursive: true });
16 }
17 for (const [rel, body] of Object.entries(files)) {
18 await mkdir(path.dirname(path.join(root, rel)), { recursive: true });
19 await writeFile(path.join(root, rel), body, 'utf8');
20 }
21 return realpath(root);
22}
23
24describe('parseManifest', () => {
25 it('reads a minimal kimi.plugin.json at the plugin root', async () => {

Callers 1

manifest.test.tsFile · 0.70

Calls 4

mkdtempFunction · 0.85
mkdirFunction · 0.50
writeFileFunction · 0.50
realpathFunction · 0.50

Tested by

no test coverage detected