neoagent 2.3.1-beta.63 → 2.3.1-beta.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
1
  part of 'main.dart';
2
2
 
3
3
  class LogsPanel extends StatefulWidget {
4
- const LogsPanel({super.key, required this.controller});
4
+ const LogsPanel({super.key, required this.controller, this.embedded = false});
5
5
 
6
6
  final NeoAgentController controller;
7
+ final bool embedded;
7
8
 
8
9
  @override
9
10
  State<LogsPanel> createState() => _LogsPanelState();
@@ -350,46 +351,89 @@ class _LogsPanelState extends State<LogsPanel> {
350
351
  @override
351
352
  Widget build(BuildContext context) {
352
353
  return ListView(
353
- padding: _pagePadding(context),
354
+ padding: widget.embedded ? EdgeInsets.zero : _pagePadding(context),
354
355
  children: <Widget>[
355
- _PageTitle(
356
- title: 'Logs',
357
- subtitle:
358
- 'Merged server and Flutter runtime logs for this app session.',
359
- trailing: Wrap(
360
- spacing: 12,
361
- runSpacing: 12,
362
- children: <Widget>[
363
- OutlinedButton.icon(
364
- onPressed: _isExportingRecentMessages
365
- ? null
366
- : _exportRecentMessages,
367
- icon: _isExportingRecentMessages
368
- ? const SizedBox.square(
369
- dimension: 16,
370
- child: CircularProgressIndicator(strokeWidth: 2),
371
- )
372
- : Icon(Icons.ios_share_outlined),
373
- label: Text('Export last 5 messages'),
374
- ),
375
- OutlinedButton.icon(
376
- onPressed: _copyDebugInfo,
377
- icon: Icon(Icons.bug_report_outlined),
378
- label: Text('Copy debug info'),
379
- ),
380
- OutlinedButton.icon(
381
- onPressed: widget.controller.logs.isEmpty ? null : _copyLogs,
382
- icon: Icon(Icons.copy_all_outlined),
383
- label: Text('Copy logs'),
384
- ),
385
- OutlinedButton.icon(
386
- onPressed: widget.controller.clearLogs,
387
- icon: Icon(Icons.clear_all),
388
- label: Text('Clear'),
356
+ if (!widget.embedded)
357
+ _PageTitle(
358
+ title: 'Logs',
359
+ subtitle:
360
+ 'Merged server and Flutter runtime logs for this app session.',
361
+ trailing: Wrap(
362
+ spacing: 12,
363
+ runSpacing: 12,
364
+ children: <Widget>[
365
+ OutlinedButton.icon(
366
+ onPressed: _isExportingRecentMessages
367
+ ? null
368
+ : _exportRecentMessages,
369
+ icon: _isExportingRecentMessages
370
+ ? const SizedBox.square(
371
+ dimension: 16,
372
+ child: CircularProgressIndicator(strokeWidth: 2),
373
+ )
374
+ : Icon(Icons.ios_share_outlined),
375
+ label: Text('Export last 5 messages'),
376
+ ),
377
+ OutlinedButton.icon(
378
+ onPressed: _copyDebugInfo,
379
+ icon: Icon(Icons.bug_report_outlined),
380
+ label: Text('Copy debug info'),
381
+ ),
382
+ OutlinedButton.icon(
383
+ onPressed: widget.controller.logs.isEmpty ? null : _copyLogs,
384
+ icon: Icon(Icons.copy_all_outlined),
385
+ label: Text('Copy logs'),
386
+ ),
387
+ OutlinedButton.icon(
388
+ onPressed: widget.controller.clearLogs,
389
+ icon: Icon(Icons.clear_all),
390
+ label: Text('Clear'),
391
+ ),
392
+ ],
393
+ ),
394
+ )
395
+ else
396
+ Align(
397
+ alignment: Alignment.centerRight,
398
+ child: Padding(
399
+ padding: const EdgeInsets.only(bottom: 12),
400
+ child: Wrap(
401
+ spacing: 12,
402
+ runSpacing: 12,
403
+ children: <Widget>[
404
+ OutlinedButton.icon(
405
+ onPressed: _isExportingRecentMessages
406
+ ? null
407
+ : _exportRecentMessages,
408
+ icon: _isExportingRecentMessages
409
+ ? const SizedBox.square(
410
+ dimension: 16,
411
+ child: CircularProgressIndicator(strokeWidth: 2),
412
+ )
413
+ : const Icon(Icons.ios_share_outlined),
414
+ label: const Text('Export last 5 messages'),
415
+ ),
416
+ OutlinedButton.icon(
417
+ onPressed: _copyDebugInfo,
418
+ icon: const Icon(Icons.bug_report_outlined),
419
+ label: const Text('Copy debug info'),
420
+ ),
421
+ OutlinedButton.icon(
422
+ onPressed: widget.controller.logs.isEmpty
423
+ ? null
424
+ : _copyLogs,
425
+ icon: const Icon(Icons.copy_all_outlined),
426
+ label: const Text('Copy logs'),
427
+ ),
428
+ OutlinedButton.icon(
429
+ onPressed: widget.controller.clearLogs,
430
+ icon: const Icon(Icons.clear_all),
431
+ label: const Text('Clear'),
432
+ ),
433
+ ],
389
434
  ),
390
- ],
435
+ ),
391
436
  ),
392
- ),
393
437
  Card(
394
438
  child: Padding(
395
439
  padding: const EdgeInsets.all(16),
@@ -440,9 +484,14 @@ class _LogsPanelState extends State<LogsPanel> {
440
484
  }
441
485
 
442
486
  class SkillsPanel extends StatefulWidget {
443
- const SkillsPanel({super.key, required this.controller});
487
+ const SkillsPanel({
488
+ super.key,
489
+ required this.controller,
490
+ this.embedded = false,
491
+ });
444
492
 
445
493
  final NeoAgentController controller;
494
+ final bool embedded;
446
495
 
447
496
  @override
448
497
  State<SkillsPanel> createState() => _SkillsPanelState();
@@ -493,10 +542,9 @@ class _SkillsPanelState extends State<SkillsPanel>
493
542
  return a.name.toLowerCase().compareTo(b.name.toLowerCase());
494
543
  });
495
544
 
496
- return Padding(
497
- padding: _pagePadding(context),
498
- child: Column(
499
- children: <Widget>[
545
+ final body = Column(
546
+ children: <Widget>[
547
+ if (!widget.embedded)
500
548
  _PageTitle(
501
549
  title: 'Skills',
502
550
  subtitle:
@@ -506,38 +554,53 @@ class _SkillsPanelState extends State<SkillsPanel>
506
554
  icon: Icon(Icons.add),
507
555
  label: Text('New Skill'),
508
556
  ),
509
- ),
510
- const SizedBox(height: 12),
511
- Container(
512
- decoration: BoxDecoration(
513
- color: _bgSecondary,
514
- borderRadius: BorderRadius.circular(14),
515
- border: Border.all(color: _border),
516
- ),
517
- child: TabBar(
518
- controller: _tabController,
519
- dividerColor: Colors.transparent,
520
- indicatorSize: TabBarIndicatorSize.tab,
521
- labelStyle: TextStyle(fontWeight: FontWeight.w700),
522
- tabs: <Widget>[
523
- Tab(text: 'Installed Skills (${controller.skills.length})'),
524
- Tab(text: 'Store (${filteredStore.length})'),
525
- ],
557
+ )
558
+ else
559
+ Align(
560
+ alignment: Alignment.centerRight,
561
+ child: Padding(
562
+ padding: const EdgeInsets.only(bottom: 12),
563
+ child: FilledButton.icon(
564
+ onPressed: () => _openCreateSkill(context),
565
+ icon: const Icon(Icons.add),
566
+ label: const Text('New Skill'),
567
+ ),
526
568
  ),
527
569
  ),
528
- const SizedBox(height: 12),
529
- Expanded(
530
- child: TabBarView(
531
- controller: _tabController,
532
- children: <Widget>[
533
- _buildInstalledTab(controller),
534
- _buildStoreTab(controller, categories, filteredStore),
535
- ],
536
- ),
570
+ if (!widget.embedded) const SizedBox(height: 12),
571
+ Container(
572
+ decoration: BoxDecoration(
573
+ color: _bgSecondary,
574
+ borderRadius: BorderRadius.circular(14),
575
+ border: Border.all(color: _border),
537
576
  ),
538
- ],
539
- ),
577
+ child: TabBar(
578
+ controller: _tabController,
579
+ dividerColor: Colors.transparent,
580
+ indicatorSize: TabBarIndicatorSize.tab,
581
+ labelStyle: TextStyle(fontWeight: FontWeight.w700),
582
+ tabs: <Widget>[
583
+ Tab(text: 'Installed Skills (${controller.skills.length})'),
584
+ Tab(text: 'Store (${filteredStore.length})'),
585
+ ],
586
+ ),
587
+ ),
588
+ const SizedBox(height: 12),
589
+ Expanded(
590
+ child: TabBarView(
591
+ controller: _tabController,
592
+ children: <Widget>[
593
+ _buildInstalledTab(controller),
594
+ _buildStoreTab(controller, categories, filteredStore),
595
+ ],
596
+ ),
597
+ ),
598
+ ],
540
599
  );
600
+ if (widget.embedded) {
601
+ return body;
602
+ }
603
+ return Padding(padding: _pagePadding(context), child: body);
541
604
  }
542
605
 
543
606
  Widget _buildInstalledTab(NeoAgentController controller) {
@@ -1985,16 +2048,18 @@ class WidgetsPanel extends StatelessWidget {
1985
2048
  spacing: 10,
1986
2049
  runSpacing: 10,
1987
2050
  children: <Widget>[
1988
- OutlinedButton(
1989
- onPressed: () =>
1990
- controller.openWidgetEditFlow(item),
1991
- child: Text('Edit With AI'),
1992
- ),
1993
- OutlinedButton(
1994
- onPressed: () =>
1995
- controller.toggleWidgetEnabled(item),
1996
- child: Text(item.enabled ? 'Pause' : 'Enable'),
1997
- ),
2051
+ if (!item.isSystem)
2052
+ OutlinedButton(
2053
+ onPressed: () =>
2054
+ controller.openWidgetEditFlow(item),
2055
+ child: Text('Edit With AI'),
2056
+ ),
2057
+ if (!item.isSystem)
2058
+ OutlinedButton(
2059
+ onPressed: () =>
2060
+ controller.toggleWidgetEnabled(item),
2061
+ child: Text(item.enabled ? 'Pause' : 'Enable'),
2062
+ ),
1998
2063
  FilledButton(
1999
2064
  onPressed: remaining > 0
2000
2065
  ? null
@@ -2003,16 +2068,18 @@ class WidgetsPanel extends StatelessWidget {
2003
2068
  _manualRunButtonLabel('Run Now', remaining),
2004
2069
  ),
2005
2070
  ),
2006
- OutlinedButton(
2007
- onPressed: () => _confirmDelete(
2008
- context,
2009
- title: 'Delete widget?',
2010
- message:
2011
- 'This removes "${item.name}" and its refresh job.',
2012
- onConfirm: () => controller.deleteWidget(item.id),
2071
+ if (!item.isSystem)
2072
+ OutlinedButton(
2073
+ onPressed: () => _confirmDelete(
2074
+ context,
2075
+ title: 'Delete widget?',
2076
+ message:
2077
+ 'This removes "${item.name}" and its refresh job.',
2078
+ onConfirm: () =>
2079
+ controller.deleteWidget(item.id),
2080
+ ),
2081
+ child: Text('Delete'),
2013
2082
  ),
2014
- child: Text('Delete'),
2015
- ),
2016
2083
  ],
2017
2084
  ),
2018
2085
  ),
@@ -2185,7 +2252,11 @@ class _AiWidgetCardState extends State<_AiWidgetCard> {
2185
2252
  ),
2186
2253
  const SizedBox(width: 12),
2187
2254
  _StatusPill(
2188
- label: item.enabled ? 'Live' : 'Paused',
2255
+ label: item.isSystem
2256
+ ? (item.enabled
2257
+ ? 'System live'
2258
+ : 'System paused')
2259
+ : (item.enabled ? 'Live' : 'Paused'),
2189
2260
  color: item.enabled ? _success : _textSecondary,
2190
2261
  ),
2191
2262
  ],