Commit Graph
220 Commits
Author SHA1 Message Date
H3CoF6 8fbddf67bf Feat: 发送图文ark卡片 (#355)
* feat(onebot): implement send tuwen ark

* test: add unit tests for send_ark action

* test(onebot): update canonical action docs count expectation to 191

* refactor(protocol,onebot): update 0xdc2_34 ark implementation and test coverage

- Rename action send_ark -> send_tuwen_ark to distinguish from structmsg and contact-share arks.
- Clarify SSO command mapping (OidbSvcTrpcTcp.0xdc2_34) and default param behavior in comments/docs.
- Adjust peerType, field3, and previewUrl to pb_optional to preserve 0/empty values during proton encoding.
- Update OneBot handler, tests, and auto-generated MCP tool catalog specs.

* style(protocol): fix indentation in rich-body-decoder tests
2026-08-20 12:12:39 +08:00
DrSmoothl 8fdd41ea22 fix(onebot): restore group and doubt request accounts
get_group_system_msg now keeps join and invite records, reports the
inviter, and fills a missing requester nick from the user profile.
get_doubt_friends_add_request returns the QQ number plus the request
message, source, and time that QQ actually sends.

Closes #400
Closes #401
Closes #402
Closes #403
2026-08-19 21:45:15 +08:00
DrSmoothl 5a10fc4c9c feat(onebot): report the invited account on group invite events
request.group.invite already identified the inviter. The event now
also reports the invited account when QQ provides it.

Closes #394
2026-08-19 00:23:40 +08:00
DrSmoothl d879ba1027 test(onebot): stop pinning the Action catalog to a head count
The live registry already owns the action list. A hardcoded length
only failed after a real addition, so drop the extra number.
2026-08-17 21:28:14 +08:00
DrSmoothl 3e31fe90dc test(onebot): count the new group admin settings action
The compiled Action list grew by one when the matching getter was added.
2026-08-17 21:17:46 +08:00
DrSmoothl cd6ada0caa feat(onebot): accept join question and answer on set_group_add_option
add_type 4 takes group_question and group_answer. add_type 5 (and 55)
takes group_question. get_group_admin_settings also returns both.

Fixes #383
2026-08-17 19:12:43 +08:00
DrSmoothl b1fa11ca05 feat(onebot): add get_group_admin_settings
Bots can now read the current join option, robot-add option, member
invite policy, member permissions, history visibility, and search
settings that previously only had setters.

Fixes #385
2026-08-17 19:06:14 +08:00
DrSmoothl aec0c781b3 fix(onebot): approve pending group join requests that were rejected as gone
Closes #380.

An empty reject reason and a stale request type could make the server treat a still-pending join as already handled.
2026-08-17 18:40:08 +08:00
DrSmoothl d5f1e35c31 fix(core): close Bridges on exit without a fake offline 2026-08-17 00:08:21 +08:00
DrSmoothl 3941c825b5 refactor(onebot): convert segments through ConverterContext
The receive path already collapsed resolvers into ConverterContext,
but elementsToOneBotSegments still took an 8-arg splat. Callers
could drop message-id or media sinks without a type error.

The public function now takes ConverterContext. Self-sent events
pass explicit null resolvers. get_forward_msg uses the instance ctx.
2026-08-16 21:44:30 +08:00
DrSmoothl 30f0ae8571 refactor(onebot): compile a sealed Action handler bind
The registry already froze names, kinds, and raw reservations, but
handlers were a second mutable map filled through registerAction.

bind(ctx, api, rawFactories) now returns the complete name-to-handler
table. Stream actions expose toHandler. ApiHandler only installs and
dispatches. The public register ports are gone.
2026-08-16 21:30:10 +08:00
DrSmoothl 8583afaf2c fix(onebot): resolve signed-int32 reply ids
Reply segments treated negative message_id hashes as invalid, so quotes against those events were dropped.
2026-08-16 13:20:35 +08:00
DrSmoothl 6da412ab96 fix(onebot): keep real sender nick on forward nodes that cite a message id
Empty group cards were treated as a name, so get_forward_msg showed the QQ number instead of the stored nickname (#372).
2026-08-16 13:11:53 +08:00
DrSmoothl d014d6c379 feat(flash-transfer): let create_flash_task set per-file names
upload_file_stream now returns file_name with the original name.
create_flash_task accepts { file, name } so a streamed path can
keep the real filename on the fileset.

Fixes #361
2026-08-14 14:17:58 +08:00
DrSmoothl 925d9c0ac7 feat(flash-file): expose cover URL as flash_file.thumb
Incoming flash cards already carry a cover link; map it to
flash_file.data.thumb. Older cards without a cover leave it empty.

Fixes #367
2026-08-14 14:00:18 +08:00
DrSmoothl 91f0eb3b7e test(onebot): cover request actions and message-store migration worker 2026-08-14 11:09:22 +08:00
DrSmoothl 4c994dbd20 test(onebot): cover group admin, message, media, and quick-operation paths 2026-08-14 10:57:17 +08:00
DrSmoothl 2f5065545a fix(onebot): percent-decode file URL basenames on upload (#354)
send_group_msg / send_private_msg with a file segment that only has
file:// (no name/filename) used url.split('/').pop() as the upload
name, so percent-encoded CJK paths uploaded as
%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6.xlsx. Derive the fallback through
guessFileNameFromUrl, which decodeURIComponent's the path basename
(invalid encodings are left as-is). An explicit name still wins.

Fixes #354
2026-08-13 11:02:02 +08:00
DrSmoothl 190f156fca fix(onebot): preserve group requests with unknown senders
Deliver actionable invitations even when the sender account is unavailable instead of failing the full polling batch.

Isolate malformed records, keep sibling requests flowing, and distinguish multiple anonymous invitations by their request handles.

Add regression coverage for repeated polls, batch isolation, and anonymous-request deduplication.
2026-08-10 13:12:18 +08:00
DrSmoothl 1996192a5e feat(onebot): report web-originated group requests
Report pending group invitations through the standard OneBot request event even when their origin does not provide a live notification.

Prevent duplicate delivery when the same invitation is observed more than once, stop outstanding work with the account lifecycle, and preserve previously supported invitation behavior.

Expand group-system message queries and surface incomplete lookups instead of reporting misleading empty or not-found results.
2026-08-10 00:26:16 +08:00
DrSmoothl 870e9a5fbc fix(bridge): recover stale outbound sessions
Recover invalidated native send bindings from same-account receive evidence. Track outbound connection loss in status health and refresh the six public native artifacts from native build 94f2b63.

Closes #342
2026-08-09 21:40:09 +08:00
DrSmoothl 129b091081 fix(onebot): skip unusable reply segments
Keep delivering valid message content when a reply target cannot be resolved, while retaining strict validation for all other segments.

Fixes #339
2026-08-09 17:25:48 +08:00
DrSmoothl c08150fc0c feat(onebot): query group todo messages
Fixes #332
2026-08-09 13:36:41 +08:00
DrSmoothl 4aba81ec6b feat(onebot): decode bot markdown and keyboards
Fixes #337
2026-08-09 13:06:35 +08:00
DrSmoothl 1e0c91e74d feat(onebot): configure group member permissions
Fixes #335
2026-08-09 12:56:05 +08:00
DrSmoothl e08613062e feat(onebot): configure group history visibility
Fixes #336
2026-08-09 12:53:45 +08:00
DrSmoothl cd6fcadea4 feat(onebot): configure group invite policy
Add validated group member invite policy updates with post-write verification.

Fixes #334
2026-08-09 11:46:04 +08:00
DrSmoothl 597a4c05f3 feat(onebot): fetch custom face details
Add packet-backed custom face detail retrieval and expose the result through the OneBot action.

Fixes #333
2026-08-09 11:45:43 +08:00
DrSmoothl 39d5a50d5f fix(protocol): accept Unicode system face identifiers (#324) 2026-08-08 17:42:14 +08:00
DrSmoothl 65683bb44d fix(onebot): accept compatible JSON card payloads (#325) 2026-08-08 10:14:39 +08:00
DrSmoothl 005154077f fix(onebot): accept id-less custom music cards (#319) 2026-08-07 21:50:28 +08:00
DrSmoothl 27c527976b fix(onebot): reject ambiguous video message combinations
Prevent ordinary messages and forwarded nodes from combining video content with visible sibling segments or additional videos. Invalid combinations now fail before parsing side effects, media work, or bridge sends, while exact empty text placeholders remain compatible with a single video.

Cover group, private, temporary-session, CQ string, nested forward, cached forward, and protocol-builder paths. Preserve the existing standalone window-shake behavior and keep valid single-video messages unchanged.
2026-08-05 23:55:55 +08:00
DrSmoothl 2ac0b92859 fix(onebot): support standard forward WebSocket routes
Accept the standard action, event, and universal paths when a forward WebSocket server listens at the root endpoint.

Keep authentication, custom endpoints, embedded listeners, and rejected-path reporting compatible while assigning each accepted connection the correct role.

Add real-listener regression coverage for standard paths, trailing slashes, query authentication, invalid paths, and existing lifecycle behavior.

Fixes #317
2026-08-05 19:39:30 +08:00
DrSmoothl 81699b839d feat(onebot): expose group member mute expiry
Return the mute expiry timestamp from group member list and detail actions, using zero when no active mute is available.

Keep the public action descriptions and generated MCP catalog aligned, and cover muted, unmuted, and unavailable member responses.

Refs #314
2026-08-05 12:28:47 +08:00
DrSmoothl 634097460c feat(onebot): expose group-wide mute status
Report whether group-wide mute is enabled through the existing group list and group information responses.

Keep standard and extended queries aligned, support explicit refreshes in the SDK, and update the generated action documentation without adding another endpoint.

Preserve established compatibility values, isolate cached non-member results by account, and add coverage across the request, mapping, action, and client layers.

Closes #313
2026-08-04 23:27:58 +08:00
DrSmoothl c6619fda0a feat(onebot): expose system face catalog queries
Add read-only actions for catalog retrieval, per-face lookup, search, and super-face classification. Publish matching SDK methods and generated MCP schemas, including valid face ID zero.
2026-08-04 23:13:51 +08:00
DrSmoothl 938975dd45 fix(onebot): report uploaded private files as sent messages
Route private file publication through the common send path so successful uploads retain their send receipt and emit a complete self-sent event.

Return action failures when publication fails while preserving upload_file=false as a non-publishing operation.
2026-08-04 18:13:22 +08:00
DrSmoothl 3c97e71650 fix(onebot): strengthen endpoint defaults
Use safer defaults for newly created service endpoints and guide operators toward suitable access credentials without disrupting existing deployments.

Apply the same policy at the save boundary, retain deliberate local-only setups and external client compatibility, and add regression coverage for editing, recovery, and trusted access paths.
2026-08-01 18:12:04 +08:00
DrSmoothl ae2e894f14 fix(onebot): protect managed stream storage
Validate managed storage before stream files are created, read, or cleaned, and reject unsafe local directory state without changing the public stream actions.

Keep ordinary existing installations compatible and add regression coverage for startup, runtime replacement, ownership, permissions, and normal transfer behavior.
2026-08-01 17:23:17 +08:00
DrSmoothl 3c772df818 fix(onebot): enforce WebSocket access policy
Apply the configured access policy before server-side WebSocket sessions are established across both listener modes.

Preserve established client compatibility and runtime configuration changes, with regression coverage for accepted and rejected connections.
2026-08-01 17:09:04 +08:00
DrSmoothl 659e0bd3d0 fix(friend): verify and synchronize remark updates
Validate the service result before reporting friend remark changes as successful. Rejected, incomplete, or contradictory confirmations now reach callers instead of being reported as completed.

Keep confirmed remarks synchronized in the identity cache and consume cross-client remark updates without exposing a new OneBot event. Local cache failures remain observable without turning an already completed remote change into a retryable failure.

Preserve friend remarks exactly across restarts and add request, response, persistence, receive-pipeline, and action-level regression coverage.

Fixes #303.
2026-07-31 23:21:05 +08:00
DrSmoothl b8ccbdbf18 fix(onebot): project group essence files correctly
Treat type-four group essence entries as files and use the returned file name, identifier, size, and business metadata instead of requiring an optional thumbnail. This restores ordinary file entries without changing pagination, message identifiers, or metadata cache atomicity.

Extend the response model and cover files with and without previews, malformed file fields, and cache safety on projection failures.

Fixes #302.
2026-07-31 22:44:22 +08:00
DrSmoothl f6e2410dae fix(onebot): normalize group essence message results
Translate group essence responses into the established OneBot shape instead of exposing the upstream digest payload.

Return validated sender, operator, timestamp, message identifier, and message segment fields for text, face, image, and video entries. Retain the authoritative message metadata in one transaction so returned identifiers can be used by later essence actions without partial cache state.

Reject malformed, cross-group, incomplete, or unknown digest entries, and surface pagination or upstream failures instead of returning truncated success results.

Fixes #300.
2026-07-31 15:40:53 +08:00
DrSmoothl a67614fa09 feat(logging): complete runtime trace diagnostics
Complete byte-level diagnostics for network, upload, runtime lifecycle, authenticated write, and background operation paths.

Preserve streaming behavior, file-storage boundaries, and default log volume while making failures, retries, cancellation, and final outcomes independently diagnosable.

Add focused regression coverage for correlation, partial data, resource context ownership, and terminal-state accuracy.
2026-07-31 11:21:12 +08:00
DrSmoothl f9c4063fc5 feat(onebot): complete trace operation chains
Make short TRACE captures independently explain OneBot action and event lifecycles from complete input through a truthful terminal conclusion. Preserve request correlation across asynchronous work while keeping disabled TRACE paths allocation-free and lazy.

Cover shutdown rejection, stream cancellation, event conversion and suppression, reporter invocation settlement, and HTTP delivery outcomes without changing established transport or observer behavior. Add focused regression coverage for lifecycle uniqueness, context reuse, disconnect handling, and quiesce ingress boundaries.
2026-07-30 17:13:40 +08:00
DrSmoothl b9104f0a5b feat(logging): establish trace diagnostics contract
Make short-lived TRACE sessions complete and correlatable without adding a persistent trace channel or changing the existing file-log safety boundary.

Protect ordinary console, subscriber, and file logs from authentication material while preserving the one documented first-start credential notice. Keep action breadcrumbs useful through bounded summaries and a narrow diagnostic name for the emoji-like pagination offset.

Lock the contract with regressions for byte-complete rendering, lazy execution, request-context reuse, credential redaction, unredacted TRACE data, and non-persistence of TRACE records.
2026-07-30 12:07:32 +08:00
DrSmoothl f0ff8da2fa feat(onebot): support moving friends between categories
Add the set_friends_category action with either an existing category ID or an exact unique category name.

Validate the current friend and category roster before applying a change, reject missing or ambiguous targets, and surface failed updates instead of reporting false success. Expose the action through the SDK types and cover validation, successful updates, repeat requests, service rejection, and registry completeness.

Closes #297
2026-07-30 10:37:16 +08:00
DrSmoothl a3b790d472 feat(onebot): expose group remarks in group queries
Include each account's saved group remark in group list and detail responses.

Keep joined-group, non-member, and fallback results shape-consistent when no remark is available. Document the field in the public response metadata and cover cached and refreshed query paths with regression tests.

Closes #294
2026-07-30 10:36:43 +08:00
DrSmoothl 25e61ce5df fix(onebot): continue storage updates after account startup
Start each account as soon as its message storage is ready, then continue older history updates without delaying normal account availability. Keep already started accounts online when maintenance needs to be retried.

Handle preparation failures, stale completions, early exits, logout, and shutdown consistently. Add lifecycle coverage for startup ordering, automatic retries, cancellation, and account availability.
2026-07-30 09:57:18 +08:00
DrSmoothl caed31ca20 fix(onebot): prepare message storage without blocking startup
Prevent existing message histories from being fully updated on the account startup path. Preserve current message behavior while allowing unfinished maintenance to continue safely after restarts.

Add coverage for older databases, interrupted upgrades, new messages written during maintenance, and newly created account storage.
2026-07-30 09:57:00 +08:00