@talesofai/neta-skills 0.12.0 → 0.14.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 (93) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +29 -21
  3. package/README.zh_cn.md +14 -14
  4. package/bin/apis/commerce.js +41 -0
  5. package/bin/apis/index.js +4 -0
  6. package/bin/commands/{travel_campaign/create_travel_campaign.cmd.en_us.yml → adventure_campaign/create_adventure_campaign.cmd.en_us.yml} +5 -5
  7. package/bin/commands/{travel_campaign/create_travel_campaign.cmd.js → adventure_campaign/create_adventure_campaign.cmd.js} +3 -3
  8. package/bin/commands/{travel_campaign/create_travel_campaign.cmd.zh_cn.yml → adventure_campaign/create_adventure_campaign.cmd.zh_cn.yml} +2 -2
  9. package/bin/commands/{travel_campaign/list_my_travel_campaigns.cmd.en_us.yml → adventure_campaign/list_my_adventure_campaigns.cmd.en_us.yml} +4 -4
  10. package/bin/commands/{travel_campaign/list_my_travel_campaigns.cmd.js → adventure_campaign/list_my_adventure_campaigns.cmd.js} +3 -3
  11. package/bin/commands/{travel_campaign/list_my_travel_campaigns.cmd.zh_cn.yml → adventure_campaign/list_my_adventure_campaigns.cmd.zh_cn.yml} +2 -2
  12. package/bin/commands/{travel_campaign/request_travel_campaign.cmd.en_us.yml → adventure_campaign/request_adventure_campaign.cmd.en_us.yml} +3 -3
  13. package/bin/commands/{travel_campaign/request_travel_campaign.cmd.js → adventure_campaign/request_adventure_campaign.cmd.js} +3 -3
  14. package/bin/commands/{travel_campaign/request_travel_campaign.cmd.zh_cn.yml → adventure_campaign/request_adventure_campaign.cmd.zh_cn.yml} +1 -1
  15. package/bin/commands/{travel_campaign/update_travel_campaign.cmd.en_us.yml → adventure_campaign/update_adventure_campaign.cmd.en_us.yml} +3 -3
  16. package/bin/commands/{travel_campaign/update_travel_campaign.cmd.js → adventure_campaign/update_adventure_campaign.cmd.js} +3 -3
  17. package/bin/commands/{travel_campaign/update_travel_campaign.cmd.zh_cn.yml → adventure_campaign/update_adventure_campaign.cmd.zh_cn.yml} +1 -1
  18. package/bin/commands/load.js +16 -4
  19. package/bin/commands/premium/create_premium_order.cmd.en_us.yml +5 -0
  20. package/bin/commands/premium/create_premium_order.cmd.js +46 -0
  21. package/bin/commands/premium/create_premium_order.cmd.zh_cn.yml +5 -0
  22. package/bin/commands/premium/get_current_premium_plan.cmd.en_us.yml +3 -0
  23. package/bin/commands/premium/get_current_premium_plan.cmd.js +32 -0
  24. package/bin/commands/premium/get_current_premium_plan.cmd.zh_cn.yml +3 -0
  25. package/bin/commands/premium/get_premium_order.cmd.en_us.yml +5 -0
  26. package/bin/commands/premium/get_premium_order.cmd.js +44 -0
  27. package/bin/commands/premium/get_premium_order.cmd.zh_cn.yml +5 -0
  28. package/bin/commands/premium/list_premium_orders.cmd.en_us.yml +6 -0
  29. package/bin/commands/premium/list_premium_orders.cmd.js +59 -0
  30. package/bin/commands/premium/list_premium_orders.cmd.zh_cn.yml +6 -0
  31. package/bin/commands/premium/list_premium_plans.cmd.en_us.yml +3 -0
  32. package/bin/commands/premium/list_premium_plans.cmd.js +67 -0
  33. package/bin/commands/premium/list_premium_plans.cmd.zh_cn.yml +3 -0
  34. package/bin/commands/premium/pay_premium_order.cmd.en_us.yml +6 -0
  35. package/bin/commands/premium/pay_premium_order.cmd.js +44 -0
  36. package/bin/commands/premium/pay_premium_order.cmd.zh_cn.yml +6 -0
  37. package/bin/utils/date.js +66 -0
  38. package/bin/utils/parse_meta.js +1 -1
  39. package/package.json +3 -2
  40. package/skills/neta/SKILL.md +26 -6
  41. package/skills/neta-adventure/SKILL.md +71 -0
  42. package/skills/{neta-travel/references/travel-crafting.md → neta-adventure/references/adventure-crafting.md} +5 -5
  43. package/skills/{neta-travel/references/travel-examples.md → neta-adventure/references/adventure-examples.md} +1 -1
  44. package/skills/{neta-travel/references/travel-field-guide.md → neta-adventure/references/adventure-field-guide.md} +2 -2
  45. package/skills/{neta-travel/references/travel-playing.md → neta-adventure/references/adventure-playing.md} +2 -2
  46. package/skills/neta-character/SKILL.md +8 -8
  47. package/skills/neta-character/references/character-creation.md +6 -6
  48. package/skills/neta-character/references/character-update.md +7 -7
  49. package/skills/neta-community/SKILL.md +8 -8
  50. package/skills/neta-community/references/character-search.md +20 -20
  51. package/skills/neta-community/references/hashtag-research.md +25 -25
  52. package/skills/neta-community/references/interactive-feed.md +27 -27
  53. package/skills/neta-community/references/social-interactive.md +10 -10
  54. package/skills/neta-creative/SKILL.md +53 -9
  55. package/skills/neta-creative/references/character-search.md +20 -20
  56. package/skills/neta-creative/references/collection-remix.md +1 -1
  57. package/skills/neta-creative/references/image-generation.md +14 -14
  58. package/skills/neta-creative/references/premium.md +68 -0
  59. package/skills/neta-creative/references/song-creation.md +4 -4
  60. package/skills/neta-creative/references/song-mv.md +15 -15
  61. package/skills/neta-creative/references/video-generation.md +5 -5
  62. package/skills/neta-elementum/SKILL.md +7 -7
  63. package/skills/neta-elementum/references/elementum-alchemy.md +8 -8
  64. package/skills/neta-elementum/references/elementum-update.md +8 -8
  65. package/skills/neta-space/SKILL.md +6 -6
  66. package/skills/neta-suggest/SKILL.md +34 -34
  67. package/skills/zh_cn/neta/SKILL.md +25 -7
  68. package/skills/zh_cn/{neta-travel → neta-adventure}/SKILL.md +15 -15
  69. package/skills/zh_cn/{neta-travel/references/travel-crafting.md → neta-adventure/references/adventure-crafting.md} +4 -4
  70. package/skills/zh_cn/{neta-travel/references/travel-field-guide.md → neta-adventure/references/adventure-field-guide.md} +1 -1
  71. package/skills/zh_cn/{neta-travel/references/travel-playing.md → neta-adventure/references/adventure-playing.md} +1 -1
  72. package/skills/zh_cn/neta-character/SKILL.md +8 -8
  73. package/skills/zh_cn/neta-character/references/character-creation.md +6 -6
  74. package/skills/zh_cn/neta-character/references/character-update.md +7 -7
  75. package/skills/zh_cn/neta-community/SKILL.md +9 -9
  76. package/skills/zh_cn/neta-community/references/character-search.md +20 -20
  77. package/skills/zh_cn/neta-community/references/hashtag-research.md +25 -25
  78. package/skills/zh_cn/neta-community/references/interactive-feed.md +30 -30
  79. package/skills/zh_cn/neta-community/references/social-interactive.md +10 -10
  80. package/skills/zh_cn/neta-creative/SKILL.md +8 -8
  81. package/skills/zh_cn/neta-creative/references/character-search.md +20 -20
  82. package/skills/zh_cn/neta-creative/references/collection-remix.md +1 -1
  83. package/skills/zh_cn/neta-creative/references/image-generation.md +14 -14
  84. package/skills/zh_cn/neta-creative/references/song-creation.md +4 -4
  85. package/skills/zh_cn/neta-creative/references/song-mv.md +15 -15
  86. package/skills/zh_cn/neta-creative/references/video-generation.md +5 -5
  87. package/skills/zh_cn/neta-elementum/SKILL.md +7 -7
  88. package/skills/zh_cn/neta-elementum/references/elementum-alchemy.md +8 -8
  89. package/skills/zh_cn/neta-elementum/references/elementum-update.md +8 -8
  90. package/skills/zh_cn/neta-space/SKILL.md +6 -6
  91. package/skills/zh_cn/neta-suggest/SKILL.md +55 -55
  92. package/skills/neta-travel/SKILL.md +0 -71
  93. /package/skills/zh_cn/{neta-travel/references/travel-examples.md → neta-adventure/references/adventure-examples.md} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @neta/skills-neta
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 54180c1: feat(premium): implement premium subscription commands and integrate dayjs for date handling
8
+
9
+ - Add premium subscription CLI commands: `create_premium_order`, `pay_premium_order`, `get_current_premium_plan`, `get_premium_order`, `list_premium_orders`, `list_premium_plans`; wire commerce APIs and command loading.
10
+ - Add `dayjs` and `src/utils/date.ts` for date formatting/parsing; adjust `parse_meta` as needed.
11
+ - Update `README.md` and `skills/neta-creative/SKILL.md`; add `skills/neta-creative/references/premium.md` for premium workflows.
12
+
13
+ ## 0.13.0
14
+
15
+ ### Minor Changes
16
+
17
+ - rename all "travel" keywords in docs、commands to "adventure"
18
+
3
19
  ## 0.12.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -12,18 +12,19 @@
12
12
 
13
13
  **NETA Skills** is a collection of powerful AI agent skills and accompanying CLI tools designed for interacting with the [Neta Art](https://www.neta.art/) API. Built for developers and AI agents, it seamlessly extends any agent's capabilities to generate multimedia, manage characters, and process audio/video workflows.
14
14
 
15
- You can get your access token from the [Neta Open Portal](https://www.neta.art/open/).
15
+ You can get your access token / NETA TOKEN from the [Neta Open Portal](https://www.neta.art/open/).
16
16
 
17
17
  ---
18
18
 
19
19
  ## ✨ Features
20
20
 
21
21
  - 🎨 **Multimedia Creation:** Generate stunning images, videos, and songs using state-of-the-art AI models.
22
+ - ⭐ **Premium & Subscriptions:** List plans, create orders, start Stripe checkout, and verify the active tier via dedicated CLI commands (global API environment).
22
23
  - 🔧 **Image & Video Processing:** Effortlessly remove backgrounds and merge video assets.
23
24
  - 👤 **Character & Style Management:** Search, fetch details, and manage characters and stylistic elements.
24
25
  - 🏷️ **Community Integrations:** Explore trending hashtags, popular characters, and curated collections.
25
26
  - 🧭 **Smart Discovery & Suggestions:** Explore interactive feeds and get keyword, tag, and category suggestions for progressive content discovery.
26
- - 📖 **Interactive Story Adventures:** Craft and play AI-driven narrative campaigns (Travel) — the agent acts as DM and character roleplayer for immersive interactive fiction.
27
+ - 📖 **Interactive Story Adventures:** Craft and play AI-driven narrative campaigns (Adventure) — the agent acts as DM and character roleplayer for immersive interactive fiction.
27
28
  - 🤖 **Agent First:** Designed from the ground up to plug into your favorite AI agent frameworks.
28
29
 
29
30
  ---
@@ -46,7 +47,7 @@ You can also install the specialized skills separately if your agent prefers mor
46
47
  # Community exploration (hashtags, spaces, interactive feed)
47
48
  npx skills add talesofai/neta-skills/skills/neta-community
48
49
 
49
- # Creation workflows (image / video / song)
50
+ # Creation workflows (image / video / song) and premium subscription flows
50
51
  npx skills add talesofai/neta-skills/skills/neta-creative
51
52
 
52
53
  # Discovery & suggestions (keywords, tags, categories, content)
@@ -61,20 +62,20 @@ npx skills add talesofai/neta-skills/skills/neta-character
61
62
  # Elementum VToken creation and management
62
63
  npx skills add talesofai/neta-skills/skills/neta-elementum
63
64
 
64
- # AI-driven interactive story adventures (Travel Campaigns)
65
- npx skills add talesofai/neta-skills/skills/neta-travel
65
+ # AI-driven interactive story adventures (Adventure Campaigns)
66
+ npx skills add talesofai/neta-skills/skills/neta-adventure
66
67
  ```
67
68
 
68
69
  ### Available Commands
69
70
 
70
- The skill includes **34 commands** for various tasks:
71
+ The skill includes **42 commands** for various tasks:
71
72
 
72
73
  | Category | Command | Description |
73
74
  |----------|---------|-------------|
74
- | **Travel Campaigns** | `create_travel_campaign` | Create an AI-driven interactive story adventure |
75
- | | `update_travel_campaign` | Update an existing travel campaign |
76
- | | `list_my_travel_campaigns` | List your created travel campaigns |
77
- | | `request_travel_campaign` | Load full campaign details for play mode |
75
+ | **Adventure Campaigns** | `create_adventure_campaign` | Create an AI-driven interactive story adventure |
76
+ | | `update_adventure_campaign` | Update an existing adventure campaign |
77
+ | | `list_my_adventure_campaigns` | List your created adventure campaigns |
78
+ | | `request_adventure_campaign` | Load full campaign details for play mode |
78
79
  | **Creation** | `make_image` | Generate images from text prompts |
79
80
  | | `make_video` | Generate videos from images and prompts |
80
81
  | | `make_song` | Compose songs with custom prompts and lyrics |
@@ -82,6 +83,12 @@ The skill includes **34 commands** for various tasks:
82
83
  | | `edit_collection` | Edit an existing collection (name, description, tags, status, etc.) |
83
84
  | | `publish_collection` | Publish or update a collection |
84
85
  | | `search_character_or_elementum` | Search reusable TCP building blocks (characters / elements / flows) |
86
+ | **Premium** | `get_current_premium_plan` | Get the signed-in user’s current tier and subscription end when applicable |
87
+ | | `list_premium_plans` | List available premium plans and SPU UUIDs |
88
+ | | `create_premium_order` | Create an order for a plan (by SPU UUID) |
89
+ | | `get_premium_order` | Fetch details for a single premium order |
90
+ | | `list_premium_orders` | List premium orders (paginated) |
91
+ | | `pay_premium_order` | Start payment for an unpaid order (e.g. Stripe Checkout) |
85
92
  | **VToken Management** | `create_character` | Create a character VToken (consumes credits) |
86
93
  | | `update_character` | Update an existing character VToken |
87
94
  | | `list_my_characters` | List all characters created by the current user |
@@ -136,14 +143,14 @@ export NETA_TOKEN=your_token_here
136
143
 
137
144
  ```bash
138
145
  # Get general help or specific command help
139
- npx -y @talesofai/neta-skills --help
140
- npx -y @talesofai/neta-skills make_image --help
146
+ npx -y @talesofai/neta-skills@latest --help
147
+ npx -y @talesofai/neta-skills@latest make_image --help
141
148
 
142
149
  # Example: Generate an image
143
- npx -y @talesofai/neta-skills make_image --prompt "A cyberpunk cityscape at night" --aspect "16:9"
150
+ npx -y @talesofai/neta-skills@latest make_image --prompt "A cyberpunk cityscape at night" --aspect "16:9"
144
151
 
145
152
  # Example: Search for characters or elementum
146
- npx -y @talesofai/neta-skills search_character_or_elementum --keywords "fantasy"
153
+ npx -y @talesofai/neta-skills@latest search_character_or_elementum --keywords "fantasy"
147
154
  ```
148
155
 
149
156
  ---
@@ -161,7 +168,7 @@ neta-skills/
161
168
  │ ├── neta-space/ # Space navigation & exploration skills (EN)
162
169
  │ ├── neta-character/ # Character VToken creation & management (EN)
163
170
  │ ├── neta-elementum/ # Elementum VToken creation & management (EN)
164
- │ ├── neta-travel/ # Interactive story adventures / Travel Campaigns (EN)
171
+ │ ├── neta-adventure/ # Interactive story adventures / Adventure Campaigns (EN)
165
172
  │ └── zh_cn/ # Chinese-localized skills & references
166
173
  │ ├── neta/
167
174
  │ ├── neta-community/
@@ -170,10 +177,10 @@ neta-skills/
170
177
  │ ├── neta-space/
171
178
  │ ├── neta-character/
172
179
  │ ├── neta-elementum/
173
- │ └── neta-travel/
180
+ │ └── neta-adventure/
174
181
  ├── src/ # TypeScript source for the CLI
175
- │ ├── apis/ # Typed Neta API client helpers
176
- │ ├── commands/ # CLI command definitions (TS + YAML meta)
182
+ │ ├── apis/ # Typed Neta API client helpers (incl. commerce)
183
+ │ ├── commands/ # CLI command groups: creative, community, adventure, VToken, premium, …
177
184
  │ ├── utils/ # Shared utilities
178
185
  │ └── cli.ts # CLI entrypoint (TypeScript)
179
186
  ├── bin/ # Built JavaScript output for the CLI
@@ -203,7 +210,8 @@ Agents use these references to learn the optimal sequence of actions, parameter
203
210
  - **Song & MV Creation:** Workflows for composing songs and creating music videos with synchronized visuals.
204
211
  - **Character & Hashtag Research:** Processes for finding trending content, searching characters, and utilizing community trends.
205
212
  - **Character & Elementum Creation:** Character creation and elementum alchemy workflows.
206
- - **Travel Campaign Crafting & Play:** Multi-turn story creation workflow (Craft Mode), interactive session management (Play Mode), field reference, and complete genre examples. See `skills/neta-travel/references/`.
213
+ - **Premium / Subscriptions:** Plan listing, order lifecycle, checkout channels, and environment limits. See `skills/neta-creative/references/premium.md`.
214
+ - **Adventure Campaign Crafting & Play:** Multi-turn story creation workflow (Craft Mode), interactive session management (Play Mode), field reference, and complete genre examples. See `skills/neta-adventure/references/`.
207
215
 
208
216
  ---
209
217
 
@@ -231,8 +239,8 @@ In terminal environments, locale is typically controlled by:
231
239
  If you want to force a specific language for a single command, you can prefix it with the desired locale, for example:
232
240
 
233
241
  ```bash
234
- LC_ALL=zh_CN.UTF-8 npx -y @talesofai/neta-skills make_image --help
235
- LANG=en_US.UTF-8 npx -y @talesofai/neta-skills make_image --help
242
+ LC_ALL=zh_CN.UTF-8 npx -y @talesofai/neta-skills@latest make_image --help
243
+ LANG=en_US.UTF-8 npx -y @talesofai/neta-skills@latest make_image --help
236
244
  ```
237
245
 
238
246
  ---
package/README.zh_cn.md CHANGED
@@ -64,7 +64,7 @@ npx skills add talesofai/neta-skills/skills/zh_cn/neta-character
64
64
  npx skills add talesofai/neta-skills/skills/zh_cn/neta-elementum
65
65
 
66
66
  # AI 驱动的交互式故事冒险(奇遇剧本)
67
- npx skills add talesofai/neta-skills/skills/zh_cn/neta-travel
67
+ npx skills add talesofai/neta-skills/skills/zh_cn/neta-adventure
68
68
  ```
69
69
 
70
70
  ### 可用指令总览
@@ -73,10 +73,10 @@ npx skills add talesofai/neta-skills/skills/zh_cn/neta-travel
73
73
 
74
74
  | 分类 | 命令 | 说明 |
75
75
  |------|------|------|
76
- | **奇遇剧本 Travel** | `create_travel_campaign` | 创建 AI 驱动的交互式故事冒险剧本 |
77
- | | `update_travel_campaign` | 更新已有奇遇剧本 |
78
- | | `list_my_travel_campaigns` | 列出你创建的奇遇剧本 |
79
- | | `request_travel_campaign` | 加载完整剧本详情(游玩模式) |
76
+ | **奇遇剧本 Adventure** | `create_adventure_campaign` | 创建 AI 驱动的交互式故事冒险剧本 |
77
+ | | `update_adventure_campaign` | 更新已有奇遇剧本 |
78
+ | | `list_my_adventure_campaigns` | 列出你创建的奇遇剧本 |
79
+ | | `request_adventure_campaign` | 加载完整剧本详情(游玩模式) |
80
80
  | **创作 Creation** | `make_image` | 基于提示词生成图片 |
81
81
  | | `make_video` | 基于图片与动作描述生成视频 |
82
82
  | | `make_song` | 基于风格与歌词生成歌曲 |
@@ -140,16 +140,16 @@ export NETA_TOKEN=your_token_here
140
140
 
141
141
  ```bash
142
142
  # 查看帮助
143
- npx -y @talesofai/neta-skills --help
144
- npx -y @talesofai/neta-skills make_image --help
143
+ npx -y @talesofai/neta-skills@latest --help
144
+ npx -y @talesofai/neta-skills@latest make_image --help
145
145
 
146
146
  # 示例:生成一张图片
147
- npx -y @talesofai/neta-skills make_image \
147
+ npx -y @talesofai/neta-skills@latest make_image \
148
148
  --prompt "夜晚的赛博朋克城市,霓虹灯,高楼大厦,雨中街道" \
149
149
  --aspect "16:9"
150
150
 
151
151
  # 示例:搜索角色或元素
152
- npx -y @talesofai/neta-skills search_character_or_elementum \
152
+ npx -y @talesofai/neta-skills@latest search_character_or_elementum \
153
153
  --keywords "幻想" \
154
154
  --parent_type "character"
155
155
  ```
@@ -169,7 +169,7 @@ neta-skills/
169
169
  │ ├── neta-space/ # 英文空间与话题导航 / 探索技能
170
170
  │ ├── neta-character/ # 英文角色 VToken 创建与管理技能
171
171
  │ ├── neta-elementum/ # 英文元素 VToken 创建与管理技能
172
- │ ├── neta-travel/ # 英文交互式故事冒险(奇遇剧本)技能
172
+ │ ├── neta-adventure/ # 英文交互式故事冒险(奇遇剧本)技能
173
173
  │ └── zh_cn/ # 中文本地化技能与参考文档
174
174
  │ ├── neta/
175
175
  │ ├── neta-community/
@@ -178,7 +178,7 @@ neta-skills/
178
178
  │ ├── neta-space/
179
179
  │ ├── neta-character/
180
180
  │ ├── neta-elementum/
181
- │ └── neta-travel/
181
+ │ └── neta-adventure/
182
182
  ├── src/ # CLI 对应的 TypeScript 源码
183
183
  │ ├── apis/ # 封装后的 Neta API 调用
184
184
  │ ├── commands/ # CLI 命令定义(TS + YAML 描述)
@@ -210,7 +210,7 @@ neta-skills/
210
210
  - **角色与标签调研**:如何通过角色 / 标签 / 空间找到合适的创作方向。
211
211
  - **角色与元素创建**:角色创建和元素炼金的工作流。
212
212
  - **玩法内容探索**:使用 `suggest_*` 与 `suggest_content` 构建渐进式探索闭环。
213
- - **奇遇剧本创作与游玩**:多轮协作故事创作工作流(创作模式)、交互式会话管理(游玩模式)、字段手册,以及含历史穿越、末世生存、武侠江湖的完整类型范例。见 `skills/zh_cn/neta-travel/references/`。
213
+ - **奇遇剧本创作与游玩**:多轮协作故事创作工作流(创作模式)、交互式会话管理(游玩模式)、字段手册,以及含历史穿越、末世生存、武侠江湖的完整类型范例。见 `skills/zh_cn/neta-adventure/references/`。
214
214
 
215
215
  ---
216
216
 
@@ -238,8 +238,8 @@ CLI 与 Skills 会根据系统与环境变量自动选择使用的语言:
238
238
  在需要强制指定语言时,推荐在运行命令前显式设置环境变量,例如:
239
239
 
240
240
  ```bash
241
- LC_ALL=zh_CN.UTF-8 npx -y @talesofai/neta-skills make_image --help
242
- LANG=en_US.UTF-8 npx -y @talesofai/neta-skills make_image --help
241
+ LC_ALL=zh_CN.UTF-8 npx -y @talesofai/neta-skills@latest make_image --help
242
+ LANG=en_US.UTF-8 npx -y @talesofai/neta-skills@latest make_image --help
243
243
  ```
244
244
 
245
245
  ---
@@ -0,0 +1,41 @@
1
+ export const createCommerceApis = (client) => {
2
+ const listPlansConfig = async () => {
3
+ const res = await client.get("/v1/configs/config", {
4
+ params: {
5
+ namespace: "fe_configs",
6
+ key: "plans",
7
+ },
8
+ });
9
+ return res.data;
10
+ };
11
+ const createOrder = async (params) => {
12
+ const res = await client.post("/v1/commerce/orders", params);
13
+ return res.data;
14
+ };
15
+ const orders = async (params) => {
16
+ const res = await client.get("/v1/commerce/orders", {
17
+ params,
18
+ });
19
+ return res.data;
20
+ };
21
+ const order = async (params) => {
22
+ const res = await client.get(`/v1/commerce/orders/${params.order_uuid}`);
23
+ return res.data;
24
+ };
25
+ const pay = async (params) => {
26
+ const { order_uuid, channel, return_url, redirect_url } = params;
27
+ return client
28
+ .post(`/v1/commerce/orders/${order_uuid}/payment/${channel}`, {
29
+ redirect_url,
30
+ return_url,
31
+ })
32
+ .then((res) => res.data);
33
+ };
34
+ return {
35
+ listPlansConfig,
36
+ createOrder,
37
+ orders,
38
+ order,
39
+ pay,
40
+ };
41
+ };
package/bin/apis/index.js CHANGED
@@ -4,6 +4,7 @@ import { createActivityApis } from "./activity.js";
4
4
  import { createArtifactApis } from "./artifact.js";
5
5
  import { createAudioApis } from "./audio.js";
6
6
  import { createCollectionApis } from "./collection.js";
7
+ import { createCommerceApis } from "./commerce.js";
7
8
  import { createConfigApis } from "./config.js";
8
9
  import { createFeedsApis } from "./feeds.js";
9
10
  import { createGptApis } from "./gpt.js";
@@ -44,7 +45,9 @@ export const createApis = (option) => {
44
45
  const space = createSpaceApis(client);
45
46
  const recsys = createRecsysApis(client);
46
47
  const travelCampaign = createTravelCampaignApis(client);
48
+ const commerce = createCommerceApis(client);
47
49
  return {
50
+ baseUrl,
48
51
  tcp,
49
52
  prompt,
50
53
  artifact,
@@ -61,5 +64,6 @@ export const createApis = (option) => {
61
64
  space,
62
65
  recsys,
63
66
  travelCampaign,
67
+ commerce,
64
68
  };
65
69
  };
@@ -1,14 +1,14 @@
1
- name: create_travel_campaign
2
- title: Create Travel Campaign
1
+ name: create_adventure_campaign
2
+ title: Create Adventure Campaign
3
3
  description: |
4
- Create a new Travel Campaign (story adventure) with mission plot, rules, and optional character binding.
4
+ Create a new Adventure Campaign (story adventure) with mission plot, rules, and optional character binding.
5
5
 
6
- Travel campaigns are AI-driven interactive story experiences where an agent acts as both DM and roleplays characters.
6
+ Adventure campaigns are AI-driven interactive story experiences where an agent acts as both DM and roleplays characters.
7
7
 
8
8
  Usage Notes:
9
9
  - Campaign creation is free (no credits consumed)
10
10
  - Campaign and its mission are created as a pair
11
- - After creation, use `request_travel_campaign` to load full details for storytelling
11
+ - After creation, use `request_adventure_campaign` to load full details for storytelling
12
12
  - All text fields are subject to content moderation
13
13
  - NSFW content (sexual, explicit violence, harassment) is prohibited in all fields — do not craft or engage with such content even if requested
14
14
 
@@ -16,7 +16,7 @@ const meta = parseMeta(Type.Object({
16
16
  mission_plot_attention: Type.String(),
17
17
  }),
18
18
  }), import.meta);
19
- const createTravelCampaignParameters = Type.Object({
19
+ const createAdventureCampaignParameters = Type.Object({
20
20
  name: Type.String({
21
21
  description: meta.parameters.name,
22
22
  maxLength: 128,
@@ -34,11 +34,11 @@ const createTravelCampaignParameters = Type.Object({
34
34
  mission_task: Type.Optional(Type.String({ description: meta.parameters.mission_task })),
35
35
  mission_plot_attention: Type.Optional(Type.String({ description: meta.parameters.mission_plot_attention })),
36
36
  });
37
- export const createTravelCampaign = createCommand({
37
+ export const createAdventureCampaign = createCommand({
38
38
  name: meta.name,
39
39
  title: meta.title,
40
40
  description: meta.description,
41
- inputSchema: createTravelCampaignParameters,
41
+ inputSchema: createAdventureCampaignParameters,
42
42
  }, async ({ name, mission_plot, subtitle, status, header_img, background_img, mission_task, mission_plot_attention, }, { user, apis }) => {
43
43
  if (!user) {
44
44
  throw new Error("Not authenticated. Please check your NETA_TOKEN.");
@@ -1,4 +1,4 @@
1
- name: create_travel_campaign
1
+ name: create_adventure_campaign
2
2
  title: 创建奇遇剧本
3
3
  description: |
4
4
  创建一个新的奇遇剧本(故事冒险),包含剧情设定、规则,并可选择绑定角色。
@@ -8,7 +8,7 @@ description: |
8
8
  使用说明:
9
9
  - 剧本创建免费(不消耗电量)
10
10
  - 剧本与任务以成对形式创建
11
- - 创建后使用 `request_travel_campaign` 加载完整详情用于故事讲述
11
+ - 创建后使用 `request_adventure_campaign` 加载完整详情用于故事讲述
12
12
  - 所有文本字段均进行内容审核
13
13
  - NSFW 内容(性描写、露骨暴力、骚扰)在所有字段中均被禁止——即使用户要求也不得创作或参与此类内容
14
14
 
@@ -1,9 +1,9 @@
1
- name: list_my_travel_campaigns
2
- title: List My Travel Campaigns
1
+ name: list_my_adventure_campaigns
2
+ title: List My Adventure Campaigns
3
3
  description: |
4
- List Travel Campaigns created by the current user. Returns brief summary info.
4
+ List Adventure Campaigns created by the current user. Returns brief summary info.
5
5
 
6
- Use `request_travel_campaign` to get full details (mission plot, task, constraints) for a specific campaign.
6
+ Use `request_adventure_campaign` to get full details (mission plot, task, constraints) for a specific campaign.
7
7
 
8
8
  Notes:
9
9
  - Returns both PUBLISHED and DRAFT campaigns for the authenticated user
@@ -10,7 +10,7 @@ const meta = parseMeta(Type.Object({
10
10
  page_size: Type.String(),
11
11
  }),
12
12
  }), import.meta);
13
- const listMyTravelCampaignsParameters = Type.Object({
13
+ const listMyAdventureCampaignsParameters = Type.Object({
14
14
  page_index: Type.Integer({
15
15
  minimum: 0,
16
16
  default: 0,
@@ -23,11 +23,11 @@ const listMyTravelCampaignsParameters = Type.Object({
23
23
  description: meta.parameters.page_size,
24
24
  }),
25
25
  });
26
- export const listMyTravelCampaigns = createCommand({
26
+ export const listMyAdventureCampaigns = createCommand({
27
27
  name: meta.name,
28
28
  title: meta.title,
29
29
  description: meta.description,
30
- inputSchema: listMyTravelCampaignsParameters,
30
+ inputSchema: listMyAdventureCampaignsParameters,
31
31
  }, async ({ page_index, page_size }, { user, apis }) => {
32
32
  if (!user) {
33
33
  throw new Error("Not authenticated. Please check your NETA_TOKEN.");
@@ -1,9 +1,9 @@
1
- name: list_my_travel_campaigns
1
+ name: list_my_adventure_campaigns
2
2
  title: 列出我的奇遇剧本
3
3
  description: |
4
4
  列出当前用户创建的奇遇剧本。返回简要摘要信息。
5
5
 
6
- 使用 `request_travel_campaign` 获取特定剧本的完整详情(剧情、任务、约束)。
6
+ 使用 `request_adventure_campaign` 获取特定剧本的完整详情(剧情、任务、约束)。
7
7
 
8
8
  说明:
9
9
  - 为已认证用户返回 PUBLISHED 和 DRAFT 剧本
@@ -1,7 +1,7 @@
1
- name: request_travel_campaign
2
- title: Get Travel Campaign Details
1
+ name: request_adventure_campaign
2
+ title: Get Adventure Campaign Details
3
3
  description: |
4
- Get full details of a Travel Campaign including mission plot, task, and AI constraints.
4
+ Get full details of an Adventure Campaign including mission plot, task, and AI constraints.
5
5
 
6
6
  This is the primary command for "play mode" — load a campaign before starting a storytelling session.
7
7
 
@@ -9,16 +9,16 @@ const meta = parseMeta(Type.Object({
9
9
  campaign_uuid: Type.String(),
10
10
  }),
11
11
  }), import.meta);
12
- const requestTravelCampaignParameters = Type.Object({
12
+ const requestAdventureCampaignParameters = Type.Object({
13
13
  campaign_uuid: Type.String({
14
14
  description: meta.parameters.campaign_uuid,
15
15
  }),
16
16
  });
17
- export const requestTravelCampaign = createCommand({
17
+ export const requestAdventureCampaign = createCommand({
18
18
  name: meta.name,
19
19
  title: meta.title,
20
20
  description: meta.description,
21
- inputSchema: requestTravelCampaignParameters,
21
+ inputSchema: requestAdventureCampaignParameters,
22
22
  }, async ({ campaign_uuid }, { apis }) => {
23
23
  const campaign = await apis.travelCampaign.getCampaign(campaign_uuid);
24
24
  return {
@@ -1,4 +1,4 @@
1
- name: request_travel_campaign
1
+ name: request_adventure_campaign
2
2
  title: 获取奇遇剧本详情
3
3
  description: |
4
4
  获取奇遇剧本的完整详情,包括剧情、任务和 AI 约束。
@@ -1,7 +1,7 @@
1
- name: update_travel_campaign
2
- title: Update Travel Campaign
1
+ name: update_adventure_campaign
2
+ title: Update Adventure Campaign
3
3
  description: |
4
- Update an existing Travel Campaign. Only specify fields that need to change — omitted fields remain unchanged.
4
+ Update an existing Adventure Campaign. Only specify fields that need to change — omitted fields remain unchanged.
5
5
 
6
6
  Usage Notes:
7
7
  - You must be the creator of the campaign to update it
@@ -17,7 +17,7 @@ const meta = parseMeta(Type.Object({
17
17
  mission_plot_attention: Type.String(),
18
18
  }),
19
19
  }), import.meta);
20
- const updateTravelCampaignParameters = Type.Object({
20
+ const updateAdventureCampaignParameters = Type.Object({
21
21
  campaign_uuid: Type.String({
22
22
  description: meta.parameters.campaign_uuid,
23
23
  }),
@@ -35,11 +35,11 @@ const updateTravelCampaignParameters = Type.Object({
35
35
  mission_task: Type.Optional(Type.String({ description: meta.parameters.mission_task })),
36
36
  mission_plot_attention: Type.Optional(Type.String({ description: meta.parameters.mission_plot_attention })),
37
37
  });
38
- export const updateTravelCampaign = createCommand({
38
+ export const updateAdventureCampaign = createCommand({
39
39
  name: meta.name,
40
40
  title: meta.title,
41
41
  description: meta.description,
42
- inputSchema: updateTravelCampaignParameters,
42
+ inputSchema: updateAdventureCampaignParameters,
43
43
  }, async ({ campaign_uuid, name, mission_plot, subtitle, status, header_img, background_img, mission_task, mission_plot_attention, }, { user, apis }) => {
44
44
  if (!user) {
45
45
  throw new Error("Not authenticated. Please check your NETA_TOKEN.");
@@ -1,4 +1,4 @@
1
- name: update_travel_campaign
1
+ name: update_adventure_campaign
2
2
  title: 更新奇遇剧本
3
3
  description: |
4
4
  更新已有的奇遇剧本。只需指定要修改的字段——未提供的字段保持不变。
@@ -11,7 +11,7 @@ import { resolve } from "node:path";
11
11
  import { pathToFileURL } from "node:url";
12
12
  import { Option, } from "@commander-js/extra-typings";
13
13
  import { Type } from "@sinclair/typebox";
14
- import { Default, Value } from "@sinclair/typebox/value";
14
+ import { AssertError, Value } from "@sinclair/typebox/value";
15
15
  import { createApis } from "../apis/index.js";
16
16
  import { ApiResponseError } from "../utils/errors.js";
17
17
  import { setLocale } from "../utils/parse_meta.js";
@@ -44,7 +44,8 @@ export const buildCommands = async (cli) => {
44
44
  "creative",
45
45
  "community",
46
46
  "character_elementum",
47
- "travel_campaign",
47
+ "adventure_campaign",
48
+ "premium",
48
49
  ]);
49
50
  return commands.map((cmd) => {
50
51
  const command = cli.command(cmd.name);
@@ -102,7 +103,7 @@ export const buildCommands = async (cli) => {
102
103
  return null;
103
104
  });
104
105
  const type = cmd.inputSchema ?? Type.Object({});
105
- const input = Value.Decode(type, Default(type, args));
106
+ const input = Value.Parse(type, args);
106
107
  if (IS_DEV) {
107
108
  logger.debug("command: %s, params: %o", cmd.name, input);
108
109
  }
@@ -120,6 +121,17 @@ export const buildCommands = async (cli) => {
120
121
  },
121
122
  })
122
123
  .catch((e) => {
124
+ if (e instanceof AssertError) {
125
+ logger.error({
126
+ error: {
127
+ type: e.name,
128
+ message: e.message,
129
+ path: e.error?.path,
130
+ schema: e.error?.schema,
131
+ },
132
+ });
133
+ return null;
134
+ }
123
135
  if (e instanceof ApiResponseError) {
124
136
  logger.error({
125
137
  error: {
@@ -145,7 +157,7 @@ export const buildCommands = async (cli) => {
145
157
  if (!result)
146
158
  return;
147
159
  if (IS_DEV) {
148
- logger.debug(result);
160
+ logger.debug(JSON.stringify(result, null, 2));
149
161
  }
150
162
  else {
151
163
  logger.info(JSON.stringify(result));
@@ -0,0 +1,5 @@
1
+ name: create_premium_order
2
+ title: Create Premium Order
3
+ description: Create a new premium order for a subscription plan (SPU).
4
+ parameters:
5
+ spu_uuid: UUID of the premium plan SPU to purchase
@@ -0,0 +1,46 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { parseDate } from "../../utils/date.js";
3
+ import { parseMeta } from "../../utils/parse_meta.js";
4
+ import { createCommand } from "../factory.js";
5
+ const meta = parseMeta(Type.Object({
6
+ name: Type.String(),
7
+ title: Type.String(),
8
+ description: Type.String(),
9
+ parameters: Type.Object({
10
+ spu_uuid: Type.String(),
11
+ }),
12
+ }), import.meta);
13
+ export const createPremiumOrder = createCommand({
14
+ name: meta.name,
15
+ title: meta.title,
16
+ description: meta.description,
17
+ inputSchema: Type.Object({
18
+ spu_uuid: Type.String({ description: meta.parameters.spu_uuid }),
19
+ }),
20
+ }, async ({ spu_uuid }, { apis }) => {
21
+ if (!apis.baseUrl.endsWith("talesofai.com")) {
22
+ throw new Error("This command is not supported in the current region");
23
+ }
24
+ const order = await apis.commerce.createOrder({
25
+ spu_uuid,
26
+ });
27
+ return {
28
+ order: {
29
+ uuid: order.uuid,
30
+ spu: {
31
+ uuid: order.spu.uuid,
32
+ name: order.spu.name,
33
+ price: order.spu.price,
34
+ },
35
+ status: order.status,
36
+ status_history: order.status_history.map((item) => ({
37
+ ...item,
38
+ time: parseDate(item.time).format(),
39
+ })),
40
+ price: order.price,
41
+ valid_until: parseDate(order.valid_until).format(),
42
+ ctime: parseDate(order.ctime).format(),
43
+ mtime: parseDate(order.mtime).format(),
44
+ },
45
+ };
46
+ });
@@ -0,0 +1,5 @@
1
+ name: create_premium_order
2
+ title: 创建会员订单
3
+ description: 为订阅套餐(SPU)创建新的会员订单。
4
+ parameters:
5
+ spu_uuid: 要购买的会员套餐 SPU 的 UUID
@@ -0,0 +1,3 @@
1
+ name: get_current_premium_plan
2
+ title: Get Current Premium Plan
3
+ description: Get the signed-in user's current premium tier and subscription end time.