@talesofai/neta-skills 0.6.0

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE +21 -0
  3. package/README.en.md +234 -0
  4. package/README.md +237 -0
  5. package/bin/apis/activity.js +14 -0
  6. package/bin/apis/artifact.js +64 -0
  7. package/bin/apis/audio.js +10 -0
  8. package/bin/apis/collection.js +87 -0
  9. package/bin/apis/config.js +49 -0
  10. package/bin/apis/feeds.js +34 -0
  11. package/bin/apis/gpt.js +10 -0
  12. package/bin/apis/hashtag.js +23 -0
  13. package/bin/apis/index.js +62 -0
  14. package/bin/apis/prompt.js +120 -0
  15. package/bin/apis/recsys.js +29 -0
  16. package/bin/apis/space.js +48 -0
  17. package/bin/apis/task.js +21 -0
  18. package/bin/apis/tcp.js +16 -0
  19. package/bin/apis/types.js +76 -0
  20. package/bin/apis/user.js +45 -0
  21. package/bin/apis/verse.js +18 -0
  22. package/bin/cli.js +16 -0
  23. package/bin/commands/community/create_comment.cmd.en_us.yml +4 -0
  24. package/bin/commands/community/create_comment.cmd.js +40 -0
  25. package/bin/commands/community/create_comment.cmd.zh_cn.yml +3 -0
  26. package/bin/commands/community/favor_collection.cmd.en_us.yml +4 -0
  27. package/bin/commands/community/favor_collection.cmd.js +29 -0
  28. package/bin/commands/community/favor_collection.cmd.zh_cn.yml +3 -0
  29. package/bin/commands/community/get_fan_list.cmd.en_us.yml +4 -0
  30. package/bin/commands/community/get_fan_list.cmd.js +36 -0
  31. package/bin/commands/community/get_fan_list.cmd.zh_cn.yml +3 -0
  32. package/bin/commands/community/get_hashtag_characters.cmd.en_us.yml +4 -0
  33. package/bin/commands/community/get_hashtag_characters.cmd.js +46 -0
  34. package/bin/commands/community/get_hashtag_characters.cmd.zh_cn.yml +3 -0
  35. package/bin/commands/community/get_hashtag_collections.cmd.en_us.yml +6 -0
  36. package/bin/commands/community/get_hashtag_collections.cmd.js +54 -0
  37. package/bin/commands/community/get_hashtag_collections.cmd.zh_cn.yml +5 -0
  38. package/bin/commands/community/get_hashtag_info.cmd.en_us.yml +4 -0
  39. package/bin/commands/community/get_hashtag_info.cmd.js +42 -0
  40. package/bin/commands/community/get_hashtag_info.cmd.zh_cn.yml +3 -0
  41. package/bin/commands/community/get_subscribe_list.cmd.en_us.yml +4 -0
  42. package/bin/commands/community/get_subscribe_list.cmd.js +36 -0
  43. package/bin/commands/community/get_subscribe_list.cmd.zh_cn.yml +3 -0
  44. package/bin/commands/community/like_collection.cmd.en_us.yml +4 -0
  45. package/bin/commands/community/like_collection.cmd.js +29 -0
  46. package/bin/commands/community/like_collection.cmd.zh_cn.yml +4 -0
  47. package/bin/commands/community/list_space_topics.cmd.en_us.yml +7 -0
  48. package/bin/commands/community/list_space_topics.cmd.js +39 -0
  49. package/bin/commands/community/list_space_topics.cmd.zh_cn.yml +6 -0
  50. package/bin/commands/community/list_spaces.cmd.en_us.yml +4 -0
  51. package/bin/commands/community/list_spaces.cmd.js +19 -0
  52. package/bin/commands/community/list_spaces.cmd.zh_cn.yml +3 -0
  53. package/bin/commands/community/read_collection.cmd.en_us.yml +4 -0
  54. package/bin/commands/community/read_collection.cmd.js +83 -0
  55. package/bin/commands/community/read_collection.cmd.zh_cn.yml +3 -0
  56. package/bin/commands/community/request_interactive_feed.cmd.en_us.yml +4 -0
  57. package/bin/commands/community/request_interactive_feed.cmd.js +54 -0
  58. package/bin/commands/community/request_interactive_feed.cmd.zh_cn.yml +5 -0
  59. package/bin/commands/community/subscribe_user.cmd.en_us.yml +4 -0
  60. package/bin/commands/community/subscribe_user.cmd.js +33 -0
  61. package/bin/commands/community/subscribe_user.cmd.zh_cn.yml +3 -0
  62. package/bin/commands/community/suggest_categories.cmd.en_us.yml +4 -0
  63. package/bin/commands/community/suggest_categories.cmd.js +26 -0
  64. package/bin/commands/community/suggest_categories.cmd.zh_cn.yml +3 -0
  65. package/bin/commands/community/suggest_content.cmd.en_us.yml +5 -0
  66. package/bin/commands/community/suggest_content.cmd.js +59 -0
  67. package/bin/commands/community/suggest_content.cmd.zh_cn.yml +4 -0
  68. package/bin/commands/community/suggest_keywords.cmd.en_us.yml +4 -0
  69. package/bin/commands/community/suggest_keywords.cmd.js +26 -0
  70. package/bin/commands/community/suggest_keywords.cmd.zh_cn.yml +3 -0
  71. package/bin/commands/community/suggest_tags.cmd.en_us.yml +4 -0
  72. package/bin/commands/community/suggest_tags.cmd.js +26 -0
  73. package/bin/commands/community/suggest_tags.cmd.zh_cn.yml +3 -0
  74. package/bin/commands/community/validate_tax_path.cmd.en_us.yml +4 -0
  75. package/bin/commands/community/validate_tax_path.cmd.js +24 -0
  76. package/bin/commands/community/validate_tax_path.cmd.zh_cn.yml +3 -0
  77. package/bin/commands/creative/edit_colleciton.cmd.en_us.yml +11 -0
  78. package/bin/commands/creative/edit_colleciton.cmd.js +140 -0
  79. package/bin/commands/creative/edit_colleciton.cmd.zh_cn.yml +10 -0
  80. package/bin/commands/creative/make_image.cmd.en_us.yml +20 -0
  81. package/bin/commands/creative/make_image.cmd.js +58 -0
  82. package/bin/commands/creative/make_image.cmd.zh_cn.yml +19 -0
  83. package/bin/commands/creative/make_song.cmd.en_us.yml +8 -0
  84. package/bin/commands/creative/make_song.cmd.js +53 -0
  85. package/bin/commands/creative/make_song.cmd.zh_cn.yml +7 -0
  86. package/bin/commands/creative/make_video.cmd.en_us.yml +17 -0
  87. package/bin/commands/creative/make_video.cmd.js +54 -0
  88. package/bin/commands/creative/make_video.cmd.zh_cn.yml +16 -0
  89. package/bin/commands/creative/publish_collection.cmd.en_us.yml +10 -0
  90. package/bin/commands/creative/publish_collection.cmd.js +101 -0
  91. package/bin/commands/creative/publish_collection.cmd.zh_cn.yml +9 -0
  92. package/bin/commands/creative/remove_background.cmd.en_us.yml +10 -0
  93. package/bin/commands/creative/remove_background.cmd.js +74 -0
  94. package/bin/commands/creative/remove_background.cmd.zh_cn.yml +9 -0
  95. package/bin/commands/creative/request_character_or_elementum.cmd.en_us.yml +23 -0
  96. package/bin/commands/creative/request_character_or_elementum.cmd.js +108 -0
  97. package/bin/commands/creative/request_character_or_elementum.cmd.zh_cn.yml +22 -0
  98. package/bin/commands/creative/search_tcp.cmd.en_us.yml +16 -0
  99. package/bin/commands/creative/search_tcp.cmd.js +53 -0
  100. package/bin/commands/creative/search_tcp.cmd.zh_cn.yml +15 -0
  101. package/bin/commands/factory.js +15 -0
  102. package/bin/commands/load.js +157 -0
  103. package/bin/utils/errors.js +61 -0
  104. package/bin/utils/json.js +8 -0
  105. package/bin/utils/lang.js +8 -0
  106. package/bin/utils/parse_meta.js +16 -0
  107. package/bin/utils/polling.js +17 -0
  108. package/bin/utils/prompts.js +186 -0
  109. package/package.json +77 -0
  110. package/skills/neta/SKILL.md +119 -0
  111. package/skills/neta-community/SKILL.md +123 -0
  112. package/skills/neta-creative/SKILL.md +118 -0
  113. package/skills/neta-space/SKILL.md +129 -0
  114. package/skills/neta-suggest/SKILL.md +490 -0
  115. package/skills/zh_cn/neta/SKILL.md +111 -0
  116. package/skills/zh_cn/neta/references/character-search.md +234 -0
  117. package/skills/zh_cn/neta/references/collection-remix.md +40 -0
  118. package/skills/zh_cn/neta/references/community-exploration.md +636 -0
  119. package/skills/zh_cn/neta/references/hashtag-research.md +295 -0
  120. package/skills/zh_cn/neta/references/image-generation.md +121 -0
  121. package/skills/zh_cn/neta/references/interactive-feed.md +377 -0
  122. package/skills/zh_cn/neta/references/social-interactive.md +73 -0
  123. package/skills/zh_cn/neta/references/song-creation.md +247 -0
  124. package/skills/zh_cn/neta/references/song-mv.md +198 -0
  125. package/skills/zh_cn/neta/references/space.md +90 -0
  126. package/skills/zh_cn/neta/references/video-generation.md +221 -0
  127. package/skills/zh_cn/neta-community/SKILL.md +109 -0
  128. package/skills/zh_cn/neta-community/references/character-search.md +233 -0
  129. package/skills/zh_cn/neta-community/references/hashtag-research.md +295 -0
  130. package/skills/zh_cn/neta-community/references/interactive-feed.md +377 -0
  131. package/skills/zh_cn/neta-community/references/social-interactive.md +73 -0
  132. package/skills/zh_cn/neta-creative/SKILL.md +105 -0
  133. package/skills/zh_cn/neta-creative/references/character-search.md +233 -0
  134. package/skills/zh_cn/neta-creative/references/collection-remix.md +40 -0
  135. package/skills/zh_cn/neta-creative/references/image-generation.md +121 -0
  136. package/skills/zh_cn/neta-creative/references/song-creation.md +247 -0
  137. package/skills/zh_cn/neta-creative/references/song-mv.md +198 -0
  138. package/skills/zh_cn/neta-creative/references/video-generation.md +221 -0
  139. package/skills/zh_cn/neta-space/SKILL.md +126 -0
  140. package/skills/zh_cn/neta-suggest/SKILL.md +662 -0
@@ -0,0 +1,40 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ export const createCommentCmd = createCommand({
10
+ name: meta.name,
11
+ title: meta.title,
12
+ description: meta.description,
13
+ inputSchema: Type.Object({
14
+ content: Type.String({ minLength: 1, maxLength: 500 }),
15
+ parent_uuid: Type.String(),
16
+ parent_type: Type.Union([Type.Literal("collection")]),
17
+ at_users: Type.String({ default: "" }),
18
+ }),
19
+ }, async ({ content, parent_uuid, parent_type, at_users }, { apis }) => {
20
+ const atUsersArray = at_users
21
+ ? at_users
22
+ .split(",")
23
+ .map((uuid) => uuid.trim())
24
+ .filter(Boolean)
25
+ : [];
26
+ const result = await apis.collection.createComment({
27
+ content,
28
+ parent_uuid,
29
+ parent_type,
30
+ at_users: atUsersArray,
31
+ });
32
+ if (!result.success) {
33
+ throw new Error("create_comment fail");
34
+ }
35
+ return {
36
+ success: true,
37
+ comment_uuid: result.comment?.uuid,
38
+ message: "create_comment success",
39
+ };
40
+ });
@@ -0,0 +1,3 @@
1
+ name: create_comment
2
+ title: 评论作品、角色、元素
3
+ description: 对作品 (collection)、角色 (character)、元素 (elementum) 进行评论评论
@@ -0,0 +1,4 @@
1
+ name: favor_collection
2
+ title: Favorite/Unfavorite Collection
3
+ description: Mark a collection as favorite or remove it from favorites.
4
+
@@ -0,0 +1,29 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ export const favorCollectionCmd = createCommand({
10
+ name: meta.name,
11
+ title: meta.title,
12
+ description: meta.description,
13
+ inputSchema: Type.Object({
14
+ uuid: Type.String(),
15
+ is_cancel: Type.Boolean({
16
+ default: false,
17
+ }),
18
+ }),
19
+ }, async ({ uuid, is_cancel }, { apis }) => {
20
+ const action = is_cancel ? "cancel_favor" : "favor";
21
+ const result = await apis.collection.favorCollection(uuid, { is_cancel });
22
+ if (!result.success) {
23
+ throw new Error(`${action} fail`);
24
+ }
25
+ return {
26
+ success: true,
27
+ message: `${action} success`,
28
+ };
29
+ });
@@ -0,0 +1,3 @@
1
+ name: favor_collection
2
+ title: 收藏作品&取消收藏
3
+ description: 对作品进行收藏或取消收藏操作
@@ -0,0 +1,4 @@
1
+ name: get_fan_list
2
+ title: Get Fans List
3
+ description: Retrieve the list of followers (fans) of the current user, with pagination support.
4
+
@@ -0,0 +1,36 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ export const getFanListCmd = createCommand({
10
+ name: meta.name,
11
+ title: meta.title,
12
+ description: meta.description,
13
+ inputSchema: Type.Object({
14
+ page_index: Type.Integer({ minimum: 0, default: 0 }),
15
+ page_size: Type.Integer({ minimum: 1, maximum: 50, default: 20 }),
16
+ }),
17
+ }, async ({ page_index, page_size }, { apis }) => {
18
+ const result = await apis.user.getFanList({
19
+ page_index,
20
+ page_size,
21
+ });
22
+ return {
23
+ total: result.total,
24
+ page_index: result.page_index,
25
+ page_size: result.page_size,
26
+ list: result.list.map((user) => ({
27
+ uuid: user.uuid,
28
+ name: user.name,
29
+ avatar_url: user.avatar_url,
30
+ total_fans: user.total_fans,
31
+ total_collections: user.total_collections,
32
+ subscribe_status: user.subscribe_status,
33
+ })),
34
+ has_next: result.has_next,
35
+ };
36
+ });
@@ -0,0 +1,3 @@
1
+ name: get_fan_list
2
+ title: 获取粉丝列表
3
+ description: 获取当前用户的粉丝列表,支持分页
@@ -0,0 +1,4 @@
1
+ name: get_hashtag_characters
2
+ title: Get Characters Under Hashtag
3
+ description: Retrieve the list of characters associated with a given hashtag.
4
+
@@ -0,0 +1,46 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ const fetchCharactersByHashtagV1Parameters = Type.Object({
10
+ hashtag: Type.String(),
11
+ page_index: Type.Integer({ minimum: 0, default: 0 }),
12
+ page_size: Type.Integer({ minimum: 1, maximum: 100, default: 20 }),
13
+ sort_by: Type.Union([Type.Literal("hot"), Type.Literal("newest")], {
14
+ default: "hot",
15
+ }),
16
+ parent_type: Type.Optional(Type.Union([Type.Literal("oc"), Type.Literal("elementum")])),
17
+ });
18
+ export const getHashtagCharacters = createCommand({
19
+ name: meta.name,
20
+ title: meta.title,
21
+ description: meta.description,
22
+ inputSchema: fetchCharactersByHashtagV1Parameters,
23
+ }, async ({ hashtag, page_index, page_size, sort_by, parent_type }, { apis }) => {
24
+ const result = await apis.hashtag.fetchCharactersByHashtag(hashtag, {
25
+ page_index,
26
+ page_size,
27
+ sort_by,
28
+ parent_type,
29
+ });
30
+ const simplifiedList = result.list.map((char) => ({
31
+ uuid: char.uuid,
32
+ name: char.name,
33
+ short_name: char.short_name,
34
+ avatar_img: char.config?.avatar_img || null,
35
+ ctime: char.ctime,
36
+ creator_uuid: char.creator?.uuid,
37
+ creator_name: char.creator?.nick_name,
38
+ }));
39
+ return {
40
+ total: result.total,
41
+ page_index: result.page_index,
42
+ page_size: result.page_size,
43
+ list: simplifiedList,
44
+ has_next: result.has_next,
45
+ };
46
+ });
@@ -0,0 +1,3 @@
1
+ name: get_hashtag_characters
2
+ title: 获取hashtag下的角色列表
3
+ description: 获取hashtag下的角色列表
@@ -0,0 +1,6 @@
1
+ name: get_hashtag_collections
2
+ title: Get Featured Collections Under Hashtag
3
+ description: Retrieve featured collections associated with a given hashtag.
4
+ errors:
5
+ no_activity_space: Hashtag "{hashtag}" is not linked to any activity space.
6
+
@@ -0,0 +1,54 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ errors: Type.Object({
9
+ no_activity_space: Type.String(),
10
+ }),
11
+ }), import.meta);
12
+ const fetchSelectedCollectionsByHashtagV1Parameters = Type.Object({
13
+ hashtag: Type.String(),
14
+ page_index: Type.Integer({ minimum: 0, default: 0 }),
15
+ page_size: Type.Integer({ minimum: 1, maximum: 100, default: 20 }),
16
+ sort_by: Type.Union([Type.Literal("highlight_mark_time")], {
17
+ default: "highlight_mark_time",
18
+ }),
19
+ });
20
+ export const getHashtagCollections = createCommand({
21
+ name: meta.name,
22
+ title: meta.title,
23
+ description: meta.description,
24
+ inputSchema: fetchSelectedCollectionsByHashtagV1Parameters,
25
+ }, async ({ hashtag, page_index = 0, page_size = 20, sort_by = "highlight_mark_time", }, { apis }) => {
26
+ // 通过hashtag获取对应的activity_uuid
27
+ const hashtagResult = await apis.hashtag.fetchHashtag(hashtag);
28
+ const activityDetail = hashtagResult?.activity_detail;
29
+ const activity_uuid = activityDetail?.uuid;
30
+ if (!activity_uuid) {
31
+ throw new Error(meta.errors.no_activity_space.replace("{hashtag}", String(hashtag ?? "").trim()));
32
+ }
33
+ const result = await apis.activity.fetchSelectedCollections(activity_uuid, {
34
+ page_index,
35
+ page_size,
36
+ sort_by,
37
+ });
38
+ // 转换API返回结果为工具输出格式
39
+ const simplifiedList = (result.list || []).map((collection) => ({
40
+ uuid: collection.storyId,
41
+ name: collection.name,
42
+ coverUrl: collection.coverUrl,
43
+ creator_name: collection.user_nick_name,
44
+ likeCount: collection.likeCount,
45
+ sameStyleCount: collection.sameStyleCount,
46
+ ctime: collection.ctime,
47
+ }));
48
+ return {
49
+ total: result.total,
50
+ page_index: result.page_index,
51
+ page_size: result.page_size,
52
+ list: simplifiedList,
53
+ };
54
+ });
@@ -0,0 +1,5 @@
1
+ name: get_hashtag_collections
2
+ title: 获取hashtag下的精选玩法
3
+ description: 获取hashtag下的精选玩法
4
+ errors:
5
+ no_activity_space: Hashtag "{hashtag}" 未关联任何活动空间
@@ -0,0 +1,4 @@
1
+ name: get_hashtag_info
2
+ title: Get Hashtag/Space Info
3
+ description: Retrieve detailed information for a hashtag or space.
4
+
@@ -0,0 +1,42 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ const fetchHashtagV1Parameters = Type.Object({
10
+ hashtag: Type.String(),
11
+ });
12
+ export const getHashtagInfo = createCommand({
13
+ name: meta.name,
14
+ title: meta.title,
15
+ description: meta.description,
16
+ inputSchema: fetchHashtagV1Parameters,
17
+ }, async ({ hashtag }, { apis }) => {
18
+ const result = await apis.hashtag.fetchHashtag(hashtag);
19
+ // 转换API返回结果为工具输出格式
20
+ const activityDetail = result["activity_detail"];
21
+ const simplifiedActivityDetail = activityDetail
22
+ ? {
23
+ uuid: activityDetail.uuid,
24
+ title: activityDetail.title,
25
+ banner_pic: activityDetail.banner_pic,
26
+ creator_name: activityDetail.creator_name,
27
+ review_users: activityDetail.review_users?.map((user) => ({
28
+ uuid: user.uuid,
29
+ name: user.name,
30
+ })) ?? null,
31
+ }
32
+ : null;
33
+ return {
34
+ hashtag: {
35
+ name: result.name,
36
+ lore: result.lore || [],
37
+ activity_detail: simplifiedActivityDetail,
38
+ hashtag_heat: result.hashtag_heat,
39
+ subscribe_count: result.subscribe_count,
40
+ },
41
+ };
42
+ });
@@ -0,0 +1,3 @@
1
+ name: get_hashtag_info
2
+ title: 获取hashtag/空间详情
3
+ description: 获取hashtag/空间详情
@@ -0,0 +1,4 @@
1
+ name: get_subscribe_list
2
+ title: Get Following List
3
+ description: Retrieve the list of users that the current user is following, with pagination support.
4
+
@@ -0,0 +1,36 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ export const getSubscribeListCmd = createCommand({
10
+ name: meta.name,
11
+ title: meta.title,
12
+ description: meta.description,
13
+ inputSchema: Type.Object({
14
+ page_index: Type.Integer({ minimum: 0, default: 0 }),
15
+ page_size: Type.Integer({ minimum: 1, maximum: 50, default: 20 }),
16
+ }),
17
+ }, async ({ page_index, page_size }, { apis }) => {
18
+ const result = await apis.user.getSubscribeList({
19
+ page_index,
20
+ page_size,
21
+ });
22
+ return {
23
+ total: result.total,
24
+ page_index: result.page_index,
25
+ page_size: result.page_size,
26
+ list: result.list.map((user) => ({
27
+ uuid: user.uuid,
28
+ name: user.name,
29
+ avatar_url: user.avatar_url,
30
+ total_fans: user.total_fans,
31
+ total_collections: user.total_collections,
32
+ subscribe_status: user.subscribe_status,
33
+ })),
34
+ has_next: result.has_next,
35
+ };
36
+ });
@@ -0,0 +1,3 @@
1
+ name: get_subscribe_list
2
+ title: 获取关注列表
3
+ description: 获取当前用户关注的用户列表,支持分页
@@ -0,0 +1,4 @@
1
+ name: like_collection
2
+ title: Like/Unlike Collection
3
+ description: Like a collection or remove a like from it.
4
+
@@ -0,0 +1,29 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ export const likeCollectionCmd = createCommand({
10
+ name: meta.name,
11
+ title: meta.title,
12
+ description: meta.description,
13
+ inputSchema: Type.Object({
14
+ uuid: Type.String(),
15
+ is_cancel: Type.Boolean({
16
+ default: false,
17
+ }),
18
+ }),
19
+ }, async ({ uuid, is_cancel }, { apis }) => {
20
+ const action = is_cancel ? "unliked" : "liked";
21
+ const success = await apis.collection.likeCollection(uuid, { is_cancel });
22
+ if (!success) {
23
+ throw new Error(`${action} fail`);
24
+ }
25
+ return {
26
+ success: true,
27
+ message: `${action} success`,
28
+ };
29
+ });
@@ -0,0 +1,4 @@
1
+ name: like_collection
2
+ title: 作品点赞&取消点赞
3
+ description: 对作品进行点赞或取消点赞操作
4
+
@@ -0,0 +1,7 @@
1
+ name: list_space_topics
2
+ title: List Topics in Space
3
+ description: List topics (sub‑spaces) within a space.
4
+
5
+ parameters:
6
+ space_uuid: UUID of the space.
7
+
@@ -0,0 +1,39 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ parameters: Type.Object({
9
+ space_uuid: Type.String(),
10
+ }),
11
+ }), import.meta);
12
+ export const listSpaceTopics = createCommand({
13
+ name: meta.name,
14
+ title: meta.title,
15
+ description: meta.description,
16
+ inputSchema: Type.Object({
17
+ space_uuid: Type.String(),
18
+ }),
19
+ }, async ({ space_uuid }, { apis }) => {
20
+ const spaceConfigs = await apis.space.spaceConfigs();
21
+ const topics = await apis.space
22
+ .topics(space_uuid)
23
+ .then(({ primary_topic, topics }) => {
24
+ return {
25
+ primary_topic,
26
+ topics: topics.map((topic) => {
27
+ const { curated_works, ...config } = spaceConfigs[topic.hashtag_name] ?? {};
28
+ return {
29
+ ...topic,
30
+ ...config,
31
+ official_collections: curated_works,
32
+ };
33
+ }),
34
+ };
35
+ });
36
+ return {
37
+ topics,
38
+ };
39
+ });
@@ -0,0 +1,6 @@
1
+ name: list_space_topics
2
+ title: 获取空间内话题(子空间)
3
+ description: 获取空间内话题(子空间)
4
+
5
+ parameters:
6
+ space_uuid: 空间UUID
@@ -0,0 +1,4 @@
1
+ name: list_spaces
2
+ title: List Spaces
3
+ description: Retrieve all available spaces.
4
+
@@ -0,0 +1,19 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ export const listSpaces = createCommand({
10
+ name: meta.name,
11
+ title: meta.title,
12
+ description: meta.description,
13
+ }, async (_, { apis }) => {
14
+ const spaceHashtags = await apis.space.spaceHashtags();
15
+ const spaces = await Promise.all(spaceHashtags.map((hashtag) => apis.space.basic(hashtag))).then((spaces) => spaces.filter((space) => space?.space_uuid));
16
+ return {
17
+ spaces,
18
+ };
19
+ });
@@ -0,0 +1,3 @@
1
+ name: list_spaces
2
+ title: 获取全部空间
3
+ description: 获取全部空间
@@ -0,0 +1,4 @@
1
+ name: read_collection
2
+ title: Read Collection
3
+ description: Read detailed information about a collection or interactive experience.
4
+
@@ -0,0 +1,83 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { isVerseCTA } from "../../apis/collection.js";
3
+ import { parseMeta } from "../../utils/parse_meta.js";
4
+ import { createCommand } from "../factory.js";
5
+ const mete = parseMeta(Type.Object({
6
+ name: Type.String(),
7
+ title: Type.String(),
8
+ description: Type.String(),
9
+ }), import.meta);
10
+ export const readCollectionCmd = createCommand({
11
+ name: mete.name,
12
+ title: mete.title,
13
+ description: mete.description,
14
+ inputSchema: Type.Object({
15
+ uuid: Type.String(),
16
+ }),
17
+ }, async ({ uuid }, { apis }) => {
18
+ const res = await apis.feeds.interactiveItem({ collection_uuid: uuid });
19
+ if (!res || res.template_id !== "NORMAL") {
20
+ throw new Error(`Collection "${uuid}" not found`);
21
+ }
22
+ const name = res.json_data.name;
23
+ const description = res.json_data.description ?? "";
24
+ const creator = {
25
+ uuid: res.json_data.creator.uuid,
26
+ name: res.json_data.creator.nick_name,
27
+ };
28
+ const artifacts = res.json_data.displayData?.pages.flatMap((page) => page.images.map((image) => ({
29
+ uuid: image.uuid,
30
+ url: image.url,
31
+ modality: image.modality,
32
+ status: image.status,
33
+ image_detail: image.image_detail,
34
+ video_detail: image.video_detail,
35
+ })));
36
+ const tags = await apis.feeds
37
+ .tags(uuid)
38
+ .then((res) => res.map((tag) => ({
39
+ name: tag.name,
40
+ type: tag.type,
41
+ participants_count: tag.participants_count,
42
+ header_pic_url: tag.header_pic_url,
43
+ })))
44
+ .catch(() => []);
45
+ const remix = await (async () => {
46
+ const cta = res.json_data.cta_info;
47
+ const verse_uuid = isVerseCTA(cta)
48
+ ? (cta.interactive_config?.verse_uuid ?? null)
49
+ : null;
50
+ const verse = verse_uuid
51
+ ? await apis.verse.versePreset(verse_uuid).catch(() => null)
52
+ : null;
53
+ const preset_description = verse?.preset_description ?? null;
54
+ const reference_planning = verse?.reference_planning ?? null;
55
+ if (isVerseCTA(cta)) {
56
+ const { interactive_config, interactive_status: _, type: __, ...rest } = cta;
57
+ if (!interactive_config?.verse_uuid)
58
+ return null;
59
+ const verse = await apis.verse
60
+ .versePreset(interactive_config.verse_uuid)
61
+ .catch(() => null);
62
+ if (!verse)
63
+ return null;
64
+ return {
65
+ ...rest,
66
+ preset_description,
67
+ reference_planning,
68
+ };
69
+ }
70
+ return null;
71
+ })();
72
+ return {
73
+ collection: {
74
+ uuid,
75
+ name,
76
+ description,
77
+ creator,
78
+ artifacts,
79
+ tags,
80
+ remix,
81
+ },
82
+ };
83
+ });
@@ -0,0 +1,3 @@
1
+ name: read_collection
2
+ title: 读取玩法信息
3
+ description: 读取玩法信息
@@ -0,0 +1,4 @@
1
+ name: request_interactive_feed
2
+ title: Get Interactive Feed
3
+ description: Retrieve interactive content feeds with pagination and multiple filter options, automatically inferring the scenario (home, profile, related feed, etc.) from parameters.
4
+
@@ -0,0 +1,54 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseMeta } from "../../utils/parse_meta.js";
3
+ import { createCommand } from "../factory.js";
4
+ const meta = parseMeta(Type.Object({
5
+ name: Type.String(),
6
+ title: Type.String(),
7
+ description: Type.String(),
8
+ }), import.meta);
9
+ export const requestInteractiveFeedInputSchema = Type.Object({
10
+ page_index: Type.Integer({ minimum: 0, default: 0 }),
11
+ page_size: Type.Integer({ minimum: 1, maximum: 40, default: 20 }),
12
+ biz_trace_id: Type.Optional(Type.String()),
13
+ scene: Type.String({ default: "agent_intent" }),
14
+ collection_uuid: Type.Optional(Type.String()),
15
+ target_collection_uuid: Type.Optional(Type.String()),
16
+ target_user_uuid: Type.Optional(Type.String()),
17
+ });
18
+ // 复用 collection.ts 中的类型定义
19
+ export const requestInteractiveFeedOutputSchema = Type.Object({
20
+ module_list_header: Type.Null(),
21
+ module_list: Type.Array(Type.Object({
22
+ data_id: Type.String(),
23
+ module_id: Type.String(),
24
+ template_id: Type.String(),
25
+ json_data: Type.Record(Type.String(), Type.Unknown()),
26
+ })),
27
+ page_data: Type.Object({
28
+ page_index: Type.Optional(Type.Number()),
29
+ page_size: Type.Optional(Type.Number()),
30
+ has_next_page: Type.Optional(Type.Boolean()),
31
+ biz_trace_id: Type.Optional(Type.String()),
32
+ }),
33
+ });
34
+ export const requestInteractiveFeed = createCommand({
35
+ name: meta.name,
36
+ title: meta.title,
37
+ description: meta.description,
38
+ inputSchema: requestInteractiveFeedInputSchema,
39
+ }, async (params, { apis }) => {
40
+ const result = await apis.feeds.interactiveList({
41
+ page_index: params.page_index,
42
+ page_size: params.page_size,
43
+ biz_trace_id: params.biz_trace_id,
44
+ scene: params.scene,
45
+ collection_uuid: params.collection_uuid,
46
+ target_collection_uuid: params.target_collection_uuid,
47
+ target_user_uuid: params.target_user_uuid,
48
+ });
49
+ return {
50
+ module_list_header: result.module_list_header,
51
+ module_list: result.module_list,
52
+ page_data: result.page_data,
53
+ };
54
+ });
@@ -0,0 +1,5 @@
1
+ name: request_interactive_feed
2
+ title: 获取互动推荐列表
3
+ description: 获取互动内容推荐列表,支持分页和多种筛选参数。根据传入参数自动判断场景(首页/个人主页/相关性 Feed 等)。
4
+
5
+
@@ -0,0 +1,4 @@
1
+ name: subscribe_user
2
+ title: Follow/Unfollow User
3
+ description: Follow or unfollow a user.
4
+