@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.
- package/LICENSE +21 -0
- package/README.md +148 -0
- package/dist/commands/copilot-setup.d.ts +5 -0
- package/dist/commands/copilot-setup.d.ts.map +1 -0
- package/dist/commands/copilot-setup.js +97 -0
- package/dist/commands/copilot-setup.js.map +1 -0
- package/dist/commands/init.d.ts +12 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +115 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/new.d.ts +11 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +41 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/entities/copilot-agent.d.ts +15 -0
- package/dist/entities/copilot-agent.d.ts.map +1 -0
- package/dist/entities/copilot-agent.js +53 -0
- package/dist/entities/copilot-agent.js.map +1 -0
- package/dist/entities/copilot-setup.d.ts +65 -0
- package/dist/entities/copilot-setup.d.ts.map +1 -0
- package/dist/entities/copilot-setup.js +6 -0
- package/dist/entities/copilot-setup.js.map +1 -0
- package/dist/entities/index.d.ts +6 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +6 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/gateways/action-version-gateway.d.ts +39 -0
- package/dist/gateways/action-version-gateway.d.ts.map +1 -0
- package/dist/gateways/action-version-gateway.js +47 -0
- package/dist/gateways/action-version-gateway.js.map +1 -0
- package/dist/gateways/agent-file-gateway.d.ts +50 -0
- package/dist/gateways/agent-file-gateway.d.ts.map +1 -0
- package/dist/gateways/agent-file-gateway.js +34 -0
- package/dist/gateways/agent-file-gateway.js.map +1 -0
- package/dist/gateways/environment-gateway.d.ts +30 -0
- package/dist/gateways/environment-gateway.d.ts.map +1 -0
- package/dist/gateways/environment-gateway.js +56 -0
- package/dist/gateways/environment-gateway.js.map +1 -0
- package/dist/gateways/file-system-utils.d.ts +8 -0
- package/dist/gateways/file-system-utils.d.ts.map +1 -0
- package/dist/gateways/file-system-utils.js +17 -0
- package/dist/gateways/file-system-utils.js.map +1 -0
- package/dist/gateways/file-system-workflow-gateway.d.ts +27 -0
- package/dist/gateways/file-system-workflow-gateway.d.ts.map +1 -0
- package/dist/gateways/file-system-workflow-gateway.js +99 -0
- package/dist/gateways/file-system-workflow-gateway.js.map +1 -0
- package/dist/gateways/index.d.ts +9 -0
- package/dist/gateways/index.d.ts.map +1 -0
- package/dist/gateways/index.js +9 -0
- package/dist/gateways/index.js.map +1 -0
- package/dist/gateways/workflow-gateway.d.ts +43 -0
- package/dist/gateways/workflow-gateway.d.ts.map +1 -0
- package/dist/gateways/workflow-gateway.js +6 -0
- package/dist/gateways/workflow-gateway.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config.d.ts +27 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +226 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/copilot-setup-config.d.ts +79 -0
- package/dist/lib/copilot-setup-config.d.ts.map +1 -0
- package/dist/lib/copilot-setup-config.js +119 -0
- package/dist/lib/copilot-setup-config.js.map +1 -0
- package/dist/lib/filesystem-structure.d.ts +45 -0
- package/dist/lib/filesystem-structure.d.ts.map +1 -0
- package/dist/lib/filesystem-structure.js +69 -0
- package/dist/lib/filesystem-structure.js.map +1 -0
- package/dist/lib/mcp-test-client.d.ts +43 -0
- package/dist/lib/mcp-test-client.d.ts.map +1 -0
- package/dist/lib/mcp-test-client.js +167 -0
- package/dist/lib/mcp-test-client.js.map +1 -0
- package/dist/lib/project-name-validation.d.ts +43 -0
- package/dist/lib/project-name-validation.d.ts.map +1 -0
- package/dist/lib/project-name-validation.js +131 -0
- package/dist/lib/project-name-validation.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +15 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +120 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/analyze-action-versions.d.ts +9 -0
- package/dist/mcp/tools/analyze-action-versions.d.ts.map +1 -0
- package/dist/mcp/tools/analyze-action-versions.js +81 -0
- package/dist/mcp/tools/analyze-action-versions.js.map +1 -0
- package/dist/mcp/tools/create-copilot-setup-workflow.d.ts +9 -0
- package/dist/mcp/tools/create-copilot-setup-workflow.d.ts.map +1 -0
- package/dist/mcp/tools/create-copilot-setup-workflow.js +121 -0
- package/dist/mcp/tools/create-copilot-setup-workflow.js.map +1 -0
- package/dist/mcp/tools/discover-environment.d.ts +9 -0
- package/dist/mcp/tools/discover-environment.d.ts.map +1 -0
- package/dist/mcp/tools/discover-environment.js +30 -0
- package/dist/mcp/tools/discover-environment.js.map +1 -0
- package/dist/mcp/tools/discover-workflow-setup-actions.d.ts +9 -0
- package/dist/mcp/tools/discover-workflow-setup-actions.d.ts.map +1 -0
- package/dist/mcp/tools/discover-workflow-setup-actions.js +37 -0
- package/dist/mcp/tools/discover-workflow-setup-actions.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +11 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +11 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/read-copilot-setup-workflow.d.ts +9 -0
- package/dist/mcp/tools/read-copilot-setup-workflow.d.ts.map +1 -0
- package/dist/mcp/tools/read-copilot-setup-workflow.js +38 -0
- package/dist/mcp/tools/read-copilot-setup-workflow.js.map +1 -0
- package/dist/mcp/tools/resolve-action-versions.d.ts +10 -0
- package/dist/mcp/tools/resolve-action-versions.d.ts.map +1 -0
- package/dist/mcp/tools/resolve-action-versions.js +61 -0
- package/dist/mcp/tools/resolve-action-versions.js.map +1 -0
- package/dist/mcp/tools/types.d.ts +67 -0
- package/dist/mcp/tools/types.d.ts.map +1 -0
- package/dist/mcp/tools/types.js +24 -0
- package/dist/mcp/tools/types.js.map +1 -0
- package/dist/mcp-server.d.ts +7 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +17 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/use-cases/action-resolution.d.ts +66 -0
- package/dist/use-cases/action-resolution.d.ts.map +1 -0
- package/dist/use-cases/action-resolution.js +107 -0
- package/dist/use-cases/action-resolution.js.map +1 -0
- package/dist/use-cases/candidate-builder.d.ts +17 -0
- package/dist/use-cases/candidate-builder.d.ts.map +1 -0
- package/dist/use-cases/candidate-builder.js +67 -0
- package/dist/use-cases/candidate-builder.js.map +1 -0
- package/dist/use-cases/copilot-setup.d.ts +8 -0
- package/dist/use-cases/copilot-setup.d.ts.map +1 -0
- package/dist/use-cases/copilot-setup.js +10 -0
- package/dist/use-cases/copilot-setup.js.map +1 -0
- package/dist/use-cases/create-copilot-agent.d.ts +29 -0
- package/dist/use-cases/create-copilot-agent.d.ts.map +1 -0
- package/dist/use-cases/create-copilot-agent.js +73 -0
- package/dist/use-cases/create-copilot-agent.js.map +1 -0
- package/dist/use-cases/index.d.ts +9 -0
- package/dist/use-cases/index.d.ts.map +1 -0
- package/dist/use-cases/index.js +9 -0
- package/dist/use-cases/index.js.map +1 -0
- package/dist/use-cases/setup-step-discovery.d.ts +87 -0
- package/dist/use-cases/setup-step-discovery.d.ts.map +1 -0
- package/dist/use-cases/setup-step-discovery.js +202 -0
- package/dist/use-cases/setup-step-discovery.js.map +1 -0
- package/dist/use-cases/workflow-generator.d.ts +34 -0
- package/dist/use-cases/workflow-generator.d.ts.map +1 -0
- package/dist/use-cases/workflow-generator.js +195 -0
- package/dist/use-cases/workflow-generator.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,202 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,EAAE,CAAC;QAC/D,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAClC,SAAS;QACb,CAAC;QAED,MAAM,KAAK,GAAI,GAA+B,CAAC,KAAK,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,SAAS;QACb,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,KAAK,E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,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE1C,IAAI,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;YAClC,UAAU,CAAC,IAAI,CAAC;gBACZ,MAAM;gBACN,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;gBACtC,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,MAAM,EAAE,UAAU;aACrB,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACjC,UAAgC;IAEhC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,YAAY,GAAyB,EAAE,CAAC;IAE9C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAC3B,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;IAED,OAAO,YAAY,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,195 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACvE,IAAI,QAAQ,EAAE,CAAC;YACX,OAAO,QAAQ,CAAC,GAAG,CAAC;QACxB,CAAC;IACL,CAAC;IAED,IAAI,OAAO,EAAE,eAAe,EAAE,CAAC;QAC3B,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED,OAAO,gBAAgB,IAAI,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;;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
+
"description": "CLI scaffolding tool that sets up projects with structure, instructions, and feedback loops for AI coding assistants",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/zpratt/lousy-agents.git"
|
|
9
|
+
},
|
|
10
|
+
"author": "zpratt",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/zpratt/lousy-agents/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/zpratt/lousy-agents#readme",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"cli",
|
|
18
|
+
"scaffolding",
|
|
19
|
+
"ai",
|
|
20
|
+
"copilot",
|
|
21
|
+
"github-copilot",
|
|
22
|
+
"coding-assistant",
|
|
23
|
+
"vibe-coding"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"bin": {
|
|
32
|
+
"lousy-agents": "./dist/index.js",
|
|
33
|
+
"lousy-agents-mcp": "./dist/mcp-server.js"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"dev": "tsx src/index.ts",
|
|
37
|
+
"build": "tsc",
|
|
38
|
+
"start": "node dist/index.js",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"lint": "biome check .",
|
|
41
|
+
"lint:fix": "biome check --write .",
|
|
42
|
+
"lint:workflows": "actionlint",
|
|
43
|
+
"lint:yaml": "yamllint ."
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@github-actions-workflow-ts/lib": "2.3.0",
|
|
47
|
+
"@modelcontextprotocol/sdk": "1.25.3",
|
|
48
|
+
"c12": "3.3.3",
|
|
49
|
+
"citty": "0.2.0",
|
|
50
|
+
"consola": "3.4.2",
|
|
51
|
+
"eta": "4.5.0",
|
|
52
|
+
"yaml": "2.8.2",
|
|
53
|
+
"zod": "4.3.6"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@biomejs/biome": "2.3.12",
|
|
57
|
+
"@types/chance": "1.1.7",
|
|
58
|
+
"@types/node": "24.10.4",
|
|
59
|
+
"chance": "1.1.13",
|
|
60
|
+
"tsx": "4.21.0",
|
|
61
|
+
"typescript": "5.9.3",
|
|
62
|
+
"vitest": "4.0.18",
|
|
63
|
+
"whatwg-fetch": "3.6.20"
|
|
64
|
+
}
|
|
65
|
+
}
|