@circleback/cli 0.1.2 → 0.1.4

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.
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.searchActionItemsCommand = void 0;
7
+ const commander_1 = require("commander");
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const jsonRpc_1 = require("../client/jsonRpc");
10
+ const constants_1 = require("../constants");
11
+ const date_1 = require("../helpers/date");
12
+ const error_1 = require("../helpers/error");
13
+ const formatter_1 = require("../helpers/formatter");
14
+ const parse_1 = require("../helpers/parse");
15
+ const DEFAULT_ACTION_ITEMS_SEARCH_LAST_DAYS = 30;
16
+ exports.searchActionItemsCommand = new commander_1.Command('search')
17
+ .description('Search action items.')
18
+ .argument('[search]', 'Search term')
19
+ .option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
20
+ .option('--status <status>', 'Filter by status (PENDING or DONE)')
21
+ .option('--last <days>', 'Show action items from the last N days')
22
+ .option('--from <date>', constants_1.START_DATE_OPTION_DESCRIPTION)
23
+ .option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
24
+ .option('--tags <ids>', constants_1.TAGS_OPTION_DESCRIPTION)
25
+ .option('--assignee <id>', 'Filter by assignee profile ID')
26
+ .action(async (query, options) => {
27
+ try {
28
+ if (options.last && options.from) {
29
+ console.error(chalk_1.default.red(constants_1.LAST_AND_FROM_CONFLICT_ERROR));
30
+ process.exit(1);
31
+ }
32
+ const jsonMode = exports.searchActionItemsCommand.parent?.parent?.opts().json ?? false;
33
+ const pageIndex = (0, parse_1.parseIntOption)(options.page, '--page');
34
+ const args = {
35
+ intent: query ?? 'Listing recent action items.',
36
+ pageIndex,
37
+ };
38
+ if (query)
39
+ args['searchTerms'] = [query];
40
+ if (options.status)
41
+ args['status'] = options.status;
42
+ if (options.last) {
43
+ args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
44
+ }
45
+ else if (options.from) {
46
+ args['startDate'] = options.from;
47
+ }
48
+ else if (!query) {
49
+ args['startDate'] = (0, date_1.getStartDateFromDaysAgo)(DEFAULT_ACTION_ITEMS_SEARCH_LAST_DAYS);
50
+ }
51
+ if (options.to)
52
+ args['endDate'] = options.to;
53
+ if (options.tags)
54
+ args['tags'] = (0, parse_1.parseNumericIds)(options.tags, 'tag ID');
55
+ if (options.assignee)
56
+ args['assigneeProfileId'] = (0, parse_1.parseIntOption)(options.assignee, '--assignee');
57
+ const result = await (0, jsonRpc_1.callTool)('SearchActionItems', args);
58
+ (0, formatter_1.formatOutput)('SearchActionItems', result, jsonMode);
59
+ }
60
+ catch (error) {
61
+ const message = error instanceof Error ? error.message : constants_1.SEARCH_FAILED_ERROR;
62
+ console.error(chalk_1.default.red((0, error_1.formatMcpError)(message) ?? message));
63
+ process.exit(1);
64
+ }
65
+ });
@@ -7,6 +7,7 @@ exports.searchCalendarCommand = void 0;
7
7
  const commander_1 = require("commander");
8
8
  const chalk_1 = __importDefault(require("chalk"));
9
9
  const jsonRpc_1 = require("../client/jsonRpc");
10
+ const constants_1 = require("../constants");
10
11
  const date_1 = require("../helpers/date");
11
12
  const error_1 = require("../helpers/error");
12
13
  const formatter_1 = require("../helpers/formatter");
@@ -14,28 +15,28 @@ const parse_1 = require("../helpers/parse");
14
15
  exports.searchCalendarCommand = new commander_1.Command('search')
15
16
  .description('Search calendar events.')
16
17
  .option('--last <days>', 'Show events from the last N days')
17
- .option('--from <date>', 'Start date (YYYY-MM-DD)')
18
- .option('--to <date>', 'End date (YYYY-MM-DD)')
18
+ .option('--from <date>', constants_1.START_DATE_OPTION_DESCRIPTION)
19
+ .option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
19
20
  .action(async (options) => {
20
21
  try {
21
22
  if (options.last && options.from) {
22
- console.error(chalk_1.default.red('Cannot use --last and --from together.'));
23
+ console.error(chalk_1.default.red(constants_1.LAST_AND_FROM_CONFLICT_ERROR));
23
24
  process.exit(1);
24
25
  }
25
26
  const jsonMode = exports.searchCalendarCommand.parent?.parent?.opts().json ?? false;
26
- const arguments_ = {
27
+ const args = {
27
28
  intent: 'Listing calendar events.',
28
29
  pageIndex: 0,
29
30
  };
30
31
  if (options.last) {
31
- arguments_['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
32
+ args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
32
33
  }
33
34
  else if (options.from) {
34
- arguments_['startDate'] = options.from;
35
+ args['startDate'] = options.from;
35
36
  }
36
37
  if (options.to)
37
- arguments_['endDate'] = options.to;
38
- const result = await (0, jsonRpc_1.callTool)('SearchCalendarEvents', arguments_);
38
+ args['endDate'] = options.to;
39
+ const result = await (0, jsonRpc_1.callTool)('SearchCalendarEvents', args);
39
40
  (0, formatter_1.formatOutput)('SearchCalendarEvents', result, jsonMode);
40
41
  }
41
42
  catch (error) {
@@ -7,13 +7,14 @@ exports.searchEmailsCommand = void 0;
7
7
  const commander_1 = require("commander");
8
8
  const chalk_1 = __importDefault(require("chalk"));
9
9
  const jsonRpc_1 = require("../client/jsonRpc");
10
+ const constants_1 = require("../constants");
10
11
  const error_1 = require("../helpers/error");
11
12
  const formatter_1 = require("../helpers/formatter");
12
13
  const parse_1 = require("../helpers/parse");
13
14
  exports.searchEmailsCommand = new commander_1.Command('search')
14
15
  .description('Search connected email accounts. Supports filters: from:email, to:email, participant:email, before:YYYY-MM-DD, after:YYYY-MM-DD.')
15
16
  .argument('[search]', 'Search term')
16
- .option('-p, --page <index>', 'Page index (starts at 0)', '0')
17
+ .option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
17
18
  .action(async (query, options) => {
18
19
  try {
19
20
  if (query !== undefined && query.trim() === '') {
@@ -22,12 +23,12 @@ exports.searchEmailsCommand = new commander_1.Command('search')
22
23
  }
23
24
  const jsonMode = exports.searchEmailsCommand.parent?.parent?.opts().json ?? false;
24
25
  const pageIndex = (0, parse_1.parseIntOption)(options.page, '--page');
25
- const arguments_ = {
26
+ const args = {
26
27
  intent: query ?? 'Listing recent emails.',
27
28
  pageIndex,
28
29
  };
29
- arguments_['searchTerm'] = query ?? '';
30
- const result = await (0, jsonRpc_1.callTool)('SearchEmails', arguments_);
30
+ args['searchTerm'] = query ?? '';
31
+ const result = await (0, jsonRpc_1.callTool)('SearchEmails', args);
31
32
  (0, formatter_1.formatOutput)('SearchEmails', result, jsonMode);
32
33
  }
33
34
  catch (error) {
@@ -7,63 +7,64 @@ exports.readMeetingsCommand = exports.searchMeetingsCommand = void 0;
7
7
  const commander_1 = require("commander");
8
8
  const chalk_1 = __importDefault(require("chalk"));
9
9
  const jsonRpc_1 = require("../client/jsonRpc");
10
+ const constants_1 = require("../constants");
10
11
  const date_1 = require("../helpers/date");
11
12
  const error_1 = require("../helpers/error");
12
13
  const formatter_1 = require("../helpers/formatter");
13
14
  const parse_1 = require("../helpers/parse");
14
15
  const DEFAULT_MEETINGS_SEARCH_LAST_DAYS = 7;
15
16
  exports.searchMeetingsCommand = new commander_1.Command('search')
16
- .description('Search for meetings.')
17
+ .description('Search meetings.')
17
18
  .argument('[search]', 'Search term')
18
- .option('-p, --page <index>', 'Page index (starts at 0)', '0')
19
+ .option('-p, --page <index>', constants_1.PAGE_OPTION_DESCRIPTION, '0')
19
20
  .option('--last <days>', 'Show meetings from the last N days')
20
- .option('--from <date>', 'Start date (YYYY-MM-DD)')
21
- .option('--to <date>', 'End date (YYYY-MM-DD)')
22
- .option('--tags <ids>', 'Comma-separated tag IDs')
23
- .option('--profiles <ids>', 'Comma-separated profile IDs')
24
- .option('--domains <domains>', 'Comma-separated domains')
21
+ .option('--from <date>', constants_1.START_DATE_OPTION_DESCRIPTION)
22
+ .option('--to <date>', constants_1.END_DATE_OPTION_DESCRIPTION)
23
+ .option('--tags <ids>', constants_1.TAGS_OPTION_DESCRIPTION)
24
+ .option('--profiles <ids>', constants_1.PROFILES_OPTION_DESCRIPTION)
25
+ .option('--domains <domains>', constants_1.DOMAINS_OPTION_DESCRIPTION)
25
26
  .action(async (query, options) => {
26
27
  try {
27
28
  if (options.last && options.from) {
28
- console.error(chalk_1.default.red('Cannot use --last and --from together.'));
29
+ console.error(chalk_1.default.red(constants_1.LAST_AND_FROM_CONFLICT_ERROR));
29
30
  process.exit(1);
30
31
  }
31
32
  const jsonMode = exports.searchMeetingsCommand.parent?.parent?.opts().json ?? false;
32
33
  const pageIndex = (0, parse_1.parseIntOption)(options.page, '--page');
33
- const arguments_ = {
34
+ const args = {
34
35
  intent: query ?? 'Listing recent meetings.',
35
36
  pageIndex,
36
37
  };
37
38
  if (query)
38
- arguments_['searchTerm'] = query;
39
+ args['searchTerm'] = query;
39
40
  if (options.last) {
40
- arguments_['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
41
+ args['startDate'] = (0, date_1.getStartDateFromDaysAgo)((0, parse_1.parseIntOption)(options.last, '--last'));
41
42
  }
42
43
  else if (options.from) {
43
- arguments_['startDate'] = options.from;
44
+ args['startDate'] = options.from;
44
45
  }
45
46
  else if (!query) {
46
- arguments_['startDate'] = (0, date_1.getStartDateFromDaysAgo)(DEFAULT_MEETINGS_SEARCH_LAST_DAYS);
47
+ args['startDate'] = (0, date_1.getStartDateFromDaysAgo)(DEFAULT_MEETINGS_SEARCH_LAST_DAYS);
47
48
  }
48
49
  if (options.to)
49
- arguments_['endDate'] = options.to;
50
+ args['endDate'] = options.to;
50
51
  if (options.tags)
51
- arguments_['tags'] = (0, parse_1.parseNumericIds)(options.tags, 'tag ID');
52
+ args['tags'] = (0, parse_1.parseNumericIds)(options.tags, 'tag ID');
52
53
  if (options.profiles)
53
- arguments_['profiles'] = (0, parse_1.parseNumericIds)(options.profiles, 'profile ID');
54
+ args['profiles'] = (0, parse_1.parseNumericIds)(options.profiles, 'profile ID');
54
55
  if (options.domains)
55
- arguments_['domains'] = options.domains.split(',');
56
- const result = await (0, jsonRpc_1.callTool)('SearchMeetings', arguments_);
56
+ args['domains'] = options.domains.split(',');
57
+ const result = await (0, jsonRpc_1.callTool)('SearchMeetings', args);
57
58
  (0, formatter_1.formatOutput)('SearchMeetings', result, jsonMode);
58
59
  }
59
60
  catch (error) {
60
- const message = error instanceof Error ? error.message : 'Search failed.';
61
+ const message = error instanceof Error ? error.message : constants_1.SEARCH_FAILED_ERROR;
61
62
  console.error(chalk_1.default.red((0, error_1.formatMcpError)(message) ?? message));
62
63
  process.exit(1);
63
64
  }
64
65
  });
65
66
  exports.readMeetingsCommand = new commander_1.Command('read')
66
- .description('Get detailed information for meetings.')
67
+ .description('Get detailed meeting information.')
67
68
  .argument('<ids...>', 'Meeting IDs')
68
69
  .action(async (ids) => {
69
70
  try {
@@ -76,7 +77,7 @@ exports.readMeetingsCommand = new commander_1.Command('read')
76
77
  (0, formatter_1.formatOutput)('ReadMeetings', result, jsonMode);
77
78
  }
78
79
  catch (error) {
79
- const message = error instanceof Error ? error.message : 'Read failed.';
80
+ const message = error instanceof Error ? error.message : constants_1.READ_FAILED_ERROR;
80
81
  console.error(chalk_1.default.red((0, error_1.formatMcpError)(message) ?? message));
81
82
  process.exit(1);
82
83
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAllCommands = exports.commandGroups = exports.standaloneCommands = void 0;
4
4
  const commander_1 = require("commander");
5
+ const actionItems_1 = require("./actionItems");
5
6
  const auth_1 = require("./auth");
6
7
  const calendar_1 = require("./calendar");
7
8
  const domains_1 = require("./domains");
@@ -52,6 +53,11 @@ exports.commandGroups = [
52
53
  description: 'Search emails.',
53
54
  subcommands: [emails_1.searchEmailsCommand],
54
55
  },
56
+ {
57
+ name: 'action-items',
58
+ description: 'Search action items.',
59
+ subcommands: [actionItems_1.searchActionItemsCommand],
60
+ },
55
61
  ];
56
62
  const buildCommandGroup = (definition) => definition.subcommands.reduce((group, command, index) => group.addCommand(command, index === 0 ? { isDefault: true } : undefined), new commander_1.Command(definition.name).description(definition.description));
57
63
  const getAllCommands = () => [
@@ -15,11 +15,11 @@ exports.searchSupportCommand = new commander_1.Command('search')
15
15
  .action(async (query) => {
16
16
  try {
17
17
  const jsonMode = exports.searchSupportCommand.parent?.parent?.opts().json ?? false;
18
- const arguments_ = {
18
+ const args = {
19
19
  intent: query ?? 'Listing support articles.',
20
20
  };
21
- arguments_['searchTerm'] = query ?? '';
22
- const result = await (0, jsonRpc_1.callTool)('SearchSupportArticles', arguments_);
21
+ args['searchTerm'] = query ?? '';
22
+ const result = await (0, jsonRpc_1.callTool)('SearchSupportArticles', args);
23
23
  (0, formatter_1.formatOutput)('SearchSupportArticles', result, jsonMode);
24
24
  }
25
25
  catch (error) {
@@ -7,30 +7,31 @@ exports.getTranscriptsCommand = exports.searchTranscriptsCommand = void 0;
7
7
  const commander_1 = require("commander");
8
8
  const chalk_1 = __importDefault(require("chalk"));
9
9
  const jsonRpc_1 = require("../client/jsonRpc");
10
+ const constants_1 = require("../constants");
10
11
  const error_1 = require("../helpers/error");
11
12
  const formatter_1 = require("../helpers/formatter");
12
13
  const parse_1 = require("../helpers/parse");
13
14
  exports.searchTranscriptsCommand = new commander_1.Command('search')
14
15
  .description('Search meeting transcripts.')
15
16
  .argument('<search>', 'Search term')
16
- .option('--tags <ids>', 'Comma-separated tag IDs')
17
- .option('--profiles <ids>', 'Comma-separated profile IDs')
18
- .option('--domains <domains>', 'Comma-separated domains')
17
+ .option('--tags <ids>', constants_1.TAGS_OPTION_DESCRIPTION)
18
+ .option('--profiles <ids>', constants_1.PROFILES_OPTION_DESCRIPTION)
19
+ .option('--domains <domains>', constants_1.DOMAINS_OPTION_DESCRIPTION)
19
20
  .showHelpAfterError(true)
20
21
  .action(async (query, options) => {
21
22
  try {
22
23
  const jsonMode = exports.searchTranscriptsCommand.parent?.parent?.opts().json ?? false;
23
- const arguments_ = {
24
+ const args = {
24
25
  intent: query,
25
26
  searchTerm: query,
26
27
  };
27
28
  if (options.tags)
28
- arguments_['tags'] = (0, parse_1.parseNumericIds)(options.tags, 'tag ID');
29
+ args['tags'] = (0, parse_1.parseNumericIds)(options.tags, 'tag ID');
29
30
  if (options.profiles)
30
- arguments_['profiles'] = (0, parse_1.parseNumericIds)(options.profiles, 'profile ID');
31
+ args['profiles'] = (0, parse_1.parseNumericIds)(options.profiles, 'profile ID');
31
32
  if (options.domains)
32
- arguments_['domains'] = options.domains.split(',');
33
- const result = await (0, jsonRpc_1.callTool)('SearchTranscripts', arguments_);
33
+ args['domains'] = options.domains.split(',');
34
+ const result = await (0, jsonRpc_1.callTool)('SearchTranscripts', args);
34
35
  (0, formatter_1.formatOutput)('SearchTranscripts', result, jsonMode);
35
36
  }
36
37
  catch (error) {
@@ -40,7 +41,7 @@ exports.searchTranscriptsCommand = new commander_1.Command('search')
40
41
  }
41
42
  });
42
43
  exports.getTranscriptsCommand = new commander_1.Command('read')
43
- .description('Get full transcripts for meetings.')
44
+ .description('Get full meeting transcripts.')
44
45
  .argument('<meetingId...>', 'Meeting IDs (max 50)')
45
46
  .showHelpAfterError(true)
46
47
  .action(async (ids) => {
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.CALLBACK_TIMEOUT_MILLISECONDS = exports.OAUTH_SCOPE = exports.TOKENS_FILE = exports.CONFIG_DIRECTORY = exports.ASCII_LOGO = exports.SECONDARY_COLOR = exports.BRAND_COLOR = exports.CLIENT_VERSION = exports.CLIENT_PACKAGE_NAME = exports.CLIENT_NAME = exports.BASE_URL = void 0;
6
+ exports.READ_FAILED_ERROR = exports.SEARCH_FAILED_ERROR = exports.LAST_AND_FROM_CONFLICT_ERROR = 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.CALLBACK_TIMEOUT_MILLISECONDS = exports.OAUTH_SCOPE = exports.TOKENS_FILE = exports.CONFIG_DIRECTORY = exports.ASCII_LOGO = exports.SECONDARY_COLOR = exports.BRAND_COLOR = 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"));
@@ -37,3 +37,14 @@ exports.CONFIG_DIRECTORY = node_path_1.default.join(node_os_1.default.homedir(),
37
37
  exports.TOKENS_FILE = node_path_1.default.join(exports.CONFIG_DIRECTORY, 'tokens.json');
38
38
  exports.OAUTH_SCOPE = 'user';
39
39
  exports.CALLBACK_TIMEOUT_MILLISECONDS = 120_000;
40
+ exports.DEFAULT_MEETING_NAME = 'New meeting';
41
+ exports.UNASSIGNED_ACTION_ITEM_ASSIGNEE_LABEL = 'Unassigned';
42
+ exports.PAGE_OPTION_DESCRIPTION = 'Page index (starts at 0)';
43
+ exports.START_DATE_OPTION_DESCRIPTION = 'Start date (YYYY-MM-DD)';
44
+ exports.END_DATE_OPTION_DESCRIPTION = 'End date (YYYY-MM-DD)';
45
+ exports.TAGS_OPTION_DESCRIPTION = 'Comma-separated tag IDs';
46
+ exports.PROFILES_OPTION_DESCRIPTION = 'Comma-separated profile IDs';
47
+ exports.DOMAINS_OPTION_DESCRIPTION = 'Comma-separated domains';
48
+ exports.LAST_AND_FROM_CONFLICT_ERROR = 'Cannot use --last and --from together.';
49
+ exports.SEARCH_FAILED_ERROR = 'Search failed.';
50
+ exports.READ_FAILED_ERROR = 'Read failed.';
@@ -20,7 +20,7 @@ const formatForTool = (toolName, data) => {
20
20
  case 'ReadMeetings':
21
21
  return (0, table_1.formatMeetingDetails)(data);
22
22
  case 'GetTranscriptsForMeetings':
23
- return (0, table_1.formatTranscripts)(data);
23
+ return (0, table_1.formatTranscriptReadResults)(data);
24
24
  case 'SearchTranscripts':
25
25
  return (0, table_1.formatTranscriptSearchResults)(data);
26
26
  case 'SearchCalendarEvents':
@@ -33,6 +33,8 @@ const formatForTool = (toolName, data) => {
33
33
  return (0, table_1.formatSupportArticles)(data);
34
34
  case 'SearchEmails':
35
35
  return (0, table_1.formatEmails)(data);
36
+ case 'SearchActionItems':
37
+ return (0, table_1.formatActionItems)(data);
36
38
  default:
37
39
  return;
38
40
  }
@@ -3,12 +3,14 @@ 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.formatEmails = exports.formatSupportArticles = exports.formatDomains = exports.formatProfiles = exports.formatCalendarEvents = exports.formatTranscriptSearchResults = exports.formatTranscripts = exports.formatMeetingDetails = exports.formatMeetingsList = void 0;
6
+ exports.formatEmails = exports.formatActionItems = exports.formatSupportArticles = exports.formatDomains = exports.formatProfiles = exports.formatCalendarEvents = exports.formatTranscriptReadResults = exports.formatTranscriptSearchResults = exports.formatMeetingDetails = exports.formatMeetingsList = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
8
  const cli_table3_1 = __importDefault(require("cli-table3"));
9
9
  const date_1 = require("./date");
10
10
  const string_1 = require("./string");
11
11
  const style_1 = require("./style");
12
+ const lodash_1 = require("lodash");
13
+ const constants_1 = require("../constants");
12
14
  const idColumnWidth = (ids) => {
13
15
  const maxLength = ids.reduce((max, id) => Math.max(max, String(id).length), 2);
14
16
  return maxLength + 2;
@@ -52,14 +54,12 @@ const formatMeetingsList = (meetings) => {
52
54
  wordWrap: true,
53
55
  style: style_1.tableStyle,
54
56
  });
55
- meetings.forEach((meeting) => {
56
- table.push([
57
- (0, string_1.truncate)(meeting.name, nameWidth - 2),
58
- meeting.id,
59
- (0, date_1.formatDate)(meeting.createdAt),
60
- meeting.attendees.map(formatAttendee).join('\n'),
61
- ]);
62
- });
57
+ table.push(...meetings.map((meeting) => [
58
+ (0, string_1.truncate)(meeting.name, nameWidth - 2),
59
+ meeting.id,
60
+ (0, date_1.formatDate)(meeting.createdAt),
61
+ meeting.attendees.map(formatAttendee).join('\n'),
62
+ ]));
63
63
  return `${chalk_1.default.bold(`${(0, string_1.pluralize)(meetings.length, 'meeting', 'meetings')} found`)}\n${table.toString()}`;
64
64
  };
65
65
  exports.formatMeetingsList = formatMeetingsList;
@@ -73,7 +73,7 @@ const formatMeetingDetails = (meetings) => {
73
73
  `${chalk_1.default.bold('ID:')} ${meeting.id}`,
74
74
  `${chalk_1.default.bold('Date:')} ${(0, date_1.formatDate)(meeting.createdAt)}`,
75
75
  meeting.duration
76
- ? `${chalk_1.default.bold('Duration:')} ${Math.round(meeting.duration / 60)} min`
76
+ ? `${chalk_1.default.bold('Duration:')} ${(0, lodash_1.round)(meeting.duration / 60)} min`
77
77
  : null,
78
78
  `${chalk_1.default.bold('Attendees:')}\n${(meeting.attendees ?? []).map((attendee) => ` ${formatAttendee(attendee)}`).join('\n')}`,
79
79
  (meeting.tags ?? []).length > 0
@@ -93,20 +93,6 @@ const formatMeetingDetails = (meetings) => {
93
93
  .join('\n\n---\n');
94
94
  };
95
95
  exports.formatMeetingDetails = formatMeetingDetails;
96
- const formatTranscripts = (transcripts) => {
97
- if (transcripts.length === 0)
98
- return chalk_1.default.yellow('No transcripts found.');
99
- return transcripts
100
- .map((transcript) => {
101
- const header = chalk_1.default.bold.cyan(`\n# ${transcript.meetingName} (ID: ${transcript.meetingId})`);
102
- const content = transcript.transcriptChunks
103
- .map((chunk) => chunk.content)
104
- .join('\n');
105
- return `${header}\n${content}`;
106
- })
107
- .join('\n\n---\n');
108
- };
109
- exports.formatTranscripts = formatTranscripts;
110
96
  const formatTranscriptSearchResults = (results) => {
111
97
  if (results.length === 0)
112
98
  return chalk_1.default.yellow('No transcript matches found.');
@@ -119,16 +105,32 @@ const formatTranscriptSearchResults = (results) => {
119
105
  wordWrap: true,
120
106
  style: style_1.tableStyle,
121
107
  });
122
- results.forEach((result) => {
123
- table.push([
124
- (0, string_1.truncate)(result.meetingName || 'New meeting', meetingWidth - 2),
125
- result.meetingId,
126
- (0, string_1.truncate)(result.content, contentWidth - 2),
127
- ]);
128
- });
108
+ table.push(...results.map((result) => [
109
+ (0, string_1.truncate)(result.meetingName || constants_1.DEFAULT_MEETING_NAME, meetingWidth - 2),
110
+ result.meetingId,
111
+ (0, string_1.truncate)(result.text, contentWidth - 2),
112
+ ]));
129
113
  return `${chalk_1.default.bold(`${(0, string_1.pluralize)(results.length, 'match', 'matches')} found`)}\n${table.toString()}`;
130
114
  };
131
115
  exports.formatTranscriptSearchResults = formatTranscriptSearchResults;
116
+ const formatTranscriptReadResults = (results) => {
117
+ if (results.length === 0)
118
+ return chalk_1.default.yellow('No transcripts found.');
119
+ return results
120
+ .map((result) => {
121
+ const header = chalk_1.default.bold.cyan(`\n# ${result.meetingName}`);
122
+ const meta = `${chalk_1.default.bold('Meeting ID:')} ${result.meetingId}`;
123
+ const transcriptEntries = result.transcript
124
+ .map((entry) => `${chalk_1.default.dim((0, lodash_1.round)(entry.timestamp, 2))} ${chalk_1.default.bold(entry.speaker ?? 'Unknown')}: ${entry.text}`)
125
+ .join('\n');
126
+ const transcript = transcriptEntries.length > 0
127
+ ? transcriptEntries
128
+ : chalk_1.default.yellow('No transcript content found.');
129
+ return `${header}\n${meta}\n\n${transcript}`;
130
+ })
131
+ .join('\n\n---\n');
132
+ };
133
+ exports.formatTranscriptReadResults = formatTranscriptReadResults;
132
134
  const formatCalendarEvents = (events) => {
133
135
  if (events.length === 0)
134
136
  return chalk_1.default.yellow('No calendar events found.');
@@ -144,15 +146,13 @@ const formatCalendarEvents = (events) => {
144
146
  wordWrap: true,
145
147
  style: style_1.tableStyle,
146
148
  });
147
- events.forEach((event) => {
148
- table.push([
149
- (0, string_1.truncate)(event.title, 28),
150
- (0, date_1.formatDateTime)(event.startTime),
151
- (0, date_1.formatDateTime)(event.endTime),
152
- event.platform ?? '-',
153
- event.attendees?.map(formatAttendee).join('\n') ?? '-',
154
- ]);
155
- });
149
+ table.push(...events.map((event) => [
150
+ (0, string_1.truncate)(event.title, 28),
151
+ (0, date_1.formatDateTime)(event.startTime),
152
+ (0, date_1.formatDateTime)(event.endTime),
153
+ event.platform ?? '-',
154
+ event.attendees?.map(formatAttendee).join('\n') ?? '-',
155
+ ]));
156
156
  return `${chalk_1.default.bold((0, string_1.pluralize)(events.length, 'event', 'events'))}\n${table.toString()}`;
157
157
  };
158
158
  exports.formatCalendarEvents = formatCalendarEvents;
@@ -176,15 +176,13 @@ const formatProfiles = (profiles) => {
176
176
  wordWrap: true,
177
177
  style: style_1.tableStyle,
178
178
  });
179
- profiles.forEach((profile) => {
180
- table.push([
181
- [profile.firstName, profile.lastName].filter(Boolean).join(' ') || '-',
182
- profile.id,
183
- profile.email ?? '-',
184
- profile.title ?? '-',
185
- profile.company ?? '-',
186
- ]);
187
- });
179
+ table.push(...profiles.map((profile) => [
180
+ [profile.firstName, profile.lastName].filter(Boolean).join(' ') || '-',
181
+ profile.id,
182
+ profile.email ?? '-',
183
+ profile.title ?? '-',
184
+ profile.company ?? '-',
185
+ ]));
188
186
  return `${chalk_1.default.bold(`${(0, string_1.pluralize)(profiles.length, 'person', 'people')} found`)}\n${table.toString()}`;
189
187
  };
190
188
  exports.formatProfiles = formatProfiles;
@@ -202,6 +200,46 @@ const formatSupportArticles = (articles) => {
202
200
  .join('\n\n');
203
201
  };
204
202
  exports.formatSupportArticles = formatSupportArticles;
203
+ const formatActionItems = (actionItems) => {
204
+ if (actionItems.length === 0)
205
+ return chalk_1.default.yellow('No action items found.');
206
+ const idWidth = idColumnWidth(actionItems.map((item) => item.id));
207
+ const titleWidth = 35;
208
+ const statusWidth = 10;
209
+ const assigneeWidth = 20;
210
+ const meetingWidth = 25;
211
+ const dateWidth = 14;
212
+ const table = new cli_table3_1.default({
213
+ head: [
214
+ style_1.brand.bold('Title'),
215
+ style_1.brand.bold('ID'),
216
+ style_1.brand.bold('Status'),
217
+ style_1.brand.bold('Assignee'),
218
+ style_1.brand.bold('Meeting'),
219
+ style_1.brand.bold('Date'),
220
+ ],
221
+ colWidths: [
222
+ titleWidth,
223
+ idWidth,
224
+ statusWidth,
225
+ assigneeWidth,
226
+ meetingWidth,
227
+ dateWidth,
228
+ ],
229
+ wordWrap: true,
230
+ style: style_1.tableStyle,
231
+ });
232
+ table.push(...actionItems.map((item) => [
233
+ (0, string_1.truncate)(item.title, titleWidth - 2),
234
+ item.id,
235
+ item.status,
236
+ item.assignee?.name ?? constants_1.UNASSIGNED_ACTION_ITEM_ASSIGNEE_LABEL,
237
+ (0, string_1.truncate)(item.meeting.name || constants_1.DEFAULT_MEETING_NAME, meetingWidth - 2),
238
+ (0, date_1.formatDate)(item.createdAt),
239
+ ]));
240
+ return `${chalk_1.default.bold(`${(0, string_1.pluralize)(actionItems.length, 'action item', 'action items')} found`)}\n${table.toString()}`;
241
+ };
242
+ exports.formatActionItems = formatActionItems;
205
243
  const formatMessage = (message) => {
206
244
  const header = chalk_1.default.bold.cyan(message.subject ?? 'No subject');
207
245
  const meta = `${chalk_1.default.bold('From:')} ${formatSender(message.sender)} ${chalk_1.default.dim((0, date_1.formatDateTime)(message.receivedOn))}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@circleback/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Circleback CLI. Search and access meetings, emails, calendar events, and more.",
5
5
  "license": "MIT",
6
6
  "author": "Circleback <support@circleback.ai> (https://circleback.ai)",
@@ -37,9 +37,11 @@
37
37
  "dependencies": {
38
38
  "chalk": "^4.1.2",
39
39
  "cli-table3": "^0.6.5",
40
- "commander": "^13.1.0"
40
+ "commander": "^13.1.0",
41
+ "lodash": "^4.17.23"
41
42
  },
42
43
  "devDependencies": {
44
+ "@types/lodash": "^4.17.24",
43
45
  "@types/node": "^22.0.0",
44
46
  "typescript": "5.6.2"
45
47
  }