Skip to main content

Crate ag_session

Crate ag_session 

Source
Expand description

Frontend-neutral session management, selection catalog, and session models.

Host applications implement SessionBackend to connect the stable programmatic API to their persistence, agent, Git, and forge workflows. Callers such as future orchestrator sessions use SessionService without depending on terminal UI state.

Structs§

AgentSelection
Session-level agent selection that keeps provider kind and model together.
AnswerQuestionsRequest
Structured input for resuming one session from clarification questions.
CoordinatorMessageRequest
Durable coordinator-owned turn submitted to one controller session.
CreateSessionRequest
Explicit input for creating one session.
OrchestrationPlanTask
Protocol-independent snapshot of one task proposed by an orchestration controller.
OrchestrationPolicy
Pure orchestration policy over typed task observations.
OrchestrationScheduleDecision
Pure scheduling decision derived from one orchestration task snapshot.
Personality
One enabled personality loaded from a workspace agent definition.
PersonalitySummary
Lightweight personality metadata stored in prompt-composer state.
Project
Persisted project metadata used for multi-project management.
ProjectListItem
Aggregated project snapshot for list and switcher views.
QuestionAnswer
One structured response to a persisted clarification question.
QuestionItem
One extracted question with predefined answer choices.
ReviewRequest
Persisted forge linkage for one session.
ReviewRequestSummary
Normalized remote summary for one linked review request.
Session
Complete persisted session aggregate returned by the programmatic API.
SessionId
Shared stable identifier for one session.
SessionMessage
One persisted transcript message for a session.
SessionMessageKindParseError
Error returned when a stored session message kind is unknown.
SessionService
Stable programmatic facade for session lifecycle operations.
SessionSettings
Complete session-scoped execution settings returned by the API.
SessionStats
Token and diff usage statistics associated with one agent session or isolated prompt.
SessionTranscript
Ordered transcript view assembled from persisted session messages.

Enums§

AgentKind
Supported agent provider families.
AgentModel
Supported agent model names across all providers.
CoordinatorMessageVisibility
Transcript treatment for one coordinator-owned prompt.
CreateSessionMode
Creation strategy for a new session.
FocusedReviewStatus
Durable state of one focused-review generation attempt.
ForgeKind
Shared forge family enum reused by persistence and forge adapters.
IntegrationApproach
User-selected destination for verified orchestration task branches.
OrchestrationStatus
Lifecycle state for one controller-owned orchestration.
OrchestrationTaskKind
Execution behavior for one persisted orchestration task.
OrchestrationTaskStatus
Lifecycle state for one orchestration task and its child session.
PermissionMode
Supported permission mode values for agent execution workflows.
PersonalityParseError
Error returned when one agent definition cannot be parsed safely.
ReasoningLevel
Supported reasoning-effort levels for task execution.
ResponseStyle
Preferred amount of detail in user-facing session responses.
ReviewRequestState
Normalized remote lifecycle state for one linked review request.
SessionDiffState
Known availability of a session worktree diff.
SessionError
Stable error returned by crate::SessionService operations.
SessionMessageKind
Durable category for one saved session transcript message.
SessionRole
Role one session plays in a multi-session workflow.
SessionStatus
High-level lifecycle state for one session.
SettingName
Stable keys used in the setting and project_setting tables.
SpeedMode
Response-speed preference applied to one agent session.
TranscriptNotice
Canonical labels for bracketed workflow notices appended to a session transcript.

Constants§

DEFAULT_AUTO_APPROVE_ORCHESTRATION_RESEARCH
Whether temporary read-only research waves start without plan approval.
DEFAULT_ORCHESTRATION_PARALLELISM
Default number of orchestration children allowed to run concurrently.
MAX_AUTOMATED_REVIEW_ITERATIONS
Maximum number of automatic focused-review remediation turns per managed worker settlement wave.
MAX_ORCHESTRATION_PARALLELISM
Maximum orchestration concurrency exposed by the settings selector.
PERSONALITY_PROMPT_MAX_BYTES
Maximum UTF-8 byte length retained for one personality prompt.

Traits§

AgentSelectionMetadata
Human-readable metadata for slash-menu selectable items.
SessionBackend
Host implementation boundary for session persistence and workflows.

Functions§

activity_day_key_with_offset
Converts Unix timestamp seconds to a day key after applying a UTC offset.
build_apply_review_prompt
Builds the agent-facing /apply prompt from focused-review suggestions.
default_option_index
Returns the initial highlighted option for a clarification question.
has_actionable_review_suggestions
Returns whether focused-review markdown contains suggestions that /apply can act on.
mru_project_order
Returns indices into project_items ordered most-recently-opened first.
normalized_message_content
Returns raw persisted message content with only outer whitespace removed.
ordered_project_items
Returns the project rows named by project_order, skipping stale indices.
parse_agent_definition
Parses one .agents agent definition.
parse_agent_summary
Parses lightweight picker metadata from one .agents agent definition.
parse_persisted_session_agent_model
Parses one persisted session agent/model pair without deriving the agent from the model when the saved agent kind is available.
project_name_from_path
Derives a readable project name from its filesystem path.
resolve_agent_kind_for_model
Resolves a provider kind that can run model from the available provider list.
resolve_agent_selection_for_model
Resolves an AgentSelection for a model-only setting.
resolve_model_for_available_agent_kinds
Resolves one model against the currently available agent kinds.
resolve_prompt_model_agent_kind
Resolves the agent kind used for prompt-side /model selection.
review_suggestions
Extracts actionable suggestion content from focused-review markdown.
selectable_models_for_agent_kinds
Returns all selectable models owned by the provided agent kinds in stable settings and slash-menu order.
session_branch
Returns the default worktree branch name for a session.
stored_message_content
Returns the durable message content for one kind.
validate_subtasks
Validates one proposed subtask set before application code persists it.