Skip to content

Interface: IMakaioSession

Makaio Framework


Makaio Framework / contracts / IMakaioSession

Defined in: ../../../packages/contracts/src/session/types.ts:25

A makaio orchestration session.

Represents a logical conversation context that may span multiple agents and adapters over time. Sessions track which agents have participated and the overall lifecycle state.

Declared as an interface (rather than a plain type alias) to allow host-tier code to add host-owned fields via TypeScript declaration merging without touching framework source. Host consumers augment this interface inside a declare module '@makaio/contracts' block.

optional adapterId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:67

Adapter instance ID (machine/installation specific). Used to determine if native resume is possible.

z.infer.adapterId


optional adapterName?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:57

Adapter type name (e.g., ‘claude-code’, ‘codex-mcp’). Identifies the source adapter for native imports.

z.infer.adapterName


optional adapterSessionId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:62

Provider’s session ID. For native imports, this is the external tool’s session identifier.

z.infer.adapterSessionId


agents: object[]

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:22

Agents currently or previously attached to this session

adapterId: string

Adapter instance that owns this agent

adapterName: string

Adapter type name (e.g., ‘claude-code’, ‘copilot’)

optional adapterSessionId?: string

Provider’s session ID for native resume support

agentId: string

Unique agent execution unit ID (stable across connector swaps and restarts)

optional clientId?: string

Client identifier for the client application this agent runs under (e.g., ‘claude-code’, ‘codex’). Omit for API-only adapters.

optional compressionMode?: "manual" | "auto" | "off"

Compression mode for session context management.

createdAt: number

Timestamp when agent was created (= when added to session)

optional cwd?: string

Current working directory

optional harnessId?: string

Resolved harness ID for this agent.

lastActivityAt: number

Timestamp of last activity (message sent/received)

optional model?: string

Current model identifier

optional personaId?: string

Persona used to configure this agent (if any).

optional profileId?: string

Profile used to configure this agent (if any).

optional providerConfigId?: string

Provider config UUID for credential/endpoint resolution

role: "lead" | "member" = AgentRoleSchema

Agent’s role in the session

sessionId: string

Makaio session this agent belongs to

status: "active" | "idle" | "dead" | "disposed" = AgentStatusSchema

Agent lifecycle status

z.infer.agents


optional approvalPolicyOverride?: "always-ask" | "reject" | "full-access" | null

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:110

User-set approval policy override for this session. When set, takes precedence over the persona → profile → harness cascade. Null means “use the cascade” (default behavior).

z.infer.approvalPolicyOverride


optional branchKind?: "fork" | "branch" | "aside" | "subagent" | "compress" | "rewrite" | "coordinator"

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:52

Type of branch this session represents. Undefined for root sessions (not created from another session).

z.infer.branchKind


optional clientAccountId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:71

Canonical client account linked to this session.

z.infer.clientAccountId


optional clientId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:69

Client application this session is linked to (for example claude-code).

z.infer.clientId


createdAt: number

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:18

Timestamp when the session was created

z.infer.createdAt


optional executionTargetId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:103

Stamped execution target — set during first startAgent resolution.

z.infer.executionTargetId


optional forkPointMessageId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:47

Message ID where this session forked from parent. The last message that was copied from parent to this fork. Undefined for root sessions.

z.infer.forkPointMessageId


optional forkTransforms?: object

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:96

Fork transforms for context projection (fork sessions only). Contains removedMessageIds and appliedPipeline configuration.

optional appliedPipeline?: object[]

Pipeline steps to apply (must be ‘transformation’ category)

optional removedMessageIds?: string[]

Message IDs to exclude from projected context

optional segments?: object[]

Segment-based context curation policies. When present, supersedes removedMessageIds and appliedPipeline.

z.infer.forkTransforms


optional isImported?: boolean

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:91

Whether this session was imported from external source.

  • true: Imported (allow incremental re-imports)
  • false: Created by Makaio runtime (skip on import)

z.infer.isImported


optional isOrchestrated?: boolean

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:79

Whether this session has been modified by Makaio orchestration. False = native session, can use adapter’s native resume. True = Makaio modified history, must inject context.

z.infer.isOrchestrated


lastActivityAt: number

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:20

Timestamp of last activity in the session

z.infer.lastActivityAt


optional lastClientIdentityObservation?: object

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:73

Latest raw client identity observation persisted for the session.

clientId: string

kind: string

observedAt: number = EpochMillisecondsSchema

payload: Record<string, unknown> = JsonObjectSchema

source: string

z.infer.lastClientIdentityObservation


optional leadAgentId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:33

Lead agent ID (receives messages by default). Undefined if no agents yet.

z.infer.leadAgentId


optional parentSessionId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:35

Parent session ID (for forked sessions). Undefined for root sessions.

z.infer.parentSessionId


optional rootSessionId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:41

Root session ID for fork chains. Denormalized for efficient “find all sessions in family” queries. Undefined for root sessions (they ARE the root).

z.infer.rootSessionId


sessionId: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:16

Unique session identifier

z.infer.sessionId


optional spawningToolCallId?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:105

Tool call ID of the Agent/spawn_subagent invocation that spawned this session. Only present for subagent sessions.

z.infer.spawningToolCallId


status: "active" | "closed" | "archived" | "discovered"

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:31

Current session status.

  • 'active': Ongoing session, agent is running or paused.
  • 'closed': Completed session, no longer active.
  • 'archived': Manually archived by the user.
  • 'discovered': Stub created from log discovery; full import not yet done.

z.infer.status


optional summary?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:83

Session summary for search and context. Undefined until generated.

z.infer.summary


optional summaryUpdatedAt?: number

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:85

Timestamp when summary was last updated. Used to detect staleness.

z.infer.summaryUpdatedAt


optional targetWorkingDirectory?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:101

Target working directory for this session. Used to override the default working directory for forked sessions.

z.infer.targetWorkingDirectory


optional title?: string

Defined in: ../../../packages/contracts/src/session/schemas/session.ts:81

Session title for sidebar display. Undefined until generated.

z.infer.title