@chatbotkit/cli 1.26.2 → 1.26.3
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/cjs/command/api/blueprint/index.cjs +81 -0
- package/dist/cjs/command/api/blueprint/index.d.ts +8 -0
- package/dist/cjs/command/api/bot/index.cjs +61 -0
- package/dist/cjs/command/api/bot/index.d.ts +6 -0
- package/dist/cjs/command/api/contact/index.cjs +61 -0
- package/dist/cjs/command/api/contact/index.d.ts +6 -0
- package/dist/cjs/command/api/dataset/file/index.cjs +76 -0
- package/dist/cjs/command/api/dataset/file/index.d.ts +7 -0
- package/dist/cjs/command/api/dataset/index.cjs +7 -2
- package/dist/cjs/command/api/dataset/record/index.cjs +83 -0
- package/dist/cjs/command/api/dataset/record/index.d.ts +7 -0
- package/dist/cjs/command/api/file/index.cjs +71 -0
- package/dist/cjs/command/api/file/index.d.ts +7 -0
- package/dist/cjs/command/api/index.cjs +24 -8
- package/dist/cjs/command/api/integration/discord/index.cjs +71 -0
- package/dist/cjs/command/api/integration/discord/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/email/index.cjs +71 -0
- package/dist/cjs/command/api/integration/email/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/extract/index.cjs +61 -0
- package/dist/cjs/command/api/integration/extract/index.d.ts +6 -0
- package/dist/cjs/command/api/integration/index.cjs +44 -0
- package/dist/cjs/command/api/integration/index.d.ts +3 -0
- package/dist/cjs/command/api/integration/instagram/index.cjs +71 -0
- package/dist/cjs/command/api/integration/instagram/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/mcpserver/index.cjs +61 -0
- package/dist/cjs/command/api/integration/mcpserver/index.d.ts +6 -0
- package/dist/cjs/command/api/integration/messenger/index.cjs +71 -0
- package/dist/cjs/command/api/integration/messenger/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/notion/index.cjs +71 -0
- package/dist/cjs/command/api/integration/notion/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/sitemap/index.cjs +71 -0
- package/dist/cjs/command/api/integration/sitemap/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/slack/index.cjs +71 -0
- package/dist/cjs/command/api/integration/slack/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/support/index.cjs +61 -0
- package/dist/cjs/command/api/integration/support/index.d.ts +6 -0
- package/dist/cjs/command/api/integration/telegram/index.cjs +71 -0
- package/dist/cjs/command/api/integration/telegram/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/trigger/index.cjs +71 -0
- package/dist/cjs/command/api/integration/trigger/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/twilio/index.cjs +71 -0
- package/dist/cjs/command/api/integration/twilio/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/whatsapp/index.cjs +71 -0
- package/dist/cjs/command/api/integration/whatsapp/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/widget/index.cjs +71 -0
- package/dist/cjs/command/api/integration/widget/index.d.ts +7 -0
- package/dist/cjs/command/api/memory/index.cjs +79 -0
- package/dist/cjs/command/api/memory/index.d.ts +7 -0
- package/dist/cjs/command/api/secret/index.cjs +81 -0
- package/dist/cjs/command/api/secret/index.d.ts +8 -0
- package/dist/cjs/command/api/skillset/ability/index.cjs +83 -0
- package/dist/cjs/command/api/skillset/ability/index.d.ts +7 -0
- package/dist/cjs/command/api/skillset/index.cjs +5 -2
- package/dist/cjs/command/api/team/index.cjs +42 -0
- package/dist/cjs/command/api/team/index.d.ts +4 -0
- package/dist/cjs/input.cjs +28 -0
- package/dist/cjs/input.d.ts +5 -0
- package/dist/cjs/solution/index.cjs +1 -1
- package/dist/esm/command/api/blueprint/index.d.ts +8 -0
- package/dist/esm/command/api/blueprint/index.js +78 -0
- package/dist/esm/command/api/bot/index.d.ts +6 -0
- package/dist/esm/command/api/bot/index.js +58 -0
- package/dist/esm/command/api/contact/index.d.ts +6 -0
- package/dist/esm/command/api/contact/index.js +58 -0
- package/dist/esm/command/api/dataset/file/index.d.ts +7 -0
- package/dist/esm/command/api/dataset/file/index.js +73 -0
- package/dist/esm/command/api/dataset/index.js +4 -0
- package/dist/esm/command/api/dataset/record/index.d.ts +7 -0
- package/dist/esm/command/api/dataset/record/index.js +80 -0
- package/dist/esm/command/api/file/index.d.ts +7 -0
- package/dist/esm/command/api/file/index.js +68 -0
- package/dist/esm/command/api/index.js +17 -1
- package/dist/esm/command/api/integration/discord/index.d.ts +7 -0
- package/dist/esm/command/api/integration/discord/index.js +68 -0
- package/dist/esm/command/api/integration/email/index.d.ts +7 -0
- package/dist/esm/command/api/integration/email/index.js +68 -0
- package/dist/esm/command/api/integration/extract/index.d.ts +6 -0
- package/dist/esm/command/api/integration/extract/index.js +58 -0
- package/dist/esm/command/api/integration/index.d.ts +3 -0
- package/dist/esm/command/api/integration/index.js +40 -0
- package/dist/esm/command/api/integration/instagram/index.d.ts +7 -0
- package/dist/esm/command/api/integration/instagram/index.js +68 -0
- package/dist/esm/command/api/integration/mcpserver/index.d.ts +6 -0
- package/dist/esm/command/api/integration/mcpserver/index.js +58 -0
- package/dist/esm/command/api/integration/messenger/index.d.ts +7 -0
- package/dist/esm/command/api/integration/messenger/index.js +68 -0
- package/dist/esm/command/api/integration/notion/index.d.ts +7 -0
- package/dist/esm/command/api/integration/notion/index.js +68 -0
- package/dist/esm/command/api/integration/sitemap/index.d.ts +7 -0
- package/dist/esm/command/api/integration/sitemap/index.js +68 -0
- package/dist/esm/command/api/integration/slack/index.d.ts +7 -0
- package/dist/esm/command/api/integration/slack/index.js +68 -0
- package/dist/esm/command/api/integration/support/index.d.ts +6 -0
- package/dist/esm/command/api/integration/support/index.js +58 -0
- package/dist/esm/command/api/integration/telegram/index.d.ts +7 -0
- package/dist/esm/command/api/integration/telegram/index.js +68 -0
- package/dist/esm/command/api/integration/trigger/index.d.ts +7 -0
- package/dist/esm/command/api/integration/trigger/index.js +68 -0
- package/dist/esm/command/api/integration/twilio/index.d.ts +7 -0
- package/dist/esm/command/api/integration/twilio/index.js +68 -0
- package/dist/esm/command/api/integration/whatsapp/index.d.ts +7 -0
- package/dist/esm/command/api/integration/whatsapp/index.js +68 -0
- package/dist/esm/command/api/integration/widget/index.d.ts +7 -0
- package/dist/esm/command/api/integration/widget/index.js +68 -0
- package/dist/esm/command/api/memory/index.d.ts +7 -0
- package/dist/esm/command/api/memory/index.js +76 -0
- package/dist/esm/command/api/secret/index.d.ts +8 -0
- package/dist/esm/command/api/secret/index.js +78 -0
- package/dist/esm/command/api/skillset/ability/index.d.ts +7 -0
- package/dist/esm/command/api/skillset/ability/index.js +80 -0
- package/dist/esm/command/api/skillset/index.js +2 -0
- package/dist/esm/command/api/team/index.d.ts +4 -0
- package/dist/esm/command/api/team/index.js +39 -0
- package/dist/esm/input.d.ts +5 -0
- package/dist/esm/input.js +27 -0
- package/dist/esm/solution/index.d.ts +74 -68
- package/dist/esm/solution/index.js +1 -1
- package/package.json +804 -26
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const secretList: Command;
|
|
2
|
+
export const secretFetch: Command;
|
|
3
|
+
export const secretDelete: Command;
|
|
4
|
+
export const secretRevoke: Command;
|
|
5
|
+
export const secretVerify: Command;
|
|
6
|
+
export const command: Command;
|
|
7
|
+
export default command;
|
|
8
|
+
import { Command } from 'commander';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../env.js';
|
|
2
|
+
import { print } from '../../../output.js';
|
|
3
|
+
import { SecretClient } from '@chatbotkit/sdk/secret/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new SecretClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const secretList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List secrets')
|
|
14
|
+
.option('-s, --stream', 'Stream secrets')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const secret of client.list().stream()) {
|
|
20
|
+
print(secret);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const secret of items) {
|
|
26
|
+
print(secret);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const secretFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch secret')
|
|
33
|
+
.argument('<secretId>', 'Secret ID')
|
|
34
|
+
.action(async (secretId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const secret = await client.fetch(secretId);
|
|
37
|
+
print(secret);
|
|
38
|
+
});
|
|
39
|
+
export const secretDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete secret')
|
|
42
|
+
.argument('<secretId>', 'Secret ID')
|
|
43
|
+
.action(async (secretId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(secretId);
|
|
46
|
+
});
|
|
47
|
+
export const secretRevoke = new Command()
|
|
48
|
+
.name('revoke')
|
|
49
|
+
.description('Revoke secret')
|
|
50
|
+
.argument('<secretId>', 'Secret ID')
|
|
51
|
+
.action(async (secretId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.revoke(secretId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
export const secretVerify = new Command()
|
|
57
|
+
.name('verify')
|
|
58
|
+
.description('Verify secret')
|
|
59
|
+
.argument('<secretId>', 'Secret ID')
|
|
60
|
+
.action(async (secretId) => {
|
|
61
|
+
const client = getClient();
|
|
62
|
+
const result = await client.verify(secretId);
|
|
63
|
+
print(result);
|
|
64
|
+
});
|
|
65
|
+
const commands = {
|
|
66
|
+
list: secretList,
|
|
67
|
+
fetch: secretFetch,
|
|
68
|
+
delete: secretDelete,
|
|
69
|
+
revoke: secretRevoke,
|
|
70
|
+
verify: secretVerify,
|
|
71
|
+
};
|
|
72
|
+
export const command = new Command()
|
|
73
|
+
.name('secret')
|
|
74
|
+
.description('Secret tools for ChatBotKit');
|
|
75
|
+
for (const cmd of Object.values(commands)) {
|
|
76
|
+
command.addCommand(cmd);
|
|
77
|
+
}
|
|
78
|
+
export default command;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { SkillsetAbilityClient } from '@chatbotkit/sdk/skillset/ability/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new SkillsetAbilityClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const abilityList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List abilities')
|
|
14
|
+
.option('-s, --stream', 'Stream abilities')
|
|
15
|
+
.argument('<skillsetId>', 'Skillset ID')
|
|
16
|
+
.action(async (skillsetId, options) => {
|
|
17
|
+
const { stream } = options;
|
|
18
|
+
const client = getClient();
|
|
19
|
+
if (stream) {
|
|
20
|
+
for await (const ability of client.list(skillsetId).stream()) {
|
|
21
|
+
print(ability);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const { items } = await client.list(skillsetId);
|
|
26
|
+
for (const ability of items) {
|
|
27
|
+
print(ability);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export const abilityFetch = new Command()
|
|
32
|
+
.name('fetch')
|
|
33
|
+
.description('Fetch ability')
|
|
34
|
+
.argument('<skillsetId>', 'Skillset ID')
|
|
35
|
+
.argument('<abilityId>', 'Ability ID')
|
|
36
|
+
.action(async (skillsetId, abilityId) => {
|
|
37
|
+
const client = getClient();
|
|
38
|
+
const ability = await client.fetch(skillsetId, abilityId);
|
|
39
|
+
print(ability);
|
|
40
|
+
});
|
|
41
|
+
export const abilityDelete = new Command()
|
|
42
|
+
.name('delete')
|
|
43
|
+
.description('Delete ability')
|
|
44
|
+
.argument('<skillsetId>', 'Skillset ID')
|
|
45
|
+
.argument('<abilityId>', 'Ability ID')
|
|
46
|
+
.action(async (skillsetId, abilityId) => {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
await client.delete(skillsetId, abilityId);
|
|
49
|
+
});
|
|
50
|
+
export const abilityExport = new Command()
|
|
51
|
+
.name('export')
|
|
52
|
+
.description('Export abilities')
|
|
53
|
+
.option('-s, --stream', 'Stream exports')
|
|
54
|
+
.argument('<skillsetId>', 'Skillset ID')
|
|
55
|
+
.action(async (skillsetId, options) => {
|
|
56
|
+
const { stream } = options;
|
|
57
|
+
const client = getClient();
|
|
58
|
+
if (stream) {
|
|
59
|
+
for await (const ability of client.export(skillsetId).stream()) {
|
|
60
|
+
print(ability);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const result = await client.export(skillsetId);
|
|
65
|
+
print(result);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const commands = {
|
|
69
|
+
list: abilityList,
|
|
70
|
+
fetch: abilityFetch,
|
|
71
|
+
delete: abilityDelete,
|
|
72
|
+
export: abilityExport,
|
|
73
|
+
};
|
|
74
|
+
export const command = new Command()
|
|
75
|
+
.name('ability')
|
|
76
|
+
.description('Ability tools for ChatBotKit');
|
|
77
|
+
for (const cmd of Object.values(commands)) {
|
|
78
|
+
command.addCommand(cmd);
|
|
79
|
+
}
|
|
80
|
+
export default command;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getRUNAS_USERID, getSECRET } from '../../../env.js';
|
|
2
2
|
import { print } from '../../../output.js';
|
|
3
|
+
import ability from './ability/index.js';
|
|
3
4
|
import { SkillsetClient } from '@chatbotkit/sdk/skillset/index.js';
|
|
4
5
|
import { Command } from 'commander';
|
|
5
6
|
function getClient() {
|
|
@@ -48,6 +49,7 @@ const commands = {
|
|
|
48
49
|
list: skillsetList,
|
|
49
50
|
fetch: skillsetFetch,
|
|
50
51
|
delete: skillsetDelete,
|
|
52
|
+
ability,
|
|
51
53
|
};
|
|
52
54
|
export const command = new Command()
|
|
53
55
|
.name('skillset')
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../env.js';
|
|
2
|
+
import { print } from '../../../output.js';
|
|
3
|
+
import { TeamClient } from '@chatbotkit/sdk/team/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new TeamClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const teamList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List teams')
|
|
14
|
+
.option('-s, --stream', 'Stream teams')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const team of client.list().stream()) {
|
|
20
|
+
print(team);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const team of items) {
|
|
26
|
+
print(team);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const commands = {
|
|
31
|
+
list: teamList,
|
|
32
|
+
};
|
|
33
|
+
export const command = new Command()
|
|
34
|
+
.name('team')
|
|
35
|
+
.description('Team tools for ChatBotKit');
|
|
36
|
+
for (const cmd of Object.values(commands)) {
|
|
37
|
+
command.addCommand(cmd);
|
|
38
|
+
}
|
|
39
|
+
export default command;
|
package/dist/esm/input.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export function confirm(question: string): Promise<boolean>;
|
|
2
2
|
export function prompt(question: string): Promise<string>;
|
|
3
|
+
export function select(question: string, options: SelectOption[]): Promise<string>;
|
|
4
|
+
export type SelectOption = {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
package/dist/esm/input.js
CHANGED
|
@@ -23,3 +23,30 @@ export async function prompt(question) {
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
export async function select(question, options) {
|
|
27
|
+
const rl = readline.createInterface({
|
|
28
|
+
input: process.stdin,
|
|
29
|
+
output: process.stdout,
|
|
30
|
+
});
|
|
31
|
+
try {
|
|
32
|
+
while (true) {
|
|
33
|
+
console.log(question);
|
|
34
|
+
options.forEach((option, index) => {
|
|
35
|
+
console.log(` ${index + 1}) ${option.label}`);
|
|
36
|
+
});
|
|
37
|
+
const answer = await new Promise((resolve) => {
|
|
38
|
+
rl.question('Enter your choice (number): ', (input) => {
|
|
39
|
+
resolve(input);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
const index = parseInt((answer), 10) - 1;
|
|
43
|
+
if (index >= 0 && index < options.length) {
|
|
44
|
+
return options[index].value;
|
|
45
|
+
}
|
|
46
|
+
console.log('Invalid choice. Please try again.\n');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
rl.close();
|
|
51
|
+
}
|
|
52
|
+
}
|