@agents-inc/cli 0.74.5 → 0.74.7
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 +24 -0
- package/dist/{chunk-AQBZJUAL.js → chunk-2GD57LQE.js} +6 -6
- package/dist/{chunk-JGSCFYCP.js → chunk-2ZQKORJI.js} +2 -2
- package/dist/{chunk-RINGLIE7.js → chunk-CJSCCLT5.js} +2 -2
- package/dist/{chunk-IK6GTV3N.js → chunk-COZ75NET.js} +2 -2
- package/dist/{chunk-KIY36DJU.js → chunk-FDIKV4ON.js} +5 -7
- package/dist/chunk-FDIKV4ON.js.map +1 -0
- package/dist/{chunk-PPFXT5LC.js → chunk-GFTBHBRQ.js} +15 -16
- package/dist/chunk-GFTBHBRQ.js.map +1 -0
- package/dist/{chunk-QK4CJOLO.js → chunk-HA35FGPO.js} +2 -2
- package/dist/{chunk-U3EDOGQG.js → chunk-HIVZDWJC.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-4OLQ4QPH.js → chunk-JB2QTE7M.js} +2 -2
- package/dist/{chunk-DBPC4V25.js → chunk-JZPQI7YI.js} +2 -2
- package/dist/{chunk-TW64EOM7.js → chunk-LVNNP7T4.js} +16 -5
- package/dist/chunk-LVNNP7T4.js.map +1 -0
- package/dist/{chunk-JNMZVX5S.js → chunk-MOWZ2FLG.js} +3 -3
- 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-JAPYUFAM.js → chunk-RHAZARG3.js} +4 -4
- package/dist/{chunk-FOPJDYUF.js → chunk-RO6BG4ZW.js} +3 -3
- package/dist/{chunk-HRJTZXRF.js → chunk-STC7IEVI.js} +6 -8
- package/dist/{chunk-HRJTZXRF.js.map → chunk-STC7IEVI.js.map} +1 -1
- package/dist/{chunk-XV6A6PAW.js → chunk-TJBOCGLR.js} +12 -12
- package/dist/{chunk-P2BH6X2C.js → chunk-UKYWXIDT.js} +7 -20
- package/dist/chunk-UKYWXIDT.js.map +1 -0
- package/dist/{chunk-WMSV5AJT.js → chunk-VMTZ5WC5.js} +4 -4
- package/dist/{chunk-CTKWL3GL.js → chunk-W3GHDONP.js} +4 -4
- 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 +26 -18
- 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 +17 -18
- 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 +2 -3
- 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 +2 -3
- package/dist/commands/validate.js.map +1 -1
- package/dist/components/wizard/category-grid.js +2 -2
- package/dist/components/wizard/category-grid.test.js +7 -8
- package/dist/components/wizard/category-grid.test.js.map +1 -1
- package/dist/components/wizard/domain-selection.js +5 -6
- package/dist/components/wizard/source-grid.js +2 -2
- package/dist/components/wizard/source-grid.test.js +7 -8
- 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 +6 -7
- package/dist/components/wizard/step-build.test.js +8 -9
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +3 -4
- package/dist/components/wizard/step-confirm.test.js +6 -7
- package/dist/components/wizard/step-confirm.test.js.map +1 -1
- package/dist/components/wizard/step-settings.js +3 -4
- package/dist/components/wizard/step-settings.test.js +6 -7
- package/dist/components/wizard/step-settings.test.js.map +1 -1
- package/dist/components/wizard/step-sources.js +5 -6
- package/dist/components/wizard/step-sources.test.js +8 -9
- 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 +4 -5
- package/dist/components/wizard/wizard.js +16 -17
- package/dist/hooks/init.js +19 -24
- 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-IV6MOOPQ.js → source-loader-HQTTAMS7.js} +3 -4
- package/dist/{source-manager-FVOH3VXK.js → source-manager-A3QLBYCU.js} +3 -4
- package/dist/stores/wizard-store.js +3 -4
- package/dist/stores/wizard-store.test.js +6 -7
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -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/{chunk-AQBZJUAL.js.map → chunk-2GD57LQE.js.map} +0 -0
- /package/dist/{chunk-JGSCFYCP.js.map → chunk-2ZQKORJI.js.map} +0 -0
- /package/dist/{chunk-RINGLIE7.js.map → chunk-CJSCCLT5.js.map} +0 -0
- /package/dist/{chunk-IK6GTV3N.js.map → chunk-COZ75NET.js.map} +0 -0
- /package/dist/{chunk-QK4CJOLO.js.map → chunk-HA35FGPO.js.map} +0 -0
- /package/dist/{chunk-U3EDOGQG.js.map → chunk-HIVZDWJC.js.map} +0 -0
- /package/dist/{chunk-NIA3NQBT.js.map → chunk-IJNNVCS4.js.map} +0 -0
- /package/dist/{chunk-4OLQ4QPH.js.map → chunk-JB2QTE7M.js.map} +0 -0
- /package/dist/{chunk-DBPC4V25.js.map → chunk-JZPQI7YI.js.map} +0 -0
- /package/dist/{chunk-JNMZVX5S.js.map → chunk-MOWZ2FLG.js.map} +0 -0
- /package/dist/{chunk-JAPYUFAM.js.map → chunk-RHAZARG3.js.map} +0 -0
- /package/dist/{chunk-FOPJDYUF.js.map → chunk-RO6BG4ZW.js.map} +0 -0
- /package/dist/{chunk-XV6A6PAW.js.map → chunk-TJBOCGLR.js.map} +0 -0
- /package/dist/{chunk-WMSV5AJT.js.map → chunk-VMTZ5WC5.js.map} +0 -0
- /package/dist/{chunk-CTKWL3GL.js.map → chunk-W3GHDONP.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-HQTTAMS7.js.map} +0 -0
- /package/dist/{source-manager-FVOH3VXK.js.map → source-manager-A3QLBYCU.js.map} +0 -0
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getDomainDisplayName,
|
|
4
4
|
orderDomains
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LVNNP7T4.js";
|
|
6
6
|
import {
|
|
7
7
|
CheckboxGrid
|
|
8
8
|
} from "./chunk-OV5UJWS5.js";
|
|
9
9
|
import {
|
|
10
10
|
useWizardStore
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GFTBHBRQ.js";
|
|
12
12
|
import {
|
|
13
13
|
matrix,
|
|
14
14
|
typedEntries
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NG2GGK6P.js";
|
|
16
16
|
import {
|
|
17
17
|
init_esm_shims
|
|
18
18
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -63,4 +63,4 @@ var DomainSelection = () => {
|
|
|
63
63
|
export {
|
|
64
64
|
DomainSelection
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-VMTZ5WC5.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
StackSelection
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MOWZ2FLG.js";
|
|
5
5
|
import {
|
|
6
6
|
useMeasuredHeight
|
|
7
7
|
} from "./chunk-K77I4XGL.js";
|
|
8
8
|
import {
|
|
9
9
|
DomainSelection
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VMTZ5WC5.js";
|
|
11
11
|
import {
|
|
12
12
|
ViewTitle
|
|
13
13
|
} from "./chunk-AQYAVLZK.js";
|
|
14
14
|
import {
|
|
15
15
|
useWizardStore
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GFTBHBRQ.js";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
19
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -37,4 +37,4 @@ var StepStack = ({ onCancel }) => {
|
|
|
37
37
|
export {
|
|
38
38
|
StepStack
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-W3GHDONP.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
typedEntries
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NG2GGK6P.js";
|
|
5
5
|
import {
|
|
6
6
|
init_esm_shims
|
|
7
7
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -363,4 +363,4 @@ export {
|
|
|
363
363
|
createMockCompileConfig,
|
|
364
364
|
testSkillToResolvedSkill
|
|
365
365
|
};
|
|
366
|
-
//# sourceMappingURL=chunk-
|
|
366
|
+
//# sourceMappingURL=chunk-ZU7AOE3X.js.map
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
compileAllAgentPlugins,
|
|
4
4
|
printAgentCompilationSummary
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-RO6BG4ZW.js";
|
|
6
6
|
import {
|
|
7
7
|
compileAllSkillPlugins,
|
|
8
8
|
compileSkillPlugin,
|
|
9
9
|
printCompilationSummary
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-UKYWXIDT.js";
|
|
11
11
|
import "../../chunk-RRBWNEG3.js";
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-4OBRPE6A.js";
|
|
12
|
+
import "../../chunk-NG2GGK6P.js";
|
|
14
13
|
import {
|
|
15
14
|
BaseCommand
|
|
16
15
|
} from "../../chunk-IJLAVOKZ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/build/plugins.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport path from \"path\";\n\nimport { BaseCommand } from \"../../base-command\";\nimport { setVerbose } from \"../../utils/logger\";\nimport { DIRS } from \"../../consts\";\nimport {\n compileAllSkillPlugins,\n compileSkillPlugin,\n printCompilationSummary,\n} from \"../../lib/skills\";\nimport { compileAllAgentPlugins, printAgentCompilationSummary } from \"../../lib/agents\";\n\nconst DEFAULT_OUTPUT_DIR = \"dist/plugins\";\n\nexport default class BuildPlugins extends BaseCommand {\n static summary = \"Build skills and agents into standalone plugins\";\n\n static description =\n \"Build skills and agents into standalone plugins. By default, compiles all skills. Use --skill to compile a specific skill only. Use --agents-dir to also compile agents.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --skill cli-commander\",\n \"<%= config.bin %> <%= command.id %> --skills-dir ./src/skills --output-dir ./plugins\",\n \"<%= config.bin %> <%= command.id %> --agents-dir ./agents\",\n \"<%= config.bin %> <%= command.id %> --verbose\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n \"skills-dir\": Flags.string({\n char: \"s\",\n description: \"Skills source directory\",\n default: DIRS.skills,\n }),\n \"agents-dir\": Flags.string({\n char: \"a\",\n description: \"Agents source directory (builds one plugin per agent)\",\n }),\n \"output-dir\": Flags.string({\n char: \"o\",\n description: \"Output directory\",\n default: DEFAULT_OUTPUT_DIR,\n }),\n skill: Flags.string({\n description: \"Compile only a specific skill (path to skill directory)\",\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(BuildPlugins);\n\n setVerbose(flags.verbose);\n\n const projectRoot = process.cwd();\n const skillsDir = path.resolve(projectRoot, flags[\"skills-dir\"]);\n const outputDir = path.resolve(projectRoot, flags[\"output-dir\"]);\n\n this.log(\"\");\n this.log(\"Compiling skill plugins\");\n this.log(` Skills directory: ${skillsDir}`);\n this.log(` Output directory: ${outputDir}`);\n this.log(\"\");\n\n try {\n if (flags.skill) {\n const skillPath = path.resolve(skillsDir, flags.skill);\n this.log(`Compiling skill at ${skillPath}...`);\n\n const result = await compileSkillPlugin({\n skillPath,\n outputDir,\n });\n\n this.log(`Compiled ${result.skillName}`);\n this.log(` Plugin path: ${result.pluginPath}`);\n } else {\n this.log(\"Finding and compiling all skills...\");\n\n const results = await compileAllSkillPlugins(skillsDir, outputDir);\n\n this.log(`Compiled ${results.length} skill plugins`);\n printCompilationSummary(results);\n }\n\n if (flags[\"agents-dir\"]) {\n const agentsDir = path.resolve(projectRoot, flags[\"agents-dir\"]);\n\n this.log(\"\");\n this.log(\"Compiling agent plugins\");\n this.log(` Agents directory: ${agentsDir}`);\n this.log(\"\");\n\n this.log(\"Finding and compiling all agents...\");\n\n const agentResults = await compileAllAgentPlugins(agentsDir, outputDir);\n\n this.log(`Compiled ${agentResults.length} agent plugins`);\n printAgentCompilationSummary(agentResults);\n }\n\n this.log(\"\");\n this.logSuccess(\"Plugin compilation complete!\");\n } catch (error) {\n this.log(\"Compilation failed\");\n this.handleError(error);\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/build/plugins.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport path from \"path\";\n\nimport { BaseCommand } from \"../../base-command\";\nimport { setVerbose } from \"../../utils/logger\";\nimport { DIRS } from \"../../consts\";\nimport {\n compileAllSkillPlugins,\n compileSkillPlugin,\n printCompilationSummary,\n} from \"../../lib/skills\";\nimport { compileAllAgentPlugins, printAgentCompilationSummary } from \"../../lib/agents\";\n\nconst DEFAULT_OUTPUT_DIR = \"dist/plugins\";\n\nexport default class BuildPlugins extends BaseCommand {\n static summary = \"Build skills and agents into standalone plugins\";\n\n static description =\n \"Build skills and agents into standalone plugins. By default, compiles all skills. Use --skill to compile a specific skill only. Use --agents-dir to also compile agents.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --skill cli-commander\",\n \"<%= config.bin %> <%= command.id %> --skills-dir ./src/skills --output-dir ./plugins\",\n \"<%= config.bin %> <%= command.id %> --agents-dir ./agents\",\n \"<%= config.bin %> <%= command.id %> --verbose\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n \"skills-dir\": Flags.string({\n char: \"s\",\n description: \"Skills source directory\",\n default: DIRS.skills,\n }),\n \"agents-dir\": Flags.string({\n char: \"a\",\n description: \"Agents source directory (builds one plugin per agent)\",\n }),\n \"output-dir\": Flags.string({\n char: \"o\",\n description: \"Output directory\",\n default: DEFAULT_OUTPUT_DIR,\n }),\n skill: Flags.string({\n description: \"Compile only a specific skill (path to skill directory)\",\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(BuildPlugins);\n\n setVerbose(flags.verbose);\n\n const projectRoot = process.cwd();\n const skillsDir = path.resolve(projectRoot, flags[\"skills-dir\"]);\n const outputDir = path.resolve(projectRoot, flags[\"output-dir\"]);\n\n this.log(\"\");\n this.log(\"Compiling skill plugins\");\n this.log(` Skills directory: ${skillsDir}`);\n this.log(` Output directory: ${outputDir}`);\n this.log(\"\");\n\n try {\n if (flags.skill) {\n const skillPath = path.resolve(skillsDir, flags.skill);\n this.log(`Compiling skill at ${skillPath}...`);\n\n const result = await compileSkillPlugin({\n skillPath,\n outputDir,\n });\n\n this.log(`Compiled ${result.skillName}`);\n this.log(` Plugin path: ${result.pluginPath}`);\n } else {\n this.log(\"Finding and compiling all skills...\");\n\n const results = await compileAllSkillPlugins(skillsDir, outputDir);\n\n this.log(`Compiled ${results.length} skill plugins`);\n printCompilationSummary(results);\n }\n\n if (flags[\"agents-dir\"]) {\n const agentsDir = path.resolve(projectRoot, flags[\"agents-dir\"]);\n\n this.log(\"\");\n this.log(\"Compiling agent plugins\");\n this.log(` Agents directory: ${agentsDir}`);\n this.log(\"\");\n\n this.log(\"Finding and compiling all agents...\");\n\n const agentResults = await compileAllAgentPlugins(agentsDir, outputDir);\n\n this.log(`Compiled ${agentResults.length} agent plugins`);\n printAgentCompilationSummary(agentResults);\n }\n\n this.log(\"\");\n this.logSuccess(\"Plugin compilation complete!\");\n } catch (error) {\n this.log(\"Compilation failed\");\n this.handleError(error);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,aAAa;AACtB,OAAO,UAAU;AAYjB,IAAM,qBAAqB;AAE3B,IAAqB,eAArB,MAAqB,sBAAqB,YAAY;AAAA,EACpD,OAAO,UAAU;AAAA,EAEjB,OAAO,cACL;AAAA,EAEF,OAAO,WAAW;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,GAAG,YAAY;AAAA,IACf,cAAc,MAAM,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS,KAAK;AAAA,IAChB,CAAC;AAAA,IACD,cAAc,MAAM,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,aAAa;AAAA,IACf,CAAC;AAAA,IACD,cAAc,MAAM,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,IACD,OAAO,MAAM,OAAO;AAAA,MAClB,aAAa;AAAA,IACf,CAAC;AAAA,IACD,SAAS,MAAM,QAAQ;AAAA,MACrB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,aAAY;AAE/C,eAAW,MAAM,OAAO;AAExB,UAAM,cAAc,QAAQ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
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getAgentDefinitions
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-RO6BG4ZW.js";
|
|
5
5
|
import {
|
|
6
6
|
compileStackPlugin,
|
|
7
7
|
loadStacks,
|
|
8
8
|
printStackCompilationSummary
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-UKYWXIDT.js";
|
|
10
10
|
import "../../chunk-RRBWNEG3.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-4OBRPE6A.js";
|
|
11
|
+
import "../../chunk-NG2GGK6P.js";
|
|
13
12
|
import {
|
|
14
13
|
BaseCommand,
|
|
15
14
|
EXIT_CODES
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/build/stack.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Flags } from \"@oclif/core\";\nimport { Select } from \"@inkjs/ui\";\nimport { render, Box, Text } from \"ink\";\nimport path from \"path\";\n\nimport { BaseCommand } from \"../../base-command\";\nimport { setVerbose } from \"../../utils/logger\";\nimport { PROJECT_ROOT, STACKS_FILE_PATH } from \"../../consts\";\nimport { compileStackPlugin, printStackCompilationSummary, loadStacks } from \"../../lib/stacks\";\nimport { getAgentDefinitions } from \"../../lib/agents\";\nimport { EXIT_CODES } from \"../../lib/exit-codes\";\n\nconst DEFAULT_OUTPUT_DIR = \"dist/stacks\";\n\ntype StackSelectorProps = {\n availableStacks: string[];\n onSelect: (stackId: string) => void;\n};\n\nconst StackSelector: React.FC<StackSelectorProps> = ({ availableStacks, onSelect }) => {\n return (\n <Box flexDirection=\"column\">\n <Text>Select a stack to compile:</Text>\n <Select\n options={availableStacks.map((name) => ({\n value: name,\n label: name,\n }))}\n onChange={(value) => {\n onSelect(value);\n }}\n />\n </Box>\n );\n};\n\nexport default class BuildStack extends BaseCommand {\n static summary = \"Build a stack into a standalone plugin\";\n\n static description =\n \"Build a stack into a standalone plugin (requires skills repo). If no stack is specified, you will be prompted to select one.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --stack frontend-stack\",\n \"<%= config.bin %> <%= command.id %> --stack frontend-stack --output-dir ./plugins\",\n \"<%= config.bin %> <%= command.id %> --agent-source /path/to/agents --refresh\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n stack: Flags.string({\n description: \"Stack ID to compile (directory name in src/stacks/)\",\n }),\n \"output-dir\": Flags.string({\n char: \"o\",\n description: \"Output directory\",\n default: DEFAULT_OUTPUT_DIR,\n }),\n \"agent-source\": Flags.string({\n description: \"Agent partials source (default: local CLI)\",\n }),\n refresh: Flags.boolean({\n description: \"Force refresh remote agent source\",\n default: false,\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(BuildStack);\n\n setVerbose(flags.verbose);\n\n const projectRoot = process.cwd();\n const outputDir = path.resolve(projectRoot, flags[\"output-dir\"]);\n\n let stackId = flags.stack;\n\n if (!stackId) {\n const stacks = await loadStacks(projectRoot);\n const availableStacks = stacks.map((s) => s.id).sort();\n\n if (availableStacks.length === 0) {\n this.error(`No stacks found in ${STACKS_FILE_PATH}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n stackId = await new Promise<string>((resolve, reject) => {\n const { waitUntilExit } = render(\n <StackSelector\n availableStacks={availableStacks}\n onSelect={(selected) => {\n resolve(selected);\n }}\n />,\n );\n\n waitUntilExit().catch(reject);\n }).catch(() => {\n this.log(\"Cancelled\");\n this.exit(EXIT_CODES.CANCELLED);\n });\n }\n\n this.log(\"\");\n this.log(`Compiling stack plugin: ${stackId}`);\n this.log(` Output directory: ${outputDir}`);\n this.log(\"\");\n\n let agentSourcePath: string;\n try {\n this.log(flags[\"agent-source\"] ? \"Fetching agent partials...\" : \"Loading agent partials...\");\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n agentSourcePath = agentDefs.sourcePath;\n this.log(\n flags[\"agent-source\"]\n ? `Agent partials fetched from: ${flags[\"agent-source\"]}`\n : `Agent partials loaded from: ${PROJECT_ROOT}`,\n );\n } catch (error) {\n this.log(\"Failed to load agent partials\");\n this.handleError(error);\n }\n\n try {\n this.log(`Compiling stack \"${stackId}\"...`);\n\n const result = await compileStackPlugin({\n stackId,\n outputDir,\n projectRoot,\n agentSourcePath,\n });\n\n this.log(`Compiled stack plugin: ${result.stackName}`);\n\n printStackCompilationSummary(result);\n\n this.log(\"\");\n this.logSuccess(\"Stack plugin compilation complete!\");\n } catch (error) {\n this.log(\"Compilation failed\");\n this.handleError(error);\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/build/stack.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Flags } from \"@oclif/core\";\nimport { Select } from \"@inkjs/ui\";\nimport { render, Box, Text } from \"ink\";\nimport path from \"path\";\n\nimport { BaseCommand } from \"../../base-command\";\nimport { setVerbose } from \"../../utils/logger\";\nimport { PROJECT_ROOT, STACKS_FILE_PATH } from \"../../consts\";\nimport { compileStackPlugin, printStackCompilationSummary, loadStacks } from \"../../lib/stacks\";\nimport { getAgentDefinitions } from \"../../lib/agents\";\nimport { EXIT_CODES } from \"../../lib/exit-codes\";\n\nconst DEFAULT_OUTPUT_DIR = \"dist/stacks\";\n\ntype StackSelectorProps = {\n availableStacks: string[];\n onSelect: (stackId: string) => void;\n};\n\nconst StackSelector: React.FC<StackSelectorProps> = ({ availableStacks, onSelect }) => {\n return (\n <Box flexDirection=\"column\">\n <Text>Select a stack to compile:</Text>\n <Select\n options={availableStacks.map((name) => ({\n value: name,\n label: name,\n }))}\n onChange={(value) => {\n onSelect(value);\n }}\n />\n </Box>\n );\n};\n\nexport default class BuildStack extends BaseCommand {\n static summary = \"Build a stack into a standalone plugin\";\n\n static description =\n \"Build a stack into a standalone plugin (requires skills repo). If no stack is specified, you will be prompted to select one.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --stack frontend-stack\",\n \"<%= config.bin %> <%= command.id %> --stack frontend-stack --output-dir ./plugins\",\n \"<%= config.bin %> <%= command.id %> --agent-source /path/to/agents --refresh\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n stack: Flags.string({\n description: \"Stack ID to compile (directory name in src/stacks/)\",\n }),\n \"output-dir\": Flags.string({\n char: \"o\",\n description: \"Output directory\",\n default: DEFAULT_OUTPUT_DIR,\n }),\n \"agent-source\": Flags.string({\n description: \"Agent partials source (default: local CLI)\",\n }),\n refresh: Flags.boolean({\n description: \"Force refresh remote agent source\",\n default: false,\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(BuildStack);\n\n setVerbose(flags.verbose);\n\n const projectRoot = process.cwd();\n const outputDir = path.resolve(projectRoot, flags[\"output-dir\"]);\n\n let stackId = flags.stack;\n\n if (!stackId) {\n const stacks = await loadStacks(projectRoot);\n const availableStacks = stacks.map((s) => s.id).sort();\n\n if (availableStacks.length === 0) {\n this.error(`No stacks found in ${STACKS_FILE_PATH}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n stackId = await new Promise<string>((resolve, reject) => {\n const { waitUntilExit } = render(\n <StackSelector\n availableStacks={availableStacks}\n onSelect={(selected) => {\n resolve(selected);\n }}\n />,\n );\n\n waitUntilExit().catch(reject);\n }).catch(() => {\n this.log(\"Cancelled\");\n this.exit(EXIT_CODES.CANCELLED);\n });\n }\n\n this.log(\"\");\n this.log(`Compiling stack plugin: ${stackId}`);\n this.log(` Output directory: ${outputDir}`);\n this.log(\"\");\n\n let agentSourcePath: string;\n try {\n this.log(flags[\"agent-source\"] ? \"Fetching agent partials...\" : \"Loading agent partials...\");\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n agentSourcePath = agentDefs.sourcePath;\n this.log(\n flags[\"agent-source\"]\n ? `Agent partials fetched from: ${flags[\"agent-source\"]}`\n : `Agent partials loaded from: ${PROJECT_ROOT}`,\n );\n } catch (error) {\n this.log(\"Failed to load agent partials\");\n this.handleError(error);\n }\n\n try {\n this.log(`Compiling stack \"${stackId}\"...`);\n\n const result = await compileStackPlugin({\n stackId,\n outputDir,\n projectRoot,\n agentSourcePath,\n });\n\n this.log(`Compiled stack plugin: ${result.stackName}`);\n\n printStackCompilationSummary(result);\n\n this.log(\"\");\n this.logSuccess(\"Stack plugin compilation complete!\");\n } catch (error) {\n this.log(\"Compilation failed\");\n this.handleError(error);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,QAAQ,KAAK,YAAY;AAClC,OAAO,UAAU;AAkBb,SACE,KADF;AATJ,IAAM,qBAAqB;AAO3B,IAAM,gBAA8C,CAAC,EAAE,iBAAiB,SAAS,MAAM;AACrF,SACE,qBAAC,OAAI,eAAc,UACjB;AAAA,wBAAC,QAAK,wCAA0B;AAAA,IAChC;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,gBAAgB,IAAI,CAAC,UAAU;AAAA,UACtC,OAAO;AAAA,UACP,OAAO;AAAA,QACT,EAAE;AAAA,QACF,UAAU,CAAC,UAAU;AACnB,mBAAS,KAAK;AAAA,QAChB;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAqB,aAArB,MAAqB,oBAAmB,YAAY;AAAA,EAClD,OAAO,UAAU;AAAA,EAEjB,OAAO,cACL;AAAA,EAEF,OAAO,WAAW;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,GAAG,YAAY;AAAA,IACf,OAA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AAA,IACH;AAEA,SAAK,IAAI,EAAE;AACX,SAAK,IAAI,2BAA2B,OAAO,EAAE;AAC7C,SAAK,IAAI,uBAAuB,SAAS,EAAE;AAC3C,SAAK,IAAI,EAAE;AAEX,QAAI;AACJ,QAAI;AACF,WAAK,IAAI,MAAM,cAAc,IAAI,+BAA+B,2BAA2B;AAC3F,YAAM,YAAY,MAAM,oBAAoB,MAAM,cAAc,GAAG;AAAA,QACjE,cAAc,MAAM;AAAA,MACtB,CAAC;AACD,wBAAkB,UAAU;AAC5B,WAAK;AAAA,QACH,MAAM,cAAc,IAChB,gCAAgC,MAAM,cAAc,CAAC,KACrD,+BAA+B,YAAY;AAAA,MACjD;AAAA,IACF,SAAS,OAAO;AACd,WAAK,IAAI,+BAA+B;AACxC,WAAK,YAAY,KAAK;AAAA,IACxB;AAEA,QAAI;AACF,WAAK,IAAI,oBAAoB,OAAO,MAAM;AAE1C,YAAM,SAAS,MAAM,mBAAmB;AAAA,QACtC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAED,WAAK,IAAI,0BAA0B,OAAO,SAAS,EAAE;AAErD,mCAA6B,MAAM;AAEnC,WAAK,IAAI,EAAE;AACX,WAAK,WAAW,oCAAoC;AAAA,IACtD,SAAS,OAAO;AACd,WAAK,IAAI,oBAAoB;AAC7B,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF;AACF;","names":[]}
|
package/dist/commands/compile.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getAgentDefinitions,
|
|
4
4
|
recompileAgents
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-RO6BG4ZW.js";
|
|
6
6
|
import {
|
|
7
7
|
ERROR_MESSAGES,
|
|
8
8
|
INFO_MESSAGES,
|
|
@@ -13,15 +13,14 @@ import {
|
|
|
13
13
|
detectProjectInstallation,
|
|
14
14
|
discoverAllPluginSkills,
|
|
15
15
|
resolveSource
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-UKYWXIDT.js";
|
|
17
17
|
import {
|
|
18
18
|
parseFrontmatter
|
|
19
19
|
} from "../chunk-RRBWNEG3.js";
|
|
20
|
-
import "../chunk-XXK6MFOA.js";
|
|
21
20
|
import {
|
|
22
21
|
typedEntries,
|
|
23
22
|
typedKeys
|
|
24
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-NG2GGK6P.js";
|
|
25
24
|
import {
|
|
26
25
|
BaseCommand,
|
|
27
26
|
EXIT_CODES
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/compile.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport os from \"os\";\nimport path from \"path\";\nimport { BaseCommand } from \"../base-command\";\nimport { setVerbose, verbose, warn } from \"../utils/logger\";\nimport { discoverAllPluginSkills } from \"../lib/plugins\";\nimport { getAgentDefinitions } from \"../lib/agents\";\nimport { resolveSource } from \"../lib/configuration\";\nimport { directoryExists, glob, readFile, fileExists } from \"../utils/fs\";\nimport { recompileAgents } from \"../lib/agents\";\nimport { parseFrontmatter } from \"../lib/loading\";\nimport { CLI_BIN_NAME, GLOBAL_INSTALL_ROOT, LOCAL_SKILLS_PATH, STANDARD_FILES } from \"../consts\";\nimport { EXIT_CODES } from \"../lib/exit-codes\";\nimport { ERROR_MESSAGES, STATUS_MESSAGES, INFO_MESSAGES } from \"../utils/messages\";\nimport {\n detectGlobalInstallation,\n detectProjectInstallation,\n type Installation,\n} from \"../lib/installation\";\nimport type { AgentSourcePaths, SkillDefinition, SkillDefinitionMap, SkillId } from \"../types\";\nimport { typedEntries, typedKeys } from \"../utils/typed-object\";\n\nasync function loadSkillsFromDir(skillsDir: string, pathPrefix = \"\"): Promise<SkillDefinitionMap> {\n const skills: SkillDefinitionMap = {};\n\n if (!(await directoryExists(skillsDir))) {\n return skills;\n }\n\n const skillFiles = await glob(\"**/SKILL.md\", skillsDir);\n\n for (const skillFile of skillFiles) {\n const skillPath = path.join(skillsDir, skillFile);\n const skillDir = path.dirname(skillPath);\n const relativePath = path.relative(skillsDir, skillDir);\n const skillDirName = path.basename(skillDir);\n\n const metadataPath = path.join(skillDir, STANDARD_FILES.METADATA_YAML);\n if (!(await fileExists(metadataPath))) {\n const displayPath = pathPrefix ? `${pathPrefix}/${relativePath}/` : `${relativePath}/`;\n warn(\n `Skill '${skillDirName}' in '${displayPath}' is missing ${STANDARD_FILES.METADATA_YAML} — skipped. Add ${STANDARD_FILES.METADATA_YAML} to register it with the CLI.`,\n );\n continue;\n }\n\n try {\n const content = await readFile(skillPath);\n const frontmatter = parseFrontmatter(content, skillPath);\n\n if (!frontmatter?.name) {\n warn(`Skipping skill in '${skillDirName}': missing or invalid frontmatter name`);\n continue;\n }\n\n const canonicalId = frontmatter.name;\n\n const skill: SkillDefinition = {\n id: canonicalId,\n path: pathPrefix ? `${pathPrefix}/${relativePath}/` : `${relativePath}/`,\n description: frontmatter?.description || \"\",\n };\n\n skills[canonicalId] = skill;\n verbose(` Loaded skill: ${canonicalId}`);\n } catch (error) {\n verbose(` Failed to load skill: ${skillFile} - ${error}`);\n }\n }\n\n return skills;\n}\n\nasync function discoverLocalProjectSkills(projectDir: string): Promise<SkillDefinitionMap> {\n const localSkillsDir = path.join(projectDir, LOCAL_SKILLS_PATH);\n return loadSkillsFromDir(localSkillsDir, LOCAL_SKILLS_PATH);\n}\n\n/** Later sources take precedence over earlier ones */\nfunction mergeSkills(...skillSources: SkillDefinitionMap[]): SkillDefinitionMap {\n const merged: SkillDefinitionMap = {};\n\n for (const source of skillSources) {\n for (const [id, skill] of typedEntries<SkillId, SkillDefinition | undefined>(source)) {\n if (skill) {\n merged[id] = skill;\n }\n }\n }\n\n return merged;\n}\n\ntype CompileFlags = {\n source?: string;\n \"agent-source\"?: string;\n verbose: boolean;\n};\n\ntype DiscoveredSkills = {\n allSkills: SkillDefinitionMap;\n totalSkillCount: number;\n};\n\nexport default class Compile extends BaseCommand {\n static summary = \"Compile agents using local skills and agent definitions\";\n\n static description =\n \"Compile agents with resolved skill references. Compiles to the Claude plugin directory.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --verbose\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Compile);\n\n setVerbose(flags.verbose);\n\n const cwd = process.cwd();\n const homeDir = os.homedir();\n\n const globalInstallation = await detectGlobalInstallation();\n // Skip project detection when cwd is home directory to avoid double-compile\n const projectInstallation = cwd === homeDir ? null : await detectProjectInstallation(cwd);\n\n if (!globalInstallation && !projectInstallation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n await this.resolveSourceForCompile(flags);\n const agentDefs = await this.loadAgentDefsForCompile(flags);\n\n let totalPassesWithSkills = 0;\n\n if (globalInstallation) {\n const hadSkills = await this.runCompilePass({\n label: \"Global\",\n projectDir: homeDir,\n installation: globalInstallation,\n agentDefs,\n flags,\n });\n if (hadSkills) totalPassesWithSkills++;\n }\n\n if (projectInstallation) {\n const hadSkills = await this.runCompilePass({\n label: \"Project\",\n projectDir: cwd,\n installation: projectInstallation,\n agentDefs,\n flags,\n });\n if (hadSkills) totalPassesWithSkills++;\n }\n\n if (totalPassesWithSkills === 0) {\n this.error(\n `No skills found. Add skills with '${CLI_BIN_NAME} add <skill>' or create in .claude/skills/.`,\n { exit: EXIT_CODES.ERROR },\n );\n }\n }\n\n private async discoverAllSkills(projectDir: string = process.cwd()): Promise<DiscoveredSkills> {\n this.log(STATUS_MESSAGES.DISCOVERING_SKILLS);\n\n const pluginSkills = await discoverAllPluginSkills(projectDir);\n const pluginSkillCount = typedKeys<SkillId>(pluginSkills).length;\n verbose(` Found ${pluginSkillCount} skills from installed plugins`);\n\n // Load global local skills (skip if projectDir is already the home directory to avoid double-loading)\n const isGlobalProject = projectDir === GLOBAL_INSTALL_ROOT;\n const globalLocalSkillsDir = path.join(GLOBAL_INSTALL_ROOT, LOCAL_SKILLS_PATH);\n const globalLocalSkills = isGlobalProject\n ? {}\n : await loadSkillsFromDir(globalLocalSkillsDir, LOCAL_SKILLS_PATH);\n const globalLocalSkillCount = typedKeys<SkillId>(globalLocalSkills).length;\n if (globalLocalSkillCount > 0) {\n verbose(` Found ${globalLocalSkillCount} global local skills from ~/.claude/skills/`);\n }\n\n const localSkills = await discoverLocalProjectSkills(projectDir);\n const localSkillCount = typedKeys<SkillId>(localSkills).length;\n verbose(` Found ${localSkillCount} local skills from .claude/skills/`);\n\n // Global skills loaded first, project skills second — project wins on conflict (later sources override)\n const allSkills = mergeSkills(pluginSkills, globalLocalSkills, localSkills);\n const totalSkillCount = typedKeys<SkillId>(allSkills).length;\n\n if (totalSkillCount === 0) {\n return { allSkills, totalSkillCount };\n }\n\n if (pluginSkillCount > 0 && totalSkillCount > pluginSkillCount) {\n const localCount = totalSkillCount - pluginSkillCount;\n this.log(\n `Discovered ${totalSkillCount} skills (${pluginSkillCount} from plugins, ${localCount} local)`,\n );\n } else if (pluginSkillCount > 0) {\n this.log(`Discovered ${pluginSkillCount} skills from plugins`);\n } else {\n this.log(`Discovered ${totalSkillCount} local skills`);\n }\n\n return { allSkills, totalSkillCount };\n }\n\n private async runCompilePass(params: {\n label: string;\n projectDir: string;\n installation: Installation;\n agentDefs: AgentSourcePaths;\n flags: CompileFlags;\n }): Promise<boolean> {\n const { label, projectDir, installation, agentDefs, flags } = params;\n\n this.log(\"\");\n this.log(`Compiling ${label.toLowerCase()} agents...`);\n this.log(\"\");\n\n verbose(` Project: ${projectDir}`);\n verbose(` Agents: ${installation.agentsDir}`);\n\n const { allSkills, totalSkillCount } = await this.discoverAllSkills(projectDir);\n\n if (totalSkillCount === 0) {\n this.log(`No skills found for ${label.toLowerCase()} pass, skipping`);\n return false;\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileResult = await recompileAgents({\n pluginDir: projectDir,\n sourcePath: agentDefs.sourcePath,\n skills: allSkills,\n projectDir,\n outputDir: installation.agentsDir,\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `Recompiled ${recompileResult.compiled.length} ${label.toLowerCase()} agents (${recompileResult.failed.length} failed)`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`Recompiled ${recompileResult.compiled.length} ${label.toLowerCase()} agents`);\n } else {\n this.log(INFO_MESSAGES.NO_AGENTS_TO_RECOMPILE);\n }\n\n if (recompileResult.compiled.length > 0) {\n verbose(` Compiled: ${recompileResult.compiled.join(\", \")}`);\n }\n } catch (error) {\n this.log(ERROR_MESSAGES.FAILED_COMPILE_AGENTS);\n this.handleError(error);\n }\n\n this.log(\"\");\n this.logSuccess(`${label} compile complete!`);\n this.log(\"\");\n\n return true;\n }\n\n private async resolveSourceForCompile(flags: CompileFlags): Promise<void> {\n this.log(STATUS_MESSAGES.RESOLVING_SOURCE);\n try {\n const sourceConfig = await resolveSource(flags.source);\n this.log(`Source: ${sourceConfig.sourceOrigin}`);\n } catch (error) {\n this.log(ERROR_MESSAGES.FAILED_RESOLVE_SOURCE);\n this.handleError(error);\n }\n }\n\n private async loadAgentDefsForCompile(flags: CompileFlags): Promise<AgentSourcePaths> {\n const projectDir = process.cwd();\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n projectDir,\n });\n this.log(flags[\"agent-source\"] ? \"Agent partials fetched\" : \"Agent partials loaded\");\n verbose(` Agents: ${agentDefs.agentsDir}`);\n verbose(` Templates: ${agentDefs.templatesDir}`);\n return agentDefs;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AClD,aAAO,KAAK,YAAY,KAAK;AAAA,IAC/B;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/compile.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport os from \"os\";\nimport path from \"path\";\nimport { BaseCommand } from \"../base-command\";\nimport { setVerbose, verbose, warn } from \"../utils/logger\";\nimport { discoverAllPluginSkills } from \"../lib/plugins\";\nimport { getAgentDefinitions } from \"../lib/agents\";\nimport { resolveSource } from \"../lib/configuration\";\nimport { directoryExists, glob, readFile, fileExists } from \"../utils/fs\";\nimport { recompileAgents } from \"../lib/agents\";\nimport { parseFrontmatter } from \"../lib/loading\";\nimport { CLI_BIN_NAME, GLOBAL_INSTALL_ROOT, LOCAL_SKILLS_PATH, STANDARD_FILES } from \"../consts\";\nimport { EXIT_CODES } from \"../lib/exit-codes\";\nimport { ERROR_MESSAGES, STATUS_MESSAGES, INFO_MESSAGES } from \"../utils/messages\";\nimport {\n detectGlobalInstallation,\n detectProjectInstallation,\n type Installation,\n} from \"../lib/installation\";\nimport type { AgentSourcePaths, SkillDefinition, SkillDefinitionMap, SkillId } from \"../types\";\nimport { typedEntries, typedKeys } from \"../utils/typed-object\";\n\nasync function loadSkillsFromDir(skillsDir: string, pathPrefix = \"\"): Promise<SkillDefinitionMap> {\n const skills: SkillDefinitionMap = {};\n\n if (!(await directoryExists(skillsDir))) {\n return skills;\n }\n\n const skillFiles = await glob(\"**/SKILL.md\", skillsDir);\n\n for (const skillFile of skillFiles) {\n const skillPath = path.join(skillsDir, skillFile);\n const skillDir = path.dirname(skillPath);\n const relativePath = path.relative(skillsDir, skillDir);\n const skillDirName = path.basename(skillDir);\n\n const metadataPath = path.join(skillDir, STANDARD_FILES.METADATA_YAML);\n if (!(await fileExists(metadataPath))) {\n const displayPath = pathPrefix ? `${pathPrefix}/${relativePath}/` : `${relativePath}/`;\n warn(\n `Skill '${skillDirName}' in '${displayPath}' is missing ${STANDARD_FILES.METADATA_YAML} — skipped. Add ${STANDARD_FILES.METADATA_YAML} to register it with the CLI.`,\n );\n continue;\n }\n\n try {\n const content = await readFile(skillPath);\n const frontmatter = parseFrontmatter(content, skillPath);\n\n if (!frontmatter?.name) {\n warn(`Skipping skill in '${skillDirName}': missing or invalid frontmatter name`);\n continue;\n }\n\n const canonicalId = frontmatter.name;\n\n const skill: SkillDefinition = {\n id: canonicalId,\n path: pathPrefix ? `${pathPrefix}/${relativePath}/` : `${relativePath}/`,\n description: frontmatter?.description || \"\",\n };\n\n skills[canonicalId] = skill;\n verbose(` Loaded skill: ${canonicalId}`);\n } catch (error) {\n verbose(` Failed to load skill: ${skillFile} - ${error}`);\n }\n }\n\n return skills;\n}\n\nasync function discoverLocalProjectSkills(projectDir: string): Promise<SkillDefinitionMap> {\n const localSkillsDir = path.join(projectDir, LOCAL_SKILLS_PATH);\n return loadSkillsFromDir(localSkillsDir, LOCAL_SKILLS_PATH);\n}\n\n/** Later sources take precedence over earlier ones */\nfunction mergeSkills(...skillSources: SkillDefinitionMap[]): SkillDefinitionMap {\n const merged: SkillDefinitionMap = {};\n\n for (const source of skillSources) {\n for (const [id, skill] of typedEntries<SkillId, SkillDefinition | undefined>(source)) {\n if (skill) {\n merged[id] = skill;\n }\n }\n }\n\n return merged;\n}\n\ntype CompileFlags = {\n source?: string;\n \"agent-source\"?: string;\n verbose: boolean;\n};\n\ntype DiscoveredSkills = {\n allSkills: SkillDefinitionMap;\n totalSkillCount: number;\n};\n\nexport default class Compile extends BaseCommand {\n static summary = \"Compile agents using local skills and agent definitions\";\n\n static description =\n \"Compile agents with resolved skill references. Compiles to the Claude plugin directory.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --verbose\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Compile);\n\n setVerbose(flags.verbose);\n\n const cwd = process.cwd();\n const homeDir = os.homedir();\n\n const globalInstallation = await detectGlobalInstallation();\n // Skip project detection when cwd is home directory to avoid double-compile\n const projectInstallation = cwd === homeDir ? null : await detectProjectInstallation(cwd);\n\n if (!globalInstallation && !projectInstallation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n await this.resolveSourceForCompile(flags);\n const agentDefs = await this.loadAgentDefsForCompile(flags);\n\n let totalPassesWithSkills = 0;\n\n if (globalInstallation) {\n const hadSkills = await this.runCompilePass({\n label: \"Global\",\n projectDir: homeDir,\n installation: globalInstallation,\n agentDefs,\n flags,\n });\n if (hadSkills) totalPassesWithSkills++;\n }\n\n if (projectInstallation) {\n const hadSkills = await this.runCompilePass({\n label: \"Project\",\n projectDir: cwd,\n installation: projectInstallation,\n agentDefs,\n flags,\n });\n if (hadSkills) totalPassesWithSkills++;\n }\n\n if (totalPassesWithSkills === 0) {\n this.error(\n `No skills found. Add skills with '${CLI_BIN_NAME} add <skill>' or create in .claude/skills/.`,\n { exit: EXIT_CODES.ERROR },\n );\n }\n }\n\n private async discoverAllSkills(projectDir: string = process.cwd()): Promise<DiscoveredSkills> {\n this.log(STATUS_MESSAGES.DISCOVERING_SKILLS);\n\n const pluginSkills = await discoverAllPluginSkills(projectDir);\n const pluginSkillCount = typedKeys<SkillId>(pluginSkills).length;\n verbose(` Found ${pluginSkillCount} skills from installed plugins`);\n\n // Load global local skills (skip if projectDir is already the home directory to avoid double-loading)\n const isGlobalProject = projectDir === GLOBAL_INSTALL_ROOT;\n const globalLocalSkillsDir = path.join(GLOBAL_INSTALL_ROOT, LOCAL_SKILLS_PATH);\n const globalLocalSkills = isGlobalProject\n ? {}\n : await loadSkillsFromDir(globalLocalSkillsDir, LOCAL_SKILLS_PATH);\n const globalLocalSkillCount = typedKeys<SkillId>(globalLocalSkills).length;\n if (globalLocalSkillCount > 0) {\n verbose(` Found ${globalLocalSkillCount} global local skills from ~/.claude/skills/`);\n }\n\n const localSkills = await discoverLocalProjectSkills(projectDir);\n const localSkillCount = typedKeys<SkillId>(localSkills).length;\n verbose(` Found ${localSkillCount} local skills from .claude/skills/`);\n\n // Global skills loaded first, project skills second — project wins on conflict (later sources override)\n const allSkills = mergeSkills(pluginSkills, globalLocalSkills, localSkills);\n const totalSkillCount = typedKeys<SkillId>(allSkills).length;\n\n if (totalSkillCount === 0) {\n return { allSkills, totalSkillCount };\n }\n\n if (pluginSkillCount > 0 && totalSkillCount > pluginSkillCount) {\n const localCount = totalSkillCount - pluginSkillCount;\n this.log(\n `Discovered ${totalSkillCount} skills (${pluginSkillCount} from plugins, ${localCount} local)`,\n );\n } else if (pluginSkillCount > 0) {\n this.log(`Discovered ${pluginSkillCount} skills from plugins`);\n } else {\n this.log(`Discovered ${totalSkillCount} local skills`);\n }\n\n return { allSkills, totalSkillCount };\n }\n\n private async runCompilePass(params: {\n label: string;\n projectDir: string;\n installation: Installation;\n agentDefs: AgentSourcePaths;\n flags: CompileFlags;\n }): Promise<boolean> {\n const { label, projectDir, installation, agentDefs, flags } = params;\n\n this.log(\"\");\n this.log(`Compiling ${label.toLowerCase()} agents...`);\n this.log(\"\");\n\n verbose(` Project: ${projectDir}`);\n verbose(` Agents: ${installation.agentsDir}`);\n\n const { allSkills, totalSkillCount } = await this.discoverAllSkills(projectDir);\n\n if (totalSkillCount === 0) {\n this.log(`No skills found for ${label.toLowerCase()} pass, skipping`);\n return false;\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileResult = await recompileAgents({\n pluginDir: projectDir,\n sourcePath: agentDefs.sourcePath,\n skills: allSkills,\n projectDir,\n outputDir: installation.agentsDir,\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `Recompiled ${recompileResult.compiled.length} ${label.toLowerCase()} agents (${recompileResult.failed.length} failed)`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`Recompiled ${recompileResult.compiled.length} ${label.toLowerCase()} agents`);\n } else {\n this.log(INFO_MESSAGES.NO_AGENTS_TO_RECOMPILE);\n }\n\n if (recompileResult.compiled.length > 0) {\n verbose(` Compiled: ${recompileResult.compiled.join(\", \")}`);\n }\n } catch (error) {\n this.log(ERROR_MESSAGES.FAILED_COMPILE_AGENTS);\n this.handleError(error);\n }\n\n this.log(\"\");\n this.logSuccess(`${label} compile complete!`);\n this.log(\"\");\n\n return true;\n }\n\n private async resolveSourceForCompile(flags: CompileFlags): Promise<void> {\n this.log(STATUS_MESSAGES.RESOLVING_SOURCE);\n try {\n const sourceConfig = await resolveSource(flags.source);\n this.log(`Source: ${sourceConfig.sourceOrigin}`);\n } catch (error) {\n this.log(ERROR_MESSAGES.FAILED_RESOLVE_SOURCE);\n this.handleError(error);\n }\n }\n\n private async loadAgentDefsForCompile(flags: CompileFlags): Promise<AgentSourcePaths> {\n const projectDir = process.cwd();\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n projectDir,\n });\n this.log(flags[\"agent-source\"] ? \"Agent partials fetched\" : \"Agent partials loaded\");\n verbose(` Agents: ${agentDefs.agentsDir}`);\n verbose(` Templates: ${agentDefs.templatesDir}`);\n return agentDefs;\n } catch (error) {\n this.log(ERROR_MESSAGES.FAILED_LOAD_AGENT_PARTIALS);\n return this.handleError(error);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,aAAa;AACtB,OAAO,QAAQ;AACf,OAAO,UAAU;AAoBjB,eAAe,kBAAkB,WAAmB,aAAa,IAAiC;AAChG,QAAM,SAA6B,CAAC;AAEpC,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SAAS,KAAK,IAAI,CAAC,EAAE;AAAA,MAC9D;AAAA,IACF,SAAS,OAAO;AACd,WAAK,IAAI,eAAe,qBAAqB;AAC7C,WAAK,YAAY,KAAK;AAAA,IACxB;AAEA,SAAK,IAAI,EAAE;AACX,SAAK,WAAW,GAAG,KAAK,oBAAoB;AAC5C,SAAK,IAAI,EAAE;AAEX,WAAO;AAAA,EACT;AAAA,EAEA,MAAc,wBAAwB,OAAoC;AACxE,SAAK,IAAI,gBAAgB,gBAAgB;AACzC,QAAI;AACF,YAAM,eAAe,MAAM,cAAc,MAAM,MAAM;AACrD,WAAK,IAAI,WAAW,aAAa,YAAY,EAAE;AAAA,IACjD,SAAS,OAAO;AACd,WAAK,IAAI,eAAe,qBAAqB;AAC7C,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF;AAAA,EAEA,MAAc,wBAAwB,OAAgD;AACpF,UAAM,aAAa,QAAQ,IAAI;AAC/B,SAAK;AAAA,MACH,MAAM,cAAc,IAChB,gBAAgB,0BAChB,gBAAgB;AAAA,IACtB;AAEA,QAAI;AACF,YAAM,YAAY,MAAM,oBAAoB,MAAM,cAAc,GAAG;AAAA,QACjE;AAAA,MACF,CAAC;AACD,WAAK,IAAI,MAAM,cAAc,IAAI,2BAA2B,uBAAuB;AACnF,cAAQ,aAAa,UAAU,SAAS,EAAE;AAC1C,cAAQ,gBAAgB,UAAU,YAAY,EAAE;AAChD,aAAO;AAAA,IACT,SAAS,OAAO;AACd,WAAK,IAAI,eAAe,0BAA0B;AAClD,aAAO,KAAK,YAAY,KAAK;AAAA,IAC/B;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigShow
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-HIVZDWJC.js";
|
|
5
|
+
import "../../chunk-UKYWXIDT.js";
|
|
6
6
|
import "../../chunk-RRBWNEG3.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-4OBRPE6A.js";
|
|
7
|
+
import "../../chunk-NG2GGK6P.js";
|
|
9
8
|
import "../../chunk-IJLAVOKZ.js";
|
|
10
9
|
import "../../chunk-4CRWKTNQ.js";
|
|
11
10
|
import "../../chunk-SRIH4U5Y.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/config/index.ts"],"sourcesContent":["import ConfigShow from \"./show.js\";\n\nexport default class Config extends ConfigShow {\n static summary = \"Show current effective configuration\";\n static description =\n \"Display the current effective configuration with all layers (env, project, default)\";\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/config/index.ts"],"sourcesContent":["import ConfigShow from \"./show.js\";\n\nexport default class Config extends ConfigShow {\n static summary = \"Show current effective configuration\";\n static description =\n \"Display the current effective configuration with all layers (env, project, default)\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAEA,IAAqB,SAArB,cAAoC,WAAW;AAAA,EAC7C,OAAO,UAAU;AAAA,EACjB,OAAO,cACL;AACJ;","names":[]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getProjectConfigPath
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-UKYWXIDT.js";
|
|
5
5
|
import "../../chunk-RRBWNEG3.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-4OBRPE6A.js";
|
|
6
|
+
import "../../chunk-NG2GGK6P.js";
|
|
8
7
|
import {
|
|
9
8
|
BaseCommand
|
|
10
9
|
} from "../../chunk-IJLAVOKZ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/config/path.ts"],"sourcesContent":["import { BaseCommand } from \"../../base-command.js\";\nimport { getProjectConfigPath } from \"../../lib/configuration/index.js\";\n\nexport default class ConfigPath extends BaseCommand {\n static summary = \"Show configuration file paths\";\n static description = \"Display the file path for the project configuration file\";\n\n static flags = {\n ...BaseCommand.baseFlags,\n };\n\n async run(): Promise<void> {\n await this.parse(ConfigPath);\n\n const projectDir = process.cwd();\n\n this.log(\"\\nConfiguration File Paths:\\n\");\n this.log(`Project: ${getProjectConfigPath(projectDir)}`);\n this.log(\"\");\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/config/path.ts"],"sourcesContent":["import { BaseCommand } from \"../../base-command.js\";\nimport { getProjectConfigPath } from \"../../lib/configuration/index.js\";\n\nexport default class ConfigPath extends BaseCommand {\n static summary = \"Show configuration file paths\";\n static description = \"Display the file path for the project configuration file\";\n\n static flags = {\n ...BaseCommand.baseFlags,\n };\n\n async run(): Promise<void> {\n await this.parse(ConfigPath);\n\n const projectDir = process.cwd();\n\n this.log(\"\\nConfiguration File Paths:\\n\");\n this.log(`Project: ${getProjectConfigPath(projectDir)}`);\n this.log(\"\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAGA,IAAqB,aAArB,MAAqB,oBAAmB,YAAY;AAAA,EAClD,OAAO,UAAU;AAAA,EACjB,OAAO,cAAc;AAAA,EAErB,OAAO,QAAQ;AAAA,IACb,GAAG,YAAY;AAAA,EACjB;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,KAAK,MAAM,WAAU;AAE3B,UAAM,aAAa,QAAQ,IAAI;AAE/B,SAAK,IAAI,+BAA+B;AACxC,SAAK,IAAI,YAAY,qBAAqB,UAAU,CAAC,EAAE;AACvD,SAAK,IAAI,EAAE;AAAA,EACb;AACF;","names":[]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigShow
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-HIVZDWJC.js";
|
|
5
|
+
import "../../chunk-UKYWXIDT.js";
|
|
6
6
|
import "../../chunk-RRBWNEG3.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-4OBRPE6A.js";
|
|
7
|
+
import "../../chunk-NG2GGK6P.js";
|
|
9
8
|
import "../../chunk-IJLAVOKZ.js";
|
|
10
9
|
import "../../chunk-4CRWKTNQ.js";
|
|
11
10
|
import "../../chunk-SRIH4U5Y.js";
|
package/dist/commands/diff.js
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
loadSkillsMatrixFromSource,
|
|
4
4
|
readForkedFromMetadata
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-UKYWXIDT.js";
|
|
6
6
|
import "../chunk-RRBWNEG3.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-4OBRPE6A.js";
|
|
7
|
+
import "../chunk-NG2GGK6P.js";
|
|
9
8
|
import {
|
|
10
9
|
BaseCommand,
|
|
11
10
|
EXIT_CODES
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/diff.ts","../../node_modules/chalk/source/index.js","../../node_modules/chalk/source/vendor/ansi-styles/index.js","../../node_modules/chalk/source/vendor/supports-color/index.js","../../node_modules/chalk/source/utilities.js"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport chalk from \"chalk\";\nimport path from \"path\";\nimport { createTwoFilesPatch } from \"diff\";\nimport { BaseCommand } from \"../base-command.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { readForkedFromMetadata, type ForkedFromMetadata } from \"../lib/skills/index.js\";\nimport { fileExists, readFile, listDirectories } from \"../utils/fs.js\";\nimport { CLI_BIN_NAME, LOCAL_SKILLS_PATH, STANDARD_FILES } from \"../consts.js\";\n\ntype SkillDiffResult = {\n skillDirName: string;\n forkedFrom: ForkedFromMetadata | null;\n hasDiff: boolean;\n diffOutput: string;\n};\n\nfunction colorDiff(diffText: string): string {\n return diffText\n .split(\"\\n\")\n .map((line) => {\n if (line.startsWith(\"+++\") || line.startsWith(\"---\")) {\n return chalk.bold(line);\n }\n if (line.startsWith(\"+\")) {\n return chalk.green(line);\n }\n if (line.startsWith(\"-\")) {\n return chalk.red(line);\n }\n if (line.startsWith(\"@@\")) {\n return chalk.cyan(line);\n }\n return line;\n })\n .join(\"\\n\");\n}\n\nasync function diffSkill(\n localSkillsPath: string,\n skillDirName: string,\n sourcePath: string,\n sourceSkills: Record<string, { path: string }>,\n): Promise<SkillDiffResult> {\n const skillDir = path.join(localSkillsPath, skillDirName);\n const forkedFrom = await readForkedFromMetadata(skillDir);\n\n if (!forkedFrom) {\n return {\n skillDirName,\n forkedFrom: null,\n hasDiff: false,\n diffOutput: \"\",\n };\n }\n\n const sourceSkill = sourceSkills[forkedFrom.skillId];\n\n if (!sourceSkill) {\n return {\n skillDirName,\n forkedFrom,\n hasDiff: false,\n diffOutput: `Source skill '${forkedFrom.skillId}' no longer exists`,\n };\n }\n\n const sourceSkillMdPath = path.join(sourcePath, \"src\", sourceSkill.path, STANDARD_FILES.SKILL_MD);\n\n if (!(await fileExists(sourceSkillMdPath))) {\n return {\n skillDirName,\n forkedFrom,\n hasDiff: false,\n diffOutput: `Source ${STANDARD_FILES.SKILL_MD} not found at ${sourceSkillMdPath}`,\n };\n }\n\n const sourceContent = await readFile(sourceSkillMdPath);\n\n const localSkillMdPath = path.join(skillDir, STANDARD_FILES.SKILL_MD);\n\n if (!(await fileExists(localSkillMdPath))) {\n return {\n skillDirName,\n forkedFrom,\n hasDiff: false,\n diffOutput: `Local ${STANDARD_FILES.SKILL_MD} not found at ${localSkillMdPath}`,\n };\n }\n\n const localContent = await readFile(localSkillMdPath);\n\n const sourceLabel = `source/${sourceSkill.path}/SKILL.md`;\n const localLabel = `local/${LOCAL_SKILLS_PATH}/${skillDirName}/SKILL.md`;\n\n const diff = createTwoFilesPatch(\n sourceLabel,\n localLabel,\n sourceContent,\n localContent,\n \"\", // No source header\n \"\", // No local header\n );\n\n const hasDiff = diff.split(\"\\n\").some((line) => {\n return (\n (line.startsWith(\"+\") || line.startsWith(\"-\")) &&\n !line.startsWith(\"+++\") &&\n !line.startsWith(\"---\")\n );\n });\n\n return {\n skillDirName,\n forkedFrom,\n hasDiff,\n diffOutput: diff,\n };\n}\n\nexport default class Diff extends BaseCommand {\n static summary = \"Show differences between local forked skills and their source versions\";\n static description =\n \"Compare local forked skills with their source versions and display differences using unified diff format with colored output\";\n\n static examples = [\n {\n description: \"Show diffs for all forked skills\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Show diff for a specific skill\",\n command: \"<%= config.bin %> <%= command.id %> my-skill\",\n },\n {\n description: \"Check for diffs without output (exit code only)\",\n command: \"<%= config.bin %> <%= command.id %> --quiet\",\n },\n ];\n\n static args = {\n skill: Args.string({\n description: \"Show diff for specific skill only\",\n required: false,\n }),\n };\n\n static flags = {\n ...BaseCommand.baseFlags,\n quiet: Flags.boolean({\n char: \"q\",\n description: \"Suppress output, only return exit code\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Diff);\n const projectDir = process.cwd();\n const localSkillsPath = path.join(projectDir, LOCAL_SKILLS_PATH);\n\n if (!(await fileExists(localSkillsPath))) {\n if (!flags.quiet) {\n this.warn(\n `No local skills found. Run '${CLI_BIN_NAME} init' or '${CLI_BIN_NAME} edit' first.`,\n );\n }\n return;\n }\n\n try {\n if (!flags.quiet) {\n this.log(\"Loading skills...\");\n }\n\n const { matrix, sourcePath, isLocal } = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n });\n\n if (!flags.quiet) {\n this.log(chalk.dim(`Loaded from ${isLocal ? \"local\" : \"remote\"}: ${sourcePath}`));\n }\n\n const sourceSkills: Record<string, { path: string }> = {};\n for (const [skillId, skill] of Object.entries(matrix.skills)) {\n if (!skill) continue;\n if (!skill.local) {\n sourceSkills[skillId] = { path: skill.path };\n }\n }\n\n let skillDirs = await listDirectories(localSkillsPath);\n\n if (args.skill) {\n skillDirs = skillDirs.filter((dir) => dir === args.skill);\n if (skillDirs.length === 0) {\n if (!flags.quiet) {\n this.error(`Skill '${args.skill}' not found in local skills`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n }\n\n const results: SkillDiffResult[] = [];\n const skillsWithoutForkedFrom: string[] = [];\n\n for (const skillDirName of skillDirs) {\n const result = await diffSkill(localSkillsPath, skillDirName, sourcePath, sourceSkills);\n results.push(result);\n\n if (!result.forkedFrom) {\n skillsWithoutForkedFrom.push(skillDirName);\n }\n }\n\n const skillsWithDiffs = results.filter((r) => r.hasDiff);\n\n if (!flags.quiet) {\n this.log(\"\");\n\n if (skillsWithoutForkedFrom.length > 0) {\n for (const skillName of skillsWithoutForkedFrom) {\n this.warn(`Skill '${skillName}' has no forkedFrom metadata - cannot compare`);\n }\n this.log(\"\");\n }\n\n const forkedSkills = results.filter((r) => r.forkedFrom);\n\n if (forkedSkills.length === 0) {\n this.logInfo(\"No forked skills to compare.\");\n } else if (skillsWithDiffs.length === 0) {\n this.logSuccess(`All ${forkedSkills.length} forked skill(s) are up to date with source.`);\n } else {\n for (const result of skillsWithDiffs) {\n this.log(\n chalk.bold(\n `\\n=== ${result.skillDirName} (forked from ${result.forkedFrom?.skillId}) ===\\n`,\n ),\n );\n this.log(colorDiff(result.diffOutput));\n }\n\n this.log(\"\");\n this.logInfo(\n `Found differences in ${chalk.yellow(String(skillsWithDiffs.length))} skill(s).`,\n );\n }\n\n this.log(\"\");\n }\n\n if (skillsWithDiffs.length > 0) {\n this.exit(EXIT_CODES.ERROR);\n }\n this.exit(EXIT_CODES.SUCCESS);\n } catch (error) {\n if (!flags.quiet) {\n const message = getErrorMessage(error);\n this.error(`Failed to compare skills: ${message}`, {\n exit: EXIT_CODES.ERROR,\n });\n } else {\n this.exit(EXIT_CODES.ERROR);\n }\n }\n }\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,MAAM,aAAa;;;ACA5B;;;ACAA;AAAA,IAAM,yB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K;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AACF;","names":["process","styles","chalk","styles"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/diff.ts","../../node_modules/chalk/source/index.js","../../node_modules/chalk/source/vendor/ansi-styles/index.js","../../node_modules/chalk/source/vendor/supports-color/index.js","../../node_modules/chalk/source/utilities.js"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport chalk from \"chalk\";\nimport path from \"path\";\nimport { createTwoFilesPatch } from \"diff\";\nimport { BaseCommand } from \"../base-command.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { readForkedFromMetadata, type ForkedFromMetadata } from \"../lib/skills/index.js\";\nimport { fileExists, readFile, listDirectories } from \"../utils/fs.js\";\nimport { CLI_BIN_NAME, LOCAL_SKILLS_PATH, STANDARD_FILES } from \"../consts.js\";\n\ntype SkillDiffResult = {\n skillDirName: string;\n forkedFrom: ForkedFromMetadata | null;\n hasDiff: boolean;\n diffOutput: string;\n};\n\nfunction colorDiff(diffText: string): string {\n return diffText\n .split(\"\\n\")\n .map((line) => {\n if (line.startsWith(\"+++\") || line.startsWith(\"---\")) {\n return chalk.bold(line);\n }\n if (line.startsWith(\"+\")) {\n return chalk.green(line);\n }\n if (line.startsWith(\"-\")) {\n return chalk.red(line);\n }\n if (line.startsWith(\"@@\")) {\n return chalk.cyan(line);\n }\n return line;\n })\n .join(\"\\n\");\n}\n\nasync function diffSkill(\n localSkillsPath: string,\n skillDirName: string,\n sourcePath: string,\n sourceSkills: Record<string, { path: string }>,\n): Promise<SkillDiffResult> {\n const skillDir = path.join(localSkillsPath, skillDirName);\n const forkedFrom = await readForkedFromMetadata(skillDir);\n\n if (!forkedFrom) {\n return {\n skillDirName,\n forkedFrom: null,\n hasDiff: false,\n diffOutput: \"\",\n };\n }\n\n const sourceSkill = sourceSkills[forkedFrom.skillId];\n\n if (!sourceSkill) {\n return {\n skillDirName,\n forkedFrom,\n hasDiff: false,\n diffOutput: `Source skill '${forkedFrom.skillId}' no longer exists`,\n };\n }\n\n const sourceSkillMdPath = path.join(sourcePath, \"src\", sourceSkill.path, STANDARD_FILES.SKILL_MD);\n\n if (!(await fileExists(sourceSkillMdPath))) {\n return {\n skillDirName,\n forkedFrom,\n hasDiff: false,\n diffOutput: `Source ${STANDARD_FILES.SKILL_MD} not found at ${sourceSkillMdPath}`,\n };\n }\n\n const sourceContent = await readFile(sourceSkillMdPath);\n\n const localSkillMdPath = path.join(skillDir, STANDARD_FILES.SKILL_MD);\n\n if (!(await fileExists(localSkillMdPath))) {\n return {\n skillDirName,\n forkedFrom,\n hasDiff: false,\n diffOutput: `Local ${STANDARD_FILES.SKILL_MD} not found at ${localSkillMdPath}`,\n };\n }\n\n const localContent = await readFile(localSkillMdPath);\n\n const sourceLabel = `source/${sourceSkill.path}/SKILL.md`;\n const localLabel = `local/${LOCAL_SKILLS_PATH}/${skillDirName}/SKILL.md`;\n\n const diff = createTwoFilesPatch(\n sourceLabel,\n localLabel,\n sourceContent,\n localContent,\n \"\", // No source header\n \"\", // No local header\n );\n\n const hasDiff = diff.split(\"\\n\").some((line) => {\n return (\n (line.startsWith(\"+\") || line.startsWith(\"-\")) &&\n !line.startsWith(\"+++\") &&\n !line.startsWith(\"---\")\n );\n });\n\n return {\n skillDirName,\n forkedFrom,\n hasDiff,\n diffOutput: diff,\n };\n}\n\nexport default class Diff extends BaseCommand {\n static summary = \"Show differences between local forked skills and their source versions\";\n static description =\n \"Compare local forked skills with their source versions and display differences using unified diff format with colored output\";\n\n static examples = [\n {\n description: \"Show diffs for all forked skills\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Show diff for a specific skill\",\n command: \"<%= config.bin %> <%= command.id %> my-skill\",\n },\n {\n description: \"Check for diffs without output (exit code only)\",\n command: \"<%= config.bin %> <%= command.id %> --quiet\",\n },\n ];\n\n static args = {\n skill: Args.string({\n description: \"Show diff for specific skill only\",\n required: false,\n }),\n };\n\n static flags = {\n ...BaseCommand.baseFlags,\n quiet: Flags.boolean({\n char: \"q\",\n description: \"Suppress output, only return exit code\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Diff);\n const projectDir = process.cwd();\n const localSkillsPath = path.join(projectDir, LOCAL_SKILLS_PATH);\n\n if (!(await fileExists(localSkillsPath))) {\n if (!flags.quiet) {\n this.warn(\n `No local skills found. Run '${CLI_BIN_NAME} init' or '${CLI_BIN_NAME} edit' first.`,\n );\n }\n return;\n }\n\n try {\n if (!flags.quiet) {\n this.log(\"Loading skills...\");\n }\n\n const { matrix, sourcePath, isLocal } = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n });\n\n if (!flags.quiet) {\n this.log(chalk.dim(`Loaded from ${isLocal ? \"local\" : \"remote\"}: ${sourcePath}`));\n }\n\n const sourceSkills: Record<string, { path: string }> = {};\n for (const [skillId, skill] of Object.entries(matrix.skills)) {\n if (!skill) continue;\n if (!skill.local) {\n sourceSkills[skillId] = { path: skill.path };\n }\n }\n\n let skillDirs = await listDirectories(localSkillsPath);\n\n if (args.skill) {\n skillDirs = skillDirs.filter((dir) => dir === args.skill);\n if (skillDirs.length === 0) {\n if (!flags.quiet) {\n this.error(`Skill '${args.skill}' not found in local skills`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n }\n\n const results: SkillDiffResult[] = [];\n const skillsWithoutForkedFrom: string[] = [];\n\n for (const skillDirName of skillDirs) {\n const result = await diffSkill(localSkillsPath, skillDirName, sourcePath, sourceSkills);\n results.push(result);\n\n if (!result.forkedFrom) {\n skillsWithoutForkedFrom.push(skillDirName);\n }\n }\n\n const skillsWithDiffs = results.filter((r) => r.hasDiff);\n\n if (!flags.quiet) {\n this.log(\"\");\n\n if (skillsWithoutForkedFrom.length > 0) {\n for (const skillName of skillsWithoutForkedFrom) {\n this.warn(`Skill '${skillName}' has no forkedFrom metadata - cannot compare`);\n }\n this.log(\"\");\n }\n\n const forkedSkills = results.filter((r) => r.forkedFrom);\n\n if (forkedSkills.length === 0) {\n this.logInfo(\"No forked skills to compare.\");\n } else if (skillsWithDiffs.length === 0) {\n this.logSuccess(`All ${forkedSkills.length} forked skill(s) are up to date with source.`);\n } else {\n for (const result of skillsWithDiffs) {\n this.log(\n chalk.bold(\n `\\n=== ${result.skillDirName} (forked from ${result.forkedFrom?.skillId}) ===\\n`,\n ),\n );\n this.log(colorDiff(result.diffOutput));\n }\n\n this.log(\"\");\n this.logInfo(\n `Found differences in ${chalk.yellow(String(skillsWithDiffs.length))} skill(s).`,\n );\n }\n\n this.log(\"\");\n }\n\n if (skillsWithDiffs.length > 0) {\n this.exit(EXIT_CODES.ERROR);\n }\n this.exit(EXIT_CODES.SUCCESS);\n } catch (error) {\n if (!flags.quiet) {\n const message = getErrorMessage(error);\n this.error(`Failed to compare skills: ${message}`, {\n exit: EXIT_CODES.ERROR,\n });\n } else {\n this.exit(EXIT_CODES.ERROR);\n }\n }\n }\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,MAAM,aAAa;;;ACA5B;;;ACAA;AAAA,IAAM,yBAAyB;AAE/B,IAAM,aAAa,CAAC,SAAS,MAAM,UAAQ,QAAU,OAAO,MAAM;AAElE,IAAM,cAAc,CAAC,SAAS,MAAM,UAAQ,QAAU,KAAK,MAAM,MAAM,IAAI;AAE3E,IAAM,cAAc,CAAC,SAAS,MAAM,CAAC,KAAK,OAAO,SAAS,QAAU,KAAK,MAAM,MAAM,GAAG,IAAI,KAAK,IAAI,IAAI;AAEzG,IAAM,SAAS;AAAA,EACd,UAAU;AAAA,IACT,OAAO,CAAC,GAAG,CAAC;AAAA;AAAA,IAEZ,MAAM,CAAC,GAAG,EAAE;AAAA,IACZ,KAAK,CAAC,GAAG,EAAE;AAAA,IACX,QAAQ,CAAC,GAAG,EAAE;AAAA,IACd,WAAW,CAAC,GAAG,EAAE;AAAA,IACjB,UAAU,CAAC,IAAI,EAAE;AAAA,IACjB,SAAS,CAAC,GAAG,EAAE;AAAA,IACf,QAAQ,CAAC,GAAG,EAAE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C,iBAAK;AAAA,cACH,eAAM;AAAA,gBACJ;AAAA,MAAS,OAAO,YAAY,iBAAiB,OAAO,YAAY,OAAO;AAAA;AAAA,cACzE;AAAA,YACF;AACA,iBAAK,IAAI,UAAU,OAAO,UAAU,CAAC;AAAA,UACvC;AAEA,eAAK,IAAI,EAAE;AACX,eAAK;AAAA,YACH,wBAAwB,eAAM,OAAO,OAAO,gBAAgB,MAAM,CAAC,CAAC;AAAA,UACtE;AAAA,QACF;AAEA,aAAK,IAAI,EAAE;AAAA,MACb;AAEA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,aAAK,KAAK,WAAW,KAAK;AAAA,MAC5B;AACA,WAAK,KAAK,WAAW,OAAO;AAAA,IAC9B,SAAS,OAAO;AACd,UAAI,CAAC,MAAM,OAAO;AAChB,cAAM,UAAU,gBAAgB,KAAK;AACrC,aAAK,MAAM,6BAA6B,OAAO,IAAI;AAAA,UACjD,MAAM,WAAW;AAAA,QACnB,CAAC;AAAA,MACH,OAAO;AACL,aAAK,KAAK,WAAW,KAAK;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AACF;","names":["process","styles","chalk","styles"]}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -5,12 +5,11 @@ import {
|
|
|
5
5
|
loadProjectConfig,
|
|
6
6
|
loadSkillsMatrixFromSource,
|
|
7
7
|
validateProjectConfig
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-UKYWXIDT.js";
|
|
9
9
|
import "../chunk-RRBWNEG3.js";
|
|
10
|
-
import "../chunk-XXK6MFOA.js";
|
|
11
10
|
import {
|
|
12
11
|
matrix
|
|
13
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-NG2GGK6P.js";
|
|
14
13
|
import {
|
|
15
14
|
BaseCommand,
|
|
16
15
|
EXIT_CODES
|