@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lousy-agents/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "CLI scaffolding tool that sets up projects with structure, instructions, and feedback loops for AI coding assistants",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"dev": "tsx src/index.ts",
|
|
41
|
-
"build": "
|
|
41
|
+
"build": "rspack build --config rspack.config.ts && chmod +x dist/index.js dist/mcp-server.js",
|
|
42
42
|
"start": "node dist/index.js",
|
|
43
43
|
"test": "vitest run",
|
|
44
44
|
"lint": "biome check .",
|
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@biomejs/biome": "2.3.13",
|
|
61
|
+
"@rspack/cli": "1.7.4",
|
|
62
|
+
"@rspack/core": "1.7.4",
|
|
61
63
|
"@types/chance": "1.1.7",
|
|
62
64
|
"@types/node": "25.1.0",
|
|
63
65
|
"chance": "1.1.13",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-setup.d.ts","sourceRoot":"","sources":["../../src/commands/copilot-setup.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,eAAO,MAAM,mBAAmB,gCAyI9B,CAAC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { mkdir } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { defineCommand } from "citty";
|
|
4
|
-
import { consola } from "consola";
|
|
5
|
-
import { createEnvironmentGateway, createWorkflowGateway, fileExists, } from "../gateways/index.js";
|
|
6
|
-
import { buildCandidatesFromEnvironment, generateWorkflowContent, updateWorkflowWithMissingSteps, } from "../use-cases/copilot-setup.js";
|
|
7
|
-
import { findMissingCandidates, getExistingActionsFromWorkflow, mergeCandidates, } from "../use-cases/setup-step-discovery.js";
|
|
8
|
-
const copilotSetupArgs = {};
|
|
9
|
-
/**
|
|
10
|
-
* Main command implementation for copilot-setup
|
|
11
|
-
*/
|
|
12
|
-
export const copilotSetupCommand = defineCommand({
|
|
13
|
-
meta: {
|
|
14
|
-
name: "copilot-setup",
|
|
15
|
-
description: "Generate or update the Copilot Setup Steps workflow based on detected environment configuration",
|
|
16
|
-
},
|
|
17
|
-
args: copilotSetupArgs,
|
|
18
|
-
run: async (context) => {
|
|
19
|
-
// Support dependency injection for testing via context.data
|
|
20
|
-
const targetDir = typeof context.data?.targetDir === "string"
|
|
21
|
-
? context.data.targetDir
|
|
22
|
-
: process.cwd();
|
|
23
|
-
// Create gateways
|
|
24
|
-
const environmentGateway = createEnvironmentGateway();
|
|
25
|
-
const workflowGateway = createWorkflowGateway();
|
|
26
|
-
consola.info("Detecting environment configuration...");
|
|
27
|
-
// Step 1: Detect environment configuration files
|
|
28
|
-
const environment = await environmentGateway.detectEnvironment(targetDir);
|
|
29
|
-
if (environment.hasMise) {
|
|
30
|
-
consola.success("Found mise.toml - will use mise-action");
|
|
31
|
-
}
|
|
32
|
-
if (environment.versionFiles.length > 0) {
|
|
33
|
-
const fileNames = environment.versionFiles
|
|
34
|
-
.map((f) => f.filename)
|
|
35
|
-
.join(", ");
|
|
36
|
-
consola.success(`Found version files: ${fileNames}`);
|
|
37
|
-
}
|
|
38
|
-
// Step 2: Parse existing workflows for setup actions
|
|
39
|
-
const workflowsDir = join(targetDir, ".github", "workflows");
|
|
40
|
-
const workflowsDirExists = await fileExists(workflowsDir);
|
|
41
|
-
const workflowCandidates = workflowsDirExists
|
|
42
|
-
? await workflowGateway.parseWorkflowsForSetupActions(targetDir)
|
|
43
|
-
: [];
|
|
44
|
-
if (workflowCandidates.length > 0) {
|
|
45
|
-
const actionNames = workflowCandidates
|
|
46
|
-
.map((c) => c.action)
|
|
47
|
-
.join(", ");
|
|
48
|
-
consola.success(`Found setup actions in existing workflows: ${actionNames}`);
|
|
49
|
-
}
|
|
50
|
-
// Step 3: Build candidates from environment
|
|
51
|
-
const envCandidates = await buildCandidatesFromEnvironment(environment);
|
|
52
|
-
// Step 4: Merge candidates (workflow takes precedence)
|
|
53
|
-
const allCandidates = mergeCandidates(workflowCandidates, envCandidates);
|
|
54
|
-
if (allCandidates.length === 0) {
|
|
55
|
-
consola.warn("No environment configuration or setup actions detected. Creating minimal workflow with checkout only.");
|
|
56
|
-
}
|
|
57
|
-
// Step 5: Check if copilot-setup-steps.yml already exists
|
|
58
|
-
const workflowExists = await workflowGateway.copilotSetupWorkflowExists(targetDir);
|
|
59
|
-
// Ensure workflows directory exists
|
|
60
|
-
if (!workflowsDirExists) {
|
|
61
|
-
await mkdir(workflowsDir, { recursive: true });
|
|
62
|
-
}
|
|
63
|
-
if (workflowExists) {
|
|
64
|
-
// Update existing workflow
|
|
65
|
-
consola.info("Found existing copilot-setup-steps.yml - checking for missing steps...");
|
|
66
|
-
const existingWorkflow = await workflowGateway.readCopilotSetupWorkflow(targetDir);
|
|
67
|
-
const existingActions = getExistingActionsFromWorkflow(existingWorkflow);
|
|
68
|
-
const missingCandidates = findMissingCandidates(allCandidates, existingActions);
|
|
69
|
-
if (missingCandidates.length === 0) {
|
|
70
|
-
consola.success("Copilot Setup Steps workflow already contains all detected setup steps. No changes needed.");
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const missingNames = missingCandidates
|
|
74
|
-
.map((c) => c.action)
|
|
75
|
-
.join(", ");
|
|
76
|
-
consola.info(`Adding missing setup steps: ${missingNames}`);
|
|
77
|
-
const updatedContent = await updateWorkflowWithMissingSteps(existingWorkflow, missingCandidates);
|
|
78
|
-
await workflowGateway.writeCopilotSetupWorkflow(targetDir, updatedContent);
|
|
79
|
-
consola.success(`Updated copilot-setup-steps.yml with ${missingCandidates.length} new step(s)`);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
// Create new workflow
|
|
83
|
-
consola.info("Creating new copilot-setup-steps.yml workflow...");
|
|
84
|
-
const content = await generateWorkflowContent(allCandidates);
|
|
85
|
-
await workflowGateway.writeCopilotSetupWorkflow(targetDir, content);
|
|
86
|
-
const stepCount = allCandidates.length + 1; // +1 for checkout
|
|
87
|
-
consola.success(`Created copilot-setup-steps.yml with ${stepCount} step(s)`);
|
|
88
|
-
if (allCandidates.length > 0) {
|
|
89
|
-
const actionNames = allCandidates
|
|
90
|
-
.map((c) => c.action)
|
|
91
|
-
.join(", ");
|
|
92
|
-
consola.info(`Included setup steps: ${actionNames}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
//# sourceMappingURL=copilot-setup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-setup.js","sourceRoot":"","sources":["../../src/commands/copilot-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBA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AC,kBAAkB;YAC9D,OAAO,CAAC,OAAO,CACX,wCAAwC,SAAS,UAAU,CAC9D,CAAC;YAEF,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,MAAM,WAAW,GAAG,aAAa;qBAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;qBACpB,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC;CACJ,CAAC,CAAC"}
|
package/dist/commands/init.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const PROJECT_TYPE_OPTIONS: ("api" | "cli" | "webapp" | "graphql")[];
|
|
2
|
-
export declare const SUPPORTED_PROJECT_TYPES: readonly ["webapp", "api"];
|
|
3
|
-
export declare const initCommand: import("citty").CommandDef<{
|
|
4
|
-
kind: {
|
|
5
|
-
type: "string";
|
|
6
|
-
description: string;
|
|
7
|
-
};
|
|
8
|
-
name: {
|
|
9
|
-
type: "string";
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
}>;
|
|
13
|
-
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,oBAAoB,0CAA4B,CAAC;AAC9D,eAAO,MAAM,uBAAuB,4BAA6B,CAAC;AAoGlE,eAAO,MAAM,WAAW;;;;;;;;;EAyEtB,CAAC"}
|
package/dist/commands/init.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
import { consola } from "consola";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { getProjectStructure } from "../lib/config.js";
|
|
5
|
-
import { createFilesystemStructure, } from "../lib/filesystem-structure.js";
|
|
6
|
-
import { getProjectNameError, isValidProjectName, } from "../lib/project-name-validation.js";
|
|
7
|
-
const ProjectTypeSchema = z.enum(["cli", "webapp", "api", "graphql"]);
|
|
8
|
-
export const PROJECT_TYPE_OPTIONS = ProjectTypeSchema.options;
|
|
9
|
-
export const SUPPORTED_PROJECT_TYPES = ["webapp", "api"];
|
|
10
|
-
const initArgs = {
|
|
11
|
-
kind: {
|
|
12
|
-
type: "string",
|
|
13
|
-
description: `Project type: ${PROJECT_TYPE_OPTIONS.join(", ")}`,
|
|
14
|
-
},
|
|
15
|
-
name: {
|
|
16
|
-
type: "string",
|
|
17
|
-
description: "Project name (used in package.json and other config files)",
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
function formatErrorMessage(error) {
|
|
21
|
-
return error instanceof Error ? error.message : String(error);
|
|
22
|
-
}
|
|
23
|
-
async function getValidatedProjectName(promptFn, existingName, projectTypeLabel, placeholder) {
|
|
24
|
-
const rawProjectName = existingName
|
|
25
|
-
? existingName
|
|
26
|
-
: await promptFn("What is your project name?", {
|
|
27
|
-
type: "text",
|
|
28
|
-
placeholder,
|
|
29
|
-
});
|
|
30
|
-
const projectName = typeof rawProjectName === "string" ? rawProjectName.trim() : "";
|
|
31
|
-
if (!projectName) {
|
|
32
|
-
consola.error(`Project name is required for ${projectTypeLabel} projects`);
|
|
33
|
-
throw new Error("Project name is required");
|
|
34
|
-
}
|
|
35
|
-
if (!isValidProjectName(projectName)) {
|
|
36
|
-
const errorMessage = getProjectNameError(projectName) || "Invalid npm package name";
|
|
37
|
-
consola.error(`Invalid project name: "${projectName}". ${errorMessage}`);
|
|
38
|
-
throw new Error(`Invalid project name. ${errorMessage}`);
|
|
39
|
-
}
|
|
40
|
-
return { projectName };
|
|
41
|
-
}
|
|
42
|
-
async function createWebappScaffolding(targetDir, templateContext) {
|
|
43
|
-
try {
|
|
44
|
-
const webappStructure = await getProjectStructure("webapp");
|
|
45
|
-
await createFilesystemStructure(webappStructure, targetDir, templateContext);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
consola.error(`Failed to create webapp scaffolding: ${formatErrorMessage(error)}`);
|
|
49
|
-
throw error;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
async function createRestApiScaffolding(targetDir, templateContext) {
|
|
53
|
-
try {
|
|
54
|
-
const restApiStructure = await getProjectStructure("api");
|
|
55
|
-
await createFilesystemStructure(restApiStructure, targetDir, templateContext);
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
consola.error(`Failed to create REST API scaffolding: ${formatErrorMessage(error)}`);
|
|
59
|
-
throw error;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export const initCommand = defineCommand({
|
|
63
|
-
meta: {
|
|
64
|
-
name: "init",
|
|
65
|
-
description: "Initialize a new project with lousy agents scaffolding",
|
|
66
|
-
},
|
|
67
|
-
args: initArgs,
|
|
68
|
-
run: async (context) => {
|
|
69
|
-
const targetDir = typeof context.data?.targetDir === "string"
|
|
70
|
-
? context.data.targetDir
|
|
71
|
-
: process.cwd();
|
|
72
|
-
const promptFn = typeof context.data?.prompt === "function"
|
|
73
|
-
? context.data.prompt
|
|
74
|
-
: consola.prompt.bind(consola);
|
|
75
|
-
const rawProjectType = context.args.kind
|
|
76
|
-
? context.args.kind
|
|
77
|
-
: await promptFn("What type of project are you initializing?", {
|
|
78
|
-
type: "select",
|
|
79
|
-
options: SUPPORTED_PROJECT_TYPES,
|
|
80
|
-
});
|
|
81
|
-
const parseResult = ProjectTypeSchema.safeParse(rawProjectType);
|
|
82
|
-
if (!parseResult.success) {
|
|
83
|
-
const validOptions = PROJECT_TYPE_OPTIONS.join(", ");
|
|
84
|
-
consola.error(`Invalid project type selected: ${String(rawProjectType)}. Valid options are: ${validOptions}`);
|
|
85
|
-
throw new Error(`Invalid project type. Expected one of: ${validOptions}`);
|
|
86
|
-
}
|
|
87
|
-
const projectType = parseResult.data;
|
|
88
|
-
consola.success(`Selected project type: ${projectType}`);
|
|
89
|
-
if (projectType === "cli") {
|
|
90
|
-
throw new Error('Project type "cli" is not yet supported. Supported types: webapp, api');
|
|
91
|
-
}
|
|
92
|
-
else if (projectType === "webapp") {
|
|
93
|
-
const { projectName } = await getValidatedProjectName(promptFn, context.args.name, "webapp", "my-webapp");
|
|
94
|
-
const templateContext = { projectName };
|
|
95
|
-
await createWebappScaffolding(targetDir, templateContext);
|
|
96
|
-
consola.info("Webapp project scaffolding complete. Run 'npm install' to install dependencies.");
|
|
97
|
-
}
|
|
98
|
-
else if (projectType === "api") {
|
|
99
|
-
const { projectName } = await getValidatedProjectName(promptFn, context.args.name, "REST API", "my-rest-api");
|
|
100
|
-
const templateContext = { projectName };
|
|
101
|
-
await createRestApiScaffolding(targetDir, templateContext);
|
|
102
|
-
consola.info("REST API project scaffolding complete. Run 'npm install' to install dependencies.");
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
throw new Error('Project type "graphql" is not yet supported. Supported types: webapp, api');
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
//# sourceMappingURL=init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACH,yBAAyB,GAE5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,mBAAmB,EACnB,kBAAkB,GACrB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;A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M,uBAAuB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAC1D,OAAO,CAAC,IAAI,CACR,iFAAiF,CACpF,CAAC;QACN,CAAC;aAAM,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;YAC/B,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,uBAAuB,CACjD,QAAQ,EACR,OAAO,CAAC,IAAI,CAAC,IAAI,EACjB,UAAU,EACV,aAAa,CAChB,CAAC;YAEF,MAAM,eAAe,GAAoB,EAAE,WAAW,EAAE,CAAC;YACzD,MAAM,wBAAwB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAC3D,OAAO,CAAC,IAAI,CACR,mFAAmF,CACtF,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,KAAK,CACX,2EAA2E,CAC9E,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAC,CAAC"}
|
package/dist/commands/new.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `skill` subcommand for creating Agent Skills
|
|
3
|
-
*/
|
|
4
|
-
export declare const skillCommand: import("citty").CommandDef<{
|
|
5
|
-
name: {
|
|
6
|
-
type: "positional";
|
|
7
|
-
description: string;
|
|
8
|
-
required: boolean;
|
|
9
|
-
};
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* The `new` command for scaffolding new resources.
|
|
13
|
-
* Supports creating Copilot custom agents and Agent Skills.
|
|
14
|
-
*/
|
|
15
|
-
export declare const newCommand: import("citty").CommandDef<{
|
|
16
|
-
"copilot-agent": {
|
|
17
|
-
type: "string";
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
}>;
|
|
21
|
-
//# sourceMappingURL=new.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;EAmCvB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;EAmDrB,CAAC"}
|
package/dist/commands/new.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
import { consola } from "consola";
|
|
3
|
-
import { createAgentFileGateway } from "../gateways/agent-file-gateway.js";
|
|
4
|
-
import { createSkillFileGateway } from "../gateways/skill-file-gateway.js";
|
|
5
|
-
import { CreateCopilotAgentUseCase } from "../use-cases/create-copilot-agent.js";
|
|
6
|
-
import { CreateSkillUseCase } from "../use-cases/create-skill.js";
|
|
7
|
-
const copilotAgentArgs = {
|
|
8
|
-
"copilot-agent": {
|
|
9
|
-
type: "string",
|
|
10
|
-
description: "Create a new GitHub Copilot custom agent with the specified name. Example: lousy-agents new --copilot-agent security",
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
const skillArgs = {
|
|
14
|
-
name: {
|
|
15
|
-
type: "positional",
|
|
16
|
-
description: "The name of the skill to create. Example: lousy-agents new skill github-actions-debug",
|
|
17
|
-
required: true,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* The `skill` subcommand for creating Agent Skills
|
|
22
|
-
*/
|
|
23
|
-
export const skillCommand = defineCommand({
|
|
24
|
-
meta: {
|
|
25
|
-
name: "skill",
|
|
26
|
-
description: "Create a new GitHub Copilot Agent Skill. Example: lousy-agents new skill github-actions-debug",
|
|
27
|
-
},
|
|
28
|
-
args: skillArgs,
|
|
29
|
-
run: async (context) => {
|
|
30
|
-
// Support dependency injection for testing via context.data
|
|
31
|
-
const targetDir = typeof context.data?.targetDir === "string"
|
|
32
|
-
? context.data.targetDir
|
|
33
|
-
: process.cwd();
|
|
34
|
-
const skillName = context.args.name;
|
|
35
|
-
if (!skillName) {
|
|
36
|
-
throw new Error("Missing required argument: <name>. Example: lousy-agents new skill github-actions-debug");
|
|
37
|
-
}
|
|
38
|
-
// Create the use case with the file system gateway
|
|
39
|
-
const gateway = createSkillFileGateway();
|
|
40
|
-
const useCase = new CreateSkillUseCase(gateway);
|
|
41
|
-
// Execute the use case
|
|
42
|
-
const result = await useCase.execute(targetDir, skillName);
|
|
43
|
-
if (!result.success) {
|
|
44
|
-
throw new Error(result.error);
|
|
45
|
-
}
|
|
46
|
-
consola.success(`Created Agent Skill: ${result.skillFilePath}`);
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
/**
|
|
50
|
-
* The `new` command for scaffolding new resources.
|
|
51
|
-
* Supports creating Copilot custom agents and Agent Skills.
|
|
52
|
-
*/
|
|
53
|
-
export const newCommand = defineCommand({
|
|
54
|
-
meta: {
|
|
55
|
-
name: "new",
|
|
56
|
-
description: "Create new resources (e.g., Copilot agents, skills). Use 'new skill <name>' to create an Agent Skill.",
|
|
57
|
-
},
|
|
58
|
-
args: copilotAgentArgs,
|
|
59
|
-
subCommands: {
|
|
60
|
-
skill: skillCommand,
|
|
61
|
-
},
|
|
62
|
-
run: async (context) => {
|
|
63
|
-
// citty runs both the subcommand's run function and the parent's run function.
|
|
64
|
-
// We need to detect when a subcommand was invoked and exit early to avoid
|
|
65
|
-
// throwing an error for missing --copilot-agent option.
|
|
66
|
-
const subCommand = context.rawArgs[0];
|
|
67
|
-
if (subCommand === "skill") {
|
|
68
|
-
return; // Subcommand was handled by skillCommand.run
|
|
69
|
-
}
|
|
70
|
-
// Support dependency injection for testing via context.data
|
|
71
|
-
const targetDir = typeof context.data?.targetDir === "string"
|
|
72
|
-
? context.data.targetDir
|
|
73
|
-
: process.cwd();
|
|
74
|
-
const copilotAgentName = context.args["copilot-agent"];
|
|
75
|
-
if (!copilotAgentName) {
|
|
76
|
-
throw new Error("Missing required option. Use one of:\n" +
|
|
77
|
-
" --copilot-agent <name> Create a Copilot custom agent\n" +
|
|
78
|
-
" skill <name> Create an Agent Skill\n\n" +
|
|
79
|
-
"Examples:\n" +
|
|
80
|
-
" lousy-agents new --copilot-agent security\n" +
|
|
81
|
-
" lousy-agents new skill github-actions-debug");
|
|
82
|
-
}
|
|
83
|
-
// Create the use case with the file system gateway
|
|
84
|
-
const gateway = createAgentFileGateway();
|
|
85
|
-
const useCase = new CreateCopilotAgentUseCase(gateway);
|
|
86
|
-
// Execute the use case
|
|
87
|
-
const result = await useCase.execute(targetDir, copilotAgentName);
|
|
88
|
-
if (!result.success) {
|
|
89
|
-
throw new Error(result.error);
|
|
90
|
-
}
|
|
91
|
-
consola.success(`Created Copilot agent: ${result.filePath}`);
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
//# sourceMappingURL=new.js.map
|
package/dist/commands/new.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,gBAAgB,GAAG;IACrB,eAAe,EAAE;QACb,IAAI,EAAE,QAAiB;QACvB,WAAW,EACP,sHAAsH;KAC7H;CACJ,CAAC;AAIF,MAAM,SAAS,GAAG;IACd,IAAI,EAAE;QACF,IAAI,EAAE,YAAqB;QAC3B,WAAW,EACP,uFAAuF;QAC3F,QAAQ,EAAE,IAAI;KACjB;CACJ,CAAC;AAIF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;IACtC,IAAI,EAAE;QACF,IAAI,EAAE,OAAO;QACb,WAAW,EACP,+FAA+F;KACtG;IACD,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,KAAK,EA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AAC,6CAA6C;QACzD,CAAC;QAED,4DAA4D;QAC5D,MAAM,SAAS,GACX,OAAO,OAAO,CAAC,IAAI,EAAE,SAAS,KAAK,QAAQ;YACvC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;YACxB,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAExB,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEvD,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACX,wCAAwC;gBACpC,2DAA2D;gBAC3D,qDAAqD;gBACrD,aAAa;gBACb,+CAA+C;gBAC/C,+CAA+C,CACtD,CAAC;QACN,CAAC;QAED,mDAAmD;QACnD,MAAM,OAAO,GAAG,sBAAsB,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAEvD,uBAAuB;QACvB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAElE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,CAAC,OAAO,CAAC,0BAA0B,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjE,CAAC;CACJ,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core domain entity for GitHub Copilot custom agent files.
|
|
3
|
-
* Handles name normalization and content generation.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Normalizes an agent name to lowercase with hyphens.
|
|
7
|
-
* Handles spaces, mixed case, multiple spaces, and leading/trailing spaces.
|
|
8
|
-
*/
|
|
9
|
-
export declare function normalizeAgentName(name: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Generates the markdown content for a custom Copilot agent file.
|
|
12
|
-
* Includes YAML frontmatter, documentation link, and example structure.
|
|
13
|
-
*/
|
|
14
|
-
export declare function generateAgentContent(agentName: string): string;
|
|
15
|
-
//# sourceMappingURL=copilot-agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-agent.d.ts","sourceRoot":"","sources":["../../src/entities/copilot-agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAqC9D"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core domain entity for GitHub Copilot custom agent files.
|
|
3
|
-
* Handles name normalization and content generation.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Normalizes an agent name to lowercase with hyphens.
|
|
7
|
-
* Handles spaces, mixed case, multiple spaces, and leading/trailing spaces.
|
|
8
|
-
*/
|
|
9
|
-
export function normalizeAgentName(name) {
|
|
10
|
-
return name.trim().toLowerCase().replace(/\s+/g, "-");
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Generates the markdown content for a custom Copilot agent file.
|
|
14
|
-
* Includes YAML frontmatter, documentation link, and example structure.
|
|
15
|
-
*/
|
|
16
|
-
export function generateAgentContent(agentName) {
|
|
17
|
-
const normalizedName = normalizeAgentName(agentName);
|
|
18
|
-
return `---
|
|
19
|
-
name: ${normalizedName}
|
|
20
|
-
description: Brief description of what this agent does
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
<!--
|
|
24
|
-
This is a custom GitHub Copilot agent for repository-level use.
|
|
25
|
-
Learn more: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents
|
|
26
|
-
-->
|
|
27
|
-
|
|
28
|
-
# ${normalizedName} Agent
|
|
29
|
-
|
|
30
|
-
You are a ${normalizedName} agent specialized in {domain/responsibility}.
|
|
31
|
-
|
|
32
|
-
## Your Role
|
|
33
|
-
|
|
34
|
-
{Brief description of the agent's expertise and focus area}
|
|
35
|
-
|
|
36
|
-
## Responsibilities
|
|
37
|
-
|
|
38
|
-
- {Primary responsibility}
|
|
39
|
-
- {Secondary responsibility}
|
|
40
|
-
- {Additional responsibility}
|
|
41
|
-
|
|
42
|
-
## Guidelines
|
|
43
|
-
|
|
44
|
-
- {Guideline or best practice}
|
|
45
|
-
- {Guideline or best practice}
|
|
46
|
-
- {Guideline or best practice}
|
|
47
|
-
|
|
48
|
-
## Example Interactions
|
|
49
|
-
|
|
50
|
-
{Example of how the agent should respond to typical requests}
|
|
51
|
-
`;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=copilot-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-agent.js","sourceRoot":"","sources":["../../src/entities/copilot-agent.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;;YAEN,cAAc;;;;;;;;;;;;;;;;;;;;;CAqBzB,CAAC;AACF,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core domain entities for the Copilot Setup Steps feature.
|
|
3
|
-
* These are the fundamental types that represent the business domain.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Types of version files supported for detection
|
|
7
|
-
*/
|
|
8
|
-
export type VersionFileType = "node" | "python" | "java" | "ruby" | "go";
|
|
9
|
-
/**
|
|
10
|
-
* Represents a detected version file in the repository
|
|
11
|
-
*/
|
|
12
|
-
export interface VersionFile {
|
|
13
|
-
type: VersionFileType;
|
|
14
|
-
filename: string;
|
|
15
|
-
version?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Result of detecting environment configuration
|
|
19
|
-
*/
|
|
20
|
-
export interface DetectedEnvironment {
|
|
21
|
-
hasMise: boolean;
|
|
22
|
-
versionFiles: VersionFile[];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Represents a setup step candidate extracted from workflows or version files
|
|
26
|
-
*/
|
|
27
|
-
export interface SetupStepCandidate {
|
|
28
|
-
action: string;
|
|
29
|
-
version?: string;
|
|
30
|
-
config?: Record<string, unknown>;
|
|
31
|
-
source: "version-file" | "workflow";
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Represents a step in a GitHub Actions workflow
|
|
35
|
-
*/
|
|
36
|
-
export interface WorkflowStep {
|
|
37
|
-
name?: string;
|
|
38
|
-
uses: string;
|
|
39
|
-
with?: Record<string, unknown>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Represents an action that needs version resolution.
|
|
43
|
-
* Used to prompt the LLM to look up the latest version.
|
|
44
|
-
*/
|
|
45
|
-
export interface ActionToResolve {
|
|
46
|
-
/** Action name without version (e.g., "actions/setup-node") */
|
|
47
|
-
action: string;
|
|
48
|
-
/** Placeholder used in workflow template (e.g., "RESOLVE_VERSION") */
|
|
49
|
-
currentPlaceholder: string;
|
|
50
|
-
/** URL to lookup latest version (e.g., "https://github.com/actions/setup-node/releases/latest") */
|
|
51
|
-
lookupUrl: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Represents a resolved action version with SHA and tag.
|
|
55
|
-
* Used when the LLM has looked up and resolved the version.
|
|
56
|
-
*/
|
|
57
|
-
export interface ResolvedVersion {
|
|
58
|
-
/** Action name without version (e.g., "actions/setup-node") */
|
|
59
|
-
action: string;
|
|
60
|
-
/** Resolved commit SHA */
|
|
61
|
-
sha: string;
|
|
62
|
-
/** Version tag for human-readable comment (e.g., "v4.0.0") */
|
|
63
|
-
versionTag: string;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=copilot-setup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-setup.d.ts","sourceRoot":"","sources":["../../src/entities/copilot-setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,cAAc,GAAG,UAAU,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mGAAmG;IACnG,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-setup.js","sourceRoot":"","sources":["../../src/entities/copilot-setup.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/dist/entities/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
|
package/dist/entities/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
|
package/dist/entities/skill.d.ts
DELETED
|
@@ -1,15 +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 declare function normalizeSkillName(name: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Generates the SKILL.md content for a Copilot Agent Skill.
|
|
12
|
-
* Includes YAML frontmatter, documentation link, and example structure.
|
|
13
|
-
*/
|
|
14
|
-
export declare function generateSkillContent(skillName: string): string;
|
|
15
|
-
//# sourceMappingURL=skill.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/entities/skill.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA+C9D"}
|