agent-nuvira 1.28.0 → 1.30.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/README.md +10 -0
- package/dist/agents/agents/git-agent.d.ts +19 -3
- package/dist/agents/agents/git-agent.d.ts.map +1 -1
- package/dist/agents/agents/git-agent.js +231 -37
- package/dist/agents/agents/git-agent.js.map +1 -1
- package/dist/agents/agents/package-agent.d.ts +12 -0
- package/dist/agents/agents/package-agent.d.ts.map +1 -1
- package/dist/agents/agents/package-agent.js +95 -8
- package/dist/agents/agents/package-agent.js.map +1 -1
- package/dist/agents/credential-store.d.ts +102 -0
- package/dist/agents/credential-store.d.ts.map +1 -0
- package/dist/agents/credential-store.js +433 -0
- package/dist/agents/credential-store.js.map +1 -0
- package/dist/agents/phase-engine.d.ts +74 -0
- package/dist/agents/phase-engine.d.ts.map +1 -0
- package/dist/agents/phase-engine.js +288 -0
- package/dist/agents/phase-engine.js.map +1 -0
- package/dist/cli/phase.d.ts +26 -0
- package/dist/cli/phase.d.ts.map +1 -0
- package/dist/cli/phase.js +279 -0
- package/dist/cli/phase.js.map +1 -0
- package/dist/cli/publish.d.ts +29 -0
- package/dist/cli/publish.d.ts.map +1 -0
- package/dist/cli/publish.js +275 -0
- package/dist/cli/publish.js.map +1 -0
- package/dist/cli/router.d.ts.map +1 -1
- package/dist/cli/router.js +8 -0
- package/dist/cli/router.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1396,6 +1396,11 @@ npx tsc --noEmit
|
|
|
1396
1396
|
| **Phase 9: Safe Execution Layer** | | |
|
|
1397
1397
|
| 9.1 | SafeExecutionLayer — file validation, Docker sandbox, safe LLM calls, EventBus integration | ✅ Complete (v1.26.0) |
|
|
1398
1398
|
| 9.2 | VerifyModule EventBus tests — 9 emission tests for SAFE_EXEC_* events | ✅ Complete (v1.26.0) |
|
|
1399
|
+
| **Phase 10: Autonomous Publish** | | |
|
|
1400
|
+
| 10.1 | CredentialStore — interactive Git/npm credential collection, GIT_ASKPASS, SSH agent, .npmrc injection | ✅ Complete (v1.29.0) |
|
|
1401
|
+
| 10.2 | PhaseExecutionEngine — multi-goal project scopes with save/resume across restarts | ✅ Complete (v1.29.0) |
|
|
1402
|
+
| 10.3 | `buff publish` — 5-phase pipeline: tests → version → git → npm → GitHub release | ✅ Complete (v1.29.0) |
|
|
1403
|
+
| 10.4 | `buff phase` — create/execute/resume/status/list scopes with credential management | ✅ Complete (v1.29.0) |
|
|
1399
1404
|
|
|
1400
1405
|
---
|
|
1401
1406
|
|
|
@@ -1430,6 +1435,7 @@ npx tsc --noEmit
|
|
|
1430
1435
|
| **v1.16.1** | Aug 2026 | Interactive dev mode enhancements — failure analysis, follow-up suggestions, /fix command, 35 new unit tests |
|
|
1431
1436
|
| **v1.26.0** | Aug 2026 | Phase 9 — SafeExecutionLayer module (file validation, Docker sandbox, safe LLM calls) + 32 new tests (23 SafeExec + 9 Verify Bus) |
|
|
1432
1437
|
| **v1.27.0** | Aug 2026 | Website + SVG — Phase 9 SafeExecutionLayer, phase progress 9/9, 2,207 tests |
|
|
1438
|
+
| **v1.29.0** | Sep 2026 | Phase 10 — Autonomous publish + phase-wise execution (CredentialStore, PhaseEngine, `buff publish`, `buff phase`, git push, npm auth) + 86 new tests |
|
|
1433
1439
|
|
|
1434
1440
|
---
|
|
1435
1441
|
|
|
@@ -1520,6 +1526,10 @@ npx tsc --noEmit
|
|
|
1520
1526
|
| **ExecuteModule (Phase 8)** | Command execution — 5-strategy command inference (backtick, Run prefix, npm patterns, file extension), npm test validation |
|
|
1521
1527
|
| **TestModule (Phase 8)** | Sandboxed test execution — temp directory, multi-framework output parsing (vitest, jest, generic), EventBus events |
|
|
1522
1528
|
| **SafeExecutionLayer (Phase 9)** | 3-domain safety system — file validation (size, gitignore, syntax, security scan), Docker sandbox (resource limits, container lifecycle), safe LLM calls (injection guardrail, prompt/response truncation, exponential backoff with circuit breaker) |
|
|
1529
|
+
| **CredentialStore (Phase 10)** | Interactive Git/npm credential collection — auto-detection from env vars (GITHUB_TOKEN, GH_TOKEN, NPM_TOKEN), GIT_ASKPASS setup for HTTPS auth, SSH agent integration with passphrase support, .npmrc token injection |
|
|
1530
|
+
| **PhaseExecutionEngine (Phase 10)** | Multi-goal project scope execution — sequential phase execution with save/resume across restarts, credential management, progress tracking |
|
|
1531
|
+
| **`buff publish` (Phase 10)** | Autonomous 5-phase publish pipeline — test verification → version bump → git commit/tag/push → npm build/publish → GitHub release |
|
|
1532
|
+
| **`buff phase` (Phase 10)** | Phase-wise project execution CLI — create/execute/resume/status/list/delete scopes with interactive pauses and credential collection |
|
|
1523
1533
|
|
|
1524
1534
|
### Agent Catalog — 15 Agent Roles & Management
|
|
1525
1535
|
| Agent/Component | Type | Description |
|
|
@@ -6,13 +6,21 @@
|
|
|
6
6
|
* - Commit changes with auto-generated commit messages (via LLM)
|
|
7
7
|
* - Generate PR descriptions from git diff
|
|
8
8
|
* - Check git status
|
|
9
|
+
* - Push commits to remote (with credential management)
|
|
10
|
+
* - Create and push tags
|
|
11
|
+
* - Auto-push — commit + tag + push in one operation
|
|
9
12
|
*
|
|
10
|
-
* This agent does NOT require an LLM for basic operations (status, branch, commit),
|
|
13
|
+
* This agent does NOT require an LLM for basic operations (status, branch, commit, push),
|
|
11
14
|
* but uses the LLM for generating commit messages and PR descriptions.
|
|
12
15
|
*
|
|
16
|
+
* Credential handling:
|
|
17
|
+
* - HTTPS: Uses GIT_ASKPASS env var (set by CredentialStore)
|
|
18
|
+
* - SSH: Uses SSH agent (keys added by CredentialStore)
|
|
19
|
+
* - Falls back to git's built-in credential helpers if available
|
|
20
|
+
*
|
|
13
21
|
* Usage in task plans:
|
|
14
22
|
* ```json
|
|
15
|
-
* { "id": "step-commit", "description": "Commit changes to git", "agentType": "git", "dependsOn": ["step-write"] }
|
|
23
|
+
* { "id": "step-commit", "description": "Commit and push changes to git", "agentType": "git", "dependsOn": ["step-write"] }
|
|
16
24
|
* ```
|
|
17
25
|
*/
|
|
18
26
|
import { Agent, type AgentContext, type AgentResult } from '../agent.js';
|
|
@@ -22,12 +30,20 @@ import type { LLMCallFn } from '../agent.js';
|
|
|
22
30
|
*/
|
|
23
31
|
export declare class GitAgent extends Agent {
|
|
24
32
|
readonly name = "Git";
|
|
25
|
-
readonly description = "Manages git operations (branch, commit, PR)";
|
|
33
|
+
readonly description = "Manages git operations (branch, commit, push, PR)";
|
|
26
34
|
execute(context: AgentContext, callLLM: LLMCallFn): Promise<AgentResult>;
|
|
27
35
|
private detectOperation;
|
|
28
36
|
private gitStatus;
|
|
29
37
|
private createBranch;
|
|
30
38
|
private commit;
|
|
39
|
+
/**
|
|
40
|
+
* Push the current branch to the remote.
|
|
41
|
+
* Uses GIT_ASKPASS for HTTPS auth (set by CredentialStore) or SSH agent.
|
|
42
|
+
*/
|
|
43
|
+
private pushToRemote;
|
|
44
|
+
private createAndPushTag;
|
|
45
|
+
private pushTagToRemote;
|
|
46
|
+
private autoPush;
|
|
31
47
|
private generatePRDescription;
|
|
32
48
|
private exec;
|
|
33
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/agents/git-agent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"git-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/agents/git-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAOH,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA0B7C;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,WAAW,uDAAuD;IAErE,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IAgC9E,OAAO,CAAC,eAAe;YAaT,SAAS;YA2BT,YAAY;YAmBZ,MAAM;IAuCpB;;;OAGG;YACW,YAAY;YAuEZ,gBAAgB;YA8ChB,eAAe;YA0Cf,QAAQ;YAyBR,qBAAqB;IAuBnC,OAAO,CAAC,IAAI;CAkBb"}
|
|
@@ -6,13 +6,21 @@
|
|
|
6
6
|
* - Commit changes with auto-generated commit messages (via LLM)
|
|
7
7
|
* - Generate PR descriptions from git diff
|
|
8
8
|
* - Check git status
|
|
9
|
+
* - Push commits to remote (with credential management)
|
|
10
|
+
* - Create and push tags
|
|
11
|
+
* - Auto-push — commit + tag + push in one operation
|
|
9
12
|
*
|
|
10
|
-
* This agent does NOT require an LLM for basic operations (status, branch, commit),
|
|
13
|
+
* This agent does NOT require an LLM for basic operations (status, branch, commit, push),
|
|
11
14
|
* but uses the LLM for generating commit messages and PR descriptions.
|
|
12
15
|
*
|
|
16
|
+
* Credential handling:
|
|
17
|
+
* - HTTPS: Uses GIT_ASKPASS env var (set by CredentialStore)
|
|
18
|
+
* - SSH: Uses SSH agent (keys added by CredentialStore)
|
|
19
|
+
* - Falls back to git's built-in credential helpers if available
|
|
20
|
+
*
|
|
13
21
|
* Usage in task plans:
|
|
14
22
|
* ```json
|
|
15
|
-
* { "id": "step-commit", "description": "Commit changes to git", "agentType": "git", "dependsOn": ["step-write"] }
|
|
23
|
+
* { "id": "step-commit", "description": "Commit and push changes to git", "agentType": "git", "dependsOn": ["step-write"] }
|
|
16
24
|
* ```
|
|
17
25
|
*/
|
|
18
26
|
import { execSync } from 'node:child_process';
|
|
@@ -20,6 +28,7 @@ import { writeFileSync, unlinkSync, mkdtempSync } from 'node:fs';
|
|
|
20
28
|
import { join } from 'node:path';
|
|
21
29
|
import { tmpdir } from 'node:os';
|
|
22
30
|
import { Agent } from '../agent.js';
|
|
31
|
+
import { logger } from '../../utils/logger.js';
|
|
23
32
|
const COMMIT_MESSAGE_PROMPT = `You are an expert at writing clear, conventional git commit messages.
|
|
24
33
|
|
|
25
34
|
Given the following git diff, write a concise commit message following conventional commits format:
|
|
@@ -36,28 +45,35 @@ Rules:
|
|
|
36
45
|
- Be specific but concise
|
|
37
46
|
|
|
38
47
|
Return ONLY the commit message, nothing else.`;
|
|
48
|
+
/** Maximum push attempts before giving up */
|
|
49
|
+
const MAX_PUSH_ATTEMPTS = 2;
|
|
39
50
|
/**
|
|
40
51
|
* GitAgent — Handles git operations for the multi-agent pipeline.
|
|
41
52
|
*/
|
|
42
53
|
export class GitAgent extends Agent {
|
|
43
54
|
name = 'Git';
|
|
44
|
-
description = 'Manages git operations (branch, commit, PR)';
|
|
55
|
+
description = 'Manages git operations (branch, commit, push, PR)';
|
|
45
56
|
async execute(context, callLLM) {
|
|
46
57
|
try {
|
|
47
58
|
const taskDesc = context.taskPlan.find((s) => s.agentType === 'git' && s.status === 'running')?.description || context.goal;
|
|
48
|
-
// Parse the task to determine the git operation
|
|
49
59
|
const operation = this.detectOperation(taskDesc);
|
|
50
60
|
switch (operation) {
|
|
51
61
|
case 'status':
|
|
52
62
|
return this.gitStatus();
|
|
53
63
|
case 'branch':
|
|
54
64
|
return this.createBranch(context, taskDesc);
|
|
65
|
+
case 'push':
|
|
66
|
+
return this.pushToRemote();
|
|
67
|
+
case 'tag':
|
|
68
|
+
return this.createAndPushTag(context, taskDesc);
|
|
55
69
|
case 'commit':
|
|
56
70
|
return this.commit(context, callLLM);
|
|
71
|
+
case 'auto-push':
|
|
72
|
+
return this.autoPush(context, callLLM);
|
|
57
73
|
case 'pr-description':
|
|
58
74
|
return this.generatePRDescription(context, callLLM);
|
|
59
75
|
default:
|
|
60
|
-
return this.
|
|
76
|
+
return this.autoPush(context, callLLM);
|
|
61
77
|
}
|
|
62
78
|
}
|
|
63
79
|
catch (err) {
|
|
@@ -71,28 +87,51 @@ export class GitAgent extends Agent {
|
|
|
71
87
|
return 'status';
|
|
72
88
|
if (lower.includes('branch') || lower.includes('checkout') || lower.includes('switch'))
|
|
73
89
|
return 'branch';
|
|
90
|
+
if (lower.includes('push') && !lower.includes('auto'))
|
|
91
|
+
return 'push';
|
|
92
|
+
if (lower.includes('tag') || lower.includes('release tag'))
|
|
93
|
+
return 'tag';
|
|
94
|
+
if (lower.includes('auto') || lower.includes('auto-push') || lower.includes('commit and push'))
|
|
95
|
+
return 'auto-push';
|
|
74
96
|
if (lower.includes('pr') || lower.includes('pull request') || lower.includes('description'))
|
|
75
97
|
return 'pr-description';
|
|
76
98
|
return 'commit';
|
|
77
99
|
}
|
|
100
|
+
// ─── Status ───────────────────────────────────────────────────────────────
|
|
78
101
|
async gitStatus() {
|
|
79
102
|
const output = this.exec('git status --short');
|
|
80
103
|
const lines = output.trim().split('\n').filter(Boolean);
|
|
104
|
+
let branch = '';
|
|
105
|
+
try {
|
|
106
|
+
branch = this.exec('git rev-parse --abbrev-ref HEAD').trim();
|
|
107
|
+
}
|
|
108
|
+
catch { /* ignore */ }
|
|
109
|
+
let remote = '';
|
|
110
|
+
try {
|
|
111
|
+
remote = this.exec('git remote get-url origin').trim();
|
|
112
|
+
}
|
|
113
|
+
catch { /* ignore */ }
|
|
114
|
+
const details = [
|
|
115
|
+
`Branch: ${branch || 'unknown'}`,
|
|
116
|
+
`Remote: ${remote || 'none'}`,
|
|
117
|
+
`Changes: ${lines.length} file(s)`,
|
|
118
|
+
'',
|
|
119
|
+
output,
|
|
120
|
+
].join('\n');
|
|
81
121
|
return {
|
|
82
122
|
success: true,
|
|
83
|
-
summary: `${lines.length} file(s) changed`,
|
|
84
|
-
details
|
|
123
|
+
summary: `${lines.length} file(s) changed on ${branch || 'current branch'}`,
|
|
124
|
+
details,
|
|
85
125
|
};
|
|
86
126
|
}
|
|
127
|
+
// ─── Branch ───────────────────────────────────────────────────────────────
|
|
87
128
|
async createBranch(context, description) {
|
|
88
|
-
// Generate branch name from goal
|
|
89
129
|
const sanitized = context.goal
|
|
90
130
|
.toLowerCase()
|
|
91
131
|
.replace(/[^a-z0-9]+/g, '-')
|
|
92
132
|
.replace(/^-|-$/g, '')
|
|
93
133
|
.slice(0, 40);
|
|
94
134
|
const branchName = `feat/${sanitized}`;
|
|
95
|
-
// Check if branch already exists
|
|
96
135
|
const existing = this.exec(`git branch --list "${branchName}"`);
|
|
97
136
|
if (existing.trim()) {
|
|
98
137
|
return { success: true, summary: `Branch '${branchName}' already exists`, details: branchName };
|
|
@@ -100,18 +139,15 @@ export class GitAgent extends Agent {
|
|
|
100
139
|
this.exec(`git checkout -b "${branchName}"`);
|
|
101
140
|
return { success: true, summary: `Created branch '${branchName}'`, details: branchName };
|
|
102
141
|
}
|
|
142
|
+
// ─── Commit ───────────────────────────────────────────────────────────────
|
|
103
143
|
async commit(context, callLLM) {
|
|
104
|
-
// Stage all changes
|
|
105
144
|
this.exec('git add -A');
|
|
106
|
-
// Check if there's anything to commit
|
|
107
145
|
const status = this.exec('git status --short');
|
|
108
146
|
if (!status.trim()) {
|
|
109
147
|
return { success: true, summary: 'No changes to commit' };
|
|
110
148
|
}
|
|
111
|
-
// Get the diff for the LLM to summarize
|
|
112
149
|
const diff = this.exec('git diff --cached --stat');
|
|
113
150
|
const fullDiff = this.exec('git diff --cached');
|
|
114
|
-
// Generate commit message via LLM
|
|
115
151
|
let commitMessage = '';
|
|
116
152
|
try {
|
|
117
153
|
const prompt = `${COMMIT_MESSAGE_PROMPT}\n\n## Diff Summary\n${diff}\n\n## Full Diff (truncated)\n${fullDiff.slice(0, 4000)}`;
|
|
@@ -119,14 +155,11 @@ export class GitAgent extends Agent {
|
|
|
119
155
|
commitMessage = commitMessage.trim().replace(/^```[\s\S]*?\n|```$/g, '').trim();
|
|
120
156
|
}
|
|
121
157
|
catch {
|
|
122
|
-
// Fallback: generate a simple commit message from the goal
|
|
123
158
|
commitMessage = `feat: ${context.goal.slice(0, 60)}`;
|
|
124
159
|
}
|
|
125
|
-
// Ensure the commit message is valid
|
|
126
160
|
if (!commitMessage || commitMessage.length < 5) {
|
|
127
161
|
commitMessage = `feat: ${context.goal.slice(0, 60)}`;
|
|
128
162
|
}
|
|
129
|
-
// Write commit message to temp file to avoid shell quoting issues (cross-platform)
|
|
130
163
|
const msgDir = mkdtempSync(join(tmpdir(), 'git-msg-'));
|
|
131
164
|
const msgFile = join(msgDir, 'commit-msg.txt');
|
|
132
165
|
writeFileSync(msgFile, commitMessage, 'utf-8');
|
|
@@ -141,26 +174,188 @@ export class GitAgent extends Agent {
|
|
|
141
174
|
details: commitMessage,
|
|
142
175
|
};
|
|
143
176
|
}
|
|
177
|
+
// ─── Push ─────────────────────────────────────────────────────────────────
|
|
178
|
+
/**
|
|
179
|
+
* Push the current branch to the remote.
|
|
180
|
+
* Uses GIT_ASKPASS for HTTPS auth (set by CredentialStore) or SSH agent.
|
|
181
|
+
*/
|
|
182
|
+
async pushToRemote() {
|
|
183
|
+
let branch = 'main';
|
|
184
|
+
try {
|
|
185
|
+
branch = this.exec('git rev-parse --abbrev-ref HEAD').trim();
|
|
186
|
+
}
|
|
187
|
+
catch { /* use default */ }
|
|
188
|
+
let remote = 'origin';
|
|
189
|
+
try {
|
|
190
|
+
const remotes = this.exec('git remote').trim();
|
|
191
|
+
if (remotes) {
|
|
192
|
+
remote = remotes.split('\n')[0].trim();
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
return {
|
|
196
|
+
success: false,
|
|
197
|
+
summary: 'No git remote configured',
|
|
198
|
+
error: 'Add a remote first: git remote add origin <url>',
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
return { success: false, summary: 'No git remote configured', error: 'Git remote not found' };
|
|
204
|
+
}
|
|
205
|
+
let lastError = '';
|
|
206
|
+
for (let attempt = 0; attempt < MAX_PUSH_ATTEMPTS; attempt++) {
|
|
207
|
+
try {
|
|
208
|
+
const output = execSync(`git push -u "${remote}" "${branch}" 2>&1`, {
|
|
209
|
+
cwd: process.cwd(),
|
|
210
|
+
timeout: 120_000,
|
|
211
|
+
encoding: 'utf-8',
|
|
212
|
+
stdio: 'pipe',
|
|
213
|
+
});
|
|
214
|
+
const lines = output.trim().split('\n').filter(Boolean);
|
|
215
|
+
return {
|
|
216
|
+
success: true,
|
|
217
|
+
summary: `Pushed ${branch} to ${remote}`,
|
|
218
|
+
details: lines.join('\n'),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
catch (err) {
|
|
222
|
+
const error = err;
|
|
223
|
+
const msg = error.stderr || error.message || '';
|
|
224
|
+
if (msg.includes('Authentication failed') || msg.includes('auth failed') ||
|
|
225
|
+
msg.includes('403') || msg.includes('401')) {
|
|
226
|
+
lastError = 'Authentication failed. Set GITHUB_TOKEN or GH_TOKEN env var, or run creds setup.';
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
if (msg.includes('Could not read from remote') || msg.includes('Repository not found') ||
|
|
230
|
+
msg.includes('fatal:')) {
|
|
231
|
+
lastError = msg.slice(0, 200);
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
lastError = msg.slice(0, 200);
|
|
235
|
+
if (attempt < MAX_PUSH_ATTEMPTS - 1) {
|
|
236
|
+
try {
|
|
237
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
238
|
+
}
|
|
239
|
+
catch { /* ignore */ }
|
|
240
|
+
logger.debug(`Retrying git push (attempt ${attempt + 2}/${MAX_PUSH_ATTEMPTS})...`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
success: false,
|
|
246
|
+
summary: `Failed to push ${branch} to ${remote}`,
|
|
247
|
+
error: lastError || 'Push failed after retries',
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
// ─── Tag ──────────────────────────────────────────────────────────────────
|
|
251
|
+
async createAndPushTag(context, description) {
|
|
252
|
+
let version = '';
|
|
253
|
+
const versionMatch = description.match(/v?(\d+\.\d+\.\d+)/);
|
|
254
|
+
if (versionMatch) {
|
|
255
|
+
version = versionMatch[1];
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
try {
|
|
259
|
+
const { existsSync, readFileSync } = await import('node:fs');
|
|
260
|
+
const pkgPath = join(process.cwd(), 'package.json');
|
|
261
|
+
if (existsSync(pkgPath)) {
|
|
262
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
263
|
+
version = pkg.version || '';
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
catch { /* fall through */ }
|
|
267
|
+
}
|
|
268
|
+
if (!version) {
|
|
269
|
+
try {
|
|
270
|
+
const lastTag = this.exec('git describe --tags --abbrev=0 2>&1').trim();
|
|
271
|
+
const parts = lastTag.replace(/^v/, '').split('.').map(Number);
|
|
272
|
+
version = `${parts[0] || 0}.${parts[1] || 0}.${(parts[2] || 0) + 1}`;
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
version = '0.1.0';
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const tagName = `v${version}`;
|
|
279
|
+
try {
|
|
280
|
+
const existing = this.exec(`git tag -l "${tagName}"`);
|
|
281
|
+
if (existing.trim() === tagName) {
|
|
282
|
+
return this.pushTagToRemote(tagName);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
catch { /* continue */ }
|
|
286
|
+
try {
|
|
287
|
+
this.exec(`git tag -a "${tagName}" -m "Release ${tagName}"`);
|
|
288
|
+
}
|
|
289
|
+
catch (err) {
|
|
290
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
291
|
+
return { success: false, summary: `Failed to create tag ${tagName}`, error: msg.slice(0, 200) };
|
|
292
|
+
}
|
|
293
|
+
return this.pushTagToRemote(tagName);
|
|
294
|
+
}
|
|
295
|
+
async pushTagToRemote(tagName) {
|
|
296
|
+
let remote = 'origin';
|
|
297
|
+
try {
|
|
298
|
+
const remotes = this.exec('git remote').trim();
|
|
299
|
+
if (remotes)
|
|
300
|
+
remote = remotes.split('\n')[0].trim();
|
|
301
|
+
}
|
|
302
|
+
catch { /* use default */ }
|
|
303
|
+
try {
|
|
304
|
+
const output = execSync(`git push "${remote}" "${tagName}" 2>&1`, {
|
|
305
|
+
cwd: process.cwd(),
|
|
306
|
+
timeout: 60_000,
|
|
307
|
+
encoding: 'utf-8',
|
|
308
|
+
stdio: 'pipe',
|
|
309
|
+
});
|
|
310
|
+
return {
|
|
311
|
+
success: true,
|
|
312
|
+
summary: `Pushed tag ${tagName} to ${remote}`,
|
|
313
|
+
details: output.trim(),
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
const error = err;
|
|
318
|
+
const msg = error.stderr || error.message || '';
|
|
319
|
+
if (msg.includes('403') || msg.includes('401') || msg.includes('auth')) {
|
|
320
|
+
return {
|
|
321
|
+
success: false,
|
|
322
|
+
summary: `Failed to push tag ${tagName}: authentication required`,
|
|
323
|
+
error: 'Set GITHUB_TOKEN or GH_TOKEN env var, or run credential setup',
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
success: false,
|
|
328
|
+
summary: `Failed to push tag ${tagName}`,
|
|
329
|
+
error: msg.slice(0, 200),
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
// ─── Auto-Push ────────────────────────────────────────────────────────────
|
|
334
|
+
async autoPush(context, callLLM) {
|
|
335
|
+
const commitResult = await this.commit(context, callLLM);
|
|
336
|
+
if (!commitResult.success) {
|
|
337
|
+
return commitResult;
|
|
338
|
+
}
|
|
339
|
+
const pushResult = await this.pushToRemote();
|
|
340
|
+
if (!pushResult.success) {
|
|
341
|
+
return {
|
|
342
|
+
success: false,
|
|
343
|
+
summary: `${commitResult.summary} but push failed: ${pushResult.error || pushResult.summary}`,
|
|
344
|
+
details: `Committed locally. Push failed. Ensure git credentials are configured.`,
|
|
345
|
+
error: pushResult.error,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
success: true,
|
|
350
|
+
summary: `${commitResult.summary} and pushed to remote`,
|
|
351
|
+
details: [commitResult.details || '', pushResult.details || ''].filter(Boolean).join('\n'),
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
// ─── PR Description ───────────────────────────────────────────────────────
|
|
144
355
|
async generatePRDescription(context, callLLM) {
|
|
145
356
|
const diff = this.exec('git diff main...HEAD --stat');
|
|
146
357
|
const fullDiff = this.exec('git diff main...HEAD');
|
|
147
|
-
const prompt = `Generate a GitHub pull request description from the following diff.
|
|
148
|
-
|
|
149
|
-
## Diff (truncated)
|
|
150
|
-
${fullDiff.slice(0, 4000)}
|
|
151
|
-
|
|
152
|
-
## Format
|
|
153
|
-
### Summary
|
|
154
|
-
[1-2 sentences describing the change]
|
|
155
|
-
|
|
156
|
-
### Changes
|
|
157
|
-
- [list of files changed and why]
|
|
158
|
-
|
|
159
|
-
### Testing
|
|
160
|
-
- [how to test this change]
|
|
161
|
-
|
|
162
|
-
### Related Issues
|
|
163
|
-
- [if applicable]`;
|
|
358
|
+
const prompt = `Generate a GitHub pull request description from the following diff.\n\n## Diff (truncated)\n${fullDiff.slice(0, 4000)}\n\n## Format\n### Summary\n[1-2 sentences describing the change]\n\n### Changes\n- [list of files changed and why]\n\n### Testing\n- [how to test this change]\n\n### Related Issues\n- [if applicable]`;
|
|
164
359
|
let description;
|
|
165
360
|
try {
|
|
166
361
|
description = await callLLM(prompt, { temperature: 0.3, maxTokens: 1500 });
|
|
@@ -175,6 +370,7 @@ ${fullDiff.slice(0, 4000)}
|
|
|
175
370
|
details: description,
|
|
176
371
|
};
|
|
177
372
|
}
|
|
373
|
+
// ─── Exec Helper (Cross-Platform) ─────────────────────────────────────────
|
|
178
374
|
exec(command, cwd) {
|
|
179
375
|
try {
|
|
180
376
|
return execSync(command, {
|
|
@@ -186,13 +382,11 @@ ${fullDiff.slice(0, 4000)}
|
|
|
186
382
|
}
|
|
187
383
|
catch (err) {
|
|
188
384
|
const error = err;
|
|
189
|
-
// Only swallow stderr for known non-fatal cases (e.g., no commits yet)
|
|
190
|
-
// Re-throw for genuine command failures
|
|
191
385
|
const msg = error.stderr || error.message || '';
|
|
192
|
-
if (msg.includes('Command failed') || msg.includes('not found') || msg.includes('not a git repository')
|
|
386
|
+
if (msg.includes('Command failed') || msg.includes('not found') || msg.includes('not a git repository') ||
|
|
387
|
+
msg.includes('not recognized') || msg.includes('cannot find') || msg.includes('failed to start')) {
|
|
193
388
|
throw new Error(msg.slice(0, 200));
|
|
194
389
|
}
|
|
195
|
-
// Return available output (maybe partial git log worked)
|
|
196
390
|
return error.stdout || msg;
|
|
197
391
|
}
|
|
198
392
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-agent.js","sourceRoot":"","sources":["../../../src/agents/agents/git-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAuC,MAAM,aAAa,CAAC;AAIzE,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;8CAegB,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,IAAI,GAAG,KAAK,CAAC;IACb,WAAW,GAAG,6CAA6C,CAAC;IAErE,KAAK,CAAC,OAAO,CAAC,OAAqB,EAAE,OAAkB;QACrD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CACpC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,KAAK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AC;IACH,CAAC;CACF"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* - Build project
|
|
7
7
|
* - Generate changelog from git log
|
|
8
8
|
* - Publish to npm
|
|
9
|
+
* - Auto-setup npm auth from env vars or CredentialStore
|
|
10
|
+
* - Pre-publish checks (auth, build success, version consistency)
|
|
9
11
|
*
|
|
10
12
|
* Usage in task plans:
|
|
11
13
|
* ```json
|
|
@@ -25,6 +27,16 @@ export declare class PackageAgent extends Agent {
|
|
|
25
27
|
private detectBumpType;
|
|
26
28
|
private bumpVersion;
|
|
27
29
|
private build;
|
|
30
|
+
/**
|
|
31
|
+
* Check if npm auth is configured before publishing.
|
|
32
|
+
* Uses NPM_TOKEN env var, .npmrc, or sets up via CredentialStore.
|
|
33
|
+
*/
|
|
34
|
+
private checkNpmAuth;
|
|
35
|
+
/**
|
|
36
|
+
* Full publish pipeline: version bump -> build -> publish.
|
|
37
|
+
* Optionally sets up npm auth via CredentialStore if available.
|
|
38
|
+
*/
|
|
39
|
+
private fullPublish;
|
|
28
40
|
private publish;
|
|
29
41
|
private generateChangelog;
|
|
30
42
|
private parseNpmError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/agents/package-agent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"package-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/agents/package-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAuB7C;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IAgC9E,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,cAAc;YAOR,WAAW;YAsCX,KAAK;IAwBnB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAkCpB;;;OAGG;YACW,WAAW;YAgDX,OAAO;YAwBP,iBAAiB;IAuC/B,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,IAAI;CAiBb"}
|