iop/packages/flutter/iop_console/lib/src/iop_agent_panel.dart
toki 173af5729c feat: embeddable iop console workbench - m-embeddable-iop-console-workbench task implementation
- Add IopConsoleContract and IopConsoleOverview components
- Update iop_console.dart entry point
- Update iop_agent_panel with new console integration
- Update iop_console_shell for workbench embedding
- Add agent task documentation for m-embeddable-iop-console-workbench
2026-06-02 11:12:36 +09:00

46 lines
1.2 KiB
Dart

import 'package:agent_shell/agent_shell.dart';
import 'package:flutter/material.dart';
import 'iop_console_contract.dart';
class IopAgentPanel extends StatelessWidget {
final ValueChanged<String>? onSubmit;
final IopCapabilityPack? capabilities;
const IopAgentPanel({
super.key,
this.onSubmit,
this.capabilities,
});
List<AgentMessage> _buildMessages() {
final introText = StringBuffer(
'IOP agent surface is ready. Edge, Node, Runtime, and Execution capabilities can be registered here.',
);
if (capabilities != null && capabilities!.capabilities.isNotEmpty) {
introText.write('\n\n**Registered Capabilities:**');
for (final cap in capabilities!.capabilities) {
introText.write('\n• **${cap.name}**: ${cap.description}');
}
}
return [
AgentMessage(
id: 'iop-agent-intro',
role: AgentMessageRole.assistant,
text: introText.toString(),
),
];
}
@override
Widget build(BuildContext context) {
return AgentShell(
messages: _buildMessages(),
busy: false,
placeholder: 'Ask about IOP operations',
onSubmit: onSubmit,
);
}
}