diff --git a/.gitignore b/.gitignore index 6ec3522c..59b57568 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ metadata.json .idea/ .idea .env.debug +tmp/ .pnp.* .yarn/* diff --git a/.vscode/settings.json b/.vscode/settings.json index 70522d1e..433e5f31 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "editor.codeActionsOnSave": { - "source.fixAll": true + "source.fixAll": "explicit" }, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true, @@ -16,5 +16,6 @@ "typescript.tsdk": ".yarn/sdks/typescript/lib", "files.associations": { "*.styl": "scss" - } + }, + "DevChat.PythonForCommands": "/home/guru/.chat/mamba/envs/devchat-commands/bin/python" } diff --git a/README.md b/README.md index f811973b..fefde809 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Development workflow -Currently, it is not recommended to run the studio on its own. Therefore, you must start the Botpress Server, which will provide a couple of required parameters so the studio can work smoothly with the server. +Currently, it is not recommended to run the studio on its own. Therefore, you must start the TheGurúCompany Studio Server, which will provide a couple of required parameters so the studio can work smoothly with the server. We use Yarn v3 in this repository, so if you have errors while trying to build the repository, ensure you have the latest version installed: `npm install -g yarn` @@ -11,7 +11,7 @@ We use Yarn v3 in this repository, so if you have errors while trying to build t Like before, any changes made on the frontend will be available after a simple page refresh. Changes on the backend will require a server restart. -Since this package MUST be started from the Botpress Server, you need to set a special environment variable on the server so it can load the correct files. +Since this package MUST be started from the TheGurúCompany Studio Server, you need to set a special environment variable on the server so it can load the correct files. The variable is named `DEV_STUDIO_PATH` and must point to `packages/studio-be/out`. Watch out, path must be an abs path, env var doesn't support relative path. ## As standalone (NOT RECOMMENDED) @@ -20,7 +20,7 @@ The studio can be executed as a standalone application, but there are still a co When started as a standalone, these environment variables must be set: -- BP_MODULES_PATH: Path to the modules folder of a Botpress installation +- BP_MODULES_PATH: Path to the modules folder of a TheGurúCompany Studio installation - BP_DATA_FOLDER: Path to the data folder (bots/, global/) - BP_SERVER_URL: to determine diff --git a/packages/studio-be/src/common/http.ts b/packages/studio-be/src/common/http.ts index 758d4dd1..2e5a38e7 100644 --- a/packages/studio-be/src/common/http.ts +++ b/packages/studio-be/src/common/http.ts @@ -67,7 +67,7 @@ export const asyncMiddleware = * @constructor * @param message - The error message that will be sent to the end-user * @param statusCode - The HTTP status code - * @param errorCode - Botpress error codes e.g. BP_0001, BP_0002, etc. + * @param errorCode - TheGurúCompany Studio error codes e.g. BP_0001, BP_0002, etc. */ export class ResponseError extends Error { errorCode: string | undefined diff --git a/packages/studio-be/src/core/app/bootstrap.ts b/packages/studio-be/src/core/app/bootstrap.ts index 339a4b0a..1ae58f90 100644 --- a/packages/studio-be/src/core/app/bootstrap.ts +++ b/packages/studio-be/src/core/app/bootstrap.ts @@ -101,7 +101,13 @@ async function start() { process.LOADED_MODULES[loadedModule.entryPoint.definition.name] = loadedModule.moduleLocation } - showBanner({ title: 'Botpress Studio', version: process.STUDIO_VERSION, logScopeLength: 9, bannerWidth: 75, logger }) + showBanner({ + title: 'TheGurúCompany Studio', + version: process.STUDIO_VERSION, + logScopeLength: 9, + bannerWidth: 75, + logger + }) if (!fs.existsSync(process.APP_DATA_PATH)) { try { @@ -128,7 +134,7 @@ This is a fatal error, process will exit.` } await app.botpress.start({ modules: loadedModules.map((m) => m.entryPoint) }).catch((err) => { - logger.attachError(err).error('Error starting Botpress Studio') + logger.attachError(err).error('Error starting TheGurúCompany Studio') if (!process.IS_FAILSAFE) { process.exit(1) diff --git a/packages/studio-be/src/core/app/server.ts b/packages/studio-be/src/core/app/server.ts index ae82a322..3fba9c1a 100644 --- a/packages/studio-be/src/core/app/server.ts +++ b/packages/studio-be/src/core/app/server.ts @@ -200,7 +200,7 @@ export class HTTPServer { return res .status(503) .send( - ' Botpress is loading. Please try again in a minute.' + ' TheGurúCompany Studio is loading. Please try again in a minute.' ) } } @@ -264,7 +264,7 @@ export class HTTPServer { const errorCode = err.errorCode const message = err.message || err || 'Unexpected error' const details = err.details || '' - const docs = err.docs || 'https://botpress.com/docs' + const docs = err.docs || 'https://chtostudio.com/docs' const devOnly = process.IS_PRODUCTION ? {} : { showStackInDev: true, stack: err.stack, full: err.message } res.status(statusCode).json({ diff --git a/packages/studio-be/src/core/config/config-loader.ts b/packages/studio-be/src/core/config/config-loader.ts index 0a56340b..5dcf4877 100644 --- a/packages/studio-be/src/core/config/config-loader.ts +++ b/packages/studio-be/src/core/config/config-loader.ts @@ -133,12 +133,12 @@ export class ConfigProvider { public async getBrandingConfig(appName: 'admin' | 'studio') { const defaultConfig = { admin: { - title: 'Botpress Admin Panel', + title: 'TheGurúCompany Studio Admin Panel', favicon: 'assets/admin/ui/public/favicon.ico', customCss: '' }, studio: { - title: 'Botpress Studio', + title: 'TheGurúCompany Studio', favicon: 'assets/studio/ui/public/img/favicon.png', customCss: '' } diff --git a/packages/studio-be/src/index.ts b/packages/studio-be/src/index.ts index 0601f366..b8b4466f 100644 --- a/packages/studio-be/src/index.ts +++ b/packages/studio-be/src/index.ts @@ -11,7 +11,7 @@ import metadata from './metadata.json' const printPlainError = (err) => { /* eslint-disable no-console */ - console.log('Error starting botpress') + console.log('Error starting TheGurúCompany Studio') console.log(err) console.log(err.message) console.log('---STACK---') @@ -93,11 +93,11 @@ try { require('yargs') .command( ['serve', '$0'], - 'Start your botpress server', + 'Start your TheGurúCompany Studio server', { dataFolder: { alias: ['d', 'data'], - description: 'Starts Botpress in standalone mode on that specific data folder', + description: 'Starts TheGurúCompany Studio in standalone mode on that specific data folder', type: 'string' } }, diff --git a/packages/studio-be/src/sdk/botpress.d.ts b/packages/studio-be/src/sdk/botpress.d.ts index 010e93e8..378859df 100644 --- a/packages/studio-be/src/sdk/botpress.d.ts +++ b/packages/studio-be/src/sdk/botpress.d.ts @@ -51,12 +51,12 @@ declare module 'botpress/sdk' { export type KnexExtended = Knex & KnexExtension /** - * Returns the current version of Botpress + * Returns the current version of TheGurúCompany Studio */ export const version: string /** - * This variable gives you access to the Botpress database via Knex. + * This variable gives you access to the TheGurúCompany Studio database via Knex. * When developing modules, you can use this to create tables and manage data * @example bp.database('srv_channel_users').insert() */ @@ -128,7 +128,7 @@ declare module 'botpress/sdk' { /** * The Module Entry Point is used by the module loader to bootstrap the module. It must be present in the index.js file - * of the module. The path to the module must also be specified in the global botpress config. + * of the module. The path to the module must also be specified in the global TheGurúCompany Studio config. */ export interface ModuleEntryPoint { /** Additional metadata about the module */ @@ -182,7 +182,7 @@ declare module 'botpress/sdk' { name: string /** Gives a short description of your module, which is displayed once the template is selected */ desc: string - /** These are used internally by Botpress when they are registered on startup */ + /** These are used internally by TheGurúCompany Studio when they are registered on startup */ readonly moduleId?: string readonly moduleName?: string } @@ -384,7 +384,7 @@ declare module 'botpress/sdk' { export const SKIP_DIALOG_ENGINE: symbol /** When this flag is active, the QNA module won't intercept this event */ export const SKIP_QNA_PROCESSING: symbol - /** When this flag is active, Botpress Native NLU will not process this event */ + /** When this flag is active, TheGurúCompany Studio Native NLU will not process this event */ export const SKIP_NATIVE_NLU: symbol /** When this flag is active, the Event State is persisted even if the dialog engine is skipped */ export const FORCE_PERSIST_STATE: symbol @@ -410,7 +410,7 @@ declare module 'botpress/sdk' { } /** - * A BotpressEvent is how conversational channels interact with Botpress. Events represent all the interactions + * A TheGurúCompany Studio Event is how conversational channels interact with TheGurúCompany Studio. Events represent all the interactions * that make up a conversation. That means the different message types (text, image, buttons, carousels etc) but also * the navigational events (chat open, user typing) and contextual events (user returned home, order delivered). */ @@ -543,7 +543,7 @@ declare module 'botpress/sdk' { * store and retrieve data for different kind of situations. */ export interface EventState { - /** Data saved as user attributes; retention policies in Botpress global config applies */ + /** Data saved as user attributes; retention policies in TheGurúCompany Studio global config applies */ user: any /** Data is kept for the active session. Timeout configurable in the global config file */ session: CurrentSession @@ -555,7 +555,7 @@ declare module 'botpress/sdk' { * There is a possible race condition since it is loaded each time a messages comes in. Update it wisely */ bot: any - /** Used internally by Botpress to keep the user's current location and upcoming instructions */ + /** Used internally by TheGurúCompany Studio to keep the user's current location and upcoming instructions */ context?: DialogContext /** This variable points to the currently active workflow */ workflow: WorkflowHistory @@ -972,7 +972,7 @@ declare module 'botpress/sdk' { /** * A Content Type describes a grouping of Content Elements @see ContentElement sharing the same properties. * They can describe anything and everything – they most often are domain-specific to your bot. They also - * tells botpress how to display the content on various channels + * tells TheGurúCompany Studio how to display the content on various channels */ export interface ContentType { id: string @@ -1093,7 +1093,7 @@ declare module 'botpress/sdk' { export interface FlowGenerationResult { /** * A partial flow originating from a skill flow generator. Missing pieces will be automatically added - * once the flow is sent to Botpress, the final product will be a Flow. + * once the flow is sent to TheGurúCompany Studio, the final product will be a Flow. */ flow: SkillFlow /** An array of possible transitions for the parent node */ @@ -1319,7 +1319,7 @@ declare module 'botpress/sdk' { inversify: any } - /** These are additional information that Botpress may pass down to migrations (for ex: running bot-specific migration) */ + /** These are additional information that TheGurúCompany Studio may pass down to migrations (for ex: running bot-specific migration) */ export interface MigrationMetadata { botId?: string } @@ -1875,7 +1875,7 @@ declare module 'botpress/sdk' { export function getModuleConfigForBot(moduleId: string, botId: string, ignoreGlobal?: boolean): Promise /** - * Returns the configuration options of Botpress + * Returns the configuration options of TheGurúCompany Studio */ export function getBotpressConfig(): Promise @@ -2169,7 +2169,7 @@ declare module 'botpress/sdk' { */ export namespace security { /** - * Creates a message signature, which can be used as proof that the message was created on Botpress backend + * Creates a message signature, which can be used as proof that the message was created on TheGurúCompany Studio backend * You can call this method twice to verify the authenticity of a message */ export function getMessageSignature(message: string): Promise @@ -2240,12 +2240,12 @@ declare module 'botpress/sdk' { /** * Creates a mapping of ids for a conversation in a given channel * @param channel The channel for which to create the mapping - * @param localId The id of the conversation in botpress + * @param localId The id of the conversation in TheGurúCompany Studio * @param foreignId The id of the conversation in that channel * @example * // I have been given an conversation id by facebook messenger * const messengerConversationId = 134314 - * // Let's say I have an already existing botpress conversation somewhere that I want to attach to this conversation + * // Let's say I have an already existing TheGurúCompany Studio conversation somewhere that I want to attach to this conversation * const conversationId = '00001337-ca79-4235-8475-3785e41eb2be' * * // Create the mapping @@ -2264,12 +2264,12 @@ declare module 'botpress/sdk' { deleteMapping(channel: string, localId: uuid, foreignId: string): Promise /** - * Gets a conversations id specific to the given channel from a botpress conversation id + * Gets a conversations id specific to the given channel from a TheGurúCompany Studio conversation id */ getForeignId(channel: string, localId: uuid): Promise /** - * Gets a botpress conversation id from the foreign id of a conversation in a the given channel + * Gets a TheGurúCompany Studio conversation id from the foreign id of a conversation in a the given channel */ getLocalId(channel: string, foreignId: string): Promise } diff --git a/packages/studio-be/src/studio/nlu/entities-service.ts b/packages/studio-be/src/studio/nlu/entities-service.ts index 5a7a3693..e8196d06 100644 --- a/packages/studio-be/src/studio/nlu/entities-service.ts +++ b/packages/studio-be/src/studio/nlu/entities-service.ts @@ -7,7 +7,7 @@ import { NLUService } from './nlu-service' const ENTITIES_DIR = './entities' -// copied from botpress/nlu repo +// copied from TheGurúCompany Studio/nlu repo const SYSTEM_ENTITIES = [ 'amountOfMoney', 'distance', diff --git a/packages/studio-be/src/typings/global.d.ts b/packages/studio-be/src/typings/global.d.ts index d8ea6301..13a6432f 100644 --- a/packages/studio-be/src/typings/global.d.ts +++ b/packages/studio-be/src/typings/global.d.ts @@ -21,7 +21,7 @@ declare namespace NodeJS { APP_SECRET: string IS_STANDALONE: boolean /** - * Path to the global APP DATA folder, shared across all installations of Botpress Server + * Path to the global APP DATA folder, shared across all installations of TheGurúCompany Studio Server * Use this folder to store stuff you'd like to cache, like NLU language models etc */ APP_DATA_PATH: string @@ -30,11 +30,11 @@ declare namespace NodeJS { PROXY?: string EXTERNAL_URL: string LOCAL_URL: string - /** This is the subfolder where Botpress is located (ex: /botpress/). It is extracted from the external URL */ + /** This is the subfolder where TheGurúCompany Studio is located (ex: /TheGurúCompany Studio/). It is extracted from the external URL */ ROOT_PATH: string /** Path to the studio executable */ STUDIO_LOCATION: string - /** Either equal to studio location, or to the botpress source code file */ + /** Either equal to studio location, or to the TheGurúCompany Studio source code file */ PROJECT_LOCATION: string /** Location of the bots/, global/ and storage/ folders à */ DATA_LOCATION: string @@ -80,7 +80,7 @@ declare interface BotpressEnvironmentVariables { /** Change the BPFS storage mechanism ("database" or "disk"). Defaults to "disk" */ readonly BPFS_STORAGE?: 'database' | 'disk' - /** The URL exposed by Botpress to external users (eg: when displaying links) */ + /** The URL exposed by TheGurúCompany Studio to external users (eg: when displaying links) */ readonly EXTERNAL_URL?: string /** @@ -95,21 +95,21 @@ declare interface BotpressEnvironmentVariables { */ readonly DATABASE_URL?: string - /** When running botpress in production, some optimizations are applied */ + /** When running TheGurúCompany Studio in production, some optimizations are applied */ readonly BP_PRODUCTION?: boolean /** Enable cluster mode */ readonly CLUSTER_ENABLED?: boolean /** - * Set this to true if you're exposing Botpress through a reverse proxy such as Nginx + * Set this to true if you're exposing TheGurúCompany Studio through a reverse proxy such as Nginx * Can also be either an IP address or a hostname * Read more: https://expressjs.com/en/guide/behind-proxies.html */ readonly REVERSE_PROXY?: string /** Use this proxy connection string to access external services, like Duckling and Licensing - * This values overwrites the value defined in the global Botpress configuration + * This values overwrites the value defined in the global TheGurúCompany Studio configuration * @example http://username:password@hostname:port */ readonly BP_PROXY?: string @@ -136,7 +136,7 @@ declare interface BotpressEnvironmentVariables { readonly APP_DATA_PATH?: string /** - * Truthy if running the official Botpress docker image + * Truthy if running the official TheGurúCompany Studio docker image */ readonly BP_IS_DOCKER?: boolean @@ -147,7 +147,7 @@ declare interface BotpressEnvironmentVariables { readonly BP_MAX_MEMORY_CACHE_SIZE?: string /** - * When set to true, Botpress will not automatically restart on crash + * When set to true, TheGurúCompany Studio will not automatically restart on crash * @default false */ readonly BP_DISABLE_AUTO_RESTART?: boolean @@ -171,7 +171,7 @@ declare interface BotpressEnvironmentVariables { readonly BP_DISABLE_SERVER_DIAG?: boolean /** - * Prevents Botpress from closing cleanly when an error is encountered. + * Prevents TheGurúCompany Studio from closing cleanly when an error is encountered. * This only affects fatal errors, it will not affect business rules checks (eg: licensing) */ readonly BP_FAILSAFE?: boolean diff --git a/packages/studio-ui/src/web/components/App/index.tsx b/packages/studio-ui/src/web/components/App/index.tsx index c6e71385..d6e26a1a 100644 --- a/packages/studio-ui/src/web/components/App/index.tsx +++ b/packages/studio-ui/src/web/components/App/index.tsx @@ -45,7 +45,7 @@ class App extends Component { } componentDidMount() { - const appName = window.APP_NAME || 'Botpress Studio' + const appName = window.APP_NAME || 'TheGurúCompany Studio' const botName = window.BOT_NAME ? ` – ${window.BOT_NAME}` : '' window.document.title = `${appName}${botName}` diff --git a/packages/studio-ui/src/web/components/Content/Select/Widget.tsx b/packages/studio-ui/src/web/components/Content/Select/Widget.tsx index 342d7b69..b6c76f2d 100644 --- a/packages/studio-ui/src/web/components/Content/Select/Widget.tsx +++ b/packages/studio-ui/src/web/components/Content/Select/Widget.tsx @@ -163,5 +163,5 @@ const ConnectedContentPicker = connect( mapDispatchToProps )(withLanguage(ContentPickerWidget)) -// Passing store explicitly since this component may be imported from another botpress-module +// Passing store explicitly since this component may be imported from another TheGurúCompany Studio-module export default (props: OwnProps) => diff --git a/packages/studio-ui/src/web/components/Content/Select/index.tsx b/packages/studio-ui/src/web/components/Content/Select/index.tsx index a1763a47..96603ae5 100644 --- a/packages/studio-ui/src/web/components/Content/Select/index.tsx +++ b/packages/studio-ui/src/web/components/Content/Select/index.tsx @@ -290,11 +290,7 @@ class SelectContent extends Component {

To learn how to define content types,{' '} - + read the docs

diff --git a/packages/studio-ui/src/web/components/Injected/index.jsx b/packages/studio-ui/src/web/components/Injected/index.jsx index d6187f58..f276567e 100644 --- a/packages/studio-ui/src/web/components/Injected/index.jsx +++ b/packages/studio-ui/src/web/components/Injected/index.jsx @@ -28,7 +28,7 @@ export default class InjectedComponent extends Component { {/* TODO Put documentation / help here */}
- Developer? click here to see why this might happen + Developer? click here to see why this might happen
) diff --git a/packages/studio-ui/src/web/components/Layout/GuidedTour.tsx b/packages/studio-ui/src/web/components/Layout/GuidedTour.tsx index 957e1593..fa067d0d 100644 --- a/packages/studio-ui/src/web/components/Layout/GuidedTour.tsx +++ b/packages/studio-ui/src/web/components/Layout/GuidedTour.tsx @@ -4,7 +4,7 @@ import React from 'react' import Tour from 'reactour' import { trackEvent } from '~/util/InjectSegment' -// Change this key to display the tour the next time a user opens Botpress +// Change this key to display the tour the next time a user opens TheGurúCompany Studio const TOUR_KEY = 'guidedTour11_9_0' interface Props { @@ -41,7 +41,7 @@ export default class GuidedTour extends React.Component { const steps = [ { selector: '', - content: 'Welcome to Botpress! This is a quick tour of the most important features.' + content: 'Welcome to TheGurúCompany Studio! This is a quick tour of the most important features.' }, { selector: '#statusbar_tutorial', @@ -70,7 +70,7 @@ export default class GuidedTour extends React.Component { }, { selector: '', - content: 'All done. Enjoy building bots! For more information, please refer to the guides on botpress.com/docs' + content: 'All done. Enjoy building bots!' } ] diff --git a/packages/studio-ui/src/web/components/Layout/Sidebar.scss b/packages/studio-ui/src/web/components/Layout/Sidebar.scss index 37480e01..6564bb3f 100644 --- a/packages/studio-ui/src/web/components/Layout/Sidebar.scss +++ b/packages/studio-ui/src/web/components/Layout/Sidebar.scss @@ -1,3 +1,9 @@ +$primary: #8c00ff; +$secondary: #0aa0fa; +$complementary: #100146; +$gray: #f1f3fa; +$light-gray: #ffffff; + .link { cursor: pointer; } @@ -31,8 +37,8 @@ } .sidebar { - background-color: var(--shark); - color: var(--seashell); + background-color: $light-gray; + color: $complementary; height: 100%; position: relative; width: 40px; @@ -50,6 +56,10 @@ } } + svg { + color: $complementary; + } + ul { box-sizing: content-box !important; width: 100%; @@ -93,10 +103,16 @@ &:not(.active) { border-color: var(--gray); } + svg { + color: $primary; + } } &.active { - border-color: var(--ocean); + border-color: $primary; + svg { + color: $primary; + } } } } diff --git a/packages/studio-ui/src/web/components/Layout/StatusBar/ConfigStatus.tsx b/packages/studio-ui/src/web/components/Layout/StatusBar/ConfigStatus.tsx index d2e4ff6f..50dfcccc 100644 --- a/packages/studio-ui/src/web/components/Layout/StatusBar/ConfigStatus.tsx +++ b/packages/studio-ui/src/web/components/Layout/StatusBar/ConfigStatus.tsx @@ -74,7 +74,7 @@ const ConfigStatus = () => {
{!isRestarting ? (
- Changes were made to the main Botpress configuration file.
+ Changes were made to the main TheGurúCompany Studio configuration file.
It is recommended to restart the server so they can take effect.
) : ( diff --git a/packages/studio-ui/src/web/components/Layout/StatusBar/index.tsx b/packages/studio-ui/src/web/components/Layout/StatusBar/index.tsx index c99b2de8..6dc8101c 100644 --- a/packages/studio-ui/src/web/components/Layout/StatusBar/index.tsx +++ b/packages/studio-ui/src/web/components/Layout/StatusBar/index.tsx @@ -19,7 +19,6 @@ const StatusBar: FC = (props) => { return (