stashes 0.1.30 → 0.1.31
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
|
@@ -1618,6 +1618,7 @@ class StashService {
|
|
|
1618
1618
|
this.isProcessingMessage = false;
|
|
1619
1619
|
}
|
|
1620
1620
|
async processMessage(projectId, chatId, message, referenceStashIds, componentContext) {
|
|
1621
|
+
const preExistingStashIds = new Set(this.persistence.listStashes(projectId).map((s) => s.id));
|
|
1621
1622
|
const component = componentContext ? { name: componentContext.name, filePath: this.selectedComponent?.filePath || "" } : this.selectedComponent;
|
|
1622
1623
|
let sourceCode = "";
|
|
1623
1624
|
const filePath = component?.filePath || "";
|
|
@@ -1776,7 +1777,7 @@ ${sourceCode.substring(0, 3000)}
|
|
|
1776
1777
|
await aiProcess.process.exited;
|
|
1777
1778
|
flushThinking();
|
|
1778
1779
|
flushText();
|
|
1779
|
-
this.syncStashesFromDisk(projectId, chatId);
|
|
1780
|
+
this.syncStashesFromDisk(projectId, chatId, preExistingStashIds);
|
|
1780
1781
|
} catch (err) {
|
|
1781
1782
|
this.broadcast({
|
|
1782
1783
|
type: "ai_stream",
|
|
@@ -1789,10 +1790,10 @@ ${sourceCode.substring(0, 3000)}
|
|
|
1789
1790
|
killAiProcess("chat");
|
|
1790
1791
|
}
|
|
1791
1792
|
}
|
|
1792
|
-
syncStashesFromDisk(projectId, chatId) {
|
|
1793
|
+
syncStashesFromDisk(projectId, chatId, preExistingIds) {
|
|
1793
1794
|
const diskStashes = this.persistence.listStashes(projectId);
|
|
1794
1795
|
for (const stash of diskStashes) {
|
|
1795
|
-
if (chatId && !stash.originChatId) {
|
|
1796
|
+
if (chatId && !stash.originChatId && preExistingIds && !preExistingIds.has(stash.id)) {
|
|
1796
1797
|
this.persistence.saveStash({ ...stash, originChatId: chatId });
|
|
1797
1798
|
}
|
|
1798
1799
|
this.broadcast({
|
|
@@ -1824,7 +1825,7 @@ ${sourceCode.substring(0, 3000)}
|
|
|
1824
1825
|
for (const stash of stashes) {
|
|
1825
1826
|
const prev = lastStatus.get(stash.id);
|
|
1826
1827
|
if (!prev || prev !== stash.status) {
|
|
1827
|
-
if (chatId && !stash.originChatId) {
|
|
1828
|
+
if (chatId && !stash.originChatId && !prev) {
|
|
1828
1829
|
this.persistence.saveStash({ ...stash, originChatId: chatId });
|
|
1829
1830
|
}
|
|
1830
1831
|
this.broadcast({
|
package/dist/mcp.js
CHANGED
|
@@ -1814,6 +1814,7 @@ class StashService {
|
|
|
1814
1814
|
this.isProcessingMessage = false;
|
|
1815
1815
|
}
|
|
1816
1816
|
async processMessage(projectId, chatId, message, referenceStashIds, componentContext) {
|
|
1817
|
+
const preExistingStashIds = new Set(this.persistence.listStashes(projectId).map((s) => s.id));
|
|
1817
1818
|
const component = componentContext ? { name: componentContext.name, filePath: this.selectedComponent?.filePath || "" } : this.selectedComponent;
|
|
1818
1819
|
let sourceCode = "";
|
|
1819
1820
|
const filePath = component?.filePath || "";
|
|
@@ -1972,7 +1973,7 @@ ${sourceCode.substring(0, 3000)}
|
|
|
1972
1973
|
await aiProcess.process.exited;
|
|
1973
1974
|
flushThinking();
|
|
1974
1975
|
flushText();
|
|
1975
|
-
this.syncStashesFromDisk(projectId, chatId);
|
|
1976
|
+
this.syncStashesFromDisk(projectId, chatId, preExistingStashIds);
|
|
1976
1977
|
} catch (err) {
|
|
1977
1978
|
this.broadcast({
|
|
1978
1979
|
type: "ai_stream",
|
|
@@ -1985,10 +1986,10 @@ ${sourceCode.substring(0, 3000)}
|
|
|
1985
1986
|
killAiProcess("chat");
|
|
1986
1987
|
}
|
|
1987
1988
|
}
|
|
1988
|
-
syncStashesFromDisk(projectId, chatId) {
|
|
1989
|
+
syncStashesFromDisk(projectId, chatId, preExistingIds) {
|
|
1989
1990
|
const diskStashes = this.persistence.listStashes(projectId);
|
|
1990
1991
|
for (const stash of diskStashes) {
|
|
1991
|
-
if (chatId && !stash.originChatId) {
|
|
1992
|
+
if (chatId && !stash.originChatId && preExistingIds && !preExistingIds.has(stash.id)) {
|
|
1992
1993
|
this.persistence.saveStash({ ...stash, originChatId: chatId });
|
|
1993
1994
|
}
|
|
1994
1995
|
this.broadcast({
|
|
@@ -2020,7 +2021,7 @@ ${sourceCode.substring(0, 3000)}
|
|
|
2020
2021
|
for (const stash of stashes) {
|
|
2021
2022
|
const prev = lastStatus.get(stash.id);
|
|
2022
2023
|
if (!prev || prev !== stash.status) {
|
|
2023
|
-
if (chatId && !stash.originChatId) {
|
|
2024
|
+
if (chatId && !stash.originChatId && !prev) {
|
|
2024
2025
|
this.persistence.saveStash({ ...stash, originChatId: chatId });
|
|
2025
2026
|
}
|
|
2026
2027
|
this.broadcast({
|