@circleback/cli 0.1.11 → 0.2.0

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/README.md CHANGED
@@ -51,7 +51,7 @@ cb meetings --json
51
51
  | `cb transcripts read <ids...>` | Read full transcripts (numeric IDs or linkIds, max 50) |
52
52
  | `cb calendar` | Search calendar events |
53
53
  | `cb people <names...>` | Search people by name |
54
- | `cb companies <terms...>` | Search companies by domain |
54
+ | `cb companies <terms...>` | Search companies by name or domain |
55
55
  | `cb emails [search]` | Search connected email accounts |
56
56
  | `cb support [search]` | Search Circleback support articles |
57
57
 
@@ -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.forceRefreshToken = exports.getValidAccessToken = exports.login = exports.refreshAccessToken = void 0;
6
+ exports.forceRefreshToken = exports.getValidAccessToken = exports.login = void 0;
7
7
  const node_child_process_1 = require("node:child_process");
8
8
  const node_crypto_1 = __importDefault(require("node:crypto"));
9
9
  const constants_1 = require("../constants");
@@ -89,7 +89,6 @@ const refreshAccessToken = async (refreshToken, clientId) => {
89
89
  }
90
90
  return tokenData;
91
91
  };
92
- exports.refreshAccessToken = refreshAccessToken;
93
92
  const login = async (options = {}) => {
94
93
  const { port, waitForCallback, shutdown } = await (0, server_1.startCallbackServer)();
95
94
  const redirectUri = `http://127.0.0.1:${port}`;
@@ -143,7 +142,7 @@ const requireTokens = () => {
143
142
  return tokens;
144
143
  };
145
144
  const refreshAndSave = async (tokens) => {
146
- const refreshed = await (0, exports.refreshAccessToken)(tokens.refreshToken, tokens.clientId);
145
+ const refreshed = await refreshAccessToken(tokens.refreshToken, tokens.clientId);
147
146
  const updatedTokens = (0, tokenStorage_1.buildStoredTokens)(refreshed, tokens.clientId);
148
147
  (0, tokenStorage_1.saveTokens)(updatedTokens);
149
148
  return updatedTokens.accessToken;
@@ -35,6 +35,7 @@ const sendRequest = async (method, params, accessToken) => fetch(`${constants_1.
35
35
  'Content-Type': 'application/json',
36
36
  Accept: 'application/json, text/event-stream',
37
37
  Authorization: `Bearer ${accessToken}`,
38
+ [constants_1.CLIENT_VERSION_HEADER]: constants_1.CLIENT_VERSION,
38
39
  },
39
40
  body: JSON.stringify({
40
41
  jsonrpc: '2.0',
@@ -3,22 +3,22 @@ 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.searchDomainsCommand = void 0;
6
+ exports.searchCompaniesCommand = 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
10
  const error_1 = require("../helpers/error");
11
11
  const formatter_1 = require("../helpers/formatter");
12
- exports.searchDomainsCommand = new commander_1.Command('search')
12
+ exports.searchCompaniesCommand = new commander_1.Command('search')
13
13
  .description('Search companies.')
14
- .argument('<terms...>', 'Search terms for domains')
14
+ .argument('<terms...>', 'Search terms for company names or domains')
15
15
  .action(async (terms) => {
16
16
  try {
17
- const jsonMode = exports.searchDomainsCommand.parent?.parent?.opts().json ?? false;
18
- const result = await (0, jsonRpc_1.callTool)('FindDomains', {
17
+ const jsonMode = exports.searchCompaniesCommand.parent?.parent?.opts().json ?? false;
18
+ const result = await (0, jsonRpc_1.callTool)('FindCompanies', {
19
19
  searchTerms: terms,
20
20
  });
21
- (0, formatter_1.formatOutput)('FindDomains', result, jsonMode);
21
+ (0, formatter_1.formatOutput)('FindCompanies', result, jsonMode);
22
22
  }
23
23
  catch (error) {
24
24
  const message = error instanceof Error ? error.message : 'Company search failed.';
@@ -67,13 +67,13 @@ exports.searchMeetingsCommand = new commander_1.Command('search')
67
67
  });
68
68
  exports.readMeetingsCommand = new commander_1.Command('read')
69
69
  .description('Get detailed meeting information.')
70
- .argument('<ids...>', 'Meeting numeric IDs or linkIds (max 50)')
70
+ .argument('<ids...>', 'Meeting IDs (max 50)')
71
71
  .action(async (ids) => {
72
72
  try {
73
73
  const jsonMode = exports.readMeetingsCommand.parent?.parent?.opts().json ?? false;
74
74
  const meetingIds = (0, parse_1.validateMeetingIdentifiers)(ids);
75
75
  const result = await (0, jsonRpc_1.callTool)('ReadMeetings', {
76
- intent: `Reading meeting details for IDs or linkIds: ${meetingIds.join(', ')}.`,
76
+ intent: `Reading meeting details for IDs: ${meetingIds.join(', ')}.`,
77
77
  meetingIds,
78
78
  });
79
79
  (0, formatter_1.formatOutput)('ReadMeetings', result, jsonMode);
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAllCommands = exports.commandGroups = exports.standaloneCommands = void 0;
3
+ exports.getAllCommands = void 0;
4
4
  const commander_1 = require("commander");
5
5
  const actionItems_1 = require("./actionItems");
6
6
  const auth_1 = require("./auth");
7
7
  const calendar_1 = require("./calendar");
8
- const domains_1 = require("./domains");
8
+ const companies_1 = require("./companies");
9
9
  const emails_1 = require("./emails");
10
10
  const meetings_1 = require("./meetings");
11
11
  const profiles_1 = require("./profiles");
@@ -13,12 +13,12 @@ const support_1 = require("./support");
13
13
  const tags_1 = require("./tags");
14
14
  const transcripts_1 = require("./transcripts");
15
15
  const update_1 = require("./update");
16
- exports.standaloneCommands = [
16
+ const standaloneCommands = [
17
17
  auth_1.loginCommand,
18
18
  auth_1.logoutCommand,
19
19
  update_1.updateCommand,
20
20
  ];
21
- exports.commandGroups = [
21
+ const commandGroups = [
22
22
  {
23
23
  name: 'meetings',
24
24
  description: 'Search meetings with `cb meetings search [term]` and read them with `cb meetings read <id>`.',
@@ -42,7 +42,7 @@ exports.commandGroups = [
42
42
  {
43
43
  name: 'companies',
44
44
  description: 'Search companies.',
45
- subcommands: [domains_1.searchDomainsCommand],
45
+ subcommands: [companies_1.searchCompaniesCommand],
46
46
  },
47
47
  {
48
48
  name: 'support',
@@ -67,7 +67,7 @@ exports.commandGroups = [
67
67
  ];
68
68
  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));
69
69
  const getAllCommands = () => [
70
- ...exports.standaloneCommands,
71
- ...exports.commandGroups.map(buildCommandGroup),
70
+ ...standaloneCommands,
71
+ ...commandGroups.map(buildCommandGroup),
72
72
  ];
73
73
  exports.getAllCommands = getAllCommands;
@@ -44,14 +44,14 @@ exports.searchTranscriptsCommand = new commander_1.Command('search')
44
44
  });
45
45
  exports.getTranscriptsCommand = new commander_1.Command('read')
46
46
  .description('Get full meeting transcripts.')
47
- .argument('<meetingId...>', 'Meeting numeric IDs or linkIds (max 50)')
47
+ .argument('<ids...>', 'Meeting IDs (max 50)')
48
48
  .showHelpAfterError(true)
49
49
  .action(async (ids) => {
50
50
  try {
51
51
  const jsonMode = exports.getTranscriptsCommand.parent?.parent?.opts().json ?? false;
52
52
  const meetingIds = (0, parse_1.validateMeetingIdentifiers)(ids);
53
53
  const result = await (0, jsonRpc_1.callTool)('GetTranscriptsForMeetings', {
54
- intent: `Getting transcripts for meetings with IDs or linkIds: ${meetingIds.join(', ')}.`,
54
+ intent: `Getting transcripts for meetings with IDs: ${meetingIds.join(', ')}.`,
55
55
  meetingIds,
56
56
  });
57
57
  (0, formatter_1.formatOutput)('GetTranscriptsForMeetings', result, jsonMode);
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.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;
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_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"));
@@ -14,6 +14,8 @@ exports.BASE_URL = 'https://circleback.ai';
14
14
  exports.CLIENT_NAME = 'Circleback CLI';
15
15
  exports.CLIENT_PACKAGE_NAME = '@circleback/cli';
16
16
  exports.CLIENT_VERSION = packageJson.version;
17
+ // Must match CIRCLEBACK_CLI_VERSION_HEADER in apps/web/helpers/api/mcp/version.ts.
18
+ exports.CLIENT_VERSION_HEADER = 'x-circleback-cli-version';
17
19
  exports.BRAND_COLOR = '#F24E1D';
18
20
  exports.SECONDARY_COLOR = '#4262FF';
19
21
  exports.ASCII_LOGO = `
@@ -10,7 +10,7 @@ const TOOL_EXAMPLES = {
10
10
  GetTranscriptsForMeetings: 'cb transcripts read 123',
11
11
  SearchEmails: 'cb emails search "invoice"',
12
12
  FindProfiles: 'cb people search "John"',
13
- FindDomains: 'cb companies search "acme"',
13
+ FindCompanies: 'cb companies search "acme"',
14
14
  SearchSupportArticles: 'cb support "recording"',
15
15
  };
16
16
  const isValidationIssue = (value) => {
@@ -21,8 +21,8 @@ const formatForTool = (toolName, data) => {
21
21
  return (0, table_1.formatCalendarEvents)(data);
22
22
  case 'FindProfiles':
23
23
  return (0, table_1.formatProfiles)(data);
24
- case 'FindDomains':
25
- return (0, table_1.formatDomains)(data);
24
+ case 'FindCompanies':
25
+ return (0, table_1.formatCompanies)(data);
26
26
  case 'SearchSupportArticles':
27
27
  return (0, table_1.formatSupportArticles)(data);
28
28
  case 'SearchEmails':
@@ -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.validateMeetingIdentifiers = exports.validateNumericIds = exports.parseNumericIds = exports.parseIntOption = exports.extractAndValidateObjectFromString = void 0;
6
+ exports.validateMeetingIdentifiers = exports.parseNumericIds = exports.parseIntOption = exports.extractAndValidateObjectFromString = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
8
  const zod_1 = require("zod");
9
9
  const extractAndValidateObjectFromString = (rawText, schema) => {
@@ -40,21 +40,12 @@ const parseNumericIds = (value, label) => {
40
40
  return result.data;
41
41
  };
42
42
  exports.parseNumericIds = parseNumericIds;
43
- const validateNumericIds = (values, label) => {
44
- const result = numericIdsSchema.safeParse(values);
45
- if (!result.success) {
46
- console.error(chalk_1.default.red(`Invalid ${label}. Expected numeric IDs.`));
47
- process.exit(1);
48
- }
49
- return result.data;
50
- };
51
- exports.validateNumericIds = validateNumericIds;
52
43
  const validateMeetingIdentifiers = (values) => {
53
44
  const cleanedValues = values.map((value) => value.trim()).filter(Boolean);
54
45
  const isValidIdentifier = /^[A-Za-z0-9_-]{1,64}$/;
55
46
  if (cleanedValues.length === 0 ||
56
47
  cleanedValues.some((value) => !isValidIdentifier.test(value))) {
57
- console.error(chalk_1.default.red('Invalid meeting identifiers. Expected one or more numeric IDs or linkIds.'));
48
+ console.error(chalk_1.default.red('Invalid meeting identifiers. Expected one or more meeting IDs.'));
58
49
  process.exit(1);
59
50
  }
60
51
  return cleanedValues;
@@ -3,11 +3,11 @@ 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.BANNER = exports.tableStyle = exports.secondary = exports.brand = void 0;
6
+ exports.BANNER = exports.tableStyle = exports.brand = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
8
  const constants_1 = require("../constants");
9
9
  exports.brand = chalk_1.default.hex(constants_1.BRAND_COLOR);
10
- exports.secondary = chalk_1.default.hex(constants_1.SECONDARY_COLOR);
10
+ const secondary = chalk_1.default.hex(constants_1.SECONDARY_COLOR);
11
11
  exports.tableStyle = { head: [], border: [] };
12
12
  exports.BANNER = [
13
13
  '',
@@ -15,7 +15,7 @@ exports.BANNER = [
15
15
  constants_1.ASCII_LOGO.split('\n')
16
16
  .map((line) => line
17
17
  .replace(/=+/g, (match) => (0, exports.brand)(match))
18
- .replace(/\++/g, (match) => (0, exports.secondary)(match)))
18
+ .replace(/\++/g, (match) => secondary(match)))
19
19
  .join('\n'),
20
20
  '',
21
21
  ].join('\n');
@@ -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.formatEmails = exports.formatTags = exports.formatActionItems = exports.formatSupportArticles = exports.formatDomains = exports.formatProfiles = exports.formatCalendarEvents = exports.formatTranscriptReadResults = exports.formatTranscriptSearchResults = exports.formatMeetingDetails = exports.formatMeetingsList = void 0;
6
+ exports.formatEmails = exports.formatTags = exports.formatActionItems = exports.formatSupportArticles = exports.formatCompanies = 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");
@@ -39,7 +39,7 @@ const formatSender = (sender) => {
39
39
  const formatMeetingsList = (meetings) => {
40
40
  if (meetings.length === 0)
41
41
  return chalk_1.default.yellow('No meetings found.');
42
- const idWidth = idColumnWidth(meetings.map((meeting) => meeting.id));
42
+ const idWidth = idColumnWidth(meetings.map((meeting) => meeting.linkId));
43
43
  const nameWidth = 40;
44
44
  const dateWidth = 14;
45
45
  const attendeesWidth = 30;
@@ -56,7 +56,7 @@ const formatMeetingsList = (meetings) => {
56
56
  });
57
57
  table.push(...meetings.map((meeting) => [
58
58
  (0, string_1.truncate)(meeting.name, nameWidth - 2),
59
- meeting.id,
59
+ meeting.linkId,
60
60
  (0, date_1.formatDate)(meeting.createdAt),
61
61
  meeting.attendees.map(formatAttendee).join('\n'),
62
62
  ]));
@@ -70,7 +70,7 @@ const formatMeetingDetails = (meetings) => {
70
70
  .map((meeting) => {
71
71
  const header = chalk_1.default.bold.cyan(`\n# ${meeting.name}`);
72
72
  const meta = [
73
- `${chalk_1.default.bold('ID:')} ${meeting.id}`,
73
+ `${chalk_1.default.bold('ID:')} ${meeting.linkId}`,
74
74
  `${chalk_1.default.bold('Date:')} ${(0, date_1.formatDate)(meeting.createdAt)}`,
75
75
  meeting.duration
76
76
  ? `${chalk_1.default.bold('Duration:')} ${(0, lodash_1.round)(meeting.duration / 60)} min`
@@ -189,12 +189,17 @@ const formatProfiles = (profiles) => {
189
189
  return `${chalk_1.default.bold(`${(0, string_1.pluralize)(profiles.length, 'person', 'people')} found`)}\n${table.toString()}`;
190
190
  };
191
191
  exports.formatProfiles = formatProfiles;
192
- const formatDomains = (domains) => {
193
- if (domains.length === 0)
192
+ const formatCompanies = (companies) => {
193
+ if (companies.length === 0)
194
194
  return chalk_1.default.yellow('No companies found.');
195
- return `${chalk_1.default.bold(`${(0, string_1.pluralize)(domains.length, 'company', 'companies')} found`)}\n${domains.map((domain) => ` ${domain}`).join('\n')}`;
195
+ const table = new cli_table3_1.default({
196
+ head: [style_1.brand.bold('Company'), style_1.brand.bold('Domain')],
197
+ style: style_1.tableStyle,
198
+ });
199
+ table.push(...companies.map((company) => [company.name ?? '-', company.domain]));
200
+ return `${chalk_1.default.bold(`${(0, string_1.pluralize)(companies.length, 'company', 'companies')} found`)}\n${table.toString()}`;
196
201
  };
197
- exports.formatDomains = formatDomains;
202
+ exports.formatCompanies = formatCompanies;
198
203
  const formatSupportArticles = (articles) => {
199
204
  if (articles.length === 0)
200
205
  return chalk_1.default.yellow('No articles found.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@circleback/cli",
3
- "version": "0.1.11",
3
+ "version": "0.2.0",
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)",
@@ -39,7 +39,7 @@
39
39
  "cli-table3": "^0.6.5",
40
40
  "commander": "^13.1.0",
41
41
  "lodash": "^4.17.23",
42
- "zod": "^4.0.0"
42
+ "zod": "^4.4.3"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/lodash": "^4.17.24",