neoagent 3.2.1-beta.11 → 3.2.1-beta.13

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.
@@ -1766,6 +1766,9 @@ class NeoAgentController extends ChangeNotifier {
1766
1766
  );
1767
1767
  case 'sharedActorRules':
1768
1768
  return policy.copyWith(
1769
+ directPolicy: policy.directPolicy == 'disabled'
1770
+ ? 'allowlist'
1771
+ : policy.directPolicy,
1769
1772
  sharedPolicy: policy.sharedPolicy == 'disabled'
1770
1773
  ? 'allowlist'
1771
1774
  : policy.sharedPolicy,
@@ -1774,6 +1777,16 @@ class NeoAgentController extends ChangeNotifier {
1774
1777
  suggestion.rule,
1775
1778
  ]),
1776
1779
  );
1780
+ case 'sharedMemberRules':
1781
+ return policy.copyWith(
1782
+ sharedPolicy: policy.sharedPolicy == 'disabled'
1783
+ ? 'allowlist'
1784
+ : policy.sharedPolicy,
1785
+ sharedMemberRules: _dedupeAccessRules(<MessagingAccessRule>[
1786
+ ...policy.sharedMemberRules,
1787
+ suggestion.rule,
1788
+ ]),
1789
+ );
1777
1790
  default:
1778
1791
  return policy.copyWith(
1779
1792
  sharedPolicy: policy.sharedPolicy == 'disabled'
@@ -719,6 +719,9 @@ class MessagingAccessRule {
719
719
  required this.scope,
720
720
  required this.value,
721
721
  this.label,
722
+ this.spaceScope,
723
+ this.spaceValue,
724
+ this.spaceLabel,
722
725
  });
723
726
 
724
727
  factory MessagingAccessRule.fromJson(Map<String, dynamic> json) {
@@ -726,23 +729,38 @@ class MessagingAccessRule {
726
729
  scope: json['scope']?.toString() ?? 'chat',
727
730
  value: json['value']?.toString() ?? '',
728
731
  label: json['label']?.toString(),
732
+ spaceScope: json['spaceScope']?.toString(),
733
+ spaceValue: json['spaceValue']?.toString(),
734
+ spaceLabel: json['spaceLabel']?.toString(),
729
735
  );
730
736
  }
731
737
 
732
738
  final String scope;
733
739
  final String value;
734
740
  final String? label;
741
+ final String? spaceScope;
742
+ final String? spaceValue;
743
+ final String? spaceLabel;
735
744
 
736
745
  Map<String, dynamic> toJson() => <String, dynamic>{
737
746
  'scope': scope,
738
747
  'value': value,
739
748
  if (label != null && label!.trim().isNotEmpty) 'label': label,
749
+ if (spaceScope != null && spaceScope!.trim().isNotEmpty)
750
+ 'spaceScope': spaceScope,
751
+ if (spaceValue != null && spaceValue!.trim().isNotEmpty)
752
+ 'spaceValue': spaceValue,
753
+ if (spaceLabel != null && spaceLabel!.trim().isNotEmpty)
754
+ 'spaceLabel': spaceLabel,
740
755
  };
741
756
 
742
- String get id => '$scope:$value';
757
+ String get id => '$scope:$value:${spaceScope ?? ''}:${spaceValue ?? ''}';
743
758
 
744
759
  String get displayLabel => label?.ifEmpty(value) ?? value;
745
760
 
761
+ String get spaceDisplayLabel =>
762
+ spaceLabel?.ifEmpty(spaceValue ?? '') ?? spaceValue ?? '';
763
+
746
764
  String get scopeLabel {
747
765
  switch (scope) {
748
766
  case 'phone_number':
@@ -767,23 +785,63 @@ class MessagingAccessRule {
767
785
  }
768
786
  }
769
787
 
788
+ class MessagingSharedParticipationRule {
789
+ const MessagingSharedParticipationRule({
790
+ required this.scope,
791
+ required this.value,
792
+ required this.allowUntagged,
793
+ this.label,
794
+ });
795
+
796
+ factory MessagingSharedParticipationRule.fromJson(Map<String, dynamic> json) {
797
+ return MessagingSharedParticipationRule(
798
+ scope: json['scope']?.toString() ?? 'chat',
799
+ value: json['value']?.toString() ?? '',
800
+ allowUntagged: json['allowUntagged'] == true,
801
+ label: json['label']?.toString(),
802
+ );
803
+ }
804
+
805
+ final String scope;
806
+ final String value;
807
+ final bool allowUntagged;
808
+ final String? label;
809
+
810
+ String get id => '$scope:$value';
811
+ String get displayLabel => label?.ifEmpty(value) ?? value;
812
+
813
+ Map<String, dynamic> toJson() => <String, dynamic>{
814
+ 'scope': scope,
815
+ 'value': value,
816
+ 'allowUntagged': allowUntagged,
817
+ if (label != null && label!.trim().isNotEmpty) 'label': label,
818
+ };
819
+ }
820
+
770
821
  class MessagingAccessPolicy {
771
822
  const MessagingAccessPolicy({
823
+ required this.schemaVersion,
772
824
  required this.directPolicy,
773
825
  required this.sharedPolicy,
774
- required this.requireMentionInShared,
826
+ required this.defaultAllowUntaggedInShared,
775
827
  required this.directRules,
776
828
  required this.sharedSpaceRules,
777
829
  required this.sharedActorRules,
830
+ required this.sharedMemberRules,
831
+ required this.sharedParticipationRules,
778
832
  });
779
833
 
780
834
  factory MessagingAccessPolicy.fromJson(Map<String, dynamic> json) {
835
+ final schemaVersion = (json['schemaVersion'] as num?)?.toInt() ?? 2;
781
836
  return MessagingAccessPolicy(
837
+ schemaVersion: schemaVersion,
782
838
  directPolicy:
783
839
  json['directPolicy']?.toString().ifEmpty('allowlist') ?? 'allowlist',
784
840
  sharedPolicy:
785
841
  json['sharedPolicy']?.toString().ifEmpty('allowlist') ?? 'allowlist',
786
- requireMentionInShared: json['requireMentionInShared'] == true,
842
+ defaultAllowUntaggedInShared: schemaVersion < 3
843
+ ? json['requireMentionInShared'] != true
844
+ : json['defaultAllowUntaggedInShared'] != false,
787
845
  directRules:
788
846
  (json['directRules'] is List
789
847
  ? json['directRules'] as List
@@ -817,48 +875,85 @@ class MessagingAccessPolicy {
817
875
  ),
818
876
  )
819
877
  .toList(growable: false),
878
+ sharedMemberRules:
879
+ (json['sharedMemberRules'] is List
880
+ ? json['sharedMemberRules'] as List
881
+ : const <dynamic>[])
882
+ .whereType<Map>()
883
+ .map(
884
+ (item) => MessagingAccessRule.fromJson(
885
+ Map<String, dynamic>.from(item),
886
+ ),
887
+ )
888
+ .toList(growable: false),
889
+ sharedParticipationRules:
890
+ (json['sharedParticipationRules'] is List
891
+ ? json['sharedParticipationRules'] as List
892
+ : const <dynamic>[])
893
+ .whereType<Map>()
894
+ .map(
895
+ (item) => MessagingSharedParticipationRule.fromJson(
896
+ Map<String, dynamic>.from(item),
897
+ ),
898
+ )
899
+ .where((item) => item.value.isNotEmpty)
900
+ .toList(growable: false),
820
901
  );
821
902
  }
822
903
 
823
904
  const MessagingAccessPolicy.defaults({
905
+ this.schemaVersion = 3,
824
906
  this.directPolicy = 'allowlist',
825
907
  this.sharedPolicy = 'allowlist',
826
- this.requireMentionInShared = true,
908
+ this.defaultAllowUntaggedInShared = true,
827
909
  this.directRules = const <MessagingAccessRule>[],
828
910
  this.sharedSpaceRules = const <MessagingAccessRule>[],
829
911
  this.sharedActorRules = const <MessagingAccessRule>[],
912
+ this.sharedMemberRules = const <MessagingAccessRule>[],
913
+ this.sharedParticipationRules = const <MessagingSharedParticipationRule>[],
830
914
  });
831
915
 
916
+ final int schemaVersion;
832
917
  final String directPolicy;
833
918
  final String sharedPolicy;
834
- final bool requireMentionInShared;
919
+ final bool defaultAllowUntaggedInShared;
835
920
  final List<MessagingAccessRule> directRules;
836
921
  final List<MessagingAccessRule> sharedSpaceRules;
837
922
  final List<MessagingAccessRule> sharedActorRules;
923
+ final List<MessagingAccessRule> sharedMemberRules;
924
+ final List<MessagingSharedParticipationRule> sharedParticipationRules;
838
925
 
839
926
  MessagingAccessPolicy copyWith({
927
+ int? schemaVersion,
840
928
  String? directPolicy,
841
929
  String? sharedPolicy,
842
- bool? requireMentionInShared,
930
+ bool? defaultAllowUntaggedInShared,
843
931
  List<MessagingAccessRule>? directRules,
844
932
  List<MessagingAccessRule>? sharedSpaceRules,
845
933
  List<MessagingAccessRule>? sharedActorRules,
934
+ List<MessagingAccessRule>? sharedMemberRules,
935
+ List<MessagingSharedParticipationRule>? sharedParticipationRules,
846
936
  }) {
847
937
  return MessagingAccessPolicy(
938
+ schemaVersion: schemaVersion ?? this.schemaVersion,
848
939
  directPolicy: directPolicy ?? this.directPolicy,
849
940
  sharedPolicy: sharedPolicy ?? this.sharedPolicy,
850
- requireMentionInShared:
851
- requireMentionInShared ?? this.requireMentionInShared,
941
+ defaultAllowUntaggedInShared:
942
+ defaultAllowUntaggedInShared ?? this.defaultAllowUntaggedInShared,
852
943
  directRules: directRules ?? this.directRules,
853
944
  sharedSpaceRules: sharedSpaceRules ?? this.sharedSpaceRules,
854
945
  sharedActorRules: sharedActorRules ?? this.sharedActorRules,
946
+ sharedMemberRules: sharedMemberRules ?? this.sharedMemberRules,
947
+ sharedParticipationRules:
948
+ sharedParticipationRules ?? this.sharedParticipationRules,
855
949
  );
856
950
  }
857
951
 
858
952
  Map<String, dynamic> toJson() => <String, dynamic>{
953
+ 'schemaVersion': schemaVersion,
859
954
  'directPolicy': directPolicy,
860
955
  'sharedPolicy': sharedPolicy,
861
- 'requireMentionInShared': requireMentionInShared,
956
+ 'defaultAllowUntaggedInShared': defaultAllowUntaggedInShared,
862
957
  'directRules': directRules
863
958
  .map((rule) => rule.toJson())
864
959
  .toList(growable: false),
@@ -868,10 +963,19 @@ class MessagingAccessPolicy {
868
963
  'sharedActorRules': sharedActorRules
869
964
  .map((rule) => rule.toJson())
870
965
  .toList(growable: false),
966
+ 'sharedMemberRules': sharedMemberRules
967
+ .map((rule) => rule.toJson())
968
+ .toList(growable: false),
969
+ 'sharedParticipationRules': sharedParticipationRules
970
+ .map((rule) => rule.toJson())
971
+ .toList(growable: false),
871
972
  };
872
973
 
873
974
  int get totalRuleCount =>
874
- directRules.length + sharedSpaceRules.length + sharedActorRules.length;
975
+ directRules.length +
976
+ sharedSpaceRules.length +
977
+ sharedActorRules.length +
978
+ sharedMemberRules.length;
875
979
  }
876
980
 
877
981
  class MessagingAccessCapabilities {
@@ -879,6 +983,7 @@ class MessagingAccessCapabilities {
879
983
  this.supportsDirectPolicy = true,
880
984
  this.supportsSharedPolicy = true,
881
985
  this.supportsMentionGate = false,
986
+ this.supportsUntaggedGroupToggle = true,
882
987
  this.supportsDiscovery = false,
883
988
  this.directRuleScopes = const <String>[],
884
989
  this.sharedSpaceRuleScopes = const <String>[],
@@ -899,6 +1004,7 @@ class MessagingAccessCapabilities {
899
1004
  supportsDirectPolicy: json['supportsDirectPolicy'] != false,
900
1005
  supportsSharedPolicy: json['supportsSharedPolicy'] != false,
901
1006
  supportsMentionGate: json['supportsMentionGate'] == true,
1007
+ supportsUntaggedGroupToggle: json['supportsUntaggedGroupToggle'] != false,
902
1008
  supportsDiscovery: json['supportsDiscovery'] == true,
903
1009
  directRuleScopes: stringList(json['directRuleScopes']),
904
1010
  sharedSpaceRuleScopes: stringList(json['sharedSpaceRuleScopes']),
@@ -910,6 +1016,7 @@ class MessagingAccessCapabilities {
910
1016
  final bool supportsDirectPolicy;
911
1017
  final bool supportsSharedPolicy;
912
1018
  final bool supportsMentionGate;
1019
+ final bool supportsUntaggedGroupToggle;
913
1020
  final bool supportsDiscovery;
914
1021
  final List<String> directRuleScopes;
915
1022
  final List<String> sharedSpaceRuleScopes;
@@ -920,6 +1027,7 @@ class MessagingAccessCapabilities {
920
1027
  'supportsDirectPolicy': supportsDirectPolicy,
921
1028
  'supportsSharedPolicy': supportsSharedPolicy,
922
1029
  'supportsMentionGate': supportsMentionGate,
1030
+ 'supportsUntaggedGroupToggle': supportsUntaggedGroupToggle,
923
1031
  'supportsDiscovery': supportsDiscovery,
924
1032
  'directRuleScopes': directRuleScopes,
925
1033
  'sharedSpaceRuleScopes': sharedSpaceRuleScopes,
@@ -936,18 +1044,41 @@ class MessagingAccessTarget {
936
1044
  required this.value,
937
1045
  required this.label,
938
1046
  required this.subtitle,
1047
+ this.spaceScope,
1048
+ this.spaceValue,
1049
+ this.spaceLabel,
939
1050
  });
940
1051
 
941
1052
  factory MessagingAccessTarget.fromJson(Map<String, dynamic> json) {
1053
+ final nestedRule = _jsonMap(json['rule']);
1054
+ final scope =
1055
+ json['scope']?.toString() ?? nestedRule['scope']?.toString() ?? 'chat';
1056
+ final value =
1057
+ json['value']?.toString() ?? nestedRule['value']?.toString() ?? '';
942
1058
  return MessagingAccessTarget(
943
1059
  source: json['source']?.toString() ?? 'manual',
944
1060
  bucket: json['bucket']?.toString() ?? 'sharedSpaceRules',
945
- scope: json['scope']?.toString() ?? 'chat',
946
- value: json['value']?.toString() ?? '',
1061
+ scope: scope,
1062
+ value: value,
947
1063
  label:
948
- json['label']?.toString().ifEmpty(json['value']?.toString() ?? '') ??
949
- (json['value']?.toString() ?? ''),
950
- subtitle: json['subtitle']?.toString() ?? '',
1064
+ nestedRule['label']?.toString().ifEmpty(
1065
+ json['label']?.toString() ?? value,
1066
+ ) ??
1067
+ json['label']?.toString().ifEmpty(value) ??
1068
+ value,
1069
+ subtitle:
1070
+ json['subtitle']?.toString() ??
1071
+ nestedRule['spaceLabel']?.toString() ??
1072
+ '',
1073
+ spaceScope:
1074
+ json['spaceScope']?.toString() ??
1075
+ nestedRule['spaceScope']?.toString(),
1076
+ spaceValue:
1077
+ json['spaceValue']?.toString() ??
1078
+ nestedRule['spaceValue']?.toString(),
1079
+ spaceLabel:
1080
+ json['spaceLabel']?.toString() ??
1081
+ nestedRule['spaceLabel']?.toString(),
951
1082
  );
952
1083
  }
953
1084
 
@@ -957,11 +1088,21 @@ class MessagingAccessTarget {
957
1088
  final String value;
958
1089
  final String label;
959
1090
  final String subtitle;
960
-
961
- MessagingAccessRule get asRule =>
962
- MessagingAccessRule(scope: scope, value: value, label: label);
963
-
964
- String get id => '$bucket:$scope:$value';
1091
+ final String? spaceScope;
1092
+ final String? spaceValue;
1093
+ final String? spaceLabel;
1094
+
1095
+ MessagingAccessRule get asRule => MessagingAccessRule(
1096
+ scope: scope,
1097
+ value: value,
1098
+ label: label,
1099
+ spaceScope: spaceScope,
1100
+ spaceValue: spaceValue,
1101
+ spaceLabel: spaceLabel,
1102
+ );
1103
+
1104
+ String get id =>
1105
+ '$bucket:$scope:$value:${spaceScope ?? ''}:${spaceValue ?? ''}';
965
1106
 
966
1107
  Map<String, dynamic> toJson() => <String, dynamic>{
967
1108
  'source': source,
@@ -970,6 +1111,12 @@ class MessagingAccessTarget {
970
1111
  'value': value,
971
1112
  'label': label,
972
1113
  'subtitle': subtitle,
1114
+ if (spaceScope != null && spaceScope!.trim().isNotEmpty)
1115
+ 'spaceScope': spaceScope,
1116
+ if (spaceValue != null && spaceValue!.trim().isNotEmpty)
1117
+ 'spaceValue': spaceValue,
1118
+ if (spaceLabel != null && spaceLabel!.trim().isNotEmpty)
1119
+ 'spaceLabel': spaceLabel,
973
1120
  };
974
1121
  }
975
1122
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neoagent",
3
- "version": "3.2.1-beta.11",
3
+ "version": "3.2.1-beta.13",
4
4
  "description": "Self-hosted AI agent for long-running tasks, automation, messaging, device control, and local memory",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "server/index.js",
@@ -1 +1 @@
1
- 92ce0d4ca56361c182ca287a33b13bce
1
+ b457889ca1da36970ec56418c27fb91b
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"0cd610717bde95fd88343c64f81c11ba4e5c00
37
37
 
38
38
  _flutter.loader.load({
39
39
  serviceWorkerSettings: {
40
- serviceWorkerVersion: "1130135668" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
40
+ serviceWorkerVersion: "2276488520" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
41
41
  }
42
42
  });