opencode-work-context 0.4.11 → 0.4.12

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.4.11",
4
+ "version": "0.4.12",
5
5
  "description": "Filesystem work-context core and OpenCode adapter",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -30,6 +30,12 @@ const statusMarker = (status) => ({
30
30
  export { readStagesSnapshot, renderStagesPanel };
31
31
 
32
32
  const defaultRuntime = { jsx };
33
+ const renderAttentionText = (value, runtime) => {
34
+ const parts = value.split(/(\[ATTN[^\]]*\])/g);
35
+ return parts.length === 1 ? value : parts.filter(Boolean).map((part) => part.startsWith("[ATTN")
36
+ ? runtime.jsx("b", { children: part })
37
+ : part);
38
+ };
33
39
 
34
40
  const renderStagesContent = (result, theme, runtime = defaultRuntime, attention, showDependencies = true, onStageSelect) => !result?.ok || !result.data?.workspace
35
41
  ? [
@@ -50,6 +56,7 @@ const renderStagesContent = (result, theme, runtime = defaultRuntime, attention,
50
56
  }),
51
57
  ...result.data.stages.map((stage) => {
52
58
  const unread = attention?.attentionForStage?.(result.data.workspace.id, stage.id);
59
+ const stageText = `${stage.id}. ${stage.title}${showDependencies && stage.depends_on?.length ? `\nDeps: ${stage.depends_on.join(", ")}` : ""}${unread ? ` [ATTN: ${attentionReasonText(unread.reason)}${unread.count > 1 ? ` x${unread.count}` : ""}]` : ""}`;
53
60
  return runtime.jsx("box", {
54
61
  flexDirection: "row",
55
62
  onMouseDown: (event) => {
@@ -58,7 +65,7 @@ const renderStagesContent = (result, theme, runtime = defaultRuntime, attention,
58
65
  },
59
66
  children: [
60
67
  runtime.jsx("text", { flexShrink: 0, marginRight: 1, fg: stage.current || stage.id === result.data.currentStage ? theme?.current?.warning : theme?.current?.textMuted, children: statusMarker(stage.status) }),
61
- runtime.jsx("text", { flexGrow: 1, flexShrink: 1, wrapMode: "word", fg: stage.current || stage.id === result.data.currentStage ? theme?.current?.warning : theme?.current?.textMuted, children: `${stage.id}. ${stage.title}${showDependencies && stage.depends_on?.length ? `\nDeps: ${stage.depends_on.join(", ")}` : ""}${unread ? ` [ATTN: ${attentionReasonText(unread.reason)}${unread.count > 1 ? ` x${unread.count}` : ""}]` : ""}` }),
68
+ runtime.jsx("text", { flexGrow: 1, flexShrink: 1, wrapMode: "word", fg: stage.current || stage.id === result.data.currentStage ? theme?.current?.warning : theme?.current?.textMuted, children: renderAttentionText(stageText, runtime) }),
62
69
  ],
63
70
  });
64
71
  }),