@lousy-agents/cli 1.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.
Files changed (151) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +148 -0
  3. package/dist/commands/copilot-setup.d.ts +5 -0
  4. package/dist/commands/copilot-setup.d.ts.map +1 -0
  5. package/dist/commands/copilot-setup.js +97 -0
  6. package/dist/commands/copilot-setup.js.map +1 -0
  7. package/dist/commands/init.d.ts +12 -0
  8. package/dist/commands/init.d.ts.map +1 -0
  9. package/dist/commands/init.js +115 -0
  10. package/dist/commands/init.js.map +1 -0
  11. package/dist/commands/new.d.ts +11 -0
  12. package/dist/commands/new.d.ts.map +1 -0
  13. package/dist/commands/new.js +41 -0
  14. package/dist/commands/new.js.map +1 -0
  15. package/dist/entities/copilot-agent.d.ts +15 -0
  16. package/dist/entities/copilot-agent.d.ts.map +1 -0
  17. package/dist/entities/copilot-agent.js +53 -0
  18. package/dist/entities/copilot-agent.js.map +1 -0
  19. package/dist/entities/copilot-setup.d.ts +65 -0
  20. package/dist/entities/copilot-setup.d.ts.map +1 -0
  21. package/dist/entities/copilot-setup.js +6 -0
  22. package/dist/entities/copilot-setup.js.map +1 -0
  23. package/dist/entities/index.d.ts +6 -0
  24. package/dist/entities/index.d.ts.map +1 -0
  25. package/dist/entities/index.js +6 -0
  26. package/dist/entities/index.js.map +1 -0
  27. package/dist/gateways/action-version-gateway.d.ts +39 -0
  28. package/dist/gateways/action-version-gateway.d.ts.map +1 -0
  29. package/dist/gateways/action-version-gateway.js +47 -0
  30. package/dist/gateways/action-version-gateway.js.map +1 -0
  31. package/dist/gateways/agent-file-gateway.d.ts +50 -0
  32. package/dist/gateways/agent-file-gateway.d.ts.map +1 -0
  33. package/dist/gateways/agent-file-gateway.js +34 -0
  34. package/dist/gateways/agent-file-gateway.js.map +1 -0
  35. package/dist/gateways/environment-gateway.d.ts +30 -0
  36. package/dist/gateways/environment-gateway.d.ts.map +1 -0
  37. package/dist/gateways/environment-gateway.js +56 -0
  38. package/dist/gateways/environment-gateway.js.map +1 -0
  39. package/dist/gateways/file-system-utils.d.ts +8 -0
  40. package/dist/gateways/file-system-utils.d.ts.map +1 -0
  41. package/dist/gateways/file-system-utils.js +17 -0
  42. package/dist/gateways/file-system-utils.js.map +1 -0
  43. package/dist/gateways/file-system-workflow-gateway.d.ts +27 -0
  44. package/dist/gateways/file-system-workflow-gateway.d.ts.map +1 -0
  45. package/dist/gateways/file-system-workflow-gateway.js +99 -0
  46. package/dist/gateways/file-system-workflow-gateway.js.map +1 -0
  47. package/dist/gateways/index.d.ts +9 -0
  48. package/dist/gateways/index.d.ts.map +1 -0
  49. package/dist/gateways/index.js +9 -0
  50. package/dist/gateways/index.js.map +1 -0
  51. package/dist/gateways/workflow-gateway.d.ts +43 -0
  52. package/dist/gateways/workflow-gateway.d.ts.map +1 -0
  53. package/dist/gateways/workflow-gateway.js +6 -0
  54. package/dist/gateways/workflow-gateway.js.map +1 -0
  55. package/dist/index.d.ts +3 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +19 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/lib/config.d.ts +27 -0
  60. package/dist/lib/config.d.ts.map +1 -0
  61. package/dist/lib/config.js +226 -0
  62. package/dist/lib/config.js.map +1 -0
  63. package/dist/lib/copilot-setup-config.d.ts +79 -0
  64. package/dist/lib/copilot-setup-config.d.ts.map +1 -0
  65. package/dist/lib/copilot-setup-config.js +119 -0
  66. package/dist/lib/copilot-setup-config.js.map +1 -0
  67. package/dist/lib/filesystem-structure.d.ts +45 -0
  68. package/dist/lib/filesystem-structure.d.ts.map +1 -0
  69. package/dist/lib/filesystem-structure.js +69 -0
  70. package/dist/lib/filesystem-structure.js.map +1 -0
  71. package/dist/lib/mcp-test-client.d.ts +43 -0
  72. package/dist/lib/mcp-test-client.d.ts.map +1 -0
  73. package/dist/lib/mcp-test-client.js +167 -0
  74. package/dist/lib/mcp-test-client.js.map +1 -0
  75. package/dist/lib/project-name-validation.d.ts +43 -0
  76. package/dist/lib/project-name-validation.d.ts.map +1 -0
  77. package/dist/lib/project-name-validation.js +131 -0
  78. package/dist/lib/project-name-validation.js.map +1 -0
  79. package/dist/mcp/index.d.ts +5 -0
  80. package/dist/mcp/index.d.ts.map +1 -0
  81. package/dist/mcp/index.js +5 -0
  82. package/dist/mcp/index.js.map +1 -0
  83. package/dist/mcp/server.d.ts +15 -0
  84. package/dist/mcp/server.d.ts.map +1 -0
  85. package/dist/mcp/server.js +120 -0
  86. package/dist/mcp/server.js.map +1 -0
  87. package/dist/mcp/tools/analyze-action-versions.d.ts +9 -0
  88. package/dist/mcp/tools/analyze-action-versions.d.ts.map +1 -0
  89. package/dist/mcp/tools/analyze-action-versions.js +81 -0
  90. package/dist/mcp/tools/analyze-action-versions.js.map +1 -0
  91. package/dist/mcp/tools/create-copilot-setup-workflow.d.ts +9 -0
  92. package/dist/mcp/tools/create-copilot-setup-workflow.d.ts.map +1 -0
  93. package/dist/mcp/tools/create-copilot-setup-workflow.js +121 -0
  94. package/dist/mcp/tools/create-copilot-setup-workflow.js.map +1 -0
  95. package/dist/mcp/tools/discover-environment.d.ts +9 -0
  96. package/dist/mcp/tools/discover-environment.d.ts.map +1 -0
  97. package/dist/mcp/tools/discover-environment.js +30 -0
  98. package/dist/mcp/tools/discover-environment.js.map +1 -0
  99. package/dist/mcp/tools/discover-workflow-setup-actions.d.ts +9 -0
  100. package/dist/mcp/tools/discover-workflow-setup-actions.d.ts.map +1 -0
  101. package/dist/mcp/tools/discover-workflow-setup-actions.js +37 -0
  102. package/dist/mcp/tools/discover-workflow-setup-actions.js.map +1 -0
  103. package/dist/mcp/tools/index.d.ts +11 -0
  104. package/dist/mcp/tools/index.d.ts.map +1 -0
  105. package/dist/mcp/tools/index.js +11 -0
  106. package/dist/mcp/tools/index.js.map +1 -0
  107. package/dist/mcp/tools/read-copilot-setup-workflow.d.ts +9 -0
  108. package/dist/mcp/tools/read-copilot-setup-workflow.d.ts.map +1 -0
  109. package/dist/mcp/tools/read-copilot-setup-workflow.js +38 -0
  110. package/dist/mcp/tools/read-copilot-setup-workflow.js.map +1 -0
  111. package/dist/mcp/tools/resolve-action-versions.d.ts +10 -0
  112. package/dist/mcp/tools/resolve-action-versions.d.ts.map +1 -0
  113. package/dist/mcp/tools/resolve-action-versions.js +61 -0
  114. package/dist/mcp/tools/resolve-action-versions.js.map +1 -0
  115. package/dist/mcp/tools/types.d.ts +67 -0
  116. package/dist/mcp/tools/types.d.ts.map +1 -0
  117. package/dist/mcp/tools/types.js +24 -0
  118. package/dist/mcp/tools/types.js.map +1 -0
  119. package/dist/mcp-server.d.ts +7 -0
  120. package/dist/mcp-server.d.ts.map +1 -0
  121. package/dist/mcp-server.js +17 -0
  122. package/dist/mcp-server.js.map +1 -0
  123. package/dist/use-cases/action-resolution.d.ts +66 -0
  124. package/dist/use-cases/action-resolution.d.ts.map +1 -0
  125. package/dist/use-cases/action-resolution.js +107 -0
  126. package/dist/use-cases/action-resolution.js.map +1 -0
  127. package/dist/use-cases/candidate-builder.d.ts +17 -0
  128. package/dist/use-cases/candidate-builder.d.ts.map +1 -0
  129. package/dist/use-cases/candidate-builder.js +67 -0
  130. package/dist/use-cases/candidate-builder.js.map +1 -0
  131. package/dist/use-cases/copilot-setup.d.ts +8 -0
  132. package/dist/use-cases/copilot-setup.d.ts.map +1 -0
  133. package/dist/use-cases/copilot-setup.js +10 -0
  134. package/dist/use-cases/copilot-setup.js.map +1 -0
  135. package/dist/use-cases/create-copilot-agent.d.ts +29 -0
  136. package/dist/use-cases/create-copilot-agent.d.ts.map +1 -0
  137. package/dist/use-cases/create-copilot-agent.js +73 -0
  138. package/dist/use-cases/create-copilot-agent.js.map +1 -0
  139. package/dist/use-cases/index.d.ts +9 -0
  140. package/dist/use-cases/index.d.ts.map +1 -0
  141. package/dist/use-cases/index.js +9 -0
  142. package/dist/use-cases/index.js.map +1 -0
  143. package/dist/use-cases/setup-step-discovery.d.ts +87 -0
  144. package/dist/use-cases/setup-step-discovery.d.ts.map +1 -0
  145. package/dist/use-cases/setup-step-discovery.js +202 -0
  146. package/dist/use-cases/setup-step-discovery.js.map +1 -0
  147. package/dist/use-cases/workflow-generator.d.ts +34 -0
  148. package/dist/use-cases/workflow-generator.d.ts.map +1 -0
  149. package/dist/use-cases/workflow-generator.js +195 -0
  150. package/dist/use-cases/workflow-generator.js.map +1 -0
  151. package/package.json +65 -0
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Entities - Core domain types and interfaces
3
+ */
4
+ export * from "./copilot-agent.js";
5
+ export * from "./copilot-setup.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Gateway for looking up GitHub Actions versions.
3
+ * This module abstracts version lookup to enable future remote API sourcing.
4
+ */
5
+ /**
6
+ * Interface for action version gateway
7
+ * Allows for different implementations (local, remote API, etc.)
8
+ */
9
+ export interface ActionVersionGateway {
10
+ /**
11
+ * Retrieves the version for a given action
12
+ * @param actionName The fully qualified action name (e.g., "actions/setup-node")
13
+ * @returns The version string (e.g., "v4") or undefined if not found
14
+ */
15
+ getVersion(actionName: string): Promise<string | undefined>;
16
+ /**
17
+ * Retrieves versions for multiple actions
18
+ * @param actionNames Array of fully qualified action names
19
+ * @returns Record mapping action names to their versions
20
+ */
21
+ getVersions(actionNames: string[]): Promise<Record<string, string>>;
22
+ }
23
+ /**
24
+ * Default implementation that uses local default versions.
25
+ * This can be replaced with a remote API implementation in the future.
26
+ */
27
+ export declare class LocalActionVersionGateway implements ActionVersionGateway {
28
+ getVersion(actionName: string): Promise<string | undefined>;
29
+ getVersions(actionNames: string[]): Promise<Record<string, string>>;
30
+ }
31
+ /**
32
+ * Creates and returns the default action version gateway
33
+ */
34
+ export declare function createActionVersionGateway(): ActionVersionGateway;
35
+ /**
36
+ * List of known action names for convenience
37
+ */
38
+ export declare const KNOWN_ACTIONS: string[];
39
+ //# sourceMappingURL=action-version-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-version-gateway.d.ts","sourceRoot":"","sources":["../../src/gateways/action-version-gateway.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;;OAIG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAE5D;;;;OAIG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvE;AAED;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,oBAAoB;IAC5D,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAK3D,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAU5E;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,oBAAoB,CAEjE;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,UAAuC,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Gateway for looking up GitHub Actions versions.
3
+ * This module abstracts version lookup to enable future remote API sourcing.
4
+ */
5
+ /**
6
+ * Default versions for setup actions (used as fallback)
7
+ */
8
+ const DEFAULT_ACTION_VERSIONS = {
9
+ "actions/checkout": "v4",
10
+ "actions/setup-node": "v4",
11
+ "actions/setup-python": "v5",
12
+ "actions/setup-java": "v4",
13
+ "actions/setup-ruby": "v1",
14
+ "actions/setup-go": "v5",
15
+ "jdx/mise-action": "v2",
16
+ };
17
+ /**
18
+ * Default implementation that uses local default versions.
19
+ * This can be replaced with a remote API implementation in the future.
20
+ */
21
+ export class LocalActionVersionGateway {
22
+ async getVersion(actionName) {
23
+ // Simulate async lookup (for future remote API compatibility)
24
+ return DEFAULT_ACTION_VERSIONS[actionName];
25
+ }
26
+ async getVersions(actionNames) {
27
+ const result = {};
28
+ for (const actionName of actionNames) {
29
+ const version = await this.getVersion(actionName);
30
+ if (version) {
31
+ result[actionName] = version;
32
+ }
33
+ }
34
+ return result;
35
+ }
36
+ }
37
+ /**
38
+ * Creates and returns the default action version gateway
39
+ */
40
+ export function createActionVersionGateway() {
41
+ return new LocalActionVersionGateway();
42
+ }
43
+ /**
44
+ * List of known action names for convenience
45
+ */
46
+ export const KNOWN_ACTIONS = Object.keys(DEFAULT_ACTION_VERSIONS);
47
+ //# sourceMappingURL=action-version-gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-version-gateway.js","sourceRoot":"","sources":["../../src/gateways/action-version-gateway.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,uBAAuB,GAA2B;IACpD,kBAAkB,EAAE,IAAI;IACxB,oBAAoB,EAAE,IAAI;IAC1B,sBAAsB,EAAE,IAAI;IAC5B,oBAAoB,EAAE,IAAI;IAC1B,oBAAoB,EAAE,IAAI;IAC1B,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;CAC1B,CAAC;AAsBF;;;GAGG;AACH,MAAM,OAAO,yBAAyB;IAClC,KAAK,CAAC,UAAU,CAAC,UAAkB;QAC/B,8DAA8D;QAC9D,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,WAAqB;QACnC,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAClD,IAAI,OAAO,EAAE,CAAC;gBACV,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC;YACjC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B;IACtC,OAAO,IAAI,yBAAyB,EAAE,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Gateway for agent file system operations.
3
+ * This module abstracts file system access for custom Copilot agent files.
4
+ */
5
+ /**
6
+ * Interface for agent file gateway
7
+ * Allows for different implementations (file system, mock, etc.)
8
+ */
9
+ export interface AgentFileGateway {
10
+ /**
11
+ * Checks if an agent file already exists
12
+ * @param targetDir The root directory of the repository
13
+ * @param agentName The normalized name of the agent
14
+ * @returns true if the agent file exists
15
+ */
16
+ agentFileExists(targetDir: string, agentName: string): Promise<boolean>;
17
+ /**
18
+ * Ensures the .github/agents directory exists
19
+ * @param targetDir The root directory of the repository
20
+ */
21
+ ensureAgentsDirectory(targetDir: string): Promise<void>;
22
+ /**
23
+ * Writes content to an agent file
24
+ * @param targetDir The root directory of the repository
25
+ * @param agentName The normalized name of the agent
26
+ * @param content The content to write to the file
27
+ */
28
+ writeAgentFile(targetDir: string, agentName: string, content: string): Promise<void>;
29
+ /**
30
+ * Returns the full path to an agent file
31
+ * @param targetDir The root directory of the repository
32
+ * @param agentName The normalized name of the agent
33
+ * @returns The full path to the agent file
34
+ */
35
+ getAgentFilePath(targetDir: string, agentName: string): string;
36
+ }
37
+ /**
38
+ * File system implementation of the agent file gateway
39
+ */
40
+ export declare class FileSystemAgentFileGateway implements AgentFileGateway {
41
+ getAgentFilePath(targetDir: string, agentName: string): string;
42
+ agentFileExists(targetDir: string, agentName: string): Promise<boolean>;
43
+ ensureAgentsDirectory(targetDir: string): Promise<void>;
44
+ writeAgentFile(targetDir: string, agentName: string, content: string): Promise<void>;
45
+ }
46
+ /**
47
+ * Creates and returns the default agent file gateway
48
+ */
49
+ export declare function createAgentFileGateway(): AgentFileGateway;
50
+ //# sourceMappingURL=agent-file-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-file-gateway.d.ts","sourceRoot":"","sources":["../../src/gateways/agent-file-gateway.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAExE;;;OAGG;IACH,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;OAKG;IACH,cAAc,CACV,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CAClE;AAED;;GAEG;AACH,qBAAa,0BAA2B,YAAW,gBAAgB;IAC/D,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAIxD,eAAe,CACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC;IAKb,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvD,cAAc,CAChB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;CAInB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,CAEzD"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Gateway for agent file system operations.
3
+ * This module abstracts file system access for custom Copilot agent 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 agent file gateway
10
+ */
11
+ export class FileSystemAgentFileGateway {
12
+ getAgentFilePath(targetDir, agentName) {
13
+ return join(targetDir, ".github", "agents", `${agentName}.md`);
14
+ }
15
+ async agentFileExists(targetDir, agentName) {
16
+ const filePath = this.getAgentFilePath(targetDir, agentName);
17
+ return fileExists(filePath);
18
+ }
19
+ async ensureAgentsDirectory(targetDir) {
20
+ const agentsDir = join(targetDir, ".github", "agents");
21
+ await mkdir(agentsDir, { recursive: true });
22
+ }
23
+ async writeAgentFile(targetDir, agentName, content) {
24
+ const filePath = this.getAgentFilePath(targetDir, agentName);
25
+ await writeFile(filePath, content, { encoding: "utf-8" });
26
+ }
27
+ }
28
+ /**
29
+ * Creates and returns the default agent file gateway
30
+ */
31
+ export function createAgentFileGateway() {
32
+ return new FileSystemAgentFileGateway();
33
+ }
34
+ //# sourceMappingURL=agent-file-gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-file-gateway.js","sourceRoot":"","sources":["../../src/gateways/agent-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;AA0CpD;;GAEG;AACH,MAAM,OAAO,0BAA0B;IACnC,gBAAgB,CAAC,SAAiB,EAAE,SAAiB;QACjD,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,KAAK,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,eAAe,CACjB,SAAiB,EACjB,SAAiB;QAEjB,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC7D,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,SAAiB;QACzC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,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"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Gateway for environment detection file system operations.
3
+ * This module abstracts file system access for environment configuration detection.
4
+ */
5
+ import type { DetectedEnvironment } from "../entities/copilot-setup.js";
6
+ /**
7
+ * Interface for environment detection gateway
8
+ * Allows for different implementations (file system, mock, etc.)
9
+ */
10
+ export interface EnvironmentGateway {
11
+ /**
12
+ * Detects environment configuration in the specified directory
13
+ * @param targetDir The directory to scan for configuration files
14
+ * @returns Detected environment configuration
15
+ */
16
+ detectEnvironment(targetDir: string): Promise<DetectedEnvironment>;
17
+ }
18
+ /**
19
+ * File system implementation of the environment gateway
20
+ */
21
+ export declare class FileSystemEnvironmentGateway implements EnvironmentGateway {
22
+ private config;
23
+ private getConfig;
24
+ detectEnvironment(targetDir: string): Promise<DetectedEnvironment>;
25
+ }
26
+ /**
27
+ * Creates and returns the default environment gateway
28
+ */
29
+ export declare function createEnvironmentGateway(): EnvironmentGateway;
30
+ //# sourceMappingURL=environment-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-gateway.d.ts","sourceRoot":"","sources":["../../src/gateways/environment-gateway.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EACR,mBAAmB,EAEtB,MAAM,8BAA8B,CAAC;AAQtC;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;OAIG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACtE;AAUD;;GAEG;AACH,qBAAa,4BAA6B,YAAW,kBAAkB;IACnE,OAAO,CAAC,MAAM,CAAmC;YAEnC,SAAS;IAOjB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA0B3E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,kBAAkB,CAE7D"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Gateway for environment detection file system operations.
3
+ * This module abstracts file system access for environment configuration detection.
4
+ */
5
+ import { readFile } from "node:fs/promises";
6
+ import { join } from "node:path";
7
+ import { getVersionFilenameToTypeMap, loadCopilotSetupConfig, } from "../lib/copilot-setup-config.js";
8
+ import { fileExists } from "./file-system-utils.js";
9
+ /**
10
+ * Reads the content of a version file and trims whitespace
11
+ */
12
+ async function readVersionFileContent(filePath) {
13
+ const content = await readFile(filePath, "utf-8");
14
+ return content.trim();
15
+ }
16
+ /**
17
+ * File system implementation of the environment gateway
18
+ */
19
+ export class FileSystemEnvironmentGateway {
20
+ config = null;
21
+ async getConfig() {
22
+ if (!this.config) {
23
+ this.config = await loadCopilotSetupConfig();
24
+ }
25
+ return this.config;
26
+ }
27
+ async detectEnvironment(targetDir) {
28
+ const miseTomlPath = join(targetDir, "mise.toml");
29
+ const hasMise = await fileExists(miseTomlPath);
30
+ const config = await this.getConfig();
31
+ const filenameToType = getVersionFilenameToTypeMap(config);
32
+ const versionFiles = [];
33
+ for (const fileConfig of config.versionFiles) {
34
+ const filePath = join(targetDir, fileConfig.filename);
35
+ if (await fileExists(filePath)) {
36
+ const version = await readVersionFileContent(filePath);
37
+ versionFiles.push({
38
+ type: filenameToType[fileConfig.filename],
39
+ filename: fileConfig.filename,
40
+ version: version || undefined,
41
+ });
42
+ }
43
+ }
44
+ return {
45
+ hasMise,
46
+ versionFiles,
47
+ };
48
+ }
49
+ }
50
+ /**
51
+ * Creates and returns the default environment gateway
52
+ */
53
+ export function createEnvironmentGateway() {
54
+ return new FileSystemEnvironmentGateway();
55
+ }
56
+ //# sourceMappingURL=environment-gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-gateway.js","sourceRoot":"","sources":["../../src/gateways/environment-gateway.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,EAEH,2BAA2B,EAC3B,sBAAsB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAepD;;GAEG;AACH,KAAK,UAAU,sBAAsB,CAAC,QAAgB;IAClD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,4BAA4B;IAC7B,MAAM,GAA8B,IAAI,CAAC;IAEzC,KAAK,CAAC,SAAS;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,GAAG,MAAM,sBAAsB,EAAE,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,SAAiB;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC;QAE/C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACtC,MAAM,cAAc,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAC;QAE3D,MAAM,YAAY,GAAkB,EAAE,CAAC;QAEvC,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,MAAM,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC7B,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,QAAQ,CAAC,CAAC;gBACvD,YAAY,CAAC,IAAI,CAAC;oBACd,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;oBACzC,QAAQ,EAAE,UAAU,CAAC,QAAQ;oBAC7B,OAAO,EAAE,OAAO,IAAI,SAAS;iBAChC,CAAC,CAAC;YACP,CAAC;QACL,CAAC;QAED,OAAO;YACH,OAAO;YACP,YAAY;SACf,CAAC;IACN,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACpC,OAAO,IAAI,4BAA4B,EAAE,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shared file system utilities for gateways.
3
+ */
4
+ /**
5
+ * Checks if a file or directory exists
6
+ */
7
+ export declare function fileExists(path: string): Promise<boolean>;
8
+ //# sourceMappingURL=file-system-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system-utils.d.ts","sourceRoot":"","sources":["../../src/gateways/file-system-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shared file system utilities for gateways.
3
+ */
4
+ import { access } from "node:fs/promises";
5
+ /**
6
+ * Checks if a file or directory exists
7
+ */
8
+ export async function fileExists(path) {
9
+ try {
10
+ await access(path);
11
+ return true;
12
+ }
13
+ catch {
14
+ return false;
15
+ }
16
+ }
17
+ //# sourceMappingURL=file-system-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system-utils.js","sourceRoot":"","sources":["../../src/gateways/file-system-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY;IACzC,IAAI,CAAC;QACD,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * File system implementation of the workflow gateway.
3
+ */
4
+ import type { SetupStepCandidate } from "../entities/copilot-setup.js";
5
+ import type { WorkflowGateway } from "./workflow-gateway.js";
6
+ /**
7
+ * File system implementation of the workflow gateway
8
+ */
9
+ export declare class FileSystemWorkflowGateway implements WorkflowGateway {
10
+ private config;
11
+ private getConfig;
12
+ /**
13
+ * Finds the path to an existing Copilot Setup Steps workflow file.
14
+ * @returns The full path if found, or null if no workflow exists.
15
+ */
16
+ private findCopilotSetupWorkflowPath;
17
+ parseWorkflowsForSetupActions(targetDir: string): Promise<SetupStepCandidate[]>;
18
+ copilotSetupWorkflowExists(targetDir: string): Promise<boolean>;
19
+ getCopilotSetupWorkflowPath(targetDir: string): Promise<string>;
20
+ readCopilotSetupWorkflow(targetDir: string): Promise<unknown | null>;
21
+ writeCopilotSetupWorkflow(targetDir: string, content: string): Promise<void>;
22
+ }
23
+ /**
24
+ * Creates and returns the default workflow gateway
25
+ */
26
+ export declare function createWorkflowGateway(): WorkflowGateway;
27
+ //# sourceMappingURL=file-system-workflow-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system-workflow-gateway.d.ts","sourceRoot":"","sources":["../../src/gateways/file-system-workflow-gateway.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAUvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAW7D;;GAEG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAC7D,OAAO,CAAC,MAAM,CAAmC;YAEnC,SAAS;IAOvB;;;OAGG;YACW,4BAA4B;IAapC,6BAA6B,CAC/B,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAkC1B,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK/D,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ/D,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAWpE,yBAAyB,CAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;CAWnB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,CAEvD"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * File system implementation of the workflow gateway.
3
+ */
4
+ import { readdir, readFile, writeFile } from "node:fs/promises";
5
+ import { join } from "node:path";
6
+ import { parse as parseYaml } from "yaml";
7
+ import { loadCopilotSetupConfig, } from "../lib/copilot-setup-config.js";
8
+ import { deduplicateCandidates, extractSetupStepsFromWorkflow, } from "../use-cases/setup-step-discovery.js";
9
+ import { fileExists } from "./file-system-utils.js";
10
+ /**
11
+ * Possible filenames for the Copilot Setup Steps workflow.
12
+ * Supports both .yml and .yaml extensions.
13
+ */
14
+ const COPILOT_SETUP_WORKFLOW_FILENAMES = [
15
+ "copilot-setup-steps.yml",
16
+ "copilot-setup-steps.yaml",
17
+ ];
18
+ /**
19
+ * File system implementation of the workflow gateway
20
+ */
21
+ export class FileSystemWorkflowGateway {
22
+ config = null;
23
+ async getConfig() {
24
+ if (!this.config) {
25
+ this.config = await loadCopilotSetupConfig();
26
+ }
27
+ return this.config;
28
+ }
29
+ /**
30
+ * Finds the path to an existing Copilot Setup Steps workflow file.
31
+ * @returns The full path if found, or null if no workflow exists.
32
+ */
33
+ async findCopilotSetupWorkflowPath(targetDir) {
34
+ const workflowsDir = join(targetDir, ".github", "workflows");
35
+ for (const filename of COPILOT_SETUP_WORKFLOW_FILENAMES) {
36
+ const workflowPath = join(workflowsDir, filename);
37
+ if (await fileExists(workflowPath)) {
38
+ return workflowPath;
39
+ }
40
+ }
41
+ return null;
42
+ }
43
+ async parseWorkflowsForSetupActions(targetDir) {
44
+ const workflowsDir = join(targetDir, ".github", "workflows");
45
+ if (!(await fileExists(workflowsDir))) {
46
+ return [];
47
+ }
48
+ const files = await readdir(workflowsDir);
49
+ const yamlFiles = files.filter((f) => f.endsWith(".yml") || f.endsWith(".yaml"));
50
+ const config = await this.getConfig();
51
+ const allCandidates = [];
52
+ for (const file of yamlFiles) {
53
+ const filePath = join(workflowsDir, file);
54
+ try {
55
+ const content = await readFile(filePath, "utf-8");
56
+ const workflow = parseYaml(content);
57
+ const candidates = extractSetupStepsFromWorkflow(workflow, config.setupActionPatterns);
58
+ allCandidates.push(...candidates);
59
+ }
60
+ catch {
61
+ // Skip files that can't be parsed as valid YAML workflows
62
+ // This is expected for malformed or non-workflow YAML files
63
+ }
64
+ }
65
+ return deduplicateCandidates(allCandidates);
66
+ }
67
+ async copilotSetupWorkflowExists(targetDir) {
68
+ const workflowPath = await this.findCopilotSetupWorkflowPath(targetDir);
69
+ return workflowPath !== null;
70
+ }
71
+ async getCopilotSetupWorkflowPath(targetDir) {
72
+ const existingPath = await this.findCopilotSetupWorkflowPath(targetDir);
73
+ return (existingPath ||
74
+ join(targetDir, ".github", "workflows", "copilot-setup-steps.yml"));
75
+ }
76
+ async readCopilotSetupWorkflow(targetDir) {
77
+ const workflowPath = await this.findCopilotSetupWorkflowPath(targetDir);
78
+ if (!workflowPath) {
79
+ return null;
80
+ }
81
+ const content = await readFile(workflowPath, "utf-8");
82
+ return parseYaml(content);
83
+ }
84
+ async writeCopilotSetupWorkflow(targetDir, content) {
85
+ // Check if an existing workflow file exists (either extension)
86
+ const existingPath = await this.findCopilotSetupWorkflowPath(targetDir);
87
+ // Use existing path if found, otherwise default to .yml
88
+ const workflowPath = existingPath ||
89
+ join(targetDir, ".github", "workflows", "copilot-setup-steps.yml");
90
+ await writeFile(workflowPath, content, "utf-8");
91
+ }
92
+ }
93
+ /**
94
+ * Creates and returns the default workflow gateway
95
+ */
96
+ export function createWorkflowGateway() {
97
+ return new FileSystemWorkflowGateway();
98
+ }
99
+ //# sourceMappingURL=file-system-workflow-gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system-workflow-gateway.js","sourceRoot":"","sources":["../../src/gateways/file-system-workflow-gateway.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Gateways - External interfaces and adapters (CLEAN architecture)
3
+ */
4
+ export * from "./action-version-gateway.js";
5
+ export * from "./agent-file-gateway.js";
6
+ export * from "./environment-gateway.js";
7
+ export * from "./file-system-utils.js";
8
+ export * from "./workflow-gateway.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gateways/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Gateways - External interfaces and adapters (CLEAN architecture)
3
+ */
4
+ export * from "./action-version-gateway.js";
5
+ export * from "./agent-file-gateway.js";
6
+ export * from "./environment-gateway.js";
7
+ export * from "./file-system-utils.js";
8
+ export * from "./workflow-gateway.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gateways/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,43 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,6 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { defineCommand, runMain } from "citty";
3
+ import { copilotSetupCommand } from "./commands/copilot-setup.js";
4
+ import { initCommand } from "./commands/init.js";
5
+ import { newCommand } from "./commands/new.js";
6
+ const main = defineCommand({
7
+ meta: {
8
+ name: "lousy-agents",
9
+ version: "0.1.0",
10
+ description: "Simple scaffolding tool for AI-assisted development",
11
+ },
12
+ subCommands: {
13
+ init: initCommand,
14
+ new: newCommand,
15
+ "copilot-setup": copilotSetupCommand,
16
+ },
17
+ });
18
+ runMain(main);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,IAAI,GAAG,aAAa,CAAC;IACvB,IAAI,EAAE;QACF,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,qDAAqD;KACrE;IACD,WAAW,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,UAAU;QACf,eAAe,EAAE,mBAAmB;KACvC;CACJ,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,27 @@
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
+ "REST API"?: FilesystemStructure;
13
+ "GraphQL API"?: 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 structure only when requested
25
+ */
26
+ export declare function getProjectStructure(projectType: "CLI" | "webapp" | "REST API" | "GraphQL API"): Promise<FilesystemStructure | undefined>;
27
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAOrE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE;QACT,GAAG,CAAC,EAAE,mBAAmB,CAAC;QAC1B,MAAM,CAAC,EAAE,mBAAmB,CAAC;QAC7B,UAAU,CAAC,EAAE,mBAAmB,CAAC;QACjC,aAAa,CAAC,EAAE,mBAAmB,CAAC;KACvC,CAAC;CACL;AA2MD;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAiBjE;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACrC,WAAW,EAAE,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,GAC3D,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAS1C"}