iop와 nomadcode가 같은 workspace에서 제품별 Flutter 콘솔을 위젯으로 삽입할 수 있어야 하므로 OTO client를 얇은 host 앱으로 정리하고 agent-shell 기반 embeddable console 패키지를 분리한다.
42 lines
1.2 KiB
Dart
42 lines
1.2 KiB
Dart
import 'package:agent_shell/agent_shell.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'oto_console_contract.dart';
|
|
|
|
class OtoAgentPanel extends StatelessWidget {
|
|
final ValueChanged<String>? onSubmit;
|
|
final OtoCapabilityPack? capabilities;
|
|
|
|
const OtoAgentPanel({super.key, this.onSubmit, this.capabilities});
|
|
|
|
List<AgentMessage> _buildMessages() {
|
|
final introText = StringBuffer(
|
|
'OTO agent surface is ready. Runner, pipeline, execution, log, and artifact capabilities can be registered here.',
|
|
);
|
|
|
|
if (capabilities != null && capabilities!.capabilities.isNotEmpty) {
|
|
introText.write('\n\nRegistered capabilities:');
|
|
for (final capability in capabilities!.capabilities) {
|
|
introText.write('\n- ${capability.name}: ${capability.description}');
|
|
}
|
|
}
|
|
|
|
return [
|
|
AgentMessage(
|
|
id: 'oto-agent-intro',
|
|
role: AgentMessageRole.assistant,
|
|
text: introText.toString(),
|
|
),
|
|
];
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AgentShell(
|
|
messages: _buildMessages(),
|
|
busy: false,
|
|
placeholder: 'Ask about OTO builds',
|
|
onSubmit: onSubmit,
|
|
);
|
|
}
|
|
}
|