@chatbotkit/cli 1.26.2 → 1.27.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.
Files changed (138) hide show
  1. package/dist/cjs/color.cjs +11 -1
  2. package/dist/cjs/color.d.ts +4 -0
  3. package/dist/cjs/command/api/blueprint/index.cjs +81 -0
  4. package/dist/cjs/command/api/blueprint/index.d.ts +8 -0
  5. package/dist/cjs/command/api/bot/index.cjs +61 -0
  6. package/dist/cjs/command/api/bot/index.d.ts +6 -0
  7. package/dist/cjs/command/api/contact/index.cjs +61 -0
  8. package/dist/cjs/command/api/contact/index.d.ts +6 -0
  9. package/dist/cjs/command/api/dataset/file/index.cjs +76 -0
  10. package/dist/cjs/command/api/dataset/file/index.d.ts +7 -0
  11. package/dist/cjs/command/api/dataset/index.cjs +7 -2
  12. package/dist/cjs/command/api/dataset/record/index.cjs +83 -0
  13. package/dist/cjs/command/api/dataset/record/index.d.ts +7 -0
  14. package/dist/cjs/command/api/file/index.cjs +71 -0
  15. package/dist/cjs/command/api/file/index.d.ts +7 -0
  16. package/dist/cjs/command/api/index.cjs +24 -8
  17. package/dist/cjs/command/api/integration/discord/index.cjs +71 -0
  18. package/dist/cjs/command/api/integration/discord/index.d.ts +7 -0
  19. package/dist/cjs/command/api/integration/email/index.cjs +71 -0
  20. package/dist/cjs/command/api/integration/email/index.d.ts +7 -0
  21. package/dist/cjs/command/api/integration/extract/index.cjs +61 -0
  22. package/dist/cjs/command/api/integration/extract/index.d.ts +6 -0
  23. package/dist/cjs/command/api/integration/index.cjs +44 -0
  24. package/dist/cjs/command/api/integration/index.d.ts +3 -0
  25. package/dist/cjs/command/api/integration/instagram/index.cjs +71 -0
  26. package/dist/cjs/command/api/integration/instagram/index.d.ts +7 -0
  27. package/dist/cjs/command/api/integration/mcpserver/index.cjs +61 -0
  28. package/dist/cjs/command/api/integration/mcpserver/index.d.ts +6 -0
  29. package/dist/cjs/command/api/integration/messenger/index.cjs +71 -0
  30. package/dist/cjs/command/api/integration/messenger/index.d.ts +7 -0
  31. package/dist/cjs/command/api/integration/notion/index.cjs +71 -0
  32. package/dist/cjs/command/api/integration/notion/index.d.ts +7 -0
  33. package/dist/cjs/command/api/integration/sitemap/index.cjs +71 -0
  34. package/dist/cjs/command/api/integration/sitemap/index.d.ts +7 -0
  35. package/dist/cjs/command/api/integration/slack/index.cjs +71 -0
  36. package/dist/cjs/command/api/integration/slack/index.d.ts +7 -0
  37. package/dist/cjs/command/api/integration/support/index.cjs +61 -0
  38. package/dist/cjs/command/api/integration/support/index.d.ts +6 -0
  39. package/dist/cjs/command/api/integration/telegram/index.cjs +71 -0
  40. package/dist/cjs/command/api/integration/telegram/index.d.ts +7 -0
  41. package/dist/cjs/command/api/integration/trigger/index.cjs +71 -0
  42. package/dist/cjs/command/api/integration/trigger/index.d.ts +7 -0
  43. package/dist/cjs/command/api/integration/twilio/index.cjs +71 -0
  44. package/dist/cjs/command/api/integration/twilio/index.d.ts +7 -0
  45. package/dist/cjs/command/api/integration/whatsapp/index.cjs +71 -0
  46. package/dist/cjs/command/api/integration/whatsapp/index.d.ts +7 -0
  47. package/dist/cjs/command/api/integration/widget/index.cjs +71 -0
  48. package/dist/cjs/command/api/integration/widget/index.d.ts +7 -0
  49. package/dist/cjs/command/api/memory/index.cjs +79 -0
  50. package/dist/cjs/command/api/memory/index.d.ts +7 -0
  51. package/dist/cjs/command/api/secret/index.cjs +81 -0
  52. package/dist/cjs/command/api/secret/index.d.ts +8 -0
  53. package/dist/cjs/command/api/skillset/ability/index.cjs +83 -0
  54. package/dist/cjs/command/api/skillset/ability/index.d.ts +7 -0
  55. package/dist/cjs/command/api/skillset/index.cjs +5 -2
  56. package/dist/cjs/command/api/team/index.cjs +42 -0
  57. package/dist/cjs/command/api/team/index.d.ts +4 -0
  58. package/dist/cjs/command/run/index.cjs +83 -0
  59. package/dist/cjs/command/run/index.d.ts +3 -0
  60. package/dist/cjs/index.cjs +7 -1
  61. package/dist/cjs/index.d.ts +4 -0
  62. package/dist/cjs/input.cjs +28 -0
  63. package/dist/cjs/input.d.ts +5 -0
  64. package/dist/cjs/loader/hooks.cjs +82 -0
  65. package/dist/cjs/loader/hooks.d.ts +4 -0
  66. package/dist/cjs/loader/index.cjs +8 -0
  67. package/dist/cjs/loader/index.d.ts +1 -0
  68. package/dist/cjs/solution/index.cjs +7 -1
  69. package/dist/esm/color.d.ts +4 -0
  70. package/dist/esm/color.js +8 -0
  71. package/dist/esm/command/api/blueprint/index.d.ts +8 -0
  72. package/dist/esm/command/api/blueprint/index.js +78 -0
  73. package/dist/esm/command/api/bot/index.d.ts +6 -0
  74. package/dist/esm/command/api/bot/index.js +58 -0
  75. package/dist/esm/command/api/contact/index.d.ts +6 -0
  76. package/dist/esm/command/api/contact/index.js +58 -0
  77. package/dist/esm/command/api/dataset/file/index.d.ts +7 -0
  78. package/dist/esm/command/api/dataset/file/index.js +73 -0
  79. package/dist/esm/command/api/dataset/index.js +4 -0
  80. package/dist/esm/command/api/dataset/record/index.d.ts +7 -0
  81. package/dist/esm/command/api/dataset/record/index.js +80 -0
  82. package/dist/esm/command/api/file/index.d.ts +7 -0
  83. package/dist/esm/command/api/file/index.js +68 -0
  84. package/dist/esm/command/api/index.js +17 -1
  85. package/dist/esm/command/api/integration/discord/index.d.ts +7 -0
  86. package/dist/esm/command/api/integration/discord/index.js +68 -0
  87. package/dist/esm/command/api/integration/email/index.d.ts +7 -0
  88. package/dist/esm/command/api/integration/email/index.js +68 -0
  89. package/dist/esm/command/api/integration/extract/index.d.ts +6 -0
  90. package/dist/esm/command/api/integration/extract/index.js +58 -0
  91. package/dist/esm/command/api/integration/index.d.ts +3 -0
  92. package/dist/esm/command/api/integration/index.js +40 -0
  93. package/dist/esm/command/api/integration/instagram/index.d.ts +7 -0
  94. package/dist/esm/command/api/integration/instagram/index.js +68 -0
  95. package/dist/esm/command/api/integration/mcpserver/index.d.ts +6 -0
  96. package/dist/esm/command/api/integration/mcpserver/index.js +58 -0
  97. package/dist/esm/command/api/integration/messenger/index.d.ts +7 -0
  98. package/dist/esm/command/api/integration/messenger/index.js +68 -0
  99. package/dist/esm/command/api/integration/notion/index.d.ts +7 -0
  100. package/dist/esm/command/api/integration/notion/index.js +68 -0
  101. package/dist/esm/command/api/integration/sitemap/index.d.ts +7 -0
  102. package/dist/esm/command/api/integration/sitemap/index.js +68 -0
  103. package/dist/esm/command/api/integration/slack/index.d.ts +7 -0
  104. package/dist/esm/command/api/integration/slack/index.js +68 -0
  105. package/dist/esm/command/api/integration/support/index.d.ts +6 -0
  106. package/dist/esm/command/api/integration/support/index.js +58 -0
  107. package/dist/esm/command/api/integration/telegram/index.d.ts +7 -0
  108. package/dist/esm/command/api/integration/telegram/index.js +68 -0
  109. package/dist/esm/command/api/integration/trigger/index.d.ts +7 -0
  110. package/dist/esm/command/api/integration/trigger/index.js +68 -0
  111. package/dist/esm/command/api/integration/twilio/index.d.ts +7 -0
  112. package/dist/esm/command/api/integration/twilio/index.js +68 -0
  113. package/dist/esm/command/api/integration/whatsapp/index.d.ts +7 -0
  114. package/dist/esm/command/api/integration/whatsapp/index.js +68 -0
  115. package/dist/esm/command/api/integration/widget/index.d.ts +7 -0
  116. package/dist/esm/command/api/integration/widget/index.js +68 -0
  117. package/dist/esm/command/api/memory/index.d.ts +7 -0
  118. package/dist/esm/command/api/memory/index.js +76 -0
  119. package/dist/esm/command/api/secret/index.d.ts +8 -0
  120. package/dist/esm/command/api/secret/index.js +78 -0
  121. package/dist/esm/command/api/skillset/ability/index.d.ts +7 -0
  122. package/dist/esm/command/api/skillset/ability/index.js +80 -0
  123. package/dist/esm/command/api/skillset/index.js +2 -0
  124. package/dist/esm/command/api/team/index.d.ts +4 -0
  125. package/dist/esm/command/api/team/index.js +39 -0
  126. package/dist/esm/command/run/index.d.ts +3 -0
  127. package/dist/esm/command/run/index.js +80 -0
  128. package/dist/esm/index.d.ts +4 -0
  129. package/dist/esm/index.js +4 -1
  130. package/dist/esm/input.d.ts +5 -0
  131. package/dist/esm/input.js +27 -0
  132. package/dist/esm/loader/hooks.d.ts +4 -0
  133. package/dist/esm/loader/hooks.js +79 -0
  134. package/dist/esm/loader/index.d.ts +1 -0
  135. package/dist/esm/loader/index.js +6 -0
  136. package/dist/esm/solution/index.d.ts +104 -64
  137. package/dist/esm/solution/index.js +7 -1
  138. package/package.json +884 -26
@@ -0,0 +1,6 @@
1
+ export const contactList: Command;
2
+ export const contactFetch: Command;
3
+ export const contactDelete: Command;
4
+ export const command: Command;
5
+ export default command;
6
+ import { Command } from 'commander';
@@ -0,0 +1,58 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../env.js';
2
+ import { print } from '../../../output.js';
3
+ import { ContactClient } from '@chatbotkit/sdk/contact/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new ContactClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const contactList = new Command()
12
+ .name('list')
13
+ .description('List contacts')
14
+ .option('-s, --stream', 'Stream contacts')
15
+ .action(async (str, options) => {
16
+ const { stream } = options;
17
+ const client = getClient();
18
+ if (stream) {
19
+ for await (const contact of client.list().stream()) {
20
+ print(contact);
21
+ }
22
+ }
23
+ else {
24
+ const { items } = await client.list();
25
+ for (const contact of items) {
26
+ print(contact);
27
+ }
28
+ }
29
+ });
30
+ export const contactFetch = new Command()
31
+ .name('fetch')
32
+ .description('Fetch contact')
33
+ .argument('<contactId>', 'Contact ID')
34
+ .action(async (contactId) => {
35
+ const client = getClient();
36
+ const contact = await client.fetch(contactId);
37
+ print(contact);
38
+ });
39
+ export const contactDelete = new Command()
40
+ .name('delete')
41
+ .description('Delete contact')
42
+ .argument('<contactId>', 'Contact ID')
43
+ .action(async (contactId) => {
44
+ const client = getClient();
45
+ await client.delete(contactId);
46
+ });
47
+ const commands = {
48
+ list: contactList,
49
+ fetch: contactFetch,
50
+ delete: contactDelete,
51
+ };
52
+ export const command = new Command()
53
+ .name('contact')
54
+ .description('Contact tools for ChatBotKit');
55
+ for (const cmd of Object.values(commands)) {
56
+ command.addCommand(cmd);
57
+ }
58
+ export default command;
@@ -0,0 +1,7 @@
1
+ export const fileList: Command;
2
+ export const fileAttach: Command;
3
+ export const fileDetach: Command;
4
+ export const fileSync: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -0,0 +1,73 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
2
+ import { print } from '../../../../output.js';
3
+ import { DatasetFileClient } from '@chatbotkit/sdk/dataset/file/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new DatasetFileClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const fileList = new Command()
12
+ .name('list')
13
+ .description('List files')
14
+ .option('-s, --stream', 'Stream files')
15
+ .argument('<datasetId>', 'Dataset ID')
16
+ .action(async (datasetId, options) => {
17
+ const { stream } = options;
18
+ const client = getClient();
19
+ if (stream) {
20
+ for await (const file of client.list(datasetId).stream()) {
21
+ print(file);
22
+ }
23
+ }
24
+ else {
25
+ const { items } = await client.list(datasetId);
26
+ for (const file of items) {
27
+ print(file);
28
+ }
29
+ }
30
+ });
31
+ export const fileAttach = new Command()
32
+ .name('attach')
33
+ .description('Attach file to dataset')
34
+ .argument('<datasetId>', 'Dataset ID')
35
+ .argument('<fileId>', 'File ID')
36
+ .action(async (datasetId, fileId) => {
37
+ const client = getClient();
38
+ const result = await client.attach(datasetId, fileId, {});
39
+ print(result);
40
+ });
41
+ export const fileDetach = new Command()
42
+ .name('detach')
43
+ .description('Detach file from dataset')
44
+ .argument('<datasetId>', 'Dataset ID')
45
+ .argument('<fileId>', 'File ID')
46
+ .action(async (datasetId, fileId) => {
47
+ const client = getClient();
48
+ const result = await client.detach(datasetId, fileId, {});
49
+ print(result);
50
+ });
51
+ export const fileSync = new Command()
52
+ .name('sync')
53
+ .description('Sync file')
54
+ .argument('<datasetId>', 'Dataset ID')
55
+ .argument('<fileId>', 'File ID')
56
+ .action(async (datasetId, fileId) => {
57
+ const client = getClient();
58
+ const result = await client.sync(datasetId, fileId, {});
59
+ print(result);
60
+ });
61
+ const commands = {
62
+ list: fileList,
63
+ attach: fileAttach,
64
+ detach: fileDetach,
65
+ sync: fileSync,
66
+ };
67
+ export const command = new Command()
68
+ .name('file')
69
+ .description('File tools for ChatBotKit');
70
+ for (const cmd of Object.values(commands)) {
71
+ command.addCommand(cmd);
72
+ }
73
+ export default command;
@@ -1,5 +1,7 @@
1
1
  import { getRUNAS_USERID, getSECRET } from '../../../env.js';
2
2
  import { print } from '../../../output.js';
3
+ import file from './file/index.js';
4
+ import record from './record/index.js';
3
5
  import { DatasetClient } from '@chatbotkit/sdk/dataset/index.js';
4
6
  import { Command } from 'commander';
5
7
  function getClient() {
@@ -48,6 +50,8 @@ const commands = {
48
50
  list: datasetList,
49
51
  fetch: datasetFetch,
50
52
  delete: datasetDelete,
53
+ file,
54
+ record,
51
55
  };
52
56
  export const command = new Command()
53
57
  .name('dataset')
@@ -0,0 +1,7 @@
1
+ export const recordList: Command;
2
+ export const recordFetch: Command;
3
+ export const recordDelete: Command;
4
+ export const recordExport: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -0,0 +1,80 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
2
+ import { print } from '../../../../output.js';
3
+ import { DatasetRecordClient } from '@chatbotkit/sdk/dataset/record/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new DatasetRecordClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const recordList = new Command()
12
+ .name('list')
13
+ .description('List records')
14
+ .option('-s, --stream', 'Stream records')
15
+ .argument('<datasetId>', 'Dataset ID')
16
+ .action(async (datasetId, options) => {
17
+ const { stream } = options;
18
+ const client = getClient();
19
+ if (stream) {
20
+ for await (const record of client.list(datasetId).stream()) {
21
+ print(record);
22
+ }
23
+ }
24
+ else {
25
+ const { items } = await client.list(datasetId);
26
+ for (const record of items) {
27
+ print(record);
28
+ }
29
+ }
30
+ });
31
+ export const recordFetch = new Command()
32
+ .name('fetch')
33
+ .description('Fetch record')
34
+ .argument('<datasetId>', 'Dataset ID')
35
+ .argument('<recordId>', 'Record ID')
36
+ .action(async (datasetId, recordId) => {
37
+ const client = getClient();
38
+ const record = await client.fetch(datasetId, recordId);
39
+ print(record);
40
+ });
41
+ export const recordDelete = new Command()
42
+ .name('delete')
43
+ .description('Delete record')
44
+ .argument('<datasetId>', 'Dataset ID')
45
+ .argument('<recordId>', 'Record ID')
46
+ .action(async (datasetId, recordId) => {
47
+ const client = getClient();
48
+ await client.delete(datasetId, recordId);
49
+ });
50
+ export const recordExport = new Command()
51
+ .name('export')
52
+ .description('Export records')
53
+ .option('-s, --stream', 'Stream exports')
54
+ .argument('<datasetId>', 'Dataset ID')
55
+ .action(async (datasetId, options) => {
56
+ const { stream } = options;
57
+ const client = getClient();
58
+ if (stream) {
59
+ for await (const record of client.export(datasetId).stream()) {
60
+ print(record);
61
+ }
62
+ }
63
+ else {
64
+ const result = await client.export(datasetId);
65
+ print(result);
66
+ }
67
+ });
68
+ const commands = {
69
+ list: recordList,
70
+ fetch: recordFetch,
71
+ delete: recordDelete,
72
+ export: recordExport,
73
+ };
74
+ export const command = new Command()
75
+ .name('record')
76
+ .description('Record tools for ChatBotKit');
77
+ for (const cmd of Object.values(commands)) {
78
+ command.addCommand(cmd);
79
+ }
80
+ export default command;
@@ -0,0 +1,7 @@
1
+ export const fileList: Command;
2
+ export const fileFetch: Command;
3
+ export const fileDelete: Command;
4
+ export const fileSync: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -0,0 +1,68 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../env.js';
2
+ import { print } from '../../../output.js';
3
+ import { FileClient } from '@chatbotkit/sdk/file/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new FileClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const fileList = new Command()
12
+ .name('list')
13
+ .description('List files')
14
+ .option('-s, --stream', 'Stream files')
15
+ .action(async (str, options) => {
16
+ const { stream } = options;
17
+ const client = getClient();
18
+ if (stream) {
19
+ for await (const file of client.list().stream()) {
20
+ print(file);
21
+ }
22
+ }
23
+ else {
24
+ const { items } = await client.list();
25
+ for (const file of items) {
26
+ print(file);
27
+ }
28
+ }
29
+ });
30
+ export const fileFetch = new Command()
31
+ .name('fetch')
32
+ .description('Fetch file')
33
+ .argument('<fileId>', 'File ID')
34
+ .action(async (fileId) => {
35
+ const client = getClient();
36
+ const file = await client.fetch(fileId);
37
+ print(file);
38
+ });
39
+ export const fileDelete = new Command()
40
+ .name('delete')
41
+ .description('Delete file')
42
+ .argument('<fileId>', 'File ID')
43
+ .action(async (fileId) => {
44
+ const client = getClient();
45
+ await client.delete(fileId);
46
+ });
47
+ export const fileSync = new Command()
48
+ .name('sync')
49
+ .description('Sync file')
50
+ .argument('<fileId>', 'File ID')
51
+ .action(async (fileId) => {
52
+ const client = getClient();
53
+ const result = await client.sync(fileId);
54
+ print(result);
55
+ });
56
+ const commands = {
57
+ list: fileList,
58
+ fetch: fileFetch,
59
+ delete: fileDelete,
60
+ sync: fileSync,
61
+ };
62
+ export const command = new Command()
63
+ .name('file')
64
+ .description('File tools for ChatBotKit');
65
+ for (const cmd of Object.values(commands)) {
66
+ command.addCommand(cmd);
67
+ }
68
+ export default command;
@@ -1,14 +1,30 @@
1
1
  import { config as printConfig } from '../../output.js';
2
+ import blueprint from './blueprint/index.js';
3
+ import bot from './bot/index.js';
4
+ import contact from './contact/index.js';
2
5
  import conversation from './conversation/index.js';
3
6
  import dataset from './dataset/index.js';
7
+ import file from './file/index.js';
8
+ import integration from './integration/index.js';
9
+ import memory from './memory/index.js';
4
10
  import partner from './partner/index.js';
11
+ import secret from './secret/index.js';
5
12
  import skillset from './skillset/index.js';
13
+ import team from './team/index.js';
6
14
  import { Command, Option } from 'commander';
7
15
  const commands = {
16
+ blueprint,
17
+ bot,
18
+ contact,
8
19
  conversation,
9
20
  dataset,
10
- skillset,
21
+ file,
22
+ integration,
23
+ memory,
11
24
  partner,
25
+ secret,
26
+ skillset,
27
+ team,
12
28
  };
13
29
  export const command = new Command()
14
30
  .name('api')
@@ -0,0 +1,7 @@
1
+ export const discordList: Command;
2
+ export const discordFetch: Command;
3
+ export const discordDelete: Command;
4
+ export const discordSetup: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -0,0 +1,68 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
2
+ import { print } from '../../../../output.js';
3
+ import { DiscordIntegrationClient } from '@chatbotkit/sdk/integration/discord/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new DiscordIntegrationClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const discordList = new Command()
12
+ .name('list')
13
+ .description('List discord integrations')
14
+ .option('-s, --stream', 'Stream discord integrations')
15
+ .action(async (str, options) => {
16
+ const { stream } = options;
17
+ const client = getClient();
18
+ if (stream) {
19
+ for await (const discord of client.list().stream()) {
20
+ print(discord);
21
+ }
22
+ }
23
+ else {
24
+ const { items } = await client.list();
25
+ for (const discord of items) {
26
+ print(discord);
27
+ }
28
+ }
29
+ });
30
+ export const discordFetch = new Command()
31
+ .name('fetch')
32
+ .description('Fetch discord integration')
33
+ .argument('<discordId>', 'Discord ID')
34
+ .action(async (discordId) => {
35
+ const client = getClient();
36
+ const discord = await client.fetch(discordId);
37
+ print(discord);
38
+ });
39
+ export const discordDelete = new Command()
40
+ .name('delete')
41
+ .description('Delete discord integration')
42
+ .argument('<discordId>', 'Discord ID')
43
+ .action(async (discordId) => {
44
+ const client = getClient();
45
+ await client.delete(discordId);
46
+ });
47
+ export const discordSetup = new Command()
48
+ .name('setup')
49
+ .description('Setup discord integration')
50
+ .argument('<discordId>', 'Discord ID')
51
+ .action(async (discordId) => {
52
+ const client = getClient();
53
+ const result = await client.setup(discordId);
54
+ print(result);
55
+ });
56
+ const commands = {
57
+ list: discordList,
58
+ fetch: discordFetch,
59
+ delete: discordDelete,
60
+ setup: discordSetup,
61
+ };
62
+ export const command = new Command()
63
+ .name('discord')
64
+ .description('Discord integration tools for ChatBotKit');
65
+ for (const cmd of Object.values(commands)) {
66
+ command.addCommand(cmd);
67
+ }
68
+ export default command;
@@ -0,0 +1,7 @@
1
+ export const emailList: Command;
2
+ export const emailFetch: Command;
3
+ export const emailDelete: Command;
4
+ export const emailSetup: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -0,0 +1,68 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
2
+ import { print } from '../../../../output.js';
3
+ import { EmailIntegrationClient } from '@chatbotkit/sdk/integration/email/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new EmailIntegrationClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const emailList = new Command()
12
+ .name('list')
13
+ .description('List email integrations')
14
+ .option('-s, --stream', 'Stream email integrations')
15
+ .action(async (str, options) => {
16
+ const { stream } = options;
17
+ const client = getClient();
18
+ if (stream) {
19
+ for await (const email of client.list().stream()) {
20
+ print(email);
21
+ }
22
+ }
23
+ else {
24
+ const { items } = await client.list();
25
+ for (const email of items) {
26
+ print(email);
27
+ }
28
+ }
29
+ });
30
+ export const emailFetch = new Command()
31
+ .name('fetch')
32
+ .description('Fetch email integration')
33
+ .argument('<emailId>', 'Email ID')
34
+ .action(async (emailId) => {
35
+ const client = getClient();
36
+ const email = await client.fetch(emailId);
37
+ print(email);
38
+ });
39
+ export const emailDelete = new Command()
40
+ .name('delete')
41
+ .description('Delete email integration')
42
+ .argument('<emailId>', 'Email ID')
43
+ .action(async (emailId) => {
44
+ const client = getClient();
45
+ await client.delete(emailId);
46
+ });
47
+ export const emailSetup = new Command()
48
+ .name('setup')
49
+ .description('Setup email integration')
50
+ .argument('<emailId>', 'Email ID')
51
+ .action(async (emailId) => {
52
+ const client = getClient();
53
+ const result = await client.setup(emailId);
54
+ print(result);
55
+ });
56
+ const commands = {
57
+ list: emailList,
58
+ fetch: emailFetch,
59
+ delete: emailDelete,
60
+ setup: emailSetup,
61
+ };
62
+ export const command = new Command()
63
+ .name('email')
64
+ .description('Email integration tools for ChatBotKit');
65
+ for (const cmd of Object.values(commands)) {
66
+ command.addCommand(cmd);
67
+ }
68
+ export default command;
@@ -0,0 +1,6 @@
1
+ export const extractList: Command;
2
+ export const extractFetch: Command;
3
+ export const extractDelete: Command;
4
+ export const command: Command;
5
+ export default command;
6
+ import { Command } from 'commander';
@@ -0,0 +1,58 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
2
+ import { print } from '../../../../output.js';
3
+ import { ExtractIntegrationClient } from '@chatbotkit/sdk/integration/extract/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new ExtractIntegrationClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const extractList = new Command()
12
+ .name('list')
13
+ .description('List extract integrations')
14
+ .option('-s, --stream', 'Stream extract integrations')
15
+ .action(async (str, options) => {
16
+ const { stream } = options;
17
+ const client = getClient();
18
+ if (stream) {
19
+ for await (const extract of client.list().stream()) {
20
+ print(extract);
21
+ }
22
+ }
23
+ else {
24
+ const { items } = await client.list();
25
+ for (const extract of items) {
26
+ print(extract);
27
+ }
28
+ }
29
+ });
30
+ export const extractFetch = new Command()
31
+ .name('fetch')
32
+ .description('Fetch extract integration')
33
+ .argument('<extractId>', 'Extract ID')
34
+ .action(async (extractId) => {
35
+ const client = getClient();
36
+ const extract = await client.fetch(extractId);
37
+ print(extract);
38
+ });
39
+ export const extractDelete = new Command()
40
+ .name('delete')
41
+ .description('Delete extract integration')
42
+ .argument('<extractId>', 'Extract ID')
43
+ .action(async (extractId) => {
44
+ const client = getClient();
45
+ await client.delete(extractId);
46
+ });
47
+ const commands = {
48
+ list: extractList,
49
+ fetch: extractFetch,
50
+ delete: extractDelete,
51
+ };
52
+ export const command = new Command()
53
+ .name('extract')
54
+ .description('Extract integration tools for ChatBotKit');
55
+ for (const cmd of Object.values(commands)) {
56
+ command.addCommand(cmd);
57
+ }
58
+ export default command;
@@ -0,0 +1,3 @@
1
+ export const command: Command;
2
+ export default command;
3
+ import { Command } from 'commander';
@@ -0,0 +1,40 @@
1
+ import discord from './discord/index.js';
2
+ import email from './email/index.js';
3
+ import extract from './extract/index.js';
4
+ import instagram from './instagram/index.js';
5
+ import mcpserver from './mcpserver/index.js';
6
+ import messenger from './messenger/index.js';
7
+ import notion from './notion/index.js';
8
+ import sitemap from './sitemap/index.js';
9
+ import slack from './slack/index.js';
10
+ import support from './support/index.js';
11
+ import telegram from './telegram/index.js';
12
+ import trigger from './trigger/index.js';
13
+ import twilio from './twilio/index.js';
14
+ import whatsapp from './whatsapp/index.js';
15
+ import widget from './widget/index.js';
16
+ import { Command } from 'commander';
17
+ const commands = {
18
+ widget,
19
+ slack,
20
+ discord,
21
+ whatsapp,
22
+ messenger,
23
+ instagram,
24
+ telegram,
25
+ trigger,
26
+ email,
27
+ sitemap,
28
+ notion,
29
+ support,
30
+ extract,
31
+ mcpserver,
32
+ twilio,
33
+ };
34
+ export const command = new Command()
35
+ .name('integration')
36
+ .description('Integration tools for ChatBotKit');
37
+ for (const cmd of Object.values(commands)) {
38
+ command.addCommand(cmd);
39
+ }
40
+ export default command;
@@ -0,0 +1,7 @@
1
+ export const instagramList: Command;
2
+ export const instagramFetch: Command;
3
+ export const instagramDelete: Command;
4
+ export const instagramSetup: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';