Files
SnowLuma/packages/proto-defs/src/index.ts
T
DrSmoothl 58c02d415f feat(onebot): fetch real private (c2c) history from server (#99)
Mirror the group-history fetch for private chats via SsoGetC2cMsg
(trpc.msg.register_proxy.RegisterProxy.SsoGetC2cMsg, fields per Lagrange:
flat friendUid/start/end request, messages@7 response). get_friend_msg_history
now resolves the anchor sequence + the friend's UID, fetches real history from
the server, converts + persists each message, and falls back to the local
store on unknown anchor / no uid / empty / error.

- protocol: fetchC2cMessageRange (decodes via the friend decoder).
- core: the group + c2c fetch now share a generic walkBackHistory loop
  (same throttle gate + caps); added MessageApi.getC2cHistory.
- onebot: getFriendHistory + a generalized persistHistoryEvent (keys private
  by sender uin, exactly like the live path — so reply to old private
  messages resolves too).

Tests: SsoGetC2cMsg request/response round-trip + friend-decode reuse.
2026-06-14 20:15:38 +08:00

37 lines
1.7 KiB
TypeScript

// SnowLuma wire-protobuf type definitions.
//
// This barrel exists so `@snowluma/proto-defs` can be resolved by a
// plain `import {} from '@snowluma/proto-defs'` (consumers that don't
// know which sub-namespace they want, or just want to see what's
// available). The package itself is otherwise consumed via the
// per-file subpath exports declared in package.json — that's the
// recommended import shape because it mirrors the legacy
// `bridge/proto/proton/<sub>` paths 1:1 and avoids name collisions.
//
// ─── Collision note ───
//
// `highway.ts` and `oidb-actions/media.ts` each define their own
// `NTV2*` types (NTV2CommonHead, NTV2ClientMeta, NTV2C2CUserInfo,
// NTV2FileInfo, NTV2FileType, NTV2GroupInfo). The two definitions
// are NOT compatible — they describe different wire shapes for
// different protocol surfaces and happen to share the same name in
// the upstream Lagrange schema. `export *` silently drops one side
// when names collide, so a consumer that grabs an `NTV2CommonHead`
// off the barrel might end up with the wrong one. Prefer the subpath
// imports below for any NTV2-named type.
export type * from './action.js';
export type * from './element.js';
// NOTE: `highway.ts` intentionally NOT re-exported here — see note above.
export type * from './longmsg.js';
export type * from './message.js';
export type * from './get-group-msg.js';
export type * from './get-c2c-msg.js';
export type * from './notify.js';
export type * from './oidb.js';
export type * from './oidb-action.js';
export type * from './oidb-actions/base.js';
export type * from './oidb-actions/group-album.js';
export type * from './oidb-actions/group-file.js';
// NOTE: `oidb-actions/media.ts` intentionally NOT re-exported — see note above.