Docs assistant

Searches these docs locally; a configured answer service can generate responses.

Ask about this page or the wider Carina docs. Try: “How do I roll back a patch?”

llms.txt

Skip to content

Markdown

Sessions

Create, control, stream, and export Carina sessions.

A session binds conversation state, a permission profile, and a workspace root. Workspaces are bound at session.create via workspace_root — there is no separate registration method.

create → (pause / resume) → close
↘ submit tasks / stream events
↘ fork / checkpoint / goal
writelocal socket

Create a session bound to a workspace and permission profile.

Params

workspace_rootstringrequiredbody

Absolute path to the workspace directory. Bound for the life of the session.

profilestringbodydefault safe-edit

Permission profile name (e.g. safe-edit, read-only). Evaluated by the capability kernel.

Result

session_idstringrequired

Opaque session identifier used by subsequent session.* and task.* calls.

workspace_idstringrequired

Bound workspace id for the session.

profilestringrequired

Effective capability profile.

MethodPurpose
session.createCreate session with workspace + profile
session.get / session.listMetadata and active/archived listing
session.archive / session.unarchiveReversible archive and restore; active work is rejected
session.pause / session.resumeSuspend / continue
session.closeCompatibility alias for archive
session.replayReplay raw audit event stream
session.itemsNormalized item stream for UI/SDK
session.reviewGovernance projection over items
session.events.streamLive notifications (since cursor, event_mode)

JSONL / SQLite export is provided by audit.export (format: jsonl|sqlite), not a session.* method.

MethodPurpose
execution.startSubmit a prompt/task into a session
execution.cancelCancel a running task
execution.statusQuery task state
governance.action.approve / governance.action.denyResolve pending approval (optional role)

Task events are consumed through session.events.stream — there is no separate task event stream.

At most one goal per session:

goal.set / get / clear / pause / resume / complete / continue

  • goal.continue is an explicit, operator-triggered task submission
  • No unattended continuation loop
  • Fails closed while a task is in-flight, after continuation limit, or when token budget is exhausted
  • Interrupting an active TUI task pauses the goal

TUI: /goal [--tokens N] OBJECTIVE plus clear|pause|resume|complete|continue.

session.checkpoint.compact compacts only a paused task’s persisted latest checkpoint. It never aliases context.compress. Compaction is WAL-backed, idempotent on retry, and leaves the source checkpoint available.

TUI: /compact.

client.ts
import { CarinaClient } from '@nebutra/carina-sdk';
const client = await CarinaClient.connect();
const session = await client.sessions.create({
workspace_root: process.cwd(),
profile: 'safe-edit',
});
for await (const event of session.events()) {
console.log(event.type, event.payload);
}
  • Lifecycle notes: docs/tui-session-lifecycle.md
  • RPC families: session.* · goal.* · session.checkpoint.*
  • CLI: carina sessions · carina resume · carina items · carina session review
  • Related: JSON-RPC · Method catalog · Audit

Was this page helpful?

One vote per page is recorded during this session.