Merge origin/master into hermes/hermes-4fd30995

This commit is contained in:
2026-05-15 03:41:50 +08:00
348 changed files with 31117 additions and 4591 deletions

View File

@@ -84,7 +84,9 @@ pub(super) fn map_match3d_anchor_pack_response_for_turn(
}
}
pub(super) fn map_match3d_anchor_item_response(anchor: Match3DAnchorItemRecord) -> Match3DAnchorItemResponse {
pub(super) fn map_match3d_anchor_item_response(
anchor: Match3DAnchorItemRecord,
) -> Match3DAnchorItemResponse {
Match3DAnchorItemResponse {
key: anchor.key,
label: anchor.label,
@@ -109,7 +111,9 @@ pub(super) fn map_match3d_anchor_item_response_for_collected(
}
}
pub(super) fn map_match3d_config_response(config: Match3DCreatorConfigRecord) -> Match3DCreatorConfigResponse {
pub(super) fn map_match3d_config_response(
config: Match3DCreatorConfigRecord,
) -> Match3DCreatorConfigResponse {
Match3DCreatorConfigResponse {
theme_text: config.theme_text,
reference_image_src: config.reference_image_src,
@@ -122,7 +126,9 @@ pub(super) fn map_match3d_config_response(config: Match3DCreatorConfigRecord) ->
}
}
pub(super) fn map_match3d_draft_response(draft: Match3DResultDraftRecord) -> Match3DResultDraftResponse {
pub(super) fn map_match3d_draft_response(
draft: Match3DResultDraftRecord,
) -> Match3DResultDraftResponse {
Match3DResultDraftResponse {
profile_id: draft.profile_id,
game_name: draft.game_name,
@@ -280,7 +286,9 @@ pub(super) fn find_match3d_generated_background_asset(
.find_map(|asset| asset.background_asset.clone())
}
pub(super) fn resolve_match3d_default_cover_image_src(assets: &[Match3DGeneratedItemAsset]) -> Option<String> {
pub(super) fn resolve_match3d_default_cover_image_src(
assets: &[Match3DGeneratedItemAsset],
) -> Option<String> {
find_match3d_generated_background_asset(assets).and_then(|asset| {
asset
.container_image_src
@@ -335,7 +343,27 @@ pub(super) fn apply_match3d_background_asset_to_agent_draft(
}
}
pub(super) fn map_match3d_message_response(message: Match3DAgentMessageRecord) -> Match3DAgentMessageResponse {
pub(super) fn build_match3d_work_profile_record_with_assets(
mut item: Match3DWorkProfileRecord,
assets: &[Match3DGeneratedItemAsset],
) -> Match3DWorkProfileRecord {
item.generated_item_assets_json = serialize_match3d_generated_item_assets(assets);
if let Some(background_asset) = find_match3d_generated_background_asset(assets) {
item.cover_image_src = item.cover_image_src.or_else(|| {
background_asset
.container_image_src
.clone()
.or(background_asset.container_image_object_key.clone())
.or(background_asset.image_src.clone())
.or(background_asset.image_object_key.clone())
});
}
item
}
pub(super) fn map_match3d_message_response(
message: Match3DAgentMessageRecord,
) -> Match3DAgentMessageResponse {
Match3DAgentMessageResponse {
id: message.message_id,
role: message.role,
@@ -345,7 +373,9 @@ pub(super) fn map_match3d_message_response(message: Match3DAgentMessageRecord) -
}
}
pub(super) fn map_match3d_work_summary_response(item: Match3DWorkProfileRecord) -> Match3DWorkSummaryResponse {
pub(super) fn map_match3d_work_summary_response(
item: Match3DWorkProfileRecord,
) -> Match3DWorkSummaryResponse {
let generated_item_asset_json =
parse_match3d_generated_item_assets(item.generated_item_assets_json.as_deref());
let background_asset = find_match3d_generated_background_asset_json(&generated_item_asset_json);
@@ -413,7 +443,9 @@ pub(super) fn require_match3d_background_music_title(
Ok(title)
}
pub(super) fn map_match3d_work_profile_response(item: Match3DWorkProfileRecord) -> Match3DWorkProfileResponse {
pub(super) fn map_match3d_work_profile_response(
item: Match3DWorkProfileRecord,
) -> Match3DWorkProfileResponse {
Match3DWorkProfileResponse {
summary: map_match3d_work_summary_response(item),
}
@@ -450,7 +482,9 @@ pub(super) fn map_match3d_run_response(run: Match3DRunRecord) -> Match3DRunSnaps
}
}
pub(super) fn map_match3d_item_response(item: Match3DItemSnapshotRecord) -> Match3DItemSnapshotResponse {
pub(super) fn map_match3d_item_response(
item: Match3DItemSnapshotRecord,
) -> Match3DItemSnapshotResponse {
Match3DItemSnapshotResponse {
item_instance_id: item.item_instance_id,
item_type_id: item.item_type_id,
@@ -465,7 +499,9 @@ pub(super) fn map_match3d_item_response(item: Match3DItemSnapshotRecord) -> Matc
}
}
pub(super) fn map_match3d_tray_slot_response(slot: Match3DTraySlotRecord) -> Match3DTraySlotResponse {
pub(super) fn map_match3d_tray_slot_response(
slot: Match3DTraySlotRecord,
) -> Match3DTraySlotResponse {
Match3DTraySlotResponse {
slot_index: slot.slot_index,
item_instance_id: slot.item_instance_id,
@@ -487,4 +523,3 @@ pub(super) fn map_match3d_click_confirmation_response(
run: map_match3d_run_response(confirmation.run),
}
}

View File

@@ -34,7 +34,9 @@ pub(super) fn normalize_match3d_tag(value: &str) -> String {
.collect::<String>()
}
pub(super) fn normalize_match3d_tag_candidates<S>(candidates: impl IntoIterator<Item = S>) -> Vec<String>
pub(super) fn normalize_match3d_tag_candidates<S>(
candidates: impl IntoIterator<Item = S>,
) -> Vec<String>
where
S: AsRef<str>,
{
@@ -169,4 +171,3 @@ pub(super) fn parse_match3d_tags_from_text(raw: &str) -> Vec<String> {
pub(super) fn fallback_match3d_work_tags(game_name: &str, theme_text: &str) -> Vec<String> {
normalize_match3d_tag_candidates([theme_text, game_name, "抓大鹅", "经典消除", "2D素材"])
}