@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
package/dist/entities/skill.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core domain entity for GitHub Copilot Agent Skills.
|
|
3
|
-
* Handles name normalization and SKILL.md content generation.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Normalizes a skill name to lowercase with hyphens.
|
|
7
|
-
* Handles spaces, mixed case, multiple spaces, and leading/trailing spaces.
|
|
8
|
-
*/
|
|
9
|
-
export function normalizeSkillName(name) {
|
|
10
|
-
return name.trim().toLowerCase().replace(/\s+/g, "-");
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Generates the SKILL.md content for a Copilot Agent Skill.
|
|
14
|
-
* Includes YAML frontmatter, documentation link, and example structure.
|
|
15
|
-
*/
|
|
16
|
-
export function generateSkillContent(skillName) {
|
|
17
|
-
const normalizedName = normalizeSkillName(skillName);
|
|
18
|
-
return `---
|
|
19
|
-
name: ${normalizedName}
|
|
20
|
-
description: Brief description of what this skill does and when Copilot should use it
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
<!--
|
|
24
|
-
This is a GitHub Copilot Agent Skill for repository-level use.
|
|
25
|
-
Learn more: https://docs.github.com/en/copilot/concepts/agents/about-agent-skills
|
|
26
|
-
-->
|
|
27
|
-
|
|
28
|
-
# ${normalizedName}
|
|
29
|
-
|
|
30
|
-
{Brief description of what this skill teaches Copilot to do}
|
|
31
|
-
|
|
32
|
-
## When to Use This Skill
|
|
33
|
-
|
|
34
|
-
Copilot should use this skill when:
|
|
35
|
-
|
|
36
|
-
- {Trigger condition 1}
|
|
37
|
-
- {Trigger condition 2}
|
|
38
|
-
- {Trigger condition 3}
|
|
39
|
-
|
|
40
|
-
## Instructions
|
|
41
|
-
|
|
42
|
-
{Detailed step-by-step instructions for Copilot to follow}
|
|
43
|
-
|
|
44
|
-
1. {Step 1}
|
|
45
|
-
2. {Step 2}
|
|
46
|
-
3. {Step 3}
|
|
47
|
-
|
|
48
|
-
## Guidelines
|
|
49
|
-
|
|
50
|
-
- {Guideline or best practice}
|
|
51
|
-
- {Guideline or best practice}
|
|
52
|
-
- {Guideline or best practice}
|
|
53
|
-
|
|
54
|
-
## Examples
|
|
55
|
-
|
|
56
|
-
{Examples of inputs and expected outputs or behaviors}
|
|
57
|
-
|
|
58
|
-
### Example 1: {Title}
|
|
59
|
-
|
|
60
|
-
{Description of the example scenario and expected behavior}
|
|
61
|
-
`;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=skill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../src/entities/skill.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IAClD,MAAM,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAErD,OAAO;QACH,cAAc;;;;;;;;;IASlB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCjB,CAAC;AACF,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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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Y;SACf,CAAC;IACN,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACpC,OAAO,IAAI,4BAA4B,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,99 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-system-workflow-gateway.js","sourceRoot":"","sources":["../../src/gateways/file-system-workflow-gateway.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAEH,sBAAsB,GACzB,MAAM,gCAAgC,CAA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ExE,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACtD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,yBAAyB,CAC3B,SAAiB,EACjB,OAAe;QAEf,+DAA+D;QAC/D,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,4BAA4B,CAAC,SAAS,CAAC,CAAC;QAExE,wDAAwD;QACxD,MAAM,YAAY,GACd,YAAY;YACZ,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,yBAAyB,CAAC,CAAC;QAEvE,MAAM,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACjC,OAAO,IAAI,yBAAyB,EAAE,CAAC;AAC3C,CAAC"}
|
package/dist/gateways/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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 "./skill-file-gateway.js";
|
|
9
|
-
export * from "./workflow-gateway.js";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
package/dist/gateways/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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 "./skill-file-gateway.js";
|
|
9
|
-
export * from "./workflow-gateway.js";
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gateway for skill file system operations.
|
|
3
|
-
* This module abstracts file system access for Copilot Agent Skill files.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Interface for skill file gateway
|
|
7
|
-
* Allows for different implementations (file system, mock, etc.)
|
|
8
|
-
*/
|
|
9
|
-
export interface SkillFileGateway {
|
|
10
|
-
/**
|
|
11
|
-
* Checks if a skill directory already exists
|
|
12
|
-
* @param targetDir The root directory of the repository
|
|
13
|
-
* @param skillName The normalized name of the skill
|
|
14
|
-
* @returns true if the skill directory exists
|
|
15
|
-
*/
|
|
16
|
-
skillDirectoryExists(targetDir: string, skillName: string): Promise<boolean>;
|
|
17
|
-
/**
|
|
18
|
-
* Ensures the .github/skills/<name> directory exists
|
|
19
|
-
* @param targetDir The root directory of the repository
|
|
20
|
-
* @param skillName The normalized name of the skill
|
|
21
|
-
*/
|
|
22
|
-
ensureSkillDirectory(targetDir: string, skillName: string): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Writes content to a SKILL.md file
|
|
25
|
-
* @param targetDir The root directory of the repository
|
|
26
|
-
* @param skillName The normalized name of the skill
|
|
27
|
-
* @param content The content to write to the file
|
|
28
|
-
*/
|
|
29
|
-
writeSkillFile(targetDir: string, skillName: string, content: string): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Returns the full path to a skill directory
|
|
32
|
-
* @param targetDir The root directory of the repository
|
|
33
|
-
* @param skillName The normalized name of the skill
|
|
34
|
-
* @returns The full path to the skill directory
|
|
35
|
-
*/
|
|
36
|
-
getSkillDirectoryPath(targetDir: string, skillName: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* Returns the full path to a SKILL.md file
|
|
39
|
-
* @param targetDir The root directory of the repository
|
|
40
|
-
* @param skillName The normalized name of the skill
|
|
41
|
-
* @returns The full path to the SKILL.md file
|
|
42
|
-
*/
|
|
43
|
-
getSkillFilePath(targetDir: string, skillName: string): string;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* File system implementation of the skill file gateway
|
|
47
|
-
*/
|
|
48
|
-
export declare class FileSystemSkillFileGateway implements SkillFileGateway {
|
|
49
|
-
getSkillDirectoryPath(targetDir: string, skillName: string): string;
|
|
50
|
-
getSkillFilePath(targetDir: string, skillName: string): string;
|
|
51
|
-
skillDirectoryExists(targetDir: string, skillName: string): Promise<boolean>;
|
|
52
|
-
ensureSkillDirectory(targetDir: string, skillName: string): Promise<void>;
|
|
53
|
-
writeSkillFile(targetDir: string, skillName: string, content: string): Promise<void>;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Creates and returns the default skill file gateway
|
|
57
|
-
*/
|
|
58
|
-
export declare function createSkillFileGateway(): SkillFileGateway;
|
|
59
|
-
//# sourceMappingURL=skill-file-gateway.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill-file-gate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