dlinkclaw-openclaw 2026.8.24-alpha.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 (77) hide show
  1. package/README.en.md +46 -0
  2. package/README.md +25 -0
  3. package/dist/index.d.ts +9 -0
  4. package/dist/index.js +1 -0
  5. package/dist/package.json +95 -0
  6. package/dist/src/account.d.ts +53 -0
  7. package/dist/src/account.js +394 -0
  8. package/dist/src/channel.d.ts +17 -0
  9. package/dist/src/channel.js +153 -0
  10. package/dist/src/client/client-manager.d.ts +4 -0
  11. package/dist/src/client/client-manager.js +10 -0
  12. package/dist/src/client/const.d.ts +37 -0
  13. package/dist/src/client/const.js +155 -0
  14. package/dist/src/client/crypto.d.ts +47 -0
  15. package/dist/src/client/crypto.js +260 -0
  16. package/dist/src/client/dl-client.d.ts +99 -0
  17. package/dist/src/client/dl-client.js +535 -0
  18. package/dist/src/client/dl-http.d.ts +27 -0
  19. package/dist/src/client/dl-http.js +223 -0
  20. package/dist/src/client/media-handler.d.ts +21 -0
  21. package/dist/src/client/media-handler.js +196 -0
  22. package/dist/src/client/message.d.ts +96 -0
  23. package/dist/src/client/message.js +1204 -0
  24. package/dist/src/client/timeout.d.ts +20 -0
  25. package/dist/src/client/timeout.js +36 -0
  26. package/dist/src/client/types.d.ts +224 -0
  27. package/dist/src/client/types.js +1 -0
  28. package/dist/src/monitor.d.ts +17 -0
  29. package/dist/src/monitor.js +320 -0
  30. package/dist/src/outbound.d.ts +4 -0
  31. package/dist/src/outbound.js +83 -0
  32. package/dist/src/policy.d.ts +42 -0
  33. package/dist/src/policy.js +205 -0
  34. package/dist/src/runtime.d.ts +9 -0
  35. package/dist/src/runtime.js +65 -0
  36. package/dist/src/services/index.d.ts +41 -0
  37. package/dist/src/services/index.js +225 -0
  38. package/dist/src/services/services.d.ts +152 -0
  39. package/dist/src/services/services.js +1066 -0
  40. package/dist/src/services/types.d.ts +391 -0
  41. package/dist/src/services/types.js +5 -0
  42. package/dist/src/services/ws-client.d.ts +174 -0
  43. package/dist/src/services/ws-client.js +866 -0
  44. package/dist/src/utils.d.ts +20 -0
  45. package/dist/src/utils.js +128 -0
  46. package/ext_capabilities/workrelay-speak/CLONE_GUIDE.md +129 -0
  47. package/ext_capabilities/workrelay-speak/HARDWARE.md +84 -0
  48. package/ext_capabilities/workrelay-speak/QWEN_GUIDE.md +151 -0
  49. package/ext_capabilities/workrelay-speak/README.md +79 -0
  50. package/ext_capabilities/workrelay-speak/__pycache__/patch-kokoro-en.cpython-312.pyc +0 -0
  51. package/ext_capabilities/workrelay-speak/install.sh +280 -0
  52. package/ext_capabilities/workrelay-speak/install.sh.bak-20260814 +376 -0
  53. package/ext_capabilities/workrelay-speak/manifest.json +49 -0
  54. package/ext_capabilities/workrelay-speak/patch-kokoro-en.py +85 -0
  55. package/ext_capabilities/workrelay-speak/status.sh +90 -0
  56. package/ext_capabilities/workrelay-speak/workrelay-tts.sh +118 -0
  57. package/ext_capabilities/workrelay-speak-luxtts/README.md +44 -0
  58. package/ext_capabilities/workrelay-speak-luxtts/install.sh +282 -0
  59. package/ext_capabilities/workrelay-speak-luxtts/manifest.json +49 -0
  60. package/ext_capabilities/workrelay-speak-luxtts/samples/45ea2e2c-0863-4966-a739-8bff8817f4c0.wav +0 -0
  61. package/ext_capabilities/workrelay-speak-luxtts/samples/800e5af4-cba5-441e-8003-6d36f35409e6.wav +0 -0
  62. package/ext_capabilities/workrelay-speak-luxtts/samples/85fafe01-d4d6-4a48-890e-9ae113f21905.wav +0 -0
  63. package/ext_capabilities/workrelay-speak-luxtts/samples/reference_text.txt +4 -0
  64. package/ext_capabilities/workrelay-speak-luxtts/samples/stone-sample-6.4s.wav +0 -0
  65. package/ext_capabilities/workrelay-speak-luxtts/status.sh +94 -0
  66. package/ext_capabilities/workrelay-speak-luxtts/workrelay-tts.sh +98 -0
  67. package/ext_capabilities/workrelay-transcribe/README.md +76 -0
  68. package/ext_capabilities/workrelay-transcribe/__pycache__/transcribe.cpython-312.pyc +0 -0
  69. package/ext_capabilities/workrelay-transcribe/__pycache__/transcribe_server.cpython-312.pyc +0 -0
  70. package/ext_capabilities/workrelay-transcribe/install.sh +207 -0
  71. package/ext_capabilities/workrelay-transcribe/manifest.json +42 -0
  72. package/ext_capabilities/workrelay-transcribe/status.sh +62 -0
  73. package/ext_capabilities/workrelay-transcribe/transcribe.py +56 -0
  74. package/ext_capabilities/workrelay-transcribe/transcribe_server.py +116 -0
  75. package/ext_capabilities/workrelay-transcribe/voicebox-transcribe.sh +88 -0
  76. package/openclaw.plugin.json +142 -0
  77. package/package.json +95 -0
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Claw-Services 主服务接口
3
+ * 为 duolian 插件提供 OpenClaw API 封装
4
+ */
5
+ import EventEmitter from 'events';
6
+ import { ClawServiceOptions, CmdMessage, CmdResponse } from './types.js';
7
+ import { PluginLogger } from 'openclaw/plugin-sdk';
8
+ /**
9
+ * Claw-Services 主类
10
+ * 处理 CMD 消息并调用相应的 OpenClaw API
11
+ */
12
+ export declare class ClawServices extends EventEmitter {
13
+ private client;
14
+ private readonly options;
15
+ private isInitialized;
16
+ private readonly logger;
17
+ constructor(options: ClawServiceOptions, logger: PluginLogger);
18
+ log(msg: string, type: 'info' | 'warn' | 'error' | 'debug'): void;
19
+ /**
20
+ * 初始化服务
21
+ */
22
+ initialize(): Promise<boolean>;
23
+ /**
24
+ * 检查服务是否已初始化
25
+ */
26
+ isReady(): boolean;
27
+ /**
28
+ * 处理 CMD 消息
29
+ */
30
+ handleCmdMessage(cmdMessage: CmdMessage): Promise<CmdResponse>;
31
+ private handleAskAgent;
32
+ /**
33
+ * 更新
34
+ * @param agentId
35
+ * @param userId
36
+ */
37
+ private handleUpdateSessionModel;
38
+ /**
39
+ * 查询当前会话的模型覆盖(用于 ChatPage 恢复选中状态)
40
+ */
41
+ private handleCurrentSessionModel;
42
+ private handleAgentList;
43
+ private handleAgentCreate;
44
+ private handleAgentUpdate;
45
+ private handleAgentDelete;
46
+ private handleAgentGet;
47
+ private handleTaskList;
48
+ private handleTaskCreate;
49
+ private handleTaskUpdate;
50
+ private handleTaskDelete;
51
+ private handleTaskRun;
52
+ private handleStatusHealth;
53
+ private handleStatusSystem;
54
+ private handleStatusUsage;
55
+ private handleListModels;
56
+ private handleSessionList;
57
+ private handleSessionGet;
58
+ private handleSessionsDescribe;
59
+ private handleSessionsResolve;
60
+ /**
61
+ * 创建新会话
62
+ * sessionKey: agent:<agentId>:<channelId>-<suffix>:<chatType>:<userId>
63
+ * 例: agent:main:workrelay-00001:direct:I35916630580137984
64
+ */
65
+ private handleSessionCreate;
66
+ /**
67
+ * 归档会话
68
+ * 入参: { sessionKey }
69
+ * - sessionKey: 完整的 sessionKey,如 "agent:main:workrelay-00001:direct:i35916630580137984"
70
+ */
71
+ private handleSessionArchive;
72
+ /**
73
+ * 恢复(取消归档)会话
74
+ * 入参: { sessionKey }
75
+ * - sessionKey: 完整的 sessionKey
76
+ */
77
+ private handleSessionRestore;
78
+ /**
79
+ * 删除会话
80
+ * 入参: { sessionKey, deleteFiles? }
81
+ * - sessionKey: 完整的 sessionKey
82
+ * - deleteFiles: 是否同时删除会话相关文件(可选,默认 false)
83
+ */
84
+ private handleSessionDelete;
85
+ private handleSessionReset;
86
+ private handleChatHistories;
87
+ private handleSkillsStatus;
88
+ private handleSkillsSearch;
89
+ private handleSkillDetail;
90
+ private handleSkillInstall;
91
+ private handleSkillUpdate;
92
+ private handleSkillsSecurityVerdicts;
93
+ private handleUsageCost;
94
+ private handleSessionsUsage;
95
+ private handleSessionsUsageLogs;
96
+ /**
97
+ * 取消当前Agent执行,通过Gateway /queue interrupt 中断活跃run
98
+ */
99
+ private handleCancelMessage;
100
+ /**
101
+ * 强制停止当前Agent run(/stop,比 /queue interrupt 更快)
102
+ * 新增 cmd 通道 agent.stop 指令
103
+ */
104
+ private handleStopAgent;
105
+ private handlChatAbout;
106
+ private handleApprove;
107
+ /** artifacts.list - 列出会话工件 */
108
+ handleArtifactsList(cmdMessage: CmdMessage): Promise<any>;
109
+ /** artifacts.get - 获取单个工件详情 */
110
+ handleArtifactsGet(cmdMessage: CmdMessage): Promise<any>;
111
+ /** artifacts.download - 下载工件 */
112
+ handleArtifactsDownload(cmdMessage: CmdMessage): Promise<any>;
113
+ /** agents.files.list - 列出 Agent 工作区文件 */
114
+ handleAgentFilesList(cmdMessage: CmdMessage): Promise<any>;
115
+ /** agents.files.get - 获取工作区文件内容 */
116
+ handleAgentFilesGet(cmdMessage: CmdMessage): Promise<any>;
117
+ /**
118
+ * extCapabilities.status - 查询扩展能力安装状态
119
+ * params: { name: 'workrelay-speak' | 'workrelay-transcribe' }
120
+ * 执行 ext_capabilities/<name>/status.sh,返回 JSON 供客户端展示
121
+ */
122
+ handleExtCapabilityStatus(params: Record<string, any>): Promise<any>;
123
+ /**
124
+ * 2026-08-10 检测指定扩展能力的安装进程是否真实在跑(存活检测)
125
+ * 注意:不能用 pgrep -f "...install.sh" —— 该命令经 bash -c 执行时,bash 进程
126
+ * 自身命令行包含 install.sh 字符串,pgrep 会永远自匹配,导致 installing 恒为 true。
127
+ * 改用 ps + grep 方括号技巧(grep 自身命令行不含字面 install.sh,不会自匹配)。
128
+ */
129
+ private isExtCapabilityInstalling;
130
+ /**
131
+ * extCapabilities.check - 检查扩展能力安装前置条件
132
+ * params: { name: 'workrelay-speak' | 'workrelay-transcribe' }
133
+ * 读取 ext_capabilities/<name>/manifest.json,逐条执行 requirements[].check(shell 表达式),
134
+ * exit 0 = 条件满足。返回每条条件是否满足,客户端据此展示"安装条件"清单。
135
+ * 2026-08-11 新增:通用适配——每个能力自带前置条件清单,用户安装前即可看到环境是否满足。
136
+ */
137
+ handleExtCapabilityCheck(params: Record<string, any>): Promise<any>;
138
+ /**
139
+ * extCapabilities.install - 安装扩展能力(长任务,后台执行)
140
+ * params: { name: 'workrelay-speak' | 'workrelay-transcribe' }
141
+ * install.sh 可能需要 5-15 分钟(下载模型),后台 spawn 立即返回"已开始",
142
+ * 客户端通过轮询 extCapabilities.status 感知进度
143
+ */
144
+ handleExtCapabilityInstall(params: Record<string, any>): Promise<any>;
145
+ /**
146
+ * 2026-08-10 读取日志文件尾部内容(供安装失败报错)
147
+ */
148
+ private readLogTail;
149
+ private formatUptime;
150
+ cleanup(): void;
151
+ }
152
+ export default ClawServices;