opencode-work-context 0.10.0 → 0.10.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-work-context",
3
3
  "type": "module",
4
- "version": "0.10.0",
4
+ "version": "0.10.1",
5
5
  "description": "Filesystem work-context core and OpenCode adapter",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -58,6 +58,15 @@ const stageCandidateText = (stage) => {
58
58
  return `Pending: ${candidate.status} · ${candidate.strategy}${others.length ? ` · also ${others.join(", ")}` : ""}`;
59
59
  };
60
60
  const capitalize = (value) => value ? `${value[0].toUpperCase()}${value.slice(1)}` : value;
61
+ const visibleAttentionSnapshot = (attention, workspace, stages) => {
62
+ const byStage = new Map(stages.map((stage) => [stage.id, attention?.attentionForStage?.(workspace, stage.id) || null]));
63
+ const bySession = new Map();
64
+ for (const unread of byStage.values()) {
65
+ for (const item of unread?.items || []) bySession.set(item.sessionId, item);
66
+ }
67
+ const items = [...bySession.values()];
68
+ return { byStage, workspace: items.length ? { count: items.length, items } : null };
69
+ };
61
70
 
62
71
  export { readStagesSnapshot, renderStagesPanel };
63
72
 
@@ -67,7 +76,8 @@ const renderStagesContent = (result, theme, runtime = defaultRuntime, attention,
67
76
  runtime.jsx("text", { children: runtime.jsx("b", { children: "Stages" }) }),
68
77
  ...renderStagesPanel(result).split("\n").slice(1).map((line) => runtime.jsx("text", { children: line })),
69
78
  ];
70
- const workspaceAttention = attentionSummaryText(attention?.attentionForWorkspace?.(result.data.workspace.id), { alwaysCount: true });
79
+ const attentionSnapshot = visibleAttentionSnapshot(attention, result.data.workspace.id, result.data.stages);
80
+ const workspaceAttention = attentionSummaryText(attentionSnapshot.workspace, { alwaysCount: true });
71
81
  return [
72
82
  runtime.jsx("box", {
73
83
  marginBottom: 1,
@@ -88,7 +98,7 @@ const renderStagesContent = (result, theme, runtime = defaultRuntime, attention,
88
98
  ],
89
99
  }),
90
100
  ...result.data.stages.flatMap((stage) => {
91
- const unread = attention?.attentionForStage?.(result.data.workspace.id, stage.id);
101
+ const unread = attentionSnapshot.byStage.get(stage.id);
92
102
  const working = attention?.activityForStage?.(result.data.workspace.id, stage.id);
93
103
  const recommendation = stage.execution_profile && stage.execution_depth && stage.recommended_model
94
104
  ? `${capitalize(stage.execution_profile)} · ${capitalize(stage.execution_depth)} · ${capitalize(stage.recommended_model)}`