feat: implement Phase 8 - Process Stdin
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m10s

Features added:
- Created stdin API route for sending input to process stdin
- Added useSendProcessStdin React Query hook
- Created StdinInput modal component with:
  - Multi-line textarea for input
  - Ctrl+Enter keyboard shortcut
  - Optional newline append
  - Character count display
  - Info banner explaining stdin functionality
- Added stdin button to ProcessCard (Terminal icon)
- Button only enabled when process is running (state === 20)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-23 19:46:47 +01:00
parent 68ec8dd3db
commit 4aa0c49372
4 changed files with 212 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
import { NextRequest, NextResponse } from 'next/server';
import { createSupervisorClient } from '@/lib/supervisor/client';
interface RouteParams {
params: Promise<{ name: string }>;
}
// POST - Send input to process stdin
export async function POST(request: NextRequest, { params }: RouteParams) {
try {
const { name } = await params;
const body = await request.json();
const { chars } = body;
if (chars === undefined || chars === null) {
return NextResponse.json(
{ error: 'Input characters are required' },
{ status: 400 }
);
}
const client = createSupervisorClient();
const result = await client.sendProcessStdin(name, chars);
return NextResponse.json({
success: result,
message: `Input sent to ${name}`,
});
} catch (error: any) {
console.error('Supervisor send stdin error:', error);
return NextResponse.json(
{ error: error.message || 'Failed to send input to process' },
{ status: 500 }
);
}
}