@shepai/cli 1.19.0 → 1.20.1
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/eslint.config.mjs +4 -0
- package/dist/src/application/ports/output/agents/feature-agent-process.interface.d.ts +2 -1
- package/dist/src/application/ports/output/agents/feature-agent-process.interface.d.ts.map +1 -1
- package/dist/src/application/ports/output/agents/index.d.ts +1 -0
- package/dist/src/application/ports/output/agents/index.d.ts.map +1 -1
- package/dist/src/application/ports/output/agents/phase-timing-repository.interface.d.ts +44 -0
- package/dist/src/application/ports/output/agents/phase-timing-repository.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/agents/phase-timing-repository.interface.js +11 -0
- package/dist/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -1
- package/dist/src/application/use-cases/agents/approve-agent-run.use-case.js +6 -2
- package/dist/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -1
- package/dist/src/application/use-cases/agents/reject-agent-run.use-case.js +0 -1
- package/dist/src/application/use-cases/features/create/create-feature.use-case.d.ts +37 -0
- package/dist/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/{create-feature.use-case.js → create/create-feature.use-case.js} +22 -70
- package/dist/src/application/use-cases/features/create/metadata-generator.d.ts +28 -0
- package/dist/src/application/use-cases/features/create/metadata-generator.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/create/metadata-generator.js +109 -0
- package/dist/src/application/use-cases/features/create/slug-resolver.d.ts +24 -0
- package/dist/src/application/use-cases/features/create/slug-resolver.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/create/slug-resolver.js +66 -0
- package/dist/src/application/use-cases/features/create/types.d.ts +16 -0
- package/dist/src/application/use-cases/features/create/types.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/create/types.js +1 -0
- package/dist/src/application/use-cases/features/resume-feature.use-case.js +2 -2
- package/dist/src/domain/generated/output.d.ts +40 -6
- package/dist/src/domain/generated/output.d.ts.map +1 -1
- package/dist/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/src/infrastructure/di/container.js +12 -1
- package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts +1 -2
- package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts.map +1 -1
- package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.js +4 -4
- package/dist/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -1
- package/dist/src/infrastructure/persistence/sqlite/migrations.js +31 -0
- package/dist/src/infrastructure/repositories/agent-run.repository.d.ts.map +1 -1
- package/dist/src/infrastructure/repositories/agent-run.repository.js +5 -9
- package/dist/src/infrastructure/repositories/sqlite-phase-timing.repository.d.ts +21 -0
- package/dist/src/infrastructure/repositories/sqlite-phase-timing.repository.d.ts.map +1 -0
- package/dist/src/infrastructure/repositories/sqlite-phase-timing.repository.js +100 -0
- package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.js +2 -2
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +305 -13
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -1
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.js +124 -7
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +2 -1
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -1
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +2 -2
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +2 -1
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +19 -7
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.js +1 -1
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +11 -2
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +46 -15
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/repair.node.d.ts +23 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/repair.node.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/repair.node.js +77 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/plan.schema.d.ts +4 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/plan.schema.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/plan.schema.js +54 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/research.schema.d.ts +3 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/research.schema.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/research.schema.js +24 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/spec.schema.d.ts +4 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/spec.schema.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/spec.schema.js +50 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/validation.d.ts +8 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/validation.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/schemas/validation.js +36 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/validate.node.d.ts +12 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/validate.node.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/validate.node.js +58 -0
- package/dist/src/infrastructure/services/agents/feature-agent/phase-timing-context.d.ts +30 -0
- package/dist/src/infrastructure/services/agents/feature-agent/phase-timing-context.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/phase-timing-context.js +68 -0
- package/dist/src/infrastructure/services/agents/feature-agent/state.d.ts +5 -1
- package/dist/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -1
- package/dist/src/infrastructure/services/agents/feature-agent/state.js +14 -1
- package/dist/src/presentation/cli/commands/feat/approve.command.d.ts +12 -0
- package/dist/src/presentation/cli/commands/feat/approve.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/approve.command.js +48 -0
- package/dist/src/presentation/cli/commands/feat/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/index.js +7 -1
- package/dist/src/presentation/cli/commands/feat/ls.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/ls.command.js +13 -5
- package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/new.command.js +35 -16
- package/dist/src/presentation/cli/commands/feat/reject.command.d.ts +12 -0
- package/dist/src/presentation/cli/commands/feat/reject.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/reject.command.js +50 -0
- package/dist/src/presentation/cli/commands/feat/resolve-waiting-feature.d.ts +30 -0
- package/dist/src/presentation/cli/commands/feat/resolve-waiting-feature.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/resolve-waiting-feature.js +57 -0
- package/dist/src/presentation/cli/commands/feat/review.command.d.ts +12 -0
- package/dist/src/presentation/cli/commands/feat/review.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/review.command.js +49 -0
- package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/show.command.js +51 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/cache/.previewinfo +1 -1
- package/web/.next/cache/.rscinfo +1 -1
- package/web/.next/cache/config.json +3 -3
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.html +2 -2
- package/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/index.html +2 -2
- package/web/.next/server/app/index.rsc +1 -1
- package/web/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/version.html +2 -2
- package/web/.next/server/app/version.rsc +1 -1
- package/web/.next/server/app/version.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/version/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/version.segment.rsc +1 -1
- package/web/.next/server/chunks/ssr/_19be0743._.js +1 -1
- package/web/.next/server/pages/404.html +2 -2
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- package/dist/src/application/use-cases/features/create-feature.use-case.d.ts +0 -43
- package/dist/src/application/use-cases/features/create-feature.use-case.d.ts.map +0 -1
- /package/web/.next/static/{nw4IT0rr_mE5Tx22X9OgO → xKJulVMYO_ZRGoqa6eM7G}/_buildManifest.js +0 -0
- /package/web/.next/static/{nw4IT0rr_mE5Tx22X9OgO → xKJulVMYO_ZRGoqa6eM7G}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{nw4IT0rr_mE5Tx22X9OgO → xKJulVMYO_ZRGoqa6eM7G}/_ssgManifest.js +0 -0
|
@@ -18,7 +18,7 @@ function computeWorktreePath(repoPath, branch) {
|
|
|
18
18
|
const slug = branch.replace(/\//g, '-');
|
|
19
19
|
return join(SHEP_HOME_DIR, 'repos', repoHash, 'wt', slug);
|
|
20
20
|
}
|
|
21
|
-
/** Map graph node names to human-readable phase labels. */
|
|
21
|
+
/** Map graph node names to human-readable phase labels (active). */
|
|
22
22
|
const NODE_TO_PHASE = {
|
|
23
23
|
analyze: 'Analyzing',
|
|
24
24
|
requirements: 'Requirements',
|
|
@@ -26,14 +26,21 @@ const NODE_TO_PHASE = {
|
|
|
26
26
|
plan: 'Planning',
|
|
27
27
|
implement: 'Implementing',
|
|
28
28
|
};
|
|
29
|
+
/** Map graph node names to approval action labels. */
|
|
30
|
+
const NODE_TO_APPROVE = {
|
|
31
|
+
analyze: 'Approve Analysis',
|
|
32
|
+
requirements: 'Approve PRD',
|
|
33
|
+
research: 'Approve Research',
|
|
34
|
+
plan: 'Approve Plan',
|
|
35
|
+
implement: 'Approve Merge',
|
|
36
|
+
};
|
|
29
37
|
function formatStatus(feature, run) {
|
|
30
38
|
if (!run) {
|
|
31
39
|
return `${colors.muted(symbols.dotEmpty)} ${colors.muted(feature.lifecycle)}`;
|
|
32
40
|
}
|
|
33
41
|
const isRunning = run.status === 'running' || run.status === 'pending';
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
: feature.lifecycle;
|
|
42
|
+
const nodeName = run.result?.startsWith('node:') ? run.result.slice(5) : undefined;
|
|
43
|
+
const phase = nodeName ? (NODE_TO_PHASE[nodeName] ?? nodeName) : feature.lifecycle;
|
|
37
44
|
if (isRunning) {
|
|
38
45
|
if (run.pid && !isProcessAlive(run.pid)) {
|
|
39
46
|
return `${colors.error(symbols.error)} ${colors.error('crashed')}`;
|
|
@@ -44,8 +51,10 @@ function formatStatus(feature, run) {
|
|
|
44
51
|
return `${colors.success(symbols.success)} ${colors.success('Completed')}`;
|
|
45
52
|
if (run.status === 'failed')
|
|
46
53
|
return `${colors.error(symbols.error)} ${colors.error('Failed')}`;
|
|
47
|
-
if (run.status === 'waiting_approval')
|
|
48
|
-
|
|
54
|
+
if (run.status === 'waiting_approval') {
|
|
55
|
+
const action = nodeName ? (NODE_TO_APPROVE[nodeName] ?? phase) : phase;
|
|
56
|
+
return `${colors.warning(symbols.warning)} ${colors.warning(action)}`;
|
|
57
|
+
}
|
|
49
58
|
if (run.status === 'interrupted')
|
|
50
59
|
return `${colors.error(symbols.error)} ${colors.error('Interrupted')}`;
|
|
51
60
|
return `${colors.muted(symbols.dotEmpty)} ${colors.muted(phase)}`;
|
|
@@ -67,8 +76,10 @@ export function createShowCommand() {
|
|
|
67
76
|
try {
|
|
68
77
|
const useCase = container.resolve(ShowFeatureUseCase);
|
|
69
78
|
const runRepo = container.resolve('IAgentRunRepository');
|
|
79
|
+
const timingRepo = container.resolve('IPhaseTimingRepository');
|
|
70
80
|
const feature = await useCase.execute(featureId);
|
|
71
81
|
const run = feature.agentRunId ? await runRepo.findById(feature.agentRunId) : null;
|
|
82
|
+
const timings = feature.agentRunId ? await timingRepo.findByRunId(feature.agentRunId) : [];
|
|
72
83
|
const worktreePath = computeWorktreePath(feature.repositoryPath, feature.branch);
|
|
73
84
|
const formatTs = (ts) => {
|
|
74
85
|
if (ts instanceof Date)
|
|
@@ -92,6 +103,40 @@ export function createShowCommand() {
|
|
|
92
103
|
content: last5,
|
|
93
104
|
});
|
|
94
105
|
}
|
|
106
|
+
if (timings.length > 0) {
|
|
107
|
+
const isWaiting = run?.status === 'waiting_approval';
|
|
108
|
+
const maxDurationMs = Math.max(...timings.map((t) => (t.durationMs != null ? Number(t.durationMs) : 0)));
|
|
109
|
+
const MAX_BAR = 20;
|
|
110
|
+
const lines = timings.map((t) => {
|
|
111
|
+
const label = (NODE_TO_PHASE[t.phase] ?? t.phase).padEnd(16);
|
|
112
|
+
if (t.completedAt && t.durationMs != null) {
|
|
113
|
+
const ms = Number(t.durationMs);
|
|
114
|
+
const secs = (ms / 1000).toFixed(1);
|
|
115
|
+
const barLen = maxDurationMs > 0 ? Math.max(1, Math.round((ms / maxDurationMs) * MAX_BAR)) : 1;
|
|
116
|
+
const bar = `${colors.success('█'.repeat(barLen))}${colors.muted('░'.repeat(MAX_BAR - barLen))}`;
|
|
117
|
+
return `${label} ${bar} ${secs}s`;
|
|
118
|
+
}
|
|
119
|
+
if (isWaiting) {
|
|
120
|
+
return `${label} ${colors.warning('awaiting review')}`;
|
|
121
|
+
}
|
|
122
|
+
return `${label} ${colors.info('running...')}`;
|
|
123
|
+
});
|
|
124
|
+
textBlocks.push({ title: 'Phase Timing', content: lines.join('\n') });
|
|
125
|
+
}
|
|
126
|
+
if (run?.status === 'waiting_approval') {
|
|
127
|
+
const phase = run.result?.startsWith('node:')
|
|
128
|
+
? (NODE_TO_PHASE[run.result.slice(5)] ?? run.result.slice(5))
|
|
129
|
+
: 'current phase';
|
|
130
|
+
textBlocks.push({
|
|
131
|
+
title: 'Awaiting Approval',
|
|
132
|
+
content: [
|
|
133
|
+
`${phase} is waiting for your review.`,
|
|
134
|
+
'',
|
|
135
|
+
` ${colors.accent('shep feat approve')} Resume the agent`,
|
|
136
|
+
` ${colors.accent('shep feat reject')} Cancel with feedback`,
|
|
137
|
+
].join('\n'),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
95
140
|
renderDetailView({
|
|
96
141
|
title: `Feature: ${feature.name}`,
|
|
97
142
|
sections: [
|