acpd_io 1.0.0
acpd_io: ^1.0.0 copied to clipboard
dart:io transport implementations for acpd — Stdio, line-buffered codec, and AcpAgent process spawning.
acpd_io #
English · 简体中文
Production dart:io transports for acpd.
Features #
StdioTransportfor the current process or an externally managed process.AcpAgentsubprocess launch, process-tree cleanup, exit tracking, and bounded stderr tail.AcpAgentConfigcommand parsing, environment, working directory, JSON, and fluent configuration.- Line-delimited JSON framing with recoverable malformed-frame reporting.
- Optional inbound/outbound line tracing without changing protocol bytes.
Usage #
import 'package:acpd/acpd.dart';
import 'package:acpd_io/acpd_io.dart';
final agent = await AcpAgent.start(
const AcpAgentConfig(
command: 'my-acp-agent',
args: ['--stdio'],
),
);
final client = ClientRole().connect(agent.transport);
try {
// Initialize and use the ACP client.
} finally {
await client.close();
await agent.close();
}
This package supports Dart VM and native Flutter platforms. It does not support Web.
See the package example/ for a runnable command-line client.
License #
Apache License 2.0. See LICENSE.