Agent Client Protocol - v1.0.0
    Preparing search index...

    Class SessionBuilder

    Builder for creating an ActiveSession.

    Start from ctx.buildSession("/absolute/cwd") for the common case, or pass a full NewSessionRequest to ctx.buildSession(...) when the session needs MCP servers, _meta, or additional request fields. All paths in ACP payloads should be absolute.

    Index

    Methods

    • Replaces the additional workspace roots for this session.

      additionalDirectories expand the session's file-system scope without changing cwd. Each path should be absolute.

      Parameters

      • additionalDirectories: string[]

      Returns this

    • Adds one MCP server to the session/new request.

      Parameters

      Returns this

    • 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.

      Parameters

      Returns Promise<ActiveSession>