@agenticmail/enterprise 0.5.77 → 0.5.78

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.
package/dist/cli.js CHANGED
@@ -48,7 +48,7 @@ Skill Development:
48
48
  break;
49
49
  case "setup":
50
50
  default:
51
- import("./setup-42DBT5CL.js").then((m) => m.runSetupWizard()).catch(fatal);
51
+ import("./setup-NPFIX7LF.js").then((m) => m.runSetupWizard()).catch(fatal);
52
52
  break;
53
53
  }
54
54
  function fatal(err) {
@@ -3802,6 +3802,182 @@ var _tsToggleRow = { display: 'flex', alignItems: 'center', justifyContent: 'spa
3802
3802
  var _tsGrid = { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 };
3803
3803
  // --- EmailSection -------------------------------------------------------
3804
3804
 
3805
+ // ════════════════════════════════════════════════════════════
3806
+ // TOOLS SECTION — Toggle tool categories per agent
3807
+ // ════════════════════════════════════════════════════════════
3808
+
3809
+ function ToolsSection(props) {
3810
+ var agentId = props.agentId;
3811
+ var _d = useApp(); var toast = _d.toast;
3812
+ var _loading = useState(true); var loading = _loading[0]; var setLoading = _loading[1];
3813
+ var _cats = useState([]); var cats = _cats[0]; var setCats = _cats[1];
3814
+ var _stats = useState({}); var stats = _stats[0]; var setStats = _stats[1];
3815
+ var _saving = useState(false); var saving = _saving[0]; var setSaving = _saving[1];
3816
+ var _filter = useState('all'); var filter = _filter[0]; var setFilter = _filter[1];
3817
+ var _expanded = useState(null); var expanded = _expanded[0]; var setExpanded = _expanded[1];
3818
+
3819
+ function load() {
3820
+ setLoading(true);
3821
+ engineCall('/bridge/agents/' + agentId + '/tools')
3822
+ .then(function(d) {
3823
+ setCats(d.categories || []);
3824
+ setStats({ total: d.totalTools, enabled: d.enabledTools });
3825
+ setLoading(false);
3826
+ })
3827
+ .catch(function() { setLoading(false); });
3828
+ }
3829
+
3830
+ useEffect(function() { load(); }, [agentId]);
3831
+
3832
+ function toggle(catId, currentEnabled) {
3833
+ setSaving(true);
3834
+ var body = {};
3835
+ body[catId] = !currentEnabled;
3836
+ engineCall('/bridge/agents/' + agentId + '/tools', {
3837
+ method: 'PUT',
3838
+ body: JSON.stringify(body),
3839
+ }).then(function() {
3840
+ setCats(function(prev) {
3841
+ return prev.map(function(c) {
3842
+ return c.id === catId ? Object.assign({}, c, { enabled: !currentEnabled }) : c;
3843
+ });
3844
+ });
3845
+ setStats(function(prev) {
3846
+ var cat = cats.find(function(c) { return c.id === catId; });
3847
+ var delta = currentEnabled ? -(cat?.toolCount || 0) : (cat?.toolCount || 0);
3848
+ return Object.assign({}, prev, { enabled: (prev.enabled || 0) + delta });
3849
+ });
3850
+ toast((!currentEnabled ? 'Enabled' : 'Disabled') + ' tools', 'success');
3851
+ setSaving(false);
3852
+ }).catch(function(e) { toast(e.message, 'error'); setSaving(false); });
3853
+ }
3854
+
3855
+ function toggleAll(enable) {
3856
+ setSaving(true);
3857
+ var body = {};
3858
+ cats.forEach(function(c) { if (!c.alwaysOn) body[c.id] = enable; });
3859
+ engineCall('/bridge/agents/' + agentId + '/tools', {
3860
+ method: 'PUT',
3861
+ body: JSON.stringify(body),
3862
+ }).then(function() {
3863
+ load();
3864
+ toast(enable ? 'All tools enabled' : 'All optional tools disabled', 'success');
3865
+ setSaving(false);
3866
+ }).catch(function(e) { toast(e.message, 'error'); setSaving(false); });
3867
+ }
3868
+
3869
+ if (loading) return h('div', { className: 'card', style: { padding: 40, textAlign: 'center' } }, 'Loading tools...');
3870
+
3871
+ var filtered = cats.filter(function(c) {
3872
+ if (filter === 'enabled') return c.enabled;
3873
+ if (filter === 'disabled') return !c.enabled;
3874
+ if (filter === 'google') return c.requiresOAuth === 'google';
3875
+ if (filter === 'enterprise') return c.id.startsWith('enterprise_');
3876
+ return true;
3877
+ });
3878
+
3879
+ var googleCats = cats.filter(function(c) { return c.requiresOAuth === 'google'; });
3880
+ var googleAvailable = googleCats.some(function(c) { return c.isAvailable; });
3881
+
3882
+ return h('div', null,
3883
+ // Stats bar
3884
+ h('div', { style: { display: 'flex', gap: 16, marginBottom: 16, flexWrap: 'wrap', alignItems: 'center' } },
3885
+ h('div', { className: 'card', style: { padding: '12px 16px', flex: '1 1 auto', minWidth: 150 } },
3886
+ h('div', { style: { fontSize: 24, fontWeight: 700, color: 'var(--accent)' } }, stats.enabled || 0),
3887
+ h('div', { style: { fontSize: 12, color: 'var(--text-muted)' } }, 'of ' + (stats.total || 0) + ' tools enabled')
3888
+ ),
3889
+ h('div', { style: { display: 'flex', gap: 8 } },
3890
+ h('button', { className: 'btn btn-sm', disabled: saving, onClick: function() { toggleAll(true); } }, 'Enable All'),
3891
+ h('button', { className: 'btn btn-sm btn-danger', disabled: saving, onClick: function() { toggleAll(false); } }, 'Disable Optional')
3892
+ )
3893
+ ),
3894
+
3895
+ // Google Workspace notice
3896
+ !googleAvailable && googleCats.length > 0 && h('div', { style: { padding: '12px 16px', background: 'var(--warning-soft)', borderRadius: 'var(--radius)', marginBottom: 16, fontSize: 12 } },
3897
+ h('strong', null, '\u26A0\uFE0F Google Workspace tools require OAuth'), ' — ',
3898
+ 'Connect a Google account in the ', h('strong', null, 'Email'), ' tab to unlock Gmail, Calendar, Drive, Sheets, Docs, and Contacts tools.'
3899
+ ),
3900
+
3901
+ // Filter tabs
3902
+ h('div', { className: 'tabs', style: { marginBottom: 16 } },
3903
+ [
3904
+ { id: 'all', label: 'All' },
3905
+ { id: 'enabled', label: 'Enabled' },
3906
+ { id: 'disabled', label: 'Disabled' },
3907
+ { id: 'google', label: 'Google Workspace' },
3908
+ { id: 'enterprise', label: 'Enterprise' },
3909
+ ].map(function(f) {
3910
+ return h('div', { key: f.id, className: 'tab' + (filter === f.id ? ' active' : ''), onClick: function() { setFilter(f.id); } }, f.label);
3911
+ })
3912
+ ),
3913
+
3914
+ // Tool category cards
3915
+ h('div', { style: { display: 'grid', gap: 12 } },
3916
+ filtered.map(function(cat) {
3917
+ var isExpanded = expanded === cat.id;
3918
+ return h('div', {
3919
+ key: cat.id,
3920
+ className: 'card',
3921
+ style: { opacity: !cat.isAvailable && cat.requiresOAuth ? 0.6 : 1 }
3922
+ },
3923
+ h('div', {
3924
+ style: { display: 'flex', alignItems: 'center', gap: 12, padding: '14px 16px', cursor: 'pointer' },
3925
+ onClick: function() { setExpanded(isExpanded ? null : cat.id); }
3926
+ },
3927
+ // Icon
3928
+ h('div', { style: { fontSize: 22, width: 36, textAlign: 'center', flexShrink: 0 } }, cat.icon),
3929
+ // Info
3930
+ h('div', { style: { flex: 1, minWidth: 0 } },
3931
+ h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, marginBottom: 2 } },
3932
+ h('span', { style: { fontWeight: 600, fontSize: 14 } }, cat.name),
3933
+ h('span', { className: 'badge', style: { fontSize: 10, padding: '1px 6px', background: 'var(--bg-tertiary)', color: 'var(--text-muted)' } }, cat.toolCount + ' tools'),
3934
+ !cat.isAvailable && cat.requiresOAuth && h('span', { className: 'badge badge-warning', style: { fontSize: 10, padding: '1px 6px' } }, 'OAuth Required'),
3935
+ cat.alwaysOn && h('span', { className: 'badge badge-info', style: { fontSize: 10, padding: '1px 6px' } }, 'Always On')
3936
+ ),
3937
+ h('div', { style: { fontSize: 12, color: 'var(--text-muted)' } }, cat.description)
3938
+ ),
3939
+ // Toggle
3940
+ !cat.alwaysOn && h('div', {
3941
+ onClick: function(e) { e.stopPropagation(); if (!saving && (cat.isAvailable || cat.enabled)) toggle(cat.id, cat.enabled); },
3942
+ style: {
3943
+ width: 44, height: 24, borderRadius: 12, position: 'relative', cursor: saving ? 'not-allowed' : 'pointer',
3944
+ background: cat.enabled ? 'var(--accent)' : 'var(--border)', transition: 'background 0.2s', flexShrink: 0,
3945
+ },
3946
+ },
3947
+ h('div', { style: {
3948
+ width: 20, height: 20, borderRadius: 10, background: '#fff', position: 'absolute', top: 2,
3949
+ left: cat.enabled ? 22 : 2, transition: 'left 0.2s',
3950
+ boxShadow: '0 1px 3px rgba(0,0,0,0.2)',
3951
+ } })
3952
+ ),
3953
+ cat.alwaysOn && h('div', { style: { width: 44, height: 24, flexShrink: 0 } }),
3954
+ // Expand arrow
3955
+ h('div', { style: { fontSize: 12, color: 'var(--text-muted)', marginLeft: 4 } }, isExpanded ? '\u25B2' : '\u25BC')
3956
+ ),
3957
+
3958
+ // Expanded tool list
3959
+ isExpanded && h('div', { style: { borderTop: '1px solid var(--border)', padding: '12px 16px', background: 'var(--bg-secondary)' } },
3960
+ h('div', { style: { display: 'flex', flexWrap: 'wrap', gap: 6 } },
3961
+ cat.tools.map(function(t) {
3962
+ return h('span', {
3963
+ key: t,
3964
+ style: {
3965
+ display: 'inline-block', padding: '3px 10px', borderRadius: 4, fontSize: 11,
3966
+ fontFamily: 'var(--font-mono)', background: cat.enabled ? 'var(--accent-soft)' : 'var(--bg-tertiary)',
3967
+ color: cat.enabled ? 'var(--accent)' : 'var(--text-muted)', border: '1px solid ' + (cat.enabled ? 'var(--accent)' : 'var(--border)'),
3968
+ }
3969
+ }, t);
3970
+ })
3971
+ )
3972
+ )
3973
+ );
3974
+ })
3975
+ ),
3976
+
3977
+ filtered.length === 0 && h('div', { style: { textAlign: 'center', padding: 40, color: 'var(--text-muted)' } }, 'No tools match this filter.')
3978
+ );
3979
+ }
3980
+
3805
3981
  function EmailSection(props) {
3806
3982
  var agentId = props.agentId;
3807
3983
  var engineAgent = props.engineAgent || {};
@@ -4588,8 +4764,8 @@ function AgentDetailPage(props) {
4588
4764
  var _agents = useState([]);
4589
4765
  var agents = _agents[0]; var setAgents = _agents[1];
4590
4766
 
4591
- var TABS = ['overview', 'personal', 'email', 'configuration', 'manager', 'skills', 'permissions', 'activity', 'communication', 'workforce', 'memory', 'guardrails', 'budget', 'tool-security', 'deployment'];
4592
- var TAB_LABELS = { 'tool-security': 'Tool Security', 'manager': 'Manager & Catch-Up', 'email': 'Email' };
4767
+ var TABS = ['overview', 'personal', 'email', 'configuration', 'manager', 'tools', 'skills', 'permissions', 'activity', 'communication', 'workforce', 'memory', 'guardrails', 'budget', 'tool-security', 'deployment'];
4768
+ var TAB_LABELS = { 'tool-security': 'Tool Security', 'manager': 'Manager & Catch-Up', 'email': 'Email', 'tools': 'Tools' };
4593
4769
 
4594
4770
  var load = function() {
4595
4771
  setLoading(true);
@@ -4713,6 +4889,7 @@ function AgentDetailPage(props) {
4713
4889
  tab === 'email' && h(EmailSection, { agentId: agentId, engineAgent: engineAgent, reload: load }),
4714
4890
  tab === 'configuration' && h(ConfigurationSection, { agentId: agentId, engineAgent: engineAgent, reload: load }),
4715
4891
  tab === 'manager' && h(ManagerCatchUpSection, { agentId: agentId, engineAgent: engineAgent, agents: agents, reload: load }),
4892
+ tab === 'tools' && h(ToolsSection, { agentId: agentId, engineAgent: engineAgent, reload: load }),
4716
4893
  tab === 'skills' && h(SkillsSection, { agentId: agentId, engineAgent: engineAgent, reload: load }),
4717
4894
  tab === 'permissions' && h(PermissionsSection, { agentId: agentId, profile: profile, reload: load }),
4718
4895
  tab === 'activity' && h(ActivitySection, { agentId: agentId }),
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ import {
35
35
  executeTool,
36
36
  runAgentLoop,
37
37
  toolsToDefinitions
38
- } from "./chunk-T36SA4K3.js";
38
+ } from "./chunk-GINZ56GG.js";
39
39
  import "./chunk-TYW5XTOW.js";
40
40
  import {
41
41
  ValidationError,
@@ -50,11 +50,11 @@ import {
50
50
  requireRole,
51
51
  securityHeaders,
52
52
  validate
53
- } from "./chunk-2HOTPWQ6.js";
53
+ } from "./chunk-CYABMD5B.js";
54
54
  import {
55
55
  provision,
56
56
  runSetupWizard
57
- } from "./chunk-7S5VMGP7.js";
57
+ } from "./chunk-NRKB2KGD.js";
58
58
  import {
59
59
  ENGINE_TABLES,
60
60
  ENGINE_TABLES_POSTGRES,