@napuketto/adapter 0.0.3 → 0.0.4

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.
@@ -614,21 +614,28 @@ var GetGroupInfoAction = class extends BaseAction {
614
614
  };
615
615
  //#endregion
616
616
  //#region src/onebot11/action/group/get-group-list.ts
617
+ /**
618
+ * get_group_list 动作:获取群列表(P2-4 接 kernel GroupApi + GroupCache)
619
+ *
620
+ * ⚠️ 实测校准(2026-08-08 端到端联调):原生 getGroupList 返回值无数据
621
+ * (仅 { result, errMsg }),列表经 onGroupListUpdate 事件推送 → GroupCache
622
+ * 维护——列表一律从缓存读,no_cache=true 仅触发原生刷新。
623
+ */
617
624
  const getGroupListSchema = z.object({
618
625
  /** 是否忽略缓存(go-cqhttp 扩展)。 */
619
626
  no_cache: z.boolean().optional() });
620
- /** 获取群列表(P2-4 接 kernel apis/group)。 */
627
+ /** 获取群列表(P2-4 接 kernel apis/group;群列表数据经事件推送,从 GroupCache 读)。 */
621
628
  var GetGroupListAction = class extends BaseAction {
622
629
  name = "get_group_list";
623
630
  schema = getGroupListSchema;
624
631
  errorCodeMap = ob11ErrorCodeMap;
625
- groupApi;
626
- constructor(groupApi) {
632
+ deps;
633
+ constructor(deps) {
627
634
  super();
628
- this.groupApi = groupApi;
635
+ this.deps = deps;
629
636
  }
630
637
  async _handle(payload) {
631
- return (await this.groupApi.getGroupList(payload.no_cache === true)).map(toOb11GroupInfo);
638
+ return (this.deps.groupCache === void 0 ? await this.deps.groupApi.getGroupList(true) : payload.no_cache === true ? await this.deps.groupCache.listGroupsRefreshed() : this.deps.groupCache.listGroups()).map(toOb11GroupInfo);
632
639
  }
633
640
  };
634
641
  //#endregion
@@ -3188,7 +3195,7 @@ function registerMsgActions(registry, deps) {
3188
3195
  function registerQueryActions(registry, deps) {
3189
3196
  registry.register(new GetLoginInfoAction(deps.api.self));
3190
3197
  registry.register(new GetGroupInfoAction(deps.api));
3191
- registry.register(new GetGroupListAction(deps.api.groupApi));
3198
+ registry.register(new GetGroupListAction(deps.api));
3192
3199
  registry.register(new GetGroupMemberInfoAction(deps.api));
3193
3200
  registry.register(new GetGroupMemberListAction(deps.api));
3194
3201
  registry.register(new GetFriendListAction(deps.api.friendApi));