(wire: WireSession)
| 91 | } |
| 92 | |
| 93 | export function toAppSession(wire: WireSession): AppSession { |
| 94 | return { |
| 95 | id: wire.id, |
| 96 | title: wire.title, |
| 97 | createdAt: wire.created_at, |
| 98 | updatedAt: wire.updated_at, |
| 99 | status: toAppSessionStatus(wire.status), |
| 100 | archived: wire.archived ?? false, |
| 101 | currentPromptId: wire.current_prompt_id, |
| 102 | lastPrompt: wire.last_prompt, |
| 103 | cwd: wire.metadata.cwd, |
| 104 | model: wire.agent_config.model, |
| 105 | usage: toAppSessionUsage(wire.usage), |
| 106 | messageCount: wire.message_count, |
| 107 | lastSeq: wire.last_seq, |
| 108 | workspaceId: wire.workspace_id, |
| 109 | parentSessionId: |
| 110 | typeof wire.metadata['parent_session_id'] === 'string' |
| 111 | ? wire.metadata['parent_session_id'] |
| 112 | : undefined, |
| 113 | }; |
| 114 | } |
| 115 | |
| 116 | export function toAppWorkspace(wire: WireWorkspace): AppWorkspace { |
| 117 | return { |
no test coverage detected