tiny.acp.Options
Defined in client.
A caller states in one value passed to Client.init which program to start and how, and what limits, numbering and callbacks the conversation runs under.
API (11)
Fields and members
Public fields and members.
argsclientcommandcwdenvironmcp_serversobserverpermission_policyreader_limitstransfer_limitstransport_epoch
Source
Source: lib/acp/src/client.zig:178
zig
/// A caller states in one value passed to `Client.init` which program to start and how, and what/// limits, numbering and callbacks the conversation runs under. The structure provides the settings/// `Client.init` takes: the program and its arguments, directory and environment, the limits on/// reading and traffic, the caller's number for this client, and the caller's callbacks and lists./// `command`, `reader_limits`, `transfer_limits` and `transport_epoch` have no default./// `Client.init` copies the working directory and the list of arguments. The client keeps every/// other string, slice and the observer by reference, so each must stay valid while the client can/// use it.pub const Options = struct { /// The program to run. The string becomes the first entry of the child's argument list, and the /// field is required. command: []const u8, /// The longest line, in bytes, the client accepts from the agent. `Client.init` allocates the /// reader's buffer, this limit plus one byte, before the agent starts. /// `acp.default_reader_limits` sets 2 MiB. A longer line fails the call with /// `error.ReaderMessageCapacityExceeded`, and the client reads nothing more from the agent. reader_limits: reader.Limits, /// The caps on traffic, described at `TransferLimits`. Every cap must be above zero. transfer_limits: TransferLimits, /// A number the caller picks for this client, stamped on every update it delivers. The value /// must be nonzero, and `Client.init` returns `error.InvalidLimits` otherwise. Together with /// the update sequence, this number names each update the client delivers. The caller records /// each change of this number before starting the client. transport_epoch: u64, /// The arguments passed to the program after the command. The list defaults to none, and /// `Client.init` reads it only while starting the program. args: []const []const u8 = &.{}, /// The directory the agent runs in. `start` also names it to the agent in `session/new`. Null, /// the default, leaves the agent in the caller's working directory, and `start` then sends the /// caller's current directory. `Client.init` copies the string. cwd: ?[]const u8 = null, /// The name, title and version reported to the agent, described at `ClientInfo`. The field /// defaults to the `ClientInfo` defaults. client: ClientInfo = .{}, /// The MCP servers the agent is asked to start for the session, sent in `session/new` as /// `mcpServers`. The slice defaults to none. The slice is borrowed, and the client reads it /// each time `start` runs. mcp_servers: []const McpServer = &.{}, /// The lists the client checks to answer a permission request when the observer gives no /// answer. The default lists nothing, so every such request gets a reject option or the /// `cancelled` outcome. The lists are borrowed for the client's life. permission_policy: PermissionPolicy = .{}, /// The caller's callbacks for updates and permission decisions, described at `Observer`. The /// field defaults to null. With no observer, the first update or permission request fails the /// call with `error.MissingDurableObserver`. observer: ?Observer = null, /// The environment the agent starts with. Null, the default, passes the caller's current /// environment. environ: ?std.process.Environ = null,};Source: lib/acp/src/root.zig:73
zig
pub const Options = client.Options;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 11 |
| Version | 26.7.0 |
| Revision | daab053ee433 |