@eldrforge/kodrdriv 0.0.33 → 0.0.37
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/README.md +46 -69
- package/dist/application.js +146 -0
- package/dist/application.js.map +1 -0
- package/dist/arguments.js +22 -21
- package/dist/arguments.js.map +1 -1
- package/dist/commands/audio-commit.js +43 -21
- package/dist/commands/audio-commit.js.map +1 -1
- package/dist/commands/audio-review.js +46 -38
- package/dist/commands/audio-review.js.map +1 -1
- package/dist/commands/clean.js +28 -12
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/commit.js +132 -39
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/link.js +177 -159
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/publish-tree.js +19 -6
- package/dist/commands/publish-tree.js.map +1 -1
- package/dist/commands/publish.js +152 -82
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/release.js +21 -16
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/review.js +286 -60
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/select-audio.js +25 -8
- package/dist/commands/select-audio.js.map +1 -1
- package/dist/commands/unlink.js +349 -159
- package/dist/commands/unlink.js.map +1 -1
- package/dist/constants.js +14 -5
- package/dist/constants.js.map +1 -1
- package/dist/content/diff.js +7 -5
- package/dist/content/diff.js.map +1 -1
- package/dist/content/log.js +4 -1
- package/dist/content/log.js.map +1 -1
- package/dist/error/CancellationError.js +9 -0
- package/dist/error/CancellationError.js.map +1 -0
- package/dist/error/CommandErrors.js +120 -0
- package/dist/error/CommandErrors.js.map +1 -0
- package/dist/logging.js +55 -12
- package/dist/logging.js.map +1 -1
- package/dist/main.js +6 -131
- package/dist/main.js.map +1 -1
- package/dist/prompt/commit.js +4 -0
- package/dist/prompt/commit.js.map +1 -1
- package/dist/prompt/instructions/commit.md +33 -24
- package/dist/prompt/instructions/release.md +39 -5
- package/dist/prompt/release.js +41 -1
- package/dist/prompt/release.js.map +1 -1
- package/dist/types.js +9 -2
- package/dist/types.js.map +1 -1
- package/dist/util/github.js +71 -4
- package/dist/util/github.js.map +1 -1
- package/dist/util/npmOptimizations.js +174 -0
- package/dist/util/npmOptimizations.js.map +1 -0
- package/dist/util/openai.js +4 -2
- package/dist/util/openai.js.map +1 -1
- package/dist/util/performance.js +202 -0
- package/dist/util/performance.js.map +1 -0
- package/dist/util/safety.js +166 -0
- package/dist/util/safety.js.map +1 -0
- package/dist/util/storage.js +10 -0
- package/dist/util/storage.js.map +1 -1
- package/dist/util/validation.js +81 -0
- package/dist/util/validation.js.map +1 -0
- package/package.json +19 -18
- package/packages/components/package.json +4 -0
- package/packages/tools/package.json +4 -0
- package/packages/utils/package.json +4 -0
- package/scripts/pre-commit-hook.sh +52 -0
- package/test-project/package.json +1 -0
|
@@ -17,13 +17,15 @@ You are generating a Git commit message based on the content provided below. The
|
|
|
17
17
|
* **CONSIDER User Context**: If `[User Context]` is provided, use it to inform your understanding and tailor your commit message appropriately to the user's situation.
|
|
18
18
|
* **FOCUS ON THE CURRENT CHANGE**: Your commit message should describe only what is happening in the current diff — not previous work or future plans.
|
|
19
19
|
* Start with a **clear, concise summary** of what was changed and why — grounded in the `User Direction` when present and informed by any `User Context`.
|
|
20
|
-
* **
|
|
20
|
+
* **ALWAYS GROUP CHANGES INTO SEPARATE LINES**: Break down changes into distinct logical groups, with each group on its own line. Even for simple changes, use multiple lines when there are different types of modifications.
|
|
21
|
+
* **USE BULLET POINTS BY DEFAULT**: Format most commit messages with bullet points to clearly separate different groups of changes.
|
|
21
22
|
* **Refer to specific changes** seen in the `Diff`, and explain why those changes matter when it's non-obvious.
|
|
22
|
-
* If the change is large, **add one or two paragraphs** expanding on the most important elements.
|
|
23
23
|
* Keep the tone technical and direct — written for a fellow developer who will read this in six months.
|
|
24
24
|
|
|
25
25
|
### ❌ DO NOT:
|
|
26
26
|
|
|
27
|
+
* ❌ **Don't squeeze multiple unrelated changes into a single line** — always separate different types of changes.
|
|
28
|
+
* ❌ **Don't create single-line commit messages when multiple logical groups exist** — use separate lines for each group.
|
|
27
29
|
* ❌ Don't describe the project or its general purpose.
|
|
28
30
|
* ❌ Don't begin with boilerplate like "This commit includes..." or "The following changes..."
|
|
29
31
|
* ❌ Don't use fluffy or celebratory language ("awesome update", "great enhancement").
|
|
@@ -37,51 +39,58 @@ You are generating a Git commit message based on the content provided below. The
|
|
|
37
39
|
|
|
38
40
|
## 📝 OUTPUT STRUCTURE
|
|
39
41
|
|
|
40
|
-
### ✅
|
|
42
|
+
### ✅ DEFAULT FORMAT: Multiline with Bullet Points
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
**PREFERRED FORMAT** - Use this for most changes, even relatively simple ones:
|
|
43
45
|
|
|
44
|
-
* A
|
|
45
|
-
*
|
|
46
|
-
*
|
|
46
|
+
* A **summary line** describing the overall intent
|
|
47
|
+
* **Bullet points** for each distinct group of changes
|
|
48
|
+
* Each bullet should represent a different logical area (files, functionality, configuration, tests, etc.)
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
#### Example:
|
|
51
|
+
|
|
52
|
+
> Refactor session handling to use new getUserProfile API
|
|
53
|
+
>
|
|
54
|
+
> * Switch from parseUser() to getUserProfile() in session.ts
|
|
55
|
+
> * Update session schema validation in auth.ts
|
|
56
|
+
> * Remove legacy parsing logic from user-utils.ts
|
|
57
|
+
> * Update related tests in session.test.ts
|
|
58
|
+
|
|
59
|
+
---
|
|
49
60
|
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
### ✅ For Single, Atomic Changes Only
|
|
62
|
+
|
|
63
|
+
**ONLY use a single line when the change is truly atomic** - affecting one function in one file with one clear purpose:
|
|
52
64
|
|
|
53
65
|
#### Example:
|
|
54
66
|
|
|
55
|
-
>
|
|
67
|
+
> Fix typo in error message for invalid user credentials
|
|
56
68
|
|
|
57
69
|
---
|
|
58
70
|
|
|
59
71
|
### ✅ For Complex or Multi-Part Changes
|
|
60
72
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* Multiple files or systems
|
|
64
|
-
* Multiple concerns (e.g., config + business logic)
|
|
65
|
-
* Involves a refactor or architectural update
|
|
66
|
-
|
|
67
|
-
Then output:
|
|
73
|
+
For larger changes with significant architectural implications:
|
|
68
74
|
|
|
69
75
|
* A **summary paragraph** describing the overall intent
|
|
70
76
|
* One or two **detail paragraphs** focusing on key aspects or trade-offs
|
|
71
|
-
*
|
|
77
|
+
* **Bullet points** to call out specific files, tools, or changes
|
|
72
78
|
|
|
73
79
|
#### Example:
|
|
74
80
|
|
|
75
|
-
>
|
|
81
|
+
> Reorganize pipeline logic to improve readability and make phase execution more testable. This is part of ongoing work to modularize transition handling.
|
|
76
82
|
>
|
|
77
83
|
> The main change separates phase node execution into its own module, reduces reliance on shared state, and simplifies test construction. Existing functionality remains unchanged, but internal structure is now better aligned with future transition plugin support.
|
|
78
84
|
>
|
|
79
|
-
> *
|
|
80
|
-
> *
|
|
81
|
-
> *
|
|
85
|
+
> * Extract executePhaseNode() from pipeline.ts
|
|
86
|
+
> * Add phase-runner.ts with dedicated error handling
|
|
87
|
+
> * Update tests in phase.test.ts for new isolation boundaries
|
|
88
|
+
> * Refactor shared state management in core.ts
|
|
82
89
|
|
|
83
90
|
---
|
|
84
91
|
|
|
85
92
|
## 🧾 Final Note
|
|
86
93
|
|
|
87
|
-
|
|
94
|
+
**DEFAULT TO MULTILINE**: When in doubt, use bullet points to separate different types of changes. This makes commit messages much more scannable and helps reviewers understand the scope of each change group. Only use single-line messages for truly atomic, single-purpose changes.
|
|
95
|
+
|
|
96
|
+
Match your output to the **scope and complexity** of the change, but favor clarity and separation over brevity. Your audience is technical and time-constrained — give them clear, well-organized information they can quickly scan.
|
|
@@ -4,6 +4,8 @@ Task #2: Provide a detailed list of changes involved in this release, and make s
|
|
|
4
4
|
|
|
5
5
|
Task #3: Use the content in the Release Focus section as the PRIMARY GUIDE for writing the release notes and to help make connections with people, projects, issues, features, and other information. The Release Focus should heavily influence the tone, emphasis, and structure of your release notes.
|
|
6
6
|
|
|
7
|
+
**IMPORTANT**: If you see a "Release Size Context" indicating this is a LARGE RELEASE, you should provide comprehensive, detailed release notes that thoroughly document all changes. For large releases, be extensive rather than brief - users need to understand the full scope of changes. Don't just summarize - dive deep into the details, organize changes into meaningful groups, and explain the impact of major changes.
|
|
8
|
+
|
|
7
9
|
### Output Format
|
|
8
10
|
|
|
9
11
|
Your response MUST be a valid JSON object with the following structure:
|
|
@@ -21,6 +23,7 @@ Your response MUST be a valid JSON object with the following structure:
|
|
|
21
23
|
**Instructions for the `body` field:**
|
|
22
24
|
- This should be the full release notes in Markdown format.
|
|
23
25
|
- Follow the detailed instructions below for structuring and writing the release notes.
|
|
26
|
+
- **For large releases**: Be comprehensive and detailed. Users deserve thorough documentation when there are many changes.
|
|
24
27
|
|
|
25
28
|
### Output Restrictions
|
|
26
29
|
|
|
@@ -28,7 +31,7 @@ Your response MUST be a valid JSON object with the following structure:
|
|
|
28
31
|
|
|
29
32
|
- Do not use marketing language about how "significant" a release is, or how the release is going to "streamline process" for "Improved usability." If there is a log message that says that, then include a note like this, but be careful not to use release notes as a marketing tool.
|
|
30
33
|
|
|
31
|
-
- If the release is very simple, keep the release notes short and simple.
|
|
34
|
+
- If the release is very simple, keep the release notes short and simple. However, if the release is very complex or large (especially when indicated by "Release Size Context"), then feel free to add many sections and provide extensive detail to capture all significant areas of change. Large releases deserve comprehensive documentation.
|
|
32
35
|
|
|
33
36
|
## 🎯 Purpose
|
|
34
37
|
|
|
@@ -37,6 +40,7 @@ Create release notes that:
|
|
|
37
40
|
* Help developers, contributors, or users **understand what changed**
|
|
38
41
|
* Reflect the **actual purpose** and **impact** of the release
|
|
39
42
|
* Are **not promotional**, **not exaggerated**, and **not overly positive**
|
|
43
|
+
* **For large releases**: Provide comprehensive coverage of all significant changes rather than brief summaries
|
|
40
44
|
|
|
41
45
|
|
|
42
46
|
## 🧭 Instructions
|
|
@@ -62,11 +66,23 @@ Create release notes that:
|
|
|
62
66
|
* `Documentation Updates`
|
|
63
67
|
* `Breaking Changes`
|
|
64
68
|
* `Deprecations`
|
|
69
|
+
* `Performance Enhancements`
|
|
70
|
+
* `Security Updates`
|
|
71
|
+
* `Developer Experience`
|
|
72
|
+
* `Testing Improvements`
|
|
73
|
+
* `Configuration Changes`
|
|
74
|
+
|
|
75
|
+
Include only the sections that are relevant. **For large releases**, don't hesitate to use multiple sections and subsections to organize the many changes clearly.
|
|
65
76
|
|
|
66
|
-
|
|
77
|
+
3. **Use clear, factual bullet points** under each section. Briefly describe what changed and why it's relevant — **but do not use marketing language**.
|
|
67
78
|
|
|
68
|
-
|
|
79
|
+
**For large releases**: Provide detailed bullet points that explain:
|
|
80
|
+
- What specifically changed
|
|
81
|
+
- Why the change was made (if evident from commit messages)
|
|
82
|
+
- Impact on users or developers
|
|
83
|
+
- Related files or components affected (when relevant)
|
|
69
84
|
|
|
85
|
+
Avoid vague or exaggerated terms like:
|
|
70
86
|
* "awesome new feature"
|
|
71
87
|
* "significant boost"
|
|
72
88
|
* "exciting changes"
|
|
@@ -79,13 +95,31 @@ Create release notes that:
|
|
|
79
95
|
* Specific pull requests or issues (if helpful)
|
|
80
96
|
* Contributors (optionally, in parentheses or footnotes)
|
|
81
97
|
|
|
98
|
+
5. **For large releases specifically**:
|
|
99
|
+
- Create more detailed subsections when there are many related changes
|
|
100
|
+
- Group related changes together logically
|
|
101
|
+
- Explain the broader context or theme when multiple commits work toward the same goal
|
|
102
|
+
- Don't be afraid to write longer, more comprehensive release notes
|
|
103
|
+
- Include technical details that help users understand the scope of changes
|
|
104
|
+
|
|
82
105
|
---
|
|
83
106
|
|
|
84
|
-
## 📝 Output Format
|
|
107
|
+
## 📝 Output Format Examples
|
|
108
|
+
|
|
109
|
+
### Example for a Large Release:
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"title": "Major Configuration System Overhaul and Enhanced Developer Experience",
|
|
114
|
+
"body": "This release represents a comprehensive overhaul of the configuration system, developer tooling, and testing infrastructure. Based on the Release Focus of modernizing the development workflow and addressing long-standing technical debt, this release includes significant architectural changes, new developer features, and extensive improvements to code quality and maintainability.\\n\\n**Configuration System Overhaul**\\n\\n* Completely redesigned configuration loading system with support for environment-specific overrides\\n* Unified `vite.config.ts`, `webpack.config.js`, and `rollup.config.js` into a single environment-aware configuration module\\n* Added support for `.env.defaults`, `.env.local`, and `.env.production` files with proper precedence handling\\n* Implemented configuration validation with detailed error messages for missing or invalid settings\\n* Migrated from legacy JSON-based config to TypeScript-based configuration with full type safety\\n\\n**New Features**\\n\\n* Added comprehensive CLI argument parsing with support for nested configuration options\\n* Implemented hot-reloading development server with automatic dependency injection\\n* Added support for custom build plugins with a new plugin API\\n* Created new debugging tools including request/response logging and performance profiling\\n* Added automated code formatting and linting with pre-commit hooks\\n\\n**Developer Experience Improvements**\\n\\n* Reduced config nesting depth in `tsconfig.json` to improve readability and maintainability\\n* Updated all development scripts to use the new unified configuration system\\n* Added comprehensive error handling with stack traces and helpful troubleshooting suggestions\\n* Implemented automatic workspace package linking and unlinking for monorepo development\\n* Created new developer documentation with step-by-step setup instructions\\n\\n**Testing Infrastructure**\\n\\n* Migrated entire test suite from Jest to Vitest for better ES module support\\n* Added comprehensive integration tests for the new configuration system\\n* Implemented end-to-end testing with Playwright for critical user workflows\\n* Added test coverage reporting with detailed branch and function coverage metrics\\n* Created performance benchmarks for build times and memory usage\\n\\n**Bug Fixes**\\n\\n* Fixed critical crash in config loader when optional fields were undefined or null\\n* Resolved issue with `yarn build` failing on Windows due to missing path escaping\\n* Fixed memory leak in development server during file watching operations\\n* Corrected TypeScript compilation errors in strict mode for legacy code\\n* Fixed race condition in parallel test execution causing intermittent failures\\n\\n**Breaking Changes**\\n\\n* Removed support for legacy `.env.local.js` files - migrate to `.env.local`\\n* Changed default output directory from `dist/` to `build/` for consistency\\n* Updated minimum Node.js version requirement to 18.0.0\\n* Deprecated `--legacy-config` flag - will be removed in next major version\\n\\n**Documentation Updates**\\n\\n* Completely rewrote setup instructions in `README.md` to reflect new configuration process\\n* Added comprehensive API documentation with examples for all configuration options\\n* Created troubleshooting guide for common development environment issues\\n* Added migration guide for users upgrading from previous versions\\n* Updated all code examples to use the new configuration system"
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Example for a Simple Release:
|
|
85
119
|
|
|
86
120
|
```json
|
|
87
121
|
{
|
|
88
122
|
"title": "Configuration System Simplification and Developer Experience Improvements",
|
|
89
123
|
"body": "This release focuses on simplifying the configuration system and removing deprecated environment-specific files. Based on the Release Focus of improving developer onboarding and standardizing build behavior, the team prioritized changes that reduce friction for new developers and standardize build behavior across local and CI environments.\\n\\n**Improvements**\\n\\n* Unified `vite.config.ts` and `webpack.config.js` into a single environment-aware module\\n* Reduced config nesting depth in `tsconfig.json` to improve readability\\n* Updated CI scripts to use `.env.defaults` instead of `.env.local`\\n\\n**Bug Fixes**\\n\\n* Fixed crash in config loader when optional fields were undefined\\n* Resolved issue with `yarn build` failing on Windows due to missing path escape\\n\\n**Documentation Updates**\\n\\n* Rewrote setup instructions in `README.md` to reflect unified config process\\n* Removed legacy instructions for `env.local.js`"
|
|
90
124
|
}
|
|
91
|
-
```
|
|
125
|
+
```
|
package/dist/prompt/release.js
CHANGED
|
@@ -4,10 +4,38 @@ import { fileURLToPath } from 'url';
|
|
|
4
4
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = path.dirname(__filename);
|
|
7
|
+
/**
|
|
8
|
+
* Analyzes release content to determine if it's a large release
|
|
9
|
+
* and calculates appropriate token limits
|
|
10
|
+
*/ const analyzeReleaseSize = (logContent, diffContent)=>{
|
|
11
|
+
const logLines = logContent.split('\n').length;
|
|
12
|
+
const diffLines = diffContent.split('\n').length;
|
|
13
|
+
const totalContentLength = logContent.length + diffContent.length;
|
|
14
|
+
// Consider it a large release if:
|
|
15
|
+
// - More than 20 commits (log lines typically ~3-5 per commit)
|
|
16
|
+
// - More than 500 diff lines
|
|
17
|
+
// - Total content length > 50KB
|
|
18
|
+
const isLarge = logLines > 60 || diffLines > 500 || totalContentLength > 50000;
|
|
19
|
+
if (isLarge) {
|
|
20
|
+
// For large releases, significantly increase token limit
|
|
21
|
+
return {
|
|
22
|
+
isLarge: true,
|
|
23
|
+
maxTokens: 25000
|
|
24
|
+
};
|
|
25
|
+
} else {
|
|
26
|
+
// Standard token limit for normal releases
|
|
27
|
+
return {
|
|
28
|
+
isLarge: false,
|
|
29
|
+
maxTokens: 10000
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
7
33
|
/**
|
|
8
34
|
* Build a release prompt using RiotPrompt Recipes.
|
|
9
35
|
*/ const createPrompt = async ({ overrides: _overrides, overridePaths: _overridePaths }, { releaseFocus, logContent, diffContent }, { context, directories } = {})=>{
|
|
10
36
|
const basePath = __dirname;
|
|
37
|
+
// Analyze release size to determine token requirements
|
|
38
|
+
const { isLarge: isLargeRelease, maxTokens } = analyzeReleaseSize(logContent, diffContent);
|
|
11
39
|
// Build content items for the prompt
|
|
12
40
|
const contentItems = [];
|
|
13
41
|
const contextItems = [];
|
|
@@ -29,6 +57,13 @@ const __dirname = path.dirname(__filename);
|
|
|
29
57
|
title: 'Release Focus'
|
|
30
58
|
});
|
|
31
59
|
}
|
|
60
|
+
// Add release size context to help guide the AI
|
|
61
|
+
if (isLargeRelease) {
|
|
62
|
+
contextItems.push({
|
|
63
|
+
content: `This appears to be a LARGE RELEASE with significant changes. Please provide comprehensive, detailed release notes that thoroughly document all major changes, improvements, and fixes. Don't summarize - dive deep into the details.`,
|
|
64
|
+
title: 'Release Size Context'
|
|
65
|
+
});
|
|
66
|
+
}
|
|
32
67
|
if (context) {
|
|
33
68
|
contextItems.push({
|
|
34
69
|
content: context,
|
|
@@ -41,11 +76,16 @@ const __dirname = path.dirname(__filename);
|
|
|
41
76
|
title: 'Directories'
|
|
42
77
|
});
|
|
43
78
|
}
|
|
44
|
-
|
|
79
|
+
const prompt = await recipe(basePath).persona({
|
|
45
80
|
path: 'personas/releaser.md'
|
|
46
81
|
}).instructions({
|
|
47
82
|
path: 'instructions/release.md'
|
|
48
83
|
}).overridePaths(_overridePaths !== null && _overridePaths !== void 0 ? _overridePaths : []).overrides(_overrides !== null && _overrides !== void 0 ? _overrides : true).content(...contentItems).context(...contextItems).cook();
|
|
84
|
+
return {
|
|
85
|
+
prompt,
|
|
86
|
+
maxTokens,
|
|
87
|
+
isLargeRelease
|
|
88
|
+
};
|
|
49
89
|
};
|
|
50
90
|
|
|
51
91
|
export { createPrompt };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.js","sources":["../../src/prompt/release.ts"],"sourcesContent":["import { ContentItem, Prompt, recipe } from '@riotprompt/riotprompt';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n// Types for the release prompt\nexport type Config = {\n overridePaths?: string[];\n overrides?: boolean;\n}\n\nexport type Content = {\n releaseFocus?: string;\n logContent: string;\n diffContent: string;\n};\n\nexport type Context = {\n context?: string;\n directories?: string[];\n};\n\n/**\n * Build a release prompt using RiotPrompt Recipes.\n */\nexport const createPrompt = async (\n { overrides: _overrides, overridePaths: _overridePaths }: Config,\n { releaseFocus, logContent, diffContent }: Content,\n { context, directories }: Context = {}\n): Promise<
|
|
1
|
+
{"version":3,"file":"release.js","sources":["../../src/prompt/release.ts"],"sourcesContent":["import { ContentItem, Prompt, recipe } from '@riotprompt/riotprompt';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n// Types for the release prompt\nexport type Config = {\n overridePaths?: string[];\n overrides?: boolean;\n}\n\nexport type Content = {\n releaseFocus?: string;\n logContent: string;\n diffContent: string;\n};\n\nexport type Context = {\n context?: string;\n directories?: string[];\n};\n\nexport type ReleasePromptResult = {\n prompt: Prompt;\n maxTokens: number;\n isLargeRelease: boolean;\n};\n\n/**\n * Analyzes release content to determine if it's a large release\n * and calculates appropriate token limits\n */\nconst analyzeReleaseSize = (logContent: string, diffContent: string): { isLarge: boolean; maxTokens: number } => {\n const logLines = logContent.split('\\n').length;\n const diffLines = diffContent.split('\\n').length;\n const totalContentLength = logContent.length + diffContent.length;\n\n // Consider it a large release if:\n // - More than 20 commits (log lines typically ~3-5 per commit)\n // - More than 500 diff lines\n // - Total content length > 50KB\n const isLarge = logLines > 60 || diffLines > 500 || totalContentLength > 50000;\n\n if (isLarge) {\n // For large releases, significantly increase token limit\n return { isLarge: true, maxTokens: 25000 };\n } else {\n // Standard token limit for normal releases\n return { isLarge: false, maxTokens: 10000 };\n }\n};\n\n/**\n * Build a release prompt using RiotPrompt Recipes.\n */\nexport const createPrompt = async (\n { overrides: _overrides, overridePaths: _overridePaths }: Config,\n { releaseFocus, logContent, diffContent }: Content,\n { context, directories }: Context = {}\n): Promise<ReleasePromptResult> => {\n const basePath = __dirname;\n\n // Analyze release size to determine token requirements\n const { isLarge: isLargeRelease, maxTokens } = analyzeReleaseSize(logContent, diffContent);\n\n // Build content items for the prompt\n const contentItems: ContentItem[] = [];\n const contextItems: ContentItem[] = [];\n\n if (diffContent) {\n contentItems.push({ content: diffContent, title: 'Diff' });\n }\n if (logContent) {\n contentItems.push({ content: logContent, title: 'Log Context' });\n }\n if (releaseFocus) {\n contentItems.push({ content: releaseFocus, title: 'Release Focus' });\n }\n\n // Add release size context to help guide the AI\n if (isLargeRelease) {\n contextItems.push({\n content: `This appears to be a LARGE RELEASE with significant changes. Please provide comprehensive, detailed release notes that thoroughly document all major changes, improvements, and fixes. Don't summarize - dive deep into the details.`,\n title: 'Release Size Context'\n });\n }\n\n if (context) {\n contextItems.push({ content: context, title: 'User Context' });\n }\n if (directories && directories.length > 0) {\n contextItems.push({ directories, title: 'Directories' });\n }\n\n const prompt = await recipe(basePath)\n .persona({ path: 'personas/releaser.md' })\n .instructions({ path: 'instructions/release.md' })\n .overridePaths(_overridePaths ?? [])\n .overrides(_overrides ?? true)\n .content(...contentItems)\n .context(...contextItems)\n .cook();\n\n return {\n prompt,\n maxTokens,\n isLargeRelease\n };\n};\n"],"names":["__filename","fileURLToPath","url","__dirname","path","dirname","analyzeReleaseSize","logContent","diffContent","logLines","split","length","diffLines","totalContentLength","isLarge","maxTokens","createPrompt","overrides","_overrides","overridePaths","_overridePaths","releaseFocus","context","directories","basePath","isLargeRelease","contentItems","contextItems","push","content","title","prompt","recipe","persona","instructions","cook"],"mappings":";;;;AAIA,MAAMA,UAAAA,GAAaC,aAAAA,CAAc,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAChD,MAAMC,SAAAA,GAAYC,IAAAA,CAAKC,OAAO,CAACL,UAAAA,CAAAA;AAyB/B;;;IAIA,MAAMM,kBAAAA,GAAqB,CAACC,UAAAA,EAAoBC,WAAAA,GAAAA;AAC5C,IAAA,MAAMC,QAAAA,GAAWF,UAAAA,CAAWG,KAAK,CAAC,MAAMC,MAAM;AAC9C,IAAA,MAAMC,SAAAA,GAAYJ,WAAAA,CAAYE,KAAK,CAAC,MAAMC,MAAM;AAChD,IAAA,MAAME,kBAAAA,GAAqBN,UAAAA,CAAWI,MAAM,GAAGH,YAAYG,MAAM;;;;;AAMjE,IAAA,MAAMG,OAAAA,GAAUL,QAAAA,GAAW,EAAA,IAAMG,SAAAA,GAAY,OAAOC,kBAAAA,GAAqB,KAAA;AAEzE,IAAA,IAAIC,OAAAA,EAAS;;QAET,OAAO;YAAEA,OAAAA,EAAS,IAAA;YAAMC,SAAAA,EAAW;AAAM,SAAA;IAC7C,CAAA,MAAO;;QAEH,OAAO;YAAED,OAAAA,EAAS,KAAA;YAAOC,SAAAA,EAAW;AAAM,SAAA;AAC9C,IAAA;AACJ,CAAA;AAEA;;IAGO,MAAMC,YAAAA,GAAe,OACxB,EAAEC,SAAAA,EAAWC,UAAU,EAAEC,aAAAA,EAAeC,cAAc,EAAU,EAChE,EAAEC,YAAY,EAAEd,UAAU,EAAE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AAC1D,IAAA;AAEA,IAAA,MAAMC,MAAAA,GAAS,MAAMC,MAAAA,CAAOR,QAAAA,CAAAA,CACvBS,OAAO,CAAC;QAAE7B,IAAAA,EAAM;AAAuB,KAAA,CAAA,CACvC8B,YAAY,CAAC;QAAE9B,IAAAA,EAAM;AAA0B,KAAA,CAAA,CAC/Ce,aAAa,CAACC,cAAAA,KAAAA,IAAAA,IAAAA,4BAAAA,cAAAA,GAAkB,EAAE,EAClCH,SAAS,CAACC,uBAAAA,UAAAA,KAAAA,MAAAA,GAAAA,UAAAA,GAAc,MACxBW,OAAO,CAAA,GAAIH,cACXJ,OAAO,CAAA,GAAIK,cACXQ,IAAI,EAAA;IAET,OAAO;AACHJ,QAAAA,MAAAA;AACAhB,QAAAA,SAAAA;AACAU,QAAAA;AACJ,KAAA;AACJ;;;;"}
|
package/dist/types.js
CHANGED
|
@@ -15,7 +15,8 @@ const ConfigSchema = z.object({
|
|
|
15
15
|
sendit: z.boolean().optional(),
|
|
16
16
|
messageLimit: z.number().optional(),
|
|
17
17
|
context: z.string().optional(),
|
|
18
|
-
direction: z.string().optional()
|
|
18
|
+
direction: z.string().optional(),
|
|
19
|
+
skipFileCheck: z.boolean().optional()
|
|
19
20
|
}).optional(),
|
|
20
21
|
audioCommit: z.object({
|
|
21
22
|
maxRecordingTime: z.number().optional(),
|
|
@@ -41,7 +42,9 @@ const ConfigSchema = z.object({
|
|
|
41
42
|
githubIssuesLimit: z.number().optional(),
|
|
42
43
|
context: z.string().optional(),
|
|
43
44
|
sendit: z.boolean().optional(),
|
|
44
|
-
note: z.string().optional()
|
|
45
|
+
note: z.string().optional(),
|
|
46
|
+
editorTimeout: z.number().optional(),
|
|
47
|
+
maxContextErrors: z.number().optional()
|
|
45
48
|
}).optional(),
|
|
46
49
|
audioReview: z.object({
|
|
47
50
|
includeCommitHistory: z.boolean().optional(),
|
|
@@ -78,6 +81,10 @@ const ConfigSchema = z.object({
|
|
|
78
81
|
releaseWorkflowNames: z.array(z.string()).optional()
|
|
79
82
|
}).optional(),
|
|
80
83
|
link: z.object({
|
|
84
|
+
scopeRoots: z.record(z.string(), z.string()).optional(),
|
|
85
|
+
dryRun: z.boolean().optional()
|
|
86
|
+
}).optional(),
|
|
87
|
+
unlink: z.object({
|
|
81
88
|
scopeRoots: z.record(z.string(), z.string()).optional(),
|
|
82
89
|
workspaceFile: z.string().optional(),
|
|
83
90
|
dryRun: z.boolean().optional()
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport { z } from \"zod\";\n\nexport const ConfigSchema = z.object({\n dryRun: z.boolean().optional(),\n verbose: z.boolean().optional(),\n debug: z.boolean().optional(),\n overrides: z.boolean().optional(),\n model: z.string().optional(),\n contextDirectories: z.array(z.string()).optional(),\n outputDirectory: z.string().optional(),\n preferencesDirectory: z.string().optional(),\n commit: z.object({\n add: z.boolean().optional(),\n cached: z.boolean().optional(),\n sendit: z.boolean().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n direction: z.string().optional(),\n }).optional(),\n audioCommit: z.object({\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n release: z.object({\n from: z.string().optional(),\n to: z.string().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n focus: z.string().optional(),\n }).optional(),\n review: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n note: z.string().optional(),\n }).optional(),\n audioReview: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n directory: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n publish: z.object({\n mergeMethod: z.enum(['merge', 'squash', 'rebase']).optional(),\n dependencyUpdatePatterns: z.array(z.string()).optional(),\n requiredEnvVars: z.array(z.string()).optional(),\n linkWorkspacePackages: z.boolean().optional(),\n unlinkWorkspacePackages: z.boolean().optional(),\n checksTimeout: z.number().optional(),\n skipUserConfirmation: z.boolean().optional(),\n sendit: z.boolean().optional(),\n waitForReleaseWorkflows: z.boolean().optional(),\n releaseWorkflowsTimeout: z.number().optional(),\n releaseWorkflowNames: z.array(z.string()).optional(),\n }).optional(),\n link: z.object({\n scopeRoots: z.record(z.string(), z.string()).optional(),\n workspaceFile: z.string().optional(),\n dryRun: z.boolean().optional(),\n }).optional(),\n publishTree: z.object({\n directory: z.string().optional(),\n excludedPatterns: z.array(z.string()).optional(),\n startFrom: z.string().optional(),\n script: z.string().optional(),\n cmd: z.string().optional(),\n publish: z.boolean().optional(),\n }).optional(),\n excludedPatterns: z.array(z.string()).optional(),\n});\n\nexport const SecureConfigSchema = z.object({\n openaiApiKey: z.string().optional(),\n});\n\nexport const CommandConfigSchema = z.object({\n commandName: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof ConfigSchema> & Cardigantime.Config;\nexport type SecureConfig = z.infer<typeof SecureConfigSchema>;\nexport type CommandConfig = z.infer<typeof CommandConfigSchema>;\n\nexport type MergeMethod = 'merge' | 'squash' | 'rebase';\n\nexport interface PullRequest {\n html_url: string;\n number: number;\n labels: {\n name: string;\n }[];\n}\n\nexport type ReleaseSummary = {\n title: string;\n body: string;\n}\n\nexport type ReleaseConfig = {\n from?: string;\n to?: string;\n context?: string;\n focus?: string;\n}\n\nexport type ReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n note?: string;\n}\n\nexport type AudioReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n directory?: string;\n keepTemp?: boolean;\n}\n\nexport type AudioCommitConfig = {\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n keepTemp?: boolean;\n}\n\nexport type PublishConfig = {\n from?: string;\n to?: string;\n}\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","model","string","contextDirectories","array","outputDirectory","preferencesDirectory","commit","add","cached","sendit","messageLimit","number","context","direction","audioCommit","maxRecordingTime","audioDevice","file","keepTemp","release","from","to","focus","review","includeCommitHistory","includeRecentDiffs","includeReleaseNotes","includeGithubIssues","commitHistoryLimit","diffHistoryLimit","releaseNotesLimit","githubIssuesLimit","note","audioReview","directory","publish","mergeMethod","enum","dependencyUpdatePatterns","requiredEnvVars","linkWorkspacePackages","unlinkWorkspacePackages","checksTimeout","skipUserConfirmation","waitForReleaseWorkflows","releaseWorkflowsTimeout","releaseWorkflowNames","link","scopeRoots","record","workspaceFile","publishTree","excludedPatterns","startFrom","script","cmd","openaiApiKey","commandName"],"mappings":";;AAGO,MAAMA,YAAAA,GAAeC,CAAAA,CAAEC,MAAM,CAAC;IACjCC,MAAAA,EAAQF,CAAAA,CAA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":["../src/types.ts"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport { z } from \"zod\";\n\nexport const ConfigSchema = z.object({\n dryRun: z.boolean().optional(),\n verbose: z.boolean().optional(),\n debug: z.boolean().optional(),\n overrides: z.boolean().optional(),\n model: z.string().optional(),\n contextDirectories: z.array(z.string()).optional(),\n outputDirectory: z.string().optional(),\n preferencesDirectory: z.string().optional(),\n commit: z.object({\n add: z.boolean().optional(),\n cached: z.boolean().optional(),\n sendit: z.boolean().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n direction: z.string().optional(),\n skipFileCheck: z.boolean().optional(),\n }).optional(),\n audioCommit: z.object({\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n release: z.object({\n from: z.string().optional(),\n to: z.string().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n focus: z.string().optional(),\n }).optional(),\n review: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n note: z.string().optional(),\n editorTimeout: z.number().optional(),\n maxContextErrors: z.number().optional(),\n }).optional(),\n audioReview: z.object({\n includeCommitHistory: z.boolean().optional(),\n includeRecentDiffs: z.boolean().optional(),\n includeReleaseNotes: z.boolean().optional(),\n includeGithubIssues: z.boolean().optional(),\n commitHistoryLimit: z.number().optional(),\n diffHistoryLimit: z.number().optional(),\n releaseNotesLimit: z.number().optional(),\n githubIssuesLimit: z.number().optional(),\n context: z.string().optional(),\n sendit: z.boolean().optional(),\n maxRecordingTime: z.number().optional(),\n audioDevice: z.string().optional(),\n file: z.string().optional(),\n directory: z.string().optional(),\n keepTemp: z.boolean().optional(),\n }).optional(),\n publish: z.object({\n mergeMethod: z.enum(['merge', 'squash', 'rebase']).optional(),\n dependencyUpdatePatterns: z.array(z.string()).optional(),\n requiredEnvVars: z.array(z.string()).optional(),\n linkWorkspacePackages: z.boolean().optional(),\n unlinkWorkspacePackages: z.boolean().optional(),\n checksTimeout: z.number().optional(),\n skipUserConfirmation: z.boolean().optional(),\n sendit: z.boolean().optional(),\n waitForReleaseWorkflows: z.boolean().optional(),\n releaseWorkflowsTimeout: z.number().optional(),\n releaseWorkflowNames: z.array(z.string()).optional(),\n }).optional(),\n link: z.object({\n scopeRoots: z.record(z.string(), z.string()).optional(),\n dryRun: z.boolean().optional(),\n }).optional(),\n unlink: z.object({\n scopeRoots: z.record(z.string(), z.string()).optional(),\n workspaceFile: z.string().optional(),\n dryRun: z.boolean().optional(),\n }).optional(),\n publishTree: z.object({\n directory: z.string().optional(),\n excludedPatterns: z.array(z.string()).optional(),\n startFrom: z.string().optional(),\n script: z.string().optional(),\n cmd: z.string().optional(),\n publish: z.boolean().optional(),\n }).optional(),\n excludedPatterns: z.array(z.string()).optional(),\n});\n\nexport const SecureConfigSchema = z.object({\n openaiApiKey: z.string().optional(),\n});\n\nexport const CommandConfigSchema = z.object({\n commandName: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof ConfigSchema> & Cardigantime.Config;\nexport type SecureConfig = z.infer<typeof SecureConfigSchema>;\nexport type CommandConfig = z.infer<typeof CommandConfigSchema>;\n\nexport type MergeMethod = 'merge' | 'squash' | 'rebase';\n\nexport interface PullRequest {\n html_url: string;\n number: number;\n labels: {\n name: string;\n }[];\n}\n\nexport type ReleaseSummary = {\n title: string;\n body: string;\n}\n\nexport type ReleaseConfig = {\n from?: string;\n to?: string;\n context?: string;\n focus?: string;\n messageLimit?: number;\n}\n\nexport type ReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n note?: string;\n editorTimeout?: number;\n maxContextErrors?: number;\n}\n\nexport type AudioReviewConfig = {\n includeCommitHistory?: boolean;\n includeRecentDiffs?: boolean;\n includeReleaseNotes?: boolean;\n includeGithubIssues?: boolean;\n commitHistoryLimit?: number;\n diffHistoryLimit?: number;\n releaseNotesLimit?: number;\n githubIssuesLimit?: number;\n context?: string;\n sendit?: boolean;\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n directory?: string;\n keepTemp?: boolean;\n}\n\nexport type AudioCommitConfig = {\n maxRecordingTime?: number;\n audioDevice?: string;\n file?: string;\n keepTemp?: boolean;\n}\n\nexport type UnlinkConfig = {\n scopeRoots?: Record<string, string>;\n workspaceFile?: string;\n dryRun?: boolean;\n}\n\nexport type PublishConfig = {\n from?: string;\n to?: string;\n}\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","model","string","contextDirectories","array","outputDirectory","preferencesDirectory","commit","add","cached","sendit","messageLimit","number","context","direction","skipFileCheck","audioCommit","maxRecordingTime","audioDevice","file","keepTemp","release","from","to","focus","review","includeCommitHistory","includeRecentDiffs","includeReleaseNotes","includeGithubIssues","commitHistoryLimit","diffHistoryLimit","releaseNotesLimit","githubIssuesLimit","note","editorTimeout","maxContextErrors","audioReview","directory","publish","mergeMethod","enum","dependencyUpdatePatterns","requiredEnvVars","linkWorkspacePackages","unlinkWorkspacePackages","checksTimeout","skipUserConfirmation","waitForReleaseWorkflows","releaseWorkflowsTimeout","releaseWorkflowNames","link","scopeRoots","record","unlink","workspaceFile","publishTree","excludedPatterns","startFrom","script","cmd","openaiApiKey","commandName"],"mappings":";;AAGO,MAAMA,YAAAA,GAAeC,CAAAA,CAAEC,MAAM,CAAC;IACjCC,MAAAA,EAAQF,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC5BC,OAAAA,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OAAAA,EAAS9C,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ;AACjC,KAAA,CAAA,CAAGA,QAAQ,EAAA;AACX4D,IAAAA,gBAAAA,EAAkBhE,EAAEW,KAAK,CAACX,CAAAA,CAAES,MAAM,IAAIL,QAAQ;AAClD,CAAA;AAEkCJ,CAAAA,CAAEC,MAAM,CAAC;IACvCmE,YAAAA,EAAcpE,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACrC,CAAA;AAEmCJ,CAAAA,CAAEC,MAAM,CAAC;IACxCoE,WAAAA,EAAarE,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ;AACpC,CAAA;;;;"}
|
package/dist/util/github.js
CHANGED
|
@@ -159,11 +159,78 @@ const waitForPullRequestChecks = async (prNumber, options = {})=>{
|
|
|
159
159
|
'cancelled'
|
|
160
160
|
].includes(cr.conclusion));
|
|
161
161
|
if (failingChecks.length > 0) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
const { owner, repo } = await getRepoDetails();
|
|
163
|
+
const prUrl = `https://github.com/${owner}/${repo}/pull/${prNumber}`;
|
|
164
|
+
// Get current branch name for better guidance
|
|
165
|
+
let currentBranch;
|
|
166
|
+
try {
|
|
167
|
+
currentBranch = await getCurrentBranchName();
|
|
168
|
+
} catch {
|
|
169
|
+
// Fallback to generic branch reference if we can't get the current branch
|
|
170
|
+
currentBranch = undefined;
|
|
171
|
+
}
|
|
172
|
+
// Collect detailed information about each failed check
|
|
173
|
+
const detailedFailedChecks = await Promise.all(failingChecks.map(async (check)=>{
|
|
174
|
+
try {
|
|
175
|
+
var _checkDetails_data_output, _checkDetails_data_output1, _checkDetails_data_output2, _checkDetails_data_output3;
|
|
176
|
+
// Get additional details from the check run
|
|
177
|
+
const checkDetails = await octokit.checks.get({
|
|
178
|
+
owner,
|
|
179
|
+
repo,
|
|
180
|
+
check_run_id: check.id
|
|
181
|
+
});
|
|
182
|
+
return {
|
|
183
|
+
name: check.name,
|
|
184
|
+
conclusion: check.conclusion || 'unknown',
|
|
185
|
+
detailsUrl: check.details_url || undefined,
|
|
186
|
+
summary: ((_checkDetails_data_output = checkDetails.data.output) === null || _checkDetails_data_output === void 0 ? void 0 : _checkDetails_data_output.summary) || undefined,
|
|
187
|
+
output: {
|
|
188
|
+
title: ((_checkDetails_data_output1 = checkDetails.data.output) === null || _checkDetails_data_output1 === void 0 ? void 0 : _checkDetails_data_output1.title) || undefined,
|
|
189
|
+
summary: ((_checkDetails_data_output2 = checkDetails.data.output) === null || _checkDetails_data_output2 === void 0 ? void 0 : _checkDetails_data_output2.summary) || undefined,
|
|
190
|
+
text: ((_checkDetails_data_output3 = checkDetails.data.output) === null || _checkDetails_data_output3 === void 0 ? void 0 : _checkDetails_data_output3.text) || undefined
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
} catch {
|
|
194
|
+
// Fallback to basic information if we can't get details
|
|
195
|
+
return {
|
|
196
|
+
name: check.name,
|
|
197
|
+
conclusion: check.conclusion || 'unknown',
|
|
198
|
+
detailsUrl: check.details_url || undefined
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}));
|
|
202
|
+
logger.error(`❌ PR #${prNumber} has ${failingChecks.length} failing check${failingChecks.length > 1 ? 's' : ''}:`);
|
|
203
|
+
logger.error('');
|
|
204
|
+
for (const check of detailedFailedChecks){
|
|
205
|
+
var _check_output, _check_output1;
|
|
206
|
+
const statusIcon = check.conclusion === 'failure' ? '❌' : check.conclusion === 'timed_out' ? '⏰' : '🚫';
|
|
207
|
+
logger.error(`${statusIcon} ${check.name}: ${check.conclusion}`);
|
|
208
|
+
// Show more detailed error information if available
|
|
209
|
+
if (((_check_output = check.output) === null || _check_output === void 0 ? void 0 : _check_output.title) && check.output.title !== check.name) {
|
|
210
|
+
logger.error(` Issue: ${check.output.title}`);
|
|
211
|
+
}
|
|
212
|
+
if ((_check_output1 = check.output) === null || _check_output1 === void 0 ? void 0 : _check_output1.summary) {
|
|
213
|
+
// Truncate very long summaries
|
|
214
|
+
const summary = check.output.summary.length > 200 ? check.output.summary.substring(0, 200) + '...' : check.output.summary;
|
|
215
|
+
logger.error(` Summary: ${summary}`);
|
|
216
|
+
}
|
|
217
|
+
// Include direct link to check details
|
|
218
|
+
if (check.detailsUrl) {
|
|
219
|
+
logger.error(` Details: ${check.detailsUrl}`);
|
|
220
|
+
}
|
|
221
|
+
logger.error('');
|
|
222
|
+
}
|
|
223
|
+
// Import the new error class
|
|
224
|
+
const { PullRequestCheckError } = await import('../error/CommandErrors.js');
|
|
225
|
+
// Create and throw the enhanced error with detailed recovery instructions
|
|
226
|
+
const prError = new PullRequestCheckError(`PR #${prNumber} checks failed. ${failingChecks.length} check${failingChecks.length > 1 ? 's' : ''} failed.`, prNumber, detailedFailedChecks, prUrl, currentBranch);
|
|
227
|
+
// Display recovery instructions
|
|
228
|
+
const instructions = prError.getRecoveryInstructions();
|
|
229
|
+
for (const instruction of instructions){
|
|
230
|
+
logger.error(instruction);
|
|
165
231
|
}
|
|
166
|
-
|
|
232
|
+
logger.error('');
|
|
233
|
+
throw prError;
|
|
167
234
|
}
|
|
168
235
|
const allChecksCompleted = checkRuns.every((cr)=>cr.status === 'completed');
|
|
169
236
|
if (allChecksCompleted) {
|