opencode-work-context 0.4.5 → 0.4.6
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/README.md +3 -1
- package/package.json +1 -1
- package/plugin/attention.js +5 -1
package/README.md
CHANGED
|
@@ -268,7 +268,9 @@ owned by an OpenCode instance other than the most recently active live instance.
|
|
|
268
268
|
Each instance refreshes its lease independently, so a crashed process expires
|
|
269
269
|
without holding ownership. If the global channel is unavailable, focus falls
|
|
270
270
|
back to OpenTUI's renderer events and unknown focus is conservatively treated as
|
|
271
|
-
foreground.
|
|
271
|
+
foreground. Attention indicators omit the native session already open in the
|
|
272
|
+
current route; retained background state is acknowledged when that session
|
|
273
|
+
receives focus or keyboard activity.
|
|
272
274
|
|
|
273
275
|
To verify cross-project delivery, install and load the TUI integration in two
|
|
274
276
|
projects, start work in linked session A, then interact with OpenCode B before A
|
package/package.json
CHANGED
package/plugin/attention.js
CHANGED
|
@@ -78,7 +78,9 @@ export const globalAttentionToast = (event) => {
|
|
|
78
78
|
duration: 5000,
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
export const attentionForSession = (api, sessionId) =>
|
|
81
|
+
export const attentionForSession = (api, sessionId) => sessionId === currentSessionId(api)
|
|
82
|
+
? null
|
|
83
|
+
: api?.workContextAttention?.attentionFor?.(sessionId) || null;
|
|
82
84
|
export const acknowledgeNavigation = (api, sessionId, observedEventKey) => {
|
|
83
85
|
if (!sessionId || !observedEventKey) return false;
|
|
84
86
|
return api?.workContextAttention?.acknowledge?.(sessionId, observedEventKey) === true;
|
|
@@ -306,7 +308,9 @@ export const createAttentionTuiController = ({ api, projectRoot, read = readWork
|
|
|
306
308
|
const acknowledge = (sessionId, observedEventKey) => engine.acknowledge(sessionId, observedEventKey);
|
|
307
309
|
const aggregate = (matches) => {
|
|
308
310
|
const bySession = new Map();
|
|
311
|
+
const current = currentSessionId(api);
|
|
309
312
|
for (const attention of engine.list()) {
|
|
313
|
+
if (attention.sessionId === current) continue;
|
|
310
314
|
const records = (snapshot?.workspaces || []).flatMap((workspace) => (workspace.sessions || [])
|
|
311
315
|
.filter((session) => session.opencode_session_id === attention.sessionId)
|
|
312
316
|
.map((session) => ({ workspace, session })));
|