totem-llm 0.13.0 → 0.13.2
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/package.json +1 -1
- package/server/.env +16 -487
- package/server/public/assets/{index-eeddac0e.js → index-cc73e159.js} +1 -1
- package/server/public/assets/{index-362a6966.js → index-f2c6653e.js} +1 -1
- package/server/public/assets/{index-44382a03.js → index-fd99e568.js} +1 -1
- package/server/public/index.js +2 -2
- package/server/utils/AiProviders/openRouter/index.js +23 -0
- package/server/utils/telegramBot/chat/agent.js +3 -4
package/package.json
CHANGED
package/server/.env
CHANGED
|
@@ -1,490 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
JWT_SECRET="my-random-string-for-seeding" # Please generate random string at least 12 chars long.
|
|
4
|
-
# JWT_EXPIRY="30d" # (optional) https://docs.anythingllm.com/configuration#custom-ttl-for-sessions
|
|
5
|
-
SIG_KEY='passphrase' # Please generate random string at least 32 chars long.
|
|
6
|
-
SIG_SALT='salt' # Please generate random string at least 32 chars long.
|
|
7
|
-
STORAGE_DIR=./storage # absolute filesystem path with no trailing slash. This is where all data including vector db and file uploads will be stored. Must be writable by the server process.
|
|
8
|
-
|
|
9
|
-
###########################################
|
|
10
|
-
######## LLM API SElECTION ################
|
|
11
|
-
###########################################
|
|
12
|
-
# LLM_PROVIDER='openai'
|
|
13
|
-
# OPEN_AI_KEY=
|
|
14
|
-
# OPEN_MODEL_PREF='gpt-4o'
|
|
15
|
-
|
|
16
|
-
# LLM_PROVIDER='gemini'
|
|
17
|
-
# GEMINI_API_KEY=
|
|
18
|
-
# GEMINI_LLM_MODEL_PREF='gemini-2.0-flash-lite'
|
|
19
|
-
|
|
20
|
-
# LLM_PROVIDER='azure'
|
|
21
|
-
# AZURE_OPENAI_ENDPOINT=
|
|
22
|
-
# AZURE_OPENAI_KEY=
|
|
23
|
-
# AZURE_OPENAI_MODEL_PREF='my-gpt35-deployment' # This is the "deployment" on Azure you want to use. Not the base model.
|
|
24
|
-
# EMBEDDING_MODEL_PREF='embedder-model' # This is the "deployment" on Azure you want to use for embeddings. Not the base model. Valid base model is text-embedding-ada-002
|
|
25
|
-
|
|
26
|
-
# LLM_PROVIDER='anthropic'
|
|
27
|
-
# ANTHROPIC_API_KEY=sk-ant-xxxx
|
|
28
|
-
# ANTHROPIC_MODEL_PREF='claude-sonnet-4-6'
|
|
29
|
-
# ANTHROPIC_CACHE_CONTROL="5m" # Enable prompt caching (5m=5min cache, 1h=1hour cache). Reduces costs and improves speed by caching system prompts.
|
|
30
|
-
|
|
31
|
-
# LLM_PROVIDER='lmstudio'
|
|
32
|
-
# LMSTUDIO_BASE_PATH='http://your-server:1234/v1'
|
|
33
|
-
# LMSTUDIO_MODEL_PREF='Loaded from Chat UI' # this is a bug in LMStudio 0.2.17
|
|
34
|
-
# LMSTUDIO_MODEL_TOKEN_LIMIT=4096
|
|
35
|
-
# LMSTUDIO_AUTH_TOKEN='your-lmstudio-auth-token-here'
|
|
36
|
-
|
|
37
|
-
# LLM_PROVIDER='localai'
|
|
38
|
-
# LOCAL_AI_BASE_PATH='http://localhost:8080/v1'
|
|
39
|
-
# LOCAL_AI_MODEL_PREF='luna-ai-llama2'
|
|
40
|
-
# LOCAL_AI_MODEL_TOKEN_LIMIT=4096
|
|
41
|
-
# LOCAL_AI_API_KEY="sk-123abc"
|
|
42
|
-
|
|
43
|
-
LLM_PROVIDER='ollama'
|
|
1
|
+
# Auto-dump ENV from system call on 22:15:04 GMT-0400 (Eastern Daylight Time)
|
|
2
|
+
LLM_PROVIDER='openrouter'
|
|
44
3
|
OLLAMA_BASE_PATH='http://127.0.0.1:11434'
|
|
45
4
|
OLLAMA_MODEL_PREF='qwen3.5:2b'
|
|
46
|
-
OLLAMA_MODEL_TOKEN_LIMIT=4096
|
|
5
|
+
OLLAMA_MODEL_TOKEN_LIMIT='4096'
|
|
47
6
|
OLLAMA_AUTH_TOKEN='your-ollama-auth-token-here (optional, only for ollama running behind auth - Bearer token)'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# LLM_PROVIDER='deepseek'
|
|
63
|
-
# DEEPSEEK_API_KEY=YOUR_API_KEY
|
|
64
|
-
# DEEPSEEK_MODEL_PREF='deepseek-chat'
|
|
65
|
-
|
|
66
|
-
LLM_PROVIDER='openrouter'
|
|
67
|
-
OPENROUTER_API_KEY='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'
|
|
68
|
-
OPENROUTER_MODEL_PREF='openrouter/auto'
|
|
69
|
-
|
|
70
|
-
# LLM_PROVIDER='mistral'
|
|
71
|
-
# MISTRAL_API_KEY='example-mistral-ai-api-key'
|
|
72
|
-
# MISTRAL_MODEL_PREF='mistral-tiny'
|
|
73
|
-
|
|
74
|
-
# LLM_PROVIDER='huggingface'
|
|
75
|
-
# HUGGING_FACE_LLM_ENDPOINT=https://uuid-here.us-east-1.aws.endpoints.huggingface.cloud
|
|
76
|
-
# HUGGING_FACE_LLM_API_KEY=hf_xxxxxx
|
|
77
|
-
# HUGGING_FACE_LLM_TOKEN_LIMIT=8000
|
|
78
|
-
|
|
79
|
-
# LLM_PROVIDER='groq'
|
|
80
|
-
# GROQ_API_KEY=gsk_abcxyz
|
|
81
|
-
# GROQ_MODEL_PREF=llama3-8b-8192
|
|
82
|
-
|
|
83
|
-
# LLM_PROVIDER='koboldcpp'
|
|
84
|
-
# KOBOLD_CPP_BASE_PATH='http://127.0.0.1:5000/v1'
|
|
85
|
-
# KOBOLD_CPP_MODEL_PREF='koboldcpp/codellama-7b-instruct.Q4_K_S'
|
|
86
|
-
# KOBOLD_CPP_MODEL_TOKEN_LIMIT=4096
|
|
87
|
-
# KOBOLD_CPP_MAX_TOKENS=2048
|
|
88
|
-
|
|
89
|
-
# LLM_PROVIDER='textgenwebui'
|
|
90
|
-
# TEXT_GEN_WEB_UI_BASE_PATH='http://127.0.0.1:5000/v1'
|
|
91
|
-
# TEXT_GEN_WEB_UI_TOKEN_LIMIT=4096
|
|
92
|
-
# TEXT_GEN_WEB_UI_API_KEY='sk-123abc'
|
|
93
|
-
|
|
94
|
-
# LLM_PROVIDER='generic-openai'
|
|
95
|
-
# GENERIC_OPEN_AI_BASE_PATH='http://proxy.url.openai.com/v1'
|
|
96
|
-
# GENERIC_OPEN_AI_MODEL_PREF='gpt-3.5-turbo'
|
|
97
|
-
# GENERIC_OPEN_AI_MODEL_TOKEN_LIMIT=4096
|
|
98
|
-
# GENERIC_OPEN_AI_API_KEY=sk-123abc
|
|
99
|
-
# GENERIC_OPEN_AI_CUSTOM_HEADERS="X-Custom-Auth:my-secret-key,X-Custom-Header:my-value" (useful if using a proxy that requires authentication or other headers)
|
|
100
|
-
|
|
101
|
-
# LLM_PROVIDER='litellm'
|
|
102
|
-
# LITE_LLM_MODEL_PREF='gpt-3.5-turbo'
|
|
103
|
-
# LITE_LLM_MODEL_TOKEN_LIMIT=4096
|
|
104
|
-
# LITE_LLM_BASE_PATH='http://127.0.0.1:4000'
|
|
105
|
-
# LITE_LLM_API_KEY='sk-123abc'
|
|
106
|
-
|
|
107
|
-
# LLM_PROVIDER='novita'
|
|
108
|
-
# NOVITA_LLM_API_KEY='your-novita-api-key-here' check on https://novita.ai/settings#key-management
|
|
109
|
-
# NOVITA_LLM_MODEL_PREF='deepseek/deepseek-r1'
|
|
110
|
-
|
|
111
|
-
# LLM_PROVIDER='cohere'
|
|
112
|
-
# COHERE_API_KEY=
|
|
113
|
-
# COHERE_MODEL_PREF='command-r'
|
|
114
|
-
|
|
115
|
-
# LLM_PROVIDER='cometapi'
|
|
116
|
-
# COMETAPI_LLM_API_KEY='your-cometapi-key-here' # Get one at https://api.cometapi.com/console/token
|
|
117
|
-
# COMETAPI_LLM_MODEL_PREF='gpt-5-mini'
|
|
118
|
-
# COMETAPI_LLM_TIMEOUT_MS=500 # Optional; stream idle timeout in ms (min 500ms)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
# LLM_PROVIDER='bedrock'
|
|
122
|
-
# AWS_BEDROCK_LLM_ACCESS_KEY_ID=
|
|
123
|
-
# AWS_BEDROCK_LLM_ACCESS_KEY=
|
|
124
|
-
# AWS_BEDROCK_LLM_REGION=us-west-2
|
|
125
|
-
# AWS_BEDROCK_LLM_MODEL_PREFERENCE=meta.llama3-1-8b-instruct-v1:0
|
|
126
|
-
# AWS_BEDROCK_LLM_MODEL_TOKEN_LIMIT=8191
|
|
127
|
-
# AWS_BEDROCK_LLM_CONNECTION_METHOD=iam
|
|
128
|
-
# AWS_BEDROCK_LLM_MAX_OUTPUT_TOKENS=4096
|
|
129
|
-
# AWS_BEDROCK_LLM_SESSION_TOKEN= # Only required if CONNECTION_METHOD is 'sessionToken'
|
|
130
|
-
# or even use Short and Long Term API keys
|
|
131
|
-
# AWS_BEDROCK_LLM_CONNECTION_METHOD="apiKey"
|
|
132
|
-
# AWS_BEDROCK_LLM_API_KEY=
|
|
133
|
-
|
|
134
|
-
# LLM_PROVIDER='apipie'
|
|
135
|
-
# APIPIE_LLM_API_KEY='sk-123abc'
|
|
136
|
-
# APIPIE_LLM_MODEL_PREF='openrouter/llama-3.1-8b-instruct'
|
|
137
|
-
|
|
138
|
-
# LLM_PROVIDER='xai'
|
|
139
|
-
# XAI_LLM_API_KEY='xai-your-api-key-here'
|
|
140
|
-
# XAI_LLM_MODEL_PREF='grok-beta'
|
|
141
|
-
|
|
142
|
-
# LLM_PROVIDER='zai'
|
|
143
|
-
# ZAI_API_KEY="your-zai-api-key-here"
|
|
144
|
-
# ZAI_MODEL_PREF="glm-4.5"
|
|
145
|
-
|
|
146
|
-
# LLM_PROVIDER='nvidia-nim'
|
|
147
|
-
# NVIDIA_NIM_LLM_BASE_PATH='http://127.0.0.1:8000'
|
|
148
|
-
# NVIDIA_NIM_LLM_MODEL_PREF='meta/llama-3.2-3b-instruct'
|
|
149
|
-
|
|
150
|
-
# LLM_PROVIDER='ppio'
|
|
151
|
-
# PPIO_API_KEY='your-ppio-api-key-here'
|
|
152
|
-
# PPIO_MODEL_PREF='deepseek/deepseek-v3/community'
|
|
153
|
-
|
|
154
|
-
# LLM_PROVIDER='moonshotai'
|
|
155
|
-
# MOONSHOT_AI_API_KEY='your-moonshot-api-key-here'
|
|
156
|
-
# MOONSHOT_AI_MODEL_PREF='moonshot-v1-32k'
|
|
157
|
-
|
|
158
|
-
# LLM_PROVIDER='foundry'
|
|
159
|
-
# FOUNDRY_BASE_PATH='http://127.0.0.1:55776'
|
|
160
|
-
# FOUNDRY_MODEL_PREF='phi-3.5-mini'
|
|
161
|
-
# FOUNDRY_MODEL_TOKEN_LIMIT=4096
|
|
162
|
-
|
|
163
|
-
# LLM_PROVIDER='giteeai'
|
|
164
|
-
# GITEE_AI_API_KEY=
|
|
165
|
-
# GITEE_AI_MODEL_PREF=
|
|
166
|
-
# GITEE_AI_MODEL_TOKEN_LIMIT=
|
|
167
|
-
|
|
168
|
-
# LLM_PROVIDER='docker-model-runner'
|
|
169
|
-
# DOCKER_MODEL_RUNNER_BASE_PATH='http://127.0.0.1:12434'
|
|
170
|
-
# DOCKER_MODEL_RUNNER_LLM_MODEL_PREF='phi-3.5-mini'
|
|
171
|
-
# DOCKER_MODEL_RUNNER_LLM_MODEL_TOKEN_LIMIT=4096
|
|
172
|
-
|
|
173
|
-
# LLM_PROVIDER='privatemode'
|
|
174
|
-
# PRIVATEMODE_LLM_BASE_PATH='http://127.0.0.1:8080'
|
|
175
|
-
# PRIVATEMODE_LLM_MODEL_PREF='gemma-3-27b'
|
|
176
|
-
|
|
177
|
-
# LLM_PROVIDER='sambanova'
|
|
178
|
-
# SAMBANOVA_LLM_API_KEY='xxx-xxx-xxx'
|
|
179
|
-
# SAMBANOVA_LLM_MODEL_PREF='gpt-oss-120b'
|
|
180
|
-
|
|
181
|
-
# LLM_PROVIDER='lemonade'
|
|
182
|
-
# LEMONADE_LLM_BASE_PATH='http://127.0.0.1:8000'
|
|
183
|
-
# LEMONADE_LLM_MODEL_PREF='Llama-3.2-1B-Instruct-GGUF'
|
|
184
|
-
# LEMONADE_LLM_MODEL_TOKEN_LIMIT=8192
|
|
185
|
-
# LEMONADE_LLM_API_KEY=
|
|
186
|
-
|
|
187
|
-
# LLM_PROVIDER='minimax'
|
|
188
|
-
# MINIMAX_API_KEY='sk-cp-...'
|
|
189
|
-
# MINIMAX_MODEL_PREF='MiniMax-M2.7'
|
|
190
|
-
|
|
191
|
-
# LLM_PROVIDER='anythingllm-router'
|
|
192
|
-
# MODEL_ROUTER_ID=1
|
|
193
|
-
|
|
194
|
-
###########################################
|
|
195
|
-
######## Embedding API SElECTION ##########
|
|
196
|
-
###########################################
|
|
197
|
-
# This will be the assumed default embedding seleciton and model
|
|
198
|
-
# EMBEDDING_ENGINE='native'
|
|
199
|
-
# EMBEDDING_MODEL_PREF='Xenova/all-MiniLM-L6-v2'
|
|
200
|
-
|
|
201
|
-
# Only used if you are using an LLM that does not natively support embedding (openai or Azure)
|
|
202
|
-
# EMBEDDING_ENGINE='openai'
|
|
203
|
-
# OPEN_AI_KEY=sk-xxxx
|
|
204
|
-
# EMBEDDING_MODEL_PREF='text-embedding-ada-002'
|
|
205
|
-
|
|
206
|
-
# EMBEDDING_ENGINE='azure'
|
|
207
|
-
# AZURE_OPENAI_ENDPOINT=
|
|
208
|
-
# AZURE_OPENAI_KEY=
|
|
209
|
-
# EMBEDDING_MODEL_PREF='my-embedder-model' # This is the "deployment" on Azure you want to use for embeddings. Not the base model. Valid base model is text-embedding-ada-002
|
|
210
|
-
|
|
211
|
-
# EMBEDDING_ENGINE='localai'
|
|
212
|
-
# EMBEDDING_BASE_PATH='http://localhost:8080/v1'
|
|
213
|
-
# EMBEDDING_MODEL_PREF='text-embedding-ada-002'
|
|
214
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=1000 # The max chunk size in chars a string to embed can be
|
|
215
|
-
|
|
216
|
-
# EMBEDDING_ENGINE='ollama'
|
|
217
|
-
# EMBEDDING_BASE_PATH='http://127.0.0.1:11434'
|
|
218
|
-
# EMBEDDING_MODEL_PREF='nomic-embed-text:latest'
|
|
219
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
220
|
-
|
|
221
|
-
# EMBEDDING_ENGINE='lmstudio'
|
|
222
|
-
# EMBEDDING_BASE_PATH='https://localhost:1234/v1'
|
|
223
|
-
# EMBEDDING_MODEL_PREF='nomic-ai/nomic-embed-text-v1.5-GGUF/nomic-embed-text-v1.5.Q4_0.gguf'
|
|
224
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
225
|
-
|
|
226
|
-
# EMBEDDING_ENGINE='cohere'
|
|
227
|
-
# COHERE_API_KEY=
|
|
228
|
-
# EMBEDDING_MODEL_PREF='embed-english-v3.0'
|
|
229
|
-
|
|
230
|
-
# EMBEDDING_ENGINE='voyageai'
|
|
231
|
-
# VOYAGEAI_API_KEY=
|
|
232
|
-
# EMBEDDING_MODEL_PREF='voyage-large-2-instruct'
|
|
233
|
-
|
|
234
|
-
# EMBEDDING_ENGINE='litellm'
|
|
235
|
-
# EMBEDDING_MODEL_PREF='text-embedding-ada-002'
|
|
236
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
237
|
-
# LITE_LLM_BASE_PATH='http://127.0.0.1:4000'
|
|
238
|
-
# LITE_LLM_API_KEY='sk-123abc'
|
|
239
|
-
|
|
240
|
-
# EMBEDDING_ENGINE='generic-openai'
|
|
241
|
-
# EMBEDDING_MODEL_PREF='text-embedding-ada-002'
|
|
242
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
243
|
-
# EMBEDDING_BASE_PATH='http://127.0.0.1:4000'
|
|
244
|
-
# GENERIC_OPEN_AI_EMBEDDING_API_KEY='sk-123abc'
|
|
245
|
-
# GENERIC_OPEN_AI_EMBEDDING_MAX_CONCURRENT_CHUNKS=500
|
|
246
|
-
# GENERIC_OPEN_AI_EMBEDDING_API_DELAY_MS=1000
|
|
247
|
-
|
|
248
|
-
# EMBEDDING_ENGINE='gemini'
|
|
249
|
-
# GEMINI_EMBEDDING_API_KEY=
|
|
250
|
-
# EMBEDDING_MODEL_PREF='text-embedding-004'
|
|
251
|
-
|
|
252
|
-
# EMBEDDING_ENGINE='openrouter'
|
|
253
|
-
# EMBEDDING_MODEL_PREF='baai/bge-m3'
|
|
254
|
-
# OPENROUTER_API_KEY=''
|
|
255
|
-
|
|
256
|
-
# EMBEDDING_ENGINE='lemonade'
|
|
257
|
-
# EMBEDDING_BASE_PATH='http://127.0.0.1:8000'
|
|
258
|
-
# EMBEDDING_MODEL_PREF='Qwen3-embedder'
|
|
259
|
-
# EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
|
|
260
|
-
|
|
261
|
-
###########################################
|
|
262
|
-
######## Vector Database Selection ########
|
|
263
|
-
###########################################
|
|
264
|
-
# Enable all below if you are using vector database: Chroma.
|
|
265
|
-
# VECTOR_DB="chroma"
|
|
266
|
-
# CHROMA_ENDPOINT='http://localhost:8000'
|
|
267
|
-
# CHROMA_API_HEADER="X-Api-Key"
|
|
268
|
-
# CHROMA_API_KEY="sk-123abc"
|
|
269
|
-
|
|
270
|
-
# Enable all below if you are using vector database: Chroma Cloud.
|
|
271
|
-
# VECTOR_DB="chromacloud"
|
|
272
|
-
# CHROMACLOUD_API_KEY="ck-your-api-key"
|
|
273
|
-
# CHROMACLOUD_TENANT=
|
|
274
|
-
# CHROMACLOUD_DATABASE=
|
|
275
|
-
|
|
276
|
-
# Enable all below if you are using vector database: Pinecone.
|
|
277
|
-
# VECTOR_DB="pinecone"
|
|
278
|
-
# PINECONE_API_KEY=
|
|
279
|
-
# PINECONE_INDEX=
|
|
280
|
-
|
|
281
|
-
# Enable all below if you are using vector database: Astra DB.
|
|
282
|
-
# VECTOR_DB="astra"
|
|
283
|
-
# ASTRA_DB_APPLICATION_TOKEN=
|
|
284
|
-
# ASTRA_DB_ENDPOINT=
|
|
285
|
-
|
|
286
|
-
# Enable all below if you are using vector database: LanceDB.
|
|
287
|
-
VECTOR_DB="lancedb"
|
|
288
|
-
|
|
289
|
-
# Enable all below if you are using vector database: PG Vector.
|
|
290
|
-
# VECTOR_DB="pgvector"
|
|
291
|
-
# PGVECTOR_CONNECTION_STRING="postgresql://dbuser:dbuserpass@localhost:5432/yourdb"
|
|
292
|
-
# PGVECTOR_TABLE_NAME="anythingllm_vectors" # optional, but can be defined
|
|
293
|
-
|
|
294
|
-
# Enable all below if you are using vector database: Weaviate.
|
|
295
|
-
# VECTOR_DB="weaviate"
|
|
296
|
-
# WEAVIATE_ENDPOINT="http://localhost:8080"
|
|
297
|
-
# WEAVIATE_API_KEY=
|
|
298
|
-
|
|
299
|
-
# Enable all below if you are using vector database: Qdrant.
|
|
300
|
-
# VECTOR_DB="qdrant"
|
|
301
|
-
# QDRANT_ENDPOINT="http://localhost:6333"
|
|
302
|
-
# QDRANT_API_KEY=
|
|
303
|
-
|
|
304
|
-
# Enable all below if you are using vector database: Milvus.
|
|
305
|
-
# VECTOR_DB="milvus"
|
|
306
|
-
# MILVUS_ADDRESS="http://localhost:19530"
|
|
307
|
-
# MILVUS_USERNAME=
|
|
308
|
-
# MILVUS_PASSWORD=
|
|
309
|
-
|
|
310
|
-
# Enable all below if you are using vector database: Zilliz Cloud.
|
|
311
|
-
# VECTOR_DB="zilliz"
|
|
312
|
-
# ZILLIZ_ENDPOINT="https://sample.api.gcp-us-west1.zillizcloud.com"
|
|
313
|
-
# ZILLIZ_API_TOKEN=api-token-here
|
|
314
|
-
|
|
315
|
-
###########################################
|
|
316
|
-
######## Audio Model Selection ############
|
|
317
|
-
###########################################
|
|
318
|
-
# (default) use built-in whisper-small model.
|
|
319
|
-
WHISPER_PROVIDER="local"
|
|
320
|
-
|
|
321
|
-
# use openai hosted whisper model.
|
|
322
|
-
# WHISPER_PROVIDER="openai"
|
|
323
|
-
# OPEN_AI_KEY=sk-xxxxxxxx
|
|
324
|
-
|
|
325
|
-
###########################################
|
|
326
|
-
######## TTS/STT Model Selection ##########
|
|
327
|
-
###########################################
|
|
328
|
-
TTS_PROVIDER="native"
|
|
329
|
-
|
|
330
|
-
# TTS_PROVIDER="openai"
|
|
331
|
-
# TTS_OPEN_AI_KEY=sk-example
|
|
332
|
-
# TTS_OPEN_AI_VOICE_MODEL=nova
|
|
333
|
-
|
|
334
|
-
# TTS_PROVIDER="elevenlabs"
|
|
335
|
-
# TTS_ELEVEN_LABS_KEY=
|
|
336
|
-
# TTS_ELEVEN_LABS_VOICE_MODEL=21m00Tcm4TlvDq8ikWAM # Rachel
|
|
337
|
-
|
|
338
|
-
# TTS_PROVIDER="generic-openai"
|
|
339
|
-
# TTS_OPEN_AI_COMPATIBLE_KEY=sk-example
|
|
340
|
-
# TTS_OPEN_AI_COMPATIBLE_MODEL=tts-1
|
|
341
|
-
# TTS_OPEN_AI_COMPATIBLE_VOICE_MODEL=nova
|
|
342
|
-
# TTS_OPEN_AI_COMPATIBLE_ENDPOINT="https://api.openai.com/v1"
|
|
343
|
-
|
|
344
|
-
# CLOUD DEPLOYMENT VARIRABLES ONLY
|
|
345
|
-
# AUTH_TOKEN="hunter2" # This is the password to your application if remote hosting.
|
|
346
|
-
# STORAGE_DIR= # absolute filesystem path with no trailing slash
|
|
347
|
-
|
|
348
|
-
###########################################
|
|
349
|
-
######## PASSWORD COMPLEXITY ##############
|
|
350
|
-
###########################################
|
|
351
|
-
# Enforce a password schema for your organization users.
|
|
352
|
-
# Documentation on how to use https://github.com/kamronbatman/joi-password-complexity
|
|
353
|
-
#PASSWORDMINCHAR=8
|
|
354
|
-
#PASSWORDMAXCHAR=250
|
|
355
|
-
#PASSWORDLOWERCASE=1
|
|
356
|
-
#PASSWORDUPPERCASE=1
|
|
357
|
-
#PASSWORDNUMERIC=1
|
|
358
|
-
#PASSWORDSYMBOL=1
|
|
359
|
-
#PASSWORDREQUIREMENTS=4
|
|
360
|
-
|
|
361
|
-
###########################################
|
|
362
|
-
######## ENABLE HTTPS SERVER ##############
|
|
363
|
-
###########################################
|
|
364
|
-
# By enabling this and providing the path/filename for the key and cert,
|
|
365
|
-
# the server will use HTTPS instead of HTTP.
|
|
366
|
-
#ENABLE_HTTPS="true"
|
|
367
|
-
#HTTPS_CERT_PATH="sslcert/cert.pem"
|
|
368
|
-
#HTTPS_KEY_PATH="sslcert/key.pem"
|
|
369
|
-
|
|
370
|
-
###########################################
|
|
371
|
-
######## AGENT SERVICE KEYS ###############
|
|
372
|
-
###########################################
|
|
373
|
-
|
|
374
|
-
#------ SEARCH ENGINES -------
|
|
375
|
-
#=============================
|
|
376
|
-
#------ Google Search -------- https://programmablesearchengine.google.com/controlpanel/create
|
|
377
|
-
# AGENT_GSE_KEY=
|
|
378
|
-
# AGENT_GSE_CTX=
|
|
379
|
-
|
|
380
|
-
#------ SerpApi ----------- https://serpapi.com/
|
|
381
|
-
# AGENT_SERPAPI_API_KEY=
|
|
382
|
-
# AGENT_SERPAPI_ENGINE=google
|
|
383
|
-
|
|
384
|
-
#------ SearchApi.io ----------- https://www.searchapi.io/
|
|
385
|
-
# AGENT_SEARCHAPI_API_KEY=
|
|
386
|
-
# AGENT_SEARCHAPI_ENGINE=google
|
|
387
|
-
|
|
388
|
-
#------ Serper.dev ----------- https://serper.dev/
|
|
389
|
-
# AGENT_SERPER_DEV_KEY=
|
|
390
|
-
|
|
391
|
-
#------ Bing Search ----------- https://portal.azure.com/
|
|
392
|
-
# AGENT_BING_SEARCH_API_KEY=
|
|
393
|
-
|
|
394
|
-
#------ Baidu Search ----------- https://cloud.baidu.com/doc/qianfan-api/s/Wmbq4z7e5
|
|
395
|
-
# AGENT_BAIDU_SEARCH_API_KEY=
|
|
396
|
-
|
|
397
|
-
#------ Serply.io ----------- https://serply.io/
|
|
398
|
-
# AGENT_SERPLY_API_KEY=
|
|
399
|
-
|
|
400
|
-
#------ SearXNG ----------- https://github.com/searxng/searxng
|
|
401
|
-
# AGENT_SEARXNG_API_URL=
|
|
402
|
-
|
|
403
|
-
#------ Tavily ----------- https://www.tavily.com/
|
|
404
|
-
# AGENT_TAVILY_API_KEY=
|
|
405
|
-
|
|
406
|
-
#------ Exa Search ----------- https://www.exa.ai/
|
|
407
|
-
# AGENT_EXA_API_KEY=
|
|
408
|
-
|
|
409
|
-
#------ Perplexity Search ----------- [https://console.perplexity.ai](https://console.perplexity.ai)
|
|
410
|
-
# AGENT_PERPLEXITY_API_KEY=
|
|
411
|
-
|
|
412
|
-
###########################################
|
|
413
|
-
######## Other Configurations ############
|
|
414
|
-
###########################################
|
|
415
|
-
|
|
416
|
-
# Disable viewing chat history from the UI and frontend APIs.
|
|
417
|
-
# See https://docs.anythingllm.com/configuration#disable-view-chat-history for more information.
|
|
418
|
-
# DISABLE_VIEW_CHAT_HISTORY=1
|
|
419
|
-
|
|
420
|
-
# Disable workspace deletion from the UI and APIs when this ENV is present with any value.
|
|
421
|
-
# WORKSPACE_DELETION_PROTECTION=1
|
|
422
|
-
|
|
423
|
-
# Enable simple SSO passthrough to pre-authenticate users from a third party service.
|
|
424
|
-
# See https://docs.anythingllm.com/configuration#simple-sso-passthrough for more information.
|
|
425
|
-
# SIMPLE_SSO_ENABLED=1
|
|
426
|
-
# SIMPLE_SSO_NO_LOGIN=1
|
|
427
|
-
# SIMPLE_SSO_NO_LOGIN_REDIRECT=https://your-custom-login-url.com (optional)
|
|
428
|
-
|
|
429
|
-
# Allow scraping of any IP address in collector - must be string "true" to be enabled
|
|
430
|
-
# See https://docs.anythingllm.com/configuration#local-ip-address-scraping for more information.
|
|
431
|
-
# COLLECTOR_ALLOW_ANY_IP="true"
|
|
432
|
-
|
|
433
|
-
# Port the collector listens on. Must match the collector process when running services separately.
|
|
434
|
-
# COLLECTOR_PORT=8888
|
|
435
|
-
|
|
436
|
-
# Specify the target languages for when using OCR to parse images and PDFs.
|
|
437
|
-
# This is a comma separated list of language codes as a string. Unsupported languages will be ignored.
|
|
438
|
-
# Default is English. See https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html for a list of valid language codes.
|
|
439
|
-
# TARGET_OCR_LANG=eng,deu,ita,spa,fra,por,rus,nld,tur,hun,pol,ita,spa,fra,por,rus,nld,tur,hun,pol
|
|
440
|
-
|
|
441
|
-
# Runtime flags for built-in pupeeteer Chromium instance
|
|
442
|
-
# This is only required on Linux machines running AnythingLLM via Docker
|
|
443
|
-
# and do not want to use the --cap-add=SYS_ADMIN docker argument
|
|
444
|
-
# ANYTHINGLLM_CHROMIUM_ARGS="--no-sandbox,--disable-setuid-sandbox"
|
|
445
|
-
|
|
446
|
-
# This enables HTTP request/response logging in development. Set value to a truthy string to enable, leave empty value or comment out to disable.
|
|
447
|
-
# ENABLE_HTTP_LOGGER=""
|
|
448
|
-
# This enables timestamps for the HTTP Logger. Set value to a truthy string to enable, leave empty value or comment out to disable.
|
|
449
|
-
# ENABLE_HTTP_LOGGER_TIMESTAMPS=""
|
|
450
|
-
|
|
451
|
-
# Disable Swagger API documentation endpoint.
|
|
452
|
-
# Set to "true" to disable the /api/docs endpoint (recommended for production deployments).
|
|
453
|
-
# DISABLE_SWAGGER_DOCS="true"
|
|
454
|
-
|
|
455
|
-
# Disable MCP cooldown timer for agent calls
|
|
456
|
-
# this can lead to infinite recursive calls of the same function
|
|
457
|
-
# for some model/provider combinations
|
|
458
|
-
# MCP_NO_COOLDOWN="true
|
|
459
|
-
|
|
460
|
-
# Allow native tool calling for specific providers.
|
|
461
|
-
# This can VASTLY improve performance and speed of agent calls.
|
|
462
|
-
# Check code for supported providers who can be enabled here via this flag
|
|
463
|
-
# PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING="generic-openai,bedrock,localai,groq,litellm,openrouter"
|
|
464
|
-
|
|
465
|
-
# (optional) Maximum number of tools an agent can chain for a single response.
|
|
466
|
-
# This prevents some lower-end models from infinite recursive tool calls.
|
|
467
|
-
# AGENT_MAX_TOOL_CALLS=10
|
|
468
|
-
|
|
469
|
-
# Enable agent tool reranking to reduce token usage by selecting only the most relevant tools
|
|
470
|
-
# for each query. Uses the native embedding reranker to score tools against the user's prompt.
|
|
471
|
-
# Set to "true" to enable. This can reduce token costs by 80% when you have
|
|
472
|
-
# many tools/MCP servers enabled.
|
|
473
|
-
# AGENT_SKILL_RERANKER_ENABLED="true"
|
|
474
|
-
# AGENT_SKILL_RERANKER_TOP_N=15 # (optional) Number of top tools to keep after reranking (default: 15)
|
|
475
|
-
|
|
476
|
-
# (optional) Memory extraction background job settings.
|
|
477
|
-
# MEMORY_EXTRACTION_INTERVAL="15m" # How often the extraction job runs (default: 15m)
|
|
478
|
-
# MEMORY_IDLE_THRESHOLD_MS=1200000 # Min ms since last chat before extraction runs (default: 1200000 / 20min). Set to 0 to disable the idle check.
|
|
479
|
-
|
|
480
|
-
# (optional) Maximum number of scheduled jobs that can run concurrently.
|
|
481
|
-
# Default is 1. Increase if using a cloud LLM provider with high rate limits.
|
|
482
|
-
# SCHEDULED_JOB_MAX_CONCURRENT=1
|
|
483
|
-
|
|
484
|
-
# (optional) Maximum time in milliseconds a scheduled job can run before being terminated.
|
|
485
|
-
# Default is 5 minutes (300000ms).
|
|
486
|
-
# SCHEDULED_JOB_TIMEOUT_MS=300000
|
|
487
|
-
|
|
488
|
-
# (optional) Comma-separated list of skills that are auto-approved.
|
|
489
|
-
# This will allow the skill to be invoked without user interaction.
|
|
490
|
-
# AGENT_AUTO_APPROVED_SKILLS=create-pdf-file,create-word-file
|
|
7
|
+
VECTOR_DB='lancedb'
|
|
8
|
+
OPENROUTER_API_KEY='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'
|
|
9
|
+
OPENROUTER_MODEL_PREF='nvidia/nemotron-3-nano-30b-a3b:free'
|
|
10
|
+
OPENROUTER_TIMEOUT_MS='3000'
|
|
11
|
+
WHISPER_PROVIDER='local'
|
|
12
|
+
JWT_SECRET='my-random-string-for-seeding'
|
|
13
|
+
TTS_PROVIDER='native'
|
|
14
|
+
STORAGE_DIR='/home/mike-diker/totem-llm'
|
|
15
|
+
SERVER_PORT='8686'
|
|
16
|
+
SIG_KEY='passphrase'
|
|
17
|
+
SIG_SALT='salt'
|
|
18
|
+
DATABASE_URL='file:../storage/anythingllm.db'
|
|
19
|
+
OLLAMA_RESPONSE_TIMEOUT='7200000 (optional, max timeout in milliseconds for ollama response to conclude. Default is 5min before aborting)'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as g,j as t,e as f,f as S,i as h,l as x,r as a,W as i,L as b,Y as j}from"../index.js";import{W as w}from"./index-
|
|
1
|
+
import{d as g,j as t,e as f,f as S,i as h,l as x,r as a,W as i,L as b,Y as j}from"../index.js";import{W as w}from"./index-fd99e568.js";import{a as k}from"./index-0b8978d7.js";import"./files-202b5d45.js";import"./purify-5067c4b9.js";/* empty css */import"./Check-7e83fb0d.js";import"./Copy-d323e545.js";import"./truncate-e484143c.js";import"./mcpServers-d6808fa0.js";import"./admin-04b020fe.js";import"./Database-f1a76329.js";import"./File-b92df2f3.js";import"./XCircle-edfe554c.js";import"./Trans-11790b69.js";import"./Brain-24e386d5.js";import"./Browser-1820fad0.js";import"./index-6f49fa27.js";import"./agentFlows-e4124dd3.js";import"./index-e7e7c547.js";import"./communityHub-aba61686.js";import"./WarningCircle-27467274.js";import"./index-8ba96f42.js";import"./Hammer-05b5ccc7.js";import"./react-beautiful-dnd.esm-51607d6e.js";import"./moment-49fc1b76.js";import"./Eye-9f033dc0.js";import"./index-4fb4d421.js";function X(){const{loading:s,requiresAuth:o,mode:r}=g();return s?t.jsx(f,{}):o!==!1?t.jsx(t.Fragment,{children:o!==null&&t.jsx(S,{mode:r})}):t.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-zinc-950 light:bg-slate-50 flex",children:[!h&&t.jsx(k,{}),t.jsx(W,{})]})}function W(){const{slug:s}=x(),[o,r]=a.useState(null),[p,m]=a.useState(null);return a.useEffect(()=>{async function u(){var n;if(!s)return;const e=await i.bySlug(s);if(!e){r(null),m(s);return}const[c,{showAgentCommand:d}]=await Promise.all([i.getSuggestedMessages(s),i.agentCommandAvailable(s)]);r({...e,suggestedMessages:c,showAgentCommand:d}),m(s),localStorage.setItem(b,JSON.stringify({slug:e.slug,name:e.name}));const l=(n=e.slug)==null?void 0:n.match(/^scheduled-job-(\d+)$/);l&&j.markAllReadForJob(Number(l[1]))}u()},[s]),t.jsx(w,{loading:p!==s,workspace:o})}export{X as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as c,j as e,p,C as h,c as d,W as I,ag as w,a6 as v,aL as S,aG as C,s as A,v as L,aN as T,a2 as F,i as N}from"../index.js";import{C as f}from"./communityHub-aba61686.js";import{r as H}from"./files-202b5d45.js";import{p as P}from"./purify-5067c4b9.js";import{s as U}from"./index-44382a03.js";import{A as b}from"./agentFlows-e4124dd3.js";/* empty css */import"./Check-7e83fb0d.js";import"./Copy-d323e545.js";import"./index-0b8978d7.js";import"./truncate-e484143c.js";import"./XCircle-edfe554c.js";import"./moment-49fc1b76.js";import"./File-b92df2f3.js";import"./Eye-9f033dc0.js";import"./index-4fb4d421.js";import"./react-beautiful-dnd.esm-51607d6e.js";import"./mcpServers-d6808fa0.js";import"./admin-04b020fe.js";import"./Database-f1a76329.js";import"./Trans-11790b69.js";import"./Brain-24e386d5.js";import"./Browser-1820fad0.js";import"./index-6f49fa27.js";import"./index-e7e7c547.js";import"./WarningCircle-27467274.js";import"./index-8ba96f42.js";import"./Hammer-05b5ccc7.js";function z({settings:t,setSettings:l,setStep:s}){const[n,a]=c.useState(t.itemId),i=()=>{if(!n)return d("Please enter an item ID","error");l(r=>({...r,itemId:n})),s(x.itemId.next())};return e.jsx("div",{className:"flex-[2] flex flex-col gap-y-[18px] mt-10",children:e.jsx("div",{className:"bg-theme-bg-secondary rounded-xl flex-1 p-6",children:e.jsxs("div",{className:"w-full flex flex-col gap-y-2 max-w-[700px]",children:[e.jsx("h2",{className:"text-base text-theme-text-primary font-semibold",children:"Import an item from the community hub"}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-theme-text-secondary text-sm",children:[e.jsx("p",{children:"The community hub is a place where you can find, share, and import agent-skills, system prompts, slash commands, and more!"}),e.jsx("p",{children:"These items are created by the AnythingLLM team and community, and are a great way to get started with AnythingLLM as well as extend AnythingLLM in a way that is customized to your needs."}),e.jsxs("p",{children:["There are both ",e.jsx("b",{children:"private"})," and ",e.jsx("b",{children:"public"})," items in the community hub. Private items are only visible to you, while public items are visible to everyone."]}),e.jsxs("p",{className:"p-4 bg-yellow-800/30 light:bg-orange-100 light:text-orange-500 light:border-orange-500 rounded-lg border border-yellow-500 text-yellow-500",children:["If you are pulling in a private item, make sure it is"," ",e.jsx("b",{children:"shared with a team"})," you belong to, and you have added a"," ",e.jsx("a",{href:p.communityHub.authentication(),className:"underline text-yellow-100 light:text-orange-500 font-semibold",children:"Connection Key."})]})]}),e.jsx("div",{className:"flex flex-col gap-y-2 mt-4",children:e.jsx("div",{className:"w-full flex flex-col gap-y-4",children:e.jsxs("div",{className:"flex flex-col w-full",children:[e.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Community Hub Item Import ID"}),e.jsx("input",{type:"text",value:n,onChange:r=>a(r.target.value),placeholder:"allm-community-id:agent-skill:1234567890",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"})]})})}),e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:i,children:"Continue with import →"})]})})})}function E({item:t,setStep:l}){const[s,n]=c.useState(null),[a,i]=c.useState([]);c.useEffect(()=>{async function o(){const m=await I.all();i(m),n(m[0].slug)}o()},[]);async function r(){d("Applying system prompt to workspace...","info");const{error:o}=await f.applyItem(t.importId,{workspaceSlug:s});if(o)return d(`Failed to apply system prompt. ${o}`,"error",{clear:!0});d("System prompt applied to workspace.","success",{clear:!0}),l(x.completed.key)}return e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-y-1",children:[e.jsxs("h2",{className:"text-base text-theme-text-primary font-semibold",children:['Review System Prompt "',t.name,'"']}),t.creatorUsername&&e.jsxs("p",{className:"text-white/60 light:text-theme-text-secondary text-xs font-mono",children:["Created by"," ",e.jsxs("a",{href:p.communityHub.profile(t.creatorUsername),target:"_blank",className:"hover:text-blue-500 hover:underline",rel:"noreferrer",children:["@",t.creatorUsername]})]})]}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-white/80 light:text-theme-text-secondary text-sm",children:[e.jsx("p",{children:"System prompts are used to guide the behavior of the AI agents and can be applied to any existing workspace."}),e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx("p",{className:"text-white/60 light:text-theme-text-secondary font-semibold",children:"Provided system prompt:"}),e.jsx("div",{className:"w-full text-theme-text-primary text-md flex flex-col max-h-[calc(300px)] overflow-y-auto",children:e.jsx("p",{className:"text-white/60 light:text-theme-text-secondary font-mono bg-zinc-900 light:bg-slate-200 px-2 py-1 rounded-md text-sm whitespace-pre-line",children:t.prompt})})]}),e.jsxs("div",{className:"flex flex-col w-60",children:[e.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Apply to Workspace"}),e.jsx("select",{name:"destinationWorkspaceSlug",required:!0,onChange:o=>n(o.target.value),className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:e.jsx("optgroup",{label:"Available workspaces",children:a.map(o=>e.jsx("option",{value:o.slug,children:o.name},o.id))})})]})]}),s&&e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:r,children:"Apply system prompt to workspace"})]})}function M({item:t,setStep:l}){async function s(){try{const{error:n}=await f.applyItem(t.importId);if(n)throw new Error(n);d(`Slash command ${t.command} imported successfully!`,"success"),l(x.completed.key)}catch(n){console.error(n),d(`Failed to import slash command. ${n.message}`,"error")}}return e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-y-1",children:[e.jsxs("h2",{className:"text-base text-theme-text-primary font-semibold",children:['Review Slash Command "',t.name,'"']}),t.creatorUsername&&e.jsxs("p",{className:"text-white/60 text-xs font-mono",children:["Created by"," ",e.jsxs("a",{href:p.communityHub.profile(t.creatorUsername),target:"_blank",className:"hover:text-blue-500 hover:underline",rel:"noreferrer",children:["@",t.creatorUsername]})]})]}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-white/80 light:text-theme-text-secondary text-sm",children:[e.jsxs("p",{children:["Slash commands are used to prefill information into a prompt while chatting with a AnythingLLM workspace.",e.jsx("br",{}),e.jsx("br",{}),"The slash command will be available during chatting by simply invoking it with"," ",e.jsx("code",{className:"font-mono bg-zinc-900 light:bg-slate-200 px-1 py-0.5 rounded-md text-sm",children:t.command})," ","like you would any other command."]}),e.jsxs("div",{className:"flex flex-col gap-y-2 mt-2",children:[e.jsx("div",{className:"w-full text-theme-text-primary text-md gap-x-2 flex items-center",children:e.jsx("p",{className:"text-white/60 light:text-theme-text-secondary w-fit font-mono bg-zinc-900 light:bg-slate-200 px-2 py-1 rounded-md text-sm whitespace-pre-line",children:t.command})}),e.jsx("div",{className:"w-full text-theme-text-primary text-md flex flex-col gap-y-2",children:e.jsx("p",{className:"text-white/60 light:text-theme-text-secondary font-mono bg-zinc-900 light:bg-slate-200 p-4 rounded-md text-sm whitespace-pre-line max-h-[calc(200px)] overflow-y-auto",children:t.prompt})})]})]}),e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:s,children:"Import slash command"})]})}function $({item:t,setSettings:l,setStep:s}){return e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsxs("div",{className:"w-full flex items-center gap-x-2",children:[e.jsx(w,{size:24,className:"text-red-500"}),e.jsx("h2",{className:"text-base text-red-500 font-semibold",children:"Unsupported item"})]}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-white/80 text-sm",children:[e.jsx("p",{children:"We found an item in the community hub, but we don't know what it is or it is not yet supported for import into AnythingLLM."}),e.jsxs("p",{children:["The item ID is: ",e.jsx("b",{children:t.id}),e.jsx("br",{}),"The item type is: ",e.jsx("b",{children:t.itemType})]}),e.jsx("p",{children:"Please contact support via email if you need help importing this item."})]}),e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:()=>{l({itemId:null,item:null}),s(x.itemId.key)},children:"Try another item"})]})}function D({item:t,settings:l,setStep:s}){const[n,a]=c.useState(!1);async function i(){try{a(!0);const{error:r}=await f.importBundleItem(l.itemId);if(r)throw new Error(r);d("Agent skill imported successfully!","success"),s(x.completed.key)}catch(r){console.error(r),d(`Failed to import agent skill. ${r.message}`,"error")}finally{a(!1)}}return c.useEffect(()=>{U()},[]),e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsx("div",{className:"border border-white/10 light:border-orange-500/20 my-2 flex flex-col md:flex-row md:items-center gap-x-2 text-theme-text-primary light:text-orange-600 mb-4 bg-orange-800/30 light:bg-orange-500/10 rounded-lg px-4 py-2",children:e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"gap-x-2 flex items-center",children:[e.jsx(w,{size:25}),e.jsxs("h1",{className:"text-lg font-semibold",children:[" ","Only import agent skills you trust"," "]})]}),e.jsx("p",{className:"text-sm",children:"Agent skills can execute code on your AnythingLLM instance, so only import agent skills from sources you trust. You should also review the code before importing. If you are unsure about what a skill does - don't import it!"})]})}),e.jsxs("div",{className:"flex flex-col gap-y-1",children:[e.jsxs("h2",{className:"text-base text-theme-text-primary font-semibold",children:['Review Agent Skill "',t.name,'"']}),t.creatorUsername&&e.jsxs("p",{className:"text-white/60 light:text-theme-text-secondary text-xs font-mono",children:["Created by"," ",e.jsxs("a",{href:p.communityHub.profile(t.creatorUsername),target:"_blank",className:"hover:text-blue-500 hover:underline",rel:"noreferrer",children:["@",t.creatorUsername]})]}),e.jsxs("div",{className:"flex gap-x-1",children:[t.verified?e.jsx("p",{className:"text-green-500 text-xs font-mono",children:"Verified code"}):e.jsx("p",{className:"text-red-500 text-xs font-mono",children:"This skill is not verified."}),e.jsx("a",{href:"https://docs.anythingllm.com/community-hub/faq#verification",target:"_blank",className:"text-xs font-mono text-blue-500 hover:underline",rel:"noreferrer",children:"Learn more →"})]})]}),e.jsx("div",{className:"flex flex-col gap-y-[25px] text-white/80 light:text-theme-text-secondary text-sm",children:e.jsxs("p",{children:["Agent skills unlock new capabilities for your AnythingLLM workspace via"," ",e.jsx("code",{className:"font-mono bg-zinc-900 light:bg-slate-200 px-1 py-0.5 rounded-md text-sm",children:"@agent"})," ","skills that can do specific tasks when invoked."]})}),e.jsx(W,{item:t}),e.jsxs(h,{disabled:n,className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:i,children:[n?e.jsx(v,{size:16,className:"animate-spin"}):null,n?"Importing...":"Import agent skill"]})]})}function W({item:t}){const l=t.manifest.files||[],[s,n]=c.useState(0),[a,i]=c.useState(l[s]);function r(){s>0&&n(s-1)}function o(){s<l.length-1&&n(s+1)}function m(u){switch(u.name.split(".").pop()){case"js":return"javascript";case"json":return"json";case"md":return"markdown";default:return"text"}}return c.useEffect(()=>{l.length>0&&i((l==null?void 0:l[s])||l[0])},[s]),a?e.jsx("div",{className:"flex flex-col gap-y-2",children:e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("button",{type:"button",className:`border-none bg-black/70 light:bg-slate-200 rounded-md p-1 text-white/60 light:text-theme-text-secondary text-xs font-mono ${s===0?"opacity-50 cursor-not-allowed":""}`,onClick:r,children:e.jsx(S,{size:16})}),e.jsxs("p",{className:"text-white/60 light:text-theme-text-secondary text-xs font-mono",children:[a.name," (",s+1," of ",l.length," files)"]}),e.jsx("button",{type:"button",className:`border-none bg-black/70 light:bg-slate-200 rounded-md p-1 text-white/60 light:text-theme-text-secondary text-xs font-mono ${s===l.length-1?"opacity-50 cursor-not-allowed":""}`,onClick:o,children:e.jsx(C,{size:16})})]}),e.jsx("span",{className:"whitespace-pre-line flex flex-col gap-y-1 text-sm leading-[20px] max-h-[500px] overflow-y-auto hljs text-theme-text-primary",dangerouslySetInnerHTML:{__html:P.sanitize(H(`\`\`\`${m(a)}
|
|
1
|
+
import{r as c,j as e,p,C as h,c as d,W as I,ag as w,a6 as v,aL as S,aG as C,s as A,v as L,aN as T,a2 as F,i as N}from"../index.js";import{C as f}from"./communityHub-aba61686.js";import{r as H}from"./files-202b5d45.js";import{p as P}from"./purify-5067c4b9.js";import{s as U}from"./index-fd99e568.js";import{A as b}from"./agentFlows-e4124dd3.js";/* empty css */import"./Check-7e83fb0d.js";import"./Copy-d323e545.js";import"./index-0b8978d7.js";import"./truncate-e484143c.js";import"./XCircle-edfe554c.js";import"./moment-49fc1b76.js";import"./File-b92df2f3.js";import"./Eye-9f033dc0.js";import"./index-4fb4d421.js";import"./react-beautiful-dnd.esm-51607d6e.js";import"./mcpServers-d6808fa0.js";import"./admin-04b020fe.js";import"./Database-f1a76329.js";import"./Trans-11790b69.js";import"./Brain-24e386d5.js";import"./Browser-1820fad0.js";import"./index-6f49fa27.js";import"./index-e7e7c547.js";import"./WarningCircle-27467274.js";import"./index-8ba96f42.js";import"./Hammer-05b5ccc7.js";function z({settings:t,setSettings:l,setStep:s}){const[n,a]=c.useState(t.itemId),i=()=>{if(!n)return d("Please enter an item ID","error");l(r=>({...r,itemId:n})),s(x.itemId.next())};return e.jsx("div",{className:"flex-[2] flex flex-col gap-y-[18px] mt-10",children:e.jsx("div",{className:"bg-theme-bg-secondary rounded-xl flex-1 p-6",children:e.jsxs("div",{className:"w-full flex flex-col gap-y-2 max-w-[700px]",children:[e.jsx("h2",{className:"text-base text-theme-text-primary font-semibold",children:"Import an item from the community hub"}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-theme-text-secondary text-sm",children:[e.jsx("p",{children:"The community hub is a place where you can find, share, and import agent-skills, system prompts, slash commands, and more!"}),e.jsx("p",{children:"These items are created by the AnythingLLM team and community, and are a great way to get started with AnythingLLM as well as extend AnythingLLM in a way that is customized to your needs."}),e.jsxs("p",{children:["There are both ",e.jsx("b",{children:"private"})," and ",e.jsx("b",{children:"public"})," items in the community hub. Private items are only visible to you, while public items are visible to everyone."]}),e.jsxs("p",{className:"p-4 bg-yellow-800/30 light:bg-orange-100 light:text-orange-500 light:border-orange-500 rounded-lg border border-yellow-500 text-yellow-500",children:["If you are pulling in a private item, make sure it is"," ",e.jsx("b",{children:"shared with a team"})," you belong to, and you have added a"," ",e.jsx("a",{href:p.communityHub.authentication(),className:"underline text-yellow-100 light:text-orange-500 font-semibold",children:"Connection Key."})]})]}),e.jsx("div",{className:"flex flex-col gap-y-2 mt-4",children:e.jsx("div",{className:"w-full flex flex-col gap-y-4",children:e.jsxs("div",{className:"flex flex-col w-full",children:[e.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Community Hub Item Import ID"}),e.jsx("input",{type:"text",value:n,onChange:r=>a(r.target.value),placeholder:"allm-community-id:agent-skill:1234567890",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"})]})})}),e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:i,children:"Continue with import →"})]})})})}function E({item:t,setStep:l}){const[s,n]=c.useState(null),[a,i]=c.useState([]);c.useEffect(()=>{async function o(){const m=await I.all();i(m),n(m[0].slug)}o()},[]);async function r(){d("Applying system prompt to workspace...","info");const{error:o}=await f.applyItem(t.importId,{workspaceSlug:s});if(o)return d(`Failed to apply system prompt. ${o}`,"error",{clear:!0});d("System prompt applied to workspace.","success",{clear:!0}),l(x.completed.key)}return e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-y-1",children:[e.jsxs("h2",{className:"text-base text-theme-text-primary font-semibold",children:['Review System Prompt "',t.name,'"']}),t.creatorUsername&&e.jsxs("p",{className:"text-white/60 light:text-theme-text-secondary text-xs font-mono",children:["Created by"," ",e.jsxs("a",{href:p.communityHub.profile(t.creatorUsername),target:"_blank",className:"hover:text-blue-500 hover:underline",rel:"noreferrer",children:["@",t.creatorUsername]})]})]}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-white/80 light:text-theme-text-secondary text-sm",children:[e.jsx("p",{children:"System prompts are used to guide the behavior of the AI agents and can be applied to any existing workspace."}),e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx("p",{className:"text-white/60 light:text-theme-text-secondary font-semibold",children:"Provided system prompt:"}),e.jsx("div",{className:"w-full text-theme-text-primary text-md flex flex-col max-h-[calc(300px)] overflow-y-auto",children:e.jsx("p",{className:"text-white/60 light:text-theme-text-secondary font-mono bg-zinc-900 light:bg-slate-200 px-2 py-1 rounded-md text-sm whitespace-pre-line",children:t.prompt})})]}),e.jsxs("div",{className:"flex flex-col w-60",children:[e.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Apply to Workspace"}),e.jsx("select",{name:"destinationWorkspaceSlug",required:!0,onChange:o=>n(o.target.value),className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:e.jsx("optgroup",{label:"Available workspaces",children:a.map(o=>e.jsx("option",{value:o.slug,children:o.name},o.id))})})]})]}),s&&e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:r,children:"Apply system prompt to workspace"})]})}function M({item:t,setStep:l}){async function s(){try{const{error:n}=await f.applyItem(t.importId);if(n)throw new Error(n);d(`Slash command ${t.command} imported successfully!`,"success"),l(x.completed.key)}catch(n){console.error(n),d(`Failed to import slash command. ${n.message}`,"error")}}return e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-y-1",children:[e.jsxs("h2",{className:"text-base text-theme-text-primary font-semibold",children:['Review Slash Command "',t.name,'"']}),t.creatorUsername&&e.jsxs("p",{className:"text-white/60 text-xs font-mono",children:["Created by"," ",e.jsxs("a",{href:p.communityHub.profile(t.creatorUsername),target:"_blank",className:"hover:text-blue-500 hover:underline",rel:"noreferrer",children:["@",t.creatorUsername]})]})]}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-white/80 light:text-theme-text-secondary text-sm",children:[e.jsxs("p",{children:["Slash commands are used to prefill information into a prompt while chatting with a AnythingLLM workspace.",e.jsx("br",{}),e.jsx("br",{}),"The slash command will be available during chatting by simply invoking it with"," ",e.jsx("code",{className:"font-mono bg-zinc-900 light:bg-slate-200 px-1 py-0.5 rounded-md text-sm",children:t.command})," ","like you would any other command."]}),e.jsxs("div",{className:"flex flex-col gap-y-2 mt-2",children:[e.jsx("div",{className:"w-full text-theme-text-primary text-md gap-x-2 flex items-center",children:e.jsx("p",{className:"text-white/60 light:text-theme-text-secondary w-fit font-mono bg-zinc-900 light:bg-slate-200 px-2 py-1 rounded-md text-sm whitespace-pre-line",children:t.command})}),e.jsx("div",{className:"w-full text-theme-text-primary text-md flex flex-col gap-y-2",children:e.jsx("p",{className:"text-white/60 light:text-theme-text-secondary font-mono bg-zinc-900 light:bg-slate-200 p-4 rounded-md text-sm whitespace-pre-line max-h-[calc(200px)] overflow-y-auto",children:t.prompt})})]})]}),e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:s,children:"Import slash command"})]})}function $({item:t,setSettings:l,setStep:s}){return e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsxs("div",{className:"w-full flex items-center gap-x-2",children:[e.jsx(w,{size:24,className:"text-red-500"}),e.jsx("h2",{className:"text-base text-red-500 font-semibold",children:"Unsupported item"})]}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-white/80 text-sm",children:[e.jsx("p",{children:"We found an item in the community hub, but we don't know what it is or it is not yet supported for import into AnythingLLM."}),e.jsxs("p",{children:["The item ID is: ",e.jsx("b",{children:t.id}),e.jsx("br",{}),"The item type is: ",e.jsx("b",{children:t.itemType})]}),e.jsx("p",{children:"Please contact support via email if you need help importing this item."})]}),e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:()=>{l({itemId:null,item:null}),s(x.itemId.key)},children:"Try another item"})]})}function D({item:t,settings:l,setStep:s}){const[n,a]=c.useState(!1);async function i(){try{a(!0);const{error:r}=await f.importBundleItem(l.itemId);if(r)throw new Error(r);d("Agent skill imported successfully!","success"),s(x.completed.key)}catch(r){console.error(r),d(`Failed to import agent skill. ${r.message}`,"error")}finally{a(!1)}}return c.useEffect(()=>{U()},[]),e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsx("div",{className:"border border-white/10 light:border-orange-500/20 my-2 flex flex-col md:flex-row md:items-center gap-x-2 text-theme-text-primary light:text-orange-600 mb-4 bg-orange-800/30 light:bg-orange-500/10 rounded-lg px-4 py-2",children:e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"gap-x-2 flex items-center",children:[e.jsx(w,{size:25}),e.jsxs("h1",{className:"text-lg font-semibold",children:[" ","Only import agent skills you trust"," "]})]}),e.jsx("p",{className:"text-sm",children:"Agent skills can execute code on your AnythingLLM instance, so only import agent skills from sources you trust. You should also review the code before importing. If you are unsure about what a skill does - don't import it!"})]})}),e.jsxs("div",{className:"flex flex-col gap-y-1",children:[e.jsxs("h2",{className:"text-base text-theme-text-primary font-semibold",children:['Review Agent Skill "',t.name,'"']}),t.creatorUsername&&e.jsxs("p",{className:"text-white/60 light:text-theme-text-secondary text-xs font-mono",children:["Created by"," ",e.jsxs("a",{href:p.communityHub.profile(t.creatorUsername),target:"_blank",className:"hover:text-blue-500 hover:underline",rel:"noreferrer",children:["@",t.creatorUsername]})]}),e.jsxs("div",{className:"flex gap-x-1",children:[t.verified?e.jsx("p",{className:"text-green-500 text-xs font-mono",children:"Verified code"}):e.jsx("p",{className:"text-red-500 text-xs font-mono",children:"This skill is not verified."}),e.jsx("a",{href:"https://docs.anythingllm.com/community-hub/faq#verification",target:"_blank",className:"text-xs font-mono text-blue-500 hover:underline",rel:"noreferrer",children:"Learn more →"})]})]}),e.jsx("div",{className:"flex flex-col gap-y-[25px] text-white/80 light:text-theme-text-secondary text-sm",children:e.jsxs("p",{children:["Agent skills unlock new capabilities for your AnythingLLM workspace via"," ",e.jsx("code",{className:"font-mono bg-zinc-900 light:bg-slate-200 px-1 py-0.5 rounded-md text-sm",children:"@agent"})," ","skills that can do specific tasks when invoked."]})}),e.jsx(W,{item:t}),e.jsxs(h,{disabled:n,className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:i,children:[n?e.jsx(v,{size:16,className:"animate-spin"}):null,n?"Importing...":"Import agent skill"]})]})}function W({item:t}){const l=t.manifest.files||[],[s,n]=c.useState(0),[a,i]=c.useState(l[s]);function r(){s>0&&n(s-1)}function o(){s<l.length-1&&n(s+1)}function m(u){switch(u.name.split(".").pop()){case"js":return"javascript";case"json":return"json";case"md":return"markdown";default:return"text"}}return c.useEffect(()=>{l.length>0&&i((l==null?void 0:l[s])||l[0])},[s]),a?e.jsx("div",{className:"flex flex-col gap-y-2",children:e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("button",{type:"button",className:`border-none bg-black/70 light:bg-slate-200 rounded-md p-1 text-white/60 light:text-theme-text-secondary text-xs font-mono ${s===0?"opacity-50 cursor-not-allowed":""}`,onClick:r,children:e.jsx(S,{size:16})}),e.jsxs("p",{className:"text-white/60 light:text-theme-text-secondary text-xs font-mono",children:[a.name," (",s+1," of ",l.length," files)"]}),e.jsx("button",{type:"button",className:`border-none bg-black/70 light:bg-slate-200 rounded-md p-1 text-white/60 light:text-theme-text-secondary text-xs font-mono ${s===l.length-1?"opacity-50 cursor-not-allowed":""}`,onClick:o,children:e.jsx(C,{size:16})})]}),e.jsx("span",{className:"whitespace-pre-line flex flex-col gap-y-1 text-sm leading-[20px] max-h-[500px] overflow-y-auto hljs text-theme-text-primary",dangerouslySetInnerHTML:{__html:P.sanitize(H(`\`\`\`${m(a)}
|
|
2
2
|
${m(a)==="markdown"?a.content.replace(/```/g,"~~~"):a.content}
|
|
3
3
|
\`\`\``))}})]})}):null}function R({item:t,setStep:l}){const s=A(t.flow,{steps:[]}),[n,a]=c.useState(!1);async function i(){try{a(!0);const{success:r,error:o,flow:m}=await b.saveFlow(t.name,s);if(!r)throw new Error(o);m!=null&&m.uuid&&await b.toggleFlow(m.uuid,!0),d("Agent flow imported successfully!","success"),l(x.completed.key)}catch(r){console.error(r),d(`Failed to import agent flow. ${r.message}`,"error")}finally{a(!1)}}return e.jsxs("div",{className:"flex flex-col mt-4 gap-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-y-1",children:[e.jsxs("h2",{className:"text-base text-theme-text-primary font-semibold",children:['Import Agent Flow "',t.name,'"']}),t.creatorUsername&&e.jsxs("p",{className:"text-white/60 light:text-theme-text-secondary text-xs font-mono",children:["Created by"," ",e.jsxs("a",{href:p.communityHub.profile(t.creatorUsername),target:"_blank",className:"hover:text-blue-500 hover:underline",rel:"noreferrer",children:["@",t.creatorUsername]})]})]}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-white/80 light:text-theme-text-secondary text-sm",children:[e.jsx("p",{children:"Agent flows allow you to create reusable sequences of actions that can be triggered by your agent."}),e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx("p",{className:"font-semibold",children:"Flow Details:"}),e.jsxs("p",{children:["Description: ",t.description]}),e.jsxs("p",{className:"font-semibold",children:["Steps (",s.steps.length,"):"]}),e.jsx("ul",{className:"list-disc pl-6",children:s.steps.map((r,o)=>e.jsx("li",{children:r.type},o))})]})]}),e.jsxs(h,{disabled:n,className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:i,children:[n?e.jsx(v,{size:16,className:"animate-spin"}):null,n?"Importing...":"Import agent flow"]})]})}const j={"agent-skill":D,"system-prompt":E,"slash-command":M,"agent-flow":R,unknown:$};function _({importId:t,updateSettings:l}){const[s,n]=c.useState(null),[a,i]=c.useState(!1),[r,o]=c.useState(null);return c.useEffect(()=>{async function m(){if(!t)return;i(!0),await new Promise(g=>setTimeout(g,2e3));const{error:u,item:y}=await f.getItemFromImportId(t);u&&o(u),n(y),l(g=>({...g,item:y})),i(!1)}m()},[t]),{item:s,loading:a,error:r}}function O({settings:t,setSettings:l,setStep:s}){const{item:n,loading:a,error:i}=_({importId:t.itemId,updateSettings:l}),r=j[n==null?void 0:n.itemType]||j.unknown;return e.jsx("div",{className:"flex-[2] flex flex-col gap-y-[18px] mt-10",children:e.jsx("div",{className:"bg-theme-bg-secondary rounded-xl flex-1 p-6",children:e.jsxs("div",{className:"w-full flex flex-col gap-y-2 max-w-[700px]",children:[e.jsx("h2",{className:"text-base text-theme-text-primary font-semibold",children:"Review item"}),a&&e.jsx("div",{className:"flex h-[200px] w-full rounded-lg animate-pulse",children:e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("p",{className:"text-sm text-theme-text-secondary",children:"Pulling item details from community hub..."})})}),!a&&i&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-y-2 mt-8",children:[e.jsx("p",{className:"text-red-500",children:"An error occurred while fetching the item. Please try again later."}),e.jsx("p",{className:"text-red-500/80 text-sm font-mono",children:i})]}),e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:()=>{l({itemId:null,item:null}),s(x.itemId.key)},children:"Try another item"})]}),!a&&!i&&n&&e.jsx(r,{item:n,settings:t,setSettings:l,setStep:s})]})})})}function q({settings:t,setSettings:l,setStep:s}){return e.jsx("div",{className:"flex-[2] flex flex-col gap-y-[18px] mt-10",children:e.jsx("div",{className:"bg-theme-bg-secondary rounded-xl flex-1 p-6",children:e.jsxs("div",{className:"w-full flex flex-col gap-y-2 max-w-[700px]",children:[e.jsx("h2",{className:"text-base text-theme-text-primary font-semibold",children:"Community Hub Item Imported"}),e.jsxs("div",{className:"flex flex-col gap-y-[25px] text-theme-text-secondary text-sm",children:[e.jsxs("p",{children:['The "',t.item.name,'" ',t.item.itemType," has been imported successfully! It is now available in your AnythingLLM instance."]}),t.item.itemType==="agent-flow"&&e.jsxs(L,{to:p.settings.agentSkills(),className:"text-theme-text-primary hover:text-blue-500 hover:underline",children:['View "',t.item.name,'" in Agent Skills']}),e.jsxs("p",{children:["Any changes you make to this ",t.item.itemType," will not be reflected in the community hub. You can now modify as needed."]})]}),e.jsx(h,{className:"text-dark-text w-full mt-[18px] h-[34px] hover:bg-accent",onClick:()=>{l({item:null,itemId:null}),s(x.itemId.key)},children:"Import another item"})]})})})}const k={itemId:{key:"itemId",name:"1. Paste in Item ID",next:()=>"validation",component:({settings:t,setSettings:l,setStep:s})=>e.jsx(z,{settings:t,setSettings:l,setStep:s})},validation:{key:"validation",name:"2. Review item",next:()=>"completed",component:({settings:t,setSettings:l,setStep:s})=>e.jsx(O,{settings:t,setSettings:l,setStep:s})},completed:{key:"completed",name:"3. Completed",component:({settings:t,setSettings:l,setStep:s})=>e.jsx(q,{settings:t,setSettings:l,setStep:s})}};function B({setStep:t,children:l}){const s=T(),[n,a]=c.useState({itemId:null,item:null});return c.useEffect(()=>{function i(){s.get("id")&&(a({itemId:s.get("id")}),t(k.itemId.next()))}i()},[]),e.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-theme-bg-container flex",children:[e.jsx(F,{}),e.jsx("div",{style:{height:N?"100%":"calc(100% - 32px)"},className:"relative md:ml-[2px] md:mr-[16px] md:my-[16px] md:rounded-[16px] w-full h-full overflow-y-scroll p-4 md:p-0",children:l(n,a,t)})]})}const x=k;function G({setStep:t,currentStep:l}){const s=Object.keys(x).indexOf(l);return e.jsx("div",{className:`bg-white/5 light:bg-white text-theme-text-primary rounded-xl py-1 px-4 shadow-lg ${N?"w-full":"min-w-[360px] w-fit"}`,children:Object.entries(x).map(([n,a],i)=>{const r=l===n,o=i===Object.keys(x).length-1,m=s===Object.keys(x).length-1||i<s;return e.jsxs("div",{className:["py-3 flex items-center justify-between transition-all duration-300",r?"rounded-t-xl":"",o?"":"border-b border-white/10 light:border-[#026AA2]/10"].join(" "),children:[m||r?e.jsx("button",{onClick:()=>t(n),className:"border-none hover:underline text-sm font-medium text-theme-text-primary",children:a.name}):e.jsx("div",{className:"text-sm text-theme-text-secondary font-medium",children:a.name}),e.jsx("div",{className:"flex items-center gap-x-2",children:m?e.jsx("div",{className:"w-[14px] h-[14px] rounded-full border border-[#32D583] flex items-center justify-center",children:e.jsx("div",{className:"w-[5.6px] h-[5.6px] rounded-full bg-[#6CE9A6]"})}):e.jsx("div",{className:`w-[14px] h-[14px] rounded-full border border-theme-text-primary ${r?"animate-pulse":"opacity-50"}`})})]},n)})})}function we(){const[t,l]=c.useState("itemId"),s=x.hasOwnProperty(t)?x[t]:x.itemId;return e.jsx(B,{setStep:l,children:(n,a,i)=>e.jsxs("div",{className:"flex flex-col w-full px-1 md:px-6 2xl:pr-[86px] md:py-6 py-16",children:[e.jsxs("div",{className:"w-full flex flex-col gap-y-1 pb-6 border-white light:border-theme-sidebar-border border-b-2 border-opacity-10",children:[e.jsx("div",{className:"items-center",children:e.jsx("p",{className:"text-lg leading-6 font-bold text-theme-text-primary",children:"Import a Community Item"})}),e.jsx("p",{className:"text-xs leading-[18px] font-base text-theme-text-secondary",children:"Import items from the AnythingLLM Community Hub to enhance your instance with community-created prompts, skills, and commands."})]}),e.jsxs("div",{className:"flex-1 flex flex-col 2xl:flex-row h-full",children:[e.jsx("div",{className:"flex flex-col gap-y-[18px] mt-10 w-full 2xl:w-[360px] 2xl:flex-shrink-0",children:e.jsx(G,{setStep:i,currentStep:t})}),e.jsx("div",{className:"flex-1 min-w-0 overflow-y-auto pb-[200px] 2xl:h-screen no-scroll",children:e.jsx("div",{className:"2xl:ml-8",children:s.component({settings:n,setSettings:a,setStep:i})})})]})]})})}export{we as default};
|