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 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-work-context",
3
3
  "type": "module",
4
- "version": "0.4.5",
4
+ "version": "0.4.6",
5
5
  "description": "Filesystem work-context core and OpenCode adapter",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -78,7 +78,9 @@ export const globalAttentionToast = (event) => {
78
78
  duration: 5000,
79
79
  };
80
80
  };
81
- export const attentionForSession = (api, sessionId) => api?.workContextAttention?.attentionFor?.(sessionId) || null;
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 })));