@botpress/cli 6.4.0 → 6.5.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/.turbo/turbo-build.log +11 -11
- package/dist/api/retry.js +31 -1
- package/dist/api/retry.js.map +2 -2
- package/dist/chat/index.d.ts +1 -0
- package/dist/chat/index.js +4 -1
- package/dist/chat/index.js.map +2 -2
- package/dist/command-definitions.d.ts +5 -0
- package/dist/command-implementations/chat-command.js +1 -1
- package/dist/command-implementations/chat-command.js.map +2 -2
- package/dist/command-implementations/index.d.ts +5 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +44 -8
- package/dist/config.js.map +2 -2
- package/dist/index.d.ts +5 -0
- package/package.json +3 -3
- package/templates/empty-bot/package.json +2 -2
- package/templates/empty-integration/package.json +2 -2
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +2 -2
- package/templates/webhook-message/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@6.
|
|
2
|
+
> @botpress/cli@6.5.0 build /home/runner/work/botpress/botpress/packages/cli
|
|
3
3
|
> pnpm run build:types && pnpm run bundle && pnpm run template:gen
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cli@6.
|
|
6
|
+
> @botpress/cli@6.5.0 build:types /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> tsc -p ./tsconfig.build.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@6.
|
|
10
|
+
> @botpress/cli@6.5.0 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> ts-node -T build.ts
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
> @botpress/cli@6.
|
|
14
|
+
> @botpress/cli@6.5.0 template:gen /home/runner/work/botpress/botpress/packages/cli
|
|
15
15
|
> pnpm -r --stream -F @bp-templates/* exec bp gen
|
|
16
16
|
|
|
17
|
-
🤖 Botpress CLI v6.
|
|
17
|
+
🤖 Botpress CLI v6.5.0
|
|
18
18
|
● Checking if cli is up to date
|
|
19
|
-
🤖 Botpress CLI v6.
|
|
19
|
+
🤖 Botpress CLI v6.5.0
|
|
20
|
+
🤖 Botpress CLI v6.5.0
|
|
20
21
|
● Checking if cli is up to date
|
|
21
|
-
🤖 Botpress CLI v6.4.0
|
|
22
22
|
● Checking if cli is up to date
|
|
23
|
-
🤖 Botpress CLI v6.
|
|
23
|
+
🤖 Botpress CLI v6.5.0
|
|
24
24
|
● Checking if cli is up to date
|
|
25
25
|
● Checking if sdk is up to date
|
|
26
26
|
● Checking if sdk is up to date
|
|
27
27
|
● Checking if sdk is up to date
|
|
28
28
|
● Checking if sdk is up to date
|
|
29
29
|
○ Generating typings for bot...
|
|
30
|
+
○ Generating typings for plugin empty-plugin...
|
|
31
|
+
○ Generating typings for integration hello-world...
|
|
30
32
|
○ Generating typings for integration empty-integration...
|
|
31
33
|
✓ Typings available at .botpress
|
|
32
34
|
|
|
33
35
|
✓ Typings available at .botpress
|
|
34
36
|
|
|
35
|
-
○ Generating typings for integration hello-world...
|
|
36
|
-
○ Generating typings for plugin empty-plugin...
|
|
37
37
|
✓ Typings available at .botpress
|
|
38
38
|
|
|
39
39
|
✓ Typings available at .botpress
|
|
40
40
|
|
|
41
|
-
🤖 Botpress CLI v6.
|
|
41
|
+
🤖 Botpress CLI v6.5.0
|
|
42
42
|
● Checking if cli is up to date
|
|
43
43
|
● Checking if sdk is up to date
|
|
44
44
|
○ Generating typings for integration webhook-message...
|
package/dist/api/retry.js
CHANGED
|
@@ -33,10 +33,40 @@ __export(retry_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(retry_exports);
|
|
34
34
|
var client = __toESM(require("@botpress/client"));
|
|
35
35
|
const HTTP_STATUS_TO_RETRY_ON = [429, 500, 502, 503, 504];
|
|
36
|
+
function getRetryAfterMs(error) {
|
|
37
|
+
const headers = error?.response?.headers;
|
|
38
|
+
if (!headers) return void 0;
|
|
39
|
+
const headerNames = ["retry-after", "ratelimit-reset", "x-ratelimit-reset"];
|
|
40
|
+
for (const name of headerNames) {
|
|
41
|
+
const raw = headers[name];
|
|
42
|
+
if (!raw) continue;
|
|
43
|
+
const value = String(raw);
|
|
44
|
+
if (value.includes(" ")) {
|
|
45
|
+
const futureDate = new Date(value);
|
|
46
|
+
if (!isNaN(futureDate.getTime())) {
|
|
47
|
+
return Math.max(0, futureDate.getTime() - Date.now());
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const seconds = parseInt(value, 10);
|
|
52
|
+
if (!isNaN(seconds) && seconds >= 0) {
|
|
53
|
+
return seconds * 1e3;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return void 0;
|
|
57
|
+
}
|
|
36
58
|
const config = {
|
|
37
59
|
retries: 3,
|
|
38
60
|
retryCondition: (err) => client.axiosRetry.isNetworkOrIdempotentRequestError(err) || HTTP_STATUS_TO_RETRY_ON.includes(err.response?.status ?? 0),
|
|
39
|
-
retryDelay: (retryCount) =>
|
|
61
|
+
retryDelay: (retryCount, error) => {
|
|
62
|
+
if (error?.response?.status === 429) {
|
|
63
|
+
const retryAfterMs = getRetryAfterMs(error);
|
|
64
|
+
if (retryAfterMs !== void 0) {
|
|
65
|
+
return retryAfterMs;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return Math.max(retryCount, 1) * 1e3;
|
|
69
|
+
}
|
|
40
70
|
};
|
|
41
71
|
// Annotate the CommonJS export names for ESM import in node:
|
|
42
72
|
0 && (module.exports = {
|
package/dist/api/retry.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/api/retry.ts"],
|
|
4
|
-
"sourcesContent": ["import * as client from '@botpress/client'\n\n// TODO: we probably shouldnt retry on 500 errors, but this is a temporary fix for the botpress repo CI\nconst HTTP_STATUS_TO_RETRY_ON = [429, 500, 502, 503, 504]\nexport const config: client.RetryConfig = {\n retries: 3,\n retryCondition: (err) =>\n client.axiosRetry.isNetworkOrIdempotentRequestError(err) ||\n HTTP_STATUS_TO_RETRY_ON.includes(err.response?.status ?? 0),\n retryDelay: (retryCount) => retryCount * 1000,\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AAGxB,MAAM,0BAA0B,CAAC,KAAK,KAAK,KAAK,KAAK,GAAG;
|
|
4
|
+
"sourcesContent": ["import * as client from '@botpress/client'\n\n// TODO: we probably shouldnt retry on 500 errors, but this is a temporary fix for the botpress repo CI\nconst HTTP_STATUS_TO_RETRY_ON = [429, 500, 502, 503, 504]\n\nfunction getRetryAfterMs(error: Parameters<NonNullable<client.RetryConfig['retryDelay']>>[1]): number | undefined {\n const headers = error?.response?.headers\n if (!headers) return undefined\n\n const headerNames = ['retry-after', 'ratelimit-reset', 'x-ratelimit-reset']\n for (const name of headerNames) {\n const raw = headers[name]\n if (!raw) continue\n const value = String(raw)\n\n // HTTP-date format (e.g. \"Mon, 28 Apr 2026 12:00:00 GMT\")\n if (value.includes(' ')) {\n const futureDate = new Date(value)\n if (!isNaN(futureDate.getTime())) {\n return Math.max(0, futureDate.getTime() - Date.now())\n }\n continue\n }\n\n // Seconds format (e.g. \"120\")\n const seconds = parseInt(value, 10)\n if (!isNaN(seconds) && seconds >= 0) {\n return seconds * 1000\n }\n }\n return undefined\n}\n\nexport const config: client.RetryConfig = {\n retries: 3,\n retryCondition: (err) =>\n client.axiosRetry.isNetworkOrIdempotentRequestError(err) ||\n HTTP_STATUS_TO_RETRY_ON.includes(err.response?.status ?? 0),\n retryDelay: (retryCount, error) => {\n if (error?.response?.status === 429) {\n const retryAfterMs = getRetryAfterMs(error)\n if (retryAfterMs !== undefined) {\n return retryAfterMs\n }\n }\n return Math.max(retryCount, 1) * 1000\n },\n}\n"],
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Chat {
|
|
|
69
69
|
async _run() {
|
|
70
70
|
this._switchAlternateScreenBuffer();
|
|
71
71
|
this._events.on("state", this._renderMessages);
|
|
72
|
-
const connection = await this._props.client.listenConversation({
|
|
72
|
+
const connection = await this._props.client.listenConversation({
|
|
73
|
+
id: this._props.conversationId,
|
|
74
|
+
protocol: this._props.protocol
|
|
75
|
+
});
|
|
73
76
|
const keyboard = readline.createInterface({
|
|
74
77
|
input: process.stdin,
|
|
75
78
|
output: process.stdout
|
package/dist/chat/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/chat/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as chat from '@botpress/chat'\nimport chalk from 'chalk'\nimport * as readline from 'readline'\nimport * as uuid from 'uuid'\nimport * as utils from '../utils'\n\ntype MessageSource = 'myself' | 'bot' | 'other'\ntype ChatMessage = chat.Message & { source: MessageSource }\ntype ChatState =\n | {\n status: 'stopped'\n }\n | {\n status: 'running'\n messages: ChatMessage[]\n connection: chat.SignalListener\n keyboard: readline.Interface\n }\n\nconst USER_ICONS: Record<MessageSource, string> = {\n myself: '\uD83D\uDC64',\n bot: '\uD83E\uDD16',\n other: '\uD83D\uDC65',\n}\n\nconst MESSAGE_ICONS: Record<chat.Message['payload']['type'], string> = {\n audio: '\uD83C\uDFB5',\n card: '\uD83C\uDCCF',\n carousel: '\uD83C\uDFA0',\n choice: '\uD83D\uDD3D',\n dropdown: '\uD83D\uDD3D',\n file: '\uD83D\uDCC1',\n image: '\uD83C\uDF05',\n location: '\uD83D\uDCCD',\n text: '',\n video: '\uD83C\uDFA5',\n markdown: '',\n bloc: '\uD83E\uDDF1',\n}\n\nconst EXIT_KEYWORDS = ['exit', '.exit']\n\nexport type ChatProps = {\n client: chat.AuthenticatedClient\n conversationId: string\n}\n\nexport class Chat {\n private _events = new utils.emitter.EventEmitter<{ state: ChatState }>()\n private _state: ChatState = { status: 'stopped' }\n\n public static launch(props: ChatProps): Chat {\n const instance = new Chat(props)\n void instance._run()\n return instance\n }\n\n private constructor(private _props: ChatProps) {}\n\n private async _run() {\n this._switchAlternateScreenBuffer()\n this._events.on('state', this._renderMessages)\n\n const connection = await this._props.client.listenConversation({
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,eAA0B;AAC1B,WAAsB;AACtB,YAAuB;AAevB,MAAM,aAA4C;AAAA,EAChD,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AACT;AAEA,MAAM,gBAAiE;AAAA,EACrE,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AACR;AAEA,MAAM,gBAAgB,CAAC,QAAQ,OAAO;
|
|
4
|
+
"sourcesContent": ["import * as chat from '@botpress/chat'\nimport chalk from 'chalk'\nimport * as readline from 'readline'\nimport * as uuid from 'uuid'\nimport * as utils from '../utils'\n\ntype MessageSource = 'myself' | 'bot' | 'other'\ntype ChatMessage = chat.Message & { source: MessageSource }\ntype ChatState =\n | {\n status: 'stopped'\n }\n | {\n status: 'running'\n messages: ChatMessage[]\n connection: chat.SignalListener\n keyboard: readline.Interface\n }\n\nconst USER_ICONS: Record<MessageSource, string> = {\n myself: '\uD83D\uDC64',\n bot: '\uD83E\uDD16',\n other: '\uD83D\uDC65',\n}\n\nconst MESSAGE_ICONS: Record<chat.Message['payload']['type'], string> = {\n audio: '\uD83C\uDFB5',\n card: '\uD83C\uDCCF',\n carousel: '\uD83C\uDFA0',\n choice: '\uD83D\uDD3D',\n dropdown: '\uD83D\uDD3D',\n file: '\uD83D\uDCC1',\n image: '\uD83C\uDF05',\n location: '\uD83D\uDCCD',\n text: '',\n video: '\uD83C\uDFA5',\n markdown: '',\n bloc: '\uD83E\uDDF1',\n}\n\nconst EXIT_KEYWORDS = ['exit', '.exit']\n\nexport type ChatProps = {\n client: chat.AuthenticatedClient\n conversationId: string\n protocol: chat.ServerEventsProtocol\n}\n\nexport class Chat {\n private _events = new utils.emitter.EventEmitter<{ state: ChatState }>()\n private _state: ChatState = { status: 'stopped' }\n\n public static launch(props: ChatProps): Chat {\n const instance = new Chat(props)\n void instance._run()\n return instance\n }\n\n private constructor(private _props: ChatProps) {}\n\n private async _run() {\n this._switchAlternateScreenBuffer()\n this._events.on('state', this._renderMessages)\n\n const connection = await this._props.client.listenConversation({\n id: this._props.conversationId,\n protocol: this._props.protocol,\n })\n const keyboard = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n })\n\n connection.on('message_created', (m) => void this._onMessageReceived(m))\n keyboard.on('line', (l) => void this._onKeyboardInput(l))\n process.stdin.on('keypress', (_, key) => {\n if (key.name === 'escape') {\n void this._onExit()\n }\n })\n\n this._setState({ status: 'running', messages: [], connection, keyboard })\n }\n\n private _setState = (newState: ChatState) => {\n this._state = newState\n this._events.emit('state', this._state)\n }\n\n private _onMessageReceived = async (message: chat.Signals['message_created']) => {\n if (this._state.status === 'stopped') {\n return\n }\n if (message.userId === this._props.client.user.id) {\n return\n }\n const source: MessageSource = message.isBot ? 'bot' : 'other'\n this._setState({ ...this._state, messages: [...this._state.messages, { ...message, source }] })\n }\n\n private _onKeyboardInput = async (line: string) => {\n if (this._state.status === 'stopped') {\n return\n }\n\n if (EXIT_KEYWORDS.includes(line)) {\n await this._onExit()\n return\n }\n\n if (!line) {\n this._setState({ ...this._state })\n return\n }\n\n const message = this._textToMessage(line)\n this._setState({ ...this._state, messages: [...this._state.messages, message] })\n await this._props.client.createMessage(message)\n }\n\n private _onExit = async () => {\n if (this._state.status === 'stopped') {\n return\n }\n const { connection, keyboard } = this._state\n await connection.disconnect()\n connection.cleanup()\n keyboard.close()\n this._setState({ status: 'stopped' })\n this._clearStdOut()\n this._restoreOriginalScreenBuffer()\n }\n\n public wait(): Promise<void> {\n return new Promise<void>((resolve) => {\n const cb = (state: ChatState) => {\n if (state.status === 'stopped') {\n this._events.off('state', cb)\n resolve()\n }\n }\n this._events.on('state', cb)\n })\n }\n\n private _renderMessages = () => {\n if (this._state.status === 'stopped') {\n return\n }\n\n this._clearStdOut()\n this._printHeader()\n\n for (const message of this._state.messages) {\n const prefix = USER_ICONS[message.source]\n const text = this._messageToText(message)\n const coloredText = message.source === 'bot' ? text : chalk.gray(text)\n process.stdout.write(`${prefix} ${coloredText}\\n`)\n }\n\n this._state.keyboard.setPrompt('>> ')\n this._state.keyboard.prompt(true) // Redisplay the prompt and maintain current input\n }\n\n private _printHeader = () => {\n process.stdout.write(chalk.bold('Botpress Chat\\n'))\n process.stdout.write(chalk.gray('Type \"exit\" or press ESC key to quit\\n'))\n }\n\n private _switchAlternateScreenBuffer = () => {\n process.stdout.write('\\x1B[?1049h')\n }\n\n private _restoreOriginalScreenBuffer = () => {\n process.stdout.write('\\x1B[?1049l')\n }\n\n private _clearStdOut = () => {\n process.stdout.write('\\x1B[2J\\x1B[0;0H')\n }\n\n private _messageToText = (message: Pick<chat.Message, 'payload'>): string => {\n const prefix = MESSAGE_ICONS[message.payload.type]\n switch (message.payload.type) {\n case 'audio':\n return prefix + message.payload.audioUrl\n case 'card':\n return prefix + JSON.stringify(message.payload)\n case 'carousel':\n return prefix + JSON.stringify(message.payload)\n case 'choice':\n return (\n prefix +\n [message.payload.text, ...message.payload.options.map((o) => ` - ${o.label} (${o.value})`)].join('\\n')\n )\n case 'dropdown':\n return (\n prefix +\n [message.payload.text, ...message.payload.options.map((o) => ` - ${o.label} (${o.value})`)].join('\\n')\n )\n case 'file':\n return prefix + message.payload.fileUrl\n case 'image':\n return prefix + message.payload.imageUrl\n case 'location':\n return prefix + `${message.payload.latitude},${message.payload.longitude} (${message.payload.address})`\n case 'text':\n return prefix + message.payload.text\n case 'video':\n return prefix + message.payload.videoUrl\n case 'markdown':\n return prefix + message.payload.markdown\n case 'bloc':\n return [\n prefix,\n ...message.payload.items.map((item) => this._messageToText({ payload: item })).map((l) => `\\t${l}`),\n ].join('\\n')\n default:\n type _assertion = utils.types.AssertNever<typeof message.payload>\n return '<unknown>'\n }\n }\n\n private _textToMessage = (text: string): ChatMessage => {\n return {\n id: uuid.v4(),\n userId: this._props.client.user.id,\n source: 'myself',\n conversationId: this._props.conversationId,\n createdAt: new Date().toISOString(),\n payload: { type: 'text', text },\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,eAA0B;AAC1B,WAAsB;AACtB,YAAuB;AAevB,MAAM,aAA4C;AAAA,EAChD,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AACT;AAEA,MAAM,gBAAiE;AAAA,EACrE,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AACR;AAEA,MAAM,gBAAgB,CAAC,QAAQ,OAAO;AAQ/B,MAAM,KAAK;AAAA,EAUR,YAAoB,QAAmB;AAAnB;AAAA,EAAoB;AAAA,EATxC,UAAU,IAAI,MAAM,QAAQ,aAAmC;AAAA,EAC/D,SAAoB,EAAE,QAAQ,UAAU;AAAA,EAEhD,OAAc,OAAO,OAAwB;AAC3C,UAAM,WAAW,IAAI,KAAK,KAAK;AAC/B,SAAK,SAAS,KAAK;AACnB,WAAO;AAAA,EACT;AAAA,EAIA,MAAc,OAAO;AACnB,SAAK,6BAA6B;AAClC,SAAK,QAAQ,GAAG,SAAS,KAAK,eAAe;AAE7C,UAAM,aAAa,MAAM,KAAK,OAAO,OAAO,m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ClC,KAAK;AACH,eAAO,SAAS,QAAQ,QAAQ;AAAA,MAClC,KAAK;AACH,eAAO,SAAS,QAAQ,QAAQ;AAAA,MAClC,KAAK;AACH,eAAO;AAAA,UACL;AAAA,UACA,GAAG,QAAQ,QAAQ,MAAM,IAAI,CAAC,SAAS,KAAK,eAAe,EAAE,SAAS,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,IAAK,CAAC,EAAE;AAAA,QACpG,EAAE,KAAK,IAAI;AAAA,MACb;AAEE,eAAO;AAAA,IACX;AAAA,EACF;AAAA,EAEQ,iBAAiB,CAAC,SAA8B;AACtD,WAAO;AAAA,MACL,IAAI,KAAK,GAAG;AAAA,MACZ,QAAQ,KAAK,OAAO,OAAO,KAAK;AAAA,MAChC,QAAQ;AAAA,MACR,gBAAgB,KAAK,OAAO;AAAA,MAC5B,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,MAClC,SAAS,EAAE,MAAM,QAAQ,KAAK;AAAA,IAChC;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["chalk"]
|
|
7
7
|
}
|
|
@@ -1405,6 +1405,11 @@ declare const _default: {
|
|
|
1405
1405
|
idx: number;
|
|
1406
1406
|
description: string;
|
|
1407
1407
|
};
|
|
1408
|
+
protocol: {
|
|
1409
|
+
choices: ("websocket" | "sse")[];
|
|
1410
|
+
default: "sse";
|
|
1411
|
+
description: string;
|
|
1412
|
+
};
|
|
1408
1413
|
apiUrl: {
|
|
1409
1414
|
type: "string";
|
|
1410
1415
|
description: string;
|
|
@@ -71,7 +71,7 @@ class ChatCommand extends import_global_command.GlobalCommand {
|
|
|
71
71
|
const { conversation } = await client2.createConversation({});
|
|
72
72
|
convLine.success(`Conversation created with id "${conversation.id}"`);
|
|
73
73
|
convLine.commit();
|
|
74
|
-
const chat2 = import_chat.Chat.launch({ client: client2, conversationId: conversation.id });
|
|
74
|
+
const chat2 = import_chat.Chat.launch({ client: client2, conversationId: conversation.id, protocol: this.argv.protocol });
|
|
75
75
|
await chat2.wait();
|
|
76
76
|
};
|
|
77
77
|
_getChatApiUrl = (api) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/chat-command.ts"],
|
|
4
|
-
"sourcesContent": ["import * as chat from '@botpress/chat'\nimport * as client from '@botpress/client'\nimport semver from 'semver'\nimport { ApiClient } from '../api'\nimport { Chat } from '../chat'\nimport type commandDefinitions from '../command-definitions'\nimport * as consts from '../consts'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { GlobalCommand } from './global-command'\n\ntype IntegrationInstance = {\n alias: string\n instance: client.Bot['integrations'][string]\n}\n\nexport type ChatCommandDefinition = typeof commandDefinitions.chat\nexport class ChatCommand extends GlobalCommand<ChatCommandDefinition> {\n public async run(): Promise<void> {\n if (process.platform === 'win32') {\n this.logger.warn('The chat command was not tested on Windows and may not work as expected')\n }\n\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const botId = this.argv.botId ?? (await this._selectBot(api))\n const { bot } = await api.client.getBot({ id: botId }).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not fetch bot \"${botId}\"`)\n })\n\n const targetChatVersion = this._getChatApiTargetVersionRange()\n let chatIntegrationInstance = this._findChatInstance(bot)\n\n if (!chatIntegrationInstance) {\n this.logger.log(`Chat integration with version ${targetChatVersion} is not installed in the selected bot`)\n const confirmInstall = await this.prompt.confirm('Do you wish to install it now?')\n if (!confirmInstall) {\n throw new errors.BotpressCLIError('Chat integration is required to proceed')\n }\n chatIntegrationInstance = await this._installChatIntegration(api, botId)\n }\n\n const { webhookId } = chatIntegrationInstance.instance\n const chatApiBaseUrl = this._getChatApiUrl(api)\n this.logger.debug(`using chat api url: \"${chatApiBaseUrl}\"`)\n\n const chatApiUrl = `${chatApiBaseUrl}/${webhookId}`\n const chatClient = await chat.Client.connect({ apiUrl: chatApiUrl })\n await this._chat(chatClient)\n }\n\n private _chat = async (client: chat.AuthenticatedClient): Promise<void> => {\n const convLine = this.logger.line()\n convLine.started('Creating a conversation...')\n const { conversation } = await client.createConversation({})\n convLine.success(`Conversation created with id \"${conversation.id}\"`)\n convLine.commit()\n\n const chat = Chat.launch({ client, conversationId: conversation.id })\n await chat.wait()\n }\n\n private _getChatApiUrl = (api: ApiClient): string => {\n if (this.argv.chatApiUrl) {\n return this.argv.chatApiUrl\n }\n\n const parseResult = utils.url.parse(api.url)\n if (parseResult.status === 'error') {\n return consts.defaultChatApiUrl\n }\n\n const { host, ...url } = parseResult.url\n if (!host.startsWith('api.')) {\n return consts.defaultChatApiUrl\n }\n\n const newHost = host.replace('api.', 'chat.')\n return utils.url.format({ ...url, host: newHost })\n }\n\n private _selectBot = async (api: ApiClient): Promise<string> => {\n const availableBots = await api\n .listAllPages(api.client.listBots, (r) => r.bots)\n .catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not fetch existing bots')\n })\n\n if (!availableBots.length) {\n throw new errors.NoBotsFoundError()\n }\n\n const prompted = await this.prompt.select('Which bot do you want to deploy?', {\n choices: availableBots.map((bot) => ({ title: bot.name, value: bot.id })),\n })\n\n if (!prompted) {\n throw new errors.ParamRequiredError('Bot Id')\n }\n\n return prompted\n }\n\n private _installChatIntegration = async (api: ApiClient, botId: string): Promise<IntegrationInstance> => {\n const line = this.logger.line()\n line.started('Installing chat integration...')\n\n const { integration } = await api.client.getPublicIntegration({\n name: 'chat',\n version: this._getChatApiTargetVersion(),\n })\n\n const { bot } = await api.client.updateBot({\n id: botId,\n integrations: {\n [integration.name]: {\n integrationId: integration.id,\n enabled: true,\n configuration: {}, // empty object will always be a valid chat integration configuration\n },\n },\n })\n\n line.success('Chat integration installed')\n line.commit()\n\n const inst = this._findChatInstance(bot)\n if (!inst) {\n throw new errors.BotpressCLIError('Chat integration was installed but could not be found')\n }\n\n return inst\n }\n\n private _findChatInstance = (bot: client.Bot): IntegrationInstance | undefined => {\n const integrationInstances = Object.entries(bot.integrations).map(([alias, integrationInstance]) => ({\n alias,\n instance: integrationInstance,\n }))\n\n const targetChatVersion = this._getChatApiTargetVersionRange()\n return integrationInstances.find(\n (i) =>\n i.instance.name === 'chat' &&\n (semver.satisfies(i.instance.version, targetChatVersion) || i.instance.version === 'dev')\n )\n }\n\n private _getChatApiTargetVersionRange = (): string => {\n const targetApiVersion = this._getChatApiTargetVersion()\n const nextMajor = semver.inc(targetApiVersion, 'major')\n return `>=${targetApiVersion} <${nextMajor}`\n }\n\n private _getChatApiTargetVersion = (): string => {\n const dummyClient = new chat.Client({ apiUrl: '' })\n return dummyClient.apiVersion\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AAEtB,oBAAmB;AAEnB,kBAAqB;AAErB,aAAwB;AACxB,aAAwB;AACxB,YAAuB;AACvB,4BAA8B;AAQvB,MAAM,oBAAoB,oCAAqC;AAAA,EACpE,MAAa,MAAqB;AAChC,QAAI,QAAQ,aAAa,SAAS;AAChC,WAAK,OAAO,KAAK,yEAAyE;AAAA,IAC5F;AAEA,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAC3D,UAAM,QAAQ,KAAK,KAAK,SAAU,MAAM,KAAK,WAAW,GAAG;AAC3D,UAAM,EAAE,IAAI,IAAI,MAAM,IAAI,OAAO,OAAO,EAAE,IAAI,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW;AACvE,YAAM,OAAO,iBAAiB,KAAK,QAAQ,wBAAwB,KAAK,GAAG;AAAA,IAC7E,CAAC;AAED,UAAM,oBAAoB,KAAK,8BAA8B;AAC7D,QAAI,0BAA0B,KAAK,kBAAkB,GAAG;AAExD,QAAI,CAAC,yBAAyB;AAC5B,WAAK,OAAO,IAAI,iCAAiC,iBAAiB,uCAAuC;AACzG,YAAM,iBAAiB,MAAM,KAAK,OAAO,QAAQ,gCAAgC;AACjF,UAAI,CAAC,gBAAgB;AACnB,cAAM,IAAI,OAAO,iBAAiB,yCAAyC;AAAA,MAC7E;AACA,gCAA0B,MAAM,KAAK,wBAAwB,KAAK,KAAK;AAAA,IACzE;AAEA,UAAM,EAAE,UAAU,IAAI,wBAAwB;AAC9C,UAAM,iBAAiB,KAAK,eAAe,GAAG;AAC9C,SAAK,OAAO,MAAM,wBAAwB,cAAc,GAAG;AAE3D,UAAM,aAAa,GAAG,cAAc,IAAI,SAAS;AACjD,UAAM,aAAa,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,WAAW,CAAC;AACnE,UAAM,KAAK,MAAM,UAAU;AAAA,EAC7B;AAAA,EAEQ,QAAQ,OAAOA,YAAoD;AACzE,UAAM,WAAW,KAAK,OAAO,KAAK;AAClC,aAAS,QAAQ,4BAA4B;AAC7C,UAAM,EAAE,aAAa,IAAI,MAAMA,QAAO,mBAAmB,CAAC,CAAC;AAC3D,aAAS,QAAQ,iCAAiC,aAAa,EAAE,GAAG;AACpE,aAAS,OAAO;AAEhB,UAAMC,QAAO,iBAAK,OAAO,EAAE,QAAAD,SAAQ,gBAAgB,aAAa,
|
|
4
|
+
"sourcesContent": ["import * as chat from '@botpress/chat'\nimport * as client from '@botpress/client'\nimport semver from 'semver'\nimport { ApiClient } from '../api'\nimport { Chat } from '../chat'\nimport type commandDefinitions from '../command-definitions'\nimport * as consts from '../consts'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { GlobalCommand } from './global-command'\n\ntype IntegrationInstance = {\n alias: string\n instance: client.Bot['integrations'][string]\n}\n\nexport type ChatCommandDefinition = typeof commandDefinitions.chat\nexport class ChatCommand extends GlobalCommand<ChatCommandDefinition> {\n public async run(): Promise<void> {\n if (process.platform === 'win32') {\n this.logger.warn('The chat command was not tested on Windows and may not work as expected')\n }\n\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const botId = this.argv.botId ?? (await this._selectBot(api))\n const { bot } = await api.client.getBot({ id: botId }).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not fetch bot \"${botId}\"`)\n })\n\n const targetChatVersion = this._getChatApiTargetVersionRange()\n let chatIntegrationInstance = this._findChatInstance(bot)\n\n if (!chatIntegrationInstance) {\n this.logger.log(`Chat integration with version ${targetChatVersion} is not installed in the selected bot`)\n const confirmInstall = await this.prompt.confirm('Do you wish to install it now?')\n if (!confirmInstall) {\n throw new errors.BotpressCLIError('Chat integration is required to proceed')\n }\n chatIntegrationInstance = await this._installChatIntegration(api, botId)\n }\n\n const { webhookId } = chatIntegrationInstance.instance\n const chatApiBaseUrl = this._getChatApiUrl(api)\n this.logger.debug(`using chat api url: \"${chatApiBaseUrl}\"`)\n\n const chatApiUrl = `${chatApiBaseUrl}/${webhookId}`\n const chatClient = await chat.Client.connect({ apiUrl: chatApiUrl })\n await this._chat(chatClient)\n }\n\n private _chat = async (client: chat.AuthenticatedClient): Promise<void> => {\n const convLine = this.logger.line()\n convLine.started('Creating a conversation...')\n const { conversation } = await client.createConversation({})\n convLine.success(`Conversation created with id \"${conversation.id}\"`)\n convLine.commit()\n\n const chat = Chat.launch({ client, conversationId: conversation.id, protocol: this.argv.protocol })\n await chat.wait()\n }\n\n private _getChatApiUrl = (api: ApiClient): string => {\n if (this.argv.chatApiUrl) {\n return this.argv.chatApiUrl\n }\n\n const parseResult = utils.url.parse(api.url)\n if (parseResult.status === 'error') {\n return consts.defaultChatApiUrl\n }\n\n const { host, ...url } = parseResult.url\n if (!host.startsWith('api.')) {\n return consts.defaultChatApiUrl\n }\n\n const newHost = host.replace('api.', 'chat.')\n return utils.url.format({ ...url, host: newHost })\n }\n\n private _selectBot = async (api: ApiClient): Promise<string> => {\n const availableBots = await api\n .listAllPages(api.client.listBots, (r) => r.bots)\n .catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not fetch existing bots')\n })\n\n if (!availableBots.length) {\n throw new errors.NoBotsFoundError()\n }\n\n const prompted = await this.prompt.select('Which bot do you want to deploy?', {\n choices: availableBots.map((bot) => ({ title: bot.name, value: bot.id })),\n })\n\n if (!prompted) {\n throw new errors.ParamRequiredError('Bot Id')\n }\n\n return prompted\n }\n\n private _installChatIntegration = async (api: ApiClient, botId: string): Promise<IntegrationInstance> => {\n const line = this.logger.line()\n line.started('Installing chat integration...')\n\n const { integration } = await api.client.getPublicIntegration({\n name: 'chat',\n version: this._getChatApiTargetVersion(),\n })\n\n const { bot } = await api.client.updateBot({\n id: botId,\n integrations: {\n [integration.name]: {\n integrationId: integration.id,\n enabled: true,\n configuration: {}, // empty object will always be a valid chat integration configuration\n },\n },\n })\n\n line.success('Chat integration installed')\n line.commit()\n\n const inst = this._findChatInstance(bot)\n if (!inst) {\n throw new errors.BotpressCLIError('Chat integration was installed but could not be found')\n }\n\n return inst\n }\n\n private _findChatInstance = (bot: client.Bot): IntegrationInstance | undefined => {\n const integrationInstances = Object.entries(bot.integrations).map(([alias, integrationInstance]) => ({\n alias,\n instance: integrationInstance,\n }))\n\n const targetChatVersion = this._getChatApiTargetVersionRange()\n return integrationInstances.find(\n (i) =>\n i.instance.name === 'chat' &&\n (semver.satisfies(i.instance.version, targetChatVersion) || i.instance.version === 'dev')\n )\n }\n\n private _getChatApiTargetVersionRange = (): string => {\n const targetApiVersion = this._getChatApiTargetVersion()\n const nextMajor = semver.inc(targetApiVersion, 'major')\n return `>=${targetApiVersion} <${nextMajor}`\n }\n\n private _getChatApiTargetVersion = (): string => {\n const dummyClient = new chat.Client({ apiUrl: '' })\n return dummyClient.apiVersion\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AAEtB,oBAAmB;AAEnB,kBAAqB;AAErB,aAAwB;AACxB,aAAwB;AACxB,YAAuB;AACvB,4BAA8B;AAQvB,MAAM,oBAAoB,oCAAqC;AAAA,EACpE,MAAa,MAAqB;AAChC,QAAI,QAAQ,aAAa,SAAS;AAChC,WAAK,OAAO,KAAK,yEAAyE;AA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default: {
|
|
|
1454
1454
|
idx: number;
|
|
1455
1455
|
description: string;
|
|
1456
1456
|
};
|
|
1457
|
+
protocol: {
|
|
1458
|
+
choices: ("websocket" | "sse")[];
|
|
1459
|
+
default: "sse";
|
|
1460
|
+
description: string;
|
|
1461
|
+
};
|
|
1457
1462
|
apiUrl: {
|
|
1458
1463
|
type: "string";
|
|
1459
1464
|
description: string;
|
package/dist/config.d.ts
CHANGED
|
@@ -1378,6 +1378,11 @@ export declare const schemas: {
|
|
|
1378
1378
|
idx: number;
|
|
1379
1379
|
description: string;
|
|
1380
1380
|
};
|
|
1381
|
+
protocol: {
|
|
1382
|
+
choices: ("websocket" | "sse")[];
|
|
1383
|
+
default: "sse";
|
|
1384
|
+
description: string;
|
|
1385
|
+
};
|
|
1381
1386
|
apiUrl: {
|
|
1382
1387
|
type: "string";
|
|
1383
1388
|
description: string;
|
package/dist/config.js
CHANGED
|
@@ -98,8 +98,16 @@ const pluginRef = {
|
|
|
98
98
|
demandOption: true,
|
|
99
99
|
description: "The plugin ID or name and version. Ex: knowledge@0.0.1"
|
|
100
100
|
};
|
|
101
|
-
const sourceMap = {
|
|
102
|
-
|
|
101
|
+
const sourceMap = {
|
|
102
|
+
type: "boolean",
|
|
103
|
+
description: "Generate sourcemaps",
|
|
104
|
+
default: false
|
|
105
|
+
};
|
|
106
|
+
const minify = {
|
|
107
|
+
type: "boolean",
|
|
108
|
+
description: "Minify the bundled code",
|
|
109
|
+
default: true
|
|
110
|
+
};
|
|
103
111
|
const dev = {
|
|
104
112
|
type: "boolean",
|
|
105
113
|
description: "List only dev bots / dev integrations",
|
|
@@ -174,7 +182,10 @@ const deploySchema = {
|
|
|
174
182
|
botId: { type: "string", description: "The bot ID to deploy. Only used when deploying a bot" },
|
|
175
183
|
noBuild,
|
|
176
184
|
dryRun,
|
|
177
|
-
createNewBot: {
|
|
185
|
+
createNewBot: {
|
|
186
|
+
type: "boolean",
|
|
187
|
+
description: "Create a new bot when deploying. Only used when deploying a bot"
|
|
188
|
+
},
|
|
178
189
|
sourceMap,
|
|
179
190
|
minify,
|
|
180
191
|
visibility: {
|
|
@@ -194,7 +205,10 @@ const deploySchema = {
|
|
|
194
205
|
description: "Allow deprecated features in the project",
|
|
195
206
|
default: false
|
|
196
207
|
},
|
|
197
|
-
url: {
|
|
208
|
+
url: {
|
|
209
|
+
type: "string",
|
|
210
|
+
description: "Custom URL for the integration. Only used when deploying an integration"
|
|
211
|
+
}
|
|
198
212
|
};
|
|
199
213
|
const devSchema = {
|
|
200
214
|
...projectSchema,
|
|
@@ -242,7 +256,12 @@ const removeSchema = {
|
|
|
242
256
|
...globalSchema,
|
|
243
257
|
...credentialsSchema,
|
|
244
258
|
workDir,
|
|
245
|
-
alias: {
|
|
259
|
+
alias: {
|
|
260
|
+
idx: 0,
|
|
261
|
+
positional: true,
|
|
262
|
+
type: "string",
|
|
263
|
+
description: "The alias of the package to uninstall"
|
|
264
|
+
}
|
|
246
265
|
};
|
|
247
266
|
const loginSchema = {
|
|
248
267
|
...globalSchema,
|
|
@@ -354,15 +373,28 @@ const chatSchema = {
|
|
|
354
373
|
positional: true,
|
|
355
374
|
idx: 0,
|
|
356
375
|
description: "The bot ID to chat with"
|
|
376
|
+
},
|
|
377
|
+
protocol: {
|
|
378
|
+
choices: ["sse", "websocket"],
|
|
379
|
+
default: "sse",
|
|
380
|
+
description: "The protocol to use for long lived connections"
|
|
357
381
|
}
|
|
358
382
|
};
|
|
359
383
|
const listProfilesSchema = {
|
|
360
384
|
...globalSchema,
|
|
361
|
-
displayToken: {
|
|
385
|
+
displayToken: {
|
|
386
|
+
type: "boolean",
|
|
387
|
+
description: "Display the token in each of the bp profiles",
|
|
388
|
+
default: false
|
|
389
|
+
}
|
|
362
390
|
};
|
|
363
391
|
const activeProfileSchema = {
|
|
364
392
|
...globalSchema,
|
|
365
|
-
displayToken: {
|
|
393
|
+
displayToken: {
|
|
394
|
+
type: "boolean",
|
|
395
|
+
description: "Display the token in the bp profile",
|
|
396
|
+
default: false
|
|
397
|
+
}
|
|
366
398
|
};
|
|
367
399
|
const useProfileSchema = {
|
|
368
400
|
...globalSchema,
|
|
@@ -381,7 +413,11 @@ const getProfileSchema = {
|
|
|
381
413
|
positional: true,
|
|
382
414
|
idx: 0
|
|
383
415
|
},
|
|
384
|
-
displayToken: {
|
|
416
|
+
displayToken: {
|
|
417
|
+
type: "boolean",
|
|
418
|
+
description: "Display the token in the bp profile",
|
|
419
|
+
default: false
|
|
420
|
+
}
|
|
385
421
|
};
|
|
386
422
|
const schemas = {
|
|
387
423
|
global: globalSchema,
|
package/dist/config.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/config.ts"],
|
|
4
|
-
"sourcesContent": ["import * as consts from './consts'\nimport { ProjectTemplates } from './project-templates'\nimport type { CommandOption, CommandSchema } from './typings'\n\n// command options\n\nconst port = {\n type: 'number',\n description: 'The port to use',\n} satisfies CommandOption\n\nconst workDir = {\n type: 'string',\n description: 'The path to the project',\n default: consts.defaultWorkDir,\n} satisfies CommandOption\n\nconst noBuild = {\n type: 'boolean',\n description: 'Skip the build step',\n default: false,\n} satisfies CommandOption\n\nconst dryRun = {\n type: 'boolean',\n description: 'Ask the API not to perform the actual operation',\n default: false,\n} as const satisfies CommandOption\n\nconst apiUrl = {\n type: 'string',\n description: 'The URL of the Botpress server',\n} satisfies CommandOption\n\nconst token = {\n type: 'string',\n description: 'You Personal Access Token ',\n} satisfies CommandOption\n\nconst workspaceId = {\n type: 'string',\n description: 'The Workspace Id to deploy to',\n} satisfies CommandOption\n\nconst secrets = {\n type: 'string',\n description: 'Values for the bot or integration secrets',\n array: true,\n default: [],\n} satisfies CommandOption\n\nconst botRef = {\n type: 'string',\n description: 'The bot ID. Bot Name is not supported.',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst packageRef = {\n type: 'string',\n description:\n 'The package ID or name with optional version. The package can be either an integration or an interface. Ex: teams, teams@0.2.0, llm@5.1.0',\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst integrationRef = {\n ...packageRef,\n demandOption: true,\n description: 'The integration ID or name with optional version. Ex: teams or teams@0.2.0',\n} satisfies CommandOption\n\nconst interfaceRef = {\n ...packageRef,\n demandOption: true,\n description: 'The interface ID or name and version. Ex: llm@5.1.0',\n} satisfies CommandOption\n\nconst pluginRef = {\n ...packageRef,\n demandOption: true,\n description: 'The plugin ID or name and version. Ex: knowledge@0.0.1',\n} satisfies CommandOption\n\nconst sourceMap = { type: 'boolean', description: 'Generate sourcemaps', default: false } satisfies CommandOption\n\nconst minify = { type: 'boolean', description: 'Minify the bundled code', default: true } satisfies CommandOption\n\nconst dev = {\n type: 'boolean',\n description: 'List only dev bots / dev integrations',\n default: false,\n} satisfies CommandOption\n\n// base schemas\n\nconst globalSchema = {\n verbose: {\n type: 'boolean',\n description: 'Enable verbose logging',\n alias: 'v',\n default: false,\n },\n confirm: {\n type: 'boolean',\n description: 'Confirm all prompts',\n alias: 'y',\n default: false,\n },\n json: {\n type: 'boolean',\n description: 'Prevent logging anything else than raw json in stdout. Useful for piping output to other tools',\n default: false,\n },\n botpressHome: {\n type: 'string',\n description: 'The path to the Botpress home directory',\n default: consts.defaultBotpressHome,\n },\n profile: {\n type: 'string',\n description: 'The CLI profile defined in the $BP_BOTPRESS_HOME/profiles.json',\n alias: 'p',\n },\n} satisfies CommandSchema\n\nconst projectSchema = {\n ...globalSchema,\n workDir,\n} satisfies CommandSchema\n\nconst credentialsSchema = {\n apiUrl,\n workspaceId,\n token,\n} satisfies CommandSchema\n\nconst secretsSchema = {\n secrets,\n} satisfies CommandSchema\n\n// command schemas\n\nconst generateSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst bundleSchema = {\n ...projectSchema,\n sourceMap,\n minify,\n} satisfies CommandSchema\n\nconst buildSchema = {\n ...projectSchema,\n sourceMap,\n minify,\n} satisfies CommandSchema\n\nconst readSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst serveSchema = {\n ...projectSchema,\n ...secretsSchema,\n port,\n} satisfies CommandSchema\n\nconst deploySchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n botId: { type: 'string', description: 'The bot ID to deploy. Only used when deploying a bot' },\n noBuild,\n dryRun,\n createNewBot: { type: 'boolean', description: 'Create a new bot when deploying. Only used when deploying a bot' },\n sourceMap,\n minify,\n visibility: {\n type: 'string',\n choices: ['public', 'private', 'unlisted'] as const,\n description:\n 'The visibility of the project. By default, projects are always private. Unlisted visibility is only supported for integrations and plugins.',\n default: 'private',\n },\n public: {\n type: 'boolean',\n description: 'DEPRECATED: Please use \"--visibility public\" instead.',\n default: false,\n deprecated: true,\n } satisfies CommandOption,\n allowDeprecated: {\n type: 'boolean',\n description: 'Allow deprecated features in the project',\n default: false,\n },\n url: { type: 'string', description: 'Custom URL for the integration. Only used when deploying an integration' },\n} as const satisfies CommandSchema\n\nconst devSchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n sourceMap,\n minify,\n port,\n tunnelUrl: {\n type: 'string',\n description: 'The tunnel HTTP URL to use',\n default: consts.defaultTunnelUrl,\n },\n tunnelId: {\n type: 'string',\n description: 'The tunnel ID to use. The ID will be generated if not specified',\n },\n noSecretCaching: {\n type: 'boolean',\n description: 'Do not save the secrets locally',\n default: false,\n alias: 'nsc',\n },\n} satisfies CommandSchema\n\nconst addSchema = {\n ...globalSchema,\n ...credentialsSchema,\n packageRef,\n installPath: {\n type: 'string',\n description: 'The path where to install the package',\n default: consts.defaultInstallPath,\n },\n useDev: {\n type: 'boolean',\n description: 'If a dev version of the package is found, use it',\n default: false,\n },\n alias: {\n type: 'string',\n description: 'The alias to install the package with',\n },\n} satisfies CommandSchema\n\nconst removeSchema = {\n ...globalSchema,\n ...credentialsSchema,\n workDir,\n alias: { idx: 0, positional: true, type: 'string', description: 'The alias of the package to uninstall' },\n} satisfies CommandSchema\n\nconst loginSchema = {\n ...globalSchema,\n token,\n workspaceId,\n apiUrl: { ...apiUrl, default: consts.defaultBotpressApiUrl },\n} satisfies CommandSchema\n\nconst logoutSchema = {\n ...globalSchema,\n} satisfies CommandSchema\n\nconst createBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name of the bot to create' },\n ifNotExists: {\n type: 'boolean',\n description: 'Do not create if a bot with the same name already exists',\n default: false,\n },\n} satisfies CommandSchema\n\nconst getBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst deleteBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst listBotsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n dev,\n} satisfies CommandSchema\n\nconst getIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst listIntegrationsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name filter when listing integrations' },\n versionNumber: { type: 'string', description: 'The version filter when listing integrations' },\n owned: { type: 'boolean', description: 'List only owned integrations' },\n public: { type: 'boolean', description: 'List only public integrations' },\n limit: { type: 'number', description: 'Limit the number of integrations returned' },\n dev,\n} satisfies CommandSchema\n\nconst deleteIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst getInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\n} satisfies CommandSchema\n\nconst listInterfacesSchema = {\n ...globalSchema,\n ...credentialsSchema,\n} satisfies CommandSchema\n\nconst deleteInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\n} satisfies CommandSchema\n\nconst getPluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst listPluginsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name filter when listing plugins' },\n versionNumber: { type: 'string', description: 'The version filter when listing plugins' },\n} satisfies CommandSchema\n\nconst deletePluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst initSchema = {\n ...globalSchema,\n workDir,\n type: { type: 'string', choices: ['bot', 'integration', 'plugin'] as const },\n template: {\n type: 'string',\n choices: ProjectTemplates.getAllChoices(),\n description: 'The template to use',\n },\n name: { type: 'string', description: 'The name of the project' },\n} satisfies CommandSchema\n\nconst lintSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst chatSchema = {\n ...globalSchema,\n ...credentialsSchema,\n chatApiUrl: {\n type: 'string',\n description: 'The URL of the chat server',\n },\n botId: {\n type: 'string',\n positional: true,\n idx: 0,\n description: 'The bot ID to chat with',\n },\n} satisfies CommandSchema\n\nconst listProfilesSchema = {\n ...globalSchema,\n displayToken: { type: 'boolean', description: 'Display the token in each of the bp profiles', default: false },\n} satisfies CommandSchema\n\nconst activeProfileSchema = {\n ...globalSchema,\n displayToken: { type: 'boolean', description: 'Display the token in the bp profile', default: false },\n} satisfies CommandSchema\n\nconst useProfileSchema = {\n ...globalSchema,\n profileToUse: {\n type: 'string',\n description: 'The CLI profile defined in the $BP_BOTPRESS_HOME/profiles.json',\n positional: true,\n idx: 0,\n },\n} satisfies CommandSchema\n\nconst getProfileSchema = {\n ...globalSchema,\n profileToGet: {\n type: 'string',\n description: 'The CLI profile defined in the $BP_BOTPRESS_HOME/profiles.json',\n positional: true,\n idx: 0,\n },\n displayToken: { type: 'boolean', description: 'Display the token in the bp profile', default: false },\n} satisfies CommandSchema\n\n// exports\n\nexport const schemas = {\n global: globalSchema,\n project: projectSchema,\n credentials: credentialsSchema,\n secrets: secretsSchema,\n login: loginSchema,\n logout: logoutSchema,\n createBot: createBotSchema,\n getBot: getBotSchema,\n deleteBot: deleteBotSchema,\n listBots: listBotsSchema,\n getIntegration: getIntegrationSchema,\n listIntegrations: listIntegrationsSchema,\n deleteIntegration: deleteIntegrationSchema,\n getInterface: getInterfaceSchema,\n listInterfaces: listInterfacesSchema,\n deleteInterface: deleteInterfaceSchema,\n getPlugin: getPluginSchema,\n listPlugins: listPluginsSchema,\n deletePlugin: deletePluginSchema,\n init: initSchema,\n generate: generateSchema,\n bundle: bundleSchema,\n build: buildSchema,\n read: readSchema,\n serve: serveSchema,\n deploy: deploySchema,\n add: addSchema,\n remove: removeSchema,\n dev: devSchema,\n lint: lintSchema,\n chat: chatSchema,\n listProfiles: listProfilesSchema,\n activeProfile: activeProfileSchema,\n useProfile: useProfileSchema,\n getProfile: getProfileSchema,\n} as const\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import type { ServerEventsProtocol } from '@botpress/chat'\nimport * as consts from './consts'\nimport { ProjectTemplates } from './project-templates'\nimport type { CommandOption, CommandSchema } from './typings'\n\n// command options\n\nconst port = {\n type: 'number',\n description: 'The port to use',\n} satisfies CommandOption\n\nconst workDir = {\n type: 'string',\n description: 'The path to the project',\n default: consts.defaultWorkDir,\n} satisfies CommandOption\n\nconst noBuild = {\n type: 'boolean',\n description: 'Skip the build step',\n default: false,\n} satisfies CommandOption\n\nconst dryRun = {\n type: 'boolean',\n description: 'Ask the API not to perform the actual operation',\n default: false,\n} as const satisfies CommandOption\n\nconst apiUrl = {\n type: 'string',\n description: 'The URL of the Botpress server',\n} satisfies CommandOption\n\nconst token = {\n type: 'string',\n description: 'You Personal Access Token ',\n} satisfies CommandOption\n\nconst workspaceId = {\n type: 'string',\n description: 'The Workspace Id to deploy to',\n} satisfies CommandOption\n\nconst secrets = {\n type: 'string',\n description: 'Values for the bot or integration secrets',\n array: true,\n default: [],\n} satisfies CommandOption\n\nconst botRef = {\n type: 'string',\n description: 'The bot ID. Bot Name is not supported.',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst packageRef = {\n type: 'string',\n description:\n 'The package ID or name with optional version. The package can be either an integration or an interface. Ex: teams, teams@0.2.0, llm@5.1.0',\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst integrationRef = {\n ...packageRef,\n demandOption: true,\n description: 'The integration ID or name with optional version. Ex: teams or teams@0.2.0',\n} satisfies CommandOption\n\nconst interfaceRef = {\n ...packageRef,\n demandOption: true,\n description: 'The interface ID or name and version. Ex: llm@5.1.0',\n} satisfies CommandOption\n\nconst pluginRef = {\n ...packageRef,\n demandOption: true,\n description: 'The plugin ID or name and version. Ex: knowledge@0.0.1',\n} satisfies CommandOption\n\nconst sourceMap = {\n type: 'boolean',\n description: 'Generate sourcemaps',\n default: false,\n} satisfies CommandOption\n\nconst minify = {\n type: 'boolean',\n description: 'Minify the bundled code',\n default: true,\n} satisfies CommandOption\n\nconst dev = {\n type: 'boolean',\n description: 'List only dev bots / dev integrations',\n default: false,\n} satisfies CommandOption\n\n// base schemas\n\nconst globalSchema = {\n verbose: {\n type: 'boolean',\n description: 'Enable verbose logging',\n alias: 'v',\n default: false,\n },\n confirm: {\n type: 'boolean',\n description: 'Confirm all prompts',\n alias: 'y',\n default: false,\n },\n json: {\n type: 'boolean',\n description: 'Prevent logging anything else than raw json in stdout. Useful for piping output to other tools',\n default: false,\n },\n botpressHome: {\n type: 'string',\n description: 'The path to the Botpress home directory',\n default: consts.defaultBotpressHome,\n },\n profile: {\n type: 'string',\n description: 'The CLI profile defined in the $BP_BOTPRESS_HOME/profiles.json',\n alias: 'p',\n },\n} satisfies CommandSchema\n\nconst projectSchema = {\n ...globalSchema,\n workDir,\n} satisfies CommandSchema\n\nconst credentialsSchema = {\n apiUrl,\n workspaceId,\n token,\n} satisfies CommandSchema\n\nconst secretsSchema = {\n secrets,\n} satisfies CommandSchema\n\n// command schemas\n\nconst generateSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst bundleSchema = {\n ...projectSchema,\n sourceMap,\n minify,\n} satisfies CommandSchema\n\nconst buildSchema = {\n ...projectSchema,\n sourceMap,\n minify,\n} satisfies CommandSchema\n\nconst readSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst serveSchema = {\n ...projectSchema,\n ...secretsSchema,\n port,\n} satisfies CommandSchema\n\nconst deploySchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n botId: { type: 'string', description: 'The bot ID to deploy. Only used when deploying a bot' },\n noBuild,\n dryRun,\n createNewBot: {\n type: 'boolean',\n description: 'Create a new bot when deploying. Only used when deploying a bot',\n },\n sourceMap,\n minify,\n visibility: {\n type: 'string',\n choices: ['public', 'private', 'unlisted'] as const,\n description:\n 'The visibility of the project. By default, projects are always private. Unlisted visibility is only supported for integrations and plugins.',\n default: 'private',\n },\n public: {\n type: 'boolean',\n description: 'DEPRECATED: Please use \"--visibility public\" instead.',\n default: false,\n deprecated: true,\n } satisfies CommandOption,\n allowDeprecated: {\n type: 'boolean',\n description: 'Allow deprecated features in the project',\n default: false,\n },\n url: {\n type: 'string',\n description: 'Custom URL for the integration. Only used when deploying an integration',\n },\n} as const satisfies CommandSchema\n\nconst devSchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n sourceMap,\n minify,\n port,\n tunnelUrl: {\n type: 'string',\n description: 'The tunnel HTTP URL to use',\n default: consts.defaultTunnelUrl,\n },\n tunnelId: {\n type: 'string',\n description: 'The tunnel ID to use. The ID will be generated if not specified',\n },\n noSecretCaching: {\n type: 'boolean',\n description: 'Do not save the secrets locally',\n default: false,\n alias: 'nsc',\n },\n} satisfies CommandSchema\n\nconst addSchema = {\n ...globalSchema,\n ...credentialsSchema,\n packageRef,\n installPath: {\n type: 'string',\n description: 'The path where to install the package',\n default: consts.defaultInstallPath,\n },\n useDev: {\n type: 'boolean',\n description: 'If a dev version of the package is found, use it',\n default: false,\n },\n alias: {\n type: 'string',\n description: 'The alias to install the package with',\n },\n} satisfies CommandSchema\n\nconst removeSchema = {\n ...globalSchema,\n ...credentialsSchema,\n workDir,\n alias: {\n idx: 0,\n positional: true,\n type: 'string',\n description: 'The alias of the package to uninstall',\n },\n} satisfies CommandSchema\n\nconst loginSchema = {\n ...globalSchema,\n token,\n workspaceId,\n apiUrl: { ...apiUrl, default: consts.defaultBotpressApiUrl },\n} satisfies CommandSchema\n\nconst logoutSchema = {\n ...globalSchema,\n} satisfies CommandSchema\n\nconst createBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name of the bot to create' },\n ifNotExists: {\n type: 'boolean',\n description: 'Do not create if a bot with the same name already exists',\n default: false,\n },\n} satisfies CommandSchema\n\nconst getBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst deleteBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst listBotsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n dev,\n} satisfies CommandSchema\n\nconst getIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst listIntegrationsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name filter when listing integrations' },\n versionNumber: { type: 'string', description: 'The version filter when listing integrations' },\n owned: { type: 'boolean', description: 'List only owned integrations' },\n public: { type: 'boolean', description: 'List only public integrations' },\n limit: { type: 'number', description: 'Limit the number of integrations returned' },\n dev,\n} satisfies CommandSchema\n\nconst deleteIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst getInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\n} satisfies CommandSchema\n\nconst listInterfacesSchema = {\n ...globalSchema,\n ...credentialsSchema,\n} satisfies CommandSchema\n\nconst deleteInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\n} satisfies CommandSchema\n\nconst getPluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst listPluginsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name filter when listing plugins' },\n versionNumber: { type: 'string', description: 'The version filter when listing plugins' },\n} satisfies CommandSchema\n\nconst deletePluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst initSchema = {\n ...globalSchema,\n workDir,\n type: { type: 'string', choices: ['bot', 'integration', 'plugin'] as const },\n template: {\n type: 'string',\n choices: ProjectTemplates.getAllChoices(),\n description: 'The template to use',\n },\n name: { type: 'string', description: 'The name of the project' },\n} satisfies CommandSchema\n\nconst lintSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst chatSchema = {\n ...globalSchema,\n ...credentialsSchema,\n chatApiUrl: {\n type: 'string',\n description: 'The URL of the chat server',\n },\n botId: {\n type: 'string',\n positional: true,\n idx: 0,\n description: 'The bot ID to chat with',\n },\n protocol: {\n choices: ['sse', 'websocket'] satisfies ReadonlyArray<ServerEventsProtocol>,\n default: 'sse' as const,\n description: 'The protocol to use for long lived connections',\n },\n} satisfies CommandSchema\n\nconst listProfilesSchema = {\n ...globalSchema,\n displayToken: {\n type: 'boolean',\n description: 'Display the token in each of the bp profiles',\n default: false,\n },\n} satisfies CommandSchema\n\nconst activeProfileSchema = {\n ...globalSchema,\n displayToken: {\n type: 'boolean',\n description: 'Display the token in the bp profile',\n default: false,\n },\n} satisfies CommandSchema\n\nconst useProfileSchema = {\n ...globalSchema,\n profileToUse: {\n type: 'string',\n description: 'The CLI profile defined in the $BP_BOTPRESS_HOME/profiles.json',\n positional: true,\n idx: 0,\n },\n} satisfies CommandSchema\n\nconst getProfileSchema = {\n ...globalSchema,\n profileToGet: {\n type: 'string',\n description: 'The CLI profile defined in the $BP_BOTPRESS_HOME/profiles.json',\n positional: true,\n idx: 0,\n },\n displayToken: {\n type: 'boolean',\n description: 'Display the token in the bp profile',\n default: false,\n },\n} satisfies CommandSchema\n\n// exports\n\nexport const schemas = {\n global: globalSchema,\n project: projectSchema,\n credentials: credentialsSchema,\n secrets: secretsSchema,\n login: loginSchema,\n logout: logoutSchema,\n createBot: createBotSchema,\n getBot: getBotSchema,\n deleteBot: deleteBotSchema,\n listBots: listBotsSchema,\n getIntegration: getIntegrationSchema,\n listIntegrations: listIntegrationsSchema,\n deleteIntegration: deleteIntegrationSchema,\n getInterface: getInterfaceSchema,\n listInterfaces: listInterfacesSchema,\n deleteInterface: deleteInterfaceSchema,\n getPlugin: getPluginSchema,\n listPlugins: listPluginsSchema,\n deletePlugin: deletePluginSchema,\n init: initSchema,\n generate: generateSchema,\n bundle: bundleSchema,\n build: buildSchema,\n read: readSchema,\n serve: serveSchema,\n deploy: deploySchema,\n add: addSchema,\n remove: removeSchema,\n dev: devSchema,\n lint: lintSchema,\n chat: chatSchema,\n listProfiles: listProfilesSchema,\n activeProfile: activeProfileSchema,\n useProfile: useProfileSchema,\n getProfile: getProfileSchema,\n} as const\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,+BAAiC;AAKjC,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS,OAAO;AAClB;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,QAAQ;AAAA,EACZ,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,cAAc;AAAA,EAClB,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,OAAO;AAAA,EACP,SAAS,CAAC;A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AM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cAAc;AAAA,EACd,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,YAAY;AACd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1446,6 +1446,11 @@ declare const _default: {
|
|
|
1446
1446
|
idx: number;
|
|
1447
1447
|
description: string;
|
|
1448
1448
|
};
|
|
1449
|
+
protocol: {
|
|
1450
|
+
choices: ("websocket" | "sse")[];
|
|
1451
|
+
default: "sse";
|
|
1452
|
+
description: string;
|
|
1453
|
+
};
|
|
1449
1454
|
apiUrl: {
|
|
1450
1455
|
type: "string";
|
|
1451
1456
|
description: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cli",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0",
|
|
4
4
|
"description": "Botpress CLI",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
|
29
29
|
"@botpress/chat": "0.5.5",
|
|
30
|
-
"@botpress/client": "1.
|
|
31
|
-
"@botpress/sdk": "6.
|
|
30
|
+
"@botpress/client": "1.42.0",
|
|
31
|
+
"@botpress/sdk": "6.7.0",
|
|
32
32
|
"@bpinternal/const": "^0.1.0",
|
|
33
33
|
"@bpinternal/tunnel": "^0.1.1",
|
|
34
34
|
"@bpinternal/verel": "^0.2.0",
|