@agents-inc/cli 0.74.5 → 0.74.8
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 +36 -0
- package/dist/{chunk-QK4CJOLO.js → chunk-4Q2JLBCX.js} +2 -2
- package/dist/{chunk-FOPJDYUF.js → chunk-7JVDZFJG.js} +4 -6
- package/dist/chunk-7JVDZFJG.js.map +1 -0
- package/dist/{chunk-XV6A6PAW.js → chunk-7SKGMV7P.js} +13 -13
- package/dist/{chunk-4OLQ4QPH.js → chunk-7W226BOV.js} +5 -6
- package/dist/chunk-7W226BOV.js.map +1 -0
- package/dist/{chunk-HRJTZXRF.js → chunk-BQW4ONJE.js} +6 -8
- package/dist/{chunk-HRJTZXRF.js.map → chunk-BQW4ONJE.js.map} +1 -1
- package/dist/{chunk-6VIOO74O.js → chunk-CBYRFAUN.js} +1 -3
- package/dist/{chunk-6VIOO74O.js.map → chunk-CBYRFAUN.js.map} +1 -1
- package/dist/{chunk-PPFXT5LC.js → chunk-E3MF6GGS.js} +27 -17
- package/dist/chunk-E3MF6GGS.js.map +1 -0
- package/dist/{chunk-BKTPEATV.js → chunk-F7LOH754.js} +2 -2
- package/dist/{chunk-P2BH6X2C.js → chunk-FVMYBN5K.js} +90 -86
- package/dist/chunk-FVMYBN5K.js.map +1 -0
- package/dist/{chunk-U3EDOGQG.js → chunk-GNA6IOQZ.js} +2 -2
- package/dist/{chunk-WMSV5AJT.js → chunk-HJY4354Y.js} +4 -4
- package/dist/{chunk-MVYJVKVT.js → chunk-HT5KOOUQ.js} +2 -2
- package/dist/{chunk-KDEOCJMS.js → chunk-ICJV3JJF.js} +83 -3
- package/dist/chunk-ICJV3JJF.js.map +1 -0
- package/dist/{chunk-NIA3NQBT.js → chunk-IJNNVCS4.js} +2 -2
- package/dist/{chunk-JAPYUFAM.js → chunk-KZG3EQSH.js} +5 -5
- package/dist/{chunk-TW64EOM7.js → chunk-LVNNP7T4.js} +16 -5
- package/dist/chunk-LVNNP7T4.js.map +1 -0
- package/dist/{chunk-KYULKBFC.js → chunk-NA6I5P5P.js} +2 -2
- package/dist/{chunk-4OBRPE6A.js → chunk-NG2GGK6P.js} +5 -1
- package/dist/{chunk-4OBRPE6A.js.map → chunk-NG2GGK6P.js.map} +1 -1
- package/dist/{chunk-RINGLIE7.js → chunk-PN65K3LH.js} +3 -3
- package/dist/{chunk-JNMZVX5S.js → chunk-Q53GBFTO.js} +3 -3
- package/dist/{chunk-AQBZJUAL.js → chunk-RBR355UI.js} +7 -7
- package/dist/{chunk-KIY36DJU.js → chunk-SM4FX2IU.js} +6 -92
- package/dist/chunk-SM4FX2IU.js.map +1 -0
- package/dist/{chunk-IK6GTV3N.js → chunk-TPXDHJDB.js} +3 -3
- package/dist/{chunk-JGSCFYCP.js → chunk-TUGXTCGX.js} +3 -3
- package/dist/{chunk-2MHSOPIU.js → chunk-UFKDY45I.js} +2 -2
- package/dist/{chunk-CTKWL3GL.js → chunk-ULP3GGXG.js} +4 -4
- package/dist/{chunk-DBPC4V25.js → chunk-X6LXHVA6.js} +3 -3
- package/dist/{chunk-FFNBQMMZ.js → chunk-ZU7AOE3X.js} +2 -2
- package/dist/commands/build/plugins.js +3 -4
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/build/stack.js +3 -4
- package/dist/commands/build/stack.js.map +1 -1
- package/dist/commands/compile.js +3 -4
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/config/index.js +3 -4
- package/dist/commands/config/index.js.map +1 -1
- package/dist/commands/config/path.js +2 -3
- package/dist/commands/config/path.js.map +1 -1
- package/dist/commands/config/show.js +3 -4
- package/dist/commands/diff.js +2 -3
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +2 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +58 -43
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +2 -3
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/import/skill.js +2 -3
- package/dist/commands/import/skill.js.map +1 -1
- package/dist/commands/info.js +2 -3
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/init.js +20 -21
- package/dist/commands/list.js +2 -3
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/agent.js +3 -4
- package/dist/commands/new/agent.js.map +1 -1
- package/dist/commands/new/marketplace.js +3 -4
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/new/skill.js +3 -4
- package/dist/commands/outdated.js +2 -3
- package/dist/commands/outdated.js.map +1 -1
- package/dist/commands/search.js +4 -5
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/uninstall.js +2 -3
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +3 -4
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.js +63 -46
- package/dist/commands/validate.js.map +1 -1
- package/dist/components/skill-search/skill-search.js +2 -2
- package/dist/components/wizard/category-grid.js +3 -3
- package/dist/components/wizard/category-grid.test.js +8 -9
- package/dist/components/wizard/category-grid.test.js.map +1 -1
- package/dist/components/wizard/domain-selection.js +5 -6
- package/dist/components/wizard/help-modal.js +2 -2
- package/dist/components/wizard/search-modal.js +2 -2
- package/dist/components/wizard/search-modal.test.js +2 -2
- package/dist/components/wizard/source-grid.js +4 -4
- package/dist/components/wizard/source-grid.test.js +9 -10
- package/dist/components/wizard/source-grid.test.js.map +1 -1
- package/dist/components/wizard/stack-selection.js +4 -5
- package/dist/components/wizard/step-agents.js +5 -6
- package/dist/components/wizard/step-agents.test.js +8 -9
- package/dist/components/wizard/step-agents.test.js.map +1 -1
- package/dist/components/wizard/step-build.js +7 -8
- package/dist/components/wizard/step-build.test.js +9 -10
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +4 -5
- package/dist/components/wizard/step-confirm.test.js +7 -8
- package/dist/components/wizard/step-confirm.test.js.map +1 -1
- package/dist/components/wizard/step-refine.js +2 -2
- package/dist/components/wizard/step-refine.test.js +2 -2
- package/dist/components/wizard/step-settings.js +4 -5
- package/dist/components/wizard/step-settings.test.js +7 -8
- package/dist/components/wizard/step-settings.test.js.map +1 -1
- package/dist/components/wizard/step-sources.js +7 -8
- package/dist/components/wizard/step-sources.test.js +10 -11
- package/dist/components/wizard/step-sources.test.js.map +1 -1
- package/dist/components/wizard/step-stack.js +7 -8
- package/dist/components/wizard/step-stack.test.js +8 -9
- package/dist/components/wizard/step-stack.test.js.map +1 -1
- package/dist/components/wizard/wizard-layout.js +6 -7
- package/dist/components/wizard/wizard.js +19 -20
- package/dist/hooks/init.js +22 -27
- package/dist/hooks/init.js.map +1 -1
- package/dist/plugins/dummy-skill/.claude-plugin/.content-hash +1 -0
- package/dist/plugins/dummy-skill/.claude-plugin/plugin.json +13 -0
- package/dist/source-loader-X46F4X2B.js +23 -0
- package/dist/{source-manager-FVOH3VXK.js → source-manager-WG7HJHVW.js} +3 -4
- package/dist/stores/wizard-store.js +3 -4
- package/dist/stores/wizard-store.test.js +30 -10
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4OLQ4QPH.js.map +0 -1
- package/dist/chunk-FOPJDYUF.js.map +0 -1
- package/dist/chunk-KDEOCJMS.js.map +0 -1
- package/dist/chunk-KIY36DJU.js.map +0 -1
- package/dist/chunk-P2BH6X2C.js.map +0 -1
- package/dist/chunk-PPFXT5LC.js.map +0 -1
- package/dist/chunk-TW64EOM7.js.map +0 -1
- package/dist/chunk-XXK6MFOA.js +0 -28
- package/dist/chunk-XXK6MFOA.js.map +0 -1
- package/dist/source-loader-IV6MOOPQ.js +0 -18
- /package/dist/{chunk-QK4CJOLO.js.map → chunk-4Q2JLBCX.js.map} +0 -0
- /package/dist/{chunk-XV6A6PAW.js.map → chunk-7SKGMV7P.js.map} +0 -0
- /package/dist/{chunk-BKTPEATV.js.map → chunk-F7LOH754.js.map} +0 -0
- /package/dist/{chunk-U3EDOGQG.js.map → chunk-GNA6IOQZ.js.map} +0 -0
- /package/dist/{chunk-WMSV5AJT.js.map → chunk-HJY4354Y.js.map} +0 -0
- /package/dist/{chunk-MVYJVKVT.js.map → chunk-HT5KOOUQ.js.map} +0 -0
- /package/dist/{chunk-NIA3NQBT.js.map → chunk-IJNNVCS4.js.map} +0 -0
- /package/dist/{chunk-JAPYUFAM.js.map → chunk-KZG3EQSH.js.map} +0 -0
- /package/dist/{chunk-KYULKBFC.js.map → chunk-NA6I5P5P.js.map} +0 -0
- /package/dist/{chunk-RINGLIE7.js.map → chunk-PN65K3LH.js.map} +0 -0
- /package/dist/{chunk-JNMZVX5S.js.map → chunk-Q53GBFTO.js.map} +0 -0
- /package/dist/{chunk-AQBZJUAL.js.map → chunk-RBR355UI.js.map} +0 -0
- /package/dist/{chunk-IK6GTV3N.js.map → chunk-TPXDHJDB.js.map} +0 -0
- /package/dist/{chunk-JGSCFYCP.js.map → chunk-TUGXTCGX.js.map} +0 -0
- /package/dist/{chunk-2MHSOPIU.js.map → chunk-UFKDY45I.js.map} +0 -0
- /package/dist/{chunk-CTKWL3GL.js.map → chunk-ULP3GGXG.js.map} +0 -0
- /package/dist/{chunk-DBPC4V25.js.map → chunk-X6LXHVA6.js.map} +0 -0
- /package/dist/{chunk-FFNBQMMZ.js.map → chunk-ZU7AOE3X.js.map} +0 -0
- /package/dist/{source-loader-IV6MOOPQ.js.map → source-loader-X46F4X2B.js.map} +0 -0
- /package/dist/{source-manager-FVOH3VXK.js.map → source-manager-WG7HJHVW.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,42 @@ Each release has detailed notes in its own file under [`changelogs/`](./changelo
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [0.74.8] - 2026-03-14
|
|
11
|
+
|
|
12
|
+
**Edit command scope fixes, unit test coverage expansion**
|
|
13
|
+
|
|
14
|
+
- Fix edit command using `installation.projectDir` instead of `cwd` for writes (D-92/D-93)
|
|
15
|
+
- Fix stack selection not resetting previous skill selections (D-94)
|
|
16
|
+
- 211 new unit tests for 29 previously untested pure functions
|
|
17
|
+
|
|
18
|
+
See [changelogs/0.74.8.md](./changelogs/0.74.8.md) for full details.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## [0.74.7] - 2026-03-13
|
|
23
|
+
|
|
24
|
+
**E2E test suite expansion and code quality audit**
|
|
25
|
+
|
|
26
|
+
- 25 new E2E test files (485 tests across 56 files) covering commands, wizards, lifecycle, and integration
|
|
27
|
+
- Shared E2E helpers, assertion utilities, and timing constants extracted from duplicated code
|
|
28
|
+
- Unit test fixture refactoring into dedicated mock-data modules
|
|
29
|
+
|
|
30
|
+
See [changelogs/0.74.7.md](./changelogs/0.74.7.md) for full details.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## [0.74.6] - 2026-03-13
|
|
35
|
+
|
|
36
|
+
**Fix init dashboard, custom skill pre-selection, and edit marketplace registration**
|
|
37
|
+
|
|
38
|
+
- Only show dashboard when project CLI config exists (not from Claude Code plugin settings)
|
|
39
|
+
- Resolve custom skill categories from matrix provider instead of static type guard
|
|
40
|
+
- Register marketplace before plugin installation in edit command
|
|
41
|
+
|
|
42
|
+
See [changelogs/0.74.6.md](./changelogs/0.74.6.md) for full details.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
10
46
|
## [0.74.5] - 2026-03-13
|
|
11
47
|
|
|
12
48
|
**Fix custom skill warnings and multi-select for synthesized categories**
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadConfigTypesDataInBackground,
|
|
8
8
|
regenerateConfigTypes,
|
|
9
9
|
resolveAuthor
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FVMYBN5K.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseCommand,
|
|
13
13
|
EXIT_CODES
|
|
@@ -339,4 +339,4 @@ export {
|
|
|
339
339
|
generateSkillRulesTs,
|
|
340
340
|
NewSkill
|
|
341
341
|
};
|
|
342
|
-
//# sourceMappingURL=chunk-
|
|
342
|
+
//# sourceMappingURL=chunk-4Q2JLBCX.js.map
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
resolveAgents,
|
|
18
18
|
writeContentHash,
|
|
19
19
|
writePluginManifest
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FVMYBN5K.js";
|
|
21
21
|
import {
|
|
22
22
|
loadAllAgents,
|
|
23
23
|
loadProjectAgents
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
typedEntries,
|
|
27
27
|
typedKeys
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-NG2GGK6P.js";
|
|
29
29
|
import {
|
|
30
30
|
agentFrontmatterValidationSchema,
|
|
31
31
|
copy,
|
|
@@ -162,14 +162,12 @@ function buildCompileConfig(params) {
|
|
|
162
162
|
async function compileAndWriteAgents(params, result) {
|
|
163
163
|
const { resolvedAgents, agentsDir, sourcePath, engine, installMode, agentScopeMap } = params;
|
|
164
164
|
const globalAgentsDir = path2.join(os.homedir(), CLAUDE_DIR, "agents");
|
|
165
|
+
await ensureDir(globalAgentsDir);
|
|
165
166
|
for (const [agentName, agent] of typedEntries(resolvedAgents)) {
|
|
166
167
|
try {
|
|
167
168
|
const output = await compileAgentForPlugin(agentName, agent, sourcePath, engine, installMode);
|
|
168
169
|
const scope = agentScopeMap?.get(agentName) ?? "project";
|
|
169
170
|
const targetDir = scope === "global" ? globalAgentsDir : agentsDir;
|
|
170
|
-
if (scope === "global") {
|
|
171
|
-
await ensureDir(targetDir);
|
|
172
|
-
}
|
|
173
171
|
await writeFile(path2.join(targetDir, `${agentName}.md`), output);
|
|
174
172
|
result.compiled.push(agentName);
|
|
175
173
|
verbose(` Recompiled: ${agentName} (${scope} -> ${targetDir})`);
|
|
@@ -327,4 +325,4 @@ export {
|
|
|
327
325
|
compileAllAgentPlugins,
|
|
328
326
|
printAgentCompilationSummary
|
|
329
327
|
};
|
|
330
|
-
//# sourceMappingURL=chunk-
|
|
328
|
+
//# sourceMappingURL=chunk-7JVDZFJG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/lib/agents/agent-fetcher.ts","../src/cli/lib/agents/agent-recompiler.ts","../src/cli/lib/agents/agent-plugin-compiler.ts","../src/cli/lib/agents/index.ts"],"sourcesContent":["import path from \"path\";\nimport { directoryExists } from \"../../utils/fs\";\nimport { verbose } from \"../../utils/logger\";\nimport { PROJECT_ROOT, DIRS, CLAUDE_DIR } from \"../../consts\";\nimport { fetchFromSource, type FetchOptions } from \"../loading\";\nimport { loadProjectSourceConfig } from \"../configuration\";\nimport type { AgentSourcePaths } from \"../../types\";\n\nexport type AgentDefinitionOptions = FetchOptions & {\n projectDir?: string;\n};\n\nexport async function getAgentDefinitions(\n remoteSource?: string,\n options: AgentDefinitionOptions = {},\n): Promise<AgentSourcePaths> {\n if (remoteSource) {\n return fetchAgentDefinitionsFromRemote(remoteSource, options);\n }\n return getLocalAgentDefinitions(options);\n}\n\nexport async function getLocalAgentDefinitions(\n options: AgentDefinitionOptions = {},\n): Promise<AgentSourcePaths> {\n const agentsDir = path.join(PROJECT_ROOT, DIRS.agents);\n let templatesDir = path.join(PROJECT_ROOT, DIRS.templates);\n\n if (!(await directoryExists(agentsDir))) {\n throw new Error(\n `Agent partials not found at '${agentsDir}'. Ensure the CLI is properly installed.`,\n );\n }\n\n if (options.projectDir) {\n const localTemplatesDir = path.join(options.projectDir, CLAUDE_DIR, \"templates\");\n if (await directoryExists(localTemplatesDir)) {\n verbose(`Using local templates from: ${localTemplatesDir}`);\n templatesDir = localTemplatesDir;\n }\n }\n\n if (!(await directoryExists(templatesDir))) {\n verbose(`Templates directory not found: ${templatesDir}`);\n }\n\n verbose(`Agent partials loaded from CLI: ${agentsDir}`);\n verbose(`Templates directory: ${templatesDir}`);\n\n return {\n agentsDir,\n templatesDir,\n sourcePath: PROJECT_ROOT,\n };\n}\n\nexport async function fetchAgentDefinitionsFromRemote(\n source: string,\n options: FetchOptions & { agentsDir?: string } = {},\n): Promise<AgentSourcePaths> {\n verbose(`Fetching agent partials from remote: ${source}`);\n\n const result = await fetchFromSource(source, {\n forceRefresh: options.forceRefresh,\n subdir: \"\",\n });\n\n let agentsDirRelPath = options.agentsDir;\n if (!agentsDirRelPath) {\n const sourceProjectConfig = await loadProjectSourceConfig(result.path);\n agentsDirRelPath = sourceProjectConfig?.agentsDir ?? DIRS.agents;\n if (sourceProjectConfig?.agentsDir) {\n verbose(`Using agentsDir from source config: ${sourceProjectConfig.agentsDir}`);\n }\n }\n\n const agentsDir = path.join(result.path, agentsDirRelPath);\n const templatesDir = path.join(agentsDir, \"_templates\");\n\n if (!(await directoryExists(agentsDir))) {\n throw new Error(`Agent partials not found at '${agentsDir}'`);\n }\n\n if (!(await directoryExists(templatesDir))) {\n verbose(`Templates directory not found: ${templatesDir}`);\n }\n\n verbose(`Agent partials fetched from: ${result.path}`);\n\n return {\n agentsDir,\n templatesDir,\n sourcePath: result.path,\n };\n}\n","import type { Liquid } from \"liquidjs\";\nimport os from \"os\";\nimport path from \"path\";\n\nimport { getErrorMessage } from \"../../utils/errors\";\nimport type {\n AgentConfig,\n AgentDefinition,\n AgentName,\n CompileAgentConfig,\n CompileConfig,\n ProjectConfig,\n SkillDefinitionMap,\n} from \"../../types\";\nimport { type InstallMode, deriveInstallMode } from \"../installation/installation\";\nimport { CLAUDE_DIR } from \"../../consts\";\nimport { glob, writeFile, ensureDir } from \"../../utils/fs\";\nimport { verbose } from \"../../utils/logger\";\nimport { typedEntries, typedKeys } from \"../../utils/typed-object\";\nimport { createLiquidEngine } from \"../compiler\";\nimport { loadProjectConfig } from \"../configuration\";\nimport { loadAllAgents, loadProjectAgents } from \"../loading\";\nimport { getPluginAgentsDir } from \"../plugins\";\nimport { discoverAllPluginSkills } from \"../plugins/plugin-discovery\";\nimport { resolveAgents, buildSkillRefsFromConfig } from \"../resolver\";\nimport { compileAgentForPlugin } from \"../stacks\";\n\nexport type RecompileAgentsOptions = {\n pluginDir: string;\n sourcePath: string;\n agents?: AgentName[];\n skills?: SkillDefinitionMap;\n projectDir?: string;\n outputDir?: string;\n installMode?: InstallMode;\n /** When provided, routes agents by scope: global agents to ~/.claude/agents/, project agents to outputDir */\n agentScopeMap?: Map<AgentName, \"project\" | \"global\">;\n};\n\nexport type RecompileAgentsResult = {\n compiled: AgentName[];\n failed: AgentName[];\n warnings: string[];\n};\n\nasync function getExistingAgentNames(pluginDir: string): Promise<AgentName[]> {\n const agentsDir = getPluginAgentsDir(pluginDir);\n const files = await glob(\"*.md\", agentsDir);\n // Boundary cast: directory names from filesystem are agent names by convention\n return files.map((f) => path.basename(f, \".md\") as AgentName);\n}\n\ntype ResolveAgentNamesParams = {\n specifiedAgents?: AgentName[];\n projectConfig: ProjectConfig | null;\n allAgents: Record<AgentName, AgentDefinition>;\n outputDir?: string;\n pluginDir: string;\n};\n\nasync function resolveAgentNames(params: ResolveAgentNamesParams): Promise<AgentName[]> {\n const { specifiedAgents, projectConfig, allAgents, outputDir, pluginDir } = params;\n\n if (specifiedAgents) {\n return specifiedAgents;\n }\n\n if (projectConfig?.agents?.length) {\n const agentNames = projectConfig.agents.map((a) => a.name);\n verbose(`Using agents from config: ${agentNames.join(\", \")}`);\n return agentNames;\n }\n\n if (outputDir) {\n const names = typedKeys<AgentName>(allAgents);\n verbose(`Using all available agents from source: ${names.join(\", \")}`);\n return names;\n }\n\n return getExistingAgentNames(pluginDir);\n}\n\ntype BuildCompileConfigParams = {\n agentNames: AgentName[];\n allAgents: Record<AgentName, AgentDefinition>;\n projectConfig: ProjectConfig | null;\n pluginDir: string;\n};\n\ntype BuildCompileConfigResult = {\n compileConfig: CompileConfig;\n warnings: string[];\n};\n\nfunction buildCompileConfig(params: BuildCompileConfigParams): BuildCompileConfigResult {\n const { agentNames, allAgents, projectConfig, pluginDir } = params;\n const warnings: string[] = [];\n\n // Store initialization: accumulator populated below for each agent in agentNames\n const compileAgents: Record<string, CompileAgentConfig> = {};\n for (const agentName of agentNames) {\n if (allAgents[agentName]) {\n const agentStack = projectConfig?.stack?.[agentName];\n compileAgents[agentName] = agentStack ? { skills: buildSkillRefsFromConfig(agentStack) } : {};\n } else {\n warnings.push(`Agent \"${agentName}\" not found in source definitions`);\n }\n }\n\n const compileConfig: CompileConfig = {\n name: projectConfig?.name || path.basename(pluginDir),\n description: projectConfig?.description || \"Recompiled plugin\",\n agents: compileAgents,\n };\n\n return { compileConfig, warnings };\n}\n\ntype CompileAndWriteParams = {\n resolvedAgents: Record<AgentName, AgentConfig>;\n agentsDir: string;\n sourcePath: string;\n engine: Liquid;\n installMode?: InstallMode;\n agentScopeMap?: Map<AgentName, \"project\" | \"global\">;\n};\n\nasync function compileAndWriteAgents(\n params: CompileAndWriteParams,\n result: RecompileAgentsResult,\n): Promise<void> {\n const { resolvedAgents, agentsDir, sourcePath, engine, installMode, agentScopeMap } = params;\n\n const globalAgentsDir = path.join(os.homedir(), CLAUDE_DIR, \"agents\");\n\n // Ensure both directories exist before writing agents.\n // ensureDir is idempotent (mkdir -p), so calling it when dirs already exist is safe.\n await ensureDir(globalAgentsDir);\n\n for (const [agentName, agent] of typedEntries<AgentName, AgentConfig>(resolvedAgents)) {\n try {\n const output = await compileAgentForPlugin(agentName, agent, sourcePath, engine, installMode);\n\n // Route agent output by scope: global agents go to ~/.claude/agents/, project agents to agentsDir\n const scope = agentScopeMap?.get(agentName) ?? \"project\";\n const targetDir = scope === \"global\" ? globalAgentsDir : agentsDir;\n await writeFile(path.join(targetDir, `${agentName}.md`), output);\n result.compiled.push(agentName);\n verbose(` Recompiled: ${agentName} (${scope} -> ${targetDir})`);\n } catch (error) {\n result.failed.push(agentName);\n result.warnings.push(`Failed to compile ${agentName}: ${getErrorMessage(error)}`);\n }\n }\n}\n\nexport async function recompileAgents(\n options: RecompileAgentsOptions,\n): Promise<RecompileAgentsResult> {\n const { pluginDir, sourcePath, skills: providedSkills, projectDir, outputDir } = options;\n\n const result: RecompileAgentsResult = {\n compiled: [],\n failed: [],\n warnings: [],\n };\n\n const configDir = projectDir ?? pluginDir;\n const loadedConfig = await loadProjectConfig(configDir);\n const projectConfig = loadedConfig?.config ?? null;\n\n const builtinAgents = await loadAllAgents(sourcePath);\n const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};\n\n // Priority: project agents > built-in agents\n const allAgents: Record<AgentName, AgentDefinition> = {\n ...builtinAgents,\n ...projectAgents,\n };\n\n const agentNames = await resolveAgentNames({\n specifiedAgents: options.agents,\n projectConfig,\n allAgents,\n outputDir,\n pluginDir,\n });\n\n if (agentNames.length === 0) {\n result.warnings.push(\"No agents found to recompile\");\n return result;\n }\n\n verbose(`Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`);\n\n // When skills are not provided, discover from all plugin directories.\n let pluginSkills: SkillDefinitionMap;\n if (providedSkills) {\n pluginSkills = providedSkills;\n } else {\n pluginSkills = await discoverAllPluginSkills(projectDir ?? pluginDir);\n }\n\n const { compileConfig, warnings } = buildCompileConfig({\n agentNames,\n allAgents,\n projectConfig,\n pluginDir,\n });\n result.warnings.push(...warnings);\n\n const engine = await createLiquidEngine(projectDir);\n const resolvedAgents = await resolveAgents(allAgents, pluginSkills, compileConfig, sourcePath);\n\n const agentsDir = outputDir ?? getPluginAgentsDir(pluginDir);\n await ensureDir(agentsDir);\n\n await compileAndWriteAgents(\n {\n resolvedAgents,\n agentsDir,\n sourcePath,\n engine,\n installMode: options.installMode ?? deriveInstallMode(projectConfig?.skills ?? []),\n agentScopeMap: options.agentScopeMap,\n },\n result,\n );\n\n return result;\n}\n","import path from \"path\";\nimport { getErrorMessage } from \"../../utils/errors\";\nimport { readFile, ensureDir, glob, copy } from \"../../utils/fs\";\nimport { log, verbose, warn } from \"../../utils/logger\";\nimport {\n generateAgentPluginManifest,\n writePluginManifest,\n getPluginManifestPath,\n} from \"../plugins\";\nimport { computeStringHash, determinePluginVersion, writeContentHash } from \"../versioning\";\nimport { extractFrontmatter } from \"../../utils/frontmatter\";\nimport type { AgentFrontmatter, PluginManifest } from \"../../types\";\nimport { agentFrontmatterValidationSchema, formatZodErrors } from \"../schemas\";\n\nexport type AgentPluginOptions = {\n agentPath: string;\n outputDir: string;\n};\n\nexport type CompiledAgentPlugin = {\n pluginPath: string;\n manifest: PluginManifest;\n agentName: string;\n};\n\nfunction parseAgentFrontmatter(\n content: string,\n filePath: string,\n): Pick<AgentFrontmatter, \"name\" | \"description\"> | null {\n const raw = extractFrontmatter(content);\n if (!raw) {\n return null;\n }\n\n const result = agentFrontmatterValidationSchema.safeParse(raw);\n if (!result.success) {\n warn(`Invalid agent frontmatter in ${filePath}: ${formatZodErrors(result.error.issues)}`);\n return null;\n }\n\n return { name: result.data.name, description: result.data.description };\n}\n\nexport async function compileAgentPlugin(\n options: AgentPluginOptions,\n): Promise<CompiledAgentPlugin> {\n const { agentPath, outputDir } = options;\n const fileName = path.basename(agentPath);\n\n const content = await readFile(agentPath);\n const frontmatter = parseAgentFrontmatter(content, agentPath);\n\n if (!frontmatter) {\n throw new Error(\n `Agent '${fileName}' has invalid or missing YAML frontmatter. ` +\n `Required fields: 'name' and 'description'. File: ${agentPath}`,\n );\n }\n\n const agentName = frontmatter.name;\n\n verbose(`Compiling agent plugin: ${agentName} from ${agentPath}`);\n\n const pluginDir = path.join(outputDir, `agent-${agentName}`);\n const agentsDir = path.join(pluginDir, \"agents\");\n\n await ensureDir(pluginDir);\n await ensureDir(agentsDir);\n\n const newHash = computeStringHash(content);\n const { version, contentHash } = await determinePluginVersion(\n newHash,\n pluginDir,\n getPluginManifestPath,\n );\n\n const manifest = generateAgentPluginManifest({\n agentName,\n description: frontmatter.description,\n version,\n });\n\n await writePluginManifest(pluginDir, manifest);\n\n await writeContentHash(pluginDir, contentHash, getPluginManifestPath);\n\n verbose(` Wrote plugin.json for ${agentName} (v${version})`);\n\n await copy(agentPath, path.join(agentsDir, `${agentName}.md`));\n verbose(` Copied agent ${fileName} -> agents/${agentName}.md`);\n\n return {\n pluginPath: pluginDir,\n manifest,\n agentName,\n };\n}\n\nexport async function compileAllAgentPlugins(\n agentsDir: string,\n outputDir: string,\n): Promise<CompiledAgentPlugin[]> {\n const results: CompiledAgentPlugin[] = [];\n\n const agentMdFiles = await glob(\"*.md\", agentsDir);\n\n for (const agentFile of agentMdFiles) {\n const agentPath = path.join(agentsDir, agentFile);\n\n try {\n const result = await compileAgentPlugin({\n agentPath,\n outputDir,\n });\n results.push(result);\n log(` [OK] agent-${result.agentName}`);\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n warn(`Failed to compile agent from '${agentFile}': ${errorMessage}`);\n }\n }\n\n return results;\n}\n\nexport function printAgentCompilationSummary(results: CompiledAgentPlugin[]): void {\n log(`\\nCompiled ${results.length} agent plugins:`);\n for (const result of results) {\n log(` - agent-${result.agentName} (v${result.manifest.version})`);\n }\n}\n","export {\n type AgentDefinitionOptions,\n getAgentDefinitions,\n getLocalAgentDefinitions,\n fetchAgentDefinitionsFromRemote,\n} from \"./agent-fetcher\";\n\nexport {\n type RecompileAgentsOptions,\n type RecompileAgentsResult,\n recompileAgents,\n} from \"./agent-recompiler\";\n\nexport {\n type AgentPluginOptions,\n type CompiledAgentPlugin,\n compileAgentPlugin,\n compileAllAgentPlugins,\n printAgentCompilationSummary,\n} from \"./agent-plugin-compiler\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,UAAU;AAYjB,eAAsB,oBACpB,cACA,UAAkC,CAAC,GACR;AAC3B,MAAI,cAAc;AAChB,WAAO,gCAAgC,cAAc,OAAO;AAAA,EAC9D;AACA,SAAO,yBAAyB,OAAO;AACzC;AAEA,eAAsB,yBACpB,UAAkC,CAAC,GACR;AAC3B,QAAM,YAAY,KAAK,KAAK,cAAc,KAAK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MAAM,KAAK,QAAQ,SAAS;AAEjD,aAAW,aAAa,cAAc;AACpC,UAAM,YAAYA,MAAK,KAAK,WAAW,SAAS;AAEhD,QAAI;AACF,YAAM,SAAS,MAAM,mBAAmB;AAAA,QACtC;AAAA,QACA;AAAA,MACF,CAAC;AACD,cAAQ,KAAK,MAAM;AACnB,UAAI,gBAAgB,OAAO,SAAS,EAAE;AAAA,IACxC,SAAS,OAAO;AACd,YAAM,eAAe,gBAAgB,KAAK;AAC1C,WAAK,iCAAiC,SAAS,MAAM,YAAY,EAAE;AAAA,IACrE;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,6BAA6B,SAAsC;AACjF,MAAI;AAAA,WAAc,QAAQ,MAAM,iBAAiB;AACjD,aAAW,UAAU,SAAS;AAC5B,QAAI,aAAa,OAAO,SAAS,MAAM,OAAO,SAAS,OAAO,GAAG;AAAA,EACnE;AACF;;;AClIA;","names":["path","path","path","path"]}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
WizardLayout
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7W226BOV.js";
|
|
5
5
|
import {
|
|
6
6
|
StepSettings
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TUGXTCGX.js";
|
|
8
8
|
import {
|
|
9
9
|
StepSources
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KZG3EQSH.js";
|
|
11
11
|
import {
|
|
12
12
|
StepStack
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ULP3GGXG.js";
|
|
14
14
|
import {
|
|
15
15
|
StepAgents
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BQW4ONJE.js";
|
|
17
17
|
import {
|
|
18
18
|
StepBuild
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RBR355UI.js";
|
|
20
20
|
import {
|
|
21
21
|
StepConfirm
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-PN65K3LH.js";
|
|
23
23
|
import {
|
|
24
24
|
getStackName
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-LVNNP7T4.js";
|
|
26
26
|
import {
|
|
27
27
|
useWizardStore
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-E3MF6GGS.js";
|
|
29
29
|
import {
|
|
30
30
|
cliTheme
|
|
31
31
|
} from "./chunk-T5DJCIUP.js";
|
|
@@ -35,15 +35,15 @@ import {
|
|
|
35
35
|
HOTKEY_SCOPE,
|
|
36
36
|
HOTKEY_SETTINGS,
|
|
37
37
|
isHotkey
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CBYRFAUN.js";
|
|
39
39
|
import {
|
|
40
40
|
resolveAlias,
|
|
41
41
|
validateSelection
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-FVMYBN5K.js";
|
|
43
43
|
import {
|
|
44
44
|
findStack,
|
|
45
45
|
matrix
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-NG2GGK6P.js";
|
|
47
47
|
import {
|
|
48
48
|
CLI_COLORS
|
|
49
49
|
} from "./chunk-EGMQ3SXN.js";
|
|
@@ -339,4 +339,4 @@ var Wizard = ({
|
|
|
339
339
|
export {
|
|
340
340
|
Wizard
|
|
341
341
|
};
|
|
342
|
-
//# sourceMappingURL=chunk-
|
|
342
|
+
//# sourceMappingURL=chunk-7SKGMV7P.js.map
|
|
@@ -8,22 +8,21 @@ import {
|
|
|
8
8
|
} from "./chunk-HGTC76BX.js";
|
|
9
9
|
import {
|
|
10
10
|
HelpModal
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NA6I5P5P.js";
|
|
12
12
|
import {
|
|
13
13
|
useWizardStore
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-E3MF6GGS.js";
|
|
15
15
|
import {
|
|
16
16
|
HOTKEY_ACCEPT_DEFAULTS,
|
|
17
17
|
HOTKEY_HELP,
|
|
18
18
|
HOTKEY_SCOPE,
|
|
19
19
|
HOTKEY_SETTINGS,
|
|
20
20
|
HOTKEY_TOGGLE_LABELS,
|
|
21
|
-
KEY_LABEL_ARROWS,
|
|
22
21
|
KEY_LABEL_ARROWS_VERT,
|
|
23
22
|
KEY_LABEL_ENTER,
|
|
24
23
|
KEY_LABEL_ESC,
|
|
25
24
|
KEY_LABEL_SPACE
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CBYRFAUN.js";
|
|
27
26
|
import {
|
|
28
27
|
CLI_COLORS,
|
|
29
28
|
DEFAULT_PLUGIN_NAME
|
|
@@ -96,7 +95,7 @@ var DefinitionItem = ({
|
|
|
96
95
|
] });
|
|
97
96
|
};
|
|
98
97
|
var HOT_KEYS = [
|
|
99
|
-
{ label: "navigate", values: [
|
|
98
|
+
{ label: "navigate", values: [KEY_LABEL_ARROWS_VERT] },
|
|
100
99
|
{ label: "select", values: [KEY_LABEL_SPACE] },
|
|
101
100
|
{ label: "continue", values: [KEY_LABEL_ENTER] },
|
|
102
101
|
{ label: "back", values: [KEY_LABEL_ESC] }
|
|
@@ -203,4 +202,4 @@ var WizardLayout = ({
|
|
|
203
202
|
export {
|
|
204
203
|
WizardLayout
|
|
205
204
|
};
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
205
|
+
//# sourceMappingURL=chunk-7W226BOV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/wizard-layout.tsx","../src/cli/components/hooks/use-terminal-dimensions.ts"],"sourcesContent":["import { Box, Static, Text } from \"ink\";\nimport React, { Fragment } from \"react\";\nimport { CLI_COLORS, DEFAULT_PLUGIN_NAME } from \"../../consts.js\";\nimport type { StartupMessage } from \"../../utils/logger.js\";\nimport { FEATURE_FLAGS } from \"../../lib/feature-flags.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { useTerminalDimensions } from \"../hooks/use-terminal-dimensions.js\";\nimport { HelpModal } from \"./help-modal.js\";\nimport {\n HOTKEY_ACCEPT_DEFAULTS,\n HOTKEY_HELP,\n HOTKEY_SCOPE,\n HOTKEY_SETTINGS,\n HOTKEY_TOGGLE_LABELS,\n KEY_LABEL_ARROWS_VERT,\n KEY_LABEL_ENTER,\n KEY_LABEL_ESC,\n KEY_LABEL_SPACE,\n} from \"./hotkeys.js\";\nimport { WIZARD_STEPS, WizardTabs } from \"./wizard-tabs.js\";\n\ntype KeyHintProps = {\n isVisible?: boolean;\n isActive?: boolean;\n label: string;\n values: string[];\n};\n\nconst DefinitionItem: React.FC<KeyHintProps> = ({\n isVisible = true,\n isActive = false,\n label,\n values,\n}) => {\n if (!isVisible) {\n return null;\n }\n\n return (\n <Text>\n {values.map((value) => (\n <Fragment key={value}>\n <Text\n backgroundColor=\"black\"\n color={isActive ? CLI_COLORS.PRIMARY : CLI_COLORS.UNFOCUSED}\n >\n {\" \"}\n {value}{\" \"}\n </Text>{\" \"}\n </Fragment>\n ))}\n <Text color={isActive ? CLI_COLORS.PRIMARY : undefined}>{label}</Text>\n </Text>\n );\n};\n\nconst HOT_KEYS: { label: string; values: string[] }[] = [\n { label: \"navigate\", values: [KEY_LABEL_ARROWS_VERT] },\n { label: \"select\", values: [KEY_LABEL_SPACE] },\n { label: \"continue\", values: [KEY_LABEL_ENTER] },\n { label: \"back\", values: [KEY_LABEL_ESC] },\n];\n\nconst WizardFooter = () => {\n const store = useWizardStore();\n\n return (\n <Box\n columnGap={2}\n borderTop\n borderRight={false}\n borderBottom\n borderLeft={false}\n borderColor=\"blackBright\"\n borderStyle=\"single\"\n paddingLeft={1}\n paddingRight={1}\n >\n <DefinitionItem\n label=\"Accept defaults\"\n values={[HOTKEY_ACCEPT_DEFAULTS.label]}\n isVisible={store.step === \"build\" && !!store.selectedStackId}\n />\n {HOT_KEYS.map((hotkey) => (\n <DefinitionItem {...hotkey} key={hotkey.label} />\n ))}\n </Box>\n );\n};\n\ntype WizardLayoutProps = {\n version?: string;\n marketplaceLabel?: string;\n logo?: string;\n startupMessages?: StartupMessage[];\n children: React.ReactNode;\n};\n\nexport const WizardLayout: React.FC<WizardLayoutProps> = ({\n version,\n marketplaceLabel,\n logo,\n startupMessages,\n children,\n}) => {\n const store = useWizardStore();\n const { completedSteps, skippedSteps } = store.getStepProgress();\n const { rows: terminalHeight } = useTerminalDimensions();\n\n return (\n <>\n {startupMessages && startupMessages.length > 0 && (\n <Static items={startupMessages}>\n {(msg, index) => (\n <Box key={index}>\n <Text\n color={msg.level === \"warn\" ? \"yellow\" : msg.level === \"error\" ? \"red\" : undefined}\n >\n {msg.level === \"warn\" ? ` Warning: ${msg.text}` : msg.text}\n </Text>\n </Box>\n )}\n </Static>\n )}\n <Box flexDirection=\"column\" paddingX={1} height={terminalHeight}>\n {logo && (\n <Box flexDirection=\"row\" marginTop={1} columnGap={1}>\n <Text>{logo}</Text>\n </Box>\n )}\n <Box>\n <Text dimColor>Marketplace: </Text>\n <Text bold>{marketplaceLabel || `${DEFAULT_PLUGIN_NAME} (public)`}</Text>\n </Box>\n <WizardTabs\n steps={WIZARD_STEPS}\n currentStep={store.step}\n completedSteps={completedSteps}\n skippedSteps={skippedSteps}\n version={version}\n />\n {store.showHelp ? (\n <HelpModal currentStep={store.step} />\n ) : (\n <>\n <Box flexDirection=\"column\" flexGrow={1} flexBasis={0} marginTop={1}>\n {children}\n </Box>\n <Box paddingX={1} columnGap={2} marginTop={2}>\n <DefinitionItem\n label=\"Labels\"\n values={[HOTKEY_TOGGLE_LABELS.label]}\n isVisible={store.step === \"build\"}\n isActive={store.showLabels}\n />\n <DefinitionItem\n label=\"Scope\"\n values={[HOTKEY_SCOPE.label]}\n isVisible={store.step === \"build\"}\n />\n <DefinitionItem\n label=\"Settings\"\n values={[HOTKEY_SETTINGS.label]}\n isVisible={store.step === \"sources\" && FEATURE_FLAGS.SOURCE_SEARCH}\n isActive={store.showSettings}\n />\n <DefinitionItem label=\"Help\" values={[HOTKEY_HELP.label]} />\n </Box>\n <WizardFooter />\n </>\n )}\n </Box>\n </>\n );\n};\n","import { useState, useEffect } from \"react\";\nimport { useStdout } from \"ink\";\n\nconst DEFAULT_COLUMNS = 80;\nconst DEFAULT_ROWS = 24;\n\nexport type TerminalDimensions = {\n /** Terminal width in columns */\n columns: number;\n /** Terminal height in rows */\n rows: number;\n};\n\n/**\n * Tracks terminal dimensions reactively. Re-renders on resize.\n *\n * Falls back to DEFAULT_COLUMNS x DEFAULT_ROWS when stdout is not a TTY\n * (e.g., piped output, CI environments, tests).\n */\nexport function useTerminalDimensions(): TerminalDimensions {\n const { stdout } = useStdout();\n\n const [dimensions, setDimensions] = useState<TerminalDimensions>(() => ({\n columns: stdout.columns || DEFAULT_COLUMNS,\n rows: stdout.rows || DEFAULT_ROWS,\n }));\n\n useEffect(() => {\n const handleResize = () => {\n setDimensions({\n columns: stdout.columns || DEFAULT_COLUMNS,\n rows: stdout.rows || DEFAULT_ROWS,\n });\n };\n\n stdout.on(\"resize\", handleResize);\n return () => {\n stdout.off(\"resize\", handleResize);\n };\n }, [stdout]);\n\n return dimensions;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,KAAK,QAAQ,YAAY;AAClC,SAAgB,gBAAgB;;;ACDhC;AAAA,SAAS,UAAU,iBAAiB;AACpC,SAAS,iBAAiB;AAE1B,IAAM,kBAAkB;AACxB,IAAM,eAAe;AAed,SAAS,wBAA4C;AAC1D,QAAM,EAAE,OAAO,IAAI,UAAU;AAE7B,QAAM,CAAC,YAAY,aAAa,IAAI,SAA6B,OAAO;AAAA,IACtE,SAAS,OAAO,WAAW;AAAA,IAC3B,MAAM,OAAO,QAAQ;AAAA,EACvB,EAAE;AAEF,YAAU,MAAM;AACd,UAAM,eAAe,MAAM;AACzB,oBAAc;AAAA,QACZ,SAAS,OAAO,WAAW;AAAA,QAC3B,MAAM,OAAO,QAAQ;AA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EACE;AAAA,4BAAC,OAAI,eAAc,UAAS,UAAU,GAAG,WAAW,GAAG,WAAW,GAC/D,UACH;AAAA,QACA,qBAAC,OAAI,UAAU,GAAG,WAAW,GAAG,WAAW,GACzC;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,OAAM;AAAA,cACN,QAAQ,CAAC,qBAAqB,KAAK;AAAA,cACnC,WAAW,MAAM,SAAS;AAAA,cAC1B,UAAU,MAAM;AAAA;AAAA,UAClB;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,OAAM;AAAA,cACN,QAAQ,CAAC,aAAa,KAAK;AAAA,cAC3B,WAAW,MAAM,SAAS;AAAA;AAAA,UAC5B;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,OAAM;AAAA,cACN,QAAQ,CAAC,gBAAgB,KAAK;AAAA,cAC9B,WAAW,MAAM,SAAS,aAAa,cAAc;AAAA,cACrD,UAAU,MAAM;AAAA;AAAA,UAClB;AAAA,UACA,oBAAC,kBAAe,OAAM,QAAO,QAAQ,CAAC,YAAY,KAAK,GAAG;AAAA,WAC5D;AAAA,QACA,oBAAC,gBAAa;AAAA,SAChB;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":["Fragment"]}
|
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
useMeasuredHeight
|
|
4
4
|
} from "./chunk-K77I4XGL.js";
|
|
5
5
|
import {
|
|
6
|
-
getDomainDisplayName
|
|
7
|
-
|
|
6
|
+
getDomainDisplayName,
|
|
7
|
+
isAgentName
|
|
8
|
+
} from "./chunk-LVNNP7T4.js";
|
|
8
9
|
import {
|
|
9
10
|
useRowScroll
|
|
10
11
|
} from "./chunk-XMLCXRTS.js";
|
|
@@ -13,14 +14,11 @@ import {
|
|
|
13
14
|
} from "./chunk-AQYAVLZK.js";
|
|
14
15
|
import {
|
|
15
16
|
useWizardStore
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
isAgentName
|
|
19
|
-
} from "./chunk-XXK6MFOA.js";
|
|
17
|
+
} from "./chunk-E3MF6GGS.js";
|
|
20
18
|
import {
|
|
21
19
|
matrix,
|
|
22
20
|
typedKeys
|
|
23
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NG2GGK6P.js";
|
|
24
22
|
import {
|
|
25
23
|
CLI_COLORS,
|
|
26
24
|
UI_SYMBOLS
|
|
@@ -268,4 +266,4 @@ var StepAgents = () => {
|
|
|
268
266
|
export {
|
|
269
267
|
StepAgents
|
|
270
268
|
};
|
|
271
|
-
//# sourceMappingURL=chunk-
|
|
269
|
+
//# sourceMappingURL=chunk-BQW4ONJE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/wizard/step-agents.tsx"],"sourcesContent":["import { Box, Text, useInput } from \"ink\";\nimport React, { useMemo, useState } from \"react\";\nimport { CLI_COLORS, UI_SYMBOLS } from \"../../consts.js\";\nimport { useRowScroll } from \"../hooks/use-row-scroll.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { matrix } from \"../../lib/matrix/matrix-provider.js\";\nimport type { AgentName, MergedSkillsMatrix } from \"../../types/index.js\";\nimport { typedKeys } from \"../../utils/typed-object.js\";\nimport { isAgentName } from \"../../utils/type-guards.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { getDomainDisplayName } from \"./utils.js\";\nimport { ViewTitle } from \"./view-title.js\";\n\ntype AgentItem = {\n id: AgentName;\n label: string;\n description: string;\n};\n\ntype AgentGroup = {\n label: string;\n items: AgentItem[];\n};\n\nconst BUILT_IN_AGENT_GROUPS: AgentGroup[] = [\n {\n label: \"Web\",\n items: [\n {\n id: \"web-developer\",\n label: \"Web Developer\",\n description: \"Frontend features, components, TypeScript\",\n },\n { id: \"web-reviewer\", label: \"Web Reviewer\", description: \"UI component code review\" },\n { id: \"web-researcher\", label: \"Web Researcher\", description: \"Frontend pattern discovery\" },\n {\n id: \"web-tester\",\n label: \"Web Tester\",\n description: \"Frontend tests, E2E, component tests\",\n },\n { id: \"web-pm\", label: \"Web PM\", description: \"Implementation specs and planning\" },\n {\n id: \"web-architecture\",\n label: \"Web Architecture\",\n description: \"App scaffolding, foundational patterns\",\n },\n {\n id: \"web-pattern-critique\",\n label: \"Web Pattern Critique\",\n description: \"Critique patterns against industry standards\",\n },\n ],\n },\n {\n label: \"API\",\n items: [\n {\n id: \"api-developer\",\n label: \"API Developer\",\n description: \"Backend routes, database, middleware\",\n },\n { id: \"api-reviewer\", label: \"API Reviewer\", description: \"Backend and config code review\" },\n { id: \"api-researcher\", label: \"API Researcher\", description: \"Backend pattern discovery\" },\n ],\n },\n {\n label: \"CLI\",\n items: [\n {\n id: \"cli-developer\",\n label: \"CLI Developer\",\n description: \"CLI commands, interactive prompts\",\n },\n { id: \"cli-tester\", label: \"CLI Tester\", description: \"CLI application tests\" },\n { id: \"cli-reviewer\", label: \"CLI Reviewer\", description: \"CLI code review\" },\n ],\n },\n {\n label: \"Meta\",\n items: [\n {\n id: \"pattern-scout\",\n label: \"Pattern Scout\",\n description: \"Extract codebase patterns and standards\",\n },\n { id: \"agent-summoner\", label: \"Agent Summoner\", description: \"Create and improve agents\" },\n {\n id: \"skill-summoner\",\n label: \"Skill Summoner\",\n description: \"Create technology-specific skills\",\n },\n { id: \"documentor\", label: \"Documentor\", description: \"AI-focused documentation\" },\n ],\n },\n];\n\n/** IDs of all built-in agents for fast lookup. */\nconst BUILT_IN_AGENT_IDS = new Set<string>(\n BUILT_IN_AGENT_GROUPS.flatMap((group) => group.items.map((a) => a.id)),\n);\n\n/** Convert a kebab-case agent ID to a title-case label. */\nfunction agentIdToLabel(id: string): string {\n return id\n .split(\"-\")\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\ntype FocusId = AgentName | \"continue\";\n\ntype ListRow =\n | { type: \"header\"; label: string }\n | { type: \"spacer\" }\n | { type: \"agent\"; agent: AgentItem };\n\nfunction buildAgentGroups(matrix: MergedSkillsMatrix): AgentGroup[] {\n const customAgentIds: string[] = [];\n for (const stack of matrix.suggestedStacks) {\n for (const agentName of typedKeys(stack.skills)) {\n if (!BUILT_IN_AGENT_IDS.has(agentName) && !customAgentIds.includes(agentName)) {\n customAgentIds.push(agentName);\n }\n }\n }\n\n if (customAgentIds.length === 0) return BUILT_IN_AGENT_GROUPS;\n\n // Group custom agents by explicit domain (from metadata.yaml) or kebab prefix fallback\n const customGroupMap = new Map<string, AgentItem[]>();\n for (const agentId of customAgentIds) {\n const explicitDomain = isAgentName(agentId) ? matrix.agentDefinedDomains?.[agentId] : undefined;\n const domainKey = explicitDomain ?? (agentId.split(\"-\")[0] || \"custom\");\n const groupLabel = getDomainDisplayName(domainKey);\n if (!customGroupMap.has(groupLabel)) {\n customGroupMap.set(groupLabel, []);\n }\n // Boundary cast: custom agent names from marketplace stacks are not in the AgentName union\n customGroupMap.get(groupLabel)!.push({\n id: agentId as AgentName,\n label: agentIdToLabel(agentId),\n description: \"Custom agent\",\n });\n }\n\n const customGroups: AgentGroup[] = [];\n for (const [label, items] of customGroupMap) {\n customGroups.push({ label, items });\n }\n\n return [...BUILT_IN_AGENT_GROUPS, ...customGroups];\n}\n\nfunction buildFlatRows(groups: AgentGroup[]): ListRow[] {\n return groups.flatMap((group, groupIndex): ListRow[] => [\n ...(groupIndex > 0 ? [{ type: \"spacer\" as const }] : []),\n { type: \"header\" as const, label: group.label },\n ...group.items.map((agent): ListRow => ({ type: \"agent\", agent })),\n ]);\n}\n\nfunction buildFocusableIds(groups: AgentGroup[]): FocusId[] {\n return [...groups.flatMap((group) => group.items.map((a) => a.id)), \"continue\"];\n}\n\nexport const StepAgents: React.FC = () => {\n const selectedAgents = useWizardStore((s) => s.selectedAgents);\n const agentConfigs = useWizardStore((s) => s.agentConfigs);\n const agentGroups = useMemo(() => buildAgentGroups(matrix), []);\n const flatRows = useMemo(() => buildFlatRows(agentGroups), [agentGroups]);\n const focusableIds = useMemo(() => buildFocusableIds(agentGroups), [agentGroups]);\n\n const [focusedId, setFocusedId] = useState<FocusId>(focusableIds[0]!);\n const { ref: listRef, measuredHeight: listHeight } = useMeasuredHeight();\n\n const focusedRowIndex =\n focusedId !== \"continue\"\n ? flatRows.findIndex((row) => row.type === \"agent\" && row.agent.id === focusedId)\n : -1;\n const { scrollEnabled, scrollTop } = useRowScroll({\n focusedIndex: Math.max(0, focusedRowIndex),\n itemCount: flatRows.length,\n availableHeight: listHeight,\n });\n\n useInput((input, key) => {\n if (key.escape) {\n useWizardStore.getState().goBack();\n return;\n }\n\n const currentIdx = focusableIds.indexOf(focusedId);\n\n if (key.upArrow || input === \"k\") {\n const nextIdx = currentIdx <= 0 ? focusableIds.length - 1 : currentIdx - 1;\n setFocusedId(focusableIds[nextIdx]!);\n return;\n }\n\n if (key.downArrow || input === \"j\") {\n const nextIdx = currentIdx >= focusableIds.length - 1 ? 0 : currentIdx + 1;\n setFocusedId(focusableIds[nextIdx]!);\n return;\n }\n\n if (key.return) {\n useWizardStore.getState().setStep(\"confirm\");\n return;\n }\n\n if (input === \" \" && focusedId !== \"continue\") {\n useWizardStore.getState().toggleAgent(focusedId);\n }\n });\n\n // Sync focusedAgentId so the wizard-level S key handler can toggle agent scope\n React.useEffect(() => {\n useWizardStore.getState().setFocusedAgentId(focusedId === \"continue\" ? null : focusedId);\n }, [focusedId]);\n\n const selectedCount = selectedAgents.length;\n const continueLabel =\n selectedCount > 0 ? `Continue with ${selectedCount} agent(s)` : \"Continue without agents\";\n\n const isContinueFocused = focusedId === \"continue\";\n\n const rowElements = flatRows.map((row, index) => {\n switch (row.type) {\n case \"header\":\n return (\n <Box key={`header-${row.label}`} flexShrink={0}>\n <Text dimColor bold>\n {\" \"}\n {row.label}\n </Text>\n </Box>\n );\n case \"spacer\":\n return (\n <Box key={`spacer-${index}`} flexShrink={0}>\n <Text> </Text>\n </Box>\n );\n case \"agent\": {\n const isFocused = row.agent.id === focusedId;\n const isSelected = selectedAgents.includes(row.agent.id);\n const checkbox = isSelected ? \"[\\u2713]\" : \"[ ]\";\n const pointer = isFocused ? UI_SYMBOLS.CURRENT : \" \";\n const agentConfig = agentConfigs.find((ac) => ac.name === row.agent.id);\n const scope = agentConfig?.scope ?? \"global\";\n const scopeBadge = scope === \"global\" ? \" [G]\" : \" [P]\";\n return (\n <Box key={row.agent.id} flexShrink={0}>\n <Text>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined}>{pointer}</Text>\n <Text\n color={isSelected || isFocused ? CLI_COLORS.PRIMARY : undefined}\n bold={isFocused}\n >\n {\" \"}\n {checkbox} {row.agent.label}\n </Text>\n <Text color={scope === \"global\" ? CLI_COLORS.WARNING : CLI_COLORS.INFO}>\n {scopeBadge}\n </Text>\n <Text dimColor> - {row.agent.description}</Text>\n </Text>\n </Box>\n );\n }\n }\n });\n\n return (\n <Box flexDirection=\"column\" width=\"100%\" flexGrow={1} flexBasis={0}>\n <ViewTitle>Select agents to compile:</ViewTitle>\n\n <Box ref={listRef} flexDirection=\"column\" flexGrow={1} flexBasis={0}>\n <Box\n flexDirection=\"column\"\n flexGrow={1}\n {...(scrollEnabled && { overflow: \"hidden\" as const })}\n >\n <Box\n flexDirection=\"column\"\n marginTop={scrollTop > 0 ? -scrollTop : 0}\n {...(scrollEnabled && { flexShrink: 0 })}\n >\n {rowElements}\n </Box>\n </Box>\n </Box>\n\n <Text color={isContinueFocused ? CLI_COLORS.PRIMARY : undefined} bold={isContinueFocused}>\n {isContinueFocused ? UI_SYMBOLS.CURRENT : \" \"} {\"\\u2192\"} {continueLabel}\n </Text>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,KAAK,MAAM,gBAAgB;AACpC,OAAO,SAAS,SAAS,gBAAgB;AAqO/B,cACE,YADF;AA9MV,IAAM,wBAAsC;AAAA,EAC1C;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,MACL;AAAA,QACE,IAAI;AAAA,QACJ,OAAO;AAAA,Q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U,QAAW,MAAM,mBACpE;AAAA,0BAAoB,WAAW,UAAU;AAAA,MAAI;AAAA,MAAE;AAAA,MAAS;AAAA,MAAE;AAAA,OAC7D;AAAA,KACF;AAEJ;","names":["matrix"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/step-agents.tsx"],"sourcesContent":["import { Box, Text, useInput } from \"ink\";\nimport React, { useMemo, useState } from \"react\";\nimport { CLI_COLORS, UI_SYMBOLS } from \"../../consts.js\";\nimport { useRowScroll } from \"../hooks/use-row-scroll.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { matrix } from \"../../lib/matrix/matrix-provider.js\";\nimport type { AgentName, MergedSkillsMatrix } from \"../../types/index.js\";\nimport { typedKeys } from \"../../utils/typed-object.js\";\nimport { isAgentName } from \"../../utils/type-guards.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { getDomainDisplayName } from \"./utils.js\";\nimport { ViewTitle } from \"./view-title.js\";\n\ntype AgentItem = {\n id: AgentName;\n label: string;\n description: string;\n};\n\ntype AgentGroup = {\n label: string;\n items: AgentItem[];\n};\n\nconst BUILT_IN_AGENT_GROUPS: AgentGroup[] = [\n {\n label: \"Web\",\n items: [\n {\n id: \"web-developer\",\n label: \"Web Developer\",\n description: \"Frontend features, components, TypeScript\",\n },\n { id: \"web-reviewer\", label: \"Web Reviewer\", description: \"UI component code review\" },\n { id: \"web-researcher\", label: \"Web Researcher\", description: \"Frontend pattern discovery\" },\n {\n id: \"web-tester\",\n label: \"Web Tester\",\n description: \"Frontend tests, E2E, component tests\",\n },\n { id: \"web-pm\", label: \"Web PM\", description: \"Implementation specs and planning\" },\n {\n id: \"web-architecture\",\n label: \"Web Architecture\",\n description: \"App scaffolding, foundational patterns\",\n },\n {\n id: \"web-pattern-critique\",\n label: \"Web Pattern Critique\",\n description: \"Critique patterns against industry standards\",\n },\n ],\n },\n {\n label: \"API\",\n items: [\n {\n id: \"api-developer\",\n label: \"API Developer\",\n description: \"Backend routes, database, middleware\",\n },\n { id: \"api-reviewer\", label: \"API Reviewer\", description: \"Backend and config code review\" },\n { id: \"api-researcher\", label: \"API Researcher\", description: \"Backend pattern discovery\" },\n ],\n },\n {\n label: \"CLI\",\n items: [\n {\n id: \"cli-developer\",\n label: \"CLI Developer\",\n description: \"CLI commands, interactive prompts\",\n },\n { id: \"cli-tester\", label: \"CLI Tester\", description: \"CLI application tests\" },\n { id: \"cli-reviewer\", label: \"CLI Reviewer\", description: \"CLI code review\" },\n ],\n },\n {\n label: \"Meta\",\n items: [\n {\n id: \"pattern-scout\",\n label: \"Pattern Scout\",\n description: \"Extract codebase patterns and standards\",\n },\n { id: \"agent-summoner\", label: \"Agent Summoner\", description: \"Create and improve agents\" },\n {\n id: \"skill-summoner\",\n label: \"Skill Summoner\",\n description: \"Create technology-specific skills\",\n },\n { id: \"documentor\", label: \"Documentor\", description: \"AI-focused documentation\" },\n ],\n },\n];\n\n/** IDs of all built-in agents for fast lookup. */\nconst BUILT_IN_AGENT_IDS = new Set<string>(\n BUILT_IN_AGENT_GROUPS.flatMap((group) => group.items.map((a) => a.id)),\n);\n\n/** Convert a kebab-case agent ID to a title-case label. */\nfunction agentIdToLabel(id: string): string {\n return id\n .split(\"-\")\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\ntype FocusId = AgentName | \"continue\";\n\ntype ListRow =\n | { type: \"header\"; label: string }\n | { type: \"spacer\" }\n | { type: \"agent\"; agent: AgentItem };\n\nfunction buildAgentGroups(matrix: MergedSkillsMatrix): AgentGroup[] {\n const customAgentIds: string[] = [];\n for (const stack of matrix.suggestedStacks) {\n for (const agentName of typedKeys(stack.skills)) {\n if (!BUILT_IN_AGENT_IDS.has(agentName) && !customAgentIds.includes(agentName)) {\n customAgentIds.push(agentName);\n }\n }\n }\n\n if (customAgentIds.length === 0) return BUILT_IN_AGENT_GROUPS;\n\n // Group custom agents by explicit domain (from metadata.yaml) or kebab prefix fallback\n const customGroupMap = new Map<string, AgentItem[]>();\n for (const agentId of customAgentIds) {\n const explicitDomain = isAgentName(agentId) ? matrix.agentDefinedDomains?.[agentId] : undefined;\n const domainKey = explicitDomain ?? (agentId.split(\"-\")[0] || \"custom\");\n const groupLabel = getDomainDisplayName(domainKey);\n if (!customGroupMap.has(groupLabel)) {\n customGroupMap.set(groupLabel, []);\n }\n // Boundary cast: custom agent names from marketplace stacks are not in the AgentName union\n customGroupMap.get(groupLabel)!.push({\n id: agentId as AgentName,\n label: agentIdToLabel(agentId),\n description: \"Custom agent\",\n });\n }\n\n const customGroups: AgentGroup[] = [];\n for (const [label, items] of customGroupMap) {\n customGroups.push({ label, items });\n }\n\n return [...BUILT_IN_AGENT_GROUPS, ...customGroups];\n}\n\nfunction buildFlatRows(groups: AgentGroup[]): ListRow[] {\n return groups.flatMap((group, groupIndex): ListRow[] => [\n ...(groupIndex > 0 ? [{ type: \"spacer\" as const }] : []),\n { type: \"header\" as const, label: group.label },\n ...group.items.map((agent): ListRow => ({ type: \"agent\", agent })),\n ]);\n}\n\nfunction buildFocusableIds(groups: AgentGroup[]): FocusId[] {\n return [...groups.flatMap((group) => group.items.map((a) => a.id)), \"continue\"];\n}\n\nexport const StepAgents: React.FC = () => {\n const selectedAgents = useWizardStore((s) => s.selectedAgents);\n const agentConfigs = useWizardStore((s) => s.agentConfigs);\n const agentGroups = useMemo(() => buildAgentGroups(matrix), []);\n const flatRows = useMemo(() => buildFlatRows(agentGroups), [agentGroups]);\n const focusableIds = useMemo(() => buildFocusableIds(agentGroups), [agentGroups]);\n\n const [focusedId, setFocusedId] = useState<FocusId>(focusableIds[0]!);\n const { ref: listRef, measuredHeight: listHeight } = useMeasuredHeight();\n\n const focusedRowIndex =\n focusedId !== \"continue\"\n ? flatRows.findIndex((row) => row.type === \"agent\" && row.agent.id === focusedId)\n : -1;\n const { scrollEnabled, scrollTop } = useRowScroll({\n focusedIndex: Math.max(0, focusedRowIndex),\n itemCount: flatRows.length,\n availableHeight: listHeight,\n });\n\n useInput((input, key) => {\n if (key.escape) {\n useWizardStore.getState().goBack();\n return;\n }\n\n const currentIdx = focusableIds.indexOf(focusedId);\n\n if (key.upArrow || input === \"k\") {\n const nextIdx = currentIdx <= 0 ? focusableIds.length - 1 : currentIdx - 1;\n setFocusedId(focusableIds[nextIdx]!);\n return;\n }\n\n if (key.downArrow || input === \"j\") {\n const nextIdx = currentIdx >= focusableIds.length - 1 ? 0 : currentIdx + 1;\n setFocusedId(focusableIds[nextIdx]!);\n return;\n }\n\n if (key.return) {\n useWizardStore.getState().setStep(\"confirm\");\n return;\n }\n\n if (input === \" \" && focusedId !== \"continue\") {\n useWizardStore.getState().toggleAgent(focusedId);\n }\n });\n\n // Sync focusedAgentId so the wizard-level S key handler can toggle agent scope\n React.useEffect(() => {\n useWizardStore.getState().setFocusedAgentId(focusedId === \"continue\" ? null : focusedId);\n }, [focusedId]);\n\n const selectedCount = selectedAgents.length;\n const continueLabel =\n selectedCount > 0 ? `Continue with ${selectedCount} agent(s)` : \"Continue without agents\";\n\n const isContinueFocused = focusedId === \"continue\";\n\n const rowElements = flatRows.map((row, index) => {\n switch (row.type) {\n case \"header\":\n return (\n <Box key={`header-${row.label}`} flexShrink={0}>\n <Text dimColor bold>\n {\" \"}\n {row.label}\n </Text>\n </Box>\n );\n case \"spacer\":\n return (\n <Box key={`spacer-${index}`} flexShrink={0}>\n <Text> </Text>\n </Box>\n );\n case \"agent\": {\n const isFocused = row.agent.id === focusedId;\n const isSelected = selectedAgents.includes(row.agent.id);\n const checkbox = isSelected ? \"[\\u2713]\" : \"[ ]\";\n const pointer = isFocused ? UI_SYMBOLS.CURRENT : \" \";\n const agentConfig = agentConfigs.find((ac) => ac.name === row.agent.id);\n const scope = agentConfig?.scope ?? \"global\";\n const scopeBadge = scope === \"global\" ? \" [G]\" : \" [P]\";\n return (\n <Box key={row.agent.id} flexShrink={0}>\n <Text>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined}>{pointer}</Text>\n <Text\n color={isSelected || isFocused ? CLI_COLORS.PRIMARY : undefined}\n bold={isFocused}\n >\n {\" \"}\n {checkbox} {row.agent.label}\n </Text>\n <Text color={scope === \"global\" ? CLI_COLORS.WARNING : CLI_COLORS.INFO}>\n {scopeBadge}\n </Text>\n <Text dimColor> - {row.agent.description}</Text>\n </Text>\n </Box>\n );\n }\n }\n });\n\n return (\n <Box flexDirection=\"column\" width=\"100%\" flexGrow={1} flexBasis={0}>\n <ViewTitle>Select agents to compile:</ViewTitle>\n\n <Box ref={listRef} flexDirection=\"column\" flexGrow={1} flexBasis={0}>\n <Box\n flexDirection=\"column\"\n flexGrow={1}\n {...(scrollEnabled && { overflow: \"hidden\" as const })}\n >\n <Box\n flexDirection=\"column\"\n marginTop={scrollTop > 0 ? -scrollTop : 0}\n {...(scrollEnabled && { flexShrink: 0 })}\n >\n {rowElements}\n </Box>\n </Box>\n </Box>\n\n <Text color={isContinueFocused ? CLI_COLORS.PRIMARY : undefined} bold={isContinueFocused}>\n {isContinueFocused ? UI_SYMBOLS.CURRENT : \" \"} {\"\\u2192\"} {continueLabel}\n </Text>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,KAAK,MAAM,gBAAgB;AACpC,OAAO,SAAS,SAAS,gBAAgB;AAqO/B,cACE,YADF;AA9MV,IAAM,wBAAsC;AAAA,EAC1C;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,MACL;AAAA,QACE,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,MACA,EAAE,IAAI,gBAAgB,OAAO,gBAAgB,aAAa,2BAA2B;AAAA,MACrF,EAAE,IAAI,kBAAkB,OAAO,kBAAkB,aAAa,6BAA6B;AAAA,MAC3F;AAAA,QACE,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,MACA,EAAE,IAAI,UAAU,OAAO,UAAU,aAAa,oCAAoC;AAAA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var KEY_LABEL_DEL = "DEL";
|
|
22
|
-
var KEY_LABEL_ARROWS = "\u2190/\u2192";
|
|
23
22
|
var KEY_LABEL_ARROWS_VERT = "\u2191/\u2193";
|
|
24
23
|
var KEY_LABEL_VIM = "h/j/k/l";
|
|
25
24
|
var KEY_LABEL_VIM_VERT = "j/k";
|
|
@@ -42,10 +41,9 @@ export {
|
|
|
42
41
|
KEY_LABEL_SPACE,
|
|
43
42
|
KEY_LABEL_TAB,
|
|
44
43
|
KEY_LABEL_DEL,
|
|
45
|
-
KEY_LABEL_ARROWS,
|
|
46
44
|
KEY_LABEL_ARROWS_VERT,
|
|
47
45
|
KEY_LABEL_VIM,
|
|
48
46
|
KEY_LABEL_VIM_VERT,
|
|
49
47
|
isHotkey
|
|
50
48
|
};
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-CBYRFAUN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/wizard/hotkeys.ts"],"sourcesContent":["/**\n * Centralized hotkey registry for wizard components.\n *\n * Every character-based hotkey and its display label lives here so that\n * changing a binding updates the key check, the footer hint, and the\n * help modal in one place.\n */\n\n// ---------------------------------------------------------------------------\n// Global hotkeys (active across multiple wizard steps)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_HELP = { key: \"?\", label: \"?\" } as const;\nexport const HOTKEY_ACCEPT_DEFAULTS = { key: \"a\", label: \"A\" } as const;\nexport const HOTKEY_SCOPE = { key: \"s\", label: \"S\" } as const;\nexport const HOTKEY_SETTINGS = { key: \"s\", label: \"S\" } as const;\n\n// ---------------------------------------------------------------------------\n// Build step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_TOGGLE_LABELS = { key: \"d\", label: \"D\" } as const;\n\n// ---------------------------------------------------------------------------\n// Sources step hotkeys (customize view)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_SET_ALL_LOCAL = { key: \"l\", label: \"L\" } as const;\nexport const HOTKEY_SET_ALL_PLUGIN = { key: \"p\", label: \"P\" } as const;\n\n// ---------------------------------------------------------------------------\n// Settings step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_ADD_SOURCE = { key: \"a\", label: \"A\" } as const;\n\n// ---------------------------------------------------------------------------\n// Skill search hotkey\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_COPY_LINK = { key: \"c\", label: \"C\" } as const;\n\n// ---------------------------------------------------------------------------\n// Common key labels (for structural keys handled via Ink key objects)\n// ---------------------------------------------------------------------------\n\nexport const KEY_LABEL_ENTER = \"ENTER\" as const;\nexport const KEY_LABEL_ESC = \"ESC\" as const;\nexport const KEY_LABEL_SPACE = \"SPACE\" as const;\nexport const KEY_LABEL_TAB = \"TAB\" as const;\nexport const KEY_LABEL_DEL = \"DEL\" as const;\nexport const KEY_LABEL_ARROWS = \"\\u2190/\\u2192\" as const;\nexport const KEY_LABEL_ARROWS_VERT = \"\\u2191/\\u2193\" as const;\nexport const KEY_LABEL_VIM = \"h/j/k/l\" as const;\nexport const KEY_LABEL_VIM_VERT = \"j/k\" as const;\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Case-insensitive check for a character hotkey. */\nexport function isHotkey(input: string, hotkey: { key: string }): boolean {\n return input.toLowerCase() === hotkey.key.toLowerCase();\n}\n"],"mappings":";;;;;;AAAA;AAYO,IAAM,cAAc,EAAE,KAAK,KAAK,OAAO,IAAI;AAC3C,IAAM,yBAAyB,EAAE,KAAK,KAAK,OAAO,IAAI;AACtD,IAAM,eAAe,EAAE,KAAK,KAAK,OAAO,IAAI;AAC5C,IAAM,kBAAkB,EAAE,KAAK,KAAK,OAAO,IAAI;AAM/C,IAAM,uBAAuB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMpD,IAAM,uBAAuB,EAAE,KAAK,KAAK,OAAO,IAAI;AACpD,IAAM,wBAAwB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMrD,IAAM,oBAAoB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMjD,IAAM,mBAAmB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMhD,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AACtB,IAAM,gBAAgB;
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/hotkeys.ts"],"sourcesContent":["/**\n * Centralized hotkey registry for wizard components.\n *\n * Every character-based hotkey and its display label lives here so that\n * changing a binding updates the key check, the footer hint, and the\n * help modal in one place.\n */\n\n// ---------------------------------------------------------------------------\n// Global hotkeys (active across multiple wizard steps)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_HELP = { key: \"?\", label: \"?\" } as const;\nexport const HOTKEY_ACCEPT_DEFAULTS = { key: \"a\", label: \"A\" } as const;\nexport const HOTKEY_SCOPE = { key: \"s\", label: \"S\" } as const;\nexport const HOTKEY_SETTINGS = { key: \"s\", label: \"S\" } as const;\n\n// ---------------------------------------------------------------------------\n// Build step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_TOGGLE_LABELS = { key: \"d\", label: \"D\" } as const;\n\n// ---------------------------------------------------------------------------\n// Sources step hotkeys (customize view)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_SET_ALL_LOCAL = { key: \"l\", label: \"L\" } as const;\nexport const HOTKEY_SET_ALL_PLUGIN = { key: \"p\", label: \"P\" } as const;\n\n// ---------------------------------------------------------------------------\n// Settings step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_ADD_SOURCE = { key: \"a\", label: \"A\" } as const;\n\n// ---------------------------------------------------------------------------\n// Skill search hotkey\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_COPY_LINK = { key: \"c\", label: \"C\" } as const;\n\n// ---------------------------------------------------------------------------\n// Common key labels (for structural keys handled via Ink key objects)\n// ---------------------------------------------------------------------------\n\nexport const KEY_LABEL_ENTER = \"ENTER\" as const;\nexport const KEY_LABEL_ESC = \"ESC\" as const;\nexport const KEY_LABEL_SPACE = \"SPACE\" as const;\nexport const KEY_LABEL_TAB = \"TAB\" as const;\nexport const KEY_LABEL_DEL = \"DEL\" as const;\nexport const KEY_LABEL_ARROWS = \"\\u2190/\\u2192\" as const;\nexport const KEY_LABEL_ARROWS_VERT = \"\\u2191/\\u2193\" as const;\nexport const KEY_LABEL_VIM = \"h/j/k/l\" as const;\nexport const KEY_LABEL_VIM_VERT = \"j/k\" as const;\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Case-insensitive check for a character hotkey. */\nexport function isHotkey(input: string, hotkey: { key: string }): boolean {\n return input.toLowerCase() === hotkey.key.toLowerCase();\n}\n"],"mappings":";;;;;;AAAA;AAYO,IAAM,cAAc,EAAE,KAAK,KAAK,OAAO,IAAI;AAC3C,IAAM,yBAAyB,EAAE,KAAK,KAAK,OAAO,IAAI;AACtD,IAAM,eAAe,EAAE,KAAK,KAAK,OAAO,IAAI;AAC5C,IAAM,kBAAkB,EAAE,KAAK,KAAK,OAAO,IAAI;AAM/C,IAAM,uBAAuB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMpD,IAAM,uBAAuB,EAAE,KAAK,KAAK,OAAO,IAAI;AACpD,IAAM,wBAAwB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMrD,IAAM,oBAAoB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMjD,IAAM,mBAAmB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMhD,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AACtB,IAAM,gBAAgB;AAEtB,IAAM,wBAAwB;AAC9B,IAAM,gBAAgB;AACtB,IAAM,qBAAqB;AAO3B,SAAS,SAAS,OAAe,QAAkC;AACxE,SAAO,MAAM,YAAY,MAAM,OAAO,IAAI,YAAY;AACxD;","names":[]}
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
deriveInstallMode,
|
|
4
4
|
resolveAlias
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
isCategory
|
|
8
|
-
} from "./chunk-XXK6MFOA.js";
|
|
5
|
+
} from "./chunk-FVMYBN5K.js";
|
|
9
6
|
import {
|
|
7
|
+
getCategoryDomain,
|
|
10
8
|
getSkillById,
|
|
11
9
|
matrix,
|
|
12
10
|
typedEntries,
|
|
13
11
|
typedKeys
|
|
14
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NG2GGK6P.js";
|
|
15
13
|
import {
|
|
16
14
|
warn
|
|
17
15
|
} from "./chunk-4CRWKTNQ.js";
|
|
@@ -29,7 +27,9 @@ import { unique } from "remeda";
|
|
|
29
27
|
import { create } from "zustand";
|
|
30
28
|
var BUILT_IN_DOMAINS = ["web", "api", "cli", "mobile", "shared"];
|
|
31
29
|
function createDefaultSkillConfig(id) {
|
|
32
|
-
|
|
30
|
+
const skill = matrix.skills[id];
|
|
31
|
+
const primarySource = skill?.availableSources?.find((s) => s.primary)?.name;
|
|
32
|
+
return { id, scope: "global", source: primarySource ?? DEFAULT_PUBLIC_SOURCE_NAME };
|
|
33
33
|
}
|
|
34
34
|
function getAllDomainsFromCategories(categories) {
|
|
35
35
|
const allDomains = unique(
|
|
@@ -67,7 +67,7 @@ function getSourceSortTier(source) {
|
|
|
67
67
|
return SOURCE_SORT_TIER_THIRD_PARTY;
|
|
68
68
|
}
|
|
69
69
|
function resolveSkillForPopulation(skillId) {
|
|
70
|
-
const { skills
|
|
70
|
+
const { skills } = matrix;
|
|
71
71
|
const skill = skills[skillId];
|
|
72
72
|
if (!skill?.category) {
|
|
73
73
|
warn(
|
|
@@ -75,16 +75,12 @@ function resolveSkillForPopulation(skillId) {
|
|
|
75
75
|
);
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
warn(`Installed skill '${skillId}' has non-standard category '${skill.category}' \u2014 skipping`);
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
const subcat = skill.category;
|
|
83
|
-
const domain = categories[subcat]?.domain;
|
|
78
|
+
const domain = getCategoryDomain(skill.category);
|
|
84
79
|
if (!domain) {
|
|
85
80
|
warn(`Installed skill '${skillId}' has unknown category '${skill.category}' \u2014 skipping`);
|
|
86
81
|
return null;
|
|
87
82
|
}
|
|
83
|
+
const subcat = skill.category;
|
|
88
84
|
return { domain, subcat, techId: skillId };
|
|
89
85
|
}
|
|
90
86
|
function buildBoundSkillOptions(boundSkills, alias, selectedSource) {
|
|
@@ -126,7 +122,18 @@ var useWizardStore = create((set, get) => ({
|
|
|
126
122
|
history: [...state.history, state.step]
|
|
127
123
|
})),
|
|
128
124
|
setApproach: (approach) => set({ approach }),
|
|
129
|
-
selectStack: (stackId) => set({
|
|
125
|
+
selectStack: (stackId) => set({
|
|
126
|
+
selectedStackId: stackId,
|
|
127
|
+
domainSelections: {},
|
|
128
|
+
_stackDomainSelections: null,
|
|
129
|
+
selectedDomains: [],
|
|
130
|
+
skillConfigs: [],
|
|
131
|
+
selectedAgents: [],
|
|
132
|
+
agentConfigs: [],
|
|
133
|
+
boundSkills: [],
|
|
134
|
+
currentDomainIndex: 0,
|
|
135
|
+
stackAction: null
|
|
136
|
+
}),
|
|
130
137
|
setStackAction: (action) => set({ stackAction: action }),
|
|
131
138
|
populateFromStack: (stack) => set(() => {
|
|
132
139
|
const { categories } = matrix;
|
|
@@ -189,10 +196,12 @@ var useWizardStore = create((set, get) => ({
|
|
|
189
196
|
const selectedDomains = sortDomainsCanonically(typedKeys(domainSelections));
|
|
190
197
|
const skillConfigs = resolvedSkillIds.map((id) => {
|
|
191
198
|
const saved = savedConfigs?.find((sc) => sc.id === id);
|
|
199
|
+
const skill = matrix.skills[id];
|
|
200
|
+
const primarySource = skill?.availableSources?.find((s) => s.primary)?.name;
|
|
192
201
|
return {
|
|
193
202
|
id,
|
|
194
203
|
scope: saved?.scope ?? "global",
|
|
195
|
-
source: saved?.source ?? DEFAULT_PUBLIC_SOURCE_NAME
|
|
204
|
+
source: primarySource ?? saved?.source ?? DEFAULT_PUBLIC_SOURCE_NAME
|
|
196
205
|
};
|
|
197
206
|
});
|
|
198
207
|
return {
|
|
@@ -486,7 +495,8 @@ var useWizardStore = create((set, get) => ({
|
|
|
486
495
|
const skillId = resolveAlias(tech);
|
|
487
496
|
const skill = getSkillById(skillId);
|
|
488
497
|
const configEntry = skillConfigs.find((sc) => sc.id === skillId);
|
|
489
|
-
const
|
|
498
|
+
const primarySource = skill.availableSources?.find((s) => s.primary)?.name;
|
|
499
|
+
const selectedSource = configEntry?.source || skill.activeSource?.name || primarySource || DEFAULT_PUBLIC_SOURCE_NAME;
|
|
490
500
|
const slug = skill.slug;
|
|
491
501
|
const sortedSources = [...skill.availableSources || []].sort(
|
|
492
502
|
(a, b) => getSourceSortTier(a) - getSourceSortTier(b)
|
|
@@ -518,4 +528,4 @@ var useWizardStore = create((set, get) => ({
|
|
|
518
528
|
export {
|
|
519
529
|
useWizardStore
|
|
520
530
|
};
|
|
521
|
-
//# sourceMappingURL=chunk-
|
|
531
|
+
//# sourceMappingURL=chunk-E3MF6GGS.js.map
|