@htekdev/actions-debugger 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 +108 -0
- package/dist/db/loader.d.ts +12 -0
- package/dist/db/loader.d.ts.map +1 -0
- package/dist/db/loader.js +76 -0
- package/dist/db/loader.js.map +1 -0
- package/dist/db/search.d.ts +19 -0
- package/dist/db/search.d.ts.map +1 -0
- package/dist/db/search.js +123 -0
- package/dist/db/search.js.map +1 -0
- package/dist/db/types.d.ts +61 -0
- package/dist/db/types.d.ts.map +1 -0
- package/dist/db/types.js +5 -0
- package/dist/db/types.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +164 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/diagnose-workflow.d.ts +13 -0
- package/dist/tools/diagnose-workflow.d.ts.map +1 -0
- package/dist/tools/diagnose-workflow.js +53 -0
- package/dist/tools/diagnose-workflow.js.map +1 -0
- package/dist/tools/list-categories.d.ts +13 -0
- package/dist/tools/list-categories.d.ts.map +1 -0
- package/dist/tools/list-categories.js +51 -0
- package/dist/tools/list-categories.js.map +1 -0
- package/dist/tools/lookup-error.d.ts +18 -0
- package/dist/tools/lookup-error.d.ts.map +1 -0
- package/dist/tools/lookup-error.js +67 -0
- package/dist/tools/lookup-error.js.map +1 -0
- package/dist/tools/search-errors.d.ts +17 -0
- package/dist/tools/search-errors.d.ts.map +1 -0
- package/dist/tools/search-errors.js +33 -0
- package/dist/tools/search-errors.js.map +1 -0
- package/dist/tools/suggest-fix.d.ts +13 -0
- package/dist/tools/suggest-fix.d.ts.map +1 -0
- package/dist/tools/suggest-fix.js +62 -0
- package/dist/tools/suggest-fix.js.map +1 -0
- package/dist/utils/pattern-matcher.d.ts +15 -0
- package/dist/utils/pattern-matcher.d.ts.map +1 -0
- package/dist/utils/pattern-matcher.js +50 -0
- package/dist/utils/pattern-matcher.js.map +1 -0
- package/dist/utils/yaml-parser.d.ts +10 -0
- package/dist/utils/yaml-parser.d.ts.map +1 -0
- package/dist/utils/yaml-parser.js +142 -0
- package/dist/utils/yaml-parser.js.map +1 -0
- package/errors/_schema.json +89 -0
- package/errors/caching-artifacts/cache-miss.yml +56 -0
- package/errors/caching-artifacts/upload-artifact-v4-breaking.yml +67 -0
- package/errors/concurrency-timing/jobs-cancelled-unexpectedly.yml +60 -0
- package/errors/known-unsolved/no-step-retry.yml +53 -0
- package/errors/permissions-auth/github-token-403.yml +64 -0
- package/errors/permissions-auth/oidc-aws-failure.yml +85 -0
- package/errors/runner-environment/disk-space.yml +57 -0
- package/errors/runner-environment/node-runtime-deprecation.yml +56 -0
- package/errors/silent-failures/github-token-no-trigger.yml +57 -0
- package/errors/silent-failures/scheduled-workflow-disabled.yml +59 -0
- package/errors/triggers/cron-schedule-late.yml +59 -0
- package/errors/triggers/workflow-not-triggering.yml +60 -0
- package/errors/yaml-syntax/if-always-true.yml +52 -0
- package/errors/yaml-syntax/secrets-in-if.yml +55 -0
- package/errors/yaml-syntax/unexpected-yaml-key.yml +69 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hector Flores (htekdev)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @htekdev/actions-debugger
|
|
2
|
+
|
|
3
|
+
[](https://github.com/htekdev/actions-debugger/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@htekdev/actions-debugger)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
> 65+ real GitHub Actions errors, queryable by agents. MCP server + Copilot skills + error database.
|
|
8
|
+
|
|
9
|
+
**Stop debugging the same CI failures over and over.** This repo packages 65+ real-world GitHub Actions error scenarios — with regex-matchable patterns, root causes, and copy-paste fixes — into formats that both humans and AI agents can consume.
|
|
10
|
+
|
|
11
|
+
## What's Inside
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
errors/ → Structured YAML error database (65+ entries)
|
|
15
|
+
src/ → MCP server (TypeScript + @modelcontextprotocol/sdk)
|
|
16
|
+
.github/skills/ → Copilot CLI skills for CI debugging
|
|
17
|
+
.github/agents/ → Copilot agent definition
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
### As an MCP Server (Claude Desktop, Copilot CLI, Cursor, etc.)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @htekdev/actions-debugger
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Add to your MCP client config:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"actions-debugger": {
|
|
34
|
+
"command": "npx",
|
|
35
|
+
"args": ["@htekdev/actions-debugger"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Client config locations:**
|
|
42
|
+
- **Claude Desktop**: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) / `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
|
|
43
|
+
- **Cursor**: `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global)
|
|
44
|
+
- **VS Code (Copilot Chat)**: `.vscode/mcp.json`
|
|
45
|
+
- **Copilot CLI**: `.github/mcp.json` (repo-level)
|
|
46
|
+
- **Windsurf**: `~/.codeium/windsurf/mcp_config.json`
|
|
47
|
+
|
|
48
|
+
### As a Copilot CLI Skill (No MCP Required)
|
|
49
|
+
|
|
50
|
+
Copy `.github/skills/actions-debugging/SKILL.md` to your repo's `.github/skills/` directory. Reference it in your agent:
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
> **Skill reference:** For CI debugging, use the `actions-debugging` skill.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Programmatic (npm Package)
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { loadErrorDatabase, lookupError, diagnoseWorkflow } from "@htekdev/actions-debugger";
|
|
60
|
+
|
|
61
|
+
const db = await loadErrorDatabase();
|
|
62
|
+
|
|
63
|
+
// Lookup by error message
|
|
64
|
+
const matches = lookupError(db, "Permission to org/repo.git denied");
|
|
65
|
+
console.log(matches[0].fix);
|
|
66
|
+
|
|
67
|
+
// Analyze a workflow
|
|
68
|
+
const issues = diagnoseWorkflow(db, workflowYamlString);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## MCP Tools
|
|
72
|
+
|
|
73
|
+
| Tool | Description |
|
|
74
|
+
|------|-------------|
|
|
75
|
+
| `lookup_error` | Match an error message against 65+ known issues |
|
|
76
|
+
| `diagnose_workflow` | Static analysis of workflow YAML for common mistakes |
|
|
77
|
+
| `suggest_fix` | Contextual fix suggestions from error context |
|
|
78
|
+
| `search_errors` | Full-text search by keyword, category, severity |
|
|
79
|
+
| `list_categories` | Browse error categories with counts |
|
|
80
|
+
|
|
81
|
+
## Error Categories
|
|
82
|
+
|
|
83
|
+
| Category | Description |
|
|
84
|
+
|----------|-------------|
|
|
85
|
+
| `yaml-syntax` | YAML validation, key typos, expression errors |
|
|
86
|
+
| `silent-failures` | No error shown, but wrong behavior |
|
|
87
|
+
| `runner-environment` | Runner issues, disk space, Docker, PATH |
|
|
88
|
+
| `permissions-auth` | GITHUB_TOKEN, OIDC, secrets, 403s |
|
|
89
|
+
| `caching-artifacts` | Cache misses, artifact v4 changes, corruption |
|
|
90
|
+
| `triggers` | Workflow not running, cron issues, dispatch |
|
|
91
|
+
| `concurrency-timing` | Job cancellation, matrix, timeouts |
|
|
92
|
+
| `known-unsolved` | Platform limitations with no fix |
|
|
93
|
+
|
|
94
|
+
## Contributing
|
|
95
|
+
|
|
96
|
+
See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for how to add new error entries. It's easy:
|
|
97
|
+
|
|
98
|
+
1. Create a YAML file in the appropriate `errors/{category}/` directory
|
|
99
|
+
2. Follow the schema in `errors/_schema.json`
|
|
100
|
+
3. Open a PR — CI validates your entry automatically
|
|
101
|
+
|
|
102
|
+
## Source
|
|
103
|
+
|
|
104
|
+
All error scenarios sourced from: **[The Definitive GitHub Actions Debugging Guide](https://htek.dev/articles/github-actions-debugging-guide)**
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
MIT — [Hector Flores](https://htek.dev) (htekdev)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML error database loader.
|
|
3
|
+
* Reads all YAML files from errors/ directory and builds an in-memory database.
|
|
4
|
+
*/
|
|
5
|
+
import type { ErrorDatabase } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Load the error database from YAML files.
|
|
8
|
+
* @param errorsDir - Optional custom path to errors directory
|
|
9
|
+
* @returns Populated ErrorDatabase
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadErrorDatabase(errorsDir?: string): Promise<ErrorDatabase>;
|
|
12
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/db/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAc,aAAa,EAAiB,MAAM,YAAY,CAAC;AAE3E;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA2ClF"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML error database loader.
|
|
3
|
+
* Reads all YAML files from errors/ directory and builds an in-memory database.
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
6
|
+
import { resolve, dirname, basename } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { globSync } from "glob";
|
|
9
|
+
import yaml from "js-yaml";
|
|
10
|
+
/**
|
|
11
|
+
* Load the error database from YAML files.
|
|
12
|
+
* @param errorsDir - Optional custom path to errors directory
|
|
13
|
+
* @returns Populated ErrorDatabase
|
|
14
|
+
*/
|
|
15
|
+
export async function loadErrorDatabase(errorsDir) {
|
|
16
|
+
const dir = errorsDir ?? findErrorsDir();
|
|
17
|
+
if (!existsSync(dir)) {
|
|
18
|
+
throw new Error(`Errors directory not found: ${dir}`);
|
|
19
|
+
}
|
|
20
|
+
const yamlFiles = globSync("**/*.yml", { cwd: dir, absolute: true });
|
|
21
|
+
const entries = [];
|
|
22
|
+
for (const file of yamlFiles) {
|
|
23
|
+
// Skip schema file
|
|
24
|
+
if (basename(file) === "_schema.json")
|
|
25
|
+
continue;
|
|
26
|
+
try {
|
|
27
|
+
const content = readFileSync(file, "utf-8");
|
|
28
|
+
const entry = yaml.load(content);
|
|
29
|
+
// Basic validation
|
|
30
|
+
if (!entry.id || !entry.title || !entry.category) {
|
|
31
|
+
console.warn(`Skipping invalid entry: ${file} (missing required fields)`);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
entries.push(entry);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
console.warn(`Failed to parse ${file}: ${err.message}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// Build indexes
|
|
41
|
+
const categories = new Map();
|
|
42
|
+
const byId = new Map();
|
|
43
|
+
for (const entry of entries) {
|
|
44
|
+
byId.set(entry.id, entry);
|
|
45
|
+
const catEntries = categories.get(entry.category) ?? [];
|
|
46
|
+
catEntries.push(entry);
|
|
47
|
+
categories.set(entry.category, catEntries);
|
|
48
|
+
}
|
|
49
|
+
return { entries, categories, byId };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Find the errors directory relative to this file or the package root.
|
|
53
|
+
*/
|
|
54
|
+
function findErrorsDir() {
|
|
55
|
+
// When running from source (src/db/loader.ts)
|
|
56
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
57
|
+
const srcDir = dirname(dirname(thisFile));
|
|
58
|
+
const rootDir = dirname(srcDir);
|
|
59
|
+
// Check for errors/ at package root
|
|
60
|
+
const candidate = resolve(rootDir, "errors");
|
|
61
|
+
if (existsSync(candidate)) {
|
|
62
|
+
return candidate;
|
|
63
|
+
}
|
|
64
|
+
// When installed as npm package, errors/ is in the package
|
|
65
|
+
const npmCandidate = resolve(rootDir, "..", "errors");
|
|
66
|
+
if (existsSync(npmCandidate)) {
|
|
67
|
+
return npmCandidate;
|
|
68
|
+
}
|
|
69
|
+
// Fallback: look relative to cwd
|
|
70
|
+
const cwdCandidate = resolve(process.cwd(), "errors");
|
|
71
|
+
if (existsSync(cwdCandidate)) {
|
|
72
|
+
return cwdCandidate;
|
|
73
|
+
}
|
|
74
|
+
throw new Error("Could not find errors directory. Set ACTIONS_DEBUGGER_ERRORS_DIR or pass errorsDir to loadErrorDatabase().");
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/db/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,IAAI,MAAM,SAAS,CAAC;AAG3B;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,SAAkB;IACxD,MAAM,GAAG,GAAG,SAAS,IAAI,aAAa,EAAE,CAAC;IAEzC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACrE,MAAM,OAAO,GAAiB,EAAE,CAAC;IAEjC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,mBAAmB;QACnB,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,cAAc;YAAE,SAAS;QAEhD,IAAI,C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,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC,oCAAoC;IACpC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7C,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,2DAA2D;IAC3D,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,iCAAiC;IACjC,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;IACtD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,4GAA4G,CAC7G,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern matching engine for error lookup.
|
|
3
|
+
* Matches error messages against regex patterns from the error database.
|
|
4
|
+
*/
|
|
5
|
+
import type { ErrorDatabase, SearchResult } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Match an error message against all patterns in the database.
|
|
8
|
+
* Returns results sorted by match confidence.
|
|
9
|
+
*/
|
|
10
|
+
export declare function lookupByPattern(db: ErrorDatabase, errorMessage: string, maxResults?: number): SearchResult[];
|
|
11
|
+
/**
|
|
12
|
+
* Search the database by keyword across title, root_cause, fix, and tags.
|
|
13
|
+
*/
|
|
14
|
+
export declare function searchByKeyword(db: ErrorDatabase, query: string, options?: {
|
|
15
|
+
category?: string;
|
|
16
|
+
severity?: string;
|
|
17
|
+
maxResults?: number;
|
|
18
|
+
}): SearchResult[];
|
|
19
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/db/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAc,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1E;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,aAAa,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,GAAE,MAAU,GACrB,YAAY,EAAE,CAehB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,aAAa,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,YAAY,EAAE,CAwDhB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern matching engine for error lookup.
|
|
3
|
+
* Matches error messages against regex patterns from the error database.
|
|
4
|
+
*/
|
|
5
|
+
/** Maximum input length to match against (prevent ReDoS on huge logs) */
|
|
6
|
+
const MAX_INPUT_LENGTH = 10_000;
|
|
7
|
+
/**
|
|
8
|
+
* Match an error message against all patterns in the database.
|
|
9
|
+
* Returns results sorted by match confidence.
|
|
10
|
+
*/
|
|
11
|
+
export function lookupByPattern(db, errorMessage, maxResults = 3) {
|
|
12
|
+
// Truncate input for safety
|
|
13
|
+
const input = errorMessage.slice(0, MAX_INPUT_LENGTH);
|
|
14
|
+
const results = [];
|
|
15
|
+
for (const entry of db.entries) {
|
|
16
|
+
const score = matchEntry(entry, input);
|
|
17
|
+
if (score > 0) {
|
|
18
|
+
results.push({ entry, score, matchType: score >= 100 ? "regex" : score >= 50 ? "exact" : "fuzzy" });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// Sort by score descending
|
|
22
|
+
results.sort((a, b) => b.score - a.score);
|
|
23
|
+
return results.slice(0, maxResults);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Search the database by keyword across title, root_cause, fix, and tags.
|
|
27
|
+
*/
|
|
28
|
+
export function searchByKeyword(db, query, options) {
|
|
29
|
+
const { category, severity, maxResults = 10 } = options ?? {};
|
|
30
|
+
const queryLower = query.toLowerCase();
|
|
31
|
+
const queryTerms = queryLower.split(/\s+/).filter(t => t.length > 1);
|
|
32
|
+
const results = [];
|
|
33
|
+
for (const entry of db.entries) {
|
|
34
|
+
// Apply filters
|
|
35
|
+
if (category && entry.category !== category)
|
|
36
|
+
continue;
|
|
37
|
+
if (severity && entry.severity !== severity)
|
|
38
|
+
continue;
|
|
39
|
+
let score = 0;
|
|
40
|
+
// Title match (highest weight)
|
|
41
|
+
const titleLower = entry.title.toLowerCase();
|
|
42
|
+
if (titleLower.includes(queryLower)) {
|
|
43
|
+
score += 100;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
for (const term of queryTerms) {
|
|
47
|
+
if (titleLower.includes(term))
|
|
48
|
+
score += 30;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Tag match
|
|
52
|
+
for (const tag of entry.tags ?? []) {
|
|
53
|
+
const tagStr = String(tag).toLowerCase();
|
|
54
|
+
if (queryTerms.includes(tagStr))
|
|
55
|
+
score += 25;
|
|
56
|
+
}
|
|
57
|
+
// Root cause match
|
|
58
|
+
const rootCauseLower = entry.root_cause.toLowerCase();
|
|
59
|
+
for (const term of queryTerms) {
|
|
60
|
+
if (rootCauseLower.includes(term))
|
|
61
|
+
score += 15;
|
|
62
|
+
}
|
|
63
|
+
// Fix match
|
|
64
|
+
const fixLower = entry.fix.toLowerCase();
|
|
65
|
+
for (const term of queryTerms) {
|
|
66
|
+
if (fixLower.includes(term))
|
|
67
|
+
score += 10;
|
|
68
|
+
}
|
|
69
|
+
// Error messages match
|
|
70
|
+
for (const msg of entry.error_messages ?? []) {
|
|
71
|
+
if (msg.toLowerCase().includes(queryLower)) {
|
|
72
|
+
score += 50;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (score > 0) {
|
|
77
|
+
results.push({ entry, score, matchType: "keyword" });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
results.sort((a, b) => b.score - a.score);
|
|
81
|
+
return results.slice(0, maxResults);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Score an entry against an error message input.
|
|
85
|
+
*/
|
|
86
|
+
function matchEntry(entry, input) {
|
|
87
|
+
let bestScore = 0;
|
|
88
|
+
// 1. Regex pattern matching (highest confidence)
|
|
89
|
+
for (const pattern of entry.patterns ?? []) {
|
|
90
|
+
try {
|
|
91
|
+
const flags = pattern.flags ?? "i";
|
|
92
|
+
const re = new RegExp(pattern.regex, flags);
|
|
93
|
+
if (re.test(input)) {
|
|
94
|
+
bestScore = Math.max(bestScore, 100);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// Invalid regex — skip
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// 2. Exact error message matching
|
|
103
|
+
for (const msg of entry.error_messages ?? []) {
|
|
104
|
+
if (input.includes(msg)) {
|
|
105
|
+
bestScore = Math.max(bestScore, 80);
|
|
106
|
+
}
|
|
107
|
+
// Partial match
|
|
108
|
+
const msgLower = msg.toLowerCase();
|
|
109
|
+
const inputLower = input.toLowerCase();
|
|
110
|
+
if (inputLower.includes(msgLower)) {
|
|
111
|
+
bestScore = Math.max(bestScore, 60);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// 3. Title keyword matching (lowest confidence)
|
|
115
|
+
const inputLower = input.toLowerCase();
|
|
116
|
+
const titleWords = entry.title.toLowerCase().split(/\s+/);
|
|
117
|
+
const matchingWords = titleWords.filter(w => w.length > 3 && inputLower.includes(w));
|
|
118
|
+
if (matchingWords.length >= 2) {
|
|
119
|
+
bestScore = Math.max(bestScore, 20 + matchingWords.length * 5);
|
|
120
|
+
}
|
|
121
|
+
return bestScore;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/db/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,yEAAyE;AACzE,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,EAAiB,EACjB,YAAoB,EACpB,aAAqB,CAAC;IAEtB,4BAA4B;IAC5B,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,OAAO,GAAmB,EAAE,CAAC;IAEnC,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACvC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACtG,CAAC;IACH,CAAC;IAED,2BAA2B;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,EAAiB,EACjB,K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;QAC9B,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript interfaces for the GitHub Actions error database.
|
|
3
|
+
*/
|
|
4
|
+
export interface ErrorPattern {
|
|
5
|
+
regex: string;
|
|
6
|
+
flags?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FixCode {
|
|
9
|
+
language: string;
|
|
10
|
+
label: string;
|
|
11
|
+
code: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DocLink {
|
|
14
|
+
url: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ErrorSource {
|
|
18
|
+
article: string;
|
|
19
|
+
section: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ErrorEntry {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
category: ErrorCategory;
|
|
25
|
+
severity: ErrorSeverity;
|
|
26
|
+
tags: string[];
|
|
27
|
+
patterns: ErrorPattern[];
|
|
28
|
+
error_messages?: string[];
|
|
29
|
+
root_cause: string;
|
|
30
|
+
fix: string;
|
|
31
|
+
fix_code?: FixCode[];
|
|
32
|
+
prevention?: string[];
|
|
33
|
+
docs?: DocLink[];
|
|
34
|
+
source?: ErrorSource;
|
|
35
|
+
}
|
|
36
|
+
export type ErrorCategory = "yaml-syntax" | "silent-failures" | "runner-environment" | "permissions-auth" | "caching-artifacts" | "triggers" | "concurrency-timing" | "known-unsolved";
|
|
37
|
+
export type ErrorSeverity = "error" | "warning" | "silent-failure" | "limitation";
|
|
38
|
+
export interface ErrorDatabase {
|
|
39
|
+
entries: ErrorEntry[];
|
|
40
|
+
categories: Map<ErrorCategory, ErrorEntry[]>;
|
|
41
|
+
byId: Map<string, ErrorEntry>;
|
|
42
|
+
}
|
|
43
|
+
export interface SearchResult {
|
|
44
|
+
entry: ErrorEntry;
|
|
45
|
+
score: number;
|
|
46
|
+
matchType: "regex" | "exact" | "fuzzy" | "keyword";
|
|
47
|
+
}
|
|
48
|
+
export interface DiagnosticFinding {
|
|
49
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
50
|
+
message: string;
|
|
51
|
+
line?: number;
|
|
52
|
+
fix: string;
|
|
53
|
+
fix_code?: string;
|
|
54
|
+
relatedError?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface CategoryInfo {
|
|
57
|
+
name: ErrorCategory;
|
|
58
|
+
count: number;
|
|
59
|
+
severities: Record<ErrorSeverity, number>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/db/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IA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js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/db/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @htekdev/actions-debugger — MCP server entry point.
|
|
4
|
+
*
|
|
5
|
+
* 65+ real GitHub Actions errors, queryable by agents.
|
|
6
|
+
* Runs as a stdio MCP server for Claude Desktop, Copilot CLI, Cursor, etc.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx @htekdev/actions-debugger
|
|
10
|
+
*
|
|
11
|
+
* Source: https://htek.dev/articles/github-actions-debugging-guide
|
|
12
|
+
*/
|
|
13
|
+
export { loadErrorDatabase } from "./db/loader.js";
|
|
14
|
+
export { lookupError } from "./tools/lookup-error.js";
|
|
15
|
+
export { diagnoseWorkflow } from "./tools/diagnose-workflow.js";
|
|
16
|
+
export { suggestFix } from "./tools/suggest-fix.js";
|
|
17
|
+
export { listCategories } from "./tools/list-categories.js";
|
|
18
|
+
export { searchErrors } from "./tools/search-errors.js";
|
|
19
|
+
export type { ErrorEntry, ErrorDatabase, ErrorCategory, ErrorSeverity, SearchResult, DiagnosticFinding, CategoryInfo, } from "./db/types.js";
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;GAUG;AAQH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,YAAY,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @htekdev/actions-debugger — MCP server entry point.
|
|
4
|
+
*
|
|
5
|
+
* 65+ real GitHub Actions errors, queryable by agents.
|
|
6
|
+
* Runs as a stdio MCP server for Claude Desktop, Copilot CLI, Cursor, etc.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx @htekdev/actions-debugger
|
|
10
|
+
*
|
|
11
|
+
* Source: https://htek.dev/articles/github-actions-debugging-guide
|
|
12
|
+
*/
|
|
13
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
14
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
|
+
import { loadErrorDatabase } from "./db/loader.js";
|
|
16
|
+
import { registerTools } from "./server.js";
|
|
17
|
+
// Re-export programmatic API
|
|
18
|
+
export { loadErrorDatabase } from "./db/loader.js";
|
|
19
|
+
export { lookupError } from "./tools/lookup-error.js";
|
|
20
|
+
export { diagnoseWorkflow } from "./tools/diagnose-workflow.js";
|
|
21
|
+
export { suggestFix } from "./tools/suggest-fix.js";
|
|
22
|
+
export { listCategories } from "./tools/list-categories.js";
|
|
23
|
+
export { searchErrors } from "./tools/search-errors.js";
|
|
24
|
+
/**
|
|
25
|
+
* Start the MCP server if running as CLI.
|
|
26
|
+
*/
|
|
27
|
+
async function main() {
|
|
28
|
+
const db = await loadErrorDatabase();
|
|
29
|
+
const server = new Server({ name: "actions-debugger", version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
30
|
+
registerTools(server, db);
|
|
31
|
+
const transport = new StdioServerTransport();
|
|
32
|
+
await server.connect(transport);
|
|
33
|
+
}
|
|
34
|
+
// Only start server when running as CLI (not when imported as library)
|
|
35
|
+
const isMainModule = process.argv[1] &&
|
|
36
|
+
(process.argv[1].endsWith("index.js") ||
|
|
37
|
+
process.argv[1].endsWith("actions-debugger"));
|
|
38
|
+
if (isMainModule) {
|
|
39
|
+
main().catch((err) => {
|
|
40
|
+
console.error("Fatal error:", err);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,6BAA6B;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAWxD;;GAEG;AACH,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,GAAG,MAAM,iBAAiB,EAAE,CAAC;IAErC,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,EAC9C,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAChC,CAAC;IAEF,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAE1B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,uEAAuE;AACvE,MAAM,YAAY,GAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACf,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAElD,IAAI,YAAY,EAAE,CAAC;IACjB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server setup — registers all tools with the MCP server.
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
|
+
import type { ErrorDatabase } from "./db/types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Register all tools with the MCP server.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerTools(server: Server, db: ErrorDatabase): void;
|
|
10
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAKnE,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,eAAe,CAAC;AAiHlE;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,GAAG,IAAI,CAqErE"}
|