@claude-collective/cli 0.13.2 → 0.13.3
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/CHANGELOG.md +8 -0
- package/README.md +18 -17
- package/dist/{chunk-LE6IY6IT.js → chunk-4K4ZXQRM.js} +8 -4
- package/dist/chunk-4K4ZXQRM.js.map +1 -0
- package/dist/{chunk-SWZXWQ6I.js → chunk-6DCSSORF.js} +11 -11
- package/dist/{chunk-ORVG4P2D.js → chunk-7Q44DMSP.js} +4 -4
- package/dist/{chunk-SGJ23HIP.js → chunk-IAUAQJQ2.js} +2 -2
- package/dist/{chunk-57Y5RALO.js → chunk-IBE7JIAG.js} +3 -3
- package/dist/{chunk-CJEHB4TB.js → chunk-ZFPSUQOU.js} +28 -2
- package/dist/{chunk-CJEHB4TB.js.map → chunk-ZFPSUQOU.js.map} +1 -1
- package/dist/commands/compile.js +3 -3
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/edit.js +9 -9
- package/dist/commands/init.js +7 -7
- package/dist/commands/list.js +3 -3
- package/dist/commands/test-imports.js +3 -3
- package/dist/commands/update.js +2 -2
- package/dist/components/wizard/step-build.js +2 -2
- package/dist/components/wizard/step-build.test.js +2 -2
- package/dist/components/wizard/wizard.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-LE6IY6IT.js.map +0 -1
- /package/dist/{chunk-SWZXWQ6I.js.map → chunk-6DCSSORF.js.map} +0 -0
- /package/dist/{chunk-ORVG4P2D.js.map → chunk-7Q44DMSP.js.map} +0 -0
- /package/dist/{chunk-SGJ23HIP.js.map → chunk-IAUAQJQ2.js.map} +0 -0
- /package/dist/{chunk-57Y5RALO.js.map → chunk-IBE7JIAG.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.13.3] - 2026-02-06
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **local config not found during recompile** - `recompileAgents` only looked for config in the plugin directory, missing local mode configs in the project directory. now falls back to project directory when plugin dir has no config
|
|
13
|
+
- **agent_skills normalization** - `agent_skills` from project config was passed to the compiler without normalizing mixed formats (string arrays vs object maps), causing compilation failures
|
|
14
|
+
|
|
8
15
|
## [0.13.2] - 2026-02-06
|
|
9
16
|
|
|
10
17
|
### Fixed
|
|
@@ -42,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
42
49
|
|
|
43
50
|
- Old `search.ts` command - Replaced with dual-mode `search.tsx` (static + interactive)
|
|
44
51
|
|
|
52
|
+
[0.13.3]: https://github.com/claude-collective/cli/releases/tag/v0.13.3
|
|
45
53
|
[0.13.2]: https://github.com/claude-collective/cli/releases/tag/v0.13.2
|
|
46
54
|
[0.13.1]: https://github.com/claude-collective/cli/releases/tag/v0.13.1
|
|
47
55
|
[0.13.0]: https://github.com/claude-collective/cli/releases/tag/v0.13.0
|
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ cc config # manage settings
|
|
|
40
40
|
cc validate # check your setup is correct
|
|
41
41
|
cc new skill # create a custom skill
|
|
42
42
|
cc new agent # create a custom agent
|
|
43
|
+
cc import skill # import a skill from a remote source
|
|
43
44
|
cc update # update local skills from source
|
|
44
45
|
cc uninstall # remove Claude Collective from project
|
|
45
46
|
cc doctor # diagnose setup issues
|
|
@@ -60,29 +61,29 @@ a skill is focused knowledge for one technology. not surface-level docs but actu
|
|
|
60
61
|
|
|
61
62
|
skills live in the [claude-collective/skills](https://github.com/claude-collective/skills) repository, organized by category:
|
|
62
63
|
|
|
63
|
-
| category | what's there
|
|
64
|
-
| -------- |
|
|
65
|
-
| web | react
|
|
66
|
-
| api | hono, drizzle, better-auth, posthog, resend, axiom+pino+sentry
|
|
67
|
-
| mobile | react-native, expo
|
|
68
|
-
| cli | oclif, ink
|
|
69
|
-
| infra | turborepo,
|
|
70
|
-
|
|
|
71
|
-
| meta | code reviewing, research methodology |
|
|
64
|
+
| category | what's there |
|
|
65
|
+
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| web | react, vue, angular, solidjs, next.js, remix, nuxt, scss-modules, cva, zustand, pinia, ngrx-signalstore, jotai, react-query, swr, trpc, graphql, react-hook-form, zod, shadcn-ui, radix-ui, tanstack-table, vitest, playwright, cypress, msw, framer-motion, storybook, accessibility |
|
|
67
|
+
| api | hono, express, fastify, drizzle, prisma, better-auth, posthog, resend, axiom+pino+sentry, github-actions |
|
|
68
|
+
| mobile | react-native, expo |
|
|
69
|
+
| cli | commander, oclif, yargs, clack, inquirer, ink |
|
|
70
|
+
| infra | turborepo, tooling, env config |
|
|
71
|
+
| meta | code reviewing, research methodology, investigation requirements, anti-over-engineering, context management |
|
|
72
72
|
|
|
73
73
|
## stacks
|
|
74
74
|
|
|
75
75
|
stacks bundle skills together with pre-configured agents. instead of picking 20 skills individually, grab a stack that matches your setup:
|
|
76
76
|
|
|
77
|
-
- **nextjs-fullstack** - next.js
|
|
78
|
-
- **
|
|
79
|
-
- **vue-stack** - vue 3 +
|
|
80
|
-
- **
|
|
81
|
-
- **remix-stack** - remix
|
|
82
|
-
- **solidjs-stack** - solidjs
|
|
83
|
-
- **
|
|
77
|
+
- **nextjs-fullstack** - next.js + react + hono + drizzle + posthog + zustand + react-query
|
|
78
|
+
- **angular-stack** - angular 19 + signals + ngrx signalstore + hono + drizzle
|
|
79
|
+
- **vue-stack** - vue 3 composition API + pinia + hono + drizzle
|
|
80
|
+
- **nuxt-stack** - nuxt + vue 3 full-stack + pinia + hono + drizzle
|
|
81
|
+
- **remix-stack** - remix + react + hono + drizzle
|
|
82
|
+
- **solidjs-stack** - solidjs + hono + drizzle
|
|
83
|
+
- **react-native-stack** - react native + expo + zustand + react-query
|
|
84
|
+
- **meta-stack** - agents for creating agents, skills, docs, and extracting patterns
|
|
84
85
|
|
|
85
|
-
each stack includes agents like `web-developer`, `api-reviewer`, `web-tester` - roles that use the right skills for the job.
|
|
86
|
+
each stack includes agents like `web-developer`, `api-developer`, `web-reviewer`, `web-tester`, `web-researcher`, `pattern-scout`, `documentor` - roles that use the right skills for the job.
|
|
86
87
|
|
|
87
88
|
## installation options
|
|
88
89
|
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isLegacyStackConfig,
|
|
15
15
|
loadProjectConfig,
|
|
16
|
+
normalizeAgentSkills,
|
|
16
17
|
normalizeStackConfig
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZFPSUQOU.js";
|
|
18
19
|
import {
|
|
19
20
|
loadAllAgents,
|
|
20
21
|
loadPluginSkills,
|
|
@@ -154,7 +155,7 @@ function projectConfigToStackLike(config) {
|
|
|
154
155
|
description: config.description,
|
|
155
156
|
skills: config.skills?.map((s) => typeof s === "string" ? { id: s } : s) ?? [],
|
|
156
157
|
agents: config.agents,
|
|
157
|
-
agent_skills: config.agent_skills,
|
|
158
|
+
agent_skills: config.agent_skills ? normalizeAgentSkills(config.agent_skills) : void 0,
|
|
158
159
|
hooks: config.hooks,
|
|
159
160
|
framework: config.framework,
|
|
160
161
|
philosophy: config.philosophy,
|
|
@@ -176,7 +177,10 @@ async function recompileAgents(options) {
|
|
|
176
177
|
failed: [],
|
|
177
178
|
warnings: []
|
|
178
179
|
};
|
|
179
|
-
|
|
180
|
+
let loadedConfig = await loadConfigWithFallback(pluginDir);
|
|
181
|
+
if (!loadedConfig && projectDir) {
|
|
182
|
+
loadedConfig = await loadConfigWithFallback(projectDir);
|
|
183
|
+
}
|
|
180
184
|
const projectConfig = loadedConfig?.config ?? null;
|
|
181
185
|
const builtinAgents = await loadAllAgents(sourcePath);
|
|
182
186
|
const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};
|
|
@@ -310,4 +314,4 @@ async function recompileAgents(options) {
|
|
|
310
314
|
export {
|
|
311
315
|
recompileAgents
|
|
312
316
|
};
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
317
|
+
//# sourceMappingURL=chunk-4K4ZXQRM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/lib/agent-recompiler.ts","../src/cli/lib/custom-agent-resolver.ts"],"sourcesContent":["import path from \"path\";\nimport { glob, writeFile, ensureDir, readFile, fileExists } from \"../utils/fs\";\nimport { verbose } from \"../utils/logger\";\nimport { loadAllAgents, loadPluginSkills, loadProjectAgents } from \"./loader\";\nimport { resolveAgents, resolveStackSkills } from \"./resolver\";\nimport { compileAgentForPlugin } from \"./stack-plugin-compiler\";\nimport { getPluginAgentsDir } from \"./plugin-finder\";\nimport { createLiquidEngine } from \"./compiler\";\nimport {\n loadProjectConfig,\n isLegacyStackConfig,\n normalizeStackConfig,\n normalizeAgentSkills,\n type LoadedProjectConfig,\n} from \"./project-config\";\nimport {\n resolveCustomAgents,\n validateCustomAgentIds,\n} from \"./custom-agent-resolver\";\nimport { parse as parseYaml } from \"yaml\";\nimport type {\n CompileConfig,\n CompileAgentConfig,\n StackConfig,\n SkillReference,\n SkillDefinition,\n ProjectConfig,\n AgentDefinition,\n} from \"../../types\";\n\nexport interface RecompileAgentsOptions {\n pluginDir: string;\n sourcePath: string;\n agents?: string[];\n skills?: Record<string, SkillDefinition>;\n projectDir?: string;\n outputDir?: string;\n}\n\nexport interface RecompileAgentsResult {\n compiled: string[];\n failed: string[];\n warnings: string[];\n}\n\nasync function getExistingAgentNames(pluginDir: string): Promise<string[]> {\n const agentsDir = getPluginAgentsDir(pluginDir);\n const files = await glob(\"*.md\", agentsDir);\n return files.map((f) => path.basename(f, \".md\"));\n}\n\n/**\n * Load config from either:\n * 1. pluginDir/config.yaml (legacy plugin location)\n * 2. pluginDir/.claude/config.yaml (new project config location)\n *\n * This provides backward compatibility with existing plugins.\n */\nasync function loadConfigWithFallback(\n pluginDir: string,\n): Promise<LoadedProjectConfig | null> {\n // First try the legacy plugin location (pluginDir/config.yaml)\n const legacyConfigPath = path.join(pluginDir, \"config.yaml\");\n if (await fileExists(legacyConfigPath)) {\n try {\n const content = await readFile(legacyConfigPath);\n const parsed = parseYaml(content);\n\n if (parsed && typeof parsed === \"object\") {\n verbose(`Loaded config.yaml from ${legacyConfigPath}`);\n\n // Check if it's legacy StackConfig format\n if (isLegacyStackConfig(parsed)) {\n const normalized = normalizeStackConfig(parsed as StackConfig);\n return {\n config: normalized,\n configPath: legacyConfigPath,\n isLegacy: true,\n };\n }\n\n return {\n config: parsed as ProjectConfig,\n configPath: legacyConfigPath,\n isLegacy: false,\n };\n }\n } catch (error) {\n verbose(`Failed to parse config.yaml: ${error}`);\n }\n }\n\n // Fall back to project config location (.claude/config.yaml)\n return loadProjectConfig(pluginDir);\n}\n\n/**\n * Convert ProjectConfig to StackConfig-like structure for compatibility\n * with existing resolveStackSkills function\n */\nfunction projectConfigToStackLike(config: ProjectConfig): StackConfig {\n return {\n name: config.name,\n version: \"1.0.0\",\n author: config.author ?? \"@unknown\",\n description: config.description,\n skills:\n config.skills?.map((s) => (typeof s === \"string\" ? { id: s } : s)) ?? [],\n agents: config.agents,\n agent_skills: config.agent_skills\n ? normalizeAgentSkills(config.agent_skills)\n : undefined,\n hooks: config.hooks,\n framework: config.framework,\n philosophy: config.philosophy,\n principles: config.principles,\n tags: config.tags,\n };\n}\n\nexport async function recompileAgents(\n options: RecompileAgentsOptions,\n): Promise<RecompileAgentsResult> {\n const {\n pluginDir,\n sourcePath,\n agents: specifiedAgents,\n skills: providedSkills,\n projectDir,\n outputDir,\n } = options;\n\n const result: RecompileAgentsResult = {\n compiled: [],\n failed: [],\n warnings: [],\n };\n\n // Load project config (handles both legacy plugin config and new ProjectConfig)\n // Try plugin dir first, then fall back to project dir for local mode\n let loadedConfig = await loadConfigWithFallback(pluginDir);\n if (!loadedConfig && projectDir) {\n loadedConfig = await loadConfigWithFallback(projectDir);\n }\n const projectConfig = loadedConfig?.config ?? null;\n\n // Load built-in agents from source\n const builtinAgents = await loadAllAgents(sourcePath);\n\n // Load project agents from .claude-src/agents/ (if projectDir provided)\n const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};\n\n // Resolve custom agents and merge with built-in agents\n // Priority: custom_agents > project agents > built-in agents\n let allAgents: Record<string, AgentDefinition> = {\n ...builtinAgents,\n ...projectAgents,\n };\n if (projectConfig?.custom_agents) {\n // Validate custom agent IDs don't conflict with built-in agents\n const idConflicts = validateCustomAgentIds(\n projectConfig.custom_agents,\n builtinAgents,\n );\n if (idConflicts.length > 0) {\n for (const error of idConflicts) {\n result.warnings.push(error);\n }\n }\n\n // Resolve custom agents to AgentDefinition\n try {\n const resolvedCustomAgents = resolveCustomAgents(\n projectConfig.custom_agents,\n builtinAgents,\n );\n // Merge: custom agents can override built-in if same name (though we warn above)\n allAgents = { ...builtinAgents, ...resolvedCustomAgents };\n verbose(\n `Resolved ${Object.keys(resolvedCustomAgents).length} custom agents`,\n );\n } catch (error) {\n result.warnings.push(\n `Failed to resolve custom agents: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n // Convert to StackConfig-like for compatibility with existing functions\n const pluginConfig = projectConfig\n ? projectConfigToStackLike(projectConfig)\n : null;\n\n let agentNames: string[];\n if (specifiedAgents) {\n agentNames = specifiedAgents;\n } else if (pluginConfig?.agents) {\n agentNames = pluginConfig.agents;\n verbose(`Using agents from config.yaml: ${agentNames.join(\", \")}`);\n } else if (outputDir) {\n agentNames = Object.keys(allAgents);\n verbose(`Using all available agents from source: ${agentNames.join(\", \")}`);\n } else {\n agentNames = await getExistingAgentNames(pluginDir);\n }\n\n if (agentNames.length === 0) {\n result.warnings.push(\"No agents found to recompile\");\n return result;\n }\n\n verbose(\n `Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`,\n );\n\n const pluginSkills = providedSkills ?? (await loadPluginSkills(pluginDir));\n\n const compileAgents: Record<string, CompileAgentConfig> = {};\n for (const agentName of agentNames) {\n if (allAgents[agentName]) {\n // Check if this is a custom agent with its own skills defined\n const customAgentConfig = projectConfig?.custom_agents?.[agentName];\n if (customAgentConfig?.skills && customAgentConfig.skills.length > 0) {\n // Custom agent has explicit skills defined\n const skillRefs: SkillReference[] = customAgentConfig.skills.map(\n (s) => ({\n id: typeof s === \"string\" ? s : s.id,\n usage: `when working with ${(typeof s === \"string\" ? s : s.id).split(\" \")[0]}`,\n preloaded:\n (typeof s === \"object\" && \"preloaded\" in s && s.preloaded) ??\n false,\n }),\n );\n compileAgents[agentName] = { skills: skillRefs };\n verbose(\n ` Agent ${agentName}: ${skillRefs.length} skills from custom_agents`,\n );\n } else if (pluginConfig?.agent_skills?.[agentName]) {\n const skillRefs = resolveStackSkills(\n pluginConfig,\n agentName,\n pluginSkills,\n );\n compileAgents[agentName] = { skills: skillRefs };\n verbose(` Agent ${agentName}: ${skillRefs.length} skills from config`);\n } else if (pluginConfig?.skills) {\n // Fall back to all skills in the config\n const skillRefs: SkillReference[] = pluginConfig.skills.map((s) => ({\n id: s.id,\n usage: `when working with ${s.id.split(\" \")[0]}`,\n preloaded: s.preloaded ?? false,\n }));\n compileAgents[agentName] = { skills: skillRefs };\n verbose(` Agent ${agentName}: ${skillRefs.length} skills (all)`);\n } else {\n compileAgents[agentName] = {};\n }\n } else {\n result.warnings.push(\n `Agent \"${agentName}\" not found in source definitions`,\n );\n }\n }\n\n const compileConfig: CompileConfig = {\n name: pluginConfig?.name || path.basename(pluginDir),\n description: pluginConfig?.description || \"Recompiled plugin\",\n claude_md: \"\",\n agents: compileAgents,\n };\n\n const engine = await createLiquidEngine(projectDir);\n const resolvedAgents = await resolveAgents(\n allAgents,\n pluginSkills,\n compileConfig,\n sourcePath,\n );\n\n const agentsDir = outputDir ?? getPluginAgentsDir(pluginDir);\n await ensureDir(agentsDir);\n\n for (const [name, agent] of Object.entries(resolvedAgents)) {\n try {\n const output = await compileAgentForPlugin(\n name,\n agent,\n sourcePath,\n engine,\n );\n await writeFile(path.join(agentsDir, `${name}.md`), output);\n result.compiled.push(name);\n verbose(` Recompiled: ${name}`);\n } catch (error) {\n result.failed.push(name);\n result.warnings.push(\n `Failed to compile ${name}: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n return result;\n}\n","import type { CustomAgentConfig, AgentDefinition } from \"../../types\";\n\n/** Default tools for standalone custom agents (no extends) */\nconst DEFAULT_TOOLS = [\"Read\", \"Grep\", \"Glob\"];\n\n/** Marker path for standalone custom agents (no extends) */\nconst CUSTOM_AGENT_PATH = \"_custom\";\n\n/**\n * Resolve a custom agent config to a full AgentDefinition.\n * If extends is specified, inherit from the base agent.\n *\n * @param agentId - The custom agent's identifier\n * @param customConfig - The custom agent configuration from config.yaml\n * @param builtinAgents - Record of built-in agent definitions to extend from\n * @returns Fully resolved AgentDefinition\n * @throws Error if extends references an unknown agent\n */\nexport function resolveCustomAgent(\n agentId: string,\n customConfig: CustomAgentConfig,\n builtinAgents: Record<string, AgentDefinition>,\n): AgentDefinition {\n let baseAgent: Partial<AgentDefinition> = {};\n\n if (customConfig.extends) {\n const base = builtinAgents[customConfig.extends];\n if (!base) {\n const availableAgents = Object.keys(builtinAgents);\n const agentList =\n availableAgents.length > 0\n ? `Available agents: ${availableAgents.slice(0, 5).join(\", \")}${availableAgents.length > 5 ? ` (and ${availableAgents.length - 5} more)` : \"\"}`\n : \"No built-in agents found\";\n throw new Error(\n `Custom agent \"${agentId}\" extends unknown agent \"${customConfig.extends}\". ${agentList}`,\n );\n }\n baseAgent = { ...base };\n }\n\n // Merge disallowed_tools: custom + inherited\n let disallowedTools: string[] | undefined;\n if (customConfig.disallowed_tools || baseAgent.disallowed_tools) {\n const merged = new Set<string>([\n ...(baseAgent.disallowed_tools || []),\n ...(customConfig.disallowed_tools || []),\n ]);\n disallowedTools = [...merged];\n }\n\n // Merge hooks: custom hooks added to inherited\n let hooks: AgentDefinition[\"hooks\"] | undefined;\n if (customConfig.hooks || baseAgent.hooks) {\n hooks = { ...baseAgent.hooks };\n if (customConfig.hooks) {\n for (const [hookType, hookDefs] of Object.entries(customConfig.hooks)) {\n if (hooks[hookType]) {\n hooks[hookType] = [...hooks[hookType], ...hookDefs];\n } else {\n hooks[hookType] = hookDefs;\n }\n }\n }\n }\n\n return {\n title: customConfig.title,\n description: customConfig.description,\n model: customConfig.model || baseAgent.model,\n tools: customConfig.tools || baseAgent.tools || DEFAULT_TOOLS,\n disallowed_tools: disallowedTools,\n permission_mode: customConfig.permission_mode || baseAgent.permission_mode,\n hooks,\n // Use extended agent's path for template resolution, or _custom for standalone\n path: baseAgent.path || CUSTOM_AGENT_PATH,\n sourceRoot: baseAgent.sourceRoot,\n };\n}\n\n/**\n * Resolve all custom agents from config to AgentDefinition records.\n *\n * @param customAgents - Record of custom agent configs from config.yaml\n * @param builtinAgents - Record of built-in agent definitions\n * @returns Record of resolved AgentDefinitions keyed by custom agent ID\n */\nexport function resolveCustomAgents(\n customAgents: Record<string, CustomAgentConfig>,\n builtinAgents: Record<string, AgentDefinition>,\n): Record<string, AgentDefinition> {\n const resolved: Record<string, AgentDefinition> = {};\n\n for (const [id, config] of Object.entries(customAgents)) {\n resolved[id] = resolveCustomAgent(id, config, builtinAgents);\n }\n\n return resolved;\n}\n\n/**\n * Check if a custom agent ID conflicts with a built-in agent ID.\n *\n * @param customAgentId - The custom agent's identifier\n * @param builtinAgents - Record of built-in agent definitions\n * @returns true if there's a conflict\n */\nexport function hasAgentIdConflict(\n customAgentId: string,\n builtinAgents: Record<string, AgentDefinition>,\n): boolean {\n return customAgentId in builtinAgents;\n}\n\n/**\n * Validate custom agents don't conflict with built-in agents.\n *\n * @param customAgents - Record of custom agent configs\n * @param builtinAgents - Record of built-in agent definitions\n * @returns Array of error messages (empty if no conflicts)\n */\nexport function validateCustomAgentIds(\n customAgents: Record<string, CustomAgentConfig>,\n builtinAgents: Record<string, AgentDefinition>,\n): string[] {\n const errors: string[] = [];\n\n for (const customId of Object.keys(customAgents)) {\n if (hasAgentIdConflict(customId, builtinAgents)) {\n errors.push(\n `Custom agent \"${customId}\" conflicts with built-in agent of the same name. Choose a unique name.`,\n );\n }\n }\n\n return errors;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,UAAU;;;ACAjB;AAGA,IAAM,gBAAgB,CAAC,QAAQ,QAAQ,MAAM;AAG7C,IAAM,oBAAoB;AAYnB,SAAS,mBACd,SACA,cACA,eACiB;AACjB,MAAI,YAAsC,CAAC;AAE3C,MAAI,aAAa,SAAS;AACxB,UAAM,OAAO,cAAc,aAAa,OAAO;AAC/C,QAAI,CAAC,MAAM;AACT,YAAM,kBAAkB,OAAO,KAAK,aAAa;AACjD,YAAM,YACJ,gBAAgB,SAAS,IACrB,qBAAqB,gBAAgB,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,GAAG,gBAAgB,SAAS,IAAI,SAAS,gBAAgB,SAAS,CAAC,WAAW,EAAE,KAC3I;AACN,YAAM,IAAI;AAAA,QACR,iBAAiB,OAAO,4BAA4B,aAAa,OAAO,MAAM,SAAS;AAAA,MACzF;AAAA,IACF;AACA,gBAAY,EAAE,GAAG,KAAK;AAAA,EACxB;AAGA,MAAI;AACJ,MAAI,aAAa,oBAAoB,UAAU,kBAAkB;AAC/D,UAAM,SAAS,oBAAI,IAAY;AAAA,MAC7B,GAAI,UAAU,oBAAoB,CAAC;AAAA,MACnC,GAAI,aAAa,oBAAoB,CAAC;AAAA,IACxC,CAAC;AACD,sBAAkB,CAAC,GAAG,MAAM;AAAA,EAC9B;AAGA,MAAI;AACJ,MAAI,aAAa,SAAS,UAAU,OAAO;AACzC,YAAQ,EAAE,GAAG,UAAU,MAAM;AAC7B,QAAI,aAAa,OAAO;AACtB,iBAAW,CAAC,UAAU,QAAQ,KAAK,OAAO,QAAQ,aAAa,KAAK,GAAG;AACrE,YAAI,MAAM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10
|
+
} from "./chunk-CDX4W4DM.js";
|
|
2
11
|
import {
|
|
3
12
|
WIZARD_STEPS,
|
|
4
13
|
WizardTabs
|
|
@@ -9,19 +18,10 @@ import {
|
|
|
9
18
|
import {
|
|
10
19
|
StepBuild,
|
|
11
20
|
validateSelection
|
|
12
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7Q44DMSP.js";
|
|
13
22
|
import {
|
|
14
23
|
StepConfirm
|
|
15
24
|
} from "./chunk-X6QONICW.js";
|
|
16
|
-
import {
|
|
17
|
-
StepRefine
|
|
18
|
-
} from "./chunk-E3FJH4TF.js";
|
|
19
|
-
import {
|
|
20
|
-
StepStackOptions
|
|
21
|
-
} from "./chunk-HLJX2FTL.js";
|
|
22
|
-
import {
|
|
23
|
-
StepStack
|
|
24
|
-
} from "./chunk-CDX4W4DM.js";
|
|
25
25
|
import {
|
|
26
26
|
useWizardStore
|
|
27
27
|
} from "./chunk-D237EVNB.js";
|
|
@@ -261,4 +261,4 @@ var Wizard = ({
|
|
|
261
261
|
export {
|
|
262
262
|
Wizard
|
|
263
263
|
};
|
|
264
|
-
//# sourceMappingURL=chunk-
|
|
264
|
+
//# sourceMappingURL=chunk-6DCSSORF.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
WizardFooter
|
|
4
|
-
} from "./chunk-Y2LW7R3Y.js";
|
|
5
2
|
import {
|
|
6
3
|
CategoryGrid
|
|
7
4
|
} from "./chunk-Z7G4B5HJ.js";
|
|
8
5
|
import {
|
|
9
6
|
SectionProgress
|
|
10
7
|
} from "./chunk-BDLUZVKU.js";
|
|
8
|
+
import {
|
|
9
|
+
WizardFooter
|
|
10
|
+
} from "./chunk-Y2LW7R3Y.js";
|
|
11
11
|
import {
|
|
12
12
|
init_esm_shims
|
|
13
13
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -579,4 +579,4 @@ export {
|
|
|
579
579
|
getDisplayLabel,
|
|
580
580
|
StepBuild
|
|
581
581
|
};
|
|
582
|
-
//# sourceMappingURL=chunk-
|
|
582
|
+
//# sourceMappingURL=chunk-7Q44DMSP.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ED4E6Q2T.js";
|
|
5
5
|
import {
|
|
6
6
|
loadProjectConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZFPSUQOU.js";
|
|
8
8
|
import {
|
|
9
9
|
directoryExists,
|
|
10
10
|
fileExists
|
|
@@ -54,4 +54,4 @@ async function detectInstallation(projectDir = process.cwd()) {
|
|
|
54
54
|
export {
|
|
55
55
|
detectInstallation
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-IAUAQJQ2.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
detectInstallation
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IAUAQJQ2.js";
|
|
5
5
|
import {
|
|
6
6
|
getCollectivePluginDir,
|
|
7
7
|
getPluginAgentsDir,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-ED4E6Q2T.js";
|
|
11
11
|
import {
|
|
12
12
|
loadProjectConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZFPSUQOU.js";
|
|
14
14
|
import {
|
|
15
15
|
directoryExists
|
|
16
16
|
} from "./chunk-TKFPKEV3.js";
|
|
@@ -126,4 +126,4 @@ export {
|
|
|
126
126
|
getInstallationInfo,
|
|
127
127
|
formatInstallationDisplay
|
|
128
128
|
};
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
129
|
+
//# sourceMappingURL=chunk-IBE7JIAG.js.map
|
|
@@ -360,11 +360,37 @@ function validateAgentSkillConfig(agentName, agentSkills) {
|
|
|
360
360
|
}
|
|
361
361
|
return `agent_skills.${agentName} must be an array or object`;
|
|
362
362
|
}
|
|
363
|
+
function isSimpleAgentSkills(value) {
|
|
364
|
+
return Array.isArray(value);
|
|
365
|
+
}
|
|
366
|
+
function normalizeSkillEntry(entry) {
|
|
367
|
+
if (typeof entry === "string") {
|
|
368
|
+
return { id: entry };
|
|
369
|
+
}
|
|
370
|
+
return entry;
|
|
371
|
+
}
|
|
372
|
+
function normalizeAgentSkills(agentSkills) {
|
|
373
|
+
const result = {};
|
|
374
|
+
for (const [agentName, skills] of Object.entries(agentSkills)) {
|
|
375
|
+
if (isSimpleAgentSkills(skills)) {
|
|
376
|
+
result[agentName] = {
|
|
377
|
+
uncategorized: skills.map(normalizeSkillEntry)
|
|
378
|
+
};
|
|
379
|
+
} else {
|
|
380
|
+
result[agentName] = {};
|
|
381
|
+
for (const [category, categorySkills] of Object.entries(skills)) {
|
|
382
|
+
result[agentName][category] = categorySkills.map(normalizeSkillEntry);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
return result;
|
|
387
|
+
}
|
|
363
388
|
|
|
364
389
|
export {
|
|
365
390
|
loadProjectConfig,
|
|
366
391
|
isLegacyStackConfig,
|
|
367
392
|
normalizeStackConfig,
|
|
368
|
-
validateProjectConfig
|
|
393
|
+
validateProjectConfig,
|
|
394
|
+
normalizeAgentSkills
|
|
369
395
|
};
|
|
370
|
-
//# sourceMappingURL=chunk-
|
|
396
|
+
//# sourceMappingURL=chunk-ZFPSUQOU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/project-config.ts"],"sourcesContent":["import path from \"path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { readFile, fileExists } from \"../utils/fs\";\nimport { verbose } from \"../utils/logger\";\nimport { CLAUDE_DIR, CLAUDE_SRC_DIR } from \"../consts\";\nimport type {\n ProjectConfig,\n StackConfig,\n SkillAssignment,\n SkillEntry,\n AgentSkillConfig,\n ValidationResult,\n CustomAgentConfig,\n} from \"../../types\";\n\nconst CONFIG_PATH = `${CLAUDE_SRC_DIR}/config.yaml`;\nconst LEGACY_CONFIG_PATH = `${CLAUDE_DIR}/config.yaml`;\n\nexport interface LoadedProjectConfig {\n config: ProjectConfig;\n configPath: string;\n /** true if was StackConfig format (legacy) */\n isLegacy: boolean;\n}\n\n/**\n * Load project config from .claude-src/config.yaml (with fallback to .claude/config.yaml)\n */\nexport async function loadProjectConfig(\n projectDir: string,\n): Promise<LoadedProjectConfig | null> {\n // Check .claude-src/config.yaml first (new location)\n const srcConfigPath = path.join(projectDir, CONFIG_PATH);\n // Fall back to .claude/config.yaml (legacy location)\n const legacyConfigPath = path.join(projectDir, LEGACY_CONFIG_PATH);\n\n let configPath = srcConfigPath;\n if (!(await fileExists(srcConfigPath))) {\n if (await fileExists(legacyConfigPath)) {\n configPath = legacyConfigPath;\n verbose(`Using legacy config location: ${legacyConfigPath}`);\n } else {\n verbose(\n `Project config not found at ${srcConfigPath} or ${legacyConfigPath}`,\n );\n return null;\n }\n }\n\n try {\n const content = await readFile(configPath);\n const parsed = parseYaml(content);\n\n if (!parsed || typeof parsed !== \"object\") {\n verbose(`Invalid project config structure at ${configPath}`);\n return null;\n }\n\n // Detect if this is legacy StackConfig format\n const isLegacy = isLegacyStackConfig(parsed);\n\n if (isLegacy) {\n verbose(`Detected legacy StackConfig format at ${configPath}`);\n const normalized = normalizeStackConfig(parsed as StackConfig);\n return {\n config: normalized,\n configPath,\n isLegacy: true,\n };\n }\n\n verbose(`Loaded project config from ${configPath}`);\n return {\n config: parsed as ProjectConfig,\n configPath,\n isLegacy: false,\n };\n } catch (error) {\n verbose(`Failed to parse project config: ${error}`);\n return null;\n }\n}\n\n/**\n * Check if a config object is in legacy StackConfig format.\n * Detection logic:\n * - If version is semver (e.g., \"1.0.0\") -> legacy\n * - If version is \"1\" -> new format\n * - If has 'id' field -> legacy\n * - If has 'created' or 'updated' fields -> legacy\n */\nexport function isLegacyStackConfig(config: unknown): boolean {\n if (!config || typeof config !== \"object\") return false;\n\n const obj = config as Record<string, unknown>;\n\n // If version looks like semver (x.y.z), it's legacy\n if (typeof obj.version === \"string\" && obj.version.includes(\".\")) {\n return true;\n }\n\n // If has legacy-only fields, it's legacy\n if (\n obj.id !== undefined ||\n obj.created !== undefined ||\n obj.updated !== undefined\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Normalize StackConfig to ProjectConfig (for backward compatibility)\n */\nexport function normalizeStackConfig(stackConfig: StackConfig): ProjectConfig {\n const config: ProjectConfig = {\n name: stackConfig.name,\n agents: stackConfig.agents,\n };\n\n // Copy optional fields\n if (stackConfig.description) {\n config.description = stackConfig.description;\n }\n\n if (stackConfig.skills && stackConfig.skills.length > 0) {\n config.skills = stackConfig.skills;\n }\n\n if (stackConfig.agent_skills) {\n // StackConfig agent_skills is always categorized format\n config.agent_skills = stackConfig.agent_skills;\n }\n\n if (stackConfig.hooks) {\n config.hooks = stackConfig.hooks;\n }\n\n if (stackConfig.author) {\n config.author = stackConfig.author;\n }\n\n if (stackConfig.framework) {\n config.framework = stackConfig.framework;\n }\n\n if (stackConfig.philosophy) {\n config.philosophy = stackConfig.philosophy;\n }\n\n if (stackConfig.principles && stackConfig.principles.length > 0) {\n config.principles = stackConfig.principles;\n }\n\n if (stackConfig.tags && stackConfig.tags.length > 0) {\n config.tags = stackConfig.tags;\n }\n\n return config;\n}\n\n/**\n * Validate project config structure.\n * Returns validation result with errors and warnings.\n */\nexport function validateProjectConfig(config: unknown): ValidationResult {\n const errors: string[] = [];\n const warnings: string[] = [];\n\n if (!config || typeof config !== \"object\") {\n return { valid: false, errors: [\"Config must be an object\"], warnings: [] };\n }\n\n const c = config as Record<string, unknown>;\n\n // Required: name\n if (!c.name || typeof c.name !== \"string\") {\n errors.push(\"name is required and must be a string\");\n }\n\n // Required: agents (for compilation)\n if (!c.agents || !Array.isArray(c.agents)) {\n errors.push(\"agents is required and must be an array\");\n } else {\n for (const agent of c.agents) {\n if (typeof agent !== \"string\") {\n errors.push(`agents must contain strings, found: ${typeof agent}`);\n }\n }\n }\n\n // Optional: version\n if (c.version !== undefined && c.version !== \"1\") {\n errors.push('version must be \"1\" (or omitted for default)');\n }\n\n // Optional: skills\n if (c.skills !== undefined) {\n if (!Array.isArray(c.skills)) {\n errors.push(\"skills must be an array\");\n } else {\n for (const skill of c.skills) {\n const skillError = validateSkillEntry(skill);\n if (skillError) {\n errors.push(skillError);\n }\n }\n }\n }\n\n // Optional: agent_skills\n if (c.agent_skills !== undefined) {\n if (typeof c.agent_skills !== \"object\" || c.agent_skills === null) {\n errors.push(\"agent_skills must be an object\");\n } else {\n for (const [agentName, agentSkills] of Object.entries(c.agent_skills)) {\n const agentSkillsError = validateAgentSkillConfig(\n agentName,\n agentSkills,\n );\n if (agentSkillsError) {\n errors.push(agentSkillsError);\n }\n }\n }\n }\n\n // Optional: preload_patterns\n if (c.preload_patterns !== undefined) {\n if (typeof c.preload_patterns !== \"object\" || c.preload_patterns === null) {\n errors.push(\"preload_patterns must be an object\");\n } else {\n for (const [agentName, patterns] of Object.entries(c.preload_patterns)) {\n if (!Array.isArray(patterns)) {\n errors.push(\n `preload_patterns.${agentName} must be an array of strings`,\n );\n } else {\n for (const pattern of patterns) {\n if (typeof pattern !== \"string\") {\n errors.push(\n `preload_patterns.${agentName} must contain only strings`,\n );\n break;\n }\n }\n }\n }\n }\n }\n\n // Optional: custom_agents\n if (c.custom_agents !== undefined) {\n const customAgentsErrors = validateCustomAgents(c.custom_agents, c.agents);\n errors.push(...customAgentsErrors);\n }\n\n // Warnings for deprecated patterns\n if (c.id !== undefined) {\n warnings.push(\"id field is deprecated in project config\");\n }\n if (c.created !== undefined) {\n warnings.push(\"created field is deprecated in project config\");\n }\n if (c.updated !== undefined) {\n warnings.push(\"updated field is deprecated in project config\");\n }\n\n return {\n valid: errors.length === 0,\n errors,\n warnings,\n };\n}\n\n/** Maximum number of custom agents allowed per project */\nconst MAX_CUSTOM_AGENTS = 20;\n\n/** Valid model values for custom agents */\nconst VALID_MODELS = [\"sonnet\", \"opus\", \"haiku\", \"inherit\"];\n\n/** Valid permission modes for custom agents */\nconst VALID_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"dontAsk\",\n \"bypassPermissions\",\n \"plan\",\n \"delegate\",\n];\n\n/**\n * Validate custom_agents section of config\n */\nfunction validateCustomAgents(\n customAgents: unknown,\n agents: unknown,\n): string[] {\n const errors: string[] = [];\n\n if (typeof customAgents !== \"object\" || customAgents === null) {\n errors.push(\"custom_agents must be an object\");\n return errors;\n }\n\n const customAgentEntries = Object.entries(customAgents);\n\n // Check maximum limit\n if (customAgentEntries.length > MAX_CUSTOM_AGENTS) {\n errors.push(\n `custom_agents cannot exceed ${MAX_CUSTOM_AGENTS} agents (found ${customAgentEntries.length})`,\n );\n }\n\n // Collect custom agent names for circular reference check\n const customAgentNames = new Set(customAgentEntries.map(([name]) => name));\n\n for (const [agentName, agentConfig] of customAgentEntries) {\n const agentErrors = validateCustomAgentConfig(\n agentName,\n agentConfig,\n customAgentNames,\n );\n errors.push(...agentErrors);\n }\n\n return errors;\n}\n\n/**\n * Validate a single custom agent configuration\n */\nfunction validateCustomAgentConfig(\n agentName: string,\n config: unknown,\n customAgentNames: Set<string>,\n): string[] {\n const errors: string[] = [];\n const prefix = `custom_agents.${agentName}`;\n\n if (typeof config !== \"object\" || config === null) {\n errors.push(`${prefix} must be an object`);\n return errors;\n }\n\n const c = config as Record<string, unknown>;\n\n // Required: title\n if (!c.title || typeof c.title !== \"string\") {\n errors.push(`${prefix}.title is required and must be a string`);\n }\n\n // Required: description\n if (!c.description || typeof c.description !== \"string\") {\n errors.push(`${prefix}.description is required and must be a string`);\n }\n\n // Optional: extends\n if (c.extends !== undefined) {\n if (typeof c.extends !== \"string\") {\n errors.push(`${prefix}.extends must be a string`);\n } else if (customAgentNames.has(c.extends)) {\n // Custom agents cannot extend other custom agents\n errors.push(\n `${prefix}.extends cannot reference another custom agent \"${c.extends}\"`,\n );\n }\n }\n\n // Optional: model\n if (c.model !== undefined) {\n if (typeof c.model !== \"string\" || !VALID_MODELS.includes(c.model)) {\n errors.push(`${prefix}.model must be one of: ${VALID_MODELS.join(\", \")}`);\n }\n }\n\n // Optional: tools\n if (c.tools !== undefined) {\n if (!Array.isArray(c.tools)) {\n errors.push(`${prefix}.tools must be an array`);\n } else {\n for (const tool of c.tools) {\n if (typeof tool !== \"string\") {\n errors.push(`${prefix}.tools must contain only strings`);\n break;\n }\n }\n }\n }\n\n // Optional: disallowed_tools\n if (c.disallowed_tools !== undefined) {\n if (!Array.isArray(c.disallowed_tools)) {\n errors.push(`${prefix}.disallowed_tools must be an array`);\n } else {\n for (const tool of c.disallowed_tools) {\n if (typeof tool !== \"string\") {\n errors.push(`${prefix}.disallowed_tools must contain only strings`);\n break;\n }\n }\n }\n }\n\n // Optional: permission_mode\n if (c.permission_mode !== undefined) {\n if (\n typeof c.permission_mode !== \"string\" ||\n !VALID_PERMISSION_MODES.includes(c.permission_mode)\n ) {\n errors.push(\n `${prefix}.permission_mode must be one of: ${VALID_PERMISSION_MODES.join(\", \")}`,\n );\n }\n }\n\n // Optional: skills\n if (c.skills !== undefined) {\n if (!Array.isArray(c.skills)) {\n errors.push(`${prefix}.skills must be an array`);\n } else {\n for (const skill of c.skills) {\n const skillError = validateSkillEntry(skill);\n if (skillError) {\n errors.push(`${prefix}.skills: ${skillError}`);\n }\n }\n }\n }\n\n // Optional: hooks\n if (c.hooks !== undefined) {\n if (typeof c.hooks !== \"object\" || c.hooks === null) {\n errors.push(`${prefix}.hooks must be an object`);\n }\n // Note: Detailed hook validation could be added later if needed\n }\n\n return errors;\n}\n\n/**\n * Validate a single skill entry\n */\nfunction validateSkillEntry(skill: unknown): string | null {\n if (typeof skill === \"string\") {\n return null; // String skill IDs are valid\n }\n\n if (typeof skill !== \"object\" || skill === null) {\n return \"skills must be strings or objects\";\n }\n\n const s = skill as Record<string, unknown>;\n\n if (!s.id || typeof s.id !== \"string\") {\n return \"skill object must have an id string\";\n }\n\n if (s.local === true && !s.path) {\n return `local skill \"${s.id}\" must have a path`;\n }\n\n if (s.preloaded !== undefined && typeof s.preloaded !== \"boolean\") {\n return `skill \"${s.id}\" preloaded must be a boolean`;\n }\n\n if (s.local !== undefined && typeof s.local !== \"boolean\") {\n return `skill \"${s.id}\" local must be a boolean`;\n }\n\n if (s.path !== undefined && typeof s.path !== \"string\") {\n return `skill \"${s.id}\" path must be a string`;\n }\n\n return null;\n}\n\n/**\n * Validate agent skill config (can be simple list or categorized)\n */\nfunction validateAgentSkillConfig(\n agentName: string,\n agentSkills: unknown,\n): string | null {\n // Check if it's a simple list (array)\n if (Array.isArray(agentSkills)) {\n for (const skill of agentSkills) {\n const skillError = validateSkillEntry(skill);\n if (skillError) {\n return `agent_skills.${agentName}: ${skillError}`;\n }\n }\n return null;\n }\n\n // Check if it's categorized (object with array values)\n if (typeof agentSkills === \"object\" && agentSkills !== null) {\n for (const [category, skills] of Object.entries(agentSkills)) {\n if (!Array.isArray(skills)) {\n return `agent_skills.${agentName}.${category} must be an array`;\n }\n for (const skill of skills) {\n const skillError = validateSkillEntry(skill);\n if (skillError) {\n return `agent_skills.${agentName}.${category}: ${skillError}`;\n }\n }\n }\n return null;\n }\n\n return `agent_skills.${agentName} must be an array or object`;\n}\n\n/**\n * Check if agent_skills value is in simple list format (array)\n */\nexport function isSimpleAgentSkills(value: unknown): value is SkillEntry[] {\n return Array.isArray(value);\n}\n\n/**\n * Normalize a skill entry to SkillAssignment\n */\nexport function normalizeSkillEntry(entry: SkillEntry): SkillAssignment {\n if (typeof entry === \"string\") {\n return { id: entry };\n }\n return entry;\n}\n\n/**\n * Normalize agent_skills to always be categorized format for internal use.\n * Simple lists are placed under an \"uncategorized\" key.\n */\nexport function normalizeAgentSkills(\n agentSkills: Record<string, AgentSkillConfig>,\n): Record<string, Record<string, SkillAssignment[]>> {\n const result: Record<string, Record<string, SkillAssignment[]>> = {};\n\n for (const [agentName, skills] of Object.entries(agentSkills)) {\n if (isSimpleAgentSkills(skills)) {\n // Simple list -> put under \"uncategorized\"\n result[agentName] = {\n uncategorized: skills.map(normalizeSkillEntry),\n };\n } else {\n // Already categorized -> normalize entries\n result[agentName] = {};\n for (const [category, categorySkills] of Object.entries(skills)) {\n result[agentName][category] = categorySkills.map(normalizeSkillEntry);\n }\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,iBAAiB;AAcnC,IAAM,cAAc,GAAG,cAAc;AACrC,IAAM,qBAAqB,GAAG,UAAU;AAYxC,eAAsB,kBACpB,YACqC;AAErC,QAAM,gBAAgB,KAAK,KAAK,YAAY,WAAW;AAEvD,QAAM,mBAAmB,KAAK,KAAK,YAAY,kBAAkB;AAEjE,MAAI,aAAa;AACjB,MAAI,CAAE,MAAM,WAAW,aAAa,GAAI;AACtC,QAAI,MAAM,WAAW,gBAAgB,GAAG;AACtC,mBAAa;AACb,cAAQ,iCAAiC,gBAAgB,EAAE;AAAA,IAC7D,OAAO;AACL;AAAA,QACE,+BAA+B,aAAa,OAAO,gBAAgB;AAAA,MACrE;AACA,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI;AACF,UAAM,UAAU,MAAM,SAAS,UAAU;AACzC,UAAM,SAAS,UAAU,OAAO;AAEhC,QAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,cAAQ,uCAAuC,UAAU,EAAE;AAC3D,aAAO;AAAA,IACT;AAGA,UAAM,WAAW,oBAAoB,MAAM;AAE3C,QAAI,UAAU;AACZ,cAAQ,yCAAyC,UAAU,EAAE;AAC7D,YAAM,aAAa,qBAAqB,MAAqB;AAC7D,aAAO;AAAA,QACL,QAAQ;AAAA,QACR;AAAA,QACA,UAAU;AAAA,MACZ;AAAA,IACF;AAEA,YAAQ,8BAA8B,UAAU,EAAE;AAClD,WAAO;AAAA,MACL,QAAQ;AAAA,MACR;AAAA,MACA,UAAU;AAAA,IACZ;AAAA,EACF,SAAS,OAAO;A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K,UAAU;AAAA,QAC7D;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAEA,SAAO,gBAAgB,SAAS;AAClC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/cli/lib/project-config.ts"],"sourcesContent":["import path from \"path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { readFile, fileExists } from \"../utils/fs\";\nimport { verbose } from \"../utils/logger\";\nimport { CLAUDE_DIR, CLAUDE_SRC_DIR } from \"../consts\";\nimport type {\n ProjectConfig,\n StackConfig,\n SkillAssignment,\n SkillEntry,\n AgentSkillConfig,\n ValidationResult,\n CustomAgentConfig,\n} from \"../../types\";\n\nconst CONFIG_PATH = `${CLAUDE_SRC_DIR}/config.yaml`;\nconst LEGACY_CONFIG_PATH = `${CLAUDE_DIR}/config.yaml`;\n\nexport interface LoadedProjectConfig {\n config: ProjectConfig;\n configPath: string;\n /** true if was StackConfig format (legacy) */\n isLegacy: boolean;\n}\n\n/**\n * Load project config from .claude-src/config.yaml (with fallback to .claude/config.yaml)\n */\nexport async function loadProjectConfig(\n projectDir: string,\n): Promise<LoadedProjectConfig | null> {\n // Check .claude-src/config.yaml first (new location)\n const srcConfigPath = path.join(projectDir, CONFIG_PATH);\n // Fall back to .claude/config.yaml (legacy location)\n const legacyConfigPath = path.join(projectDir, LEGACY_CONFIG_PATH);\n\n let configPath = srcConfigPath;\n if (!(await fileExists(srcConfigPath))) {\n if (await fileExists(legacyConfigPath)) {\n configPath = legacyConfigPath;\n verbose(`Using legacy config location: ${legacyConfigPath}`);\n } else {\n verbose(\n `Project config not found at ${srcConfigPath} or ${legacyConfigPath}`,\n );\n return null;\n }\n }\n\n try {\n const content = await readFile(configPath);\n const parsed = parseYaml(content);\n\n if (!parsed || typeof parsed !== \"object\") {\n verbose(`Invalid project config structure at ${configPath}`);\n return null;\n }\n\n // Detect if this is legacy StackConfig format\n const isLegacy = isLegacyStackConfig(parsed);\n\n if (isLegacy) {\n verbose(`Detected legacy StackConfig format at ${configPath}`);\n const normalized = normalizeStackConfig(parsed as StackConfig);\n return {\n config: normalized,\n configPath,\n isLegacy: true,\n };\n }\n\n verbose(`Loaded project config from ${configPath}`);\n return {\n config: parsed as ProjectConfig,\n configPath,\n isLegacy: false,\n };\n } catch (error) {\n verbose(`Failed to parse project config: ${error}`);\n return null;\n }\n}\n\n/**\n * Check if a config object is in legacy StackConfig format.\n * Detection logic:\n * - If version is semver (e.g., \"1.0.0\") -> legacy\n * - If version is \"1\" -> new format\n * - If has 'id' field -> legacy\n * - If has 'created' or 'updated' fields -> legacy\n */\nexport function isLegacyStackConfig(config: unknown): boolean {\n if (!config || typeof config !== \"object\") return false;\n\n const obj = config as Record<string, unknown>;\n\n // If version looks like semver (x.y.z), it's legacy\n if (typeof obj.version === \"string\" && obj.version.includes(\".\")) {\n return true;\n }\n\n // If has legacy-only fields, it's legacy\n if (\n obj.id !== undefined ||\n obj.created !== undefined ||\n obj.updated !== undefined\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Normalize StackConfig to ProjectConfig (for backward compatibility)\n */\nexport function normalizeStackConfig(stackConfig: StackConfig): ProjectConfig {\n const config: ProjectConfig = {\n name: stackConfig.name,\n agents: stackConfig.agents,\n };\n\n // Copy optional fields\n if (stackConfig.description) {\n config.description = stackConfig.description;\n }\n\n if (stackConfig.skills && stackConfig.skills.length > 0) {\n config.skills = stackConfig.skills;\n }\n\n if (stackConfig.agent_skills) {\n // StackConfig agent_skills is always categorized format\n config.agent_skills = stackConfig.agent_skills;\n }\n\n if (stackConfig.hooks) {\n config.hooks = stackConfig.hooks;\n }\n\n if (stackConfig.author) {\n config.author = stackConfig.author;\n }\n\n if (stackConfig.framework) {\n config.framework = stackConfig.framework;\n }\n\n if (stackConfig.philosophy) {\n config.philosophy = stackConfig.philosophy;\n }\n\n if (stackConfig.principles && stackConfig.principles.length > 0) {\n config.principles = stackConfig.principles;\n }\n\n if (stackConfig.tags && stackConfig.tags.length > 0) {\n config.tags = stackConfig.tags;\n }\n\n return config;\n}\n\n/**\n * Validate project config structure.\n * Returns validation result with errors and warnings.\n */\nexport function validateProjectConfig(config: unknown): ValidationResult {\n const errors: string[] = [];\n const warnings: string[] = [];\n\n if (!config || typeof config !== \"object\") {\n return { valid: false, errors: [\"Config must be an object\"], warnings: [] };\n }\n\n const c = config as Record<string, unknown>;\n\n // Required: name\n if (!c.name || typeof c.name !== \"string\") {\n errors.push(\"name is required and must be a string\");\n }\n\n // Required: agents (for compilation)\n if (!c.agents || !Array.isArray(c.agents)) {\n errors.push(\"agents is required and must be an array\");\n } else {\n for (const agent of c.agents) {\n if (typeof agent !== \"string\") {\n errors.push(`agents must contain strings, found: ${typeof agent}`);\n }\n }\n }\n\n // Optional: version\n if (c.version !== undefined && c.version !== \"1\") {\n errors.push('version must be \"1\" (or omitted for default)');\n }\n\n // Optional: skills\n if (c.skills !== undefined) {\n if (!Array.isArray(c.skills)) {\n errors.push(\"skills must be an array\");\n } else {\n for (const skill of c.skills) {\n const skillError = validateSkillEntry(skill);\n if (skillError) {\n errors.push(skillError);\n }\n }\n }\n }\n\n // Optional: agent_skills\n if (c.agent_skills !== undefined) {\n if (typeof c.agent_skills !== \"object\" || c.agent_skills === null) {\n errors.push(\"agent_skills must be an object\");\n } else {\n for (const [agentName, agentSkills] of Object.entries(c.agent_skills)) {\n const agentSkillsError = validateAgentSkillConfig(\n agentName,\n agentSkills,\n );\n if (agentSkillsError) {\n errors.push(agentSkillsError);\n }\n }\n }\n }\n\n // Optional: preload_patterns\n if (c.preload_patterns !== undefined) {\n if (typeof c.preload_patterns !== \"object\" || c.preload_patterns === null) {\n errors.push(\"preload_patterns must be an object\");\n } else {\n for (const [agentName, patterns] of Object.entries(c.preload_patterns)) {\n if (!Array.isArray(patterns)) {\n errors.push(\n `preload_patterns.${agentName} must be an array of strings`,\n );\n } else {\n for (const pattern of patterns) {\n if (typeof pattern !== \"string\") {\n errors.push(\n `preload_patterns.${agentName} must contain only strings`,\n );\n break;\n }\n }\n }\n }\n }\n }\n\n // Optional: custom_agents\n if (c.custom_agents !== undefined) {\n const customAgentsErrors = validateCustomAgents(c.custom_agents, c.agents);\n errors.push(...customAgentsErrors);\n }\n\n // Warnings for deprecated patterns\n if (c.id !== undefined) {\n warnings.push(\"id field is deprecated in project config\");\n }\n if (c.created !== undefined) {\n warnings.push(\"created field is deprecated in project config\");\n }\n if (c.updated !== undefined) {\n warnings.push(\"updated field is deprecated in project config\");\n }\n\n return {\n valid: errors.length === 0,\n errors,\n warnings,\n };\n}\n\n/** Maximum number of custom agents allowed per project */\nconst MAX_CUSTOM_AGENTS = 20;\n\n/** Valid model values for custom agents */\nconst VALID_MODELS = [\"sonnet\", \"opus\", \"haiku\", \"inherit\"];\n\n/** Valid permission modes for custom agents */\nconst VALID_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"dontAsk\",\n \"bypassPermissions\",\n \"plan\",\n \"delegate\",\n];\n\n/**\n * Validate custom_agents section of config\n */\nfunction validateCustomAgents(\n customAgents: unknown,\n agents: unknown,\n): string[] {\n const errors: string[] = [];\n\n if (typeof customAgents !== \"object\" || customAgents === null) {\n errors.push(\"custom_agents must be an object\");\n return errors;\n }\n\n const customAgentEntries = Object.entries(customAgents);\n\n // Check maximum limit\n if (customAgentEntries.length > MAX_CUSTOM_AGENTS) {\n errors.push(\n `custom_agents cannot exceed ${MAX_CUSTOM_AGENTS} agents (found ${customAgentEntries.length})`,\n );\n }\n\n // Collect custom agent names for circular reference check\n const customAgentNames = new Set(customAgentEntries.map(([name]) => name));\n\n for (const [agentName, agentConfig] of customAgentEntries) {\n const agentErrors = validateCustomAgentConfig(\n agentName,\n agentConfig,\n customAgentNames,\n );\n errors.push(...agentErrors);\n }\n\n return errors;\n}\n\n/**\n * Validate a single custom agent configuration\n */\nfunction validateCustomAgentConfig(\n agentName: string,\n config: unknown,\n customAgentNames: Set<string>,\n): string[] {\n const errors: string[] = [];\n const prefix = `custom_agents.${agentName}`;\n\n if (typeof config !== \"object\" || config === null) {\n errors.push(`${prefix} must be an object`);\n return errors;\n }\n\n const c = config as Record<string, unknown>;\n\n // Required: title\n if (!c.title || typeof c.title !== \"string\") {\n errors.push(`${prefix}.title is required and must be a string`);\n }\n\n // Required: description\n if (!c.description || typeof c.description !== \"string\") {\n errors.push(`${prefix}.description is required and must be a string`);\n }\n\n // Optional: extends\n if (c.extends !== undefined) {\n if (typeof c.extends !== \"string\") {\n errors.push(`${prefix}.extends must be a string`);\n } else if (customAgentNames.has(c.extends)) {\n // Custom agents cannot extend other custom agents\n errors.push(\n `${prefix}.extends cannot reference another custom agent \"${c.extends}\"`,\n );\n }\n }\n\n // Optional: model\n if (c.model !== undefined) {\n if (typeof c.model !== \"string\" || !VALID_MODELS.includes(c.model)) {\n errors.push(`${prefix}.model must be one of: ${VALID_MODELS.join(\", \")}`);\n }\n }\n\n // Optional: tools\n if (c.tools !== undefined) {\n if (!Array.isArray(c.tools)) {\n errors.push(`${prefix}.tools must be an array`);\n } else {\n for (const tool of c.tools) {\n if (typeof tool !== \"string\") {\n errors.push(`${prefix}.tools must contain only strings`);\n break;\n }\n }\n }\n }\n\n // Optional: disallowed_tools\n if (c.disallowed_tools !== undefined) {\n if (!Array.isArray(c.disallowed_tools)) {\n errors.push(`${prefix}.disallowed_tools must be an array`);\n } else {\n for (const tool of c.disallowed_tools) {\n if (typeof tool !== \"string\") {\n errors.push(`${prefix}.disallowed_tools must contain only strings`);\n break;\n }\n }\n }\n }\n\n // Optional: permission_mode\n if (c.permission_mode !== undefined) {\n if (\n typeof c.permission_mode !== \"string\" ||\n !VALID_PERMISSION_MODES.includes(c.permission_mode)\n ) {\n errors.push(\n `${prefix}.permission_mode must be one of: ${VALID_PERMISSION_MODES.join(\", \")}`,\n );\n }\n }\n\n // Optional: skills\n if (c.skills !== undefined) {\n if (!Array.isArray(c.skills)) {\n errors.push(`${prefix}.skills must be an array`);\n } else {\n for (const skill of c.skills) {\n const skillError = validateSkillEntry(skill);\n if (skillError) {\n errors.push(`${prefix}.skills: ${skillError}`);\n }\n }\n }\n }\n\n // Optional: hooks\n if (c.hooks !== undefined) {\n if (typeof c.hooks !== \"object\" || c.hooks === null) {\n errors.push(`${prefix}.hooks must be an object`);\n }\n // Note: Detailed hook validation could be added later if needed\n }\n\n return errors;\n}\n\n/**\n * Validate a single skill entry\n */\nfunction validateSkillEntry(skill: unknown): string | null {\n if (typeof skill === \"string\") {\n return null; // String skill IDs are valid\n }\n\n if (typeof skill !== \"object\" || skill === null) {\n return \"skills must be strings or objects\";\n }\n\n const s = skill as Record<string, unknown>;\n\n if (!s.id || typeof s.id !== \"string\") {\n return \"skill object must have an id string\";\n }\n\n if (s.local === true && !s.path) {\n return `local skill \"${s.id}\" must have a path`;\n }\n\n if (s.preloaded !== undefined && typeof s.preloaded !== \"boolean\") {\n return `skill \"${s.id}\" preloaded must be a boolean`;\n }\n\n if (s.local !== undefined && typeof s.local !== \"boolean\") {\n return `skill \"${s.id}\" local must be a boolean`;\n }\n\n if (s.path !== undefined && typeof s.path !== \"string\") {\n return `skill \"${s.id}\" path must be a string`;\n }\n\n return null;\n}\n\n/**\n * Validate agent skill config (can be simple list or categorized)\n */\nfunction validateAgentSkillConfig(\n agentName: string,\n agentSkills: unknown,\n): string | null {\n // Check if it's a simple list (array)\n if (Array.isArray(agentSkills)) {\n for (const skill of agentSkills) {\n const skillError = validateSkillEntry(skill);\n if (skillError) {\n return `agent_skills.${agentName}: ${skillError}`;\n }\n }\n return null;\n }\n\n // Check if it's categorized (object with array values)\n if (typeof agentSkills === \"object\" && agentSkills !== null) {\n for (const [category, skills] of Object.entries(agentSkills)) {\n if (!Array.isArray(skills)) {\n return `agent_skills.${agentName}.${category} must be an array`;\n }\n for (const skill of skills) {\n const skillError = validateSkillEntry(skill);\n if (skillError) {\n return `agent_skills.${agentName}.${category}: ${skillError}`;\n }\n }\n }\n return null;\n }\n\n return `agent_skills.${agentName} must be an array or object`;\n}\n\n/**\n * Check if agent_skills value is in simple list format (array)\n */\nexport function isSimpleAgentSkills(value: unknown): value is SkillEntry[] {\n return Array.isArray(value);\n}\n\n/**\n * Normalize a skill entry to SkillAssignment\n */\nexport function normalizeSkillEntry(entry: SkillEntry): SkillAssignment {\n if (typeof entry === \"string\") {\n return { id: entry };\n }\n return entry;\n}\n\n/**\n * Normalize agent_skills to always be categorized format for internal use.\n * Simple lists are placed under an \"uncategorized\" key.\n */\nexport function normalizeAgentSkills(\n agentSkills: Record<string, AgentSkillConfig>,\n): Record<string, Record<string, SkillAssignment[]>> {\n const result: Record<string, Record<string, SkillAssignment[]>> = {};\n\n for (const [agentName, skills] of Object.entries(agentSkills)) {\n if (isSimpleAgentSkills(skills)) {\n // Simple list -> put under \"uncategorized\"\n result[agentName] = {\n uncategorized: skills.map(normalizeSkillEntry),\n };\n } else {\n // Already categorized -> normalize entries\n result[agentName] = {};\n for (const [category, categorySkills] of Object.entries(skills)) {\n result[agentName][category] = categorySkills.map(normalizeSkillEntry);\n }\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,iBAAiB;AAcnC,IAAM,cAAc,GAAG,cAAc;AACrC,IAAM,qBAAqB,GAAG,UAAU;AAYxC,eAAsB,kBACpB,YACqC;AAErC,QAAM,gBAAgB,KAAK,KAAK,YAAY,WAAW;AAEvD,QAAM,mBAAmB,KAAK,KAAK,YAAY,kBAAkB;AAEjE,MAAI,aAAa;AACjB,MAAI,CAAE,MAAM,WAAW,aAAa,GAAI;AACtC,QAAI,MAAM,WAAW,gBAAgB,GAAG;AACtC,mBAAa;AACb,cAAQ,iCAAiC,gBAAgB,EAAE;AAAA,IAC7D,OAAO;AACL;AAAA,QACE,+BAA+B,aAAa,OAAO,gBAAgB;AAAA,MACrE;AACA,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI;AACF,UAAM,UAAU,MAAM,SAAS,UAAU;AACzC,UAAM,SAAS,UAAU,OAAO;AAEhC,QAAI,CAAC,UAAU,OAAO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import {
|
|
6
6
|
detectInstallation
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-IAUAQJQ2.js";
|
|
8
8
|
import {
|
|
9
9
|
recompileAgents
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-4K4ZXQRM.js";
|
|
11
11
|
import "../chunk-DRXPNNPB.js";
|
|
12
12
|
import "../chunk-GDH553MV.js";
|
|
13
13
|
import "../chunk-I4TPKIYX.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
getPluginManifestPath,
|
|
18
18
|
getProjectPluginsDir
|
|
19
19
|
} from "../chunk-ED4E6Q2T.js";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-ZFPSUQOU.js";
|
|
21
21
|
import "../chunk-KAAEN2PO.js";
|
|
22
22
|
import {
|
|
23
23
|
loadPluginSkills
|
package/dist/commands/doctor.js
CHANGED
package/dist/commands/edit.js
CHANGED
|
@@ -7,23 +7,23 @@ import {
|
|
|
7
7
|
} from "../chunk-SVYPSDWY.js";
|
|
8
8
|
import {
|
|
9
9
|
detectInstallation
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-IAUAQJQ2.js";
|
|
11
11
|
import {
|
|
12
12
|
recompileAgents
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-4K4ZXQRM.js";
|
|
14
14
|
import {
|
|
15
15
|
Wizard
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-I2DSLOXZ.js";
|
|
18
|
-
import "../chunk-ZENYS6KW.js";
|
|
19
|
-
import "../chunk-ORVG4P2D.js";
|
|
20
|
-
import "../chunk-X6QONICW.js";
|
|
16
|
+
} from "../chunk-6DCSSORF.js";
|
|
21
17
|
import "../chunk-E3FJH4TF.js";
|
|
22
|
-
import "../chunk-Y2LW7R3Y.js";
|
|
23
18
|
import "../chunk-HLJX2FTL.js";
|
|
24
19
|
import "../chunk-CDX4W4DM.js";
|
|
20
|
+
import "../chunk-I2DSLOXZ.js";
|
|
21
|
+
import "../chunk-ZENYS6KW.js";
|
|
22
|
+
import "../chunk-7Q44DMSP.js";
|
|
25
23
|
import "../chunk-Z7G4B5HJ.js";
|
|
26
24
|
import "../chunk-BDLUZVKU.js";
|
|
25
|
+
import "../chunk-X6QONICW.js";
|
|
26
|
+
import "../chunk-Y2LW7R3Y.js";
|
|
27
27
|
import "../chunk-D237EVNB.js";
|
|
28
28
|
import "../chunk-Z2CWURZ6.js";
|
|
29
29
|
import "../chunk-DRXPNNPB.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
getPluginSkillIds,
|
|
35
35
|
getPluginSkillsDir
|
|
36
36
|
} from "../chunk-ED4E6Q2T.js";
|
|
37
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-ZFPSUQOU.js";
|
|
38
38
|
import {
|
|
39
39
|
copySkillsToPluginFromSource
|
|
40
40
|
} from "../chunk-K7EVM5LY.js";
|
package/dist/commands/init.js
CHANGED
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
} from "../chunk-UQTEPWU7.js";
|
|
8
8
|
import {
|
|
9
9
|
Wizard
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-I2DSLOXZ.js";
|
|
12
|
-
import "../chunk-ZENYS6KW.js";
|
|
13
|
-
import "../chunk-ORVG4P2D.js";
|
|
14
|
-
import "../chunk-X6QONICW.js";
|
|
10
|
+
} from "../chunk-6DCSSORF.js";
|
|
15
11
|
import "../chunk-E3FJH4TF.js";
|
|
16
|
-
import "../chunk-Y2LW7R3Y.js";
|
|
17
12
|
import "../chunk-HLJX2FTL.js";
|
|
18
13
|
import "../chunk-CDX4W4DM.js";
|
|
14
|
+
import "../chunk-I2DSLOXZ.js";
|
|
15
|
+
import "../chunk-ZENYS6KW.js";
|
|
16
|
+
import "../chunk-7Q44DMSP.js";
|
|
19
17
|
import "../chunk-Z7G4B5HJ.js";
|
|
20
18
|
import "../chunk-BDLUZVKU.js";
|
|
19
|
+
import "../chunk-X6QONICW.js";
|
|
20
|
+
import "../chunk-Y2LW7R3Y.js";
|
|
21
21
|
import "../chunk-D237EVNB.js";
|
|
22
22
|
import "../chunk-Z2CWURZ6.js";
|
|
23
23
|
import {
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "../chunk-ED4E6Q2T.js";
|
|
37
37
|
import {
|
|
38
38
|
loadProjectConfig as loadProjectConfig2
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-ZFPSUQOU.js";
|
|
40
40
|
import {
|
|
41
41
|
copySkillsToLocalFlattened
|
|
42
42
|
} from "../chunk-K7EVM5LY.js";
|
package/dist/commands/list.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatInstallationDisplay,
|
|
4
4
|
getInstallationInfo
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-IBE7JIAG.js";
|
|
6
|
+
import "../chunk-IAUAQJQ2.js";
|
|
7
7
|
import "../chunk-ED4E6Q2T.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-ZFPSUQOU.js";
|
|
9
9
|
import {
|
|
10
10
|
BaseCommand
|
|
11
11
|
} from "../chunk-EHS3TWWP.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getPluginInfo
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-IBE7JIAG.js";
|
|
5
5
|
import {
|
|
6
6
|
validatePluginManifest
|
|
7
7
|
} from "../chunk-NDY25DTL.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-IAUAQJQ2.js";
|
|
9
9
|
import {
|
|
10
10
|
compileAllAgents,
|
|
11
11
|
resolveSkillReference
|
|
12
12
|
} from "../chunk-I4TPKIYX.js";
|
|
13
13
|
import "../chunk-ED4E6Q2T.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-ZFPSUQOU.js";
|
|
15
15
|
import {
|
|
16
16
|
loadSkillsMatrixFromSource
|
|
17
17
|
} from "../chunk-CPZOTVCI.js";
|
package/dist/commands/update.js
CHANGED
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "../chunk-RTE64SJA.js";
|
|
5
5
|
import {
|
|
6
6
|
recompileAgents
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-4K4ZXQRM.js";
|
|
8
8
|
import "../chunk-DRXPNNPB.js";
|
|
9
9
|
import "../chunk-GDH553MV.js";
|
|
10
10
|
import "../chunk-I4TPKIYX.js";
|
|
11
11
|
import {
|
|
12
12
|
getCollectivePluginDir
|
|
13
13
|
} from "../chunk-ED4E6Q2T.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-ZFPSUQOU.js";
|
|
15
15
|
import {
|
|
16
16
|
hashFile
|
|
17
17
|
} from "../chunk-KAAEN2PO.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
StepBuild,
|
|
4
4
|
getDisplayLabel,
|
|
5
5
|
validateBuildStep
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-Y2LW7R3Y.js";
|
|
6
|
+
} from "../../chunk-7Q44DMSP.js";
|
|
8
7
|
import "../../chunk-Z7G4B5HJ.js";
|
|
9
8
|
import "../../chunk-BDLUZVKU.js";
|
|
9
|
+
import "../../chunk-Y2LW7R3Y.js";
|
|
10
10
|
import "../../chunk-DHET7RCE.js";
|
|
11
11
|
export {
|
|
12
12
|
StepBuild,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
StepBuild,
|
|
21
21
|
getDisplayLabel,
|
|
22
22
|
validateBuildStep
|
|
23
|
-
} from "../../chunk-
|
|
24
|
-
import "../../chunk-Y2LW7R3Y.js";
|
|
23
|
+
} from "../../chunk-7Q44DMSP.js";
|
|
25
24
|
import "../../chunk-Z7G4B5HJ.js";
|
|
26
25
|
import "../../chunk-BDLUZVKU.js";
|
|
26
|
+
import "../../chunk-Y2LW7R3Y.js";
|
|
27
27
|
import {
|
|
28
28
|
init_esm_shims
|
|
29
29
|
} from "../../chunk-DHET7RCE.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
Wizard
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-I2DSLOXZ.js";
|
|
6
|
-
import "../../chunk-ZENYS6KW.js";
|
|
7
|
-
import "../../chunk-ORVG4P2D.js";
|
|
8
|
-
import "../../chunk-X6QONICW.js";
|
|
4
|
+
} from "../../chunk-6DCSSORF.js";
|
|
9
5
|
import "../../chunk-E3FJH4TF.js";
|
|
10
|
-
import "../../chunk-Y2LW7R3Y.js";
|
|
11
6
|
import "../../chunk-HLJX2FTL.js";
|
|
12
7
|
import "../../chunk-CDX4W4DM.js";
|
|
8
|
+
import "../../chunk-I2DSLOXZ.js";
|
|
9
|
+
import "../../chunk-ZENYS6KW.js";
|
|
10
|
+
import "../../chunk-7Q44DMSP.js";
|
|
13
11
|
import "../../chunk-Z7G4B5HJ.js";
|
|
14
12
|
import "../../chunk-BDLUZVKU.js";
|
|
13
|
+
import "../../chunk-X6QONICW.js";
|
|
14
|
+
import "../../chunk-Y2LW7R3Y.js";
|
|
15
15
|
import "../../chunk-D237EVNB.js";
|
|
16
16
|
import "../../chunk-Z2CWURZ6.js";
|
|
17
17
|
import "../../chunk-76DWXGQE.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/agent-recompiler.ts","../src/cli/lib/custom-agent-resolver.ts"],"sourcesContent":["import path from \"path\";\nimport { glob, writeFile, ensureDir, readFile, fileExists } from \"../utils/fs\";\nimport { verbose } from \"../utils/logger\";\nimport { loadAllAgents, loadPluginSkills, loadProjectAgents } from \"./loader\";\nimport { resolveAgents, resolveStackSkills } from \"./resolver\";\nimport { compileAgentForPlugin } from \"./stack-plugin-compiler\";\nimport { getPluginAgentsDir } from \"./plugin-finder\";\nimport { createLiquidEngine } from \"./compiler\";\nimport {\n loadProjectConfig,\n isLegacyStackConfig,\n normalizeStackConfig,\n type LoadedProjectConfig,\n} from \"./project-config\";\nimport {\n resolveCustomAgents,\n validateCustomAgentIds,\n} from \"./custom-agent-resolver\";\nimport { parse as parseYaml } from \"yaml\";\nimport type {\n CompileConfig,\n CompileAgentConfig,\n StackConfig,\n SkillReference,\n SkillDefinition,\n ProjectConfig,\n AgentDefinition,\n} from \"../../types\";\n\nexport interface RecompileAgentsOptions {\n pluginDir: string;\n sourcePath: string;\n agents?: string[];\n skills?: Record<string, SkillDefinition>;\n projectDir?: string;\n outputDir?: string;\n}\n\nexport interface RecompileAgentsResult {\n compiled: string[];\n failed: string[];\n warnings: string[];\n}\n\nasync function getExistingAgentNames(pluginDir: string): Promise<string[]> {\n const agentsDir = getPluginAgentsDir(pluginDir);\n const files = await glob(\"*.md\", agentsDir);\n return files.map((f) => path.basename(f, \".md\"));\n}\n\n/**\n * Load config from either:\n * 1. pluginDir/config.yaml (legacy plugin location)\n * 2. pluginDir/.claude/config.yaml (new project config location)\n *\n * This provides backward compatibility with existing plugins.\n */\nasync function loadConfigWithFallback(\n pluginDir: string,\n): Promise<LoadedProjectConfig | null> {\n // First try the legacy plugin location (pluginDir/config.yaml)\n const legacyConfigPath = path.join(pluginDir, \"config.yaml\");\n if (await fileExists(legacyConfigPath)) {\n try {\n const content = await readFile(legacyConfigPath);\n const parsed = parseYaml(content);\n\n if (parsed && typeof parsed === \"object\") {\n verbose(`Loaded config.yaml from ${legacyConfigPath}`);\n\n // Check if it's legacy StackConfig format\n if (isLegacyStackConfig(parsed)) {\n const normalized = normalizeStackConfig(parsed as StackConfig);\n return {\n config: normalized,\n configPath: legacyConfigPath,\n isLegacy: true,\n };\n }\n\n return {\n config: parsed as ProjectConfig,\n configPath: legacyConfigPath,\n isLegacy: false,\n };\n }\n } catch (error) {\n verbose(`Failed to parse config.yaml: ${error}`);\n }\n }\n\n // Fall back to project config location (.claude/config.yaml)\n return loadProjectConfig(pluginDir);\n}\n\n/**\n * Convert ProjectConfig to StackConfig-like structure for compatibility\n * with existing resolveStackSkills function\n */\nfunction projectConfigToStackLike(config: ProjectConfig): StackConfig {\n return {\n name: config.name,\n version: \"1.0.0\",\n author: config.author ?? \"@unknown\",\n description: config.description,\n skills:\n config.skills?.map((s) => (typeof s === \"string\" ? { id: s } : s)) ?? [],\n agents: config.agents,\n agent_skills: config.agent_skills as StackConfig[\"agent_skills\"],\n hooks: config.hooks,\n framework: config.framework,\n philosophy: config.philosophy,\n principles: config.principles,\n tags: config.tags,\n };\n}\n\nexport async function recompileAgents(\n options: RecompileAgentsOptions,\n): Promise<RecompileAgentsResult> {\n const {\n pluginDir,\n sourcePath,\n agents: specifiedAgents,\n skills: providedSkills,\n projectDir,\n outputDir,\n } = options;\n\n const result: RecompileAgentsResult = {\n compiled: [],\n failed: [],\n warnings: [],\n };\n\n // Load project config (handles both legacy plugin config and new ProjectConfig)\n const loadedConfig = await loadConfigWithFallback(pluginDir);\n const projectConfig = loadedConfig?.config ?? null;\n\n // Load built-in agents from source\n const builtinAgents = await loadAllAgents(sourcePath);\n\n // Load project agents from .claude-src/agents/ (if projectDir provided)\n const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};\n\n // Resolve custom agents and merge with built-in agents\n // Priority: custom_agents > project agents > built-in agents\n let allAgents: Record<string, AgentDefinition> = {\n ...builtinAgents,\n ...projectAgents,\n };\n if (projectConfig?.custom_agents) {\n // Validate custom agent IDs don't conflict with built-in agents\n const idConflicts = validateCustomAgentIds(\n projectConfig.custom_agents,\n builtinAgents,\n );\n if (idConflicts.length > 0) {\n for (const error of idConflicts) {\n result.warnings.push(error);\n }\n }\n\n // Resolve custom agents to AgentDefinition\n try {\n const resolvedCustomAgents = resolveCustomAgents(\n projectConfig.custom_agents,\n builtinAgents,\n );\n // Merge: custom agents can override built-in if same name (though we warn above)\n allAgents = { ...builtinAgents, ...resolvedCustomAgents };\n verbose(\n `Resolved ${Object.keys(resolvedCustomAgents).length} custom agents`,\n );\n } catch (error) {\n result.warnings.push(\n `Failed to resolve custom agents: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n // Convert to StackConfig-like for compatibility with existing functions\n const pluginConfig = projectConfig\n ? projectConfigToStackLike(projectConfig)\n : null;\n\n let agentNames: string[];\n if (specifiedAgents) {\n agentNames = specifiedAgents;\n } else if (pluginConfig?.agents) {\n agentNames = pluginConfig.agents;\n verbose(`Using agents from config.yaml: ${agentNames.join(\", \")}`);\n } else if (outputDir) {\n agentNames = Object.keys(allAgents);\n verbose(`Using all available agents from source: ${agentNames.join(\", \")}`);\n } else {\n agentNames = await getExistingAgentNames(pluginDir);\n }\n\n if (agentNames.length === 0) {\n result.warnings.push(\"No agents found to recompile\");\n return result;\n }\n\n verbose(\n `Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`,\n );\n\n const pluginSkills = providedSkills ?? (await loadPluginSkills(pluginDir));\n\n const compileAgents: Record<string, CompileAgentConfig> = {};\n for (const agentName of agentNames) {\n if (allAgents[agentName]) {\n // Check if this is a custom agent with its own skills defined\n const customAgentConfig = projectConfig?.custom_agents?.[agentName];\n if (customAgentConfig?.skills && customAgentConfig.skills.length > 0) {\n // Custom agent has explicit skills defined\n const skillRefs: SkillReference[] = customAgentConfig.skills.map(\n (s) => ({\n id: typeof s === \"string\" ? s : s.id,\n usage: `when working with ${(typeof s === \"string\" ? s : s.id).split(\" \")[0]}`,\n preloaded:\n (typeof s === \"object\" && \"preloaded\" in s && s.preloaded) ??\n false,\n }),\n );\n compileAgents[agentName] = { skills: skillRefs };\n verbose(\n ` Agent ${agentName}: ${skillRefs.length} skills from custom_agents`,\n );\n } else if (pluginConfig?.agent_skills?.[agentName]) {\n const skillRefs = resolveStackSkills(\n pluginConfig,\n agentName,\n pluginSkills,\n );\n compileAgents[agentName] = { skills: skillRefs };\n verbose(` Agent ${agentName}: ${skillRefs.length} skills from config`);\n } else if (pluginConfig?.skills) {\n // Fall back to all skills in the config\n const skillRefs: SkillReference[] = pluginConfig.skills.map((s) => ({\n id: s.id,\n usage: `when working with ${s.id.split(\" \")[0]}`,\n preloaded: s.preloaded ?? false,\n }));\n compileAgents[agentName] = { skills: skillRefs };\n verbose(` Agent ${agentName}: ${skillRefs.length} skills (all)`);\n } else {\n compileAgents[agentName] = {};\n }\n } else {\n result.warnings.push(\n `Agent \"${agentName}\" not found in source definitions`,\n );\n }\n }\n\n const compileConfig: CompileConfig = {\n name: pluginConfig?.name || path.basename(pluginDir),\n description: pluginConfig?.description || \"Recompiled plugin\",\n claude_md: \"\",\n agents: compileAgents,\n };\n\n const engine = await createLiquidEngine(projectDir);\n const resolvedAgents = await resolveAgents(\n allAgents,\n pluginSkills,\n compileConfig,\n sourcePath,\n );\n\n const agentsDir = outputDir ?? getPluginAgentsDir(pluginDir);\n await ensureDir(agentsDir);\n\n for (const [name, agent] of Object.entries(resolvedAgents)) {\n try {\n const output = await compileAgentForPlugin(\n name,\n agent,\n sourcePath,\n engine,\n );\n await writeFile(path.join(agentsDir, `${name}.md`), output);\n result.compiled.push(name);\n verbose(` Recompiled: ${name}`);\n } catch (error) {\n result.failed.push(name);\n result.warnings.push(\n `Failed to compile ${name}: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n return result;\n}\n","import type { CustomAgentConfig, AgentDefinition } from \"../../types\";\n\n/** Default tools for standalone custom agents (no extends) */\nconst DEFAULT_TOOLS = [\"Read\", \"Grep\", \"Glob\"];\n\n/** Marker path for standalone custom agents (no extends) */\nconst CUSTOM_AGENT_PATH = \"_custom\";\n\n/**\n * Resolve a custom agent config to a full AgentDefinition.\n * If extends is specified, inherit from the base agent.\n *\n * @param agentId - The custom agent's identifier\n * @param customConfig - The custom agent configuration from config.yaml\n * @param builtinAgents - Record of built-in agent definitions to extend from\n * @returns Fully resolved AgentDefinition\n * @throws Error if extends references an unknown agent\n */\nexport function resolveCustomAgent(\n agentId: string,\n customConfig: CustomAgentConfig,\n builtinAgents: Record<string, AgentDefinition>,\n): AgentDefinition {\n let baseAgent: Partial<AgentDefinition> = {};\n\n if (customConfig.extends) {\n const base = builtinAgents[customConfig.extends];\n if (!base) {\n const availableAgents = Object.keys(builtinAgents);\n const agentList =\n availableAgents.length > 0\n ? `Available agents: ${availableAgents.slice(0, 5).join(\", \")}${availableAgents.length > 5 ? ` (and ${availableAgents.length - 5} more)` : \"\"}`\n : \"No built-in agents found\";\n throw new Error(\n `Custom agent \"${agentId}\" extends unknown agent \"${customConfig.extends}\". ${agentList}`,\n );\n }\n baseAgent = { ...base };\n }\n\n // Merge disallowed_tools: custom + inherited\n let disallowedTools: string[] | undefined;\n if (customConfig.disallowed_tools || baseAgent.disallowed_tools) {\n const merged = new Set<string>([\n ...(baseAgent.disallowed_tools || []),\n ...(customConfig.disallowed_tools || []),\n ]);\n disallowedTools = [...merged];\n }\n\n // Merge hooks: custom hooks added to inherited\n let hooks: AgentDefinition[\"hooks\"] | undefined;\n if (customConfig.hooks || baseAgent.hooks) {\n hooks = { ...baseAgent.hooks };\n if (customConfig.hooks) {\n for (const [hookType, hookDefs] of Object.entries(customConfig.hooks)) {\n if (hooks[hookType]) {\n hooks[hookType] = [...hooks[hookType], ...hookDefs];\n } else {\n hooks[hookType] = hookDefs;\n }\n }\n }\n }\n\n return {\n title: customConfig.title,\n description: customConfig.description,\n model: customConfig.model || baseAgent.model,\n tools: customConfig.tools || baseAgent.tools || DEFAULT_TOOLS,\n disallowed_tools: disallowedTools,\n permission_mode: customConfig.permission_mode || baseAgent.permission_mode,\n hooks,\n // Use extended agent's path for template resolution, or _custom for standalone\n path: baseAgent.path || CUSTOM_AGENT_PATH,\n sourceRoot: baseAgent.sourceRoot,\n };\n}\n\n/**\n * Resolve all custom agents from config to AgentDefinition records.\n *\n * @param customAgents - Record of custom agent configs from config.yaml\n * @param builtinAgents - Record of built-in agent definitions\n * @returns Record of resolved AgentDefinitions keyed by custom agent ID\n */\nexport function resolveCustomAgents(\n customAgents: Record<string, CustomAgentConfig>,\n builtinAgents: Record<string, AgentDefinition>,\n): Record<string, AgentDefinition> {\n const resolved: Record<string, AgentDefinition> = {};\n\n for (const [id, config] of Object.entries(customAgents)) {\n resolved[id] = resolveCustomAgent(id, config, builtinAgents);\n }\n\n return resolved;\n}\n\n/**\n * Check if a custom agent ID conflicts with a built-in agent ID.\n *\n * @param customAgentId - The custom agent's identifier\n * @param builtinAgents - Record of built-in agent definitions\n * @returns true if there's a conflict\n */\nexport function hasAgentIdConflict(\n customAgentId: string,\n builtinAgents: Record<string, AgentDefinition>,\n): boolean {\n return customAgentId in builtinAgents;\n}\n\n/**\n * Validate custom agents don't conflict with built-in agents.\n *\n * @param customAgents - Record of custom agent configs\n * @param builtinAgents - Record of built-in agent definitions\n * @returns Array of error messages (empty if no conflicts)\n */\nexport function validateCustomAgentIds(\n customAgents: Record<string, CustomAgentConfig>,\n builtinAgents: Record<string, AgentDefinition>,\n): string[] {\n const errors: string[] = [];\n\n for (const customId of Object.keys(customAgents)) {\n if (hasAgentIdConflict(customId, builtinAgents)) {\n errors.push(\n `Custom agent \"${customId}\" conflicts with built-in agent of the same name. Choose a unique name.`,\n );\n }\n }\n\n return errors;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,UAAU;;;ACAjB;AAGA,IAAM,gBAAgB,CAAC,QAAQ,QAAQ,MAAM;AAG7C,IAAM,oBAAoB;AAYnB,SAAS,mBACd,SACA,cACA,eACiB;AACjB,MAAI,YAAsC,CAAC;AAE3C,MAAI,aAAa,SAAS;AACxB,UAAM,OAAO,cAAc,aAAa,OAAO;AAC/C,QAAI,CAAC,MAAM;AACT,YAAM,kBAAkB,OAAO,KAAK,aAAa;AACjD,YAAM,YACJ,gBAAgB,SAAS,IACrB,qBAAqB,gBAAgB,MAAM,GAAG,CAAC,EAAE,KA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