cli/pkg/process/actions.go
Snider 41270b2904 feat(process): add process management package with Core IPC
Add pkg/process for spawning, monitoring, and orchestrating external
processes with Core ACTION integration:

- Service with framework.ServiceRuntime integration
- ACTION messages: ProcessStarted, ProcessOutput, ProcessExited
- RingBuffer for output capture
- Runner for orchestration (RunAll, RunSequential, RunParallel)
- Dependency graph support for QA pipelines
- Global convenience functions following i18n patterns

Also add docs/pkg/PACKAGE_STANDARDS.md defining how to create Core
packages, using pkg/i18n as the reference implementation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:48:28 +00:00

37 lines
856 B
Go

package process
import "time"
// --- ACTION messages (broadcast via Core.ACTION) ---
// ActionProcessStarted is broadcast when a process begins execution.
type ActionProcessStarted struct {
ID string
Command string
Args []string
Dir string
PID int
}
// ActionProcessOutput is broadcast for each line of output.
// Subscribe to this for real-time streaming.
type ActionProcessOutput struct {
ID string
Line string
Stream Stream
}
// ActionProcessExited is broadcast when a process completes.
// Check ExitCode for success (0) or failure.
type ActionProcessExited struct {
ID string
ExitCode int
Duration time.Duration
Error error // Non-nil if failed to start or was killed
}
// ActionProcessKilled is broadcast when a process is terminated.
type ActionProcessKilled struct {
ID string
Signal string
}