@circleback/cli 0.4.0 → 0.4.1
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/commands/actionItems.js +16 -47
- package/dist/commands/calendar.js +9 -35
- package/dist/commands/companies.js +4 -20
- package/dist/commands/emails.js +11 -26
- package/dist/commands/meetings.js +26 -65
- package/dist/commands/profiles.js +4 -20
- package/dist/commands/support.js +7 -22
- package/dist/commands/tags.js +3 -20
- package/dist/commands/transcripts.js +19 -46
- package/dist/constants.js +1 -4
- package/dist/helpers/command.js +19 -0
- package/dist/helpers/date.js +10 -1
- package/dist/helpers/formatter.js +16 -13
- package/dist/helpers/parse.js +3 -1
- package/dist/helpers/tag.js +2 -1
- package/dist/types.js +15 -1
- package/package.json +1 -1
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchActionItemsCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const jsonRpc_1 = require("../client/jsonRpc");
|
|
6
5
|
const constants_1 = require("../constants");
|
|
6
|
+
const command_1 = require("../helpers/command");
|
|
7
7
|
const date_1 = require("../helpers/date");
|
|
8
|
-
const error_1 = require("../helpers/error");
|
|
9
|
-
const output_1 = require("../helpers/output");
|
|
10
|
-
const formatter_1 = require("../helpers/formatter");
|
|
11
8
|
const parse_1 = require("../helpers/parse");
|
|
12
9
|
const tag_1 = require("../helpers/tag");
|
|
10
|
+
const types_1 = require("../types");
|
|
13
11
|
const DEFAULT_ACTION_ITEMS_SEARCH_LAST_DAYS = 30;
|
|
14
|
-
exports.searchActionItemsCommand = new commander_1.Command('search')
|
|
12
|
+
exports.searchActionItemsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('search')
|
|
15
13
|
.description('Search action items.')
|
|
16
14
|
.argument('[search]', 'Search term')
|
|
17
15
|
.option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
|
|
@@ -20,45 +18,16 @@ exports.searchActionItemsCommand = new commander_1.Command('search')
|
|
|
20
18
|
.option('--from <date>', constants_1.START_DATE_OPTION_DESCRIPTION)
|
|
21
19
|
.option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
|
|
22
20
|
.option('--tags <tags>', constants_1.TAGS_OPTION_DESCRIPTION)
|
|
23
|
-
.option('--assignee <id>', 'Filter by assignee profile ID')
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (query)
|
|
37
|
-
args['searchTerms'] = [query];
|
|
38
|
-
if (options.status)
|
|
39
|
-
args['status'] = options.status;
|
|
40
|
-
if (options.last) {
|
|
41
|
-
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
|
|
42
|
-
}
|
|
43
|
-
else if (options.from) {
|
|
44
|
-
args['startDate'] = options.from;
|
|
45
|
-
}
|
|
46
|
-
else if (!query) {
|
|
47
|
-
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)(DEFAULT_ACTION_ITEMS_SEARCH_LAST_DAYS);
|
|
48
|
-
}
|
|
49
|
-
if (options.to)
|
|
50
|
-
args['endDate'] = options.to;
|
|
51
|
-
if (options.tags) {
|
|
52
|
-
args['tags'] = await (0, tag_1.resolveTagValues)(options.tags);
|
|
53
|
-
}
|
|
54
|
-
if (options.assignee)
|
|
55
|
-
args['assigneeProfileId'] = (0, parse_1.parseIntOption)(options.assignee, '--assignee');
|
|
56
|
-
const result = await (0, jsonRpc_1.callTool)('SearchActionItems', args);
|
|
57
|
-
(0, formatter_1.formatOutput)('SearchActionItems', result, jsonMode);
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
const message = error instanceof Error ? error.message : constants_1.SEARCH_FAILED_ERROR;
|
|
61
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
21
|
+
.option('--assignee <id>', 'Filter by assignee profile ID'), types_1.ToolName.SearchActionItems, async (query, options) => ({
|
|
22
|
+
intent: query ?? 'Listing recent action items.',
|
|
23
|
+
pageIndex: (0, parse_1.parseIntOption)(options.page, '--page'),
|
|
24
|
+
searchTerms: query ? [query] : undefined,
|
|
25
|
+
status: options.status || undefined,
|
|
26
|
+
startDate: (0, date_1.getStartDate)(options) ??
|
|
27
|
+
(query
|
|
28
|
+
? undefined
|
|
29
|
+
: (0, date_1.getStartDateFromDaysAgo)(DEFAULT_ACTION_ITEMS_SEARCH_LAST_DAYS)),
|
|
30
|
+
endDate: options.to || undefined,
|
|
31
|
+
tags: options.tags ? await (0, tag_1.resolveTagValues)(options.tags) : undefined,
|
|
32
|
+
assigneeProfileId: (0, parse_1.parseOptionalIntOption)(options.assignee, '--assignee'),
|
|
33
|
+
}));
|
|
@@ -2,43 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchCalendarCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const jsonRpc_1 = require("../client/jsonRpc");
|
|
6
5
|
const constants_1 = require("../constants");
|
|
6
|
+
const command_1 = require("../helpers/command");
|
|
7
7
|
const date_1 = require("../helpers/date");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const formatter_1 = require("../helpers/formatter");
|
|
11
|
-
const parse_1 = require("../helpers/parse");
|
|
12
|
-
exports.searchCalendarCommand = new commander_1.Command('search')
|
|
8
|
+
const types_1 = require("../types");
|
|
9
|
+
exports.searchCalendarCommand = (0, command_1.defineToolCommand)(new commander_1.Command('search')
|
|
13
10
|
.description('Search calendar events.')
|
|
14
11
|
.option('--last <days>', 'Show events from the last N days')
|
|
15
12
|
.option('--from <date>', constants_1.START_DATE_OPTION_DESCRIPTION)
|
|
16
|
-
.option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
const jsonMode = exports.searchCalendarCommand.parent?.parent?.opts().json ?? false;
|
|
24
|
-
const args = {
|
|
25
|
-
intent: 'Listing calendar events.',
|
|
26
|
-
pageIndex: 0,
|
|
27
|
-
};
|
|
28
|
-
if (options.last) {
|
|
29
|
-
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
|
|
30
|
-
}
|
|
31
|
-
else if (options.from) {
|
|
32
|
-
args['startDate'] = options.from;
|
|
33
|
-
}
|
|
34
|
-
if (options.to)
|
|
35
|
-
args['endDate'] = options.to;
|
|
36
|
-
const result = await (0, jsonRpc_1.callTool)('SearchCalendarEvents', args);
|
|
37
|
-
(0, formatter_1.formatOutput)('SearchCalendarEvents', result, jsonMode);
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
const message = error instanceof Error ? error.message : 'Calendar search failed.';
|
|
41
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
13
|
+
.option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION), types_1.ToolName.SearchCalendarEvents, (options) => ({
|
|
14
|
+
intent: 'Listing calendar events.',
|
|
15
|
+
pageIndex: 0,
|
|
16
|
+
startDate: (0, date_1.getStartDate)(options),
|
|
17
|
+
endDate: options.to || undefined,
|
|
18
|
+
}));
|
|
@@ -2,24 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchCompaniesCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const formatter_1 = require("../helpers/formatter");
|
|
9
|
-
exports.searchCompaniesCommand = new commander_1.Command('search')
|
|
5
|
+
const command_1 = require("../helpers/command");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
exports.searchCompaniesCommand = (0, command_1.defineToolCommand)(new commander_1.Command('search')
|
|
10
8
|
.description('Search companies.')
|
|
11
|
-
.argument('<terms...>', 'Search terms for company names or domains')
|
|
12
|
-
.action(async (terms) => {
|
|
13
|
-
try {
|
|
14
|
-
const jsonMode = exports.searchCompaniesCommand.parent?.parent?.opts().json ?? false;
|
|
15
|
-
const result = await (0, jsonRpc_1.callTool)('FindCompanies', {
|
|
16
|
-
searchTerms: terms,
|
|
17
|
-
});
|
|
18
|
-
(0, formatter_1.formatOutput)('FindCompanies', result, jsonMode);
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
const message = error instanceof Error ? error.message : 'Company search failed.';
|
|
22
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
9
|
+
.argument('<terms...>', 'Search terms for company names or domains'), types_1.ToolName.FindCompanies, (terms) => ({ searchTerms: terms }));
|
package/dist/commands/emails.js
CHANGED
|
@@ -2,35 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchEmailsCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const jsonRpc_1 = require("../client/jsonRpc");
|
|
6
5
|
const constants_1 = require("../constants");
|
|
7
|
-
const
|
|
8
|
-
const output_1 = require("../helpers/output");
|
|
9
|
-
const formatter_1 = require("../helpers/formatter");
|
|
6
|
+
const command_1 = require("../helpers/command");
|
|
10
7
|
const parse_1 = require("../helpers/parse");
|
|
11
|
-
|
|
8
|
+
const types_1 = require("../types");
|
|
9
|
+
exports.searchEmailsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('search')
|
|
12
10
|
.description('Search connected email accounts. Supports filters: from:email, to:email, participant:email, before:YYYY-MM-DD, after:YYYY-MM-DD.')
|
|
13
11
|
.argument('[search]', 'Search term')
|
|
14
|
-
.option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (query !== undefined && query.trim() === '') {
|
|
18
|
-
(0, output_1.printText)('Search term cannot be empty.', output_1.TextType.Error);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
const jsonMode = exports.searchEmailsCommand.parent?.parent?.opts().json ?? false;
|
|
22
|
-
const pageIndex = (0, parse_1.parseIntOption)(options.page, '--page');
|
|
23
|
-
const args = {
|
|
24
|
-
intent: query ?? 'Listing recent emails.',
|
|
25
|
-
pageIndex,
|
|
26
|
-
};
|
|
27
|
-
args['searchTerm'] = query ?? '';
|
|
28
|
-
const result = await (0, jsonRpc_1.callTool)('SearchEmails', args);
|
|
29
|
-
(0, formatter_1.formatOutput)('SearchEmails', result, jsonMode);
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
const message = error instanceof Error ? error.message : 'Email search failed.';
|
|
33
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
34
|
-
process.exit(1);
|
|
12
|
+
.option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0'), types_1.ToolName.SearchEmails, (query, options) => {
|
|
13
|
+
if (query?.trim() === '') {
|
|
14
|
+
throw new Error('Search term cannot be empty.');
|
|
35
15
|
}
|
|
16
|
+
return {
|
|
17
|
+
intent: query ?? 'Listing recent emails.',
|
|
18
|
+
pageIndex: (0, parse_1.parseIntOption)(options.page, '--page'),
|
|
19
|
+
searchTerm: query ?? '',
|
|
20
|
+
};
|
|
36
21
|
});
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readMeetingsCommand = exports.searchMeetingsCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const jsonRpc_1 = require("../client/jsonRpc");
|
|
6
5
|
const constants_1 = require("../constants");
|
|
6
|
+
const command_1 = require("../helpers/command");
|
|
7
7
|
const date_1 = require("../helpers/date");
|
|
8
|
-
const error_1 = require("../helpers/error");
|
|
9
|
-
const output_1 = require("../helpers/output");
|
|
10
|
-
const formatter_1 = require("../helpers/formatter");
|
|
11
8
|
const parse_1 = require("../helpers/parse");
|
|
12
9
|
const tag_1 = require("../helpers/tag");
|
|
10
|
+
const types_1 = require("../types");
|
|
13
11
|
const DEFAULT_MEETINGS_SEARCH_LAST_DAYS = 7;
|
|
14
|
-
exports.searchMeetingsCommand = new commander_1.Command('search')
|
|
12
|
+
exports.searchMeetingsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('search')
|
|
15
13
|
.description('Search meetings.')
|
|
16
14
|
.argument('[search]', 'Search term')
|
|
17
15
|
.option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
|
|
@@ -20,65 +18,28 @@ exports.searchMeetingsCommand = new commander_1.Command('search')
|
|
|
20
18
|
.option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
|
|
21
19
|
.option('--tags <tags>', constants_1.TAGS_OPTION_DESCRIPTION)
|
|
22
20
|
.option('--profiles <ids>', constants_1.PROFILES_OPTION_DESCRIPTION)
|
|
23
|
-
.option('--domains <domains>', constants_1.DOMAINS_OPTION_DESCRIPTION)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
|
|
40
|
-
}
|
|
41
|
-
else if (options.from) {
|
|
42
|
-
args['startDate'] = options.from;
|
|
43
|
-
}
|
|
44
|
-
else if (!query) {
|
|
45
|
-
args['startDate'] = (0, date_1.getStartDateFromDaysAgo)(DEFAULT_MEETINGS_SEARCH_LAST_DAYS);
|
|
46
|
-
}
|
|
47
|
-
if (options.to)
|
|
48
|
-
args['endDate'] = options.to;
|
|
49
|
-
if (options.tags) {
|
|
50
|
-
args['tags'] = await (0, tag_1.resolveTagValues)(options.tags);
|
|
51
|
-
}
|
|
52
|
-
if (options.profiles)
|
|
53
|
-
args['profiles'] = (0, parse_1.parseNumericIds)(options.profiles, 'profile ID');
|
|
54
|
-
if (options.domains)
|
|
55
|
-
args['domains'] = options.domains.split(',');
|
|
56
|
-
const result = await (0, jsonRpc_1.callTool)('SearchMeetings', args);
|
|
57
|
-
(0, formatter_1.formatOutput)('SearchMeetings', result, jsonMode);
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
const message = error instanceof Error ? error.message : constants_1.SEARCH_FAILED_ERROR;
|
|
61
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
exports.readMeetingsCommand = new commander_1.Command('read')
|
|
21
|
+
.option('--domains <domains>', constants_1.DOMAINS_OPTION_DESCRIPTION), types_1.ToolName.SearchMeetings, async (query, options) => ({
|
|
22
|
+
intent: query ?? 'Listing recent meetings.',
|
|
23
|
+
pageIndex: (0, parse_1.parseIntOption)(options.page, '--page'),
|
|
24
|
+
searchTerm: query,
|
|
25
|
+
startDate: (0, date_1.getStartDate)(options) ??
|
|
26
|
+
(query
|
|
27
|
+
? undefined
|
|
28
|
+
: (0, date_1.getStartDateFromDaysAgo)(DEFAULT_MEETINGS_SEARCH_LAST_DAYS)),
|
|
29
|
+
endDate: options.to || undefined,
|
|
30
|
+
tags: options.tags ? await (0, tag_1.resolveTagValues)(options.tags) : undefined,
|
|
31
|
+
profiles: options.profiles
|
|
32
|
+
? (0, parse_1.parseNumericIds)(options.profiles, 'profile ID')
|
|
33
|
+
: undefined,
|
|
34
|
+
domains: options.domains ? options.domains.split(',') : undefined,
|
|
35
|
+
}));
|
|
36
|
+
exports.readMeetingsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('read')
|
|
66
37
|
.description('Get detailed meeting information.')
|
|
67
|
-
.argument('<ids...>', `Meeting IDs (max ${constants_1.MAX_READ_MEETING_IDENTIFIERS})`)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
intent: `Reading meeting details for IDs: ${meetingIds.join(', ')}.`,
|
|
75
|
-
meetingIds,
|
|
76
|
-
});
|
|
77
|
-
(0, formatter_1.formatOutput)('ReadMeetings', result, jsonMode);
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
const message = error instanceof Error ? error.message : constants_1.READ_FAILED_ERROR;
|
|
81
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
82
|
-
process.exit(1);
|
|
83
|
-
}
|
|
38
|
+
.argument('<ids...>', `Meeting IDs (max ${constants_1.MAX_READ_MEETING_IDENTIFIERS})`), types_1.ToolName.ReadMeetings, (ids) => {
|
|
39
|
+
const meetingIds = (0, parse_1.validateMeetingIdentifiers)(ids);
|
|
40
|
+
(0, parse_1.validateReadMeetingIdentifierLimit)(meetingIds);
|
|
41
|
+
return {
|
|
42
|
+
intent: `Reading meeting details for IDs: ${meetingIds.join(', ')}.`,
|
|
43
|
+
meetingIds,
|
|
44
|
+
};
|
|
84
45
|
});
|
|
@@ -2,24 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchProfilesCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const formatter_1 = require("../helpers/formatter");
|
|
9
|
-
exports.searchProfilesCommand = new commander_1.Command('search')
|
|
5
|
+
const command_1 = require("../helpers/command");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
exports.searchProfilesCommand = (0, command_1.defineToolCommand)(new commander_1.Command('search')
|
|
10
8
|
.description('Search people by name.')
|
|
11
|
-
.argument('<names...>', 'Names to search for')
|
|
12
|
-
.action(async (names) => {
|
|
13
|
-
try {
|
|
14
|
-
const jsonMode = exports.searchProfilesCommand.parent?.parent?.opts().json ?? false;
|
|
15
|
-
const result = await (0, jsonRpc_1.callTool)('FindProfiles', {
|
|
16
|
-
searchTerms: names,
|
|
17
|
-
});
|
|
18
|
-
(0, formatter_1.formatOutput)('FindProfiles', result, jsonMode);
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
const message = error instanceof Error ? error.message : 'People search failed.';
|
|
22
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
9
|
+
.argument('<names...>', 'Names to search for'), types_1.ToolName.FindProfiles, (names) => ({ searchTerms: names }));
|
package/dist/commands/support.js
CHANGED
|
@@ -2,26 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchSupportCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const formatter_1 = require("../helpers/formatter");
|
|
9
|
-
exports.searchSupportCommand = new commander_1.Command('search')
|
|
5
|
+
const command_1 = require("../helpers/command");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
exports.searchSupportCommand = (0, command_1.defineToolCommand)(new commander_1.Command('search')
|
|
10
8
|
.description('Search Circleback support articles.')
|
|
11
|
-
.argument('[search]', 'Search term')
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const args = {
|
|
16
|
-
intent: query ?? 'Listing support articles.',
|
|
17
|
-
};
|
|
18
|
-
args['searchTerm'] = query ?? '';
|
|
19
|
-
const result = await (0, jsonRpc_1.callTool)('SearchSupportArticles', args);
|
|
20
|
-
(0, formatter_1.formatOutput)('SearchSupportArticles', result, jsonMode);
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
const message = error instanceof Error ? error.message : 'Support search failed.';
|
|
24
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
9
|
+
.argument('[search]', 'Search term'), types_1.ToolName.SearchSupportArticles, (query) => ({
|
|
10
|
+
intent: query ?? 'Listing support articles.',
|
|
11
|
+
searchTerm: query ?? '',
|
|
12
|
+
}));
|
package/dist/commands/tags.js
CHANGED
|
@@ -2,23 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listTagsCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const formatter_1 = require("../helpers/formatter");
|
|
9
|
-
exports.listTagsCommand = new commander_1.Command('list')
|
|
10
|
-
.description('List all tags.')
|
|
11
|
-
.action(async () => {
|
|
12
|
-
try {
|
|
13
|
-
const jsonMode = exports.listTagsCommand.parent?.parent?.opts().json ?? false;
|
|
14
|
-
const result = await (0, jsonRpc_1.callTool)('ListTags', {
|
|
15
|
-
intent: 'Listing all tags.',
|
|
16
|
-
});
|
|
17
|
-
(0, formatter_1.formatOutput)('ListTags', result, jsonMode);
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
const message = error instanceof Error ? error.message : 'Failed to list tags.';
|
|
21
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
5
|
+
const command_1 = require("../helpers/command");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
exports.listTagsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('list').description('List all tags.'), types_1.ToolName.ListTags, () => ({ intent: 'Listing all tags.' }));
|
|
@@ -2,60 +2,33 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTranscriptsCommand = exports.searchTranscriptsCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
-
const jsonRpc_1 = require("../client/jsonRpc");
|
|
6
5
|
const constants_1 = require("../constants");
|
|
7
|
-
const
|
|
8
|
-
const output_1 = require("../helpers/output");
|
|
9
|
-
const formatter_1 = require("../helpers/formatter");
|
|
6
|
+
const command_1 = require("../helpers/command");
|
|
10
7
|
const parse_1 = require("../helpers/parse");
|
|
11
8
|
const tag_1 = require("../helpers/tag");
|
|
12
|
-
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
exports.searchTranscriptsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('search')
|
|
13
11
|
.description('Search meeting transcripts.')
|
|
14
12
|
.argument('<search>', 'Search term')
|
|
15
13
|
.option('--tags <tags>', constants_1.TAGS_OPTION_DESCRIPTION)
|
|
16
14
|
.option('--profiles <ids>', constants_1.PROFILES_OPTION_DESCRIPTION)
|
|
17
15
|
.option('--domains <domains>', constants_1.DOMAINS_OPTION_DESCRIPTION)
|
|
18
|
-
.showHelpAfterError(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
if (options.profiles)
|
|
30
|
-
args['profiles'] = (0, parse_1.parseNumericIds)(options.profiles, 'profile ID');
|
|
31
|
-
if (options.domains)
|
|
32
|
-
args['domains'] = options.domains.split(',');
|
|
33
|
-
const result = await (0, jsonRpc_1.callTool)('SearchTranscripts', args);
|
|
34
|
-
(0, formatter_1.formatOutput)('SearchTranscripts', result, jsonMode);
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
const message = error instanceof Error ? error.message : 'Transcript search failed.';
|
|
38
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
exports.getTranscriptsCommand = new commander_1.Command('read')
|
|
16
|
+
.showHelpAfterError(), types_1.ToolName.SearchTranscripts, async (query, options) => ({
|
|
17
|
+
intent: query,
|
|
18
|
+
searchTerm: query,
|
|
19
|
+
tags: options.tags ? await (0, tag_1.resolveTagValues)(options.tags) : undefined,
|
|
20
|
+
profiles: options.profiles
|
|
21
|
+
? (0, parse_1.parseNumericIds)(options.profiles, 'profile ID')
|
|
22
|
+
: undefined,
|
|
23
|
+
domains: options.domains ? options.domains.split(',') : undefined,
|
|
24
|
+
}));
|
|
25
|
+
exports.getTranscriptsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('read')
|
|
43
26
|
.description('Get full meeting transcripts.')
|
|
44
27
|
.argument('<ids...>', 'Meeting IDs (max 50)')
|
|
45
|
-
.showHelpAfterError(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
intent: `Getting transcripts for meetings with IDs: ${meetingIds.join(', ')}.`,
|
|
52
|
-
meetingIds,
|
|
53
|
-
});
|
|
54
|
-
(0, formatter_1.formatOutput)('GetTranscriptsForMeetings', result, jsonMode);
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
const message = error instanceof Error ? error.message : 'Transcript retrieval failed.';
|
|
58
|
-
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
28
|
+
.showHelpAfterError(), types_1.ToolName.GetTranscriptsForMeetings, (ids) => {
|
|
29
|
+
const meetingIds = (0, parse_1.validateMeetingIdentifiers)(ids);
|
|
30
|
+
return {
|
|
31
|
+
intent: `Getting transcripts for meetings with IDs: ${meetingIds.join(', ')}.`,
|
|
32
|
+
meetingIds,
|
|
33
|
+
};
|
|
61
34
|
});
|
package/dist/constants.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.DOMAINS_OPTION_DESCRIPTION = exports.PROFILES_OPTION_DESCRIPTION = exports.TAGS_OPTION_DESCRIPTION = exports.END_DATE_OPTION_DESCRIPTION = exports.START_DATE_OPTION_DESCRIPTION = exports.PAGE_OPTION_DESCRIPTION = exports.UNASSIGNED_ACTION_ITEM_ASSIGNEE_LABEL = exports.DEFAULT_MEETING_NAME = exports.MAX_READ_MEETING_IDENTIFIERS = exports.CALLBACK_TIMEOUT_MILLISECONDS = exports.OAUTH_SCOPE = exports.TOKENS_FILE = exports.CONFIG_DIRECTORY = exports.ASCII_LOGO = exports.SECONDARY_COLOR = exports.BRAND_COLOR = exports.API_KEY_SETTINGS_URL = exports.API_KEY_ENVIRONMENT_VARIABLE = exports.API_KEY_PREFIX = exports.CLIENT_VERSION_HEADER = exports.CLIENT_VERSION = exports.CLIENT_PACKAGE_NAME = exports.CLIENT_NAME = exports.BASE_URL = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const node_os_1 = __importDefault(require("node:os"));
|
|
@@ -54,6 +54,3 @@ exports.END_DATE_OPTION_DESCRIPTION = 'End date (YYYY-MM-DD)';
|
|
|
54
54
|
exports.TAGS_OPTION_DESCRIPTION = 'Comma-separated tag names or IDs';
|
|
55
55
|
exports.PROFILES_OPTION_DESCRIPTION = 'Comma-separated profile IDs';
|
|
56
56
|
exports.DOMAINS_OPTION_DESCRIPTION = 'Comma-separated domains';
|
|
57
|
-
exports.LAST_AND_FROM_CONFLICT_ERROR = 'Cannot use --last and --from together.';
|
|
58
|
-
exports.SEARCH_FAILED_ERROR = 'Search failed.';
|
|
59
|
-
exports.READ_FAILED_ERROR = 'Read failed.';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineToolCommand = void 0;
|
|
4
|
+
const jsonRpc_1 = require("../client/jsonRpc");
|
|
5
|
+
const error_1 = require("./error");
|
|
6
|
+
const formatter_1 = require("./formatter");
|
|
7
|
+
const output_1 = require("./output");
|
|
8
|
+
const defineToolCommand = (command, toolName, getArguments) => command.action(async (...args) => {
|
|
9
|
+
try {
|
|
10
|
+
const result = await (0, jsonRpc_1.callTool)(toolName, await getArguments(...args));
|
|
11
|
+
(0, formatter_1.formatOutput)(toolName, result, Boolean(command.optsWithGlobals().json));
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
const message = error instanceof Error ? error.message : `${toolName} failed.`;
|
|
15
|
+
(0, output_1.printText)((0, error_1.formatMcpError)(message) ?? message, output_1.TextType.Error);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
exports.defineToolCommand = defineToolCommand;
|
package/dist/helpers/date.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatDateTime = exports.formatDate = exports.getStartDateFromDaysAgo = void 0;
|
|
3
|
+
exports.formatDateTime = exports.formatDate = exports.getStartDate = exports.getStartDateFromDaysAgo = void 0;
|
|
4
|
+
const parse_1 = require("./parse");
|
|
4
5
|
const getStartDateFromDaysAgo = (days) => new Date(Date.now() - days * 86400000).toISOString().slice(0, 10);
|
|
5
6
|
exports.getStartDateFromDaysAgo = getStartDateFromDaysAgo;
|
|
7
|
+
const getStartDate = ({ last, from, }) => {
|
|
8
|
+
if (last && from)
|
|
9
|
+
throw new Error('Cannot use --last and --from together.');
|
|
10
|
+
return last
|
|
11
|
+
? (0, exports.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(last, '--last'))
|
|
12
|
+
: from || undefined;
|
|
13
|
+
};
|
|
14
|
+
exports.getStartDate = getStartDate;
|
|
6
15
|
const formatDate = (dateString) => {
|
|
7
16
|
const date = new Date(dateString);
|
|
8
17
|
return date.toLocaleDateString('en-US', {
|
|
@@ -5,35 +5,38 @@ const table_1 = require("./table");
|
|
|
5
5
|
const parse_1 = require("./parse");
|
|
6
6
|
const output_1 = require("./output");
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
|
+
const types_1 = require("../types");
|
|
8
9
|
const stringify = (value) => typeof value === 'string' ? value : JSON.stringify(value, null, 2);
|
|
9
10
|
const formatForTool = (toolName, data) => {
|
|
10
11
|
if (!Array.isArray(data))
|
|
11
12
|
return;
|
|
12
13
|
switch (toolName) {
|
|
13
|
-
case
|
|
14
|
+
case types_1.ToolName.SearchMeetings:
|
|
14
15
|
return (0, table_1.formatMeetingsList)(data);
|
|
15
|
-
case
|
|
16
|
+
case types_1.ToolName.ReadMeetings:
|
|
16
17
|
return (0, table_1.formatMeetingDetails)(data);
|
|
17
|
-
case
|
|
18
|
+
case types_1.ToolName.GetTranscriptsForMeetings:
|
|
18
19
|
return (0, table_1.formatTranscriptReadResults)(data);
|
|
19
|
-
case
|
|
20
|
+
case types_1.ToolName.SearchTranscripts:
|
|
20
21
|
return (0, table_1.formatTranscriptSearchResults)(data);
|
|
21
|
-
case
|
|
22
|
+
case types_1.ToolName.SearchCalendarEvents:
|
|
22
23
|
return (0, table_1.formatCalendarEvents)(data);
|
|
23
|
-
case
|
|
24
|
+
case types_1.ToolName.FindProfiles:
|
|
24
25
|
return (0, table_1.formatProfiles)(data);
|
|
25
|
-
case
|
|
26
|
+
case types_1.ToolName.FindCompanies:
|
|
26
27
|
return (0, table_1.formatCompanies)(data);
|
|
27
|
-
case
|
|
28
|
+
case types_1.ToolName.SearchSupportArticles:
|
|
28
29
|
return (0, table_1.formatSupportArticles)(data);
|
|
29
|
-
case
|
|
30
|
+
case types_1.ToolName.SearchEmails:
|
|
30
31
|
return (0, table_1.formatEmails)(data);
|
|
31
|
-
case
|
|
32
|
+
case types_1.ToolName.SearchActionItems:
|
|
32
33
|
return (0, table_1.formatActionItems)(data);
|
|
33
|
-
case
|
|
34
|
+
case types_1.ToolName.ListTags:
|
|
34
35
|
return (0, table_1.formatTags)(data);
|
|
35
|
-
default:
|
|
36
|
-
|
|
36
|
+
default: {
|
|
37
|
+
const _absurd = toolName;
|
|
38
|
+
return _absurd;
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
};
|
|
39
42
|
const formatOutput = (toolName, rawText, jsonMode) => {
|
package/dist/helpers/parse.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateReadMeetingIdentifierLimit = exports.validateMeetingIdentifiers = exports.parseNumericIds = exports.parseIntOption = exports.extractAndValidateObjectFromString = void 0;
|
|
3
|
+
exports.validateReadMeetingIdentifierLimit = exports.validateMeetingIdentifiers = exports.parseNumericIds = exports.parseOptionalIntOption = exports.parseIntOption = exports.extractAndValidateObjectFromString = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const output_1 = require("./output");
|
|
@@ -29,6 +29,8 @@ const parseIntOption = (value, flagName) => {
|
|
|
29
29
|
return result.data;
|
|
30
30
|
};
|
|
31
31
|
exports.parseIntOption = parseIntOption;
|
|
32
|
+
const parseOptionalIntOption = (value, flagName) => (value ? (0, exports.parseIntOption)(value, flagName) : undefined);
|
|
33
|
+
exports.parseOptionalIntOption = parseOptionalIntOption;
|
|
32
34
|
const parseNumericIds = (value, label) => {
|
|
33
35
|
const result = numericIdsSchema.safeParse(value.split(','));
|
|
34
36
|
if (!result.success) {
|
package/dist/helpers/tag.js
CHANGED
|
@@ -5,13 +5,14 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const jsonRpc_1 = require("../client/jsonRpc");
|
|
6
6
|
const output_1 = require("./output");
|
|
7
7
|
const parse_1 = require("./parse");
|
|
8
|
+
const types_1 = require("../types");
|
|
8
9
|
const tagItemSchema = zod_1.z.object({
|
|
9
10
|
id: zod_1.z.number(),
|
|
10
11
|
name: zod_1.z.string(),
|
|
11
12
|
});
|
|
12
13
|
const tagsSchema = zod_1.z.array(tagItemSchema);
|
|
13
14
|
const fetchUserTags = async () => {
|
|
14
|
-
const rawResult = await (0, jsonRpc_1.callTool)(
|
|
15
|
+
const rawResult = await (0, jsonRpc_1.callTool)(types_1.ToolName.ListTags, {
|
|
15
16
|
intent: 'Resolving tag values.',
|
|
16
17
|
});
|
|
17
18
|
return (0, parse_1.extractAndValidateObjectFromString)(rawResult, tagsSchema);
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isJsonRpcResponse = exports.jsonRpcResultSchema = exports.isOAuthTokenResponse = exports.isStoredApiKey = exports.parseStoredCredentials = exports.CredentialSource = exports.CredentialType = void 0;
|
|
3
|
+
exports.isJsonRpcResponse = exports.jsonRpcResultSchema = exports.isOAuthTokenResponse = exports.isStoredApiKey = exports.parseStoredCredentials = exports.ToolName = exports.CredentialSource = exports.CredentialType = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
var CredentialType;
|
|
6
6
|
(function (CredentialType) {
|
|
@@ -12,6 +12,20 @@ var CredentialSource;
|
|
|
12
12
|
CredentialSource["Environment"] = "environment";
|
|
13
13
|
CredentialSource["Stored"] = "stored";
|
|
14
14
|
})(CredentialSource || (exports.CredentialSource = CredentialSource = {}));
|
|
15
|
+
var ToolName;
|
|
16
|
+
(function (ToolName) {
|
|
17
|
+
ToolName["SearchMeetings"] = "SearchMeetings";
|
|
18
|
+
ToolName["ReadMeetings"] = "ReadMeetings";
|
|
19
|
+
ToolName["GetTranscriptsForMeetings"] = "GetTranscriptsForMeetings";
|
|
20
|
+
ToolName["SearchTranscripts"] = "SearchTranscripts";
|
|
21
|
+
ToolName["SearchCalendarEvents"] = "SearchCalendarEvents";
|
|
22
|
+
ToolName["FindProfiles"] = "FindProfiles";
|
|
23
|
+
ToolName["FindCompanies"] = "FindCompanies";
|
|
24
|
+
ToolName["SearchSupportArticles"] = "SearchSupportArticles";
|
|
25
|
+
ToolName["SearchEmails"] = "SearchEmails";
|
|
26
|
+
ToolName["SearchActionItems"] = "SearchActionItems";
|
|
27
|
+
ToolName["ListTags"] = "ListTags";
|
|
28
|
+
})(ToolName || (exports.ToolName = ToolName = {}));
|
|
15
29
|
const storedTokensSchema = zod_1.z.object({
|
|
16
30
|
accessToken: zod_1.z.string(),
|
|
17
31
|
refreshToken: zod_1.z.string(),
|
package/package.json
CHANGED