merlyn/frontend/src/utils/paths.js
Sean Hatfield 192ca411f2
Telegram bot connector (#5190)
* wip telegram bot connector

* encrypt bot token, reorg telegram bot modules, secure pairing codes

* offload telegram chat to background worker, add @agent support with chart png rendering, reconnect ui

* refactor telegram bot settings page into subcomponents

* response.locals for mum, telemetry for connecting to telegram

* simplify telegram command registration

* improve telegram bot ux: rework switch/history/resume commands

* add voice, photo, and TTS support to telegram bot with long message handling

* lint

* rename external_connectors to external_communication_connectors, add voice response mode, persist chat workspace/thread selection

* lint

* fix telegram bot connect/disconnect bugs, kill telegram bot on multiuser mode enable

* add english translations

* fix qr code in light mode

* repatch migration

* WIP checkpoint

* pipeline overhaul for using response obj

* format functions

* fix comment block

* remove conditional dumpENV + lint

* remove .end() from sendStatus calls

* patch broken streaming where streaming only first chunk

* refactor

* use Ephemeral handler now

* show metrics and citations in real GUI

* bugfixes

* prevent MuM persistence, UI cleanup, styling for status

* add new workspace flow in UI
Add thread chat count
fix 69 byte payload callback limit bug

* handle pagination for workspaces, threads, and models

* modularize commands and navigation

* add /proof support for citation recall

* handle backlog message spam

* support abort of response streams

* code cleanup

* spam prevention

* fix translations, update voice typing indicator, fix token bug

* frontend refactor, update tips on /status and voice response improvements

* collapse agent though blocks

* support images

* Fix mime issues with audio from other devices

* fix config issue post server stop

* persist image on agentic chats

* 5189 i18n (#5245)

* i18n translations
connect #5189

* prune translations

* fix errors

* fix translation gaps

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2026-03-23 15:10:21 -07:00

236 lines
6.1 KiB
JavaScript

import { API_BASE } from "./constants";
function applyOptions(path, options = {}) {
let updatedPath = path;
if (!options || Object.keys(options).length === 0) return updatedPath;
if (options.search) {
const searchParams = new URLSearchParams(options.search);
updatedPath += `?${searchParams.toString()}`;
}
return updatedPath;
}
export default {
home: () => {
return "/";
},
login: (noTry = false) => {
return `/login${noTry ? "?nt=1" : ""}`;
},
sso: {
login: () => {
return "/sso/simple";
},
},
onboarding: {
home: () => {
return "/onboarding";
},
survey: () => {
return "/onboarding/survey";
},
llmPreference: () => {
return "/onboarding/llm-preference";
},
embeddingPreference: () => {
return "/onboarding/embedding-preference";
},
vectorDatabase: () => {
return "/onboarding/vector-database";
},
userSetup: () => {
return "/onboarding/user-setup";
},
dataHandling: () => {
return "/onboarding/data-handling";
},
},
github: () => {
return "https://github.com/Mintplex-Labs/anything-llm";
},
discord: () => {
return "https://discord.com/invite/6UyHPeGZAC";
},
docs: () => {
return "https://docs.anythingllm.com";
},
chatModes: () => {
return "https://docs.anythingllm.com/features/chat-modes";
},
mailToMintplex: () => {
return "mailto:team@mintplexlabs.com";
},
hosting: () => {
return "https://my.mintplexlabs.com/aio-checkout?product=anythingllm";
},
workspace: {
chat: (slug, options = {}) => {
return applyOptions(`/workspace/${slug}`, options);
},
settings: {
generalAppearance: (slug) => {
return `/workspace/${slug}/settings/general-appearance`;
},
chatSettings: function (slug, options = {}) {
return applyOptions(
`/workspace/${slug}/settings/chat-settings`,
options
);
},
vectorDatabase: (slug) => {
return `/workspace/${slug}/settings/vector-database`;
},
members: (slug) => {
return `/workspace/${slug}/settings/members`;
},
agentConfig: (slug) => {
return `/workspace/${slug}/settings/agent-config`;
},
},
thread: (wsSlug, threadSlug) => {
return `/workspace/${wsSlug}/t/${threadSlug}`;
},
},
apiDocs: () => {
return `${API_BASE}/docs`;
},
settings: {
users: () => {
return `/settings/users`;
},
invites: () => {
return `/settings/invites`;
},
workspaces: () => {
return `/settings/workspaces`;
},
chats: () => {
return "/settings/workspace-chats";
},
llmPreference: () => {
return "/settings/llm-preference";
},
transcriptionPreference: () => {
return "/settings/transcription-preference";
},
audioPreference: () => {
return "/settings/audio-preference";
},
defaultSystemPrompt: () => {
return "/settings/default-system-prompt";
},
embedder: {
modelPreference: () => "/settings/embedding-preference",
chunkingPreference: () => "/settings/text-splitter-preference",
},
embeddingPreference: () => {
return "/settings/embedding-preference";
},
vectorDatabase: () => {
return "/settings/vector-database";
},
security: () => {
return "/settings/security";
},
interface: () => {
return "/settings/interface";
},
branding: () => {
return "/settings/branding";
},
agentSkills: () => {
return "/settings/agents";
},
chat: () => {
return "/settings/chat";
},
apiKeys: () => {
return "/settings/api-keys";
},
systemPromptVariables: () => "/settings/system-prompt-variables",
logs: () => {
return "/settings/event-logs";
},
privacy: () => {
return "/settings/privacy";
},
embedChatWidgets: () => {
return `/settings/embed-chat-widgets`;
},
browserExtension: () => {
return `/settings/browser-extension`;
},
mobile: () => {
return `/settings/mobile-connections`;
},
experimental: () => {
return `/settings/beta-features`;
},
mobileConnections: () => {
return `/settings/mobile-connections`;
},
telegram: () => {
return `/settings/external-connections/telegram`;
},
},
agents: {
builder: () => {
return `/settings/agents/builder`;
},
editAgent: (uuid) => {
return `/settings/agents/builder/${uuid}`;
},
},
communityHub: {
website: () => {
return import.meta.env.DEV
? `http://localhost:5173`
: `https://hub.anythingllm.com`;
},
/**
* View more items of a given type on the community hub.
* @param {string} type - The type of items to view more of. Should be kebab-case.
* @returns {string} The path to view more items of the given type.
*/
viewMoreOfType: function (type) {
return `${this.website()}/list/${type}`;
},
viewItem: function (type, id) {
return `${this.website()}/i/${type}/${id}`;
},
trending: () => {
return `/settings/community-hub/trending`;
},
authentication: () => {
return `/settings/community-hub/authentication`;
},
importItem: (importItemId) => {
return `/settings/community-hub/import-item${importItemId ? `?id=${importItemId}` : ""}`;
},
profile: function (username) {
if (username) return `${this.website()}/u/${username}`;
return `${this.website()}/me`;
},
noPrivateItems: () => {
return "https://docs.anythingllm.com/community-hub/faq#no-private-items";
},
},
// TODO: Migrate all docs.anythingllm.com links to the new docs.
documentation: {
mobileIntroduction: () => {
return "https://docs.anythingllm.com/mobile/overview";
},
contextWindows: () => {
return "https://docs.anythingllm.com/chatting-with-documents/introduction#you-exceed-the-context-window---what-now";
},
},
experimental: {
liveDocumentSync: {
manage: () => `/settings/beta-features/live-document-sync/manage`,
},
},
};