Skip to content

Commit 56a04c2

Browse files
AndlerRLBran18sheriffjimoh
authored
[masterbots.ai] fix: stream object meta prompt llm (#546)
* fix: increase execution time - image generation * chore: increase maxDuration * fix: attachment upload management (#517) * fix: attachment upload management * chore: clean up * perf(impr): log failed chunks * feat: attachment upt cron n public browse tweaks (#520) * feat: reresh attch cron + user attach async dep upt * fix: load more missing props * fix: attachment expires typeof sql value * fix: public browse search + load more deps * perf(impr): trnx support in attch link refresh cron * [masterbots.ai] feat: stripe subscription plans and promocode support (#513) * fix whirlpool animation * feat: add validation for promo codes and subscriptions * fix: initital coderabbitai recomendations * chore: add improve to subscription flow * chore: add card switcher * chore: impr pro card * chore: fix custom class * chore: add free card newcolor * [masterbots.ai] feat: thread context file (#519) * feat(wip): thread context file * fix: typo * fix: attachment prop dep * fix: user attachments upt concurrency * feat(wip): thread context focus on open * fix: content editable selection on first render * fix: new line after enabling content editable * fix: paste text in editable content + paste context * fix: paste context + show attachment text content in public * fix: show continue message cta in cutoff content trigger * fix: contentEditable text encoding * fix: hook race condition build * [masterbots.ai] fix: bug fix and improvements (#523) * fix whirlpool animation * feat: add validation for promo codes and subscriptions * fix: initital coderabbitai recomendations * chore: add improve to subscription flow * chore: add card switcher * chore: impr pro card * chore: fix custom class * chore: add free card newcolor * chore: add improvements and medium level bug fix * feat: add example question modal * chore: fix biome format * chore: add modal and botcard redesing * chore: fix sizes * chore: enable example questions feat flag * fix(impr): onboarding card responsiveness + space & bg style --------- Co-authored-by: Roberto 'Andler' Lucas <contact@andler.dev> * chore: enable subscription page navigation * fix: attachment css + optimistic attch upt (#528) * fix: attachment css + optimistic attch upt * fix: messageAttachment ref assig loc * chore: attch cnt read for dev * [masterbots.ai] feat: onboarding and ui ux tweaks (#526) * chore: fix color and new card style * chore: restore white line * fix: flicker + include new images * chore: fix regresion issues * chore: biome corrections * fix: layout tweaks + onboard card render * fix: tailwind class * fix: tailwind class --------- Co-authored-by: Roberto 'Andler' Lucas <contact@andler.dev> * [masterbots.ai] chore(fix): change logic flow (#531) * perf: dynamic imports (#530) * perf(wip): dynamic imports * chore(fix): rm static skeleton * perf: dynamic imports in chat routes * fix: tailwind class * fix: persistent route (#529) * fix: add persistent route build * chore: remove comment section * feat: phase 4, topics & chatbot order fields + new & upt seeds (#522) * feat(wip): phase 4, topics + cat & chatbot order fields * chore: add order field in gen types * chore(wip): upt init config seed, phase 4, category order upt + wip chatbot new descriptions * style: format and lint * chore: upt chatbot new descriptions + new bots and prompts * chore: upt chatbot prompt junction seeds inserts * chore: upt chatbot categories juntion seeds * chore: upt chatbots & relationships * chore: upt chatbots & relationships * fix: order field permissions + gen * fix: onboarding chatbot description * [masterbots.ai] fix: thread popup for threadquestion page (#516) * update * fix: update * update * update * update * update * fix: thread style * fix: thread style * fix: added popup to threadQuestionPage * fix: update * fix: sub thread slug update on url: * fix: update thread question slug navigation * fix: update thread question slug navigation * fix: update thread question slug navigation * fix: update * fix: update thread path * fix: update * fix: update package data * fix: use proper error handling component on server * fix: update * fix: make the selected thread in popup open by the default * fix: focus the last sub-thread when know sub-thread slug is on the pathname * fix: popup flickering * fix: handle bot page routing and threadquestion page * fix: disable link on the bot view page * fix: question not displaying * fix: question not displaying * fix: chatbot page loading more unrelated threads --------- Co-authored-by: Roberto 'Andler' Lucas <contact@andler.dev> * [hasura] fix(restore): is_pro + pro-exclusive chatbot table params * revert: "fix: persistent route (#529)" (#533) This reverts commit cba7b70. * chore: upt canonical domains (#532) * chore: upt canonical domains * fix: getRouteType * fix: missing canonical domains and topics * fix: category slug * fix: hydration warns + continue thread upt after start * fix: upt init config chatbot inserts * chore: upt biblebot expertise + chefbot n growbot descr puntuation * fix: coderabbitai observation * [materbots.ai] perf: impr onboarding cards ui (#535) * [masterbots.ai] chore(style): logo updates (#525) * update * fix: update * update * update * update * update * feat: import logos * feat: added logo to app header * feat: app logo * chore: user page text * fix: update * feat: added bg to auth pages * fix: update * fix: wait for page to mount to load custom logos * fix: update * fix: update * fix: update * fix: update theme to use resolvedTheme instead * fix: update assets --------- Co-authored-by: Roberto 'Andler' Lucas <contact@andler.dev> * perf(impr): overall layout css spacing at mob + footer mob loc * fix: thread search context (#534) * update * fix: update * update * update * update * update * fix: thread fetching render on search * fix: thread fetching render on search * fix: rm search input from botpage welcome view * fix: introduce global search component * fix: clean up browe(public) search * fix: update * fix: search from db on personal pages instead of the eveilable threads * fix: search update * fix: clean up * chore: upt gemini models ref, web (#538) * [masterbots.ai] feat: dashboard modal (#536) * chore:add dashboard modal * chore: add dashboard to public * chore:upt design * chore: add new flow * chore: build issue + new ui * chore: fix local storage - user pref * fix: mobile chat panel a11y * fix: mobile chat panel a11y --------- Co-authored-by: Roberto 'Andler' Lucas <contact@andler.dev> * chore: gpt reasoning model upt (#543) * fix: new gpt 5 models selection & default * fix: profile layout render * [masterbots.ai] feat: impr sidebar nav onboarding (#540) * chore:add dashboard modal * chore: add dashboard to public * chore:upt design * chore: add new flow * chore: build issue + new ui * chore: fix local storage - user pref * feat: sidebar nav onboarding * chore: fix build * chore: upt local storage conditions and debug * fix: add persistent localstorage selection * feat: add consistent selection * fix: onboarding display logic --------- Co-authored-by: brandonfernandezf <brandon@bitcash.org> Co-authored-by: bran18 <andreyfdez18@gmail.com> Co-authored-by: Brandon Fernández <31634868+Bran18@users.noreply.github.com> * fix: create response stream object model temperature + impr output prompt * chore: upt default llm --------- Co-authored-by: bran18 <andreyfdez18@gmail.com> Co-authored-by: Brandon Fernández <31634868+Bran18@users.noreply.github.com> Co-authored-by: Jimoh sherifdeen <63134009+sheriffjimoh@users.noreply.github.com> Co-authored-by: brandonfernandezf <brandon@bitcash.org>
1 parent 7bcd68c commit 56a04c2

36 files changed

+1588
-390
lines changed

apps/masterbots.ai/app/actions/ai-main-call.actions.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
streamText,
3838
wrapLanguageModel,
3939
} from 'ai'
40-
import { createStreamableValue } from 'ai/rsc'
40+
import { createStreamableValue, readStreamableValue } from 'ai/rsc'
4141
import { appConfig } from 'mb-env'
4242
import type OpenAI from 'openai'
4343
import type { ZodType, z } from 'zod'
@@ -255,16 +255,18 @@ export async function processWithAiObject({
255255
chatbotMetadata,
256256
})
257257

258+
console.log('response::processWithAiObject', response)
259+
258260
// @ts-ignore
259261
const responseObject = response.curr
260262

261263
// ! Experimental. Use when stable...
262264
// for await (const resObj of readStreamableValue(response)) {
263-
// if (!resObj) {
264-
// throw new Error('Failed to process the request, object stream is null')
265-
// }
265+
// if (!resObj) {
266+
// throw new Error('Failed to process the request, object stream is null')
267+
// }
266268

267-
// responseObject = resObj
269+
// responseObject = resObj
268270
// }
269271

270272
if (!responseObject) {
@@ -380,7 +382,7 @@ export async function createResponseStream(
380382
maxSteps: 3,
381383
tools,
382384
}
383-
console.log('openAiStreamConfig', openAiStreamConfig)
385+
// console.log('openAiStreamConfig', openAiStreamConfig)
384386
if (appConfig.features.experimentalAiConfig) {
385387
// @ts-ignore: It does exist in the config
386388
openAiStreamConfig.experimental_transform = smoothStream({
@@ -459,7 +461,7 @@ export async function createResponseStream(
459461
//? Adjust configuration for Gemini 2.0 Flash Exp image generation
460462
const isGemini2FlashExp =
461463
model === 'gemini-2.0-flash-preview-image-generation'
462-
console.log('isGemini2FlashExp -> 🤖 ', isGemini2FlashExp)
464+
// console.log('isGemini2FlashExp -> 🤖 ', isGemini2FlashExp)
463465

464466
//? If using Gemini 2.0 Flash Exp, only use user messages
465467
// TODO: Improve adjustedMessages to include system prompts to have the 'user' role.
@@ -539,19 +541,21 @@ export async function createResponseStreamObject(
539541
// if (webSearch) tools.webSearch = aiTools.webSearch
540542

541543
try {
542-
const openaiModel = initializeOpenAi(model)
544+
// ? Hardcoding to a specific model due to model limitations to temperature 0
545+
const openaiModel = initializeOpenAi('gpt-4o-mini')
543546
const stream = createStreamableValue()
544-
const { partialObjectStream } = streamObject({
547+
const streamObjectResponse = streamObject({
545548
model: openaiModel,
546549
schema,
547550
output: 'object',
548551
prompt,
549552
})
550553

551554
// ? This validates the object stream before to return a object stream
552-
for await (const objectStream of partialObjectStream) {
555+
for await (const objectStream of streamObjectResponse.partialObjectStream) {
553556
if (!objectStream) {
554-
throw new Error('Failed to process the request, object stream is null')
557+
console.error('Failed to process the request, object stream is null')
558+
continue
555559
}
556560

557561
stream.update(objectStream)

apps/masterbots.ai/app/actions/thread.actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ export async function uploadAttachmentToBucket({
226226
)
227227

228228
if (byteSize !== size) {
229-
throw new Error(
230-
`Attachment size mismatch: expected ${size} bytes, got ${byteSize} bytes`,
229+
console.warn(
230+
`Careful! Attachment size mismatch: expected ${size} bytes, got ${byteSize} bytes in return.`,
231231
)
232232
}
233233

apps/masterbots.ai/app/api/chat/models/models.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ export enum AIModels {
1313
Gemini_Flash_Lite = 'gemini-2.0-flash-lite',
1414
Gemini_Flash_Lite_Pro = 'gemini-2.0-flash-lite-pro',
1515
Gemini_Flash_Pro = 'gemini-2.5-pro-preview-03-25',
16-
Default = 'gpt-5-mini', //! OpenAI_5
16+
// Default = 'gpt-5-mini', //! OpenAI_5
17+
Default = 'gpt-4o-mini', //! OpenAI_5
1718
}

apps/masterbots.ai/app/c/[category]/[domain]/[chatbot]/[threadSlug]/[threadQuestionSlug]/page.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import { redirect } from 'next/navigation'
1212

1313
const ThreadPanel = dynamic(
1414
() => import('@/components/routes/thread/thread-panel'),
15-
{
16-
loading: () => <MainContentSkeleton />,
17-
},
1815
)
1916
const ChatChatbot = dynamic(
2017
() => import('@/components/routes/chat/chat').then((mod) => mod.Chat),

apps/masterbots.ai/app/globals.css

Lines changed: 226 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
background-origin: border-box;
279279
background-clip: content-box, border-box;
280280
display: inline-block;
281-
transition: all 0.3s ease;
281+
transition: all 0.3s ease-in-out;
282282
}
283283

284284
.dark .border-gradient {
@@ -302,8 +302,9 @@
302302
rgba(128, 128, 128, 0.2) 100%
303303
);
304304
background-size: 100% 100%, 200% 100%;
305-
background-position: 0 0, 0 0;
306-
animation: gradient-shift 3s linear infinite;
305+
background-position: 0% 0%, 0% 0%;
306+
transition-property: all;
307+
animation: gradient-shift 1.5s linear infinite;
307308
}
308309

309310
.dark .border-gradient:hover:not(.pro-card),
@@ -342,11 +343,11 @@
342343
}
343344

344345
@keyframes gradient-shift {
345-
0% {
346-
background-position: 0 0, 0 0;
346+
from {
347+
background-position: 0% 0%, 0% 0%;
347348
}
348-
100% {
349-
background-position: 0 0, 200% 0;
349+
to {
350+
background-position: 0% 0%, 200% 0%;
350351
}
351352
}
352353

@@ -614,7 +615,7 @@
614615
background-origin: border-box;
615616
background-clip: content-box, border-box;
616617
background-size: 100% 100%, 200% 100%;
617-
background-position: 0 0, 0 0;
618+
background-position: 0% 0%, 0% 0%;
618619
animation: pro-gradient-shift 4s linear infinite;
619620
}
620621

@@ -651,10 +652,10 @@
651652

652653
@keyframes pro-gradient-shift {
653654
0% {
654-
background-position: 0 0, 0 0;
655+
background-position: 0% 0%, 0% 0%;
655656
}
656657
100% {
657-
background-position: 0 0, 200% 0;
658+
background-position: 0% 0%, 200% 0%;
658659
}
659660
}
660661

@@ -852,5 +853,219 @@
852853
}
853854

854855
.profile-hero-bg {
855-
@apply w-full relative bg-center bg-cover bg-[url('/hero-bg.jpg')] bg-no-repeat py-6;
856+
background-size: cover;
857+
background-position: center;
858+
background-repeat: no-repeat;
859+
}
860+
861+
/* NextStep Onboarding Custom Styling */
862+
.nextstep-overlay {
863+
background: rgba(0, 0, 0, 0.6) !important;
864+
backdrop-filter: blur(2px);
865+
}
866+
867+
.nextstep-card {
868+
background: rgb(255 255 255 / 0.95) !important;
869+
border: 2px solid rgb(139 92 246 / 0.3) !important;
870+
border-radius: 12px !important;
871+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px
872+
rgba(0, 0, 0, 0.04), 0 0 0 2px rgba(139, 92, 246, 0.2) !important;
873+
backdrop-filter: blur(8px) !important;
874+
overflow: hidden !important;
875+
position: relative !important;
876+
}
877+
878+
.dark .nextstep-card {
879+
background: rgb(9 9 11 / 0.95) !important;
880+
border-color: rgb(139 92 246 / 0.4) !important;
881+
}
882+
883+
/* Route-based theming for onboarding cards */
884+
[data-route="chat"] .nextstep-card {
885+
border-color: rgb(139 92 246 / 0.3) !important;
886+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px
887+
rgba(0, 0, 0, 0.04), 0 0 0 2px rgba(139, 92, 246, 0.2) !important;
888+
}
889+
890+
[data-route="public"] .nextstep-card {
891+
border-color: rgb(34 197 94 / 0.3) !important;
892+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px
893+
rgba(0, 0, 0, 0.04), 0 0 0 2px rgba(34, 197, 94, 0.2) !important;
894+
}
895+
896+
/* Background pattern for onboarding cards */
897+
.nextstep-card::before {
898+
content: "";
899+
position: absolute;
900+
top: 0;
901+
left: 0;
902+
right: 0;
903+
bottom: 0;
904+
background-image: url("/background-light.webp");
905+
background-size: cover;
906+
background-position: center;
907+
opacity: 0.05;
908+
z-index: -1;
909+
}
910+
911+
.dark .nextstep-card::before {
912+
background-image: url("/background.webp");
913+
opacity: 0.08;
914+
}
915+
916+
/* Card header styling */
917+
.nextstep-card .nextstep-card-header {
918+
padding: 20px 24px 16px !important;
919+
border-bottom: 1px solid rgb(229 231 235 / 0.5) !important;
920+
}
921+
922+
.dark .nextstep-card .nextstep-card-header {
923+
border-bottom-color: rgb(63 63 70 / 0.5) !important;
924+
}
925+
926+
/* Title styling */
927+
.nextstep-card .nextstep-card-title {
928+
font-size: 18px !important;
929+
font-weight: 600 !important;
930+
margin-bottom: 4px !important;
931+
display: flex !important;
932+
align-items: center !important;
933+
gap: 8px !important;
934+
}
935+
936+
[data-route="chat"] .nextstep-card .nextstep-card-title {
937+
color: rgb(147 51 234) !important;
938+
}
939+
940+
[data-route="public"] .nextstep-card .nextstep-card-title {
941+
color: rgb(34 197 94) !important;
942+
}
943+
944+
.dark [data-route="chat"] .nextstep-card .nextstep-card-title {
945+
color: rgb(196 181 253) !important;
946+
}
947+
948+
.dark [data-route="public"] .nextstep-card .nextstep-card-title {
949+
color: rgb(134 239 172) !important;
950+
}
951+
952+
/* Content styling */
953+
.nextstep-card .nextstep-card-content {
954+
padding: 16px 24px 20px !important;
955+
font-size: 14px !important;
956+
line-height: 1.5 !important;
957+
color: rgb(75 85 99) !important;
958+
}
959+
960+
.dark .nextstep-card .nextstep-card-content {
961+
color: rgb(209 213 219) !important;
962+
}
963+
964+
/* Button styling */
965+
.nextstep-card .nextstep-card-footer {
966+
padding: 16px 24px 20px !important;
967+
border-top: 1px solid rgb(229 231 235 / 0.5) !important;
968+
display: flex !important;
969+
justify-content: space-between !important;
970+
align-items: center !important;
971+
}
972+
973+
.dark .nextstep-card .nextstep-card-footer {
974+
border-top-color: rgb(63 63 70 / 0.5) !important;
975+
}
976+
977+
.nextstep-card .nextstep-button {
978+
padding: 8px 16px !important;
979+
border-radius: 6px !important;
980+
font-size: 14px !important;
981+
font-weight: 500 !important;
982+
transition: all 0.2s ease !important;
983+
}
984+
985+
.nextstep-card .nextstep-button-primary {
986+
background: rgb(139 92 246) !important;
987+
color: white !important;
988+
border: none !important;
989+
}
990+
991+
.nextstep-card .nextstep-button-primary:hover {
992+
background: rgb(124 58 237) !important;
993+
transform: translateY(-1px) !important;
994+
}
995+
996+
[data-route="public"] .nextstep-card .nextstep-button-primary {
997+
background: rgb(34 197 94) !important;
998+
}
999+
1000+
[data-route="public"] .nextstep-card .nextstep-button-primary:hover {
1001+
background: rgb(22 163 74) !important;
1002+
}
1003+
1004+
.nextstep-card .nextstep-button-secondary {
1005+
background: transparent !important;
1006+
color: rgb(107 114 128) !important;
1007+
border: 1px solid rgb(209 213 219) !important;
1008+
}
1009+
1010+
.nextstep-card .nextstep-button-secondary:hover {
1011+
background: rgb(249 250 251) !important;
1012+
border-color: rgb(156 163 175) !important;
1013+
}
1014+
1015+
.dark .nextstep-card .nextstep-button-secondary {
1016+
color: rgb(156 163 175) !important;
1017+
border-color: rgb(75 85 99) !important;
1018+
}
1019+
1020+
.dark .nextstep-card .nextstep-button-secondary:hover {
1021+
background: rgb(31 41 55) !important;
1022+
border-color: rgb(107 114 128) !important;
1023+
}
1024+
1025+
/* Step indicator */
1026+
.nextstep-card .nextstep-step-indicator {
1027+
position: absolute !important;
1028+
top: 16px !important;
1029+
right: 20px !important;
1030+
width: 32px !important;
1031+
height: 32px !important;
1032+
border-radius: 50% !important;
1033+
display: flex !important;
1034+
align-items: center !important;
1035+
justify-content: center !important;
1036+
font-size: 12px !important;
1037+
font-weight: bold !important;
1038+
color: white !important;
1039+
z-index: 10 !important;
1040+
}
1041+
1042+
[data-route="chat"] .nextstep-card .nextstep-step-indicator {
1043+
background: rgb(139 92 246) !important;
1044+
}
1045+
1046+
[data-route="public"] .nextstep-card .nextstep-step-indicator {
1047+
background: rgb(34 197 94) !important;
1048+
}
1049+
1050+
/* Shine effect */
1051+
.nextstep-card::after {
1052+
content: "";
1053+
position: absolute;
1054+
top: 0;
1055+
left: -100%;
1056+
width: 100%;
1057+
height: 100%;
1058+
background: linear-gradient(
1059+
90deg,
1060+
transparent,
1061+
rgba(255, 255, 255, 0.2),
1062+
transparent
1063+
);
1064+
transition: left 0.8s ease;
1065+
z-index: 5;
1066+
pointer-events: none;
1067+
}
1068+
1069+
.nextstep-card:hover::after {
1070+
left: 100%;
8561071
}

0 commit comments

Comments
 (0)