@soffits/dsh-notify-inbox 0.3.0 → 0.5.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0
4
+
5
+ - A new page, built from DSH's own components and the shared [@soffits/dsh-ui-kit](https://github.com/soffits/dsh-ui-kit), which is now required. Notifications are grouped as Needs you, Live, Handled and To know, with the counts on top, an optional summary line (`summary.json`) and each domain's icon on a tinted tile (`domains` setting). [docs/ui.md](docs/ui.md) lists what is DSH's and what is the plugin's own.
6
+ - Records may carry `attention`, `thread`, `live` and `handled`. Without `attention`, interrupts and notifications with done or snooze buttons need you and the rest is to know. A needs-you item marked done moves to Handled, a snoozed one waits under To know, a live item drops to To know when its time is over.
7
+ - Notifications with the same `thread` are one item with their history beneath; a live thread's newest notification replaces the item in place.
8
+ - New notifications and changes show up while the page is open, through `GET /api/notify-inbox/events` (Server-Sent Events), with a short cue on what changed. The page polls while the stream is down.
9
+ - The filters are Needs you and All (Unread is gone: unread items carry a dot). Items stay where they first showed until you leave the view. Mark unread is in the opened item. Push settings moved into the ⋯ menu.
10
+ - An inbox file rewritten in place is read again even when it grew.
11
+ - Needs DSH 0.2.2-rc.1 or later.
12
+ ## 0.4.0
13
+
14
+ - Suggested next steps: a notification's `step` actions show as their own buttons (from @soffits/dsh-ui-actions 0.2.0). A tap is recorded here like done and snooze, as the event `ui.action.step` with who pressed it, then the step is sent to the assistant; the row says "Started".
15
+ - Button labels may be maps from language tag to text.
16
+ - Each press remembers which button it was, so several steps on one notification keep their own state.
17
+
3
18
  ## 0.3.0
4
19
 
5
20
  - The buttons come from [@soffits/dsh-ui-actions](https://github.com/soffits/dsh-ui-actions), installed as its own plugin, instead of a copy of the card board's chunk. "Ask" now opens a conversation with the notification attached as a card the person can remove and write beside; the sent message shows the same card, and the agent gets the notification as compact text with its id. Without the package the page works and shows no buttons.
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # dsh-notify-inbox
2
2
 
3
- A notification inbox for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH). Something outside DSH (your assistant's notification router, a cron script, a watcher) files notifications as JSON lines, one folder per person. The plugin shows each signed-in person their own inbox in the Web UI, keeps read and unread per person on the server, pushes new ones to the browsers and installed home-screen apps they turned notifications on for, and gives every notification buttons: ask the agent about it, mark it done, remind me later.
3
+ A notification inbox for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH). Something outside DSH (a notification router, a cron script, a watcher) files notifications as JSON lines, one folder per person. The plugin shows each signed-in person their own inbox in the Web UI, keeps read and unread per person on the server, pushes new ones to the browsers and installed home-screen apps they turned notifications on for, and gives every notification buttons: ask the agent about it, mark it done, remind me later.
4
+
5
+ The page sorts notifications by what they ask of you: **Needs you**, **Live** (a flight's status, a running job, updated in place), **Handled** (what was done for you, in one quiet line) and **To know**. Notifications about one thing fold into one item with its history underneath, new ones appear while the page is open, and an optional line at the top says what matters now. It is built from DSH's own components, so it looks like the rest of the Web UI in light and dark ([docs/ui.md](docs/ui.md) says which few pieces aren't DSH's, and why).
4
6
 
5
7
  The contract is files, so nothing gets lost while DSH restarts: the writer keeps appending, and the plugin pushes whatever arrived once it's back.
6
8
 
@@ -10,6 +12,12 @@ The contract is files, so nothing gets lost while DSH restarts: the writer keeps
10
12
  npx @deepseek-ai/dsh plugin --profile web add @soffits/dsh-notify-inbox@latest
11
13
  ```
12
14
 
15
+ It needs two small shared plugins next to it, [@soffits/dsh-ui-kit](https://github.com/soffits/dsh-ui-kit) (icons, live time, history) and [@soffits/dsh-ui-actions](https://github.com/soffits/dsh-ui-actions) (the buttons):
16
+
17
+ ```sh
18
+ npx @deepseek-ai/dsh plugin --profile web add @soffits/dsh-ui-kit@latest @soffits/dsh-ui-actions@latest
19
+ ```
20
+
13
21
  Restart `dsh web`. The inbox appears in the sidebar. Then set `dataDir` in a profile override of the `notify-inbox` row:
14
22
 
15
23
  ```yaml
@@ -31,6 +39,8 @@ Restart `dsh web`. The inbox appears in the sidebar. Then set `dataDir` in a pro
31
39
  | `peopleFile`, `peopleKey` | | A JSON file with more of the same mapping, re-read when it changes; `peopleKey` picks a top-level key. |
32
40
  | `vapidFile` | `<dataDir>/.push/vapid.json` | The Web Push key pair, made on first start with mode 600. Keep it: a new key means every device subscribes again. |
33
41
  | `vapidSubject` | `mailto:admin@example.invalid` | A contact push services can reach. Set your own. |
42
+ | `domains` | `{}` | How each `domain` is drawn, on top of the built-in defaults (`mail`, `money`, `health`, `travel`, `home`, `orders`...): `{ "legal": { "icon": "scale", "tone": "violet" } }`. `icon` is a [Lucide](https://lucide.dev) name the kit bundles; `tone` (`ok`, `warn`, `bad`, `accent`, `violet`, `muted`) is usually left out, since an item's colour says what it needs. |
43
+ | `summaryHours` | `12` | How long the summary line is shown after it was written. |
34
44
  | `pollSeconds` | `5` | How often new lines are looked for (to push them). |
35
45
 
36
46
  **Who sees what.** With a mapping, every request is checked on the server: a person sees, marks and presses only their own inbox, and a request without a verified identity sees nothing. The identity comes from any plugin that provides a `requestIdentity` service (`current()` → `{ provider, issuer, id, name } | null`), such as [dsh-oidc](https://github.com/soffits/dsh-oidc) 0.3.0-alpha.9 or later. Without a mapping (a DSH only you use), you see every folder.
@@ -51,12 +61,18 @@ Append one JSON object per line to `<dataDir>/<person>/inbox.jsonl` (person ids
51
61
  {"destination": "phone", "type": "ntfy", "ok": false, "detail": "timed out"}]}
52
62
  ```
53
63
 
54
- - `id` (required, unique), `time` (required, ISO 8601). `lane: "interrupt"` marks it urgent (red dot, high push urgency).
64
+ - `id` (required, unique), `time` (required, ISO 8601). `lane: "interrupt"` makes it urgent (it needs you, a red tile, high push urgency).
55
65
  - `title`, `spoken` (one short line: the push body), `text` (the full text), `links` (http/https).
56
66
  - `files`: attachments the writer copied to `<dataDir>/<person>/files/<id>/<name>`; only those are served, and only to that person.
57
67
  - `push: false` files it without a push. `test: true` labels it as a test.
58
68
  - `routed`: where else the notification went and whether that worked; shown under the text.
59
69
  - `actions`: buttons, see below.
70
+ - `attention`: the group, `needs-you`, `live`, `handled` or `info` ("To know"). Left out, it follows from the rest: `handled` when `handled` is set, `live` when `live` is, `needs-you` for an interrupt or a notification with `done` or `snooze` buttons, else `info`. A needs-you item the person marked done moves to Handled, a snoozed one waits under To know until it comes back.
71
+ - `thread`: notifications with the same thread are one item, the newest on top and the older ones as its history (three reminders about one task).
72
+ - `live`: `{ "until"?, "progress"?: { "from", "to" } }`. The thread's newest notification replaces the item in place, shown as live until `until` (or six hours after its last update), with a bar from `from` to `to`.
73
+ - `handled`: `{ "text", "at"? }`, what was done for the person, shown as one quiet line with a check.
74
+
75
+ An optional `<dataDir>/<person>/summary.json`, `{ "text": "...", "at": "<ISO time>" }`, is the sentence shown above the items for `summaryHours`.
60
76
 
61
77
  A line `{"v": 1, "type": "handled", "record": "<id>", "press": "<press id>", "action": "done", "result": "done", "time": "..."}` tells the inbox that a press on that record was dealt with (`result: "snoozed"` with `until` shows when it comes back). Bad lines are skipped and counted.
62
78
 
@@ -66,7 +82,7 @@ The buttons come from [@soffits/dsh-ui-actions](https://github.com/soffits/dsh-u
66
82
 
67
83
  Every notification gets **Ask**: it opens a new session with the notification attached to the message box as a card (removable), and the person writes their own words beside it. The sent message shows the same card; the agent gets the notification as a short quote with its id. Since the person sends it from the Web UI, the sign-in plugin records them as the sender.
68
84
 
69
- Declared `actions` add more: `done`, `snooze` (a small picker: in an hour, this evening, tomorrow morning; or a fixed `payload.until`), `event` (anything else) and `link` (`payload.url`). A press on `done`, `snooze` or `event` is checked on the server (the record must be the caller's and declare that button), appended to `<dataDir>/<person>/actions.jsonl`, and published on the event channel `ui.action.<kind>` when [dsh-cron-jobs](https://github.com/soffits/dsh-cron-jobs) is installed, so a job listening there can act on it:
85
+ Declared `actions` add more: `step` (a suggested next step whoever filed the notification knows, like "Pay it from the joint account": one tap records the press, then sends the step with the notification to the assistant as the person, at most three; `label` required, text or `{ "en": …, "zh": … }`), `done`, `snooze` (a small picker: in an hour, this evening, tomorrow morning; or a fixed `payload.until`), `event` (anything else) and `link` (`payload.url`). A press on `step`, `done`, `snooze` or `event` is checked on the server (the record must be the caller's and declare that button), appended to `<dataDir>/<person>/actions.jsonl`, and published on the event channel `ui.action.<kind>` when [dsh-cron-jobs](https://github.com/soffits/dsh-cron-jobs) is installed, so a job listening there can act on it:
70
86
 
71
87
  ```json
72
88
  {"action": "snooze", "id": "snooze", "payload": {"until": "2026-11-18T09:00:00-05:00"}, "person": "ana",
@@ -78,7 +94,7 @@ The page shows the press as waiting until a `handled` line for it shows up.
78
94
 
79
95
  ## Push notifications
80
96
 
81
- Open the inbox on the device and press **Turn on**. The browser picks its own push service, and the plugin only ever talks to that service, with the message encrypted end to end (RFC 8291, VAPID per RFC 8292, no third-party library):
97
+ Open the inbox on the device, open its **⋯** menu and choose **Turn on**. The browser picks its own push service, and the plugin only ever talks to that service, with the message encrypted end to end (RFC 8291, VAPID per RFC 8292, no third-party library):
82
98
 
83
99
  - **iPhone and iPad** (iOS 16.4+): add DSH to the Home Screen, open it from there, then turn notifications on. Pushes go through Apple's service.
84
100
  - **Chrome, Edge, Android**: pushes go through Google's Firebase Cloud Messaging, so they don't arrive where Google is blocked.
@@ -86,6 +102,10 @@ Open the inbox on the device and press **Turn on**. The browser picks its own pu
86
102
 
87
103
  Tapping a notification opens the inbox on it. A device whose subscription expired is dropped the first time its push service says so.
88
104
 
105
+ ## Live updates
106
+
107
+ An open page follows `GET /api/notify-inbox/events`, a Server-Sent Events stream that says when the caller's inbox changed (records, read marks, presses or the summary), and fetches again; it polls while the stream is down. While anyone listens the plugin looks at those files every two seconds; nothing runs otherwise.
108
+
89
109
  ## Languages
90
110
 
91
111
  The page follows DSH's language. Its words live in `locale/<tag>.json` (`ui` for the page, `meta` for the plugin list): English, French and Chinese ship. Another language is one more file with the same keys; anything it leaves out comes from its primary language (`pt` for `pt-BR`), then English. Notification text is shown as it was sent.