@agenticmail/enterprise 0.5.257 → 0.5.258

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.
@@ -49,17 +49,23 @@ function injectCSS() {
49
49
  function layoutChains(tasks) {
50
50
  if (!tasks.length) return { nodes: [], edges: [], width: 0, height: 0, chains: [] };
51
51
 
52
- // Group by chainId
52
+ // Group by chainId — but single-task chains are treated as orphans (no chain)
53
53
  var chainMap = new Map();
54
54
  var orphans = [];
55
+ var tempChains = new Map();
55
56
  tasks.forEach(function(t) {
56
57
  if (t.chainId) {
57
- if (!chainMap.has(t.chainId)) chainMap.set(t.chainId, []);
58
- chainMap.get(t.chainId).push(t);
58
+ if (!tempChains.has(t.chainId)) tempChains.set(t.chainId, []);
59
+ tempChains.get(t.chainId).push(t);
59
60
  } else {
60
61
  orphans.push(t);
61
62
  }
62
63
  });
64
+ // Only keep chains with 2+ tasks; singles become orphans
65
+ tempChains.forEach(function(arr, key) {
66
+ if (arr.length > 1) { chainMap.set(key, arr); }
67
+ else { orphans = orphans.concat(arr); }
68
+ });
63
69
 
64
70
  // Sort each chain by chainSeq
65
71
  chainMap.forEach(function(arr) { arr.sort(function(a, b) { return (a.chainSeq || 0) - (b.chainSeq || 0); }); });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.257",
3
+ "version": "0.5.258",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -49,17 +49,23 @@ function injectCSS() {
49
49
  function layoutChains(tasks) {
50
50
  if (!tasks.length) return { nodes: [], edges: [], width: 0, height: 0, chains: [] };
51
51
 
52
- // Group by chainId
52
+ // Group by chainId — but single-task chains are treated as orphans (no chain)
53
53
  var chainMap = new Map();
54
54
  var orphans = [];
55
+ var tempChains = new Map();
55
56
  tasks.forEach(function(t) {
56
57
  if (t.chainId) {
57
- if (!chainMap.has(t.chainId)) chainMap.set(t.chainId, []);
58
- chainMap.get(t.chainId).push(t);
58
+ if (!tempChains.has(t.chainId)) tempChains.set(t.chainId, []);
59
+ tempChains.get(t.chainId).push(t);
59
60
  } else {
60
61
  orphans.push(t);
61
62
  }
62
63
  });
64
+ // Only keep chains with 2+ tasks; singles become orphans
65
+ tempChains.forEach(function(arr, key) {
66
+ if (arr.length > 1) { chainMap.set(key, arr); }
67
+ else { orphans = orphans.concat(arr); }
68
+ });
63
69
 
64
70
  // Sort each chain by chainSeq
65
71
  chainMap.forEach(function(arr) { arr.sort(function(a, b) { return (a.chainSeq || 0) - (b.chainSeq || 0); }); });