@chatbotkit/cli 1.26.1 → 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.
Files changed (122) hide show
  1. package/dist/cjs/command/api/blueprint/index.cjs +81 -0
  2. package/dist/cjs/command/api/blueprint/index.d.ts +8 -0
  3. package/dist/cjs/command/api/bot/index.cjs +61 -0
  4. package/dist/cjs/command/api/bot/index.d.ts +6 -0
  5. package/dist/cjs/command/api/contact/index.cjs +61 -0
  6. package/dist/cjs/command/api/contact/index.d.ts +6 -0
  7. package/dist/cjs/command/api/dataset/file/index.cjs +76 -0
  8. package/dist/cjs/command/api/dataset/file/index.d.ts +7 -0
  9. package/dist/cjs/command/api/dataset/index.cjs +7 -2
  10. package/dist/cjs/command/api/dataset/record/index.cjs +83 -0
  11. package/dist/cjs/command/api/dataset/record/index.d.ts +7 -0
  12. package/dist/cjs/command/api/file/index.cjs +71 -0
  13. package/dist/cjs/command/api/file/index.d.ts +7 -0
  14. package/dist/cjs/command/api/index.cjs +24 -8
  15. package/dist/cjs/command/api/integration/discord/index.cjs +71 -0
  16. package/dist/cjs/command/api/integration/discord/index.d.ts +7 -0
  17. package/dist/cjs/command/api/integration/email/index.cjs +71 -0
  18. package/dist/cjs/command/api/integration/email/index.d.ts +7 -0
  19. package/dist/cjs/command/api/integration/extract/index.cjs +61 -0
  20. package/dist/cjs/command/api/integration/extract/index.d.ts +6 -0
  21. package/dist/cjs/command/api/integration/index.cjs +44 -0
  22. package/dist/cjs/command/api/integration/index.d.ts +3 -0
  23. package/dist/cjs/command/api/integration/instagram/index.cjs +71 -0
  24. package/dist/cjs/command/api/integration/instagram/index.d.ts +7 -0
  25. package/dist/cjs/command/api/integration/mcpserver/index.cjs +61 -0
  26. package/dist/cjs/command/api/integration/mcpserver/index.d.ts +6 -0
  27. package/dist/cjs/command/api/integration/messenger/index.cjs +71 -0
  28. package/dist/cjs/command/api/integration/messenger/index.d.ts +7 -0
  29. package/dist/cjs/command/api/integration/notion/index.cjs +71 -0
  30. package/dist/cjs/command/api/integration/notion/index.d.ts +7 -0
  31. package/dist/cjs/command/api/integration/sitemap/index.cjs +71 -0
  32. package/dist/cjs/command/api/integration/sitemap/index.d.ts +7 -0
  33. package/dist/cjs/command/api/integration/slack/index.cjs +71 -0
  34. package/dist/cjs/command/api/integration/slack/index.d.ts +7 -0
  35. package/dist/cjs/command/api/integration/support/index.cjs +61 -0
  36. package/dist/cjs/command/api/integration/support/index.d.ts +6 -0
  37. package/dist/cjs/command/api/integration/telegram/index.cjs +71 -0
  38. package/dist/cjs/command/api/integration/telegram/index.d.ts +7 -0
  39. package/dist/cjs/command/api/integration/trigger/index.cjs +71 -0
  40. package/dist/cjs/command/api/integration/trigger/index.d.ts +7 -0
  41. package/dist/cjs/command/api/integration/twilio/index.cjs +71 -0
  42. package/dist/cjs/command/api/integration/twilio/index.d.ts +7 -0
  43. package/dist/cjs/command/api/integration/whatsapp/index.cjs +71 -0
  44. package/dist/cjs/command/api/integration/whatsapp/index.d.ts +7 -0
  45. package/dist/cjs/command/api/integration/widget/index.cjs +71 -0
  46. package/dist/cjs/command/api/integration/widget/index.d.ts +7 -0
  47. package/dist/cjs/command/api/memory/index.cjs +79 -0
  48. package/dist/cjs/command/api/memory/index.d.ts +7 -0
  49. package/dist/cjs/command/api/secret/index.cjs +81 -0
  50. package/dist/cjs/command/api/secret/index.d.ts +8 -0
  51. package/dist/cjs/command/api/skillset/ability/index.cjs +83 -0
  52. package/dist/cjs/command/api/skillset/ability/index.d.ts +7 -0
  53. package/dist/cjs/command/api/skillset/index.cjs +5 -2
  54. package/dist/cjs/command/api/team/index.cjs +42 -0
  55. package/dist/cjs/command/api/team/index.d.ts +4 -0
  56. package/dist/cjs/input.cjs +28 -0
  57. package/dist/cjs/input.d.ts +5 -0
  58. package/dist/cjs/solution/index.cjs +1 -1
  59. package/dist/cjs/tools.cjs +5 -186
  60. package/dist/cjs/tools.d.ts +2 -7
  61. package/dist/esm/command/api/blueprint/index.d.ts +8 -0
  62. package/dist/esm/command/api/blueprint/index.js +78 -0
  63. package/dist/esm/command/api/bot/index.d.ts +6 -0
  64. package/dist/esm/command/api/bot/index.js +58 -0
  65. package/dist/esm/command/api/contact/index.d.ts +6 -0
  66. package/dist/esm/command/api/contact/index.js +58 -0
  67. package/dist/esm/command/api/dataset/file/index.d.ts +7 -0
  68. package/dist/esm/command/api/dataset/file/index.js +73 -0
  69. package/dist/esm/command/api/dataset/index.js +4 -0
  70. package/dist/esm/command/api/dataset/record/index.d.ts +7 -0
  71. package/dist/esm/command/api/dataset/record/index.js +80 -0
  72. package/dist/esm/command/api/file/index.d.ts +7 -0
  73. package/dist/esm/command/api/file/index.js +68 -0
  74. package/dist/esm/command/api/index.js +17 -1
  75. package/dist/esm/command/api/integration/discord/index.d.ts +7 -0
  76. package/dist/esm/command/api/integration/discord/index.js +68 -0
  77. package/dist/esm/command/api/integration/email/index.d.ts +7 -0
  78. package/dist/esm/command/api/integration/email/index.js +68 -0
  79. package/dist/esm/command/api/integration/extract/index.d.ts +6 -0
  80. package/dist/esm/command/api/integration/extract/index.js +58 -0
  81. package/dist/esm/command/api/integration/index.d.ts +3 -0
  82. package/dist/esm/command/api/integration/index.js +40 -0
  83. package/dist/esm/command/api/integration/instagram/index.d.ts +7 -0
  84. package/dist/esm/command/api/integration/instagram/index.js +68 -0
  85. package/dist/esm/command/api/integration/mcpserver/index.d.ts +6 -0
  86. package/dist/esm/command/api/integration/mcpserver/index.js +58 -0
  87. package/dist/esm/command/api/integration/messenger/index.d.ts +7 -0
  88. package/dist/esm/command/api/integration/messenger/index.js +68 -0
  89. package/dist/esm/command/api/integration/notion/index.d.ts +7 -0
  90. package/dist/esm/command/api/integration/notion/index.js +68 -0
  91. package/dist/esm/command/api/integration/sitemap/index.d.ts +7 -0
  92. package/dist/esm/command/api/integration/sitemap/index.js +68 -0
  93. package/dist/esm/command/api/integration/slack/index.d.ts +7 -0
  94. package/dist/esm/command/api/integration/slack/index.js +68 -0
  95. package/dist/esm/command/api/integration/support/index.d.ts +6 -0
  96. package/dist/esm/command/api/integration/support/index.js +58 -0
  97. package/dist/esm/command/api/integration/telegram/index.d.ts +7 -0
  98. package/dist/esm/command/api/integration/telegram/index.js +68 -0
  99. package/dist/esm/command/api/integration/trigger/index.d.ts +7 -0
  100. package/dist/esm/command/api/integration/trigger/index.js +68 -0
  101. package/dist/esm/command/api/integration/twilio/index.d.ts +7 -0
  102. package/dist/esm/command/api/integration/twilio/index.js +68 -0
  103. package/dist/esm/command/api/integration/whatsapp/index.d.ts +7 -0
  104. package/dist/esm/command/api/integration/whatsapp/index.js +68 -0
  105. package/dist/esm/command/api/integration/widget/index.d.ts +7 -0
  106. package/dist/esm/command/api/integration/widget/index.js +68 -0
  107. package/dist/esm/command/api/memory/index.d.ts +7 -0
  108. package/dist/esm/command/api/memory/index.js +76 -0
  109. package/dist/esm/command/api/secret/index.d.ts +8 -0
  110. package/dist/esm/command/api/secret/index.js +78 -0
  111. package/dist/esm/command/api/skillset/ability/index.d.ts +7 -0
  112. package/dist/esm/command/api/skillset/ability/index.js +80 -0
  113. package/dist/esm/command/api/skillset/index.js +2 -0
  114. package/dist/esm/command/api/team/index.d.ts +4 -0
  115. package/dist/esm/command/api/team/index.js +39 -0
  116. package/dist/esm/input.d.ts +5 -0
  117. package/dist/esm/input.js +27 -0
  118. package/dist/esm/solution/index.d.ts +78 -72
  119. package/dist/esm/solution/index.js +1 -1
  120. package/dist/esm/tools.d.ts +2 -7
  121. package/dist/esm/tools.js +2 -183
  122. package/package.json +783 -3
@@ -334,7 +334,7 @@ export const ExtractIntegrationResourceConfigSchema = BasicResourceConfigSchema.
334
334
  botId: z.string().optional(),
335
335
  schema: z.record(z.unknown()).optional(),
336
336
  request: z.string().optional(),
337
- trigger: z.string().optional(),
337
+ model: z.string().optional(),
338
338
  }),
339
339
  });
340
340
  export const McpServerIntegrationResourceConfigSchema = BasicResourceConfigSchema.extend({
@@ -1,9 +1,4 @@
1
1
  export function getTools(selectedTools?: Array<keyof typeof tools>): typeof tools;
2
2
  export function getToolNames(): Array<keyof typeof tools>;
3
- export const tools: Record<string, {
4
- description: string;
5
- input: z.ZodObject<any>;
6
- handler: (input: any) => Promise<any>;
7
- default?: boolean;
8
- }>;
9
- import { z } from 'zod';
3
+ export { tools };
4
+ import { tools } from '@chatbotkit/agent';
package/dist/esm/tools.js CHANGED
@@ -1,186 +1,5 @@
1
- import { exec, spawn } from 'child_process';
2
- import { readFile, writeFile } from 'fs/promises';
3
- import { promisify } from 'util';
4
- import { z } from 'zod';
5
- const execAsync = promisify(exec);
6
- export const tools = {
7
- read: {
8
- description: 'Read the contents of a file',
9
- default: true,
10
- input: z.object({
11
- path: z.string().describe('The file path to read'),
12
- }),
13
- handler: async (input) => {
14
- try {
15
- const content = await readFile(input.path, 'utf-8');
16
- return { success: true, content };
17
- }
18
- catch (error) {
19
- return {
20
- success: false,
21
- error: error instanceof Error ? error.message : 'Unknown error',
22
- };
23
- }
24
- },
25
- },
26
- write: {
27
- description: 'Write content to a file',
28
- default: true,
29
- input: z.object({
30
- path: z.string().describe('The file path to write to'),
31
- content: z.string().describe('The content to write'),
32
- }),
33
- handler: async (input) => {
34
- try {
35
- await writeFile(input.path, input.content, 'utf-8');
36
- return { success: true };
37
- }
38
- catch (error) {
39
- return {
40
- success: false,
41
- error: error instanceof Error ? error.message : 'Unknown error',
42
- };
43
- }
44
- },
45
- },
46
- edit: {
47
- description: 'Edit a file by replacing an exact string occurrence with a new string. Only one occurrence must exist.',
48
- default: true,
49
- input: z.object({
50
- path: z.string().describe('The file path to edit'),
51
- oldString: z
52
- .string()
53
- .describe('The exact string to find and replace (must match exactly)'),
54
- newString: z.string().describe('The new string to replace with'),
55
- }),
56
- handler: async (input) => {
57
- try {
58
- const content = await readFile(input.path, 'utf-8');
59
- const occurrences = content.split(input.oldString).length - 1;
60
- if (occurrences === 0) {
61
- return {
62
- success: false,
63
- error: 'String not found in file',
64
- };
65
- }
66
- if (occurrences > 1) {
67
- return {
68
- success: false,
69
- error: `Multiple occurrences found (${occurrences}). The old string must match exactly one location.`,
70
- };
71
- }
72
- const newContent = content.replace(input.oldString, input.newString);
73
- await writeFile(input.path, newContent, 'utf-8');
74
- const oldPreview = input.oldString.length > 100
75
- ? input.oldString.substring(0, 100) + '...'
76
- : input.oldString;
77
- const newPreview = input.newString.length > 100
78
- ? input.newString.substring(0, 100) + '...'
79
- : input.newString;
80
- return {
81
- success: true,
82
- message: `Successfully replaced:\n OLD: ${oldPreview}\n NEW: ${newPreview}`,
83
- };
84
- }
85
- catch (error) {
86
- return {
87
- success: false,
88
- error: error instanceof Error ? error.message : 'Unknown error',
89
- };
90
- }
91
- },
92
- },
93
- find: {
94
- description: 'Search for files matching a pattern',
95
- default: true,
96
- input: z.object({
97
- pattern: z.string().describe('The glob pattern to search for'),
98
- directory: z
99
- .string()
100
- .optional()
101
- .describe('The directory to search in (defaults to current)'),
102
- }),
103
- handler: async (input) => {
104
- try {
105
- const dir = input.directory || '.';
106
- const { stdout } = await execAsync(`find ${dir} -name "${input.pattern}"`);
107
- const files = stdout.trim().split('\n').filter(Boolean);
108
- return { success: true, files };
109
- }
110
- catch (error) {
111
- return {
112
- success: false,
113
- error: error instanceof Error ? error.message : 'Unknown error',
114
- };
115
- }
116
- },
117
- },
118
- exec: {
119
- description: 'Execute a shell command (non-interactive only). Commands timeout after the specified duration (default 30 seconds). Use only for commands that run and exit automatically.',
120
- default: true,
121
- input: z.object({
122
- command: z.string().describe('The command to execute'),
123
- timeout: z
124
- .number()
125
- .default(30)
126
- .describe('Timeout in seconds. The command will be killed if it runs longer than this.'),
127
- }),
128
- handler: async (input) => {
129
- const timeoutMs = input.timeout * 1000;
130
- return new Promise((resolve) => {
131
- const childProcess = spawn('sh', ['-c', input.command], {
132
- stdio: ['ignore', 'pipe', 'pipe'],
133
- timeout: timeoutMs,
134
- });
135
- let stdout = '';
136
- let stderr = '';
137
- let timedOut = false;
138
- childProcess.stdout.on('data', (data) => {
139
- stdout += data.toString();
140
- });
141
- childProcess.stderr.on('data', (data) => {
142
- stderr += data.toString();
143
- });
144
- childProcess.on('close', (code) => {
145
- if (timedOut) {
146
- resolve({
147
- success: false,
148
- error: `Command timed out after ${timeoutMs / 1000} seconds. This may indicate an interactive command.`,
149
- });
150
- }
151
- else if (code === 0) {
152
- resolve({ success: true, stdout, stderr });
153
- }
154
- else {
155
- resolve({
156
- success: false,
157
- error: `Command exited with code ${code}`,
158
- stdout,
159
- stderr,
160
- });
161
- }
162
- });
163
- childProcess.on('error', (error) => {
164
- resolve({
165
- success: false,
166
- error: error.message,
167
- });
168
- });
169
- setTimeout(() => {
170
- if (!childProcess.killed) {
171
- timedOut = true;
172
- childProcess.kill('SIGTERM');
173
- setTimeout(() => {
174
- if (!childProcess.killed) {
175
- childProcess.kill('SIGKILL');
176
- }
177
- }, 2000);
178
- }
179
- }, timeoutMs);
180
- });
181
- },
182
- },
183
- };
1
+ import { tools } from '@chatbotkit/agent';
2
+ export { tools };
184
3
  export function getTools(selectedTools) {
185
4
  if (!selectedTools || selectedTools.length === 0) {
186
5
  return Object.fromEntries(Object.entries(tools).filter(([, tool]) => tool.default));