feat: Add agent preview integration with auto-teardown and simplified commands
- Add agentId label to preview containers (cw.agent-id) for tracking - Add startForAgent/stopByAgentId methods to PreviewManager - Auto-teardown: previews torn down on agent:stopped event - Conditional preview prompt injection for execute/refine/discuss agents - Agent-simplified CLI: cw preview start/stop --agent <id> - cw preview setup command with --auto mode for guided config generation - hasPreviewConfig hint on cw project register output - New tRPC procedures: startPreviewForAgent, stopPreviewByAgent
This commit is contained in:
@@ -128,6 +128,7 @@ export function generateLabels(opts: {
|
||||
gatewayPort: number;
|
||||
previewId: string;
|
||||
mode: 'preview' | 'dev';
|
||||
agentId?: string;
|
||||
}): Record<string, string> {
|
||||
const labels: Record<string, string> = {
|
||||
[PREVIEW_LABELS.preview]: 'true',
|
||||
@@ -143,5 +144,9 @@ export function generateLabels(opts: {
|
||||
labels[PREVIEW_LABELS.phaseId] = opts.phaseId;
|
||||
}
|
||||
|
||||
if (opts.agentId) {
|
||||
labels[PREVIEW_LABELS.agentId] = opts.agentId;
|
||||
}
|
||||
|
||||
return labels;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user