stashes 0.1.36 → 0.1.37
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/dist/cli.js
CHANGED
|
@@ -2012,7 +2012,8 @@ function createWebSocketHandler(projectPath, userDevPort, appProxyPort) {
|
|
|
2012
2012
|
case "select_component":
|
|
2013
2013
|
stashService.setSelectedComponent(event.component);
|
|
2014
2014
|
break;
|
|
2015
|
-
case "message":
|
|
2015
|
+
case "message": {
|
|
2016
|
+
const isFirstMessage = persistence.getChatMessages(event.projectId, event.chatId).length === 0;
|
|
2016
2017
|
persistence.saveChatMessage(event.projectId, event.chatId, {
|
|
2017
2018
|
id: crypto.randomUUID(),
|
|
2018
2019
|
role: "user",
|
|
@@ -2022,8 +2023,16 @@ function createWebSocketHandler(projectPath, userDevPort, appProxyPort) {
|
|
|
2022
2023
|
referenceStashIds: event.referenceStashIds,
|
|
2023
2024
|
componentContext: event.componentContext
|
|
2024
2025
|
});
|
|
2026
|
+
if (isFirstMessage) {
|
|
2027
|
+
const chat = persistence.getChat(event.projectId, event.chatId);
|
|
2028
|
+
if (chat) {
|
|
2029
|
+
const title = event.message.length > 80 ? event.message.substring(0, 80).trimEnd() + "\u2026" : event.message;
|
|
2030
|
+
persistence.saveChat({ ...chat, title });
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2025
2033
|
await stashService.message(event.projectId, event.chatId, event.message, event.referenceStashIds, event.componentContext);
|
|
2026
2034
|
break;
|
|
2035
|
+
}
|
|
2027
2036
|
case "interact":
|
|
2028
2037
|
await stashService.switchPreview(event.stashId, event.sortedStashIds);
|
|
2029
2038
|
break;
|
package/dist/mcp.js
CHANGED
|
@@ -2208,7 +2208,8 @@ function createWebSocketHandler(projectPath, userDevPort, appProxyPort) {
|
|
|
2208
2208
|
case "select_component":
|
|
2209
2209
|
stashService.setSelectedComponent(event.component);
|
|
2210
2210
|
break;
|
|
2211
|
-
case "message":
|
|
2211
|
+
case "message": {
|
|
2212
|
+
const isFirstMessage = persistence.getChatMessages(event.projectId, event.chatId).length === 0;
|
|
2212
2213
|
persistence.saveChatMessage(event.projectId, event.chatId, {
|
|
2213
2214
|
id: crypto.randomUUID(),
|
|
2214
2215
|
role: "user",
|
|
@@ -2218,8 +2219,16 @@ function createWebSocketHandler(projectPath, userDevPort, appProxyPort) {
|
|
|
2218
2219
|
referenceStashIds: event.referenceStashIds,
|
|
2219
2220
|
componentContext: event.componentContext
|
|
2220
2221
|
});
|
|
2222
|
+
if (isFirstMessage) {
|
|
2223
|
+
const chat = persistence.getChat(event.projectId, event.chatId);
|
|
2224
|
+
if (chat) {
|
|
2225
|
+
const title = event.message.length > 80 ? event.message.substring(0, 80).trimEnd() + "\u2026" : event.message;
|
|
2226
|
+
persistence.saveChat({ ...chat, title });
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2221
2229
|
await stashService.message(event.projectId, event.chatId, event.message, event.referenceStashIds, event.componentContext);
|
|
2222
2230
|
break;
|
|
2231
|
+
}
|
|
2223
2232
|
case "interact":
|
|
2224
2233
|
await stashService.switchPreview(event.stashId, event.sortedStashIds);
|
|
2225
2234
|
break;
|