Returns the session/new request that will be sent.
The returned object is a defensive copy, so mutating it does not change the builder.
Replaces the additional workspace roots for this session.
additionalDirectories expand the session's file-system scope without
changing cwd. Each path should be absolute.
Starts the session and returns an ActiveSession for prompting and reading
updates.
Call dispose() on the returned session when you no longer need update
routing, or use withSession(...) to scope disposal automatically.
Optionaloptions: SendRequestOptionsStarts the session, runs op, and disposes the active-session update
routing when op finishes or throws.
Builder for creating an
ActiveSession.Start from
ctx.buildSession("/absolute/cwd")for the common case, or pass a fullNewSessionRequesttoctx.buildSession(...)when the session needs MCP servers,_meta, or additional request fields. All paths in ACP payloads should be absolute.