refactor(oidb): migrate extras.ts OIDB cmds to namespaces

5 logical OIDB cmds → 4 namespace files (group todo's 3 sub-cmds
collapse into one namespace with a dynamic resolver):

  - GroupTodo          (0xF90_1/2/3) — set/complete/cancel via the
                                       new `action` discriminator
  - GetStrangerStatus  (0xFE1_2)     — uinForm=true; preserves the
                                       (status*10, ext_status) decode
                                       quirk verbatim
  - FetchAiVoiceList   (0x929D_0)
  - FetchAiVoice       (0x929B_0)    — single poll; retry loop
                                       stays on the facade so callers
                                       can plug their own back-off

Facade keeps the 6 public methods (setGroupTodo / completeGroupTodo /
cancelGroupTodo / getStrangerStatus / fetchAiVoiceList / fetchAiVoice)
as one-line forwarders; only `getStrangerStatus` wraps in try/catch
to preserve its "return null on transport failure" contract, and
`fetchAiVoice` keeps the polling loop.

30 new namespace-level tests; extras.test.ts moved onto the
sendRawPacket assertion model.

Verification:
  - typecheck green
  - @snowluma/bridge: 24 files / 195 tests
  - @snowluma/core: 302 tests
Wire bytes unchanged.
This commit is contained in:
DrSmoothl committed 2026-05-22 23:45:13 +08:00
1 parent 8356121518
commit 80afa31f5c
11 files changed
+606 -180

No files matched your search

+16
View File
@@ -115,6 +115,22 @@
"types": "./src/oidb-services/web/get-pskey.ts",
"default": "./src/oidb-services/web/get-pskey.ts"
},
"./oidb-services/extras/group-todo": {
"types": "./src/oidb-services/extras/group-todo.ts",
"default": "./src/oidb-services/extras/group-todo.ts"
},
"./oidb-services/extras/get-stranger-status": {
"types": "./src/oidb-services/extras/get-stranger-status.ts",
"default": "./src/oidb-services/extras/get-stranger-status.ts"
},
"./oidb-services/extras/fetch-ai-voice-list": {
"types": "./src/oidb-services/extras/fetch-ai-voice-list.ts",
"default": "./src/oidb-services/extras/fetch-ai-voice-list.ts"
},
"./oidb-services/extras/fetch-ai-voice": {
"types": "./src/oidb-services/extras/fetch-ai-voice.ts",
"default": "./src/oidb-services/extras/fetch-ai-voice.ts"
},
"./bridge-context": {
"types": "./src/bridge-context.ts",
"default": "./src/bridge-context.ts"