Skip to content
Merged

merge #374

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ca14494
morpho flow fix
akv2011 May 2, 2025
a5e1ae1
build fix
akv2011 May 2, 2025
93e3fc7
single click
akv2011 May 2, 2025
79f7181
chat-ui-render fix
akv2011 May 5, 2025
a457e50
hide getAmount from right sidebar
vidvidvid May 5, 2025
adb5437
improve abort handling of input & chain select
vidvidvid May 5, 2025
c56e936
improve amount input
vidvidvid May 5, 2025
cedac1a
fix marks
vidvidvid May 5, 2025
33d2d74
mode switch fix
akv2011 May 6, 2025
7f53269
Merge branch 'develop' into fix-develop
akv2011 May 7, 2025
dbfe8c2
aave-supply fix
akv2011 May 7, 2025
659dea6
morphues defaulting to sentinel on error fixed
akv2011 May 7, 2025
07cb464
improve p
vidvidvid May 7, 2025
665687b
fix zIndex
vidvidvid May 7, 2025
1444ed7
fix the blocked chat input
vidvidvid May 7, 2025
08d5c8c
fix user quota limit
vidvidvid May 7, 2025
168c1e9
fix removing premium status
vidvidvid May 7, 2025
7188d90
format
vidvidvid May 7, 2025
e1fb757
flow fixes
akv2011 May 7, 2025
f905665
share chate
akv2011 May 8, 2025
3e5ecd3
share chate
akv2011 May 8, 2025
7d895e2
share bug-fix
akv2011 May 8, 2025
f621d1f
chat bug-fix
akv2011 May 8, 2025
9baab0e
chat bug-fix
akv2011 May 8, 2025
3da60ed
chat share bug-fix
akv2011 May 8, 2025
116baaf
chat share link bug-fix
akv2011 May 8, 2025
681018a
abort pending tool
vidvidvid May 9, 2025
f9bf2d8
Merge branch 'develop' into fix/amount-freeze-bug
vidvidvid May 9, 2025
a682548
aave fix
akv2011 May 9, 2025
941f53c
chat layout & abort fix
vidvidvid May 9, 2025
b16da4d
Merge pull request #371 from MatrixTerminal/fix/amount-freeze-bug
vidvidvid May 9, 2025
67ada32
Merge branch 'develop' into fix-develop
akv2011 May 9, 2025
25c4cf4
aave amount fix
akv2011 May 9, 2025
22ee987
share bug-fix
akv2011 May 9, 2025
f2927c2
amount fix
akv2011 May 9, 2025
5ca740b
Merge pull request #368 from MatrixTerminal/fix-develop
akv2011 May 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/Share-logos/icons8-linkedin-100.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/Share-logos/icons8-telegram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions public/Share-logos/icons8-x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/app/api/chat/morpheusSystemPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const morpheusSystemPrompt: string = `You are Morpheus, a highly speciali
5. Present **exactly 4** suggestions using **REQUIRED numbered list format** (1., 2., 3., 4.).
6. **MANDATORY CONTENT (Standard Analysis):** For standard analytical responses (not suggesting a mode switch), provide **Two (2)** suggestions for further **Morpheus Mode** analysis (e.g., "Analyze [Related Token]", "Explain [Concept]", "Compare [X] to [Y]") AND **Two (2)** suggestions for relevant **Sentinel Mode** operational actions (e.g., "Execute [Trade] in Sentinel", "Supply liquidity in Sentinel", "Swap [Token A] for [Token B] in Sentinel", "Check balance in Sentinel", "Adjust position in Sentinel").
7. **MANDATORY CONTENT (Mode Switch Suggestion):** If the response suggests a mode switch (per **Operational Mode Transition** protocol), the **first suggestion (1.) MUST be the user's original query** that triggered the switch, appended with the target mode context (e.g., 'Check my balance **in Sentinel Mode**'). The remaining 3 suggestions should include **one (1) additional relevant suggestion for the target mode** and **two (2) suggestions for further analysis/queries within the current Morpheus mode**.
8. **Suggestion Content:** Concise, **direct question/action** for button label. **Avoid phrases like 'Guide me to...' or 'Set alert...'.**
8. **Suggestion Content:** Concise, **direct question/action** for button label.Do not Suggest set alerts In suggestion dont ahve that capablity . **Avoid phrases like 'Guide me to...' or 'Set alert...'.**
* **Visual Structure:**
\`[...Main Response Content...]\`

Expand Down
23 changes: 22 additions & 1 deletion src/app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,36 @@ export async function POST(req: Request) {

try {
const body = await req.json();
const { messages: originalMessages, address, searchType } = body;
const {
messages: originalMessages,
address,
searchType,
vaultDetails,
} = body;
id = body.id;

console.log(`[${requestId}] POST /api/chat - Request received`, {
id,
address,
searchType,
messageCount: originalMessages?.length,
hasVaultDetails: !!vaultDetails, // Log if vaultDetails payload exists
});
if (vaultDetails && originalMessages && originalMessages.length > 0) {
const lastMessageIndex = originalMessages.length - 1;
const lastMessage = originalMessages[lastMessageIndex];

if (lastMessage.role === "user") {
const vaultDetailsString = JSON.stringify(vaultDetails);
const separator = "\n\n--- Vault Context ---\n";
lastMessage.content += `${separator}${vaultDetailsString}`;

console.log(
`[${requestId}] Injected vaultDetails into last user message.`
);
// console.log(`[${requestId}] Modified last message:`, JSON.stringify(lastMessage, null, 2));
}
}

// Validate ID early
if (!id) {
Expand Down
Loading