Skip to content

Let's use AI to Earn!

feat: The interaction and integration of my channel and works have been completed (#479)

Gaof14e20696c33
diff --git a/project/web/.claude/rules/default.md b/project/web/.claude/rules/default.md
index d5bcb809..381e25a6 100644
--- a/project/web/.claude/rules/default.md
+++ b/project/web/.claude/rules/default.md
@@ -5,9 +5,10 @@ TypeScript 类型检查:使用 `npx tsc --noEmit`,不要使用 `npm run buil
# 项目主题色
-1. 项目使用shadcnui 默认的中性灰色系即可,不需要其它主题色。
+1. 项目使用shadcnui 默认的中性灰色系即可,不需要其它主题色,注意,不要无脑用中性色,需要其它漂亮的颜色点缀的地方,可以使用 shadcnui 提供的语义化颜色变量。
2. 注意项目要实现主题色 深色/浅色 切换,不要使用硬编码的颜色类(如 text-gray-900、bg-white),要使用shadcn/ui 的语义化颜色变量,全局css `/src/app/globals.css`。
3. 不要使用 `/src/app/var.css` 中的颜色,我现在在过渡阶段,项目中所有用到 var.css 的地方我都会逐渐全改了。
+4. 注意修复eslint问题。
# 测试和文档规则
diff --git a/project/web/public/en/agentTasks_api.txt b/project/web/public/en/agentTasks_api.txt
deleted file mode 100644
index 78306b89..00000000
--- a/project/web/public/en/agentTasks_api.txt
+++ /dev/null
@@ -1,760 +0,0 @@
-
-id: 1
-data: {"type":"init","taskId":"694a77d5d8f9058d53c4bb5d"}
-
-id: 2
-data: {"type":"keep_alive"}
-
-id: 3
-data: {"type":"keep_alive"}
-
-id: 4
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"200432ce-0c3f-4fad-8a22-2d1b5dc81288","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01DqWZ7HEpcZ5VfhLAnh7A4v","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":260,"cache_read_input_tokens":31384,"cache_creation":{"ephemeral_5m_input_tokens":260,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}},"parent_tool_use_id":null}}
-
-id: 5
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fb624f7c-401e-4745-8ae8-39510a6c5261","event":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},"parent_tool_use_id":null}}
-
-id: 6
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e6fd949c-031a-4f4d-a48b-a6ba93b16a64","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"好"}},"parent_tool_use_id":null}}
-
-id: 7
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8a20fcf2-e350-423a-8783-872563170a76","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"的,"}},"parent_tool_use_id":null}}
-
-id: 8
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9dbe3198-eed3-4bf7-b8be-69126f31d2e5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"我将"}},"parent_tool_use_id":null}}
-
-id: 9
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2ae58102-fc4c-42c0-979b-f18cf03b8d35","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"再"}},"parent_tool_use_id":null}}
-
-id: 10
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3c07fd38-e866-4a90-b8c7-9d972530ab5b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"次发布这"}},"parent_tool_use_id":null}}
-
-id: 11
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1feb878c-c43c-4c8b-b6e6-d8d39fe89e1c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"3"}},"parent_tool_use_id":null}}
-
-id: 12
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6a4a1805-bc94-4665-9352-87ad8fe24bf3","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"张"}},"parent_tool_use_id":null}}
-
-id: 13
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"31c949c8-5d9e-4166-80a4-1911ec2d7e07","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"哆啦A梦"}},"parent_tool_use_id":null}}
-
-id: 14
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"59deebe9-45fc-4801-8e9b-bb53965c4e19","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"漫画图片到Instagram..."}},"parent_tool_use_id":null}}
-
-id: 15
-data: {"type":"assistant","message":{"type":"assistant","uuid":"1cf8bceb-c5d7-4075-a084-9336394e3dfe","message":{"id":"msg_01DqWZ7HEpcZ5VfhLAnh7A4v","content":[{"type":"text","text":"好的,我将再次发布这3张哆啦A梦漫画图片到Instagram..."}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":260},"cache_creation_input_tokens":260,"cache_read_input_tokens":31384,"input_tokens":3,"output_tokens":1,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
-
-id: 16
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7609baec-08c5-4619-a7b8-cdc8b4c2e9dd","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
-
-id: 17
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"45ce247c-a22e-4060-a678-4736bbabd6a1","event":{"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01PT3Mhygkv36PaNaev1tNvk","name":"mcp__publish__publishPostToInstagram","input":{}}},"parent_tool_use_id":null}}
-
-id: 18
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"39399417-c188-4bcc-a4d2-28d5b9e7a0ef","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}},"parent_tool_use_id":null}}
-
-id: 19
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"560f4013-34a9-424f-8314-cf0f9c0f5b96","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\""}},"parent_tool_use_id":null}}
-
-id: 20
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a24ea2eb-bb6a-4f51-b0c5-5f7a59180776","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"accou"}},"parent_tool_use_id":null}}
-
-id: 21
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2a7d1e46-49d6-4d01-93ae-268f479a2db6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ntId\": \"inst"}},"parent_tool_use_id":null}}
-
-id: 22
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0cc8c513-1dc2-4fd8-8e6b-ae2ca946f783","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"agram_25"}},"parent_tool_use_id":null}}
-
-id: 23
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1ad9f1e8-3efe-40d9-ab9e-2aaf3b0f2c3f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"72156652750"}},"parent_tool_use_id":null}}
-
-id: 24
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c6256c4c-fe81-4520-a881-c7b243cf5e85","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"1315\""}},"parent_tool_use_id":null}}
-
-id: 25
-data: {"type":"keep_alive"}
-
-id: 26
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e0a60159-414d-4d1a-aeca-cdcbdd0d4c7b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"user"}},"parent_tool_use_id":null}}
-
-id: 27
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"af164319-8500-4fa6-905d-36780115c387","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"Id\":"}},"parent_tool_use_id":null}}
-
-id: 28
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9c68090e-8274-4d5f-bdca-a7beae6735b0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" \"68ab"}},"parent_tool_use_id":null}}
-
-id: 29
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"926288a2-4be4-4437-86bc-5529eb814845","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"be6af812ccb"}},"parent_tool_use_id":null}}
-
-id: 30
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"04f299db-693b-422a-b450-28528d5a0fad","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3e1a"}},"parent_tool_use_id":null}}
-
-id: 31
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9fa93a18-8740-478b-b68a-c5b8fa22e7d7","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"53d68\""}},"parent_tool_use_id":null}}
-
-id: 32
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e4f030d2-d4b4-4a35-9b4e-97a82e091e3b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"t"}},"parent_tool_use_id":null}}
-
-id: 33
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9066b030-98f7-4fa7-a814-5672eddf6d10","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"itle\":"}},"parent_tool_use_id":null}}
-
-id: 34
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f0f01c79-defd-4407-a2b4-cf02b9e9818e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" \"Doraemo"}},"parent_tool_use_id":null}}
-
-id: 35
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c2f3dafd-c176-476c-9976-1761cb288ace","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"n "}},"parent_tool_use_id":null}}
-
-id: 36
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"314cae9b-b492-4b08-98ec-9dc30c5bafe0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"Comic Ad"}},"parent_tool_use_id":null}}
-
-id: 37
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"522d1929-2dac-44cb-8d69-57b8ce0f804d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ventur"}},"parent_tool_use_id":null}}
-
-id: 38
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2e9c50ba-45cc-4c05-85bb-673f69c12c30","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"e 🎨✨\""}},"parent_tool_use_id":null}}
-
-id: 39
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7dfcfa45-b4f1-4291-bca9-4d0552d68d2c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"desc\": "}},"parent_tool_use_id":null}}
-
-id: 40
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"57fba50c-5e27-4973-bf9d-e5430800582b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\"Vibran"}},"parent_tool_use_id":null}}
-
-id: 41
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"29f2b85c-9aac-4ea6-b6bc-d1a93862d9d4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"t Doraem"}},"parent_tool_use_id":null}}
-
-id: 42
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"90f60da9-1837-4b86-8f00-121a52bf2b4e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"on "}},"parent_tool_use_id":null}}
-
-id: 43
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2c87cbe8-73e1-4e8e-8fef-13d872310b86","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"manga-st"}},"parent_tool_use_id":null}}
-
-id: 44
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5b8810ae-3203-4ff1-9c8c-74515fcdf5cf","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"yle illustr"}},"parent_tool_use_id":null}}
-
-id: 45
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dfbb086e-6fba-473b-806c-d6f214202c93","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ations"}},"parent_tool_use_id":null}}
-
-id: 46
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"06118aa8-f529-40d3-a440-676d5ceb25d4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" br"}},"parent_tool_use_id":null}}
-
-id: 47
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5bb254f1-2338-455e-9baa-1dd600a4ee52","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"inging clas"}},"parent_tool_use_id":null}}
-
-id: 48
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0ee1b41a-8bf7-444b-93e0-dcfd30a66c00","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"sic advent"}},"parent_tool_use_id":null}}
-
-id: 49
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f0f69bb2-908b-4260-a221-af97102f5573","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ure"}},"parent_tool_use_id":null}}
-
-id: 50
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8524a075-870c-4fe0-8198-bac417762af8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"s to"}},"parent_tool_use_id":null}}
-
-id: 51
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"28697f68-174e-4a4a-ba6b-34f41c06de78","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" life!"}},"parent_tool_use_id":null}}
-
-id: 52
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7b0300f2-c75e-41a6-b638-69ec5b36fc76","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" Feat"}},"parent_tool_use_id":null}}
-
-id: 53
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e0eabdc7-e5f3-407f-ac30-134bade02103","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"uring dynami"}},"parent_tool_use_id":null}}
-
-id: 54
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0035bee4-7f81-4e4a-a0c3-4f8bfca72982","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"c comic pane"}},"parent_tool_use_id":null}}
-
-id: 55
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4de4c6ca-dfcb-4483-a3d1-50d1f7d8a807","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ls with bri"}},"parent_tool_use_id":null}}
-
-id: 56
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1dde694f-a4d1-40b0-b7a6-554c9564e338","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ght "}},"parent_tool_use_id":null}}
-
-id: 57
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1c05e79e-eac4-45d2-ae30-f0a76c7093da","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"colors and"}},"parent_tool_use_id":null}}
-
-id: 58
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0d68ebc8-c2cb-4209-b893-5da667d9c2b6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" ene"}},"parent_tool_use_id":null}}
-
-id: 59
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"623c7d69-1ed7-47cf-aebd-30d8d19ffe6c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rgetic co"}},"parent_tool_use_id":null}}
-
-id: 60
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a9d3e30b-a314-40b8-9171-6bb26135b60b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"mpo"}},"parent_tool_use_id":null}}
-
-id: 61
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a2bc7dca-8180-4337-9dcc-60fd14f86cc9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"sitions"}},"parent_tool_use_id":null}}
-
-id: 62
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a0f30632-3650-497c-b7a5-131bd28b1dde","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":". Perf"}},"parent_tool_use_id":null}}
-
-id: 63
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ebf125e8-fab4-4c40-868d-5c3d06b89821","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ect for an"}},"parent_tool_use_id":null}}
-
-id: 64
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"092ddb17-118b-435e-bfb2-7dddfeb25da9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ime"}},"parent_tool_use_id":null}}
-
-id: 65
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"cac3fcd3-3883-4e23-8c20-36a0bebd690a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" and man"}},"parent_tool_use_id":null}}
-
-id: 66
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"00464cea-76d7-4621-ba08-a3bcfb206a35","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ga l"}},"parent_tool_use_id":null}}
-
-id: 67
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f6e78125-826f-4a30-b66a-aab1b4ae093b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"over"}},"parent_tool_use_id":null}}
-
-id: 68
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"07794bbd-c468-4689-bd8b-37545bff29ff","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"s! 💙"}},"parent_tool_use_id":null}}
-
-id: 69
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d83b0a98-83db-4322-97f0-4aa32b1ff1f7","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"🤖\\n"}},"parent_tool_use_id":null}}
-
-id: 70
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"63262c0f-cb37-4d66-9b1c-330eb0057b9e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\\nOriginal "}},"parent_tool_use_id":null}}
-
-id: 71
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e4bba5ff-9d48-41a3-9aea-8f0470248b07","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"artwork"}},"parent_tool_use_id":null}}
-
-id: 72
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"139cbfde-80b5-4ad0-97d0-d757c1db12b7","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" i"}},"parent_tool_use_id":null}}
-
-id: 73
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ff20e6a3-a60f-421b-bc65-466fd591abad","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"nspired by"}},"parent_tool_use_id":null}}
-
-id: 74
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9fd91ce1-6848-4161-93b6-fae3f3e50c26","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" t"}},"parent_tool_use_id":null}}
-
-id: 75
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8549b6af-2205-4f90-9ff9-da2ef43d8533","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"he bel"}},"parent_tool_use_id":null}}
-
-id: 76
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"723dd796-d4d6-40f5-8668-91eac6d2ca74","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"oved blue "}},"parent_tool_use_id":null}}
-
-id: 77
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6765e881-59a8-4345-9aee-6c44f3d68b1a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"robot"}},"parent_tool_use_id":null}}
-
-id: 78
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ebe12020-506b-4811-9be9-74ed8a803a15","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" cat and "}},"parent_tool_use_id":null}}
-
-id: 79
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a028526c-bd65-4c8b-bdbf-726abfb4fc63","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"his "}},"parent_tool_use_id":null}}
-
-id: 80
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7d6d9c7e-7120-490b-b373-6157422d5aae","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"magica"}},"parent_tool_use_id":null}}
-
-id: 81
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e57118e8-a57f-45ce-bed0-7a58b528730b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"l gadgets"}},"parent_tool_use_id":null}}
-
-id: 82
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"861c5c65-3656-47c2-bf21-39c5d8ced56f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":". S"}},"parent_tool_use_id":null}}
-
-id: 83
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6cee1620-36c0-4104-9e37-12ceecfe75ca","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"wipe th"}},"parent_tool_use_id":null}}
-
-id: 84
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7fb08681-0be4-4210-9757-7d320cb3f2f4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ro"}},"parent_tool_use_id":null}}
-
-id: 85
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ebd1213b-097b-4df5-9d62-bcce8a8eebb5","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ugh for mor"}},"parent_tool_use_id":null}}
-
-id: 86
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d86d8a42-b4a0-4f17-812b-ed254f8cbe54","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"e exciting"}},"parent_tool_use_id":null}}
-
-id: 87
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1881813c-cd86-4d75-833f-9aef5aee14f1","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" s"}},"parent_tool_use_id":null}}
-
-id: 88
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1eee50ca-9451-4466-8cd2-85089f3aff7a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"cene"}},"parent_tool_use_id":null}}
-
-id: 89
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a490925b-bfc2-4260-8a65-0dc81a360eb6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"s!\\n\\n#Do"}},"parent_tool_use_id":null}}
-
-id: 90
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"feb12493-6d31-427c-b15a-1c08db407bf3","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"raemon"}},"parent_tool_use_id":null}}
-
-id: 91
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9b74d8be-d01f-4e5e-9820-181274b83914","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" #Anime #"}},"parent_tool_use_id":null}}
-
-id: 92
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"adfbf6a8-5f7f-4c7b-a4e1-2ee9fda48d5d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"Manga #Com"}},"parent_tool_use_id":null}}
-
-id: 93
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"94328736-b5c0-4b40-a347-7cf72b5ac346","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"icArt #Jap"}},"parent_tool_use_id":null}}
-
-id: 94
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"350cd67f-6a97-40a8-b62f-8200dab65f28","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"aneseAnima"}},"parent_tool_use_id":null}}
-
-id: 95
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dcdc0227-8164-4cfd-a844-e07054aa057b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"tion #AnimeA"}},"parent_tool_use_id":null}}
-
-id: 96
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d5a590e2-a8b1-43e7-969f-6aed9ade597a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rt #CartoonA"}},"parent_tool_use_id":null}}
-
-id: 97
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bfbaf65f-7001-46db-9e98-ef3496cdeee9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rt #"}},"parent_tool_use_id":null}}
-
-id: 98
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"24aece9b-3f08-49f7-9887-95b9eb7fff37","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"Illust"}},"parent_tool_use_id":null}}
-
-id: 99
-data: {"type":"keep_alive"}
-
-id: 100
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8ca62f81-2585-46e4-9a05-b1f931fcbdac","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rati"}},"parent_tool_use_id":null}}
-
-id: 101
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"45c2b832-dd6a-40cc-8b9e-77378e5ca8fe","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"on #DigitalA"}},"parent_tool_use_id":null}}
-
-id: 102
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7653e28b-7538-4c53-8507-d26367641d12","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rt "}},"parent_tool_use_id":null}}
-
-id: 103
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e1eabe98-6a3a-4e78-a1bb-a4baea54f934","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"#FanArt\""}},"parent_tool_use_id":null}}
-
-id: 104
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"94007dcf-5b92-478d-9514-1bdf2f90b405","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"imgUrlLis"}},"parent_tool_use_id":null}}
-
-id: 105
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"49896b3d-bad0-4b29-924a-785624a5eb66","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"t\": [\"htt"}},"parent_tool_use_id":null}}
-
-id: 106
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f15459ee-a641-41e3-9500-f995ea67e7e7","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ps:"}},"parent_tool_use_id":null}}
-
-id: 107
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f558c8d3-c542-484b-b4ba-db346dd3015e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"//aitoea"}},"parent_tool_use_id":null}}
-
-id: 108
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9308cf8a-33a5-4d71-9d8d-4d4dd025b199","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rn.s3.a"}},"parent_tool_use_id":null}}
-
-id: 109
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d0b62213-f1c8-4ed6-872c-f3579b016ed2","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"p-southeas"}},"parent_tool_use_id":null}}
-
-id: 110
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dda12b4b-d35a-40b4-98ac-6e290b5b3c62","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"t-1"}},"parent_tool_use_id":null}}
-
-id: 111
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ec489f7c-1b35-451c-a257-9d1dd8e83996","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":".a"}},"parent_tool_use_id":null}}
-
-id: 112
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0218c1c2-3758-4418-bc90-26c8b2901b84","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"mazonaws.co"}},"parent_tool_use_id":null}}
-
-id: 113
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2daa586d-48f8-46cc-a084-3ff80a50a069","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"m/ai/imag"}},"parent_tool_use_id":null}}
-
-id: 114
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6a5fe2b5-fd35-4294-accd-2db04b50c93d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"es/gemini-"}},"parent_tool_use_id":null}}
-
-id: 115
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"52b265df-08e7-42f2-845b-622861ace7fa","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3-pro-image-"}},"parent_tool_use_id":null}}
-
-id: 116
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"59876c68-34f7-40d0-a482-50e723000a3d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"preview/68ab"}},"parent_tool_use_id":null}}
-
-id: 117
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"871c12af-5bbb-4134-880b-cdfcee97d9b0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"be6af812ccb3"}},"parent_tool_use_id":null}}
-
-id: 118
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0435a134-9e23-4900-94ae-e3c8cfe4107c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"e1a53d68/"}},"parent_tool_use_id":null}}
-
-id: 119
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3e607ebc-a182-4520-ba6a-0e94ca35db51","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"mjih"}},"parent_tool_use_id":null}}
-
-id: 120
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"27094d43-dcc6-44e8-b0fe-43716005b8fd","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"fz2"}},"parent_tool_use_id":null}}
-
-id: 121
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c83913f6-54ad-40c7-bb88-6ff25863d335","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"x.png"}},"parent_tool_use_id":null}}
-
-id: 122
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"755dfcbe-16d3-4472-8e13-66585b0591b3","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\",\"h"}},"parent_tool_use_id":null}}
-
-id: 123
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"26970e6f-ab6f-4670-b378-a22ea041437b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ttps"}},"parent_tool_use_id":null}}
-
-id: 124
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1362154a-1af8-4c66-bd29-d7a55d582aaf","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"://aitoearn"}},"parent_tool_use_id":null}}
-
-id: 125
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c24b7da3-4cd1-44f8-9d83-e79c35555ed6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":".s"}},"parent_tool_use_id":null}}
-
-id: 126
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"94317139-dcc2-44ce-bf60-8c23779ae3a9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3."}},"parent_tool_use_id":null}}
-
-id: 127
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"09e7d1ea-e84f-45bf-99f8-b22a5abd60d6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ap-"}},"parent_tool_use_id":null}}
-
-id: 128
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fa40d52d-259f-4fc4-a9a3-93acfd5967a9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"southe"}},"parent_tool_use_id":null}}
-
-id: 129
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"745a316e-bead-4e73-933b-52f43231edf1","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ast-1.amaz"}},"parent_tool_use_id":null}}
-
-id: 130
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b79b12cb-aa5b-4d6b-beda-52f9149ca8f4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"onaws.co"}},"parent_tool_use_id":null}}
-
-id: 131
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0b4a0c14-7b90-449f-bc32-68d2b84da49d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"m/ai/im"}},"parent_tool_use_id":null}}
-
-id: 132
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3c071406-cac7-4a42-ab85-70050a20f0b9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ages/gem"}},"parent_tool_use_id":null}}
-
-id: 133
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9a10c9b5-17bf-4b74-a299-11ba4e36ed36","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ini-3-"}},"parent_tool_use_id":null}}
-
-id: 134
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"011537ef-0219-423a-83f3-fae7ea0f8bea","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"pro-image"}},"parent_tool_use_id":null}}
-
-id: 135
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0a36c7d9-72e1-4131-b40e-bee075b52ad8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"-preview/6"}},"parent_tool_use_id":null}}
-
-id: 136
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b43703d8-8edb-431b-b6a0-7fde0aa55910","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"8abbe6af8"}},"parent_tool_use_id":null}}
-
-id: 137
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ae7a0684-cce8-4f33-ab81-526a8dfde385","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"12ccb3"}},"parent_tool_use_id":null}}
-
-id: 138
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8a746ca3-5017-4828-ad70-75383304f471","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"e1"}},"parent_tool_use_id":null}}
-
-id: 139
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5e2b4de2-2141-4664-b2a2-4ce2bfe09ef8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"a53d68"}},"parent_tool_use_id":null}}
-
-id: 140
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"95d484c3-b32f-4d3f-90ae-4ef0169490e0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"/mji"}},"parent_tool_use_id":null}}
-
-id: 141
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0bb81da0-5696-4f38-8517-c705fe721727","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"hi"}},"parent_tool_use_id":null}}
-
-id: 142
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"88b9a676-7771-4c08-8351-e90cf0a4844e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"9m6.p"}},"parent_tool_use_id":null}}
-
-id: 143
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5df0a083-71a8-47df-8f9e-9b1f3d4d1332","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ng\",\"h"}},"parent_tool_use_id":null}}
-
-id: 144
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"06cc4374-9923-4db0-bb37-da2ad6b33f1c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ttps://aito"}},"parent_tool_use_id":null}}
-
-id: 145
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e096c518-91a1-420c-95b3-2d72c1813c06","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"earn."}},"parent_tool_use_id":null}}
-
-id: 146
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5041f34e-990f-4003-b416-e126b04ded5a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"s3."}},"parent_tool_use_id":null}}
-
-id: 147
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"03f6ffdf-b047-4500-8f25-33fd74e713e8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ap-south"}},"parent_tool_use_id":null}}
-
-id: 148
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d8c2c260-bfef-47c8-8949-2c2338165e16","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"east-1.am"}},"parent_tool_use_id":null}}
-
-id: 149
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"670514c8-76e7-4f8a-a7d0-2e153c8fd9b5","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"azonaws.com/"}},"parent_tool_use_id":null}}
-
-id: 150
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ac2b44a7-4d86-4890-8217-2f53705dcd5c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ai/i"}},"parent_tool_use_id":null}}
-
-id: 151
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5fc8760a-ed8f-4c7c-902b-3a3372a94bbf","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ma"}},"parent_tool_use_id":null}}
-
-id: 152
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9d9b43df-6b0d-4314-9e1a-ec035fc94a30","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ges/gemini-3"}},"parent_tool_use_id":null}}
-
-id: 153
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1a8a27a4-f0ea-4d38-9198-82c17fe8f376","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"-pr"}},"parent_tool_use_id":null}}
-
-id: 154
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4b15559b-6367-48c0-b2f9-bd0bd6d95a75","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"o-image-"}},"parent_tool_use_id":null}}
-
-id: 155
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"18b42707-6f49-4f77-802f-32db25419b79","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"previe"}},"parent_tool_use_id":null}}
-
-id: 156
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"46df0639-b856-4495-9d61-38d0c53e7265","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"w/68abbe6a"}},"parent_tool_use_id":null}}
-
-id: 157
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"06f01463-791e-4ac7-8128-b3acf06ecd3f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"f812ccb3e"}},"parent_tool_use_id":null}}
-
-id: 158
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"59e45d34-0fee-480f-aecf-cd38d45bd619","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"1a53d68"}},"parent_tool_use_id":null}}
-
-id: 159
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c5da9a51-df36-484f-ac4b-1a95fd43babf","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"/mjihlq"}},"parent_tool_use_id":null}}
-
-id: 160
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0ae798f8-111b-4d10-a982-77fe97c7d842","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"gj.pn"}},"parent_tool_use_id":null}}
-
-id: 161
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"50d79efd-8979-4856-9c76-31fe7177a02d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"g\"]}"}},"parent_tool_use_id":null}}
-
-id: 162
-data: {"type":"assistant","message":{"type":"assistant","uuid":"891ef81b-cfe5-4748-8947-1ff1aef1316f","message":{"id":"msg_01DqWZ7HEpcZ5VfhLAnh7A4v","content":[{"type":"tool_use","id":"toolu_01PT3Mhygkv36PaNaev1tNvk","name":"mcp__publish__publishPostToInstagram","input":{"accountId":"instagram_25721566527501315","userId":"68abbe6af812ccb3e1a53d68","title":"Doraemon Comic Adventure 🎨✨","desc":"Vibrant Doraemon manga-style illustrations bringing classic adventures to life! Featuring dynamic comic panels with bright colors and energetic compositions. Perfect for anime and manga lovers! 💙🤖\n\nOriginal artwork inspired by the beloved blue robot cat and his magical gadgets. Swipe through for more exciting scenes!\n\n#Doraemon #Anime #Manga #ComicArt #JapaneseAnimation #AnimeArt #CartoonArt #Illustration #DigitalArt #FanArt","imgUrlList":["https://aitoearn.s3.ap-southeast-1.amazonaws.com/ai/images/gemini-3-pro-image-preview/68abbe6af812ccb3e1a53d68/mjihfz2x.png","https://aitoearn.s3.ap-southeast-1.amazonaws.com/ai/images/gemini-3-pro-image-preview/68abbe6af812ccb3e1a53d68/mjihi9m6.png","https://aitoearn.s3.ap-southeast-1.amazonaws.com/ai/images/gemini-3-pro-image-preview/68abbe6af812ccb3e1a53d68/mjihlqgj.png"]}}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":"tool_use","stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":260},"cache_creation_input_tokens":260,"cache_read_input_tokens":31384,"input_tokens":3,"output_tokens":488,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
-
-id: 163
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"96c97936-24a7-48af-b5f8-7e8e32e54a5b","event":{"type":"content_block_stop","index":1},"parent_tool_use_id":null}}
-
-id: 164
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d396681a-ae06-4a7a-b978-40d80dc453f0","event":{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"cache_creation_input_tokens":260,"cache_read_input_tokens":31384,"input_tokens":3,"output_tokens":488}},"parent_tool_use_id":null}}
-
-id: 165
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9b5ada2e-71c9-47d4-ae6b-4afa3df12a49","event":{"type":"message_stop"},"parent_tool_use_id":null}}
-
-id: 166
-data: {"type":"user","message":{"type":"user","uuid":"880bab62-58a5-4287-8aea-6e9fc899cefa","message":{"content":[{"tool_use_id":"toolu_01PT3Mhygkv36PaNaev1tNvk","type":"tool_result","content":[{"type":"text","text":"Publish task created successfully. FlowId: a1e9d413-a151-48e7-9867-b695531ac947. Use this flowId to check task status."}]}],"role":"user"},"parent_tool_use_id":null,"tool_use_result":[{"type":"text","text":"Publish task created successfully. FlowId: a1e9d413-a151-48e7-9867-b695531ac947. Use this flowId to check task status."}]}}
-
-id: 167
-data: {"type":"keep_alive"}
-
-id: 168
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"350b167d-8565-40e2-8ce1-487fb48d6929","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01TnTU5i3RkZqDqH1gUAYhsJ","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":5,"cache_creation_input_tokens":539,"cache_read_input_tokens":31644,"cache_creation":{"ephemeral_5m_input_tokens":539,"ephemeral_1h_input_tokens":0},"output_tokens":34,"service_tier":"standard"}}},"parent_tool_use_id":null}}
-
-id: 169
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e8ab7d0e-b3c5-48f6-89f3-cf90b9282b43","event":{"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01LEk7A2xR628wey7VRHkHxD","name":"mcp__publish__getPublishingTaskStatus","input":{}}},"parent_tool_use_id":null}}
-
-id: 170
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ef998d6d-4368-4efc-917e-f232d3299631","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""}},"parent_tool_use_id":null}}
-
-id: 171
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f5da3fb9-7ce7-4d9c-9bf4-26bf704c1d9c","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"flowId\":"}},"parent_tool_use_id":null}}
-
-id: 172
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"db4ebe3c-1848-4319-9766-e38934cdf397","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \"a1e9"}},"parent_tool_use_id":null}}
-
-id: 173
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4270e9e8-c362-437b-8374-7c883c98355a","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"d413-a"}},"parent_tool_use_id":null}}
-
-id: 174
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9fe2985c-e437-4fc0-9f4f-aa418b765290","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"151-48e"}},"parent_tool_use_id":null}}
-
-id: 175
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4d9a23c1-e16b-4145-bd0d-913da1b7575d","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"7-98"}},"parent_tool_use_id":null}}
-
-id: 176
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"63dcd122-6285-4baf-af9c-aa885f406ff1","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"67-"}},"parent_tool_use_id":null}}
-
-id: 177
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b845d3de-9592-4b6d-aeaf-13771c9c4882","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"b695531ac947"}},"parent_tool_use_id":null}}
-
-id: 178
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"937d60b4-2cc6-489c-af5d-be1b4304e331","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\""}},"parent_tool_use_id":null}}
-
-id: 179
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ac351db0-ab19-4c6e-88a5-26dc05636296","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"userId\""}},"parent_tool_use_id":null}}
-
-id: 180
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"41916dc2-2319-4c66-906a-86758a9c7ed9","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": \"6"}},"parent_tool_use_id":null}}
-
-id: 181
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e4d0528c-c09e-40c4-b2c6-c93473cc6d32","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"8abbe6af812c"}},"parent_tool_use_id":null}}
-
-id: 182
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2b25c558-61dc-4f9a-9ae5-373f8dc46a4c","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"cb"}},"parent_tool_use_id":null}}
-
-id: 183
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ef999cbd-b5cd-41b8-9928-ee3d5d8c5582","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"3e1a53d68\"}"}},"parent_tool_use_id":null}}
-
-id: 184
-data: {"type":"assistant","message":{"type":"assistant","uuid":"77d3d495-7090-42a5-b6f1-75162ab6329d","message":{"id":"msg_01TnTU5i3RkZqDqH1gUAYhsJ","content":[{"type":"tool_use","id":"toolu_01LEk7A2xR628wey7VRHkHxD","name":"mcp__publish__getPublishingTaskStatus","input":{"flowId":"a1e9d413-a151-48e7-9867-b695531ac947","userId":"68abbe6af812ccb3e1a53d68"}}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":539},"cache_creation_input_tokens":539,"cache_read_input_tokens":31644,"input_tokens":5,"output_tokens":34,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
-
-id: 185
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a72ff777-6dff-4b4f-8e92-97a2f64a75fe","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
-
-id: 186
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bb347825-51bd-4952-b618-1b99cdfd5cec","event":{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"cache_creation_input_tokens":539,"cache_read_input_tokens":31644,"input_tokens":5,"output_tokens":114}},"parent_tool_use_id":null}}
-
-id: 187
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"748f4dfa-7a41-45d0-a660-80ccb3593eff","event":{"type":"message_stop"},"parent_tool_use_id":null}}
-
-id: 188
-data: {"type":"user","message":{"type":"user","uuid":"d415bf8b-8225-493e-b9df-bfe51dde1589","message":{"content":[{"tool_use_id":"toolu_01LEk7A2xR628wey7VRHkHxD","type":"tool_result","content":[{"type":"text","text":"Publishing Task Status:\nFlowID: a1e9d413-a151-48e7-9867-b695531ac947\nStatus: 2\nAccount Type: instagram\nTitle: Doraemon Comic Adventure 🎨✨"}]}],"role":"user"},"parent_tool_use_id":null,"tool_use_result":[{"type":"text","text":"Publishing Task Status:\nFlowID: a1e9d413-a151-48e7-9867-b695531ac947\nStatus: 2\nAccount Type: instagram\nTitle: Doraemon Comic Adventure 🎨✨"}]}}
-
-id: 189
-data: {"type":"keep_alive"}
-
-id: 190
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2417bf26-8b3b-4a56-aa0c-120972e9e25e","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01XALiacD1hiNURTaik44Uun","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":293,"cache_read_input_tokens":32183,"cache_creation":{"ephemeral_5m_input_tokens":293,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}},"parent_tool_use_id":null}}
-
-id: 191
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b6b3a5ed-6874-45d5-8c74-80cd5ec42ff7","event":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},"parent_tool_use_id":null}}
-
-id: 192
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3680ac17-18e1-4ccd-be38-fc6688611f88","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"✅"}},"parent_tool_use_id":null}}
-
-id: 193
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fe293399-6e71-4ef4-a257-40e7c8d92969","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" **再"}},"parent_tool_use_id":null}}
-
-id: 194
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"05de1096-a723-499f-a8d8-5098fcb42ed6","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"次发布成"}},"parent_tool_use_id":null}}
-
-id: 195
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4fe2838c-bfe3-4a1e-bce0-9fbe266930de","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"功!**\n\n这"}},"parent_tool_use_id":null}}
-
-id: 196
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"450f0e31-c836-40ee-939c-82d3b949747c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"3"}},"parent_tool_use_id":null}}
-
-id: 197
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a7790fc5-5ccd-4bd1-9a57-07b0fb630db9","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"张哆啦A梦"}},"parent_tool_use_id":null}}
-
-id: 198
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dc619813-2b07-4269-897b-d140e2046e4b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"漫画图片已经再"}},"parent_tool_use_id":null}}
-
-id: 199
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"96dd5ba2-c51a-4561-928e-d915ed4c0b6c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"次成"}},"parent_tool_use_id":null}}
-
-id: 200
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"953e3eb4-4ed7-4fa1-a6f0-50afec67ac38","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"功发布到您"}},"parent_tool_use_id":null}}
-
-id: 201
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e9921f79-fe38-4fad-a4e6-8f4fb055a20d","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"的Instagram账"}},"parent_tool_use_id":null}}
-
-id: 202
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ba0a2ff0-e082-46a4-b89d-4984fcd8531c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"户 "}},"parent_tool_use_id":null}}
-
-id: 203
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2d647bda-d9f0-4af1-a0ab-0452908984dc","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"**"}},"parent_tool_use_id":null}}
-
-id: 204
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5e203fce-d96a-4a3b-b80f-d323d3041df4","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ab"}},"parent_tool_use_id":null}}
-
-id: 205
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"761a7d75-80fa-4cdc-8b89-5d6c2230b659","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"c"}},"parent_tool_use_id":null}}
-
-id: 206
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"13a5bb36-ac94-45e1-b9de-9f65135119b5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"g"}},"parent_tool_use_id":null}}
-
-id: 207
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f5e860b2-edcc-41e3-a039-3d1d77c9418c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"."}},"parent_tool_use_id":null}}
-
-id: 208
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d2d7dce2-d7f8-45e4-8cb2-17cb915be0a2","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ao"}},"parent_tool_use_id":null}}
-
-id: 209
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a2dc3978-2d06-480a-9b7f-0fe36d4f09d1","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"**!\n\n**"}},"parent_tool_use_id":null}}
-
-id: 210
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"586c2ee0-655e-4011-b54d-7e79b82e21c5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"发"}},"parent_tool_use_id":null}}
-
-id: 211
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a89187bd-13e4-439a-b7c6-f062e5eef276","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"布详情**"}},"parent_tool_use_id":null}}
-
-id: 212
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5a257d4b-0d3c-43ed-8fb6-d916feb495c8","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":":\n- "}},"parent_tool_use_id":null}}
-
-id: 213
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4cbf7fb9-a1ce-4d0c-b2a1-b7f8aca0df1d","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"📸 3"}},"parent_tool_use_id":null}}
-
-id: 214
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"672a57b5-5261-4976-859e-182d51124d52","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"张"}},"parent_tool_use_id":null}}
-
-id: 215
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"868c9f24-7151-41ee-a314-b7827b8694cf","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"竖版"}},"parent_tool_use_id":null}}
-
-id: 216
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d4b4f6ea-0764-4454-a541-2331f1dfe8d6","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"漫画风"}},"parent_tool_use_id":null}}
-
-id: 217
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b539f487-71d1-43f5-9577-122ef93864f7","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"格图"}},"parent_tool_use_id":null}}
-
-id: 218
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b0eb6ce8-149c-4133-9058-2742e7341cf6","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"片\n- "}},"parent_tool_use_id":null}}
-
-id: 219
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"af0a34ee-7502-4541-bd17-53274953a127","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"📝 标题:"}},"parent_tool_use_id":null}}
-
-id: 220
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dd22e5b4-32cc-44ec-b1cf-b25078994f91","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Doraemon Comic Adventure "}},"parent_tool_use_id":null}}
-
-id: 221
-data: {"type":"keep_alive"}
-
-id: 222
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5e8677fb-6a70-426c-bef1-32d6263cbad4","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"🎨✨\n- "}},"parent_tool_use_id":null}}
-
-id: 223
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"55182342-061a-4581-8054-a3e2cb60495b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"🏷️ 包"}},"parent_tool_use_id":null}}
-
-id: 224
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0a4549da-cd44-495f-81ca-694f8b0abfef","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"含10"}},"parent_tool_use_id":null}}
-
-id: 225
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"25ff02f8-ba81-41f3-8612-7ebb19aca153","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"个相"}},"parent_tool_use_id":null}}
-
-id: 226
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"cb7cc80b-641e-4eb7-a9cb-75247b518e25","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"关标"}},"parent_tool_use_id":null}}
-
-id: 227
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bd30afae-5a2b-4275-96db-449fe94b04a5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"签"}},"parent_tool_use_id":null}}
-
-id: 228
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b3ab6469-507f-4350-8b10-7744117e7f74","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n- "}},"parent_tool_use_id":null}}
-
-id: 229
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"40ebf194-cc28-4897-a9e2-413810254624","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"🎨 色"}},"parent_tool_use_id":null}}
-
-id: 230
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4328043c-955f-4167-a983-e4c803d25ce2","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"彩明"}},"parent_tool_use_id":null}}
-
-id: 231
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2dcdb2e6-8abc-4078-bb1b-da6055bda37a","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"快"}},"parent_tool_use_id":null}}
-
-id: 232
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0d3f80f4-d4ee-43ad-a2e4-b1470e9ffb7c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":",适"}},"parent_tool_use_id":null}}
-
-id: 233
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"63785087-ef2c-462d-892e-24c118491871","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"配"}},"parent_tool_use_id":null}}
-
-id: 234
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b84850d4-b2bc-4b9a-bd8b-81b12d604453","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Instagram"}},"parent_tool_use_id":null}}
-
-id: 235
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"53eb3295-a47b-44f3-8082-a31c39e627d5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n现"}},"parent_tool_use_id":null}}
-
-id: 236
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"55e8eb3c-7ef1-4e11-a5ef-4aad702b66f5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"在您"}},"parent_tool_use_id":null}}
-
-id: 237
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"697fdc93-8a71-462e-ae80-c3b67f277ce3","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"的Instagram上"}},"parent_tool_use_id":null}}
-
-id: 238
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"42e10099-77b4-425b-9ea9-172a3c50b72c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"有"}},"parent_tool_use_id":null}}
-
-id: 239
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f9a707ac-d680-4544-9d83-6dddd14d5b8c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"两"}},"parent_tool_use_id":null}}
-
-id: 240
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"51317612-c815-4280-9c3a-cfa42dd9b563","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"条"}},"parent_tool_use_id":null}}
-
-id: 241
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a8ffa1c4-ad2e-46ec-85b1-c254a4ed51ec","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"相"}},"parent_tool_use_id":null}}
-
-id: 242
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f4ba659f-2c2f-4988-abe9-35137a383e5a","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"同"}},"parent_tool_use_id":null}}
-
-id: 243
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"42c1fb9c-885c-4287-9d6d-e30999806569","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"内"}},"parent_tool_use_id":null}}
-
-id: 244
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b44ecee7-14ec-4968-acd3-405a228e1304","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"容的"}},"parent_tool_use_id":null}}
-
-id: 245
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0ca4c21a-4fd6-4d7a-9bde-515792a88e8b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"帖子了"}},"parent_tool_use_id":null}}
-
-id: 246
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"585928a1-90cb-4753-8553-ecc3dc69ddd5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"!"}},"parent_tool_use_id":null}}
-
-id: 247
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"69884bd3-601b-4731-8c61-8035d57ff679","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"📱"}},"parent_tool_use_id":null}}
-
-id: 248
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"029374fa-e702-42c1-893a-459209746b09","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"✨"}},"parent_tool_use_id":null}}
-
-id: 249
-data: {"type":"assistant","message":{"type":"assistant","uuid":"453b9598-abe1-4dc7-97b4-a40f46aee5ac","message":{"id":"msg_01XALiacD1hiNURTaik44Uun","content":[{"type":"text","text":"✅ **再次发布成功!**\n\n这3张哆啦A梦漫画图片已经再次成功发布到您的Instagram账户 **abcg.ao**!\n\n**发布详情**:\n- 📸 3张竖版漫画风格图片\n- 📝 标题:Doraemon Comic Adventure 🎨✨\n- 🏷️ 包含10个相关标签\n- 🎨 色彩明快,适配Instagram\n\n现在您的Instagram上有两条相同内容的帖子了!📱✨"}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":293},"cache_creation_input_tokens":293,"cache_read_input_tokens":32183,"input_tokens":2,"output_tokens":1,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
-
-id: 250
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5b96dc1b-a7c5-4106-9a49-4c2accc1d1c9","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
-
-id: 251
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4e6d0047-6ab3-48eb-9f65-d1c725a97372","event":{"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"cache_creation_input_tokens":293,"cache_read_input_tokens":32183,"input_tokens":2,"output_tokens":159}},"parent_tool_use_id":null}}
-
-id: 252
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2daf6621-9e6c-487f-965e-6d9178d97f4c","event":{"type":"message_stop"},"parent_tool_use_id":null}}
-
-id: 253
-data: {"type":"result","message":{"type":"result","subtype":"success","uuid":"c48ddba3-c3ab-40fb-b06a-5878f441c7c4","duration_ms":34445,"duration_api_ms":44756,"is_error":false,"num_turns":3,"message":"✅ **再次发布成功!**\n\n这3张哆啦A梦漫画图片已经再次成功发布到您的Instagram账户 **abcg.ao**!\n\n**发布详情**:\n- 📸 3张竖版漫画风格图片\n- 📝 标题:Doraemon Comic Adventure 🎨✨\n- 🏷️ 包含10个相关标签\n- 🎨 色彩明快,适配Instagram\n\n现在您的Instagram上有两条相同内容的帖子了!📱✨","total_cost_usd":0.0513453,"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":1092},"cache_creation_input_tokens":1092,"cache_read_input_tokens":95211,"input_tokens":10,"output_tokens":761,"server_tool_use":{"web_search_requests":0}},"permission_denials":[]}}
-
diff --git a/project/web/public/en/agent_test3.txt b/project/web/public/en/agent_test3.txt
index eda3e136..2fd1fe01 100644
--- a/project/web/public/en/agent_test3.txt
+++ b/project/web/public/en/agent_test3.txt
@@ -1,781 +1,538 @@
id: 1
-data: {"type":"init","taskId":"694a77d5d8f9058d53c4bb5d"}
+data: {"type":"init","taskId":"69529bae818aa053e5a3f428"}
id: 2
data: {"type":"keep_alive"}
id: 3
-data: {"type":"keep_alive"}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"40804ee5-cefc-40ac-9656-f2adab8e0f6a","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01HtKytShLjdRCGdsXYz7FAk","type":"message","role":"assistant","content":[{"type":"text","text":"好"}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1581,"cache_read_input_tokens":28554,"cache_creation":{"ephemeral_5m_input_tokens":1581,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}},"parent_tool_use_id":null}}
id: 4
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"769a4690-b766-4a99-a3bb-d9ea558eb1e8","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_013yvFkPUW7bcKLBAz1FuscS","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":30674,"cache_read_input_tokens":1867,"cache_creation":{"ephemeral_5m_input_tokens":30674,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a7ca6335-3404-4a3e-9c4c-9d8486749b19","event":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},"parent_tool_use_id":null}}
id: 5
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"780cb045-3a74-46a2-8e06-70ec20eb7328","event":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"53d6fa89-2572-4ea8-9ffb-6bf02cf2f49e","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"好"}},"parent_tool_use_id":null}}
id: 6
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5ba4d3b7-b477-4ab7-8e84-84e0aab26dc5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"好"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"510f174d-38c1-404f-ba70-8d0e52a4b7a7","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"的,我现"}},"parent_tool_use_id":null}}
id: 7
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dd0ccc13-dd89-4b95-9790-ede6e8a111b2","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"的,我将"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"530aac4a-b669-42fa-ac87-e097ce71252b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"在就帮你"}},"parent_tool_use_id":null}}
id: 8
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"da222e28-b437-4814-bb07-461a59a16f92","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"第"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"265c80f2-41a8-4d36-9bcc-907a5200d36a","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"发布视频到快手!"}},"parent_tool_use_id":null}}
id: 9
-data: {"type":"keep_alive"}
+data: {"type":"assistant","message":{"type":"assistant","uuid":"eb1c95b2-44f2-4322-8b6e-1e676cde3ba0","message":{"id":"msg_01HtKytShLjdRCGdsXYz7FAk","content":[{"type":"text","text":"好的,我现在就帮你发布视频到快手!"}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":1581},"cache_creation_input_tokens":1581,"cache_read_input_tokens":28554,"input_tokens":3,"output_tokens":2,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
id: 10
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"708948b3-b3ee-4053-a33f-ef177cadaed7","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"三"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d02cb332-6ce8-43c1-9e05-1e6c81ff087c","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
id: 11
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1c505960-e7d0-4d6b-8b9d-e5dd157a2691","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"次"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b92f665b-2a92-4497-bb74-b2b424bf009a","event":{"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_0197t3co1pzmgH1u6D2Dws3N","name":"mcp__publish__publishPostToKwai","input":{}}},"parent_tool_use_id":null}}
id: 12
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ec2dc55f-1065-4218-83b0-a67956d2b632","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"发布这"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d4a403d6-445f-4b7c-8944-329531045425","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}},"parent_tool_use_id":null}}
id: 13
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f78ef9f5-428c-4b80-8b99-f50fb8a82d35","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"3"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d76ca0e7-fb2a-4c4e-8da2-0942904b8ef1","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"userId"}},"parent_tool_use_id":null}}
id: 14
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"56b0bbd1-4353-431b-881b-f45c3dbacc7f","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"张哆啦A梦"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"475c1695-2179-49ba-ad61-8da0c671696f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\": \"68a"}},"parent_tool_use_id":null}}
id: 15
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"42a2d5ee-d976-4eda-8dad-6f476521e3ec","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"漫画图片到Instagram"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3254016a-0fe2-4602-aa66-c1f75b549586","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"bbe6"}},"parent_tool_use_id":null}}
id: 16
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"446a83b2-051f-4c45-aeda-b91b686ccbd1","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"..."}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2f95a4da-e8c9-4b97-9819-bec596443177","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"af812ccb3e1"}},"parent_tool_use_id":null}}
id: 17
-data: {"type":"assistant","message":{"type":"assistant","uuid":"806c2947-68b3-4ff8-b429-c339ffd85743","message":{"id":"msg_013yvFkPUW7bcKLBAz1FuscS","content":[{"type":"text","text":"好的,我将第三次发布这3张哆啦A梦漫画图片到Instagram..."}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":30674},"cache_creation_input_tokens":30674,"cache_read_input_tokens":1867,"input_tokens":3,"output_tokens":1,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b78b1c94-1940-41ed-b85d-4cf853e9a1c8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"a5"}},"parent_tool_use_id":null}}
id: 18
-data: {"type":"keep_alive"}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fcd7cedf-469e-47f8-9588-6865a2585a17","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3d68\""}},"parent_tool_use_id":null}}
id: 19
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"174a224f-fa83-4b72-95e2-aefd4c7289ec","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f09d8e76-da5f-4907-a173-192f92afd3bb","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"a"}},"parent_tool_use_id":null}}
id: 20
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bce669f5-df5d-4b1a-a696-91df56d358fd","event":{"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_014814VKZxU9vsCNNcjde8Uq","name":"mcp__publish__publishPostToInstagram","input":{}}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"77e19dd9-e80c-43e6-9fdd-dc1a76875098","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ccountId\": \""}},"parent_tool_use_id":null}}
id: 21
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a3366154-eb02-4784-9a1e-c872e2a8ef59","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b825120e-0d52-4ac2-8336-7feb5d0f3fdd","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"KWAI"}},"parent_tool_use_id":null}}
id: 22
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e6d97c86-94a7-4b52-904a-b43bfb4699c6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"accou"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2679a6e6-38a0-463e-8042-1173dc8d7d44","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"_f1b"}},"parent_tool_use_id":null}}
id: 23
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"93700313-cfbb-4135-a840-60ee1c049076","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ntId\": \"in"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b7396be7-08b7-46dd-966c-acc1d6f43dbc","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"6d99b9252a"}},"parent_tool_use_id":null}}
id: 24
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"de745d87-c002-40a9-a7a4-113e16fbd4b0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"stag"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4bee0545-92f1-428e-81d6-7002c50ee1b0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"17"}},"parent_tool_use_id":null}}
id: 25
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f6c81821-8090-4678-964a-42a0ae24aee8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ram_25"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8298fd71-01e8-4a81-9c5c-048fe620b246","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"314bf"}},"parent_tool_use_id":null}}
id: 26
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4fcb03ff-72ae-4bc9-8be4-da8f4a8e729a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"7215665275"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"59178662-068a-4e3c-a252-8acca995d40d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"5724e6"}},"parent_tool_use_id":null}}
id: 27
-data: {"type":"keep_alive"}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"71c43e30-2e53-4817-b4e3-1db709b937ff","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"66123f\""}},"parent_tool_use_id":null}}
id: 28
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fc7980cf-01f1-4cc5-8780-2c5750c845ba","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"01315\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a04a384b-5e55-4234-b963-fbfb870c609a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"title"}},"parent_tool_use_id":null}}
id: 29
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"181981fe-c5df-4538-8fa0-a99c51e5a08a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"d"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dc8b9fbe-c4ad-4f70-b405-6fb5edf86a81","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\": \"t"}},"parent_tool_use_id":null}}
id: 30
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"edd7adc3-70f2-4c62-a556-747f25bea8e0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"esc\": "}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"35c08d41-d150-46b3-a56f-aafbb3feecbe","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"est\""}},"parent_tool_use_id":null}}
id: 31
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c9def8a4-f27c-4beb-b8d0-fe2d904106a5","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\"V"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ce3311a3-9162-47f1-ac52-5451f4a13643","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"desc"}},"parent_tool_use_id":null}}
id: 32
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a915eb63-f869-429b-be0a-03fe55526822","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ibrant D"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ff325113-448d-4662-b66f-55552a73ae24","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\": \"t"}},"parent_tool_use_id":null}}
id: 33
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8fd0037b-c43d-4c0c-b404-1ddffd293ac6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"oraem"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b0701ec6-d5d1-4a96-8dc5-8c7a15a43d6b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"est\""}},"parent_tool_use_id":null}}
id: 34
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1728daab-b6e1-42a1-a9e0-342cc760b690","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"on m"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ca9cea11-17d8-4904-ade6-13eb2181da41","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"v"}},"parent_tool_use_id":null}}
id: 35
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c0e1c36a-9426-489f-bc76-09ae5373cb37","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"anga-style"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a4c7b464-94c1-4db9-8104-a924722d7157","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ideoUrl\":"}},"parent_tool_use_id":null}}
id: 36
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1f6d3d48-f765-4c24-b641-2a1b6aa4820a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" illu"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a7278ae3-2bcf-4faa-9575-9204ca08268d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" \"https:"}},"parent_tool_use_id":null}}
id: 37
-data: {"type":"keep_alive"}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f6f7d078-0ab5-48b4-a252-a4ce5af1acc0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"//"}},"parent_tool_use_id":null}}
id: 38
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"417751fc-555e-4007-ad2a-f5924295a5e6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"strations br"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1e3fab01-5d0a-444a-b321-b5e219a6ed5e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"aito"}},"parent_tool_use_id":null}}
id: 39
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bca67372-21f9-46ac-9acf-1224b4065a9f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"inging clas"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8d9fecd7-b629-4a63-9e9e-ce6720d816d7","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"earn.s"}},"parent_tool_use_id":null}}
id: 40
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b82147b8-63f5-4aba-b84f-9c6fb5a99fd3","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"sic adven"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f83fecc8-1cac-4501-a227-087d6c65f9c9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3.ap-southea"}},"parent_tool_use_id":null}}
id: 41
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f63db2c3-9e93-4db4-a008-24d7ab2880aa","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"tures"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4b26a406-24aa-46d5-a1c9-80882bf2b08c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"st-1.amazona"}},"parent_tool_use_id":null}}
id: 42
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4f9b6fd7-687d-4168-9030-4d28a37efbb9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" to l"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"edadaa40-26e9-490d-be75-f72c52528d3a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ws.com/68abb"}},"parent_tool_use_id":null}}
id: 43
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6ed58d2e-8595-4ab1-8305-fd618e87208d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ife! F"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f7fb8619-1838-4c0f-aa4c-408aaffce3ab","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"e6af"}},"parent_tool_use_id":null}}
id: 44
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"86657299-d920-4a7a-a3c9-d29ba2de7022","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"eaturing dy"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7d7969e6-69dc-4bf1-b281-50db4e797368","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"812ccb3e1a5"}},"parent_tool_use_id":null}}
id: 45
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4871e497-e217-4ff1-8ef7-1255865ca3bf","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"nam"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"44aca2bd-4e63-42ca-8db4-a01efc26a064","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3d68/6bd5"}},"parent_tool_use_id":null}}
id: 46
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"69184efd-3b0e-4eb4-a0ee-2511e9537770","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ic"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2714f017-cab0-4757-bf18-b9c1fb6c8b97","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"272b2930b6e"}},"parent_tool_use_id":null}}
id: 47
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c3f441f4-78a8-4220-bbcb-b08ac4d96b9d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" comic pan"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6ca6bf7f-37dc-4046-b7b4-5969e40a5cdd","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"a99"}},"parent_tool_use_id":null}}
id: 48
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3cf68edb-dac6-4760-a26c-470209a02135","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"els with br"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"794cbe27-b836-4321-9c12-1338815db26a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"a7d969"}},"parent_tool_use_id":null}}
id: 49
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3e5278de-df55-47d2-95dc-61f28e6974c3","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ight colors"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ac3e8116-0c33-40c0-b6b1-71190efd7c4c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"2b"}},"parent_tool_use_id":null}}
id: 50
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2740e784-7f6b-4e4d-913e-9f1ff61a92fc","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" an"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"cb3b68db-91b1-4bac-8fa1-edcabd101486","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"f1428"}},"parent_tool_use_id":null}}
id: 51
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a71c7e9e-66e5-41a8-a4d4-a118adefa9f4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"d energetic"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"86c750e8-af23-4e2e-99c6-b127cd051ed4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"85.mp4\""}},"parent_tool_use_id":null}}
id: 52
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"30ee2604-0acc-4688-a12b-0a271305ae7e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" compo"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1db25fc4-c14c-412a-95e5-78b2b3d0a07d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"c"}},"parent_tool_use_id":null}}
id: 53
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2b766009-1c31-40ed-aced-c5dc2914dcf3","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"si"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dbc39cc3-e18d-48b0-b3a9-9b16b1dfef8a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ove"}},"parent_tool_use_id":null}}
id: 54
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"56049e7a-3ded-4121-b87f-4467e4ef7366","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ti"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"92742a38-30a8-4052-a157-a3f7f7771d48","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rUrl\": \""}},"parent_tool_use_id":null}}
id: 55
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"362f0da3-055c-4d1d-94cc-afa17dd2fcc9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ons. Perfect"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3f9d469b-7840-4c84-9708-2e955580bc2b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"uploads/"}},"parent_tool_use_id":null}}
id: 56
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"346c3497-293e-4b7f-94d2-ce28d469abb8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" for"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ab51ad9b-91ad-4aec-b355-0159858acbeb","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"6b0"}},"parent_tool_use_id":null}}
id: 57
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"64aec25e-1572-46e2-ae7c-a82e634b4d4b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" anime a"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"785b8c21-1968-4c19-84da-9607e2d7f611","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"42e97b6d54"}},"parent_tool_use_id":null}}
id: 58
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"21825206-a171-4f0e-97d3-86e330343a3e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"nd mang"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d915db79-ba68-4ce0-8c5c-c4dc8ab179f9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"cb790a0"}},"parent_tool_use_id":null}}
id: 59
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bd21e6a0-4c03-489f-940c-494fa5729b18","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"a lovers!"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"afa7339e-3a40-41f0-9e54-d1de31027dbe","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"597de6"}},"parent_tool_use_id":null}}
id: 60
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ad78688d-7664-44e1-860b-f5f576375f76","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" 💙🤖\\n\\nOrigi"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"49f8b79d-17c3-499a-a73b-6cddc5e17e2f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"80f3a6.jp"}},"parent_tool_use_id":null}}
id: 61
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"15032a3b-4a45-4fb5-aea7-887d0d98c3fa","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"nal artwo"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"01d41c2d-11dc-4178-8e3f-00c6b158e167","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"g\""}},"parent_tool_use_id":null}}
id: 62
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"be798577-2fc8-4009-99a5-8a6f175bb7c9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rk in"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"10cfc668-0eb1-410c-b49b-cbdbaa854039","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"topi"}},"parent_tool_use_id":null}}
id: 63
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5a469c78-fc6d-4f1c-b627-e3963136b5a7","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"spired "}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3f68ba4b-0251-40b1-abbd-e15a741c8e2b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"cs\": [\"1\""}},"parent_tool_use_id":null}}
id: 64
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"05868e25-0045-4eb5-be8a-f6121ecc9404","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"by "}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"715c2746-0fbf-4bac-8cee-63d6af702b09","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":",\""}},"parent_tool_use_id":null}}
id: 65
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"235737f3-dcff-4e2c-8d6c-23f42c96a69e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"the belo"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4bf2f8fa-2683-487b-b9ed-f9b39ac381c6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"2\"]}"}},"parent_tool_use_id":null}}
id: 66
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"304e5afd-403a-442d-bbcb-d937546f24cc","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ved blu"}},"parent_tool_use_id":null}}
+data: {"type":"assistant","message":{"type":"assistant","uuid":"ac33ba2b-6c83-4254-bcc9-8541682b8b11","message":{"id":"msg_01HtKytShLjdRCGdsXYz7FAk","content":[{"type":"tool_use","id":"toolu_0197t3co1pzmgH1u6D2Dws3N","name":"mcp__publish__publishPostToKwai","input":{"userId":"68abbe6af812ccb3e1a53d68","accountId":"KWAI_f1b6d99b9252a17314bf5724e666123f","title":"test","desc":"test","videoUrl":"https://aitoearn.s3.ap-southeast-1.amazonaws.com/68abbe6af812ccb3e1a53d68/6bd5272b2930b6ea99a7d9692bf142885.mp4","coverUrl":"uploads/6b042e97b6d54cb790a0597de680f3a6.jpg","topics":["1","2"]}}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":1581},"cache_creation_input_tokens":1581,"cache_read_input_tokens":28554,"input_tokens":3,"output_tokens":2,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
id: 67
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4ea578b0-2a83-4d63-879c-79d08bdbf1a9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"e robo"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a9f61775-38cd-4d54-bf11-9c7540209e25","event":{"type":"content_block_stop","index":1},"parent_tool_use_id":null}}
id: 68
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0c0e8273-c610-4967-8365-e4ef0fcfce46","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"t cat and hi"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8d6425bd-1ee2-45de-bf54-1b3ad35204e5","event":{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"cache_creation_input_tokens":1581,"cache_read_input_tokens":28554,"input_tokens":3,"output_tokens":307}},"parent_tool_use_id":null}}
id: 69
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a7bfcceb-b493-4154-9b69-64d37a0814f2","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"s ma"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"80551da6-5189-4963-9203-c1a8f56bc7e7","event":{"type":"message_stop"},"parent_tool_use_id":null}}
id: 70
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7153f8fa-bda2-4609-a8a0-45d6aa35d4cb","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"gic"}},"parent_tool_use_id":null}}
+data: {"type":"user","message":{"type":"user","uuid":"423d1251-6d94-44e9-947a-e4738e1d9564","message":{"content":[{"tool_use_id":"toolu_0197t3co1pzmgH1u6D2Dws3N","type":"tool_result","content":[{"type":"text","text":"Publish task created successfully. FlowId: 7a467199-143b-47ad-9561-a12a8292f891. Use this flowId to check task status."}]}],"role":"user"},"parent_tool_use_id":null,"tool_use_result":[{"type":"text","text":"Publish task created successfully. FlowId: 7a467199-143b-47ad-9561-a12a8292f891. Use this flowId to check task status."}]}}
id: 71
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7cb1eb3b-51e2-4b39-9f2b-f0ce307efc74","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"al gadg"}},"parent_tool_use_id":null}}
+data: {"type":"keep_alive"}
id: 72
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0c26fe4e-7f83-4c3b-ac22-f1092675bd68","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ets. Swi"}},"parent_tool_use_id":null}}
+data: {"type":"keep_alive"}
id: 73
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"da9c522f-d7b7-41ca-8f73-a52cee1b855a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"pe through"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a58d6a0c-dbed-4bb5-a044-59826ddc76f1","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01WhEKd423J5guuJUbPUqc5Q","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":5,"cache_creation_input_tokens":358,"cache_read_input_tokens":30135,"cache_creation":{"ephemeral_5m_input_tokens":358,"ephemeral_1h_input_tokens":0},"output_tokens":32,"service_tier":"standard"}}},"parent_tool_use_id":null}}
id: 74
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"126e49cb-7de6-4310-81a6-eb75fd43827a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" for more ex"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f6396450-43da-45a6-9b76-051febf1d064","event":{"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_0134Cnnp3Nd11XBFHGrRe2nr","name":"mcp__sessionTools__outputTaskResult","input":{}}},"parent_tool_use_id":null}}
id: 75
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"30d88684-81f4-4b0a-a26e-dea060168ada","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"citin"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"948fb3ce-ff84-4bda-b38b-dff916c1c872","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""}},"parent_tool_use_id":null}}
id: 76
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"872dbd05-2449-47d8-a29b-3193be34d70c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"g sce"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a5a55ab0-827c-4f7c-b361-30760ec8a97c","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"res"}},"parent_tool_use_id":null}}
id: 77
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"479f35dd-90d3-4809-9c13-2ba392a34f80","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"nes!\\n\\"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6260d89b-8a35-4aaa-8b29-15dd69e9bb10","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ult"}},"parent_tool_use_id":null}}
id: 78
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"64ba7d6e-8758-43ae-9203-2f8c0afbc608","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"n#"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"34f11185-0434-4eb4-b8a2-3c925800bc17","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\": [{\"type\":"}},"parent_tool_use_id":null}}
id: 79
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7302df3d-d104-4fb9-ae7d-c229c56051b8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"Doraemon "}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e2329054-d610-4bbe-9c6f-624e552a8fa1","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"fullCo"}},"parent_tool_use_id":null}}
id: 80
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"75e2ee98-ca02-422d-8519-87b9ec81745f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"#Anime #Man"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9fb24c8d-d22f-44c6-8f75-7b3e8651c434","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ntent\",\""}},"parent_tool_use_id":null}}
id: 81
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9fb785c2-900c-4b91-8870-b573287a72cd","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ga "}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f29622a8-adde-41bc-a705-26cec9c7b405","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"acti"}},"parent_tool_use_id":null}}
id: 82
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3f4dabf6-f071-4edb-99b7-9e0b701a798f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"#ComicAr"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"06c081fa-fe01-4a29-823c-5128b292d06e","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"on\":\"none\",\""}},"parent_tool_use_id":null}}
id: 83
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"48ecda02-2c11-494c-9f70-94fc9349af51","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"t #JapaneseA"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1670bba7-08df-4f0c-83aa-fc57f5e9be4d","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"title\":\"tes"}},"parent_tool_use_id":null}}
id: 84
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fe33f34a-77f9-4056-948a-f83aba0d5259","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"nimation"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b5b242d2-33c4-46a1-a94f-c3e2740a7d3b","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"t\",\"descr"}},"parent_tool_use_id":null}}
id: 85
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0a85dff8-21fd-4f76-9916-5d95f16ade3a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" #Ani"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ce566018-4499-4772-a106-2a3727604fba","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"iption\":\"tes"}},"parent_tool_use_id":null}}
id: 86
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"43b0d077-0d67-40b5-a720-c2a79222d8b4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"meArt #Ca"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3cde6c20-1030-4ca3-85fa-fc5b1e03ac73","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"t\",\"tags\":[\""}},"parent_tool_use_id":null}}
id: 87
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f19ef18a-42b1-435a-bfe9-2cf443050e35","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rt"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8770d16c-4f49-4360-b9bf-33300f89b843","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"1\",\"2\"],\"m"}},"parent_tool_use_id":null}}
id: 88
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c08a8903-215d-458d-8d26-5414f5a9b279","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"oonArt #Illu"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"02194539-a822-40e7-8b27-f365151b869c","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"edias\":[{"}},"parent_tool_use_id":null}}
id: 89
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fc2ea7fa-8c71-440e-b470-95f1fc5d9da6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"stration"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"00d3eb32-4232-4640-8aff-93535060ca99","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"typ"}},"parent_tool_use_id":null}}
id: 90
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a8087000-54ed-41cf-a234-93c466d5ce02","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" #DigitalArt"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2ff36e5e-cf72-4452-be32-e29d40d118e1","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"e\":\"VIDEO\",\""}},"parent_tool_use_id":null}}
id: 91
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"052816e9-3a4f-4ce8-8417-80566b283568","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" #FanArt\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b86f010c-fa25-4633-b4c6-8ddcbed80ce3","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"url\":\"https:"}},"parent_tool_use_id":null}}
id: 92
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9b970805-4756-4ee9-8f2c-65e30cd4b347","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"imgUrlLi"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f28c52c9-5da7-4ca5-9610-b8dcd06dfa92","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"//a"}},"parent_tool_use_id":null}}
id: 93
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ad559dc7-68a0-4d7b-b515-ebb6a1626e95","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"st\": [\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"494f4264-dbe2-4a02-875e-81469257e94f","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ito"}},"parent_tool_use_id":null}}
id: 94
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e6d03314-b2d1-45af-b642-29772590d642","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"htt"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"119ceb77-90b9-49fb-bb2b-e87d8e876fdc","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ear"}},"parent_tool_use_id":null}}
id: 95
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"53374b4f-8011-4cef-a7fd-4b4b5dd473ce","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ps://aitoear"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e9aad9df-c0df-4b8a-8dd4-a1119e62168c","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n.s3."}},"parent_tool_use_id":null}}
id: 96
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fcbcc608-91d2-459c-8e08-7d88ee5ce62c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"n.s3."}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6b5c5159-dfde-49d2-80eb-105c57beda81","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ap"}},"parent_tool_use_id":null}}
id: 97
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6a61efd5-7b7a-4afc-a4eb-86a312dbb1c6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ap-southeast"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"05535530-270f-4a42-b08e-2a5fe42a262d","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"-so"}},"parent_tool_use_id":null}}
id: 98
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"300f1b35-50a2-40c0-8499-89f3e2773b9f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"-1.amazonaws"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a559481e-1222-4a4c-9579-98111d0672e5","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"uth"}},"parent_tool_use_id":null}}
id: 99
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5cd3e7fe-d8cd-464a-a492-3831d52e72b9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":".com/ai/ima"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5a96a794-71fb-4f06-92ba-13fc04ff79f4","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"eas"}},"parent_tool_use_id":null}}
id: 100
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f8344970-2f48-4e8a-a301-f35440a101d4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ge"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3425c34c-068e-444d-81ff-ececcf409d7b","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"t-1.a"}},"parent_tool_use_id":null}}
id: 101
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d856d40a-0a38-44a9-81a7-cd22cb7836b4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"s/gemi"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"875b8437-ff69-42b5-b7c8-db815cdc0b82","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"mazonaws.c"}},"parent_tool_use_id":null}}
id: 102
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c59f0b43-bc4c-4c41-99bd-8847ff2150c5","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ni-3-"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"28391110-aaa4-4f18-bf5b-d5185b91c31c","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"om/68abbe6af"}},"parent_tool_use_id":null}}
id: 103
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"666eb7b5-9863-41c2-9338-9e387b6c0920","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"pro-im"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"39051633-833b-416b-9923-cdf3e9eb6058","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"812ccb3e"}},"parent_tool_use_id":null}}
id: 104
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5996a3d2-e8c1-4847-b83d-48bdd6c6cf1a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"age-preview/"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"20d75d56-11f4-4739-b11e-f681ca2690db","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"1a53d"}},"parent_tool_use_id":null}}
id: 105
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6169ba5b-701d-4d0d-b501-2964925371fb","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"68abb"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fd6dda39-6b8b-4922-9858-6fd5e9a792d5","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"68/6bd527"}},"parent_tool_use_id":null}}
id: 106
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"31ee0a07-a1bd-4337-99e8-d65e57e8d1cc","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"e6af8"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"af68bcaa-141a-4e48-9356-09489ac90bb1","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"2b"}},"parent_tool_use_id":null}}
id: 107
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"57a2f60a-2428-4297-befc-4af72ad2c9ff","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"12c"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a630ed0c-f20a-4570-857a-79b44d60e6e6","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"2930b6ea9"}},"parent_tool_use_id":null}}
id: 108
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"eb047173-d27e-4369-8892-dadc8861b194","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"cb3e1a53"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"75fef6d7-4208-4cbb-bccc-e3432f8b2b53","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"9a7d96"}},"parent_tool_use_id":null}}
id: 109
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"91352c52-b26b-499f-9df6-c5a86b2b0a7b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"d68/mjihfz"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1873e355-dde0-4c48-8630-24eb9c7f9314","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"92bf"}},"parent_tool_use_id":null}}
id: 110
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a57e1301-d3df-4049-94ef-60e5c520f67d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"2x.png"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b5ffbced-957b-4d4f-8c67-3fa3b1783cc6","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"142885.mp4"}},"parent_tool_use_id":null}}
id: 111
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9a8b6789-b56d-4585-a211-f21672b7e97f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\",\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ad58858e-75fe-4fe1-8837-9c16d355792d","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\",\"thumbUr"}},"parent_tool_use_id":null}}
id: 112
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"659fb98e-20d8-4cea-bd32-cb8cd1956749","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"https://ai"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"33d35eda-c177-4d25-aab1-be814916abd6","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"l\":\"upload"}},"parent_tool_use_id":null}}
id: 113
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"df3010de-2b06-49bd-ae72-2a01ee9054c1","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"toearn.s3.a"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a0b1a492-50c3-49fb-b527-060cb5249de0","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"s/6b04"}},"parent_tool_use_id":null}}
id: 114
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2822fe28-f370-4d55-912a-7275af1c1183","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"p-sou"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8b428813-3593-4dc4-82a5-ed73ac06d694","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"2e97b6d54c"}},"parent_tool_use_id":null}}
id: 115
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3a455811-5671-465c-bf6e-85b08a1033b4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"the"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e844e7b7-9c37-427e-b365-0b6205fcedca","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"b790a0597d"}},"parent_tool_use_id":null}}
id: 116
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a9a02235-8f8b-4dc6-812e-7e6ef9753c7c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ast-1.ama"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c2d6f970-3422-47a2-9dd2-d4aa7079453d","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"e680f3a"}},"parent_tool_use_id":null}}
id: 117
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7050afc0-3d19-4dee-be85-23adfa32bf1e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"zona"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6a9af5b8-f99d-47a7-a921-7ebcc8d067c4","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"6.jpg\"}],"}},"parent_tool_use_id":null}}
id: 118
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"74705857-06f5-41c1-8584-f465b46ab93d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ws.com/a"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"aa2ab845-57d0-4b82-868d-e7e1aa47a2f8","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"plat"}},"parent_tool_use_id":null}}
id: 119
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"931d50ee-4969-45c8-91d0-46db699a0cc6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"i/imag"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e1c92e89-669e-459b-b0a8-cc7ba28bb521","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"form\":\"KWA"}},"parent_tool_use_id":null}}
id: 120
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d1a8e2ea-f52e-4448-b66a-9a1523a1adb8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"es"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"20ed956d-e29a-47c2-97e0-21e4df8bade6","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"I\",\"flow"}},"parent_tool_use_id":null}}
id: 121
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"131d997a-ba7e-45ba-95b5-80e2a04dbc95","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"/gemin"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"20b3bfba-8748-42d6-9640-1cf5af73aa38","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"Id\""}},"parent_tool_use_id":null}}
id: 122
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"723e60db-8648-4c02-b077-fd9321e3917a","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"i-3-p"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d32dc062-dd1d-4f1a-809e-23703df65803","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":":\"7a467199"}},"parent_tool_use_id":null}}
id: 123
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"221a7071-2f49-44de-9255-49529c28f6f0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ro-i"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ea8c8fed-8338-44d2-be9d-d5a74c8b5e10","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"-143b-47ad-"}},"parent_tool_use_id":null}}
id: 124
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"44f65b37-9af5-4b7f-ba13-db2078a0f4c5","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"mage-pr"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d96b6009-7e23-4b7b-8e3c-170925ba0857","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"95"}},"parent_tool_use_id":null}}
id: 125
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"020a0986-ad17-4f00-a2a7-88395a21d0d9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"eview/68ab"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7d406d8d-8863-4068-8043-f61402eed89c","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"61-a12a8292"}},"parent_tool_use_id":null}}
id: 126
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d5ccaaf5-8858-4f46-a223-77b4aa5dd99d","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"be6af812cc"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"858ec736-6d78-45bd-90c6-5dcd447fd484","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"f891"}},"parent_tool_use_id":null}}
id: 127
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ed0304ac-dc39-4589-9ad6-260b65d53044","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"b3e1a"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bc4d0dfc-9b86-44af-b24d-18871f2fb0ce","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"}]}"}},"parent_tool_use_id":null}}
id: 128
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5b9adf66-bb01-4062-859e-5181e06d4e00","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"53d"}},"parent_tool_use_id":null}}
+data: {"type":"assistant","message":{"type":"assistant","uuid":"924a144a-1e52-4a87-a556-516e137f7cd4","message":{"id":"msg_01WhEKd423J5guuJUbPUqc5Q","content":[{"type":"tool_use","id":"toolu_0134Cnnp3Nd11XBFHGrRe2nr","name":"mcp__sessionTools__outputTaskResult","input":{"result":[{"type":"fullContent","action":"none","title":"test","description":"test","tags":["1","2"],"medias":[{"type":"VIDEO","url":"https://aitoearn.s3.ap-southeast-1.amazonaws.com/68abbe6af812ccb3e1a53d68/6bd5272b2930b6ea99a7d9692bf142885.mp4","thumbUrl":"uploads/6b042e97b6d54cb790a0597de680f3a6.jpg"}],"platform":"KWAI","flowId":"7a467199-143b-47ad-9561-a12a8292f891"}]}}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":358},"cache_creation_input_tokens":358,"cache_read_input_tokens":30135,"input_tokens":5,"output_tokens":32,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
id: 129
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"aa919a10-e556-4ba0-b251-0d332354b0a1","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"68/mjihi9m6."}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"12fbe9c0-f07f-456d-a50b-a54f97be35af","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
id: 130
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8722ac37-4613-476e-bc98-b7886e6b6478","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"png\",\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a1e7285a-d86c-45a7-b3a2-afc4f581bb32","event":{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"cache_creation_input_tokens":358,"cache_read_input_tokens":30135,"input_tokens":5,"output_tokens":234}},"parent_tool_use_id":null}}
id: 131
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d89f96a1-f4a2-47ee-8b4a-f606e6606431","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"https://aito"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"76a48272-c482-4025-8cb6-b20467f0c80e","event":{"type":"message_stop"},"parent_tool_use_id":null}}
id: 132
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c390d227-71f9-488c-882b-868279d7bd5f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"earn.s3"}},"parent_tool_use_id":null}}
+data: {"type":"user","message":{"type":"user","uuid":"d4878a6b-4571-4c6f-b33f-772338640332","message":{"content":[{"tool_use_id":"toolu_0134Cnnp3Nd11XBFHGrRe2nr","type":"tool_result","content":[{"type":"text","text":"Task result submitted successfully"}]}],"role":"user"},"parent_tool_use_id":null,"tool_use_result":[{"type":"text","text":"Task result submitted successfully"}]}}
id: 133
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b992016e-3276-471d-aae7-a6c28b65e302","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":".ap-so"}},"parent_tool_use_id":null}}
+data: {"type":"keep_alive"}
id: 134
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"80b4e792-3251-4b1d-8195-855c9ebfdc45","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"utheast-"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c6329e94-dcc3-43e9-b72b-ac139a9b6d3e","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01918jzYfW2djkCpFnDomGqB","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":361,"cache_read_input_tokens":30493,"cache_creation":{"ephemeral_5m_input_tokens":361,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}},"parent_tool_use_id":null}}
id: 135
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0514fc14-d470-4be4-8a48-29a1d40fb1aa","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"1.ama"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c1ec616e-7369-4ca7-9243-c1885252e86d","event":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},"parent_tool_use_id":null}}
id: 136
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ecbc477f-bf12-4ed8-977b-94cd8b7d44c6","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"zonaws."}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ee065528-854f-4c79-9105-90707582df2f","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"🎉 **"}},"parent_tool_use_id":null}}
id: 137
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a3e0c2de-2c2a-4d20-92fb-a16e625b07e1","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"com/ai/ima"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8a34a01c-7f43-4fe5-8c6e-358830cf07e3","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"视频已"}},"parent_tool_use_id":null}}
id: 138
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3fd0535a-eb73-4665-b6fd-d783b045b628","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ges/gemini-"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0834300f-9f7d-4aaa-ad77-3960fbb86d4a","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"成"}},"parent_tool_use_id":null}}
id: 139
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0ff27b98-170b-425e-8bbe-170b72163749","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3-pr"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"71b2fb1e-e9bd-4375-8e22-cc0221f5411a","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"功提"}},"parent_tool_use_id":null}}
id: 140
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dbe113fb-4409-4ba4-8a80-57dcec7ff2a1","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"o-image"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c827a0a3-6685-4620-8d0d-d769d29fb245","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"交到快手!**\n\n**"}},"parent_tool_use_id":null}}
id: 141
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8c30dabf-5cb7-49fc-8cf8-230d3f06efbe","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"-preview"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"947aa5a4-b481-41ed-bf79-75e2f993f922","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"发"}},"parent_tool_use_id":null}}
id: 142
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"be32350f-384f-4bb7-96aa-4d8ce9b76e0c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"/68abbe6af"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6dd2af86-9c6a-4ed3-867c-781e88235910","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"布信"}},"parent_tool_use_id":null}}
id: 143
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a6736f6e-3947-48f5-8c59-9f6c8558190f","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"812ccb"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4da3fab2-5ee9-466b-a657-604231d4649c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"息:**\n- "}},"parent_tool_use_id":null}}
id: 144
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e3374d6c-049c-4401-8e2a-2c05f381fd9e","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3e"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3a06c996-04a4-4487-abf7-d22a767cf545","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"✅ "}},"parent_tool_use_id":null}}
id: 145
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e3ff7d7c-4342-4152-b18f-f3db868e74aa","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"1a53d68/mji"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"91c1444c-ad5b-49a6-97b1-13af597193a3","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"标"}},"parent_tool_use_id":null}}
id: 146
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3a8e2b6e-3946-4a44-acee-8a71818858e1","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"hlqgj.png\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a6c79d61-9f2e-40ee-9004-894b32313e14","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"题:test"}},"parent_tool_use_id":null}}
id: 147
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3a483afc-0a18-493a-8770-7c831cf8c318","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"]"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0262907d-f598-4273-af73-ae33c0202e82","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n- ✅ 描"}},"parent_tool_use_id":null}}
id: 148
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e24e8709-f4e2-43db-8a53-af7dd056beca","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"tit"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fbd56b27-73e0-4ce5-88da-59d7347712ec","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"述:test\n- ✅"}},"parent_tool_use_id":null}}
id: 149
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"db13046a-d15b-44c1-ba18-1b0c9a5dd3e9","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"le\": \"Dor"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"aedc30ef-2cf0-4236-8aec-c3faeaf024d8","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" 话题标签:#"}},"parent_tool_use_id":null}}
id: 150
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"80f93abe-8bce-44d9-8ab6-f351766a2a1b","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"aemon C"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c727aa18-2f35-424d-bab0-7725d7f38beb","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"1 #2\n- "}},"parent_tool_use_id":null}}
id: 151
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8feea842-1bda-46e3-ad03-d3e22e5ba3c2","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"omic Adve"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"eee10a95-74e8-4494-9cdc-4cdacd11b470","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"✅ 封"}},"parent_tool_use_id":null}}
id: 152
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7be2ef41-da2a-4679-bffe-6cf519f86dd4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"nture 🎨✨\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d3a8ed3f-53f4-4df1-b2ea-9e60502a751b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"面:"}},"parent_tool_use_id":null}}
id: 153
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"caaeebff-6672-4b31-a483-5c4d80c91664","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"us"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"886ee5b8-4f55-495b-aaa2-4db6338df07b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"已"}},"parent_tool_use_id":null}}
id: 154
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a744b3b0-3604-40d9-924c-f1737d31d601","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"er"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"852a5ec9-9f76-48de-987f-d7a3e5c17adc","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"自"}},"parent_tool_use_id":null}}
id: 155
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"25ab33da-1f92-416a-9960-f15b66c6ddb4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"Id\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f052a683-1c2f-4864-a1f5-28f9fcd7065d","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"动生成\n- ✅"}},"parent_tool_use_id":null}}
id: 156
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"629e54f5-9652-4813-9a94-7e1f25df0fd2","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":": \""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4a0f2c23-0137-4de6-ad9d-0caac4527df5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" 账"}},"parent_tool_use_id":null}}
id: 157
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"606fd8b9-fb0c-4cc4-9455-45c948fbf155","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"68ab"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f91771ec-95fa-4f4c-b919-59bd8e6d929e","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"号"}},"parent_tool_use_id":null}}
id: 158
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"70c84cb1-0c88-4542-915a-e276432da524","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"be6af81"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"90da539f-6dee-498b-8f57-415844e3e2d2","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":":f"}},"parent_tool_use_id":null}}
id: 159
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"37638a1f-738f-498a-a990-6413b85dd3e8","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"2cc"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6997c735-b658-42fa-9718-3169230b4a7d","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"1b6d99b9252"}},"parent_tool_use_id":null}}
id: 160
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b5dd1fbc-60d9-4004-9cdf-85922547053c","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"b3"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2be13ddc-f205-4efa-8e42-b1cd4866f9e5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"a17314bf5724e666"}},"parent_tool_use_id":null}}
id: 161
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"acc14246-5c6c-40d3-b57f-2a8c642a33c4","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"e1a53d"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"44a90ffd-3b4f-4b7f-b61e-88766d41bd14","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"123f"}},"parent_tool_use_id":null}}
id: 162
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"50b24ea2-2c70-4b55-9bf6-1a9c34ac25f0","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"68\"}"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b407d889-8208-4b6b-b0d5-7c208b1dad0f","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n视"}},"parent_tool_use_id":null}}
id: 163
-data: {"type":"assistant","message":{"type":"assistant","uuid":"f7bdd164-cfda-4d77-a7a2-c377520af703","message":{"id":"msg_013yvFkPUW7bcKLBAz1FuscS","content":[{"type":"tool_use","id":"toolu_014814VKZxU9vsCNNcjde8Uq","name":"mcp__publish__publishPostToInstagram","input":{"accountId":"instagram_25721566527501315","desc":"Vibrant Doraemon manga-style illustrations bringing classic adventures to life! Featuring dynamic comic panels with bright colors and energetic compositions. Perfect for anime and manga lovers! 💙🤖\n\nOriginal artwork inspired by the beloved blue robot cat and his magical gadgets. Swipe through for more exciting scenes!\n\n#Doraemon #Anime #Manga #ComicArt #JapaneseAnimation #AnimeArt #CartoonArt #Illustration #DigitalArt #FanArt","imgUrlList":["https://aitoearn.s3.ap-southeast-1.amazonaws.com/ai/images/gemini-3-pro-image-preview/68abbe6af812ccb3e1a53d68/mjihfz2x.png","https://aitoearn.s3.ap-southeast-1.amazonaws.com/ai/images/gemini-3-pro-image-preview/68abbe6af812ccb3e1a53d68/mjihi9m6.png","https://aitoearn.s3.ap-southeast-1.amazonaws.com/ai/images/gemini-3-pro-image-preview/68abbe6af812ccb3e1a53d68/mjihlqgj.png"],"title":"Doraemon Comic Adventure 🎨✨","userId":"68abbe6af812ccb3e1a53d68"}}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":"tool_use","stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":30674},"cache_creation_input_tokens":30674,"cache_read_input_tokens":1867,"input_tokens":3,"output_tokens":489,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
+data: {"type":"keep_alive"}
id: 164
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"075522ff-d6f0-4424-a23f-3fe5c2072807","event":{"type":"content_block_stop","index":1},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2c6e607c-ba6f-4335-b026-d7033aa6298b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"频正"}},"parent_tool_use_id":null}}
id: 165
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c02e7a8a-3bc3-4528-81a9-fb71eba49dd9","event":{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"cache_creation_input_tokens":30674,"cache_read_input_tokens":1867,"input_tokens":3,"output_tokens":489}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9cb30ae9-a0f3-4190-9246-eecc363737d1","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"在发"}},"parent_tool_use_id":null}}
id: 166
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7358072f-6296-4e24-bd48-b621af22f1ea","event":{"type":"message_stop"},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bfb41f4b-bc1e-48a2-91a8-d7d4c5e19f96","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"布中,你"}},"parent_tool_use_id":null}}
id: 167
-data: {"type":"user","message":{"type":"user","uuid":"4219e66c-103a-425a-9dc8-7f17bc60cd17","message":{"content":[{"tool_use_id":"toolu_014814VKZxU9vsCNNcjde8Uq","type":"tool_result","content":[{"type":"text","text":"Publish task created successfully. FlowId: 3642a5b7-ec08-4e22-b3e1-d0acdd3f9aa0. Use this flowId to check task status."}]}],"role":"user"},"parent_tool_use_id":null,"tool_use_result":[{"type":"text","text":"Publish task created successfully. FlowId: 3642a5b7-ec08-4e22-b3e1-d0acdd3f9aa0. Use this flowId to check task status."}]}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e6e09b4d-897d-43d2-9283-34bbe7e3654d","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"可以"}},"parent_tool_use_id":null}}
id: 168
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a541e153-daae-462e-b091-c70e8e02745a","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_01Q5UyqgMy1t9enrj86DcaiU","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":5,"cache_creation_input_tokens":547,"cache_read_input_tokens":32541,"cache_creation":{"ephemeral_5m_input_tokens":547,"ephemeral_1h_input_tokens":0},"output_tokens":34,"service_tier":"standard"}}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"81579252-4b85-478e-877d-0b836c3c6b19","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"稍后在"}},"parent_tool_use_id":null}}
id: 169
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"67e497cd-a48b-40e9-9fac-4b54179ea883","event":{"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01CCq34fotxcTvUK1bc3E28U","name":"mcp__publish__getPublishingTaskStatus","input":{}}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"44806df0-65bd-48f9-939a-2ac9c445a671","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"快手上查看发"}},"parent_tool_use_id":null}}
id: 170
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"54c8a013-bcfa-4024-a0cd-24e4668e9f58","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e7352026-15aa-45a6-b0c0-abfad42cd179","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"布结果。"}},"parent_tool_use_id":null}}
id: 171
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d66b723d-656e-45cb-a324-b77d968e752d","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"flowId\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9c43d29d-893a-417f-a306-9617e3f57a73","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"发"}},"parent_tool_use_id":null}}
id: 172
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d944c80b-587b-4fb2-9d69-ed9978a12dd7","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": \"3642a5b7"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"836ee564-3a11-4c0f-afdd-db024602b43f","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"布任"}},"parent_tool_use_id":null}}
id: 173
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"7e25db96-91e2-4bd0-ae20-5c1d8328f72d","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"-ec08-"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e12e6176-2d4f-4fb0-9fcf-6f39b83cedef","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"务已创"}},"parent_tool_use_id":null}}
id: 174
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"17c917de-b923-4f6b-964c-4dfa4a350594","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"4e22-b3e1"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"723f496b-12cc-46bf-b1c3-1d4cd049d28c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"建成功!"}},"parent_tool_use_id":null}}
id: 175
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"51344a6a-8a96-4644-ab9b-da88bacb1efc","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"-d0acdd3"}},"parent_tool_use_id":null}}
+data: {"type":"assistant","message":{"type":"assistant","uuid":"37b377eb-c26b-4c50-a132-5b2cf4f234ca","message":{"id":"msg_01918jzYfW2djkCpFnDomGqB","content":[{"type":"text","text":"🎉 **视频已成功提交到快手!**\n\n**发布信息:**\n- ✅ 标题:test\n- ✅ 描述:test\n- ✅ 话题标签:#1 #2\n- ✅ 封面:已自动生成\n- ✅ 账号:f1b6d99b9252a17314bf5724e666123f\n\n视频正在发布中,你可以稍后在快手上查看发布结果。发布任务已创建成功!"}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":361},"cache_creation_input_tokens":361,"cache_read_input_tokens":30493,"input_tokens":2,"output_tokens":2,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
id: 176
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"493d7080-dcfd-4d0b-99c6-70d600150d11","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"f9aa"}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2dffe92f-7252-4ca3-be52-6962c73924a1","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
id: 177
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2e28576d-ae07-4cd8-b345-96989e5b80bf","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"0\""}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"8d7f1c83-f0be-4d27-a0d8-6a27603d89d9","event":{"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"cache_creation_input_tokens":361,"cache_read_input_tokens":30493,"input_tokens":2,"output_tokens":148}},"parent_tool_use_id":null}}
id: 178
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"76831dfd-6415-43a1-9608-3cf6f0ec8b5c","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"userId\": "}},"parent_tool_use_id":null}}
+data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9a1699da-8f7c-4918-900b-966a1d9a04e4","event":{"type":"message_stop"},"parent_tool_use_id":null}}
id: 179
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9030b501-f6b5-4896-b9ec-1468b23252b8","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"68abb"}},"parent_tool_use_id":null}}
-
-id: 180
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"380e8756-657d-4e6e-b6b5-91c5f123eec1","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"e6af"}},"parent_tool_use_id":null}}
-
-id: 181
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"420ba161-b3a3-4723-8a15-07a0db20e93b","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"812ccb3e"}},"parent_tool_use_id":null}}
-
-id: 182
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"abac65a2-7e50-4a3b-8dc3-c6a6a9cc2a35","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"1a"}},"parent_tool_use_id":null}}
-
-id: 183
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fce7d64f-d918-4ada-8230-6b4ef3273caf","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"53d68"}},"parent_tool_use_id":null}}
-
-id: 184
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4bb606df-385d-46a2-9f58-37aa57febac5","event":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"}"}},"parent_tool_use_id":null}}
-
-id: 185
-data: {"type":"assistant","message":{"type":"assistant","uuid":"f5fd1493-41ea-4e23-a33d-1b15ac0e986b","message":{"id":"msg_01Q5UyqgMy1t9enrj86DcaiU","content":[{"type":"tool_use","id":"toolu_01CCq34fotxcTvUK1bc3E28U","name":"mcp__publish__getPublishingTaskStatus","input":{"flowId":"3642a5b7-ec08-4e22-b3e1-d0acdd3f9aa0","userId":"68abbe6af812ccb3e1a53d68"}}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":547},"cache_creation_input_tokens":547,"cache_read_input_tokens":32541,"input_tokens":5,"output_tokens":34,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
-
-id: 186
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4e770c19-c1bf-41f6-9a2c-f543bbecc22f","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
-
-id: 187
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"618a5c98-d148-468c-a472-e51e14592f7c","event":{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"cache_creation_input_tokens":547,"cache_read_input_tokens":32541,"input_tokens":5,"output_tokens":120}},"parent_tool_use_id":null}}
-
-id: 188
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6bdf7a9f-0a20-4384-9fcf-29d68b294584","event":{"type":"message_stop"},"parent_tool_use_id":null}}
-
-id: 189
-data: {"type":"user","message":{"type":"user","uuid":"ebcad41b-247c-4195-ab3c-90235d0f11de","message":{"content":[{"tool_use_id":"toolu_01CCq34fotxcTvUK1bc3E28U","type":"tool_result","content":[{"type":"text","text":"Publishing Task Status:\nFlowID: 3642a5b7-ec08-4e22-b3e1-d0acdd3f9aa0\nStatus: 2\nAccount Type: instagram\nTitle: Doraemon Comic Adventure 🎨✨"}]}],"role":"user"},"parent_tool_use_id":null,"tool_use_result":[{"type":"text","text":"Publishing Task Status:\nFlowID: 3642a5b7-ec08-4e22-b3e1-d0acdd3f9aa0\nStatus: 2\nAccount Type: instagram\nTitle: Doraemon Comic Adventure 🎨✨"}]}}
-
-id: 190
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0556b74f-7684-4c38-9100-ddd708212761","event":{"type":"message_start","message":{"model":"claude-sonnet-4-5-20250929","id":"msg_011QUgp5DL3AMu9fWhPwSXLh","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":306,"cache_read_input_tokens":33088,"cache_creation":{"ephemeral_5m_input_tokens":306,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}},"parent_tool_use_id":null}}
-
-id: 191
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1658fd40-6cad-4e74-b53f-0bebe2a91bc4","event":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},"parent_tool_use_id":null}}
-
-id: 192
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2b7e05da-874d-4ed0-af24-e4413e798605","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"✅"}},"parent_tool_use_id":null}}
-
-id: 193
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"bb90a941-2c95-445b-b8ea-70db5b793718","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" **第"}},"parent_tool_use_id":null}}
-
-id: 194
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c9adb3bc-b7b0-4cc7-afa5-831ad2d4f3de","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"三次发布成"}},"parent_tool_use_id":null}}
-
-id: 195
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"dbdf2c01-00bb-4284-913c-69c60fd94103","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"功!**"}},"parent_tool_use_id":null}}
-
-id: 196
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"52014562-f7f3-4046-b6d9-06bf8119b61b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n这"}},"parent_tool_use_id":null}}
-
-id: 197
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b3a5c334-5f02-4b3b-854b-a7c6bc274154","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"3"}},"parent_tool_use_id":null}}
-
-id: 198
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9aa9edda-89e8-4ec2-8ec1-e52ebda60a00","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"张哆啦A梦"}},"parent_tool_use_id":null}}
-
-id: 199
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c3942f44-dd42-4bd7-9e47-bb43dc98c5db","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"漫画图片已经第"}},"parent_tool_use_id":null}}
-
-id: 200
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d4442770-88eb-40fe-a786-eecc21ac4485","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"三次成功发布到您"}},"parent_tool_use_id":null}}
-
-id: 201
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2278abef-1ec1-494b-a3f6-05b0295b2e48","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"的Instagram账"}},"parent_tool_use_id":null}}
-
-id: 202
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4100e824-f5ec-48ac-8634-02501276862a","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"户 "}},"parent_tool_use_id":null}}
-
-id: 203
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4195eb39-15ca-4052-9de6-855b9944f326","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"**"}},"parent_tool_use_id":null}}
-
-id: 204
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"21f899d5-e7ef-4625-a003-3c3a2a451a1e","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ab"}},"parent_tool_use_id":null}}
-
-id: 205
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f1883ba3-401d-486d-b255-4e0a5c56ad07","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"c"}},"parent_tool_use_id":null}}
-
-id: 206
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e0850164-9453-49b8-9bd3-882c8099635e","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"g"}},"parent_tool_use_id":null}}
-
-id: 207
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0129df38-6fd5-4e5f-a965-8cea7ecaa346","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"."}},"parent_tool_use_id":null}}
-
-id: 208
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e1cdd6ae-4ccd-47cb-a94a-d7f5f6f125f1","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ao"}},"parent_tool_use_id":null}}
-
-id: 209
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ffd6c99d-3896-4540-b48a-73d099ca8c3b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"**!"}},"parent_tool_use_id":null}}
-
-id: 210
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"88040dad-c7d0-435a-b028-2e13d85a6dd7","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n**"}},"parent_tool_use_id":null}}
-
-id: 211
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0eec9f58-a670-431b-bc66-c40a3ac3d9a1","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"发"}},"parent_tool_use_id":null}}
-
-id: 212
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a81fd24f-0ecc-4944-adb0-3fa318fe2db7","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"布详情**"}},"parent_tool_use_id":null}}
-
-id: 213
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"d4a86247-13bf-4d8e-b688-3bf193abd48f","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":":\n- "}},"parent_tool_use_id":null}}
-
-id: 214
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ac84756e-01da-459e-9cd3-076dcfe68516","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"📸 3"}},"parent_tool_use_id":null}}
-
-id: 215
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"cf3af85d-7a7c-4486-a87d-265bd1054226","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"张"}},"parent_tool_use_id":null}}
-
-id: 216
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e96da5df-8938-42f6-abb9-8f25a3d66f2c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"竖版"}},"parent_tool_use_id":null}}
-
-id: 217
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3eb4abbb-6f3e-48e1-9baf-436344e999c2","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"漫画风"}},"parent_tool_use_id":null}}
-
-id: 218
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1b8bd4a6-4604-4855-a2d0-a6ed5ed49622","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"格图"}},"parent_tool_use_id":null}}
-
-id: 219
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ef8a529b-f9ac-4242-8423-2cf153880967","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"片\n- "}},"parent_tool_use_id":null}}
-
-id: 220
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"6e963f61-a514-4b20-9c90-05520636f8b4","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"📝 标题:"}},"parent_tool_use_id":null}}
-
-id: 221
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"55e62524-3f82-4612-890b-1e439c37b5aa","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Doraemon Comic Adventure "}},"parent_tool_use_id":null}}
-
-id: 222
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"77009f55-282e-48f2-9a81-934ce4ebe9b0","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"🎨✨\n- "}},"parent_tool_use_id":null}}
-
-id: 223
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"9dbf3c7f-891c-4d48-a8ce-4231ce696ee0","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"🏷️ 包"}},"parent_tool_use_id":null}}
-
-id: 224
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"71a2418f-9d25-4807-b969-ec2b1a402f9c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"含完"}},"parent_tool_use_id":null}}
-
-id: 225
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0eaf5832-b7ec-44b8-96f2-38d2664f2ad5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"整描"}},"parent_tool_use_id":null}}
-
-id: 226
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"fb6728a3-cfac-456e-8ca1-7a9d671c9758","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"述和标"}},"parent_tool_use_id":null}}
-
-id: 227
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"11ea8e40-5fd4-4b4b-8675-1c2c77ce0065","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"签"}},"parent_tool_use_id":null}}
-
-id: 228
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e1ea406f-1b24-44c0-872b-9949dcf2fab9","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n- "}},"parent_tool_use_id":null}}
-
-id: 229
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a4065ff4-f7fe-44ea-a651-dd1071189bb8","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"🎨"}},"parent_tool_use_id":null}}
-
-id: 230
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"0fc73aac-20cc-47d9-994d-83d160172006","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" 色"}},"parent_tool_use_id":null}}
-
-id: 231
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2849b2bc-2453-43e8-8830-b705052b076a","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"彩明快"}},"parent_tool_use_id":null}}
-
-id: 232
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5aa6810a-0e56-4e6d-9b13-9af2f0e9b80b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":",分"}},"parent_tool_use_id":null}}
-
-id: 233
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ad70fb7d-3d90-44f0-b404-8211ea251feb","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"镜感"}},"parent_tool_use_id":null}}
-
-id: 234
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3adefeb1-329b-4692-bffa-53580ae5d581","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"强"}},"parent_tool_use_id":null}}
-
-id: 235
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"1ebfecf9-b6d2-4744-bcd7-1dcf7bbfce08","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n现"}},"parent_tool_use_id":null}}
-
-id: 236
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"41dbe089-50f5-4ae4-9934-f73b867890ee","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"在您的"}},"parent_tool_use_id":null}}
-
-id: 237
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"b95b152c-e700-4e68-a1a6-264b2d7b9a24","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Instagram上"}},"parent_tool_use_id":null}}
-
-id: 238
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ea66a211-7bc1-49f0-bdfe-c964b2d8693b","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"已"}},"parent_tool_use_id":null}}
-
-id: 239
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"222be6a3-2fb7-4ca5-ae7a-f6b0f5ceb889","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"经"}},"parent_tool_use_id":null}}
-
-id: 240
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"3101be99-312e-4cf4-9e53-9c7bad32f218","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"有三"}},"parent_tool_use_id":null}}
-
-id: 241
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"76211a75-507f-4ea1-b3e1-69fcdabd52a7","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"条"}},"parent_tool_use_id":null}}
-
-id: 242
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2ce903bd-e764-40d8-8549-dd8c27fb4865","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"相"}},"parent_tool_use_id":null}}
-
-id: 243
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"c589bd63-e954-47f5-9094-ff1f13a6380f","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"同"}},"parent_tool_use_id":null}}
-
-id: 244
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"13b4756c-0087-4453-876d-572886d98b79","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"内"}},"parent_tool_use_id":null}}
-
-id: 245
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"2ee3852e-2182-4678-a2b3-ae84fe761160","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"容的"}},"parent_tool_use_id":null}}
-
-id: 246
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4e082c52-f0e5-4814-8148-4bd9a16fb8f3","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"帖子了"}},"parent_tool_use_id":null}}
-
-id: 247
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"4800e818-025f-4ece-abf9-d7231cf27afe","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"!"}},"parent_tool_use_id":null}}
-
-id: 248
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"22de3793-34c6-4a82-a4e8-9e9d3026d07c","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"📱"}},"parent_tool_use_id":null}}
-
-id: 249
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"5daad950-e70a-484d-a9be-84b5d06fbd30","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"✨\n\n还"}},"parent_tool_use_id":null}}
-
-id: 250
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"e59f36c9-fe07-4d9d-9b94-d0e0166b3b29","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"需"}},"parent_tool_use_id":null}}
-
-id: 251
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ee919a88-8f97-4ba4-86d4-c3652491bac5","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"要继"}},"parent_tool_use_id":null}}
-
-id: 252
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"f4ecd429-90d7-49ed-b944-e0c1d39980b1","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"续发布或"}},"parent_tool_use_id":null}}
-
-id: 253
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"63fdcce0-ce1c-427e-a699-1bd749d27524","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"者做"}},"parent_tool_use_id":null}}
-
-id: 254
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"a3913926-c268-48f1-b898-43d96b5dc75a","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"其他操"}},"parent_tool_use_id":null}}
-
-id: 255
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"10bb2a2f-db50-47c2-9cce-fa4dd75509a9","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"作吗?"}},"parent_tool_use_id":null}}
-
-id: 256
-data: {"type":"assistant","message":{"type":"assistant","uuid":"efce0d27-51e2-4aa6-bda4-fe8c23146130","message":{"id":"msg_011QUgp5DL3AMu9fWhPwSXLh","content":[{"type":"text","text":"✅ **第三次发布成功!**\n\n这3张哆啦A梦漫画图片已经第三次成功发布到您的Instagram账户 **abcg.ao**!\n\n**发布详情**:\n- 📸 3张竖版漫画风格图片\n- 📝 标题:Doraemon Comic Adventure 🎨✨\n- 🏷️ 包含完整描述和标签\n- 🎨 色彩明快,分镜感强\n\n现在您的Instagram上已经有三条相同内容的帖子了!📱✨\n\n还需要继续发布或者做其他操作吗?"}],"model":"claude-sonnet-4-5-20250929","role":"assistant","stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":306},"cache_creation_input_tokens":306,"cache_read_input_tokens":33088,"input_tokens":2,"output_tokens":184,"service_tier":"standard"},"context_management":null},"parent_tool_use_id":null}}
-
-id: 257
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"db916a3f-d680-43dd-83b4-cee2552f22c9","event":{"type":"content_block_stop","index":0},"parent_tool_use_id":null}}
-
-id: 258
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ef93165b-bda2-430a-aa1f-996910aed426","event":{"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"cache_creation_input_tokens":306,"cache_read_input_tokens":33088,"input_tokens":2,"output_tokens":184}},"parent_tool_use_id":null}}
-
-id: 259
-data: {"type":"stream_event","message":{"type":"stream_event","uuid":"ef258010-6657-4973-b8b0-d168ee5e0c34","event":{"type":"message_stop"},"parent_tool_use_id":null}}
-
-id: 260
-data: {"type":"result","message":{"type":"result","subtype":"success","uuid":"dc857076-e46d-4182-b1fa-772246d471df","duration_ms":29834,"duration_api_ms":41364,"is_error":false,"num_turns":3,"message":"✅ **第三次发布成功!**\n\n这3张哆啦A梦漫画图片已经第三次成功发布到您的Instagram账户 **abcg.ao**!\n\n**发布详情**:\n- 📸 3张竖版漫画风格图片\n- 📝 标题:Doraemon Comic Adventure 🎨✨\n- 🏷️ 包含完整描述和标签\n- 🎨 色彩明快,分镜感强\n\n现在您的Instagram上已经有三条相同内容的帖子了!📱✨\n\n还需要继续发布或者做其他操作吗?","total_cost_usd":0.15754704999999997,"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":31527},"cache_creation_input_tokens":31527,"cache_read_input_tokens":67496,"input_tokens":10,"output_tokens":793,"server_tool_use":{"web_search_requests":0}},"permission_denials":[]}}
+data: {"type":"result","message":{"type":"result","subtype":"success","uuid":"10ae54e9-c024-474f-bdea-f0187ea6fa13","duration_ms":23723,"duration_api_ms":31428,"is_error":false,"num_turns":3,"message":"🎉 **视频已成功提交到快手!**\n\n**发布信息:**\n- ✅ 标题:test\n- ✅ 描述:test\n- ✅ 话题标签:#1 #2\n- ✅ 封面:已自动生成\n- ✅ 账号:f1b6d99b9252a17314bf5724e666123f\n\n视频正在发布中,你可以稍后在快手上查看发布结果。发布任务已创建成功!","result":[{"type":"fullContent","title":"test","description":"test","tags":["1","2"],"medias":[{"type":"VIDEO","url":"https://aitoearn.s3.ap-southeast-1.amazonaws.com/68abbe6af812ccb3e1a53d68/6bd5272b2930b6ea99a7d9692bf142885.mp4","thumbUrl":"uploads/6b042e97b6d54cb790a0597de680f3a6.jpg"}],"action":"none","platform":"KWAI","flowId":"7a467199-143b-47ad-9561-a12a8292f891"}],"total_cost_usd":0.051878600000000004,"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":2300},"cache_creation_input_tokens":2300,"cache_read_input_tokens":89182,"input_tokens":10,"output_tokens":689,"server_tool_use":{"web_search_requests":0}},"permission_denials":[]}}
diff --git a/project/web/src/api/agent.ts b/project/web/src/api/agent.ts
index 9d595ea3..a4a4f0f1 100644
--- a/project/web/src/api/agent.ts
+++ b/project/web/src/api/agent.ts
@@ -223,7 +223,7 @@ export const agentApi = {
(async () => {
// try common paths
- const candidates = ['/en/agentTasks_api.txt']
+ const candidates = ['/en/agent_test3.txt']
let raw = ''
for (const p of candidates) {
try {
diff --git a/project/web/src/app/[lng]/accounts/accountCore.tsx b/project/web/src/app/[lng]/accounts/accountCore.tsx
index 42342e3d..41857ba5 100644
--- a/project/web/src/app/[lng]/accounts/accountCore.tsx
+++ b/project/web/src/app/[lng]/accounts/accountCore.tsx
@@ -8,16 +8,19 @@ import Image from 'next/image'
import { useEffect, useRef, useState } from 'react'
import { useShallow } from 'zustand/react/shallow'
import AccountsTopNav from '@/app/[lng]/accounts/components/AccountsTopNav'
-import AddAccountModal from '@/app/[lng]/accounts/components/AddAccountModal'
import CalendarTiming from '@/app/[lng]/accounts/components/CalendarTiming'
import { AccountStatus } from '@/app/config/accountConfig'
import { AccountPlatInfoMap, PlatType } from '@/app/config/platConfig'
import { useTransClient } from '@/app/i18n/client'
import rightArrow from '@/assets/images/jiantou.png'
+import { useChannelManagerStore } from '@/components/ChannelManager'
import PublishDialog from '@/components/PublishDialog'
+import { VideoGrabFrame } from '@/components/PublishDialog/PublishDialog.util'
+import { usePublishDialog } from '@/components/PublishDialog/usePublishDialog'
import { confirm } from '@/lib/confirm'
import { useAccountStore } from '@/store/account'
import { useUserStore } from '@/store/user'
+import { generateUUID } from '@/utils'
import { useCalendarTiming } from './components/CalendarTiming/useCalendarTiming'
import 'driver.js/dist/driver.css'
@@ -52,15 +55,18 @@ export default function AccountPageCore({
})),
)
- // 添加账号弹窗状态
- const [addAccountModalOpen, setAddAccountModalOpen] = useState(false)
- const [targetPlatform, setTargetPlatform] = useState<PlatType | undefined>()
- const [targetSpaceId, setTargetSpaceId] = useState<string | undefined>()
-
const { t } = useTransClient('account')
const { t: tCommon } = useTransClient('common')
const userStore = useUserStore()
+ // 频道管理器相关方法
+ const { openConnectList, openAndAuth } = useChannelManagerStore(
+ useShallow(state => ({
+ openConnectList: state.openConnectList,
+ openAndAuth: state.openAndAuth,
+ })),
+ )
+
// 移动端下载提示弹窗开关
const [showMobileDownload, setShowMobileDownload] = useState(false)
// 微信浏览器提示弹窗开关
@@ -89,12 +95,9 @@ export default function AccountPageCore({
const validPlatforms = Object.values(PlatType)
if (validPlatforms.includes(platform)) {
- // 设置目标平台
- setTargetPlatform(platform)
-
- // 直接打开添加账号弹窗,autoTriggerPlatform 会自动触发授权
+ // 直接打开频道管理器并触发授权
setTimeout(() => {
- setAddAccountModalOpen(true)
+ openAndAuth(platform)
}, 500)
// 清除URL参数
@@ -136,9 +139,6 @@ export default function AccountPageCore({
return
}
- // 设置目标平台
- setTargetPlatform(platform as PlatType)
-
const driverObj = driver({
showProgress: false,
showButtons: ['next'],
@@ -186,7 +186,7 @@ export default function AccountPageCore({
},
],
onNextClick: () => {
- // 点击按钮时关闭引导并打开添加账号弹窗
+ // 点击按钮时关闭引导并打开频道管理器
driverObj.destroy()
// 清除URL参数
if (typeof window !== 'undefined') {
@@ -194,9 +194,9 @@ export default function AccountPageCore({
url.searchParams.delete('addChannel')
window.history.replaceState({}, '', url.toString())
}
- // 打开添加账号弹窗
+ // 打开频道管理器并直接授权该平台
setTimeout(() => {
- setAddAccountModalOpen(true)
+ openAndAuth(platform as PlatType)
}, 300)
return false // 阻止默认行为
},
@@ -246,15 +246,6 @@ export default function AccountPageCore({
setAiGeneratedData(data)
- // 如果有 platform 参数,设置目标平台
- if (searchParams.platform) {
- const platform = searchParams.platform as PlatType
- const validPlatforms = Object.values(PlatType)
- if (validPlatforms.includes(platform)) {
- setTargetPlatform(platform)
- }
- }
-
// 选择账号:优先使用 accountId,其次选择对应平台的账号
let targetAccount = null
@@ -325,19 +316,18 @@ export default function AccountPageCore({
// 验证平台类型是否有效
const platform = searchParams.platform as PlatType
const validPlatforms = Object.values(PlatType)
+ const spaceId = searchParams.spaceId
if (searchParams.platform && validPlatforms.includes(platform)) {
- setTargetPlatform(platform)
+ // 有指定平台,直接授权
+ openAndAuth(platform, spaceId)
}
-
- if (searchParams.spaceId) {
- setTargetSpaceId(searchParams.spaceId)
+ else if (spaceId) {
+ // 只有spaceId,打开连接频道列表
+ openConnectList(spaceId)
}
-
- // 打开添加账号弹窗
- setAddAccountModalOpen(true)
}
- }, [searchParams, allAccounts.length])
+ }, [searchParams, allAccounts.length, openAndAuth, openConnectList])
/**
* 检测是否为微信浏览器
@@ -436,29 +426,12 @@ export default function AccountPageCore({
}
})()
- const handleAddAccountSuccess = (accountInfo: SocialAccount) => {
- setAddAccountModalOpen(false)
- // 可以在这里添加成功提示或其他逻辑
- }
-
- const handleAddAccountClose = () => {
- setAddAccountModalOpen(false)
- // 清除URL参数(可选)
- if (typeof window !== 'undefined') {
- const url = new URL(window.location.href)
- url.searchParams.delete('platform')
- url.searchParams.delete('spaceId')
- window.history.replaceState({}, '', url.toString())
- }
- }
-
// Fill AI-generated data after publish dialog opens
useEffect(() => {
if (aiGeneratedData && publishDialogOpen && allAccounts.length > 0) {
// Delay filling to ensure PublishDialog is fully initialized
const timeoutId = setTimeout(() => {
try {
- const { usePublishDialog } = require('@/components/PublishDialog/usePublishDialog')
const store = usePublishDialog.getState()
// If pubList is not initialized yet, retry after delay
@@ -481,10 +454,6 @@ export default function AccountPageCore({
// Helper function to fill data
const fillAIData = async (store: any) => {
- const { VideoGrabFrame } = require('@/components/PublishDialog/PublishDialog.util')
- // Dynamic import generateUUID and VideoGrabFrame
- const { generateUUID } = require('@/utils')
-
// Build params - append tags to description
let description = aiGeneratedData.description || ''
if (aiGeneratedData.tags && aiGeneratedData.tags.length > 0) {
@@ -510,8 +479,6 @@ export default function AccountPageCore({
// If API returned cover URL, use it directly (support both coverUrl and thumbUrl)
const coverUrl = videoMedia.coverUrl || videoMedia.thumbUrl
if (coverUrl) {
- const { formatImg } = require('@/components/PublishDialog/PublishDialog.util')
-
// Load cover image to get dimension info
coverInfo = await new Promise((resolve) => {
const img = document.createElement('img')
@@ -736,7 +703,7 @@ export default function AccountPageCore({
)
if (!hasAccounts) {
- // 使用 confirm 弹窗提示用户先添加账号,点击“去添加”打开添加账号弹窗
+ // 使用 confirm 弹窗提示用户先添加账号,点击"去添加"打开频道管理器
confirm({
title: t('noAccountWarning.title'),
content: t('noAccountWarning.content'),
@@ -744,8 +711,8 @@ export default function AccountPageCore({
cancelText: tCommon('actions.cancel'),
okType: 'default',
onOk: async () => {
- // 打开添加账号弹窗
- setAddAccountModalOpen(true)
+ // 打开频道管理器连接频道列表
+ openConnectList()
},
})
}
@@ -753,22 +720,12 @@ export default function AccountPageCore({
setPublishDialogOpen(true)
}
}}
- onAddAccount={() => setAddAccountModalOpen(true)}
+ onAddAccount={() => openConnectList()}
/>
{/* 主内容区域: CalendarTiming (包含 Row 2 工具栏和日历/列表视图) */}
<CalendarTiming />
- {/* 添加账号弹窗 */}
- <AddAccountModal
- open={addAccountModalOpen}
- onClose={handleAddAccountClose}
- onAddSuccess={handleAddAccountSuccess}
- targetGroupId={targetSpaceId}
- showSpaceSelector={!targetSpaceId}
- autoTriggerPlatform={targetPlatform}
- />
-
{/* 微信浏览器提示(遮罩 + 箭头指向右上角) */}
{showWechatBrowserTip && (
<>
diff --git a/project/web/src/app/[lng]/accounts/components/AddAccountModal/index.tsx b/project/web/src/app/[lng]/accounts/components/AddAccountModal/index.tsx
deleted file mode 100644
index 0ea2503a..00000000
--- a/project/web/src/app/[lng]/accounts/components/AddAccountModal/index.tsx
+++ /dev/null
@@ -1,624 +0,0 @@
-/**
- * AddAccountModal - 添加账号弹窗
- * 支持添加各平台社交媒体账号
- */
-
-import type { ForwardedRef } from 'react'
-import type { SocialAccount } from '@/api/types/account.type'
-import type { PluginPlatformType } from '@/store/plugin'
-import type { IpLocationInfo } from '@/utils/ipLocation'
-import { forwardRef, memo, useEffect, useMemo, useState } from 'react'
-import { useShallow } from 'zustand/react/shallow'
-import { kwaiSkip } from '@/app/[lng]/accounts/plat/kwaiLogin'
-import { AccountPlatInfoArr, AccountPlatInfoMap, PlatType } from '@/app/config/platConfig'
-import { useTransClient } from '@/app/i18n/client'
-import DownloadAppModal from '@/components/common/DownloadAppModal'
-import { Button } from '@/components/ui/button'
-import { Modal } from '@/components/ui/modal'
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from '@/components/ui/select'
-import {
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from '@/components/ui/tooltip'
-import { confirm } from '@/lib/confirm'
-import { toast } from '@/lib/toast'
-import { useAccountStore } from '@/store/account'
-import { PLUGIN_SUPPORTED_PLATFORMS, PluginStatus, usePluginStore } from '@/store/plugin'
-import { getIpLocation } from '@/utils/ipLocation'
-import { bilibiliSkip } from '../../plat/BilibiliLogin'
-import { FacebookPagesModal, facebookSkip } from '../../plat/FacebookLogin'
-import { instagramSkip } from '../../plat/InstagramLogin'
-import { linkedinSkip } from '../../plat/LinkedinLogin'
-import { pinterestSkip } from '../../plat/PinterestLogin'
-import { threadsSkip } from '../../plat/ThreadsLogin'
-import { tiktokSkip } from '../../plat/TiktokLogin'
-import { twitterSkip } from '../../plat/TwtterLogin'
-import { wxGzhSkip } from '../../plat/WxGzh'
-import { youtubeSkip } from '../../plat/YoutubeLogin'
-
-export interface IAddAccountModalRef {}
-
-export interface IAddAccountModalProps {
- open: boolean
- onClose: () => void
- onAddSuccess: (accountInfo: SocialAccount) => void
- // 目标空间ID,用于根据空间属地(CN)过滤可添加平台
- targetGroupId?: string
- // 是否显示空间选择器(当从AccountSidebar的"添加账号"按钮打开时显示)
- showSpaceSelector?: boolean
- // 自动触发平台,用于在打开时直接尝试跳转授权
- autoTriggerPlatform?: PlatType
-}
-
-const AddAccountModal = memo(
- forwardRef(
- (
- { open, onClose, onAddSuccess, targetGroupId, showSpaceSelector = false, autoTriggerPlatform }: IAddAccountModalProps,
- ref: ForwardedRef<IAddAccountModalRef>,
- ) => {
- const { t } = useTransClient('account')
- const [showFacebookPagesModal, setShowFacebookPagesModal] = useState(false)
- const { accountGroupList, getAccountList } = useAccountStore(
- useShallow(state => ({
- accountGroupList: state.accountGroupList,
- getAccountList: state.getAccountList,
- })),
- )
- const [downloadVisible, setDownloadVisible] = useState(false)
- const [downloadPlatform, setDownloadPlatform] = useState<string>('')
- const aitoearnDownloadUrl = process.env.NEXT_PUBLIC_AITOEARN_APP_DOWNLOAD_URL || ''
-
- // 插件相关状态
- const pluginStatus = usePluginStore(state => state.status)
- const platformAccounts = usePluginStore(state => state.platformAccounts)
- const syncAccountToDatabase = usePluginStore(state => state.syncAccountToDatabase)
- const init = usePluginStore(state => state.init)
- const [syncLoadingPlatform, setSyncLoadingPlatform] = useState<PlatType | null>(null)
-
- // 空间选择相关状态
- const [selectedSpaceId, setSelectedSpaceId] = useState<string | undefined>(targetGroupId)
- const [spaceSelectionRequired, setSpaceSelectionRequired] = useState(false)
-
- // 判断location是否属于中国(CN)
- const isLocationCN = (location?: string | null): boolean => {
- if (!location)
- return false
- const upper = location.toUpperCase()
- return upper.startsWith('CN') || upper.includes('CHINA') || location.includes('中国')
- }
-
- // 当前目标空间是否视为中国属地
- const [isCnSpace, setIsCnSpace] = useState<boolean | null>(null)
- const [isLocLoading, setIsLocLoading] = useState(false)
-
- // 初始化空间选择 - 简化版本
- useEffect(() => {
- if (!open) {
- setSpaceSelectionRequired(false)
- setSelectedSpaceId(undefined)
- return
- }
-
- if (showSpaceSelector) {
- setSpaceSelectionRequired(true)
- // 默认选择第一个默认空间
- const defaultSpace = accountGroupList.find(group => group.isDefault)
- if (defaultSpace && !selectedSpaceId) {
- setSelectedSpaceId(defaultSpace.id)
- }
- }
- else {
- setSpaceSelectionRequired(false)
- if (targetGroupId) {
- setSelectedSpaceId(targetGroupId)
- }
- }
- }, [open, showSpaceSelector, targetGroupId, accountGroupList, selectedSpaceId])
-
- useEffect(() => {
- if (!open || !selectedSpaceId) {
- setIsCnSpace(null)
- setIsLocLoading(false)
- return
- }
-
- const currentSpace = (accountGroupList || []).find((g: any) => g.id === selectedSpaceId)
- if (!currentSpace) {
- setIsCnSpace(null)
- return
- }
-
- const shouldUseLocal = !currentSpace.proxyIp || currentSpace.proxyIp === ''
- if (!shouldUseLocal && currentSpace.ip && currentSpace.location) {
- setIsCnSpace(isLocationCN(currentSpace.location))
- return
- }
-
- let cancelled = false
- const fetchLocal = async () => {
- try {
- setIsLocLoading(true)
- const info: IpLocationInfo = await getIpLocation()
- if (!cancelled)
- setIsCnSpace(isLocationCN(info.location))
- }
- catch {
- if (!cancelled)
- setIsCnSpace(null)
- }
- finally {
- if (!cancelled)
- setIsLocLoading(false)
- }
- }
- fetchLocal()
-
- return () => {
- cancelled = true
- }
- }, [open, selectedSpaceId])
-
- // 自动触发平台授权
- useEffect(() => {
- if (open && autoTriggerPlatform && selectedSpaceId) {
- // 延迟一下确保弹窗完全打开
- const timer = setTimeout(() => {
- const platformInfo = AccountPlatInfoArr.find(([key]) => key === autoTriggerPlatform)
- if (platformInfo) {
- handlePlatformClick(autoTriggerPlatform, platformInfo[1])
- }
- }, 500)
-
- return () => clearTimeout(timer)
- }
- }, [open, autoTriggerPlatform, selectedSpaceId])
-
- // 判断平台是否在当前属地可用
- const isPlatformAvailable = (platType: PlatType): boolean => {
- // TODO: 暂时屏蔽国内平台 @@.@@
- return true
- if (isCnSpace === null)
- return true // 未确定属地时显示所有平台
-
- const cnOnlyPlatforms = new Set<PlatType>([
- PlatType.Douyin,
- PlatType.KWAI,
- PlatType.WxGzh,
- PlatType.WxSph,
- PlatType.BILIBILI,
- ])
-
- // 小红书是全球平台,不受IP限制
- if (platType === PlatType.Xhs) {
- return true
- }
-
- if (isCnSpace === true) {
- // 中国属地:仅国内平台可用
- return cnOnlyPlatforms.has(platType)
- }
- else {
- // 非中国属地:国内平台不可用
- return !cnOnlyPlatforms.has(platType)
- }
- }
-
- const handleOk = () => {
- onClose()
- }
-
- const handleCancel = () => {
- onClose()
- }
-
- // 处理Facebook授权成功后的页面选择
- const handleFacebookAuthSuccess = () => {
- setShowFacebookPagesModal(true)
- }
-
- // 处理Facebook页面选择成功
- const handleFacebookPagesSuccess = async () => {
- setShowFacebookPagesModal(false)
- // Facebook页面选择成功后,刷新账号列表并触发成功回调
- await handleAuthSuccess(null, PlatType.Facebook)
- }
-
- // 统一处理授权成功后的逻辑
- const handleAuthSuccess = async (authResult: any, platType: PlatType) => {
- try {
- // 刷新账号列表
- await getAccountList()
-
- // 找到新添加的账号
- const afterAuthCount = accountGroupList.reduce((total, group) => total + group.children.length, 0)
- const currentSpace = accountGroupList.find(group => group.id === selectedSpaceId)
-
- if (currentSpace) {
- const newAccounts = currentSpace.children.filter((account) => {
- // 这里可以根据时间戳或其他方式判断是否为新账号
- // 暂时简单判断数量变化
- return true // 需要更精确的判断逻辑
- })
-
- if (newAccounts.length > 0) {
- // 找到最新添加的账号
- const latestAccount = newAccounts[newAccounts.length - 1]
- // 触发成功回调
- onAddSuccess(latestAccount)
- // 显示成功提示
- toast.success(t('addAccountModal.authSuccess', { platform: AccountPlatInfoMap.get(platType)?.name || platType }))
- }
- }
-
- // 关闭弹窗
- onClose()
- }
- catch (error) {
- console.error('处理授权成功失败:', error)
- toast.error(t('addAccountModal.authSuccessFailed'))
- }
- }
-
- /**
- * 检查平台是否为插件支持的平台
- */
- const isPluginSupportedPlatform = (platform: PlatType): platform is PluginPlatformType => {
- return PLUGIN_SUPPORTED_PLATFORMS.includes(platform as PluginPlatformType)
- }
-
- /**
- * 处理从插件同步账号
- * @param platform 平台类型(必须是插件支持的平台)
- */
- const handlePluginPlatformSync = async (platform: PluginPlatformType) => {
- const platformName = AccountPlatInfoMap.get(platform)?.name || platform
-
- // 检查插件是否就绪
- if (pluginStatus !== PluginStatus.READY) {
- // 插件未就绪,显示下载弹框(带插件Tab)
- setDownloadPlatform(platformName)
- setDownloadVisible(true)
- return
- }
-
- // 检查是否有账号
- const account = platformAccounts[platform]
- if (!account) {
- toast.warning(t('addAccountModal.platformNotLoggedIn', { platform: platformName }))
- return
- }
-
- setSyncLoadingPlatform(platform)
- try {
- const result = await syncAccountToDatabase(platform, selectedSpaceId)
- if (result) {
- toast.success(t('addAccountModal.syncSuccess'))
- onAddSuccess(result)
- onClose()
- }
- else {
- toast.error(t('addAccountModal.syncFailed'))
- }
- }
- catch (error) {
- console.error('同步账号失败:', error)
- toast.error(t('addAccountModal.syncFailed'))
- }
- finally {
- setSyncLoadingPlatform(null)
- }
- }
-
- // 处理平台点击
- const handlePlatformClick = async (key: PlatType, value: any) => {
- // 如果需要选择空间但未选择,提示用户
- if (spaceSelectionRequired && !selectedSpaceId) {
- return
- }
-
- // 如果平台在当前属地不可用,则提示
- if (!isPlatformAvailable(key)) {
- return
- }
-
- // 如果该平台在PC端不可用,则提示下载Aitoearn App
- if (value.pcNoThis) {
- setDownloadPlatform(value.name)
- setDownloadVisible(true)
- return
- }
-
- // 检查是否为插件支持的平台
- if (isPluginSupportedPlatform(key)) {
- await handlePluginPlatformSync(key)
- return
- }
-
- // 记录授权前的账号数量,用于后续识别新账号
- const beforeAuthCount = accountGroupList.reduce((total, group) => total + group.children.length, 0)
-
- let authResult: any = null
-
- try {
- switch (key) {
- case PlatType.KWAI:
- // 快手授权前先显示提示
- // 在 onOk 回调中直接执行授权,确保 window.open 在用户交互上下文中
- await confirm({
- title: t('addAccountModal.kwaiAuthWarning.title'),
- content: t('addAccountModal.kwaiAuthWarning.content'),
- okText: t('addAccountModal.kwaiAuthWarning.okText'),
- cancelText: undefined, // 不显示取消按钮
- onOk: async () => {
- // 在用户点击"我知道了"时立即执行授权,确保 window.open 在用户交互上下文中
- try {
- authResult = await kwaiSkip(key, selectedSpaceId)
- }
- catch (error) {
- console.error('快手授权失败:', error)
- throw error
- }
- },
- })
- break
- case PlatType.BILIBILI:
- authResult = await bilibiliSkip(key, selectedSpaceId)
- break
- case PlatType.YouTube:
- authResult = await youtubeSkip(key, selectedSpaceId)
- break
- case PlatType.Twitter:
- authResult = await twitterSkip(key, selectedSpaceId)
- break
- case PlatType.Tiktok:
- authResult = await tiktokSkip(key, selectedSpaceId)
- break
- case PlatType.Facebook:
- authResult = await facebookSkip(key, selectedSpaceId)
- // Facebook授权成功后显示页面选择弹窗(特殊处理,不刷新账号列表)
- handleFacebookAuthSuccess()
- break
- case PlatType.Instagram:
- authResult = await instagramSkip(key, selectedSpaceId)
- break
- case PlatType.Threads:
- authResult = await threadsSkip(key, selectedSpaceId)
- break
- case PlatType.WxGzh:
- authResult = await wxGzhSkip(key, selectedSpaceId)
- break
- case PlatType.Pinterest:
- authResult = await pinterestSkip(key, selectedSpaceId)
- break
- case PlatType.LinkedIn:
- authResult = await linkedinSkip(key, selectedSpaceId)
- break
- }
-
- // 统一处理授权成功后的逻辑(除了Facebook这种特殊情况)
- if (authResult && key !== PlatType.Facebook) {
- await handleAuthSuccess(authResult, key)
- }
- }
- catch (error) {
- console.error(`${key} 授权失败:`, error)
- // 可以在这里添加失败提示
- }
- }
-
- return (
- <>
- <Modal
- title={(
- <div className="flex items-center gap-2">
- <span className="text-xl">🎯</span>
- <span className="text-sm sm:text-base md:text-lg font-semibold">{t('addAccountModal.title')}</span>
- </div>
- )}
- open={open}
- onOk={handleOk}
- onCancel={handleCancel}
- footer={null}
- width={750}
- className="add-account-responsive-modal"
- >
- <div className="w-full">
- <h1 className="text-sm sm:text-base font-semibold mb-3 sm:mb-4 text-gray-700">
- {t('addAccountModal.subtitle')}
- </h1>
-
- {/* 空间选择器 */}
- {spaceSelectionRequired && (
- <div className="mb-3 sm:mb-4 pb-3 sm:pb-4 border-b border-border w-full">
- <div className="flex flex-col sm:flex-row items-start sm:items-center gap-2 sm:gap-3 p-3 bg-gradient-to-r from-blue-50 to-indigo-50 rounded-lg border border-blue-100">
- <span className="text-xs sm:text-sm font-semibold text-gray-700 whitespace-nowrap">
- {t('addAccountModal.addTo')}
- </span>
- <Select value={selectedSpaceId} onValueChange={setSelectedSpaceId}>
- <SelectTrigger className="w-full sm:w-[220px] border-blue-200 h-9">
- <SelectValue placeholder={t('pleaseChooseSpace')} />
- </SelectTrigger>
- <SelectContent>
- {accountGroupList.map(g => (
- <SelectItem key={g.id} value={g.id}>
- {g.name}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </div>
- </div>
- )}
-
- {/* 当前选择的空间信息 */}
- {selectedSpaceId && !spaceSelectionRequired && (
- <div className="mb-3 sm:mb-4 p-2.5 sm:p-3 bg-gradient-to-r from-blue-50 to-indigo-50 rounded-lg border border-blue-100 text-xs sm:text-sm text-gray-600 w-full">
- <span className="flex items-center gap-1.5 sm:gap-2 flex-wrap">
- <span className="inline-block w-1.5 h-1.5 sm:w-2 sm:h-2 bg-blue-500 rounded-full flex-shrink-0"></span>
- <span>
- {t('addAccountModal.currentSpace')}
- :
- </span>
- <span className="font-semibold text-gray-800">
- {accountGroupList.find(g => g.id === selectedSpaceId)?.name}
- </span>
- </span>
- </div>
- )}
-
- {/* 平台网格 - 响应式优化 */}
- <div
- className="
- w-full p-3 grid gap-2 sm:gap-3 mb-3 sm:mb-4
- overflow-y-auto overflow-x-hidden
- max-h-[60vh] sm:max-h-[450px]
- grid-cols-3
- sm:grid-cols-4
- md:grid-cols-5
- lg:grid-cols-6
- xl:grid-cols-7
- "
- style={{
- scrollbarWidth: 'thin',
- scrollbarColor: '#cbd5e1 #f1f5f9',
- }}
- >
- <TooltipProvider>
- {AccountPlatInfoArr.map(([key, value]) => {
- const isAvailable = isPlatformAvailable(key as PlatType)
- const isLoading = syncLoadingPlatform === key
- return (
- <Tooltip key={key}>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- className={`
- relative rounded-lg sm:rounded-xl whitespace-normal
- flex flex-col items-center justify-center
- bg-gradient-to-br from-white to-gray-50
- border border-gray-200 sm:border-[1.5px]
- transition-all duration-300 ease-out
- hover:border-blue-400 hover:shadow-lg hover:shadow-blue-100/50
- hover:-translate-y-1 hover:bg-gradient-to-br hover:from-white hover:to-blue-50
- active:translate-y-0 active:scale-[0.98]
- disabled:opacity-40 disabled:cursor-not-allowed
- disabled:hover:translate-y-0 disabled:hover:shadow-none
- overflow-hidden group
- p-2 sm:p-3
- h-[90px] sm:h-[100px] md:h-[110px]
- min-w-0 w-full
- ${!isAvailable || (spaceSelectionRequired && !selectedSpaceId) ? 'grayscale' : ''}
- `}
- disabled={!isAvailable || (spaceSelectionRequired && !selectedSpaceId) || isLoading}
- onClick={() => handlePlatformClick(key as PlatType, value)}
- >
- {/* 光泽效果 */}
- <div className="absolute inset-0 bg-gradient-to-r from-transparent via-white/40 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700" />
-
- <div className="flex flex-col items-center gap-1.5 sm:gap-2 w-full relative z-10">
- {isLoading ? (
- <div className="w-9 h-9 sm:w-10 sm:h-10 md:w-11 md:h-11 flex items-center justify-center">
- <div className="animate-spin rounded-full h-8 w-8 sm:h-9 sm:w-9 md:h-10 md:w-10 border-b-2 border-blue-500" />
- </div>
- ) : (
- <img
- src={value.icon}
- className={`
- w-9 h-9 sm:w-10 sm:h-10 md:w-11 md:h-11
- object-contain
- transition-all duration-300
- group-hover:scale-110 group-hover:rotate-[5deg]
- filter drop-shadow-md
- `}
- alt={value.name}
- />
- )}
- <span
- className={`
- text-[11px] sm:text-xs text-center font-medium
- leading-tight transition-all duration-300
- group-hover:text-blue-600 group-hover:font-semibold
- ${isAvailable ? 'text-gray-700' : 'text-gray-400'}
- line-clamp-2 w-full
- `}
- >
- {value.name}
- </span>
- </div>
- </Button>
- </TooltipTrigger>
- <TooltipContent className="max-w-[200px] text-xs">
- <p>{value.tips?.account}</p>
- </TooltipContent>
- </Tooltip>
- )
- })}
- </TooltipProvider>
- </div>
-
- {/* 属地限制提示 */}
- {isCnSpace !== null && (
- <div className="mt-2 sm:mt-3 p-2.5 sm:p-3 bg-gradient-to-r from-amber-50 to-orange-50 rounded-lg text-amber-700 text-center border border-amber-200 flex items-center justify-center gap-1.5 sm:gap-2 flex-wrap w-full">
- <span className="text-sm flex-shrink-0">ℹ️</span>
- <span className="text-[11px] sm:text-xs leading-tight">
- {isCnSpace
- ? t('locationRestriction.cnSpace')
- : t('locationRestriction.nonCnSpace')}
- </span>
- </div>
- )}
-
- {/* 空间选择提示 */}
- {spaceSelectionRequired && !selectedSpaceId && (
- <div className="mt-2 sm:mt-3 p-2.5 sm:p-3 bg-gradient-to-r from-yellow-50 to-amber-50 rounded-lg text-amber-600 text-center border border-yellow-200 flex items-center justify-center gap-1.5 sm:gap-2 animate-pulse flex-wrap w-full">
- <span className="text-sm flex-shrink-0">⚠️</span>
- <span className="font-medium text-[11px] sm:text-xs leading-tight">
- {t('addAccountModal.pleaseChooseSpaceFirst')}
- </span>
- </div>
- )}
- </div>
- </Modal>
-
- {/* Facebook页面选择弹窗 */}
- <FacebookPagesModal
- open={showFacebookPagesModal}
- onClose={() => setShowFacebookPagesModal(false)}
- onSuccess={handleFacebookPagesSuccess}
- />
-
- {/* 下载Aitoearn App提示弹窗 */}
- <DownloadAppModal
- visible={downloadVisible}
- onClose={() => setDownloadVisible(false)}
- platform={downloadPlatform}
- appName="Aitoearn App"
- downloadUrl={aitoearnDownloadUrl}
- // 如果是插件支持的平台且插件未就绪,显示插件Tab
- showPluginTab={pluginStatus !== PluginStatus.READY}
- defaultTab="plugin"
- pluginStatus={
- pluginStatus === PluginStatus.INSTALLED_NO_PERMISSION
- ? 'no_permission'
- : pluginStatus === PluginStatus.NOT_INSTALLED || pluginStatus === PluginStatus.UNKNOWN
- ? 'not_installed'
- : 'ready'
- }
- onCheckPermission={() => init()}
- />
- </>
- )
- },
- ),
-)
-AddAccountModal.displayName = 'AddAccountModal'
-
-export default AddAccountModal
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/CalendarToolbar.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTiming/CalendarToolbar.tsx
index b881c8c0..e4daf235 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/CalendarToolbar.tsx
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTiming/CalendarToolbar.tsx
@@ -1,30 +1,24 @@
/**
* CalendarToolbar 组件
*
- * 功能描述: 日历工具栏 (Row 2 - Calendar Controls Bar)
- * - 左侧: 上月/下月按钮 + 当前月份显示 + 今天按钮 (仅日历模式显示)
- * - 右侧: 日历/列表模式切换标签
+ * 功能描述: 日历工具栏 - 包含导航按钮和月份显示
+ * - 上月/下月按钮
+ * - 当前月份显示
+ * - 今天按钮
*/
'use client'
-import {
- CalendarOutlined,
- UnorderedListOutlined,
-} from '@ant-design/icons'
import dayjs from 'dayjs'
import { ChevronLeft, ChevronRight } from 'lucide-react'
import { memo, useMemo } from 'react'
import { useTransClient } from '@/app/i18n/client'
import { Button } from '@/components/ui/button'
-import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { useGetClientLng } from '@/hooks/useSystem'
import 'dayjs/locale/zh-cn'
import 'dayjs/locale/en'
export interface ICalendarToolbarProps {
- activeMode: 'calendar' | 'list'
- onModeChange: (mode: 'calendar' | 'list') => void
currentDate: Date
onPrev: () => void
onNext: () => void
@@ -32,7 +26,7 @@ export interface ICalendarToolbarProps {
}
const CalendarToolbar = memo<ICalendarToolbarProps>(
- ({ activeMode, onModeChange, currentDate, onPrev, onNext, onToday }) => {
+ ({ currentDate, onPrev, onNext, onToday }) => {
const { t } = useTransClient('account')
const lng = useGetClientLng()
@@ -44,56 +38,39 @@ const CalendarToolbar = memo<ICalendarToolbarProps>(
}, [currentDate, lng])
return (
- <div className="h-14 flex items-center justify-between px-6 py-3 border-b bg-background shrink-0">
- {/* 左侧: 日历导航控制 (仅在日历模式显示) */}
- <div className="flex items-center gap-3">
- {activeMode === 'calendar' && (
- <>
- <Button
- variant="ghost"
- size="icon"
- onClick={onPrev}
- className="h-8 w-8"
- >
- <ChevronLeft className="h-4 w-4" />
- </Button>
- <Button
- variant="ghost"
- size="icon"
- onClick={onNext}
- className="h-8 w-8"
- >
- <ChevronRight className="h-4 w-4" />
- </Button>
- <div className="text-base font-semibold text-foreground min-w-[120px] text-center">
- {formattedDate}
- </div>
- <Button
- variant="outline"
- onClick={onToday}
- className="h-8"
- >
- {t('today')}
- </Button>
- </>
- )}
+ <div className="h-12 md:h-14 flex items-center justify-between px-4 md:px-6 py-2 md:py-3 border-b bg-background shrink-0">
+ {/* 导航控制 */}
+ <div className="flex items-center gap-1 md:gap-3">
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={onPrev}
+ className="h-7 w-7 md:h-8 md:w-8 cursor-pointer"
+ >
+ <ChevronLeft className="h-4 w-4" />
+ </Button>
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={onNext}
+ className="h-7 w-7 md:h-8 md:w-8 cursor-pointer"
+ >
+ <ChevronRight className="h-4 w-4" />
+ </Button>
+ <div className="text-sm md:text-base font-semibold text-foreground min-w-[100px] md:min-w-[120px] text-center">
+ {formattedDate}
+ </div>
</div>
- {/* 右侧: 模式切换标签 */}
- <div className="flex items-center gap-3">
- <Tabs value={activeMode} onValueChange={value => onModeChange(value as 'calendar' | 'list')}>
- <TabsList>
- <TabsTrigger value="calendar" className="gap-1.5">
- <CalendarOutlined />
- {t('calendarModeTab')}
- </TabsTrigger>
- <TabsTrigger value="list" className="gap-1.5">
- <UnorderedListOutlined />
- {t('listModeTab')}
- </TabsTrigger>
- </TabsList>
- </Tabs>
- </div>
+ {/* 今天按钮 */}
+ <Button
+ variant="outline"
+ onClick={onToday}
+ size="sm"
+ className="h-7 md:h-8 text-xs md:text-sm cursor-pointer"
+ >
+ {t('today')}
+ </Button>
</div>
)
},
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/QueueItem.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/QueueItem.tsx
deleted file mode 100644
index 0c49005f..00000000
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/QueueItem.tsx
+++ /dev/null
@@ -1,223 +0,0 @@
-/**
- * QueueItem 组件
- * 功能:显示发布队列中的单个记录项
- */
-import type { PublishRecordItem } from '@/api/plat/types/publish.types'
-import {
- CheckCircleOutlined,
- ClockCircleOutlined,
- CloseCircleOutlined,
- LoadingOutlined,
- SendOutlined,
-} from '@ant-design/icons'
-import { memo } from 'react'
-import { useShallow } from 'zustand/react/shallow'
-import { PublishStatus } from '@/api/plat/types/publish.types'
-import { getDays } from '@/app/[lng]/accounts/components/CalendarTiming/calendarTiming.utils'
-import { AccountPlatInfoMap } from '@/app/config/platConfig'
-import { useTransClient } from '@/app/i18n/client'
-import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
-import { Button } from '@/components/ui/button'
-import { useAccountStore } from '@/store/account'
-import { getOssUrl } from '@/utils/oss'
-
-interface QueueItemProps {
- record: PublishRecordItem
- onRetry?: (record: PublishRecordItem) => void
- onEdit?: (record: PublishRecordItem) => void
- onMore?: (record: PublishRecordItem) => void
-}
-
-const QueueItem = memo(({ record, onRetry, onEdit, onMore }: QueueItemProps) => {
- const { t } = useTransClient('publish')
- const { accountMap, accountActive } = useAccountStore(
- useShallow(state => ({
- accountMap: state.accountMap,
- accountActive: state.accountActive,
- })),
- )
-
- const account = accountMap.get(record.accountId)
- const platInfo = AccountPlatInfoMap.get(record.accountType)
- const days = getDays(record.publishTime)
-
- const getStatusInfo = () => {
- switch (record.status) {
- case PublishStatus.FAIL:
- return {
- color: 'error',
- text: t('status.publishFailed'),
- icon: <CloseCircleOutlined />,
- }
- case PublishStatus.PUB_LOADING:
- return {
- color: 'cyan',
- text: t('status.publishing'),
- icon: <LoadingOutlined />,
- }
- case PublishStatus.RELEASED:
- return {
- color: 'success',
- text: t('status.publishSuccess'),
- icon: <CheckCircleOutlined />,
- }
- case PublishStatus.UNPUBLISH:
- return {
- color: 'processing',
- text: t('status.waitingPublish'),
- icon: <ClockCircleOutlined />,
- }
- default:
- return {
- color: 'default',
- text: t('status.unknown'),
- icon: null,
- }
- }
- }
-
- const statusInfo = getStatusInfo()
-
- return (
- <div className="bg-background rounded-xl border border-border shadow-sm overflow-hidden transition-all duration-300 ease-in-out mb-4 last:mb-0 hover:shadow-md hover:-translate-y-0.5">
- {/* 状态头部 */}
- <div className="flex justify-between items-start p-4 pb-3 border-b border-border">
- <div className="flex flex-col gap-1">
- <div className="flex items-center gap-2">
- <span className="text-sm text-muted-foreground font-medium">{days.format('MMM DD')}</span>
- <span className="text-sm text-muted-foreground font-medium">{days.format('h:mm A')}</span>
- </div>
- <span className="text-base font-semibold text-foreground">{statusInfo.text}</span>
- </div>
- <div className="flex-shrink-0">
- {/* 可以在这里添加状态徽章 */}
- </div>
- </div>
-
- {/* 错误信息横幅 */}
- {record.status === PublishStatus.FAIL && record.errorMsg && (
- <div className="flex items-center gap-3 p-3 px-5 bg-destructive/10 border-b border-destructive/30">
- <div className="text-destructive text-base flex-shrink-0">
- <CloseCircleOutlined />
- </div>
- <div className="text-destructive text-sm leading-tight flex-1">
- {record.errorMsg}
- </div>
- </div>
- )}
-
- {/* 主要内容区域 */}
- <div className="p-5">
- <div className="flex flex-row justify-between gap-3">
- {/* 左侧:账户信息和文本内容 */}
- <div className="flex flex-col gap-3">
- {/* 账户信息 */}
- <div className="flex items-start gap-3 mb-4">
- <div className="relative flex-shrink-0">
- <Avatar className="h-10 w-10">
- <AvatarImage src={getOssUrl(accountActive?.avatar || '')} alt={accountActive?.nickname || accountActive?.account} />
- <AvatarFallback>
- {accountActive?.nickname?.charAt(0) || accountActive?.account?.charAt(0)}
- </AvatarFallback>
- </Avatar>
- <div className="absolute -bottom-0.5 -right-0.5 w-5 h-5 bg-background rounded-full flex items-center justify-center border-2 border-background shadow-sm">
- <img
- src={platInfo?.icon}
- alt="platform"
- className="w-3 h-3 object-contain"
- />
- </div>
- </div>
- <div className="flex-1 min-w-0">
- <div className="text-base font-semibold text-foreground mb-1 leading-tight">
- {account?.nickname}
- </div>
- <div className="text-sm text-muted-foreground leading-tight">
- @
- {account?.account}
- </div>
- </div>
- </div>
-
- {/* 发布内容文本 */}
- <div className="text-base text-foreground leading-relaxed mb-4 break-words">
- {record.desc}
- </div>
- </div>
-
- {/* 右侧:媒体内容 */}
- <div className="relative">
- {(record.coverUrl || record.imgUrlList?.length > 0) && (
- <div className="mb-4">
- {record.videoUrl
- ? (
- <div className="relative rounded-lg overflow-hidden bg-muted max-w-[300px]">
- <img
- src={getOssUrl(record.coverUrl || '')}
- alt="video thumbnail"
- className="w-full h-auto block rounded-lg"
- />
- <div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-12 h-12 bg-black/70 rounded-full flex items-center justify-center cursor-pointer transition-all hover:bg-black/80 hover:scale-110">
- <div className="text-white text-base ml-0.5">▶</div>
- </div>
- </div>
- )
- : (
- <div className="rounded-lg overflow-hidden bg-muted max-w-[300px]">
- <img
- src={getOssUrl(record.coverUrl || record.imgUrlList?.[0] || '')}
- alt="post image"
- className="w-full h-auto block rounded-lg"
- />
- </div>
- )}
- </div>
- )}
- </div>
- </div>
- </div>
-
- {/* 底部信息 */}
- <div className="flex justify-between items-center p-4 px-5 border-t border-border bg-muted/30">
- <div className="text-sm text-muted-foreground">
- {t('creationInfo', { date: days.format('YYYY-MM-DD') })}
- </div>
- <div className="flex items-center gap-2">
- {record.status === PublishStatus.UNPUBLISH && (
- <Button
- onClick={() => onRetry?.(record)}
- size="sm"
- className="h-8 rounded-md font-medium"
- >
- <SendOutlined />
- {t('buttons.publishNow')}
- </Button>
- )}
- {record.workLink && (
- <Button
- variant="outline"
- size="sm"
- onClick={async () => {
- try {
- await navigator.clipboard.writeText(record.workLink)
- // 可以添加一个提示消息
- }
- catch (err) {
- console.error('复制链接失败:', err)
- }
- }}
- className="h-8 rounded-md font-medium border border-border bg-background transition-all hover:border-primary hover:bg-accent"
- >
- <SendOutlined />
- {t('buttons.copyLink')}
- </Button>
- )}
- </div>
- </div>
- </div>
- )
-})
-
-QueueItem.displayName = 'QueueItem'
-
-export default QueueItem
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/SentList.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/SentList.tsx
deleted file mode 100644
index 96d34652..00000000
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/SentList.tsx
+++ /dev/null
@@ -1,328 +0,0 @@
-/**
- * SentList 组件
- * 功能:显示已发送的帖子列表
- */
-import type { SentPost } from '@/api/types/sent.types'
-import { AimOutlined, BarChartOutlined, EyeInvisibleOutlined, EyeOutlined, HeartOutlined, LikeOutlined, MessageOutlined, ShareAltOutlined } from '@ant-design/icons'
-import dayjs from 'dayjs'
-import React, { useEffect, useMemo, useState } from 'react'
-import { useShallow } from 'zustand/react/shallow'
-import { getSentPosts } from '@/api/sent'
-import { AccountPlatInfoMap } from '@/app/config/platConfig'
-import { useTransClient } from '@/app/i18n/client'
-import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
-import { Button } from '@/components/ui/button'
-import { Skeleton } from '@/components/ui/skeleton'
-import { useAccountStore } from '@/store/account'
-import { getOssUrl } from '@/utils/oss'
-
-interface SentListProps {
- platform: string
- uid: string
- onDataChange?: (count: number) => void
- accountInfo?: {
- avatar: string
- nickname: string
- account: string
- }
-}
-
-const SentList: React.FC<SentListProps> = ({ platform, uid, onDataChange, accountInfo }) => {
- const { t } = useTransClient('account')
- const [posts, setPosts] = useState<SentPost[]>([])
- const [loading, setLoading] = useState(false)
- const [hasMore, setHasMore] = useState(false)
- const [page, setPage] = useState(1)
-
- // Get account list for mapping
- const { accountList } = useAccountStore(
- useShallow(state => ({
- accountList: state.accountList,
- })),
- )
-
- // Create mapping from accountId to account information
- const accountMap = useMemo(() => {
- const map = new Map()
- accountList.forEach((account) => {
- map.set(account.id, account)
- })
- return map
- }, [accountList])
-
- const loadPosts = async (pageNum: number = 1, append: boolean = false) => {
- setLoading(true)
- try {
- // Build request parameters, if platform and uid are not passed, don't pass
- const params: any = {
- time: [dayjs().subtract(1, 'month').utc().format(), dayjs().utc().format()],
- }
-
- if (platform) {
- params.accountType = platform
- }
-
- if (uid) {
- params.uid = uid
- }
-
- const response = await getSentPosts(params)
-
- // Handle new API response format
- const responseData = (response as any)?.data || response
-
- // Handle response data, directly use responseData as an array
- const postsData = Array.isArray(responseData)
- ? responseData
- : (responseData?.posts || responseData?.data?.posts || responseData?.list || [])
-
- if (append) {
- setPosts(prev => [...prev, ...postsData])
- }
- else {
- setPosts(postsData)
- }
- setHasMore(responseData?.hasMore || false)
-
- // Notify parent component of data change
- if (onDataChange) {
- onDataChange(responseData?.total || postsData.length)
- }
- }
- catch (error) {
- console.error('Failed to load sent posts:', error)
- // When an error occurs, reset data
- if (!append) {
- setPosts([])
- setHasMore(false)
- if (onDataChange) {
- onDataChange(0)
- }
- }
- }
- finally {
- setLoading(false)
- }
- }
-
- useEffect(() => {
- // Enter the page and call it, regardless of whether there is platform and uid
- loadPosts(1, false)
- }, [platform, uid])
-
- const loadMore = () => {
- const nextPage = page + 1
- setPage(nextPage)
- loadPosts(nextPage, true)
- }
-
- const formatTime = (timestamp: string | number) => {
- const date = typeof timestamp === 'string' ? new Date(timestamp) : new Date(timestamp)
- return {
- date: date.toLocaleDateString('zh-CN', { month: '2-digit', day: '2-digit' }),
- time: date.toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit', hour12: false }),
- }
- }
-
- const renderPostItem = (post: SentPost) => {
- // Get account information based on accountId
- const account = accountMap.get(post.accountId)
- const platInfo = AccountPlatInfoMap.get(post.accountType as any)
-
- const timeInfo = formatTime(post.publishTime)
- const postTime = typeof post.publishTime === 'string' ? new Date(post.publishTime).getTime() : post.publishTime
- const daysAgo = Math.floor((Date.now() - postTime) / (1000 * 60 * 60 * 24))
-
- return (
- <div key={post.id} className="mb-6 last:mb-0">
- <div className="bg-background rounded-xl shadow-sm border border-border overflow-hidden transition-all duration-300 ease-in-out hover:shadow-md hover:-translate-y-0.5">
- {/* Date time header */}
- <div className="px-5 pt-4 pb-3 border-b border-border/50">
- <div className="flex items-center gap-2">
- <span className="text-sm text-muted-foreground font-medium">{timeInfo.date}</span>
- <span className="text-sm text-muted-foreground font-medium">{timeInfo.time}</span>
- </div>
- </div>
-
- {/* Post content */}
- <div className="p-5">
- {/* User information */}
- <div className="flex items-start gap-3 mb-4">
- <Avatar className="h-10 w-10">
- <AvatarImage src={getOssUrl(account?.avatar || '')} alt={account?.nickname || account?.account} />
- <AvatarFallback>
- {account?.nickname?.charAt(0) || account?.account?.charAt(0) || post.title?.charAt(0) || '?'}
- </AvatarFallback>
- </Avatar>
- <div className="flex-1 min-w-0">
- <div className="text-base font-semibold text-foreground mb-1 leading-tight">
- {account?.nickname || account?.account || post.title || t('unknownAccount')}
- </div>
- <div className="flex items-center gap-1.5 text-sm text-muted-foreground leading-tight">
- {platInfo && (
- <img src={platInfo.icon} alt={platInfo.name} className="w-4 h-4 rounded-sm" />
- )}
- <span>{platInfo?.name || post.accountType}</span>
- </div>
- </div>
- </div>
-
- {/* Post text */}
- <div className="text-base text-foreground leading-relaxed mb-4 break-words">
- {post.desc}
- </div>
-
- {/* Media content */}
- {post.coverUrl && (
- <div className="mb-5">
- <div className="relative max-w-[300px]">
- <img
- src={post.coverUrl}
- alt={post.title || post.desc}
- className="w-full h-auto block rounded-lg"
- />
- {(post.type === 'video' || post.type?.includes('video')) && (
- <div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-12 h-12 bg-black/70 rounded-full flex items-center justify-center">
- <div className="text-white text-base ml-0.5">▶</div>
- </div>
- )}
- </div>
- </div>
- )}
-
- {/* Interactive data */}
- <div className="mb-5 p-4 bg-muted/50 rounded-lg">
- <div className="flex items-center gap-6 flex-wrap">
- <div className="flex flex-col items-center gap-1 min-w-[60px]">
- <div className="text-base text-muted-foreground"><LikeOutlined /></div>
- <div className="text-xs text-muted-foreground font-medium text-center">Likes</div>
- <div className="text-sm text-foreground font-semibold">{post.engagement?.likeCount || 0}</div>
- </div>
- <div className="flex flex-col items-center gap-1 min-w-[60px]">
- <div className="text-base text-muted-foreground"><ShareAltOutlined /></div>
- <div className="text-xs text-muted-foreground font-medium text-center">Shares</div>
- <div className="text-sm text-foreground font-semibold">{post.engagement?.shareCount || 0}</div>
- </div>
- <div className="flex flex-col items-center gap-1 min-w-[60px]">
- <div className="text-base text-muted-foreground"><EyeOutlined /></div>
- <div className="text-xs text-muted-foreground font-medium text-center">Views</div>
- <div className="text-sm text-foreground font-semibold">{post.engagement?.viewCount || 0}</div>
- </div>
- <div className="flex flex-col items-center gap-1 min-w-[60px]">
- <div className="text-base text-muted-foreground"><MessageOutlined /></div>
- <div className="text-xs text-muted-foreground font-medium text-center">Comments</div>
- <div className="text-sm text-foreground font-semibold">{post.engagement?.commentCount || 0}</div>
- </div>
- <div className="flex flex-col items-center gap-1 min-w-[60px]">
- <div className="text-base text-muted-foreground"><HeartOutlined /></div>
- <div className="text-xs text-muted-foreground font-medium text-center">Favorites</div>
- <div className="text-sm text-foreground font-semibold">{post.engagement?.favoriteCount || 0}</div>
- </div>
- <div className="flex flex-col items-center gap-1 min-w-[60px]">
- <div className="text-base text-muted-foreground"><AimOutlined /></div>
- <div className="text-xs text-muted-foreground font-medium text-center">Click</div>
- <div className="text-sm text-foreground font-semibold">{post.engagement?.clickCount || 0}</div>
- </div>
- <div className="flex flex-col items-center gap-1 min-w-[60px]">
- <div className="text-base text-muted-foreground"><EyeInvisibleOutlined /></div>
- <div className="text-xs text-muted-foreground font-medium text-center">Impression</div>
- <div className="text-sm text-foreground font-semibold">{post.engagement?.impressionCount || 0}</div>
- </div>
- <div className="ml-auto text-base text-muted-foreground cursor-pointer p-1 rounded transition-all hover:bg-muted hover:text-foreground">
- <BarChartOutlined />
- </div>
- </div>
- </div>
-
- {/* Bottom information */}
- <div className="flex justify-between items-center pt-4 border-t border-border/50">
- <div className="text-sm text-muted-foreground">
- {t('listMode.createdDaysAgo', { days: daysAgo })}
- </div>
- <div className="flex items-center gap-2">
- <Button
- variant="link"
- size="sm"
- className="text-sm text-primary px-2 h-auto border border-border/50 rounded bg-background transition-all hover:border-primary hover:bg-accent"
- onClick={() => window.open(post.workLink, '_blank')}
- >
- {t('listMode.viewPost')}
- {' '}
- ↗️
- </Button>
- <Button
- variant="ghost"
- size="sm"
- className="text-base text-muted-foreground px-2 h-auto rounded transition-all hover:bg-muted hover:text-foreground"
- >
- ⋮
- </Button>
- </div>
- </div>
- </div>
- </div>
- </div>
- )
- }
-
- // Filter out data that cannot be matched in the account list
- const validPosts = useMemo(() => {
- return posts.filter(post => accountMap.has(post.accountId))
- }, [posts, accountMap])
-
- if (loading && posts.length === 0) {
- return (
- <div className="w-full h-full flex flex-col p-0">
- <div className="py-5">
- <div className="space-y-3 p-4">
- <Skeleton className="h-4 w-full" />
- <Skeleton className="h-4 w-3/4" />
- <Skeleton className="h-20 w-full" />
- </div>
- <div className="space-y-3 p-4">
- <Skeleton className="h-4 w-full" />
- <Skeleton className="h-4 w-3/4" />
- <Skeleton className="h-20 w-full" />
- </div>
- <div className="space-y-3 p-4">
- <Skeleton className="h-4 w-full" />
- <Skeleton className="h-4 w-3/4" />
- <Skeleton className="h-20 w-full" />
- </div>
- </div>
- </div>
- )
- }
-
- return (
- <div className="w-full h-full flex flex-col p-0">
- {validPosts.length > 0
- ? (
- <>
- <div className="flex-1 overflow-y-auto overflow-x-hidden p-0">
- {validPosts.map(renderPostItem)}
- </div>
- {hasMore && (
- <div className="flex justify-center py-6 shrink-0">
- <Button
- disabled={loading}
- onClick={loadMore}
- className="rounded-[20px] px-8 h-auto py-2.5 text-sm font-medium"
- >
- Load more...
- </Button>
- </div>
- )}
- </>
- )
- : (
- <div className="flex flex-col items-center justify-center py-16 text-center text-muted-foreground h-full min-h-[300px]">
- <div className="text-4xl mb-4">📮</div>
- <p className="text-sm">{t('listMode.noSentPosts')}</p>
- </div>
- )}
- </div>
- )
-}
-
-export default SentList
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/index.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/index.tsx
deleted file mode 100644
index d75c3d1b..00000000
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/index.tsx
+++ /dev/null
@@ -1,157 +0,0 @@
-import type { ForwardedRef } from 'react'
-import type { PublishRecordItem } from '@/api/plat/types/publish.types'
-import { forwardRef, memo, useState } from 'react'
-import { DndProvider } from 'react-dnd'
-import { HTML5Backend } from 'react-dnd-html5-backend'
-import { useShallow } from 'zustand/react/shallow'
-import { useCalendarTiming } from '@/app/[lng]/accounts/components/CalendarTiming/useCalendarTiming'
-import { useTransClient } from '@/app/i18n/client'
-import { Badge } from '@/components/ui/badge'
-import { Skeleton } from '@/components/ui/skeleton'
-import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
-import { useAccountStore } from '@/store/account'
-import QueueItem from './QueueItem'
-import SentList from './SentList'
-
-export interface IListModeRef {}
-export interface IListModeProps {
- onClickPub?: (date: string) => void
-}
-
-const ListMode = memo(
- forwardRef(
- ({ onClickPub }: IListModeProps, ref: ForwardedRef<IListModeRef>) => {
- const { t } = useTransClient('account')
- const { recordMap, listLoading } = useCalendarTiming(
- useShallow(state => ({
- recordMap: state.recordMap,
- listLoading: state.listLoading,
- })),
- )
-
- const { accountActive } = useAccountStore(
- useShallow(state => ({
- accountActive: state.accountActive,
- })),
- )
-
- const [sentCount, setSentCount] = useState(0)
-
- // 将所有记录转换为列表格式,保持后端原始顺序
- const queueRecords = Array.from(recordMap.values()).flat()
-
- const renderRecordItem = (record: PublishRecordItem) => {
- return (
- <QueueItem
- key={record.id}
- record={record}
- onRetry={(record) => {
- // TODO: 实现重试逻辑
- console.log('Retry record:', record)
- }}
- onEdit={(record) => {
- // TODO: 实现编辑逻辑
- console.log('Edit record:', record)
- }}
- onMore={(record) => {
- // TODO: 实现更多操作逻辑
- console.log('More actions for record:', record)
- }}
- />
- )
- }
-
- if (listLoading) {
- return (
- <div className="w-full h-full flex flex-col p-2.5 px-[15px] box-border">
- <div className="flex justify-between items-center mb-[15px] pb-2.5 border-b border-border">
- <div className="flex flex-col gap-1">
- <h3 className="m-0 text-lg font-semibold text-foreground">
- {t('listMode.title')}
- </h3>
- </div>
- </div>
- <div className="h-full p-0 pr-1.5">
- {[1, 2, 3, 4, 5].map(i => (
- <div key={i} className="py-3 px-0.5 border-b border-border last:border-b-0">
- <div className="space-y-3">
- <Skeleton className="h-4 w-full" />
- <Skeleton className="h-4 w-3/4" />
- <Skeleton className="h-20 w-full" />
- </div>
- </div>
- ))}
- </div>
- </div>
- )
- }
-
- const queueTabContent = (
- <div className="h-full p-0 pr-1.5">
- <DndProvider backend={HTML5Backend}>
- {queueRecords.length > 0
- ? (
- <div className="h-full overflow-y-auto overflow-x-hidden p-0">
- {queueRecords.map(renderRecordItem)}
- </div>
- )
- : (
- <div className="flex flex-col items-center justify-center py-16 text-center text-muted-foreground">
- <div className="text-4xl mb-4">📋</div>
- <p className="text-sm">{t('listMode.noRecords')}</p>
- </div>
- )}
- </DndProvider>
- </div>
- )
-
- const sentTabContent = (
- <SentList
- platform={accountActive?.type || ''}
- uid={accountActive?.uid || ''}
- onDataChange={setSentCount}
- accountInfo={accountActive
- ? {
- avatar: accountActive.avatar,
- nickname: accountActive.nickname,
- account: accountActive.account,
- }
- : undefined}
- />
- )
-
- return (
- <div className="w-full h-full flex flex-col p-2.5 px-[15px] box-border">
- <Tabs defaultValue="queue" className="flex-1 flex flex-col min-h-0">
- <TabsList className="grid w-full grid-cols-2">
- <TabsTrigger value="queue" className="gap-2">
- <span>{t('listMode.queue')}</span>
- {queueRecords.length > 0 && (
- <Badge variant="secondary" className="h-5 min-w-5 px-1.5 text-xs">
- {queueRecords.length}
- </Badge>
- )}
- </TabsTrigger>
- <TabsTrigger value="sent" className="gap-2">
- <span>{t('listMode.sent')}</span>
- {sentCount > 0 && (
- <Badge variant="secondary" className="h-5 min-w-5 px-1.5 text-xs">
- {sentCount}
- </Badge>
- )}
- </TabsTrigger>
- </TabsList>
- <TabsContent value="queue" className="flex-1 min-h-0 mt-4">
- {queueTabContent}
- </TabsContent>
- <TabsContent value="sent" className="flex-1 min-h-0 mt-4">
- {sentTabContent}
- </TabsContent>
- </Tabs>
- </div>
- )
- },
- ),
-)
-
-export default ListMode
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.scss b/project/web/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.scss
index 0f038db3..fa2d354f 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.scss
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.scss
@@ -135,3 +135,50 @@
opacity: 0;
transition: opacity 300ms ease-out;
}
+
+/* ================================
+ 移动端响应式样式 (< 768px)
+ ================================ */
+@media (max-width: 767px) {
+ /* 日历容器:减小内边距 */
+ .calendarTiming-calendar {
+ padding: 0.5rem;
+ }
+
+ /* 星期头部:字体缩小 */
+ .calendarTiming-calendar thead .fc-scrollgrid-sync-inner {
+ padding: 3px 0;
+ font-size: 0.75rem;
+ }
+
+ /* 星期名称:缩小 */
+ .fc-col-header-cell-cushion {
+ font-size: 0.7rem;
+ padding: 4px 2px;
+ }
+
+ /* 动画加速 - 移动端使用更快的动画 */
+ .slideLeftEnterActive,
+ .slideLeftExitActive,
+ .slideRightEnterActive,
+ .slideRightExitActive {
+ transition-duration: 200ms;
+ }
+
+ /* 减小滑动距离 */
+ .slideLeftEnter {
+ transform: translateX(30px);
+ }
+
+ .slideLeftExitActive {
+ transform: translateX(-30px);
+ }
+
+ .slideRightEnter {
+ transform: translateX(-30px);
+ }
+
+ .slideRightExitActive {
+ transform: translateX(30px);
+ }
+}
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/index.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
index 6061fee8..ca7af6d0 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
@@ -1,8 +1,7 @@
/**
* CalendarTiming 组件
*
- * 功能描述: 日历定时发布组件 - 显示日历视图或列表视图,管理发布任务
- * 重构说明: 已移除顶部header和toolbar,使用新的CalendarToolbar组件
+ * 功能描述: 日历定时发布组件 - 显示日历视图,管理发布任务
*/
import type { DatesSetArg } from '@fullcalendar/core'
@@ -30,7 +29,6 @@ import {
getTransitionClassNames,
} from '@/app/[lng]/accounts/components/CalendarTiming/calendarTiming.utils'
import CalendarToolbar from '@/app/[lng]/accounts/components/CalendarTiming/CalendarToolbar'
-import ListMode from '@/app/[lng]/accounts/components/CalendarTiming/ListMode'
import { useCalendarTiming } from '@/app/[lng]/accounts/components/CalendarTiming/useCalendarTiming'
import PublishDialog from '@/components/PublishDialog'
import { PublishDatePickerType } from '@/components/PublishDialog/compoents/PublishDatePicker/publishDatePicker.enums'
@@ -55,9 +53,7 @@ const CalendarTiming = memo(
'left',
)
const [currentDate, setCurrentDate] = useState<Date>(new Date())
- const [activeMode, setActiveMode] = useState<'calendar' | 'list'>(
- 'calendar',
- )
+
const handleDatesSet = (arg: DatesSetArg) => {
const date = calendarRef.current?.getApi().getDate()
if (date) {
@@ -79,14 +75,12 @@ const CalendarTiming = memo(
recordMap,
setCalendarRef,
getPubRecord,
- getQueueRecord,
} = useCalendarTiming(
useShallow(state => ({
setCalendarCallWidth: state.setCalendarCallWidth,
listLoading: state.listLoading,
recordMap: state.recordMap,
getPubRecord: state.getPubRecord,
- getQueueRecord: state.getQueueRecord,
setCalendarRef: state.setCalendarRef,
})),
)
@@ -95,12 +89,7 @@ const CalendarTiming = memo(
useEffect(() => {
setCalendarRef(calendarRef.current!)
window.addEventListener('resize', handleResize)
- if (activeMode === 'list') {
- getQueueRecord(0)
- }
- else {
- getPubRecord()
- }
+ getPubRecord()
setTimeout(() => {
handleResize()
@@ -147,18 +136,15 @@ const CalendarTiming = memo(
}, [])
useEffect(() => {
- if (activeMode === 'list') {
- getQueueRecord(0)
- }
- else {
- getPubRecord()
- }
- }, [accountActive, activeMode, getPubRecord, getQueueRecord])
+ getPubRecord()
+ }, [accountActive, getPubRecord])
// 处理窗口大小变化
const handleResize = () => {
setTimeout(() => {
- const el = document.querySelector('.calendarTimingItem--js')!
+ const el = document.querySelector('.calendarTimingItem--js')
+ if (!el) return
+
const style = window.getComputedStyle(el)
const paddingLeft = Number.parseFloat(style.paddingLeft)
const paddingRight = Number.parseFloat(style.paddingRight)
@@ -169,7 +155,9 @@ const CalendarTiming = memo(
// 动画触发函数
const triggerAnimation = (dir: 'left' | 'right' | 'fade') => {
- calendarTimingCalendarRef.current!.scrollTop = 0
+ if (calendarTimingCalendarRef.current) {
+ calendarTimingCalendarRef.current.scrollTop = 0
+ }
setDirection(dir)
setAnimating(true)
}
@@ -201,6 +189,36 @@ const CalendarTiming = memo(
}, 300)
}
+ // FullCalendar 内容(移动端不包裹 DndProvider)
+ const calendarContent = (
+ <FullCalendar
+ ref={calendarRef}
+ locale={getFullCalendarLang(lng)}
+ plugins={[dayGridPlugin]}
+ initialView="dayGridMonth"
+ initialDate={currentDate}
+ headerToolbar={false}
+ stickyFooterScrollbar={true}
+ dayCellContent={(arg) => {
+ const dateStr = getDays(arg.date).format('YYYY-MM-DD')
+ return (
+ <CalendarTimingItem
+ key={dateStr}
+ records={recordMap.get(dateStr)}
+ loading={listLoading}
+ arg={arg}
+ onClickPub={(date) => {
+ useUserStore.getState().setCurrentDatePickerType(PublishDatePickerType.DATE)
+ publishDialogRef.current!.setPubTime(date)
+ setPublishDialogOpen(true)
+ }}
+ />
+ )
+ }}
+ datesSet={handleDatesSet}
+ />
+ )
+
return (
<div className="flex flex-col flex-1 overflow-hidden">
<PublishDialog
@@ -214,70 +232,32 @@ const CalendarTiming = memo(
accounts={accountList}
/>
- {/* 日历工具栏 (Row 2) */}
+ {/* 日历工具栏 */}
<CalendarToolbar
- activeMode={activeMode}
- onModeChange={setActiveMode}
currentDate={currentDate}
onPrev={handlePrev}
onNext={handleNext}
onToday={handleToday}
/>
- {/* 主内容区域 - 日历或列表视图 */}
+ {/* 主内容区域 - 日历视图 */}
<div className="flex-1 overflow-hidden relative">
- {activeMode === 'calendar'
- ? (
- <CSSTransition
- in={!animating}
- timeout={300}
- classNames={getTransitionClassNames(direction)}
- unmountOnExit
- >
- <div
- className="calendarTiming-calendar overflow-hidden"
- id="calendarTiming-calendar"
- ref={calendarTimingCalendarRef}
- >
- <DndProvider backend={HTML5Backend}>
- <FullCalendar
- ref={calendarRef}
- locale={getFullCalendarLang(lng)}
- plugins={[dayGridPlugin]}
- initialView="dayGridMonth"
- initialDate={currentDate}
- headerToolbar={false}
- stickyFooterScrollbar={true}
- dayCellContent={(arg) => {
- const dateStr = getDays(arg.date).format('YYYY-MM-DD')
- return (
- <CalendarTimingItem
- key={dateStr}
- records={recordMap.get(dateStr)}
- loading={listLoading}
- arg={arg}
- onClickPub={(date) => {
- useUserStore.getState().setCurrentDatePickerType(PublishDatePickerType.DATE)
- publishDialogRef.current!.setPubTime(date)
- setPublishDialogOpen(true)
- }}
- />
- )
- }}
- datesSet={handleDatesSet}
- />
- </DndProvider>
- </div>
- </CSSTransition>
- )
- : (
- <ListMode
- onClickPub={(date) => {
- publishDialogRef.current!.setPubTime(date)
- setPublishDialogOpen(true)
- }}
- />
- )}
+ <CSSTransition
+ in={!animating}
+ timeout={300}
+ classNames={getTransitionClassNames(direction)}
+ unmountOnExit
+ >
+ <div
+ className="calendarTiming-calendar overflow-hidden"
+ id="calendarTiming-calendar"
+ ref={calendarTimingCalendarRef}
+ >
+ <DndProvider backend={HTML5Backend}>
+ {calendarContent}
+ </DndProvider>
+ </div>
+ </CSSTransition>
</div>
</div>
)
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/useCalendarTiming.ts b/project/web/src/app/[lng]/accounts/components/CalendarTiming/useCalendarTiming.ts
index 3c9830df..c6279b77 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/useCalendarTiming.ts
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTiming/useCalendarTiming.ts
@@ -3,7 +3,7 @@ import type { PublishRecordItem } from '@/api/plat/types/publish.types'
import lodash from 'lodash'
import { create } from 'zustand'
import { combine } from 'zustand/middleware'
-import { getPublishList, getPublishQueue, getPublishRecordDetail } from '@/api/plat/publish'
+import { getPublishList, getPublishRecordDetail } from '@/api/plat/publish'
import { getDays } from '@/app/[lng]/accounts/components/CalendarTiming/calendarTiming.utils'
import { useAccountStore } from '@/store/account'
@@ -117,45 +117,6 @@ export const useCalendarTiming = create(
}
},
- // 获取列表模式队列数据(不依赖日历可视范围)
- async getQueueRecord(status?: number) {
- try {
- methods.setListLoading(true)
- const res = await getPublishQueue({
- accountType: useAccountStore.getState().accountActive?.type,
- status,
- publishingChannel: 'internal',
- })
- methods.setListLoading(false)
-
- if (!res || !res.data || !Array.isArray(res.data)) {
- console.warn('获取发布队列数据失败或数据格式不正确:', res)
- methods.setRecordMap(new Map())
- return
- }
-
- const recordMap = new Map<string, PublishRecordItem[]>()
- res.data.forEach((v) => {
- const days = getDays(v.publishTime)
- const timeStr = days.format('YYYY-MM-DD')
- let list = recordMap.get(timeStr)
- if (!list) {
- list = []
- recordMap.set(timeStr, list)
- }
- list.push(v)
- })
- methods.setRecordMap(recordMap)
- // 获取完数据后,启动轮询检查
- methods.queryPubTask()
- }
- catch (error) {
- console.error('获取发布队列时发生错误:', error)
- methods.setListLoading(false)
- methods.setRecordMap(new Map())
- }
- },
-
// 查询列表是否有在发布中的数据,如果有则轮询查询详情,直到状态不为发布中
async queryPubTask() {
if (get().polling) {
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/components/CalendarRecord.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/components/CalendarRecord.tsx
index c21c0909..cb5c4861 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/components/CalendarRecord.tsx
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/components/CalendarRecord.tsx
@@ -1,3 +1,9 @@
+/**
+ * CalendarRecord 组件
+ *
+ * 功能描述: 可拖拽的发布记录组件(桌面端支持拖拽,移动端禁用)
+ */
+
import type { ForwardedRef } from 'react'
import type { DragSourceMonitor } from 'react-dnd'
import type {
@@ -17,6 +23,7 @@ import {
getUtcDays,
} from '@/app/[lng]/accounts/components/CalendarTiming/calendarTiming.utils'
import { useCalendarTiming } from '@/app/[lng]/accounts/components/CalendarTiming/useCalendarTiming'
+import { useIsMobile } from '@/hooks/useIsMobile'
import RecordCore from './RecordCore'
export interface ICalendarRecordRef {}
@@ -31,6 +38,7 @@ const CalendarRecord = memo(
{ publishRecord }: ICalendarRecordProps,
ref: ForwardedRef<ICalendarRecordRef>,
) => {
+ const isMobile = useIsMobile()
const { setRecordMap, recordMap } = useCalendarTiming(
useShallow(state => ({
setRecordMap: state.setRecordMap,
@@ -39,7 +47,9 @@ const CalendarRecord = memo(
)
const [{ opacity }, drag, preview] = useDrag(
() => ({
- type: 'box',
+ // 移动端禁用拖拽
+ type: isMobile ? 'none' : 'box',
+ canDrag: !isMobile,
item: { publishRecord },
end(item, monitor) {
const dropResult: any = monitor.getDropResult()
@@ -101,22 +111,26 @@ const CalendarRecord = memo(
opacity: monitor.isDragging() ? 0 : 1,
}),
}),
- [recordMap],
+ [recordMap, isMobile],
)
useEffect(() => {
- preview(getEmptyImage(), { captureDraggingState: true })
- }, [])
+ // 移动端不需要设置空图片预览
+ if (!isMobile) {
+ preview(getEmptyImage(), { captureDraggingState: true })
+ }
+ }, [isMobile, preview])
return (
<div
style={{ opacity }}
ref={(node) => {
- if (publishRecord.status === PublishStatus.UNPUBLISH) {
+ // 只在桌面端且未发布状态启用拖拽
+ if (!isMobile && publishRecord.status === PublishStatus.UNPUBLISH) {
drag(node)
}
}}
- role="DraggableBox"
+ role={isMobile ? 'button' : 'DraggableBox'}
>
<RecordCore publishRecord={publishRecord} />
</div>
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/components/RecordCore.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/components/RecordCore.tsx
index d126fe46..a398027d 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/components/RecordCore.tsx
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/components/RecordCore.tsx
@@ -1,3 +1,11 @@
+/**
+ * RecordCore 组件
+ *
+ * 功能描述: 发布记录详情组件
+ * - 桌面端:使用 Popover 显示详情
+ * - 移动端:使用全屏 Dialog 显示详情
+ */
+
import type {
ForwardedRef,
} from 'react'
@@ -12,11 +20,11 @@ import {
Eye,
Heart,
Loader2,
- Maximize2,
MessageCircle,
MoreVertical,
Send,
Share2,
+ X,
XCircle,
} from 'lucide-react'
import {
@@ -40,6 +48,11 @@ import { MediaPreview } from '@/components/common/MediaPreview'
import ScrollButtonContainer from '@/components/ScrollButtonContainer'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
+import {
+ Dialog,
+ DialogContent,
+ DialogTitle,
+} from '@/components/ui/dialog'
import {
DropdownMenu,
DropdownMenuContent,
@@ -51,6 +64,7 @@ import {
PopoverContent,
PopoverTrigger,
} from '@/components/ui/popover'
+import { useIsMobile } from '@/hooks/useIsMobile'
import { cn } from '@/lib/utils'
import { useAccountStore } from '@/store/account'
import { getOssUrl } from '@/utils/oss'
@@ -61,6 +75,7 @@ export interface IRecordCoreProps {
publishRecord: PublishRecordItem
}
+// 发布状态组件
function PubStatus({ status }: { status: PublishStatus }) {
const { t } = useTransClient('publish')
@@ -107,6 +122,7 @@ const RecordCore = memo(
{ publishRecord }: IRecordCoreProps,
ref: ForwardedRef<IRecordCoreRef>,
) => {
+ const isMobile = useIsMobile()
const { calendarCallWidth, setListLoading, getPubRecord } = useCalendarTiming(
useShallow(state => ({
calendarCallWidth: state.calendarCallWidth,
@@ -126,13 +142,9 @@ const RecordCore = memo(
const [mediaPreviewIndex, setMediaPreviewIndex] = useState(0)
/**
- * 删除按钮显示逻辑:
- * 1. 未发布的、发布失败的,直接显示删除按钮。
- * 2. 已发布的,除了小红书、抖音、视频号、ins、tiktok之外,其他平台均显示删除按钮。
- * 注意:Facebook 只有post类型显示删除按钮。
+ * 删除按钮显示逻辑
*/
const shouldShowDelete = useMemo(() => {
- // 规则1:未发布或发布失败的,显示删除按钮
if (
publishRecord.status === PublishStatus.UNPUBLISH
|| publishRecord.status === PublishStatus.FAIL
@@ -140,33 +152,26 @@ const RecordCore = memo(
return true
}
- // 规则2:已发布的,根据平台判断
if (publishRecord.status === PublishStatus.RELEASED) {
- // 不允许删除的平台列表
const noDeletablePlats = [
- PlatType.Xhs, // 小红书
- PlatType.Douyin, // 抖音
- PlatType.WxSph, // 视频号
- PlatType.Instagram, // ins
- PlatType.Tiktok, // tiktok
+ PlatType.Xhs,
+ PlatType.Douyin,
+ PlatType.WxSph,
+ PlatType.Instagram,
+ PlatType.Tiktok,
]
- // 如果是不允许删除的平台,不显示删除按钮
if (noDeletablePlats.includes(publishRecord.accountType)) {
return false
}
- // Facebook特殊处理:post类型不显示删除按钮
if (publishRecord.accountType === PlatType.Facebook) {
- // 如果是post类型,不显示删除按钮
return publishRecord.option?.facebook?.content_category === 'post'
}
- // 其他已发布的平台,显示删除按钮
return true
}
- // 发布中的状态,不显示删除按钮
return false
}, [publishRecord])
@@ -184,11 +189,6 @@ const RecordCore = memo(
)?.icon
}, [publishRecord])
- /**
- * 根据 clientType 获取显示的标签文本
- * @param clientType 客户端类型(web/app)
- * @returns 标签显示文本
- */
const getClientTypeLabel = (clientType?: ClientType) => {
if (!clientType)
return null
@@ -205,22 +205,22 @@ const RecordCore = memo(
return [
{
label: t('record.metrics.views'),
- icon: <Eye className="h-4 w-4" />,
+ icon: <Eye className="h-3.5 w-3.5 md:h-4 md:w-4" />,
key: 'viewCount',
},
{
label: t('record.metrics.comments'),
- icon: <MessageCircle className="h-4 w-4" />,
+ icon: <MessageCircle className="h-3.5 w-3.5 md:h-4 md:w-4" />,
key: 'commentCount',
},
{
label: t('record.metrics.likes'),
- icon: <Heart className="h-4 w-4" />,
+ icon: <Heart className="h-3.5 w-3.5 md:h-4 md:w-4" />,
key: 'likeCount',
},
{
label: t('record.metrics.shares'),
- icon: <Share2 className="h-4 w-4" />,
+ icon: <Share2 className="h-3.5 w-3.5 md:h-4 md:w-4" />,
key: 'shareCount',
},
]
@@ -230,11 +230,9 @@ const RecordCore = memo(
return `${publishRecord.desc} ${publishRecord.topics ? publishRecord.topics?.map(v => `#${v}`).join(' ') : ''}`
}, [publishRecord])
- // 构建媒体预览 items
const mediaPreviewItems = useMemo(() => {
const items: Array<{ type: 'image' | 'video', src: string }> = []
- // 如果有视频,添加视频
if (publishRecord.videoUrl) {
items.push({
type: 'video',
@@ -242,7 +240,6 @@ const RecordCore = memo(
})
}
- // 如果有图片列表,添加所有图片
if (publishRecord.imgUrlList && publishRecord.imgUrlList.length > 0) {
publishRecord.imgUrlList.forEach((imgUrl) => {
items.push({
@@ -252,7 +249,6 @@ const RecordCore = memo(
})
}
- // 如果只有封面图,也添加封面图
if (items.length === 0 && publishRecord.coverUrl) {
items.push({
type: 'image',
@@ -263,9 +259,8 @@ const RecordCore = memo(
return items
}, [publishRecord])
- // 处理封面点击
const handleCoverClick = (e: React.MouseEvent) => {
- e.stopPropagation() // 阻止事件冒泡,防止 Popover 关闭
+ e.stopPropagation()
e.preventDefault()
if (mediaPreviewItems.length > 0) {
setMediaPreviewIndex(0)
@@ -273,249 +268,317 @@ const RecordCore = memo(
}
}
- // 阻止鼠标按下事件冒泡
const handleCoverMouseDown = (e: React.MouseEvent) => {
- e.stopPropagation() // 阻止事件冒泡,防止 Popover 关闭
+ e.stopPropagation()
}
- return (
- <>
- <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
- <PopoverTrigger asChild>
+ // 触发按钮
+ const TriggerButton = (
+ <Button
+ variant="outline"
+ className={cn(
+ 'flex justify-between items-center box-border px-1 md:px-1.5 w-full h-auto py-1 md:py-1.5',
+ 'bg-card hover:bg-accent border-border',
+ 'rounded-md transition-colors',
+ 'text-foreground font-normal',
+ 'shadow-none cursor-pointer',
+ )}
+ style={{ width: isMobile ? '100%' : `${calendarCallWidth}px` }}
+ >
+ <div className="flex items-center gap-1 md:gap-1.5">
+ <img
+ src={platIcon}
+ className="w-5 h-5 md:w-[25px] md:h-[25px]"
+ alt="platform"
+ />
+ <div className="font-semibold text-xs md:text-sm">{days.format('HH:mm')}</div>
+ </div>
+ {publishRecord.coverUrl && (
+ <div className="flex items-center">
+ <img
+ src={getOssUrl(publishRecord.coverUrl || '')}
+ className="w-5 h-5 md:w-6 md:h-6 rounded object-cover"
+ alt="cover"
+ />
+ </div>
+ )}
+ </Button>
+ )
+
+ // 详情内容(复用于 Popover 和 Dialog)
+ const RecordContent = ({ inDialog = false }: { inDialog?: boolean }) => (
+ <div className={cn('w-full box-border', inDialog && 'flex flex-col h-full')} onMouseDown={e => e.stopPropagation()}>
+ {/* 顶部:时间 */}
+ <div className={cn(
+ 'flex justify-between items-center border-b border-border p-2.5 md:p-3',
+ inDialog && 'shrink-0',
+ )}
+ >
+ <div className="font-semibold flex items-center gap-2 text-sm md:text-base">
+ {days.format('YYYY-MM-DD HH:mm')}
+ <Calendar className="h-3.5 w-3.5 md:h-4 md:w-4" />
+ </div>
+ {inDialog && (
<Button
- variant="outline"
- className={cn(
- 'flex justify-between items-center box-border px-1.5 w-full h-auto py-1.5',
- 'bg-card hover:bg-accent border-border',
- 'rounded-md transition-colors',
- 'text-foreground font-normal',
- 'shadow-none',
+ variant="ghost"
+ size="icon"
+ className="h-7 w-7 cursor-pointer"
+ onClick={() => setPopoverOpen(false)}
+ >
+ <X className="h-4 w-4" />
+ </Button>
+ )}
+ </div>
+
+ {/* 中间:用户信息和内容 */}
+ <div className={cn(
+ 'flex flex-col md:flex-row justify-between gap-3 border-b border-border p-2.5 md:p-3',
+ inDialog && 'flex-1 overflow-auto',
+ )}
+ >
+ <div className="flex-1 min-h-[120px] md:min-h-[150px]">
+ <div className="flex items-center mb-2 md:mb-3">
+ <AvatarPlat account={account} size={isMobile ? 'default' : 'large'} />
+ <span className="ml-2 md:ml-2.5 inline-block font-bold text-sm md:text-base">
+ {account?.nickname}
+ </span>
+ {account?.clientType && (
+ <span
+ className={cn(
+ 'inline-block px-1.5 py-0.5 rounded text-[10px] md:text-[11px] font-medium ml-2',
+ account.clientType === 'web'
+ ? 'bg-blue-50 text-blue-600 border border-blue-200 dark:bg-blue-900 dark:text-blue-200 dark:border-blue-700'
+ : 'bg-green-50 text-green-600 border border-green-200 dark:bg-green-900 dark:text-green-200 dark:border-green-700',
+ )}
+ >
+ {getClientTypeLabel(account.clientType)}
+ </span>
+ )}
+ </div>
+ <div
+ title={desc}
+ className="line-clamp-3 md:line-clamp-2 overflow-hidden text-ellipsis mt-2 md:mt-2.5 pr-0 md:pr-2.5 text-sm md:text-base"
+ >
+ {desc}
+ </div>
+ <div className="mt-3 md:mt-4">
+ {publishRecord && (
+ <PubStatus status={publishRecord.status} />
)}
- style={{ width: `${calendarCallWidth}px` }}
+ </div>
+ {publishRecord.errorMsg && (
+ <div
+ title={publishRecord.errorMsg}
+ className="mt-1 text-xs text-destructive"
+ >
+ {publishRecord.errorMsg}
+ </div>
+ )}
+ </div>
+
+ {/* 媒体预览 */}
+ {mediaPreviewItems.length > 0 && (
+ <div
+ className={cn('shrink-0', isMobile ? 'w-full' : '')}
+ onClick={e => e.stopPropagation()}
+ onMouseDown={e => e.stopPropagation()}
>
- <div className="flex items-center gap-1.5">
+ <div
+ data-cover-preview
+ onClick={(e) => {
+ e.stopPropagation()
+ e.preventDefault()
+ handleCoverClick(e)
+ }}
+ onMouseDown={(e) => {
+ e.stopPropagation()
+ handleCoverMouseDown(e)
+ }}
+ className={cn(
+ 'rounded-md overflow-hidden cursor-pointer hover:opacity-90 transition-opacity border border-border',
+ isMobile ? 'w-full h-48' : 'w-[145px] h-[145px]',
+ )}
+ >
<img
- src={platIcon}
- className="w-[25px] h-[25px]"
- alt="platform"
+ src={getOssUrl(publishRecord.coverUrl || publishRecord.imgUrlList?.[0] || '')}
+ className="w-full h-full object-cover pointer-events-none"
+ alt="cover"
/>
- <div className="font-semibold text-sm">{days.format('HH:mm')}</div>
- </div>
- {publishRecord.coverUrl && (
- <div className="flex items-center">
- <img
- src={getOssUrl(publishRecord.coverUrl || '')}
- className="w-6 h-6 rounded object-cover"
- alt="cover"
- />
- </div>
- )}
- </Button>
- </PopoverTrigger>
- <PopoverContent
- side="right"
- className="w-[450px] p-0"
- align="start"
- onInteractOutside={(e) => {
- // MediaPreview 打开时,完全阻止 Popover 关闭
- if (mediaPreviewOpen) {
- e.preventDefault()
- return
- }
- // 如果点击的是封面区域,阻止 Popover 关闭
- const target = e.target as HTMLElement
- if (target.closest('[data-cover-preview]')) {
- e.preventDefault()
- }
- }}
- onPointerDownOutside={(e) => {
- // MediaPreview 打开时,完全阻止 Popover 关闭
- if (mediaPreviewOpen) {
- e.preventDefault()
- return
- }
- // 如果点击的是封面区域,阻止 Popover 关闭
- const target = e.target as HTMLElement
- if (target.closest('[data-cover-preview]')) {
- e.preventDefault()
- }
- }}
- >
- <div className="w-full box-border" onMouseDown={e => e.stopPropagation()}>
- {/* 顶部:时间和全屏按钮 */}
- <div className="flex justify-between items-center border-b border-border p-3">
- <div className="font-semibold flex items-center gap-2">
- {days.format('YYYY-MM-DD HH:mm')}
- <Calendar className="h-4 w-4" />
- </div>
</div>
-
- {/* 中间:用户信息和内容 */}
- <div className="flex justify-between gap-3 border-b border-border p-3">
- <div className="flex-1 min-h-[150px]">
- <div className="flex items-center mb-3">
- <AvatarPlat account={account} size="large" />
- <span className="ml-2.5 inline-block font-bold">
- {account?.nickname}
- </span>
- {account?.clientType && (
- <span
- className={cn(
- 'inline-block px-1.5 py-0.5 rounded text-[11px] font-medium ml-2',
- account.clientType === 'web'
- ? 'bg-blue-50 text-blue-600 border border-blue-200 dark:bg-blue-900 dark:text-blue-200 dark:border-blue-700'
- : 'bg-green-50 text-green-600 border border-green-200 dark:bg-green-900 dark:text-green-200 dark:border-green-700',
- )}
- >
- {getClientTypeLabel(account.clientType)}
- </span>
- )}
- </div>
- <div
- title={desc}
- className="line-clamp-2 overflow-hidden text-ellipsis mt-2.5 pr-2.5"
- >
- {desc}
- </div>
- <div className="mt-4">
- {publishRecord && (
- <PubStatus status={publishRecord.status} />
- )}
- </div>
- {publishRecord.errorMsg && (
- <div
- title={publishRecord.errorMsg}
- className="mt-1 text-xs text-destructive"
- >
- {publishRecord.errorMsg}
- </div>
- )}
+ </div>
+ )}
+ </div>
+
+ {/* 信息指标 */}
+ <ScrollButtonContainer>
+ <div className="flex gap-3 md:gap-4 p-2 md:p-2.5 border-b border-border overflow-x-auto">
+ {recordInfo.map(v => (
+ <div key={v.label} className="flex-shrink-0 md:flex-1 min-w-[60px] md:min-w-0">
+ <div className="flex items-center gap-1 md:gap-1.5">
+ {v.icon}
+ <span className="text-xs text-muted-foreground whitespace-nowrap">{v.label}</span>
</div>
- {mediaPreviewItems.length > 0 && (
- <div className="shrink-0" onClick={e => e.stopPropagation()} onMouseDown={e => e.stopPropagation()}>
- <div
- data-cover-preview
- onClick={(e) => {
- e.stopPropagation()
- e.preventDefault()
- handleCoverClick(e)
- }}
- onMouseDown={(e) => {
- e.stopPropagation()
- handleCoverMouseDown(e)
- }}
- className="w-[145px] h-[145px] rounded-md overflow-hidden cursor-pointer hover:opacity-90 transition-opacity border border-border"
- >
- <img
- src={getOssUrl(publishRecord.coverUrl || publishRecord.imgUrlList?.[0] || '')}
- className="w-full h-full object-cover pointer-events-none"
- alt="cover"
- />
- </div>
+ {publishRecord.engagement && (
+ <div className="text-sm md:text-base font-semibold mt-0.5 md:mt-1">
+ {publishRecord.engagement[v.key as 'viewCount'] ?? 0}
</div>
)}
</div>
+ ))}
+ </div>
+ </ScrollButtonContainer>
+
+ {/* 底部:操作按钮 */}
+ <div className={cn(
+ 'flex gap-2 md:gap-2.5 p-2.5 md:p-3',
+ isMobile ? 'flex-col' : 'flex-row justify-end',
+ inDialog && 'shrink-0',
+ )}
+ >
+ {publishRecord.workLink && (
+ <Button
+ className={cn('cursor-pointer', isMobile && 'w-full')}
+ onClick={() => {
+ window.open(publishRecord.workLink, '_blank')
+ }}
+ >
+ <ExternalLink className="h-4 w-4 mr-2" />
+ {t('record.viewWork')}
+ </Button>
+ )}
- {/* 信息指标 */}
- <ScrollButtonContainer>
- <div className="flex gap-4 p-2.5 border-b border-border">
- {recordInfo.map(v => (
- <div key={v.label} className="flex-1">
- <div className="flex items-center gap-1.5">
- {v.icon}
- <span className="text-xs text-muted-foreground">{v.label}</span>
- </div>
- {publishRecord.engagement && (
- <div className="text-base font-semibold mt-1">
- {publishRecord.engagement[v.key as 'viewCount'] ?? 0}
- </div>
+ {publishRecord.status !== PublishStatus.RELEASED
+ && publishRecord.status !== PublishStatus.PUB_LOADING
+ ? (
+ <Button
+ className={cn('cursor-pointer', isMobile && 'w-full')}
+ disabled={nowPubLoading}
+ onClick={async () => {
+ setNowPubLoading(true)
+ await nowPubTaskApi(publishRecord.id)
+ getPubRecord()
+ setNowPubLoading(false)
+ }}
+ >
+ {nowPubLoading
+ ? (
+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />
+ )
+ : (
+ <Send className="mr-2 h-4 w-4" />
)}
- </div>
- ))}
- </div>
- </ScrollButtonContainer>
-
- {/* 底部:操作按钮 */}
- <div className="flex justify-end gap-2.5 p-3">
+ {t('buttons.publishNow')}
+ </Button>
+ )
+ : null}
+
+ {(publishRecord.workLink || shouldShowDelete) && (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="outline" size="icon" className={cn('cursor-pointer', isMobile && 'w-full')}>
+ <MoreVertical className="h-4 w-4" />
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
{publishRecord.workLink && (
- <Button
- onClick={() => {
- window.open(publishRecord.workLink, '_blank')
+ <DropdownMenuItem
+ onClick={async () => {
+ await navigator.clipboard.writeText(
+ publishRecord?.workLink ?? '',
+ )
}}
>
- <ExternalLink className="h-4 w-4" />
- {t('record.viewWork')}
- </Button>
+ {t('buttons.copyLink')}
+ </DropdownMenuItem>
)}
-
- {publishRecord.status !== PublishStatus.RELEASED
- && publishRecord.status !== PublishStatus.PUB_LOADING
- ? (
- <Button
- disabled={nowPubLoading}
- onClick={async () => {
- setNowPubLoading(true)
- await nowPubTaskApi(publishRecord.id)
- getPubRecord()
- setNowPubLoading(false)
- }}
- >
- {nowPubLoading ? (
- <Loader2 className="mr-2 h-4 w-4 animate-spin" />
- ) : (
- <Send className="mr-2 h-4 w-4" />
- )}
- {t('buttons.publishNow')}
- </Button>
- )
- : null}
-
- {(publishRecord.workLink || shouldShowDelete) && (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="outline" size="icon">
- <MoreVertical className="h-4 w-4" />
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- {publishRecord.workLink && (
- <DropdownMenuItem
- onClick={async () => {
- await navigator.clipboard.writeText(
- publishRecord?.workLink ?? '',
- )
- }}
- >
- {t('buttons.copyLink')}
- </DropdownMenuItem>
- )}
- {shouldShowDelete && (
- <DropdownMenuItem
- className="text-destructive focus:text-destructive"
- onClick={async () => {
- setPopoverOpen(false)
- setListLoading(true)
- if (publishRecord.status === PublishStatus.RELEASED) {
- const res = await deletePlatWorkApi(publishRecord.accountId!, publishRecord.dataId)
- if (!res) {
- setListLoading(false)
- return
- }
- }
- await deletePublishRecordApi(publishRecord.id)
- getPubRecord()
- }}
- >
- {t('buttons.delete')}
- </DropdownMenuItem>
- )}
- </DropdownMenuContent>
- </DropdownMenu>
+ {shouldShowDelete && (
+ <DropdownMenuItem
+ className="text-destructive focus:text-destructive"
+ onClick={async () => {
+ setPopoverOpen(false)
+ setListLoading(true)
+ if (publishRecord.status === PublishStatus.RELEASED) {
+ const res = await deletePlatWorkApi(publishRecord.accountId!, publishRecord.dataId)
+ if (!res) {
+ setListLoading(false)
+ return
+ }
+ }
+ await deletePublishRecordApi(publishRecord.id)
+ getPubRecord()
+ }}
+ >
+ {t('buttons.delete')}
+ </DropdownMenuItem>
)}
- </div>
- </div>
- </PopoverContent>
- </Popover>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )}
+ </div>
+ </div>
+ )
+
+ return (
+ <>
+ {isMobile
+ ? (
+ // 移动端:全屏 Dialog
+ <>
+ <div onClick={() => setPopoverOpen(true)}>
+ {TriggerButton}
+ </div>
+ <Dialog open={popoverOpen} onOpenChange={setPopoverOpen}>
+ <DialogContent
+ className="w-[calc(100%-24px)] h-[85vh] max-w-full p-0 flex flex-col overflow-hidden"
+ onInteractOutside={(e) => {
+ if (mediaPreviewOpen) {
+ e.preventDefault()
+ }
+ }}
+ >
+ <DialogTitle className="sr-only">
+ {days.format('YYYY-MM-DD HH:mm')}
+ </DialogTitle>
+ <RecordContent inDialog />
+ </DialogContent>
+ </Dialog>
+ </>
+ )
+ : (
+ // 桌面端:Popover
+ <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
+ <PopoverTrigger asChild>
+ {TriggerButton}
+ </PopoverTrigger>
+ <PopoverContent
+ side="right"
+ className="w-[450px] p-0"
+ align="start"
+ onInteractOutside={(e) => {
+ if (mediaPreviewOpen) {
+ e.preventDefault()
+ return
+ }
+ const target = e.target as HTMLElement
+ if (target.closest('[data-cover-preview]')) {
+ e.preventDefault()
+ }
+ }}
+ onPointerDownOutside={(e) => {
+ if (mediaPreviewOpen) {
+ e.preventDefault()
+ return
+ }
+ const target = e.target as HTMLElement
+ if (target.closest('[data-cover-preview]')) {
+ e.preventDefault()
+ }
+ }}
+ >
+ <RecordContent />
+ </PopoverContent>
+ </Popover>
+ )}
{/* 媒体预览 */}
<MediaPreview
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/index.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/index.tsx
index 3189a798..1b92631e 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/index.tsx
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTimingItem/index.tsx
@@ -1,3 +1,9 @@
+/**
+ * CalendarTimingItem 组件
+ *
+ * 功能描述: 日历单元格组件 - 显示日期和发布记录
+ */
+
import type { DayCellContentArg } from '@fullcalendar/core'
import type { ForwardedRef } from 'react'
import type { PublishRecordItem } from '@/api/plat/types/publish.types'
@@ -10,6 +16,7 @@ import { useCalendarTiming } from '@/app/[lng]/accounts/components/CalendarTimin
import { useTransClient } from '@/app/i18n/client'
import { Button } from '@/components/ui/button'
import { Skeleton } from '@/components/ui/skeleton'
+import { useIsMobile } from '@/hooks/useIsMobile'
import { cn } from '@/lib/utils'
import CalendarRecord from './components/CalendarRecord'
import { CustomDragLayer } from './components/CustomDragLayer'
@@ -31,12 +38,11 @@ const CalendarTimingItem = memo(
ref: ForwardedRef<ICalendarTimingItemRef>,
) => {
const { t } = useTransClient('account')
+ const isMobile = useIsMobile()
+
// arg.date 是当前格子的日期,Date 类型
const today = new Date()
- // 🔧 测试模式:模拟今天是1号(取消注释下面一行来测试)
- // today.setDate(30);
-
// 去掉时分秒,只比较年月日
const argDate = new Date(
arg.date.getFullYear(),
@@ -48,11 +54,13 @@ const CalendarTimingItem = memo(
today.getMonth(),
today.getDate(),
)
+
// [[小时,分钟]] [[4, 12]]
const [reservationsTimes, setReservationsTimes] = useState([])
const [{ canDrop, isOver }, drop] = useDrop(
() => ({
- accept: 'box',
+ // 移动端禁用拖拽
+ accept: isMobile ? 'none' : 'box',
drop: () => ({
time: arg,
}),
@@ -61,7 +69,7 @@ const CalendarTimingItem = memo(
canDrop: monitor.canDrop(),
}),
}),
- [],
+ [isMobile],
)
const [isMore, setIsMore] = useState(false)
const cellRef = useRef<HTMLDivElement | null>(null)
@@ -75,6 +83,9 @@ const CalendarTimingItem = memo(
return argDate >= nowDate ? reservationsTimes : []
}, [reservationsTimes])
+ // 移动端默认显示更少的记录
+ const maxRecords = isMobile ? 2 : 3
+
const recordsLast = useMemo(() => {
if (!records)
return []
@@ -82,9 +93,9 @@ const CalendarTimingItem = memo(
return records
}
else {
- return records?.slice(0, 3 - reservationsTimesLast.length)
+ return records?.slice(0, maxRecords - reservationsTimesLast.length)
}
- }, [isMore, records, reservationsTimesLast, recordMap])
+ }, [isMore, records, reservationsTimesLast, recordMap, maxRecords])
// 进入视图时将"今天"尽量居中显示(仅在日历容器内滚动)
useEffect(() => {
@@ -106,35 +117,42 @@ const CalendarTimingItem = memo(
return (
<div
ref={(node) => {
- if (argDate >= nowDate) {
+ // 移动端不启用 drop
+ if (!isMobile && argDate >= nowDate) {
drop(node)
}
cellRef.current = node
}}
className={cn(
'calendarTimingItem--js',
- 'box-border p-2.5 flex flex-col font-semibold min-h-[200px] h-full group',
+ 'box-border p-1.5 md:p-2.5 flex flex-col font-semibold',
+ 'min-h-[120px] md:min-h-[200px] h-full group',
'transition-colors',
argDate < nowDate && 'bg-muted/30',
- isOver && 'bg-accent/50',
+ // 只在桌面端显示拖拽高亮
+ !isMobile && isOver && 'bg-accent/50',
)}
>
{/* 顶部:日期和添加按钮 */}
- <div className="flex justify-between items-center mb-1.5 group/top">
+ <div className="flex justify-between items-center mb-1 md:mb-1.5 group/top">
<div
className={cn(
- 'w-6 h-6 leading-6 text-center rounded-full text-sm font-semibold',
+ 'w-5 h-5 md:w-6 md:h-6 leading-5 md:leading-6 text-center rounded-full text-xs md:text-sm font-semibold',
argDate.getTime() === nowDate.getTime() && 'bg-(--primary-color) text-white',
)}
>
{arg.date.getDate()}
</div>
+ {/* 添加按钮:移动端始终可见,桌面端 hover 显示 */}
{argDate >= nowDate && (
<Button
size="sm"
variant="ghost"
- className="h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"
+ className={cn(
+ 'h-5 w-5 md:h-6 md:w-6 p-0 cursor-pointer',
+ 'md:opacity-0 md:group-hover:opacity-100 transition-opacity',
+ )}
onClick={() => {
const days = dayjs(arg.date)
const today = dayjs()
@@ -147,7 +165,7 @@ const CalendarTimingItem = memo(
}
}}
>
- <Plus className="h-3.5 w-3.5" />
+ <Plus className="h-3 w-3 md:h-3.5 md:w-3.5" />
</Button>
)}
</div>
@@ -155,12 +173,12 @@ const CalendarTimingItem = memo(
{/* 内容区域 */}
{loading
? (
- <div className="flex flex-col gap-2">
- <Skeleton className="h-[34px] w-full rounded-md" />
+ <div className="flex flex-col gap-1.5 md:gap-2">
+ <Skeleton className="h-[28px] md:h-[34px] w-full rounded-md" />
</div>
)
: (
- <div className="flex flex-col gap-2">
+ <div className="flex flex-col gap-1.5 md:gap-2">
{/* 预约时间按钮 */}
{argDate >= nowDate
&& reservationsTimesLast.map((v, i) => {
@@ -169,7 +187,7 @@ const CalendarTimingItem = memo(
key={i}
size="sm"
variant="outline"
- className="w-full h-[34px] text-xs group/btn relative overflow-hidden"
+ className="w-full h-[28px] md:h-[34px] text-xs group/btn relative overflow-hidden cursor-pointer"
onClick={() => {
const days = dayjs(arg.date)
.set('hour', v[0])
@@ -196,17 +214,18 @@ const CalendarTimingItem = memo(
&& recordsLast.map((v) => {
return (
<div key={v.id + v.title + v.uid + v.updatedAt}>
- <CustomDragLayer publishRecord={v} snapToGrid={false} />
+ {/* 移动端不显示拖拽层 */}
+ {!isMobile && <CustomDragLayer publishRecord={v} snapToGrid={false} />}
<CalendarRecord publishRecord={v} />
</div>
)
})}
{/* 显示更多/收起按钮 */}
- {records && records.length > 3 - reservationsTimesLast.length && (
+ {records && records.length > maxRecords - reservationsTimesLast.length && (
<Button
variant="ghost"
- className="w-full h-auto py-2 px-3 text-sm text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors justify-start"
+ className="w-full h-auto py-1.5 md:py-2 px-2 md:px-3 text-xs md:text-sm text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors justify-start cursor-pointer"
onClick={() => {
setIsMore(!isMore)
}}
@@ -214,13 +233,13 @@ const CalendarTimingItem = memo(
{isMore
? (
<>
- <ChevronUp className="mr-2 h-4 w-4" />
+ <ChevronUp className="mr-1.5 md:mr-2 h-3.5 w-3.5 md:h-4 md:w-4" />
{t('calendar.hideMore')}
</>
)
: (
<>
- <ChevronDown className="mr-2 h-4 w-4" />
+ <ChevronDown className="mr-1.5 md:mr-2 h-3.5 w-3.5 md:h-4 md:w-4" />
{records.length - recordsLast?.length}
{' '}
{t('calendar.showMore')}
diff --git a/project/web/src/app/[lng]/accounts/plat/kwaiLogin.ts b/project/web/src/app/[lng]/accounts/plat/kwaiLogin.ts
index f4bb55aa..731f1856 100644
--- a/project/web/src/app/[lng]/accounts/plat/kwaiLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/kwaiLogin.ts
@@ -29,11 +29,11 @@ export async function kwaiSkip(platType: PlatType, spaceId?: string): Promise<an
const autoStatusRes = await getKwaiAuthStatus(res.data.taskId)
if (!autoStatusRes?.data) {
- reject(new Error('no status data'))
+ resolve(autoStatusRes)
return true
}
- if (autoStatusRes.data.status === 1) {
+ if (autoStatusRes?.data?.status === 1) {
// 授权成功,返回结果,交由调用方处理
resolve(autoStatusRes)
return true
diff --git a/project/web/src/app/[lng]/chat/[taskId]/utils/convertMessages.ts b/project/web/src/app/[lng]/chat/[taskId]/utils/convertMessages.ts
index 20ffa9a4..f78d5924 100644
--- a/project/web/src/app/[lng]/chat/[taskId]/utils/convertMessages.ts
+++ b/project/web/src/app/[lng]/chat/[taskId]/utils/convertMessages.ts
@@ -31,6 +31,8 @@ export function convertMessages(messages: TaskMessage[]): IDisplayMessage[] {
let currentStepWorkflow: IWorkflowStep[] = []
let stepIndex = 0
let lastAssistantMsgIndex = -1
+ // 用于在 medias 处理后保留原始 content 供去重检查
+ let contentBeforeMediasProcessing = ''
// 用于追踪工具调用的 Map
const toolCallMap = new Map<string, string>()
@@ -72,6 +74,9 @@ export function convertMessages(messages: TaskMessage[]): IDisplayMessage[] {
const resultData = msgAnyCheck.result
const resultArray = Array.isArray(resultData) ? resultData : [resultData]
+ // 保存处理 medias 前的 currentStepContent,用于后续去重检查
+ contentBeforeMediasProcessing = currentStepContent
+
resultArray.forEach((item: any, arrIndex: number) => {
if (item && item.medias && Array.isArray(item.medias) && item.medias.length > 0) {
const convertedMedias = item.medias.map((m: any) => ({
@@ -169,9 +174,24 @@ export function convertMessages(messages: TaskMessage[]): IDisplayMessage[] {
else if (msg.type === 'result') {
// 结果消息处理
const result = processResultMessage(msg, index, displayMessages)
- if (result.contentToAdd && !currentStepContent.includes(result.contentToAdd)) {
+ // 更严格的去重:比较 trim 后的内容,避免因空白字符导致重复
+ // 注意:如果 medias 处理时调用了 saveCurrentStep(),currentStepContent 可能被重置
+ // 使用 contentBeforeMediasProcessing 作为备选来源进行去重检查
+ const contentToAdd = result.contentToAdd?.trim()
+ const existingContent = currentStepContent.trim()
+ const previousContent = contentBeforeMediasProcessing.trim()
+ // 检查内容是否已存在于当前步骤或之前保存的步骤中
+ const isDuplicate = contentToAdd && (
+ existingContent.includes(contentToAdd)
+ || contentToAdd === existingContent
+ || previousContent.includes(contentToAdd)
+ || contentToAdd === previousContent
+ )
+ if (contentToAdd && !isDuplicate) {
currentStepContent += (currentStepContent ? '\n\n' : '') + result.contentToAdd
}
+ // 重置 contentBeforeMediasProcessing,避免影响后续消息
+ contentBeforeMediasProcessing = ''
if (result.newAssistantMsgIndex !== undefined) {
lastAssistantMsgIndex = result.newAssistantMsgIndex
}
@@ -460,8 +480,9 @@ function processResultMessage(
const resultArray = Array.isArray(resultData) ? resultData : [resultData]
// Map actions (but do NOT attach medias to action cards to avoid duplicate rendering)
+ // 过滤掉 action 为 "none" 的项,因为它们不需要显示为 action 卡片
actions = resultArray
- .filter((item: any) => item && item.action) // 只处理有 action 的项
+ .filter((item: any) => item && item.action && item.action !== 'none') // 只处理有实际 action 的项
.map((item: any) => ({
type: item.action, // 映射 action -> type
platform: item.platform,
diff --git a/project/web/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx b/project/web/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
index fa4a202b..cac75cfc 100644
--- a/project/web/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
+++ b/project/web/src/app/[lng]/dataStatistics/components/DataStatisticsHeader/index.tsx
@@ -11,10 +11,10 @@ import { forwardRef, memo, useState } from 'react'
import { Navigation } from 'swiper/modules'
import { Swiper, SwiperSlide } from 'swiper/react'
import { useShallow } from 'zustand/react/shallow'
-import AddAccountModal from '@/app/[lng]/accounts/components/AddAccountModal'
import { useDataStatisticsStore } from '@/app/[lng]/dataStatistics/useDataStatistics'
import { useTransClient } from '@/app/i18n/client'
import AvatarPlat from '@/components/AvatarPlat'
+import { useChannelManagerStore } from '@/components/ChannelManager'
import { useAccountStore } from '@/store/account'
import AccountCount from '../../svgs/accountCount.svg'
import styles from './dataStatisticsHeader.module.scss'
@@ -49,21 +49,16 @@ const DataStatisticsHeader = memo(
setAccountSearchValue: state.setAccountSearchValue,
})),
)
- const [addAccountModalOpen, setAddAccountModalOpen] = useState(false)
const { t } = useTransClient('dataStatistics')
+ // 频道管理器相关方法
+ const { openConnectList } = useChannelManagerStore(
+ useShallow(state => ({
+ openConnectList: state.openConnectList,
+ })),
+ )
return (
<div className={styles.dataStatisticsHeader}>
- {/* 添加账号弹窗 */}
- <AddAccountModal
- open={addAccountModalOpen}
- onClose={() => setAddAccountModalOpen(false)}
- onAddSuccess={() => setAddAccountModalOpen(false)}
- // targetGroupId={targetSpaceId}
- // showSpaceSelector={!targetSpaceId}
- // autoTriggerPlatform={targetPlatform}
- />
-
<div className="dataStatisticsHeader-top">
<h2>{t('accountData')}</h2>
<div className="dataStatisticsHeader-top-options">
@@ -174,7 +169,7 @@ const DataStatisticsHeader = memo(
<a
onClick={(e) => {
e.preventDefault()
- setAddAccountModalOpen(true)
+ openConnectList()
}}
>
{t('relogin')}
diff --git a/project/web/src/app/[lng]/interactiveNew/components/FeedDetailModal/DetailSection.tsx b/project/web/src/app/[lng]/interactiveNew/components/FeedDetailModal/DetailSection.tsx
index 9d7871dd..c4219fce 100644
--- a/project/web/src/app/[lng]/interactiveNew/components/FeedDetailModal/DetailSection.tsx
+++ b/project/web/src/app/[lng]/interactiveNew/components/FeedDetailModal/DetailSection.tsx
@@ -28,7 +28,6 @@ import CommentList from './CommentList'
* 从描述中移除话题标签(因为话题会单独显示)
* 支持多平台格式:
* - 小红书:#话题名[话题]#
- * - 抖音:#话题名 或 #话题名#
* @param text 原始描述文本
* @param platform 当前平台
* @returns 移除话题后的纯文本
@@ -45,11 +44,6 @@ function removeTopicsFromDescription(text: string, platform: SupportedPlatformTy
result = result.replace(/#[^#[\]]+\[话题\]#/g, '')
break
- case PlatType.Douyin:
- // 抖音格式:#话题名 或 #话题名#(话题名不含空格和#)
- result = result.replace(/#[^\s#]+#?/g, '')
- break
-
default:
// 通用格式:移除 #话题名[话题]# 和 #话题名
result = result.replace(/#[^#[\]]+\[话题\]#/g, '')
diff --git a/project/web/src/app/[lng]/interactiveNew/store/detailStore.ts b/project/web/src/app/[lng]/interactiveNew/store/detailStore.ts
index d314d77e..24f338fc 100644
--- a/project/web/src/app/[lng]/interactiveNew/store/detailStore.ts
+++ b/project/web/src/app/[lng]/interactiveNew/store/detailStore.ts
@@ -6,7 +6,6 @@
import type { ClickRect } from '../components/FeedCard'
import type { HomeFeedItem, SupportedPlatformType, WorkDetail } from '@/store/plugin/plats/types'
import { create } from 'zustand'
-import { PlatType } from '@/app/config/platConfig'
import { platformManager } from '@/store/plugin'
/**
@@ -154,8 +153,6 @@ export const useDetailModalStore = create<DetailModalStore>((set, get) => ({
workId: item.workId,
// 小红书需要 xsecToken
xsecToken: item.origin?.xsec_token,
- // 抖音需要 origin 数据
- origin: platform === PlatType.Douyin ? item.origin : undefined,
})
// 检查弹框是否还在打开状态(避免关闭后还更新状态)
diff --git a/project/web/src/app/[lng]/layout.tsx b/project/web/src/app/[lng]/layout.tsx
index 34cf750c..a718d88c 100644
--- a/project/web/src/app/[lng]/layout.tsx
+++ b/project/web/src/app/[lng]/layout.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from '@/app/i18n'
import { fallbackLng, languages } from '@/app/i18n/settings'
import LayoutSidebar from '@/app/layout/LayoutSidebar'
import MobileNav from '@/app/layout/MobileNav'
+import { ChannelManager } from '@/components/ChannelManager'
import { Providers } from '../layout/Providers'
import '@/app/var.css'
import '../globals.css'
@@ -42,6 +43,8 @@ export default async function RootLayout({
/>
<script async src="https://r.wdfl.co/rw.js" data-rewardful="ded70f" />
<Providers lng={lng}>
+ {/* 全局频道管理弹框 */}
+ <ChannelManager />
<p className="hidden">
Impact-Site-Verification: f9836212-462a-482f-9232-8a877970eacf
</p>
@@ -54,9 +57,13 @@ export default async function RootLayout({
<main id="main-content" className="flex-1 min-h-0 overflow-y-auto overflow-x-hidden pt-14 md:pt-0">
{children}
</main>
+ {/* eslint-disable-next-line next/no-sync-scripts */}
<script src="/js/xhs_web_sign.js" />
+ {/* eslint-disable-next-line next/no-sync-scripts */}
<script src="/js/xhs_sign_init.js" />
+ {/* eslint-disable-next-line next/no-sync-scripts */}
<script src="/js/xhs_sign_core.js" />
+ {/* eslint-disable-next-line next/no-sync-scripts */}
<script src="/js/xhs_sign_inject.js" />
</div>
</Providers>
diff --git a/project/web/src/app/config/platConfig.ts b/project/web/src/app/config/platConfig.ts
index ecc68f3d..26ae193c 100644
--- a/project/web/src/app/config/platConfig.ts
+++ b/project/web/src/app/config/platConfig.ts
@@ -83,8 +83,8 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
themeColor: 'red',
pubTypes: new Set([PubType.VIDEO, PubType.ImageText]),
commonPubParamsConfig: {
- titleMax: 100,
- topicMax: 100,
+ titleMax: 10,
+ topicMax: 5,
desMax: 1000,
},
jiancha: true,
@@ -121,56 +121,6 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
jiancha: true,
},
],
- [
- PlatType.WxGzh,
- {
- name: 'wxgzh',
- icon: gongzhonghaoSvg.src,
- url: 'https://mp.weixin.qq.com/',
- pubTypes: new Set([PubType.ImageText, PubType.Article]),
- commonPubParamsConfig: {
- topicMax: 10,
- desMax: 2200,
- imagesMax: 20,
- },
- themeColor: 'green',
- jiancha: true,
- },
- ],
-
- [
- PlatType.Douyin,
- {
- name: 'douyin',
- icon: douyinSvg,
- url: 'https://www.douyin.com/',
- pubTypes: new Set([PubType.VIDEO, PubType.ImageText]),
- commonPubParamsConfig: {
- titleMax: 30,
- topicMax: 5,
- desMax: 1000,
- },
- themeColor: '#FF4D00',
- jiancha: true,
- },
- ],
- [
- PlatType.WxSph,
- {
- name: 'wxsph',
- icon: wxSphSvg,
- url: 'https://mp.weixin.qq.com/',
- pubTypes: new Set([PubType.VIDEO, PubType.ImageText]),
- commonPubParamsConfig: {
- titleMax: 100,
- topicMax: 100,
- desMax: 5000,
- },
- themeColor: 'green',
- pcNoThis: true,
- jiancha: true,
- },
- ],
[
PlatType.Tiktok,
{
diff --git a/project/web/src/app/i18n/locales/en/account.json b/project/web/src/app/i18n/locales/en/account.json
index f78b469a..926f9e73 100644
--- a/project/web/src/app/i18n/locales/en/account.json
+++ b/project/web/src/app/i18n/locales/en/account.json
@@ -44,7 +44,8 @@
"title": "Kwai Authorization Notice",
"content": "Kwai may remain on the login page after login. This is an official Kwai issue. Please refresh the page and return to the platform to refresh, then authorization can succeed.",
"okText": "I understand"
- }
+ },
+ "authSuccess": "The authorization for the channel {{platform}} has been successful!"
},
"noAccountWarning": {
"title": "Notice",
@@ -288,6 +289,31 @@
"myChannels": "My Channels",
"title": "Channel Manager",
"description": "Manage your channels and space groups",
+ "platforms": "Platforms",
+ "allChannels": "All Channels",
+ "availablePlatforms": "Available Platforms",
+ "connectNewChannel": "Connect New Channel",
+ "backToChannels": "Back to My Channels",
+ "newUserTip": "Connect any channel to start your amazing AiToEarn journey!",
+ "addChannel": "Add Channel",
+ "connecting": "Connecting {{platform}}",
+ "authWaitingTip": "Please complete authorization in the new window...",
+ "remainingTime": "Remaining time: ",
+ "reopenAuthPage": "Reopen Authorization Page",
+ "autoRedirectTip": "Will automatically redirect after successful authorization",
+ "authTimeout": "Authorization Timeout",
+ "authTimeoutTip": "Authorization time has expired, please try again",
+ "authFailed": "Authorization Failed",
+ "authFailedTip": "An error occurred during authorization, please retry",
+ "authError": "Authorization Error",
+ "authInProgress": "Authorizing",
+ "authDescription": "Waiting for authorization to complete",
+ "connectDescription": "Select a platform to connect",
+ "retry": "Retry",
+ "pluginNotReady": "Please install and authorize the browser plugin before adding {{platform}} account",
+ "platformNotLoggedIn": "{{platform}} is not logged in, please log in via the plugin first",
+ "syncSuccess": "Account synced successfully",
+ "syncFailed": "Account sync failed",
"tabs": {
"channels": "Channels",
"spaces": "Spaces"
@@ -314,6 +340,8 @@
"sorting": "Sorting...",
"deleting": "Deleting...",
"fans": "Fans: {{count}}",
+ "reauth": "Re-authorize",
+ "addToSpace": "Add to: {{space}}",
"deleteDialogContent": "Are you sure you want to delete {{type}} '{{name}}'? This action cannot be undone.",
"noData": "No data available"
}
diff --git a/project/web/src/app/i18n/locales/en/common.json b/project/web/src/app/i18n/locales/en/common.json
index abcf2118..63cca372 100644
--- a/project/web/src/app/i18n/locales/en/common.json
+++ b/project/web/src/app/i18n/locales/en/common.json
@@ -25,6 +25,8 @@
"markAsRead": "Mark as read",
"unreadCount": "Unread messages",
"viewAll": "View all",
+ "cancel": "Cancel",
+ "confirm": "Confirm",
"actions": {
"cancel": "Cancel",
"confirm": "Confirm",
diff --git a/project/web/src/app/i18n/locales/en/publish.json b/project/web/src/app/i18n/locales/en/publish.json
index a116ab84..f75f59c6 100644
--- a/project/web/src/app/i18n/locales/en/publish.json
+++ b/project/web/src/app/i18n/locales/en/publish.json
@@ -320,7 +320,7 @@
}
},
"messages": {
- "publishSubmitted": "Your post has been submitted. It may take a few minutes for the content to process and appear on your TikTok profile."
+ "publishSubmitted": "Your post has been submitted. It may take a few minutes for the content to process and appear on your {{platform}} profile."
},
"previewvideo": "Preview Video",
"record": {
diff --git a/project/web/src/app/i18n/locales/zh-CN/account.json b/project/web/src/app/i18n/locales/zh-CN/account.json
index 7a4fe029..26ed7f2c 100644
--- a/project/web/src/app/i18n/locales/zh-CN/account.json
+++ b/project/web/src/app/i18n/locales/zh-CN/account.json
@@ -42,9 +42,10 @@
"syncFailed": "账号同步失败",
"kwaiAuthWarning": {
"title": "快手授权提示",
- "content": "快手可能出现登录后还在登录界面,系快手官方问题刷新页面再返回平台刷新可授权成功",
+ "content": "快手可能出现登录后还在登录界面,联系快手官方问题刷新页面再返回平台刷新可授权成功",
"okText": "我知道了"
- }
+ },
+ "authSuccess": "频道 {{platform}} 授权成功!"
},
"noAccountWarning": {
"title": "提示",
@@ -288,6 +289,31 @@
"myChannels": "我的频道",
"title": "频道管理",
"description": "管理您的频道和空间分组",
+ "platforms": "平台列表",
+ "allChannels": "全部频道",
+ "availablePlatforms": "可连接的平台",
+ "connectNewChannel": "连接新频道",
+ "backToChannels": "返回我的频道",
+ "newUserTip": "授权任何频道开始您奇妙的AiToEarn之旅吧!",
+ "addChannel": "添加频道",
+ "connecting": "正在连接 {{platform}}",
+ "authWaitingTip": "请在新窗口完成授权操作...",
+ "remainingTime": "剩余时间:",
+ "reopenAuthPage": "重新打开授权页面",
+ "autoRedirectTip": "授权成功后将自动跳转",
+ "authTimeout": "授权超时",
+ "authTimeoutTip": "授权时间已到,请重新尝试",
+ "authFailed": "授权失败",
+ "authFailedTip": "授权过程中出现错误,请重试",
+ "authError": "授权错误",
+ "authInProgress": "授权中",
+ "authDescription": "正在等待授权完成",
+ "connectDescription": "选择要连接的平台",
+ "retry": "重试",
+ "pluginNotReady": "请先安装并授权浏览器插件后再添加{{platform}}账号",
+ "platformNotLoggedIn": "{{platform}}未登录,请先在插件中登录",
+ "syncSuccess": "账号同步成功",
+ "syncFailed": "账号同步失败",
"tabs": {
"channels": "频道",
"spaces": "空间"
@@ -311,6 +337,8 @@
"sorting": "排序中...",
"deleting": "删除中...",
"fans": "粉丝: {{count}}",
+ "reauth": "重新授权",
+ "addToSpace": "添加到: {{space}}",
"deleteDialogContent": "确定要删除 {{type}} \"{{name}}\" 吗?此操作无法撤销。",
"deleteSpaceConfirm": "确认删除空间",
"deleteSpaceSuccess": "删除空间成功",
diff --git a/project/web/src/app/i18n/locales/zh-CN/chat.json b/project/web/src/app/i18n/locales/zh-CN/chat.json
index dd94e6f2..6c05165f 100644
--- a/project/web/src/app/i18n/locales/zh-CN/chat.json
+++ b/project/web/src/app/i18n/locales/zh-CN/chat.json
@@ -1,6 +1,6 @@
{
"input": {
- "placeholder": "输入你想创作的内容...",
+ "placeholder": "帮我制作一个猫跳舞的视频,直接上传到YouTube上",
"send": "发送",
"stop": "停止",
"uploading": "上传中..."
diff --git a/project/web/src/app/i18n/locales/zh-CN/common.json b/project/web/src/app/i18n/locales/zh-CN/common.json
index 467f5ffb..0632439b 100644
--- a/project/web/src/app/i18n/locales/zh-CN/common.json
+++ b/project/web/src/app/i18n/locales/zh-CN/common.json
@@ -25,6 +25,8 @@
"markAsRead": "标记为已读",
"unreadCount": "未读消息",
"viewAll": "查看全部",
+ "cancel": "取消",
+ "confirm": "确认",
"actions": {
"cancel": "取消",
"confirm": "确认",
diff --git a/project/web/src/app/i18n/locales/zh-CN/publish.json b/project/web/src/app/i18n/locales/zh-CN/publish.json
index 82ab7b31..b12aa8ad 100644
--- a/project/web/src/app/i18n/locales/zh-CN/publish.json
+++ b/project/web/src/app/i18n/locales/zh-CN/publish.json
@@ -321,7 +321,7 @@
}
},
"messages": {
- "publishSubmitted": "发布已提交,系统正在处理,内容可能需要几分钟才会显示在您的 TikTok 个人主页上。"
+ "publishSubmitted": "发布已提交,系统正在处理,内容可能需要几分钟才会显示在您的 {{platform}} 个人主页上。"
},
"previewvideo": "预览视频",
"record": {
diff --git a/project/web/src/app/layout/LayoutSidebar/components/BottomSection/MyChannelsEntry.tsx b/project/web/src/app/layout/LayoutSidebar/components/BottomSection/MyChannelsEntry.tsx
index a87e4f8f..c1c0a0a0 100644
--- a/project/web/src/app/layout/LayoutSidebar/components/BottomSection/MyChannelsEntry.tsx
+++ b/project/web/src/app/layout/LayoutSidebar/components/BottomSection/MyChannelsEntry.tsx
@@ -6,9 +6,8 @@
import type { SidebarCommonProps } from '../../types'
import { Tv } from 'lucide-react'
-import { useState } from 'react'
import { useTransClient } from '@/app/i18n/client'
-import ChannelManager from '@/components/ChannelManager'
+import { useChannelManagerStore } from '@/components/ChannelManager'
import {
Tooltip,
TooltipContent,
@@ -19,40 +18,36 @@ import { cn } from '@/lib/utils'
export function MyChannelsEntry({ collapsed }: SidebarCommonProps) {
const { t } = useTransClient('account')
- const [isOpen, setIsOpen] = useState(false)
+ const openModal = useChannelManagerStore(state => state.openModal)
const handleClick = () => {
- setIsOpen(true)
+ openModal()
}
return (
- <>
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <button
- type="button"
- onClick={handleClick}
- className={cn(
- 'flex flex-1 items-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground cursor-pointer',
- collapsed ? 'h-9 w-9 justify-center' : 'justify-between px-3 py-2',
- )}
- >
- <div className="flex items-center gap-2">
- <Tv size={18} className="text-primary" />
- {!collapsed && <span className="text-sm">{t('channelManager.myChannels', '我的频道')}</span>}
- </div>
- </button>
- </TooltipTrigger>
- {collapsed && (
- <TooltipContent side="right">
- <p>{t('channelManager.myChannels', '我的频道')}</p>
- </TooltipContent>
- )}
- </Tooltip>
- </TooltipProvider>
-
- <ChannelManager open={isOpen} onOpenChange={setIsOpen} />
- </>
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ type="button"
+ onClick={handleClick}
+ className={cn(
+ 'flex flex-1 cursor-pointer items-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground',
+ collapsed ? 'h-9 w-9 justify-center' : 'justify-between px-3 py-2',
+ )}
+ >
+ <div className="flex items-center gap-2">
+ <Tv size={18} className="text-primary" />
+ {!collapsed && <span className="text-sm">{t('channelManager.myChannels')}</span>}
+ </div>
+ </button>
+ </TooltipTrigger>
+ {collapsed && (
+ <TooltipContent side="right">
+ <p>{t('channelManager.myChannels')}</p>
+ </TooltipContent>
+ )}
+ </Tooltip>
+ </TooltipProvider>
)
}
diff --git a/project/web/src/app/layout/LayoutSidebar/components/BottomSection/PluginEntry.tsx b/project/web/src/app/layout/LayoutSidebar/components/BottomSection/PluginEntry.tsx
index caf89745..e5cabdda 100644
--- a/project/web/src/app/layout/LayoutSidebar/components/BottomSection/PluginEntry.tsx
+++ b/project/web/src/app/layout/LayoutSidebar/components/BottomSection/PluginEntry.tsx
@@ -7,7 +7,7 @@
import type { SidebarCommonProps } from '../../types'
import { Puzzle } from 'lucide-react'
-import { useState } from 'react'
+import { useShallow } from 'zustand/react/shallow'
import { useTransClient } from '@/app/i18n/client'
import { PluginModal } from '@/components/Plugin'
import {
@@ -22,8 +22,15 @@ import { PluginStatus } from '@/store/plugin/types/baseTypes'
export function PluginEntry({ collapsed }: SidebarCommonProps) {
const { t } = useTransClient('common')
- const pluginStatus = usePluginStore(state => state.status)
- const [pluginModalVisible, setPluginModalVisible] = useState(false)
+
+ const { pluginStatus, pluginModalVisible, openPluginModal, closePluginModal } = usePluginStore(
+ useShallow(state => ({
+ pluginStatus: state.status,
+ pluginModalVisible: state.pluginModalVisible,
+ openPluginModal: state.openPluginModal,
+ closePluginModal: state.closePluginModal,
+ })),
+ )
// 根据插件状态返回对应的颜色和状态文本
const getStatusInfo = () => {
@@ -65,7 +72,7 @@ export function PluginEntry({ collapsed }: SidebarCommonProps) {
const content = (
<button
- onClick={() => setPluginModalVisible(true)}
+ onClick={openPluginModal}
className={cn(
'flex w-full cursor-pointer items-center rounded-lg border-none bg-transparent text-muted-foreground transition-colors hover:bg-accent hover:text-foreground',
collapsed ? 'h-9 w-9 justify-center' : 'justify-between px-3 py-2',
@@ -109,7 +116,7 @@ export function PluginEntry({ collapsed }: SidebarCommonProps) {
)}
{/* 插件状态弹框 */}
- <PluginModal visible={pluginModalVisible} onClose={() => setPluginModalVisible(false)} />
+ <PluginModal visible={pluginModalVisible} onClose={closePluginModal} />
</>
)
}
diff --git a/project/web/src/app/layout/LayoutSidebar/components/NavSection.tsx b/project/web/src/app/layout/LayoutSidebar/components/NavSection.tsx
index 7261665e..69505f2e 100644
--- a/project/web/src/app/layout/LayoutSidebar/components/NavSection.tsx
+++ b/project/web/src/app/layout/LayoutSidebar/components/NavSection.tsx
@@ -5,7 +5,7 @@
'use client'
import type { NavItemData, NavSectionProps, SidebarCommonProps } from '../types'
-import { FileText, PlusCircle } from 'lucide-react'
+import { FileText, MoreHorizontal } from 'lucide-react'
import Link from 'next/link'
import { useEffect, useRef, useState } from 'react'
import { useTransClient } from '@/app/i18n/client'
@@ -76,70 +76,23 @@ function NavItem({ item, isActive, collapsed }: NavItemProps) {
return content
}
-/** Add Channel 按钮 */
-interface AddChannelButtonProps extends SidebarCommonProps {
- onClick: () => void
-}
-
-function AddChannelButton({ collapsed, onClick }: AddChannelButtonProps) {
- const { t } = useTransClient('route')
-
- const content = (
- <button
- onClick={onClick}
- className={cn(
- 'relative flex items-center rounded-lg text-sm font-medium transition-all w-full',
- 'text-primary hover:bg-primary/10 hover:text-primary',
- 'border border-dashed border-primary/40 hover:border-primary',
- collapsed ? 'justify-center px-2 py-2.5' : 'gap-3 px-3 py-2.5',
- )}
- >
- <span className="flex shrink-0 items-center justify-center text-primary">
- <PlusCircle size={20} />
- </span>
- {!collapsed && (
- <span className="overflow-hidden text-ellipsis whitespace-nowrap">
- {t('addChannel')}
- </span>
- )}
- </button>
- )
-
- // 收缩状态下显示 Tooltip
- if (collapsed) {
- return (
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>{content}</TooltipTrigger>
- <TooltipContent side="right">
- <p>{t('addChannel')}</p>
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- )
- }
-
- return content
-}
-
-interface NavSectionWithAddChannelProps extends NavSectionProps {
- onAddChannel?: () => void
-}
-
-export function NavSection({ items, currentRoute, collapsed, onAddChannel }: NavSectionWithAddChannelProps) {
- // Move Add Channel to be the second item (under Home)
- const addChannelInsertIndex = 1
-
- // Keys to group into a collapsed section
+export function NavSection({ items, currentRoute, collapsed }: NavSectionProps) {
+ // Keys to group into the "More" section
+ // Order: tasksHistory, interactive (作品互动), dataStatistics, materialLibrary, draftBox
const groupKeys = [
'tasksHistory',
+ 'interactive',
'dataStatistics',
'header.materialLibrary',
'header.draftBox',
]
- const groupedItems = items.filter(i => groupKeys.includes(i.translationKey as string))
- const otherItems = items.filter(i => !groupKeys.includes(i.translationKey as string))
+ // Main items: only Home and Publish (accounts)
+ const mainItems = items.filter(i => !groupKeys.includes(i.translationKey as string))
+ // Grouped items in specified order
+ const groupedItems = groupKeys
+ .map(key => items.find(i => i.translationKey === key))
+ .filter((i): i is NavItemData => i !== undefined)
const [groupOpen, setGroupOpen] = useState(false)
const [popoverOpen, setPopoverOpen] = useState(false)
@@ -171,7 +124,7 @@ export function NavSection({ items, currentRoute, collapsed, onAddChannel }: Nav
}
hoverTimeoutRef.current = setTimeout(() => {
setPopoverOpen(true)
- }, 200) // 200ms delay to prevent accidental triggers
+ }, 200)
}
const handleMouseLeave = () => {
@@ -180,44 +133,22 @@ export function NavSection({ items, currentRoute, collapsed, onAddChannel }: Nav
}
hoverTimeoutRef.current = setTimeout(() => {
setPopoverOpen(false)
- }, 300) // 300ms delay to allow moving to popover
+ }, 300)
}
return (
<nav className="flex flex-col gap-1">
- {otherItems.map((item, index) => {
- // Render first item (Home)
- if (index === 0) {
- return (
- <div key={item.path || item.translationKey}>
- <NavItem
- item={item}
- isActive={item.path === currentRoute}
- collapsed={collapsed}
- />
- {/* Insert Add Channel right after first item */}
- {onAddChannel && (
- <div className="mt-1">
- <AddChannelButton collapsed={collapsed} onClick={onAddChannel} />
- </div>
- )}
- </div>
- )
- }
-
- // For other items (excluding the grouped ones), render normally
- return (
- <div key={item.path || item.translationKey}>
- <NavItem
- item={item}
- isActive={item.path === currentRoute}
- collapsed={collapsed}
- />
- </div>
- )
- })}
-
- {/* Collapsible group for Task History / Data / Library / Drafts */}
+ {/* Main navigation items: Home, Publish */}
+ {mainItems.map(item => (
+ <NavItem
+ key={item.path || item.translationKey}
+ item={item}
+ isActive={item.path === currentRoute}
+ collapsed={collapsed}
+ />
+ ))}
+
+ {/* Collapsible "More" section */}
{groupedItems.length > 0 && (
<div>
{collapsed ? (
@@ -235,7 +166,7 @@ export function NavSection({ items, currentRoute, collapsed, onAddChannel }: Nav
onMouseLeave={handleMouseLeave}
>
<span className="flex shrink-0 items-center justify-center">
- <FileText size={20} />
+ <MoreHorizontal size={20} />
</span>
</button>
</PopoverTrigger>
@@ -256,7 +187,7 @@ export function NavSection({ items, currentRoute, collapsed, onAddChannel }: Nav
key={gitem.path || gitem.translationKey}
item={gitem}
isActive={gitem.path === currentRoute}
- collapsed={false} // Always show text in popover
+ collapsed={false}
/>
))}
</div>
@@ -277,13 +208,11 @@ export function NavSection({ items, currentRoute, collapsed, onAddChannel }: Nav
)}
>
<span className="flex shrink-0 items-center justify-center">
- <FileText size={20} />
+ <MoreHorizontal size={20} />
</span>
<span className="overflow-hidden text-ellipsis whitespace-nowrap">
- {/* Use a generic label for the grouped section */}
{t('sidebar.more')}
</span>
- {/* Show expand/collapse indicator */}
<span className="absolute right-3 top-1/2 -translate-y-1/2 text-xs opacity-60">
{groupOpen ? '−' : '+'}
</span>
diff --git a/project/web/src/app/layout/LayoutSidebar/index.tsx b/project/web/src/app/layout/LayoutSidebar/index.tsx
index c39bb4e8..545464f5 100644
--- a/project/web/src/app/layout/LayoutSidebar/index.tsx
+++ b/project/web/src/app/layout/LayoutSidebar/index.tsx
@@ -6,17 +6,15 @@
'use client'
import type { SettingsTab } from '@/components/SettingsModal'
-import { BookOpen } from 'lucide-react'
import { useRouter, useSelectedLayoutSegments } from 'next/navigation'
-import { useEffect, useState } from 'react'
+import { useState } from 'react'
import { useShallow } from 'zustand/shallow'
-import AddAccountModal from '@/app/[lng]/accounts/components/AddAccountModal'
import { routerData } from '@/app/layout/routerData'
+import { ExternalLinks } from '@/app/layout/shared'
import NotificationPanel from '@/components/notification/NotificationPanel'
import SettingsModal from '@/components/SettingsModal'
import { useSettingsModalStore } from '@/components/SettingsModal/store'
import { useNotification } from '@/hooks/useNotification'
-import { toast } from '@/lib/toast'
import { cn } from '@/lib/utils'
import { openLoginModal } from '@/store/loginModal'
import { useUserStore } from '@/store/user'
@@ -30,86 +28,6 @@ import {
import { AffiliatesEntry } from './components/BottomSection/AffiliatesEntry'
import { MyChannelsEntry } from './components/BottomSection/MyChannelsEntry'
-// GitHub 配置
-const GITHUB_REPO = 'yikart/AiToEarn'
-const DOCS_URL = 'https://docs.aitoearn.ai'
-
-/**
- * 外部链接组件 - Docs 和 GitHub
- */
-function ExternalLinks({ collapsed }: { collapsed: boolean }) {
- const [starCount, setStarCount] = useState<string>('9.5k')
-
- useEffect(() => {
- fetch(`https://api.github.com/repos/${GITHUB_REPO}`)
- .then(res => res.json())
- .then((data) => {
- if (data.stargazers_count) {
- const count = data.stargazers_count
- setStarCount(count >= 1000 ? `${(count / 1000).toFixed(1)}k` : count.toString())
- }
- })
- .catch(() => {})
- }, [])
-
- if (collapsed) {
- return (
- <div className="flex flex-col items-center gap-1.5 pt-3 mt-2 border-t border-sidebar-border">
- <a
- href={DOCS_URL}
- target="_blank"
- rel="noopener noreferrer"
- className="flex items-center justify-center w-8 h-8 rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground transition-colors"
- title="Docs"
- >
- <BookOpen className="w-3.5 h-3.5" />
- </a>
- <a
- href={`https://github.com/${GITHUB_REPO}`}
- target="_blank"
- rel="noopener noreferrer"
- className="flex items-center justify-center w-8 h-8 rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground transition-colors"
- title={`GitHub Stars: ${starCount}`}
- >
- <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor">
- <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
- </svg>
- </a>
- </div>
- )
- }
-
- return (
- <div className="flex items-center justify-center gap-3 pt-3 mt-2 border-t border-sidebar-border">
- <a
- href={DOCS_URL}
- target="_blank"
- rel="noopener noreferrer"
- className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full border border-border/60 text-[11px] font-medium text-muted-foreground/80 hover:bg-accent hover:text-foreground hover:border-border transition-all"
- >
- <BookOpen className="w-3 h-3" />
- Docs
- </a>
- <a
- href={`https://github.com/${GITHUB_REPO}`}
- target="_blank"
- rel="noopener noreferrer"
- className="inline-flex items-center rounded-full border border-border/60 overflow-hidden hover:border-border transition-all"
- >
- <span className="inline-flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] font-medium text-muted-foreground/80 hover:bg-accent hover:text-foreground transition-colors">
- <svg className="w-3 h-3" viewBox="0 0 24 24" fill="currentColor">
- <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
- </svg>
- Star
- </span>
- <span className="px-2 py-1.5 text-[11px] font-semibold text-muted-foreground bg-accent/30 border-l border-border/60">
- {starCount}
- </span>
- </a>
- </div>
- )
-}
-
/**
* 侧边栏主组件
*/
@@ -132,7 +50,6 @@ function LayoutSidebar() {
// UI 状态
const [notificationVisible, setNotificationVisible] = useState(false)
- const [addAccountVisible, setAddAccountVisible] = useState(false)
const {
settingsVisible,
settingsDefaultTab,
@@ -171,16 +88,6 @@ function LayoutSidebar() {
closeSettings()
}
- // 打开添加账号弹窗
- const handleAddChannel = () => {
- if (!token) {
- toast.warning('Please login first')
- openLoginModal(() => setAddAccountVisible(true))
- return
- }
- setAddAccountVisible(true)
- }
-
// 转换路由数据为 NavSection 所需格式
const navItems = routerData.map(item => ({
path: item.path || '/',
@@ -208,7 +115,6 @@ function LayoutSidebar() {
items={navItems}
currentRoute={currRouter}
collapsed={collapsed}
- onAddChannel={handleAddChannel}
/>
</div>
@@ -263,18 +169,6 @@ function LayoutSidebar() {
onClose={handleCloseSettings}
defaultTab={settingsDefaultTab}
/>
-
- {/* 添加账号弹窗 */}
- <AddAccountModal
- open={addAccountVisible}
- onClose={() => setAddAccountVisible(false)}
- onAddSuccess={() => {
- setAddAccountVisible(false)
- toast.success('Account added successfully')
- }}
- showSpaceSelector={true}
- />
-
</>
)
}
diff --git a/project/web/src/app/layout/LayoutSidebar/store.ts b/project/web/src/app/layout/LayoutSidebar/store.ts
deleted file mode 100644
index dbe6a22a..00000000
--- a/project/web/src/app/layout/LayoutSidebar/store.ts
+++ /dev/null
@@ -1 +0,0 @@
-// 已迁移到 `@/components/SettingsModal/store`,保留空文件避免误引用
diff --git a/project/web/src/app/layout/MobileNav/index.tsx b/project/web/src/app/layout/MobileNav/index.tsx
index 057502cc..77c8fe01 100644
--- a/project/web/src/app/layout/MobileNav/index.tsx
+++ b/project/web/src/app/layout/MobileNav/index.tsx
@@ -8,16 +8,17 @@
import type { SettingsTab } from '@/components/SettingsModal'
import {
Bell,
- BookOpen,
+ ChevronDown,
+ ChevronUp,
Crown,
DollarSign,
FileText,
Mail,
Menu,
- PlusCircle,
- Puzzle,
+ MoreHorizontal,
Share2,
Smartphone,
+ Tv,
X,
} from 'lucide-react'
import Image from 'next/image'
@@ -26,13 +27,13 @@ import { useRouter, useSelectedLayoutSegments } from 'next/navigation'
import { useEffect, useState } from 'react'
import { useShallow } from 'zustand/react/shallow'
import { centsToUsd } from '@/api/credits'
-import AddAccountModal from '@/app/[lng]/accounts/components/AddAccountModal'
import { useTransClient } from '@/app/i18n/client'
import { routerData } from '@/app/layout/routerData'
+import { ACTIVE_VIP_STATUSES, AFFILIATES_URL, ExternalLinks } from '@/app/layout/shared'
import logo from '@/assets/images/logo.png'
+import { useChannelManagerStore } from '@/components/ChannelManager'
import DownloadAppModal from '@/components/common/DownloadAppModal'
import NotificationPanel from '@/components/notification/NotificationPanel'
-import { PluginModal } from '@/components/Plugin'
import SettingsModal from '@/components/SettingsModal'
import { useSettingsModalStore } from '@/components/SettingsModal/store'
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
@@ -42,22 +43,11 @@ import { Skeleton } from '@/components/ui/skeleton'
import { CONTACT } from '@/constant'
import { useNotification } from '@/hooks/useNotification'
import { useGetClientLng } from '@/hooks/useSystem'
-import { toast } from '@/lib/toast'
import { cn } from '@/lib/utils'
import { openLoginModal } from '@/store/loginModal'
-import { usePluginStore } from '@/store/plugin'
-import { PluginStatus } from '@/store/plugin/types/baseTypes'
import { useUserStore } from '@/store/user'
import { getOssUrl } from '@/utils/oss'
-// GitHub 配置
-const GITHUB_REPO = 'yikart/AiToEarn'
-const DOCS_URL = 'https://docs.aitoearn.ai'
-const AFFILIATES_URL = 'https://aitoearn.getrewardful.com/signup?_gl=1*15wk8k8*_gcl_au*MjAzNTIwODgyMi4xNzY1MjkwMjc2LjExMjI2NzUyNDguMTc2NjE1MjM5OS4xNzY2MTUzODYz*_ga*OTk1MTc5MzQzLjE3NjUyOTAyNzY.*_ga_YJYFH7ZS27*czE3NjYxNTIzOTIkbzckZzEkdDE3NjYxNTM4OTQkajQ3JGwwJGgxODk3OTAxMTc1'
-
-// 有效的 VIP 会员状态
-const ACTIVE_VIP_STATUSES = ['active_monthly', 'active_yearly', 'active_nonrenewing', 'monthly_once', 'yearly_once']
-
/**
* 移动端导航项组件
*/
@@ -97,37 +87,140 @@ function MobileNavItem({
}
/**
- * 移动端 Add Channel 按钮
+ * 移动端我的频道按钮
*/
-function MobileAddChannelButton({
+function MobileMyChannelsButton({
onClose,
- onAddChannel,
+ onOpenMyChannels,
}: {
onClose: () => void
- onAddChannel: () => void
+ onOpenMyChannels: () => void
}) {
- const { t } = useTransClient('route')
+ const { t } = useTransClient('account')
return (
<button
onClick={() => {
onClose()
- onAddChannel()
+ onOpenMyChannels()
}}
className={cn(
'flex items-center gap-3 px-4 py-3 rounded-lg text-base font-medium transition-all w-full',
- 'text-primary hover:bg-primary/10 hover:text-primary',
- 'border border-dashed border-primary/40 hover:border-primary',
+ 'text-muted-foreground hover:bg-muted hover:text-foreground',
)}
>
<span className="flex items-center justify-center text-primary">
- <PlusCircle size={20} />
+ <Tv size={20} />
</span>
- <span>{t('addChannel' as any)}</span>
+ <span>{t('channelManager.myChannels')}</span>
</button>
)
}
+/**
+ * 移动端导航列表 - 包含主导航和"更多"折叠菜单
+ */
+function MobileNavList({
+ currentRoute,
+ onClose,
+ onOpenMyChannels,
+}: {
+ currentRoute: string
+ onClose: () => void
+ onOpenMyChannels: () => void
+}) {
+ const { t } = useTransClient('route')
+ const [moreOpen, setMoreOpen] = useState(false)
+
+ // Keys to group into the "More" section
+ // Order: tasksHistory, interactive (作品互动), dataStatistics, materialLibrary, draftBox
+ const groupKeys = [
+ 'tasksHistory',
+ 'interactive',
+ 'dataStatistics',
+ 'header.materialLibrary',
+ 'header.draftBox',
+ ]
+
+ // Main items: only Home and Publish (accounts)
+ const mainItems = routerData.filter(i => !groupKeys.includes(i.translationKey as string))
+ // Grouped items in specified order
+ const groupedItems = groupKeys
+ .map(key => routerData.find(i => i.translationKey === key))
+ .filter((i): i is (typeof routerData)[0] => i !== undefined)
+
+ // Auto-expand if current route is in grouped items
+ useEffect(() => {
+ const isCurrentRouteInGroup = groupedItems.some(item => item.path === currentRoute)
+ if (isCurrentRouteInGroup && !moreOpen) {
+ setMoreOpen(true)
+ }
+ }, [currentRoute, groupedItems, moreOpen])
+
+ return (
+ <nav className="flex flex-col gap-1 p-4">
+ {/* Main navigation items: Home, Publish */}
+ {mainItems.map(item => (
+ <MobileNavItem
+ key={item.path || item.name}
+ path={item.path || '/'}
+ translationKey={item.translationKey}
+ icon={item.icon}
+ isActive={item.path === currentRoute}
+ onClose={onClose}
+ />
+ ))}
+
+ {/* 我的频道 */}
+ <MobileMyChannelsButton
+ onClose={onClose}
+ onOpenMyChannels={onOpenMyChannels}
+ />
+
+ {/* "More" collapsible section */}
+ {groupedItems.length > 0 && (
+ <div className="mt-1">
+ {/* More button */}
+ <button
+ onClick={() => setMoreOpen(s => !s)}
+ className={cn(
+ 'flex items-center gap-3 px-4 py-3 rounded-lg text-base font-medium transition-all w-full',
+ 'text-muted-foreground hover:bg-muted hover:text-foreground',
+ moreOpen && 'bg-muted text-foreground',
+ )}
+ >
+ <span className="flex items-center justify-center">
+ <MoreHorizontal size={20} />
+ </span>
+ <span className="flex-1 text-left">{t('sidebar.more')}</span>
+ {moreOpen ? (
+ <ChevronUp size={18} className="text-muted-foreground" />
+ ) : (
+ <ChevronDown size={18} className="text-muted-foreground" />
+ )}
+ </button>
+
+ {/* Expanded items */}
+ {moreOpen && (
+ <div className="mt-1 ml-2 flex flex-col gap-1">
+ {groupedItems.map(item => (
+ <MobileNavItem
+ key={item.path || item.name}
+ path={item.path || '/'}
+ translationKey={item.translationKey}
+ icon={item.icon}
+ isActive={item.path === currentRoute}
+ onClose={onClose}
+ />
+ ))}
+ </div>
+ )}
+ </div>
+ )}
+ </nav>
+ )
+}
+
/**
* 移动端用户头像/登录区域
*/
@@ -203,11 +296,8 @@ function MobileBottomSection({
})),
)
- const pluginStatus = usePluginStore(state => state.status)
- const [pluginModalVisible, setPluginModalVisible] = useState(false)
const [downloadModalVisible, setDownloadModalVisible] = useState(false)
const [notificationVisible, setNotificationVisible] = useState(false)
- const [starCount, setStarCount] = useState<string>('9.5k')
// 判断用户是否是有效会员:需要有有效的状态且未过期
const isVip = Boolean(
@@ -224,51 +314,6 @@ function MobileBottomSection({
}
}, [token, fetchCreditsBalance])
- // 获取 GitHub star 数量
- useEffect(() => {
- fetch(`https://api.github.com/repos/${GITHUB_REPO}`)
- .then(res => res.json())
- .then((data) => {
- if (data.stargazers_count) {
- const count = data.stargazers_count
- setStarCount(count >= 1000 ? `${(count / 1000).toFixed(1)}k` : count.toString())
- }
- })
- .catch(() => {})
- }, [])
-
- // 根据插件状态返回对应的颜色和状态文本
- const getPluginStatusInfo = () => {
- switch (pluginStatus) {
- case PluginStatus.READY:
- return {
- iconColor: 'text-success',
- dotColor: 'bg-success',
- statusText: t('pluginStatus.ready'),
- }
- case PluginStatus.INSTALLED_NO_PERMISSION:
- return {
- iconColor: 'text-warning',
- dotColor: 'bg-warning',
- statusText: t('pluginStatus.noPermission'),
- }
- case PluginStatus.CHECKING:
- return {
- iconColor: 'text-info',
- dotColor: 'bg-info animate-pulse',
- statusText: t('pluginStatus.checking'),
- }
- default:
- return {
- iconColor: 'text-muted-foreground/70',
- dotColor: 'bg-muted-foreground/70',
- statusText: t('pluginStatus.notInstalled'),
- }
- }
- }
-
- const pluginInfo = getPluginStatusInfo()
-
return (
<>
<div className="flex flex-col gap-1 border-t border-border pt-3">
@@ -309,26 +354,6 @@ function MobileBottomSection({
</button>
)}
- {/* 插件入口 */}
- <button
- onClick={() => setPluginModalVisible(true)}
- className="flex items-center justify-between px-4 py-3 rounded-lg text-muted-foreground hover:bg-muted transition-colors w-full"
- >
- <div className="flex items-center gap-3">
- <div className="relative">
- <Puzzle size={20} className={pluginInfo.iconColor} />
- <span
- className={cn(
- 'absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full border border-background',
- pluginInfo.dotColor,
- )}
- />
- </div>
- <span className="text-base font-medium">{t('plugin')}</span>
- </div>
- <span className="text-xs text-muted-foreground">{pluginInfo.statusText}</span>
- </button>
-
{/* VIP 会员入口 */}
<Link
href={`/${lng}/pricing`}
@@ -366,7 +391,7 @@ function MobileBottomSection({
{/* 下载APP */}
<button
onClick={() => setDownloadModalVisible(true)}
- className="flex h-10 w-10 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted transition-colors"
+ className="flex h-10 w-10 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted transition-colors cursor-pointer"
title={t('downloadAppButton')}
>
<Smartphone size={20} />
@@ -376,7 +401,7 @@ function MobileBottomSection({
{token && (
<button
onClick={() => setNotificationVisible(true)}
- className="flex h-10 w-10 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted transition-colors relative"
+ className="flex h-10 w-10 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted transition-colors relative cursor-pointer"
title={t('notifications')}
>
<Bell size={20} />
@@ -393,33 +418,7 @@ function MobileBottomSection({
</div>
{/* 外部链接 - Docs 和 GitHub */}
- <div className="flex items-center justify-center gap-3 border-t border-border py-3">
- <a
- href={DOCS_URL}
- target="_blank"
- rel="noopener noreferrer"
- className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full border border-border/60 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-all"
- >
- <BookOpen className="w-3.5 h-3.5" />
- Docs
- </a>
- <a
- href={`https://github.com/${GITHUB_REPO}`}
- target="_blank"
- rel="noopener noreferrer"
- className="inline-flex items-center rounded-full border border-border/60 overflow-hidden hover:border-border transition-all"
- >
- <span className="inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors">
- <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor">
- <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
- </svg>
- Star
- </span>
- <span className="px-2 py-1.5 text-xs font-semibold text-muted-foreground bg-muted/50 border-l border-border/60">
- {starCount}
- </span>
- </a>
- </div>
+ <ExternalLinks isMobile />
{/* 用户区域 */}
<div className="border-t border-border pt-3 px-4">
@@ -427,7 +426,6 @@ function MobileBottomSection({
</div>
{/* 弹窗 */}
- <PluginModal visible={pluginModalVisible} onClose={() => setPluginModalVisible(false)} />
<DownloadAppModal visible={downloadModalVisible} onClose={() => setDownloadModalVisible(false)} />
<NotificationPanel visible={notificationVisible} onClose={() => setNotificationVisible(false)} />
</>
@@ -439,7 +437,6 @@ function MobileBottomSection({
*/
function MobileNav() {
const [isOpen, setIsOpen] = useState(false)
- const [addAccountVisible, setAddAccountVisible] = useState(false)
const router = useRouter()
const lng = useGetClientLng()
const route = useSelectedLayoutSegments()
@@ -451,6 +448,13 @@ function MobileNav() {
closeSettings,
} = useSettingsModalStore()
+ // 频道管理器
+ const { openModal } = useChannelManagerStore(
+ useShallow(state => ({
+ openModal: state.openModal,
+ })),
+ )
+
// 获取当前路由
let currRouter = '/'
if (route.length === 1) {
@@ -473,16 +477,6 @@ function MobileNav() {
openSettings(defaultTab)
}
- // 打开添加账号弹窗
- const handleAddChannel = () => {
- if (!token) {
- toast.warning('Please login first')
- openLoginModal(() => setAddAccountVisible(true))
- return
- }
- setAddAccountVisible(true)
- }
-
return (
<>
{/* 移动端顶部栏 */}
@@ -528,32 +522,11 @@ function MobileNav() {
{/* 可滚动内容区域 */}
<div className="flex-1 overflow-y-auto">
{/* 导航列表 */}
- <nav className="flex flex-col gap-1 p-4">
- {routerData.map((item, index) => {
- // 找到 interactive(Engage)的位置,在其后面插入 Add Channel 按钮
- const isInteractive = item.translationKey === 'interactive'
- return (
- <div key={item.path || item.name}>
- <MobileNavItem
- path={item.path || '/'}
- translationKey={item.translationKey}
- icon={item.icon}
- isActive={item.path === currRouter}
- onClose={handleClose}
- />
- {/* 在 Engage 后面插入 Add Channel 按钮 */}
- {isInteractive && (
- <div className="mt-1">
- <MobileAddChannelButton
- onClose={handleClose}
- onAddChannel={handleAddChannel}
- />
- </div>
- )}
- </div>
- )
- })}
- </nav>
+ <MobileNavList
+ currentRoute={currRouter}
+ onClose={handleClose}
+ onOpenMyChannels={openModal}
+ />
{/* 底部功能区 */}
<div className="px-4 pb-4">
@@ -568,17 +541,6 @@ function MobileNav() {
onClose={closeSettings}
defaultTab={settingsDefaultTab}
/>
-
- {/* 添加账号弹窗 */}
- <AddAccountModal
- open={addAccountVisible}
- onClose={() => setAddAccountVisible(false)}
- onAddSuccess={() => {
- setAddAccountVisible(false)
- toast.success('Account added successfully')
- }}
- showSpaceSelector={true}
- />
</>
)
}
diff --git a/project/web/src/app/layout/shared/components/ExternalLinks.tsx b/project/web/src/app/layout/shared/components/ExternalLinks.tsx
new file mode 100644
index 00000000..eda285d8
--- /dev/null
+++ b/project/web/src/app/layout/shared/components/ExternalLinks.tsx
@@ -0,0 +1,122 @@
+/**
+ * ExternalLinks - 外部链接组件(Docs 和 GitHub)
+ * 支持桌面端(collapsed/expanded)和移动端样式
+ */
+
+'use client'
+
+import { BookOpen } from 'lucide-react'
+import { DOCS_URL, GITHUB_REPO } from '../constants'
+import { useGitHubStars } from '../hooks/useGitHubStars'
+
+/** GitHub SVG 图标 */
+function GitHubIcon({ className }: { className?: string }) {
+ return (
+ <svg className={className} viewBox="0 0 24 24" fill="currentColor">
+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
+ </svg>
+ )
+}
+
+interface ExternalLinksProps {
+ /** 桌面端:是否为收缩状态 */
+ collapsed?: boolean
+ /** 是否为移动端样式 */
+ isMobile?: boolean
+}
+
+/**
+ * 外部链接组件
+ * - 桌面端 collapsed: 图标垂直排列
+ * - 桌面端 expanded: 水平排列,带标签
+ * - 移动端: 水平排列,带标签
+ */
+export function ExternalLinks({ collapsed = false, isMobile = false }: ExternalLinksProps) {
+ const starCount = useGitHubStars()
+
+ // 桌面端收缩状态:图标垂直排列
+ if (collapsed && !isMobile) {
+ return (
+ <div className="flex flex-col items-center gap-1.5 pt-3 mt-2 border-t border-sidebar-border">
+ <a
+ href={DOCS_URL}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="flex items-center justify-center w-8 h-8 rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground transition-colors"
+ title="Docs"
+ >
+ <BookOpen className="w-3.5 h-3.5" />
+ </a>
+ <a
+ href={`https://github.com/${GITHUB_REPO}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="flex items-center justify-center w-8 h-8 rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground transition-colors"
+ title={`GitHub Stars: ${starCount}`}
+ >
+ <GitHubIcon className="w-3.5 h-3.5" />
+ </a>
+ </div>
+ )
+ }
+
+ // 移动端样式
+ if (isMobile) {
+ return (
+ <div className="flex items-center justify-center gap-3 border-t border-border py-3">
+ <a
+ href={DOCS_URL}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full border border-border/60 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-all"
+ >
+ <BookOpen className="w-3.5 h-3.5" />
+ Docs
+ </a>
+ <a
+ href={`https://github.com/${GITHUB_REPO}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="inline-flex items-center rounded-full border border-border/60 overflow-hidden hover:border-border transition-all"
+ >
+ <span className="inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors">
+ <GitHubIcon className="w-3.5 h-3.5" />
+ Star
+ </span>
+ <span className="px-2 py-1.5 text-xs font-semibold text-muted-foreground bg-muted/50 border-l border-border/60">
+ {starCount}
+ </span>
+ </a>
+ </div>
+ )
+ }
+
+ // 桌面端展开状态:水平排列
+ return (
+ <div className="flex items-center justify-center gap-3 pt-3 mt-2 border-t border-sidebar-border">
+ <a
+ href={DOCS_URL}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full border border-border/60 text-[11px] font-medium text-muted-foreground/80 hover:bg-accent hover:text-foreground hover:border-border transition-all"
+ >
+ <BookOpen className="w-3 h-3" />
+ Docs
+ </a>
+ <a
+ href={`https://github.com/${GITHUB_REPO}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="inline-flex items-center rounded-full border border-border/60 overflow-hidden hover:border-border transition-all"
+ >
+ <span className="inline-flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] font-medium text-muted-foreground/80 hover:bg-accent hover:text-foreground transition-colors">
+ <GitHubIcon className="w-3 h-3" />
+ Star
+ </span>
+ <span className="px-2 py-1.5 text-[11px] font-semibold text-muted-foreground bg-accent/30 border-l border-border/60">
+ {starCount}
+ </span>
+ </a>
+ </div>
+ )
+}
diff --git a/project/web/src/app/layout/shared/components/index.ts b/project/web/src/app/layout/shared/components/index.ts
new file mode 100644
index 00000000..d47738ec
--- /dev/null
+++ b/project/web/src/app/layout/shared/components/index.ts
@@ -0,0 +1,5 @@
+/**
+ * shared/components - 共享组件导出
+ */
+
+export { ExternalLinks } from './ExternalLinks'
diff --git a/project/web/src/app/layout/shared/constants.ts b/project/web/src/app/layout/shared/constants.ts
new file mode 100644
index 00000000..ca6e4845
--- /dev/null
+++ b/project/web/src/app/layout/shared/constants.ts
@@ -0,0 +1,16 @@
+/**
+ * 导航共享常量
+ * MobileNav 和 LayoutSidebar 共用的常量配置
+ */
+
+/** GitHub 仓库地址 */
+export const GITHUB_REPO = 'yikart/AiToEarn'
+
+/** 文档网站地址 */
+export const DOCS_URL = 'https://docs.aitoearn.ai'
+
+/** 推广注册地址 */
+export const AFFILIATES_URL = 'https://aitoearn.getrewardful.com/signup?_gl=1*15wk8k8*_gcl_au*MjAzNTIwODgyMi4xNzY1MjkwMjc2LjExMjI2NzUyNDguMTc2NjE1MjM5OS4xNzY2MTUzODYz*_ga*OTk1MTc5MzQzLjE3NjUyOTAyNzY.*_ga_YJYFH7ZS27*czE3NjYxNTIzOTIkbzckZzEkdDE3NjYxNTM4OTQkajQ3JGwwJGgxODk3OTAxMTc1'
+
+/** 有效的 VIP 会员状态 */
+export const ACTIVE_VIP_STATUSES = ['active_monthly', 'active_yearly', 'active_nonrenewing', 'monthly_once', 'yearly_once']
diff --git a/project/web/src/app/layout/shared/hooks/index.ts b/project/web/src/app/layout/shared/hooks/index.ts
new file mode 100644
index 00000000..91c268df
--- /dev/null
+++ b/project/web/src/app/layout/shared/hooks/index.ts
@@ -0,0 +1,5 @@
+/**
+ * shared/hooks - 共享 hooks 导出
+ */
+
+export { useGitHubStars } from './useGitHubStars'
diff --git a/project/web/src/app/layout/shared/hooks/useGitHubStars.ts b/project/web/src/app/layout/shared/hooks/useGitHubStars.ts
new file mode 100644
index 00000000..23d77c43
--- /dev/null
+++ b/project/web/src/app/layout/shared/hooks/useGitHubStars.ts
@@ -0,0 +1,30 @@
+/**
+ * useGitHubStars - 获取 GitHub 仓库 star 数量
+ */
+
+import { useEffect, useState } from 'react'
+import { GITHUB_REPO } from '../constants'
+
+/**
+ * 获取 GitHub 仓库的 star 数量
+ * @returns star 数量字符串(如 "9.5k")
+ */
+export function useGitHubStars() {
+ const [starCount, setStarCount] = useState<string>('9.5k')
+
+ useEffect(() => {
+ fetch(`https://api.github.com/repos/${GITHUB_REPO}`)
+ .then(res => res.json())
+ .then((data) => {
+ if (data.stargazers_count) {
+ const count = data.stargazers_count
+ setStarCount(count >= 1000 ? `${(count / 1000).toFixed(1)}k` : count.toString())
+ }
+ })
+ .catch(() => {
+ // 失败时保持默认值
+ })
+ }, [])
+
+ return starCount
+}
diff --git a/project/web/src/app/layout/shared/index.ts b/project/web/src/app/layout/shared/index.ts
new file mode 100644
index 00000000..f1fc28e0
--- /dev/null
+++ b/project/web/src/app/layout/shared/index.ts
@@ -0,0 +1,8 @@
+/**
+ * layout/shared - 导航共享模块
+ * MobileNav 和 LayoutSidebar 共用的常量、hooks、组件
+ */
+
+export * from './constants'
+export * from './hooks'
+export * from './components'
diff --git a/project/web/src/app/var.css b/project/web/src/app/var.css
index ffcead9b..25b2f400 100644
--- a/project/web/src/app/var.css
+++ b/project/web/src/app/var.css
@@ -18,11 +18,6 @@
--grayColor13: #242424;
--grayColor14: #181818;
- /* 头部高度 */
- --layoutHeaderHegiht: 1px;
-
- /* 超大号字 */
- --fs-xl: 20px;
/* 大号字 */
--fs-lg: 18px;
/* 中号字 */
diff --git a/project/web/src/components/ChannelManager/channelManagerStore.ts b/project/web/src/components/ChannelManager/channelManagerStore.ts
new file mode 100644
index 00000000..1f7f5182
--- /dev/null
+++ b/project/web/src/components/ChannelManager/channelManagerStore.ts
@@ -0,0 +1,599 @@
+/**
+ * ChannelManager - 频道管理器状态管理
+ * 管理三页面视图状态、授权状态、侧边栏状态等
+ */
+
+import type {
+ AuthState,
+ AuthUrlResponse,
+ ChannelManagerMethods,
+ ChannelManagerState,
+ ChannelManagerView,
+} from './types'
+import type { SocialAccount } from '@/api/types/account.type'
+import type { PluginPlatformType } from '@/store/plugin'
+import lodash from 'lodash'
+import { create } from 'zustand'
+import { combine } from 'zustand/middleware'
+import { apiCheckBilibiliAuth, apiGetBilibiliLoginUrl } from '@/api/plat/bilibili'
+import { createKwaiAuth, getKwaiAuthStatus } from '@/api/plat/kwai'
+import {
+ apiCheckYoutubeAuth,
+ checkMetaAuthApi,
+ checkPinterestAuthApi,
+ checkTiktokAuthApi,
+ checkWxGzAuthApi,
+ getFacebookAuthUrlApi,
+ getInstagramAuthUrlApi,
+ getLinkedInAuthUrlApi,
+ getPinterestAuthUrlApi,
+ getThreadsAuthUrlApi,
+ getTiktokAuthUrlApi,
+ getWxGzhAuthUrlApi,
+ getYouTubeAuthUrlApi,
+} from '@/api/platAuth'
+import { AccountPlatInfoMap, PlatType } from '@/app/config/platConfig'
+import i18next from '@/app/i18n/client'
+import { toast } from '@/lib/toast'
+import { useAccountStore } from '@/store/account'
+import { PLUGIN_SUPPORTED_PLATFORMS, PluginStatus, usePluginStore } from '@/store/plugin'
+import { useUserStore } from '@/store/user'
+import { DEFAULT_AUTH_COUNTDOWN, POLLING_INTERVAL } from './types'
+
+/**
+ * 获取翻译文本
+ */
+function t(key: string, options?: Record<string, string>): string {
+ return i18next.t(key, { ns: 'account', ...options })
+}
+
+/**
+ * 检查平台是否为插件支持的平台
+ */
+function isPluginSupportedPlatform(platform: PlatType): platform is PluginPlatformType {
+ return PLUGIN_SUPPORTED_PLATFORMS.includes(platform as PluginPlatformType)
+}
+
+/** 初始授权状态 */
+const initialAuthState: AuthState = {
+ platform: null,
+ taskId: null,
+ authUrl: null,
+ countdown: DEFAULT_AUTH_COUNTDOWN,
+ isPolling: false,
+ error: null,
+ isTimeout: false,
+}
+
+/** 初始状态 */
+const initialState: ChannelManagerState = {
+ open: false,
+ currentView: 'main',
+ selectedPlatform: 'all',
+ authState: { ...initialAuthState },
+ targetSpaceId: null,
+ onAuthSuccess: null,
+ isNewUser: false,
+}
+
+function getInitialState(): ChannelManagerState {
+ return lodash.cloneDeep(initialState)
+}
+
+/** 轮询定时器ID */
+let pollingIntervalId: ReturnType<typeof setInterval> | null = null
+/** 倒计时定时器ID */
+let countdownIntervalId: ReturnType<typeof setInterval> | null = null
+
+/**
+ * 清理所有定时器
+ */
+function clearAllTimers() {
+ if (pollingIntervalId) {
+ clearInterval(pollingIntervalId)
+ pollingIntervalId = null
+ }
+ if (countdownIntervalId) {
+ clearInterval(countdownIntervalId)
+ countdownIntervalId = null
+ }
+}
+
+/**
+ * 根据平台类型获取授权URL
+ */
+async function getAuthUrl(
+ platform: PlatType,
+ spaceId?: string,
+): Promise<AuthUrlResponse | null> {
+ try {
+ let res: any
+
+ switch (platform) {
+ case PlatType.KWAI:
+ res = await createKwaiAuth('pc', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.BILIBILI:
+ res = await apiGetBilibiliLoginUrl('pc', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.YouTube:
+ res = await getYouTubeAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.Tiktok:
+ res = await getTiktokAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.Facebook:
+ res = await getFacebookAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.Instagram:
+ res = await getInstagramAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.Threads:
+ res = await getThreadsAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.LinkedIn:
+ res = await getLinkedInAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.Twitter:
+ // Twitter 使用与 Meta 系列相同的授权逻辑
+ res = await getLinkedInAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ case PlatType.WxGzh:
+ res = await getWxGzhAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.id || res.data.taskId }
+ }
+ break
+
+ case PlatType.Pinterest:
+ res = await getPinterestAuthUrlApi('', spaceId)
+ if (res?.data) {
+ return { url: res.data.url, taskId: res.data.taskId }
+ }
+ break
+
+ default:
+ console.warn(`Platform ${platform} not supported for OAuth`)
+ return null
+ }
+
+ // 检查登录状态
+ if (res?.code === 1) {
+ useUserStore.getState().logout()
+ return null
+ }
+
+ return null
+ }
+ catch (error) {
+ console.error(`Failed to get auth URL for ${platform}:`, error)
+ return null
+ }
+}
+
+/**
+ * 根据平台类型检查授权状态
+ */
+async function checkAuthStatus(
+ platform: PlatType,
+ taskId: string,
+): Promise<{ status: number, data?: any } | null> {
+ try {
+ let res: any
+
+ switch (platform) {
+ case PlatType.KWAI:
+ res = await getKwaiAuthStatus(taskId)
+ break
+
+ case PlatType.BILIBILI:
+ res = await apiCheckBilibiliAuth(taskId)
+ break
+
+ case PlatType.YouTube:
+ res = await apiCheckYoutubeAuth(taskId)
+ break
+
+ case PlatType.Tiktok:
+ res = await checkTiktokAuthApi(taskId)
+ break
+
+ case PlatType.Facebook:
+ case PlatType.Instagram:
+ case PlatType.Threads:
+ case PlatType.LinkedIn:
+ res = await checkMetaAuthApi(taskId)
+ break
+
+ case PlatType.WxGzh:
+ res = await checkWxGzAuthApi(taskId)
+ break
+
+ case PlatType.Pinterest:
+ res = await checkPinterestAuthApi(taskId)
+ break
+
+ default:
+ return null
+ }
+
+ if (res?.data) {
+ return { status: res.data.status, data: res.data }
+ }
+
+ return null
+ }
+ catch (error) {
+ console.error(`Failed to check auth status for ${platform}:`, error)
+ return null
+ }
+}
+
+export const useChannelManagerStore = create(
+ combine(getInitialState(), (set, get) => {
+ const methods: ChannelManagerMethods = {
+ /** 打开弹框(默认显示主页) */
+ openModal() {
+ const accountList = useAccountStore.getState().accountList
+ const isNewUser = accountList.length === 0
+
+ set({
+ open: true,
+ currentView: isNewUser ? 'connect-list' : 'main',
+ isNewUser,
+ })
+ },
+
+ /** 关闭弹框 */
+ closeModal() {
+ // 停止所有授权相关的定时器
+ methods.stopAuth()
+ set({
+ open: false,
+ currentView: 'main',
+ selectedPlatform: 'all',
+ authState: { ...initialAuthState },
+ targetSpaceId: null,
+ })
+ },
+
+ /** 直接打开并进入指定平台的授权流程 */
+ openAndAuth(platform: PlatType, spaceId?: string) {
+ // 如果没有指定空间,使用默认空间
+ const accountGroupList = useAccountStore.getState().accountGroupList
+ const defaultSpace = accountGroupList.find(g => g.isDefault)
+ const targetSpaceId = spaceId || defaultSpace?.id || null
+
+ set({
+ open: true,
+ currentView: 'auth-loading',
+ targetSpaceId,
+ })
+
+ // 开始授权流程
+ methods.startAuth(platform, targetSpaceId || undefined)
+ },
+
+ /** 直接打开并进入连接新频道列表页 */
+ openConnectList(spaceId?: string) {
+ // 如果没有指定空间,使用默认空间
+ const accountGroupList = useAccountStore.getState().accountGroupList
+ const defaultSpace = accountGroupList.find(g => g.isDefault)
+ const targetSpaceId = spaceId || defaultSpace?.id || null
+
+ set({
+ open: true,
+ currentView: 'connect-list',
+ targetSpaceId,
+ isNewUser: false,
+ })
+ },
+
+ /** 设置授权成功回调 */
+ setOnAuthSuccess(callback) {
+ set({ onAuthSuccess: callback })
+ },
+
+ /** 切换视图 */
+ setCurrentView(view: ChannelManagerView) {
+ set({ currentView: view })
+ },
+
+ /** 设置侧边栏选中的平台 */
+ setSelectedPlatform(platform) {
+ set({ selectedPlatform: platform })
+ },
+
+ /** 设置目标空间ID */
+ setTargetSpaceId(spaceId) {
+ set({ targetSpaceId: spaceId })
+ },
+
+ /** 开始授权流程 */
+ async startAuth(platform: PlatType, spaceId?: string) {
+ // 清理之前的定时器
+ clearAllTimers()
+
+ // 设置授权状态
+ set({
+ currentView: 'auth-loading',
+ authState: {
+ ...initialAuthState,
+ platform,
+ isPolling: true,
+ },
+ targetSpaceId: spaceId || get().targetSpaceId,
+ })
+
+ // 检查是否为插件支持的平台
+ if (isPluginSupportedPlatform(platform)) {
+ await methods.handlePluginPlatformAuth(platform, spaceId)
+ return
+ }
+
+ // OAuth授权流程
+ try {
+ // 获取授权URL
+ const authData = await getAuthUrl(platform, spaceId)
+
+ if (!authData) {
+ set({
+ authState: {
+ ...get().authState,
+ error: 'Failed to get auth URL',
+ isPolling: false,
+ },
+ })
+ return
+ }
+
+ // 更新状态并打开授权窗口
+ set({
+ authState: {
+ ...get().authState,
+ taskId: authData.taskId,
+ authUrl: authData.url,
+ },
+ })
+
+ // 打开授权窗口
+ window.open(authData.url)
+
+ // 启动倒计时
+ countdownIntervalId = setInterval(() => {
+ const currentState = get()
+ const newCountdown = currentState.authState.countdown - 1
+
+ if (newCountdown <= 0) {
+ // 超时
+ methods.stopAuth()
+ set({
+ authState: {
+ ...currentState.authState,
+ isTimeout: true,
+ isPolling: false,
+ countdown: 0,
+ },
+ })
+ }
+ else {
+ set({
+ authState: {
+ ...currentState.authState,
+ countdown: newCountdown,
+ },
+ })
+ }
+ }, 1000)
+
+ // 启动轮询
+ pollingIntervalId = setInterval(async () => {
+ const currentState = get()
+ const { authState } = currentState
+
+ if (!authState.taskId || !authState.platform) {
+ return
+ }
+
+ const result = await checkAuthStatus(
+ authState.platform,
+ authState.taskId,
+ )
+
+ if (result?.status === 1) {
+ // 授权成功
+ clearAllTimers()
+
+ // 刷新账户列表
+ await useAccountStore.getState().getAccountList()
+
+ // 获取新添加的账户
+ const accountList = useAccountStore.getState().accountList
+ const newAccount = accountList.find(
+ acc => acc.type === authState.platform,
+ )
+
+ if (newAccount) {
+ methods.handleAuthSuccess(newAccount)
+ }
+ else {
+ // 没找到新账户,但也算成功
+ set({
+ currentView: 'main',
+ selectedPlatform: authState.platform || 'all',
+ authState: { ...initialAuthState },
+ isNewUser: false,
+ })
+ }
+ }
+ }, POLLING_INTERVAL)
+ }
+ catch (error) {
+ console.error('Auth error:', error)
+ set({
+ authState: {
+ ...get().authState,
+ error: error instanceof Error ? error.message : 'Unknown error',
+ isPolling: false,
+ },
+ })
+ }
+ },
+
+ /**
+ * 处理插件平台的授权(小红书、抖音等)
+ * 这些平台通过浏览器插件同步账号,而非OAuth
+ */
+ async handlePluginPlatformAuth(platform: PluginPlatformType, spaceId?: string) {
+ const pluginStore = usePluginStore.getState()
+ const platformName = AccountPlatInfoMap.get(platform)?.name || platform
+
+ // 检查插件是否就绪
+ if (pluginStore.status !== PluginStatus.READY) {
+ // 插件未就绪,重置状态并打开插件弹框
+ set({
+ currentView: 'connect-list',
+ authState: { ...initialAuthState },
+ })
+ toast.warning(t('channelManager.pluginNotReady', { platform: platformName }))
+ // 打开插件弹框引导用户安装/授权
+ pluginStore.openPluginModal()
+ return
+ }
+
+ // 检查是否有账号
+ const account = pluginStore.platformAccounts[platform]
+ if (!account) {
+ // 平台未登录,重置状态并打开插件弹框
+ set({
+ currentView: 'connect-list',
+ authState: { ...initialAuthState },
+ })
+ toast.warning(t('channelManager.platformNotLoggedIn', { platform: platformName }))
+ // 打开插件弹框引导用户登录
+ pluginStore.openPluginModal()
+ return
+ }
+
+ // 同步账号到数据库
+ try {
+ const result = await pluginStore.syncAccountToDatabase(platform, spaceId)
+
+ if (result) {
+ // 同步成功
+ toast.success(t('channelManager.syncSuccess'))
+
+ // 刷新账户列表
+ await useAccountStore.getState().getAccountList()
+
+ // 处理授权成功
+ methods.handleAuthSuccess(result)
+ }
+ else {
+ set({
+ currentView: 'connect-list',
+ authState: { ...initialAuthState },
+ })
+ toast.error(t('channelManager.syncFailed'))
+ }
+ }
+ catch (error) {
+ console.error('Plugin auth error:', error)
+ set({
+ currentView: 'connect-list',
+ authState: { ...initialAuthState },
+ })
+ toast.error(t('channelManager.syncFailed'))
+ }
+ },
+
+ /** 停止授权(取消/超时) */
+ stopAuth() {
+ clearAllTimers()
+ set({
+ authState: {
+ ...get().authState,
+ isPolling: false,
+ },
+ })
+ },
+
+ /** 重新打开授权页面 */
+ reopenAuthWindow() {
+ const { authState } = get()
+ if (authState.authUrl) {
+ window.open(authState.authUrl)
+ }
+ },
+
+ /** 授权成功处理 */
+ handleAuthSuccess(account: SocialAccount) {
+ const { authState, onAuthSuccess } = get()
+ const platform = authState.platform
+
+ // 调用外部回调
+ if (onAuthSuccess && platform) {
+ onAuthSuccess(account, platform)
+ }
+
+ // 重置状态,跳转到主页并选中该平台
+ set({
+ currentView: 'main',
+ selectedPlatform: platform || 'all',
+ authState: { ...initialAuthState },
+ isNewUser: false,
+ })
+ },
+
+ /** 重置状态 */
+ reset() {
+ clearAllTimers()
+ set(getInitialState())
+ },
+
+ /** 检查是否为新用户 */
+ checkIsNewUser() {
+ const accountList = useAccountStore.getState().accountList
+ set({ isNewUser: accountList.length === 0 })
+ },
+ }
+
+ return methods
+ }),
+)
diff --git a/project/web/src/components/ChannelManager/channelStore.ts b/project/web/src/components/ChannelManager/channelStore.ts
index 3a0c9713..918480a8 100644
--- a/project/web/src/components/ChannelManager/channelStore.ts
+++ b/project/web/src/components/ChannelManager/channelStore.ts
@@ -1,28 +1,25 @@
/**
* ChannelManager - 频道管理器局部状态管理
- * 只管理弹窗显示隐藏状态,所有数据使用全局account store
+ * 只管理弹窗显示隐藏状态,所有数据使用全局 account store
*/
import { create } from 'zustand'
import { combine } from 'zustand/middleware'
export interface ChannelManagerState {
+ /** 弹窗是否打开 */
open: boolean
- _hasHydrated: boolean
}
const initialState: ChannelManagerState = {
open: false,
- _hasHydrated: true,
}
export const useChannelManagerStore = create(
- combine(initialState, (set, get) => {
- return {
- // 设置弹窗开关
- setOpen: (open: boolean) => {
- set({ open })
- },
- }
- }),
+ combine(initialState, set => ({
+ /** 设置弹窗开关状态 */
+ setOpen: (open: boolean) => {
+ set({ open })
+ },
+ })),
)
diff --git a/project/web/src/components/ChannelManager/components/AuthLoadingPage.tsx b/project/web/src/components/ChannelManager/components/AuthLoadingPage.tsx
new file mode 100644
index 00000000..e6fbdf1b
--- /dev/null
+++ b/project/web/src/components/ChannelManager/components/AuthLoadingPage.tsx
@@ -0,0 +1,169 @@
+/**
+ * AuthLoadingPage - 授权Loading页
+ * 显示授权等待状态、倒计时和操作按钮
+ */
+
+'use client'
+
+import { AlertCircle, ExternalLink, Loader2, RefreshCw, X } from 'lucide-react'
+import { useMemo } from 'react'
+import { useShallow } from 'zustand/react/shallow'
+import { AccountPlatInfoMap } from '@/app/config/platConfig'
+import { useTransClient } from '@/app/i18n/client'
+import { Button } from '@/components/ui/button'
+import { useChannelManagerStore } from '../channelManagerStore'
+
+export function AuthLoadingPage() {
+ const { t } = useTransClient('account')
+
+ const { authState, setCurrentView, reopenAuthWindow, stopAuth, startAuth }
+ = useChannelManagerStore(
+ useShallow(state => ({
+ authState: state.authState,
+ setCurrentView: state.setCurrentView,
+ reopenAuthWindow: state.reopenAuthWindow,
+ stopAuth: state.stopAuth,
+ startAuth: state.startAuth,
+ })),
+ )
+
+ const { platform, countdown, isPolling, error, isTimeout } = authState
+
+ // 获取平台信息
+ const platformInfo = useMemo(() => {
+ if (!platform)
+ return null
+ return AccountPlatInfoMap.get(platform)
+ }, [platform])
+
+ // 格式化倒计时
+ const formattedCountdown = useMemo(() => {
+ const minutes = Math.floor(countdown / 60)
+ const seconds = countdown % 60
+ return `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`
+ }, [countdown])
+
+ // 处理取消
+ const handleCancel = () => {
+ stopAuth()
+ setCurrentView('connect-list')
+ }
+
+ // 处理重试
+ const handleRetry = () => {
+ if (platform) {
+ startAuth(platform)
+ }
+ }
+
+ // 如果没有平台信息,显示错误
+ if (!platformInfo || !platform) {
+ return (
+ <div className="flex h-full flex-col items-center justify-center p-8">
+ <AlertCircle className="mb-4 h-16 w-16 text-destructive" />
+ <p className="text-lg text-muted-foreground">{t('channelManager.authError')}</p>
+ <Button className="mt-4 cursor-pointer" onClick={handleCancel}>
+ {t('common.back')}
+ </Button>
+ </div>
+ )
+ }
+
+ // 超时或错误状态
+ if (isTimeout || error) {
+ return (
+ <div className="flex h-full flex-col items-center justify-center p-8">
+ <div className="mb-6 flex h-24 w-24 items-center justify-center rounded-full bg-muted">
+ <img
+ src={platformInfo.icon}
+ alt={platformInfo.name}
+ className="h-14 w-14 object-contain opacity-50 grayscale"
+ />
+ </div>
+
+ <div className="mb-2 flex items-center gap-2 text-destructive">
+ <AlertCircle className="h-5 w-5" />
+ <span className="text-lg font-medium">
+ {isTimeout
+ ? t('channelManager.authTimeout')
+ : t('channelManager.authFailed')}
+ </span>
+ </div>
+
+ <p className="mb-6 text-center text-sm text-muted-foreground">
+ {isTimeout
+ ? t('channelManager.authTimeoutTip')
+ : error || t('channelManager.authFailedTip')}
+ </p>
+
+ <div className="flex gap-3">
+ <Button variant="outline" className="cursor-pointer" onClick={handleCancel}>
+ {t('cancel')}
+ </Button>
+ <Button className="cursor-pointer" onClick={handleRetry}>
+ <RefreshCw className="mr-2 h-4 w-4" />
+ {t('channelManager.retry')}
+ </Button>
+ </div>
+ </div>
+ )
+ }
+
+ // 正在授权状态
+ return (
+ <div className="flex h-full flex-col items-center justify-center p-8">
+ {/* 平台图标和loading动画 */}
+ <div className="relative mb-8">
+ <div className="flex h-28 w-28 items-center justify-center rounded-full bg-gradient-to-br from-primary/10 to-primary/5">
+ <img
+ src={platformInfo.icon}
+ alt={platformInfo.name}
+ className="h-16 w-16 object-contain"
+ />
+ </div>
+ {/* 旋转边框动画 */}
+ {isPolling && (
+ <div className="absolute inset-0 animate-spin rounded-full border-4 border-primary/20 border-t-primary" style={{ animationDuration: '2s' }} />
+ )}
+ </div>
+
+ {/* 标题 */}
+ <h2 className="mb-2 text-xl font-semibold">
+ {t('channelManager.connecting', { platform: platformInfo.name })}
+ </h2>
+
+ {/* 提示文案 */}
+ <p className="mb-6 text-center text-sm text-muted-foreground">
+ {t('channelManager.authWaitingTip')}
+ </p>
+
+ {/* 倒计时 */}
+ <div className="mb-8 flex items-center gap-2">
+ <Loader2 className="h-4 w-4 animate-spin text-muted-foreground" />
+ <span className="text-sm text-muted-foreground">
+ {t('channelManager.remainingTime')}
+ </span>
+ <span className="font-mono text-2xl font-bold text-primary">
+ {formattedCountdown}
+ </span>
+ </div>
+
+ {/* 操作按钮 */}
+ <div className="flex gap-3">
+ <Button variant="outline" className="cursor-pointer" onClick={handleCancel}>
+ <X className="mr-2 h-4 w-4" />
+ {t('cancel')}
+ </Button>
+ <Button className="cursor-pointer" onClick={reopenAuthWindow}>
+ <ExternalLink className="mr-2 h-4 w-4" />
+ {t('channelManager.reopenAuthPage')}
+ </Button>
+ </div>
+
+ {/* 底部提示 */}
+ <p className="mt-8 text-center text-xs text-muted-foreground">
+ {t('channelManager.autoRedirectTip')}
+ </p>
+ </div>
+ )
+}
diff --git a/project/web/src/components/ChannelManager/components/ChannelItem.tsx b/project/web/src/components/ChannelManager/components/ChannelItem.tsx
index 9efdab4c..83ed9202 100644
--- a/project/web/src/components/ChannelManager/components/ChannelItem.tsx
+++ b/project/web/src/components/ChannelManager/components/ChannelItem.tsx
@@ -4,20 +4,23 @@
* 功能:
* - 显示频道信息(头像、名称、平台、粉丝数等)
* - 处理频道删除操作
+ * - 离线频道显示灰色样式和重新授权按钮
*/
'use client'
import type { SocialAccount } from '@/api/types/account.type'
-import { Loader2, Trash2 } from 'lucide-react'
+import { Loader2, RefreshCw, Trash2 } from 'lucide-react'
import Image from 'next/image'
import AccountStatusView from '@/app/[lng]/accounts/components/AccountsTopNav/components/AccountStatusView'
+import { AccountStatus } from '@/app/config/accountConfig'
import { AccountPlatInfoMap } from '@/app/config/platConfig'
import { useTransClient } from '@/app/i18n/client'
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
import { Button } from '@/components/ui/button'
import { getOssUrl } from '@/utils/oss'
+import { useChannelManagerStore } from '../channelManagerStore'
interface ChannelItemProps {
channel: SocialAccount
@@ -28,21 +31,28 @@ interface ChannelItemProps {
export function ChannelItem({ channel, onDelete, deleteLoading }: ChannelItemProps) {
const platInfo = AccountPlatInfoMap.get(channel.type)
const isDeleting = deleteLoading === channel.id
+ const isOffline = channel.status !== AccountStatus.USABLE
const { t } = useTransClient('account')
+ const openAndAuth = useChannelManagerStore(state => state.openAndAuth)
+
+ // 处理重新授权
+ const handleReauth = () => {
+ openAndAuth(channel.type, channel.groupId)
+ }
return (
<div
className={`flex items-center gap-3 p-4 hover:bg-accent/30 transition-colors group relative ${
isDeleting ? 'opacity-50 cursor-not-allowed' : ''
- }`}
+ } ${isOffline ? 'opacity-60' : ''}`}
>
- <Avatar className="h-10 w-10 shrink-0">
+ <Avatar className={`h-10 w-10 shrink-0 ${isOffline ? 'grayscale' : ''}`}>
<AvatarImage src={getOssUrl(channel.avatar)} alt={channel.nickname} />
<AvatarFallback>{channel.nickname?.[0] || channel.account?.[0]}</AvatarFallback>
</Avatar>
<div className="flex-1 min-w-0">
- <div className="font-medium text-sm truncate">
+ <div className={`font-medium text-sm truncate ${isOffline ? 'text-muted-foreground' : ''}`}>
{channel.nickname || channel.account}
</div>
<div className="flex items-center gap-2 mt-1 flex-wrap">
@@ -52,7 +62,7 @@ export function ChannelItem({ channel, onDelete, deleteLoading }: ChannelItemPro
alt={platInfo.name}
width={14}
height={14}
- className="rounded-sm shrink-0"
+ className={`rounded-sm shrink-0 ${isOffline ? 'grayscale' : ''}`}
/>
)}
<span className="text-xs text-muted-foreground shrink-0">
@@ -67,6 +77,19 @@ export function ChannelItem({ channel, onDelete, deleteLoading }: ChannelItemPro
</div>
</div>
+ {/* 离线状态显示重新授权按钮 */}
+ {isOffline && !isDeleting && (
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 cursor-pointer shrink-0"
+ onClick={handleReauth}
+ >
+ <RefreshCw className="mr-1 h-3 w-3" />
+ {t('channelManager.reauth')}
+ </Button>
+ )}
+
{isDeleting ? (
<div className="p-1">
<Loader2 className="h-4 w-4 text-muted-foreground animate-spin" />
diff --git a/project/web/src/components/ChannelManager/components/ChannelSidebar.tsx b/project/web/src/components/ChannelManager/components/ChannelSidebar.tsx
new file mode 100644
index 00000000..1041e932
--- /dev/null
+++ b/project/web/src/components/ChannelManager/components/ChannelSidebar.tsx
@@ -0,0 +1,237 @@
+/**
+ * ChannelSidebar - 频道类型侧边栏
+ * 显示"全部频道"和各平台列表,支持过滤和快速授权
+ */
+
+'use client'
+
+import { Layers, Plus, Puzzle } from 'lucide-react'
+import { useMemo } from 'react'
+import { useShallow } from 'zustand/react/shallow'
+import { AccountPlatInfoArr, AccountPlatInfoMap, PlatType } from '@/app/config/platConfig'
+import { useTransClient } from '@/app/i18n/client'
+import { Button } from '@/components/ui/button'
+import { ScrollArea } from '@/components/ui/scroll-area'
+import { cn } from '@/lib/utils'
+import { useAccountStore } from '@/store/account'
+import { PLUGIN_SUPPORTED_PLATFORMS } from '@/store/plugin'
+import { useChannelManagerStore } from '../channelManagerStore'
+
+/**
+ * 检查平台是否需要插件支持
+ */
+function isPluginPlatform(platform: PlatType): boolean {
+ return PLUGIN_SUPPORTED_PLATFORMS.includes(platform as any)
+}
+
+export function ChannelSidebar() {
+ const { t } = useTransClient('account')
+
+ const { selectedPlatform, setSelectedPlatform, setCurrentView, startAuth, setTargetSpaceId }
+ = useChannelManagerStore(
+ useShallow(state => ({
+ selectedPlatform: state.selectedPlatform,
+ setSelectedPlatform: state.setSelectedPlatform,
+ setCurrentView: state.setCurrentView,
+ startAuth: state.startAuth,
+ setTargetSpaceId: state.setTargetSpaceId,
+ })),
+ )
+
+ const { accountList, accountGroupList } = useAccountStore(
+ useShallow(state => ({
+ accountList: state.accountList,
+ accountGroupList: state.accountGroupList,
+ })),
+ )
+
+ // 从配置获取支持的平台列表
+ const allPlatforms = useMemo(() => {
+ return AccountPlatInfoArr.map(([platform]) => platform)
+ }, [])
+
+ // 统计各平台账号数量
+ const platformAccountCounts = useMemo(() => {
+ const counts = new Map<PlatType, number>()
+ for (const account of accountList) {
+ const current = counts.get(account.type) || 0
+ counts.set(account.type, current + 1)
+ }
+ return counts
+ }, [accountList])
+
+ // 获取有账号的平台列表
+ const platformsWithAccounts = useMemo(() => {
+ return allPlatforms.filter(platform => (platformAccountCounts.get(platform) || 0) > 0)
+ }, [allPlatforms, platformAccountCounts])
+
+ // 获取无账号的平台列表
+ const platformsWithoutAccounts = useMemo(() => {
+ return allPlatforms.filter(platform => (platformAccountCounts.get(platform) || 0) === 0)
+ }, [allPlatforms, platformAccountCounts])
+
+ // 处理平台点击
+ const handlePlatformClick = (platform: PlatType) => {
+ const hasAccount = (platformAccountCounts.get(platform) || 0) > 0
+
+ if (hasAccount) {
+ // 有账号:切换过滤
+ setSelectedPlatform(platform)
+ }
+ else {
+ // 无账号:进入授权流程
+ const defaultSpace = accountGroupList.find(g => g.isDefault)
+ if (defaultSpace) {
+ setTargetSpaceId(defaultSpace.id)
+ }
+ startAuth(platform, defaultSpace?.id)
+ }
+ }
+
+ // 处理"连接新频道"按钮点击
+ const handleConnectNewChannel = () => {
+ setCurrentView('connect-list')
+ }
+
+ return (
+ <div className="flex h-full w-48 flex-col border-r bg-muted/30">
+ {/* 侧边栏标题 */}
+ <div className="border-b p-3">
+ <h3 className="text-sm font-medium text-foreground">
+ {t('channelManager.platforms')}
+ </h3>
+ </div>
+
+ <ScrollArea className="flex-1">
+ <div className="space-y-1 p-2">
+ {/* 全部频道选项 */}
+ <button
+ type="button"
+ onClick={() => setSelectedPlatform('all')}
+ className={cn(
+ 'flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors',
+ selectedPlatform === 'all'
+ ? 'bg-primary text-primary-foreground font-medium'
+ : 'hover:bg-muted/60',
+ )}
+ >
+ <Layers className="h-4 w-4" />
+ <span className="flex-1 text-left">{t('channelManager.allChannels')}</span>
+ <span
+ className={cn(
+ 'rounded-full px-2 py-0.5 text-xs',
+ selectedPlatform === 'all'
+ ? 'bg-primary-foreground/20 text-primary-foreground'
+ : 'bg-muted text-muted-foreground',
+ )}
+ >
+ {accountList.length}
+ </span>
+ </button>
+
+ {/* 分隔线 */}
+ {platformsWithAccounts.length > 0 && (
+ <div className="my-2 border-t" />
+ )}
+
+ {/* 有账号的平台 */}
+ {platformsWithAccounts.map((platform) => {
+ const info = AccountPlatInfoMap.get(platform)
+ const count = platformAccountCounts.get(platform) || 0
+ const needsPlugin = isPluginPlatform(platform)
+
+ if (!info)
+ return null
+
+ return (
+ <button
+ key={platform}
+ type="button"
+ onClick={() => handlePlatformClick(platform)}
+ className={cn(
+ 'flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors',
+ selectedPlatform === platform
+ ? 'bg-primary text-primary-foreground font-medium'
+ : 'hover:bg-muted/60',
+ )}
+ >
+ <div className="relative shrink-0">
+ <img
+ src={typeof info.icon === 'string' ? info.icon : info.icon}
+ alt={info.name}
+ className="h-4 w-4 object-contain"
+ />
+ {needsPlugin && (
+ <Puzzle className="absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 text-muted-foreground" />
+ )}
+ </div>
+ <span className="flex-1 truncate text-left">{info.name}</span>
+ <span
+ className={cn(
+ 'rounded-full px-2 py-0.5 text-xs',
+ selectedPlatform === platform
+ ? 'bg-primary-foreground/20 text-primary-foreground'
+ : 'bg-muted text-muted-foreground',
+ )}
+ >
+ {count}
+ </span>
+ </button>
+ )
+ })}
+
+ {/* 无账号的平台(灰色显示) */}
+ {platformsWithoutAccounts.length > 0 && (
+ <>
+ <div className="my-2 border-t" />
+ <div className="px-3 py-1 text-xs text-muted-foreground">
+ {t('channelManager.availablePlatforms')}
+ </div>
+ {platformsWithoutAccounts.map((platform) => {
+ const info = AccountPlatInfoMap.get(platform)
+ const needsPlugin = isPluginPlatform(platform)
+
+ if (!info)
+ return null
+
+ return (
+ <button
+ key={platform}
+ type="button"
+ onClick={() => handlePlatformClick(platform)}
+ className="flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-muted-foreground opacity-60 transition-colors hover:bg-muted/60 hover:opacity-100"
+ >
+ <div className="relative shrink-0">
+ <img
+ src={typeof info.icon === 'string' ? info.icon : info.icon}
+ alt={info.name}
+ className="h-4 w-4 object-contain grayscale"
+ />
+ {needsPlugin && (
+ <Puzzle className="absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5" />
+ )}
+ </div>
+ <span className="flex-1 truncate text-left">{info.name}</span>
+ <Plus className="h-3 w-3" />
+ </button>
+ )
+ })}
+ </>
+ )}
+ </div>
+ </ScrollArea>
+
+ {/* 底部:连接新频道按钮 */}
+ <div className="border-t p-3">
+ <Button
+ variant="outline"
+ className="w-full cursor-pointer"
+ onClick={handleConnectNewChannel}
+ >
+ <Plus className="mr-2 h-4 w-4" />
+ {t('channelManager.connectNewChannel')}
+ </Button>
+ </div>
+ </div>
+ )
+}
diff --git a/project/web/src/components/ChannelManager/components/ConnectChannelList.tsx b/project/web/src/components/ChannelManager/components/ConnectChannelList.tsx
new file mode 100644
index 00000000..527ce788
--- /dev/null
+++ b/project/web/src/components/ChannelManager/components/ConnectChannelList.tsx
@@ -0,0 +1,166 @@
+/**
+ * ConnectChannelList - 连接频道列表页
+ * 显示所有可连接的平台,点击进入授权流程
+ */
+
+'use client'
+
+import type { PlatType } from '@/app/config/platConfig'
+import { ArrowLeft, Sparkles } from 'lucide-react'
+import { useShallow } from 'zustand/react/shallow'
+import { AccountPlatInfoArr } from '@/app/config/platConfig'
+import { useTransClient } from '@/app/i18n/client'
+import { Button } from '@/components/ui/button'
+import { ScrollArea } from '@/components/ui/scroll-area'
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from '@/components/ui/tooltip'
+import { useAccountStore } from '@/store/account'
+import { useChannelManagerStore } from '../channelManagerStore'
+
+export function ConnectChannelList() {
+ const { t } = useTransClient('account')
+
+ const { isNewUser, setCurrentView, startAuth, targetSpaceId, setTargetSpaceId }
+ = useChannelManagerStore(
+ useShallow(state => ({
+ isNewUser: state.isNewUser,
+ setCurrentView: state.setCurrentView,
+ startAuth: state.startAuth,
+ targetSpaceId: state.targetSpaceId,
+ setTargetSpaceId: state.setTargetSpaceId,
+ })),
+ )
+
+ const { accountGroupList } = useAccountStore(
+ useShallow(state => ({
+ accountGroupList: state.accountGroupList,
+ })),
+ )
+
+ // 返回主页
+ const handleBack = () => {
+ setCurrentView('main')
+ }
+
+ // 处理平台点击
+ const handlePlatformClick = (platform: PlatType) => {
+ // 如果没有设置目标空间,使用默认空间
+ let spaceId = targetSpaceId
+ if (!spaceId) {
+ const defaultSpace = accountGroupList.find(g => g.isDefault)
+ spaceId = defaultSpace?.id || null
+ if (spaceId) {
+ setTargetSpaceId(spaceId)
+ }
+ }
+
+ // 开始授权流程
+ startAuth(platform, spaceId || undefined)
+ }
+
+ return (
+ <div className="flex h-full flex-col">
+ {/* 头部 - 返回按钮 */}
+ <div className="flex items-center gap-3 border-b px-4 py-3">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="cursor-pointer"
+ onClick={handleBack}
+ >
+ <ArrowLeft className="mr-1 h-4 w-4" />
+ {t('channelManager.backToChannels')}
+ </Button>
+ </div>
+
+ {/* 新用户提示 */}
+ {isNewUser && (
+ <div className="mx-4 mt-4 flex items-center gap-3 rounded-lg border bg-muted/30 p-4">
+ <Sparkles className="h-6 w-6 shrink-0 text-muted-foreground" />
+ <p className="text-sm text-muted-foreground">
+ {t('channelManager.newUserTip')}
+ </p>
+ </div>
+ )}
+
+ {/* 平台网格 */}
+ <ScrollArea className="flex-1 p-4">
+ <div
+ className="
+ grid w-full gap-2 sm:gap-3
+ pt-3
+ grid-cols-3
+ sm:grid-cols-4
+ md:grid-cols-5
+ lg:grid-cols-6
+ "
+ >
+ <TooltipProvider>
+ {AccountPlatInfoArr.map(([key, value]) => {
+ return (
+ <Tooltip key={key}>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ className="
+ group relative flex h-[90px] min-w-0
+ w-full cursor-pointer flex-col items-center
+ justify-center overflow-hidden whitespace-normal
+ rounded-lg border border-border bg-card
+ p-2 transition-all duration-200
+ hover:-translate-y-0.5 hover:border-foreground/30 hover:bg-accent
+ hover:shadow-md
+ active:translate-y-0 active:scale-[0.98]
+ sm:h-[100px] sm:rounded-xl sm:p-3
+ md:h-[110px]
+ "
+ onClick={() => handlePlatformClick(key as PlatType)}
+ >
+ {/* 光泽效果 */}
+ <div className="absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-white/40 to-transparent transition-transform duration-700 group-hover:translate-x-full" />
+
+ <div className="relative z-10 flex w-full flex-col items-center gap-1.5 sm:gap-2">
+ <img
+ src={value.icon}
+ className="
+ h-9 w-9 object-contain
+ drop-shadow-md filter transition-all
+ duration-300 group-hover:rotate-[5deg]
+ group-hover:scale-110
+ sm:h-10 sm:w-10
+ md:h-11 md:w-11
+ "
+ alt={value.name}
+ />
+ <span
+ className="
+ line-clamp-2 w-full text-center
+ text-[11px] font-medium leading-tight
+ text-foreground transition-all duration-300
+ group-hover:font-semibold
+ sm:text-xs
+ "
+ >
+ {value.name}
+ </span>
+ </div>
+ </Button>
+ </TooltipTrigger>
+ {value.tips?.account && (
+ <TooltipContent className="max-w-[200px] text-xs">
+ <p>{value.tips.account}</p>
+ </TooltipContent>
+ )}
+ </Tooltip>
+ )
+ })}
+ </TooltipProvider>
+ </div>
+ </ScrollArea>
+ </div>
+ )
+}
diff --git a/project/web/src/components/ChannelManager/components/CreateSpaceSection.tsx b/project/web/src/components/ChannelManager/components/CreateSpaceSection.tsx
index 253f34d7..6fd4475d 100644
--- a/project/web/src/components/ChannelManager/components/CreateSpaceSection.tsx
+++ b/project/web/src/components/ChannelManager/components/CreateSpaceSection.tsx
@@ -73,7 +73,7 @@ export function CreateSpaceSection({ onSpaceCreated }: CreateSpaceSectionProps)
) : (
<Plus className="h-4 w-4 mr-1" />
)}
- {t('common.confirm', '确认')}
+ {t('deleteConfirm.confirm')}
</Button>
<Button
variant="outline"
@@ -83,18 +83,18 @@ export function CreateSpaceSection({ onSpaceCreated }: CreateSpaceSectionProps)
}}
size="sm"
>
- {t('common.cancel', '取消')}
+ {t('deleteConfirm.cancel')}
</Button>
</>
) : (
<Button
variant="outline"
onClick={() => setShowCreateSpace(true)}
- className="w-full justify-start"
+ className="w-full cursor-pointer justify-start border-dashed"
disabled={showCreateSpace}
>
- <Plus className="h-4 w-4 mr-2" />
- {t('channelManager.createSpace', '新建空间')}
+ <Plus className="mr-2 h-4 w-4" />
+ {t('channelManager.createSpace')}
</Button>
)}
</div>
diff --git a/project/web/src/components/ChannelManager/components/DeleteConfirmDialog.tsx b/project/web/src/components/ChannelManager/components/DeleteConfirmDialog.tsx
index 7f094644..a51de560 100644
--- a/project/web/src/components/ChannelManager/components/DeleteConfirmDialog.tsx
+++ b/project/web/src/components/ChannelManager/components/DeleteConfirmDialog.tsx
@@ -8,7 +8,6 @@
'use client'
-import { LoadingOutlined } from '@ant-design/icons'
import { Loader2 } from 'lucide-react'
import { useTransClient } from '@/app/i18n/client'
import {
diff --git a/project/web/src/components/ChannelManager/components/MainPage.tsx b/project/web/src/components/ChannelManager/components/MainPage.tsx
new file mode 100644
index 00000000..0f0675eb
--- /dev/null
+++ b/project/web/src/components/ChannelManager/components/MainPage.tsx
@@ -0,0 +1,321 @@
+/**
+ * MainPage - 频道管理主页
+ * 左侧侧边栏 + 右侧空间和账号管理
+ */
+
+'use client'
+
+import type { SocialAccount } from '@/api/types/account.type'
+import type { PlatType } from '@/app/config/platConfig'
+import { Plus } from 'lucide-react'
+import { useCallback, useMemo, useState } from 'react'
+import { useShallow } from 'zustand/react/shallow'
+import { deleteAccountApi, deleteAccountGroupApi, updateAccountGroupApi } from '@/api/account'
+import { apiUpdateAccountGroupSortRank } from '@/api/accountSort'
+import { useTransClient } from '@/app/i18n/client'
+import { Button } from '@/components/ui/button'
+import { ScrollArea } from '@/components/ui/scroll-area'
+import { toast } from '@/lib/toast'
+import { useAccountStore } from '@/store/account'
+import { useChannelManagerStore } from '../channelManagerStore'
+import { ChannelSidebar } from './ChannelSidebar'
+import { CreateSpaceSection } from './CreateSpaceSection'
+import { DeleteConfirmDialog } from './DeleteConfirmDialog'
+import { SpaceItem } from './SpaceItem'
+import { SpaceListSkeleton } from './SpaceListSkeleton'
+
+export function MainPage() {
+ const { t } = useTransClient('account')
+
+ const { selectedPlatform, setCurrentView, startAuth, setTargetSpaceId }
+ = useChannelManagerStore(
+ useShallow(state => ({
+ selectedPlatform: state.selectedPlatform,
+ setCurrentView: state.setCurrentView,
+ startAuth: state.startAuth,
+ setTargetSpaceId: state.setTargetSpaceId,
+ })),
+ )
+
+ const {
+ accountGroupList,
+ accountList,
+ accountLoading,
+ getAccountGroup,
+ getAccountList,
+ } = useAccountStore(
+ useShallow(state => ({
+ accountGroupList: state.accountGroupList,
+ accountList: state.accountList,
+ accountLoading: state.accountLoading,
+ getAccountGroup: state.getAccountGroup,
+ getAccountList: state.getAccountList,
+ })),
+ )
+
+ // UI状态
+ const [editingSpace, setEditingSpace] = useState<string | null>(null)
+ const [editSpaceName, setEditSpaceName] = useState('')
+ const [editingSpaceLoading, setEditingSpaceLoading] = useState(false)
+ const [collapsedSpaces, setCollapsedSpaces] = useState<Set<string>>(new Set())
+ const [deleteLoading, setDeleteLoading] = useState<string | null>(null)
+ const [sortingSpaceLoading, setSortingSpaceLoading] = useState<string | null>(null)
+
+ // 删除确认对话框
+ const [deleteDialog, setDeleteDialog] = useState<{
+ open: boolean
+ type: 'space' | 'channel'
+ id: string
+ name: string
+ }>({
+ open: false,
+ type: 'space',
+ id: '',
+ name: '',
+ })
+
+ // 开始编辑空间
+ const startEditingSpace = useCallback((spaceId: string, currentName: string) => {
+ setEditingSpace(spaceId)
+ setEditSpaceName(currentName)
+ }, [])
+
+ // 保存空间编辑
+ const saveSpaceEdit = useCallback(async () => {
+ if (!editingSpace || !editSpaceName.trim())
+ return
+
+ setEditingSpaceLoading(true)
+ try {
+ await updateAccountGroupApi({
+ id: editingSpace,
+ name: editSpaceName.trim(),
+ })
+ await getAccountGroup()
+ toast.success(t('channelManager.editSpaceSuccess'))
+ setEditingSpace(null)
+ setEditSpaceName('')
+ }
+ catch (error) {
+ toast.error(t('channelManager.editSpaceFailed'))
+ }
+ finally {
+ setEditingSpaceLoading(false)
+ }
+ }, [editingSpace, editSpaceName, getAccountGroup, t])
+
+ // 取消编辑
+ const cancelSpaceEdit = useCallback(() => {
+ setEditingSpace(null)
+ setEditSpaceName('')
+ }, [])
+
+ // 删除空间或频道
+ const confirmDelete = useCallback(async () => {
+ setDeleteLoading(deleteDialog.id)
+ try {
+ if (deleteDialog.type === 'space') {
+ await deleteAccountGroupApi([deleteDialog.id])
+ toast.success(t('channelManager.deleteSpaceSuccess'))
+ await getAccountGroup()
+ }
+ else {
+ await deleteAccountApi(deleteDialog.id)
+ toast.success(t('channelManager.deleteChannelSuccess'))
+ await Promise.all([getAccountList(), getAccountGroup()])
+ }
+ setDeleteDialog({ open: false, type: 'space', id: '', name: '' })
+ }
+ catch (error) {
+ const errorType = deleteDialog.type === 'space' ? '空间' : '频道'
+ toast.error(`删除${errorType}失败`)
+ }
+ finally {
+ setDeleteLoading(null)
+ }
+ }, [deleteDialog, getAccountGroup, getAccountList, t])
+
+ // 切换空间折叠状态
+ const toggleSpaceCollapse = useCallback((spaceId: string) => {
+ setCollapsedSpaces((prev) => {
+ const newSet = new Set(prev)
+ if (newSet.has(spaceId)) {
+ newSet.delete(spaceId)
+ }
+ else {
+ newSet.add(spaceId)
+ }
+ return newSet
+ })
+ }, [])
+
+ // 空间排序函数
+ const handleSpaceSort = useCallback(async (spaceId: string, direction: 'up' | 'down') => {
+ if (sortingSpaceLoading)
+ return
+
+ setSortingSpaceLoading(spaceId)
+
+ try {
+ const sortedGroups = [...accountGroupList].sort((a, b) => (a.rank || 0) - (b.rank || 0))
+ const currentIndex = sortedGroups.findIndex(g => g.id === spaceId)
+
+ if (currentIndex === -1)
+ return
+
+ const newIndex = direction === 'up' ? currentIndex - 1 : currentIndex + 1
+ if (newIndex < 0 || newIndex >= sortedGroups.length)
+ return
+
+ [sortedGroups[currentIndex], sortedGroups[newIndex]] = [sortedGroups[newIndex], sortedGroups[currentIndex]]
+
+ const updateList = sortedGroups.map((group, index) => ({
+ id: group.id,
+ rank: index,
+ }))
+
+ await apiUpdateAccountGroupSortRank({ list: updateList })
+ await getAccountGroup()
+ toast.success(t('channelManager.sortSuccess'))
+ }
+ catch (error) {
+ toast.error(t('channelManager.sortFailed'))
+ }
+ finally {
+ setSortingSpaceLoading(null)
+ }
+ }, [accountGroupList, getAccountGroup, t, sortingSpaceLoading])
+
+ // 获取空间下的频道(支持平台过滤)
+ const getChannelsInSpace = useCallback((spaceId: string): SocialAccount[] => {
+ let channels = accountList.filter(account => account.groupId === spaceId)
+
+ // 根据侧边栏选择的平台过滤
+ if (selectedPlatform !== 'all') {
+ channels = channels.filter(account => account.type === selectedPlatform)
+ }
+
+ return channels
+ }, [accountList, selectedPlatform])
+
+ // 处理添加频道点击
+ const handleAddChannel = useCallback((spaceId: string) => {
+ setTargetSpaceId(spaceId)
+
+ if (selectedPlatform === 'all') {
+ // 选中"全部频道"时,进入连接频道列表页
+ setCurrentView('connect-list')
+ }
+ else {
+ // 选中具体平台时,直接进入授权流程
+ startAuth(selectedPlatform as PlatType, spaceId)
+ }
+ }, [selectedPlatform, setCurrentView, startAuth, setTargetSpaceId])
+
+ // 过滤后的空间列表(如果选中某平台,只显示有该平台账号的空间,或空空间)
+ const filteredAccountGroupList = useMemo(() => {
+ if (selectedPlatform === 'all') {
+ return accountGroupList
+ }
+
+ // 选中具体平台时,显示所有空间(但频道会被过滤)
+ return accountGroupList
+ }, [accountGroupList, selectedPlatform])
+
+ return (
+ <div className="flex h-full flex-col md:flex-row">
+ {/* 左侧侧边栏 - 移动端隐藏 */}
+ <div className="hidden md:block">
+ <ChannelSidebar />
+ </div>
+
+ {/* 移动端顶部操作栏 */}
+ <div className="flex items-center justify-between border-b px-4 py-2 md:hidden">
+ <span className="text-sm text-muted-foreground">
+ {t('channelManager.channelCount', { count: accountList.length })}
+ </span>
+ <Button
+ variant="default"
+ size="sm"
+ className="cursor-pointer"
+ onClick={() => setCurrentView('connect-list')}
+ >
+ <Plus className="mr-1.5 h-4 w-4" />
+ {t('channelManager.addChannel')}
+ </Button>
+ </div>
+
+ {/* 右侧主内容区 */}
+ <div className="flex flex-1 flex-col overflow-hidden">
+ {accountLoading ? (
+ <div className="flex-1 p-4">
+ <SpaceListSkeleton />
+ </div>
+ ) : (
+ <div className="flex flex-1 flex-col gap-4 overflow-hidden p-4">
+ {/* 添加新空间 */}
+ <CreateSpaceSection onSpaceCreated={getAccountGroup} />
+
+ {/* 空间和频道列表 */}
+ <ScrollArea className="h-full flex-1">
+ <div className="space-y-2">
+ {filteredAccountGroupList.map((space, index) => {
+ const channels = getChannelsInSpace(space.id)
+ const isEditing = editingSpace === space.id
+ const isCollapsed = collapsedSpaces.has(space.id)
+
+ return (
+ <SpaceItem
+ key={space.id}
+ space={space}
+ channels={channels}
+ index={index}
+ totalSpaces={filteredAccountGroupList.length}
+ isCollapsed={isCollapsed}
+ isEditing={isEditing}
+ editSpaceName={editSpaceName}
+ editingSpaceLoading={editingSpaceLoading}
+ deleteLoading={deleteLoading}
+ sortingLoading={sortingSpaceLoading}
+ onToggleCollapse={() => toggleSpaceCollapse(space.id)}
+ onStartEdit={() => startEditingSpace(space.id, space.name)}
+ onEditNameChange={setEditSpaceName}
+ onSaveEdit={saveSpaceEdit}
+ onCancelEdit={cancelSpaceEdit}
+ onMoveUp={() => handleSpaceSort(space.id, 'up')}
+ onMoveDown={() => handleSpaceSort(space.id, 'down')}
+ onDelete={() => setDeleteDialog({
+ open: true,
+ type: 'space',
+ id: space.id,
+ name: space.name,
+ })}
+ onChannelDelete={(channel: SocialAccount) => setDeleteDialog({
+ open: true,
+ type: 'channel',
+ id: channel.id,
+ name: channel.nickname,
+ })}
+ onRefresh={getAccountGroup}
+ onAddChannel={() => handleAddChannel(space.id)}
+ />
+ )
+ })}
+ </div>
+ </ScrollArea>
+
+ {/* 删除确认对话框 */}
+ <DeleteConfirmDialog
+ open={deleteDialog.open}
+ type={deleteDialog.type}
+ name={deleteDialog.name}
+ loading={!!deleteLoading}
+ onOpenChange={open => setDeleteDialog(prev => ({ ...prev, open }))}
+ onConfirm={confirmDelete}
+ />
+ </div>
+ )}
+ </div>
+ </div>
+ )
+}
diff --git a/project/web/src/components/ChannelManager/components/SpaceItem.tsx b/project/web/src/components/ChannelManager/components/SpaceItem.tsx
index f490472c..2fa462b8 100644
--- a/project/web/src/components/ChannelManager/components/SpaceItem.tsx
+++ b/project/web/src/components/ChannelManager/components/SpaceItem.tsx
@@ -11,7 +11,6 @@
'use client'
import type { SocialAccount } from '@/api/types/account.type'
-import { LoadingOutlined } from '@ant-design/icons'
import {
Box,
ChevronDown,
@@ -20,10 +19,9 @@ import {
Edit,
Loader2,
MoreVertical,
+ Plus,
Trash2,
} from 'lucide-react'
-import { useCallback, useState } from 'react'
-import { updateAccountGroupApi } from '@/api/account'
import { useTransClient } from '@/app/i18n/client'
import { Button } from '@/components/ui/button'
import {
@@ -34,7 +32,6 @@ import {
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu'
import { Input } from '@/components/ui/input'
-import { toast } from '@/lib/toast'
import { ChannelItem } from './ChannelItem'
interface AccountGroup {
@@ -64,6 +61,7 @@ interface SpaceItemProps {
onDelete: () => void
onChannelDelete: (channel: SocialAccount) => void
onRefresh: () => void
+ onAddChannel?: () => void
}
export function SpaceItem({
@@ -87,6 +85,7 @@ export function SpaceItem({
onDelete,
onChannelDelete,
onRefresh,
+ onAddChannel,
}: SpaceItemProps) {
const { t } = useTransClient('account')
@@ -97,54 +96,79 @@ export function SpaceItem({
return (
<div className={`border rounded-lg overflow-hidden ${isSorting ? 'opacity-60 pointer-events-none' : ''}`}>
{/* 空间标题栏 */}
- <div className="flex items-center gap-2.5 py-2 px-4 bg-muted/30 border-b">
- {isCollapsed ? (
- <ChevronRight
- className="h-4 w-4 text-muted-foreground shrink-0 cursor-pointer hover:text-foreground transition-colors"
- onClick={() => !isEditing && onToggleCollapse()}
- />
- ) : (
- <ChevronDown
- className="h-4 w-4 text-muted-foreground shrink-0 cursor-pointer hover:text-foreground transition-colors"
- onClick={() => !isEditing && onToggleCollapse()}
- />
- )}
+ <div className="flex items-center gap-2.5 py-2 px-4 bg-muted/30 border-b hover:bg-muted/50 transition-colors">
+ {/* 可点击的折叠区域 */}
+ <div
+ className="flex flex-1 items-center gap-2.5 min-w-0 cursor-pointer"
+ onClick={() => !isEditing && onToggleCollapse()}
+ >
+ {isCollapsed ? (
+ <ChevronRight
+ className="h-4 w-4 text-muted-foreground shrink-0 hover:text-foreground transition-colors"
+ />
+ ) : (
+ <ChevronDown
+ className="h-4 w-4 text-muted-foreground shrink-0 hover:text-foreground transition-colors"
+ />
+ )}
- <Box className="h-4 w-4 text-primary shrink-0" />
+ <Box className="h-4 w-4 text-primary shrink-0" />
- {isEditing ? (
- <div className="flex-1 flex gap-2">
- <Input
- value={editSpaceName}
- onChange={e => onEditNameChange(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === 'Enter')
- onSaveEdit()
- if (e.key === 'Escape')
- onCancelEdit()
- }}
- autoFocus
- className="h-7 text-sm"
- />
- <Button onClick={onSaveEdit} size="sm" disabled={editingSpaceLoading}>
- {editingSpaceLoading ? (
- <Loader2 className="h-4 w-4 animate-spin mr-1" />
- ) : null}
- {t('common.save', '保存')}
- </Button>
- <Button variant="outline" onClick={onCancelEdit} size="sm" disabled={editingSpaceLoading}>
- {t('common.cancel', '取消')}
- </Button>
- </div>
- ) : (
- <>
- <div className="flex-1 min-w-0">
- <div className="font-medium text-sm">{space.name}</div>
+ {isEditing ? (
+ <div className="flex-1 flex gap-2" onClick={e => e.stopPropagation()}>
+ <Input
+ value={editSpaceName}
+ onChange={e => onEditNameChange(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter')
+ onSaveEdit()
+ if (e.key === 'Escape')
+ onCancelEdit()
+ }}
+ autoFocus
+ className="h-7 text-sm"
+ />
+ <Button onClick={onSaveEdit} size="sm" disabled={editingSpaceLoading}>
+ {editingSpaceLoading ? (
+ <Loader2 className="h-4 w-4 animate-spin mr-1" />
+ ) : null}
+ {t('common.save', '保存')}
+ </Button>
+ <Button variant="outline" onClick={onCancelEdit} size="sm" disabled={editingSpaceLoading}>
+ {t('common.cancel', '取消')}
+ </Button>
</div>
+ ) : (
+ <>
+ <div className="flex-1 min-w-0">
+ <div className="font-medium text-sm">{space.name}</div>
+ </div>
- <div className="text-xs text-muted-foreground shrink-0">
- {t('channelManager.channelCount', { count: channels.length })}
- </div>
+ <div className="text-xs text-muted-foreground shrink-0">
+ {t('channelManager.channelCount', { count: channels.length })}
+ </div>
+ </>
+ )}
+ </div>
+
+ {/* 操作按钮区域 - 不参与折叠点击 */}
+ {!isEditing && (
+ <>
+ {/* 添加频道按钮 */}
+ {onAddChannel && (
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 cursor-pointer shrink-0"
+ onClick={(e) => {
+ e.stopPropagation()
+ onAddChannel()
+ }}
+ >
+ <Plus className="mr-1 h-3 w-3" />
+ {t('channelManager.addChannel')}
+ </Button>
+ )}
{isSorting && (
<div className="flex items-center gap-1 text-xs text-muted-foreground shrink-0">
diff --git a/project/web/src/components/ChannelManager/components/UnifiedChannelSpaceList.tsx b/project/web/src/components/ChannelManager/components/UnifiedChannelSpaceList.tsx
index 549030a9..9fe35da8 100644
--- a/project/web/src/components/ChannelManager/components/UnifiedChannelSpaceList.tsx
+++ b/project/web/src/components/ChannelManager/components/UnifiedChannelSpaceList.tsx
@@ -100,8 +100,8 @@ export function UnifiedChannelSpaceList() {
// 删除空间或频道
const confirmDelete = useCallback(async () => {
+ setDeleteLoading(deleteDialog.id)
try {
- setDeleteLoading(deleteDialog.id)
if (deleteDialog.type === 'space') {
await deleteAccountGroupApi([deleteDialog.id])
toast.success(t('channelManager.deleteSpaceSuccess', '删除空间成功'))
@@ -113,15 +113,16 @@ export function UnifiedChannelSpaceList() {
// 删除频道后同时刷新账户列表和分组数据
await Promise.all([getAccountList(), getAccountGroup()])
}
+ // 删除成功后关闭对话框
+ setDeleteDialog({ open: false, type: 'space', id: '', name: '' })
}
catch (error) {
const errorType = deleteDialog.type === 'space' ? '空间' : '频道'
toast.error(`删除${errorType}失败`)
- return
+ // 删除失败不关闭对话框,让用户可以重试
}
finally {
setDeleteLoading(null)
- setDeleteDialog({ open: false, type: 'space', id: '', name: '' })
}
}, [deleteDialog, getAccountGroup, getAccountList, t])
diff --git a/project/web/src/components/ChannelManager/index.tsx b/project/web/src/components/ChannelManager/index.tsx
index f0a75dee..52cf1201 100644
--- a/project/web/src/components/ChannelManager/index.tsx
+++ b/project/web/src/components/ChannelManager/index.tsx
@@ -2,63 +2,77 @@
* ChannelManager - 频道管理弹窗组件
*
* 功能描述:
- * - 空间和频道融合管理界面
- * - 支持添加空间、编辑空间、删除空间、空间排序
- * - 支持删除频道
- * - 完全使用全局account store数据
+ * - 三页面视图:主页、连接频道列表、授权loading页
+ * - 左侧频道类型侧边栏 + 右侧空间和账号管理
+ * - 支持外部调用 openModal、openAndAuth 等方法
+ * - 全局单例,挂载在根布局
*/
'use client'
-import { useCallback, useState } from 'react'
+import { useShallow } from 'zustand/react/shallow'
import { useTransClient } from '@/app/i18n/client'
import {
Dialog,
DialogContent,
- DialogDescription,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog'
-import { UnifiedChannelSpaceList } from './components/UnifiedChannelSpaceList'
+import { useChannelManagerStore } from './channelManagerStore'
+import { AuthLoadingPage } from './components/AuthLoadingPage'
+import { ConnectChannelList } from './components/ConnectChannelList'
+import { MainPage } from './components/MainPage'
-interface ChannelManagerProps {
- open?: boolean
- onOpenChange?: (open: boolean) => void
-}
-
-export function ChannelManager({
- open: controlledOpen,
- onOpenChange,
-}: ChannelManagerProps) {
+export function ChannelManager() {
const { t } = useTransClient('account')
- const [internalOpen, setInternalOpen] = useState(false)
- const isOpen = controlledOpen ?? internalOpen
- // 使用useCallback优化关闭函数
- const handleClose = useCallback(() => {
- if (onOpenChange) {
- onOpenChange(false)
+ const { open, currentView, closeModal } = useChannelManagerStore(
+ useShallow(state => ({
+ open: state.open,
+ currentView: state.currentView,
+ closeModal: state.closeModal,
+ })),
+ )
+
+ // 根据当前视图获取标题
+ const getTitle = () => {
+ switch (currentView) {
+ case 'connect-list':
+ return t('channelManager.connectNewChannel')
+ case 'auth-loading':
+ return t('channelManager.authInProgress')
+ default:
+ return t('channelManager.title')
}
- else {
- setInternalOpen(false)
+ }
+
+ // 渲染当前视图
+ const renderView = () => {
+ switch (currentView) {
+ case 'connect-list':
+ return <ConnectChannelList />
+ case 'auth-loading':
+ return <AuthLoadingPage />
+ default:
+ return <MainPage />
}
- }, [onOpenChange])
+ }
return (
- <Dialog open={isOpen} onOpenChange={handleClose}>
- <DialogContent className="max-w-4xl h-[700px] overflow-hidden flex flex-col">
- <DialogHeader>
- <DialogTitle className="text-lg font-semibold">
- {t('channelManager.title', '我的频道')}
- </DialogTitle>
- <DialogDescription>
- {t('channelManager.description', '管理您的频道和空间分组')}
- </DialogDescription>
- </DialogHeader>
+ <Dialog open={open} onOpenChange={closeModal}>
+ <DialogContent className="flex h-[100dvh] max-h-[100dvh] w-full max-w-full flex-col overflow-hidden p-0 md:h-[700px] md:max-h-[700px] md:max-w-5xl md:rounded-lg">
+ {/* Header - 只在主页和连接列表页显示 */}
+ {currentView !== 'auth-loading' && (
+ <DialogHeader className="border-b px-6 py-4">
+ <DialogTitle className="text-lg font-semibold">
+ {getTitle()}
+ </DialogTitle>
+ </DialogHeader>
+ )}
- {/* 统一的空间和频道管理列表 */}
- <div className="flex-1 min-h-0">
- <UnifiedChannelSpaceList />
+ {/* 内容区域 */}
+ <div className="min-h-0 flex-1">
+ {renderView()}
</div>
</DialogContent>
</Dialog>
@@ -66,7 +80,10 @@ export function ChannelManager({
}
// 导出store hook
-export { useChannelManagerStore } from './channelStore'
+export { useChannelManagerStore } from './channelManagerStore'
+
+// 导出类型
+export * from './types'
// 默认导出
export default ChannelManager
diff --git a/project/web/src/components/ChannelManager/types.ts b/project/web/src/components/ChannelManager/types.ts
new file mode 100644
index 00000000..2d0c2b0e
--- /dev/null
+++ b/project/web/src/components/ChannelManager/types.ts
@@ -0,0 +1,95 @@
+/**
+ * ChannelManager - 频道管理器类型定义
+ * 包含三页面视图状态、授权状态、侧边栏状态等类型
+ */
+
+import type { SocialAccount } from '@/api/types/account.type'
+import type { PlatType } from '@/app/config/platConfig'
+import type { PluginPlatformType } from '@/store/plugin'
+
+/** 频道管理器视图类型 */
+export type ChannelManagerView = 'main' | 'connect-list' | 'auth-loading'
+
+/** 授权状态 */
+export interface AuthState {
+ /** 正在授权的平台 */
+ platform: PlatType | null
+ /** 授权任务ID */
+ taskId: string | null
+ /** 授权URL */
+ authUrl: string | null
+ /** 倒计时秒数(默认300秒 = 5分钟) */
+ countdown: number
+ /** 是否正在轮询 */
+ isPolling: boolean
+ /** 授权错误信息 */
+ error: string | null
+ /** 是否授权超时 */
+ isTimeout: boolean
+}
+
+/** 频道管理器状态 */
+export interface ChannelManagerState {
+ /** 弹窗是否打开 */
+ open: boolean
+ /** 当前页面视图 */
+ currentView: ChannelManagerView
+ /** 侧边栏选中的频道类型,'all' 表示全部频道 */
+ selectedPlatform: PlatType | 'all'
+ /** 授权相关状态 */
+ authState: AuthState
+ /** 目标空间ID(授权成功后账号添加到哪个空间) */
+ targetSpaceId: string | null
+ /** 授权成功回调(外部设置) */
+ onAuthSuccess: ((account: SocialAccount, platform: PlatType) => void) | null
+ /** 是否为新用户(没有任何账号) */
+ isNewUser: boolean
+}
+
+/** 频道管理器方法 */
+export interface ChannelManagerMethods {
+ /** 打开弹框(默认显示主页) */
+ openModal: () => void
+ /** 关闭弹框 */
+ closeModal: () => void
+ /** 直接打开并进入指定平台的授权流程 */
+ openAndAuth: (platform: PlatType, spaceId?: string) => void
+ /** 直接打开并进入连接新频道列表页 */
+ openConnectList: (spaceId?: string) => void
+ /** 设置授权成功回调 */
+ setOnAuthSuccess: (
+ callback: ((account: SocialAccount, platform: PlatType) => void) | null,
+ ) => void
+ /** 切换视图 */
+ setCurrentView: (view: ChannelManagerView) => void
+ /** 设置侧边栏选中的平台 */
+ setSelectedPlatform: (platform: PlatType | 'all') => void
+ /** 设置目标空间ID */
+ setTargetSpaceId: (spaceId: string | null) => void
+ /** 开始授权流程 */
+ startAuth: (platform: PlatType, spaceId?: string) => Promise<void>
+ /** 处理插件平台的授权(小红书、抖音等) */
+ handlePluginPlatformAuth: (platform: PluginPlatformType, spaceId?: string) => Promise<void>
+ /** 停止授权(取消/超时) */
+ stopAuth: () => void
+ /** 重新打开授权页面 */
+ reopenAuthWindow: () => void
+ /** 授权成功处理 */
+ handleAuthSuccess: (account: SocialAccount) => void
+ /** 重置状态 */
+ reset: () => void
+ /** 检查是否为新用户 */
+ checkIsNewUser: () => void
+}
+
+/** 授权URL响应 */
+export interface AuthUrlResponse {
+ url: string
+ taskId: string
+}
+
+/** 默认授权倒计时时间(秒) */
+export const DEFAULT_AUTH_COUNTDOWN = 300
+
+/** 轮询间隔(毫秒) */
+export const POLLING_INTERVAL = 2000
diff --git a/project/web/src/components/Chat/ActionCard/index.tsx b/project/web/src/components/Chat/ActionCard/index.tsx
index 28f54948..38f49d42 100644
--- a/project/web/src/components/Chat/ActionCard/index.tsx
+++ b/project/web/src/components/Chat/ActionCard/index.tsx
@@ -9,9 +9,10 @@
import type { IActionCard } from '@/store/agent/agent.types'
import { AlertCircle, ArrowRight, Link2, RefreshCw, Send } from 'lucide-react'
import { useParams, usePathname, useRouter } from 'next/navigation'
-import { useState } from 'react'
-import AddAccountModal from '@/app/[lng]/accounts/components/AddAccountModal'
+import { useCallback } from 'react'
+import { useShallow } from 'zustand/react/shallow'
import { useTransClient } from '@/app/i18n/client'
+import { useChannelManagerStore } from '@/components/ChannelManager'
import { Button } from '@/components/ui/button'
import { toast } from '@/lib/toast'
import { cn } from '@/lib/utils'
@@ -75,8 +76,13 @@ export function ActionCard({ action, className }: IActionCardProps) {
// Agent store 方法
const { continueTask } = useAgentStore()
- // 添加账号弹窗状态
- const [addAccountVisible, setAddAccountVisible] = useState(false)
+ // 频道管理器
+ const { openConnectList, setOnAuthSuccess } = useChannelManagerStore(
+ useShallow(state => ({
+ openConnectList: state.openConnectList,
+ setOnAuthSuccess: state.setOnAuthSuccess,
+ })),
+ )
const platformName = getPlatformDisplayName(action.platform)
@@ -149,11 +155,11 @@ export function ActionCard({ action, className }: IActionCardProps) {
const config = getActionConfig()
/**
- * 处理账号添加成功
+ * 处理账号添加成功 - 用于 ChannelManager 回调
*/
- const handleAccountAddSuccess = async () => {
- // 关闭弹窗
- setAddAccountVisible(false)
+ const handleAccountAddSuccess = useCallback(async () => {
+ // 清除回调
+ setOnAuthSuccess(null)
// 检查是否在 chat 页面
if (pathname.includes('/chat/')) {
@@ -164,8 +170,8 @@ export function ActionCard({ action, className }: IActionCardProps) {
const taskId = pathParts[taskIdIndex + 1]
// 自动发送消息
- const platformName = getPlatformDisplayName(action.platform)
- const autoMessage = `I have added the "${platformName}" channel account, please continue.`
+ const platformDisplayName = getPlatformDisplayName(action.platform)
+ const autoMessage = `I have added the "${platformDisplayName}" channel account, please continue.`
try {
await continueTask({
@@ -180,7 +186,17 @@ export function ActionCard({ action, className }: IActionCardProps) {
}
}
}
- }
+ }, [pathname, action.platform, continueTask, t, setOnAuthSuccess])
+
+ /**
+ * 打开频道管理器并设置成功回调
+ */
+ const openChannelManager = useCallback(() => {
+ // 设置授权成功回调
+ setOnAuthSuccess(handleAccountAddSuccess)
+ // 打开频道管理器
+ openConnectList()
+ }, [setOnAuthSuccess, handleAccountAddSuccess, openConnectList])
// 处理按钮点击
const handleClick = () => {
@@ -191,11 +207,11 @@ export function ActionCard({ action, className }: IActionCardProps) {
// 未登录时先登录
if (!token) {
toast.warning(t('home.loginRequired' as any) || 'Please login first')
- openLoginModal(() => setAddAccountVisible(true))
+ openLoginModal(() => openChannelManager())
return
}
- // 直接打开添加账号弹窗
- setAddAccountVisible(true)
+ // 打开频道管理器
+ openChannelManager()
break
case 'updateChannel':
router.push(`/${lng}/accounts?updateChannel=${platform}`)
@@ -265,16 +281,6 @@ export function ActionCard({ action, className }: IActionCardProps) {
<ArrowRight className="w-4 h-4 ml-2 transition-transform group-hover:translate-x-1" />
</Button>
)}
-
- {/* 添加账号弹窗 - 仅用于 createChannel */}
- {action.type === 'createChannel' && (
- <AddAccountModal
- open={addAccountVisible}
- onClose={() => setAddAccountVisible(false)}
- onAddSuccess={handleAccountAddSuccess}
- showSpaceSelector={true}
- />
- )}
</div>
)
}
diff --git a/project/web/src/components/Home/HomeChat/index.tsx b/project/web/src/components/Home/HomeChat/index.tsx
index af0a03c1..99e5a8e3 100644
--- a/project/web/src/components/Home/HomeChat/index.tsx
+++ b/project/web/src/components/Home/HomeChat/index.tsx
@@ -10,9 +10,10 @@ import Image from 'next/image'
import { useParams, useRouter, useSearchParams } from 'next/navigation'
import { useCallback, useEffect, useState } from 'react'
-import AddAccountModal from '@/app/[lng]/accounts/components/AddAccountModal'
+import { useShallow } from 'zustand/react/shallow'
import { AccountPlatInfoArr } from '@/app/config/platConfig'
import { useTransClient } from '@/app/i18n/client'
+import { useChannelManagerStore } from '@/components/ChannelManager'
import { ChatInput } from '@/components/Chat/ChatInput'
import { useMediaUpload } from '@/hooks/useMediaUpload'
import { toast } from '@/lib/toast'
@@ -87,16 +88,22 @@ export function HomeChat({
}
}, [externalPrompt, onClearExternalPrompt, agentTaskId])
const [isSubmitting, setIsSubmitting] = useState(false)
- const [addAccountVisible, setAddAccountVisible] = useState(false)
+
+ // 频道管理器
+ const { openConnectList } = useChannelManagerStore(
+ useShallow(state => ({
+ openConnectList: state.openConnectList,
+ })),
+ )
// 处理添加账号点击 - 未登录时弹出登录弹窗
const handleAddChannelClick = useCallback(() => {
if (!token) {
- openLoginModal(() => setAddAccountVisible(true))
+ openLoginModal(() => openConnectList())
return
}
- setAddAccountVisible(true)
- }, [token])
+ openConnectList()
+ }, [token, openConnectList])
// 使用媒体上传 Hook
const {
@@ -279,14 +286,6 @@ export function HomeChat({
{t('home.enterToSend')}
</span>
</div>
-
- {/* 添加账号弹窗 */}
- <AddAccountModal
- open={addAccountVisible}
- onClose={() => setAddAccountVisible(false)}
- onAddSuccess={() => setAddAccountVisible(false)}
- showSpaceSelector={true}
- />
</div>
)
}
diff --git a/project/web/src/components/Home/TaskPreview/index.tsx b/project/web/src/components/Home/TaskPreview/index.tsx
index cac75473..23378440 100644
--- a/project/web/src/components/Home/TaskPreview/index.tsx
+++ b/project/web/src/components/Home/TaskPreview/index.tsx
@@ -9,10 +9,12 @@ import type { TaskListItem } from '@/api/agent'
import { ArrowRight, History } from 'lucide-react'
import { useParams, useRouter } from 'next/navigation'
import { useCallback, useEffect, useState } from 'react'
+import { useShallow } from 'zustand/react/shallow'
import { agentApi } from '@/api/agent'
import { useTransClient } from '@/app/i18n/client'
import TaskHistoryList from '@/components/Chat/TaskHistoryList'
import { cn } from '@/lib/utils'
+import { useUserStore } from '@/store'
export interface ITaskPreviewProps {
/** 显示数量 */
@@ -28,6 +30,15 @@ export function TaskPreview({ limit = 4, className }: ITaskPreviewProps) {
const { t } = useTransClient('chat')
const router = useRouter()
const { lng } = useParams()
+ const {
+ _hasHydrated,
+ token,
+ } = useUserStore(
+ useShallow(state => ({
+ _hasHydrated: state._hasHydrated,
+ token: state.token,
+ })),
+ )
const [tasks, setTasks] = useState<TaskListItem[]>([])
const [isLoading, setIsLoading] = useState(true)
@@ -50,8 +61,12 @@ export function TaskPreview({ limit = 4, className }: ITaskPreviewProps) {
}, [limit])
useEffect(() => {
- void loadTasks()
- }, [loadTasks])
+ if (token && _hasHydrated) {
+ loadTasks()
+ } else {
+ setIsLoading(false)
+ }
+ }, [loadTasks, token, _hasHydrated])
/** 跳转到任务记录页 */
const handleViewAll = () => {
diff --git a/project/web/src/components/Plugin/PluginReady/PublishListTab.tsx b/project/web/src/components/Plugin/PluginReady/PublishListTab.tsx
index cd88740e..cd81b0af 100644
--- a/project/web/src/components/Plugin/PluginReady/PublishListTab.tsx
+++ b/project/web/src/components/Plugin/PluginReady/PublishListTab.tsx
@@ -28,22 +28,6 @@ function getPlatformName(platform: PluginPlatformType): string {
return platInfo?.name || platform
}
-/**
- * 获取状态 Badge 样式
- */
-function getStatusVariant(status: PlatformTaskStatus): 'default' | 'secondary' | 'destructive' | 'outline' {
- switch (status) {
- case PlatformTaskStatus.COMPLETED:
- return 'default'
- case PlatformTaskStatus.PUBLISHING:
- return 'secondary'
- case PlatformTaskStatus.ERROR:
- return 'destructive'
- default:
- return 'outline'
- }
-}
-
/**
* 获取状态 Badge 自定义类名
*/
diff --git a/project/web/src/components/PublishDialog/index.tsx b/project/web/src/components/PublishDialog/index.tsx
index b8e2f5a8..609771ab 100644
--- a/project/web/src/components/PublishDialog/index.tsx
+++ b/project/web/src/components/PublishDialog/index.tsx
@@ -761,8 +761,10 @@ const PublishDialog = memo(
}
}
else {
- // 给用户提示:发布已提交,可能需要一些时间处理(符合 TikTok API 客户端要求)
- toast.success(t('messages.publishSubmitted' as any), {
+ // 给用户提示:发布已提交,可能需要一些时间处理
+ toast.success(t('messages.publishSubmitted', {
+ platform: pubListChoosed.map(item => AccountPlatInfoMap.get(item.account!.type)!.name).join(', '),
+ }), {
key: 'publish_submitted',
duration: 3,
})
diff --git a/project/web/src/components/SettingsModal/tabs/ProfileTab.tsx b/project/web/src/components/SettingsModal/tabs/ProfileTab.tsx
index bd0c544c..d603f8f6 100644
--- a/project/web/src/components/SettingsModal/tabs/ProfileTab.tsx
+++ b/project/web/src/components/SettingsModal/tabs/ProfileTab.tsx
@@ -29,11 +29,11 @@ export function ProfileTab({ onClose }: ProfileTabProps) {
const router = useRouter()
const fileInputRef = useRef<HTMLInputElement>(null)
- const { userInfo, getUserInfo, clearLoginStatus } = useUserStore(
+ const { userInfo, getUserInfo, logout } = useUserStore(
useShallow(state => ({
userInfo: state.userInfo,
getUserInfo: state.getUserInfo,
- clearLoginStatus: state.clearLoginStatus,
+ logout: state.logout,
})),
)
@@ -144,14 +144,12 @@ export function ProfileTab({ onClose }: ProfileTabProps) {
}
const handleLogout = () => {
- clearLoginStatus()
+ logout()
toast.success(tCommon('logout'))
onClose()
- router.push('/')
}
const totalIncome = ((userInfo as any)?.totalIncome || 0) / 100
- const currentBalance = (userInfo?.income || 0) / 100
return (
<div className="w-full space-y-6">
diff --git a/project/web/src/components/Share/ShareModal.tsx b/project/web/src/components/Share/ShareModal.tsx
index d03436f4..ae4fd19c 100644
--- a/project/web/src/components/Share/ShareModal.tsx
+++ b/project/web/src/components/Share/ShareModal.tsx
@@ -1,7 +1,10 @@
+/**
+ * ShareModal - 分享对话弹窗组件
+ * 用于选择并导出聊天消息为图片
+ */
'use client'
-import type { TaskDetail, TaskMessage } from '@/api/agent'
-import type { IDisplayMessage } from '@/store/agent'
+import type { TaskDetail } from '@/api/agent'
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { agentApi } from '@/api/agent'
import { convertMessages } from '@/app/[lng]/chat/[taskId]/utils'
@@ -24,6 +27,7 @@ import {
} from '@/components/ui/dropdown-menu'
import { Skeleton } from '@/components/ui/skeleton'
import { toast } from '@/lib/toast'
+import { cn } from '@/lib/utils'
import { useUserStore } from '@/store/user'
import { generateImageFromMessages } from './generateShareImages'
import SharePreviewModal from './SharePreviewModal'
@@ -97,11 +101,6 @@ export function ShareModal({
return convertMessages(taskDetail.messages)
}, [taskDetail?.messages])
- // 在列表中始终显示所有消息(复选框仅用于高亮与导出选择)
- const displayMessages = useMemo(() => {
- return messages
- }, [messages])
-
// 折叠状态:记录被折叠的 message id 集合
const [collapsedIds, setCollapsedIds] = useState<Set<string>>(new Set())
const toggleCollapse = (id: string) => {
@@ -146,7 +145,7 @@ export function ShareModal({
ro.disconnect()
window.removeEventListener('resize', measure)
}
- }, [displayMessages])
+ }, [messages])
const toggleSelect = useCallback((id: string) => {
setSelectedIds((prev) => {
if (prev.includes(id))
@@ -200,39 +199,7 @@ export function ShareModal({
finally {
setLoading(false)
}
- }, [messages, selectedIds, taskId, user?.name, onOpenChange])
-
- // 辅助函数:下载图片
- const downloadImages = async (
- blobs: Blob[],
- taskId: string,
- ): Promise<void> => {
- const downloadPromises = blobs.map((blob, index) => {
- return new Promise<void>((resolve, reject) => {
- try {
- const a = document.createElement('a')
- const url = URL.createObjectURL(blob)
- a.href = url
- // 为长图使用不同的命名
- const fileName
- = blobs.length === 1
- ? `aitoearn_conversation_${taskId}.png`
- : `aitoearn_${taskId}_${index + 1}.png`
- a.download = fileName
- document.body.appendChild(a)
- a.click()
- a.remove()
- URL.revokeObjectURL(url)
- resolve()
- }
- catch (err) {
- reject(err)
- }
- })
- })
-
- await Promise.all(downloadPromises)
- }
+ }, [messages, selectedIds, user?.name, t])
const messageListContent = loading ? (
<div className="space-y-4">
@@ -248,7 +215,7 @@ export function ShareModal({
))}
</div>
) : (
- displayMessages.map((message) => {
+ messages.map((message) => {
const isUser = message.role === 'user'
const isSelected = selectedIds.includes(message.id)
const isCollapsed = collapsedIds.has(message.id)
@@ -258,7 +225,7 @@ export function ShareModal({
<input
type="checkbox"
checked={isSelected}
- onChange={(e) => {
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
if (e.target.checked) {
setSelectedIds(prev => Array.from(new Set([...prev, message.id])))
}
@@ -266,7 +233,7 @@ export function ShareModal({
setSelectedIds(prev => prev.filter(id => id !== message.id))
}
}}
- className="mt-1"
+ className="mt-1 h-4 w-4 cursor-pointer rounded border-border accent-primary"
/>
)
@@ -281,32 +248,6 @@ export function ShareModal({
toggleSelect(message.id)
}
- // role-based base and highlight colors (now unified; use grayish highlight)
- const ROLE_BASE: Record<string, string> = {
- user: '#ffffff',
- assistant: '#ffffff',
- }
- // make highlight very subtle (lighter)
- const ROLE_HIGHLIGHT: Record<string, string> = {
- user: '#fbfbfd',
- assistant: '#fbfbfd',
- }
- const baseMessageStyle: React.CSSProperties = {
- padding: 12,
- borderRadius: 8,
- }
- const roleBg = isUser ? ROLE_BASE.user : ROLE_BASE.assistant
- const selectedBg = isUser ? ROLE_HIGHLIGHT.user : ROLE_HIGHLIGHT.assistant
- const selectedStyle: React.CSSProperties = {
- ...baseMessageStyle,
- background: selectedBg,
- boxShadow: 'inset 0 0 0 1px rgba(0,0,0,0.02)',
- }
- const defaultStyle: React.CSSProperties = {
- ...baseMessageStyle,
- background: roleBg,
- }
-
return (
<div
key={message.id}
@@ -320,8 +261,12 @@ export function ShareModal({
if (e.key === 'Enter' || e.key === ' ')
toggleSelect(message.id)
}}
- className="flex items-start gap-3"
- style={isSelected ? selectedStyle : defaultStyle}
+ className={cn(
+ 'flex items-start gap-3 p-3 rounded-lg transition-colors cursor-pointer',
+ isSelected
+ ? 'bg-muted/50 ring-1 ring-border/50'
+ : 'bg-card hover:bg-muted/30',
+ )}
ref={(el) => {
if (el)
messageRefs.current.set(message.id, el as HTMLDivElement)
@@ -335,7 +280,7 @@ export function ShareModal({
)}
<div className="flex-1 min-w-0">
- <div style={isLong && isCollapsed ? { maxHeight: 40, overflow: 'hidden', position: 'relative' } : undefined}>
+ <div className={cn(isLong && isCollapsed && 'max-h-10 overflow-hidden relative')}>
<ChatMessage
role={message.role === 'system' ? 'assistant' : message.role}
content={message.content}
@@ -348,10 +293,9 @@ export function ShareModal({
className="max-w-full"
/>
{isLong && isCollapsed && (
- <div style={{ position: 'absolute', left: 0, right: 0, bottom: 0, height: 40, background: 'linear-gradient(rgba(255,255,255,0), rgba(255,255,255,0.95))' }} />
+ <div className="absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent" />
)}
</div>
- {/* fold button moved to top-right for better visibility */}
</div>
{isUser && (
@@ -361,16 +305,20 @@ export function ShareModal({
)}
</div>
- {/* top-right collapse button */}
+ {/* 折叠/展开按钮 */}
{isLong && (
<button
type="button"
onClick={(e) => { e.stopPropagation(); toggleCollapse(message.id) }}
title={isCollapsed ? t('showMore') : t('collapse')}
- className="absolute top-3 w-9 h-9 flex items-center justify-center bg-white border border-border rounded-full shadow-sm hover:bg-muted/80"
- style={{ zIndex: 20, left: isUser ? '12px' : undefined, right: isUser ? undefined : '12px' } as React.CSSProperties}
+ className={cn(
+ 'absolute top-3 z-20 w-9 h-9 flex items-center justify-center',
+ 'bg-background border border-border rounded-full shadow-sm',
+ 'hover:bg-muted/80 cursor-pointer transition-colors',
+ isUser ? 'left-3' : 'right-3',
+ )}
>
- <span style={{ fontSize: 12 }}>{isCollapsed ? '▾' : '▴'}</span>
+ <span className="text-xs">{isCollapsed ? '▾' : '▴'}</span>
</button>
)}
</div>
@@ -395,7 +343,7 @@ export function ShareModal({
variant="outline"
size="sm"
onClick={() => {
- const allIds = displayMessages.map(m => m.id)
+ const allIds = messages.map(m => m.id)
setSelectedIds(allIds)
}}
className="cursor-pointer"
@@ -416,8 +364,8 @@ export function ShareModal({
<DropdownMenuContent>
<DropdownMenuItem
onClick={() => {
- const recentCount = Math.min(5, displayMessages.length)
- const recentIds = displayMessages.slice(-recentCount).map(m => m.id)
+ const recentCount = Math.min(5, messages.length)
+ const recentIds = messages.slice(-recentCount).map(m => m.id)
setSelectedIds(recentIds)
}}
>
@@ -425,8 +373,8 @@ export function ShareModal({
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => {
- const recentCount = Math.min(10, displayMessages.length)
- const recentIds = displayMessages.slice(-recentCount).map(m => m.id)
+ const recentCount = Math.min(10, messages.length)
+ const recentIds = messages.slice(-recentCount).map(m => m.id)
setSelectedIds(recentIds)
}}
>
@@ -434,8 +382,8 @@ export function ShareModal({
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => {
- const recentCount = Math.min(20, displayMessages.length)
- const recentIds = displayMessages.slice(-recentCount).map(m => m.id)
+ const recentCount = Math.min(20, messages.length)
+ const recentIds = messages.slice(-recentCount).map(m => m.id)
setSelectedIds(recentIds)
}}
>
@@ -477,7 +425,6 @@ export function ShareModal({
<Button
onClick={handleGenerateAndDownload}
disabled={loading || selectedIds.length === 0}
- className="bg-primary text-white"
>
{loading ? t('generating') : t('generate')}
</Button>
diff --git a/project/web/src/components/Share/SharePreviewModal.tsx b/project/web/src/components/Share/SharePreviewModal.tsx
index 710e593b..9ffbd71c 100644
--- a/project/web/src/components/Share/SharePreviewModal.tsx
+++ b/project/web/src/components/Share/SharePreviewModal.tsx
@@ -1,7 +1,11 @@
+/**
+ * SharePreviewModal - 分享预览弹窗组件
+ * 用于预览生成的分享图片并提供下载/发布功能
+ */
'use client'
import { useRouter } from 'next/navigation'
-import React, { useState } from 'react'
+import React, { useCallback, useState } from 'react'
import { uploadToOss } from '@/api/oss'
import { AccountPlatInfoMap } from '@/app/config/platConfig'
import { PubType } from '@/app/config/publishConfig'
@@ -10,7 +14,6 @@ import { Button } from '@/components/ui/button'
import { Modal } from '@/components/ui/modal'
import { toast } from '@/lib/toast'
import { useAccountStore } from '@/store/account'
-import { usePublishDialogData } from '../PublishDialog/usePublishDialogData'
import { usePublishDialogStorageStore } from '../PublishDialog/usePublishDialogStorageStore'
interface SharePreviewModalProps {
@@ -21,6 +24,30 @@ interface SharePreviewModalProps {
taskId: string
}
+/**
+ * 上传 Blob 数组到 OSS
+ * @param blobs - 待上传的 Blob 数组
+ * @returns 上传成功的 URL 数组
+ */
+async function uploadBlobsToOss(blobs: Blob[]): Promise<string[]> {
+ const uploadedUrls: string[] = []
+ for (let i = 0; i < blobs.length; i++) {
+ const file = new File(
+ [blobs[i]],
+ `aitoearn_export_${Date.now()}_${i}.png`,
+ { type: blobs[i].type || 'image/png' },
+ )
+ try {
+ const url = await uploadToOss(file)
+ uploadedUrls.push(url as string)
+ }
+ catch (err) {
+ console.error('Upload failed for blob', err)
+ }
+ }
+ return uploadedUrls
+}
+
export function SharePreviewModal({
open,
onClose,
@@ -33,7 +60,8 @@ export function SharePreviewModal({
const { accountList, getAccountList } = useAccountStore()
const [uploading, setUploading] = useState(false)
- const downloadBlobs = async () => {
+ // 下载图片
+ const downloadBlobs = useCallback(async () => {
try {
for (let i = 0; i < blobs.length; i++) {
const blob = blobs[i]
@@ -55,29 +83,22 @@ export function SharePreviewModal({
console.error(e)
toast.error(t('downloadFailed') || 'Download failed')
}
- }
+ }, [blobs, taskId, t])
+
+ // Agent 分享:上传图片并跳转到首页
+ const handleAgentShare = useCallback(async () => {
+ if (!blobs || blobs.length === 0) {
+ toast.error(t('noImagesToShare') || 'No images to share')
+ return
+ }
- const handleAgentShare = async () => {
try {
setUploading(true)
- // upload blobs (if available) and get urls
- const targets = blobs && blobs.length > 0 ? blobs : []
- const uploadedUrls: string[] = []
- if (targets.length > 0) {
- for (let i = 0; i < targets.length; i++) {
- const file = new File(
- [targets[i]],
- `aitoearn_export_${Date.now()}_${i}.png`,
- { type: targets[i].type || 'image/png' },
- )
- try {
- const url = await uploadToOss(file)
- uploadedUrls.push(url as string)
- }
- catch (err) {
- console.error('Upload failed for blob', err)
- }
- }
+ const uploadedUrls = await uploadBlobsToOss(blobs)
+
+ if (uploadedUrls.length === 0) {
+ toast.error(t('uploadFailed') || 'Upload failed')
+ return
}
const payloadPrompt
@@ -104,17 +125,25 @@ export function SharePreviewModal({
finally {
setUploading(false)
}
- }
+ }, [blobs, onClose, router, t])
+
+ // 发布分享:上传图片并跳转到账号页面
+ const handlePublishShare = useCallback(async () => {
+ if (!blobs || blobs.length === 0) {
+ toast.error(t('noImagesToShare') || 'No images to share')
+ return
+ }
- const handlePublishShare = async () => {
try {
usePublishDialogStorageStore.getState().clearPubData()
setUploading(true)
- // ensure accounts loaded
+
+ // 确保账号列表已加载
if (!accountList || accountList.length === 0) {
await getAccountList()
}
- // filter accounts that support ImageText and are online (status !== 0)
+
+ // 筛选支持图文发布且在线的账号
const candidates = (useAccountStore.getState().accountList || []).filter(
(acc) => {
const plat = AccountPlatInfoMap.get(acc.type as any)
@@ -129,30 +158,12 @@ export function SharePreviewModal({
return
}
- // Prepare medias param for accounts page (upload blobs then navigate)
- const targets = blobs && blobs.length > 0 ? blobs : []
- let uploadedUrls: string[] = []
- if (targets.length > 0) {
- if (targets.length > 0) {
- for (let i = 0; i < targets.length; i++) {
- const file = new File(
- [targets[i]],
- `aitoearn_export_${Date.now()}_${i}.png`,
- { type: targets[i].type || 'image/png' },
- )
- try {
- const url = await uploadToOss(file)
- uploadedUrls.push(url as string)
- }
- catch (err) {
- console.error('Upload failed for blob', err)
- }
- }
- }
- }
- else {
- // fallback to provided urls
- uploadedUrls = urls.slice()
+ // 上传图片
+ const uploadedUrls = await uploadBlobsToOss(blobs)
+
+ if (uploadedUrls.length === 0) {
+ toast.error(t('uploadFailed') || 'Upload failed')
+ return
}
const medias = uploadedUrls.map(u => ({ type: 'IMAGE', url: u }))
@@ -162,14 +173,13 @@ export function SharePreviewModal({
|| 'I generated this conversation on aitoearn using agent, check it out!'
const tags = ['aitoearn', 'agent']
- // Build URL params and navigate to /accounts to trigger publish dialog filling
+ // 构建 URL 参数并跳转到账号页面
const params = new URLSearchParams()
params.set('aiGenerated', 'true')
params.set('medias', encodeURIComponent(JSON.stringify(medias)))
params.set('description', encodeURIComponent(description))
params.set('title', encodeURIComponent(title))
params.set('tags', encodeURIComponent(JSON.stringify(tags)))
- // set accountId to first candidate for default selection
params.set('accountId', candidates[0].id)
onClose()
@@ -182,12 +192,12 @@ export function SharePreviewModal({
finally {
setUploading(false)
}
- }
+ }, [blobs, accountList, getAccountList, onClose, router, t])
return (
<Modal open={open} onCancel={onClose} title={t('previewTitle')}>
<div className="max-w-3xl mx-auto">
- <div className="bg-white rounded-md border p-4 flex justify-center">
+ <div className="bg-card rounded-md border p-4 flex justify-center">
{urls[0] ? (
<img
src={urls[0]}
@@ -202,16 +212,24 @@ export function SharePreviewModal({
</div>
<div className="mt-4 flex items-center justify-end gap-2">
- <div className="flex items-center gap-3">
- {/* show nothing; buttons will show loading state */}
- </div>
- <Button variant="outline" onClick={handleAgentShare} loading={uploading}>
+ <Button
+ variant="outline"
+ onClick={handleAgentShare}
+ loading={uploading}
+ >
{t('agentShare')}
</Button>
- <Button variant="outline" onClick={handlePublishShare} loading={uploading}>
+ <Button
+ variant="outline"
+ onClick={handlePublishShare}
+ loading={uploading}
+ >
{t('publishShare')}
</Button>
- <Button onClick={downloadBlobs} disabled={uploading}>
+ <Button
+ onClick={downloadBlobs}
+ disabled={uploading}
+ >
{t('download')}
</Button>
</div>
diff --git a/project/web/src/components/Share/generateShareImages.ts b/project/web/src/components/Share/generateShareImages.ts
index ef960738..b655fcea 100644
--- a/project/web/src/components/Share/generateShareImages.ts
+++ b/project/web/src/components/Share/generateShareImages.ts
@@ -1,3 +1,7 @@
+/**
+ * generateShareImages - 分享图片生成工具
+ * 将聊天消息渲染为可分享的图片
+ */
import type { IDisplayMessage } from '@/store/agent'
import html2canvas from 'html2canvas-pro'
import React from 'react'
@@ -271,8 +275,14 @@ export async function generateImageFromNode(node: HTMLElement, scale = 1): Promi
* 将容器中所有img和video元素的AWS URL替换为代理URL
*/
function replaceMediaUrlsWithProxy(container: HTMLElement): void {
- const awsUrl = process.env.NEXT_PUBLIC_S3_URL!
- const proxyUrl = process.env.NEXT_PUBLIC_S3_PROXY!
+ const awsUrl = process.env.NEXT_PUBLIC_S3_URL
+ const proxyUrl = process.env.NEXT_PUBLIC_S3_PROXY
+
+ // 如果环境变量未配置,跳过替换
+ if (!awsUrl || !proxyUrl) {
+ console.warn('S3 URL or proxy URL not configured, skipping URL replacement')
+ return
+ }
// 处理图片元素
const images = container.querySelectorAll('img')
diff --git a/project/web/src/components/ui/NotificationCenter.tsx b/project/web/src/components/ui/NotificationCenter.tsx
index b75f7a72..4a290784 100644
--- a/project/web/src/components/ui/NotificationCenter.tsx
+++ b/project/web/src/components/ui/NotificationCenter.tsx
@@ -116,7 +116,7 @@ export const NotificationCenter: React.FC = () => {
}, [])
return (
- <div className="fixed top-4 right-4 z-50 flex flex-col items-end gap-3">
+ <div className="fixed top-4 right-4 z-500000 flex flex-col items-end gap-3">
{items.map(item => (
<div
key={item.uid}
diff --git a/project/web/src/components/ui/dialog.tsx b/project/web/src/components/ui/dialog.tsx
index 6899fc46..d7bcc2c4 100644
--- a/project/web/src/components/ui/dialog.tsx
+++ b/project/web/src/components/ui/dialog.tsx
@@ -17,30 +17,16 @@ const DialogClose = DialogPrimitive.Close
const DialogOverlay = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
->(({ className, ...props }, ref) => {
- // prevent clicks on the overlay from bubbling to underlying elements (which may cause navigation)
- const handlePointerDown: React.PointerEventHandler = (e) => {
- e.stopPropagation()
- if (typeof props.onPointerDown === 'function') {
- try {
- (props.onPointerDown as any)(e)
- }
- catch {}
- }
- }
-
- return (
- <DialogPrimitive.Overlay
- ref={ref}
- className={cn(
- 'fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500',
- className,
- )}
- onPointerDown={handlePointerDown}
- {...props}
- />
- )
-})
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Overlay
+ ref={ref}
+ className={cn(
+ 'fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500',
+ className,
+ )}
+ {...props}
+ />
+))
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
@@ -59,6 +45,8 @@ const DialogContent = React.forwardRef<
/>
<DialogPrimitive.Content
ref={ref}
+ // 抑制 Radix UI 的 Description 警告,允许 Dialog 没有 Description
+ aria-describedby={props['aria-describedby'] ?? undefined}
// Ensure the content container can receive focus and explicitly move focus
// to it when the dialog opens to avoid aria-hidden being applied to an
// ancestor while a descendant still has focus (causes accessibility warning).
diff --git a/project/web/src/hooks/index.ts b/project/web/src/hooks/index.ts
index 89f69b10..a5913232 100644
--- a/project/web/src/hooks/index.ts
+++ b/project/web/src/hooks/index.ts
@@ -2,6 +2,7 @@
* Hooks 统一导出
*/
+export * from './useIsMobile'
export * from './useMediaUpload'
export * from './useNotification'
export * from './useSystem'
diff --git a/project/web/src/hooks/useIsMobile.ts b/project/web/src/hooks/useIsMobile.ts
new file mode 100644
index 00000000..01ae331e
--- /dev/null
+++ b/project/web/src/hooks/useIsMobile.ts
@@ -0,0 +1,33 @@
+/**
+ * useIsMobile Hook
+ *
+ * 功能描述: 检测当前设备是否为移动端(屏幕宽度 < 768px)
+ * 用于移动端适配,如禁用拖拽、切换弹窗类型等
+ */
+import { useEffect, useState } from 'react'
+
+/**
+ * 检测当前是否为移动端设备
+ * @returns boolean - true 表示移动端,false 表示桌面端
+ */
+export function useIsMobile() {
+ const [isMobile, setIsMobile] = useState(false)
+
+ useEffect(() => {
+ // SSR 安全检查
+ if (typeof window === 'undefined') return
+
+ const mediaQuery = window.matchMedia('(max-width: 767px)')
+
+ // 设置初始值
+ setIsMobile(mediaQuery.matches)
+
+ // 监听变化
+ const handler = (e: MediaQueryListEvent) => setIsMobile(e.matches)
+ mediaQuery.addEventListener('change', handler)
+
+ return () => mediaQuery.removeEventListener('change', handler)
+ }, [])
+
+ return isMobile
+}
diff --git a/project/web/src/store/account.ts b/project/web/src/store/account.ts
index ccf7a0e4..8c8f6b3b 100644
--- a/project/web/src/store/account.ts
+++ b/project/web/src/store/account.ts
@@ -4,6 +4,7 @@ import { create } from 'zustand'
import { combine } from 'zustand/middleware'
import { getAccountGroupApi, getAccountListApi } from '@/api/account'
import { useDataStatisticsStore } from '@/app/[lng]/dataStatistics/useDataStatistics'
+import { PlatType } from '@/app/config/platConfig'
import { directTrans } from '@/app/i18n/client'
import { usePluginStore } from '@/store/plugin'
import { useUserStore } from '@/store/user'
@@ -91,6 +92,10 @@ export const useAccountStore = create(
const accountList: SocialAccount[] = []
for (const item of result.data) {
+ // 抖音账号过滤
+ if (item.type === PlatType.Douyin) {
+ continue
+ }
accountMap.set(item.id, item)
accountAccountMap.set(item.account, item)
accountList.push(item)
diff --git a/project/web/src/store/agent/agent.methods.ts b/project/web/src/store/agent/agent.methods.ts
index 140caa8d..1409c2ba 100644
--- a/project/web/src/store/agent/agent.methods.ts
+++ b/project/web/src/store/agent/agent.methods.ts
@@ -68,11 +68,26 @@ export function createStoreMethods(ctx: IMethodsContext) {
const cardActionTypes = ['createChannel', 'updateChannel', 'loginChannel']
// 需要自动执行的 action(如发布、保存草稿等)
const autoExecuteActions: ITaskData[] = []
+ // 收集所有 result 中的 medias(用于在消息中显示视频/图片)
+ const allMedias: Array<{ type: string, url: string, thumbUrl?: string }> = []
if (resultMsg.result) {
const resultArray: ITaskData[] = Array.isArray(resultMsg.result) ? resultMsg.result : [resultMsg.result]
resultArray.forEach((taskData) => {
+ // 收集 medias(无论 action 类型)
+ if (taskData.medias && Array.isArray(taskData.medias) && taskData.medias.length > 0) {
+ taskData.medias.forEach((media: any) => {
+ if (media && (media.url || media.thumbUrl)) {
+ allMedias.push({
+ type: media.type || 'IMAGE',
+ url: media.url || '',
+ thumbUrl: media.thumbUrl,
+ })
+ }
+ })
+ }
+
if (taskData.action && cardActionTypes.includes(taskData.action)) {
// 转换为 ActionCard 格式
actionCards.push({
@@ -85,8 +100,8 @@ export function createStoreMethods(ctx: IMethodsContext) {
tags: taskData.tags,
})
}
- else {
- // 其他 action 自动执行
+ else if (taskData.action && (taskData.action as string) !== 'none') {
+ // 其他有效 action 自动执行(排除 none,none 是后端表示无操作的特殊值)
autoExecuteActions.push(taskData)
}
})
@@ -108,6 +123,10 @@ export function createStoreMethods(ctx: IMethodsContext) {
if (actionCards.length > 0) {
messageUtils.updateMessageWithActions(resultMsg.message, actionCards)
}
+ else if (allMedias.length > 0) {
+ // 有 medias 时使用带 medias 的更新方法
+ messageUtils.updateMessageContentWithMedias(resultMsg.message, allMedias)
+ }
else {
messageUtils.updateMessageContent(resultMsg.message)
}
diff --git a/project/web/src/store/agent/handlers/sse.handlers.ts b/project/web/src/store/agent/handlers/sse.handlers.ts
index 836b2d16..3e05c30b 100644
--- a/project/web/src/store/agent/handlers/sse.handlers.ts
+++ b/project/web/src/store/agent/handlers/sse.handlers.ts
@@ -174,7 +174,9 @@ export const textDeltaHandler: ISSEHandler = {
if (ctx.refs.currentStepIndex.value >= 0 && ctx.refs.currentStepIndex.value < updatedSteps.length) {
updatedSteps[ctx.refs.currentStepIndex.value] = currentStepData
}
- else if (ctx.refs.currentStepIndex.value === updatedSteps.length) {
+ else if (ctx.refs.currentStepIndex.value >= updatedSteps.length) {
+ // 当 stepIndex >= steps.length 时,添加新步骤
+ // 这处理了 stepIndex > steps.length 的情况(中间可能有跳过的空步骤)
updatedSteps.push(currentStepData)
}
diff --git a/project/web/src/store/agent/utils/message.ts b/project/web/src/store/agent/utils/message.ts
index 99657127..5dc88777 100644
--- a/project/web/src/store/agent/utils/message.ts
+++ b/project/web/src/store/agent/utils/message.ts
@@ -77,9 +77,28 @@ export function createMessageUtils(ctx: IMessageContext) {
*/
updateMessageContent(content: string) {
set((state: any) => ({
- messages: state.messages.map((m: any) =>
- m.id === refs.currentAssistantMessageId.value ? { ...m, content, status: 'done' } : m,
- ),
+ messages: state.messages.map((m: any) => {
+ if (m.id === refs.currentAssistantMessageId.value) {
+ // 同时更新 content 和最后一个 step 的内容(如果存在)
+ // 这样确保 steps 和 content 保持同步
+ const updatedSteps = m.steps && m.steps.length > 0
+ ? m.steps.map((step: any, index: number) => {
+ // 只更新最后一个 step(当前活跃的 step)
+ if (index === m.steps.length - 1) {
+ return { ...step, content, isActive: false }
+ }
+ return step
+ })
+ : undefined
+ return {
+ ...m,
+ content,
+ status: 'done',
+ ...(updatedSteps ? { steps: updatedSteps } : {}),
+ }
+ }
+ return m
+ }),
}))
},
@@ -99,11 +118,68 @@ export function createMessageUtils(ctx: IMessageContext) {
*/
updateMessageWithActions(content: string, actions: IActionCard[]) {
set((state: any) => ({
- messages: state.messages.map((m: any) =>
- m.id === refs.currentAssistantMessageId.value
- ? { ...m, content, status: 'done', actions }
- : m,
- ),
+ messages: state.messages.map((m: any) => {
+ if (m.id === refs.currentAssistantMessageId.value) {
+ // 同时更新 content 和最后一个 step 的内容(如果存在)
+ const updatedSteps = m.steps && m.steps.length > 0
+ ? m.steps.map((step: any, index: number) => {
+ if (index === m.steps.length - 1) {
+ return { ...step, content, isActive: false }
+ }
+ return step
+ })
+ : undefined
+ return {
+ ...m,
+ content,
+ status: 'done',
+ actions,
+ ...(updatedSteps ? { steps: updatedSteps } : {}),
+ }
+ }
+ return m
+ }),
+ }))
+ },
+
+ /**
+ * 更新当前 assistant 消息内容,并将 medias 附加到最后一个 step
+ * 用于 SSE result 消息处理,确保视频/图片等媒体能正确显示
+ */
+ updateMessageContentWithMedias(content: string, medias?: Array<{ type: string, url: string, thumbUrl?: string }>) {
+ set((state: any) => ({
+ messages: state.messages.map((m: any) => {
+ if (m.id === refs.currentAssistantMessageId.value) {
+ // 转换 medias 格式
+ const convertedMedias = medias?.map(media => ({
+ url: media.url || media.thumbUrl || '',
+ type: media.type === 'VIDEO' ? 'video' as const : 'image' as const,
+ }))
+
+ // 更新 steps,将 medias 附加到最后一个 step
+ const updatedSteps = m.steps && m.steps.length > 0
+ ? m.steps.map((step: any, index: number) => {
+ if (index === m.steps.length - 1) {
+ return {
+ ...step,
+ content,
+ isActive: false,
+ ...(convertedMedias && convertedMedias.length > 0 ? { medias: convertedMedias } : {}),
+ }
+ }
+ return step
+ })
+ : undefined
+
+ return {
+ ...m,
+ content,
+ status: 'done',
+ ...(updatedSteps ? { steps: updatedSteps } : {}),
+ }
+ }
+ return m
+ }),
}))
},
diff --git a/project/web/src/store/agent/utils/workflow.ts b/project/web/src/store/agent/utils/workflow.ts
index 0a8d754b..ab4b8217 100644
--- a/project/web/src/store/agent/utils/workflow.ts
+++ b/project/web/src/store/agent/utils/workflow.ts
@@ -25,6 +25,7 @@ export function createWorkflowUtils(ctx: IWorkflowContext) {
/**
* 保存当前步骤到消息中
+ * 关键:正确处理 textDeltaHandler 创建的 `-live` 步骤,更新而非新增
*/
function saveCurrentStepToMessage() {
if (refs.currentStepIndex.value < 0 || !refs.streamingText.value.trim()) {
@@ -32,7 +33,7 @@ export function createWorkflowUtils(ctx: IWorkflowContext) {
}
const stepData: IMessageStep = {
- id: `step-${refs.currentStepIndex.value}-${Date.now()}`,
+ id: `step-${refs.currentStepIndex.value}-saved`,
content: refs.streamingText.value,
workflowSteps: [...refs.currentStepWorkflow.value],
isActive: false,
@@ -43,13 +44,23 @@ export function createWorkflowUtils(ctx: IWorkflowContext) {
messages: state.messages.map((m: any) => {
if (m.id === refs.currentAssistantMessageId.value) {
const steps = m.steps || []
+ // 查找匹配的步骤:可能是 -live 步骤或相同 index 的步骤
+ const liveStepId = `step-${refs.currentStepIndex.value}-live`
const existingIndex = steps.findIndex(
(s: IMessageStep) =>
- s.id === stepData.id
- || (refs.currentStepIndex.value >= 0 && steps.length === refs.currentStepIndex.value),
+ s.id === liveStepId // 匹配 textDeltaHandler 创建的 -live 步骤
+ || s.id.startsWith(`step-${refs.currentStepIndex.value}-`), // 匹配相同 index 的步骤
)
if (existingIndex >= 0) {
- steps[existingIndex] = stepData
+ // 更新已有步骤(保留工作流步骤的合并)
+ const existingStep = steps[existingIndex]
+ steps[existingIndex] = {
+ ...stepData,
+ // 合并工作流步骤,避免丢失
+ workflowSteps: (stepData.workflowSteps && stepData.workflowSteps.length > 0)
+ ? stepData.workflowSteps
+ : (existingStep.workflowSteps || []),
+ }
}
else {
steps.push(stepData)
diff --git a/project/web/src/store/plugin/store.ts b/project/web/src/store/plugin/store.ts
index 961ef8c8..b8da7536 100644
--- a/project/web/src/store/plugin/store.ts
+++ b/project/web/src/store/plugin/store.ts
@@ -117,6 +117,8 @@ export interface IPluginStore {
publishTasks: PublishTask[]
taskListConfig: PublishTaskListConfig
platformAccounts: PlatformAccountsMap
+ /** 插件弹框是否可见 */
+ pluginModalVisible: boolean
}
const store: IPluginStore = {
@@ -134,6 +136,7 @@ const store: IPluginStore = {
cleanAfter: 24 * 60 * 60 * 1000,
},
platformAccounts: createInitialPlatformAccounts(),
+ pluginModalVisible: false,
}
function getStore() {
@@ -150,6 +153,16 @@ export const usePluginStore = create(
set({ ...getStore() })
},
+ /** 打开插件弹框 */
+ openPluginModal() {
+ set({ pluginModalVisible: true })
+ },
+
+ /** 关闭插件弹框 */
+ closePluginModal() {
+ set({ pluginModalVisible: false })
+ },
+
/** 检查插件是否安装 */
checkPlugin() {
const isAvailable = typeof window !== 'undefined' && !!window.AIToEarnPlugin
diff --git a/project/web/src/store/plugin/types/baseTypes.ts b/project/web/src/store/plugin/types/baseTypes.ts
index 01c247ff..23ea0538 100644
--- a/project/web/src/store/plugin/types/baseTypes.ts
+++ b/project/web/src/store/plugin/types/baseTypes.ts
@@ -47,15 +47,12 @@ export enum PluginStatus {
INSTALLED_NO_PERMISSION = 'INSTALLED_NO_PERMISSION',
/** 未安装 */
NOT_INSTALLED = 'NOT_INSTALLED',
- /** 已连接(兼容旧代码) */
- CONNECTED = 'READY',
}
/**
* 插件支持的平台列表
*/
export const PLUGIN_SUPPORTED_PLATFORMS = [
- PlatType.Douyin,
PlatType.Xhs,
] as const