dsh-workrally 0.3.0 → 0.3.1

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 (46) hide show
  1. package/README.md +4 -3
  2. package/lib/account.js +18 -9
  3. package/lib/client.js +3671 -444
  4. package/lib/easy-writing-skills/book-creation.md +90 -0
  5. package/lib/easy-writing-skills/novel-writing.md +8 -0
  6. package/lib/easy-writing-skills/story-development.md +41 -0
  7. package/lib/easy-writing-skills/title-and-intro.md +67 -0
  8. package/lib/easyWriting.js +72 -0
  9. package/lib/gallery.js +8 -6
  10. package/lib/index.js +81 -1
  11. package/lib/manju-skills/chongsheng-manju/SKILL.md +311 -0
  12. package/lib/manju-skills/chuanyue-manju/SKILL.md +309 -0
  13. package/lib/manju-skills/dushi-manju/SKILL.md +311 -0
  14. package/lib/manju-skills/gongdou-manju/SKILL.md +312 -0
  15. package/lib/manju-skills/jiating-manju/SKILL.md +311 -0
  16. package/lib/manju-skills/minsu-manju/SKILL.md +313 -0
  17. package/lib/manju-skills/moshi-manju/SKILL.md +313 -0
  18. package/lib/manju-skills/niandai-manju/SKILL.md +311 -0
  19. package/lib/manju-skills/quanmou-manju/SKILL.md +311 -0
  20. package/lib/manju-skills/shangzhan-manju/SKILL.md +311 -0
  21. package/lib/manju-skills/tianchong-manju/SKILL.md +310 -0
  22. package/lib/manju-skills/wuxia-manju/SKILL.md +308 -0
  23. package/lib/manju-skills/xiaoyuan-manju/SKILL.md +312 -0
  24. package/lib/manju-skills/xihuan-manju/SKILL.md +312 -0
  25. package/lib/manju-skills/xingji-manju/SKILL.md +312 -0
  26. package/lib/manju-skills/xitong-manju/SKILL.md +310 -0
  27. package/lib/manju-skills/xuanhuan-manju/SKILL.md +306 -0
  28. package/lib/manju-skills/xuanyi-manju/SKILL.md +315 -0
  29. package/lib/manju-skills/yule-manju/SKILL.md +310 -0
  30. package/lib/manju-skills/zhaidou-manju/SKILL.md +311 -0
  31. package/lib/manju-skills/zhongtian-manju/SKILL.md +310 -0
  32. package/lib/manjuSkills.js +69 -0
  33. package/lib/mcp.js +75 -0
  34. package/lib/nvzhuang/anime.json +1 -0
  35. package/lib/nvzhuang/portrait.json +1 -0
  36. package/lib/nvzhuang/real.json +1 -0
  37. package/lib/nvzhuang.js +184 -0
  38. package/lib/openmotion-skills/openmotion/SKILL.md +33 -0
  39. package/lib/openmotion-skills/openmotion-director/SKILL.md +67 -0
  40. package/lib/openmotion-skills/openmotion-media/SKILL.md +42 -0
  41. package/lib/openmotion-skills/openmotion-production/SKILL.md +48 -0
  42. package/lib/openmotion-skills/openmotion-recreate/SKILL.md +91 -0
  43. package/lib/openmotion-skills/openmotion-template-to-video/SKILL.md +72 -0
  44. package/lib/openmotion-skills/openmotion-video-to-template/SKILL.md +44 -0
  45. package/lib/openmotion.js +128 -0
  46. package/package.json +1 -1
package/README.md CHANGED
@@ -30,7 +30,7 @@ dsh plugin --profile desktop remove dsh-workrally
30
30
  ## 快速开始
31
31
 
32
32
  1. **打开创作台**:左侧面板列表里的「WorkRally」,或右侧栏加号里的「WorkRally」。
33
- 2. **登录**:点「登录」,浏览器会打开 WorkRally 授权页,授权完成后自动连接。只需要登录一次。
33
+ 2. **登录**:安装后会自动打开 WorkRally 授权页。在浏览器里点一次允许即可,之后自动续期,不用再登。
34
34
  3. **在对话里提需求**,例如:
35
35
  - 「用 WorkRally 生成一张橘猫坐在窗台上的图,16:9」
36
36
  - 「把这个剧本做成 30 秒的品牌短片」
@@ -42,7 +42,7 @@ dsh plugin --profile desktop remove dsh-workrally
42
42
 
43
43
  | 能力 | 说明 |
44
44
  |------|------|
45
- | 🔐 **一键登录** | 自带 WorkRally MCP,不用手动配置;浏览器授权一次,之后自动续期 |
45
+ | 🔐 **安装即登录** | 自带 WorkRally MCP,不用手动配置;安装后自动打开授权页,授权一次,之后自动续期 |
46
46
  | 🎯 **AI 生图 / 生视频** | Agent 直接调用 WorkRally 的生图、生视频、音频、3D、媒资、画布等工具 |
47
47
  | 🧠 **创作技能** | 随包 10 个创作技能,Agent 用到时才加载正文 |
48
48
  | 📋 **任务追踪** | 按对话记录生成任务的进度和失败原因,DSH 重启后不丢 |
@@ -56,7 +56,8 @@ dsh plugin --profile desktop remove dsh-workrally
56
56
  ### 登录与连接
57
57
 
58
58
  - 插件自带 WorkRally MCP(连接名 `workrally`),不需要在 DSH 的 MCP 设置里再添加。
59
- - 登录信息保存在 DSH 的凭据存储里,到期前自动续期。只有续期被拒绝时,创作台才会提示重新登录。
59
+ - 第一次安装、或本机没有登录记录时,插件会自己打开浏览器授权页,不用先点「登录」。
60
+ - 登录信息保存在 DSH 的凭据存储里,到期前自动续期。续期被拒绝时会再次打开授权页。
60
61
  - 退出登录:在 DSH 设置里删除凭据记录 `dsh-workrally/workrally`。
61
62
  - 卸载插件时,WorkRally 连接和工具会一起移除,不会改动你的其它配置。
62
63
 
package/lib/account.js CHANGED
@@ -21,7 +21,7 @@ const MAX_TIMER_MS = 2_147_000_000;
21
21
 
22
22
  const MESSAGES = {
23
23
  unavailable: 'DSH 凭据服务尚未就绪,暂时无法连接 WorkRally。',
24
- 'signed-out': '登录 WorkRally 后,对话里即可直接使用 WorkRally 工具。',
24
+ 'signed-out': '登录后可以查看画布和媒资,也可以在对话里直接使用 WorkRally。',
25
25
  authorizing: '已在浏览器打开 WorkRally 登录页,完成授权后会自动连接。',
26
26
  connected: '已连接 WorkRally。',
27
27
  expired: 'WorkRally 登录已过期,请重新登录。',
@@ -278,19 +278,28 @@ export const createAccount = ({ warn }) => {
278
278
  };
279
279
 
280
280
  return {
281
- /** 凭据与加载服务就绪:恢复已保存的登录并挂载 MCP。 */
281
+ /** 凭据与加载服务就绪:恢复已保存的登录;没有登录记录时直接打开浏览器授权。 */
282
282
  async start(serviceCtx) {
283
283
  scope = serviceCtx;
284
284
  set('signed-out');
285
285
  const grant = await readGrant();
286
- if (!scope || !grant?.accessToken) return;
287
- if (grant.expiresAt - Date.now() > REFRESH_SKEW_MS) {
288
- await mount(grant.accessToken);
289
- set('connected');
290
- schedule(grant.expiresAt - Date.now() - REFRESH_SKEW_MS);
291
- } else {
292
- await refresh();
286
+ if (!scope) return;
287
+ if (!grant?.accessToken) {
288
+ this.login();
289
+ return;
290
+ }
291
+ try {
292
+ if (grant.expiresAt - Date.now() > REFRESH_SKEW_MS) {
293
+ await mount(grant.accessToken);
294
+ set('connected');
295
+ schedule(grant.expiresAt - Date.now() - REFRESH_SKEW_MS);
296
+ } else {
297
+ await refresh();
298
+ }
299
+ } catch {
300
+ // 临时失败已经排了重试;令牌被拒绝时状态是 expired,下面补一次登录。
293
301
  }
302
+ if (scope && (phase === 'signed-out' || phase === 'expired')) this.login();
294
303
  },
295
304
 
296
305
  /** 发起或复用一次浏览器登录,立即返回当前状态。 */