agent/pkg/agentic/pid_example_test.go
Snider 34010f6d35 feat(ax-10): bring agent to v0.8.0-alpha.1 + CLI test scaffold
- Bump dappco.re/go/* deps to v0.8.0-alpha.1 in go.mod (any forge.lthn.ai/core/* paths migrated to canonical dappco.re/go/* form)
- Update Go source imports across 29 .go files
- Add tests/cli/agent/Taskfile.yaml AX-10 scaffold (build/vet/test under default deps), per RFC-CORE-008-AGENT-EXPERIENCE.md §10

Co-Authored-By: Athena <athena@lthn.ai>
2026-04-24 23:48:34 +01:00

41 lines
949 B
Go

// SPDX-License-Identifier: EUPL-1.2
package agentic
import (
"context"
core "dappco.re/go/core"
"dappco.re/go/process"
)
func ExampleProcessAlive() {
r := testCore.Process().Start(context.Background(), core.NewOptions(
core.Option{Key: "command", Value: "sleep"},
core.Option{Key: "args", Value: []string{"1"}},
core.Option{Key: "detach", Value: true},
))
if !r.OK {
return
}
proc := r.Value.(*process.Process)
defer proc.Kill()
core.Println(ProcessAlive(testCore, proc.ID, proc.Info().PID))
// Output: true
}
func ExampleProcessTerminate() {
r := testCore.Process().Start(context.Background(), core.NewOptions(
core.Option{Key: "command", Value: "sleep"},
core.Option{Key: "args", Value: []string{"1"}},
core.Option{Key: "detach", Value: true},
))
if !r.OK {
return
}
proc := r.Value.(*process.Process)
defer proc.Kill()
core.Println(ProcessTerminate(testCore, proc.ID, proc.Info().PID))
// Output: true
}