@eldrforge/kodrdriv 1.2.21 → 1.2.23
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/WORKFLOW-PRECHECK-IMPLEMENTATION.md +239 -0
- package/WORKFLOW-SKIP-SUMMARY.md +121 -0
- package/dist/arguments.js +2 -2
- package/dist/arguments.js.map +1 -1
- package/dist/commands/audio-commit.js +15 -6
- package/dist/commands/audio-commit.js.map +1 -1
- package/dist/commands/audio-review.js +31 -15
- package/dist/commands/audio-review.js.map +1 -1
- package/dist/commands/commit.js +30 -19
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/link.js +27 -27
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/publish.js +74 -21
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/release.js +30 -17
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/review.js +33 -26
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/select-audio.js +4 -4
- package/dist/commands/select-audio.js.map +1 -1
- package/dist/commands/tree.js +122 -35
- package/dist/commands/tree.js.map +1 -1
- package/dist/commands/unlink.js +13 -13
- package/dist/commands/unlink.js.map +1 -1
- package/dist/commands/updates.js +21 -0
- package/dist/commands/updates.js.map +1 -1
- package/dist/commands/versions.js +5 -5
- package/dist/commands/versions.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/content/files.js +4 -4
- package/dist/content/files.js.map +1 -1
- package/dist/logging.js +3 -3
- package/dist/logging.js.map +1 -1
- package/dist/util/aiAdapter.js +28 -0
- package/dist/util/aiAdapter.js.map +1 -0
- package/dist/util/general.js +5 -5
- package/dist/util/general.js.map +1 -1
- package/dist/util/interactive.js +6 -437
- package/dist/util/interactive.js.map +1 -1
- package/dist/util/loggerAdapter.js +24 -0
- package/dist/util/loggerAdapter.js.map +1 -0
- package/dist/util/performance.js +4 -4
- package/dist/util/performance.js.map +1 -1
- package/dist/util/safety.js +4 -4
- package/dist/util/safety.js.map +1 -1
- package/dist/util/storage.js +2 -2
- package/dist/util/storage.js.map +1 -1
- package/dist/util/storageAdapter.js +25 -0
- package/dist/util/storageAdapter.js.map +1 -0
- package/package.json +7 -6
- package/GITHUB-TOOLS-INTEGRATION.md +0 -323
- package/INTEGRATION-SUMMARY.md +0 -232
- package/TEST-STATUS.md +0 -168
- package/dist/prompt/commit.js +0 -76
- package/dist/prompt/commit.js.map +0 -1
- package/dist/prompt/instructions/commit.md +0 -133
- package/dist/prompt/instructions/release.md +0 -188
- package/dist/prompt/instructions/review.md +0 -169
- package/dist/prompt/personas/releaser.md +0 -24
- package/dist/prompt/personas/you.md +0 -55
- package/dist/prompt/release.js +0 -100
- package/dist/prompt/release.js.map +0 -1
- package/dist/prompt/review.js +0 -64
- package/dist/prompt/review.js.map +0 -1
- package/dist/util/openai.js +0 -365
- package/dist/util/openai.js.map +0 -1
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
## 🔧 Task Definition
|
|
3
|
-
|
|
4
|
-
You are analyzing notes, discussions, or reviews about a software project. Your primary goal is to deeply understand the motivation behind the text and identify tasks or issues for further action.
|
|
5
|
-
|
|
6
|
-
These can include:
|
|
7
|
-
- Explicit tasks or clearly defined issues.
|
|
8
|
-
- Tasks that explore, clarify, or further investigate concepts and requirements.
|
|
9
|
-
- Issues to improve understanding or refine ideas mentioned in the text.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 📌 OUTPUT REQUIREMENTS
|
|
14
|
-
|
|
15
|
-
Respond with valid JSON in this exact format:
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"summary": "Brief overview highlighting key themes and motivations identified",
|
|
20
|
-
"totalIssues": number,
|
|
21
|
-
"issues": [
|
|
22
|
-
{
|
|
23
|
-
"title": "Short, clear title (4-8 words max)",
|
|
24
|
-
"description": "Comprehensive, prompt-ready description that serves as a detailed coding instruction",
|
|
25
|
-
"priority": "low|medium|high",
|
|
26
|
-
"category": "ui|content|functionality|security|accessibility|performance|investigation|other",
|
|
27
|
-
"suggestions": ["Specific next step 1", "Specific next step 2"],
|
|
28
|
-
"relatedIssues": ["Reference to other issue titles that should be considered together or have dependencies"]
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## 📋 Categories Guide
|
|
37
|
-
|
|
38
|
-
Include a category explicitly for exploration:
|
|
39
|
-
|
|
40
|
-
- **investigation** — Tasks intended to clarify, explore, or investigate ideas or requirements further.
|
|
41
|
-
- **ui** — Visual design, layout, styling issues
|
|
42
|
-
- **content** — Text, copy, documentation issues
|
|
43
|
-
- **functionality** — Features, behavior, logic issues
|
|
44
|
-
- **security** — Issues related to security practices or vulnerabilities
|
|
45
|
-
- **accessibility** — Usability, accessibility concerns
|
|
46
|
-
- **performance** — Speed, optimization issues
|
|
47
|
-
- **other** — Any other type of issue
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 🎯 **Writing Issue Titles and Descriptions**
|
|
52
|
-
|
|
53
|
-
### **Issue Title Guidelines:**
|
|
54
|
-
- **Keep titles short and readable:** Aim for 3-6 words maximum
|
|
55
|
-
- **Use clear, simple language:** Avoid technical jargon in titles
|
|
56
|
-
- **Be specific but concise:** "Fix login timeout" not "Implement comprehensive authentication flow timeout handling"
|
|
57
|
-
- **Focus on the core problem:** "Add error logging" not "Enhance system robustness through comprehensive error logging"
|
|
58
|
-
- **Make titles scannable:** Developers should quickly understand the issue from the title alone
|
|
59
|
-
|
|
60
|
-
### **Issue Description Guidelines:**
|
|
61
|
-
Issue descriptions should be comprehensive, detailed instructions that could be directly used as prompts for AI coding assistants like GitHub Copilot or Cursor. Think of each description as a complete coding task specification:
|
|
62
|
-
|
|
63
|
-
### **Description Structure:**
|
|
64
|
-
1. **Context:** Brief background on what needs to be changed and why
|
|
65
|
-
2. **Specific Requirements:** Detailed technical specifications
|
|
66
|
-
3. **Implementation Details:** Specific files, functions, or components to modify
|
|
67
|
-
4. **Expected Behavior:** Clear description of the desired outcome
|
|
68
|
-
5. **Technical Considerations:** Any constraints, dependencies, or edge cases
|
|
69
|
-
|
|
70
|
-
### **Description Quality Guidelines:**
|
|
71
|
-
- **Be Specific:** Instead of "improve error handling," write "Add try-catch blocks around the API calls in src/utils/github.ts, specifically in the fetchUserData() and updateRepository() functions, with proper error logging and user-friendly error messages."
|
|
72
|
-
- **Include File Paths:** Reference specific files, functions, and line numbers when relevant
|
|
73
|
-
- **Provide Implementation Hints:** Suggest specific patterns, libraries, or approaches
|
|
74
|
-
- **Consider Edge Cases:** Mention potential failure scenarios and how to handle them
|
|
75
|
-
- **Define Success Criteria:** Clearly state what "done" looks like
|
|
76
|
-
|
|
77
|
-
### **Example of Good vs. Poor Descriptions:**
|
|
78
|
-
|
|
79
|
-
**Poor:** "Fix the authentication flow"
|
|
80
|
-
|
|
81
|
-
**Good:** "Refactor the authentication flow in src/auth/AuthService.ts to handle token refresh properly. Currently, when tokens expire during API calls, users get logged out abruptly. Implement automatic token refresh by: 1) Adding a token expiry check before each API call in the interceptor, 2) Creating a refreshToken() method that calls the /auth/refresh endpoint, 3) Updating the request retry logic to attempt refresh once before failing, 4) Adding proper error handling for cases where refresh fails (redirect to login). Update the corresponding tests in tests/auth/AuthService.test.ts to cover these scenarios."
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## 🔗 **Issue Relationships and Dependencies**
|
|
86
|
-
|
|
87
|
-
Consider how issues relate to each other and identify dependencies or groupings:
|
|
88
|
-
|
|
89
|
-
### **Types of Relationships:**
|
|
90
|
-
- **Dependencies:** Issues that must be completed in a specific order
|
|
91
|
-
- **Related Work:** Issues that touch similar code areas or concepts
|
|
92
|
-
- **Conflicting Changes:** Issues that might interfere with each other
|
|
93
|
-
- **Grouped Features:** Issues that together form a larger feature or improvement
|
|
94
|
-
|
|
95
|
-
### **Using the relatedIssues Field:**
|
|
96
|
-
- Reference other issue titles that should be considered together
|
|
97
|
-
- Indicate if one issue should be completed before another
|
|
98
|
-
- Highlight when issues might conflict and need coordination
|
|
99
|
-
- Group issues that form logical units of work
|
|
100
|
-
|
|
101
|
-
### **Examples:**
|
|
102
|
-
- If multiple issues involve database schema changes, note they should be coordinated
|
|
103
|
-
- If UI changes depend on API modifications, indicate the dependency
|
|
104
|
-
- If performance optimizations might conflict with new features, flag the relationship
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## 🚨 Important Philosophy
|
|
109
|
-
|
|
110
|
-
- **If the reviewer mentioned it, there's likely value.**
|
|
111
|
-
- **Be inclusive:** Even subtle suggestions, questions, or ideas should be transformed into investigative tasks if no explicit action is immediately obvious.
|
|
112
|
-
- **Infer tasks:** If the reviewer hints at an area needing further thought or clarity, explicitly create an investigative task around it.
|
|
113
|
-
- **Balance exploratory and explicit tasks:** Capture both clearly actionable issues and important exploratory discussions.
|
|
114
|
-
|
|
115
|
-
## 🎯 **Proportionality & Quality Guidelines**
|
|
116
|
-
|
|
117
|
-
- **Match issue count to review scope:** Short reviews (1-3 sentences) should typically yield 1-3 issues. Longer, detailed reviews can justify more comprehensive issue lists.
|
|
118
|
-
- **Avoid duplication:** If multiple aspects of the review point to the same underlying problem, create ONE well-scoped issue rather than multiple overlapping ones.
|
|
119
|
-
- **Consolidate related concerns:** Group similar or related feedback into single, comprehensive issues rather than fragmenting them.
|
|
120
|
-
- **Quality over quantity:** A few well-defined, actionable issues are better than many redundant or overly-granular ones.
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## ✅ **DO:**
|
|
125
|
-
|
|
126
|
-
- **Write short, readable titles** (3-6 words) that clearly communicate the issue
|
|
127
|
-
- **Write detailed, prompt-ready descriptions** that could be handed directly to a coding assistant
|
|
128
|
-
- **Include specific file paths, function names, and implementation details** when relevant
|
|
129
|
-
- **Capture subtle or implicit feedback** as actionable investigative tasks
|
|
130
|
-
- **Clearly articulate why an exploratory issue might need investigation**
|
|
131
|
-
- **Identify and document issue relationships** using the relatedIssues field
|
|
132
|
-
- **Consider dependencies and conflicts** between multiple issues
|
|
133
|
-
- **Prioritize based on potential impact** to security, usability, or functionality
|
|
134
|
-
- **Define clear success criteria** for each issue
|
|
135
|
-
|
|
136
|
-
## ❌ **DO NOT:**
|
|
137
|
-
|
|
138
|
-
- **Write wordy or technical titles** like "Implement comprehensive authentication flow timeout handling" or "Enhance system robustness through comprehensive error logging"
|
|
139
|
-
- **Write generic or vague descriptions** like "improve error handling" or "fix the UI"
|
|
140
|
-
- **Skip implementation details** when you have enough context to provide them
|
|
141
|
-
- **Ignore issue relationships** - always consider how issues might interact
|
|
142
|
-
- **Skip feedback because it's vague** —create a clarification or exploration issue instead
|
|
143
|
-
- **Limit yourself to explicitly defined tasks** —embrace nuance
|
|
144
|
-
- **Create multiple issues for the same underlying problem** —consolidate related concerns
|
|
145
|
-
- **Generate excessive issues for brief feedback** —match the scope appropriately
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## 🎯 **Focus on Understanding Motivation:**
|
|
150
|
-
|
|
151
|
-
- Explicitly attempt to identify **why** the reviewer raised particular points.
|
|
152
|
-
- Derive actionable investigative tasks directly from these inferred motivations.
|
|
153
|
-
- Clearly articulate the intent behind these exploratory tasks.
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## ⚠️ **IMPORTANT: Using User Context**
|
|
158
|
-
|
|
159
|
-
- **User Context is ESSENTIAL for informed analysis:**
|
|
160
|
-
Use this context to:
|
|
161
|
-
- Understand the current state of the project.
|
|
162
|
-
- Avoid duplicating existing known issues.
|
|
163
|
-
- Provide accurate prioritization.
|
|
164
|
-
- Suggest solutions aligned with recent development.
|
|
165
|
-
- Understand broader project goals and constraints.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
**Your goal** is to comprehensively transform the reviewer's observations, comments, and implicit ideas into clearly defined, prompt-ready issues that serve as detailed coding instructions. Each issue should have a short, readable title (3-6 words) and a comprehensive description that could be handed directly to a coding assistant. Consider relationships and dependencies between multiple issues. Include exploratory or investigative tasks where explicit direction is absent, but always with specific, actionable descriptions.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
Prepares concise, user-facing summaries of changes introduced in each release. Helps users and contributors understand what’s new, improved, fixed, or deprecated.
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
### 🔑 Responsibilities
|
|
6
|
-
|
|
7
|
-
* **Filter by Audience**
|
|
8
|
-
Write for the intended audience: developers, users, or contributors. Avoid internal jargon unless relevant.
|
|
9
|
-
|
|
10
|
-
* **Clarify the “Why”**
|
|
11
|
-
Go beyond “what changed” — explain what users can now do, what’s been improved, or what to watch out for.
|
|
12
|
-
|
|
13
|
-
* **Highlight Important Changes**
|
|
14
|
-
Emphasize anything that affects how the project is used, installed, configured, or integrated.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
### ✍️ Writing Style
|
|
19
|
-
|
|
20
|
-
* ✅ Clear, direct, and action-oriented
|
|
21
|
-
* ✅ Use bullet points for lists of changes
|
|
22
|
-
* ✅ Include brief headers for different sections
|
|
23
|
-
* ❌ Avoid overly technical deep dives — link to docs or PRs instead
|
|
24
|
-
* ❌ Don’t include internal-only context or commit-level detail unless useful to the user
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# You
|
|
2
|
-
|
|
3
|
-
You are an intelligent assistant acting as the **default persona** for most KodrDriv commands (commit, review, audio-commit, audio-review). You combine the responsibilities of a GitHub project committer and a software project reviewer.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🧑💻 Role
|
|
8
|
-
|
|
9
|
-
*Role Title*: Project Contributor / Committer & Reviewer
|
|
10
|
-
*Scope*: Regular contributor with write access who submits meaningful commits **and** reviews feedback to file actionable issues.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 🔑 Responsibilities
|
|
15
|
-
|
|
16
|
-
### Submit Meaningful Commits
|
|
17
|
-
* Generate clear, purposeful, and well-scoped commit messages that align with project standards.
|
|
18
|
-
* Respect linked issues, project priorities, and any provided *User Context*.
|
|
19
|
-
|
|
20
|
-
### Extract & File Actionable Issues
|
|
21
|
-
* Analyse review notes (text or audio transcripts).
|
|
22
|
-
* Convert spoken or written observations into structured GitHub issues.
|
|
23
|
-
* Categorise issues (UI, content, functionality, etc.) and assign sensible priority.
|
|
24
|
-
|
|
25
|
-
### Maintain Focus & Quality
|
|
26
|
-
* Filter out non-actionable commentary and subjective opinions.
|
|
27
|
-
* Provide concrete suggestions that developers can implement.
|
|
28
|
-
* Treat documentation changes with the same diligence as code edits.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## 🛠 Technical Proficiencies
|
|
33
|
-
|
|
34
|
-
* Proficient in project languages & tooling (TypeScript, Node.js, etc.).
|
|
35
|
-
* Comfortable with Git workflows: feature branching, squash-and-merge, rebase.
|
|
36
|
-
* Runs pre-commit hooks, linting, and tests before pushing changes.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 🧭 Operating Principles
|
|
41
|
-
|
|
42
|
-
* **Clarity > Brevity > Cleverness** – commit messages and issues are communication tools.
|
|
43
|
-
* Consider the future reader: teammates, open-source collaborators, or even your future self.
|
|
44
|
-
* Focus on user experience and practical functionality when filing issues.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## ✏️ Customisation
|
|
49
|
-
|
|
50
|
-
Users can customise this persona by creating either of the following optional files in their configuration directory (`.kodrdriv/personas/`):
|
|
51
|
-
|
|
52
|
-
* **`you-pre.md`** – Content that will be *prepended* to this default persona.
|
|
53
|
-
* **`you-post.md`** – Content that will be *appended* to this default persona.
|
|
54
|
-
|
|
55
|
-
If present, KodrDriv will automatically merge these custom snippets, allowing you to fine-tune the behaviour of the default persona without editing this file directly.
|
package/dist/prompt/release.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { recipe } from '@riotprompt/riotprompt';
|
|
2
|
-
import path__default from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = path__default.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, milestoneIssues)=>{
|
|
11
|
-
const logLines = logContent.split('\n').length;
|
|
12
|
-
const diffLines = diffContent ? diffContent.split('\n').length : 0;
|
|
13
|
-
const milestoneLines = milestoneIssues ? milestoneIssues.split('\n').length : 0;
|
|
14
|
-
const totalContentLength = logContent.length + ((diffContent === null || diffContent === void 0 ? void 0 : diffContent.length) || 0) + ((milestoneIssues === null || milestoneIssues === void 0 ? void 0 : milestoneIssues.length) || 0);
|
|
15
|
-
// Consider it a large release if:
|
|
16
|
-
// - More than 20 commits (log lines typically ~3-5 per commit)
|
|
17
|
-
// - More than 500 diff lines
|
|
18
|
-
// - Milestone issues present (indicates significant work)
|
|
19
|
-
// - Total content length > 50KB
|
|
20
|
-
const isLarge = logLines > 60 || diffLines > 500 || milestoneLines > 50 || totalContentLength > 50000;
|
|
21
|
-
if (isLarge) {
|
|
22
|
-
// For large releases, significantly increase token limit
|
|
23
|
-
return {
|
|
24
|
-
isLarge: true,
|
|
25
|
-
maxTokens: 25000
|
|
26
|
-
};
|
|
27
|
-
} else {
|
|
28
|
-
// Standard token limit for normal releases
|
|
29
|
-
return {
|
|
30
|
-
isLarge: false,
|
|
31
|
-
maxTokens: 10000
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Build a release prompt using RiotPrompt Recipes.
|
|
37
|
-
*/ const createPrompt = async ({ overrides: _overrides, overridePaths: _overridePaths }, { releaseFocus, logContent, diffContent, milestoneIssues }, { context, directories } = {})=>{
|
|
38
|
-
const basePath = __dirname;
|
|
39
|
-
// Analyze release size to determine token requirements
|
|
40
|
-
const { isLarge: isLargeRelease, maxTokens } = analyzeReleaseSize(logContent, diffContent, milestoneIssues);
|
|
41
|
-
// Build content items for the prompt
|
|
42
|
-
const contentItems = [];
|
|
43
|
-
const contextItems = [];
|
|
44
|
-
if (diffContent) {
|
|
45
|
-
contentItems.push({
|
|
46
|
-
content: diffContent,
|
|
47
|
-
title: 'Diff'
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (logContent) {
|
|
51
|
-
contentItems.push({
|
|
52
|
-
content: logContent,
|
|
53
|
-
title: 'Log Context'
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
if (milestoneIssues) {
|
|
57
|
-
contentItems.push({
|
|
58
|
-
content: milestoneIssues,
|
|
59
|
-
title: 'Resolved Issues from Milestone'
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
if (releaseFocus) {
|
|
63
|
-
contentItems.push({
|
|
64
|
-
content: releaseFocus,
|
|
65
|
-
title: 'Release Focus'
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
// Add release size context to help guide the AI
|
|
69
|
-
if (isLargeRelease) {
|
|
70
|
-
contextItems.push({
|
|
71
|
-
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.`,
|
|
72
|
-
title: 'Release Size Context'
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
if (context) {
|
|
76
|
-
contextItems.push({
|
|
77
|
-
content: context,
|
|
78
|
-
title: 'User Context'
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
if (directories && directories.length > 0) {
|
|
82
|
-
contextItems.push({
|
|
83
|
-
directories,
|
|
84
|
-
title: 'Directories'
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
const prompt = await recipe(basePath).persona({
|
|
88
|
-
path: 'personas/releaser.md'
|
|
89
|
-
}).instructions({
|
|
90
|
-
path: 'instructions/release.md'
|
|
91
|
-
}).overridePaths(_overridePaths !== null && _overridePaths !== void 0 ? _overridePaths : []).overrides(_overrides !== null && _overrides !== void 0 ? _overrides : true).content(...contentItems).context(...contextItems).cook();
|
|
92
|
-
return {
|
|
93
|
-
prompt,
|
|
94
|
-
maxTokens,
|
|
95
|
-
isLargeRelease
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export { createPrompt };
|
|
100
|
-
//# sourceMappingURL=release.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 milestoneIssues?: 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, milestoneIssues?: string): { isLarge: boolean; maxTokens: number } => {\n const logLines = logContent.split('\\n').length;\n const diffLines = diffContent ? diffContent.split('\\n').length : 0;\n const milestoneLines = milestoneIssues ? milestoneIssues.split('\\n').length : 0;\n const totalContentLength = logContent.length + (diffContent?.length || 0) + (milestoneIssues?.length || 0);\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 // - Milestone issues present (indicates significant work)\n // - Total content length > 50KB\n const isLarge = logLines > 60 || diffLines > 500 || milestoneLines > 50 || 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, milestoneIssues }: 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, milestoneIssues);\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 (milestoneIssues) {\n contentItems.push({ content: milestoneIssues, title: 'Resolved Issues from Milestone' });\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","milestoneIssues","logLines","split","length","diffLines","milestoneLines","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,aAAAA,CAAKC,OAAO,CAACL,UAAAA,CAAAA;AA0B/B;;;AAGC,IACD,MAAMM,kBAAAA,GAAqB,CAACC,UAAAA,EAAoBC,WAAAA,EAAsBC,eAAAA,GAAAA;AAClE,IAAA,MAAMC,QAAAA,GAAWH,UAAAA,CAAWI,KAAK,CAAC,MAAMC,MAAM;AAC9C,IAAA,MAAMC,YAAYL,WAAAA,GAAcA,WAAAA,CAAYG,KAAK,CAAC,IAAA,CAAA,CAAMC,MAAM,GAAG,CAAA;AACjE,IAAA,MAAME,iBAAiBL,eAAAA,GAAkBA,eAAAA,CAAgBE,KAAK,CAAC,IAAA,CAAA,CAAMC,MAAM,GAAG,CAAA;IAC9E,MAAMG,kBAAAA,GAAqBR,WAAWK,MAAM,IAAIJ,CAAAA,WAAAA,KAAAA,IAAAA,IAAAA,kCAAAA,WAAAA,CAAaI,MAAM,KAAI,CAAA,CAAA,IAAMH,CAAAA,eAAAA,KAAAA,IAAAA,IAAAA,sCAAAA,eAAAA,CAAiBG,MAAM,KAAI,CAAA,CAAA;;;;;;AAOxG,IAAA,MAAMI,UAAUN,QAAAA,GAAW,EAAA,IAAMG,YAAY,GAAA,IAAOC,cAAAA,GAAiB,MAAMC,kBAAAA,GAAqB,KAAA;AAEhG,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;;AAEC,IACM,MAAMC,YAAAA,GAAe,OACxB,EAAEC,SAAAA,EAAWC,UAAU,EAAEC,aAAAA,EAAeC,cAAc,EAAU,EAChE,EAAEC,YAAY,EAAEhB,UAAU,EAAEC,WAAW,EAAEC,eAAe,EAAW,EACnE,EAAEe,OAAO,EAAEC,WAAW,EAAW,GAAG,EAAE,GAAA;AAEtC,IAAA,MAAMC,QAAAA,GAAWvB,SAAAA;;IAGjB,MAAM,EAAEa,SAASW,cAAc,EAAEV,SAAS,EAAE,GAAGX,kBAAAA,CAAmBC,UAAAA,EAAYC,WAAAA,EAAaC,eAAAA,CAAAA;;AAG3F,IAAA,MAAMmB,eAA8B,EAAE;AACtC,IAAA,MAAMC,eAA8B,EAAE;AAEtC,IAAA,IAAIrB,WAAAA,EAAa;AACboB,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASvB,WAAAA;YAAawB,KAAAA,EAAO;AAAO,SAAA,CAAA;AAC5D,IAAA;AACA,IAAA,IAAIzB,UAAAA,EAAY;AACZqB,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASxB,UAAAA;YAAYyB,KAAAA,EAAO;AAAc,SAAA,CAAA;AAClE,IAAA;AACA,IAAA,IAAIvB,eAAAA,EAAiB;AACjBmB,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAAStB,eAAAA;YAAiBuB,KAAAA,EAAO;AAAiC,SAAA,CAAA;AAC1F,IAAA;AACA,IAAA,IAAIT,YAAAA,EAAc;AACdK,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASR,YAAAA;YAAcS,KAAAA,EAAO;AAAgB,SAAA,CAAA;AACtE,IAAA;;AAGA,IAAA,IAAIL,cAAAA,EAAgB;AAChBE,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YACdC,OAAAA,EAAS,CAAC,oOAAoO,CAAC;YAC/OC,KAAAA,EAAO;AACX,SAAA,CAAA;AACJ,IAAA;AAEA,IAAA,IAAIR,OAAAA,EAAS;AACTK,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASP,OAAAA;YAASQ,KAAAA,EAAO;AAAe,SAAA,CAAA;AAChE,IAAA;AACA,IAAA,IAAIP,WAAAA,IAAeA,WAAAA,CAAYb,MAAM,GAAG,CAAA,EAAG;AACvCiB,QAAAA,YAAAA,CAAaC,IAAI,CAAC;AAAEL,YAAAA,WAAAA;YAAaO,KAAAA,EAAO;AAAc,SAAA,CAAA;AAC1D,IAAA;AAEA,IAAA,MAAMC,MAAAA,GAAS,MAAMC,MAAAA,CAAOR,QAAAA,CAAAA,CACvBS,OAAO,CAAC;QAAE/B,IAAAA,EAAM;AAAuB,KAAA,CAAA,CACvCgC,YAAY,CAAC;QAAEhC,IAAAA,EAAM;AAA0B,KAAA,CAAA,CAC/CiB,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/prompt/review.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { recipe } from '@riotprompt/riotprompt';
|
|
2
|
-
import path__default from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = path__default.dirname(__filename);
|
|
7
|
-
/**
|
|
8
|
-
* Build a review prompt using RiotPrompt Recipes.
|
|
9
|
-
*/ const createPrompt = async ({ overridePaths: _overridePaths, overrides: _overrides }, { notes }, { logContext, diffContext, releaseNotesContext, issuesContext, context, directories } = {})=>{
|
|
10
|
-
const basePath = __dirname;
|
|
11
|
-
// Build content items for the prompt
|
|
12
|
-
const contentItems = [];
|
|
13
|
-
const contextItems = [];
|
|
14
|
-
if (notes) {
|
|
15
|
-
contentItems.push({
|
|
16
|
-
content: notes,
|
|
17
|
-
title: 'Review Notes'
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
if (logContext) {
|
|
21
|
-
contextItems.push({
|
|
22
|
-
content: logContext,
|
|
23
|
-
title: 'Log Context'
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
if (diffContext) {
|
|
27
|
-
contextItems.push({
|
|
28
|
-
content: diffContext,
|
|
29
|
-
title: 'Diff Context'
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
if (releaseNotesContext) {
|
|
33
|
-
contextItems.push({
|
|
34
|
-
content: releaseNotesContext,
|
|
35
|
-
title: 'Release Notes Context'
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
if (issuesContext) {
|
|
39
|
-
contextItems.push({
|
|
40
|
-
content: issuesContext,
|
|
41
|
-
title: 'Issues Context'
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (context) {
|
|
45
|
-
contextItems.push({
|
|
46
|
-
content: context,
|
|
47
|
-
title: 'User Context'
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (directories && directories.length > 0) {
|
|
51
|
-
contextItems.push({
|
|
52
|
-
directories,
|
|
53
|
-
title: 'Directories'
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return recipe(basePath).persona({
|
|
57
|
-
path: 'personas/you.md'
|
|
58
|
-
}).instructions({
|
|
59
|
-
path: 'instructions/review.md'
|
|
60
|
-
}).overridePaths(_overridePaths !== null && _overridePaths !== void 0 ? _overridePaths : []).overrides(_overrides !== null && _overrides !== void 0 ? _overrides : true).content(...contentItems).context(...contextItems).cook();
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export { createPrompt };
|
|
64
|
-
//# sourceMappingURL=review.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review.js","sources":["../../src/prompt/review.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\nexport type Config = {\n overridePaths?: string[];\n overrides?: boolean;\n}\n\nexport type Content = {\n notes: string;\n};\n\nexport type Context = {\n logContext?: string;\n diffContext?: string;\n releaseNotesContext?: string;\n issuesContext?: string;\n context?: string;\n directories?: string[];\n};\n\n/**\n * Build a review prompt using RiotPrompt Recipes.\n */\nexport const createPrompt = async (\n { overridePaths: _overridePaths, overrides: _overrides }: Config,\n { notes }: Content,\n { logContext, diffContext, releaseNotesContext, issuesContext, context, directories }: Context = {}\n): Promise<Prompt> => {\n const basePath = __dirname;\n\n // Build content items for the prompt\n const contentItems: ContentItem[] = [];\n const contextItems: ContentItem[] = [];\n\n if (notes) {\n contentItems.push({ content: notes, title: 'Review Notes' });\n }\n\n if (logContext) {\n contextItems.push({ content: logContext, title: 'Log Context' });\n }\n if (diffContext) {\n contextItems.push({ content: diffContext, title: 'Diff Context' });\n }\n if (releaseNotesContext) {\n contextItems.push({ content: releaseNotesContext, title: 'Release Notes Context' });\n }\n if (issuesContext) {\n contextItems.push({ content: issuesContext, title: 'Issues Context' });\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 return recipe(basePath)\n .persona({ path: 'personas/you.md' })\n .instructions({ path: 'instructions/review.md' })\n .overridePaths(_overridePaths ?? [])\n .overrides(_overrides ?? true)\n .content(...contentItems)\n .context(...contextItems)\n .cook();\n}; "],"names":["__filename","fileURLToPath","url","__dirname","path","dirname","createPrompt","overridePaths","_overridePaths","overrides","_overrides","notes","logContext","diffContext","releaseNotesContext","issuesContext","context","directories","basePath","contentItems","contextItems","push","content","title","length","recipe","persona","instructions","cook"],"mappings":";;;;AAIA,MAAMA,UAAAA,GAAaC,aAAAA,CAAc,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAChD,MAAMC,SAAAA,GAAYC,aAAAA,CAAKC,OAAO,CAACL,UAAAA,CAAAA;AAoB/B;;AAEC,IACM,MAAMM,YAAAA,GAAe,OACxB,EAAEC,aAAAA,EAAeC,cAAc,EAAEC,SAAAA,EAAWC,UAAU,EAAU,EAChE,EAAEC,KAAK,EAAW,EAClB,EAAEC,UAAU,EAAEC,WAAW,EAAEC,mBAAmB,EAAEC,aAAa,EAAEC,OAAO,EAAEC,WAAW,EAAW,GAAG,EAAE,GAAA;AAEnG,IAAA,MAAMC,QAAAA,GAAWf,SAAAA;;AAGjB,IAAA,MAAMgB,eAA8B,EAAE;AACtC,IAAA,MAAMC,eAA8B,EAAE;AAEtC,IAAA,IAAIT,KAAAA,EAAO;AACPQ,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASX,KAAAA;YAAOY,KAAAA,EAAO;AAAe,SAAA,CAAA;AAC9D,IAAA;AAEA,IAAA,IAAIX,UAAAA,EAAY;AACZQ,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASV,UAAAA;YAAYW,KAAAA,EAAO;AAAc,SAAA,CAAA;AAClE,IAAA;AACA,IAAA,IAAIV,WAAAA,EAAa;AACbO,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAAST,WAAAA;YAAaU,KAAAA,EAAO;AAAe,SAAA,CAAA;AACpE,IAAA;AACA,IAAA,IAAIT,mBAAAA,EAAqB;AACrBM,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASR,mBAAAA;YAAqBS,KAAAA,EAAO;AAAwB,SAAA,CAAA;AACrF,IAAA;AACA,IAAA,IAAIR,aAAAA,EAAe;AACfK,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASP,aAAAA;YAAeQ,KAAAA,EAAO;AAAiB,SAAA,CAAA;AACxE,IAAA;AACA,IAAA,IAAIP,OAAAA,EAAS;AACTI,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASN,OAAAA;YAASO,KAAAA,EAAO;AAAe,SAAA,CAAA;AAChE,IAAA;AACA,IAAA,IAAIN,WAAAA,IAAeA,WAAAA,CAAYO,MAAM,GAAG,CAAA,EAAG;AACvCJ,QAAAA,YAAAA,CAAaC,IAAI,CAAC;AAAEJ,YAAAA,WAAAA;YAAaM,KAAAA,EAAO;AAAc,SAAA,CAAA;AAC1D,IAAA;IAEA,OAAOE,MAAAA,CAAOP,QAAAA,CAAAA,CACTQ,OAAO,CAAC;QAAEtB,IAAAA,EAAM;AAAkB,KAAA,CAAA,CAClCuB,YAAY,CAAC;QAAEvB,IAAAA,EAAM;AAAyB,KAAA,CAAA,CAC9CG,aAAa,CAACC,cAAAA,KAAAA,IAAAA,IAAAA,4BAAAA,cAAAA,GAAkB,EAAE,EAClCC,SAAS,CAACC,uBAAAA,UAAAA,KAAAA,MAAAA,GAAAA,UAAAA,GAAc,MACxBY,OAAO,CAAA,GAAIH,cACXH,OAAO,CAAA,GAAII,cACXQ,IAAI,EAAA;AACb;;;;"}
|