@circleback/cli 0.4.1 → 0.6.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 +32 -17
- package/dist/client/jsonRpc.js +4 -2
- package/dist/commands/actionItems.js +32 -1
- package/dist/commands/registry.js +16 -4
- package/dist/commands/tags.js +53 -1
- package/dist/constants.js +1 -1
- package/dist/helpers/formatter.js +37 -0
- package/dist/types.js +14 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Circleback CLI
|
|
2
2
|
|
|
3
|
-
Search and access your meetings, transcripts, emails, calendar events, and more from the terminal.
|
|
3
|
+
Search and access your meetings, transcripts, emails, calendar events, and more from the terminal, and manage your action items.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -31,27 +31,40 @@ cb transcripts "pricing discussion"
|
|
|
31
31
|
# Search emails
|
|
32
32
|
cb emails "from:alice@example.com after:2026-01-01"
|
|
33
33
|
|
|
34
|
+
# Mark an action item done
|
|
35
|
+
cb action-items update 123 --status DONE
|
|
36
|
+
|
|
34
37
|
# Get raw JSON for scripting
|
|
35
38
|
cb meetings --json
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
## Commands
|
|
39
42
|
|
|
40
|
-
| Command
|
|
41
|
-
|
|
|
42
|
-
| `cb auth login`
|
|
43
|
-
| `cb auth login --api-key`
|
|
44
|
-
| `cb auth logout`
|
|
45
|
-
| `cb update`
|
|
46
|
-
| `cb meetings [search]`
|
|
47
|
-
| `cb meetings read <ids...>`
|
|
48
|
-
| `cb transcripts <search>`
|
|
49
|
-
| `cb transcripts read <ids...>`
|
|
50
|
-
| `cb calendar`
|
|
51
|
-
| `cb people <names...>`
|
|
52
|
-
| `cb companies <terms...>`
|
|
53
|
-
| `cb emails [search]`
|
|
54
|
-
| `cb support [search]`
|
|
43
|
+
| Command | Description |
|
|
44
|
+
| -------------------------------------- | --------------------------------------------------------------- |
|
|
45
|
+
| `cb auth login` | Log in to Circleback with your browser |
|
|
46
|
+
| `cb auth login --api-key` | Log in with an API key |
|
|
47
|
+
| `cb auth logout` | Sign out on this device |
|
|
48
|
+
| `cb update` | Update CLI to the latest version |
|
|
49
|
+
| `cb meetings [search]` | Search meetings |
|
|
50
|
+
| `cb meetings read <ids...>` | Read detailed meeting info, notes, and action items (max 50) |
|
|
51
|
+
| `cb transcripts <search>` | Search transcript content |
|
|
52
|
+
| `cb transcripts read <ids...>` | Read full transcripts (max 50) |
|
|
53
|
+
| `cb calendar` | Search calendar events |
|
|
54
|
+
| `cb people <names...>` | Search people by name |
|
|
55
|
+
| `cb companies <terms...>` | Search companies by name or domain |
|
|
56
|
+
| `cb emails [search]` | Search connected email accounts |
|
|
57
|
+
| `cb support [search]` | Search Circleback support articles |
|
|
58
|
+
| `cb action-items [search]` | Search action items |
|
|
59
|
+
| `cb action-items create <title>` | Create an action item |
|
|
60
|
+
| `cb action-items update <id>` | Update an action item's title, description, status, or assignee |
|
|
61
|
+
| `cb action-items delete <id>` | Delete an action item |
|
|
62
|
+
| `cb tags` | List tags |
|
|
63
|
+
| `cb tags create <name>` | Create a tag |
|
|
64
|
+
| `cb tags update <id>` | Update a tag's name, description, or color |
|
|
65
|
+
| `cb tags delete <id>` | Delete a tag |
|
|
66
|
+
| `cb tags apply <id> <meetingIds...>` | Add a tag to meetings |
|
|
67
|
+
| `cb tags unapply <id> <meetingIds...>` | Remove a tag from meetings |
|
|
55
68
|
|
|
56
69
|
Run `cb --help` or `cb <command> --help` for full usage details.
|
|
57
70
|
|
|
@@ -102,6 +115,8 @@ For stateless automation, set `CIRCLEBACK_API_KEY` instead of logging in:
|
|
|
102
115
|
CIRCLEBACK_API_KEY=cb_your_api_key cb meetings --json
|
|
103
116
|
```
|
|
104
117
|
|
|
118
|
+
Changing action items or tags needs write access. Browser logins from before v0.5.0 don't include it, so run `cb auth login` again; read-only API keys can't make changes.
|
|
119
|
+
|
|
105
120
|
`CIRCLEBACK_API_KEY` takes precedence over stored credentials. Unset it before running `cb auth login`; `cb auth logout` cannot clear an environment variable from your shell.
|
|
106
121
|
|
|
107
122
|
## Agents
|
|
@@ -117,4 +132,4 @@ The CLI is designed to work well with AI agents and tool-use systems:
|
|
|
117
132
|
## Links
|
|
118
133
|
|
|
119
134
|
- [Circleback](https://circleback.ai)
|
|
120
|
-
- [Support](https://
|
|
135
|
+
- [Support](https://circleback.ai/docs/support)
|
package/dist/client/jsonRpc.js
CHANGED
|
@@ -25,6 +25,7 @@ const extractErrorMessage = async (response) => {
|
|
|
25
25
|
return text;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
const WRITE_ACCESS_HINT = 'Run `circleback auth login` again or use a write-enabled API key.';
|
|
28
29
|
const HTTP_ERROR_MESSAGES = {
|
|
29
30
|
401: 'Authentication expired. Run `circleback auth login` to re-authenticate.',
|
|
30
31
|
403: 'Permission denied.',
|
|
@@ -132,9 +133,10 @@ const callTool = async (toolName, toolArguments) => {
|
|
|
132
133
|
if (!response.ok) {
|
|
133
134
|
const fallback = HTTP_ERROR_MESSAGES[response.status];
|
|
134
135
|
const serverMessage = await extractErrorMessage(response);
|
|
135
|
-
|
|
136
|
+
const message = serverMessage ||
|
|
136
137
|
fallback ||
|
|
137
|
-
`Request failed with status ${response.status}
|
|
138
|
+
`Request failed with status ${response.status}.`;
|
|
139
|
+
throw new Error(response.status === 403 ? `${message} ${WRITE_ACCESS_HINT}` : message);
|
|
138
140
|
}
|
|
139
141
|
return parseResponse(response);
|
|
140
142
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.searchActionItemsCommand = void 0;
|
|
3
|
+
exports.deleteActionItemCommand = exports.updateActionItemCommand = exports.createActionItemCommand = exports.searchActionItemsCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const command_1 = require("../helpers/command");
|
|
@@ -31,3 +31,34 @@ exports.searchActionItemsCommand = (0, command_1.defineToolCommand)(new commande
|
|
|
31
31
|
tags: options.tags ? await (0, tag_1.resolveTagValues)(options.tags) : undefined,
|
|
32
32
|
assigneeProfileId: (0, parse_1.parseOptionalIntOption)(options.assignee, '--assignee'),
|
|
33
33
|
}));
|
|
34
|
+
exports.createActionItemCommand = (0, command_1.defineToolCommand)(new commander_1.Command('create')
|
|
35
|
+
.description('Create an action item.')
|
|
36
|
+
.argument('<title>', 'Action item title')
|
|
37
|
+
.option('--description <description>', 'Set the description')
|
|
38
|
+
.option('--assignee <id>', 'Assign to a profile ID'), types_1.ToolName.CreateActionItem, (title, options) => ({
|
|
39
|
+
title,
|
|
40
|
+
description: options.description,
|
|
41
|
+
assigneeProfileId: (0, parse_1.parseOptionalIntOption)(options.assignee, '--assignee'),
|
|
42
|
+
}));
|
|
43
|
+
exports.updateActionItemCommand = (0, command_1.defineToolCommand)(new commander_1.Command('update')
|
|
44
|
+
.description('Update an action item.')
|
|
45
|
+
.argument('<id>', 'Action item ID')
|
|
46
|
+
.option('--title <title>', 'Set the title')
|
|
47
|
+
.option('--description <description>', 'Set the description')
|
|
48
|
+
.addOption(new commander_1.Option('--status <status>', 'Set completion status').choices(Object.values(types_1.ActionItemStatus)))
|
|
49
|
+
.option('--assignee <id|none>', 'Set or remove the assignee'), types_1.ToolName.UpdateActionItem, (identifier, { assignee, ...fields }) => {
|
|
50
|
+
if (assignee === undefined &&
|
|
51
|
+
!Object.values(fields).some((value) => value !== undefined)) {
|
|
52
|
+
throw new Error('Provide at least one field to update.');
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
actionItemId: (0, parse_1.parseIntOption)(identifier, 'id'),
|
|
56
|
+
...fields,
|
|
57
|
+
...(assignee !== undefined && {
|
|
58
|
+
assigneeProfileId: assignee === 'none' ? null : (0, parse_1.parseIntOption)(assignee, '--assignee'),
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
exports.deleteActionItemCommand = (0, command_1.defineToolCommand)(new commander_1.Command('delete')
|
|
63
|
+
.description('Delete an action item.')
|
|
64
|
+
.argument('<id>', 'Action item ID'), types_1.ToolName.DeleteActionItem, (identifier) => ({ actionItemId: (0, parse_1.parseIntOption)(identifier, 'id') }));
|
|
@@ -52,13 +52,25 @@ const commandGroups = [
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
name: 'action-items',
|
|
55
|
-
description: 'Search action items.',
|
|
56
|
-
subcommands: [
|
|
55
|
+
description: 'Search, create, update, and delete action items.',
|
|
56
|
+
subcommands: [
|
|
57
|
+
actionItems_1.searchActionItemsCommand,
|
|
58
|
+
actionItems_1.createActionItemCommand,
|
|
59
|
+
actionItems_1.updateActionItemCommand,
|
|
60
|
+
actionItems_1.deleteActionItemCommand,
|
|
61
|
+
],
|
|
57
62
|
},
|
|
58
63
|
{
|
|
59
64
|
name: 'tags',
|
|
60
|
-
description: 'List tags.',
|
|
61
|
-
subcommands: [
|
|
65
|
+
description: 'List and manage tags.',
|
|
66
|
+
subcommands: [
|
|
67
|
+
tags_1.listTagsCommand,
|
|
68
|
+
tags_1.createTagCommand,
|
|
69
|
+
tags_1.updateTagCommand,
|
|
70
|
+
tags_1.deleteTagCommand,
|
|
71
|
+
tags_1.applyTagCommand,
|
|
72
|
+
tags_1.unapplyTagCommand,
|
|
73
|
+
],
|
|
62
74
|
},
|
|
63
75
|
];
|
|
64
76
|
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));
|
package/dist/commands/tags.js
CHANGED
|
@@ -1,7 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listTagsCommand = void 0;
|
|
3
|
+
exports.unapplyTagCommand = exports.applyTagCommand = exports.deleteTagCommand = exports.updateTagCommand = exports.createTagCommand = exports.listTagsCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const command_1 = require("../helpers/command");
|
|
6
|
+
const parse_1 = require("../helpers/parse");
|
|
6
7
|
const types_1 = require("../types");
|
|
8
|
+
const createColorOption = () => new commander_1.Option('--color <color>', 'Set the display color').choices([
|
|
9
|
+
'neutral',
|
|
10
|
+
'red',
|
|
11
|
+
'rose',
|
|
12
|
+
'orange',
|
|
13
|
+
'amber',
|
|
14
|
+
'emerald',
|
|
15
|
+
'sky',
|
|
16
|
+
'blue',
|
|
17
|
+
'indigo',
|
|
18
|
+
'purple',
|
|
19
|
+
]);
|
|
20
|
+
const getTagColor = (color) => color ? `bg-tag-${color}` : undefined;
|
|
21
|
+
const getTagAssignment = (identifier, meetingIds) => ({
|
|
22
|
+
tagId: (0, parse_1.parseIntOption)(identifier, 'id'),
|
|
23
|
+
meetingIds,
|
|
24
|
+
});
|
|
7
25
|
exports.listTagsCommand = (0, command_1.defineToolCommand)(new commander_1.Command('list').description('List all tags.'), types_1.ToolName.ListTags, () => ({ intent: 'Listing all tags.' }));
|
|
26
|
+
exports.createTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('create')
|
|
27
|
+
.description('Create a tag.')
|
|
28
|
+
.argument('<name>', 'Tag name')
|
|
29
|
+
.option('--description <description>', 'Set the description')
|
|
30
|
+
.addOption(createColorOption()), types_1.ToolName.CreateTag, (name, options) => ({
|
|
31
|
+
name,
|
|
32
|
+
description: options.description,
|
|
33
|
+
color: getTagColor(options.color),
|
|
34
|
+
}));
|
|
35
|
+
exports.updateTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('update')
|
|
36
|
+
.description('Update a tag.')
|
|
37
|
+
.argument('<id>', 'Tag ID')
|
|
38
|
+
.option('--name <name>', 'Set the name')
|
|
39
|
+
.option('--description <description>', 'Set the description')
|
|
40
|
+
.addOption(createColorOption()), types_1.ToolName.UpdateTag, (identifier, options) => {
|
|
41
|
+
if (!Object.values(options).some((value) => value !== undefined)) {
|
|
42
|
+
throw new Error('Provide at least one field to update.');
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
tagId: (0, parse_1.parseIntOption)(identifier, 'id'),
|
|
46
|
+
name: options.name,
|
|
47
|
+
description: options.description,
|
|
48
|
+
color: getTagColor(options.color),
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
exports.deleteTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('delete').description('Delete a tag.').argument('<id>', 'Tag ID'), types_1.ToolName.DeleteTag, (identifier) => ({ tagId: (0, parse_1.parseIntOption)(identifier, 'id') }));
|
|
52
|
+
exports.applyTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('apply')
|
|
53
|
+
.description('Add a tag to meetings.')
|
|
54
|
+
.argument('<id>', 'Tag ID')
|
|
55
|
+
.argument('<meetingIds...>', 'Meeting IDs'), types_1.ToolName.AddTagToMeetings, getTagAssignment);
|
|
56
|
+
exports.unapplyTagCommand = (0, command_1.defineToolCommand)(new commander_1.Command('unapply')
|
|
57
|
+
.description('Remove a tag from meetings.')
|
|
58
|
+
.argument('<id>', 'Tag ID')
|
|
59
|
+
.argument('<meetingIds...>', 'Meeting IDs'), types_1.ToolName.RemoveTagFromMeetings, getTagAssignment);
|
package/dist/constants.js
CHANGED
|
@@ -43,7 +43,7 @@ exports.ASCII_LOGO = `
|
|
|
43
43
|
============= +++++`;
|
|
44
44
|
exports.CONFIG_DIRECTORY = node_path_1.default.join(node_os_1.default.homedir(), '.config', 'circleback');
|
|
45
45
|
exports.TOKENS_FILE = node_path_1.default.join(exports.CONFIG_DIRECTORY, 'tokens.json');
|
|
46
|
-
exports.OAUTH_SCOPE = 'user';
|
|
46
|
+
exports.OAUTH_SCOPE = 'user user:write';
|
|
47
47
|
exports.CALLBACK_TIMEOUT_MILLISECONDS = 120_000;
|
|
48
48
|
exports.MAX_READ_MEETING_IDENTIFIERS = 50;
|
|
49
49
|
exports.DEFAULT_MEETING_NAME = 'New meeting';
|
|
@@ -7,7 +7,41 @@ const output_1 = require("./output");
|
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
8
|
const types_1 = require("../types");
|
|
9
9
|
const stringify = (value) => typeof value === 'string' ? value : JSON.stringify(value, null, 2);
|
|
10
|
+
const ActionItemChangeSchema = zod_1.z.object({
|
|
11
|
+
id: zod_1.z.number(),
|
|
12
|
+
title: zod_1.z.string(),
|
|
13
|
+
status: zod_1.z.string(),
|
|
14
|
+
});
|
|
15
|
+
const formatActionItemChange = (verb, data) => {
|
|
16
|
+
const result = ActionItemChangeSchema.safeParse(data);
|
|
17
|
+
if (!result.success)
|
|
18
|
+
return;
|
|
19
|
+
const { id, title, status } = result.data;
|
|
20
|
+
return `${verb} action item ${id}: ${title} (${status})`;
|
|
21
|
+
};
|
|
22
|
+
const TagChangeSchema = zod_1.z.object({ id: zod_1.z.number(), name: zod_1.z.string() });
|
|
23
|
+
const formatTagChange = (verb, data) => {
|
|
24
|
+
const result = TagChangeSchema.safeParse(data);
|
|
25
|
+
if (!result.success)
|
|
26
|
+
return;
|
|
27
|
+
const { id, name } = result.data;
|
|
28
|
+
return `${verb} tag ${id}: ${name}`;
|
|
29
|
+
};
|
|
10
30
|
const formatForTool = (toolName, data) => {
|
|
31
|
+
switch (toolName) {
|
|
32
|
+
case types_1.ToolName.CreateActionItem:
|
|
33
|
+
return formatActionItemChange('Created', data);
|
|
34
|
+
case types_1.ToolName.UpdateActionItem:
|
|
35
|
+
return formatActionItemChange('Updated', data);
|
|
36
|
+
case types_1.ToolName.DeleteActionItem:
|
|
37
|
+
return formatActionItemChange('Deleted', data);
|
|
38
|
+
case types_1.ToolName.CreateTag:
|
|
39
|
+
return formatTagChange('Created', data);
|
|
40
|
+
case types_1.ToolName.UpdateTag:
|
|
41
|
+
return formatTagChange('Updated', data);
|
|
42
|
+
case types_1.ToolName.DeleteTag:
|
|
43
|
+
return formatTagChange('Deleted', data);
|
|
44
|
+
}
|
|
11
45
|
if (!Array.isArray(data))
|
|
12
46
|
return;
|
|
13
47
|
switch (toolName) {
|
|
@@ -33,6 +67,9 @@ const formatForTool = (toolName, data) => {
|
|
|
33
67
|
return (0, table_1.formatActionItems)(data);
|
|
34
68
|
case types_1.ToolName.ListTags:
|
|
35
69
|
return (0, table_1.formatTags)(data);
|
|
70
|
+
case types_1.ToolName.AddTagToMeetings:
|
|
71
|
+
case types_1.ToolName.RemoveTagFromMeetings:
|
|
72
|
+
return;
|
|
36
73
|
default: {
|
|
37
74
|
const _absurd = toolName;
|
|
38
75
|
return _absurd;
|
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.ToolName = exports.CredentialSource = exports.CredentialType = void 0;
|
|
3
|
+
exports.isJsonRpcResponse = exports.jsonRpcResultSchema = exports.isOAuthTokenResponse = exports.isStoredApiKey = exports.parseStoredCredentials = exports.ActionItemStatus = exports.ToolName = exports.CredentialSource = exports.CredentialType = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
var CredentialType;
|
|
6
6
|
(function (CredentialType) {
|
|
@@ -25,7 +25,20 @@ var ToolName;
|
|
|
25
25
|
ToolName["SearchEmails"] = "SearchEmails";
|
|
26
26
|
ToolName["SearchActionItems"] = "SearchActionItems";
|
|
27
27
|
ToolName["ListTags"] = "ListTags";
|
|
28
|
+
ToolName["CreateActionItem"] = "CreateActionItem";
|
|
29
|
+
ToolName["UpdateActionItem"] = "UpdateActionItem";
|
|
30
|
+
ToolName["DeleteActionItem"] = "DeleteActionItem";
|
|
31
|
+
ToolName["CreateTag"] = "CreateTag";
|
|
32
|
+
ToolName["UpdateTag"] = "UpdateTag";
|
|
33
|
+
ToolName["DeleteTag"] = "DeleteTag";
|
|
34
|
+
ToolName["AddTagToMeetings"] = "AddTagToMeetings";
|
|
35
|
+
ToolName["RemoveTagFromMeetings"] = "RemoveTagFromMeetings";
|
|
28
36
|
})(ToolName || (exports.ToolName = ToolName = {}));
|
|
37
|
+
var ActionItemStatus;
|
|
38
|
+
(function (ActionItemStatus) {
|
|
39
|
+
ActionItemStatus["Pending"] = "PENDING";
|
|
40
|
+
ActionItemStatus["Done"] = "DONE";
|
|
41
|
+
})(ActionItemStatus || (exports.ActionItemStatus = ActionItemStatus = {}));
|
|
29
42
|
const storedTokensSchema = zod_1.z.object({
|
|
30
43
|
accessToken: zod_1.z.string(),
|
|
31
44
|
refreshToken: zod_1.z.string(),
|
package/package.json
CHANGED