@lousy-agents/cli 1.1.1 → 2.1.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.
Files changed (182) hide show
  1. package/README.md +11 -12
  2. package/dist/145.js +29 -0
  3. package/dist/145.js.map +1 -0
  4. package/dist/190.js +1765 -0
  5. package/dist/190.js.map +1 -0
  6. package/dist/255.js +1850 -0
  7. package/dist/255.js.map +1 -0
  8. package/dist/31.js +127 -0
  9. package/dist/31.js.map +1 -0
  10. package/dist/399.js +13 -0
  11. package/dist/399.js.map +1 -0
  12. package/dist/610.js +254 -0
  13. package/dist/610.js.map +1 -0
  14. package/dist/651.js +39 -0
  15. package/dist/651.js.map +1 -0
  16. package/dist/659.js +16 -0
  17. package/dist/659.js.map +1 -0
  18. package/dist/709.js +47 -0
  19. package/dist/709.js.map +1 -0
  20. package/dist/835.js +298 -0
  21. package/dist/835.js.map +1 -0
  22. package/dist/index.js +30651 -9
  23. package/dist/index.js.map +1 -1
  24. package/dist/mcp-server.js +46530 -5
  25. package/dist/mcp-server.js.map +1 -1
  26. package/package.json +4 -2
  27. package/dist/commands/copilot-setup.d.ts +0 -5
  28. package/dist/commands/copilot-setup.d.ts.map +0 -1
  29. package/dist/commands/copilot-setup.js +0 -97
  30. package/dist/commands/copilot-setup.js.map +0 -1
  31. package/dist/commands/init.d.ts +0 -12
  32. package/dist/commands/init.d.ts.map +0 -1
  33. package/dist/commands/init.js +0 -138
  34. package/dist/commands/init.js.map +0 -1
  35. package/dist/commands/new.d.ts +0 -21
  36. package/dist/commands/new.d.ts.map +0 -1
  37. package/dist/commands/new.js +0 -94
  38. package/dist/commands/new.js.map +0 -1
  39. package/dist/entities/copilot-agent.d.ts +0 -15
  40. package/dist/entities/copilot-agent.d.ts.map +0 -1
  41. package/dist/entities/copilot-agent.js +0 -53
  42. package/dist/entities/copilot-agent.js.map +0 -1
  43. package/dist/entities/copilot-setup.d.ts +0 -65
  44. package/dist/entities/copilot-setup.d.ts.map +0 -1
  45. package/dist/entities/copilot-setup.js +0 -6
  46. package/dist/entities/copilot-setup.js.map +0 -1
  47. package/dist/entities/index.d.ts +0 -7
  48. package/dist/entities/index.d.ts.map +0 -1
  49. package/dist/entities/index.js +0 -7
  50. package/dist/entities/index.js.map +0 -1
  51. package/dist/entities/skill.d.ts +0 -15
  52. package/dist/entities/skill.d.ts.map +0 -1
  53. package/dist/entities/skill.js +0 -63
  54. package/dist/entities/skill.js.map +0 -1
  55. package/dist/gateways/action-version-gateway.d.ts +0 -39
  56. package/dist/gateways/action-version-gateway.d.ts.map +0 -1
  57. package/dist/gateways/action-version-gateway.js +0 -47
  58. package/dist/gateways/action-version-gateway.js.map +0 -1
  59. package/dist/gateways/agent-file-gateway.d.ts +0 -50
  60. package/dist/gateways/agent-file-gateway.d.ts.map +0 -1
  61. package/dist/gateways/agent-file-gateway.js +0 -34
  62. package/dist/gateways/agent-file-gateway.js.map +0 -1
  63. package/dist/gateways/environment-gateway.d.ts +0 -30
  64. package/dist/gateways/environment-gateway.d.ts.map +0 -1
  65. package/dist/gateways/environment-gateway.js +0 -56
  66. package/dist/gateways/environment-gateway.js.map +0 -1
  67. package/dist/gateways/file-system-utils.d.ts +0 -8
  68. package/dist/gateways/file-system-utils.d.ts.map +0 -1
  69. package/dist/gateways/file-system-utils.js +0 -17
  70. package/dist/gateways/file-system-utils.js.map +0 -1
  71. package/dist/gateways/file-system-workflow-gateway.d.ts +0 -27
  72. package/dist/gateways/file-system-workflow-gateway.d.ts.map +0 -1
  73. package/dist/gateways/file-system-workflow-gateway.js +0 -99
  74. package/dist/gateways/file-system-workflow-gateway.js.map +0 -1
  75. package/dist/gateways/index.d.ts +0 -10
  76. package/dist/gateways/index.d.ts.map +0 -1
  77. package/dist/gateways/index.js +0 -10
  78. package/dist/gateways/index.js.map +0 -1
  79. package/dist/gateways/skill-file-gateway.d.ts +0 -59
  80. package/dist/gateways/skill-file-gateway.d.ts.map +0 -1
  81. package/dist/gateways/skill-file-gateway.js +0 -37
  82. package/dist/gateways/skill-file-gateway.js.map +0 -1
  83. package/dist/gateways/workflow-gateway.d.ts +0 -43
  84. package/dist/gateways/workflow-gateway.d.ts.map +0 -1
  85. package/dist/gateways/workflow-gateway.js +0 -6
  86. package/dist/gateways/workflow-gateway.js.map +0 -1
  87. package/dist/index.d.ts +0 -3
  88. package/dist/index.d.ts.map +0 -1
  89. package/dist/lib/config.d.ts +0 -27
  90. package/dist/lib/config.d.ts.map +0 -1
  91. package/dist/lib/config.js +0 -400
  92. package/dist/lib/config.js.map +0 -1
  93. package/dist/lib/copilot-setup-config.d.ts +0 -79
  94. package/dist/lib/copilot-setup-config.d.ts.map +0 -1
  95. package/dist/lib/copilot-setup-config.js +0 -119
  96. package/dist/lib/copilot-setup-config.js.map +0 -1
  97. package/dist/lib/filesystem-structure.d.ts +0 -45
  98. package/dist/lib/filesystem-structure.d.ts.map +0 -1
  99. package/dist/lib/filesystem-structure.js +0 -69
  100. package/dist/lib/filesystem-structure.js.map +0 -1
  101. package/dist/lib/mcp-test-client.d.ts +0 -43
  102. package/dist/lib/mcp-test-client.d.ts.map +0 -1
  103. package/dist/lib/mcp-test-client.js +0 -167
  104. package/dist/lib/mcp-test-client.js.map +0 -1
  105. package/dist/lib/project-name-validation.d.ts +0 -43
  106. package/dist/lib/project-name-validation.d.ts.map +0 -1
  107. package/dist/lib/project-name-validation.js +0 -131
  108. package/dist/lib/project-name-validation.js.map +0 -1
  109. package/dist/mcp/index.d.ts +0 -5
  110. package/dist/mcp/index.d.ts.map +0 -1
  111. package/dist/mcp/index.js +0 -5
  112. package/dist/mcp/index.js.map +0 -1
  113. package/dist/mcp/server.d.ts +0 -15
  114. package/dist/mcp/server.d.ts.map +0 -1
  115. package/dist/mcp/server.js +0 -120
  116. package/dist/mcp/server.js.map +0 -1
  117. package/dist/mcp/tools/analyze-action-versions.d.ts +0 -9
  118. package/dist/mcp/tools/analyze-action-versions.d.ts.map +0 -1
  119. package/dist/mcp/tools/analyze-action-versions.js +0 -81
  120. package/dist/mcp/tools/analyze-action-versions.js.map +0 -1
  121. package/dist/mcp/tools/create-copilot-setup-workflow.d.ts +0 -9
  122. package/dist/mcp/tools/create-copilot-setup-workflow.d.ts.map +0 -1
  123. package/dist/mcp/tools/create-copilot-setup-workflow.js +0 -121
  124. package/dist/mcp/tools/create-copilot-setup-workflow.js.map +0 -1
  125. package/dist/mcp/tools/discover-environment.d.ts +0 -9
  126. package/dist/mcp/tools/discover-environment.d.ts.map +0 -1
  127. package/dist/mcp/tools/discover-environment.js +0 -30
  128. package/dist/mcp/tools/discover-environment.js.map +0 -1
  129. package/dist/mcp/tools/discover-workflow-setup-actions.d.ts +0 -9
  130. package/dist/mcp/tools/discover-workflow-setup-actions.d.ts.map +0 -1
  131. package/dist/mcp/tools/discover-workflow-setup-actions.js +0 -37
  132. package/dist/mcp/tools/discover-workflow-setup-actions.js.map +0 -1
  133. package/dist/mcp/tools/index.d.ts +0 -11
  134. package/dist/mcp/tools/index.d.ts.map +0 -1
  135. package/dist/mcp/tools/index.js +0 -11
  136. package/dist/mcp/tools/index.js.map +0 -1
  137. package/dist/mcp/tools/read-copilot-setup-workflow.d.ts +0 -9
  138. package/dist/mcp/tools/read-copilot-setup-workflow.d.ts.map +0 -1
  139. package/dist/mcp/tools/read-copilot-setup-workflow.js +0 -38
  140. package/dist/mcp/tools/read-copilot-setup-workflow.js.map +0 -1
  141. package/dist/mcp/tools/resolve-action-versions.d.ts +0 -10
  142. package/dist/mcp/tools/resolve-action-versions.d.ts.map +0 -1
  143. package/dist/mcp/tools/resolve-action-versions.js +0 -61
  144. package/dist/mcp/tools/resolve-action-versions.js.map +0 -1
  145. package/dist/mcp/tools/types.d.ts +0 -67
  146. package/dist/mcp/tools/types.d.ts.map +0 -1
  147. package/dist/mcp/tools/types.js +0 -24
  148. package/dist/mcp/tools/types.js.map +0 -1
  149. package/dist/mcp-server.d.ts +0 -7
  150. package/dist/mcp-server.d.ts.map +0 -1
  151. package/dist/use-cases/action-resolution.d.ts +0 -66
  152. package/dist/use-cases/action-resolution.d.ts.map +0 -1
  153. package/dist/use-cases/action-resolution.js +0 -107
  154. package/dist/use-cases/action-resolution.js.map +0 -1
  155. package/dist/use-cases/candidate-builder.d.ts +0 -17
  156. package/dist/use-cases/candidate-builder.d.ts.map +0 -1
  157. package/dist/use-cases/candidate-builder.js +0 -67
  158. package/dist/use-cases/candidate-builder.js.map +0 -1
  159. package/dist/use-cases/copilot-setup.d.ts +0 -8
  160. package/dist/use-cases/copilot-setup.d.ts.map +0 -1
  161. package/dist/use-cases/copilot-setup.js +0 -10
  162. package/dist/use-cases/copilot-setup.js.map +0 -1
  163. package/dist/use-cases/create-copilot-agent.d.ts +0 -29
  164. package/dist/use-cases/create-copilot-agent.d.ts.map +0 -1
  165. package/dist/use-cases/create-copilot-agent.js +0 -73
  166. package/dist/use-cases/create-copilot-agent.js.map +0 -1
  167. package/dist/use-cases/create-skill.d.ts +0 -30
  168. package/dist/use-cases/create-skill.d.ts.map +0 -1
  169. package/dist/use-cases/create-skill.js +0 -75
  170. package/dist/use-cases/create-skill.js.map +0 -1
  171. package/dist/use-cases/index.d.ts +0 -10
  172. package/dist/use-cases/index.d.ts.map +0 -1
  173. package/dist/use-cases/index.js +0 -10
  174. package/dist/use-cases/index.js.map +0 -1
  175. package/dist/use-cases/setup-step-discovery.d.ts +0 -87
  176. package/dist/use-cases/setup-step-discovery.d.ts.map +0 -1
  177. package/dist/use-cases/setup-step-discovery.js +0 -202
  178. package/dist/use-cases/setup-step-discovery.js.map +0 -1
  179. package/dist/use-cases/workflow-generator.d.ts +0 -34
  180. package/dist/use-cases/workflow-generator.d.ts.map +0 -1
  181. package/dist/use-cases/workflow-generator.js +0 -195
  182. package/dist/use-cases/workflow-generator.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/cli",
3
- "version": "1.1.1",
3
+ "version": "2.1.0",
4
4
  "description": "CLI scaffolding tool that sets up projects with structure, instructions, and feedback loops for AI coding assistants",
5
5
  "type": "module",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "scripts": {
40
40
  "dev": "tsx src/index.ts",
41
- "build": "tsc && chmod +x dist/index.js dist/mcp-server.js",
41
+ "build": "rspack build --config rspack.config.ts && chmod +x dist/index.js dist/mcp-server.js",
42
42
  "start": "node dist/index.js",
43
43
  "test": "vitest run",
44
44
  "lint": "biome check .",
@@ -58,6 +58,8 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@biomejs/biome": "2.3.13",
61
+ "@rspack/cli": "1.7.4",
62
+ "@rspack/core": "1.7.4",
61
63
  "@types/chance": "1.1.7",
62
64
  "@types/node": "25.1.0",
63
65
  "chance": "1.1.13",
@@ -1,5 +0,0 @@
1
- /**
2
- * Main command implementation for copilot-setup
3
- */
4
- export declare const copilotSetupCommand: import("citty").CommandDef<{}>;
5
- //# sourceMappingURL=copilot-setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copilot-setup.d.ts","sourceRoot":"","sources":["../../src/commands/copilot-setup.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,eAAO,MAAM,mBAAmB,gCAyI9B,CAAC"}
@@ -1,97 +0,0 @@
1
- import { mkdir } from "node:fs/promises";
2
- import { join } from "node:path";
3
- import { defineCommand } from "citty";
4
- import { consola } from "consola";
5
- import { createEnvironmentGateway, createWorkflowGateway, fileExists, } from "../gateways/index.js";
6
- import { buildCandidatesFromEnvironment, generateWorkflowContent, updateWorkflowWithMissingSteps, } from "../use-cases/copilot-setup.js";
7
- import { findMissingCandidates, getExistingActionsFromWorkflow, mergeCandidates, } from "../use-cases/setup-step-discovery.js";
8
- const copilotSetupArgs = {};
9
- /**
10
- * Main command implementation for copilot-setup
11
- */
12
- export const copilotSetupCommand = defineCommand({
13
- meta: {
14
- name: "copilot-setup",
15
- description: "Generate or update the Copilot Setup Steps workflow based on detected environment configuration",
16
- },
17
- args: copilotSetupArgs,
18
- run: async (context) => {
19
- // Support dependency injection for testing via context.data
20
- const targetDir = typeof context.data?.targetDir === "string"
21
- ? context.data.targetDir
22
- : process.cwd();
23
- // Create gateways
24
- const environmentGateway = createEnvironmentGateway();
25
- const workflowGateway = createWorkflowGateway();
26
- consola.info("Detecting environment configuration...");
27
- // Step 1: Detect environment configuration files
28
- const environment = await environmentGateway.detectEnvironment(targetDir);
29
- if (environment.hasMise) {
30
- consola.success("Found mise.toml - will use mise-action");
31
- }
32
- if (environment.versionFiles.length > 0) {
33
- const fileNames = environment.versionFiles
34
- .map((f) => f.filename)
35
- .join(", ");
36
- consola.success(`Found version files: ${fileNames}`);
37
- }
38
- // Step 2: Parse existing workflows for setup actions
39
- const workflowsDir = join(targetDir, ".github", "workflows");
40
- const workflowsDirExists = await fileExists(workflowsDir);
41
- const workflowCandidates = workflowsDirExists
42
- ? await workflowGateway.parseWorkflowsForSetupActions(targetDir)
43
- : [];
44
- if (workflowCandidates.length > 0) {
45
- const actionNames = workflowCandidates
46
- .map((c) => c.action)
47
- .join(", ");
48
- consola.success(`Found setup actions in existing workflows: ${actionNames}`);
49
- }
50
- // Step 3: Build candidates from environment
51
- const envCandidates = await buildCandidatesFromEnvironment(environment);
52
- // Step 4: Merge candidates (workflow takes precedence)
53
- const allCandidates = mergeCandidates(workflowCandidates, envCandidates);
54
- if (allCandidates.length === 0) {
55
- consola.warn("No environment configuration or setup actions detected. Creating minimal workflow with checkout only.");
56
- }
57
- // Step 5: Check if copilot-setup-steps.yml already exists
58
- const workflowExists = await workflowGateway.copilotSetupWorkflowExists(targetDir);
59
- // Ensure workflows directory exists
60
- if (!workflowsDirExists) {
61
- await mkdir(workflowsDir, { recursive: true });
62
- }
63
- if (workflowExists) {
64
- // Update existing workflow
65
- consola.info("Found existing copilot-setup-steps.yml - checking for missing steps...");
66
- const existingWorkflow = await workflowGateway.readCopilotSetupWorkflow(targetDir);
67
- const existingActions = getExistingActionsFromWorkflow(existingWorkflow);
68
- const missingCandidates = findMissingCandidates(allCandidates, existingActions);
69
- if (missingCandidates.length === 0) {
70
- consola.success("Copilot Setup Steps workflow already contains all detected setup steps. No changes needed.");
71
- return;
72
- }
73
- const missingNames = missingCandidates
74
- .map((c) => c.action)
75
- .join(", ");
76
- consola.info(`Adding missing setup steps: ${missingNames}`);
77
- const updatedContent = await updateWorkflowWithMissingSteps(existingWorkflow, missingCandidates);
78
- await workflowGateway.writeCopilotSetupWorkflow(targetDir, updatedContent);
79
- consola.success(`Updated copilot-setup-steps.yml with ${missingCandidates.length} new step(s)`);
80
- }
81
- else {
82
- // Create new workflow
83
- consola.info("Creating new copilot-setup-steps.yml workflow...");
84
- const content = await generateWorkflowContent(allCandidates);
85
- await workflowGateway.writeCopilotSetupWorkflow(targetDir, content);
86
- const stepCount = allCandidates.length + 1; // +1 for checkout
87
- consola.success(`Created copilot-setup-steps.yml with ${stepCount} step(s)`);
88
- if (allCandidates.length > 0) {
89
- const actionNames = allCandidates
90
- .map((c) => c.action)
91
- .join(", ");
92
- consola.info(`Included setup steps: ${actionNames}`);
93
- }
94
- }
95
- },
96
- });
97
- //# sourceMappingURL=copilot-setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copilot-setup.js","sourceRoot":"","sources":["../../src/commands/copilot-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EACH,wBAAwB,EACxB,qBAAqB,EACrB,UAAU,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,8BAA8B,EAC9B,uBAAuB,EACvB,8BAA8B,GACjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,qBAAqB,EACrB,8BAA8B,EAC9B,eAAe,GAClB,MAAM,sCAAsC,CAA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@ -1,12 +0,0 @@
1
- export declare const PROJECT_TYPE_OPTIONS: ("CLI" | "webapp" | "REST API" | "GraphQL API")[];
2
- export declare const initCommand: import("citty").CommandDef<{
3
- kind: {
4
- type: "string";
5
- description: string;
6
- };
7
- name: {
8
- type: "string";
9
- description: string;
10
- };
11
- }>;
12
- //# sourceMappingURL=init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,oBAAoB,mDAA4B,CAAC;AAyI9D,eAAO,MAAM,WAAW;;;;;;;;;EA8EtB,CAAC"}
@@ -1,138 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import { consola } from "consola";
3
- import { z } from "zod";
4
- import { getProjectStructure } from "../lib/config.js";
5
- import { createFilesystemStructure, } from "../lib/filesystem-structure.js";
6
- import { getProjectNameError, isValidProjectName, } from "../lib/project-name-validation.js";
7
- const ProjectTypeSchema = z.enum(["CLI", "webapp", "REST API", "GraphQL API"]);
8
- export const PROJECT_TYPE_OPTIONS = ProjectTypeSchema.options;
9
- const initArgs = {
10
- kind: {
11
- type: "string",
12
- description: `Project type: ${PROJECT_TYPE_OPTIONS.join(", ")}`,
13
- },
14
- name: {
15
- type: "string",
16
- description: "Project name (used in package.json and other config files)",
17
- },
18
- };
19
- function formatErrorMessage(error) {
20
- return error instanceof Error ? error.message : String(error);
21
- }
22
- async function getValidatedProjectName(promptFn, existingName, projectTypeLabel, placeholder) {
23
- const rawProjectName = existingName
24
- ? existingName
25
- : await promptFn("What is your project name?", {
26
- type: "text",
27
- placeholder,
28
- });
29
- const projectName = typeof rawProjectName === "string" ? rawProjectName.trim() : "";
30
- if (!projectName) {
31
- consola.error(`Project name is required for ${projectTypeLabel} projects`);
32
- throw new Error("Project name is required");
33
- }
34
- if (!isValidProjectName(projectName)) {
35
- const errorMessage = getProjectNameError(projectName) || "Invalid npm package name";
36
- consola.error(`Invalid project name: "${projectName}". ${errorMessage}`);
37
- throw new Error(`Invalid project name. ${errorMessage}`);
38
- }
39
- return { projectName };
40
- }
41
- async function createCliScaffolding(targetDir) {
42
- try {
43
- // Load the CLI structure from configuration
44
- const cliStructure = await getProjectStructure("CLI");
45
- if (!cliStructure) {
46
- consola.warn("No CLI project structure defined in configuration");
47
- return;
48
- }
49
- await createFilesystemStructure(cliStructure, targetDir);
50
- }
51
- catch (error) {
52
- consola.error(`Failed to create CLI scaffolding: ${formatErrorMessage(error)}`);
53
- throw error;
54
- }
55
- }
56
- async function createWebappScaffolding(targetDir, templateContext) {
57
- try {
58
- // Load the webapp structure from configuration
59
- const webappStructure = await getProjectStructure("webapp");
60
- if (!webappStructure) {
61
- consola.warn("No webapp project structure defined in configuration");
62
- return;
63
- }
64
- await createFilesystemStructure(webappStructure, targetDir, templateContext);
65
- }
66
- catch (error) {
67
- consola.error(`Failed to create webapp scaffolding: ${formatErrorMessage(error)}`);
68
- throw error;
69
- }
70
- }
71
- async function createRestApiScaffolding(targetDir, templateContext) {
72
- try {
73
- // Load the REST API structure from configuration
74
- const restApiStructure = await getProjectStructure("REST API");
75
- if (!restApiStructure) {
76
- consola.warn("No REST API project structure defined in configuration");
77
- return;
78
- }
79
- await createFilesystemStructure(restApiStructure, targetDir, templateContext);
80
- }
81
- catch (error) {
82
- consola.error(`Failed to create REST API scaffolding: ${formatErrorMessage(error)}`);
83
- throw error;
84
- }
85
- }
86
- export const initCommand = defineCommand({
87
- meta: {
88
- name: "init",
89
- description: "Initialize a new project with lousy agents scaffolding",
90
- },
91
- args: initArgs,
92
- run: async (context) => {
93
- // Support dependency injection for testing via context.data
94
- // Runtime checks for type safety
95
- const targetDir = typeof context.data?.targetDir === "string"
96
- ? context.data.targetDir
97
- : process.cwd();
98
- const promptFn = typeof context.data?.prompt === "function"
99
- ? context.data.prompt
100
- : consola.prompt.bind(consola);
101
- // Use CLI argument if provided, otherwise prompt
102
- const rawProjectType = context.args.kind
103
- ? context.args.kind
104
- : await promptFn("What type of project are you initializing?", {
105
- type: "select",
106
- options: PROJECT_TYPE_OPTIONS,
107
- });
108
- // Validate the user input at runtime
109
- const parseResult = ProjectTypeSchema.safeParse(rawProjectType);
110
- if (!parseResult.success) {
111
- const validOptions = PROJECT_TYPE_OPTIONS.join(", ");
112
- consola.error(`Invalid project type selected: ${String(rawProjectType)}. Valid options are: ${validOptions}`);
113
- throw new Error(`Invalid project type. Expected one of: ${validOptions}`);
114
- }
115
- const projectType = parseResult.data;
116
- consola.success(`Selected project type: ${projectType}`);
117
- if (projectType === "CLI") {
118
- await createCliScaffolding(targetDir);
119
- consola.info("CLI project scaffolding complete. Check the .github directory for instructions.");
120
- }
121
- else if (projectType === "webapp") {
122
- const { projectName } = await getValidatedProjectName(promptFn, context.args.name, "webapp", "my-webapp");
123
- const templateContext = { projectName };
124
- await createWebappScaffolding(targetDir, templateContext);
125
- consola.info("Webapp project scaffolding complete. Run 'npm install' to install dependencies.");
126
- }
127
- else if (projectType === "REST API") {
128
- const { projectName } = await getValidatedProjectName(promptFn, context.args.name, "REST API", "my-rest-api");
129
- const templateContext = { projectName };
130
- await createRestApiScaffolding(targetDir, templateContext);
131
- consola.info("REST API project scaffolding complete. Run 'npm install' to install dependencies.");
132
- }
133
- else {
134
- consola.info(`Scaffolding for ${projectType} projects will be implemented in a future release.`);
135
- }
136
- },
137
- });
138
- //# sourceMappingURL=init.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACH,yBAAyB,GAE5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,mBAAmB,EACnB,kBAAkB,GACrB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AAwB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAC3D,OAAO,CAAC,IAAI,CACR,mFAAmF,CACtF,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,IAAI,CACR,mBAAmB,WAAW,oDAAoD,CACrF,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * The `skill` subcommand for creating Agent Skills
3
- */
4
- export declare const skillCommand: import("citty").CommandDef<{
5
- name: {
6
- type: "positional";
7
- description: string;
8
- required: boolean;
9
- };
10
- }>;
11
- /**
12
- * The `new` command for scaffolding new resources.
13
- * Supports creating Copilot custom agents and Agent Skills.
14
- */
15
- export declare const newCommand: import("citty").CommandDef<{
16
- "copilot-agent": {
17
- type: "string";
18
- description: string;
19
- };
20
- }>;
21
- //# sourceMappingURL=new.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;EAmCvB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;EAmDrB,CAAC"}
@@ -1,94 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import { consola } from "consola";
3
- import { createAgentFileGateway } from "../gateways/agent-file-gateway.js";
4
- import { createSkillFileGateway } from "../gateways/skill-file-gateway.js";
5
- import { CreateCopilotAgentUseCase } from "../use-cases/create-copilot-agent.js";
6
- import { CreateSkillUseCase } from "../use-cases/create-skill.js";
7
- const copilotAgentArgs = {
8
- "copilot-agent": {
9
- type: "string",
10
- description: "Create a new GitHub Copilot custom agent with the specified name. Example: lousy-agents new --copilot-agent security",
11
- },
12
- };
13
- const skillArgs = {
14
- name: {
15
- type: "positional",
16
- description: "The name of the skill to create. Example: lousy-agents new skill github-actions-debug",
17
- required: true,
18
- },
19
- };
20
- /**
21
- * The `skill` subcommand for creating Agent Skills
22
- */
23
- export const skillCommand = defineCommand({
24
- meta: {
25
- name: "skill",
26
- description: "Create a new GitHub Copilot Agent Skill. Example: lousy-agents new skill github-actions-debug",
27
- },
28
- args: skillArgs,
29
- run: async (context) => {
30
- // Support dependency injection for testing via context.data
31
- const targetDir = typeof context.data?.targetDir === "string"
32
- ? context.data.targetDir
33
- : process.cwd();
34
- const skillName = context.args.name;
35
- if (!skillName) {
36
- throw new Error("Missing required argument: <name>. Example: lousy-agents new skill github-actions-debug");
37
- }
38
- // Create the use case with the file system gateway
39
- const gateway = createSkillFileGateway();
40
- const useCase = new CreateSkillUseCase(gateway);
41
- // Execute the use case
42
- const result = await useCase.execute(targetDir, skillName);
43
- if (!result.success) {
44
- throw new Error(result.error);
45
- }
46
- consola.success(`Created Agent Skill: ${result.skillFilePath}`);
47
- },
48
- });
49
- /**
50
- * The `new` command for scaffolding new resources.
51
- * Supports creating Copilot custom agents and Agent Skills.
52
- */
53
- export const newCommand = defineCommand({
54
- meta: {
55
- name: "new",
56
- description: "Create new resources (e.g., Copilot agents, skills). Use 'new skill <name>' to create an Agent Skill.",
57
- },
58
- args: copilotAgentArgs,
59
- subCommands: {
60
- skill: skillCommand,
61
- },
62
- run: async (context) => {
63
- // citty runs both the subcommand's run function and the parent's run function.
64
- // We need to detect when a subcommand was invoked and exit early to avoid
65
- // throwing an error for missing --copilot-agent option.
66
- const subCommand = context.rawArgs[0];
67
- if (subCommand === "skill") {
68
- return; // Subcommand was handled by skillCommand.run
69
- }
70
- // Support dependency injection for testing via context.data
71
- const targetDir = typeof context.data?.targetDir === "string"
72
- ? context.data.targetDir
73
- : process.cwd();
74
- const copilotAgentName = context.args["copilot-agent"];
75
- if (!copilotAgentName) {
76
- throw new Error("Missing required option. Use one of:\n" +
77
- " --copilot-agent <name> Create a Copilot custom agent\n" +
78
- " skill <name> Create an Agent Skill\n\n" +
79
- "Examples:\n" +
80
- " lousy-agents new --copilot-agent security\n" +
81
- " lousy-agents new skill github-actions-debug");
82
- }
83
- // Create the use case with the file system gateway
84
- const gateway = createAgentFileGateway();
85
- const useCase = new CreateCopilotAgentUseCase(gateway);
86
- // Execute the use case
87
- const result = await useCase.execute(targetDir, copilotAgentName);
88
- if (!result.success) {
89
- throw new Error(result.error);
90
- }
91
- consola.success(`Created Copilot agent: ${result.filePath}`);
92
- },
93
- });
94
- //# sourceMappingURL=new.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,gBAAgB,GAAG;IACrB,eAAe,EAAE;QACb,IAAI,EAAE,QAAiB;QACvB,WAAW,EACP,sHAAsH;KAC7H;CACJ,CAAC;AAIF,MAAM,SAAS,GAAG;IACd,IAAI,EAAE;QACF,IAAI,EAAE,YAAqB;QAC3B,WAAW,EACP,uFAAuF;QAC3F,QAAQ,EAAE,IAAI;KACjB;CACJ,CAAC;AAIF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;IACtC,IAAI,EAAE;QACF,IAAI,EAAE,OAAO;QACb,WAAW,EACP,+FAA+F;KACtG;IACD,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,KAAK,EAAE,OAAkC,EAAE,EAAE;QAC9C,4DAA4D;QAC5D,MAAM,SAAS,GACX,OAAO,OAAO,CAAC,IAAI,EAAE,SAAS,KAAK,QAAQ;YACvC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;YACxB,CAAC,CAAC,OAAO,CAA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C,GAAG,EAAE,CAAC;QAExB,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEvD,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACX,wCAAwC;gBACpC,2DAA2D;gBAC3D,qDAAqD;gBACrD,aAAa;gBACb,+CAA+C;gBAC/C,+CAA+C,CACtD,CAAC;QACN,CAAC;QAED,mDAAmD;QACnD,MAAM,OAAO,GAAG,sBAAsB,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAEvD,uBAAuB;QACvB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAElE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,CAAC,OAAO,CAAC,0BAA0B,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjE,CAAC;CACJ,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Core domain entity for GitHub Copilot custom agent files.
3
- * Handles name normalization and content generation.
4
- */
5
- /**
6
- * Normalizes an agent name to lowercase with hyphens.
7
- * Handles spaces, mixed case, multiple spaces, and leading/trailing spaces.
8
- */
9
- export declare function normalizeAgentName(name: string): string;
10
- /**
11
- * Generates the markdown content for a custom Copilot agent file.
12
- * Includes YAML frontmatter, documentation link, and example structure.
13
- */
14
- export declare function generateAgentContent(agentName: string): string;
15
- //# sourceMappingURL=copilot-agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copilot-agent.d.ts","sourceRoot":"","sources":["../../src/entities/copilot-agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAqC9D"}
@@ -1,53 +0,0 @@
1
- /**
2
- * Core domain entity for GitHub Copilot custom agent files.
3
- * Handles name normalization and content generation.
4
- */
5
- /**
6
- * Normalizes an agent name to lowercase with hyphens.
7
- * Handles spaces, mixed case, multiple spaces, and leading/trailing spaces.
8
- */
9
- export function normalizeAgentName(name) {
10
- return name.trim().toLowerCase().replace(/\s+/g, "-");
11
- }
12
- /**
13
- * Generates the markdown content for a custom Copilot agent file.
14
- * Includes YAML frontmatter, documentation link, and example structure.
15
- */
16
- export function generateAgentContent(agentName) {
17
- const normalizedName = normalizeAgentName(agentName);
18
- return `---
19
- name: ${normalizedName}
20
- description: Brief description of what this agent does
21
- ---
22
-
23
- <!--
24
- This is a custom GitHub Copilot agent for repository-level use.
25
- Learn more: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents
26
- -->
27
-
28
- # ${normalizedName} Agent
29
-
30
- You are a ${normalizedName} agent specialized in {domain/responsibility}.
31
-
32
- ## Your Role
33
-
34
- {Brief description of the agent's expertise and focus area}
35
-
36
- ## Responsibilities
37
-
38
- - {Primary responsibility}
39
- - {Secondary responsibility}
40
- - {Additional responsibility}
41
-
42
- ## Guidelines
43
-
44
- - {Guideline or best practice}
45
- - {Guideline or best practice}
46
- - {Guideline or best practice}
47
-
48
- ## Example Interactions
49
-
50
- {Example of how the agent should respond to typical requests}
51
- `;
52
- }
53
- //# sourceMappingURL=copilot-agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copilot-agent.js","sourceRoot":"","sources":["../../src/entities/copilot-agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IAClD,MAAM,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAErD,OAAO;QACH,cAAc;;;;;;;;;IASlB,cAAc;;YAEN,cAAc;;;;;;;;;;;;;;;;;;;;;CAqBzB,CAAC;AACF,CAAC"}
@@ -1,65 +0,0 @@
1
- /**
2
- * Core domain entities for the Copilot Setup Steps feature.
3
- * These are the fundamental types that represent the business domain.
4
- */
5
- /**
6
- * Types of version files supported for detection
7
- */
8
- export type VersionFileType = "node" | "python" | "java" | "ruby" | "go";
9
- /**
10
- * Represents a detected version file in the repository
11
- */
12
- export interface VersionFile {
13
- type: VersionFileType;
14
- filename: string;
15
- version?: string;
16
- }
17
- /**
18
- * Result of detecting environment configuration
19
- */
20
- export interface DetectedEnvironment {
21
- hasMise: boolean;
22
- versionFiles: VersionFile[];
23
- }
24
- /**
25
- * Represents a setup step candidate extracted from workflows or version files
26
- */
27
- export interface SetupStepCandidate {
28
- action: string;
29
- version?: string;
30
- config?: Record<string, unknown>;
31
- source: "version-file" | "workflow";
32
- }
33
- /**
34
- * Represents a step in a GitHub Actions workflow
35
- */
36
- export interface WorkflowStep {
37
- name?: string;
38
- uses: string;
39
- with?: Record<string, unknown>;
40
- }
41
- /**
42
- * Represents an action that needs version resolution.
43
- * Used to prompt the LLM to look up the latest version.
44
- */
45
- export interface ActionToResolve {
46
- /** Action name without version (e.g., "actions/setup-node") */
47
- action: string;
48
- /** Placeholder used in workflow template (e.g., "RESOLVE_VERSION") */
49
- currentPlaceholder: string;
50
- /** URL to lookup latest version (e.g., "https://github.com/actions/setup-node/releases/latest") */
51
- lookupUrl: string;
52
- }
53
- /**
54
- * Represents a resolved action version with SHA and tag.
55
- * Used when the LLM has looked up and resolved the version.
56
- */
57
- export interface ResolvedVersion {
58
- /** Action name without version (e.g., "actions/setup-node") */
59
- action: string;
60
- /** Resolved commit SHA */
61
- sha: string;
62
- /** Version tag for human-readable comment (e.g., "v4.0.0") */
63
- versionTag: string;
64
- }
65
- //# sourceMappingURL=copilot-setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copilot-setup.d.ts","sourceRoot":"","sources":["../../src/entities/copilot-setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,cAAc,GAAG,UAAU,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mGAAmG;IACnG,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;CACtB"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Core domain entities for the Copilot Setup Steps feature.
3
- * These are the fundamental types that represent the business domain.
4
- */
5
- export {};
6
- //# sourceMappingURL=copilot-setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copilot-setup.js","sourceRoot":"","sources":["../../src/entities/copilot-setup.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Entities - Core domain types and interfaces
3
- */
4
- export * from "./copilot-agent.js";
5
- export * from "./copilot-setup.js";
6
- export * from "./skill.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Entities - Core domain types and interfaces
3
- */
4
- export * from "./copilot-agent.js";
5
- export * from "./copilot-setup.js";
6
- export * from "./skill.js";
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Core domain entity for GitHub Copilot Agent Skills.
3
- * Handles name normalization and SKILL.md content generation.
4
- */
5
- /**
6
- * Normalizes a skill name to lowercase with hyphens.
7
- * Handles spaces, mixed case, multiple spaces, and leading/trailing spaces.
8
- */
9
- export declare function normalizeSkillName(name: string): string;
10
- /**
11
- * Generates the SKILL.md content for a Copilot Agent Skill.
12
- * Includes YAML frontmatter, documentation link, and example structure.
13
- */
14
- export declare function generateSkillContent(skillName: string): string;
15
- //# sourceMappingURL=skill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/entities/skill.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA+C9D"}