From 287c56ce64be4052351da5b6a13f50b3fd4c70b5 Mon Sep 17 00:00:00 2001 From: JustinBordage <38659460+JustinBordage@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:16:31 -0500 Subject: [PATCH 1/3] feat(packages/cli): implement token masking for profile commands (#14977) --- packages/cli/package.json | 2 +- .../profile-commands.ts | 20 ++++++++++++++++--- packages/cli/src/config.ts | 2 ++ scripts/upload-sandbox-scripts.ts | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 860033a2606..677e99fa194 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@botpress/cli", - "version": "5.5.7", + "version": "5.6.0", "description": "Botpress CLI", "scripts": { "build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen", diff --git a/packages/cli/src/command-implementations/profile-commands.ts b/packages/cli/src/command-implementations/profile-commands.ts index f51bd328d3a..029195ba809 100644 --- a/packages/cli/src/command-implementations/profile-commands.ts +++ b/packages/cli/src/command-implementations/profile-commands.ts @@ -9,6 +9,8 @@ type ProfileEntry = ProfileCredentials & { name: string } +type ProfileEntryWithoutToken = Omit + export type ActiveProfileCommandDefinition = typeof commandDefinitions.profiles.subcommands.active export class ActiveProfileCommand extends GlobalCommand { public async run(): Promise { @@ -21,7 +23,8 @@ export class ActiveProfileCommand extends GlobalCommand ({ + name: profile.name, + apiUrl: profile.apiUrl, + workspaceId: profile.workspaceId, +}) + +const _shouldOmitToken = (argv: { displayToken: boolean }) => !argv.displayToken diff --git a/packages/cli/src/config.ts b/packages/cli/src/config.ts index 86255af4e9c..2f15f15b644 100644 --- a/packages/cli/src/config.ts +++ b/packages/cli/src/config.ts @@ -381,10 +381,12 @@ const chatSchema = { const listProfilesSchema = { ...globalSchema, + displayToken: { type: 'boolean', description: 'Display the token in each of the bp profiles', default: false }, } satisfies CommandSchema const activeProfileSchema = { ...globalSchema, + displayToken: { type: 'boolean', description: 'Display the token in the bp profile', default: false }, } satisfies CommandSchema const useProfileSchema = { diff --git a/scripts/upload-sandbox-scripts.ts b/scripts/upload-sandbox-scripts.ts index 529a0287735..4edeaff8775 100644 --- a/scripts/upload-sandbox-scripts.ts +++ b/scripts/upload-sandbox-scripts.ts @@ -24,7 +24,7 @@ const _fallbackProfileArgs = () => ({ token: undefined, }) function getProfileArgs(): any { - const activeProfileCmdResult = spawnSync('pnpm', ['exec', 'bp', 'profiles', 'active', '--json']) + const activeProfileCmdResult = spawnSync('pnpm', ['exec', 'bp', 'profiles', 'active', '--json', '--displayToken']) if (activeProfileCmdResult.status !== 0) { console.debug( `Failed to get active profile: ${activeProfileCmdResult.error?.message || activeProfileCmdResult.stderr.toString() || 'Unknown error'}` From 883957a9b356af795567e2dafdb26968b80054db Mon Sep 17 00:00:00 2001 From: JustinBordage <38659460+JustinBordage@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:39:01 -0500 Subject: [PATCH 2/3] fix(packages/cli): read command not including the configurations in integration json schema (#14981) --- packages/cli/package.json | 2 +- packages/cli/src/command-implementations/read-command.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 677e99fa194..e2123c15aba 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@botpress/cli", - "version": "5.6.0", + "version": "5.6.1", "description": "Botpress CLI", "scripts": { "build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen", diff --git a/packages/cli/src/command-implementations/read-command.ts b/packages/cli/src/command-implementations/read-command.ts index ccc6c14e64d..8efdb9922d2 100644 --- a/packages/cli/src/command-implementations/read-command.ts +++ b/packages/cli/src/command-implementations/read-command.ts @@ -38,7 +38,14 @@ export class ReadCommand extends ProjectCommand { } private _parseIntegration = async (integrationDef: sdk.IntegrationDefinition) => { - const parsed = await apiUtils.prepareCreateIntegrationBody(integrationDef) + const { + // Ignored fields ("code", "icon", "readme") so the terminal output doesn't get polluted + code: _code, + icon: _icon, + readme: _readme, + ...parsed + } = await this.prepareCreateIntegrationBody(integrationDef) + parsed.interfaces = utils.records.mapValues(integrationDef.interfaces ?? {}, (iface) => ({ ...iface, id: iface.id ?? '', From 88c47aeb47565da0cbd4ab036c530de5273c4a28 Mon Sep 17 00:00:00 2001 From: JustinBordage <38659460+JustinBordage@users.noreply.github.com> Date: Wed, 4 Mar 2026 20:53:46 -0500 Subject: [PATCH 3/3] fix(integrations/trello): add missing titles & descriptions (#14928) --- .../definitions/actions/board-actions.ts | 17 ++++++-- .../definitions/actions/card-actions.ts | 40 +++++++++++++------ .../trello/definitions/actions/common.ts | 36 +---------------- .../definitions/actions/list-actions.ts | 22 +++++++--- .../definitions/actions/member-actions.ts | 31 +++++++++----- integrations/trello/integration.definition.ts | 2 +- 6 files changed, 81 insertions(+), 67 deletions(-) diff --git a/integrations/trello/definitions/actions/board-actions.ts b/integrations/trello/definitions/actions/board-actions.ts index 379b73dace6..ce346b577f0 100644 --- a/integrations/trello/definitions/actions/board-actions.ts +++ b/integrations/trello/definitions/actions/board-actions.ts @@ -1,6 +1,6 @@ import { ActionDefinition, z } from '@botpress/sdk' import { boardSchema } from 'definitions/schemas' -import { hasBoardId, noInput, outputsBoard, outputsBoards } from './common' +import { hasBoardId, noInput } from './common' export const getBoardById = { title: 'Get board by ID', @@ -9,7 +9,9 @@ export const getBoardById = { schema: hasBoardId.describe('Input schema for getting a board from its ID'), }, output: { - schema: outputsBoard.describe('Output schema for getting a board from its ID'), + schema: z.object({ + board: boardSchema.title('Trello Board').describe('The details of the Trello board associated with the given ID'), + }), }, } as const satisfies ActionDefinition @@ -24,7 +26,12 @@ export const getBoardsByDisplayName = { .describe('Input schema for getting a board ID from its name'), }, output: { - schema: outputsBoards.describe('Output schema for getting a board from its name'), + schema: z.object({ + boards: z + .array(boardSchema) + .title('Trello Boards') + .describe('A list of boards that match the given display name'), + }), }, } as const satisfies ActionDefinition @@ -35,6 +42,8 @@ export const getAllBoards = { schema: noInput.describe('Input schema for getting all boards'), }, output: { - schema: outputsBoards.describe('Output schema for getting all boards'), + schema: z.object({ + boards: z.array(boardSchema).title('Trello Boards').describe('A list of Trello boards'), + }), }, } as const satisfies ActionDefinition diff --git a/integrations/trello/definitions/actions/card-actions.ts b/integrations/trello/definitions/actions/card-actions.ts index 7175c6c31c8..8c8d2da82f7 100644 --- a/integrations/trello/definitions/actions/card-actions.ts +++ b/integrations/trello/definitions/actions/card-actions.ts @@ -1,6 +1,6 @@ import { ActionDefinition, z } from '@botpress/sdk' import { cardSchema, listSchema, trelloIdSchema } from 'definitions/schemas' -import { hasCardId, hasListId, hasMessage, outputsCard, outputsCards } from './common' +import { hasCardId, hasListId, hasMessage } from './common' export const getCardById = { title: 'Get card by ID', @@ -9,13 +9,15 @@ export const getCardById = { schema: hasCardId.describe('Input schema for getting a card from its ID'), }, output: { - schema: outputsCard.describe('Output schema for getting a card from its ID'), + schema: z.object({ + card: cardSchema.title('Trello Card').describe("The Trello card that's associated with the given card ID"), + }), }, } as const satisfies ActionDefinition export const getCardsByDisplayName = { - title: 'Find cards by name name', - description: 'Find all lists whose display name match this name', + title: 'Find cards by name', + description: 'Find all cards whose display name match this name', input: { schema: hasListId .extend({ @@ -24,7 +26,9 @@ export const getCardsByDisplayName = { .describe('Input schema for getting a card ID from its name'), }, output: { - schema: outputsCards.describe('Output schema for getting a card ID from its name'), + schema: z.object({ + cards: z.array(cardSchema).title('Trello Cards').describe('A list of cards that match the given card name'), + }), }, } as const satisfies ActionDefinition @@ -35,7 +39,12 @@ export const getCardsInList = { schema: hasListId.describe('Input schema for getting all cards in a list'), }, output: { - schema: outputsCards.describe('Output schema for getting all cards in a list'), + schema: z.object({ + cards: z + .array(cardSchema) + .title('Trello Cards') + .describe('An array of cards that are contained within the given list'), + }), }, } as const satisfies ActionDefinition @@ -73,8 +82,11 @@ export const createCard = { .describe('Input schema for creating a new card'), }, output: { - schema: hasMessage - .extend({ + schema: z + .object({ + message: hasMessage.shape.message + .title('Action message') + .describe('A message that says if the card was successfully created or not'), newCardId: cardSchema.shape.id.describe('Unique identifier of the new card'), }) .describe('Output schema for creating a card'), @@ -201,11 +213,13 @@ export const addCardComment = { .describe('Input schema for adding a comment to a card'), }, output: { - schema: hasMessage - .extend({ - newCommentId: trelloIdSchema.describe('Unique identifier of the newly created comment'), - }) - .describe('Output schema for adding a comment to a card'), + schema: z.object({ + message: z + .string() + .title('Action message') + .describe('A message that says if the comment was successfully created or not'), + newCommentId: trelloIdSchema.title('New Comment ID').describe('Unique identifier of the newly created comment'), + }), }, } as const satisfies ActionDefinition diff --git a/integrations/trello/definitions/actions/common.ts b/integrations/trello/definitions/actions/common.ts index 0fe66a97bc8..555c61ee0e8 100644 --- a/integrations/trello/definitions/actions/common.ts +++ b/integrations/trello/definitions/actions/common.ts @@ -1,5 +1,5 @@ import { z } from '@botpress/sdk' -import { boardSchema, listSchema, cardSchema, memberSchema } from 'definitions/schemas' +import { boardSchema, listSchema, cardSchema } from 'definitions/schemas' // ==== Common Input Schemas ==== export const noInput = z.object({}) @@ -18,37 +18,5 @@ export const hasCardId = z.object({ // ==== Common Output Schemas ==== export const hasMessage = z.object({ - message: z.string().describe('Output message'), -}) - -export const outputsMember = z.object({ - member: memberSchema.describe('The member object'), -}) - -export const outputsMembers = z.object({ - members: z.array(memberSchema).describe('Array of member objects'), -}) - -export const outputsCard = z.object({ - card: cardSchema.describe('The card object'), -}) - -export const outputsCards = z.object({ - cards: z.array(cardSchema).describe('Array of card objects'), -}) - -export const outputsList = z.object({ - list: listSchema.describe('The list object'), -}) - -export const outputsLists = z.object({ - lists: z.array(listSchema).describe('Array of list objects'), -}) - -export const outputsBoard = z.object({ - board: boardSchema.describe('The board object'), -}) - -export const outputsBoards = z.object({ - boards: z.array(boardSchema).describe('Array of board objects'), + message: z.string().title('Output message').describe('Output message'), }) diff --git a/integrations/trello/definitions/actions/list-actions.ts b/integrations/trello/definitions/actions/list-actions.ts index 2554f7029c2..bbaebe1a1f2 100644 --- a/integrations/trello/definitions/actions/list-actions.ts +++ b/integrations/trello/definitions/actions/list-actions.ts @@ -1,6 +1,6 @@ -import { ActionDefinition } from '@botpress/sdk' +import { ActionDefinition, z } from '@botpress/sdk' import { listSchema } from 'definitions/schemas' -import { hasBoardId, hasListId, outputsList, outputsLists } from './common' +import { hasBoardId, hasListId } from './common' export const getListById = { title: 'Get list by ID', @@ -9,7 +9,9 @@ export const getListById = { schema: hasListId.describe('Input schema for getting a list from its ID'), }, output: { - schema: outputsList.describe('Output schema for getting a list from its ID'), + schema: z.object({ + list: listSchema.title('Trello List').describe("The Trello list that's associated with the given list ID"), + }), }, } as const satisfies ActionDefinition @@ -24,7 +26,12 @@ export const getListsByDisplayName = { .describe('Input schema for getting a list ID from its name'), }, output: { - schema: outputsLists.describe('Output schema for getting a list ID from its name'), + schema: z.object({ + lists: z + .array(listSchema) + .title('Trello Lists') + .describe('A set of lists that are associated with the given board ID and match the given display name'), + }), }, } as const satisfies ActionDefinition @@ -35,6 +42,11 @@ export const getListsInBoard = { schema: hasBoardId.describe('Input schema for getting all lists in a board'), }, output: { - schema: outputsLists.describe('Output schema for getting all lists in a board'), + schema: z.object({ + lists: z + .array(listSchema) + .title('Trello Lists') + .describe('A set of all the lists that are associated with the given board ID'), + }), }, } as const satisfies ActionDefinition diff --git a/integrations/trello/definitions/actions/member-actions.ts b/integrations/trello/definitions/actions/member-actions.ts index 224d3f772d5..f7b306fa8c7 100644 --- a/integrations/trello/definitions/actions/member-actions.ts +++ b/integrations/trello/definitions/actions/member-actions.ts @@ -1,6 +1,6 @@ import { ActionDefinition, z } from '@botpress/sdk' import { boardSchema, memberSchema } from 'definitions/schemas' -import { hasBoardId, hasCardId, outputsMember, outputsMembers } from './common' +import { hasBoardId, hasCardId } from './common' export const getMemberByIdOrUsername = { title: 'Get member by ID or username', @@ -16,7 +16,11 @@ export const getMemberByIdOrUsername = { .describe('Input schema for getting a member from its ID or username'), }, output: { - schema: outputsMember.describe('Output schema for getting a member by its ID or username'), + schema: z.object({ + member: memberSchema + .title('Trello Member') + .describe('The Trello member who is associated with the specified member ID or username'), + }), }, } as const satisfies ActionDefinition @@ -27,7 +31,12 @@ export const getAllCardMembers = { schema: hasCardId.describe('Input schema for getting all members of a card'), }, output: { - schema: outputsMembers.describe('Output schema for getting all members of a card'), + schema: z.object({ + members: z + .array(memberSchema) + .title('Card Members') + .describe('A list of members who have been assigned to the card'), + }), }, } as const satisfies ActionDefinition @@ -38,7 +47,9 @@ export const getAllBoardMembers = { schema: hasBoardId.describe('Input schema for getting all members of a board'), }, output: { - schema: outputsMembers.describe('Output schema for getting all members of a board'), + schema: z.object({ + members: z.array(memberSchema).title('Board Members').describe('A list of members who have access to the board'), + }), }, } as const satisfies ActionDefinition @@ -46,13 +57,13 @@ export const getBoardMembersByDisplayName = { title: 'Get members by name', description: 'Find all members whose display name match this name', input: { - schema: hasBoardId - .extend({ - displayName: boardSchema.shape.name.title('Display Name').describe('Display name of the member'), - }) - .describe('Input schema for getting a member from its name'), + schema: hasBoardId.extend({ + displayName: boardSchema.shape.name.title('Display Name').describe('Display name of the member'), + }), }, output: { - schema: outputsMembers.describe('Output schema for getting a member from its name'), + schema: z.object({ + members: z.array(memberSchema).title('Board Members').describe('A list of members that match the specified name'), + }), }, } as const satisfies ActionDefinition diff --git a/integrations/trello/integration.definition.ts b/integrations/trello/integration.definition.ts index 52e5484a980..776fddc10e0 100644 --- a/integrations/trello/integration.definition.ts +++ b/integrations/trello/integration.definition.ts @@ -5,7 +5,7 @@ import { trelloIdSchema } from 'definitions/schemas' import { events, actions, channels, user, configuration, entities } from './definitions' export const INTEGRATION_NAME = 'trello' -export const INTEGRATION_VERSION = '2.1.1' +export const INTEGRATION_VERSION = '2.1.2' export default new sdk.IntegrationDefinition({ name: INTEGRATION_NAME,