fork abstract method

Future<Session> fork(
  1. SessionMetadata source, {
  2. required String cwd,
  3. String? entryId,
  4. ForkPosition position,
  5. String? id,
  6. String? parentSessionPath,
  7. Map<String, dynamic>? metadata,
})

Forks source into a new session containing a prefix of its tree.

When entryId is given, the fork contains the branch ending at that entry (ForkPosition.at) or everything before it, which requires the entry to be a user message (ForkPosition.before, the default).

Implementation

Future<Session> fork(
  SessionMetadata source, {
  required String cwd,
  String? entryId,
  ForkPosition position,
  String? id,
  String? parentSessionPath,
  Map<String, dynamic>? metadata,
});