@radkode/neo 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +15 -112
- package/dist/cli.js.map +1 -1
- package/dist/commands/git/push/index.d.ts.map +1 -1
- package/dist/commands/git/push/index.js +3 -0
- package/dist/commands/git/push/index.js.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +3 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +29 -0
- package/dist/commands/init/index.js.map +1 -1
- package/dist/commands/work/finish/index.d.ts +22 -0
- package/dist/commands/work/finish/index.d.ts.map +1 -0
- package/dist/commands/work/finish/index.js +306 -0
- package/dist/commands/work/finish/index.js.map +1 -0
- package/dist/commands/work/index.d.ts +3 -0
- package/dist/commands/work/index.d.ts.map +1 -0
- package/dist/commands/work/index.js +33 -0
- package/dist/commands/work/index.js.map +1 -0
- package/dist/commands/work/ship/index.d.ts +27 -0
- package/dist/commands/work/ship/index.d.ts.map +1 -0
- package/dist/commands/work/ship/index.js +361 -0
- package/dist/commands/work/ship/index.js.map +1 -0
- package/dist/commands/work/start/index.d.ts +17 -0
- package/dist/commands/work/start/index.d.ts.map +1 -0
- package/dist/commands/work/start/index.js +250 -0
- package/dist/commands/work/start/index.js.map +1 -0
- package/dist/core/errors/index.d.ts +7 -129
- package/dist/core/errors/index.d.ts.map +1 -1
- package/dist/core/errors/index.js +0 -233
- package/dist/core/errors/index.js.map +1 -1
- package/dist/storage/db.d.ts +5 -3
- package/dist/storage/db.d.ts.map +1 -1
- package/dist/storage/db.js +87 -120
- package/dist/storage/db.js.map +1 -1
- package/dist/types/agent.d.ts +0 -8
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +1 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +1 -0
- package/dist/types/schemas.js.map +1 -1
- package/dist/utils/agent.js +1 -1
- package/dist/utils/agent.js.map +1 -1
- package/dist/utils/config.d.ts +0 -6
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +0 -8
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/logger.d.ts +8 -2
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +8 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/prompt.d.ts.map +1 -1
- package/dist/utils/prompt.js +15 -11
- package/dist/utils/prompt.js.map +1 -1
- package/dist/utils/skill-installer.d.ts +10 -0
- package/dist/utils/skill-installer.d.ts.map +1 -0
- package/dist/utils/skill-installer.js +56 -0
- package/dist/utils/skill-installer.js.map +1 -0
- package/package.json +6 -13
- package/templates/skills/neo/SKILL.md +66 -0
- package/dist/core/container/index.d.ts +0 -27
- package/dist/core/container/index.d.ts.map +0 -1
- package/dist/core/container/index.js +0 -90
- package/dist/core/container/index.js.map +0 -1
- package/dist/core/interfaces/index.d.ts +0 -324
- package/dist/core/interfaces/index.d.ts.map +0 -1
- package/dist/core/interfaces/index.js +0 -19
- package/dist/core/interfaces/index.js.map +0 -1
- package/dist/core/plugins/command-registry.d.ts +0 -16
- package/dist/core/plugins/command-registry.d.ts.map +0 -1
- package/dist/core/plugins/command-registry.js +0 -40
- package/dist/core/plugins/command-registry.js.map +0 -1
- package/dist/core/plugins/event-bus.d.ts +0 -12
- package/dist/core/plugins/event-bus.d.ts.map +0 -1
- package/dist/core/plugins/event-bus.js +0 -56
- package/dist/core/plugins/event-bus.js.map +0 -1
- package/dist/core/plugins/index.d.ts +0 -6
- package/dist/core/plugins/index.d.ts.map +0 -1
- package/dist/core/plugins/index.js +0 -6
- package/dist/core/plugins/index.js.map +0 -1
- package/dist/core/plugins/plugin-context.d.ts +0 -3
- package/dist/core/plugins/plugin-context.d.ts.map +0 -1
- package/dist/core/plugins/plugin-context.js +0 -116
- package/dist/core/plugins/plugin-context.js.map +0 -1
- package/dist/core/plugins/plugin-loader.d.ts +0 -30
- package/dist/core/plugins/plugin-loader.d.ts.map +0 -1
- package/dist/core/plugins/plugin-loader.js +0 -149
- package/dist/core/plugins/plugin-loader.js.map +0 -1
- package/dist/core/plugins/plugin-registry.d.ts +0 -21
- package/dist/core/plugins/plugin-registry.d.ts.map +0 -1
- package/dist/core/plugins/plugin-registry.js +0 -150
- package/dist/core/plugins/plugin-registry.js.map +0 -1
- package/dist/utils/ui-examples.d.ts +0 -3
- package/dist/utils/ui-examples.d.ts.map +0 -1
- package/dist/utils/ui-examples.js +0 -188
- package/dist/utils/ui-examples.js.map +0 -1
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { Command } from '@commander-js/extra-typings';
|
|
2
|
+
import { execa } from 'execa';
|
|
3
|
+
import { access, readdir } from 'node:fs/promises';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { ui } from '../../../utils/ui.js';
|
|
6
|
+
import { emitJson } from '../../../utils/output.js';
|
|
7
|
+
import { runAction } from '../../../utils/run-action.js';
|
|
8
|
+
import { getRuntimeContext } from '../../../utils/runtime-context.js';
|
|
9
|
+
import { NonInteractiveError } from '../../../utils/prompt.js';
|
|
10
|
+
import { GitErrors, isNotGitRepository, isAuthenticationError, isNetworkError, } from '../../../utils/git-errors.js';
|
|
11
|
+
import { executeVerify } from '../../verify/index.js';
|
|
12
|
+
import { executeChangeset } from '../../changeset/index.js';
|
|
13
|
+
import { executeAiPr } from '../../ai/pr/index.js';
|
|
14
|
+
import { isAICommitAvailable } from '../../../services/ai/index.js';
|
|
15
|
+
async function pathExists(p) {
|
|
16
|
+
try {
|
|
17
|
+
await access(p);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function detectDefaultBranch() {
|
|
25
|
+
try {
|
|
26
|
+
const { stdout } = await execa('git', ['symbolic-ref', 'refs/remotes/origin/HEAD']);
|
|
27
|
+
return stdout.replace('refs/remotes/origin/', '').trim();
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
for (const name of ['main', 'master']) {
|
|
31
|
+
try {
|
|
32
|
+
await execa('git', ['show-ref', '--verify', '--quiet', `refs/remotes/origin/${name}`]);
|
|
33
|
+
return name;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
throw new Error('Could not detect default branch. Pass --base <name>, or run `git remote set-head origin --auto`.');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function getCurrentBranch() {
|
|
43
|
+
const { stdout } = await execa('git', ['branch', '--show-current']);
|
|
44
|
+
return stdout.trim();
|
|
45
|
+
}
|
|
46
|
+
async function hasUncommittedChanges() {
|
|
47
|
+
const { stdout } = await execa('git', ['status', '--porcelain']);
|
|
48
|
+
return stdout.trim().length > 0;
|
|
49
|
+
}
|
|
50
|
+
async function countCommitsAhead(base) {
|
|
51
|
+
try {
|
|
52
|
+
const { stdout } = await execa('git', ['rev-list', '--count', `origin/${base}..HEAD`]);
|
|
53
|
+
return parseInt(stdout.trim(), 10) || 0;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function hasUpstream(branch) {
|
|
60
|
+
try {
|
|
61
|
+
await execa('git', ['rev-parse', '--abbrev-ref', `${branch}@{upstream}`], {
|
|
62
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
63
|
+
});
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function existingPrUrl() {
|
|
71
|
+
try {
|
|
72
|
+
const { stdout } = await execa('gh', ['pr', 'view', '--json', 'url', '-q', '.url'], {
|
|
73
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
74
|
+
});
|
|
75
|
+
const url = stdout.trim();
|
|
76
|
+
return url.length > 0 ? url : null;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async function ghInstalled() {
|
|
83
|
+
try {
|
|
84
|
+
await execa('gh', ['--version'], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function hasPendingChangeset(cwd) {
|
|
92
|
+
const dir = join(cwd, '.changeset');
|
|
93
|
+
if (!(await pathExists(dir)))
|
|
94
|
+
return null;
|
|
95
|
+
try {
|
|
96
|
+
const entries = await readdir(dir);
|
|
97
|
+
const match = entries.find((name) => name.endsWith('.md') && name.toLowerCase() !== 'readme.md');
|
|
98
|
+
return match ? join(dir, match) : null;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function getProjectRoot() {
|
|
105
|
+
const { stdout } = await execa('git', ['rev-parse', '--show-toplevel']);
|
|
106
|
+
return stdout.trim();
|
|
107
|
+
}
|
|
108
|
+
function inferPrTitle(branch, commits) {
|
|
109
|
+
const firstCommit = commits[0]?.trim();
|
|
110
|
+
if (firstCommit && firstCommit.length > 0)
|
|
111
|
+
return firstCommit;
|
|
112
|
+
const lastSegment = branch.split('/').pop() ?? branch;
|
|
113
|
+
return lastSegment.replace(/[-_]+/g, ' ');
|
|
114
|
+
}
|
|
115
|
+
async function getCommitSubjects(base) {
|
|
116
|
+
const { stdout } = await execa('git', [
|
|
117
|
+
'log',
|
|
118
|
+
`origin/${base}..HEAD`,
|
|
119
|
+
'--pretty=format:%s',
|
|
120
|
+
'--reverse',
|
|
121
|
+
]);
|
|
122
|
+
return stdout.split('\n').filter((line) => line.trim().length > 0);
|
|
123
|
+
}
|
|
124
|
+
function inferPrBody(commits) {
|
|
125
|
+
const lines = ['## Summary'];
|
|
126
|
+
if (commits.length <= 3) {
|
|
127
|
+
for (const c of commits)
|
|
128
|
+
lines.push(`- ${c}`);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
for (const c of commits.slice(0, 3))
|
|
132
|
+
lines.push(`- ${c}`);
|
|
133
|
+
lines.push(`- ... and ${commits.length - 3} more commit(s)`);
|
|
134
|
+
}
|
|
135
|
+
lines.push('', '## Test plan', '- [ ] Verify locally');
|
|
136
|
+
return lines.join('\n');
|
|
137
|
+
}
|
|
138
|
+
export async function executeWorkShip(options) {
|
|
139
|
+
try {
|
|
140
|
+
await execa('git', ['rev-parse', '--is-inside-work-tree']);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (isNotGitRepository(error))
|
|
144
|
+
throw GitErrors.notARepository('work ship');
|
|
145
|
+
throw GitErrors.unknown('work ship', error);
|
|
146
|
+
}
|
|
147
|
+
const ctx = getRuntimeContext();
|
|
148
|
+
const cwd = await getProjectRoot();
|
|
149
|
+
const branch = await getCurrentBranch();
|
|
150
|
+
if (!branch) {
|
|
151
|
+
throw new Error('Detached HEAD — check out a branch before running `neo work ship`.');
|
|
152
|
+
}
|
|
153
|
+
const base = options.base ?? (await detectDefaultBranch());
|
|
154
|
+
if (branch === base) {
|
|
155
|
+
throw new Error(`Already on base branch "${base}" — start a feature branch with \`neo work start <name>\`.`);
|
|
156
|
+
}
|
|
157
|
+
if (await hasUncommittedChanges()) {
|
|
158
|
+
throw new Error('You have uncommitted changes. Commit them first (`neo git commit --ai`), then re-run.');
|
|
159
|
+
}
|
|
160
|
+
const fetchSpinner = ui.spinner(`Fetching origin/${base}`);
|
|
161
|
+
fetchSpinner.start();
|
|
162
|
+
try {
|
|
163
|
+
await execa('git', ['fetch', 'origin', base]);
|
|
164
|
+
fetchSpinner.succeed(`Fetched origin/${base}`);
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
fetchSpinner.fail(`Fetch failed for origin/${base}`);
|
|
168
|
+
if (isAuthenticationError(error))
|
|
169
|
+
throw GitErrors.authenticationFailed('work ship');
|
|
170
|
+
if (isNetworkError(error))
|
|
171
|
+
throw GitErrors.networkError('work ship');
|
|
172
|
+
throw GitErrors.unknown('work ship', error);
|
|
173
|
+
}
|
|
174
|
+
const commitsAhead = await countCommitsAhead(base);
|
|
175
|
+
if (commitsAhead === 0) {
|
|
176
|
+
throw new Error(`Nothing to ship — ${branch} has no commits ahead of origin/${base}. Commit your changes first.`);
|
|
177
|
+
}
|
|
178
|
+
let verified = false;
|
|
179
|
+
let verifyDurationMs;
|
|
180
|
+
if (options.verify !== false) {
|
|
181
|
+
const vr = await executeVerify(cwd, {});
|
|
182
|
+
verifyDurationMs = vr.totalDurationMs;
|
|
183
|
+
if (!vr.ok) {
|
|
184
|
+
throw new Error('Verify failed — fix the failing scripts before shipping.');
|
|
185
|
+
}
|
|
186
|
+
verified = true;
|
|
187
|
+
}
|
|
188
|
+
let changesetPath;
|
|
189
|
+
let changesetExisting = false;
|
|
190
|
+
if (options.changeset !== false) {
|
|
191
|
+
const existing = await hasPendingChangeset(cwd);
|
|
192
|
+
if (existing) {
|
|
193
|
+
changesetPath = existing;
|
|
194
|
+
changesetExisting = true;
|
|
195
|
+
ui.muted(`Using existing changeset: ${existing}`);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
const cs = await executeChangeset(cwd, {
|
|
199
|
+
...(options.bump !== undefined ? { bump: options.bump } : {}),
|
|
200
|
+
...(options.summary !== undefined ? { summary: options.summary } : {}),
|
|
201
|
+
...(options.package !== undefined ? { package: options.package } : {}),
|
|
202
|
+
});
|
|
203
|
+
changesetPath = cs.path;
|
|
204
|
+
await execa('git', ['add', cs.path]);
|
|
205
|
+
try {
|
|
206
|
+
await execa('git', ['commit', '--amend', '--no-edit', '-n']);
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
await execa('git', ['commit', '-n', '-m', 'chore: add changeset']);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
let pushed = false;
|
|
214
|
+
const pushSpinner = ui.spinner(`Pushing ${branch} to origin`);
|
|
215
|
+
pushSpinner.start();
|
|
216
|
+
try {
|
|
217
|
+
const pushArgs = (await hasUpstream(branch))
|
|
218
|
+
? ['push', '--force-with-lease', 'origin', branch]
|
|
219
|
+
: ['push', '-u', 'origin', branch];
|
|
220
|
+
await execa('git', pushArgs);
|
|
221
|
+
pushSpinner.succeed(`Pushed ${branch}`);
|
|
222
|
+
pushed = true;
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
pushSpinner.fail('Push failed');
|
|
226
|
+
if (isAuthenticationError(error))
|
|
227
|
+
throw GitErrors.authenticationFailed('work ship');
|
|
228
|
+
if (isNetworkError(error))
|
|
229
|
+
throw GitErrors.networkError('work ship');
|
|
230
|
+
throw GitErrors.unknown('work ship', error);
|
|
231
|
+
}
|
|
232
|
+
let prUrl;
|
|
233
|
+
let prCreated = false;
|
|
234
|
+
if (!(await ghInstalled())) {
|
|
235
|
+
ui.warn('gh CLI not found — skipping PR creation. Install from https://cli.github.com.');
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
const existing = await existingPrUrl();
|
|
239
|
+
if (existing) {
|
|
240
|
+
prUrl = existing;
|
|
241
|
+
ui.muted(`PR already exists: ${existing}`);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
const wantAiPr = options.aiPr !== false && (await isAICommitAvailable());
|
|
245
|
+
if (wantAiPr) {
|
|
246
|
+
if (ctx.nonInteractive && !ctx.yes) {
|
|
247
|
+
throw new NonInteractiveError('PR creation needs confirmation (neo work ship)', '--yes (or --no-ai-pr to skip AI generation)');
|
|
248
|
+
}
|
|
249
|
+
const pr = await executeAiPr({
|
|
250
|
+
base,
|
|
251
|
+
create: true,
|
|
252
|
+
...(options.draft ? { draft: true } : {}),
|
|
253
|
+
});
|
|
254
|
+
prUrl = pr.prUrl;
|
|
255
|
+
prCreated = pr.created;
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
const commitSubjects = await getCommitSubjects(base);
|
|
259
|
+
const title = inferPrTitle(branch, commitSubjects);
|
|
260
|
+
const body = inferPrBody(commitSubjects);
|
|
261
|
+
const createSpinner = ui.spinner('Creating PR (inferred title + body)');
|
|
262
|
+
createSpinner.start();
|
|
263
|
+
try {
|
|
264
|
+
const args = ['pr', 'create', '--base', base, '--title', title, '--body', body];
|
|
265
|
+
if (options.draft)
|
|
266
|
+
args.push('--draft');
|
|
267
|
+
const { stdout } = await execa('gh', args);
|
|
268
|
+
const url = stdout.trim().split('\n').pop() ?? '';
|
|
269
|
+
createSpinner.succeed(`Created PR: ${url}`);
|
|
270
|
+
prUrl = url;
|
|
271
|
+
prCreated = true;
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
createSpinner.fail('Failed to create PR');
|
|
275
|
+
const stderr = error.stderr ?? '';
|
|
276
|
+
if (stderr)
|
|
277
|
+
ui.muted(stderr.trim().split('\n').slice(-10).join('\n'));
|
|
278
|
+
throw new Error('gh pr create failed. Fix the issue and re-run, or open the PR manually.');
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const result = {
|
|
284
|
+
branch,
|
|
285
|
+
base,
|
|
286
|
+
verified,
|
|
287
|
+
pushed,
|
|
288
|
+
prCreated,
|
|
289
|
+
changesetExisting,
|
|
290
|
+
commits: commitsAhead,
|
|
291
|
+
};
|
|
292
|
+
if (verifyDurationMs !== undefined)
|
|
293
|
+
result.verifyDurationMs = verifyDurationMs;
|
|
294
|
+
if (prUrl !== undefined)
|
|
295
|
+
result.prUrl = prUrl;
|
|
296
|
+
if (changesetPath !== undefined)
|
|
297
|
+
result.changesetPath = changesetPath;
|
|
298
|
+
return result;
|
|
299
|
+
}
|
|
300
|
+
export function createWorkShipCommand() {
|
|
301
|
+
const command = new Command('ship');
|
|
302
|
+
command
|
|
303
|
+
.description('Ship the current branch: verify → ensure changeset → push → open PR')
|
|
304
|
+
.option('--base <branch>', 'base branch (default: origin HEAD)')
|
|
305
|
+
.option('--no-verify', 'skip the verify step')
|
|
306
|
+
.option('--no-changeset', 'skip changeset creation')
|
|
307
|
+
.option('--no-ai-pr', 'do not use AI for PR description (inferred title + minimal body)')
|
|
308
|
+
.option('--draft', 'open the PR as a draft')
|
|
309
|
+
.option('--bump <level>', 'changeset bump level (major|minor|patch|empty)')
|
|
310
|
+
.option('--summary <text>', 'changeset summary')
|
|
311
|
+
.option('--package <names>', 'comma-separated package names (monorepos)')
|
|
312
|
+
.addHelpText('after', `
|
|
313
|
+
Examples:
|
|
314
|
+
Ship the current branch interactively:
|
|
315
|
+
$ neo work ship
|
|
316
|
+
|
|
317
|
+
Skip verify (iterating fast):
|
|
318
|
+
$ neo work ship --no-verify
|
|
319
|
+
|
|
320
|
+
Agent-friendly (non-AI PR, minor bump changeset):
|
|
321
|
+
$ neo work ship --yes --no-ai-pr --bump minor --summary "Add foo" --json
|
|
322
|
+
|
|
323
|
+
Draft PR:
|
|
324
|
+
$ neo work ship --draft
|
|
325
|
+
`)
|
|
326
|
+
.action(runAction(async (options) => {
|
|
327
|
+
const result = await executeWorkShip(options);
|
|
328
|
+
emitJson({
|
|
329
|
+
ok: true,
|
|
330
|
+
command: 'work ship',
|
|
331
|
+
branch: result.branch,
|
|
332
|
+
base: result.base,
|
|
333
|
+
verified: result.verified,
|
|
334
|
+
verifyDurationMs: result.verifyDurationMs,
|
|
335
|
+
pushed: result.pushed,
|
|
336
|
+
commits: result.commits,
|
|
337
|
+
prUrl: result.prUrl,
|
|
338
|
+
prCreated: result.prCreated,
|
|
339
|
+
changesetPath: result.changesetPath,
|
|
340
|
+
changesetExisting: result.changesetExisting,
|
|
341
|
+
}, {
|
|
342
|
+
text: () => {
|
|
343
|
+
ui.newline();
|
|
344
|
+
if (result.prUrl) {
|
|
345
|
+
ui.success(result.prCreated
|
|
346
|
+
? `Shipped ${result.branch} → PR opened: ${result.prUrl}`
|
|
347
|
+
: `Shipped ${result.branch} → existing PR: ${result.prUrl}`);
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
ui.success(`Shipped ${result.branch} (no PR created — gh unavailable)`);
|
|
351
|
+
}
|
|
352
|
+
if (result.changesetPath) {
|
|
353
|
+
const tag = result.changesetExisting ? 'kept' : 'added';
|
|
354
|
+
ui.muted(`Changeset ${tag}: ${result.changesetPath}`);
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
}));
|
|
359
|
+
return command;
|
|
360
|
+
}
|
|
361
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/work/ship/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,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AAM,CAAC,aAAa,EAAE,CAAC;oBACzB,MAAM,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;oBACxD,EAAE,CAAC,KAAK,CAAC,aAAa,GAAG,KAAK,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;gBACxD,CAAC;YACH,CAAC;SACF,CACF,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEJ,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@commander-js/extra-typings';
|
|
2
|
+
interface WorkStartOptions {
|
|
3
|
+
prefix?: string | false;
|
|
4
|
+
from?: string;
|
|
5
|
+
worktree?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface WorkStartResult {
|
|
8
|
+
branch: string;
|
|
9
|
+
base: string;
|
|
10
|
+
worktreePath?: string;
|
|
11
|
+
previousBranch: string;
|
|
12
|
+
contextRecorded: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function executeWorkStart(rawName: string, options: WorkStartOptions): Promise<WorkStartResult>;
|
|
15
|
+
export declare function createWorkStartCommand(): Command;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/work/start/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAgBtD,UAAU,gBAAgB;IAMxB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;CAC1B;AA4HD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAoF1B;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAgEhD"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { Command } from '@commander-js/extra-typings';
|
|
2
|
+
import { execa } from 'execa';
|
|
3
|
+
import { access } from 'node:fs/promises';
|
|
4
|
+
import { resolve } from 'node:path';
|
|
5
|
+
import { ui } from '../../../utils/ui.js';
|
|
6
|
+
import { emitJson } from '../../../utils/output.js';
|
|
7
|
+
import { runAction } from '../../../utils/run-action.js';
|
|
8
|
+
import { GitErrors, isNotGitRepository, isAuthenticationError, isNetworkError, } from '../../../utils/git-errors.js';
|
|
9
|
+
import { getProjectRoot, isAgentInitialized, getAgentDbPath } from '../../../utils/agent.js';
|
|
10
|
+
import { ContextDB } from '../../../storage/db.js';
|
|
11
|
+
async function pathExists(p) {
|
|
12
|
+
try {
|
|
13
|
+
await access(p);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function detectDefaultBranch() {
|
|
21
|
+
try {
|
|
22
|
+
const { stdout } = await execa('git', ['symbolic-ref', 'refs/remotes/origin/HEAD']);
|
|
23
|
+
return stdout.replace('refs/remotes/origin/', '').trim();
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
for (const name of ['main', 'master']) {
|
|
27
|
+
try {
|
|
28
|
+
await execa('git', ['show-ref', '--verify', '--quiet', `refs/remotes/origin/${name}`]);
|
|
29
|
+
return name;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
throw new Error('Could not detect default branch. Pass --from <ref>, or run `git remote set-head origin --auto`.');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function getCurrentBranch() {
|
|
39
|
+
const { stdout } = await execa('git', ['branch', '--show-current']);
|
|
40
|
+
return stdout.trim();
|
|
41
|
+
}
|
|
42
|
+
async function readGitUserName() {
|
|
43
|
+
try {
|
|
44
|
+
const { stdout } = await execa('git', ['config', '--get', 'user.name']);
|
|
45
|
+
const trimmed = stdout.trim();
|
|
46
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function userNameToPrefix(userName) {
|
|
53
|
+
const firstToken = userName.trim().split(/\s+/)[0] ?? '';
|
|
54
|
+
const normalized = firstToken.toLowerCase().replace(/[^a-z0-9-]/g, '');
|
|
55
|
+
return normalized.length > 0 ? normalized : null;
|
|
56
|
+
}
|
|
57
|
+
async function resolveBranchName(raw, options) {
|
|
58
|
+
const trimmed = raw.trim();
|
|
59
|
+
if (trimmed.length === 0) {
|
|
60
|
+
throw new Error('Branch name is required.');
|
|
61
|
+
}
|
|
62
|
+
if (options.prefix === false)
|
|
63
|
+
return trimmed;
|
|
64
|
+
if (trimmed.includes('/'))
|
|
65
|
+
return trimmed;
|
|
66
|
+
if (typeof options.prefix === 'string' && options.prefix.length > 0) {
|
|
67
|
+
const clean = options.prefix.replace(/\/+$/, '');
|
|
68
|
+
return `${clean}/${trimmed}`;
|
|
69
|
+
}
|
|
70
|
+
const userName = await readGitUserName();
|
|
71
|
+
const derived = userName ? userNameToPrefix(userName) : null;
|
|
72
|
+
if (!derived) {
|
|
73
|
+
throw new Error('Could not derive a branch prefix from git user.name. Pass --prefix <name> or --no-prefix.');
|
|
74
|
+
}
|
|
75
|
+
return `${derived}/${trimmed}`;
|
|
76
|
+
}
|
|
77
|
+
async function branchExistsLocally(branch) {
|
|
78
|
+
try {
|
|
79
|
+
await execa('git', ['show-ref', '--verify', '--quiet', `refs/heads/${branch}`]);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async function recordWorkItemInAgentDb(payload) {
|
|
87
|
+
if (!(await isAgentInitialized()))
|
|
88
|
+
return false;
|
|
89
|
+
const dbPath = await getAgentDbPath();
|
|
90
|
+
if (!dbPath)
|
|
91
|
+
return false;
|
|
92
|
+
let db = null;
|
|
93
|
+
try {
|
|
94
|
+
db = await ContextDB.create(dbPath);
|
|
95
|
+
db.addContext({
|
|
96
|
+
content: JSON.stringify({
|
|
97
|
+
kind: 'work-item',
|
|
98
|
+
branch: payload.branch,
|
|
99
|
+
base: payload.base,
|
|
100
|
+
worktreePath: payload.worktreePath ?? null,
|
|
101
|
+
createdAt: new Date().toISOString(),
|
|
102
|
+
}),
|
|
103
|
+
tags: ['work-item', 'active', `branch:${payload.branch}`],
|
|
104
|
+
priority: 'medium',
|
|
105
|
+
});
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
finally {
|
|
112
|
+
db?.close();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export async function executeWorkStart(rawName, options) {
|
|
116
|
+
try {
|
|
117
|
+
await execa('git', ['rev-parse', '--is-inside-work-tree']);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
if (isNotGitRepository(error))
|
|
121
|
+
throw GitErrors.notARepository('work start');
|
|
122
|
+
throw GitErrors.unknown('work start', error);
|
|
123
|
+
}
|
|
124
|
+
const previousBranch = await getCurrentBranch();
|
|
125
|
+
const branch = await resolveBranchName(rawName, options);
|
|
126
|
+
if (await branchExistsLocally(branch)) {
|
|
127
|
+
throw new Error(`Branch "${branch}" already exists locally. Run \`git checkout ${branch}\` to switch to it.`);
|
|
128
|
+
}
|
|
129
|
+
const base = options.from ?? `origin/${await detectDefaultBranch()}`;
|
|
130
|
+
if (base.startsWith('origin/')) {
|
|
131
|
+
const remoteBranch = base.replace(/^origin\//, '');
|
|
132
|
+
const fetchSpinner = ui.spinner(`Fetching ${base}`);
|
|
133
|
+
fetchSpinner.start();
|
|
134
|
+
try {
|
|
135
|
+
await execa('git', ['fetch', 'origin', remoteBranch]);
|
|
136
|
+
fetchSpinner.succeed(`Fetched ${base}`);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
fetchSpinner.fail(`Fetch failed for ${base}`);
|
|
140
|
+
if (isAuthenticationError(error))
|
|
141
|
+
throw GitErrors.authenticationFailed('work start');
|
|
142
|
+
if (isNetworkError(error))
|
|
143
|
+
throw GitErrors.networkError('work start');
|
|
144
|
+
throw GitErrors.unknown('work start', error);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
let worktreePath;
|
|
148
|
+
if (options.worktree) {
|
|
149
|
+
const projectRoot = (await getProjectRoot()) ?? (await execa('git', ['rev-parse', '--show-toplevel'])).stdout.trim();
|
|
150
|
+
const lastSegment = branch.split('/').pop() ?? branch;
|
|
151
|
+
const wtAbs = resolve(projectRoot, '.worktrees', lastSegment);
|
|
152
|
+
if (await pathExists(wtAbs)) {
|
|
153
|
+
throw new Error(`Worktree path already exists: ${wtAbs}`);
|
|
154
|
+
}
|
|
155
|
+
const wtSpinner = ui.spinner(`Creating worktree at .worktrees/${lastSegment}`);
|
|
156
|
+
wtSpinner.start();
|
|
157
|
+
try {
|
|
158
|
+
await execa('git', ['worktree', 'add', '-b', branch, wtAbs, base]);
|
|
159
|
+
wtSpinner.succeed(`Created worktree at .worktrees/${lastSegment}`);
|
|
160
|
+
worktreePath = wtAbs;
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
wtSpinner.fail('Worktree creation failed');
|
|
164
|
+
throw GitErrors.unknown('work start', error);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
const coSpinner = ui.spinner(`Creating branch ${branch} from ${base}`);
|
|
169
|
+
coSpinner.start();
|
|
170
|
+
try {
|
|
171
|
+
await execa('git', ['checkout', '-b', branch, base]);
|
|
172
|
+
coSpinner.succeed(`Created branch ${branch} from ${base}`);
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
coSpinner.fail('Branch creation failed');
|
|
176
|
+
throw GitErrors.unknown('work start', error);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const contextRecorded = await recordWorkItemInAgentDb({
|
|
180
|
+
branch,
|
|
181
|
+
base,
|
|
182
|
+
...(worktreePath !== undefined ? { worktreePath } : {}),
|
|
183
|
+
});
|
|
184
|
+
const result = {
|
|
185
|
+
branch,
|
|
186
|
+
base,
|
|
187
|
+
previousBranch,
|
|
188
|
+
contextRecorded,
|
|
189
|
+
};
|
|
190
|
+
if (worktreePath !== undefined)
|
|
191
|
+
result.worktreePath = worktreePath;
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
export function createWorkStartCommand() {
|
|
195
|
+
const command = new Command('start');
|
|
196
|
+
command
|
|
197
|
+
.description('Start a new piece of work: create a prefixed branch (and optionally a worktree)')
|
|
198
|
+
.argument('<name>', 'branch name (e.g. fix-login-redirect or CLRK-123-fix-login)')
|
|
199
|
+
.option('--prefix <name>', 'branch prefix (default: lowercased first token of git user.name)')
|
|
200
|
+
.option('--no-prefix', 'skip automatic prefixing')
|
|
201
|
+
.option('--from <ref>', 'base ref (default: origin/<default-branch>)')
|
|
202
|
+
.option('--worktree', 'create under .worktrees/<name>/ instead of checking out in place')
|
|
203
|
+
.addHelpText('after', `
|
|
204
|
+
Examples:
|
|
205
|
+
New branch off origin/main with auto prefix:
|
|
206
|
+
$ neo work start fix-login-redirect
|
|
207
|
+
# → creates jacek/fix-login-redirect (for user jacek)
|
|
208
|
+
|
|
209
|
+
Start in a worktree (keeps your current branch intact):
|
|
210
|
+
$ neo work start fix-login-redirect --worktree
|
|
211
|
+
|
|
212
|
+
Override the prefix:
|
|
213
|
+
$ neo work start 123-auth-bug --prefix team
|
|
214
|
+
|
|
215
|
+
From a specific ref:
|
|
216
|
+
$ neo work start experiment --from origin/develop
|
|
217
|
+
|
|
218
|
+
Agent-friendly:
|
|
219
|
+
$ neo work start fix-foo --yes --json
|
|
220
|
+
`)
|
|
221
|
+
.action(runAction(async (name, options) => {
|
|
222
|
+
const result = await executeWorkStart(name, options);
|
|
223
|
+
emitJson({
|
|
224
|
+
ok: true,
|
|
225
|
+
command: 'work start',
|
|
226
|
+
branch: result.branch,
|
|
227
|
+
base: result.base,
|
|
228
|
+
worktreePath: result.worktreePath,
|
|
229
|
+
previousBranch: result.previousBranch,
|
|
230
|
+
contextRecorded: result.contextRecorded,
|
|
231
|
+
}, {
|
|
232
|
+
text: () => {
|
|
233
|
+
if (result.worktreePath) {
|
|
234
|
+
ui.newline();
|
|
235
|
+
ui.success(`Worktree ready: ${result.worktreePath}`);
|
|
236
|
+
ui.muted(` cd ${result.worktreePath}`);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
ui.newline();
|
|
240
|
+
ui.success(`On branch ${result.branch} (from ${result.base})`);
|
|
241
|
+
}
|
|
242
|
+
if (result.contextRecorded) {
|
|
243
|
+
ui.muted('Recorded work item in .neo/agent/contexts.json');
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
}));
|
|
248
|
+
return command;
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/work/start/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,EAAE,EA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