@lousy-agents/cli 4.0.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @lousy-agents/cli
2
+
3
+ CLI scaffolding for Lousy Agents.
4
+
5
+ Use this package to bootstrap new projects with testing, linting, AI assistant instructions, and GitHub Copilot setup.
6
+
7
+ ## Quick Start
8
+
9
+ ```bash
10
+ npx @lousy-agents/cli init
11
+ ```
12
+
13
+ Common follow-up commands:
14
+
15
+ ```bash
16
+ # Generate Copilot setup workflow in an existing repository
17
+ npx @lousy-agents/cli copilot-setup
18
+
19
+ # Create new resources such as custom agents
20
+ npx @lousy-agents/cli new
21
+
22
+ # Validate skills, agents, and instruction files
23
+ npx @lousy-agents/cli lint
24
+ ```
25
+
26
+ ## Documentation
27
+
28
+ - Project overview: [README](https://github.com/zpratt/lousy-agents#readme)
29
+ - `init` command: [`docs/init.md`](https://github.com/zpratt/lousy-agents/blob/main/docs/init.md)
30
+ - `new` command: [`docs/new.md`](https://github.com/zpratt/lousy-agents/blob/main/docs/new.md)
31
+ - `lint` command: [`docs/lint.md`](https://github.com/zpratt/lousy-agents/blob/main/docs/lint.md)
32
+ - `copilot-setup` command: [`docs/copilot-setup.md`](https://github.com/zpratt/lousy-agents/blob/main/docs/copilot-setup.md)
33
+
34
+ ## Reference Examples
35
+
36
+ - React webapp scaffold: [`packages/cli/ui/copilot-with-react`](https://github.com/zpratt/lousy-agents/tree/main/packages/cli/ui/copilot-with-react)
37
+ - Fastify API scaffold: [`packages/cli/api/copilot-with-fastify`](https://github.com/zpratt/lousy-agents/tree/main/packages/cli/api/copilot-with-fastify)
38
+ - Citty CLI scaffold: [`packages/cli/cli/copilot-with-citty`](https://github.com/zpratt/lousy-agents/tree/main/packages/cli/cli/copilot-with-citty)
@@ -13,7 +13,7 @@
13
13
  "lousy-agents": {
14
14
  "type": "stdio",
15
15
  "command": "npx",
16
- "args": ["-y", "-p", "@lousy-agents/cli", "lousy-agents-mcp"]
16
+ "args": ["-y", "-p", "@lousy-agents/mcp", "lousy-agents-mcp"]
17
17
  }
18
18
  }
19
19
  }
@@ -13,7 +13,7 @@
13
13
  "lousy-agents": {
14
14
  "type": "stdio",
15
15
  "command": "npx",
16
- "args": ["-y", "-p", "@lousy-agents/cli", "lousy-agents-mcp"]
16
+ "args": ["-y", "-p", "@lousy-agents/mcp", "lousy-agents-mcp"]
17
17
  }
18
18
  }
19
19
  }
package/dist/index.js CHANGED
@@ -55810,6 +55810,84 @@ const remark = unified().use(remarkParse).use(remarkStringify).freeze()
55810
55810
  }
55811
55811
  }
55812
55812
 
55813
+ ;// CONCATENATED MODULE: ../core/src/use-cases/apply-severity-filter.ts
55814
+ /**
55815
+ * Shared severity filtering for lint outputs.
55816
+ * Applies rule severity configuration to diagnostics, filtering out "off" rules,
55817
+ * remapping "warn" → "warning", and recalculating summary counts.
55818
+ */ /** Maps a lint target to its config key */ const TARGET_TO_CONFIG_KEY = {
55819
+ skill: "skills",
55820
+ agent: "agents",
55821
+ instruction: "instructions"
55822
+ };
55823
+ /**
55824
+ * Maps config severity to diagnostic severity.
55825
+ * "warn" → "warning", "error" → "error", "off" → null (drop).
55826
+ */ function apply_severity_filter_mapSeverity(configSeverity) {
55827
+ if (configSeverity === "off") {
55828
+ return null;
55829
+ }
55830
+ if (configSeverity === "warn") {
55831
+ return "warning";
55832
+ }
55833
+ return configSeverity;
55834
+ }
55835
+ /**
55836
+ * Filters instruction suggestions based on rule severity configuration.
55837
+ * Drops suggestions whose corresponding rule is "off".
55838
+ * Suggestions without a ruleId pass through unchanged.
55839
+ */ function filterInstructionSuggestions(suggestions, rules) {
55840
+ return suggestions.filter((suggestion)=>{
55841
+ if (!suggestion.ruleId) {
55842
+ return true;
55843
+ }
55844
+ return rules[suggestion.ruleId] !== "off";
55845
+ });
55846
+ }
55847
+ /**
55848
+ * Applies severity filtering to a LintOutput based on rule configuration.
55849
+ * Drops diagnostics for "off" rules, remaps severity for "warn"/"error" rules.
55850
+ * Diagnostics without a ruleId pass through unchanged.
55851
+ * For instruction targets, also filters qualityResult.suggestions.
55852
+ */ function applySeverityFilter(output, rulesConfig) {
55853
+ const configKey = TARGET_TO_CONFIG_KEY[output.target];
55854
+ const targetRules = rulesConfig[configKey];
55855
+ const filteredDiagnostics = [];
55856
+ for (const diagnostic of output.diagnostics){
55857
+ const configuredSeverity = diagnostic.ruleId ? targetRules[diagnostic.ruleId] : undefined;
55858
+ if (!configuredSeverity) {
55859
+ filteredDiagnostics.push(diagnostic);
55860
+ continue;
55861
+ }
55862
+ const mappedSeverity = apply_severity_filter_mapSeverity(configuredSeverity);
55863
+ if (mappedSeverity === null) {
55864
+ continue;
55865
+ }
55866
+ filteredDiagnostics.push({
55867
+ ...diagnostic,
55868
+ severity: mappedSeverity
55869
+ });
55870
+ }
55871
+ const totalErrors = filteredDiagnostics.filter((d)=>d.severity === "error").length;
55872
+ const totalWarnings = filteredDiagnostics.filter((d)=>d.severity === "warning").length;
55873
+ const totalInfos = filteredDiagnostics.filter((d)=>d.severity === "info").length;
55874
+ const filteredQualityResult = output.qualityResult && configKey === "instructions" ? {
55875
+ ...output.qualityResult,
55876
+ suggestions: filterInstructionSuggestions(output.qualityResult.suggestions, targetRules)
55877
+ } : output.qualityResult;
55878
+ return {
55879
+ ...output,
55880
+ diagnostics: filteredDiagnostics,
55881
+ qualityResult: filteredQualityResult,
55882
+ summary: {
55883
+ ...output.summary,
55884
+ totalErrors,
55885
+ totalWarnings,
55886
+ totalInfos
55887
+ }
55888
+ };
55889
+ }
55890
+
55813
55891
  ;// CONCATENATED MODULE: ../core/src/use-cases/lint-agent-frontmatter.ts
55814
55892
  /**
55815
55893
  * Use case for linting GitHub Copilot custom agent frontmatter.
@@ -56111,6 +56189,7 @@ function hasFrontmatterDelimiters(content) {
56111
56189
 
56112
56190
 
56113
56191
 
56192
+
56114
56193
  /** Schema for validating target directory */ const TargetDirSchema = schemas_string().min(1, "Target directory is required");
56115
56194
  /**
56116
56195
  * Validates the target directory.
@@ -56275,78 +56354,6 @@ function hasFrontmatterDelimiters(content) {
56275
56354
  consola.warn(suggestion.message);
56276
56355
  }
56277
56356
  }
56278
- /** Maps a lint target to its config key */ const TARGET_TO_CONFIG_KEY = {
56279
- skill: "skills",
56280
- agent: "agents",
56281
- instruction: "instructions"
56282
- };
56283
- /**
56284
- * Maps config-facing severity to diagnostic-facing severity.
56285
- * "warn" → "warning", "error" → "error", "off" → null (drop).
56286
- */ function lint_mapSeverity(configSeverity) {
56287
- if (configSeverity === "off") {
56288
- return null;
56289
- }
56290
- if (configSeverity === "warn") {
56291
- return "warning";
56292
- }
56293
- return configSeverity;
56294
- }
56295
- /**
56296
- * Filters instruction suggestions based on rule severity configuration.
56297
- * Drops suggestions whose corresponding rule is "off".
56298
- * Suggestions without a ruleId pass through unchanged.
56299
- */ function filterInstructionSuggestions(suggestions, rules) {
56300
- return suggestions.filter((suggestion)=>{
56301
- if (!suggestion.ruleId) {
56302
- return true;
56303
- }
56304
- return rules[suggestion.ruleId] !== "off";
56305
- });
56306
- }
56307
- /**
56308
- * Applies severity filtering to a LintOutput based on rule configuration.
56309
- * Drops diagnostics for "off" rules, remaps severity for "warn"/"error" rules.
56310
- * Diagnostics without a ruleId pass through unchanged.
56311
- * For instruction targets, also filters qualityResult.suggestions.
56312
- */ function applySeverityFilter(output, rulesConfig) {
56313
- const configKey = TARGET_TO_CONFIG_KEY[output.target];
56314
- const targetRules = rulesConfig[configKey];
56315
- const filteredDiagnostics = [];
56316
- for (const diagnostic of output.diagnostics){
56317
- const configuredSeverity = diagnostic.ruleId ? targetRules[diagnostic.ruleId] : undefined;
56318
- if (!configuredSeverity) {
56319
- filteredDiagnostics.push(diagnostic);
56320
- continue;
56321
- }
56322
- const mappedSeverity = lint_mapSeverity(configuredSeverity);
56323
- if (mappedSeverity === null) {
56324
- continue;
56325
- }
56326
- filteredDiagnostics.push({
56327
- ...diagnostic,
56328
- severity: mappedSeverity
56329
- });
56330
- }
56331
- const totalErrors = filteredDiagnostics.filter((d)=>d.severity === "error").length;
56332
- const totalWarnings = filteredDiagnostics.filter((d)=>d.severity === "warning").length;
56333
- const totalInfos = filteredDiagnostics.filter((d)=>d.severity === "info").length;
56334
- const filteredQualityResult = output.qualityResult && configKey === "instructions" ? {
56335
- ...output.qualityResult,
56336
- suggestions: filterInstructionSuggestions(output.qualityResult.suggestions, targetRules)
56337
- } : output.qualityResult;
56338
- return {
56339
- ...output,
56340
- diagnostics: filteredDiagnostics,
56341
- qualityResult: filteredQualityResult,
56342
- summary: {
56343
- ...output.summary,
56344
- totalErrors,
56345
- totalWarnings,
56346
- totalInfos
56347
- }
56348
- };
56349
- }
56350
56357
  /**
56351
56358
  * The `lint` command for validating agent skills, custom agents, and instruction files.
56352
56359
  */ const lintCommand = defineCommand({