Chat info: Session section with native id, resume command and export

The chat information sheet gains a Session section: the harness's native
session id (copy), harness, directory, a verified resume command (copy)
and Export conversation (Markdown), Export JSON and, for Claude Code,
Export native session (the JSONL transcript).

Server: chat_sessions rows carry resume_command and native_export; new
chat_export command builds Markdown/JSON from the same paged history
chat_messages serves (bounded at 8 MiB), refuses non-operator sessions.
App: exports go through the artifact file bridge (web download, share
sheet on phones).
This commit is contained in:
2026-11-03 10:59:41 +00:00
parent 6413fc5a90
commit 1de74f76bb
19 changed files with 1552 additions and 10 deletions
@@ -178,6 +178,20 @@ class ChatRepository {
gateway.call('chat_rename', {
'chat_rename': {'session_id': sessionId, 'title': title.trim()},
});
/// The chat as one file: `chat_export_file` with name, mime and content.
/// A reply without a file is refused rather than saved as an empty file.
Future<JsonMap> export(String sessionId, String format) async {
final reply = await gateway.call('chat_export', {
'chat_export': {'session_id': sessionId, 'format': format},
});
final file = reply['chat_export_file'];
if (file is! Map || '${file['name'] ?? ''}'.trim().isEmpty) {
throw StateError('The server did not return an export file.');
}
return file.cast<String, dynamic>();
}
Future<JsonMap> star(String sessionId, bool starred) =>
gateway.call('chat_star', {
'chat_query': {'session_id': sessionId, 'starred': starred},