openclaw-server 0.1.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.
- package/package.json +29 -0
- package/packs/default/faq.yaml +8 -0
- package/packs/default/intents.yaml +19 -0
- package/packs/default/pack.yaml +12 -0
- package/packs/default/policies.yaml +1 -0
- package/packs/default/scenarios.yaml +1 -0
- package/packs/default/synonyms.yaml +1 -0
- package/packs/default/templates.yaml +16 -0
- package/packs/default/tools.yaml +1 -0
- package/readme.md +1219 -0
- package/src/auth.ts +24 -0
- package/src/better-sqlite3.d.ts +17 -0
- package/src/config.ts +63 -0
- package/src/core/matcher.ts +214 -0
- package/src/core/normalizer.test.ts +37 -0
- package/src/core/normalizer.ts +183 -0
- package/src/core/pack-loader.ts +97 -0
- package/src/core/reply-engine.test.ts +76 -0
- package/src/core/reply-engine.ts +256 -0
- package/src/core/request-adapter.ts +65 -0
- package/src/core/session-store.ts +48 -0
- package/src/core/stream-renderer.ts +237 -0
- package/src/core/tool-engine.ts +60 -0
- package/src/debug-log.ts +211 -0
- package/src/index.ts +23 -0
- package/src/openai.ts +79 -0
- package/src/response-api.ts +107 -0
- package/src/routes/admin.ts +32 -0
- package/src/routes/chat-completions.ts +173 -0
- package/src/routes/health.ts +7 -0
- package/src/routes/models.ts +21 -0
- package/src/routes/request-validation.ts +33 -0
- package/src/routes/responses.ts +182 -0
- package/src/routes/tasks.ts +138 -0
- package/src/runtime-stats.ts +80 -0
- package/src/server.test.ts +776 -0
- package/src/server.ts +108 -0
- package/src/tasks/chat-integration.ts +70 -0
- package/src/tasks/service.ts +320 -0
- package/src/tasks/store.test.ts +183 -0
- package/src/tasks/store.ts +602 -0
- package/src/tasks/time-parser.test.ts +94 -0
- package/src/tasks/time-parser.ts +610 -0
- package/src/tasks/timezone.ts +171 -0
- package/src/tasks/types.ts +128 -0
- package/src/types.ts +202 -0
- package/src/weather/chat-integration.ts +56 -0
- package/src/weather/location-catalog.ts +166 -0
- package/src/weather/open-meteo-provider.ts +221 -0
- package/src/weather/parser.test.ts +23 -0
- package/src/weather/parser.ts +102 -0
- package/src/weather/service.test.ts +54 -0
- package/src/weather/service.ts +188 -0
- package/src/weather/types.ts +56 -0
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openclaw-server",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Independent faux AI backend for OpenClaw",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"src",
|
|
9
|
+
"packs"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev": "node --import tsx src/index.ts",
|
|
16
|
+
"start": "node --import tsx src/index.ts",
|
|
17
|
+
"test": "pnpm exec vitest run --config vitest.config.ts"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"better-sqlite3": "^12.6.2",
|
|
21
|
+
"express": "^5.2.1",
|
|
22
|
+
"tsx": "^4.0.0",
|
|
23
|
+
"yaml": "^2.8.2",
|
|
24
|
+
"zod": "^4.3.6"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22.12.0"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
- id: greeting
|
|
2
|
+
priority: 100
|
|
3
|
+
matchAny:
|
|
4
|
+
- 你好
|
|
5
|
+
- 你在吗
|
|
6
|
+
- 在吗
|
|
7
|
+
- hello
|
|
8
|
+
- hi
|
|
9
|
+
- hey
|
|
10
|
+
responseTemplateId: greeting.default
|
|
11
|
+
|
|
12
|
+
- id: capabilities.help
|
|
13
|
+
priority: 60
|
|
14
|
+
matchAny:
|
|
15
|
+
- 你能做什么
|
|
16
|
+
- 你会什么
|
|
17
|
+
- capabilities
|
|
18
|
+
- help
|
|
19
|
+
responseTemplateId: capabilities.help
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
- id: greeting.default
|
|
2
|
+
variants:
|
|
3
|
+
- "你好,我是 openclaw-server。我可以帮你创建任务、设置提醒、查询待办,也支持按城市查询今天、明天、后天的天气。"
|
|
4
|
+
- "我在。当前这个服务不会调用真实 AI API,但可以用规则、模板和场景帮你处理固定而实用的业务需求。"
|
|
5
|
+
|
|
6
|
+
- id: capabilities.help
|
|
7
|
+
variants:
|
|
8
|
+
- "我目前支持两类业务功能:一类是任务和提醒,比如创建待办、补充提醒、查询今天/明天/本周任务,以及完成、延后、取消提醒任务;另一类是天气查询,比如按城市查询今天、明天、后天的天气。如果缺地点或时间,我会继续追问。"
|
|
9
|
+
|
|
10
|
+
- id: faq.real-ai
|
|
11
|
+
variants:
|
|
12
|
+
- "不是。我不会调用真实 AI API。当前回复来自 `openclaw-server` 的知识包、规则匹配、模板和多轮场景编排。"
|
|
13
|
+
|
|
14
|
+
- id: fallback.default
|
|
15
|
+
variants:
|
|
16
|
+
- "这个我暂时没准确听懂。你可以直接说具体需求,比如“明天下午 3 点提醒我开会”、“我有哪些任务”或“天津明天天气如何”,我会按这个方向继续帮你。"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|