@lousy-agents/cli 2.0.0 → 2.2.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 (181) hide show
  1. package/dist/145.js +29 -0
  2. package/dist/145.js.map +1 -0
  3. package/dist/190.js +1765 -0
  4. package/dist/190.js.map +1 -0
  5. package/dist/255.js +1850 -0
  6. package/dist/255.js.map +1 -0
  7. package/dist/31.js +127 -0
  8. package/dist/31.js.map +1 -0
  9. package/dist/399.js +13 -0
  10. package/dist/399.js.map +1 -0
  11. package/dist/610.js +254 -0
  12. package/dist/610.js.map +1 -0
  13. package/dist/651.js +39 -0
  14. package/dist/651.js.map +1 -0
  15. package/dist/659.js +16 -0
  16. package/dist/659.js.map +1 -0
  17. package/dist/709.js +47 -0
  18. package/dist/709.js.map +1 -0
  19. package/dist/835.js +298 -0
  20. package/dist/835.js.map +1 -0
  21. package/dist/index.js +30651 -9
  22. package/dist/index.js.map +1 -1
  23. package/dist/mcp-server.js +46530 -5
  24. package/dist/mcp-server.js.map +1 -1
  25. package/package.json +4 -2
  26. package/dist/commands/copilot-setup.d.ts +0 -5
  27. package/dist/commands/copilot-setup.d.ts.map +0 -1
  28. package/dist/commands/copilot-setup.js +0 -97
  29. package/dist/commands/copilot-setup.js.map +0 -1
  30. package/dist/commands/init.d.ts +0 -13
  31. package/dist/commands/init.d.ts.map +0 -1
  32. package/dist/commands/init.js +0 -109
  33. package/dist/commands/init.js.map +0 -1
  34. package/dist/commands/new.d.ts +0 -21
  35. package/dist/commands/new.d.ts.map +0 -1
  36. package/dist/commands/new.js +0 -94
  37. package/dist/commands/new.js.map +0 -1
  38. package/dist/entities/copilot-agent.d.ts +0 -15
  39. package/dist/entities/copilot-agent.d.ts.map +0 -1
  40. package/dist/entities/copilot-agent.js +0 -53
  41. package/dist/entities/copilot-agent.js.map +0 -1
  42. package/dist/entities/copilot-setup.d.ts +0 -65
  43. package/dist/entities/copilot-setup.d.ts.map +0 -1
  44. package/dist/entities/copilot-setup.js +0 -6
  45. package/dist/entities/copilot-setup.js.map +0 -1
  46. package/dist/entities/index.d.ts +0 -7
  47. package/dist/entities/index.d.ts.map +0 -1
  48. package/dist/entities/index.js +0 -7
  49. package/dist/entities/index.js.map +0 -1
  50. package/dist/entities/skill.d.ts +0 -15
  51. package/dist/entities/skill.d.ts.map +0 -1
  52. package/dist/entities/skill.js +0 -63
  53. package/dist/entities/skill.js.map +0 -1
  54. package/dist/gateways/action-version-gateway.d.ts +0 -39
  55. package/dist/gateways/action-version-gateway.d.ts.map +0 -1
  56. package/dist/gateways/action-version-gateway.js +0 -47
  57. package/dist/gateways/action-version-gateway.js.map +0 -1
  58. package/dist/gateways/agent-file-gateway.d.ts +0 -50
  59. package/dist/gateways/agent-file-gateway.d.ts.map +0 -1
  60. package/dist/gateways/agent-file-gateway.js +0 -34
  61. package/dist/gateways/agent-file-gateway.js.map +0 -1
  62. package/dist/gateways/environment-gateway.d.ts +0 -30
  63. package/dist/gateways/environment-gateway.d.ts.map +0 -1
  64. package/dist/gateways/environment-gateway.js +0 -56
  65. package/dist/gateways/environment-gateway.js.map +0 -1
  66. package/dist/gateways/file-system-utils.d.ts +0 -8
  67. package/dist/gateways/file-system-utils.d.ts.map +0 -1
  68. package/dist/gateways/file-system-utils.js +0 -17
  69. package/dist/gateways/file-system-utils.js.map +0 -1
  70. package/dist/gateways/file-system-workflow-gateway.d.ts +0 -27
  71. package/dist/gateways/file-system-workflow-gateway.d.ts.map +0 -1
  72. package/dist/gateways/file-system-workflow-gateway.js +0 -99
  73. package/dist/gateways/file-system-workflow-gateway.js.map +0 -1
  74. package/dist/gateways/index.d.ts +0 -10
  75. package/dist/gateways/index.d.ts.map +0 -1
  76. package/dist/gateways/index.js +0 -10
  77. package/dist/gateways/index.js.map +0 -1
  78. package/dist/gateways/skill-file-gateway.d.ts +0 -59
  79. package/dist/gateways/skill-file-gateway.d.ts.map +0 -1
  80. package/dist/gateways/skill-file-gateway.js +0 -37
  81. package/dist/gateways/skill-file-gateway.js.map +0 -1
  82. package/dist/gateways/workflow-gateway.d.ts +0 -43
  83. package/dist/gateways/workflow-gateway.d.ts.map +0 -1
  84. package/dist/gateways/workflow-gateway.js +0 -6
  85. package/dist/gateways/workflow-gateway.js.map +0 -1
  86. package/dist/index.d.ts +0 -3
  87. package/dist/index.d.ts.map +0 -1
  88. package/dist/lib/config.d.ts +0 -28
  89. package/dist/lib/config.d.ts.map +0 -1
  90. package/dist/lib/config.js +0 -406
  91. package/dist/lib/config.js.map +0 -1
  92. package/dist/lib/copilot-setup-config.d.ts +0 -79
  93. package/dist/lib/copilot-setup-config.d.ts.map +0 -1
  94. package/dist/lib/copilot-setup-config.js +0 -119
  95. package/dist/lib/copilot-setup-config.js.map +0 -1
  96. package/dist/lib/filesystem-structure.d.ts +0 -45
  97. package/dist/lib/filesystem-structure.d.ts.map +0 -1
  98. package/dist/lib/filesystem-structure.js +0 -69
  99. package/dist/lib/filesystem-structure.js.map +0 -1
  100. package/dist/lib/mcp-test-client.d.ts +0 -43
  101. package/dist/lib/mcp-test-client.d.ts.map +0 -1
  102. package/dist/lib/mcp-test-client.js +0 -167
  103. package/dist/lib/mcp-test-client.js.map +0 -1
  104. package/dist/lib/project-name-validation.d.ts +0 -43
  105. package/dist/lib/project-name-validation.d.ts.map +0 -1
  106. package/dist/lib/project-name-validation.js +0 -131
  107. package/dist/lib/project-name-validation.js.map +0 -1
  108. package/dist/mcp/index.d.ts +0 -5
  109. package/dist/mcp/index.d.ts.map +0 -1
  110. package/dist/mcp/index.js +0 -5
  111. package/dist/mcp/index.js.map +0 -1
  112. package/dist/mcp/server.d.ts +0 -15
  113. package/dist/mcp/server.d.ts.map +0 -1
  114. package/dist/mcp/server.js +0 -120
  115. package/dist/mcp/server.js.map +0 -1
  116. package/dist/mcp/tools/analyze-action-versions.d.ts +0 -9
  117. package/dist/mcp/tools/analyze-action-versions.d.ts.map +0 -1
  118. package/dist/mcp/tools/analyze-action-versions.js +0 -81
  119. package/dist/mcp/tools/analyze-action-versions.js.map +0 -1
  120. package/dist/mcp/tools/create-copilot-setup-workflow.d.ts +0 -9
  121. package/dist/mcp/tools/create-copilot-setup-workflow.d.ts.map +0 -1
  122. package/dist/mcp/tools/create-copilot-setup-workflow.js +0 -121
  123. package/dist/mcp/tools/create-copilot-setup-workflow.js.map +0 -1
  124. package/dist/mcp/tools/discover-environment.d.ts +0 -9
  125. package/dist/mcp/tools/discover-environment.d.ts.map +0 -1
  126. package/dist/mcp/tools/discover-environment.js +0 -30
  127. package/dist/mcp/tools/discover-environment.js.map +0 -1
  128. package/dist/mcp/tools/discover-workflow-setup-actions.d.ts +0 -9
  129. package/dist/mcp/tools/discover-workflow-setup-actions.d.ts.map +0 -1
  130. package/dist/mcp/tools/discover-workflow-setup-actions.js +0 -37
  131. package/dist/mcp/tools/discover-workflow-setup-actions.js.map +0 -1
  132. package/dist/mcp/tools/index.d.ts +0 -11
  133. package/dist/mcp/tools/index.d.ts.map +0 -1
  134. package/dist/mcp/tools/index.js +0 -11
  135. package/dist/mcp/tools/index.js.map +0 -1
  136. package/dist/mcp/tools/read-copilot-setup-workflow.d.ts +0 -9
  137. package/dist/mcp/tools/read-copilot-setup-workflow.d.ts.map +0 -1
  138. package/dist/mcp/tools/read-copilot-setup-workflow.js +0 -38
  139. package/dist/mcp/tools/read-copilot-setup-workflow.js.map +0 -1
  140. package/dist/mcp/tools/resolve-action-versions.d.ts +0 -10
  141. package/dist/mcp/tools/resolve-action-versions.d.ts.map +0 -1
  142. package/dist/mcp/tools/resolve-action-versions.js +0 -61
  143. package/dist/mcp/tools/resolve-action-versions.js.map +0 -1
  144. package/dist/mcp/tools/types.d.ts +0 -67
  145. package/dist/mcp/tools/types.d.ts.map +0 -1
  146. package/dist/mcp/tools/types.js +0 -24
  147. package/dist/mcp/tools/types.js.map +0 -1
  148. package/dist/mcp-server.d.ts +0 -7
  149. package/dist/mcp-server.d.ts.map +0 -1
  150. package/dist/use-cases/action-resolution.d.ts +0 -66
  151. package/dist/use-cases/action-resolution.d.ts.map +0 -1
  152. package/dist/use-cases/action-resolution.js +0 -107
  153. package/dist/use-cases/action-resolution.js.map +0 -1
  154. package/dist/use-cases/candidate-builder.d.ts +0 -17
  155. package/dist/use-cases/candidate-builder.d.ts.map +0 -1
  156. package/dist/use-cases/candidate-builder.js +0 -67
  157. package/dist/use-cases/candidate-builder.js.map +0 -1
  158. package/dist/use-cases/copilot-setup.d.ts +0 -8
  159. package/dist/use-cases/copilot-setup.d.ts.map +0 -1
  160. package/dist/use-cases/copilot-setup.js +0 -10
  161. package/dist/use-cases/copilot-setup.js.map +0 -1
  162. package/dist/use-cases/create-copilot-agent.d.ts +0 -29
  163. package/dist/use-cases/create-copilot-agent.d.ts.map +0 -1
  164. package/dist/use-cases/create-copilot-agent.js +0 -73
  165. package/dist/use-cases/create-copilot-agent.js.map +0 -1
  166. package/dist/use-cases/create-skill.d.ts +0 -30
  167. package/dist/use-cases/create-skill.d.ts.map +0 -1
  168. package/dist/use-cases/create-skill.js +0 -75
  169. package/dist/use-cases/create-skill.js.map +0 -1
  170. package/dist/use-cases/index.d.ts +0 -10
  171. package/dist/use-cases/index.d.ts.map +0 -1
  172. package/dist/use-cases/index.js +0 -10
  173. package/dist/use-cases/index.js.map +0 -1
  174. package/dist/use-cases/setup-step-discovery.d.ts +0 -87
  175. package/dist/use-cases/setup-step-discovery.d.ts.map +0 -1
  176. package/dist/use-cases/setup-step-discovery.js +0 -202
  177. package/dist/use-cases/setup-step-discovery.js.map +0 -1
  178. package/dist/use-cases/workflow-generator.d.ts +0 -34
  179. package/dist/use-cases/workflow-generator.d.ts.map +0 -1
  180. package/dist/use-cases/workflow-generator.js +0 -195
  181. package/dist/use-cases/workflow-generator.js.map +0 -1
@@ -1,37 +0,0 @@
1
- /**
2
- * Gateway for skill file system operations.
3
- * This module abstracts file system access for Copilot Agent Skill files.
4
- */
5
- import { mkdir, writeFile } from "node:fs/promises";
6
- import { join } from "node:path";
7
- import { fileExists } from "./file-system-utils.js";
8
- /**
9
- * File system implementation of the skill file gateway
10
- */
11
- export class FileSystemSkillFileGateway {
12
- getSkillDirectoryPath(targetDir, skillName) {
13
- return join(targetDir, ".github", "skills", skillName);
14
- }
15
- getSkillFilePath(targetDir, skillName) {
16
- return join(this.getSkillDirectoryPath(targetDir, skillName), "SKILL.md");
17
- }
18
- async skillDirectoryExists(targetDir, skillName) {
19
- const dirPath = this.getSkillDirectoryPath(targetDir, skillName);
20
- return fileExists(dirPath);
21
- }
22
- async ensureSkillDirectory(targetDir, skillName) {
23
- const skillDir = this.getSkillDirectoryPath(targetDir, skillName);
24
- await mkdir(skillDir, { recursive: true });
25
- }
26
- async writeSkillFile(targetDir, skillName, content) {
27
- const filePath = this.getSkillFilePath(targetDir, skillName);
28
- await writeFile(filePath, content, { encoding: "utf-8" });
29
- }
30
- }
31
- /**
32
- * Creates and returns the default skill file gateway
33
- */
34
- export function createSkillFileGateway() {
35
- return new FileSystemSkillFileGateway();
36
- }
37
- //# sourceMappingURL=skill-file-gateway.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skill-file-gateway.js","sourceRoot":"","sources":["../../src/gateways/skill-file-gateway.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAsDpD;;GAEG;AACH,MAAM,OAAO,0BAA0B;IACnC,qBAAqB,CAAC,SAAiB,EAAE,SAAiB;QACtD,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,gBAAgB,CAAC,SAAiB,EAAE,SAAiB;QACjD,OAAO,IAAI,CACP,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,SAAS,CAAC,EAChD,UAAU,CACb,CAAC;IACN,CAAC;IAED,KAAK,CAAC,oBAAoB,CACtB,SAAiB,EACjB,SAAiB;QAEjB,MAAM,OAAO,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACjE,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,oBAAoB,CACtB,SAAiB,EACjB,SAAiB;QAEjB,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAClE,MAAM,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,SAAiB,EACjB,SAAiB,EACjB,OAAe;QAEf,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC7D,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IAClC,OAAO,IAAI,0BAA0B,EAAE,CAAC;AAC5C,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * Gateway interface for GitHub Actions workflow operations.
3
- */
4
- import type { SetupStepCandidate } from "../entities/copilot-setup.js";
5
- /**
6
- * Interface for workflow gateway
7
- * Allows for different implementations (file system, mock, etc.)
8
- */
9
- export interface WorkflowGateway {
10
- /**
11
- * Parses all workflow files and extracts setup actions
12
- * @param targetDir The repository root directory
13
- * @returns Array of deduplicated setup step candidates
14
- */
15
- parseWorkflowsForSetupActions(targetDir: string): Promise<SetupStepCandidate[]>;
16
- /**
17
- * Checks if the copilot-setup-steps workflow exists (supports .yml and .yaml)
18
- * @param targetDir The repository root directory
19
- * @returns True if the workflow exists
20
- */
21
- copilotSetupWorkflowExists(targetDir: string): Promise<boolean>;
22
- /**
23
- * Gets the path to the Copilot Setup Steps workflow file.
24
- * Returns the actual path if it exists, or the default path if it doesn't.
25
- * @param targetDir The repository root directory
26
- * @returns The workflow file path
27
- */
28
- getCopilotSetupWorkflowPath(targetDir: string): Promise<string>;
29
- /**
30
- * Reads and parses the existing copilot-setup-steps workflow (supports .yml and .yaml)
31
- * @param targetDir The repository root directory
32
- * @returns The parsed workflow object or null if it doesn't exist
33
- */
34
- readCopilotSetupWorkflow(targetDir: string): Promise<unknown | null>;
35
- /**
36
- * Writes the Copilot Setup Steps workflow to the repository
37
- * @param targetDir The repository root directory
38
- * @param content The workflow YAML content
39
- */
40
- writeCopilotSetupWorkflow(targetDir: string, content: string): Promise<void>;
41
- }
42
- export { createWorkflowGateway, FileSystemWorkflowGateway, } from "./file-system-workflow-gateway.js";
43
- //# sourceMappingURL=workflow-gateway.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-gateway.d.ts","sourceRoot":"","sources":["../../src/gateways/workflow-gateway.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,6BAA6B,CACzB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAEjC;;;;OAIG;IACH,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhE;;;;;OAKG;IACH,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhE;;;;OAIG;IACH,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAErE;;;;OAIG;IACH,yBAAyB,CACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAGD,OAAO,EACH,qBAAqB,EACrB,yBAAyB,GAC5B,MAAM,mCAAmC,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Gateway interface for GitHub Actions workflow operations.
3
- */
4
- // Re-export implementation and factory from the implementation file
5
- export { createWorkflowGateway, FileSystemWorkflowGateway, } from "./file-system-workflow-gateway.js";
6
- //# sourceMappingURL=workflow-gateway.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-gateway.js","sourceRoot":"","sources":["../../src/gateways/workflow-gateway.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmDH,oEAAoE;AACpE,OAAO,EACH,qBAAqB,EACrB,yBAAyB,GAC5B,MAAM,mCAAmC,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
@@ -1,28 +0,0 @@
1
- import type { FilesystemStructure } from "./filesystem-structure.js";
2
- /**
3
- * Configuration for lousy-agents init command
4
- */
5
- export interface LousyAgentsConfig {
6
- /**
7
- * Filesystem structures for different project types
8
- */
9
- structures?: {
10
- cli?: FilesystemStructure;
11
- webapp?: FilesystemStructure;
12
- api?: FilesystemStructure;
13
- graphql?: FilesystemStructure;
14
- };
15
- }
16
- /**
17
- * Loads the configuration for the init command
18
- * Falls back to defaults if no configuration is found
19
- * Note: webapp structure is lazy-loaded only when requested
20
- */
21
- export declare function loadInitConfig(): Promise<LousyAgentsConfig>;
22
- /**
23
- * Gets the filesystem structure for a specific project type
24
- * Lazy-loads webapp and REST API structures only when requested
25
- * @throws Error if the project type structure is not defined
26
- */
27
- export declare function getProjectStructure(projectType: "cli" | "webapp" | "api" | "graphql"): Promise<FilesystemStructure>;
28
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAQrE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE;QACT,GAAG,CAAC,EAAE,mBAAmB,CAAC;QAC1B,MAAM,CAAC,EAAE,mBAAmB,CAAC;QAC7B,GAAG,CAAC,EAAE,mBAAmB,CAAC;QAC1B,OAAO,CAAC,EAAE,mBAAmB,CAAC;KACjC,CAAC;CACL;AA8YD;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAiBjE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACrC,WAAW,EAAE,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAClD,OAAO,CAAC,mBAAmB,CAAC,CAsB9B"}
@@ -1,406 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { loadConfig } from "c12";
5
- import { consola } from "consola";
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = dirname(__filename);
8
- const PROJECT_ROOT = join(__dirname, "..", "..");
9
- const WEBAPP_TEMPLATE_DIR = join(PROJECT_ROOT, "ui", "copilot-with-react");
10
- const RESTAPI_TEMPLATE_DIR = join(PROJECT_ROOT, "api", "copilot-with-fastify");
11
- /**
12
- * Default CLI project filesystem structure
13
- */
14
- const DEFAULT_CLI_STRUCTURE = {
15
- nodes: [
16
- {
17
- type: "directory",
18
- path: ".github/instructions",
19
- },
20
- {
21
- type: "file",
22
- path: ".github/copilot-instructions.md",
23
- content: "",
24
- },
25
- ],
26
- };
27
- /**
28
- * Helper function to read template file content
29
- * @throws Error if template file cannot be read
30
- */
31
- function readTemplateFile(relativePath, templateDir = WEBAPP_TEMPLATE_DIR) {
32
- try {
33
- return readFileSync(join(templateDir, relativePath), "utf-8");
34
- }
35
- catch (error) {
36
- const message = error instanceof Error ? error.message : String(error);
37
- const errorMsg = `Failed to read template file ${relativePath}: ${message}`;
38
- consola.error(errorMsg);
39
- throw new Error(errorMsg);
40
- }
41
- }
42
- /**
43
- * Cached webapp structure - lazy-loaded on first access
44
- */
45
- let cachedWebappStructure = null;
46
- /**
47
- * Builds the webapp project filesystem structure by reading template files
48
- * This is called lazily only when webapp scaffolding is needed
49
- */
50
- function buildWebappStructure() {
51
- if (cachedWebappStructure) {
52
- return cachedWebappStructure;
53
- }
54
- cachedWebappStructure = {
55
- nodes: [
56
- // Root configuration files
57
- {
58
- type: "file",
59
- path: "package.json",
60
- content: readTemplateFile("package.json"),
61
- },
62
- {
63
- type: "file",
64
- path: "tsconfig.json",
65
- content: readTemplateFile("tsconfig.json"),
66
- },
67
- {
68
- type: "file",
69
- path: "next.config.ts",
70
- content: readTemplateFile("next.config.ts"),
71
- },
72
- {
73
- type: "file",
74
- path: "vitest.config.ts",
75
- content: readTemplateFile("vitest.config.ts"),
76
- },
77
- {
78
- type: "file",
79
- path: "vitest.setup.ts",
80
- content: readTemplateFile("vitest.setup.ts"),
81
- },
82
- {
83
- type: "file",
84
- path: "biome.json",
85
- content: readTemplateFile("biome.json"),
86
- },
87
- {
88
- type: "file",
89
- path: ".editorconfig",
90
- content: readTemplateFile(".editorconfig"),
91
- },
92
- {
93
- type: "file",
94
- path: ".nvmrc",
95
- content: readTemplateFile(".nvmrc"),
96
- },
97
- {
98
- type: "file",
99
- path: ".yamllint",
100
- content: readTemplateFile(".yamllint"),
101
- },
102
- // GitHub copilot instructions
103
- {
104
- type: "directory",
105
- path: ".github",
106
- },
107
- {
108
- type: "directory",
109
- path: ".github/instructions",
110
- },
111
- {
112
- type: "file",
113
- path: ".github/copilot-instructions.md",
114
- content: readTemplateFile(".github/copilot-instructions.md"),
115
- },
116
- {
117
- type: "file",
118
- path: ".github/instructions/test.instructions.md",
119
- content: readTemplateFile(".github/instructions/test.instructions.md"),
120
- },
121
- {
122
- type: "file",
123
- path: ".github/instructions/spec.instructions.md",
124
- content: readTemplateFile(".github/instructions/spec.instructions.md"),
125
- },
126
- {
127
- type: "file",
128
- path: ".github/instructions/pipeline.instructions.md",
129
- content: readTemplateFile(".github/instructions/pipeline.instructions.md"),
130
- },
131
- {
132
- type: "file",
133
- path: ".github/instructions/software-architecture.instructions.md",
134
- content: readTemplateFile(".github/instructions/software-architecture.instructions.md"),
135
- },
136
- // GitHub Issue Templates
137
- {
138
- type: "directory",
139
- path: ".github/ISSUE_TEMPLATE",
140
- },
141
- {
142
- type: "file",
143
- path: ".github/ISSUE_TEMPLATE/feature-to-spec.yml",
144
- content: readTemplateFile(".github/ISSUE_TEMPLATE/feature-to-spec.yml"),
145
- },
146
- // GitHub Workflows
147
- {
148
- type: "directory",
149
- path: ".github/workflows",
150
- },
151
- {
152
- type: "file",
153
- path: ".github/workflows/assign-copilot.yml",
154
- content: readTemplateFile(".github/workflows/assign-copilot.yml"),
155
- },
156
- // Specs directory
157
- {
158
- type: "directory",
159
- path: ".github/specs",
160
- },
161
- {
162
- type: "file",
163
- path: ".github/specs/README.md",
164
- content: readTemplateFile(".github/specs/README.md"),
165
- },
166
- // VSCode configuration
167
- {
168
- type: "directory",
169
- path: ".vscode",
170
- },
171
- {
172
- type: "file",
173
- path: ".vscode/extensions.json",
174
- content: readTemplateFile(".vscode/extensions.json"),
175
- },
176
- {
177
- type: "file",
178
- path: ".vscode/launch.json",
179
- content: readTemplateFile(".vscode/launch.json"),
180
- },
181
- // Devcontainer configuration
182
- {
183
- type: "directory",
184
- path: ".devcontainer",
185
- },
186
- {
187
- type: "file",
188
- path: ".devcontainer/devcontainer.json",
189
- content: readTemplateFile(".devcontainer/devcontainer.json"),
190
- },
191
- ],
192
- };
193
- return cachedWebappStructure;
194
- }
195
- /**
196
- * Cached REST API structure - lazy-loaded on first access
197
- */
198
- let cachedRestApiStructure = null;
199
- /**
200
- * Helper function to read REST API template files
201
- */
202
- function readRestApiTemplateFile(relativePath) {
203
- return readTemplateFile(relativePath, RESTAPI_TEMPLATE_DIR);
204
- }
205
- /**
206
- * Builds the REST API project filesystem structure by reading template files
207
- * This is called lazily only when REST API scaffolding is needed
208
- */
209
- function buildRestApiStructure() {
210
- if (cachedRestApiStructure) {
211
- return cachedRestApiStructure;
212
- }
213
- cachedRestApiStructure = {
214
- nodes: [
215
- // Root configuration files
216
- {
217
- type: "file",
218
- path: "package.json",
219
- content: readRestApiTemplateFile("package.json"),
220
- },
221
- {
222
- type: "file",
223
- path: "tsconfig.json",
224
- content: readRestApiTemplateFile("tsconfig.json"),
225
- },
226
- {
227
- type: "file",
228
- path: "vitest.config.ts",
229
- content: readRestApiTemplateFile("vitest.config.ts"),
230
- },
231
- {
232
- type: "file",
233
- path: "vitest.integration.config.ts",
234
- content: readRestApiTemplateFile("vitest.integration.config.ts"),
235
- },
236
- {
237
- type: "file",
238
- path: "vitest.setup.ts",
239
- content: readRestApiTemplateFile("vitest.setup.ts"),
240
- },
241
- {
242
- type: "file",
243
- path: "biome.json",
244
- content: readRestApiTemplateFile("biome.json"),
245
- },
246
- {
247
- type: "file",
248
- path: ".editorconfig",
249
- content: readRestApiTemplateFile(".editorconfig"),
250
- },
251
- {
252
- type: "file",
253
- path: ".nvmrc",
254
- content: readRestApiTemplateFile(".nvmrc"),
255
- },
256
- {
257
- type: "file",
258
- path: ".yamllint",
259
- content: readRestApiTemplateFile(".yamllint"),
260
- },
261
- // GitHub copilot instructions
262
- {
263
- type: "directory",
264
- path: ".github",
265
- },
266
- {
267
- type: "directory",
268
- path: ".github/instructions",
269
- },
270
- {
271
- type: "file",
272
- path: ".github/copilot-instructions.md",
273
- content: readRestApiTemplateFile(".github/copilot-instructions.md"),
274
- },
275
- {
276
- type: "file",
277
- path: ".github/instructions/test.instructions.md",
278
- content: readRestApiTemplateFile(".github/instructions/test.instructions.md"),
279
- },
280
- {
281
- type: "file",
282
- path: ".github/instructions/spec.instructions.md",
283
- content: readRestApiTemplateFile(".github/instructions/spec.instructions.md"),
284
- },
285
- {
286
- type: "file",
287
- path: ".github/instructions/pipeline.instructions.md",
288
- content: readRestApiTemplateFile(".github/instructions/pipeline.instructions.md"),
289
- },
290
- {
291
- type: "file",
292
- path: ".github/instructions/software-architecture.instructions.md",
293
- content: readRestApiTemplateFile(".github/instructions/software-architecture.instructions.md"),
294
- },
295
- // GitHub Issue Templates
296
- {
297
- type: "directory",
298
- path: ".github/ISSUE_TEMPLATE",
299
- },
300
- {
301
- type: "file",
302
- path: ".github/ISSUE_TEMPLATE/feature-to-spec.yml",
303
- content: readRestApiTemplateFile(".github/ISSUE_TEMPLATE/feature-to-spec.yml"),
304
- },
305
- // GitHub Workflows
306
- {
307
- type: "directory",
308
- path: ".github/workflows",
309
- },
310
- {
311
- type: "file",
312
- path: ".github/workflows/assign-copilot.yml",
313
- content: readRestApiTemplateFile(".github/workflows/assign-copilot.yml"),
314
- },
315
- {
316
- type: "file",
317
- path: ".github/workflows/ci.yml",
318
- content: readRestApiTemplateFile(".github/workflows/ci.yml"),
319
- },
320
- // Specs directory
321
- {
322
- type: "directory",
323
- path: ".github/specs",
324
- },
325
- {
326
- type: "file",
327
- path: ".github/specs/README.md",
328
- content: readRestApiTemplateFile(".github/specs/README.md"),
329
- },
330
- // VSCode configuration
331
- {
332
- type: "directory",
333
- path: ".vscode",
334
- },
335
- {
336
- type: "file",
337
- path: ".vscode/extensions.json",
338
- content: readRestApiTemplateFile(".vscode/extensions.json"),
339
- },
340
- {
341
- type: "file",
342
- path: ".vscode/launch.json",
343
- content: readRestApiTemplateFile(".vscode/launch.json"),
344
- },
345
- {
346
- type: "file",
347
- path: ".vscode/mcp.json",
348
- content: readRestApiTemplateFile(".vscode/mcp.json"),
349
- },
350
- // Devcontainer configuration
351
- {
352
- type: "directory",
353
- path: ".devcontainer",
354
- },
355
- {
356
- type: "file",
357
- path: ".devcontainer/devcontainer.json",
358
- content: readRestApiTemplateFile(".devcontainer/devcontainer.json"),
359
- },
360
- ],
361
- };
362
- return cachedRestApiStructure;
363
- }
364
- /**
365
- * Loads the configuration for the init command
366
- * Falls back to defaults if no configuration is found
367
- * Note: webapp structure is lazy-loaded only when requested
368
- */
369
- export async function loadInitConfig() {
370
- const { config } = await loadConfig({
371
- name: "lousy-agents",
372
- defaults: {
373
- structures: {
374
- cli: DEFAULT_CLI_STRUCTURE,
375
- },
376
- },
377
- });
378
- return (config || {
379
- structures: {
380
- cli: DEFAULT_CLI_STRUCTURE,
381
- },
382
- });
383
- }
384
- /**
385
- * Gets the filesystem structure for a specific project type
386
- * Lazy-loads webapp and REST API structures only when requested
387
- * @throws Error if the project type structure is not defined
388
- */
389
- export async function getProjectStructure(projectType) {
390
- const config = await loadInitConfig();
391
- // Lazy-load webapp structure only when requested
392
- if (projectType === "webapp") {
393
- return config.structures?.webapp || buildWebappStructure();
394
- }
395
- // Lazy-load REST API structure only when requested
396
- if (projectType === "api") {
397
- return config.structures?.api || buildRestApiStructure();
398
- }
399
- // CLI has a default structure
400
- if (projectType === "cli") {
401
- return config.structures?.cli || DEFAULT_CLI_STRUCTURE;
402
- }
403
- // GraphQL is not yet implemented
404
- throw new Error(`Project type "${projectType}" is not yet supported. Supported types: cli, webapp, api`);
405
- }
406
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO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AAc;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,CAAoB;QACnD,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE;YACN,UAAU,EAAE;gBACR,GAAG,EAAE,qBAAqB;aAC7B;SACJ;KACJ,CAAC,CAAC;IAEH,OAAO,CACH,MAAM,IAAI;QACN,UAAU,EAAE;YACR,GAAG,EAAE,qBAAqB;SAC7B;KACJ,CACJ,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACrC,WAAiD;IAEjD,MAAM,MAAM,GAAG,MAAM,cAAc,EAAE,CAAC;IAEtC,iDAAiD;IACjD,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,MAAM,CAAC,UAAU,EAAE,MAAM,IAAI,oBAAoB,EAAE,CAAC;IAC/D,CAAC;IAED,mDAAmD;IACnD,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,UAAU,EAAE,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAC7D,CAAC;IAED,8BAA8B;IAC9B,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,UAAU,EAAE,GAAG,IAAI,qBAAqB,CAAC;IAC3D,CAAC;IAED,iCAAiC;IACjC,MAAM,IAAI,KAAK,CACX,iBAAiB,WAAW,2DAA2D,CAC1F,CAAC;AACN,CAAC"}
@@ -1,79 +0,0 @@
1
- /**
2
- * Configuration for the copilot-setup command.
3
- * Uses c12 for configuration loading, allowing runtime customization.
4
- */
5
- import type { VersionFileType } from "../entities/copilot-setup.js";
6
- /**
7
- * Configuration for a version file mapping
8
- */
9
- export interface VersionFileMapping {
10
- /**
11
- * The filename to detect (e.g., ".nvmrc")
12
- */
13
- filename: string;
14
- /**
15
- * The version file type (e.g., "node")
16
- */
17
- type: VersionFileType;
18
- }
19
- /**
20
- * Configuration for a setup action
21
- */
22
- export interface SetupActionConfig {
23
- /**
24
- * The action name (e.g., "actions/setup-node")
25
- */
26
- action: string;
27
- /**
28
- * The version file type this action handles
29
- */
30
- type: VersionFileType;
31
- /**
32
- * The "with" config key for version file (e.g., "node-version-file")
33
- */
34
- versionFileKey: string;
35
- }
36
- /**
37
- * Configuration for copilot-setup command
38
- */
39
- export interface CopilotSetupConfig {
40
- /**
41
- * List of idiomatic version files to detect
42
- */
43
- versionFiles: VersionFileMapping[];
44
- /**
45
- * List of setup actions and their configuration
46
- */
47
- setupActions: SetupActionConfig[];
48
- /**
49
- * List of action patterns to detect in existing workflows
50
- */
51
- setupActionPatterns: string[];
52
- }
53
- /**
54
- * Loads the copilot-setup configuration using c12
55
- * Falls back to defaults if no configuration is found
56
- */
57
- export declare function loadCopilotSetupConfig(): Promise<CopilotSetupConfig>;
58
- /**
59
- * Resets the cached configuration (useful for testing)
60
- *
61
- * This function is retained for backwards compatibility but is a no-op
62
- * because configuration is no longer cached at module scope.
63
- */
64
- export declare function resetCopilotSetupConfigCache(): void;
65
- /**
66
- * Gets a version file type to action mapping from config
67
- * Returns a partial record as not all types may be configured
68
- */
69
- export declare function getVersionTypeToActionMap(config: CopilotSetupConfig): Partial<Record<VersionFileType, string>>;
70
- /**
71
- * Gets a version file type to config key mapping from config
72
- * Returns a partial record as not all types may be configured
73
- */
74
- export declare function getVersionFileConfigKeyMap(config: CopilotSetupConfig): Partial<Record<VersionFileType, string>>;
75
- /**
76
- * Gets a filename to version type mapping from config
77
- */
78
- export declare function getVersionFilenameToTypeMap(config: CopilotSetupConfig): Record<string, VersionFileType>;
79
- //# sourceMappingURL=copilot-setup-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copilot-setup-config.d.ts","sourceRoot":"","sources":["../../src/lib/copilot-setup-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IACtB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC;;OAEG;IACH,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC;;OAEG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;CACjC;AAkED;;;GAGG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAQ1E;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACrC,MAAM,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAM1C;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACtC,MAAM,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAM1C;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACvC,MAAM,EAAE,kBAAkB,GAC3B,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAMjC"}