neoagent 3.2.1-beta.9 → 3.3.0

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.
Files changed (70) hide show
  1. package/flutter_app/lib/main_app_shell.dart +178 -34
  2. package/flutter_app/lib/main_chat.dart +542 -80
  3. package/flutter_app/lib/main_controller.dart +59 -4
  4. package/flutter_app/lib/main_models.dart +171 -22
  5. package/flutter_app/lib/main_operations.dart +0 -49
  6. package/flutter_app/lib/main_settings.dart +338 -0
  7. package/flutter_app/lib/src/backend_client.dart +19 -0
  8. package/package.json +1 -1
  9. package/server/db/database.js +2 -2
  10. package/server/http/routes.js +1 -0
  11. package/server/public/.last_build_id +1 -1
  12. package/server/public/assets/fonts/MaterialIcons-Regular.otf +0 -0
  13. package/server/public/flutter_bootstrap.js +1 -1
  14. package/server/public/main.dart.js +85079 -83904
  15. package/server/routes/behavior.js +80 -0
  16. package/server/routes/settings.js +4 -0
  17. package/server/services/agents/manager.js +1 -1
  18. package/server/services/ai/history.js +1 -1
  19. package/server/services/ai/loop/agent_engine_core.js +110 -17
  20. package/server/services/ai/loop/blank_recovery.js +5 -4
  21. package/server/services/ai/loop/completion_judge.js +226 -33
  22. package/server/services/ai/loop/conversation_loop.js +92 -34
  23. package/server/services/ai/loop/messaging_delivery.js +47 -0
  24. package/server/services/ai/loop/progress_classification.js +2 -0
  25. package/server/services/ai/loopPolicy.js +24 -2
  26. package/server/services/ai/messagingFallback.js +17 -17
  27. package/server/services/ai/model_failure_cache.js +7 -0
  28. package/server/services/ai/systemPrompt.js +31 -122
  29. package/server/services/ai/taskAnalysis.js +86 -12
  30. package/server/services/ai/toolEvidence.js +68 -224
  31. package/server/services/ai/tools.js +60 -19
  32. package/server/services/behavior/config.js +251 -0
  33. package/server/services/behavior/defaults.js +68 -0
  34. package/server/services/behavior/delivery.js +176 -0
  35. package/server/services/behavior/index.js +43 -0
  36. package/server/services/behavior/model_client.js +35 -0
  37. package/server/services/behavior/modules/agent_identity.js +37 -0
  38. package/server/services/behavior/modules/channel_style.js +28 -0
  39. package/server/services/behavior/modules/index.js +29 -0
  40. package/server/services/behavior/modules/norms.js +101 -0
  41. package/server/services/behavior/modules/persona.js +172 -0
  42. package/server/services/behavior/modules/persona_prompt.js +238 -0
  43. package/server/services/behavior/modules/social_memory.js +86 -0
  44. package/server/services/behavior/modules/social_observability.js +94 -0
  45. package/server/services/behavior/modules/social_signals.js +41 -0
  46. package/server/services/behavior/modules/theory_of_mind.js +118 -0
  47. package/server/services/behavior/modules/turn_taking.js +238 -0
  48. package/server/services/behavior/pipeline.js +341 -0
  49. package/server/services/behavior/registry.js +78 -0
  50. package/server/services/behavior/signals.js +107 -0
  51. package/server/services/behavior/state.js +99 -0
  52. package/server/services/behavior/system_prompt.js +75 -0
  53. package/server/services/memory/manager.js +14 -33
  54. package/server/services/messaging/access_policy.js +269 -74
  55. package/server/services/messaging/automation.js +158 -27
  56. package/server/services/messaging/discord.js +11 -1
  57. package/server/services/messaging/formatting_guides.js +5 -4
  58. package/server/services/messaging/http_platforms.js +73 -28
  59. package/server/services/messaging/inbound_queue.js +74 -13
  60. package/server/services/messaging/inbound_store.js +33 -0
  61. package/server/services/messaging/manager.js +57 -5
  62. package/server/services/messaging/telegram.js +10 -1
  63. package/server/services/messaging/whatsapp.js +11 -0
  64. package/server/services/social_reach/channels/social_video.js +1 -1
  65. package/server/services/social_video/captions.js +2 -2
  66. package/server/services/social_video/service.js +194 -29
  67. package/server/services/voice/message.js +1 -1
  68. package/server/services/voice/runtime.js +2 -2
  69. package/server/utils/logger.js +19 -0
  70. package/server/services/ai/terminal_reply.js +0 -57
@@ -1673,53 +1673,112 @@ class _HomeViewState extends State<HomeView> {
1673
1673
  builder: (dialogContext) {
1674
1674
  return AlertDialog(
1675
1675
  backgroundColor: _bgCard,
1676
- title: Text('Allow sender on ${notice.platform.toUpperCase()}?'),
1676
+ shape: RoundedRectangleBorder(
1677
+ borderRadius: BorderRadius.circular(24),
1678
+ ),
1679
+ titlePadding: const EdgeInsets.fromLTRB(24, 24, 24, 0),
1680
+ title: Row(
1681
+ children: <Widget>[
1682
+ Container(
1683
+ width: 44,
1684
+ height: 44,
1685
+ decoration: BoxDecoration(
1686
+ color: _accent.withValues(alpha: 0.12),
1687
+ borderRadius: BorderRadius.circular(14),
1688
+ ),
1689
+ child: Icon(Icons.shield_outlined, color: _accent),
1690
+ ),
1691
+ const SizedBox(width: 14),
1692
+ Expanded(
1693
+ child: Column(
1694
+ crossAxisAlignment: CrossAxisAlignment.start,
1695
+ children: <Widget>[
1696
+ Text(
1697
+ 'Message needs access',
1698
+ style: TextStyle(fontWeight: FontWeight.w800),
1699
+ ),
1700
+ const SizedBox(height: 2),
1701
+ Text(
1702
+ notice.platform.toUpperCase(),
1703
+ style: TextStyle(
1704
+ color: _textMuted,
1705
+ fontSize: 12,
1706
+ fontWeight: FontWeight.w700,
1707
+ letterSpacing: 0.8,
1708
+ ),
1709
+ ),
1710
+ ],
1711
+ ),
1712
+ ),
1713
+ ],
1714
+ ),
1677
1715
  content: SizedBox(
1678
- width: 520,
1716
+ width: 560,
1679
1717
  child: SingleChildScrollView(
1680
1718
  child: Column(
1681
1719
  mainAxisSize: MainAxisSize.min,
1682
1720
  crossAxisAlignment: CrossAxisAlignment.start,
1683
1721
  children: <Widget>[
1684
- Text(
1685
- notice.senderLabel,
1686
- style: TextStyle(
1687
- fontSize: 16,
1688
- fontWeight: FontWeight.w700,
1722
+ Container(
1723
+ width: double.infinity,
1724
+ padding: const EdgeInsets.all(14),
1725
+ decoration: BoxDecoration(
1726
+ color: _bgSecondary,
1727
+ borderRadius: BorderRadius.circular(16),
1728
+ border: Border.all(color: _borderLight),
1689
1729
  ),
1690
- ),
1691
- if (notice.meta.isNotEmpty) ...<Widget>[
1692
- const SizedBox(height: 6),
1693
- Text(
1694
- notice.meta,
1695
- style: TextStyle(color: _textSecondary),
1730
+ child: Row(
1731
+ children: <Widget>[
1732
+ CircleAvatar(
1733
+ backgroundColor: _accent.withValues(alpha: 0.12),
1734
+ foregroundColor: _accent,
1735
+ child: Icon(Icons.person_outline_rounded),
1736
+ ),
1737
+ const SizedBox(width: 12),
1738
+ Expanded(
1739
+ child: Column(
1740
+ crossAxisAlignment: CrossAxisAlignment.start,
1741
+ children: <Widget>[
1742
+ Text(
1743
+ notice.senderLabel,
1744
+ style: TextStyle(
1745
+ fontSize: 16,
1746
+ fontWeight: FontWeight.w700,
1747
+ ),
1748
+ ),
1749
+ if (notice.meta.isNotEmpty) ...<Widget>[
1750
+ const SizedBox(height: 3),
1751
+ Text(
1752
+ notice.meta,
1753
+ style: TextStyle(color: _textSecondary),
1754
+ ),
1755
+ ],
1756
+ ],
1757
+ ),
1758
+ ),
1759
+ ],
1696
1760
  ),
1697
- ],
1761
+ ),
1698
1762
  const SizedBox(height: 12),
1699
1763
  Text(
1700
- 'This sender is currently blocked by the access list. You can allow them now or jump to Messaging to edit the full list.',
1764
+ 'Choose exactly where this sender should be allowed. You can change or remove the rule later in Messaging.',
1701
1765
  style: TextStyle(color: _textSecondary, height: 1.45),
1702
1766
  ),
1703
1767
  if (notice.suggestions.isNotEmpty) ...<Widget>[
1704
- const SizedBox(height: 18),
1768
+ const SizedBox(height: 16),
1705
1769
  ...notice.suggestions.map(
1706
1770
  (suggestion) => Padding(
1707
1771
  padding: const EdgeInsets.only(bottom: 10),
1708
- child: SizedBox(
1709
- width: double.infinity,
1710
- child: FilledButton.icon(
1711
- onPressed: () async {
1712
- Navigator.of(dialogContext).pop();
1713
- await widget.controller
1714
- .allowMessagingSuggestion(
1715
- notice.platform,
1716
- suggestion,
1717
- chatId: notice.chatId,
1718
- );
1719
- },
1720
- icon: Icon(Icons.verified_user_outlined),
1721
- label: Text(suggestion.label),
1722
- ),
1772
+ child: _BlockedAccessChoice(
1773
+ suggestion: suggestion,
1774
+ onPressed: () async {
1775
+ Navigator.of(dialogContext).pop();
1776
+ await widget.controller.allowMessagingSuggestion(
1777
+ notice.platform,
1778
+ suggestion,
1779
+ chatId: notice.chatId,
1780
+ );
1781
+ },
1723
1782
  ),
1724
1783
  ),
1725
1784
  ),
@@ -1734,18 +1793,18 @@ class _HomeViewState extends State<HomeView> {
1734
1793
  widget.controller.setSelectedSection(AppSection.messaging);
1735
1794
  Navigator.of(dialogContext).pop();
1736
1795
  },
1737
- child: Text('Open Messaging'),
1796
+ child: Text('Review all access'),
1738
1797
  ),
1739
1798
  TextButton(
1740
1799
  onPressed: () async {
1741
1800
  Navigator.of(dialogContext).pop();
1742
1801
  await widget.controller.ignoreBlockedSender(notice);
1743
1802
  },
1744
- child: Text('Ignore'),
1803
+ child: Text('Ignore this chat'),
1745
1804
  ),
1746
1805
  TextButton(
1747
1806
  onPressed: () => Navigator.of(dialogContext).pop(),
1748
- child: Text('Dismiss'),
1807
+ child: Text('Not now'),
1749
1808
  ),
1750
1809
  ],
1751
1810
  );
@@ -1762,6 +1821,91 @@ class _HomeViewState extends State<HomeView> {
1762
1821
  }
1763
1822
  }
1764
1823
 
1824
+ class _BlockedAccessChoice extends StatelessWidget {
1825
+ const _BlockedAccessChoice({
1826
+ required this.suggestion,
1827
+ required this.onPressed,
1828
+ });
1829
+
1830
+ final QuickAllowSuggestion suggestion;
1831
+ final VoidCallback onPressed;
1832
+
1833
+ @override
1834
+ Widget build(BuildContext context) {
1835
+ final (icon, title, description) = switch (suggestion.bucket) {
1836
+ 'sharedMemberRules' => (
1837
+ Icons.person_pin_circle_outlined,
1838
+ 'Only in this group',
1839
+ 'Allow this sender here, without granting access in DMs or other groups.',
1840
+ ),
1841
+ 'sharedActorRules' => (
1842
+ Icons.person_add_alt_1_rounded,
1843
+ 'This sender everywhere',
1844
+ 'Allow this person in DMs and in every group or shared space.',
1845
+ ),
1846
+ 'sharedSpaceRules' => (
1847
+ Icons.groups_2_outlined,
1848
+ 'Everyone in this group',
1849
+ 'Allow messages from every participant in this group or shared space.',
1850
+ ),
1851
+ _ => (
1852
+ Icons.person_outline_rounded,
1853
+ 'Allow this sender',
1854
+ 'Allow this person to message the agent directly.',
1855
+ ),
1856
+ };
1857
+ return Material(
1858
+ color: _bgSecondary,
1859
+ borderRadius: BorderRadius.circular(16),
1860
+ child: InkWell(
1861
+ borderRadius: BorderRadius.circular(16),
1862
+ onTap: onPressed,
1863
+ child: Container(
1864
+ width: double.infinity,
1865
+ padding: const EdgeInsets.all(14),
1866
+ decoration: BoxDecoration(
1867
+ borderRadius: BorderRadius.circular(16),
1868
+ border: Border.all(color: _borderLight),
1869
+ ),
1870
+ child: Row(
1871
+ children: <Widget>[
1872
+ Container(
1873
+ width: 42,
1874
+ height: 42,
1875
+ decoration: BoxDecoration(
1876
+ color: _accent.withValues(alpha: 0.1),
1877
+ borderRadius: BorderRadius.circular(13),
1878
+ ),
1879
+ child: Icon(icon, color: _accent),
1880
+ ),
1881
+ const SizedBox(width: 12),
1882
+ Expanded(
1883
+ child: Column(
1884
+ crossAxisAlignment: CrossAxisAlignment.start,
1885
+ children: <Widget>[
1886
+ Text(title, style: TextStyle(fontWeight: FontWeight.w700)),
1887
+ const SizedBox(height: 3),
1888
+ Text(
1889
+ description,
1890
+ style: TextStyle(
1891
+ color: _textSecondary,
1892
+ fontSize: 13,
1893
+ height: 1.3,
1894
+ ),
1895
+ ),
1896
+ ],
1897
+ ),
1898
+ ),
1899
+ const SizedBox(width: 8),
1900
+ Icon(Icons.arrow_forward_rounded, color: _textMuted),
1901
+ ],
1902
+ ),
1903
+ ),
1904
+ ),
1905
+ );
1906
+ }
1907
+ }
1908
+
1765
1909
  class _Sidebar extends StatelessWidget {
1766
1910
  const _Sidebar({
1767
1911
  required this.controller,