feat(gmail): add filter creation tool and auth scope
This commit is contained in:
@@ -18,6 +18,10 @@ const ALL_TOOL_NAMES = [
|
||||
'memory.read',
|
||||
'memory.write',
|
||||
'memory.search',
|
||||
'gmail.list',
|
||||
'gmail.search',
|
||||
'gmail.read',
|
||||
'gmail.filter.create',
|
||||
'minio.share',
|
||||
'minio.ingest',
|
||||
'minio.sync',
|
||||
@@ -146,7 +150,7 @@ describe('ToolPolicy', () => {
|
||||
expect(names).not.toContain('mcp:filesystem:read_file');
|
||||
});
|
||||
|
||||
it('messaging profile includes memory and web search', () => {
|
||||
it('messaging profile includes memory, web search, and gmail tools', () => {
|
||||
const policy = new ToolPolicy(defaultConfig({ profile: 'messaging' }));
|
||||
const result = policy.filterTools(ALL_TOOLS);
|
||||
const names = result.map(t => t.name);
|
||||
@@ -155,6 +159,10 @@ describe('ToolPolicy', () => {
|
||||
expect(names).toContain('memory.write');
|
||||
expect(names).toContain('web.search');
|
||||
expect(names).toContain('web.search.news');
|
||||
expect(names).toContain('gmail.list');
|
||||
expect(names).toContain('gmail.search');
|
||||
expect(names).toContain('gmail.read');
|
||||
expect(names).toContain('gmail.filter.create');
|
||||
expect(names).not.toContain('shell.exec');
|
||||
expect(names).not.toContain('file.write');
|
||||
});
|
||||
@@ -503,6 +511,21 @@ describe('ToolPolicy', () => {
|
||||
expect(names).not.toContain('shell.exec');
|
||||
});
|
||||
|
||||
it('expands group:gmail', () => {
|
||||
const policy = new ToolPolicy(defaultConfig({
|
||||
profile: 'minimal',
|
||||
allow: ['group:gmail'],
|
||||
}));
|
||||
const result = policy.filterTools(ALL_TOOLS);
|
||||
const names = result.map(t => t.name);
|
||||
expect(names).toContain('gmail.list');
|
||||
expect(names).toContain('gmail.search');
|
||||
expect(names).toContain('gmail.read');
|
||||
expect(names).toContain('gmail.filter.create');
|
||||
expect(names).toContain('file.read');
|
||||
expect(names).not.toContain('shell.exec');
|
||||
});
|
||||
|
||||
it('expands group:k8s', () => {
|
||||
const policy = new ToolPolicy(defaultConfig({
|
||||
profile: 'minimal',
|
||||
|
||||
Reference in New Issue
Block a user