socialdatax-skills 0.2.23 → 0.2.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -73,7 +73,7 @@ Common search phrases for this skill package:
73
73
  - Sensitive Words Check MCP server name: `sensitive-check`
74
74
  - Sensitive Words Check future MCP registry name: `com.socialdatax/sensitive-check`
75
75
  - Unified MCP registry name: none; this package installs skills and calls explicit platform services.
76
- - Current public capability version: `0.2.23`
76
+ - Current public capability version: `0.2.24`
77
77
 
78
78
  ## Direct CLI
79
79
 
@@ -87,6 +87,7 @@ npx -y socialdatax-skills@latest xhs search --keyword "露营" --since-days 7 --
87
87
  npx -y socialdatax-skills@latest xhs hot-search --pretty
88
88
  npx -y socialdatax-skills@latest xhs detail --note-id "<note_id>" --pretty
89
89
  npx -y socialdatax-skills@latest xhs comments --note-id "<note_id>" --pretty
90
+ npx -y socialdatax-skills@latest xhs comments --note-id "<note_id>" --sort-type time_descending --pretty
90
91
  npx -y socialdatax-skills@latest xhs comments --note-id "<note_id>" --all --include-replies --pretty
91
92
  npx -y socialdatax-skills@latest xhs sub-comments --note-id "<note_id>" --comment-id "<comment_id>" --pretty
92
93
  npx -y socialdatax-skills@latest xhs user-info --user-id "<user_id>" --pretty
@@ -186,6 +187,10 @@ XHS, Douyin, Kuaishou, Weibo, and WeChat Channels search use `--keyword` and opt
186
187
  Kuaishou work search uses `kuaishou search --keyword` and optional `--page-token`; Kuaishou creator search uses `kuaishou user-search --keyword` and optional `--page-token`. Kuaishou search does not accept Douyin semantic filters, and `kuaishou user-search` does not support `--since-days`.
187
188
  Weibo and WeChat Channels search use `--keyword` and optional `--page-token`.
188
189
 
190
+ XHS comments accept optional `--sort-type` values: `default`,
191
+ `time_descending`, and `like_count_descending`; omit it for the platform
192
+ default comment order.
193
+
189
194
  Douyin search filters use semantic values: `--sort-type` supports `general`,
190
195
  `time_descending`, and `like_count_descending`; `--publish-time-range` supports
191
196
  `all`, `day`, `week`, and `half_year`; `--duration-range` supports `all`,
@@ -405,8 +410,8 @@ Current Sensitive Words Check workflows include:
405
410
  | `xhs_search_notes` | Search Xiaohongshu / 小红书 notes by keyword with optional sort, note type, and publish-time filters. |
406
411
  | `xhs_get_note_detail_by_note_url` | Resolve a shared XHS link, short link, or share text into structured note details. |
407
412
  | `xhs_get_note_detail_by_note_id` | Fetch structured note details when the caller already has a note ID. |
408
- | `xhs_get_note_comments_by_note_id` | Fetch paginated first-level comments when the caller already has a note ID. |
409
- | `xhs_get_note_comments_by_note_url` | Fetch paginated first-level comments directly from a shared note URL, short link, or share text. |
413
+ | `xhs_get_note_comments_by_note_id` | Fetch paginated first-level comments when the caller already has a note ID; accepts optional comment `sort_type`. |
414
+ | `xhs_get_note_comments_by_note_url` | Fetch paginated first-level comments directly from a shared note URL, short link, or share text; accepts optional comment `sort_type`. |
410
415
  | `xhs_get_note_sub_comments_by_comment_id` | Fetch paginated replies under a first-level comment by note ID and comment ID. |
411
416
  | `xhs_get_user_info_by_user_id` | Fetch creator profile data when the caller already has a user ID. |
412
417
  | `xhs_get_user_info_by_profile_url` | Resolve a profile link, short link, or share text into creator profile data. |
package/cli.mjs CHANGED
@@ -17,7 +17,7 @@ import { dirname, join, resolve } from "node:path";
17
17
  import { fileURLToPath } from "node:url";
18
18
 
19
19
  const PACKAGE_NAME = "socialdatax-skills";
20
- const PACKAGE_VERSION = "0.2.23";
20
+ const PACKAGE_VERSION = "0.2.24";
21
21
  const PACKAGE_SPEC = `${PACKAGE_NAME}@latest`;
22
22
  const LOG_PREFIX = `[${PACKAGE_NAME}]`;
23
23
  const MIN_NODE_VERSION = "20.18.1";
@@ -177,6 +177,7 @@ const XHS_DIRECT_ACTION_OPTIONS = {
177
177
  "all",
178
178
  "maxItems",
179
179
  "includeReplies",
180
+ "sortType",
180
181
  "pretty",
181
182
  ],
182
183
  "sub-comments": [
@@ -228,6 +229,11 @@ const XHS_SEARCH_SORT_TYPES = [
228
229
  "comment_count_descending",
229
230
  "collect_count_descending",
230
231
  ];
232
+ const XHS_COMMENT_SORT_TYPES = [
233
+ "default",
234
+ "time_descending",
235
+ "like_count_descending",
236
+ ];
231
237
  const XHS_LEGACY_SEARCH_SORT_TYPE_ALIASES = {
232
238
  popularity_descending: "like_count_descending",
233
239
  comment_descending: "comment_count_descending",
@@ -552,12 +558,13 @@ const PLATFORMS = {
552
558
  },
553
559
  {
554
560
  name: "xhs_get_note_comments_by_note_id",
555
- description: "Fetch paginated first-level comments by note ID.",
561
+ description:
562
+ "Fetch paginated first-level comments by note ID with optional sort.",
556
563
  },
557
564
  {
558
565
  name: "xhs_get_note_comments_by_note_url",
559
566
  description:
560
- "Fetch paginated first-level comments from a note URL, short link, or share text.",
567
+ "Fetch paginated first-level comments from a note URL, short link, or share text with optional sort.",
561
568
  },
562
569
  {
563
570
  name: "xhs_get_note_sub_comments_by_comment_id",
@@ -2092,6 +2099,8 @@ function printHelp() {
2092
2099
  console.log(" For comments commands, also fetch nested second-level replies for each returned first-level comment.");
2093
2100
  console.log(" --sort-type <general|time_descending|like_count_descending|comment_count_descending|collect_count_descending>");
2094
2101
  console.log(" XHS sort meanings: general=default, time_descending=newest, like_count_descending=most liked, comment_count_descending=most commented, collect_count_descending=most collected.");
2102
+ console.log(" --sort-type <default|time_descending|like_count_descending>");
2103
+ console.log(" XHS comments sort meanings: default=platform default, time_descending=newest, like_count_descending=most liked.");
2095
2104
  console.log(" --note-type <all|image|video> XHS search note type filter; default is all.");
2096
2105
  console.log(" --publish-time-range <all|day|week|half_year>");
2097
2106
  console.log(" XHS search publish-time filter; default is all.");
@@ -2386,6 +2395,7 @@ function buildXhsOperation(action, options) {
2386
2395
  idDisplay: "--note-id",
2387
2396
  urlDisplay: "--url",
2388
2397
  pageToken: options.pageToken,
2398
+ extraArguments: buildXhsCommentsExtraArguments(options),
2389
2399
  })
2390
2400
  );
2391
2401
  case "sub-comments":
@@ -3684,6 +3694,7 @@ function buildOneOfCall(
3684
3694
  idDisplay,
3685
3695
  urlDisplay,
3686
3696
  pageToken,
3697
+ extraArguments = {},
3687
3698
  }
3688
3699
  ) {
3689
3700
  const idValue = options[idOption];
@@ -3700,9 +3711,23 @@ function buildOneOfCall(
3700
3711
  if (pageToken) {
3701
3712
  toolArguments.page_token = pageToken;
3702
3713
  }
3714
+ Object.assign(toolArguments, extraArguments);
3703
3715
  return { tool, toolArguments };
3704
3716
  }
3705
3717
 
3718
+ function buildXhsCommentsExtraArguments(options) {
3719
+ const toolArguments = {};
3720
+ if (options.sortType !== undefined) {
3721
+ toolArguments.sort_type = parseAllowedStringOption(
3722
+ options.sortType,
3723
+ "--sort-type",
3724
+ XHS_COMMENT_SORT_TYPES,
3725
+ XHS_COMMENT_SORT_TYPES.join(", ")
3726
+ );
3727
+ }
3728
+ return toolArguments;
3729
+ }
3730
+
3706
3731
  function buildTranscriptCall(
3707
3732
  options,
3708
3733
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socialdatax-skills",
3
- "version": "0.2.23",
3
+ "version": "0.2.24",
4
4
  "description": "SocialDataX / 社媒数据助手 skill installer and direct CLI helper for hosted platform social media MCP services.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -142,6 +142,7 @@ npx -y socialdatax-skills@latest wechat replies \
142
142
  Optional arguments:
143
143
 
144
144
  - XHS `--note-id <note_id>`: use the complete 24-character lowercase hexadecimal `note_id` returned from search, detail, comments, or creator note lists; do not pass only a prefix.
145
+ - XHS comments `--sort-type <default|time_descending|like_count_descending>`: optional first-level comment sort order; omit it for the platform default order.
145
146
  - Douyin `--aweme-id <aweme_id>`: preferred when the video ID is already known and should anchor the comment thread.
146
147
  - `--url <url_or_share_text>`: use for a content page URL, short link, or share text for first-level comments.
147
148
  - Douyin URL safety: do not pass `video.play_url`; use a Douyin content page URL, short link, or share text instead.
@@ -188,8 +189,8 @@ MCP tools matching the direct CLI commands above:
188
189
  - `wechat_get_video_comment_replies_by_comment_id`
189
190
 
190
191
  If MCP tools are already available in the current agent, use one of these tools:
191
- - `xhs_get_note_comments_by_note_id`: use when the complete 24-character lowercase hexadecimal `note_id` is known; do not pass only a prefix.
192
- - `xhs_get_note_comments_by_note_url`: use for note URLs, short links, or share text.
192
+ - `xhs_get_note_comments_by_note_id`: use when the complete 24-character lowercase hexadecimal `note_id` is known; do not pass only a prefix; optional `sort_type` accepts `default`, `time_descending`, or `like_count_descending`.
193
+ - `xhs_get_note_comments_by_note_url`: use for note URLs, short links, or share text; optional `sort_type` accepts `default`, `time_descending`, or `like_count_descending`.
193
194
  - `xhs_get_note_sub_comments_by_comment_id`: use when the complete 24-character lowercase hexadecimal `note_id` and first-level comment ID are known; do not pass only a note ID prefix.
194
195
  - `douyin_get_video_comments_by_aweme_id`: use when the aweme_id is known.
195
196
  - `douyin_get_video_comments_by_url`: use for Douyin content page URLs, short links, or share text; do not pass playback URLs such as `video.play_url`.
@@ -436,7 +436,8 @@ Optional arguments:
436
436
  - Kuaishou `user-search` supports `--pages <n>` and `--max-items <n>` for bounded creator candidate discovery; it does not support `--since-days`.
437
437
  - `--since-days <1-365>`: keep search or creator content-list items whose public `publish_time` is within the last N days. Search stays bounded by `--pages`; creator content lists continue until the publish-time boundary when `--pages` is omitted.
438
438
  - `--include-replies`: for first-level comments, also fetch nested second-level replies under each returned comment.
439
- - `--sort-type`, `--note-type`, `--publish-time-range`, `--duration-range`, and `--content-type`: apply only to XHS, Douyin, or WeChat Channels keyword research commands when the user asks for filtering; Kuaishou and Weibo search currently use `--keyword` and optional `--page-token`.
439
+ - XHS comments `--sort-type <default|time_descending|like_count_descending>`: optional first-level comment sort order; omit it for the platform default order.
440
+ - Keyword research filters: use the documented XHS, Douyin, and WeChat Channels search `--sort-type` values; `--note-type`, `--publish-time-range`, `--duration-range`, and `--content-type` apply only where supported. Kuaishou and Weibo search currently use `--keyword` and optional `--page-token`.
440
441
  - `--comment-id`: required for reply/sub-comment commands together with the content ID.
441
442
  - `--pretty`: output formatting only.
442
443
  - `--source-client socialdatax-skills --source-platform npm --source-skill socialdatax-content-research-assistant`: usage attribution for this Agent Skill; keep these values unchanged when running examples from this Skill.