MCPcopy Create free account
hub / github.com/apache/maka / headerToSummary

Function headerToSummary

packages/runtime/src/session-manager.ts:6160–6198  ·  view source on GitHub ↗
(h: SessionHeader)

Source from the content-addressed store, hash-verified

6158// ============================================================================
6159
6160export function headerToSummary(h: SessionHeader): SessionSummary {
6161 const summary: SessionSummary = {
6162 id: h.id,
6163 cwd: h.cwd,
6164 ...(h.projectId !== undefined ? { projectId: h.projectId } : {}),
6165 name: h.name === 'New Session' ? DEFAULT_SESSION_NAME : h.name,
6166 isFlagged: h.isFlagged,
6167 isArchived: h.isArchived,
6168 labels: h.labels,
6169 hasUnread: h.hasUnread,
6170 status: h.status,
6171 ...(h.blockedReason ? { blockedReason: h.blockedReason } : {}),
6172 ...(h.statusUpdatedAt !== undefined ? { statusUpdatedAt: h.statusUpdatedAt } : {}),
6173 ...(h.parentSessionId ? { parentSessionId: h.parentSessionId } : {}),
6174 ...(h.branchOfTurnId ? { branchOfTurnId: h.branchOfTurnId } : {}),
6175 ...(h.subagentParent ? { subagentParent: h.subagentParent } : {}),
6176 ...(h.subagentRuntime
6177 ? { subagentRuntime: subagentSessionRuntimeSummary(h.subagentRuntime) }
6178 : {}),
6179 ...(h.subagentWorkspace ? { subagentWorkspace: h.subagentWorkspace } : {}),
6180 ...(h.revisionRootSessionId ? { revisionRootSessionId: h.revisionRootSessionId } : {}),
6181 ...(h.revisionParentSessionId ? { revisionParentSessionId: h.revisionParentSessionId } : {}),
6182 ...(h.revisionOfTurnId ? { revisionOfTurnId: h.revisionOfTurnId } : {}),
6183 ...(h.revisionIndex !== undefined ? { revisionIndex: h.revisionIndex } : {}),
6184 ...(h.revisionState ? { revisionState: h.revisionState } : {}),
6185 backend: h.backend,
6186 llmConnectionSlug: h.llmConnectionSlug,
6187 connectionLocked: h.connectionLocked,
6188 model: h.model,
6189 permissionMode: h.permissionMode ?? 'ask',
6190 collaborationMode: h.collaborationMode ?? 'agent',
6191 orchestrationMode: h.orchestrationMode ?? 'default',
6192 };
6193 if (h.thinkingLevel !== undefined) summary.thinkingLevel = h.thinkingLevel;
6194 if (h.lastMessageAt !== undefined) {
6195 summary.lastMessageAt = h.lastMessageAt;
6196 }
6197 return summary;
6198}
6199
6200function isNotFoundError(error: unknown): error is NodeJS.ErrnoException {
6201 return error instanceof Error && 'code' in error && error.code === 'ENOENT';

Callers 12

defaultCreateFunction · 0.90
coordinatorFixtureFunction · 0.90
catalogRecordFunction · 0.90
createSessionMethod · 0.85
setSessionStatusMethod · 0.85
commitRevisionVersionMethod · 0.85
setPermissionModeMethod · 0.85
setCollaborationModeMethod · 0.85
setOrchestrationModeMethod · 0.85
createRevisionSessionMethod · 0.85
createBranchSessionMethod · 0.85

Calls 1

Tested by 3

defaultCreateFunction · 0.72
coordinatorFixtureFunction · 0.72
catalogRecordFunction · 0.72