Record chat shell commands with fixture captures and a note
Show Expand only when output can overflow and drop the final newline from the drawn output. The full-app probe lists shell runs with ?shell=1 so the cards, Shell mode and Run command dialog can be captured in Chrome.
This commit is contained in:
@@ -16,12 +16,15 @@
|
||||
// `?msgs=`, `?rich=1`, `?older=1`, `?live=N` vary the chat transcripts for
|
||||
// scroll captures (tool/perf/chat_scroll_fixture.dart).
|
||||
// `?question=` pushes an agent question (tool/perf/chat_question_fixture.dart).
|
||||
// `?shell=1` lists operator shell commands in every chat
|
||||
// (tool/perf/chat_shell_fixture.dart).
|
||||
// `/new` in a fixture chat moves it to a fresh, empty session
|
||||
// (tool/perf/chat_new_session_fixture.dart).
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
|
||||
import 'chat_new_session_fixture.dart';
|
||||
import 'chat_question_fixture.dart';
|
||||
import 'chat_shell_fixture.dart';
|
||||
import 'chat_scroll_fixture.dart';
|
||||
|
||||
Map<String, String> _params = const {};
|
||||
@@ -35,6 +38,7 @@ void configurePerfFixture(Map<String, String> params) {
|
||||
);
|
||||
configureChatScrollFixture(params);
|
||||
configureChatQuestionFixture(params);
|
||||
configureChatShellFixture(params);
|
||||
}
|
||||
|
||||
int get _hits => int.tryParse(_params['hits'] ?? '') ?? 0;
|
||||
@@ -126,6 +130,8 @@ bool get _scrollVariety => ['msgs', 'rich', 'older'].any(_params.containsKey);
|
||||
List<JsonMap> perfChatFollowUps(JsonMap request) {
|
||||
final answered = chatQuestionFollowUps(request);
|
||||
if (answered.isNotEmpty) return answered;
|
||||
final shell = chatShellFollowUps(request);
|
||||
if (shell.isNotEmpty) return shell;
|
||||
final quota = _params['quota'];
|
||||
if (_chats == 0 || quota == null || request['type'] != 'chat_subscribe') {
|
||||
return const [];
|
||||
@@ -226,6 +232,8 @@ JsonMap? perfChatReply(JsonMap request) {
|
||||
if (_chats == 0) return null;
|
||||
final question = chatQuestionReply(request);
|
||||
if (question != null) return question;
|
||||
final shell = chatShellReply(request);
|
||||
if (shell != null) return shell;
|
||||
final id = request['id'];
|
||||
switch ('${request['type']}') {
|
||||
case 'chat_sessions':
|
||||
|
||||
Reference in New Issue
Block a user