@iwpz/fishpi-dsh 0.0.0-stage → 0.1.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/README.md CHANGED
@@ -1,3 +1,94 @@
1
- # Temporary Holding Version
1
+ # FishPi chatroom for DSH
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Adds a [FishPi / 摸鱼派](https://fishpi.cn) chatroom to the DeepSeek Harness right
4
+ Sidebar, with account sign-in in DSH Settings.
5
+
6
+ ![FishPi chatroom preview](docs/preview.svg)
7
+
8
+ ## What it does
9
+
10
+ - **Right Sidebar tab** — open it from the right Sidebar's `+` guide card
11
+ (**FishPi chatroom**) or from the fish button in a Session header. The tab
12
+ shows recent messages, live updates, topic, online count, and a composer.
13
+ - **Settings → FishPi** — sign in with username/email and password; accounts
14
+ with two-step verification are asked for the code. Sign out from the same page.
15
+ - **Message rendering** — rich text renders the server-sanitized HTML (Markdown,
16
+ links, images) stored by FishPi; plain text shows the source text only and
17
+ replaces image syntax with a localized `[Image]` / `[图片]` label. Links open
18
+ outside the panel.
19
+ - **Cards** — red packet, music, and weather messages render as compact cards.
20
+ Clicking a red packet opens its claim records and a claim action; heartbeat
21
+ and rock-paper-scissors packets require explicit risk acceptance, and
22
+ rock-paper-scissors also asks for a gesture.
23
+ - **Images** — the composer's `+` button selects several images at once, and
24
+ pasted images are accepted too. Files upload through the Host and are inserted
25
+ into the message as Markdown image links; the send button sits to the right of
26
+ the input.
27
+ - **Mentions** — typing `@` opens a username candidate popup. Online users are
28
+ matched fuzzily by username or nickname, and FishPi's suggestion API supplies
29
+ username-prefix matches. Choosing a candidate inserts `@username `, which the
30
+ FishPi server turns into a real mention notification.
31
+ - **Own messages** — messages you sent align to the right side of the panel.
32
+ - **Animated mark** — the Settings entry, the Session-header button, and the
33
+ Sidebar guide card replay the FishPi home-page `#logo-animate` composition;
34
+ the Plugin Manager icon is an animated WebP rendered from the same data.
35
+ - **Unread and notifications** — the header fish button shows a dot and the tab
36
+ title carries the unread count; optional desktop notifications fire while the
37
+ chatroom is not in front.
38
+ - **Live transport** — the Host keeps one authenticated FishPi chat WebSocket,
39
+ refreshes its ticket before the grant expires, reconnects with backoff, and
40
+ replays events to the page; the page re-reads the message window whenever the
41
+ server asks for a resync.
42
+
43
+ ## Install
44
+
45
+ Published as `@iwpz/fishpi-dsh`. From the DSH **Plugins** page choose
46
+ **Add plugin** and enter `@iwpz/fishpi-dsh`, or select a local checkout
47
+ directory. The bundle has no npm dependencies.
48
+
49
+ ## Use
50
+
51
+ 1. Open **Settings → FishPi**.
52
+ 2. Enter your FishPi username or email and password, then **Sign in**.
53
+ With **Remember password** on, the password's MD5 digest is stored so an
54
+ expired access token can sign in again automatically.
55
+ 3. Open the chat from the Session header's fish button or the right Sidebar's
56
+ `+` guide card.
57
+ 4. Pick **Rich text** or **Plain text** and enable **Desktop notifications** in
58
+ Settings. The login form also links to the FishPi registration page.
59
+
60
+ ## Where credentials live
61
+
62
+ The access token and the optional password digest are stored as a credential
63
+ record (`fishpi-chat/account`) in the local DSH credential store — not in the
64
+ profile's `cordis.patch.yml`, not in localStorage, and never sent to the page.
65
+ The page talks to the Host only through authenticated same-origin
66
+ `api/fishpi/*` routes and never calls the FishPi API itself. Rich-text images
67
+ are loaded by the page from FishPi's image hosts. Signing out deletes the
68
+ record.
69
+
70
+ ## Limitations
71
+
72
+ - FishPi's login endpoint refuses browser CORS, so the Host performs login; the
73
+ page never contacts `fishpi.cn` directly.
74
+ - Accounts with two-step verification cannot renew from the saved password
75
+ digest alone: when the access token expires, sign in again with the password
76
+ and the code.
77
+ - The chat opens inside a Session; without an active conversation there is no
78
+ right Sidebar to open it into.
79
+ - Reactions, message withdrawal, barrages, and changing the topic are not part
80
+ of this version.
81
+ - Images load from FishPi's image hosts; the panel blurs nothing by default.
82
+ - The plugin uses FishPi API v3 as documented at
83
+ <https://github.com/FishPiOffical/rhythm/blob/api_v3/API.md>; third-party
84
+ behavior can differ from the first-party website.
85
+
86
+ ## Development
87
+
88
+ The package has no build step:
89
+
90
+ - `index.js` — Host wiring and routes; `fishpi.js` — FishPi HTTP/WebSocket client.
91
+ - `client.js` — the browser module (`window.__ModuleLoader__` factory).
92
+ - `locale/en.json`, `locale/zh.json` — Plugin Manager display metadata.
93
+ - `test/fishpi.test.mjs` — Node tests for the API client, event hub, and message
94
+ normalization (`node --test test/fishpi.test.mjs`).