@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.
- package/dist/145.js +29 -0
- package/dist/145.js.map +1 -0
- package/dist/190.js +1765 -0
- package/dist/190.js.map +1 -0
- package/dist/255.js +1850 -0
- package/dist/255.js.map +1 -0
- package/dist/31.js +127 -0
- package/dist/31.js.map +1 -0
- package/dist/399.js +13 -0
- package/dist/399.js.map +1 -0
- package/dist/610.js +254 -0
- package/dist/610.js.map +1 -0
- package/dist/651.js +39 -0
- package/dist/651.js.map +1 -0
- package/dist/659.js +16 -0
- package/dist/659.js.map +1 -0
- package/dist/709.js +47 -0
- package/dist/709.js.map +1 -0
- package/dist/835.js +298 -0
- package/dist/835.js.map +1 -0
- package/dist/index.js +30651 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +46530 -5
- package/dist/mcp-server.js.map +1 -1
- package/package.json +4 -2
- package/dist/commands/copilot-setup.d.ts +0 -5
- package/dist/commands/copilot-setup.d.ts.map +0 -1
- package/dist/commands/copilot-setup.js +0 -97
- package/dist/commands/copilot-setup.js.map +0 -1
- package/dist/commands/init.d.ts +0 -13
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -109
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/new.d.ts +0 -21
- package/dist/commands/new.d.ts.map +0 -1
- package/dist/commands/new.js +0 -94
- package/dist/commands/new.js.map +0 -1
- package/dist/entities/copilot-agent.d.ts +0 -15
- package/dist/entities/copilot-agent.d.ts.map +0 -1
- package/dist/entities/copilot-agent.js +0 -53
- package/dist/entities/copilot-agent.js.map +0 -1
- package/dist/entities/copilot-setup.d.ts +0 -65
- package/dist/entities/copilot-setup.d.ts.map +0 -1
- package/dist/entities/copilot-setup.js +0 -6
- package/dist/entities/copilot-setup.js.map +0 -1
- package/dist/entities/index.d.ts +0 -7
- package/dist/entities/index.d.ts.map +0 -1
- package/dist/entities/index.js +0 -7
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/skill.d.ts +0 -15
- package/dist/entities/skill.d.ts.map +0 -1
- package/dist/entities/skill.js +0 -63
- package/dist/entities/skill.js.map +0 -1
- package/dist/gateways/action-version-gateway.d.ts +0 -39
- package/dist/gateways/action-version-gateway.d.ts.map +0 -1
- package/dist/gateways/action-version-gateway.js +0 -47
- package/dist/gateways/action-version-gateway.js.map +0 -1
- package/dist/gateways/agent-file-gateway.d.ts +0 -50
- package/dist/gateways/agent-file-gateway.d.ts.map +0 -1
- package/dist/gateways/agent-file-gateway.js +0 -34
- package/dist/gateways/agent-file-gateway.js.map +0 -1
- package/dist/gateways/environment-gateway.d.ts +0 -30
- package/dist/gateways/environment-gateway.d.ts.map +0 -1
- package/dist/gateways/environment-gateway.js +0 -56
- package/dist/gateways/environment-gateway.js.map +0 -1
- package/dist/gateways/file-system-utils.d.ts +0 -8
- package/dist/gateways/file-system-utils.d.ts.map +0 -1
- package/dist/gateways/file-system-utils.js +0 -17
- package/dist/gateways/file-system-utils.js.map +0 -1
- package/dist/gateways/file-system-workflow-gateway.d.ts +0 -27
- package/dist/gateways/file-system-workflow-gateway.d.ts.map +0 -1
- package/dist/gateways/file-system-workflow-gateway.js +0 -99
- package/dist/gateways/file-system-workflow-gateway.js.map +0 -1
- package/dist/gateways/index.d.ts +0 -10
- package/dist/gateways/index.d.ts.map +0 -1
- package/dist/gateways/index.js +0 -10
- package/dist/gateways/index.js.map +0 -1
- package/dist/gateways/skill-file-gateway.d.ts +0 -59
- package/dist/gateways/skill-file-gateway.d.ts.map +0 -1
- package/dist/gateways/skill-file-gateway.js +0 -37
- package/dist/gateways/skill-file-gateway.js.map +0 -1
- package/dist/gateways/workflow-gateway.d.ts +0 -43
- package/dist/gateways/workflow-gateway.d.ts.map +0 -1
- package/dist/gateways/workflow-gateway.js +0 -6
- package/dist/gateways/workflow-gateway.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/config.d.ts +0 -28
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -406
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/copilot-setup-config.d.ts +0 -79
- package/dist/lib/copilot-setup-config.d.ts.map +0 -1
- package/dist/lib/copilot-setup-config.js +0 -119
- package/dist/lib/copilot-setup-config.js.map +0 -1
- package/dist/lib/filesystem-structure.d.ts +0 -45
- package/dist/lib/filesystem-structure.d.ts.map +0 -1
- package/dist/lib/filesystem-structure.js +0 -69
- package/dist/lib/filesystem-structure.js.map +0 -1
- package/dist/lib/mcp-test-client.d.ts +0 -43
- package/dist/lib/mcp-test-client.d.ts.map +0 -1
- package/dist/lib/mcp-test-client.js +0 -167
- package/dist/lib/mcp-test-client.js.map +0 -1
- package/dist/lib/project-name-validation.d.ts +0 -43
- package/dist/lib/project-name-validation.d.ts.map +0 -1
- package/dist/lib/project-name-validation.js +0 -131
- package/dist/lib/project-name-validation.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -5
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -5
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -15
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -120
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/tools/analyze-action-versions.d.ts +0 -9
- package/dist/mcp/tools/analyze-action-versions.d.ts.map +0 -1
- package/dist/mcp/tools/analyze-action-versions.js +0 -81
- package/dist/mcp/tools/analyze-action-versions.js.map +0 -1
- package/dist/mcp/tools/create-copilot-setup-workflow.d.ts +0 -9
- package/dist/mcp/tools/create-copilot-setup-workflow.d.ts.map +0 -1
- package/dist/mcp/tools/create-copilot-setup-workflow.js +0 -121
- package/dist/mcp/tools/create-copilot-setup-workflow.js.map +0 -1
- package/dist/mcp/tools/discover-environment.d.ts +0 -9
- package/dist/mcp/tools/discover-environment.d.ts.map +0 -1
- package/dist/mcp/tools/discover-environment.js +0 -30
- package/dist/mcp/tools/discover-environment.js.map +0 -1
- package/dist/mcp/tools/discover-workflow-setup-actions.d.ts +0 -9
- package/dist/mcp/tools/discover-workflow-setup-actions.d.ts.map +0 -1
- package/dist/mcp/tools/discover-workflow-setup-actions.js +0 -37
- package/dist/mcp/tools/discover-workflow-setup-actions.js.map +0 -1
- package/dist/mcp/tools/index.d.ts +0 -11
- package/dist/mcp/tools/index.d.ts.map +0 -1
- package/dist/mcp/tools/index.js +0 -11
- package/dist/mcp/tools/index.js.map +0 -1
- package/dist/mcp/tools/read-copilot-setup-workflow.d.ts +0 -9
- package/dist/mcp/tools/read-copilot-setup-workflow.d.ts.map +0 -1
- package/dist/mcp/tools/read-copilot-setup-workflow.js +0 -38
- package/dist/mcp/tools/read-copilot-setup-workflow.js.map +0 -1
- package/dist/mcp/tools/resolve-action-versions.d.ts +0 -10
- package/dist/mcp/tools/resolve-action-versions.d.ts.map +0 -1
- package/dist/mcp/tools/resolve-action-versions.js +0 -61
- package/dist/mcp/tools/resolve-action-versions.js.map +0 -1
- package/dist/mcp/tools/types.d.ts +0 -67
- package/dist/mcp/tools/types.d.ts.map +0 -1
- package/dist/mcp/tools/types.js +0 -24
- package/dist/mcp/tools/types.js.map +0 -1
- package/dist/mcp-server.d.ts +0 -7
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/use-cases/action-resolution.d.ts +0 -66
- package/dist/use-cases/action-resolution.d.ts.map +0 -1
- package/dist/use-cases/action-resolution.js +0 -107
- package/dist/use-cases/action-resolution.js.map +0 -1
- package/dist/use-cases/candidate-builder.d.ts +0 -17
- package/dist/use-cases/candidate-builder.d.ts.map +0 -1
- package/dist/use-cases/candidate-builder.js +0 -67
- package/dist/use-cases/candidate-builder.js.map +0 -1
- package/dist/use-cases/copilot-setup.d.ts +0 -8
- package/dist/use-cases/copilot-setup.d.ts.map +0 -1
- package/dist/use-cases/copilot-setup.js +0 -10
- package/dist/use-cases/copilot-setup.js.map +0 -1
- package/dist/use-cases/create-copilot-agent.d.ts +0 -29
- package/dist/use-cases/create-copilot-agent.d.ts.map +0 -1
- package/dist/use-cases/create-copilot-agent.js +0 -73
- package/dist/use-cases/create-copilot-agent.js.map +0 -1
- package/dist/use-cases/create-skill.d.ts +0 -30
- package/dist/use-cases/create-skill.d.ts.map +0 -1
- package/dist/use-cases/create-skill.js +0 -75
- package/dist/use-cases/create-skill.js.map +0 -1
- package/dist/use-cases/index.d.ts +0 -10
- package/dist/use-cases/index.d.ts.map +0 -1
- package/dist/use-cases/index.js +0 -10
- package/dist/use-cases/index.js.map +0 -1
- package/dist/use-cases/setup-step-discovery.d.ts +0 -87
- package/dist/use-cases/setup-step-discovery.d.ts.map +0 -1
- package/dist/use-cases/setup-step-discovery.js +0 -202
- package/dist/use-cases/setup-step-discovery.js.map +0 -1
- package/dist/use-cases/workflow-generator.d.ts +0 -34
- package/dist/use-cases/workflow-generator.d.ts.map +0 -1
- package/dist/use-cases/workflow-generator.js +0 -195
- package/dist/use-cases/workflow-generator.js.map +0 -1
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use case for creating GitHub Copilot Agent Skills.
|
|
3
|
-
* Orchestrates entity logic with gateway operations.
|
|
4
|
-
*/
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { generateSkillContent, normalizeSkillName } from "../entities/skill.js";
|
|
7
|
-
/**
|
|
8
|
-
* Schema for validating skill name input
|
|
9
|
-
* Validates that the input is a non-empty string with reasonable constraints
|
|
10
|
-
*/
|
|
11
|
-
const SkillNameSchema = z
|
|
12
|
-
.string()
|
|
13
|
-
.min(1, "Skill name is required")
|
|
14
|
-
.max(100, "Skill name must be 100 characters or less")
|
|
15
|
-
.regex(/^[a-zA-Z0-9\s_-]+$/, "Skill name can only contain letters, numbers, spaces, hyphens, and underscores");
|
|
16
|
-
/**
|
|
17
|
-
* Use case for creating a new Agent Skill
|
|
18
|
-
*/
|
|
19
|
-
export class CreateSkillUseCase {
|
|
20
|
-
gateway;
|
|
21
|
-
constructor(gateway) {
|
|
22
|
-
this.gateway = gateway;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Executes the create skill operation
|
|
26
|
-
* @param targetDir The root directory of the repository
|
|
27
|
-
* @param skillName The name of the skill to create
|
|
28
|
-
* @returns Result of the operation
|
|
29
|
-
*/
|
|
30
|
-
async execute(targetDir, skillName) {
|
|
31
|
-
// Validate the skill name using Zod schema
|
|
32
|
-
const validationResult = SkillNameSchema.safeParse(skillName);
|
|
33
|
-
if (!validationResult.success) {
|
|
34
|
-
const errorMessage = validationResult.error.issues[0]?.message ??
|
|
35
|
-
"Invalid skill name";
|
|
36
|
-
return {
|
|
37
|
-
success: false,
|
|
38
|
-
error: errorMessage,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
// Normalize the skill name
|
|
42
|
-
const normalizedName = normalizeSkillName(validationResult.data);
|
|
43
|
-
// Validate that the normalized name is not empty (handles whitespace-only input)
|
|
44
|
-
if (!normalizedName) {
|
|
45
|
-
return {
|
|
46
|
-
success: false,
|
|
47
|
-
error: "Skill name is required",
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
// Get the paths
|
|
51
|
-
const skillDirectoryPath = this.gateway.getSkillDirectoryPath(targetDir, normalizedName);
|
|
52
|
-
const skillFilePath = this.gateway.getSkillFilePath(targetDir, normalizedName);
|
|
53
|
-
// Check if the skill directory already exists
|
|
54
|
-
if (await this.gateway.skillDirectoryExists(targetDir, normalizedName)) {
|
|
55
|
-
return {
|
|
56
|
-
success: false,
|
|
57
|
-
error: `Skill already exists: ${skillDirectoryPath}`,
|
|
58
|
-
skillDirectoryPath,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
// Ensure the skill directory exists
|
|
62
|
-
await this.gateway.ensureSkillDirectory(targetDir, normalizedName);
|
|
63
|
-
// Generate the content
|
|
64
|
-
const content = generateSkillContent(normalizedName);
|
|
65
|
-
// Write the SKILL.md file
|
|
66
|
-
await this.gateway.writeSkillFile(targetDir, normalizedName, content);
|
|
67
|
-
return {
|
|
68
|
-
success: true,
|
|
69
|
-
normalizedName,
|
|
70
|
-
skillDirectoryPath,
|
|
71
|
-
skillFilePath,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=create-skill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-skill.js","sourceRoot":"","sources":["../../src/use-cases/create-skill.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGhF;;;GAGG;AACH,MAAM,eAAe,GAAG,CAAC;KACpB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC;KAChC,GAAG,CAAC,GAAG,EAAE,2CAA2C,CAAC;KACrD,KAAK,CACF,oBAAoB,EACpB,gFAAgF,CACnF,CAAC;AAaN;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACE;IAA7B,YAA6B,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAE1D;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CACT,SAAiB,EACjB,SAAiB;QAEjB,2CAA2C;QAC3C,MAAM,gBAAgB,GAAG,eAAe,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC9D,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAC5B,MAAM,YAAY,GACd,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO;gBACzC,oBAAoB,CAAC;YACzB,OAAO;gBACH,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,YAAY;aACtB,CAAC;QACN,CAAC;QAED,2BAA2B;QAC3B,MAAM,cAAc,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEjE,iFAAiF;QACjF,IAAI,CAAC,cAAc,EAAE,CAAC;YAClB,OAAO;gBACH,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,wBAAwB;aAClC,CAAC;QACN,CAAC;QAED,gBAAgB;QAChB,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CACzD,SAAS,EACT,cAAc,CACjB,CAAC;QACF,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAC/C,SAAS,EACT,cAAc,CACjB,CAAC;QAEF,8CAA8C;QAC9C,IACI,MAAM,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,SAAS,EAAE,cAAc,CAAC,EACpE,CAAC;YACC,OAAO;gBACH,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,yBAAyB,kBAAkB,EAAE;gBACpD,kBAAkB;aACrB,CAAC;QACN,CAAC;QAED,oCAAoC;QACpC,MAAM,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAEnE,uBAAuB;QACvB,MAAM,OAAO,GAAG,oBAAoB,CAAC,cAAc,CAAC,CAAC;QAErD,0BAA0B;QAC1B,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;QAEtE,OAAO;YACH,OAAO,EAAE,IAAI;YACb,cAAc;YACd,kBAAkB;YAClB,aAAa;SAChB,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use Cases - Application-specific business rules
|
|
3
|
-
*/
|
|
4
|
-
export * from "./action-resolution.js";
|
|
5
|
-
export * from "./candidate-builder.js";
|
|
6
|
-
export * from "./copilot-setup.js";
|
|
7
|
-
export * from "./create-copilot-agent.js";
|
|
8
|
-
export * from "./create-skill.js";
|
|
9
|
-
export * from "./workflow-generator.js";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/use-cases/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
package/dist/use-cases/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use Cases - Application-specific business rules
|
|
3
|
-
*/
|
|
4
|
-
export * from "./action-resolution.js";
|
|
5
|
-
export * from "./candidate-builder.js";
|
|
6
|
-
export * from "./copilot-setup.js";
|
|
7
|
-
export * from "./create-copilot-agent.js";
|
|
8
|
-
export * from "./create-skill.js";
|
|
9
|
-
export * from "./workflow-generator.js";
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/use-cases/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use case for discovering setup steps in workflows.
|
|
3
|
-
* This module provides reusable logic for finding existing and missing setup steps.
|
|
4
|
-
*/
|
|
5
|
-
import type { SetupStepCandidate } from "../entities/copilot-setup.js";
|
|
6
|
-
/**
|
|
7
|
-
* Extracts action name from a "uses" string
|
|
8
|
-
* @example "actions/setup-node@v4" -> "actions/setup-node"
|
|
9
|
-
*/
|
|
10
|
-
export declare function parseActionName(uses: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* Checks if an action matches any of the setup action patterns
|
|
13
|
-
* @param actionName The action name to check (e.g., "actions/setup-node")
|
|
14
|
-
* @param patterns List of patterns to match against
|
|
15
|
-
*/
|
|
16
|
-
export declare function isSetupAction(actionName: string, patterns: string[]): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Step object with all fields (for workflow reading)
|
|
19
|
-
*/
|
|
20
|
-
export interface WorkflowStepDetails {
|
|
21
|
-
name?: string;
|
|
22
|
-
uses?: string;
|
|
23
|
-
with?: Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Extracts all steps from a workflow (including steps without "uses")
|
|
27
|
-
* @param workflow The parsed workflow object
|
|
28
|
-
* @returns Array of step details
|
|
29
|
-
*/
|
|
30
|
-
export declare function extractAllWorkflowSteps(workflow: unknown): WorkflowStepDetails[];
|
|
31
|
-
/**
|
|
32
|
-
* Extracts existing setup actions from a parsed workflow
|
|
33
|
-
* @param workflow The parsed workflow object
|
|
34
|
-
* @returns Set of action names already present
|
|
35
|
-
*/
|
|
36
|
-
export declare function getExistingActionsFromWorkflow(workflow: unknown): Set<string>;
|
|
37
|
-
/**
|
|
38
|
-
* Identifies candidates that are missing from an existing workflow
|
|
39
|
-
* @param candidates All candidates to potentially add
|
|
40
|
-
* @param existingActions Actions already present in the workflow
|
|
41
|
-
* @returns Candidates that need to be added
|
|
42
|
-
*/
|
|
43
|
-
export declare function findMissingCandidates(candidates: SetupStepCandidate[], existingActions: Set<string>): SetupStepCandidate[];
|
|
44
|
-
/**
|
|
45
|
-
* Merges candidates from multiple sources, with earlier sources taking precedence
|
|
46
|
-
* @param candidateSources Arrays of candidates, in order of precedence
|
|
47
|
-
* @returns Merged and deduplicated candidates
|
|
48
|
-
*/
|
|
49
|
-
export declare function mergeCandidates(...candidateSources: SetupStepCandidate[][]): SetupStepCandidate[];
|
|
50
|
-
/**
|
|
51
|
-
* Extracts version from a "uses" string
|
|
52
|
-
* @example "actions/setup-node@v4" -> "v4"
|
|
53
|
-
*/
|
|
54
|
-
export declare function parseActionVersion(uses: string): string | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Action reference with name and version.
|
|
57
|
-
* @example { name: "actions/setup-node", version: "v4" }
|
|
58
|
-
* @example { name: "actions/checkout", version: "b4ffde65f46336ab88eb53be808477a3936bae11" }
|
|
59
|
-
*/
|
|
60
|
-
export interface ActionReference {
|
|
61
|
-
/** The action name without version (e.g., "actions/setup-node") */
|
|
62
|
-
name: string;
|
|
63
|
-
/** The version, tag, or commit SHA (e.g., "v4", "main", "a1b2c3d4") */
|
|
64
|
-
version: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Extracts all action references from a workflow.
|
|
68
|
-
* Only includes actions that have a version specified (format: "action@version").
|
|
69
|
-
* Actions without versions are skipped as they represent incomplete references.
|
|
70
|
-
* @param workflow The parsed workflow object
|
|
71
|
-
* @returns Array of action references with name and version
|
|
72
|
-
*/
|
|
73
|
-
export declare function extractActionsFromWorkflow(workflow: unknown): ActionReference[];
|
|
74
|
-
/**
|
|
75
|
-
* Extracts setup step candidates from a parsed workflow based on action patterns
|
|
76
|
-
* @param workflow The parsed workflow object
|
|
77
|
-
* @param patterns List of action patterns to detect
|
|
78
|
-
* @returns Array of setup step candidates
|
|
79
|
-
*/
|
|
80
|
-
export declare function extractSetupStepsFromWorkflow(workflow: unknown, patterns: string[]): SetupStepCandidate[];
|
|
81
|
-
/**
|
|
82
|
-
* Deduplicates candidates by action name, keeping the first occurrence
|
|
83
|
-
* @param candidates Array of candidates to deduplicate
|
|
84
|
-
* @returns Deduplicated array of candidates
|
|
85
|
-
*/
|
|
86
|
-
export declare function deduplicateCandidates(candidates: SetupStepCandidate[]): SetupStepCandidate[];
|
|
87
|
-
//# sourceMappingURL=setup-step-discovery.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-step-discovery.d.ts","sourceRoot":"","sources":["../../src/use-cases/setup-step-discovery.ts"],"names":[],"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B,CACzC,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,EAAE,GACnB,kBAAkB,EAAE,CAiBtB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACjC,UAAU,EAAE,kBAAkB,EAAE,GACjC,kBAAkB,EAAE,CAYtB"}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use case for discovering setup steps in workflows.
|
|
3
|
-
* This module provides reusable logic for finding existing and missing setup steps.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Extracts action name from a "uses" string
|
|
7
|
-
* @example "actions/setup-node@v4" -> "actions/setup-node"
|
|
8
|
-
*/
|
|
9
|
-
export function parseActionName(uses) {
|
|
10
|
-
const atIndex = uses.indexOf("@");
|
|
11
|
-
return atIndex === -1 ? uses : uses.substring(0, atIndex);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Checks if an action matches any of the setup action patterns
|
|
15
|
-
* @param actionName The action name to check (e.g., "actions/setup-node")
|
|
16
|
-
* @param patterns List of patterns to match against
|
|
17
|
-
*/
|
|
18
|
-
export function isSetupAction(actionName, patterns) {
|
|
19
|
-
return patterns.includes(actionName);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Iterates over all steps in a workflow that have a "uses" field
|
|
23
|
-
* @param workflow The parsed workflow object
|
|
24
|
-
* @param callback Function to call for each step with a "uses" field
|
|
25
|
-
*/
|
|
26
|
-
function forEachWorkflowStep(workflow, callback) {
|
|
27
|
-
if (!workflow || typeof workflow !== "object") {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const jobs = workflow.jobs;
|
|
31
|
-
if (!jobs || typeof jobs !== "object") {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
for (const job of Object.values(jobs)) {
|
|
35
|
-
if (!job || typeof job !== "object") {
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
const steps = job.steps;
|
|
39
|
-
if (!Array.isArray(steps)) {
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
for (const step of steps) {
|
|
43
|
-
if (!step || typeof step !== "object") {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
const stepObj = step;
|
|
47
|
-
const uses = stepObj.uses;
|
|
48
|
-
if (typeof uses === "string") {
|
|
49
|
-
const withConfig = stepObj.with;
|
|
50
|
-
callback({
|
|
51
|
-
uses,
|
|
52
|
-
with: withConfig && typeof withConfig === "object"
|
|
53
|
-
? withConfig
|
|
54
|
-
: undefined,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Extracts all steps from a workflow (including steps without "uses")
|
|
62
|
-
* @param workflow The parsed workflow object
|
|
63
|
-
* @returns Array of step details
|
|
64
|
-
*/
|
|
65
|
-
export function extractAllWorkflowSteps(workflow) {
|
|
66
|
-
const steps = [];
|
|
67
|
-
if (!workflow || typeof workflow !== "object") {
|
|
68
|
-
return steps;
|
|
69
|
-
}
|
|
70
|
-
const jobs = workflow.jobs;
|
|
71
|
-
if (!jobs || typeof jobs !== "object") {
|
|
72
|
-
return steps;
|
|
73
|
-
}
|
|
74
|
-
for (const job of Object.values(jobs)) {
|
|
75
|
-
if (!job || typeof job !== "object") {
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
const jobSteps = job.steps;
|
|
79
|
-
if (!Array.isArray(jobSteps)) {
|
|
80
|
-
continue;
|
|
81
|
-
}
|
|
82
|
-
for (const step of jobSteps) {
|
|
83
|
-
if (!step || typeof step !== "object") {
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
const stepObj = step;
|
|
87
|
-
const withConfig = stepObj.with;
|
|
88
|
-
steps.push({
|
|
89
|
-
name: typeof stepObj.name === "string" ? stepObj.name : undefined,
|
|
90
|
-
uses: typeof stepObj.uses === "string" ? stepObj.uses : undefined,
|
|
91
|
-
with: withConfig && typeof withConfig === "object"
|
|
92
|
-
? withConfig
|
|
93
|
-
: undefined,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return steps;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Extracts existing setup actions from a parsed workflow
|
|
101
|
-
* @param workflow The parsed workflow object
|
|
102
|
-
* @returns Set of action names already present
|
|
103
|
-
*/
|
|
104
|
-
export function getExistingActionsFromWorkflow(workflow) {
|
|
105
|
-
const actions = new Set();
|
|
106
|
-
forEachWorkflowStep(workflow, (step) => {
|
|
107
|
-
actions.add(parseActionName(step.uses));
|
|
108
|
-
});
|
|
109
|
-
return actions;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Identifies candidates that are missing from an existing workflow
|
|
113
|
-
* @param candidates All candidates to potentially add
|
|
114
|
-
* @param existingActions Actions already present in the workflow
|
|
115
|
-
* @returns Candidates that need to be added
|
|
116
|
-
*/
|
|
117
|
-
export function findMissingCandidates(candidates, existingActions) {
|
|
118
|
-
return candidates.filter((candidate) => !existingActions.has(candidate.action));
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Merges candidates from multiple sources, with earlier sources taking precedence
|
|
122
|
-
* @param candidateSources Arrays of candidates, in order of precedence
|
|
123
|
-
* @returns Merged and deduplicated candidates
|
|
124
|
-
*/
|
|
125
|
-
export function mergeCandidates(...candidateSources) {
|
|
126
|
-
const result = [];
|
|
127
|
-
const seen = new Set();
|
|
128
|
-
for (const candidates of candidateSources) {
|
|
129
|
-
for (const candidate of candidates) {
|
|
130
|
-
if (!seen.has(candidate.action)) {
|
|
131
|
-
seen.add(candidate.action);
|
|
132
|
-
result.push(candidate);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Extracts version from a "uses" string
|
|
140
|
-
* @example "actions/setup-node@v4" -> "v4"
|
|
141
|
-
*/
|
|
142
|
-
export function parseActionVersion(uses) {
|
|
143
|
-
const atIndex = uses.indexOf("@");
|
|
144
|
-
return atIndex !== -1 ? uses.substring(atIndex + 1) : undefined;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Extracts all action references from a workflow.
|
|
148
|
-
* Only includes actions that have a version specified (format: "action@version").
|
|
149
|
-
* Actions without versions are skipped as they represent incomplete references.
|
|
150
|
-
* @param workflow The parsed workflow object
|
|
151
|
-
* @returns Array of action references with name and version
|
|
152
|
-
*/
|
|
153
|
-
export function extractActionsFromWorkflow(workflow) {
|
|
154
|
-
const actions = [];
|
|
155
|
-
forEachWorkflowStep(workflow, (step) => {
|
|
156
|
-
const name = parseActionName(step.uses);
|
|
157
|
-
const version = parseActionVersion(step.uses);
|
|
158
|
-
// Skip actions without versions - these are incomplete references
|
|
159
|
-
if (version) {
|
|
160
|
-
actions.push({ name, version });
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
return actions;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Extracts setup step candidates from a parsed workflow based on action patterns
|
|
167
|
-
* @param workflow The parsed workflow object
|
|
168
|
-
* @param patterns List of action patterns to detect
|
|
169
|
-
* @returns Array of setup step candidates
|
|
170
|
-
*/
|
|
171
|
-
export function extractSetupStepsFromWorkflow(workflow, patterns) {
|
|
172
|
-
const candidates = [];
|
|
173
|
-
forEachWorkflowStep(workflow, (step) => {
|
|
174
|
-
const action = parseActionName(step.uses);
|
|
175
|
-
if (isSetupAction(action, patterns)) {
|
|
176
|
-
candidates.push({
|
|
177
|
-
action,
|
|
178
|
-
version: parseActionVersion(step.uses),
|
|
179
|
-
config: step.with,
|
|
180
|
-
source: "workflow",
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
return candidates;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Deduplicates candidates by action name, keeping the first occurrence
|
|
188
|
-
* @param candidates Array of candidates to deduplicate
|
|
189
|
-
* @returns Deduplicated array of candidates
|
|
190
|
-
*/
|
|
191
|
-
export function deduplicateCandidates(candidates) {
|
|
192
|
-
const seen = new Set();
|
|
193
|
-
const deduplicated = [];
|
|
194
|
-
for (const candidate of candidates) {
|
|
195
|
-
if (!seen.has(candidate.action)) {
|
|
196
|
-
seen.add(candidate.action);
|
|
197
|
-
deduplicated.push(candidate);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return deduplicated;
|
|
201
|
-
}
|
|
202
|
-
//# sourceMappingURL=setup-step-discovery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-step-discovery.js","sourceRoot":"","sources":["../../src/use-cases/setup-step-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB,EAAE,QAAkB;IAChE,OAAO,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC;AAmBD;;;;GAIG;AACH,SAAS,mBAAmB,CACxB,QAAiB,EACjB,QAA0C;IAE1C,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO;IACX,CAAC;IAED,MAAM,IAAI,GAAI,QAAoC,CAAC,IAAI,CAAC;IACxD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO;IACX,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,IAA+B,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3
|
-
* This module handles the transformation of setup step candidates
|
|
4
|
-
* into GitHub Actions workflow YAML.
|
|
5
|
-
*/
|
|
6
|
-
import type { ResolvedVersion, SetupStepCandidate } from "../entities/copilot-setup.js";
|
|
7
|
-
import type { ActionVersionGateway } from "../gateways/action-version-gateway.js";
|
|
8
|
-
/**
|
|
9
|
-
* Options for workflow content generation
|
|
10
|
-
*/
|
|
11
|
-
export interface GenerateWorkflowOptions {
|
|
12
|
-
/** Whether to use placeholder versions instead of gateway versions */
|
|
13
|
-
usePlaceholders?: boolean;
|
|
14
|
-
/** Resolved versions to use for SHA-pinning */
|
|
15
|
-
resolvedVersions?: ResolvedVersion[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generates the Copilot Setup Steps workflow content using typed workflow builder
|
|
19
|
-
* @param candidates The setup step candidates to include
|
|
20
|
-
* @param versionGateway Optional gateway for looking up action versions (defaults to local)
|
|
21
|
-
* @param options Optional generation options for placeholders and resolved versions
|
|
22
|
-
* @returns The workflow YAML content as a string
|
|
23
|
-
*/
|
|
24
|
-
export declare function generateWorkflowContent(candidates: SetupStepCandidate[], versionGateway?: ActionVersionGateway, options?: GenerateWorkflowOptions): Promise<string>;
|
|
25
|
-
/**
|
|
26
|
-
* Updates an existing workflow by appending missing setup steps
|
|
27
|
-
* @param existingWorkflow The parsed existing workflow
|
|
28
|
-
* @param missingCandidates Candidates to add to the workflow
|
|
29
|
-
* @param versionGateway Optional gateway for looking up action versions (defaults to local)
|
|
30
|
-
* @param options Optional generation options for placeholders and resolved versions
|
|
31
|
-
* @returns The updated workflow YAML content
|
|
32
|
-
*/
|
|
33
|
-
export declare function updateWorkflowWithMissingSteps(existingWorkflow: unknown, missingCandidates: SetupStepCandidate[], versionGateway?: ActionVersionGateway, options?: GenerateWorkflowOptions): Promise<string>;
|
|
34
|
-
//# sourceMappingURL=workflow-generator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-generator.d.ts","sourceRoot":"","sources":["../../src/use-cases/workflow-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EACR,eAAe,EACf,kBAAkB,EACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAgClF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACxC;AAyJD;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CACzC,UAAU,EAAE,kBAAkB,EAAE,EAChC,cAAc,GAAE,oBAAmD,EACnE,OAAO,CAAC,EAAE,uBAAuB,GAClC,OAAO,CAAC,MAAM,CAAC,CA8CjB;AAED;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,CAChD,gBAAgB,EAAE,OAAO,EACzB,iBAAiB,EAAE,kBAAkB,EAAE,EACvC,cAAc,GAAE,oBAAmD,EACnE,OAAO,CAAC,EAAE,uBAAuB,GAClC,OAAO,CAAC,MAAM,CAAC,CAsDjB"}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use case for generating Copilot Setup Steps workflow content.
|
|
3
|
-
* This module handles the transformation of setup step candidates
|
|
4
|
-
* into GitHub Actions workflow YAML.
|
|
5
|
-
*/
|
|
6
|
-
import { NormalJob, Step, Workflow, } from "@github-actions-workflow-ts/lib";
|
|
7
|
-
import { Scalar, stringify as stringifyYaml } from "yaml";
|
|
8
|
-
import { createActionVersionGateway } from "../gateways/action-version-gateway.js";
|
|
9
|
-
import { findResolvedVersion, VERSION_PLACEHOLDER, } from "./action-resolution.js";
|
|
10
|
-
/**
|
|
11
|
-
* Generates a human-readable step name from an action name
|
|
12
|
-
* @example "actions/setup-node" -> "Setup node"
|
|
13
|
-
* @example "jdx/mise-action" -> "Setup mise"
|
|
14
|
-
*/
|
|
15
|
-
function generateStepName(actionName) {
|
|
16
|
-
const name = actionName.split("/").pop() || actionName;
|
|
17
|
-
return `Setup ${name.replace("setup-", "").replace("-action", "")}`;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Gets the version string for an action based on options.
|
|
21
|
-
* Priority: resolved version > candidate version > placeholder
|
|
22
|
-
*/
|
|
23
|
-
function getVersionForAction(action, candidateVersion, options) {
|
|
24
|
-
if (options?.resolvedVersions) {
|
|
25
|
-
const resolved = findResolvedVersion(action, options.resolvedVersions);
|
|
26
|
-
if (resolved) {
|
|
27
|
-
return resolved.sha;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (options?.usePlaceholders) {
|
|
31
|
-
return VERSION_PLACEHOLDER;
|
|
32
|
-
}
|
|
33
|
-
return candidateVersion || "";
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Builds the 'uses' value for a step, returning a YAML Scalar with comment
|
|
37
|
-
* when the action has a resolved version, or a plain string otherwise.
|
|
38
|
-
*
|
|
39
|
-
* Note: The Step constructor from @github-actions-workflow-ts/lib accepts both
|
|
40
|
-
* string and Scalar at runtime, even though its TypeScript types only declare string.
|
|
41
|
-
* We use type casts when passing the return value to Step to work around this.
|
|
42
|
-
*
|
|
43
|
-
* @param action The action name (e.g., "actions/setup-node")
|
|
44
|
-
* @param version The version string (SHA or version tag)
|
|
45
|
-
* @param options Optional conversion options for resolved versions
|
|
46
|
-
* @returns Either a Scalar with comment (for SHA-pinned) or a plain string
|
|
47
|
-
*/
|
|
48
|
-
function buildUsesValue(action, version, options) {
|
|
49
|
-
const uses = version ? `${action}@${version}` : action;
|
|
50
|
-
if (options?.resolvedVersions) {
|
|
51
|
-
const resolved = findResolvedVersion(action, options.resolvedVersions);
|
|
52
|
-
if (resolved) {
|
|
53
|
-
const scalar = new Scalar(uses);
|
|
54
|
-
scalar.comment = ` ${resolved.versionTag}`;
|
|
55
|
-
return scalar;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return uses;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Builds a Step object from a SetupStepCandidate
|
|
62
|
-
* @param candidate The candidate to convert to a Step
|
|
63
|
-
* @param options Optional conversion options for placeholders and resolved versions
|
|
64
|
-
* @returns A typed Step object
|
|
65
|
-
*/
|
|
66
|
-
function buildStepFromCandidate(candidate, options) {
|
|
67
|
-
const version = getVersionForAction(candidate.action, candidate.version, options);
|
|
68
|
-
const usesValue = buildUsesValue(candidate.action, version, options);
|
|
69
|
-
const withConfig = candidate.config && Object.keys(candidate.config).length > 0
|
|
70
|
-
? candidate.config
|
|
71
|
-
: undefined;
|
|
72
|
-
const stepProps = {
|
|
73
|
-
name: generateStepName(candidate.action),
|
|
74
|
-
uses: usesValue,
|
|
75
|
-
with: withConfig,
|
|
76
|
-
};
|
|
77
|
-
return new Step(stepProps);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Converts an array of SetupStepCandidate to typed Step objects
|
|
81
|
-
* @param candidates The setup step candidates to convert
|
|
82
|
-
* @param options Optional conversion options for placeholders and resolved versions
|
|
83
|
-
* @returns Array of typed Step objects
|
|
84
|
-
*/
|
|
85
|
-
function buildStepsFromCandidates(candidates, options) {
|
|
86
|
-
return candidates.map((candidate) => buildStepFromCandidate(candidate, options));
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Appends missing setup steps to an existing workflow's job steps array
|
|
90
|
-
* @param steps The existing steps array to append to
|
|
91
|
-
* @param missingCandidates The candidates to add as new steps
|
|
92
|
-
* @param options Optional conversion options for placeholders and resolved versions
|
|
93
|
-
*/
|
|
94
|
-
function appendMissingStepsToJob(steps, missingCandidates, options) {
|
|
95
|
-
for (const candidate of missingCandidates) {
|
|
96
|
-
const newStep = buildStepFromCandidate(candidate, options);
|
|
97
|
-
steps.push(newStep.step);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Gets the checkout version based on resolved versions, placeholders, or gateway.
|
|
102
|
-
* Reduces duplication by centralizing the version resolution logic.
|
|
103
|
-
*/
|
|
104
|
-
async function getCheckoutVersion(versionGateway, options) {
|
|
105
|
-
if (options?.resolvedVersions) {
|
|
106
|
-
const resolved = findResolvedVersion("actions/checkout", options.resolvedVersions);
|
|
107
|
-
if (resolved) {
|
|
108
|
-
return resolved.sha;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (options?.usePlaceholders) {
|
|
112
|
-
return VERSION_PLACEHOLDER;
|
|
113
|
-
}
|
|
114
|
-
return (await versionGateway.getVersion("actions/checkout")) || "v4";
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Generates the Copilot Setup Steps workflow content using typed workflow builder
|
|
118
|
-
* @param candidates The setup step candidates to include
|
|
119
|
-
* @param versionGateway Optional gateway for looking up action versions (defaults to local)
|
|
120
|
-
* @param options Optional generation options for placeholders and resolved versions
|
|
121
|
-
* @returns The workflow YAML content as a string
|
|
122
|
-
*/
|
|
123
|
-
export async function generateWorkflowContent(candidates, versionGateway = createActionVersionGateway(), options) {
|
|
124
|
-
const stepOptions = {
|
|
125
|
-
usePlaceholders: options?.usePlaceholders,
|
|
126
|
-
resolvedVersions: options?.resolvedVersions,
|
|
127
|
-
};
|
|
128
|
-
const checkoutVersion = await getCheckoutVersion(versionGateway, options);
|
|
129
|
-
const checkoutUsesValue = buildUsesValue("actions/checkout", checkoutVersion, stepOptions);
|
|
130
|
-
const checkoutStepProps = {
|
|
131
|
-
name: "Checkout code",
|
|
132
|
-
uses: checkoutUsesValue,
|
|
133
|
-
};
|
|
134
|
-
const steps = [
|
|
135
|
-
new Step(checkoutStepProps),
|
|
136
|
-
...buildStepsFromCandidates(candidates, stepOptions),
|
|
137
|
-
];
|
|
138
|
-
const job = new NormalJob("copilot-setup-steps", {
|
|
139
|
-
"runs-on": "ubuntu-latest",
|
|
140
|
-
"timeout-minutes": 30,
|
|
141
|
-
permissions: {
|
|
142
|
-
"id-token": "write",
|
|
143
|
-
contents: "read",
|
|
144
|
-
},
|
|
145
|
-
}).addSteps(steps);
|
|
146
|
-
const workflow = new Workflow("copilot-setup-steps.yml", {
|
|
147
|
-
name: "Copilot Setup Steps",
|
|
148
|
-
on: {
|
|
149
|
-
workflow_dispatch: {},
|
|
150
|
-
push: {
|
|
151
|
-
branches: ["main"],
|
|
152
|
-
paths: [".github/workflows/copilot-setup-steps.yml"],
|
|
153
|
-
},
|
|
154
|
-
pull_request: {
|
|
155
|
-
branches: ["main"],
|
|
156
|
-
paths: [".github/workflows/copilot-setup-steps.yml"],
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
}).addJob(job);
|
|
160
|
-
return `---\n${stringifyYaml(workflow.workflow, { lineWidth: 0 })}`;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Updates an existing workflow by appending missing setup steps
|
|
164
|
-
* @param existingWorkflow The parsed existing workflow
|
|
165
|
-
* @param missingCandidates Candidates to add to the workflow
|
|
166
|
-
* @param versionGateway Optional gateway for looking up action versions (defaults to local)
|
|
167
|
-
* @param options Optional generation options for placeholders and resolved versions
|
|
168
|
-
* @returns The updated workflow YAML content
|
|
169
|
-
*/
|
|
170
|
-
export async function updateWorkflowWithMissingSteps(existingWorkflow, missingCandidates, versionGateway = createActionVersionGateway(), options) {
|
|
171
|
-
if (!existingWorkflow || typeof existingWorkflow !== "object") {
|
|
172
|
-
return generateWorkflowContent(missingCandidates, versionGateway, options);
|
|
173
|
-
}
|
|
174
|
-
const workflow = JSON.parse(JSON.stringify(existingWorkflow));
|
|
175
|
-
const jobs = workflow.jobs;
|
|
176
|
-
if (!jobs) {
|
|
177
|
-
return generateWorkflowContent(missingCandidates, versionGateway, options);
|
|
178
|
-
}
|
|
179
|
-
const jobNames = Object.keys(jobs);
|
|
180
|
-
if (jobNames.length === 0) {
|
|
181
|
-
return generateWorkflowContent(missingCandidates, versionGateway, options);
|
|
182
|
-
}
|
|
183
|
-
const mainJobName = jobNames[0];
|
|
184
|
-
const mainJob = jobs[mainJobName];
|
|
185
|
-
if (!mainJob || !Array.isArray(mainJob.steps)) {
|
|
186
|
-
return generateWorkflowContent(missingCandidates, versionGateway, options);
|
|
187
|
-
}
|
|
188
|
-
const stepOptions = {
|
|
189
|
-
usePlaceholders: options?.usePlaceholders,
|
|
190
|
-
resolvedVersions: options?.resolvedVersions,
|
|
191
|
-
};
|
|
192
|
-
appendMissingStepsToJob(mainJob.steps, missingCandidates, stepOptions);
|
|
193
|
-
return `---\n${stringifyYaml(workflow, { lineWidth: 0 })}`;
|
|
194
|
-
}
|
|
195
|
-
//# sourceMappingURL=workflow-generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-generator.js","sourceRoot":"","sources":["../../src/use-cases/workflow-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEH,SAAS,EACT,IAAI,EACJ,QAAQ,GACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAM1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EACH,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,wBAAwB,CAAC;AAqChC;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,UAAkB;IACxC,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,UAAU,CAAC;IACvD,OAAO,SAAS,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC;AACxE,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CACxB,MAAc,EACd,gBAAoC,EACpC,OAAgC;IAEhC,IAAI,OAAO,EAAE,gBAAgB,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,mBAAmB,CA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