@agent-loom/loom 1.0.0
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.
- package/README.md +144 -0
- package/dist/apply.d.ts +56 -0
- package/dist/apply.d.ts.map +1 -0
- package/dist/apply.js +97 -0
- package/dist/apply.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +503 -0
- package/dist/cli.js.map +1 -0
- package/dist/clone.d.ts +38 -0
- package/dist/clone.d.ts.map +1 -0
- package/dist/clone.js +68 -0
- package/dist/clone.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +55 -0
- package/dist/config.js.map +1 -0
- package/dist/manifest.d.ts +41 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +454 -0
- package/dist/manifest.js.map +1 -0
- package/dist/renderers/claude.d.ts +15 -0
- package/dist/renderers/claude.d.ts.map +1 -0
- package/dist/renderers/claude.js +180 -0
- package/dist/renderers/claude.js.map +1 -0
- package/dist/renderers/copilot.d.ts +16 -0
- package/dist/renderers/copilot.d.ts.map +1 -0
- package/dist/renderers/copilot.js +191 -0
- package/dist/renderers/copilot.js.map +1 -0
- package/dist/repo-clone.d.ts +72 -0
- package/dist/repo-clone.d.ts.map +1 -0
- package/dist/repo-clone.js +197 -0
- package/dist/repo-clone.js.map +1 -0
- package/dist/resolve-template.d.ts +32 -0
- package/dist/resolve-template.d.ts.map +1 -0
- package/dist/resolve-template.js +75 -0
- package/dist/resolve-template.js.map +1 -0
- package/dist/search-registry.d.ts +31 -0
- package/dist/search-registry.d.ts.map +1 -0
- package/dist/search-registry.js +96 -0
- package/dist/search-registry.js.map +1 -0
- package/dist/search.d.ts +20 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +51 -0
- package/dist/search.js.map +1 -0
- package/dist/skill-fetcher.d.ts +40 -0
- package/dist/skill-fetcher.d.ts.map +1 -0
- package/dist/skill-fetcher.js +99 -0
- package/dist/skill-fetcher.js.map +1 -0
- package/dist/types.d.ts +297 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -0
- package/dist/validate.d.ts +42 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +191 -0
- package/dist/validate.js.map +1 -0
- package/dist/workspaces.d.ts +17 -0
- package/dist/workspaces.d.ts.map +1 -0
- package/dist/workspaces.js +72 -0
- package/dist/workspaces.js.map +1 -0
- package/package.json +42 -0
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loom Config Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages ~/.loom/config.yaml for registry list and defaults.
|
|
5
|
+
*/
|
|
6
|
+
import type { LoomConfig, RegistryConfig } from './types.js';
|
|
7
|
+
export declare function loadConfig(): Promise<LoomConfig>;
|
|
8
|
+
export declare function saveConfig(config: LoomConfig): Promise<void>;
|
|
9
|
+
export declare function addRegistry(name: string, url: string): Promise<void>;
|
|
10
|
+
export declare function removeRegistry(name: string): Promise<void>;
|
|
11
|
+
export declare function listRegistries(): Promise<RegistryConfig[]>;
|
|
12
|
+
export declare function getConfigPath(): string;
|
|
13
|
+
export declare function getLoomDir(): string;
|
|
14
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK7D,wBAAsB,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,CAQtD;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlE;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ1E;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhE;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAGhE;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,UAAU,IAAI,MAAM,CAEnC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loom Config Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages ~/.loom/config.yaml for registry list and defaults.
|
|
5
|
+
*/
|
|
6
|
+
import { readFile, writeFile, mkdir } from 'node:fs/promises';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { homedir } from 'node:os';
|
|
9
|
+
import yaml from 'js-yaml';
|
|
10
|
+
const LOOM_DIR = join(homedir(), '.loom');
|
|
11
|
+
const CONFIG_PATH = join(LOOM_DIR, 'config.yaml');
|
|
12
|
+
export async function loadConfig() {
|
|
13
|
+
try {
|
|
14
|
+
const raw = await readFile(CONFIG_PATH, 'utf-8');
|
|
15
|
+
const parsed = yaml.load(raw);
|
|
16
|
+
return parsed ?? { registries: [] };
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return { registries: [] };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export async function saveConfig(config) {
|
|
23
|
+
await mkdir(LOOM_DIR, { recursive: true });
|
|
24
|
+
const content = yaml.dump(config, { lineWidth: 120 });
|
|
25
|
+
await writeFile(CONFIG_PATH, content, 'utf-8');
|
|
26
|
+
}
|
|
27
|
+
export async function addRegistry(name, url) {
|
|
28
|
+
const config = await loadConfig();
|
|
29
|
+
const existing = config.registries.find((r) => r.name === name);
|
|
30
|
+
if (existing) {
|
|
31
|
+
throw new Error(`Registry "${name}" already exists. Remove it first with: loom registry remove ${name}`);
|
|
32
|
+
}
|
|
33
|
+
config.registries.push({ name, url, type: 'github' });
|
|
34
|
+
await saveConfig(config);
|
|
35
|
+
}
|
|
36
|
+
export async function removeRegistry(name) {
|
|
37
|
+
const config = await loadConfig();
|
|
38
|
+
const idx = config.registries.findIndex((r) => r.name === name);
|
|
39
|
+
if (idx === -1) {
|
|
40
|
+
throw new Error(`Registry "${name}" not found.`);
|
|
41
|
+
}
|
|
42
|
+
config.registries.splice(idx, 1);
|
|
43
|
+
await saveConfig(config);
|
|
44
|
+
}
|
|
45
|
+
export async function listRegistries() {
|
|
46
|
+
const config = await loadConfig();
|
|
47
|
+
return config.registries;
|
|
48
|
+
}
|
|
49
|
+
export function getConfigPath() {
|
|
50
|
+
return CONFIG_PATH;
|
|
51
|
+
}
|
|
52
|
+
export function getLoomDir() {
|
|
53
|
+
return LOOM_DIR;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,SAAS,CAAC;AAG3B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAElD,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,CAAC;QACnD,OAAO,MAAM,IAAI,E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EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC;IACnD,CAAC;IACD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACjC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest parser and resolver.
|
|
3
|
+
*
|
|
4
|
+
* Parses manifest.yaml files and resolves $ref / file / registry references
|
|
5
|
+
* to produce a fully resolved manifest ready for rendering.
|
|
6
|
+
*/
|
|
7
|
+
import type { Manifest, AgentManifest, ResolvedManifest } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Parse a manifest.yaml file into a typed Manifest object.
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseManifest(manifestPath: string): Promise<Manifest>;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve all $ref, file, and registry references in a parsed manifest.
|
|
14
|
+
*
|
|
15
|
+
* @param manifest - Parsed manifest (from parseManifest)
|
|
16
|
+
* @param templateDir - Absolute path to the template directory (contains manifest.yaml)
|
|
17
|
+
* @param registryRoot - Absolute path to the registry root (contains shared/)
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveManifest(manifest: Manifest, templateDir: string, registryRoot: string): Promise<ResolvedManifest>;
|
|
20
|
+
/**
|
|
21
|
+
* Parse an agent manifest.yaml file (per-agent within a team template).
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseAgentManifest(manifestPath: string): Promise<AgentManifest>;
|
|
24
|
+
/**
|
|
25
|
+
* Discover nested agent directories within a template.
|
|
26
|
+
* Returns agent directory names if the template has an agents/ subdirectory
|
|
27
|
+
* where each subdir contains a manifest.yaml.
|
|
28
|
+
*/
|
|
29
|
+
export declare function discoverNestedAgents(templateDir: string): Promise<string[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Merge a team manifest with one or more agent manifests to produce
|
|
32
|
+
* a combined manifest ready for resolving.
|
|
33
|
+
*
|
|
34
|
+
* Merge rules:
|
|
35
|
+
* - repos: agent only (team repos are NOT included)
|
|
36
|
+
* - mcp, instructions, skills, prompts, prerequisites: union (team + agent)
|
|
37
|
+
* - agents: built from agent.md files in selected agents
|
|
38
|
+
* - targets: inherited from team
|
|
39
|
+
*/
|
|
40
|
+
export declare function mergeTeamAndAgentManifests(teamManifest: Manifest, agentManifests: AgentManifest[], agentDirs: string[]): Manifest;
|
|
41
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,gBAAgB,EAmBjB,MAAM,YAAY,CAAC;AAYpB;;GAEG;AACH,wBAAsB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAK3E;AAMD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAuB3B;AAgRD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAIrF;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAqBjF;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,QAAQ,EACtB,cAAc,EAAE,aAAa,EAAE,EAC/B,SAAS,EAAE,MAAM,EAAE,GAClB,QAAQ,CAuDV"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest parser and resolver.
|
|
3
|
+
*
|
|
4
|
+
* Parses manifest.yaml files and resolves $ref / file / registry references
|
|
5
|
+
* to produce a fully resolved manifest ready for rendering.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile, readdir } from 'node:fs/promises';
|
|
8
|
+
import { resolve, dirname, basename, extname, relative, join } from 'node:path';
|
|
9
|
+
import yaml from 'js-yaml';
|
|
10
|
+
import { isSharedRef, isLocalFileRef, isRegistrySkillRef, isMcpInlineDef, } from './types.js';
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Parse
|
|
13
|
+
// =============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Parse a manifest.yaml file into a typed Manifest object.
|
|
16
|
+
*/
|
|
17
|
+
export async function parseManifest(manifestPath) {
|
|
18
|
+
const content = await readFile(manifestPath, 'utf-8');
|
|
19
|
+
const raw = yaml.load(content);
|
|
20
|
+
return raw;
|
|
21
|
+
}
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// Resolve
|
|
24
|
+
// =============================================================================
|
|
25
|
+
/**
|
|
26
|
+
* Resolve all $ref, file, and registry references in a parsed manifest.
|
|
27
|
+
*
|
|
28
|
+
* @param manifest - Parsed manifest (from parseManifest)
|
|
29
|
+
* @param templateDir - Absolute path to the template directory (contains manifest.yaml)
|
|
30
|
+
* @param registryRoot - Absolute path to the registry root (contains shared/)
|
|
31
|
+
*/
|
|
32
|
+
export async function resolveManifest(manifest, templateDir, registryRoot) {
|
|
33
|
+
const [instructions, skills, agents, mcp, repos, prerequisites, prompts] = await Promise.all([
|
|
34
|
+
resolveInstructions(manifest.contents.instructions ?? [], templateDir, registryRoot),
|
|
35
|
+
resolveSkills(manifest.contents.skills ?? [], templateDir),
|
|
36
|
+
resolveAgents(manifest.contents.agents ?? [], templateDir),
|
|
37
|
+
resolveMcp(manifest.contents.mcp ?? [], registryRoot),
|
|
38
|
+
resolveRepos(manifest.contents.repos ?? [], registryRoot),
|
|
39
|
+
resolvePrerequisites(manifest.prerequisites ?? [], registryRoot),
|
|
40
|
+
resolvePrompts(manifest.contents.prompts ?? [], templateDir, registryRoot),
|
|
41
|
+
]);
|
|
42
|
+
return {
|
|
43
|
+
version: manifest.version,
|
|
44
|
+
template: manifest.template,
|
|
45
|
+
targets: manifest.targets,
|
|
46
|
+
instructions,
|
|
47
|
+
skills,
|
|
48
|
+
agents,
|
|
49
|
+
mcp,
|
|
50
|
+
repos,
|
|
51
|
+
prompts,
|
|
52
|
+
prerequisites,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
// =============================================================================
|
|
56
|
+
// Internal resolvers
|
|
57
|
+
// =============================================================================
|
|
58
|
+
async function resolveInstructions(entries, templateDir, registryRoot) {
|
|
59
|
+
return Promise.all(entries.map(async (entry) => {
|
|
60
|
+
if (isSharedRef(entry)) {
|
|
61
|
+
const filePath = resolve(registryRoot, entry.$ref);
|
|
62
|
+
const content = await readFile(filePath, 'utf-8');
|
|
63
|
+
return { scope: entry.scope, content, sourcePath: entry.$ref };
|
|
64
|
+
}
|
|
65
|
+
if (isLocalFileRef(entry)) {
|
|
66
|
+
const filePath = resolve(templateDir, entry.file);
|
|
67
|
+
const content = await readFile(filePath, 'utf-8');
|
|
68
|
+
return { scope: entry.scope, content, sourcePath: entry.file };
|
|
69
|
+
}
|
|
70
|
+
throw new Error(`Unknown instruction entry type: ${JSON.stringify(entry)}`);
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
async function resolveSkills(entries, templateDir) {
|
|
74
|
+
return Promise.all(entries.map(async (entry) => {
|
|
75
|
+
if (isRegistrySkillRef(entry)) {
|
|
76
|
+
return {
|
|
77
|
+
type: 'registry',
|
|
78
|
+
registry: entry.registry,
|
|
79
|
+
ref: entry.ref,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (isLocalFileRef(entry)) {
|
|
83
|
+
const filePath = resolve(templateDir, entry.file);
|
|
84
|
+
const content = await readFile(filePath, 'utf-8');
|
|
85
|
+
const name = parseFrontmatterField(content, 'name');
|
|
86
|
+
const skillDir = dirname(filePath);
|
|
87
|
+
const extraFiles = await collectExtraFiles(skillDir, filePath);
|
|
88
|
+
return {
|
|
89
|
+
type: 'local',
|
|
90
|
+
name: name ?? entry.name,
|
|
91
|
+
content,
|
|
92
|
+
sourcePath: entry.file,
|
|
93
|
+
extraFiles: extraFiles.length > 0 ? extraFiles : undefined,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
throw new Error(`Unknown skill entry type: ${JSON.stringify(entry)}`);
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Recursively collect all files in a skill directory except the main SKILL.md.
|
|
101
|
+
*/
|
|
102
|
+
async function collectExtraFiles(dir, mainFile, baseDir) {
|
|
103
|
+
baseDir = baseDir ?? dir;
|
|
104
|
+
const results = [];
|
|
105
|
+
let dirEntries;
|
|
106
|
+
try {
|
|
107
|
+
dirEntries = await readdir(dir, { withFileTypes: true });
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return results;
|
|
111
|
+
}
|
|
112
|
+
for (const entry of dirEntries) {
|
|
113
|
+
const fullPath = join(dir, String(entry.name));
|
|
114
|
+
if (entry.isDirectory()) {
|
|
115
|
+
results.push(...(await collectExtraFiles(fullPath, mainFile, baseDir)));
|
|
116
|
+
}
|
|
117
|
+
else if (fullPath !== mainFile) {
|
|
118
|
+
const content = await readFile(fullPath, 'utf-8');
|
|
119
|
+
results.push({
|
|
120
|
+
relativePath: relative(baseDir, fullPath).replace(/\\/g, '/'),
|
|
121
|
+
content,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return results;
|
|
126
|
+
}
|
|
127
|
+
async function resolveAgents(entries, templateDir) {
|
|
128
|
+
return Promise.all(entries.map(async (entry) => {
|
|
129
|
+
const filePath = resolve(templateDir, entry.file);
|
|
130
|
+
const raw = await readFile(filePath, 'utf-8');
|
|
131
|
+
const name = parseFrontmatterField(raw, 'name') ?? '';
|
|
132
|
+
const description = parseFrontmatterField(raw, 'description') ?? '';
|
|
133
|
+
// Strip frontmatter from content
|
|
134
|
+
const content = stripFrontmatter(raw);
|
|
135
|
+
return {
|
|
136
|
+
name,
|
|
137
|
+
description,
|
|
138
|
+
model: entry.model,
|
|
139
|
+
tools: entry.tools ?? [],
|
|
140
|
+
content,
|
|
141
|
+
sourcePath: entry.file,
|
|
142
|
+
};
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
async function resolveMcp(entries, registryRoot) {
|
|
146
|
+
return Promise.all(entries.map(async (entry) => {
|
|
147
|
+
if (isSharedRef(entry)) {
|
|
148
|
+
const filePath = resolve(registryRoot, entry.$ref);
|
|
149
|
+
const content = await readFile(filePath, 'utf-8');
|
|
150
|
+
const parsed = yaml.load(content);
|
|
151
|
+
return {
|
|
152
|
+
id: parsed.id,
|
|
153
|
+
name: parsed.name,
|
|
154
|
+
description: parsed.description,
|
|
155
|
+
type: parsed.type,
|
|
156
|
+
command: parsed.command,
|
|
157
|
+
args: parsed.args,
|
|
158
|
+
url: parsed.url,
|
|
159
|
+
authType: parsed.authType,
|
|
160
|
+
env: parsed.env,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
if (isMcpInlineDef(entry)) {
|
|
164
|
+
return {
|
|
165
|
+
id: entry.id,
|
|
166
|
+
name: entry.name,
|
|
167
|
+
description: entry.description,
|
|
168
|
+
type: entry.type,
|
|
169
|
+
command: entry.command,
|
|
170
|
+
args: entry.args,
|
|
171
|
+
url: entry.url,
|
|
172
|
+
authType: entry.authType,
|
|
173
|
+
env: entry.env,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
throw new Error(`Unknown MCP entry type: ${JSON.stringify(entry)}`);
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
async function resolveRepos(entries, registryRoot) {
|
|
180
|
+
return Promise.all(entries.map(async (entry) => {
|
|
181
|
+
if (isSharedRef(entry)) {
|
|
182
|
+
const filePath = resolve(registryRoot, entry.$ref);
|
|
183
|
+
const content = await readFile(filePath, 'utf-8');
|
|
184
|
+
const parsed = yaml.load(content);
|
|
185
|
+
return {
|
|
186
|
+
id: parsed.id,
|
|
187
|
+
name: parsed.name,
|
|
188
|
+
description: parsed.description,
|
|
189
|
+
url: parsed.url,
|
|
190
|
+
sparse: parsed.sparse,
|
|
191
|
+
paths: parsed.paths,
|
|
192
|
+
large: parsed.large,
|
|
193
|
+
repoType: parsed.repoType,
|
|
194
|
+
cloneStrategy: parsed.cloneStrategy,
|
|
195
|
+
note: parsed.note,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
// Inline repo
|
|
199
|
+
return {
|
|
200
|
+
id: entry.id,
|
|
201
|
+
name: entry.name,
|
|
202
|
+
url: entry.url,
|
|
203
|
+
description: entry.description,
|
|
204
|
+
sparse: entry.sparse,
|
|
205
|
+
paths: entry.paths,
|
|
206
|
+
large: entry.large,
|
|
207
|
+
repoType: entry.repoType,
|
|
208
|
+
cloneStrategy: entry.cloneStrategy,
|
|
209
|
+
note: entry.note,
|
|
210
|
+
};
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
async function resolvePrompts(entries, templateDir, registryRoot) {
|
|
214
|
+
return Promise.all(entries.map(async (entry) => {
|
|
215
|
+
let filePath;
|
|
216
|
+
let sourcePath;
|
|
217
|
+
if (isSharedRef(entry)) {
|
|
218
|
+
filePath = resolve(registryRoot, entry.$ref);
|
|
219
|
+
sourcePath = entry.$ref;
|
|
220
|
+
}
|
|
221
|
+
else if (isLocalFileRef(entry)) {
|
|
222
|
+
filePath = resolve(templateDir, entry.file);
|
|
223
|
+
sourcePath = entry.file;
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
throw new Error(`Unknown prompt entry type: ${JSON.stringify(entry)}`);
|
|
227
|
+
}
|
|
228
|
+
const raw = await readFile(filePath, 'utf-8');
|
|
229
|
+
const name = isLocalFileRef(entry) && entry.name
|
|
230
|
+
? entry.name
|
|
231
|
+
: parseFrontmatterField(raw, 'name')
|
|
232
|
+
?? basename(filePath, extname(filePath)).replace(/\.prompt$/, '');
|
|
233
|
+
const description = isLocalFileRef(entry) && entry.description
|
|
234
|
+
? entry.description
|
|
235
|
+
: parseFrontmatterField(raw, 'description');
|
|
236
|
+
const localRef = isLocalFileRef(entry) ? entry : {};
|
|
237
|
+
return {
|
|
238
|
+
name,
|
|
239
|
+
description,
|
|
240
|
+
content: raw,
|
|
241
|
+
sourcePath,
|
|
242
|
+
agent: localRef.agent ?? parseFrontmatterField(raw, 'agent'),
|
|
243
|
+
model: localRef.model ?? parseFrontmatterField(raw, 'model'),
|
|
244
|
+
tools: localRef.tools ?? parseFrontmatterArrayField(raw, 'tools'),
|
|
245
|
+
shared: localRef.shared ?? false,
|
|
246
|
+
disableAutoInvoke: localRef.disableAutoInvoke ?? false,
|
|
247
|
+
};
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
async function resolvePrerequisites(entries, registryRoot) {
|
|
251
|
+
return Promise.all(entries.map(async (entry) => {
|
|
252
|
+
if (isSharedRef(entry)) {
|
|
253
|
+
const filePath = resolve(registryRoot, entry.$ref);
|
|
254
|
+
const content = await readFile(filePath, 'utf-8');
|
|
255
|
+
const parsed = yaml.load(content);
|
|
256
|
+
return {
|
|
257
|
+
id: parsed.id,
|
|
258
|
+
name: parsed.name,
|
|
259
|
+
required: parsed.required,
|
|
260
|
+
description: parsed.description,
|
|
261
|
+
check: parsed.check,
|
|
262
|
+
install: parsed.install,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
// Inline prerequisite
|
|
266
|
+
const inline = entry;
|
|
267
|
+
return inline;
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
// =============================================================================
|
|
271
|
+
// Nested agent support
|
|
272
|
+
// =============================================================================
|
|
273
|
+
/**
|
|
274
|
+
* Parse an agent manifest.yaml file (per-agent within a team template).
|
|
275
|
+
*/
|
|
276
|
+
export async function parseAgentManifest(manifestPath) {
|
|
277
|
+
const content = await readFile(manifestPath, 'utf-8');
|
|
278
|
+
const raw = yaml.load(content);
|
|
279
|
+
return raw;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Discover nested agent directories within a template.
|
|
283
|
+
* Returns agent directory names if the template has an agents/ subdirectory
|
|
284
|
+
* where each subdir contains a manifest.yaml.
|
|
285
|
+
*/
|
|
286
|
+
export async function discoverNestedAgents(templateDir) {
|
|
287
|
+
const { readdir, stat } = await import('node:fs/promises');
|
|
288
|
+
const agentsDir = resolve(templateDir, 'agents');
|
|
289
|
+
try {
|
|
290
|
+
const entries = await readdir(agentsDir);
|
|
291
|
+
const agentIds = [];
|
|
292
|
+
for (const entry of entries) {
|
|
293
|
+
const entryPath = resolve(agentsDir, entry);
|
|
294
|
+
const manifestPath = resolve(entryPath, 'manifest.yaml');
|
|
295
|
+
const s = await stat(entryPath).catch(() => null);
|
|
296
|
+
if (s?.isDirectory()) {
|
|
297
|
+
const hasManifest = await stat(manifestPath).then(() => true).catch(() => false);
|
|
298
|
+
if (hasManifest) {
|
|
299
|
+
agentIds.push(entry);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return agentIds.sort();
|
|
304
|
+
}
|
|
305
|
+
catch {
|
|
306
|
+
return [];
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Merge a team manifest with one or more agent manifests to produce
|
|
311
|
+
* a combined manifest ready for resolving.
|
|
312
|
+
*
|
|
313
|
+
* Merge rules:
|
|
314
|
+
* - repos: agent only (team repos are NOT included)
|
|
315
|
+
* - mcp, instructions, skills, prompts, prerequisites: union (team + agent)
|
|
316
|
+
* - agents: built from agent.md files in selected agents
|
|
317
|
+
* - targets: inherited from team
|
|
318
|
+
*/
|
|
319
|
+
export function mergeTeamAndAgentManifests(teamManifest, agentManifests, agentDirs) {
|
|
320
|
+
// Build agent entries from the per-agent data
|
|
321
|
+
const agentEntries = agentManifests.map((am, i) => ({
|
|
322
|
+
file: `agents/${agentDirs[i]}/agent.md`,
|
|
323
|
+
model: am.agent.model,
|
|
324
|
+
tools: am.agent.tools,
|
|
325
|
+
}));
|
|
326
|
+
// Collect agent-specific MCP, instructions, skills, prompts, prerequisites
|
|
327
|
+
const agentMcps = [];
|
|
328
|
+
const agentInstructions = [];
|
|
329
|
+
const agentSkills = [];
|
|
330
|
+
const agentPrompts = [];
|
|
331
|
+
const agentPrereqs = [];
|
|
332
|
+
// Repos come ONLY from agents
|
|
333
|
+
const agentRepos = [];
|
|
334
|
+
for (const am of agentManifests) {
|
|
335
|
+
if (am.contents?.mcp)
|
|
336
|
+
agentMcps.push(...am.contents.mcp);
|
|
337
|
+
if (am.contents?.instructions)
|
|
338
|
+
agentInstructions.push(...am.contents.instructions);
|
|
339
|
+
if (am.contents?.skills)
|
|
340
|
+
agentSkills.push(...am.contents.skills);
|
|
341
|
+
if (am.contents?.prompts)
|
|
342
|
+
agentPrompts.push(...am.contents.prompts);
|
|
343
|
+
if (am.contents?.repos)
|
|
344
|
+
agentRepos.push(...am.contents.repos);
|
|
345
|
+
if (am.prerequisites)
|
|
346
|
+
agentPrereqs.push(...am.prerequisites);
|
|
347
|
+
}
|
|
348
|
+
// Deduplicate MCP by $ref value or id
|
|
349
|
+
const teamMcps = teamManifest.contents.mcp ?? [];
|
|
350
|
+
const allMcps = deduplicateEntries([...teamMcps, ...agentMcps], mcpEntryKey);
|
|
351
|
+
// Deduplicate skills
|
|
352
|
+
const teamSkills = teamManifest.contents.skills ?? [];
|
|
353
|
+
const allSkills = deduplicateEntries([...teamSkills, ...agentSkills], skillEntryKey);
|
|
354
|
+
// Deduplicate prerequisites
|
|
355
|
+
const teamPrereqs = teamManifest.prerequisites ?? [];
|
|
356
|
+
const allPrereqs = deduplicateEntries([...teamPrereqs, ...agentPrereqs], prereqEntryKey);
|
|
357
|
+
// Deduplicate repos
|
|
358
|
+
const allRepos = deduplicateEntries(agentRepos, repoEntryKey);
|
|
359
|
+
return {
|
|
360
|
+
version: teamManifest.version,
|
|
361
|
+
template: teamManifest.template,
|
|
362
|
+
targets: teamManifest.targets,
|
|
363
|
+
contents: {
|
|
364
|
+
instructions: [...(teamManifest.contents.instructions ?? []), ...agentInstructions],
|
|
365
|
+
skills: allSkills,
|
|
366
|
+
agents: agentEntries,
|
|
367
|
+
mcp: allMcps,
|
|
368
|
+
repos: allRepos,
|
|
369
|
+
prompts: [...(teamManifest.contents.prompts ?? []), ...agentPrompts],
|
|
370
|
+
},
|
|
371
|
+
prerequisites: allPrereqs,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
// --- Deduplication helpers ---
|
|
375
|
+
function deduplicateEntries(entries, keyFn) {
|
|
376
|
+
const seen = new Set();
|
|
377
|
+
const result = [];
|
|
378
|
+
for (const entry of entries) {
|
|
379
|
+
const key = keyFn(entry);
|
|
380
|
+
if (!seen.has(key)) {
|
|
381
|
+
seen.add(key);
|
|
382
|
+
result.push(entry);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return result;
|
|
386
|
+
}
|
|
387
|
+
function mcpEntryKey(entry) {
|
|
388
|
+
if (isSharedRef(entry))
|
|
389
|
+
return `ref:${entry.$ref}`;
|
|
390
|
+
if (isMcpInlineDef(entry))
|
|
391
|
+
return `inline:${entry.id}`;
|
|
392
|
+
return JSON.stringify(entry);
|
|
393
|
+
}
|
|
394
|
+
function skillEntryKey(entry) {
|
|
395
|
+
if (isRegistrySkillRef(entry))
|
|
396
|
+
return `registry:${entry.registry}:${entry.ref}`;
|
|
397
|
+
if (isLocalFileRef(entry))
|
|
398
|
+
return `file:${entry.file}`;
|
|
399
|
+
return JSON.stringify(entry);
|
|
400
|
+
}
|
|
401
|
+
function prereqEntryKey(entry) {
|
|
402
|
+
if (isSharedRef(entry))
|
|
403
|
+
return `ref:${entry.$ref}`;
|
|
404
|
+
return `inline:${entry.id ?? JSON.stringify(entry)}`;
|
|
405
|
+
}
|
|
406
|
+
function repoEntryKey(entry) {
|
|
407
|
+
if (isSharedRef(entry))
|
|
408
|
+
return `ref:${entry.$ref}`;
|
|
409
|
+
return `url:${entry.url}`;
|
|
410
|
+
}
|
|
411
|
+
// =============================================================================
|
|
412
|
+
// Frontmatter helpers
|
|
413
|
+
// =============================================================================
|
|
414
|
+
/**
|
|
415
|
+
* Parse a single field from YAML frontmatter (--- delimited).
|
|
416
|
+
*/
|
|
417
|
+
function parseFrontmatterField(content, field) {
|
|
418
|
+
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
419
|
+
if (!match)
|
|
420
|
+
return undefined;
|
|
421
|
+
try {
|
|
422
|
+
const fm = yaml.load(match[1]);
|
|
423
|
+
const value = fm[field];
|
|
424
|
+
return typeof value === 'string' ? value : undefined;
|
|
425
|
+
}
|
|
426
|
+
catch {
|
|
427
|
+
return undefined;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Parse an array field from YAML frontmatter.
|
|
432
|
+
*/
|
|
433
|
+
function parseFrontmatterArrayField(content, field) {
|
|
434
|
+
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
435
|
+
if (!match)
|
|
436
|
+
return undefined;
|
|
437
|
+
try {
|
|
438
|
+
const fm = yaml.load(match[1]);
|
|
439
|
+
const value = fm[field];
|
|
440
|
+
if (Array.isArray(value))
|
|
441
|
+
return value.map(String);
|
|
442
|
+
return undefined;
|
|
443
|
+
}
|
|
444
|
+
catch {
|
|
445
|
+
return undefined;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Strip YAML frontmatter from content, returning only the body.
|
|
450
|
+
*/
|
|
451
|
+
function stripFrontmatter(content) {
|
|
452
|
+
return content.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n*/, '').trim();
|
|
453
|
+
}
|
|
454
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,IAAI,MAAM,SAAS,CAAC;AAwB3B,OAAO,EACL,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,gFAAgF;AAChF,QAAQ;AACR,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,YAAoB;IACtD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACtD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAA4B,CAAC;IAE1D,OAAO,GAA0B,CAAC;AACpC,CAAC;AAED,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAkB,EAClB,WAAmB,EACnB,YAAoB;IAEpB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC3F,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,IAAI,EAAE,EAAE,WAAW,EAAE,YAAY,CAAC;QACpF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KAAK,CAAC,CAAC;QACxB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACnD,OAAO,SAAS,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACvC,OAAO,OAAO,CAAC,OAAO,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code Renderer
|
|
3
|
+
*
|
|
4
|
+
* Generates Claude Code workspace configuration files from a ResolvedManifest:
|
|
5
|
+
* CLAUDE.md — combined instructions
|
|
6
|
+
* .claude/settings.json — MCP servers + settings
|
|
7
|
+
* .claude/agents/<name>.md — subagents (plain markdown)
|
|
8
|
+
* .mcp.json — project-level MCP config
|
|
9
|
+
*/
|
|
10
|
+
import type { ResolvedManifest } from '../types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Render a resolved manifest into Claude Code workspace configuration files.
|
|
13
|
+
*/
|
|
14
|
+
export declare function renderClaude(manifest: ResolvedManifest, outputDir: string): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/renderers/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,gBAAgB,EAMjB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ/F"}
|