Files
pipelines/app/tool/chat_sessions_probe_entry.dart
T

63 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/chat/session_screen.dart';
class _FixtureGateway implements ApiGateway {
@override
Stream<JsonMap> get frames => const Stream.empty();
@override
Future<JsonMap> call(String type, [JsonMap fields = const {}]) async {
if (type == 'chat_sessions') {
return {
'chat_sessions': [
{
'id': 'probe-open',
'title': 'Open fixture',
'directory': '/workspace/demo',
'starred': true,
},
{
'id': 'probe-closed',
'title': 'Closed fixture',
'directory': '/workspace/archive',
'closed_at': '2026-01-01',
},
{
'id': 'probe-stream',
'title': 'Streaming fixture',
'directory': '/workspace/demo',
'running': true,
},
],
};
}
if (type == 'chat_directories') {
return {
'chat_directories': ['/workspace/demo', '/workspace/archive'],
};
}
if (type == 'chat_backends') {
return {
'chat_backends': ['opencode', 'codex'],
};
}
if (type == 'chat_create') {
return {
'chat_session': {
'id': 'probe-new',
'title': 'New fixture',
'directory': '/workspace/demo',
},
};
}
return {'chat_session': {}};
}
}
void main() => runApp(
MaterialApp(
home: ChatSessionsScreen(gateway: _FixtureGateway(), onOpen: (_) {}),
),
);