@dcrays/dcgchat-test 0.2.27 → 0.2.29
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/index.ts +19 -17
- package/package.json +1 -6
- package/src/bot.ts +224 -593
- package/src/channel.ts +113 -178
- package/src/monitor.ts +124 -180
- package/src/{api.ts → request/api.ts} +34 -35
- package/src/request/oss.ts +58 -0
- package/src/request/request.ts +198 -0
- package/src/{userInfo.ts → request/userInfo.ts} +36 -34
- package/src/skill.ts +119 -197
- package/src/tool.ts +109 -113
- package/src/transport.ts +108 -0
- package/src/types.ts +75 -64
- package/src/utils/constant.ts +7 -0
- package/src/utils/global.ts +112 -0
- package/src/utils/log.ts +15 -0
- package/src/utils/searchFile.ts +212 -0
- package/src/connection.ts +0 -11
- package/src/log.ts +0 -46
- package/src/oss.ts +0 -72
- package/src/request.ts +0 -201
- package/src/runtime.ts +0 -40
package/index.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import type { OpenClawPluginApi } from
|
|
2
|
-
import { emptyPluginConfigSchema } from
|
|
3
|
-
import { dcgchatPlugin } from
|
|
4
|
-
import { setDcgchatRuntime, setWorkspaceDir } from
|
|
5
|
-
import { monitoringToolMessage } from
|
|
1
|
+
import type { OpenClawPluginApi } from 'openclaw/plugin-sdk'
|
|
2
|
+
import { emptyPluginConfigSchema } from 'openclaw/plugin-sdk'
|
|
3
|
+
import { dcgchatPlugin } from './src/channel.js'
|
|
4
|
+
import { setDcgchatRuntime, setWorkspaceDir } from './src/utils/global.js'
|
|
5
|
+
import { monitoringToolMessage } from './src/tool.js'
|
|
6
|
+
import { setOpenClawConfig } from './src/utils/global.js'
|
|
6
7
|
|
|
7
8
|
const plugin = {
|
|
8
9
|
id: "dcgchat-test",
|
|
9
|
-
name:
|
|
10
|
-
description:
|
|
10
|
+
name: '书灵墨宝',
|
|
11
|
+
description: '连接 OpenClaw 与 书灵墨宝 产品(WebSocket)',
|
|
11
12
|
configSchema: emptyPluginConfigSchema(),
|
|
12
13
|
register(api: OpenClawPluginApi) {
|
|
13
|
-
setDcgchatRuntime(api.runtime)
|
|
14
|
-
monitoringToolMessage(api)
|
|
15
|
-
api.
|
|
14
|
+
setDcgchatRuntime(api.runtime)
|
|
15
|
+
monitoringToolMessage(api)
|
|
16
|
+
setOpenClawConfig(api.config)
|
|
17
|
+
api.registerChannel({ plugin: dcgchatPlugin })
|
|
16
18
|
api.registerTool((ctx) => {
|
|
17
|
-
const workspaceDir = ctx.workspaceDir
|
|
18
|
-
setWorkspaceDir(workspaceDir)
|
|
19
|
-
return null
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
}
|
|
19
|
+
const workspaceDir = ctx.workspaceDir
|
|
20
|
+
setWorkspaceDir(workspaceDir)
|
|
21
|
+
return null
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
}
|
|
23
25
|
|
|
24
|
-
export default plugin
|
|
26
|
+
export default plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcrays/dcgchat-test",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenClaw channel plugin for 书灵墨宝 (WebSocket)",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -16,11 +16,6 @@
|
|
|
16
16
|
"websocket",
|
|
17
17
|
"ai"
|
|
18
18
|
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"typecheck": "tsc --noEmit",
|
|
21
|
-
"build:prod": "npx tsx scripts/build.ts production",
|
|
22
|
-
"build:test": "npx tsx scripts/build.ts test"
|
|
23
|
-
},
|
|
24
19
|
"dependencies": {
|
|
25
20
|
"ali-oss": "file:src/libs/ali-oss-6.23.0.tgz",
|
|
26
21
|
"axios": "file:src/libs/axios-1.13.6.tgz",
|