@goodnesshq/opencode-notification 0.1.6 → 0.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.
@@ -20,11 +20,11 @@ const SCHEMA_SOURCE_PATH = join(SCRIPT_DIR, "oc-notify.schema.json");
20
20
  const DEFAULTS = {
21
21
  enabled: true,
22
22
  title: "",
23
- tier: "standard",
24
- detailLevel: "full",
23
+ tier: "focus",
24
+ detailLevel: "title-only",
25
25
  responseComplete: {
26
26
  enabled: true,
27
- trigger: "message.updated",
27
+ trigger: "session.idle",
28
28
  },
29
29
  channels: {
30
30
  mac: {
@@ -465,25 +465,20 @@ async function main() {
465
465
  ? await promptSelect({
466
466
  message: "Select a tier:",
467
467
  choices: [
468
- { name: "Minimal", value: "minimal" },
469
- { name: "Standard", value: "standard" },
470
- { name: "Verbose", value: "verbose" },
468
+ { name: "Focus (requests + completion)", value: "focus" },
469
+ { name: "Full (standard + failures + summary)", value: "full" },
471
470
  { name: "Custom", value: "custom" },
472
471
  ],
473
- defaultValue: "standard",
472
+ defaultValue: "focus",
474
473
  })
475
474
  : await (async () => {
476
- console.log(
477
- "\nSelect a tier:\n 1) Minimal\n 2) Standard\n 3) Verbose\n 4) Custom",
478
- );
479
- const tierInput = await rl.question("> [2] ");
480
- return tierInput.trim() === "1"
481
- ? "minimal"
475
+ console.log("\nSelect a tier:\n 1) Focus (requests + completion)\n 2) Full (standard + failures + summary)\n 3) Custom");
476
+ const tierInput = await rl.question("> [1] ");
477
+ return tierInput.trim() === "2"
478
+ ? "full"
482
479
  : tierInput.trim() === "3"
483
- ? "verbose"
484
- : tierInput.trim() === "4"
485
- ? "custom"
486
- : "standard";
480
+ ? "custom"
481
+ : "focus";
487
482
  })();
488
483
 
489
484
  const trigger = interactive
@@ -497,18 +492,18 @@ async function main() {
497
492
  value: "message.part.updated",
498
493
  },
499
494
  ],
500
- defaultValue: "message.updated",
495
+ defaultValue: "session.idle",
501
496
  })
502
497
  : await (async () => {
503
498
  console.log(
504
499
  "\nResponse-complete trigger:\n 1) session.idle (coarse, low noise)\n 2) message.updated (precise)\n 3) message.part.updated (very precise, more noise)",
505
500
  );
506
- const triggerInput = await rl.question("> [2] ");
507
- return triggerInput.trim() === "1"
508
- ? "session.idle"
501
+ const triggerInput = await rl.question("> [1] ");
502
+ return triggerInput.trim() === "2"
503
+ ? "message.updated"
509
504
  : triggerInput.trim() === "3"
510
505
  ? "message.part.updated"
511
- : "message.updated";
506
+ : "session.idle";
512
507
  })();
513
508
 
514
509
  const macEnabled = interactive
@@ -556,11 +551,11 @@ async function main() {
556
551
  { name: "full", value: "full" },
557
552
  { name: "title-only", value: "title-only" },
558
553
  ],
559
- defaultValue: "full",
554
+ defaultValue: "title-only",
560
555
  })
561
- : (await rl.question("Detail level (1=full, 2=title-only) [1] ")).trim() === "2"
562
- ? "title-only"
563
- : "full";
556
+ : (await rl.question("Detail level (1=full, 2=title-only) [2] ")).trim() === "1"
557
+ ? "full"
558
+ : "title-only";
564
559
 
565
560
  const adjustGroups = interactive
566
561
  ? await promptConfirm("Adjust event groups?", false)
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "tier": {
18
18
  "type": "string",
19
- "enum": ["minimal", "standard", "verbose", "custom"]
19
+ "enum": ["focus", "full", "custom"]
20
20
  },
21
21
  "detailLevel": {
22
22
  "type": "string",
package/README.md CHANGED
@@ -32,26 +32,26 @@ The config is defined in `.opencode/oc-notify.schema.json` and supports:
32
32
 
33
33
  - `enabled`: master switch
34
34
  - `title`: override or template (supports `{repo}` and `{branch}`)
35
- - `tier`: `minimal` | `standard` | `verbose` | `custom`
35
+ - `tier`: `focus` | `full` | `custom`
36
36
  - `detailLevel`: `full` | `title-only`
37
- - `responseComplete`: trigger for completion notifications
37
+ - `responseComplete`: trigger for completion notifications (default: `session.idle`)
38
38
  - `channels`: `mac` and `ntfy` settings
39
39
  - `overrides`: include/exclude groups
40
40
  - `dedupe`: in-memory TTL settings
41
41
 
42
42
  ## Tier Defaults
43
43
 
44
- - **minimal**: `action_required`, `failures`
45
- - **standard**: minimal + `change_summary`, `session_lifecycle`
46
- - **verbose**: standard + `files`, `todos`, `vcs_worktree`, `pty`, `responses`
44
+ - **focus**: `action_required`
45
+ - **full**: `action_required`, `failures`, `change_summary`, `session_lifecycle`
47
46
 
48
47
  ## Example Configs
49
48
 
50
- ### Minimal
49
+ ### Focus
51
50
  ```json
52
51
  {
53
52
  "enabled": true,
54
- "tier": "minimal",
53
+ "tier": "focus",
54
+ "detailLevel": "title-only",
55
55
  "responseComplete": {
56
56
  "enabled": true,
57
57
  "trigger": "session.idle"
@@ -63,36 +63,47 @@ The config is defined in `.opencode/oc-notify.schema.json` and supports:
63
63
  }
64
64
  ```
65
65
 
66
- ### Standard
66
+ ### Full
67
67
  ```json
68
68
  {
69
69
  "enabled": true,
70
- "tier": "standard",
71
- "detailLevel": "full",
70
+ "tier": "full",
71
+ "detailLevel": "title-only",
72
72
  "responseComplete": {
73
73
  "enabled": true,
74
- "trigger": "message.updated"
74
+ "trigger": "session.idle"
75
75
  }
76
76
  }
77
77
  ```
78
78
 
79
- ### Verbose
79
+ ### Custom (formerly verbose-style)
80
80
  ```json
81
81
  {
82
82
  "enabled": true,
83
- "tier": "verbose",
83
+ "tier": "custom",
84
84
  "responseComplete": {
85
85
  "enabled": true,
86
86
  "trigger": "message.part.updated"
87
87
  },
88
88
  "overrides": {
89
- "includeGroups": ["commands_tools"],
89
+ "includeGroups": [
90
+ "action_required",
91
+ "failures",
92
+ "change_summary",
93
+ "session_lifecycle",
94
+ "files",
95
+ "todos",
96
+ "vcs_worktree",
97
+ "pty",
98
+ "responses",
99
+ "commands_tools"
100
+ ],
90
101
  "excludeGroups": []
91
102
  }
92
103
  }
93
104
  ```
94
105
 
95
- ### Custom
106
+ ### Custom (curated)
96
107
  ```json
97
108
  {
98
109
  "enabled": true,
@@ -102,4 +113,12 @@ The config is defined in `.opencode/oc-notify.schema.json` and supports:
102
113
  "excludeGroups": ["session_lifecycle"]
103
114
  }
104
115
  }
116
+
117
+ ## Migration from legacy tiers
118
+
119
+ Legacy tiers `minimal`, `standard`, and `verbose` are no longer supported. Update existing configs before notifications resume:
120
+
121
+ - `minimal` -> `custom` with includeGroups: `action_required`, `failures`
122
+ - `standard` -> `full`
123
+ - `verbose` -> `custom` with includeGroups: `action_required`, `failures`, `change_summary`, `session_lifecycle`, `files`, `todos`, `vcs_worktree`, `pty`, `responses`
105
124
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodnesshq/opencode-notification",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Per-repo notification plugin for OpenCode with macOS and ntfy delivery.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,11 +10,11 @@ const DEFAULTS = {
10
10
  version: 1,
11
11
  enabled: true,
12
12
  title: "",
13
- tier: "standard",
14
- detailLevel: "full",
13
+ tier: "focus",
14
+ detailLevel: "title-only",
15
15
  responseComplete: {
16
16
  enabled: true,
17
- trigger: "message.updated",
17
+ trigger: "session.idle",
18
18
  },
19
19
  channels: {
20
20
  mac: {
@@ -71,19 +71,8 @@ const GROUPS = {
71
71
  };
72
72
 
73
73
  const TIER_GROUPS = {
74
- minimal: ["action_required", "failures"],
75
- standard: ["action_required", "failures", "change_summary", "session_lifecycle"],
76
- verbose: [
77
- "action_required",
78
- "failures",
79
- "change_summary",
80
- "session_lifecycle",
81
- "files",
82
- "todos",
83
- "vcs_worktree",
84
- "pty",
85
- "responses",
86
- ],
74
+ focus: ["action_required"],
75
+ full: ["action_required", "failures", "change_summary", "session_lifecycle"],
87
76
  custom: [],
88
77
  };
89
78
 
@@ -118,8 +107,11 @@ function normalizeArray(value) {
118
107
  }
119
108
 
120
109
  function normalizeTier(value) {
121
- if (typeof value !== "string") return DEFAULTS.tier;
122
- return TIER_GROUPS[value] ? value : DEFAULTS.tier;
110
+ if (value === undefined || value === null) {
111
+ return { value: DEFAULTS.tier, valid: true };
112
+ }
113
+ if (typeof value !== "string") return { value, valid: false };
114
+ return TIER_GROUPS[value] ? { value, valid: true } : { value, valid: false };
123
115
  }
124
116
 
125
117
  function normalizeTrigger(value) {
@@ -147,11 +139,13 @@ function normalizeConfig(raw, globalConfig) {
147
139
  globalConfig && typeof globalConfig === "object" && !Array.isArray(globalConfig)
148
140
  ? globalConfig
149
141
  : {};
142
+ const tierInfo = normalizeTier(source.tier);
150
143
  const config = {
151
144
  version: DEFAULTS.version,
152
145
  enabled: normalizeBool(source.enabled, DEFAULTS.enabled),
153
146
  title: normalizeString(source.title, DEFAULTS.title),
154
- tier: normalizeTier(source.tier),
147
+ tier: tierInfo.value,
148
+ tierValid: tierInfo.valid,
155
149
  detailLevel: source.detailLevel === "title-only" ? "title-only" : "full",
156
150
  responseComplete: {
157
151
  enabled: normalizeBool(
@@ -196,7 +190,7 @@ function normalizeConfig(raw, globalConfig) {
196
190
  }
197
191
 
198
192
  function buildGroupSet(config) {
199
- const baseGroups = TIER_GROUPS[config.tier] ?? TIER_GROUPS.standard;
193
+ const baseGroups = TIER_GROUPS[config.tier] ?? [];
200
194
  const groupSet = new Set(baseGroups);
201
195
  for (const group of config.overrides.includeGroups) {
202
196
  if (GROUPS[group]) groupSet.add(group);
@@ -655,6 +649,7 @@ export default async function opencodeNotify(input) {
655
649
  console.warn("[opencode-notifications] invalid config detected", repoConfig.errors);
656
650
  }
657
651
  if (!config.enabled) return;
652
+ if (!config.tierValid) return;
658
653
 
659
654
  if (payload?.type === "vcs.branch.updated" && payload?.properties?.branch) {
660
655
  cachedBranch = payload.properties.branch;