Files
oh-my-pi/packages/coding-agent/src/session/foreign-session-store.ts
T
can1357 f11641d5a8 feat(coding-agent): enabled importing foreign sessions from claude and codex
- Implemented session stores and metadata converters to import Claude and Codex sessions into OMP.
- Added `--from-claude` and `--from-codex` CLI flags and `/resume` command arguments for foreign session resolution.
- Updated session selector components and controllers to support listing and picking external agent sessions.
- Added comprehensive unit tests and documentation covering foreign session import functionality.
2026-07-30 00:28:40 +02:00

27 lines
963 B
TypeScript

import type { SessionManager } from "./session-manager";
/** External coding-agent session source supported by OMP imports. */
export type ForeignSessionSource = "claude" | "codex";
/** Lightweight source metadata used to choose a foreign session before loading its transcript. */
export interface ForeignSessionInfo {
readonly source: ForeignSessionSource;
readonly id: string;
readonly path: string;
readonly cwd: string;
readonly title?: string;
readonly created: Date;
readonly modified: Date;
readonly messageCount?: number;
readonly firstMessage?: string;
}
/** Lists and converts sessions owned by another coding agent. */
export interface ForeignSessionStore {
readonly source: ForeignSessionSource;
/** Lists source sessions without parsing complete transcripts. */
list(): Promise<ForeignSessionInfo[]>;
/** Converts one source session into a non-persistent OMP session. */
load(session: ForeignSessionInfo): Promise<SessionManager>;
}