Commit Graph
361 Commits
Author SHA1 Message Date
DrSmoothl b884a1c479 fix(onebot): unify message segment type normalization
Keep empty-placeholder detection aligned with strict segment parsing.
2026-07-23 12:18:02 +08:00
DrSmoothl edd2ac278a fix(onebot): trace empty text placeholder normalization
Document the compatibility rule in action metadata and regenerate the MCP catalog.
2026-07-23 12:14:01 +08:00
DrSmoothl a7b9ba14fb fix(onebot): accept empty text placeholders in arrays
Fixes #273.
2026-07-23 12:08:17 +08:00
DrSmoothl 97ab8dc393 chore(release): v1.12.8 2026-07-22 20:03:54 +08:00
DrSmoothl aed15b9a3f fix(group-album): return video media metadata
Decode the QQ group album video payload, including cover, duration, and multi-resolution URLs. Add a wire-level regression test and update generated action documentation.

Fixes #270
2026-07-22 20:00:07 +08:00
DrSmoothl eed2e692b1 fix(onebot): expose robot status for group members
Fetch QQ's versioned robot UIN ranges, classify and persist member status, and surface is_robot from both group member actions.

Preserve unknown legacy cache entries and fail visibly when classification is unavailable.

Closes #265
2026-07-21 23:27:01 +08:00
DrSmoothl ff60221330 feat(onebot): support private window shake messages
Encode poke message segments as private window shake messages while keeping the dedicated send_poke action unchanged.

Restrict window shakes to a single ordinary private-chat segment. Reject group, temporary-session, mixed-message, and forwarded usage before identity lookup, media upload, or packet transmission.

Add full outbound request coverage, OneBot action regressions, and live private-chat verification for issue #259.

Closes #259
2026-07-21 19:28:17 +08:00
DrSmoothl feb7fcac0e feat(group-album): expose cover and upload metadata
Decode the verified album cover response field and expose normalized cover details and last-upload timestamps through both album list actions. Preserve the legacy numeric timestamp shape, retain string timestamps for the native response, return null when no cover exists, and avoid additional network requests.

Document the new output contracts in the OneBot and MCP catalogs. Add independent wire fixtures and action-level regression tests for the protocol mapping and public response shapes.

Refs #257
2026-07-20 23:37:41 +08:00
DrSmoothl 4aa2cd1693 fix(onebot): correct private message history (#256)
Use the C2C roam cursor and canonical NT sequence for bidirectional history. Persist direction-aware recall tombstones so recalled messages cannot reappear.
2026-07-20 22:25:13 +08:00
DrSmoothl 88216ce644 chore(release): v1.12.7 2026-07-20 15:52:49 +08:00
DrSmoothl 4ba2b27398 fix(onebot): keep synthetic sequences out of history
Distinguish QQ-authoritative message sequences from local message IDs so group files and reply placeholders cannot become history anchors or be reused by protocol actions.

Filter QQ null roam records and migrate previously stored synthetic rows.

Fixes #254
2026-07-20 15:33:28 +08:00
DrSmoothl fc80a598c0 fix(onebot): return AI voice message IDs
Build send_group_ai_record results from the canonical group-message sequence returned by the Core receipt correlator, using the same message ID mapping as normal inbound events.

Stop reporting the historical placeholder value of zero and surface receipt failures through the standard Action error path. Preserve the existing get_ai_record URL response and update the SDK result documentation without changing its public shape.

Add Action-level coverage for canonical ID generation and missing-receipt failures.

Refs #250
2026-07-20 14:03:13 +08:00
DrSmoothl 06c26dee87 fix(group-album): use native QQ album service
Replace the lossy Qzone album-list endpoint with the QQ NT AlbumService protobuf request. Preserve creator nicknames and expose native pagination for get_qun_album_list.
2026-07-20 13:03:16 +08:00
DrSmoothl 8df62d6486 fix(onebot): report API-sent private messages
Emit message_sent.private after successful friend messages sent through OneBot actions or the WebUI debug console when QQ does not provide an inbound self echo.

Keep a later QQ echo as the canonical stored event while suppressing duplicate downstream delivery across both race orders. Match echoes by conversation, sequence, message ID, and a bounded time window; leave group messages, temporary sessions, split file sends, unreliable receipts, and messages sent manually from the QQ client unchanged.

Add regression coverage for action-only reporting, both echo race orders, hash collisions, cached-but-unreported events, temporary sessions, and incomplete receipts.

Fixes #251
2026-07-20 13:02:29 +08:00
DrSmoothl 810d72fa04 feat(onebot): implement collection list retrieval
Replace the get_collection_list placeholder with authenticated, read-only collection retrieval through the existing bridge API.

Add strict binary envelope validation, bounded pagination, accurate category filtering, preserved 64-bit identifiers, and explicit ticket, transport, service, and malformed-response failures. Cap item counts, page traversal, response bytes, per-request waits, and the total operation time.

Expose the compatible response model through Core, OneBot, the SDK, and the generated MCP catalog. Cover protocol framing, cursor behavior, filtered hasMore semantics, cleanup failures, bridge ticket acquisition, and Action validation with regression tests.

Verified with the live test bot without changing native components or adding any collection write behavior.
2026-07-19 20:22:16 +08:00
DrSmoothl 4e62fdc80b chore(release): v1.12.6 2026-07-19 19:38:13 +08:00
DrSmoothl f3bfec04a5 feat(onebot): implement online client queries
Replace the get_online_clients placeholder with the latest QQ online-device snapshot and return stable OneBot fields for client ID, device name, and localized device category.

Fail explicitly when no snapshot has been observed or when callers request an unsupported fresh refresh, while preserving an observed empty snapshot as a successful result. Update SDK types and generated MCP schemas, and add action-level coverage for every state.
2026-07-19 19:20:28 +08:00
DrSmoothl b92c8ad881 feat(protocol): decode online device snapshots
Decode Event 0x210 subtype 349 into typed online-device snapshots, including QQ-compatible low-byte client type normalization and one-entry-per-device-category projection.

Keep replacement snapshots outside system-message deduplication, reject malformed device identities observably, and add wire-level regressions for complete, packed, repeated, and invalid payloads. Live verification covered mobile account switching without requiring native changes.
2026-07-19 19:19:58 +08:00
DrSmoothl e6a69b05a7 feat(onebot): expose group folder upload metadata
Decode the folder modifier metadata returned by group file listings and project it as last upload time, uploader ID, and uploader name for both folder listing actions.

Regenerate the MCP catalog and add protocol, bridge, OneBot projection, and action schema coverage for the new fields.

Closes #248
2026-07-19 18:34:53 +08:00
DrSmoothl f3e0c4e45a fix(onebot): allow clearing the self signature
Accept explicit empty strings from both longNick and long_nick when callers need to clear the bot signature. Missing and non-string values remain rejected before reaching the bridge.

Preserve the QQ-compatible clear representation by omitting the empty profile value, and add action-level and wire-level regression coverage. Live verification confirmed successful clearing and readback on the test bot.

Fixes #247
2026-07-19 18:12:48 +08:00
DrSmoothl 65e819d96e feat(onebot): expose stranger profile signatures
Return the NapCat-compatible long_nick field from get_stranger_info for both freshly fetched and cached user profiles. Keep the field present as an empty string when profile data is unavailable so callers receive a stable response shape.

Document the response contract in the Action schema and generated MCP catalog, and cover fetched, cached, and empty fallback paths with regression tests. This change reuses the existing profile signature value and does not add QQ requests or alter protocol packets.

Closes #246
2026-07-19 17:26:59 +08:00
DrSmoothl 613b2b1e68 fix(proton): decode extended uint32 field varints
Consume complete well-formed value varints before retaining their low 32 bits, matching QQ push behavior without relaxing tag or length parsing.

Add generator and end-to-end group reaction regressions, including truncated and malformed varint coverage. Refs #242.
2026-07-19 15:35:53 +08:00
DrSmoothl 4391b45c41 chore(release): v1.12.5 2026-07-17 18:47:51 +08:00
DrSmoothl fadc7ce316 feat(onebot): expose bidirectional message history
Add reverse_order to group and private history actions, preserve latest-page behavior without an anchor, and keep local fallback results chronologically ordered.

Key self-sent private messages and reply targets by the conversation peer, reject cross-conversation anchors, and include request context when a server fetch falls back to local history.

Refs #229
2026-07-17 17:45:30 +08:00
DrSmoothl 6a1042e33f chore(release): v1.12.4 2026-07-16 20:29:00 +08:00
DrSmoothl 0e3bbc6906 fix(protocol): correct group membership notices
Derive group increase approval and invitation subtypes from the member-change operation code instead of actor identity.

Treat voluntary leave field 5 as structured metadata and attribute the operation to the departing member so valid notices are not discarded.

Add protocol and OneBot regression coverage for issue #237.
2026-07-16 19:41:48 +08:00
DrSmoothl ebd02c3f3d chore(release): v1.12.3 2026-07-15 21:31:59 +08:00
DrSmoothl 9c61d991bd feat(onebot): report stalled receive health
Separate account login state from receive-path health in get_status. A logged-in account remains online while good becomes false only after the receive path has been confirmed stale.

Apply the same health value to OneBot lifecycle and heartbeat events so API polling and event consumers observe consistent status semantics.

Regenerate the MCP action catalog with the clarified contract and add regression coverage for the online-but-degraded response.

Refs #233.
2026-07-15 16:48:02 +08:00
DrSmoothl 2fea3ca4d9 feat(core): validate backup restores before mutation
Route selected backup entries through owner-owned config parsers before any filesystem write. Reject unsupported paths, mismatched encodings, malformed base64, lossy normalization, invalid effective overlays, and decoded payloads larger than 32 MiB.

Treat WebUI state, private keys, and every OneBot config as a single sensitive group. Skip unselected sensitive entries without inspecting their contents, preserve recognized migrations, and assign restrictive modes to credential files.
2026-07-15 16:11:44 +08:00
DrSmoothl a3467a8d89 chore(release): v1.12.2 2026-07-14 07:57:08 +08:00
DrSmoothl 5885187e7d test(group-notice): cover publishing options and readback
Verify endpoint selection, option validation, image metadata parsing, response merging, and OneBot forwarding. Cover the type-20 new-member path and fail-fast conflict behavior.
2026-07-14 03:39:27 +08:00
DrSmoothl 51eb1f733d feat(group-notice): support advanced announcement controls
Route regular and new-member announcements through their correct web endpoints. Validate option conflicts, preserve existing defaults, merge returned notice collections, and surface transport and upload failures.
2026-07-14 03:39:11 +08:00
DrSmoothl defe15694b feat(onebot): implement mark all as read
Replace the compatibility no-op with a real batched read action for current groups and observed incoming private conversations.

Exclude stale groups, group temporary sessions, and sent-message echoes from private targets, then expose the functional action through the generated MCP catalog.

Add action and message-store regressions for target selection and delegation.
2026-07-13 23:02:08 +08:00
DrSmoothl 03aec3b052 fix(core): verify conversation read updates
Replace message-header sequence forwarding with a server-guided read flow for group and private conversations.

Batch read reports conservatively, validate per-conversation results and cursor advancement, and fail with actionable errors when the server does not apply an update.

Add regression coverage for mixed batches, pagination, already-current sessions, malformed responses, and private sequence-domain mismatches.
2026-07-13 23:01:39 +08:00
DrSmoothl b5452c59e6 fix(onebot): return categorized friend lists 2026-07-13 18:51:45 +08:00
DrSmoothl 2ae9a47249 fix(onebot): clarify invalid JSON segment errors
Validate the public OneBot data.data field before converting JSON segments to the internal message element shape. Invalid payloads still return retcode 1400, but now identify the correct public field without reaching the QQ bridge.

Add Action-level regression coverage for issue #220.
2026-07-12 16:43:05 +08:00
DrSmoothl a824e0b46a fix(onebot): repair group system message queries 2026-07-10 19:11:15 +08:00
DrSmoothl b53004ee23 fix(proton): accept sign-extended uint32 field values 2026-07-10 18:20:11 +08:00
DrSmoothl c04864dd21 chore(release): v1.12.1 2026-07-10 14:00:40 +08:00
DrSmoothl 852004291b feat(onebot): reconcile and drain network adapters
Serialize desired network plans, isolate per-adapter apply failures, restore prior bindings when possible, and report saved versus applied state. Quiesce Action and event ingress, await in-flight dispatches and transport closes, retain failed generations for retry, and propagate shutdown failures.
2026-07-10 13:49:17 +08:00
DrSmoothl 01688c7567 fix(protocol): enforce message element contracts end to end
Replace the open message bag with a validated discriminated union and preflight complete messages before uploads or sends. Return BAD_REQUEST for invalid or unsendable segments instead of dropping fields, sending partial content, or silently changing private messages.
2026-07-10 13:47:06 +08:00
DrSmoothl aff6ad9179 refactor(onebot): make config persistence explicit
Persist user saves as authoritative per-account snapshots while retaining legacy overlay compatibility. Validate deterministic topology errors before writing and replace configuration files atomically.
2026-07-10 13:46:09 +08:00
DrSmoothl 588fdab8de refactor(onebot): compile and seal the action registry
Compile canonical names, aliases, stream kinds, documentation, and raw reservations into one immutable registry. Reject duplicate, undeclared, mismatched, or late handler registration before requests can be dispatched.
2026-07-10 13:45:32 +08:00
DrSmoothl 4825434ffa fix(onebot): await malformed stream responses
Wait for asynchronous transports to flush bad-request frames before processStreamRequest returns. This prevents malformed Stream API requests from losing their terminal error response.
2026-07-10 13:43:31 +08:00
DrSmoothl 35958a7fc2 fix(onebot): use canonical group request flags 2026-07-10 02:42:07 +08:00
DrSmoothl 3c73d1d5b0 feat(onebot): reply into group temp sessions (临时会话) (#212)
send_private_msg / send_msg can now reply to a group temp-session message
by passing the source group_id. Inbound temp messages surface their
source group on sender.group_id; a reply is only made into a temp session
the bot has an inbound record of. Group temp replies route through
RoutingHead.grpTmp (field 3).
2026-07-10 02:29:18 +08:00
DrSmoothl 5e73d69663 fix(test): add groupName to GroupMessage test fixtures (#212 CI)
core's typecheck covers its own tests (protocol/onebot typecheck src
only), so the newly-required GroupMessage.groupName field failed the
Dev Build typecheck on test fixtures that construct group_message
events. Add groupName to every such fixture across core/onebot/protocol
tests.
2026-07-09 19:18:09 +08:00
DrSmoothl 9b470d0412 feat(onebot): add group_name to group message events (#212)
Group message events (message + message_sent) now carry group_name — a
non-standard but common OneBot extension. The name comes from the
message's own wire field (ResponseGrp field 7, accurate even right after
a rename), falling back to the identity group cache, else '' when neither
is available. It's resolved in the group-message decoder, where both the
wire head and the identity cache are already at hand, so the converter
just passes it through (no ConverterContext change).

Verified live (tempserver): real inbound group messages from a non-self
account carry group_name set to the actual group name.
2026-07-09 18:50:54 +08:00
DrSmoothl b6fb5bd530 chore(release): v1.12.0 2026-07-07 22:38:02 +08:00
DrSmoothl 8fbcbd29ff feat(onebot): honour a custom per-node time in merged forward (#209)
Merged-forward nodes always stamped the current time. A custom forward can now
set each node's displayed timestamp via the OneBot `data.time` field (unix
seconds), matching the field the wire already carries per node.

parseForwardNodes reads `data.time` on custom/fake nodes and threads it onto the
node payload (the `time?` field already existed for the receive side);
buildForwardPushBody uses it for `contentHead.timestamp`, falling back to now
when absent. The value is validated to a plausible unix-seconds range — the wire
field is uint32, so a millisecond or out-of-range input is rejected (would
overflow) and defaults to now rather than corrupting the timestamp. The
message_id-reference branch (time from the quoted message) and the c2c-file
expireTime (real now) are unchanged. Nested inner nodes honour their own time.
2026-07-07 21:35:33 +08:00