Properties
required
The agent’s
cognition.ai/* capability flags (agentCapabilities._meta).JsonRpcConnection
required
required
The agent’s
initialize response (capabilities, auth methods).undefined | AgentRequestHandler
required
Type:
AgentRequestHandlerAnswer agent → client requests the SDK does not handle itself (anything
but session/request_permission). Without a handler — or when the
handler returns undefined — built-in defaults apply (diagnostics report
none) and other methods are declined with method not found.undefined | (notification: CognitionExtensionNotification) => void
required
Type:
CognitionExtensionNotificationObserve connection-scoped _cognition.ai/* notifications — those without
a sessionId (or one that matches no tracked session), e.g.
mcp/serversChanged and plugins/changed. Session-scoped notifications
go to the owning session’s onExtension instead.required
Which
session/prompt content blocks the agent accepts, and the cloud size limits.number
required
The ACP protocol version the agent settled on (
1 or 2).Methods
[asyncDispose]()
await using devin = … closes the client at scope exit, once the connection has shut down.
Returns
Promise<void>
assertNotOpen()
Parameters
string
required
attach()
session.events() or continue it with session.run().
Parameters
string
required
Returns
LocalSession
close()
connect()
start.
Parameters
RpcStreams
required
null | ChildProcess
Promise<never>
Returns
LocalDevin
createSession()
cwd).
Parameters
Returns
LocalSession
deleteSession()
Parameters
string
required
Returns
Promise<void>
extNotify()
_cognition.ai/* notification (no response).
Parameters
M
required
CognitionRequestParams<M>
required
Type:
CognitionRequestParams_cognition.ai/* notification (no response).
Parameters
string
required
unknown
extRequest()
_cognition.ai/* request. Typed when the method
is in the generated registry (CognitionAgentResponseMap); any other
_cognition.ai/* method is accepted untyped. For session-scoped methods
prefer AcpSession.extRequest, which fills in the session id.
Parameters
M
required
CognitionRequestParams<M>
required
Type:
CognitionRequestParamsReturns
CognitionRequestResult
_cognition.ai/* request. Typed when the method
is in the generated registry (CognitionAgentResponseMap); any other
_cognition.ai/* method is accepted untyped. For session-scoped methods
prefer AcpSession.extRequest, which fills in the session id.
Parameters
string
required
unknown
Returns
Promise<T>
handshake()
Parameters
JsonRpcConnection
required
Returns
InitializeResult
launchSession()
turn.accepted,
not the turn’s outcome. Cancel explicitly with session.cancel().
Startup errors after creation preserve sessionId; never retry blindly.
Parameters
required
LaunchSessionOptions<LocalSessionOptions, T> & { turn: RunOptions<T> & { output…
required
Returns
LaunchedSessionLocalSession
turn.accepted,
not the turn’s outcome. Cancel explicitly with session.cancel().
Startup errors after creation preserve sessionId; never retry blindly.
Parameters
required
LaunchSessionOptions<LocalSessionOptions, unknown> & { turn: Omit<RunOptions<un…
Returns
LaunchedSessionLocalSession
turn.accepted,
not the turn’s outcome. Cancel explicitly with session.cancel().
Startup errors after creation preserve sessionId; never retry blindly.
Parameters
required
LaunchSessionOptions<LocalSessionOptions, T>
required
Returns
LaunchedSessionLocalSession
listSessions()
Parameters
Returns
SessionInfo
listSubagents()
cwd (defaults to the client-level cwd).
Parameters
string
Returns
SubagentsListResponse
loadSession()
model default applies only
to createSession; use session.setModel to switch.
Parameters
string
required
Returns
LoadedLocalSession
mcpServers()
Parameters
required
Returns
McpServer
openSession()
session/new follow-ups such as choosing the model or organization). A
failing request releases the session and surfaces as a
SessionStartupError carrying the allocated id.
Parameters
required
required
() => Promise<unknown>
Returns
LocalSession
releaseSession()
Parameters
string
required
resumeSession()
openSession, but the agent
replays history as session/update notifications before load settles;
those are captured and returned instead of being delivered live. Refuses
a session that is already open on this client, since loading it again
would steal its notification routing.
Parameters
required
required
() => Promise<unknown>
required
Returns
LoadedSessionLocalSession
spawn()
cliPath as devin acp with exactly env, and perform
the ACP initialize handshake. Unlike start this neither requires
an API key nor redirects the CLI’s state directories, for hosts whose CLI
is already authenticated (e.g. a sandbox).
Parameters
string
required
Omit<LocalDevinOptions, "apiKey" | "stateDir">
Type:
LocalDevinOptionsProcessEnv
Returns
LocalDevin
start()
devin acp and perform the ACP initialize handshake.
Parameters
Returns
LocalDevin
supports()
cognition.ai/* capability, e.g.
devin.supports("cognition.ai/sessionRename") before calling
session.rename().
Parameters
string
required
Returns
boolean
track()
Parameters
required
untrack()
Parameters
string
required

