zjbar-opencode 1.1.6 → 1.1.8
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/index.js +7 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -160,7 +160,7 @@ var ZjbarPlugin = async ({ directory, client }) => {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function sendToZjbar(hookEvent, toolName, summary) {
|
|
163
|
+
function sendToZjbar(hookEvent, toolName, summary, skipDesktop) {
|
|
164
164
|
const payload = JSON.stringify({
|
|
165
165
|
source: "opencode",
|
|
166
166
|
pane_id: parseInt(paneId, 10),
|
|
@@ -181,7 +181,7 @@ var ZjbarPlugin = async ({ directory, client }) => {
|
|
|
181
181
|
payload
|
|
182
182
|
], { detached: true, stdio: "ignore" });
|
|
183
183
|
child.unref();
|
|
184
|
-
if (shouldNotify(hookEvent, paneId, termProgram)) {
|
|
184
|
+
if (!skipDesktop && shouldNotify(hookEvent, paneId, termProgram)) {
|
|
185
185
|
sendNotification(hookEvent, paneId, zellijSession, termProgram, summary);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
@@ -195,14 +195,16 @@ var ZjbarPlugin = async ({ directory, client }) => {
|
|
|
195
195
|
sendToZjbar("SessionStart");
|
|
196
196
|
break;
|
|
197
197
|
case "session.idle": {
|
|
198
|
+
sendToZjbar("Stop", null, null, true);
|
|
198
199
|
const sid = ev.properties?.sessionID || activeSessionId;
|
|
199
|
-
let summary = null;
|
|
200
200
|
if (sid && client) {
|
|
201
201
|
try {
|
|
202
|
-
summary = await getSessionSummary(client, sid);
|
|
202
|
+
const summary = await getSessionSummary(client, sid);
|
|
203
|
+
if (summary && shouldNotify("Stop", paneId, termProgram)) {
|
|
204
|
+
sendNotification("Stop", paneId, zellijSession, termProgram, summary);
|
|
205
|
+
}
|
|
203
206
|
} catch {}
|
|
204
207
|
}
|
|
205
|
-
sendToZjbar("Stop", null, summary);
|
|
206
208
|
break;
|
|
207
209
|
}
|
|
208
210
|
case "session.deleted":
|