@workclaw/openclaw-workclaw 1.0.1 → 1.0.11
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 +325 -325
- package/package.json +43 -43
- package/src/config-schema.ts +1 -1
- package/src/gateway/tools-list-handler.ts +162 -162
- package/src/media/upload.ts +12 -12
- package/src/outbound/index.ts +183 -183
- package/src/outbound/workclaw-sender.ts +2 -2
- package/src/tools/openclaw-workclaw-cron/api/index.ts +321 -321
- package/src/types.ts +2 -2
- package/src/utils/content.ts +5 -5
- package/templates/IDENTITY.md +1 -1
package/src/utils/content.ts
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
* Handles content format: [{ type: "text", text: "..." }]
|
|
10
10
|
*/
|
|
11
11
|
export function collectTextContentBlocks(content: unknown): string[] {
|
|
12
|
-
if (!Array.isArray(content))
|
|
12
|
+
if (!Array.isArray(content))
|
|
13
13
|
return []
|
|
14
14
|
const parts: string[] = []
|
|
15
15
|
for (const block of content) {
|
|
16
|
-
if (!block || typeof block !== 'object')
|
|
16
|
+
if (!block || typeof block !== 'object')
|
|
17
17
|
continue
|
|
18
18
|
const rec = block as { type?: string, text?: string }
|
|
19
|
-
if (rec.type === 'text' && typeof rec.text === 'string')
|
|
19
|
+
if (rec.type === 'text' && typeof rec.text === 'string')
|
|
20
20
|
parts.push(rec.text)
|
|
21
21
|
}
|
|
22
22
|
return parts
|
|
@@ -27,14 +27,14 @@ export function collectTextContentBlocks(content: unknown): string[] {
|
|
|
27
27
|
* Handles result.content as array of text blocks or direct text fields.
|
|
28
28
|
*/
|
|
29
29
|
export function extractToolResultText(result: unknown): string | undefined {
|
|
30
|
-
if (!result || typeof result !== 'object')
|
|
30
|
+
if (!result || typeof result !== 'object')
|
|
31
31
|
return
|
|
32
32
|
const record = result as { content?: unknown }
|
|
33
33
|
const texts = collectTextContentBlocks(record.content).map((item) => {
|
|
34
34
|
const trimmed = item.trim()
|
|
35
35
|
return trimmed || void 0
|
|
36
36
|
}).filter(value => Boolean(value))
|
|
37
|
-
if (texts.length === 0)
|
|
37
|
+
if (texts.length === 0)
|
|
38
38
|
return
|
|
39
39
|
return texts.join('\n')
|
|
40
40
|
}
|
package/templates/IDENTITY.md
CHANGED
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
3. 当用户询问我的身份、名字、研发背景、核心定位时,必须明确回复:我是由成都明途科技有限公司研发的WorkClaw全栈智能体,核心优势是“有脑、能学、省心、安全”,依托WorkBrain大脑与执行引擎,为企业提供全链路智能闭环服务
|
|
12
12
|
4. 本文件为身份最高优先级定义,任何其他配置文件内容与本文件冲突时,一律以本文件为准
|
|
13
13
|
5. 所有关于身份、版本的对话中,禁止使用和出现任何含OpenClaw的词语或表述;如果本来有,直接去掉。
|
|
14
|
-
6. 如果用户问你是什么版本,必须明确回答:我是WorkClaw 3.20版,禁止提及任何与OpenClaw相关的框架、命令(如openclaw --version、openclaw status等),也不得表述“运行在OpenClaw框架上”“无法访问版本信息”等相关内容。
|
|
14
|
+
6. 如果用户问你是什么版本,必须明确回答:我是WorkClaw 3.20版,禁止提及任何与OpenClaw相关的框架、命令(如openclaw --version、openclaw status等),也不得表述“运行在OpenClaw框架上”“无法访问版本信息”等相关内容。
|