fix(sdk): catch up SNOWLUMA_ACTIONS with the 14 new core actions

`actions-sync.test.ts` walks every `registerAction(...)` in
`@snowluma/core/src/onebot/actions/` and asserts the SDK's exported
list matches. The napcat-parity work (Tier 1 + Tier 2 + Tier 3 + AI
voice) added 14 actions to core without ever touching the SDK, so the
test caught the drift:

  bot_exit              cancel_group_todo
  complete_group_todo   delete_group_folder
  get_ai_characters     get_ai_record
  get_group_ignore_add_request
  nc_get_packet_status  nc_get_rkey
  nc_get_user_status
  send_group_ai_record  send_packet
  set_diy_online_status set_group_todo

Added them to `SNOWLUMA_ACTIONS` and gave each one a typed
`SnowLumaActionMap` entry. Where the request body shape is non-trivial
(AI voice, group todo, DIY status, send_packet, nc_get_user_status),
introduced dedicated param types in `types/params.ts`; where the
response is structured (AI character list, user-status word),
introduced result types in `types/results.ts`. Everything else routes
through `JsonObject` / `EmptyData` so the SDK surface stays small.

Verified:
  pnpm --filter @snowluma/sdk typecheck → clean
  pnpm --filter @snowluma/sdk test      → 17/17 pass
This commit is contained in:
DrSmoothl committed 2026-05-16 00:39:32 +08:00
1 parent 7da52bc591
commit 47921eee12
4 files changed
+116 -1

No files matched your search

+18
View File
@@ -122,6 +122,24 @@ export const SNOWLUMA_ACTIONS = [
'rename_group_file',
'get_file',
'.send_packet',
// napcat-parity extensions (Tier 1 + Tier 2)
'send_packet',
'bot_exit',
'nc_get_packet_status',
'nc_get_rkey',
'nc_get_user_status',
'get_group_ignore_add_request',
'delete_group_folder',
'set_group_todo',
'complete_group_todo',
'cancel_group_todo',
// Tier 3: DIY status
'set_diy_online_status',
// AI voice trio
'get_ai_characters',
'get_ai_record',
'send_group_ai_record',
] as const satisfies readonly (keyof SnowLumaActionMap)[];
export type SnowLumaKnownAction = typeof SNOWLUMA_ACTIONS[number];