@xinleibird/bridge-opencode 0.2.6 → 0.2.7
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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bridge.ts
CHANGED
|
@@ -104,8 +104,25 @@ export const BridgePlugin: Plugin = async ({ directory }) => {
|
|
|
104
104
|
pendingByCallID.delete(input.callID);
|
|
105
105
|
|
|
106
106
|
for (const filePath of pending.filePaths) {
|
|
107
|
-
await
|
|
108
|
-
|
|
107
|
+
const before = await checkBuffer(filePath);
|
|
108
|
+
let reloadSucceeded = false;
|
|
109
|
+
try {
|
|
110
|
+
await refreshBuffer(filePath);
|
|
111
|
+
reloadSucceeded = true;
|
|
112
|
+
} catch (err) {
|
|
113
|
+
console.error(`Failed to reload ${filePath}:`, err);
|
|
114
|
+
} finally {
|
|
115
|
+
if (before.isCurrent) {
|
|
116
|
+
try {
|
|
117
|
+
await sendMessage(
|
|
118
|
+
reloadSucceeded ? "🔄 Reloaded by OpenCode." : "⚠️ Reload failed.",
|
|
119
|
+
reloadSucceeded ? "info" : "warn",
|
|
120
|
+
);
|
|
121
|
+
} catch {
|
|
122
|
+
// non-fatal
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
109
126
|
}
|
|
110
127
|
},
|
|
111
128
|
|