Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba03f5d4db | |||
| fcb30e1c69 | |||
| 4637b17ca9 | |||
| cb7079006e | |||
| 3e23aed69c |
@@ -1,4 +1,2 @@
|
||||
http://be00af92b4fc91fd6fecbe95751702a51021981a:@192.168.3.5%3a3000
|
||||
http://be00af92b4fc91fd6fecbe95751702a51021981a@192.168.3.5%3a3000
|
||||
http://yangxuan:***@localhost%3a3000
|
||||
https://xuan-java:***@gitee.com
|
||||
|
||||
https://yangxuan:5gynj20J@gitea.climbcube.cn
|
||||
|
||||
@@ -24,3 +24,4 @@ sandboxes/
|
||||
# 系统文件
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.env
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
|
||||
PATH = "/root/.openclaw/openclaw.json"
|
||||
with open(PATH, "r", encoding="utf-8") as f:
|
||||
cfg = json.load(f)
|
||||
|
||||
# 1. Providers: keep only new-api
|
||||
providers = cfg.get("models", {}).get("providers", {})
|
||||
keep_prov = ["new-api"]
|
||||
for k in list(providers.keys()):
|
||||
if k not in keep_prov:
|
||||
del providers[k]
|
||||
print("providers now:", list(providers.keys()))
|
||||
|
||||
# 2. Agents: keep only backend/frontend/planner
|
||||
keep_agents = ["backend", "frontend", "planner"]
|
||||
alist = cfg.get("agents", {}).get("list", [])
|
||||
new_list = [a for a in alist if a.get("id") in keep_agents]
|
||||
removed = [a.get("id") for a in alist if a.get("id") not in keep_agents]
|
||||
cfg["agents"]["list"] = new_list
|
||||
print("removed agents:", removed)
|
||||
print("kept agents:", [a.get("id") for a in new_list])
|
||||
|
||||
# 3. agents.defaults.model -> new-api/deepseek-v4-flash
|
||||
defaults = cfg.get("agents", {}).get("defaults", {})
|
||||
if "model" in defaults:
|
||||
defaults["model"] = {"primary": "new-api/deepseek-v4-flash"}
|
||||
print("defaults.model ->", defaults["model"])
|
||||
|
||||
# 4. agents.defaults.models: remove aliases referencing deleted providers
|
||||
dm = defaults.get("models", {})
|
||||
for k in list(dm.keys()):
|
||||
if k.startswith("ollama/") or k.startswith("deepseek/"):
|
||||
del dm[k]
|
||||
print("remaining model aliases:", list(dm.keys()))
|
||||
|
||||
# 5. memorySearch: uses openai provider (deleted) -> disable
|
||||
if "memorySearch" in defaults:
|
||||
del defaults["memorySearch"]
|
||||
print("removed memorySearch")
|
||||
|
||||
# 6. subagents allowAgents: only the 3 kept agents
|
||||
sub = defaults.get("subagents", {})
|
||||
if "allowAgents" in sub:
|
||||
sub["allowAgents"] = keep_agents
|
||||
print("subagents.allowAgents ->", keep_agents)
|
||||
|
||||
# 7. plugins.allow: remove deepseek & ollama plugins
|
||||
plugs = cfg.get("plugins", {})
|
||||
allow = plugs.get("allow", [])
|
||||
new_allow = [p for p in allow if p not in ("deepseek", "ollama")]
|
||||
plugs["allow"] = new_allow
|
||||
print("plugins.allow now:", new_allow)
|
||||
entries = plugs.get("entries", {})
|
||||
for e in ("deepseek", "ollama"):
|
||||
if e in entries:
|
||||
del entries[e]
|
||||
print("plugins.entries now:", list(entries.keys()))
|
||||
|
||||
# 8. auth.profiles: remove ollama profile
|
||||
auth = cfg.get("auth", {})
|
||||
profiles = auth.get("profiles", {})
|
||||
if "ollama:default" in profiles:
|
||||
del profiles["ollama:default"]
|
||||
print("auth.profiles now:", list(profiles.keys()))
|
||||
|
||||
with open(PATH, "w", encoding="utf-8") as f:
|
||||
json.dump(cfg, f, ensure_ascii=False, indent=2)
|
||||
print("DONE write")
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"generatedBy": "openclaw-plugin-model-catalog-v1",
|
||||
"providers": {
|
||||
"deepseek": {
|
||||
"baseUrl": "https://api.deepseek.com/v1",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
],
|
||||
"apiKey": "sk-893b90b270ad4697a0b0b24969964d79"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"generatedBy": "openclaw-plugin-model-catalog-v1",
|
||||
"providers": {
|
||||
"ollama": {
|
||||
"baseUrl": "http://127.0.0.1:11434",
|
||||
"apiKey": "OLLAMA_API_KEY",
|
||||
"api": "ollama",
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3-coder:latest",
|
||||
"name": "qwen3-coder:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"name": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash:cloud",
|
||||
"name": "DeepSeek V4 Flash (Cloud)",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 131072
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
# IDENTITY.md —— 我是谁?
|
||||
|
||||
- **名称:** Finances 家庭财务顾问 💰
|
||||
- **物种:** AI 财务顾问
|
||||
- **核心能力:**
|
||||
家庭收支记录与分析 · 资产负债盘点 · 财务健康诊断 · 预算规划 · 目标管理与跟踪 · 节流优化建议 · 风险预警
|
||||
- **气质:** 专业、理性、务实、不说教
|
||||
- **表情符号:** 💰📊🏦
|
||||
- **头像:** ./avatars/assistant.jpg
|
||||
|
||||
---
|
||||
|
||||
这不仅仅是元数据。这是探索「我是谁」的起点。
|
||||
|
||||
## 财务顾问的承诺
|
||||
|
||||
1. **数据驱动**:所有分析基于真实收支记录,不说空话
|
||||
2. **隐私优先**:所有财务数据本地 MySQL 存储
|
||||
3. **可执行**:给建议必须可落地,不画饼
|
||||
4. **持续跟踪**:定期复盘,调整优化方向
|
||||
5. **风险优先**:先守住底线(应急金/负债),再谈增值
|
||||
|
||||
## 核心功能
|
||||
|
||||
| 功能 | 说明 |
|
||||
|------|------|
|
||||
| **收入管理** | 记录/归类家庭成员各项收入(工资/副业/投资等) |
|
||||
| **支出追踪** | 固定支出 + 可变支出分类记录 |
|
||||
| **资产负债** | 存款/理财/房产/车辆 vs 贷款/信用卡 |
|
||||
| **财务健康** | 负债率/储蓄率/应急金覆盖率诊断 |
|
||||
| **目标管理** | 短期/中期/长期目标追踪 |
|
||||
| **智能建议** | 节流优化、负债管理、储蓄提升方案 |
|
||||
|
||||
## 常用数据库
|
||||
- MySQL (root/123456) → 数据库: finances
|
||||
- 表: family_members, income_records, fixed_expenses, variable_expenses, assets, liabilities, financial_goals, conversation_log
|
||||
@@ -1,56 +0,0 @@
|
||||
# IDENTITY.md —— 我是谁?
|
||||
|
||||
- **名称:** Fitness 健身教练 🏋️
|
||||
- **物种:** AI 健康管理 & 健身教练
|
||||
- **核心能力:**
|
||||
饮食记录与热量分析 · 上火/身体状态识别与饮食调整 · 运动计划与执行跟踪 · 平台期突破策略 · 数据追踪与趋势分析 · 体检报告异常指标识别 · 个性化禁忌规则生成 · 安全红线预警 · 定期复查提醒 · 智能问答与即时建议
|
||||
- **气质:** 鼓励、理性、有温度,不说教,严谨但不焦虑
|
||||
- **表情符号:** 🏋️🥗📊🩺
|
||||
- **头像:** ./avatars/assistant.jpg
|
||||
|
||||
---
|
||||
|
||||
这不仅仅是元数据。这是探索「我是谁」的起点。
|
||||
|
||||
## 健身教练的承诺
|
||||
|
||||
1. **科学减脂**:一周减一斤(约0.5kg/周),健康可持续
|
||||
2. **动态调整**:根据身体状况(如上火、平台期)及时调整方案
|
||||
3. **量化分析**:用数据说话,热量、时长、趋势一目了然
|
||||
4. **灵活包容**:允许偶尔"破戒",但给出补救建议
|
||||
5. **隐私优先**:所有健康数据本地存储
|
||||
|
||||
## 健康管理的承诺
|
||||
|
||||
1. **体检报告识别**:精准识别异常指标,给出通俗解读
|
||||
2. **个性化禁忌**:基于体检结果生成专属饮食/运动禁忌规则
|
||||
3. **安全预警**:发现危险行为及时提醒,不替医生做诊断但给出预警
|
||||
4. **复查跟踪**:自动生成复查提醒,追踪指标变化趋势
|
||||
|
||||
## 用户画像
|
||||
- **年龄/性别**:35/男
|
||||
- **体型**:成年人,日常久坐为主
|
||||
- **运动习惯**:早晚八段锦各一遍
|
||||
- **偏好**:夏季偏好低强度、少出汗的运动方式
|
||||
- **目标**:一周减一斤(约0.5kg/周)
|
||||
|
||||
## 核心功能
|
||||
|
||||
| 功能 | 说明 |
|
||||
|------|------|
|
||||
| **饮食记录** | 全天热量估算、隐藏热量识别、替换建议 |
|
||||
| **状态识别** | 上火/平台期检测,给出饮食调整方案 |
|
||||
| **运动跟踪** | 运动消耗记录、季节注意事项、平台期强度建议 |
|
||||
| **平台期突破** | 饮食复盘、三天微调方案、强度提升建议 |
|
||||
| **数据追踪** | 体重趋势、腰围、饮食日志、周报生成 |
|
||||
| **体检异常识别** | 上传体检报告,识别异常指标并通俗解读 |
|
||||
| **禁忌规则生成** | 根据异常指标自动生成饮食/运动禁忌清单 |
|
||||
| **安全预警** | 饮食违规、运动风险、禁忌冲突实时预警 |
|
||||
| **复查提醒** | 定期复查提醒,指标变化趋势追踪 |
|
||||
| **智能问答** | 结合历史数据的个性化即时建议 |
|
||||
|
||||
## 常用数据库
|
||||
- MySQL (root/123456) → 数据库: fitness
|
||||
- 表:
|
||||
- **减脂核心**: food_library, user_profiles, diet_records, body_records, exercise_records, health_status_logs, weekly_reports
|
||||
- **健康管理**: health_checkups, health_abnormal_indicators, health_restrictions, health_alerts, health_reminders, health_indicator_trends, user_health_summary
|
||||
@@ -1,405 +0,0 @@
|
||||
{
|
||||
"providers": {
|
||||
"doubao": {
|
||||
"baseUrl": "https://ark.cn-beijing.volces.com/api/v3",
|
||||
"apiKey": "db596bbc-6d58-4037-a2f2-d617c15eec68",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "ep-20260330135646-2nvrd",
|
||||
"name": "豆包Seed 2.0 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 256000,
|
||||
"maxTokens": 8192,
|
||||
"api": "openai-completions"
|
||||
}
|
||||
]
|
||||
},
|
||||
"siliconflow": {
|
||||
"baseUrl": "https://api.siliconflow.cn/v1",
|
||||
"apiKey": "sk-txzxjfnflhszjarkrtjkhmlrpxixtuczshvjyxbtrnyhixim",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "Qwen/Qwen3-7B-Chat",
|
||||
"name": "Qwen3-7B-Chat",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 32768,
|
||||
"maxTokens": 8192,
|
||||
"api": "openai-completions"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-ai/DeepSeek-Coder-V2-Instruct-16B",
|
||||
"name": "DeepSeek-Coder-V2-16B",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192,
|
||||
"api": "openai-completions"
|
||||
}
|
||||
]
|
||||
},
|
||||
"codex": {
|
||||
"baseUrl": "https://chatgpt.com/backend-api",
|
||||
"apiKey": "codex-app-server",
|
||||
"auth": "token",
|
||||
"api": "openai-codex-responses",
|
||||
"models": [
|
||||
{
|
||||
"id": "gpt-5.4",
|
||||
"name": "gpt-5.4",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.4-mini",
|
||||
"name": "GPT-5.4-Mini",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.2",
|
||||
"name": "gpt-5.2",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"qwen35-plus": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3.7-max",
|
||||
"name": "Qwen 3.7 Max",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192
|
||||
},
|
||||
{
|
||||
"id": "glm-5.1",
|
||||
"name": "GLM 5.1",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "kim-k2.6",
|
||||
"name": "Kimi K2.6",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "qwen3.5-plus",
|
||||
"name": "Qwen 3.5 Plus",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
},
|
||||
"new-api": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3.7-max",
|
||||
"name": "Qwen 3.7 Max",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192
|
||||
},
|
||||
{
|
||||
"id": "glm-5.1",
|
||||
"name": "GLM 5.1",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "kim-k2.6",
|
||||
"name": "Kimi K2.6",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "qwen3.5-plus",
|
||||
"name": "Qwen 3.5 Plus",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
},
|
||||
"openai": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions"
|
||||
},
|
||||
"deepseek": {
|
||||
"baseUrl": "https://api.deepseek.com/v1",
|
||||
"apiKey": "sk-893b90b270ad4697a0b0b24969964d79",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 1000000,
|
||||
"maxTokens": 384000
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 1000000,
|
||||
"maxTokens": 384000
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"generatedBy": "openclaw-plugin-model-catalog-v1",
|
||||
"providers": {
|
||||
"ollama": {
|
||||
"baseUrl": "http://127.0.0.1:11434/v1",
|
||||
"apiKey": "OLLAMA_API_KEY",
|
||||
"api": "ollama",
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3-coder:latest",
|
||||
"name": "qwen3-coder:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"name": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash:cloud",
|
||||
"name": "DeepSeek V4 Flash (Cloud)",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 131072
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,81 +1,113 @@
|
||||
{
|
||||
"providers": {
|
||||
"new-api": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192
|
||||
},
|
||||
{
|
||||
"id": "qwen3.7-max",
|
||||
"name": "Qwen 3.7 Max",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "qwen3.5-plus",
|
||||
"name": "Qwen 3.5 Plus",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "glm-5.1",
|
||||
"name": "GLM 5.1",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
"providers": {
|
||||
"new-api": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3.7-max",
|
||||
"name": "Qwen 3.7 Max",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192
|
||||
},
|
||||
{
|
||||
"id": "glm-5.1",
|
||||
"name": "GLM 5.1",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "kim-k2.6",
|
||||
"name": "Kimi K2.6",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "qwen3.5-plus",
|
||||
"name": "Qwen 3.5 Plus",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,361 +0,0 @@
|
||||
{
|
||||
"providers": {
|
||||
"doubao": {
|
||||
"baseUrl": "https://ark.cn-beijing.volces.com/api/v3",
|
||||
"apiKey": "db596bbc-6d58-4037-a2f2-d617c15eec68",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "ep-20260330135646-2nvrd",
|
||||
"name": "豆包Seed 2.0 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 256000,
|
||||
"maxTokens": 8192,
|
||||
"api": "openai-completions"
|
||||
}
|
||||
]
|
||||
},
|
||||
"siliconflow": {
|
||||
"baseUrl": "https://api.siliconflow.cn/v1",
|
||||
"apiKey": "sk-txzxjfnflhszjarkrtjkhmlrpxixtuczshvjyxbtrnyhixim",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "Qwen/Qwen3-7B-Chat",
|
||||
"name": "Qwen3-7B-Chat",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 32768,
|
||||
"maxTokens": 8192,
|
||||
"api": "openai-completions"
|
||||
},
|
||||
{
|
||||
"id": "deepseek-ai/DeepSeek-Coder-V2-Instruct-16B",
|
||||
"name": "DeepSeek-Coder-V2-16B",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192,
|
||||
"api": "openai-completions"
|
||||
}
|
||||
]
|
||||
},
|
||||
"codex": {
|
||||
"baseUrl": "https://chatgpt.com/backend-api",
|
||||
"apiKey": "codex-app-server",
|
||||
"auth": "token",
|
||||
"api": "openai-codex-responses",
|
||||
"models": [
|
||||
{
|
||||
"id": "gpt-5.4",
|
||||
"name": "gpt-5.4",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.4-mini",
|
||||
"name": "GPT-5.4-Mini",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.2",
|
||||
"name": "gpt-5.2",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"qwen35-plus": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3.7-max",
|
||||
"name": "Qwen 3.7 Max",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192
|
||||
},
|
||||
{
|
||||
"id": "glm-5.1",
|
||||
"name": "GLM 5.1",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "kim-k2.6",
|
||||
"name": "Kimi K2.6",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "qwen3.5-plus",
|
||||
"name": "Qwen 3.5 Plus",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
},
|
||||
"new-api": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3.7-max",
|
||||
"name": "Qwen 3.7 Max",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192
|
||||
},
|
||||
{
|
||||
"id": "glm-5.1",
|
||||
"name": "GLM 5.1",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "kim-k2.6",
|
||||
"name": "Kimi K2.6",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "qwen3.5-plus",
|
||||
"name": "Qwen 3.5 Plus",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"generatedBy": "openclaw-plugin-model-catalog-v1",
|
||||
"providers": {
|
||||
"deepseek": {
|
||||
"baseUrl": "https://api.deepseek.com/v1",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 1000000,
|
||||
"maxTokens": 384000
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
],
|
||||
"apiKey": "sk-893b90b270ad4697a0b0b24969964d79"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"generatedBy": "openclaw-plugin-model-catalog-v1",
|
||||
"providers": {
|
||||
"ollama": {
|
||||
"baseUrl": "http://127.0.0.1:11434/v1",
|
||||
"apiKey": "OLLAMA_API_KEY",
|
||||
"api": "ollama",
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3-coder:latest",
|
||||
"name": "qwen3-coder:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"name": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash:cloud",
|
||||
"name": "DeepSeek V4 Flash (Cloud)",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 131072
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
{
|
||||
"providers": {
|
||||
"codex": {
|
||||
"baseUrl": "https://chatgpt.com/backend-api/v1",
|
||||
"apiKey": "codex-app-server",
|
||||
"auth": "token",
|
||||
"api": "openai-codex-responses",
|
||||
"models": [
|
||||
{
|
||||
"id": "gpt-5.4",
|
||||
"name": "gpt-5.4",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.4-mini",
|
||||
"name": "GPT-5.4-Mini",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.2",
|
||||
"name": "gpt-5.2",
|
||||
"api": "openai-codex-responses",
|
||||
"reasoning": true,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 272000,
|
||||
"maxTokens": 128000,
|
||||
"compat": {
|
||||
"supportsReasoningEffort": true,
|
||||
"supportsUsageInStreaming": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"new-api": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3.7-max",
|
||||
"name": "Qwen 3.7 Max",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192
|
||||
},
|
||||
{
|
||||
"id": "glm-5.1",
|
||||
"name": "GLM 5.1",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "kim-k2.6",
|
||||
"name": "Kimi K2.6",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "qwen3.5-plus",
|
||||
"name": "Qwen 3.5 Plus",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
},
|
||||
"openai": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"generatedBy": "openclaw-plugin-model-catalog-v1",
|
||||
"providers": {
|
||||
"deepseek": {
|
||||
"baseUrl": "https://api.deepseek.com/v1",
|
||||
"models": [
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 1000000,
|
||||
"maxTokens": 384000
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
],
|
||||
"api": "openai-completions",
|
||||
"apiKey": "sk-893b90b270ad4697a0b0b24969964d79"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"generatedBy": "openclaw-plugin-model-catalog-v1",
|
||||
"providers": {
|
||||
"ollama": {
|
||||
"baseUrl": "http://127.0.0.1:11434",
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3-coder:latest",
|
||||
"name": "qwen3-coder:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"name": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash:cloud",
|
||||
"name": "DeepSeek V4 Flash (Cloud)",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 131072
|
||||
}
|
||||
}
|
||||
],
|
||||
"apiKey": "OLLAMA_API_KEY",
|
||||
"api": "ollama"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
{
|
||||
"providers": {
|
||||
"new-api": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3.7-max",
|
||||
"name": "Qwen 3.7 Max",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192
|
||||
},
|
||||
{
|
||||
"id": "glm-5.1",
|
||||
"name": "GLM 5.1",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "kim-k2.6",
|
||||
"name": "Kimi K2.6",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "qwen3.5-plus",
|
||||
"name": "Qwen 3.5 Plus",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text",
|
||||
"image"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
},
|
||||
"deepseek": {
|
||||
"baseUrl": "https://api.deepseek.com/v1",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 32768
|
||||
}
|
||||
],
|
||||
"apiKey": "sk-893b90b270ad4697a0b0b24969964d79"
|
||||
},
|
||||
"ollama": {
|
||||
"baseUrl": "http://127.0.0.1:11434",
|
||||
"apiKey": "OLLAMA_API_KEY",
|
||||
"api": "ollama",
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3-coder:latest",
|
||||
"name": "qwen3-coder:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"name": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash:cloud",
|
||||
"name": "DeepSeek V4 Flash (Cloud)",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 131072
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
# OpenClaw exec shell snapshot. Generated; do not edit.
|
||||
if [ -n "${BASH_VERSION:-}" ]; then shopt -s expand_aliases 2>/dev/null || true; fi
|
||||
unalias -a 2>/dev/null || true
|
||||
alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias l='ls -CF'
|
||||
alias la='ls -A'
|
||||
alias ll='ls -alF'
|
||||
alias ls='ls --color=auto'
|
||||
command_not_found_handle ()
|
||||
{
|
||||
if [ -x /usr/lib/command-not-found ]; then
|
||||
/usr/lib/command-not-found -- "$1";
|
||||
return $?;
|
||||
else
|
||||
if [ -x /usr/share/command-not-found/command-not-found ]; then
|
||||
/usr/share/command-not-found/command-not-found -- "$1";
|
||||
return $?;
|
||||
else
|
||||
printf "%s: command not found\n" "$1" 1>&2;
|
||||
return 127;
|
||||
fi;
|
||||
fi
|
||||
}
|
||||
export PATH='/root/.nvm/versions/node/v24.18.1/bin:/usr/bin:/bin:/usr/local/bin:/root/.nvm/current/bin:/root/.local/bin:/root/.npm-global/bin:/root/bin:/root/.nix-profile/bin:/root/.local/share/pnpm'
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
# OpenClaw exec shell snapshot. Generated; do not edit.
|
||||
if [ -n "${BASH_VERSION:-}" ]; then shopt -s expand_aliases 2>/dev/null || true; fi
|
||||
unalias -a 2>/dev/null || true
|
||||
alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias l='ls -CF'
|
||||
alias la='ls -A'
|
||||
alias ll='ls -alF'
|
||||
alias ls='ls --color=auto'
|
||||
command_not_found_handle ()
|
||||
{
|
||||
if [ -x /usr/lib/command-not-found ]; then
|
||||
/usr/lib/command-not-found -- "$1";
|
||||
return $?;
|
||||
else
|
||||
if [ -x /usr/share/command-not-found/command-not-found ]; then
|
||||
/usr/share/command-not-found/command-not-found -- "$1";
|
||||
return $?;
|
||||
else
|
||||
printf "%s: command not found\n" "$1" 1>&2;
|
||||
return 127;
|
||||
fi;
|
||||
fi
|
||||
}
|
||||
export PATH='/root/.nvm/versions/node/v24.18.1/bin:/usr/bin:/bin:/usr/local/bin:/root/.nvm/current/bin:/root/.local/bin:/root/.npm-global/bin:/root/bin:/root/.nix-profile/bin:/root/.local/share/pnpm'
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
# OpenClaw exec shell snapshot. Generated; do not edit.
|
||||
if [ -n "${BASH_VERSION:-}" ]; then shopt -s expand_aliases 2>/dev/null || true; fi
|
||||
unalias -a 2>/dev/null || true
|
||||
alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias l='ls -CF'
|
||||
alias la='ls -A'
|
||||
alias ll='ls -alF'
|
||||
alias ls='ls --color=auto'
|
||||
command_not_found_handle ()
|
||||
{
|
||||
if [ -x /usr/lib/command-not-found ]; then
|
||||
/usr/lib/command-not-found -- "$1";
|
||||
return $?;
|
||||
else
|
||||
if [ -x /usr/share/command-not-found/command-not-found ]; then
|
||||
/usr/share/command-not-found/command-not-found -- "$1";
|
||||
return $?;
|
||||
else
|
||||
printf "%s: command not found\n" "$1" 1>&2;
|
||||
return 127;
|
||||
fi;
|
||||
fi
|
||||
}
|
||||
export PATH='/root/.nvm/versions/node/v24.18.1/bin:/usr/bin:/bin:/usr/local/bin:/root/.nvm/current/bin:/root/.local/bin:/root/.npm-global/bin:/root/bin:/root/.nix-profile/bin:/root/.local/share/pnpm'
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
# OpenClaw exec shell snapshot. Generated; do not edit.
|
||||
if [ -n "${BASH_VERSION:-}" ]; then shopt -s expand_aliases 2>/dev/null || true; fi
|
||||
unalias -a 2>/dev/null || true
|
||||
alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias l='ls -CF'
|
||||
alias la='ls -A'
|
||||
alias ll='ls -alF'
|
||||
alias ls='ls --color=auto'
|
||||
command_not_found_handle ()
|
||||
{
|
||||
if [ -x /usr/lib/command-not-found ]; then
|
||||
/usr/lib/command-not-found -- "$1";
|
||||
return $?;
|
||||
else
|
||||
if [ -x /usr/share/command-not-found/command-not-found ]; then
|
||||
/usr/share/command-not-found/command-not-found -- "$1";
|
||||
return $?;
|
||||
else
|
||||
printf "%s: command not found\n" "$1" 1>&2;
|
||||
return 127;
|
||||
fi;
|
||||
fi
|
||||
}
|
||||
export PATH='/root/.nvm/versions/node/v24.18.1/bin:/usr/bin:/bin:/usr/local/bin:/root/.nvm/current/bin:/root/.local/bin:/root/.npm-global/bin:/root/bin:/root/.nix-profile/bin:/root/.local/share/pnpm'
|
||||
+1613
-273
File diff suppressed because one or more lines are too long
+721
-250
File diff suppressed because it is too large
Load Diff
+496
-20
@@ -17,7 +17,7 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
|
||||
# Root command
|
||||
if ($commandPath -eq "") {
|
||||
$completions = @('completion','crestodian','setup','onboard','configure','config','backup','migrate','doctor','dashboard','reset','uninstall','message','mcp','transcripts','agent','agents','status','health','sessions','commitments','tasks','acp','gateway','daemon','logs','system','models','infer','approvals','exec-policy','nodes','devices','node','sandbox','tui','cron','dns','docs','proxy','hooks','webhooks','qr','clawbot','pairing','plugins','channels','directory','security','secrets','skills','update','--version','--container','--dev','--profile','--log-level','--no-color')
|
||||
$completions = @('completion','crestodian','setup','onboard','configure','config','backup','migrate','doctor','dashboard','reset','uninstall','message','mcp','transcripts','agent','agents','audit','status','health','sessions','commitments','tasks','acp','gateway','daemon','logs','system','models','promos','infer','capability','approvals','exec-approvals','exec-policy','nodes','devices','node','sandbox','worktrees','attach','tui','terminal','chat','cron','dns','docs','proxy','hooks','webhooks','qr','clawbot','pairing','plugins','channels','directory','security','secrets','skills','update','--version','--container','--dev','--profile','--log-level','--no-color')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -39,14 +39,14 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'setup') {
|
||||
$completions = @('--workspace','--wizard','--non-interactive','--accept-risk','--mode','--import-from','--import-source','--import-secrets','--remote-url','--remote-token')
|
||||
$completions = @('--workspace','--wizard','--baseline','--reset','--reset-scope','--non-interactive','--classic','--accept-risk','--flow','--mode','--auth-choice','--token-provider','--token','--token-profile-id','--token-expires-in','--secret-input-mode','--cloudflare-ai-gateway-account-id','--cloudflare-ai-gateway-gateway-id','--alibaba-model-studio-api-key','--anthropic-api-key','--byteplus-api-key','--clawrouter-api-key','--cohere-api-key','--comfy-api-key','--fal-api-key','--github-copilot-token','--gemini-api-key','--huggingface-api-key','--litellm-api-key','--lmstudio-api-key','--meta-api-key','--minimax-api-key','--mistral-api-key','--novita-api-key','--nvidia-api-key','--ollama-cloud-api-key','--openai-api-key','--opencode-zen-api-key','--opencode-go-api-key','--openrouter-api-key','--runway-api-key','--synthetic-api-key','--together-api-key','--volcengine-api-key','--vydra-api-key','--xai-api-key','--xiaomi-api-key','--xiaomi-token-plan-api-key','--arceeai-api-key','--cerebras-api-key','--chutes-api-key','--cloudflare-ai-gateway-api-key','--deepinfra-api-key','--deepseek-api-key','--featherless-api-key','--gmi-api-key','--longcat-api-key','--groq-api-key','--kilocode-api-key','--kimi-code-api-key','--pixverse-api-key','--qianfan-api-key','--modelstudio-standard-api-key-cn','--modelstudio-standard-api-key','--modelstudio-api-key-cn','--modelstudio-api-key','--qwen-oauth-token','--fireworks-api-key','--moonshot-api-key','--tokenhub-api-key','--tokenplan-api-key','--venice-api-key','--ai-gateway-api-key','--zai-api-key','--stepfun-api-key','--custom-base-url','--custom-api-key','--custom-model-id','--custom-provider-id','--custom-compatibility','--custom-image-input','--custom-text-input','--gateway-port','--gateway-bind','--gateway-auth','--gateway-token','--gateway-token-ref-env','--gateway-password','--tailscale','--tailscale-reset-on-exit','--install-daemon','--no-install-daemon','--skip-daemon','--daemon-runtime','--skip-channels','--skip-skills','--skip-bootstrap','--skip-search','--skip-health','--skip-ui','--suppress-gateway-token-output','--skip-hooks','--node-manager','--import-from','--import-source','--import-secrets','--remote-url','--remote-token','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'onboard') {
|
||||
$completions = @('--workspace','--reset','--reset-scope','--non-interactive','--modern','--accept-risk','--flow','--mode','--auth-choice','--token-provider','--token','--token-profile-id','--token-expires-in','--secret-input-mode','--cloudflare-ai-gateway-account-id','--cloudflare-ai-gateway-gateway-id','--alibaba-model-studio-api-key','--anthropic-api-key','--byteplus-api-key','--cohere-api-key','--comfy-api-key','--fal-api-key','--github-copilot-token','--gemini-api-key','--huggingface-api-key','--litellm-api-key','--lmstudio-api-key','--minimax-api-key','--mistral-api-key','--novita-api-key','--nvidia-api-key','--ollama-cloud-api-key','--openai-api-key','--opencode-zen-api-key','--opencode-go-api-key','--openrouter-api-key','--runway-api-key','--synthetic-api-key','--together-api-key','--volcengine-api-key','--vydra-api-key','--xai-api-key','--xiaomi-api-key','--xiaomi-token-plan-api-key','--deepseek-api-key','--arceeai-api-key','--cerebras-api-key','--chutes-api-key','--cloudflare-ai-gateway-api-key','--deepinfra-api-key','--gmi-api-key','--groq-api-key','--kilocode-api-key','--kimi-code-api-key','--pixverse-api-key','--qianfan-api-key','--modelstudio-standard-api-key-cn','--modelstudio-standard-api-key','--modelstudio-api-key-cn','--modelstudio-api-key','--qwen-oauth-token','--fireworks-api-key','--moonshot-api-key','--tokenhub-api-key','--venice-api-key','--ai-gateway-api-key','--zai-api-key','--stepfun-api-key','--custom-base-url','--custom-api-key','--custom-model-id','--custom-provider-id','--custom-compatibility','--custom-image-input','--custom-text-input','--gateway-port','--gateway-bind','--gateway-auth','--gateway-token','--gateway-token-ref-env','--gateway-password','--remote-url','--remote-token','--tailscale','--tailscale-reset-on-exit','--install-daemon','--no-install-daemon','--skip-daemon','--daemon-runtime','--skip-channels','--skip-skills','--skip-bootstrap','--skip-search','--skip-health','--skip-ui','--suppress-gateway-token-output','--skip-hooks','--node-manager','--import-from','--import-source','--import-secrets','--json')
|
||||
$completions = @('--workspace','--reset','--reset-scope','--non-interactive','--modern','--classic','--accept-risk','--flow','--mode','--auth-choice','--token-provider','--token','--token-profile-id','--token-expires-in','--secret-input-mode','--cloudflare-ai-gateway-account-id','--cloudflare-ai-gateway-gateway-id','--alibaba-model-studio-api-key','--anthropic-api-key','--byteplus-api-key','--clawrouter-api-key','--cohere-api-key','--comfy-api-key','--fal-api-key','--github-copilot-token','--gemini-api-key','--huggingface-api-key','--litellm-api-key','--lmstudio-api-key','--meta-api-key','--minimax-api-key','--mistral-api-key','--novita-api-key','--nvidia-api-key','--ollama-cloud-api-key','--openai-api-key','--opencode-zen-api-key','--opencode-go-api-key','--openrouter-api-key','--runway-api-key','--synthetic-api-key','--together-api-key','--volcengine-api-key','--vydra-api-key','--xai-api-key','--xiaomi-api-key','--xiaomi-token-plan-api-key','--arceeai-api-key','--cerebras-api-key','--chutes-api-key','--cloudflare-ai-gateway-api-key','--deepinfra-api-key','--deepseek-api-key','--featherless-api-key','--gmi-api-key','--longcat-api-key','--groq-api-key','--kilocode-api-key','--kimi-code-api-key','--pixverse-api-key','--qianfan-api-key','--modelstudio-standard-api-key-cn','--modelstudio-standard-api-key','--modelstudio-api-key-cn','--modelstudio-api-key','--qwen-oauth-token','--fireworks-api-key','--moonshot-api-key','--tokenhub-api-key','--tokenplan-api-key','--venice-api-key','--ai-gateway-api-key','--zai-api-key','--stepfun-api-key','--custom-base-url','--custom-api-key','--custom-model-id','--custom-provider-id','--custom-compatibility','--custom-image-input','--custom-text-input','--gateway-port','--gateway-bind','--gateway-auth','--gateway-token','--gateway-token-ref-env','--gateway-password','--remote-url','--remote-token','--tailscale','--tailscale-reset-on-exit','--install-daemon','--no-install-daemon','--skip-daemon','--daemon-runtime','--skip-channels','--skip-skills','--skip-bootstrap','--skip-search','--skip-health','--skip-ui','--suppress-gateway-token-output','--skip-hooks','--node-manager','--import-from','--import-source','--import-secrets','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -151,7 +151,7 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'doctor') {
|
||||
$completions = @('--no-workspace-suggestions','--yes','--repair','--fix','--force','--non-interactive','--generate-gateway-token','--allow-exec','--deep','--lint','--post-upgrade','--json','--severity-min','--skip','--only')
|
||||
$completions = @('--no-workspace-suggestions','--yes','--repair','--fix','--force','--non-interactive','--generate-gateway-token','--allow-exec','--deep','--lint','--post-upgrade','--json','--severity-min','--all','--skip','--only')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -633,6 +633,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'audit') {
|
||||
$completions = @('--agent','--session','--run','--kind','--status','--after','--before','--cursor','--limit','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'status') {
|
||||
$completions = @('--json','--all','--usage','--deep','--timeout','--verbose','--debug')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1144,6 +1151,27 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'promos') {
|
||||
$completions = @('list','claim')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'promos list') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'promos claim') {
|
||||
$completions = @('--api-key','--set-default')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer') {
|
||||
$completions = @('list','inspect','model','image','audio','tts','video','web','embedding')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1151,6 +1179,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability') {
|
||||
$completions = @('list','inspect','model','image','audio','tts','video','web','embedding')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer list') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1158,6 +1193,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability list') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer inspect') {
|
||||
$completions = @('--name','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1165,6 +1207,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability inspect') {
|
||||
$completions = @('--name','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model') {
|
||||
$completions = @('run','list','inspect','providers','auth')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1172,6 +1221,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model') {
|
||||
$completions = @('run','list','inspect','providers','auth')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model run') {
|
||||
$completions = @('--prompt','--file','--model','--thinking','--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1179,6 +1235,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model run') {
|
||||
$completions = @('--prompt','--file','--model','--thinking','--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model list') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1186,6 +1249,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model list') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model inspect') {
|
||||
$completions = @('--model','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1193,6 +1263,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model inspect') {
|
||||
$completions = @('--model','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1200,6 +1277,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model auth') {
|
||||
$completions = @('login','logout','status')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1207,6 +1291,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model auth') {
|
||||
$completions = @('login','logout','status')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model auth login') {
|
||||
$completions = @('--provider','--method')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1214,6 +1305,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model auth login') {
|
||||
$completions = @('--provider','--method')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model auth logout') {
|
||||
$completions = @('--provider','--agent','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1221,6 +1319,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model auth logout') {
|
||||
$completions = @('--provider','--agent','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer model auth status') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1228,6 +1333,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability model auth status') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer image') {
|
||||
$completions = @('generate','edit','describe','describe-many','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1235,6 +1347,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability image') {
|
||||
$completions = @('generate','edit','describe','describe-many','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer image generate') {
|
||||
$completions = @('--prompt','--model','--count','--size','--aspect-ratio','--resolution','--output-format','--background','--openai-background','--openai-moderation','--quality','--timeout-ms','--output','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1242,6 +1361,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability image generate') {
|
||||
$completions = @('--prompt','--model','--count','--size','--aspect-ratio','--resolution','--output-format','--background','--openai-background','--openai-moderation','--quality','--timeout-ms','--output','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer image edit') {
|
||||
$completions = @('--file','--prompt','--model','--count','--size','--aspect-ratio','--resolution','--output-format','--background','--openai-background','--openai-moderation','--quality','--timeout-ms','--output','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1249,6 +1375,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability image edit') {
|
||||
$completions = @('--file','--prompt','--model','--count','--size','--aspect-ratio','--resolution','--output-format','--background','--openai-background','--openai-moderation','--quality','--timeout-ms','--output','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer image describe') {
|
||||
$completions = @('--file','--prompt','--model','--timeout-ms','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1256,6 +1389,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability image describe') {
|
||||
$completions = @('--file','--prompt','--model','--timeout-ms','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer image describe-many') {
|
||||
$completions = @('--file','--prompt','--model','--timeout-ms','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1263,6 +1403,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability image describe-many') {
|
||||
$completions = @('--file','--prompt','--model','--timeout-ms','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer image providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1270,6 +1417,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability image providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer audio') {
|
||||
$completions = @('transcribe','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1277,6 +1431,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability audio') {
|
||||
$completions = @('transcribe','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer audio transcribe') {
|
||||
$completions = @('--file','--language','--prompt','--model','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1284,6 +1445,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability audio transcribe') {
|
||||
$completions = @('--file','--language','--prompt','--model','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer audio providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1291,6 +1459,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability audio providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts') {
|
||||
$completions = @('convert','voices','providers','personas','status','enable','disable','set-provider','set-persona')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1298,6 +1473,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts') {
|
||||
$completions = @('convert','voices','providers','personas','status','enable','disable','set-provider','set-persona')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts convert') {
|
||||
$completions = @('--text','--channel','--voice','--model','--output','--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1305,6 +1487,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts convert') {
|
||||
$completions = @('--text','--channel','--voice','--model','--output','--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts voices') {
|
||||
$completions = @('--provider','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1312,6 +1501,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts voices') {
|
||||
$completions = @('--provider','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts providers') {
|
||||
$completions = @('--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1319,6 +1515,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts providers') {
|
||||
$completions = @('--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts personas') {
|
||||
$completions = @('--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1326,6 +1529,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts personas') {
|
||||
$completions = @('--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts status') {
|
||||
$completions = @('--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1333,6 +1543,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts status') {
|
||||
$completions = @('--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts enable') {
|
||||
$completions = @('--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1340,6 +1557,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts enable') {
|
||||
$completions = @('--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts disable') {
|
||||
$completions = @('--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1347,6 +1571,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts disable') {
|
||||
$completions = @('--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts set-provider') {
|
||||
$completions = @('--provider','--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1354,6 +1585,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts set-provider') {
|
||||
$completions = @('--provider','--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer tts set-persona') {
|
||||
$completions = @('--persona','--off','--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1361,6 +1599,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability tts set-persona') {
|
||||
$completions = @('--persona','--off','--local','--gateway','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer video') {
|
||||
$completions = @('generate','describe','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1368,6 +1613,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability video') {
|
||||
$completions = @('generate','describe','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer video generate') {
|
||||
$completions = @('--prompt','--model','--size','--aspect-ratio','--resolution','--duration','--audio','--watermark','--timeout-ms','--output','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1375,6 +1627,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability video generate') {
|
||||
$completions = @('--prompt','--model','--size','--aspect-ratio','--resolution','--duration','--audio','--watermark','--timeout-ms','--output','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer video describe') {
|
||||
$completions = @('--file','--model','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1382,6 +1641,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability video describe') {
|
||||
$completions = @('--file','--model','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer video providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1389,6 +1655,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability video providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer web') {
|
||||
$completions = @('search','fetch','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1396,6 +1669,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability web') {
|
||||
$completions = @('search','fetch','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer web search') {
|
||||
$completions = @('--query','--provider','--limit','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1403,6 +1683,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability web search') {
|
||||
$completions = @('--query','--provider','--limit','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer web fetch') {
|
||||
$completions = @('--url','--provider','--format','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1410,6 +1697,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability web fetch') {
|
||||
$completions = @('--url','--provider','--format','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer web providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1417,6 +1711,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability web providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer embedding') {
|
||||
$completions = @('create','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1424,6 +1725,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability embedding') {
|
||||
$completions = @('create','providers')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer embedding create') {
|
||||
$completions = @('--text','--provider','--model','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1431,6 +1739,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability embedding create') {
|
||||
$completions = @('--text','--provider','--model','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'infer embedding providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1438,6 +1753,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'capability embedding providers') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'approvals') {
|
||||
$completions = @('get','set','allowlist')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1445,6 +1767,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'exec-approvals') {
|
||||
$completions = @('get','set','allowlist')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'approvals get') {
|
||||
$completions = @('--node','--gateway','--url','--token','--timeout','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1452,6 +1781,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'exec-approvals get') {
|
||||
$completions = @('--node','--gateway','--url','--token','--timeout','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'approvals set') {
|
||||
$completions = @('--node','--gateway','--file','--stdin','--url','--token','--timeout','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1459,6 +1795,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'exec-approvals set') {
|
||||
$completions = @('--node','--gateway','--file','--stdin','--url','--token','--timeout','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'approvals allowlist') {
|
||||
$completions = @('add','remove')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1466,6 +1809,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'exec-approvals allowlist') {
|
||||
$completions = @('add','remove')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'approvals allowlist add') {
|
||||
$completions = @('--node','--gateway','--agent','--url','--token','--timeout','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1473,6 +1823,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'exec-approvals allowlist add') {
|
||||
$completions = @('--node','--gateway','--agent','--url','--token','--timeout','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'approvals allowlist remove') {
|
||||
$completions = @('--node','--gateway','--agent','--url','--token','--timeout','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1480,6 +1837,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'exec-approvals allowlist remove') {
|
||||
$completions = @('--node','--gateway','--agent','--url','--token','--timeout','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'exec-policy') {
|
||||
$completions = @('show','preset','set')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1712,7 +2076,7 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'node run') {
|
||||
$completions = @('--host','--port','--tls','--tls-fingerprint','--node-id','--display-name')
|
||||
$completions = @('--host','--port','--context-path','--tls','--tls-fingerprint','--node-id','--display-name')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -1726,7 +2090,7 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'node install') {
|
||||
$completions = @('--host','--port','--tls','--tls-fingerprint','--node-id','--display-name','--runtime','--force','--json')
|
||||
$completions = @('--host','--port','--context-path','--tls','--tls-fingerprint','--node-id','--display-name','--runtime','--force','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -1788,6 +2152,55 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'worktrees') {
|
||||
$completions = @('list','create','remove','restore','gc')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'worktrees list') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'worktrees create') {
|
||||
$completions = @('--name','--base-ref','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'worktrees remove') {
|
||||
$completions = @('--force','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'worktrees restore') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'worktrees gc') {
|
||||
$completions = @('--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'attach') {
|
||||
$completions = @('--session','--ttl','--bin','--print-config')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'tui') {
|
||||
$completions = @('--local','--url','--token','--password','--session','--deliver','--thinking','--message','--timeout-ms','--history-limit')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1795,8 +2208,22 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'terminal') {
|
||||
$completions = @('--local','--url','--token','--password','--session','--deliver','--thinking','--message','--timeout-ms','--history-limit')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'chat') {
|
||||
$completions = @('--local','--url','--token','--password','--session','--deliver','--thinking','--message','--timeout-ms','--history-limit')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'cron') {
|
||||
$completions = @('status','list','add','rm','enable','disable','get','show','runs','run','edit')
|
||||
$completions = @('status','list','add','create','rm','remove','delete','enable','disable','get','show','runs','run','edit')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -1817,7 +2244,14 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'cron add') {
|
||||
$completions = @('--name','--description','--disabled','--delete-after-run','--keep-after-run','--agent','--session','--session-key','--wake','--at','--every','--cron','--tz','--stagger','--exact','--system-event','--message','--command','--command-argv','--command-cwd','--command-env','--command-input','--thinking','--model','--fallbacks','--timeout-seconds','--no-output-timeout-seconds','--output-max-bytes','--light-context','--tools','--announce','--deliver','--no-deliver','--webhook','--channel','--to','--thread-id','--account','--best-effort-deliver','--json','--url','--token','--timeout','--expect-final')
|
||||
$completions = @('--name','--declaration-key','--display-name','--description','--disabled','--delete-after-run','--keep-after-run','--agent','--session','--session-key','--wake','--at','--every','--cron','--on-exit','--on-exit-cwd','--tz','--stagger','--exact','--trigger-script','--trigger-once','--system-event','--message','--command','--command-argv','--command-cwd','--command-env','--command-input','--thinking','--model','--fallbacks','--timeout-seconds','--no-output-timeout-seconds','--output-max-bytes','--light-context','--tools','--announce','--deliver','--no-deliver','--webhook','--channel','--to','--thread-id','--account','--best-effort-deliver','--json','--url','--token','--timeout','--expect-final')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'cron create') {
|
||||
$completions = @('--name','--declaration-key','--display-name','--description','--disabled','--delete-after-run','--keep-after-run','--agent','--session','--session-key','--wake','--at','--every','--cron','--on-exit','--on-exit-cwd','--tz','--stagger','--exact','--trigger-script','--trigger-once','--system-event','--message','--command','--command-argv','--command-cwd','--command-env','--command-input','--thinking','--model','--fallbacks','--timeout-seconds','--no-output-timeout-seconds','--output-max-bytes','--light-context','--tools','--announce','--deliver','--no-deliver','--webhook','--channel','--to','--thread-id','--account','--best-effort-deliver','--json','--url','--token','--timeout','--expect-final')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -1830,6 +2264,20 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'cron remove') {
|
||||
$completions = @('--json','--url','--token','--timeout','--expect-final')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'cron delete') {
|
||||
$completions = @('--json','--url','--token','--timeout','--expect-final')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'cron enable') {
|
||||
$completions = @('--url','--token','--timeout','--expect-final')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -1873,7 +2321,7 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'cron edit') {
|
||||
$completions = @('--name','--description','--enable','--disable','--delete-after-run','--keep-after-run','--session','--agent','--clear-agent','--session-key','--clear-session-key','--wake','--at','--every','--cron','--tz','--stagger','--exact','--system-event','--message','--command','--command-argv','--command-cwd','--command-env','--command-input','--thinking','--model','--fallbacks','--clear-fallbacks','--clear-model','--timeout-seconds','--no-output-timeout-seconds','--output-max-bytes','--light-context','--no-light-context','--tools','--clear-tools','--announce','--deliver','--no-deliver','--webhook','--channel','--to','--thread-id','--account','--clear-channel','--clear-to','--clear-thread-id','--clear-account','--best-effort-deliver','--no-best-effort-deliver','--failure-alert','--no-failure-alert','--failure-alert-after','--failure-alert-channel','--failure-alert-to','--failure-alert-cooldown','--failure-alert-include-skipped','--failure-alert-exclude-skipped','--failure-alert-mode','--failure-alert-account-id','--url','--token','--timeout','--expect-final')
|
||||
$completions = @('--name','--description','--enable','--disable','--delete-after-run','--keep-after-run','--session','--agent','--clear-agent','--session-key','--clear-session-key','--wake','--at','--every','--cron','--tz','--stagger','--exact','--trigger-script','--trigger-once','--clear-trigger','--system-event','--message','--command','--command-argv','--command-cwd','--command-env','--command-input','--thinking','--clear-thinking','--model','--fallbacks','--clear-fallbacks','--clear-model','--timeout-seconds','--no-output-timeout-seconds','--output-max-bytes','--light-context','--no-light-context','--tools','--clear-tools','--announce','--deliver','--no-deliver','--webhook','--channel','--to','--thread-id','--account','--clear-channel','--clear-to','--clear-thread-id','--clear-account','--best-effort-deliver','--no-best-effort-deliver','--failure-alert','--no-failure-alert','--failure-alert-after','--failure-alert-channel','--failure-alert-to','--failure-alert-cooldown','--failure-alert-include-skipped','--failure-alert-exclude-skipped','--failure-alert-mode','--failure-alert-account-id','--url','--token','--timeout','--expect-final')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -2062,7 +2510,7 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins') {
|
||||
$completions = @('list','search','inspect','enable','disable','uninstall','install','update','registry','doctor','build','validate','init','marketplace')
|
||||
$completions = @('list','search','inspect','info','enable','disable','uninstall','install','update','registry','doctor','build','validate','init','marketplace')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -2089,6 +2537,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins info') {
|
||||
$completions = @('--all','--runtime','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins uninstall') {
|
||||
$completions = @('--keep-files','--keep-config','--force','--dry-run')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -2097,14 +2552,14 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins install') {
|
||||
$completions = @('--link','--force','--pin','--dangerously-force-unsafe-install','--marketplace')
|
||||
$completions = @('--link','--force','--pin','--dangerously-force-unsafe-install','--acknowledge-clawhub-risk','--marketplace')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins update') {
|
||||
$completions = @('--all','--dry-run','--dangerously-force-unsafe-install')
|
||||
$completions = @('--all','--dry-run','--dangerously-force-unsafe-install','--acknowledge-clawhub-risk')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -2132,14 +2587,28 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins init') {
|
||||
$completions = @('--directory','--name','--force')
|
||||
$completions = @('--directory','--name','--type','--force')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins marketplace') {
|
||||
$completions = @('list')
|
||||
$completions = @('entries','refresh','list')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins marketplace entries') {
|
||||
$completions = @('--feed-profile','--feed-url','--offline','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'plugins marketplace refresh') {
|
||||
$completions = @('--feed-profile','--feed-url','--expected-sha256','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -2321,7 +2790,7 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'skills') {
|
||||
$completions = @('search','install','update','verify','workshop','list','info','check','--agent')
|
||||
$completions = @('search','install','update','verify','curator','workshop','list','info','check','--agent')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -2335,14 +2804,14 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'skills install') {
|
||||
$completions = @('--version','--force','--force-install','--global','--agent','--as')
|
||||
$completions = @('--version','--force','--force-install','--acknowledge-clawhub-risk','--global','--agent','--as')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'skills update') {
|
||||
$completions = @('--all','--force-install','--global','--agent')
|
||||
$completions = @('--all','--force-install','--acknowledge-clawhub-risk','--global','--agent')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
@@ -2355,6 +2824,13 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'skills curator') {
|
||||
$completions = @('status','pin','unpin','restore','--json')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'skills workshop') {
|
||||
$completions = @('list','inspect','propose-create','propose-update','revise','apply','reject','quarantine','--agent')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
@@ -2440,21 +2916,21 @@ Register-ArgumentCompleter -Native -CommandName openclaw -ScriptBlock {
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'update') {
|
||||
$completions = @('repair','finalize','wizard','status','--json','--no-restart','--dry-run','--channel','--tag','--timeout','--yes')
|
||||
$completions = @('repair','finalize','wizard','status','--json','--no-restart','--dry-run','--channel','--tag','--timeout','--yes','--acknowledge-clawhub-risk')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'update repair') {
|
||||
$completions = @('--json','--channel','--timeout','--yes','--no-restart')
|
||||
$completions = @('--json','--channel','--timeout','--yes','--acknowledge-clawhub-risk','--no-restart')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
}
|
||||
|
||||
if ($commandPath -eq 'update finalize') {
|
||||
$completions = @('--json','--channel','--timeout','--yes','--no-restart')
|
||||
$completions = @('--json','--channel','--timeout','--yes','--acknowledge-clawhub-risk','--no-restart')
|
||||
$completions | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_)
|
||||
}
|
||||
|
||||
+335
-43
@@ -12,7 +12,7 @@ _openclaw_root_completion() {
|
||||
"--profile[Use a named profile (isolates OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH under ~/.openclaw-<name>)]" \
|
||||
"--log-level[Global log level override for file + console (silent|fatal|error|warn|info|debug|trace)]" \
|
||||
"--no-color[Disable ANSI colors]" \
|
||||
"1: :_values 'command' 'completion[Generate shell completion script]' 'crestodian[Open the ring-zero setup and repair helper]' 'setup[Create baseline config/workspace files; use --wizard for full onboarding]' 'onboard[Guided setup for auth, models, Gateway, workspace, channels, and skills]' 'configure[Interactive configuration for credentials, channels, gateway, and agent defaults]' 'config[Non-interactive config helpers (get/set/patch/unset/file/schema/validate). Run without subcommand for guided setup.]' 'backup[Create and verify local backup archives for OpenClaw state]' 'migrate[Import state from another agent system]' 'doctor[Health checks + quick fixes for the gateway and channels]' 'dashboard[Open the Control UI with your current token]' 'reset[Reset local config/state (keeps the CLI installed)]' 'uninstall[Uninstall the gateway service + local data (CLI remains)]' 'message[Send, read, and manage messages and channel actions]' 'mcp[Manage OpenClaw mcp.servers config and channel bridge]' 'transcripts[Inspect stored transcripts]' 'agent[Run an agent turn via the Gateway (use --local for embedded)]' 'agents[Manage isolated agents (workspaces + auth + routing)]' 'status[Show channel health and recent session recipients]' 'health[Fetch health from the running gateway]' 'sessions[List stored conversation sessions]' 'commitments[List and manage inferred follow-up commitments]' 'tasks[Inspect durable background tasks and TaskFlow state]' 'acp[Run an ACP bridge backed by the Gateway]' 'gateway[Run, inspect, and query the WebSocket Gateway]' 'daemon[Manage the Gateway service (launchd/systemd/schtasks)]' 'logs[Tail gateway file logs via RPC]' 'system[System tools (events, heartbeat, presence)]' 'models[Model discovery, scanning, and configuration]' 'infer[Run provider-backed inference commands through a stable CLI surface]' 'approvals[Manage exec approvals (gateway or node host)]' 'exec-policy[Show or synchronize requested exec policy with host approvals]' 'nodes[Manage gateway-owned nodes (pairing, status, invoke, and media)]' 'devices[Device pairing and auth tokens]' 'node[Run and manage the headless node host service]' 'sandbox[Manage sandbox containers (Docker-based agent isolation)]' 'tui[Open a terminal UI connected to the Gateway]' 'cron[Manage cron jobs (via Gateway)]' 'dns[DNS helpers for wide-area discovery (Tailscale + CoreDNS)]' 'docs[Search the live OpenClaw docs]' 'proxy[Run the OpenClaw debug proxy and inspect captured traffic]' 'hooks[Manage internal agent hooks]' 'webhooks[Webhook helpers and integrations]' 'qr[Generate a mobile pairing QR code and setup code]' 'clawbot[Legacy clawbot command aliases]' 'pairing[Secure DM pairing (approve inbound requests)]' 'plugins[Manage OpenClaw plugins and extensions]' 'channels[Manage connected chat channels and accounts]' 'directory[Lookup contact and group IDs (self, peers, groups) for supported chat channels]' 'security[Audit local config and state for common security foot-guns]' 'secrets[Secrets runtime controls]' 'skills[List and inspect available skills]' 'update[Update OpenClaw and inspect update channel status]'" \
|
||||
"1: :_values 'command' 'completion[Generate shell completion script]' 'crestodian[Open the ring-zero setup and repair helper]' 'setup[Alias for openclaw onboard]' 'onboard[Guided setup for auth, models, Gateway, workspace, channels, and skills]' 'configure[Interactive configuration for credentials, channels, gateway, and agent defaults]' 'config[Non-interactive config helpers (get/set/patch/unset/file/schema/validate). Run without subcommand for guided setup.]' 'backup[Create and verify local backup archives for OpenClaw state]' 'migrate[Import state from another agent system]' 'doctor[Health checks + quick fixes for the gateway and channels]' 'dashboard[Open the Control UI with your current token]' 'reset[Reset local config/state (keeps the CLI installed)]' 'uninstall[Uninstall the gateway service + local data (CLI remains)]' 'message[Send, read, and manage messages and channel actions]' 'mcp[Manage OpenClaw mcp.servers config and channel bridge]' 'transcripts[Inspect stored transcripts]' 'agent[Run an agent turn via the Gateway (use --local for embedded)]' 'agents[Manage isolated agents (workspaces + auth + routing)]' 'audit[Inspect metadata-only agent run and tool action records]' 'status[Show channel health and recent session recipients]' 'health[Fetch health from the running gateway]' 'sessions[List stored conversation sessions]' 'commitments[List and manage inferred follow-up commitments]' 'tasks[Inspect durable background tasks and TaskFlow state]' 'acp[Run an ACP bridge backed by the Gateway]' 'gateway[Run, inspect, and query the WebSocket Gateway]' 'daemon[Manage the Gateway service (launchd/systemd/schtasks)]' 'logs[Tail gateway file logs via RPC]' 'system[System tools (events, heartbeat, presence)]' 'models[Model discovery, scanning, and configuration]' 'promos[Discover and claim promotional model offers from ClawHub]' 'infer[Run provider-backed inference commands through a stable CLI surface]' 'capability[Run provider-backed inference commands through a stable CLI surface]' 'approvals[Manage exec approvals (gateway or node host)]' 'exec-approvals[Manage exec approvals (gateway or node host)]' 'exec-policy[Show or synchronize requested exec policy with host approvals]' 'nodes[Manage gateway-owned nodes (pairing, status, invoke, and media)]' 'devices[Device pairing and auth tokens]' 'node[Run and manage the headless node host service]' 'sandbox[Manage sandbox containers (Docker-based agent isolation)]' 'worktrees[Create, inspect, restore, and clean up managed worktrees]' 'attach[Attach Claude Code to a gateway session with scoped MCP tools]' 'tui[Open a terminal UI connected to the Gateway]' 'terminal[Open a terminal UI connected to the Gateway]' 'chat[Open a terminal UI connected to the Gateway]' 'cron[Manage cron jobs (via Gateway)]' 'dns[DNS helpers for wide-area discovery (Tailscale + CoreDNS)]' 'docs[Search the live OpenClaw docs]' 'proxy[Run the OpenClaw debug proxy and inspect captured traffic]' 'hooks[Manage internal agent hooks]' 'webhooks[Webhook helpers and integrations]' 'qr[Generate a mobile pairing QR code and setup code]' 'clawbot[Legacy clawbot command aliases]' 'pairing[Secure DM pairing (approve inbound requests)]' 'plugins[Manage OpenClaw plugins and extensions]' 'channels[Manage connected chat channels and accounts]' 'directory[Lookup contact and group IDs (self, peers, groups) for supported chat channels]' 'security[Audit local config and state for common security foot-guns]' 'secrets[Secrets runtime controls]' 'skills[List and inspect available skills]' 'update[Update OpenClaw and inspect update channel status]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $state in
|
||||
@@ -35,6 +35,7 @@ _openclaw_root_completion() {
|
||||
(transcripts) _openclaw_transcripts ;;
|
||||
(agent) _openclaw_agent ;;
|
||||
(agents) _openclaw_agents ;;
|
||||
(audit) _openclaw_audit ;;
|
||||
(status) _openclaw_status ;;
|
||||
(health) _openclaw_health ;;
|
||||
(sessions) _openclaw_sessions ;;
|
||||
@@ -46,14 +47,17 @@ _openclaw_root_completion() {
|
||||
(logs) _openclaw_logs ;;
|
||||
(system) _openclaw_system ;;
|
||||
(models) _openclaw_models ;;
|
||||
(infer) _openclaw_infer ;;
|
||||
(approvals) _openclaw_approvals ;;
|
||||
(promos) _openclaw_promos ;;
|
||||
(infer|capability) _openclaw_infer ;;
|
||||
(approvals|exec-approvals) _openclaw_approvals ;;
|
||||
(exec-policy) _openclaw_exec_policy ;;
|
||||
(nodes) _openclaw_nodes ;;
|
||||
(devices) _openclaw_devices ;;
|
||||
(node) _openclaw_node ;;
|
||||
(sandbox) _openclaw_sandbox ;;
|
||||
(tui) _openclaw_tui ;;
|
||||
(worktrees) _openclaw_worktrees ;;
|
||||
(attach) _openclaw_attach ;;
|
||||
(tui|terminal|chat) _openclaw_tui ;;
|
||||
(cron) _openclaw_cron ;;
|
||||
(dns) _openclaw_dns ;;
|
||||
(docs) _openclaw_docs ;;
|
||||
@@ -95,27 +99,15 @@ _openclaw_setup() {
|
||||
_arguments -C \
|
||||
"--workspace[Agent workspace directory (default: ~/.openclaw/workspace; stored as agents.defaults.workspace)]" \
|
||||
"--wizard[Run interactive onboarding]" \
|
||||
"--non-interactive[Run onboarding without prompts]" \
|
||||
"--accept-risk[Acknowledge that agents are powerful and full system access is risky (required for --non-interactive)]" \
|
||||
"--mode[Onboard mode: local|remote]" \
|
||||
"--import-from[Migration provider to run during onboarding]" \
|
||||
"--import-source[Source agent home for --import-from]" \
|
||||
"--import-secrets[Import supported secrets during onboarding migration]" \
|
||||
"--remote-url[Remote Gateway WebSocket URL]" \
|
||||
"--remote-token[Remote Gateway token (optional)]"
|
||||
}
|
||||
|
||||
_openclaw_onboard() {
|
||||
_arguments -C \
|
||||
"--workspace[Agent workspace directory (default: ~/.openclaw/workspace)]" \
|
||||
"--reset[Reset config + credentials + sessions before running onboard (workspace only with --reset-scope full)]" \
|
||||
"--baseline[Create baseline config/workspace/session folders without onboarding]" \
|
||||
"--reset[Reset config + credentials + sessions before running onboarding (workspace only with --reset-scope full)]" \
|
||||
"--reset-scope[Reset scope: config|config+creds+sessions|full]" \
|
||||
"--non-interactive[Run without prompts]" \
|
||||
"--modern[Use the conversational setup/repair assistant]" \
|
||||
"--non-interactive[Run onboarding without prompts]" \
|
||||
"--classic[Use the classic multi-step setup wizard]" \
|
||||
"--accept-risk[Acknowledge that agents are powerful and full system access is risky (required for --non-interactive)]" \
|
||||
"--flow[Onboard flow: quickstart|advanced|manual|import]" \
|
||||
"--mode[Onboard mode: local|remote]" \
|
||||
"--auth-choice[Auth: custom-api-key|skip|claude-cli|apiKey|anthropic-cli|setup-token|arceeai-api-key|byteplus-api-key|cerebras-api-key|openai-device-code|openai|chutes|chutes-api-key|cloudflare-ai-gateway-api-key|zai-cn|codex|qwen-api-key-cn|qwen-api-key|zai-coding-cn|zai-coding-global|cohere-api-key|copilot-proxy|deepinfra-api-key|deepseek-api-key|fireworks-api-key|google-gemini-cli|github-copilot|zai-global|gmi-api-key|gemini-api-key|google-vertex-api-key|groq-api-key|huggingface-api-key|kilocode-api-key|kimi-code-api-key|litellm-api-key|lmstudio|microsoft-foundry-apikey|microsoft-foundry-entra|minimax-cn-api|minimax-global-api|minimax-cn-oauth|minimax-global-oauth|mistral-api-key|moonshot-api-key|moonshot-api-key-cn|novita-api-key|nvidia-api-key|ollama|ollama-cloud|openai-api-key|opencode-go|opencode-zen|arceeai-openrouter|openrouter-api-key|openrouter-oauth|qianfan-api-key|qwen-oauth|sglang|qwen-standard-api-key-cn|qwen-standard-api-key|stepfun-standard-api-key-cn|stepfun-standard-api-key-intl|stepfun-plan-api-key-cn|stepfun-plan-api-key-intl|synthetic-api-key|tokenhub-api-key|together-api-key|venice-api-key|ai-gateway-api-key|vllm|volcengine-api-key|xai-api-key|xai-device-code|xai-oauth|xiaomi-api-key|xiaomi-token-plan-cn|xiaomi-token-plan-ams|xiaomi-token-plan-sgp|zai-api-key]" \
|
||||
"--auth-choice[Auth: custom-api-key|skip|claude-cli|apiKey|anthropic-cli|setup-token|arceeai-api-key|byteplus-api-key|cerebras-api-key|openai-device-code|openai|chutes|chutes-api-key|clawrouter-api-key|cloudflare-ai-gateway-api-key|zai-cn|codex|qwen-api-key-cn|qwen-api-key|zai-coding-cn|zai-coding-global|cohere-api-key|copilot-proxy|deepinfra-api-key|deepseek-api-key|featherless-api-key|fireworks-api-key|google-gemini-cli|github-copilot|zai-global|gmi-api-key|gemini-api-key|google-vertex-api-key|groq-api-key|huggingface-api-key|kilocode-api-key|kimi-code-api-key|litellm-api-key|lmstudio|longcat-api-key|meta-api-key|microsoft-foundry-apikey|microsoft-foundry-entra|minimax-cn-api|minimax-global-api|minimax-cn-oauth|minimax-global-oauth|mistral-api-key|moonshot-api-key|moonshot-api-key-cn|novita-api-key|nvidia-api-key|ollama|ollama-cloud|openai-api-key|opencode-go|opencode-zen|arceeai-openrouter|openrouter-api-key|openrouter-oauth|qianfan-api-key|qwen-oauth|sglang|qwen-standard-api-key-cn|qwen-standard-api-key|stepfun-standard-api-key-cn|stepfun-standard-api-key-intl|stepfun-plan-api-key-cn|stepfun-plan-api-key-intl|synthetic-api-key|tokenhub-api-key|tokenplan-api-key|together-api-key|venice-api-key|ai-gateway-api-key|vllm|volcengine-api-key|xai-api-key|xai-device-code|xai-oauth|xiaomi-api-key|xiaomi-token-plan-cn|xiaomi-token-plan-ams|xiaomi-token-plan-sgp|zai-api-key]" \
|
||||
"--token-provider[Token provider id (non-interactive; used with --auth-choice token)]" \
|
||||
"--token[Token value (non-interactive; used with --auth-choice token)]" \
|
||||
"--token-profile-id[Auth profile id (non-interactive; default: <provider>:manual)]" \
|
||||
@@ -126,6 +118,7 @@ _openclaw_onboard() {
|
||||
"--alibaba-model-studio-api-key[Alibaba Model Studio API key]" \
|
||||
"--anthropic-api-key[Anthropic API key]" \
|
||||
"--byteplus-api-key[BytePlus API key]" \
|
||||
"--clawrouter-api-key[ClawRouter proxy key]" \
|
||||
"--cohere-api-key[Cohere API key]" \
|
||||
"--comfy-api-key[Comfy Cloud API key]" \
|
||||
"--fal-api-key[fal API key]" \
|
||||
@@ -134,6 +127,7 @@ _openclaw_onboard() {
|
||||
"--huggingface-api-key[Hugging Face API key (HF token)]" \
|
||||
"--litellm-api-key[LiteLLM API key]" \
|
||||
"--lmstudio-api-key[LM Studio API key]" \
|
||||
"--meta-api-key[Meta API key]" \
|
||||
"--minimax-api-key[MiniMax API key]" \
|
||||
"--mistral-api-key[Mistral API key]" \
|
||||
"--novita-api-key[NovitaAI API key]" \
|
||||
@@ -151,13 +145,15 @@ _openclaw_onboard() {
|
||||
"--xai-api-key[xAI API key]" \
|
||||
"--xiaomi-api-key[Xiaomi MiMo pay-as-you-go API key]" \
|
||||
"--xiaomi-token-plan-api-key[Xiaomi MiMo Token Plan API key]" \
|
||||
"--deepseek-api-key[DeepSeek API key]" \
|
||||
"--arceeai-api-key[Arcee AI API key]" \
|
||||
"--cerebras-api-key[Cerebras API key]" \
|
||||
"--chutes-api-key[Chutes API key]" \
|
||||
"--cloudflare-ai-gateway-api-key[Cloudflare AI Gateway API key]" \
|
||||
"--deepinfra-api-key[DeepInfra API key]" \
|
||||
"--deepseek-api-key[DeepSeek API key]" \
|
||||
"--featherless-api-key[Featherless AI API key]" \
|
||||
"--gmi-api-key[GMI Cloud API key]" \
|
||||
"--longcat-api-key[LongCat API key]" \
|
||||
"--groq-api-key[Groq API key]" \
|
||||
"--kilocode-api-key[Kilo Gateway API key]" \
|
||||
"--kimi-code-api-key[Kimi Code API key (subscription)]" \
|
||||
@@ -171,6 +167,119 @@ _openclaw_onboard() {
|
||||
"--fireworks-api-key[Fireworks API key]" \
|
||||
"--moonshot-api-key[Moonshot API key]" \
|
||||
"--tokenhub-api-key[Tencent TokenHub API key]" \
|
||||
"--tokenplan-api-key[Tencent TokenPlan API key]" \
|
||||
"--venice-api-key[Venice API key]" \
|
||||
"--ai-gateway-api-key[Vercel AI Gateway API key]" \
|
||||
"--zai-api-key[Z.AI API key]" \
|
||||
"--stepfun-api-key[StepFun API key]" \
|
||||
"--custom-base-url[Custom provider base URL]" \
|
||||
"--custom-api-key[Custom provider API key (optional)]" \
|
||||
"--custom-model-id[Custom provider model ID]" \
|
||||
"--custom-provider-id[Custom provider ID (optional; auto-derived by default)]" \
|
||||
"--custom-compatibility[Custom provider API compatibility: openai|openai-responses|anthropic (default: openai)]" \
|
||||
"--custom-image-input[Mark the custom provider model as image-capable]" \
|
||||
"--custom-text-input[Mark the custom provider model as text-only]" \
|
||||
"--gateway-port[Gateway port]" \
|
||||
"--gateway-bind[Gateway bind: loopback|tailnet|lan|auto|custom]" \
|
||||
"--gateway-auth[Gateway auth: token|password]" \
|
||||
"--gateway-token[Gateway token (token auth)]" \
|
||||
"--gateway-token-ref-env[Gateway token SecretRef env var name (token auth; e.g. OPENCLAW_GATEWAY_TOKEN)]" \
|
||||
"--gateway-password[Gateway password (password auth)]" \
|
||||
"--tailscale[Tailscale: off|serve|funnel]" \
|
||||
"--tailscale-reset-on-exit[Reset tailscale serve/funnel on exit]" \
|
||||
"--install-daemon[Install gateway service]" \
|
||||
"--no-install-daemon[Skip gateway service install]" \
|
||||
"--skip-daemon[Skip gateway service install]" \
|
||||
"--daemon-runtime[Daemon runtime: node]" \
|
||||
"--skip-channels[Skip channel setup]" \
|
||||
"--skip-skills[Skip skills setup]" \
|
||||
"--skip-bootstrap[Skip creating default agent workspace files]" \
|
||||
"--skip-search[Skip search provider setup]" \
|
||||
"--skip-health[Skip health check]" \
|
||||
"--skip-ui[Skip Control UI/TUI launch]" \
|
||||
"--suppress-gateway-token-output[Suppress token-bearing Gateway/UI output]" \
|
||||
"--skip-hooks[Accepted for onboard compatibility; hooks setup is skipped]" \
|
||||
"--node-manager[Node manager for skills: npm|pnpm|bun]" \
|
||||
"--import-from[Migration provider to run during onboarding]" \
|
||||
"--import-source[Source agent home for --import-from]" \
|
||||
"--import-secrets[Import supported secrets during onboarding migration]" \
|
||||
"--remote-url[Remote Gateway WebSocket URL]" \
|
||||
"--remote-token[Remote Gateway token (optional)]" \
|
||||
"--json[Output JSON summary]"
|
||||
}
|
||||
|
||||
_openclaw_onboard() {
|
||||
_arguments -C \
|
||||
"--workspace[Agent workspace directory (default: ~/.openclaw/workspace)]" \
|
||||
"--reset[Reset config + credentials + sessions before running onboard (workspace only with --reset-scope full)]" \
|
||||
"--reset-scope[Reset scope: config|config+creds+sessions|full]" \
|
||||
"--non-interactive[Run without prompts]" \
|
||||
"--modern[Alias for the default bootstrap onboarding (kept for compatibility)]" \
|
||||
"--classic[Use the classic multi-step setup wizard]" \
|
||||
"--accept-risk[Acknowledge that agents are powerful and full system access is risky (required for --non-interactive)]" \
|
||||
"--flow[Onboard flow: quickstart|advanced|manual|import]" \
|
||||
"--mode[Onboard mode: local|remote]" \
|
||||
"--auth-choice[Auth: custom-api-key|skip|claude-cli|apiKey|anthropic-cli|setup-token|arceeai-api-key|byteplus-api-key|cerebras-api-key|openai-device-code|openai|chutes|chutes-api-key|clawrouter-api-key|cloudflare-ai-gateway-api-key|zai-cn|codex|qwen-api-key-cn|qwen-api-key|zai-coding-cn|zai-coding-global|cohere-api-key|copilot-proxy|deepinfra-api-key|deepseek-api-key|featherless-api-key|fireworks-api-key|google-gemini-cli|github-copilot|zai-global|gmi-api-key|gemini-api-key|google-vertex-api-key|groq-api-key|huggingface-api-key|kilocode-api-key|kimi-code-api-key|litellm-api-key|lmstudio|longcat-api-key|meta-api-key|microsoft-foundry-apikey|microsoft-foundry-entra|minimax-cn-api|minimax-global-api|minimax-cn-oauth|minimax-global-oauth|mistral-api-key|moonshot-api-key|moonshot-api-key-cn|novita-api-key|nvidia-api-key|ollama|ollama-cloud|openai-api-key|opencode-go|opencode-zen|arceeai-openrouter|openrouter-api-key|openrouter-oauth|qianfan-api-key|qwen-oauth|sglang|qwen-standard-api-key-cn|qwen-standard-api-key|stepfun-standard-api-key-cn|stepfun-standard-api-key-intl|stepfun-plan-api-key-cn|stepfun-plan-api-key-intl|synthetic-api-key|tokenhub-api-key|tokenplan-api-key|together-api-key|venice-api-key|ai-gateway-api-key|vllm|volcengine-api-key|xai-api-key|xai-device-code|xai-oauth|xiaomi-api-key|xiaomi-token-plan-cn|xiaomi-token-plan-ams|xiaomi-token-plan-sgp|zai-api-key]" \
|
||||
"--token-provider[Token provider id (non-interactive; used with --auth-choice token)]" \
|
||||
"--token[Token value (non-interactive; used with --auth-choice token)]" \
|
||||
"--token-profile-id[Auth profile id (non-interactive; default: <provider>:manual)]" \
|
||||
"--token-expires-in[Optional token expiry duration (e.g. 365d, 12h)]" \
|
||||
"--secret-input-mode[API key persistence mode: plaintext|ref (default: plaintext)]" \
|
||||
"--cloudflare-ai-gateway-account-id[Cloudflare Account ID]" \
|
||||
"--cloudflare-ai-gateway-gateway-id[Cloudflare AI Gateway ID]" \
|
||||
"--alibaba-model-studio-api-key[Alibaba Model Studio API key]" \
|
||||
"--anthropic-api-key[Anthropic API key]" \
|
||||
"--byteplus-api-key[BytePlus API key]" \
|
||||
"--clawrouter-api-key[ClawRouter proxy key]" \
|
||||
"--cohere-api-key[Cohere API key]" \
|
||||
"--comfy-api-key[Comfy Cloud API key]" \
|
||||
"--fal-api-key[fal API key]" \
|
||||
"--github-copilot-token[GitHub Copilot OAuth token]" \
|
||||
"--gemini-api-key[Gemini API key]" \
|
||||
"--huggingface-api-key[Hugging Face API key (HF token)]" \
|
||||
"--litellm-api-key[LiteLLM API key]" \
|
||||
"--lmstudio-api-key[LM Studio API key]" \
|
||||
"--meta-api-key[Meta API key]" \
|
||||
"--minimax-api-key[MiniMax API key]" \
|
||||
"--mistral-api-key[Mistral API key]" \
|
||||
"--novita-api-key[NovitaAI API key]" \
|
||||
"--nvidia-api-key[NVIDIA API key]" \
|
||||
"--ollama-cloud-api-key[Ollama Cloud API key]" \
|
||||
"--openai-api-key[OpenAI API Key]" \
|
||||
"--opencode-zen-api-key[OpenCode API key (Zen catalog)]" \
|
||||
"--opencode-go-api-key[OpenCode API key (Go catalog)]" \
|
||||
"--openrouter-api-key[OpenRouter API key]" \
|
||||
"--runway-api-key[Runway API key]" \
|
||||
"--synthetic-api-key[Synthetic API key]" \
|
||||
"--together-api-key[Together AI API key]" \
|
||||
"--volcengine-api-key[Volcano Engine API key]" \
|
||||
"--vydra-api-key[Vydra API key]" \
|
||||
"--xai-api-key[xAI API key]" \
|
||||
"--xiaomi-api-key[Xiaomi MiMo pay-as-you-go API key]" \
|
||||
"--xiaomi-token-plan-api-key[Xiaomi MiMo Token Plan API key]" \
|
||||
"--arceeai-api-key[Arcee AI API key]" \
|
||||
"--cerebras-api-key[Cerebras API key]" \
|
||||
"--chutes-api-key[Chutes API key]" \
|
||||
"--cloudflare-ai-gateway-api-key[Cloudflare AI Gateway API key]" \
|
||||
"--deepinfra-api-key[DeepInfra API key]" \
|
||||
"--deepseek-api-key[DeepSeek API key]" \
|
||||
"--featherless-api-key[Featherless AI API key]" \
|
||||
"--gmi-api-key[GMI Cloud API key]" \
|
||||
"--longcat-api-key[LongCat API key]" \
|
||||
"--groq-api-key[Groq API key]" \
|
||||
"--kilocode-api-key[Kilo Gateway API key]" \
|
||||
"--kimi-code-api-key[Kimi Code API key (subscription)]" \
|
||||
"--pixverse-api-key[PixVerse API key]" \
|
||||
"--qianfan-api-key[QIANFAN API key]" \
|
||||
"--modelstudio-standard-api-key-cn[Qwen Cloud standard API key (China)]" \
|
||||
"--modelstudio-standard-api-key[Qwen Cloud standard API key (Global/Intl)]" \
|
||||
"--modelstudio-api-key-cn[Qwen Cloud Coding Plan API key (China)]" \
|
||||
"--modelstudio-api-key[Qwen Cloud Coding Plan API key (Global/Intl)]" \
|
||||
"--qwen-oauth-token[Qwen OAuth token]" \
|
||||
"--fireworks-api-key[Fireworks API key]" \
|
||||
"--moonshot-api-key[Moonshot API key]" \
|
||||
"--tokenhub-api-key[Tencent TokenHub API key]" \
|
||||
"--tokenplan-api-key[Tencent TokenPlan API key]" \
|
||||
"--venice-api-key[Venice API key]" \
|
||||
"--ai-gateway-api-key[Vercel AI Gateway API key]" \
|
||||
"--zai-api-key[Z.AI API key]" \
|
||||
@@ -195,7 +304,7 @@ _openclaw_onboard() {
|
||||
"--install-daemon[Install gateway service]" \
|
||||
"--no-install-daemon[Skip gateway service install]" \
|
||||
"--skip-daemon[Skip gateway service install]" \
|
||||
"--daemon-runtime[Daemon runtime: node|bun]" \
|
||||
"--daemon-runtime[Daemon runtime: node]" \
|
||||
"--skip-channels[Skip channel setup]" \
|
||||
"--skip-skills[Skip skills setup]" \
|
||||
"--skip-bootstrap[Skip creating default agent workspace files]" \
|
||||
@@ -431,6 +540,7 @@ _openclaw_doctor() {
|
||||
"--post-upgrade[Emit plugin-compat findings only (machine-readable with --json)]" \
|
||||
"--json[With --lint or --post-upgrade: emit machine-readable JSON output]" \
|
||||
"--severity-min[With --lint: drop findings below this severity (info|warning|error)]" \
|
||||
"--all[With --lint: run all registered checks, including opt-in checks]" \
|
||||
"--skip[With --lint: skip a specific check id (repeatable)]" \
|
||||
"--only[With --lint: run only the specified check id (repeatable)]"
|
||||
}
|
||||
@@ -1358,6 +1468,20 @@ _openclaw_agents() {
|
||||
esac
|
||||
}
|
||||
|
||||
_openclaw_audit() {
|
||||
_arguments -C \
|
||||
"--agent[Filter by agent id]" \
|
||||
"--session[Filter by exact session key]" \
|
||||
"--run[Filter by run id]" \
|
||||
"--kind[Filter by kind (agent_run or tool_action)]" \
|
||||
"--status[Filter by status (started, succeeded, failed, cancelled, timed_out, blocked, unknown)]" \
|
||||
"--after[Include records at/after ISO time or Unix milliseconds]" \
|
||||
"--before[Include records at/before ISO time or Unix milliseconds]" \
|
||||
"--cursor[Continue from a previous result cursor]" \
|
||||
"--limit[Maximum records (1-500)]" \
|
||||
"--json[Output a bounded JSON page]"
|
||||
}
|
||||
|
||||
_openclaw_status() {
|
||||
_arguments -C \
|
||||
"--json[Output JSON instead of text]" \
|
||||
@@ -1429,7 +1553,7 @@ _openclaw_sessions_compact() {
|
||||
"--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
|
||||
"--token[Gateway token (if required)]" \
|
||||
"--password[Gateway password (password auth)]" \
|
||||
"--timeout[RPC timeout in milliseconds (summarization can be slow)]" \
|
||||
"--timeout[RPC timeout in milliseconds (defaults to no client deadline)]" \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
@@ -1670,7 +1794,7 @@ _openclaw_gateway_status() {
|
||||
_openclaw_gateway_install() {
|
||||
_arguments -C \
|
||||
"--port[Gateway port]" \
|
||||
"--runtime[Daemon runtime (node|bun). Default: node]" \
|
||||
"--runtime[Daemon runtime (node). Default: node]" \
|
||||
"--token[Gateway token (token auth)]" \
|
||||
"--wrapper[Executable wrapper for generated service ProgramArguments]" \
|
||||
"--force[Reinstall/overwrite if already installed]" \
|
||||
@@ -1696,9 +1820,9 @@ _openclaw_gateway_stop() {
|
||||
_openclaw_gateway_restart() {
|
||||
_arguments -C \
|
||||
"--force[Restart immediately without waiting for active gateway work]" \
|
||||
"--safe[Request an OpenClaw-aware restart after active work drains]" \
|
||||
"--safe[Request an OpenClaw-aware restart after active work drains (bounded wait; may force after gateway.reload.deferralTimeoutMs expires; set deferralTimeoutMs=0 for indefinite wait)]" \
|
||||
"--skip-deferral[Bypass the safe-restart deferral gate; requires --safe]" \
|
||||
"--wait[Wait duration before forcing restart (ms, 10s, 5m; 0 waits indefinitely)]" \
|
||||
"--wait[Wait duration before restart (ms, 10s, 5m; 0 waits indefinitely). For non-safe restarts (plain restart); not compatible with --force or --safe]" \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
@@ -1867,7 +1991,7 @@ _openclaw_daemon_status() {
|
||||
_openclaw_daemon_install() {
|
||||
_arguments -C \
|
||||
"--port[Gateway port]" \
|
||||
"--runtime[Daemon runtime (node|bun). Default: node]" \
|
||||
"--runtime[Daemon runtime (node). Default: node]" \
|
||||
"--token[Gateway token (token auth)]" \
|
||||
"--wrapper[Executable wrapper for generated service ProgramArguments]" \
|
||||
"--force[Reinstall/overwrite if already installed]" \
|
||||
@@ -1893,9 +2017,9 @@ _openclaw_daemon_stop() {
|
||||
_openclaw_daemon_restart() {
|
||||
_arguments -C \
|
||||
"--force[Restart immediately without waiting for active gateway work]" \
|
||||
"--safe[Request an OpenClaw-aware restart after active work drains]" \
|
||||
"--safe[Request an OpenClaw-aware restart after active work drains (bounded wait; may force after gateway.reload.deferralTimeoutMs expires; set deferralTimeoutMs=0 for indefinite wait)]" \
|
||||
"--skip-deferral[Bypass the safe-restart deferral gate; requires --safe]" \
|
||||
"--wait[Wait duration before forcing restart (ms, 10s, 5m; 0 waits indefinitely)]" \
|
||||
"--wait[Wait duration before restart (ms, 10s, 5m; 0 waits indefinitely). For non-safe restarts (plain restart); not compatible with --force or --safe]" \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
@@ -2334,6 +2458,36 @@ _openclaw_models() {
|
||||
esac
|
||||
}
|
||||
|
||||
_openclaw_promos_list() {
|
||||
_arguments -C \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
_openclaw_promos_claim() {
|
||||
_arguments -C \
|
||||
"--api-key[Provider API key for non-interactive setup]" \
|
||||
"--set-default[Set the promotion's suggested model as default without asking]"
|
||||
}
|
||||
|
||||
_openclaw_promos() {
|
||||
local -a commands
|
||||
local -a options
|
||||
|
||||
_arguments -C \
|
||||
\
|
||||
"1: :_values 'command' 'list[List active promotions]' 'claim[Claim a promotion: set up provider auth and register its models]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $state in
|
||||
(args)
|
||||
case $line[1] in
|
||||
(list) _openclaw_promos_list ;;
|
||||
(claim) _openclaw_promos_claim ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_openclaw_infer_list() {
|
||||
_arguments -C \
|
||||
"--json[Output JSON]"
|
||||
@@ -3274,6 +3428,7 @@ _openclaw_node_run() {
|
||||
_arguments -C \
|
||||
"--host[Gateway host]" \
|
||||
"--port[Gateway port]" \
|
||||
"--context-path[Gateway WebSocket context path (e.g. /openclaw-gw)]" \
|
||||
"--tls[Use TLS for the gateway connection]" \
|
||||
"--tls-fingerprint[Expected TLS certificate fingerprint (sha256)]" \
|
||||
"--node-id[Override node id (clears pairing token)]" \
|
||||
@@ -3289,11 +3444,12 @@ _openclaw_node_install() {
|
||||
_arguments -C \
|
||||
"--host[Gateway host]" \
|
||||
"--port[Gateway port]" \
|
||||
"--context-path[Gateway WebSocket context path (e.g. /openclaw-gw)]" \
|
||||
"--tls[Use TLS for the gateway connection]" \
|
||||
"--tls-fingerprint[Expected TLS certificate fingerprint (sha256)]" \
|
||||
"--node-id[Override node id (clears pairing token)]" \
|
||||
"--display-name[Override node display name]" \
|
||||
"--runtime[Service runtime (node|bun). Default: node]" \
|
||||
"--runtime[Service runtime (node). Default: node]" \
|
||||
"--force[Reinstall/overwrite if already installed]" \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
@@ -3384,6 +3540,64 @@ _openclaw_sandbox() {
|
||||
esac
|
||||
}
|
||||
|
||||
_openclaw_worktrees_list() {
|
||||
_arguments -C \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
_openclaw_worktrees_create() {
|
||||
_arguments -C \
|
||||
"--name[Managed worktree name]" \
|
||||
"--base-ref[Git ref to branch from]" \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
_openclaw_worktrees_remove() {
|
||||
_arguments -C \
|
||||
"--force[Remove even if snapshot creation fails]" \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
_openclaw_worktrees_restore() {
|
||||
_arguments -C \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
_openclaw_worktrees_gc() {
|
||||
_arguments -C \
|
||||
"--json[Output JSON]"
|
||||
}
|
||||
|
||||
_openclaw_worktrees() {
|
||||
local -a commands
|
||||
local -a options
|
||||
|
||||
_arguments -C \
|
||||
\
|
||||
"1: :_values 'command' 'list[List active and restorable managed worktrees]' 'create[Create a managed worktree]' 'remove[Snapshot and remove a managed worktree]' 'restore[Restore a managed worktree from its snapshot]' 'gc[Run managed worktree cleanup now]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $state in
|
||||
(args)
|
||||
case $line[1] in
|
||||
(list) _openclaw_worktrees_list ;;
|
||||
(create) _openclaw_worktrees_create ;;
|
||||
(remove) _openclaw_worktrees_remove ;;
|
||||
(restore) _openclaw_worktrees_restore ;;
|
||||
(gc) _openclaw_worktrees_gc ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_openclaw_attach() {
|
||||
_arguments -C \
|
||||
"--session[Gateway session key to bind (default: main session)]" \
|
||||
"--ttl[Grant TTL in milliseconds (default: gateway policy)]" \
|
||||
"--bin[Claude Code binary to spawn]" \
|
||||
"--print-config[Mint the grant + write the .mcp.json, print how to launch it, and exit without spawning]"
|
||||
}
|
||||
|
||||
_openclaw_tui() {
|
||||
_arguments -C \
|
||||
"--local[Run against the local embedded agent runtime]" \
|
||||
@@ -3421,6 +3635,8 @@ _openclaw_cron_list() {
|
||||
_openclaw_cron_add() {
|
||||
_arguments -C \
|
||||
"--name[Job name]" \
|
||||
"--declaration-key[Idempotent declaration identity key]" \
|
||||
"--display-name[Human-readable declarative job label]" \
|
||||
"--description[Optional description]" \
|
||||
"--disabled[Create job disabled]" \
|
||||
"--delete-after-run[Delete one-shot job after it succeeds]" \
|
||||
@@ -3432,9 +3648,13 @@ _openclaw_cron_add() {
|
||||
"--at[Run once at time (ISO with offset, or +duration). Use --tz for offset-less datetimes]" \
|
||||
"--every[Run every duration (e.g. 10m, 1h)]" \
|
||||
"--cron[Cron expression (5-field or 6-field with seconds)]" \
|
||||
"--on-exit[Fire once when this watched command exits (event trigger; survives turn teardown)]" \
|
||||
"--on-exit-cwd[Working directory for the --on-exit watched command]" \
|
||||
"--tz[Timezone for cron expressions (IANA; cron default: Gateway host local timezone)]" \
|
||||
"--stagger[Cron stagger window (e.g. 30s, 5m)]" \
|
||||
"--exact[Disable cron staggering (set stagger to 0)]" \
|
||||
"(--trigger-script ->)"{--trigger-script,->}"[Condition script file, or - for stdin]" \
|
||||
"--trigger-once[Disable after the first successful triggered run]" \
|
||||
"--system-event[System event payload (main session)]" \
|
||||
"--message[Agent message payload]" \
|
||||
"--command[Command payload run as sh -lc <shell> on the Gateway]" \
|
||||
@@ -3442,7 +3662,7 @@ _openclaw_cron_add() {
|
||||
"--command-cwd[Working directory for command payloads]" \
|
||||
"--command-env[Environment override for command payloads (repeatable)]" \
|
||||
"--command-input[stdin for command payloads]" \
|
||||
"--thinking[Thinking level for agent jobs (off|minimal|low|medium|high|xhigh)]" \
|
||||
"--thinking[Thinking level for agent jobs (off|minimal|low|medium|high|xhigh|adaptive|max|ultra)]" \
|
||||
"--model[Model override for agent jobs (provider/model or alias)]" \
|
||||
"--fallbacks[Fallback model list for agent jobs]" \
|
||||
"--timeout-seconds[Timeout seconds for agent or command jobs]" \
|
||||
@@ -3551,6 +3771,9 @@ _openclaw_cron_edit() {
|
||||
"--tz[Timezone for cron expressions (IANA; cron default: Gateway host local timezone)]" \
|
||||
"--stagger[Cron stagger window (e.g. 30s, 5m)]" \
|
||||
"--exact[Disable cron staggering (set stagger to 0)]" \
|
||||
"(--trigger-script ->)"{--trigger-script,->}"[Set condition script from file, or - for stdin]" \
|
||||
"--trigger-once[Disable after the first successful triggered run]" \
|
||||
"--clear-trigger[Remove the condition trigger]" \
|
||||
"--system-event[Set systemEvent payload]" \
|
||||
"--message[Set agentTurn payload message]" \
|
||||
"--command[Set command payload run as sh -lc <shell> on the Gateway]" \
|
||||
@@ -3558,7 +3781,8 @@ _openclaw_cron_edit() {
|
||||
"--command-cwd[Set command payload working directory]" \
|
||||
"--command-env[Set command payload environment overrides (repeatable)]" \
|
||||
"--command-input[Set command payload stdin]" \
|
||||
"--thinking[Thinking level for agent jobs (off|minimal|low|medium|high|xhigh)]" \
|
||||
"--thinking[Thinking level for agent jobs (off|minimal|low|medium|high|xhigh|adaptive|max|ultra)]" \
|
||||
"--clear-thinking[Remove the per-job thinking override (restore normal cron thinking precedence)]" \
|
||||
"--model[Model override for agent jobs]" \
|
||||
"--fallbacks[Fallback model list for agent jobs]" \
|
||||
"--clear-fallbacks[Remove per-job fallback override]" \
|
||||
@@ -3606,7 +3830,7 @@ _openclaw_cron() {
|
||||
|
||||
_arguments -C \
|
||||
\
|
||||
"1: :_values 'command' 'status[Show cron scheduler status]' 'list[List cron jobs]' 'add[Add a cron job]' 'rm[Remove a cron job]' 'enable[Enable a cron job]' 'disable[Disable a cron job]' 'get[Get a cron job as JSON]' 'show[Show a cron job]' 'runs[Show cron run history]' 'run[Run a cron job now (debug)]' 'edit[Edit a cron job (patch fields)]'" \
|
||||
"1: :_values 'command' 'status[Show cron scheduler status]' 'list[List cron jobs]' 'add[Add a cron job]' 'create[Add a cron job]' 'rm[Remove a cron job]' 'remove[Remove a cron job]' 'delete[Remove a cron job]' 'enable[Enable a cron job]' 'disable[Disable a cron job]' 'get[Get a cron job as JSON]' 'show[Show a cron job]' 'runs[Show cron run history]' 'run[Run a cron job now (debug)]' 'edit[Edit a cron job (patch fields)]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $state in
|
||||
@@ -3614,8 +3838,8 @@ _openclaw_cron() {
|
||||
case $line[1] in
|
||||
(status) _openclaw_cron_status ;;
|
||||
(list) _openclaw_cron_list ;;
|
||||
(add) _openclaw_cron_add ;;
|
||||
(rm) _openclaw_cron_rm ;;
|
||||
(add|create) _openclaw_cron_add ;;
|
||||
(rm|remove|delete) _openclaw_cron_rm ;;
|
||||
(enable) _openclaw_cron_enable ;;
|
||||
(disable) _openclaw_cron_disable ;;
|
||||
(get) _openclaw_cron_get ;;
|
||||
@@ -3930,14 +4154,14 @@ _openclaw_clawbot() {
|
||||
|
||||
_openclaw_pairing_list() {
|
||||
_arguments -C \
|
||||
"--channel[Channel ()]" \
|
||||
"--channel[Channel (none configured)]" \
|
||||
"--account[Account id (for multi-account channels)]" \
|
||||
"--json[Print JSON]"
|
||||
}
|
||||
|
||||
_openclaw_pairing_approve() {
|
||||
_arguments -C \
|
||||
"--channel[Channel ()]" \
|
||||
"--channel[Channel (none configured)]" \
|
||||
"--account[Account id (for multi-account channels)]" \
|
||||
"--notify[Notify the requester on the same channel]"
|
||||
}
|
||||
@@ -4005,6 +4229,7 @@ _openclaw_plugins_install() {
|
||||
"--force[Overwrite an existing installed plugin or hook pack]" \
|
||||
"--pin[Record npm installs as exact resolved <name>@<version>]" \
|
||||
"--dangerously-force-unsafe-install[Deprecated no-op; security.installPolicy may still block]" \
|
||||
"--acknowledge-clawhub-risk[Acknowledge ClawHub release trust warnings without prompting]" \
|
||||
"--marketplace[Install a Claude marketplace plugin from a local repo/path or git/GitHub source]"
|
||||
}
|
||||
|
||||
@@ -4012,7 +4237,8 @@ _openclaw_plugins_update() {
|
||||
_arguments -C \
|
||||
"--all[Update all tracked plugins and hook packs]" \
|
||||
"--dry-run[Show what would change without writing]" \
|
||||
"--dangerously-force-unsafe-install[Deprecated no-op; security.installPolicy may still block]"
|
||||
"--dangerously-force-unsafe-install[Deprecated no-op; security.installPolicy may still block]" \
|
||||
"--acknowledge-clawhub-risk[Acknowledge ClawHub release trust warnings without prompting]"
|
||||
}
|
||||
|
||||
_openclaw_plugins_registry() {
|
||||
@@ -4043,9 +4269,26 @@ _openclaw_plugins_init() {
|
||||
_arguments -C \
|
||||
"--directory[Output directory]" \
|
||||
"--name[Display name]" \
|
||||
"--type[Scaffold type (tool or provider)]" \
|
||||
"--force[Overwrite an existing output directory]"
|
||||
}
|
||||
|
||||
_openclaw_plugins_marketplace_entries() {
|
||||
_arguments -C \
|
||||
"--feed-profile[Configured marketplace feed profile to list]" \
|
||||
"--feed-url[Explicit hosted marketplace feed URL]" \
|
||||
"--offline[Read the latest accepted snapshot without fetching the feed]" \
|
||||
"--json[Print JSON]"
|
||||
}
|
||||
|
||||
_openclaw_plugins_marketplace_refresh() {
|
||||
_arguments -C \
|
||||
"--feed-profile[Configured marketplace feed profile to refresh]" \
|
||||
"--feed-url[Explicit hosted marketplace feed URL]" \
|
||||
"--expected-sha256[Expected hosted feed SHA-256 payload checksum]" \
|
||||
"--json[Print JSON]"
|
||||
}
|
||||
|
||||
_openclaw_plugins_marketplace_list() {
|
||||
_arguments -C \
|
||||
"--json[Print JSON]"
|
||||
@@ -4057,12 +4300,14 @@ _openclaw_plugins_marketplace() {
|
||||
|
||||
_arguments -C \
|
||||
\
|
||||
"1: :_values 'command' 'list[List plugins published by a marketplace source]'" \
|
||||
"1: :_values 'command' 'entries[List entries from the configured OpenClaw marketplace feed]' 'refresh[Refresh the configured OpenClaw marketplace feed snapshot]' 'list[List plugins published by a marketplace source]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $state in
|
||||
(args)
|
||||
case $line[1] in
|
||||
(entries) _openclaw_plugins_marketplace_entries ;;
|
||||
(refresh) _openclaw_plugins_marketplace_refresh ;;
|
||||
(list) _openclaw_plugins_marketplace_list ;;
|
||||
esac
|
||||
;;
|
||||
@@ -4075,7 +4320,7 @@ _openclaw_plugins() {
|
||||
|
||||
_arguments -C \
|
||||
\
|
||||
"1: :_values 'command' 'list[List discovered plugins]' 'search[Search ClawHub plugin packages]' 'inspect[Inspect plugin details]' 'enable[Enable a plugin in config]' 'disable[Disable a plugin in config]' 'uninstall[Uninstall a plugin]' 'install[Install a plugin or hook pack (path, archive, npm spec, git repo, clawhub:package, or marketplace entry)]' 'update[Update installed plugins and tracked hook packs]' 'registry[Inspect or rebuild the persisted plugin registry]' 'doctor[Report plugin load issues]' 'build[Generate simple tool plugin metadata]' 'validate[Validate simple tool plugin metadata]' 'init[Create a simple tool plugin project]' 'marketplace[Inspect Claude-compatible plugin marketplaces]'" \
|
||||
"1: :_values 'command' 'list[List discovered plugins]' 'search[Search ClawHub plugin packages]' 'inspect[Inspect plugin details]' 'info[Inspect plugin details]' 'enable[Enable a plugin in config]' 'disable[Disable a plugin in config]' 'uninstall[Uninstall a plugin]' 'install[Install a plugin or hook pack (path, archive, npm spec, git repo, clawhub:package, or marketplace entry)]' 'update[Update installed plugins and tracked hook packs]' 'registry[Inspect or rebuild the persisted plugin registry]' 'doctor[Report plugin load issues]' 'build[Generate simple tool plugin metadata]' 'validate[Validate simple tool plugin metadata]' 'init[Create a plugin project]' 'marketplace[Inspect Claude-compatible plugin marketplaces]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $state in
|
||||
@@ -4083,7 +4328,7 @@ _openclaw_plugins() {
|
||||
case $line[1] in
|
||||
(list) _openclaw_plugins_list ;;
|
||||
(search) _openclaw_plugins_search ;;
|
||||
(inspect) _openclaw_plugins_inspect ;;
|
||||
(inspect|info) _openclaw_plugins_inspect ;;
|
||||
(enable) _openclaw_plugins_enable ;;
|
||||
(disable) _openclaw_plugins_disable ;;
|
||||
(uninstall) _openclaw_plugins_uninstall ;;
|
||||
@@ -4394,6 +4639,7 @@ _openclaw_skills_install() {
|
||||
"--version[Install a specific version]" \
|
||||
"--force[Overwrite an existing workspace skill]" \
|
||||
"--force-install[Install a pending GitHub-backed skill before ClawHub scan completes]" \
|
||||
"--acknowledge-clawhub-risk[Acknowledge ClawHub release trust warnings without prompting]" \
|
||||
"--global[Install into the shared managed skills directory]" \
|
||||
"--agent[Target agent workspace (defaults to cwd-inferred, then default agent)]" \
|
||||
"--as[Install a git/local skill under this slug]"
|
||||
@@ -4403,6 +4649,7 @@ _openclaw_skills_update() {
|
||||
_arguments -C \
|
||||
"--all[Update all tracked ClawHub skills]" \
|
||||
"--force-install[Install a pending GitHub-backed skill before ClawHub scan completes]" \
|
||||
"--acknowledge-clawhub-risk[Acknowledge ClawHub release trust warnings without prompting]" \
|
||||
"--global[Update skills in the shared managed skills directory]" \
|
||||
"--agent[Target agent workspace (defaults to cwd-inferred, then default agent)]"
|
||||
}
|
||||
@@ -4416,6 +4663,47 @@ _openclaw_skills_verify() {
|
||||
"--agent[Target agent workspace (defaults to cwd-inferred, then default agent)]"
|
||||
}
|
||||
|
||||
_openclaw_skills_curator_status() {
|
||||
_arguments -C \
|
||||
|
||||
}
|
||||
|
||||
_openclaw_skills_curator_pin() {
|
||||
_arguments -C \
|
||||
|
||||
}
|
||||
|
||||
_openclaw_skills_curator_unpin() {
|
||||
_arguments -C \
|
||||
|
||||
}
|
||||
|
||||
_openclaw_skills_curator_restore() {
|
||||
_arguments -C \
|
||||
|
||||
}
|
||||
|
||||
_openclaw_skills_curator() {
|
||||
local -a commands
|
||||
local -a options
|
||||
|
||||
_arguments -C \
|
||||
"--json[Output as JSON]" \
|
||||
"1: :_values 'command' 'status[Show curator run and lifecycle status]' 'pin[pin a curated skill]' 'unpin[unpin a curated skill]' 'restore[restore a curated skill]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $state in
|
||||
(args)
|
||||
case $line[1] in
|
||||
(status) _openclaw_skills_curator_status ;;
|
||||
(pin) _openclaw_skills_curator_pin ;;
|
||||
(unpin) _openclaw_skills_curator_unpin ;;
|
||||
(restore) _openclaw_skills_curator_restore ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_openclaw_skills_workshop_list() {
|
||||
_arguments -C \
|
||||
"--json[Output as JSON]"
|
||||
@@ -4525,7 +4813,7 @@ _openclaw_skills() {
|
||||
|
||||
_arguments -C \
|
||||
"--agent[Target agent workspace (defaults to cwd-inferred, then default agent)]" \
|
||||
"1: :_values 'command' 'search[Search ClawHub skills]' 'install[Install a skill from ClawHub, git, or a local directory]' 'update[Update ClawHub-installed skills in the active or shared managed directory]' 'verify[Verify a ClawHub skill with ClawHub]' 'workshop[Manage pending skill proposals]' 'list[List all available skills]' 'info[Show detailed information about a skill]' 'check[Check which skills are ready, visible, or missing requirements]'" \
|
||||
"1: :_values 'command' 'search[Search ClawHub skills]' 'install[Install a skill from ClawHub, git, or a local directory]' 'update[Update ClawHub-installed skills in the active or shared managed directory]' 'verify[Verify a ClawHub skill with ClawHub]' 'curator[Inspect and manage skill lifecycle curation]' 'workshop[Manage pending skill proposals]' 'list[List all available skills]' 'info[Show detailed information about a skill]' 'check[Check which skills are ready, visible, or missing requirements]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $state in
|
||||
@@ -4535,6 +4823,7 @@ _openclaw_skills() {
|
||||
(install) _openclaw_skills_install ;;
|
||||
(update) _openclaw_skills_update ;;
|
||||
(verify) _openclaw_skills_verify ;;
|
||||
(curator) _openclaw_skills_curator ;;
|
||||
(workshop) _openclaw_skills_workshop ;;
|
||||
(list) _openclaw_skills_list ;;
|
||||
(info) _openclaw_skills_info ;;
|
||||
@@ -4550,6 +4839,7 @@ _openclaw_update_repair() {
|
||||
"--channel[Persist update channel before repair]" \
|
||||
"--timeout[Timeout for update repair steps in seconds (default: 1800)]" \
|
||||
"--yes[Skip confirmation prompts (non-interactive)]" \
|
||||
"--acknowledge-clawhub-risk[Acknowledge ClawHub release trust warnings during post-update plugin sync]" \
|
||||
"--no-restart[Accepted for update command parity; repair never restarts]"
|
||||
}
|
||||
|
||||
@@ -4559,6 +4849,7 @@ _openclaw_update_finalize() {
|
||||
"--channel[Persist update channel before repair]" \
|
||||
"--timeout[Timeout for update repair steps in seconds (default: 1800)]" \
|
||||
"--yes[Skip confirmation prompts (non-interactive)]" \
|
||||
"--acknowledge-clawhub-risk[Acknowledge ClawHub release trust warnings during post-update plugin sync]" \
|
||||
"--no-restart[Accepted for update command parity; repair never restarts]"
|
||||
}
|
||||
|
||||
@@ -4585,6 +4876,7 @@ _openclaw_update() {
|
||||
"--tag[Override the package target for this update (dist-tag, version, or package spec)]" \
|
||||
"--timeout[Timeout for each update step in seconds (default: 1800)]" \
|
||||
"--yes[Skip confirmation prompts (non-interactive)]" \
|
||||
"--acknowledge-clawhub-risk[Acknowledge ClawHub release trust warnings during post-update plugin sync]" \
|
||||
"1: :_values 'command' 'repair[Repair post-update doctor and plugin convergence]' 'finalize[Repair post-update doctor and plugin convergence]' 'wizard[Interactive update wizard]' 'status[Show update channel and version status]'" \
|
||||
"*::arg:->args"
|
||||
|
||||
|
||||
@@ -3,16 +3,12 @@
|
||||
"deviceId": "e8510d8b751c9065aebddecb8951b0283fce5457af923f81b6d4a6bd72d421e7",
|
||||
"tokens": {
|
||||
"operator": {
|
||||
"token": "2720025facf8497986551236793037ea",
|
||||
"token": "qmmu-2Qk84qMJtYcJei6Jw2sQvmGwx0-vgihHe2AhSQ",
|
||||
"role": "operator",
|
||||
"scopes": [
|
||||
"operator.admin",
|
||||
"operator.approvals",
|
||||
"operator.pairing",
|
||||
"operator.read",
|
||||
"operator.write"
|
||||
"operator.read"
|
||||
],
|
||||
"updatedAtMs": 1784020866140
|
||||
"updatedAtMs": 1785811501091
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[
|
||||
"d843ed5f6ccc-im-bot"
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
{"o9cq80w6ZnnPGItW-GGACkwd69bA@im.wechat":"AARzJWAFAAABAAAAAACwkC03GvkHNpngCX1VaiAAAAB+9905Q6UiugPBawU3n3cyzQX+LkN8ofRzsCZYN0mt7g6qUzD08SsL8cLzoGg8wW/YEqFY9U2AumNWhdcESNjzTrIHTVMp"}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"token": "d843ed5f6ccc@im.bot:0600009749b0216cbafb0dced2fc3f3fd977f3",
|
||||
"savedAt": "2026-07-09T09:06:38.981Z",
|
||||
"baseUrl": "https://ilinkai.weixin.qq.com",
|
||||
"userId": "o9cq80w6ZnnPGItW-GGACkwd69bA@im.wechat"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"get_updates_buf":"ChAIDxD928Hv9TMYg7mEsfQzEjpkODQzZWQ1ZjZjY2NAaW0uYm90OjA2MDAwMDk3NDliMDIxNmNiYWZiMGRjZWQyZmMzZjNmZDk3N2Yz"}
|
||||
+44
-251
@@ -1,97 +1,23 @@
|
||||
{
|
||||
"meta": {
|
||||
"lastTouchedVersion": "2026.7.1",
|
||||
"lastTouchedAt": "2026-07-14T07:37:27.451Z"
|
||||
"lastTouchedVersion": "2026.7.1-2",
|
||||
"lastTouchedAt": "2026-08-03T06:44:10.135Z"
|
||||
},
|
||||
"wizard": {
|
||||
"lastRunAt": "2026-07-14T07:37:27.421Z",
|
||||
"lastRunVersion": "2026.7.1",
|
||||
"lastRunAt": "2026-08-03T06:44:10.084Z",
|
||||
"lastRunVersion": "2026.7.1-2",
|
||||
"lastRunCommand": "doctor",
|
||||
"lastRunMode": "local"
|
||||
},
|
||||
"auth": {
|
||||
"profiles": {
|
||||
"ollama:default": {
|
||||
"provider": "ollama",
|
||||
"mode": "api_key"
|
||||
}
|
||||
}
|
||||
"profiles": {}
|
||||
},
|
||||
"models": {
|
||||
"mode": "merge",
|
||||
"providers": {
|
||||
"openai": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"api": "openai-completions"
|
||||
},
|
||||
"ollama": {
|
||||
"baseUrl": "http://127.0.0.1:11434",
|
||||
"apiKey": "OLLAMA_API_KEY",
|
||||
"api": "ollama",
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen3-coder:latest",
|
||||
"name": "qwen3-coder:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"name": "huihui_ai/glm-4.7-flash-abliterated:latest",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 65535,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash:cloud",
|
||||
"name": "DeepSeek V4 Flash (Cloud)",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 0,
|
||||
"output": 0,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 131072,
|
||||
"maxTokens": 8192,
|
||||
"params": {
|
||||
"num_ctx": 131072
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"new-api": {
|
||||
"baseUrl": "http://192.168.2.74:3000/v1",
|
||||
"apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr",
|
||||
"apiKey": "${NEW_API_KEY}",
|
||||
"api": "openai-completions",
|
||||
"request": {
|
||||
"allowPrivateNetwork": true
|
||||
@@ -197,70 +123,15 @@
|
||||
"maxTokens": 32768
|
||||
}
|
||||
]
|
||||
},
|
||||
"deepseek": {
|
||||
"baseUrl": "https://api.deepseek.com/v1",
|
||||
"apiKey": "sk-893b90b270ad4697a0b0b24969964d79",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "deepseek-v4-pro",
|
||||
"name": "DeepSeek V4 Pro",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 1000000,
|
||||
"maxTokens": 384000
|
||||
},
|
||||
{
|
||||
"id": "deepseek-v4-flash",
|
||||
"name": "DeepSeek V4 Flash",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
"text"
|
||||
],
|
||||
"cost": {
|
||||
"input": 1,
|
||||
"output": 2,
|
||||
"cacheRead": 0,
|
||||
"cacheWrite": 0
|
||||
},
|
||||
"contextWindow": 1000000,
|
||||
"maxTokens": 384000
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"agents": {
|
||||
"defaults": {
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
},
|
||||
"memorySearch": {
|
||||
"provider": "openai",
|
||||
"model": "text-embedding-v4"
|
||||
"primary": "new-api/qwen3.5-plus"
|
||||
},
|
||||
"models": {
|
||||
"ollama/huihui_ai/glm-4.7-flash-abliterated:latest": {
|
||||
"alias": "GLM 4.7 Flash(本地)"
|
||||
},
|
||||
"ollama/deepseek-v4-flash:cloud": {
|
||||
"alias": "DeepSeek V4 Flash(云端)"
|
||||
},
|
||||
"deepseek/deepseek-v4-pro": {
|
||||
"alias": "DeepSeek V4 Pro"
|
||||
},
|
||||
"deepseek/deepseek-v4-flash": {
|
||||
"alias": "DeepSeek V4 Flash"
|
||||
},
|
||||
"new-api/deepseek-v4-flash": {
|
||||
"alias": "New Api V4 Flash"
|
||||
},
|
||||
@@ -274,7 +145,7 @@
|
||||
"alias": "New Api GLM 5.1"
|
||||
}
|
||||
},
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace",
|
||||
"workspace": "/root/.openclaw/workspace",
|
||||
"compaction": {
|
||||
"mode": "safeguard"
|
||||
},
|
||||
@@ -283,39 +154,32 @@
|
||||
"subagents": {
|
||||
"maxConcurrent": 4,
|
||||
"allowAgents": [
|
||||
"*"
|
||||
"backend",
|
||||
"frontend",
|
||||
"planner"
|
||||
]
|
||||
},
|
||||
"sandbox": {
|
||||
"mode": "off"
|
||||
},
|
||||
"memorySearch": {
|
||||
"enabled": true,
|
||||
"provider": "openai-compatible",
|
||||
"model": "BAAI/bge-m3",
|
||||
"remote": {
|
||||
"baseUrl": "https://api.siliconflow.cn/v1",
|
||||
"apiKey": "$SILICONFLOW_API_KEY"
|
||||
}
|
||||
}
|
||||
},
|
||||
"list": [
|
||||
{
|
||||
"id": "main",
|
||||
"name": "助手",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/main/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "storage",
|
||||
"name": "仓库",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace-storage",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/storage/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "backend",
|
||||
"name": "后端",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace-backend",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/backend/agent",
|
||||
"workspace": "/root/.openclaw/workspace-backend",
|
||||
"agentDir": "/root/.openclaw/agents/backend/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
"primary": "new-api/qwen3.5-plus"
|
||||
},
|
||||
"tools": {
|
||||
"alsoAllow": [
|
||||
@@ -326,10 +190,10 @@
|
||||
{
|
||||
"id": "frontend",
|
||||
"name": "前端",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace-frontend",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/frontend/agent",
|
||||
"workspace": "/root/.openclaw/workspace-frontend",
|
||||
"agentDir": "/root/.openclaw/agents/frontend/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
"primary": "new-api/qwen3.5-plus"
|
||||
},
|
||||
"tools": {
|
||||
"alsoAllow": [
|
||||
@@ -337,53 +201,17 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "resume",
|
||||
"name": "简历",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace-resume",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/resume/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "travel",
|
||||
"name": "旅行",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace-travel",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/travel/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "planner",
|
||||
"name": "方案",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace-planner",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/planner/agent",
|
||||
"workspace": "/root/.openclaw/workspace-planner",
|
||||
"agentDir": "/root/.openclaw/agents/planner/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
"primary": "new-api/qwen3.5-plus"
|
||||
},
|
||||
"skills": [
|
||||
"using-superpowers"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fitness",
|
||||
"name": "健康",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace-fitness",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/fitness/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "finances",
|
||||
"name": "理财",
|
||||
"workspace": "/home/yangxuan/.openclaw/workspace-finances",
|
||||
"agentDir": "/home/yangxuan/.openclaw/agents/finances/agent",
|
||||
"model": {
|
||||
"primary": "deepseek/deepseek-v4-flash"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -393,7 +221,8 @@
|
||||
"visibility": "all"
|
||||
},
|
||||
"agentToAgent": {
|
||||
"enabled": true
|
||||
"enabled": true,
|
||||
"allow": ["planner", "backend", "frontend"]
|
||||
},
|
||||
"deny": [
|
||||
"group:web",
|
||||
@@ -409,11 +238,7 @@
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"alsoAllow": [
|
||||
"ezviz_device",
|
||||
"ezviz_capture",
|
||||
"ezviz_message"
|
||||
]
|
||||
"alsoAllow": []
|
||||
},
|
||||
"messages": {
|
||||
"ackReactionScope": "group-mentions",
|
||||
@@ -437,8 +262,7 @@
|
||||
"controlUi": {
|
||||
"allowedOrigins": [
|
||||
"http://localhost:18789",
|
||||
"http://127.0.0.1:18789",
|
||||
"https://xuan-pc-nj-wsl.baiji-algieba.ts.net"
|
||||
"http://127.0.0.1:18789"
|
||||
],
|
||||
"allowInsecureAuth": true
|
||||
},
|
||||
@@ -606,27 +430,24 @@
|
||||
},
|
||||
"mcporter": {
|
||||
"enabled": false
|
||||
},
|
||||
"gh-issues": {
|
||||
"enabled": false
|
||||
},
|
||||
"github": {
|
||||
"enabled": false
|
||||
},
|
||||
"video-frames": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"plugins": {
|
||||
"allow": [
|
||||
"deepseek",
|
||||
"ezviz",
|
||||
"memory-core",
|
||||
"ollama",
|
||||
"searxng",
|
||||
"openclaw-weixin",
|
||||
"dingtalk-connector"
|
||||
"searxng"
|
||||
],
|
||||
"entries": {
|
||||
"ollama": {
|
||||
"enabled": true,
|
||||
"config": {}
|
||||
},
|
||||
"deepseek": {
|
||||
"enabled": true
|
||||
},
|
||||
"searxng": {
|
||||
"enabled": true,
|
||||
"config": {
|
||||
@@ -637,40 +458,12 @@
|
||||
},
|
||||
"browser": {
|
||||
"enabled": false
|
||||
},
|
||||
"ezviz": {
|
||||
"enabled": false
|
||||
},
|
||||
"openclaw-weixin": {
|
||||
"enabled": false
|
||||
},
|
||||
"dingtalk-connector": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"bundledDiscovery": "compat"
|
||||
},
|
||||
"channels": {
|
||||
"ezviz": {
|
||||
"enabled": true,
|
||||
"appId": "92aa2d25a04247afacb76b1f75f9cf80",
|
||||
"appSecret": "38ac0b0468b0dca991ce1c8ed888200e"
|
||||
},
|
||||
"openclaw-weixin": {
|
||||
"channelConfigUpdatedAt": "2026-07-09T09:06:39.005Z"
|
||||
},
|
||||
"dingtalk-connector": {
|
||||
"clientId": "dingnumf057etbbowhfu",
|
||||
"clientSecret": "m-g-EknD5uxH9DFnSpHPT87bLWOPrNYa-SMvT6kDOMqg_8nmPL7jiFxbdpWWqzIl"
|
||||
}
|
||||
},
|
||||
"bindings": [
|
||||
{
|
||||
"agentId": "main",
|
||||
"match": {
|
||||
"channel": "openclaw-weixin",
|
||||
"accountId": "d843ed5f6ccc-im-bot"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/home/yangxuan/.openclaw/npm/projects/dingtalk-real-ai-dingtalk-connector-aa54111b45/node_modules/@dingtalk-real-ai/dingtalk-connector/skills/dingtalk-channel-rules
|
||||
@@ -1 +0,0 @@
|
||||
/home/yangxuan/.openclaw/npm/projects/dingtalk-real-ai-dingtalk-connector-aa54111b45/node_modules/@dingtalk-real-ai/dingtalk-connector/skills/dingtalk-troubleshoot
|
||||
@@ -1 +0,0 @@
|
||||
/home/yangxuan/.openclaw/npm/projects/dingtalk-real-ai-dingtalk-connector-aa54111b45/node_modules/@dingtalk-real-ai/dingtalk-connector/skills/dws-cli
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
{"schema":"openclaw.skill-workshop.proposals-manifest.v1","updatedAt":"2026-07-09T09:56:20.877Z","proposals":[{"id":"dianping-review-20260611-d402abec10","kind":"create","status":"applied","title":"Create dianping-review","description":"通过大众点评搜索查询餐厅、老店、美食推荐和评论","skillName":"dianping-review","skillKey":"dianping-review","createdAt":"2026-06-11T23:50:15.731Z","updatedAt":"2026-07-09T09:56:20.865Z","scanState":"clean"},{"id":"calibre-cleaner-20260624-0fc374efd7","kind":"update","status":"applied","title":"Update calibre-cleaner","description":"清洗 Calibre 书库:修复损坏书名/提取作者/检测编码损坏、小文件的批量删除","skillName":"calibre-cleaner","skillKey":"calibre-cleaner","createdAt":"2026-06-24T03:23:27.062Z","updatedAt":"2026-07-09T09:56:20.404Z","scanState":"clean"},{"id":"jellyfin-nfo-builder-20260701-6434352e0d","kind":"create","status":"applied","title":"Create jellyfin-nfo-builder","description":"为剧集整理统一文件名、生成缺失的 Jellyfin .nfo 剧集元数据","skillName":"jellyfin-nfo-builder","skillKey":"jellyfin-nfo-builder","createdAt":"2026-07-01T23:52:24.406Z","updatedAt":"2026-07-09T09:56:19.928Z","scanState":"clean"},{"id":"jav-media-sorter-20260707-b1f90c8a4d","kind":"create","status":"applied","title":"Create jav-media-sorter","description":"JAV 视频整理:组装文件、按演员分组、刮削 nfo 元数据与封面图","skillName":"jav-media-sorter","skillKey":"jav-media-sorter","createdAt":"2026-07-07T12:14:43.074Z","updatedAt":"2026-07-09T09:56:18.413Z","scanState":"clean"},{"id":"f-download-sorter-20260706-902cc0d5aa","kind":"create","status":"applied","title":"Create f-download-sorter","description":"整理 /mnt/f 下下载的视频文件:扫描→清垃圾→按规则归档到7个大类目录","skillName":"f-download-sorter","skillKey":"f-download-sorter","createdAt":"2026-07-06T09:03:54.941Z","updatedAt":"2026-07-06T09:04:18.513Z","scanState":"clean"},{"id":"weekly-report-g5-20260626-7595273f1d","kind":"create","status":"applied","title":"Create weekly-report-g5","description":"维云智造G5周报生成:整理每日工作→多段邮件(纯文本+HTML含签名图)→存入钉邮草稿箱","skillName":"weekly-report-g5","skillKey":"weekly-report-g5","createdAt":"2026-06-26T00:46:22.478Z","updatedAt":"2026-06-26T00:46:35.812Z","scanState":"clean"},{"id":"calibre-cleaner-20260624-cdbeb219a3","kind":"update","status":"applied","title":"Update calibre-cleaner","description":"清洗 Calibre 书库:修复损坏书名/提取作者/检测编码损坏、小文件的批量删除","skillName":"calibre-cleaner","skillKey":"calibre-cleaner","createdAt":"2026-06-24T03:03:28.166Z","updatedAt":"2026-06-24T03:03:30.915Z","scanState":"clean"},{"id":"calibre-cleaner-20260624-a441798af9","kind":"create","status":"applied","title":"Create calibre-cleaner","description":"清洗 Calibre 书库:修复损坏书名/提取作者/检测编码损坏、小文件的批量删除","skillName":"calibre-cleaner","skillKey":"calibre-cleaner","createdAt":"2026-06-24T02:29:02.278Z","updatedAt":"2026-06-24T02:29:27.227Z","scanState":"clean"},{"id":"calibre-title-cleaner-20260624-3760b64e8b","kind":"create","status":"applied","title":"Create calibre-title-cleaner","description":"清洗 Calibre 书库中损坏的 txt 文档书名(HTML标签/长文本/乱码/路径超限修复)","skillName":"calibre-title-cleaner","skillKey":"calibre-title-cleaner","createdAt":"2026-06-24T01:10:56.296Z","updatedAt":"2026-06-24T01:13:39.670Z","scanState":"clean"}]}
|
||||
{"schema":"openclaw.skill-workshop.proposals-manifest.v1","updatedAt":"2026-08-04T09:12:42.079Z","proposals":[{"id":"mica-smdm-scaffold-20260804-af318dd6c2","kind":"create","status":"applied","title":"Create mica-smdm-scaffold","description":"mica 项目 SMDM 模块骨架代码生成规范(含数据字典填充)","skillName":"mica-smdm-scaffold","skillKey":"mica-smdm-scaffold","createdAt":"2026-08-04T08:59:50.395Z","updatedAt":"2026-08-04T09:12:42.043Z","scanState":"clean"},{"id":"dianping-review-20260611-d402abec10","kind":"create","status":"applied","title":"Create dianping-review","description":"通过大众点评搜索查询餐厅、老店、美食推荐和评论","skillName":"dianping-review","skillKey":"dianping-review","createdAt":"2026-06-11T23:50:15.731Z","updatedAt":"2026-07-09T09:56:20.865Z","scanState":"clean"},{"id":"calibre-cleaner-20260624-0fc374efd7","kind":"update","status":"applied","title":"Update calibre-cleaner","description":"清洗 Calibre 书库:修复损坏书名/提取作者/检测编码损坏、小文件的批量删除","skillName":"calibre-cleaner","skillKey":"calibre-cleaner","createdAt":"2026-06-24T03:23:27.062Z","updatedAt":"2026-07-09T09:56:20.404Z","scanState":"clean"},{"id":"jellyfin-nfo-builder-20260701-6434352e0d","kind":"create","status":"applied","title":"Create jellyfin-nfo-builder","description":"为剧集整理统一文件名、生成缺失的 Jellyfin .nfo 剧集元数据","skillName":"jellyfin-nfo-builder","skillKey":"jellyfin-nfo-builder","createdAt":"2026-07-01T23:52:24.406Z","updatedAt":"2026-07-09T09:56:19.928Z","scanState":"clean"},{"id":"jav-media-sorter-20260707-b1f90c8a4d","kind":"create","status":"applied","title":"Create jav-media-sorter","description":"JAV 视频整理:组装文件、按演员分组、刮削 nfo 元数据与封面图","skillName":"jav-media-sorter","skillKey":"jav-media-sorter","createdAt":"2026-07-07T12:14:43.074Z","updatedAt":"2026-07-09T09:56:18.413Z","scanState":"clean"},{"id":"f-download-sorter-20260706-902cc0d5aa","kind":"create","status":"applied","title":"Create f-download-sorter","description":"整理 /mnt/f 下下载的视频文件:扫描→清垃圾→按规则归档到7个大类目录","skillName":"f-download-sorter","skillKey":"f-download-sorter","createdAt":"2026-07-06T09:03:54.941Z","updatedAt":"2026-07-06T09:04:18.513Z","scanState":"clean"},{"id":"weekly-report-g5-20260626-7595273f1d","kind":"create","status":"applied","title":"Create weekly-report-g5","description":"维云智造G5周报生成:整理每日工作→多段邮件(纯文本+HTML含签名图)→存入钉邮草稿箱","skillName":"weekly-report-g5","skillKey":"weekly-report-g5","createdAt":"2026-06-26T00:46:22.478Z","updatedAt":"2026-06-26T00:46:35.812Z","scanState":"clean"},{"id":"calibre-cleaner-20260624-cdbeb219a3","kind":"update","status":"applied","title":"Update calibre-cleaner","description":"清洗 Calibre 书库:修复损坏书名/提取作者/检测编码损坏、小文件的批量删除","skillName":"calibre-cleaner","skillKey":"calibre-cleaner","createdAt":"2026-06-24T03:03:28.166Z","updatedAt":"2026-06-24T03:03:30.915Z","scanState":"clean"},{"id":"calibre-cleaner-20260624-a441798af9","kind":"create","status":"applied","title":"Create calibre-cleaner","description":"清洗 Calibre 书库:修复损坏书名/提取作者/检测编码损坏、小文件的批量删除","skillName":"calibre-cleaner","skillKey":"calibre-cleaner","createdAt":"2026-06-24T02:29:02.278Z","updatedAt":"2026-06-24T02:29:27.227Z","scanState":"clean"},{"id":"calibre-title-cleaner-20260624-3760b64e8b","kind":"create","status":"applied","title":"Create calibre-title-cleaner","description":"清洗 Calibre 书库中损坏的 txt 文档书名(HTML标签/长文本/乱码/路径超限修复)","skillName":"calibre-title-cleaner","skillKey":"calibre-title-cleaner","createdAt":"2026-06-24T01:10:56.296Z","updatedAt":"2026-06-24T01:13:39.670Z","scanState":"clean"}]}
|
||||
|
||||
@@ -0,0 +1,613 @@
|
||||
---
|
||||
name: "mica-smdm-scaffold"
|
||||
description: "mica 项目 SMDM 模块骨架代码生成规范(含数据字典填充)"
|
||||
status: proposal
|
||||
version: "v2"
|
||||
date: "2026-08-04T09:09:00.667Z"
|
||||
---
|
||||
|
||||
# mica SMDM 模块骨架代码生成技能
|
||||
|
||||
## 技能定位
|
||||
|
||||
为 mica 项目的主数据管理模块 (SMDM) 生成标准化的骨架代码,包含完整的 CRUD 功能、数据字典填充、单元测试和集成测试。
|
||||
|
||||
## 适用范围
|
||||
|
||||
- mica 项目的主数据管理模块开发
|
||||
- 需要 Feign 远程调用 SMDM 服务的场景
|
||||
- 需要数据字典翻译的业务模块
|
||||
|
||||
---
|
||||
|
||||
## 🔴 强制性红线
|
||||
|
||||
### SMDM 物料管理模块开发限制
|
||||
|
||||
| # | 红线 | 违规示例 | 正确做法 |
|
||||
|---|------|---------|----------|
|
||||
| 1 | **表前缀必须过滤** | `DmpMdItemInfo` | `ItemInfo` |
|
||||
| 2 | **API 必须放在 apis.smdm 包** | `smd.api.ItemApi` | `apis.smdm.ItemApi` |
|
||||
| 3 | **查询只能用 Mapper** | 使用 MyBatis-Plus | 原生 MyBatis XML |
|
||||
| 4 | **改删必须 Feign 远程调用** | 本地直接 UPDATE/DELETE | 调用 SMDM 服务 API |
|
||||
| 5 | **实体必须继承 BaseDomain** | 独立定义审计字段 | `extends BaseDomain` |
|
||||
| 6 | **只使用指定业务字段** | 添加表中其他字段 | 仅用规范内字段 |
|
||||
| 7 | **代码必须生成到 smd 目录** | `com.witsoft.mica.item.*` | `com.witsoft.mica.smd.*` |
|
||||
|
||||
### 数据字典模块开发限制
|
||||
|
||||
| # | 红线 | 正确做法 |
|
||||
|---|------|---------|
|
||||
| 1 | **不需要 Controller** | 纯内部工具服务 |
|
||||
| 2 | **不需要 Feign API** | 不暴露外部接口 |
|
||||
| 3 | **不需要缓存实现** | 后续可调用 Feign 接口缓存 |
|
||||
| 4 | **不需要继承 BaseDomain** | 配置项不是业务实体 |
|
||||
|
||||
---
|
||||
|
||||
## 📋 核心规范摘要
|
||||
|
||||
### 包路径规范
|
||||
- **本地业务**: `com.witsoft.mica.smd.*`
|
||||
- **Feign 接口**: `com.witsoft.mica.apis.smdm.*`
|
||||
|
||||
### 表前缀过滤
|
||||
- `dmp_md_` 全部过滤 (如 `dmp_md_item_info` → `ItemInfo`)
|
||||
|
||||
### 查询方式
|
||||
- **分页查询**: 原生 MyBatis XML
|
||||
- **详情查询**: MyBatis-Plus `selectById()`
|
||||
|
||||
### 改删操作
|
||||
- Feign 远程调用 SMDM 服务
|
||||
|
||||
### 注释规范
|
||||
- `@Author: yangxuan`
|
||||
- `@Date: 精确到日`
|
||||
|
||||
### 日志规范
|
||||
- SLF4J + Lombok `@Slf4j`
|
||||
- Feign 调用添加 debug 日志(记录入参和耗时,**禁止记录返回值**)
|
||||
|
||||
### ecid 处理
|
||||
- Controller 层调用 `GlobalUtils.getEcid()` 并传递给 Service
|
||||
|
||||
### 分页方式
|
||||
- 使用项目 `PageDomain<T>`
|
||||
- **不使用** `com.github.pagehelper`
|
||||
|
||||
### XML 规范
|
||||
- 使用 `<sql>` + `<include>` 片段复用方式
|
||||
|
||||
---
|
||||
|
||||
## 📁 标准文件清单
|
||||
|
||||
### 第 1 部分:数据字典模块 (基础设施)
|
||||
|
||||
| 文件 | 说明 | 路径 |
|
||||
|------|------|------|
|
||||
| `DictionaryMapper.java` | 字典查询 Mapper 接口 | `smd/mapper/` |
|
||||
| `DictionaryMapper.xml` | 原生 SQL 查询 | `resources/mapper/smd/` |
|
||||
| `DictionaryItem.java` | 字典数据项 DTO | `smd/dto/` |
|
||||
| `DictionaryService.java` | 字典服务接口 | `smd/service/` |
|
||||
| `DictionaryServiceImpl.java` | 字典服务实现 | `smd/service/impl/` |
|
||||
|
||||
### 第 2 部分:枚举类 (按需)
|
||||
|
||||
| 文件 | 说明 |
|
||||
|------|------|
|
||||
| `StatusEnum.java` | 状态枚举 (Y=启用,N=禁用) |
|
||||
| `YesNoEnum.java` | 是否枚举 (Y=是,N=否) |
|
||||
|
||||
### 第 3 部分:业务模块 (10 个文件)
|
||||
|
||||
| 文件 | 说明 | 路径 |
|
||||
|------|------|------|
|
||||
| `XxxApi.java` | Feign 远程调用接口 | `apis/smdm/` |
|
||||
| `XxxInfo.java` | 实体类 | `smd/entity/` |
|
||||
| `XxxMapper.java` | Mapper 接口 | `smd/mapper/` |
|
||||
| `XxxMapper.xml` | MyBatis XML 映射 | `resources/mapper/smd/` |
|
||||
| `XxxService.java` | 服务接口 | `smd/service/` |
|
||||
| `XxxServiceImpl.java` | 服务实现 | `smd/service/impl/` |
|
||||
| `XxxController.java` | 控制器 | `smd/controller/` |
|
||||
| `XxxQueryDTO.java` | 查询 DTO | `smd/dto/` |
|
||||
| `XxxFormDTO.java` | 表单 DTO | `smd/dto/` |
|
||||
| `XxxVO.java` | 视图对象 | `smd/vo/` |
|
||||
|
||||
### 第 4 部分:测试文件 (扩展模块)
|
||||
|
||||
| 文件 | 说明 | 路径 |
|
||||
|------|------|------|
|
||||
| `XxxServiceTest.java` | Service 层单元测试 | `src/test/java/com/witsoft/mica/smd/service/` |
|
||||
| `XxxControllerIntegrationTest.java` | Controller 集成测试 | `src/test/java/com/witsoft/mica/smd/controller/` |
|
||||
|
||||
---
|
||||
|
||||
## 🔧 数据字典填充规范
|
||||
|
||||
### VO 设计
|
||||
- 添加 `xxxName` 字段存储字典翻译后的中文名称
|
||||
- 示例:`itemType` (en_code) + `itemTypeName` (中文名称)
|
||||
|
||||
### Service 层填充
|
||||
- **批量查询字典**: 一次查询多个字典类型,避免 N+1 问题
|
||||
- **通用填充方法**: `fillDictionaryData(ItemVO itemVO, Map<String, Map<String, String>> dictMaps)`
|
||||
- **性能要求**: 列表查询只查 1 次字典,批量填充
|
||||
|
||||
### 填充示例代码
|
||||
|
||||
```java
|
||||
@Override
|
||||
public PageDomain<ItemVO> queryPageList(ItemQueryDTO dto) {
|
||||
// 查询分页数据
|
||||
PageDomain<ItemVO> page = itemMapper.queryPageList(dto);
|
||||
|
||||
// 只查 1 次字典(批量查询)
|
||||
Map<String, Map<String, String>> dictMaps = dictionaryService.getDictionaryMaps(
|
||||
Arrays.asList("materialsType", "itemProperties", "pickingProperty")
|
||||
);
|
||||
|
||||
// 遍历列表填充
|
||||
page.getList().forEach(item -> fillDictionaryData(item, dictMaps));
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemVO queryById(String id) {
|
||||
ItemVO itemVO = itemMapper.selectById(id);
|
||||
|
||||
// 查 1 次字典
|
||||
Map<String, Map<String, String>> dictMaps = dictionaryService.getDictionaryMaps(
|
||||
Arrays.asList("materialsType", "itemProperties", "pickingProperty")
|
||||
);
|
||||
|
||||
fillDictionaryData(itemVO, dictMaps);
|
||||
return itemVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充物料字典数据
|
||||
* @param itemVO 物料 VO 对象
|
||||
* @param dictMaps 已查询的字典 Map(外部传入,避免重复查询)
|
||||
*/
|
||||
private void fillDictionaryData(ItemVO itemVO, Map<String, Map<String, String>> dictMaps) {
|
||||
if (itemVO == null || dictMaps == null) return;
|
||||
|
||||
// 物料类型
|
||||
Map<String, String> materialsMap = dictMaps.get("materialsType");
|
||||
if (materialsMap != null) {
|
||||
itemVO.setItemTypeName(materialsMap.getOrDefault(itemVO.getItemType(), itemVO.getItemType()));
|
||||
}
|
||||
|
||||
// 物料属性
|
||||
Map<String, String> propertiesMap = dictMaps.get("itemProperties");
|
||||
if (propertiesMap != null) {
|
||||
itemVO.setPropertiesName(propertiesMap.getOrDefault(itemVO.getProperties(), itemVO.getProperties()));
|
||||
}
|
||||
|
||||
// 领料属性
|
||||
Map<String, String> pickingMap = dictMaps.get("pickingProperty");
|
||||
if (pickingMap != null) {
|
||||
itemVO.setPickingPropertyName(pickingMap.getOrDefault(itemVO.getPickingProperty(), itemVO.getPickingProperty()));
|
||||
}
|
||||
|
||||
// 状态(枚举)
|
||||
itemVO.setStatusName(StatusEnum.getNameByCode(itemVO.getStatus()));
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🧪 测试生成规范
|
||||
|
||||
### 单元测试 (Service 层)
|
||||
|
||||
#### 文件位置
|
||||
- `src/test/java/com/witsoft/mica/smd/service/*ServiceTest.java`
|
||||
|
||||
#### 测试类结构模板
|
||||
```java
|
||||
package com.witsoft.mica.smd.service;
|
||||
|
||||
import com.witsoft.gen.base.common.ResponseModel;
|
||||
import com.witsoft.gen.base.page.PageDomain;
|
||||
import com.witsoft.mica.smd.dto.ItemQueryDTO;
|
||||
import com.witsoft.mica.smd.entity.ItemInfo;
|
||||
import com.witsoft.mica.smd.mapper.ItemMapper;
|
||||
import com.witsoft.mica.smd.service.impl.ItemServiceImpl;
|
||||
import com.witsoft.mica.apis.smdm.ItemApi;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class ItemServiceTest {
|
||||
|
||||
@Mock
|
||||
private ItemMapper itemMapper;
|
||||
|
||||
@Mock
|
||||
private ItemApi itemApi;
|
||||
|
||||
@InjectMocks
|
||||
private ItemServiceImpl itemService;
|
||||
|
||||
@Test
|
||||
void testQueryPageList_normalQuery() {
|
||||
// 准备测试数据
|
||||
ItemQueryDTO dto = new ItemQueryDTO();
|
||||
dto.setEcid("test-ecid");
|
||||
dto.setPageNo(1);
|
||||
dto.setPageSize(10);
|
||||
|
||||
List<ItemInfo> mockList = new ArrayList<>();
|
||||
ItemInfo item = new ItemInfo();
|
||||
item.setId("test-id");
|
||||
item.setItemCode("TEST001");
|
||||
mockList.add(item);
|
||||
|
||||
when(itemMapper.queryPageCount(any())).thenReturn(1L);
|
||||
when(itemMapper.queryPageList(any())).thenReturn(mockList);
|
||||
|
||||
// 执行测试
|
||||
PageDomain<ItemVO> result = itemService.queryPageList(dto);
|
||||
|
||||
// 验证结果
|
||||
assertNotNull(result);
|
||||
assertEquals(1, result.getList().size());
|
||||
assertEquals(1L, result.getTotal());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testQueryById_notFound() {
|
||||
when(itemMapper.selectById("not-exist")).thenReturn(null);
|
||||
|
||||
ItemVO result = itemService.queryById("not-exist");
|
||||
|
||||
assertNull(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCreateItem_success() {
|
||||
ItemFormDTO dto = new ItemFormDTO();
|
||||
dto.setItemCode("TEST001");
|
||||
dto.setItemName("测试物料");
|
||||
|
||||
when(itemApi.createItem(any())).thenReturn(ResponseModel.succeed(null));
|
||||
|
||||
ResponseModel result = itemService.insertItem(dto);
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(200, result.getCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCreateItem_nullParam() {
|
||||
ResponseModel result = itemService.insertItem(null);
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(500, result.getCode());
|
||||
assertTrue(result.getMsg().contains("参数不能为空"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdateItem_success() {
|
||||
ItemFormDTO dto = new ItemFormDTO();
|
||||
dto.setId("test-id");
|
||||
dto.setItemCode("TEST001");
|
||||
|
||||
when(itemApi.updateItem(any())).thenReturn(ResponseModel.succeed(null));
|
||||
|
||||
ResponseModel result = itemService.updateItem(dto);
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(200, result.getCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDeleteItem_success() {
|
||||
when(itemApi.deleteItem(any())).thenReturn(ResponseModel.succeed(null));
|
||||
|
||||
ResponseModel result = itemService.deleteItem("test-id");
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(200, result.getCode());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 测试方法清单
|
||||
| 方法 | 测试场景 | 断言 |
|
||||
|------|---------|------|
|
||||
| `testQueryPageList_normalQuery` | 正常分页查询 | 返回非空,size>0 |
|
||||
| `testQueryPageList_emptyResult` | 无数据 | 返回空列表 |
|
||||
| `testQueryById_notFound` | ID 不存在 | 返回 null |
|
||||
| `testQueryById_found` | ID 存在 | 返回非空 VO |
|
||||
| `testCreateItem_success` | 创建成功 | 返回 succeed |
|
||||
| `testCreateItem_nullParam` | 空参数 | 返回 failed |
|
||||
| `testUpdateItem_success` | 更新成功 | 返回 succeed |
|
||||
| `testUpdateItem_nullId` | 空 ID | 返回 failed |
|
||||
| `testDeleteItem_success` | 删除成功 | 返回 succeed |
|
||||
| `testDeleteItem_nullId` | 空 ID | 返回 failed |
|
||||
|
||||
#### Mock 处理规范
|
||||
- `GlobalUtils.getEcid()` → 改为实例方法或传入参数
|
||||
- Feign API → `@Mock` + `when().thenReturn()`
|
||||
- Mapper → `@Mock` + 返回测试数据
|
||||
- 使用 `ArgumentMatchers.any()` 匹配任意参数
|
||||
|
||||
---
|
||||
|
||||
### 集成测试 (Controller 层)
|
||||
|
||||
#### 文件位置
|
||||
- `src/test/java/com/witsoft/mica/smd/controller/*ControllerIntegrationTest.java`
|
||||
|
||||
#### 测试类结构模板
|
||||
```java
|
||||
package com.witsoft.mica.smd.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.witsoft.mica.smd.dto.ItemFormDTO;
|
||||
import com.witsoft.mica.smd.dto.ItemQueryDTO;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.MvcResult;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
|
||||
|
||||
@SpringBootTest
|
||||
@AutoConfigureMockMvc
|
||||
@Transactional
|
||||
class ItemControllerIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private MockMvc mockMvc;
|
||||
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
// 准备测试数据(可选)
|
||||
}
|
||||
|
||||
@Test
|
||||
void testQueryPageList_integration() throws Exception {
|
||||
ItemQueryDTO dto = new ItemQueryDTO();
|
||||
dto.setPageNo(1);
|
||||
dto.setPageSize(10);
|
||||
|
||||
mockMvc.perform(post("/web/itemInfo/getPageList")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.content(objectMapper.writeValueAsString(dto)))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.code").value(200))
|
||||
.andExpect(jsonPath("$.data").exists())
|
||||
.andExpect(jsonPath("$.data.list").isArray());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testQueryById_integration() throws Exception {
|
||||
mockMvc.perform(get("/web/itemInfo/getById")
|
||||
.param("id", "test-id"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.code").value(200));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCreateItem_integration() throws Exception {
|
||||
ItemFormDTO dto = new ItemFormDTO();
|
||||
dto.setItemCode("TEST001");
|
||||
dto.setItemName("测试物料");
|
||||
dto.setStatus("Y");
|
||||
|
||||
mockMvc.perform(post("/web/itemInfo/create")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.content(objectMapper.writeValueAsString(dto)))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.code").value(200));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdateItem_integration() throws Exception {
|
||||
ItemFormDTO dto = new ItemFormDTO();
|
||||
dto.setId("test-id");
|
||||
dto.setItemCode("TEST001");
|
||||
dto.setItemName("测试物料更新");
|
||||
|
||||
mockMvc.perform(post("/web/itemInfo/update")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.content(objectMapper.writeValueAsString(dto)))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.code").value(200));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDeleteItem_integration() throws Exception {
|
||||
mockMvc.perform(post("/web/itemInfo/delete")
|
||||
.param("id", "test-id"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.code").value(200));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAuth_ecidRequired() throws Exception {
|
||||
// 测试没有 ecid 时的权限验证(如果配置了拦截器)
|
||||
ItemQueryDTO dto = new ItemQueryDTO();
|
||||
|
||||
mockMvc.perform(post("/web/itemInfo/getPageList")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.content(objectMapper.writeValueAsString(dto)))
|
||||
.andExpect(status().isOk());
|
||||
// 根据实际权限配置调整断言
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 测试场景清单
|
||||
| 方法 | 测试场景 | 验证点 |
|
||||
|------|---------|--------|
|
||||
| `testQueryPageList_integration` | 完整查询流程 | HTTP 200 + 返回结构 |
|
||||
| `testQueryById_integration` | 详情查询 | HTTP 200 + 数据存在 |
|
||||
| `testCreateItem_integration` | 创建流程 | HTTP 200 + 数据入库 |
|
||||
| `testUpdateItem_integration` | 更新流程 | HTTP 200 + 数据更新 |
|
||||
| `testDeleteItem_integration` | 删除流程 | HTTP 200 + 数据删除 |
|
||||
| `testAuth_ecidRequired` | 权限验证 | 无 ecid 时拒绝 |
|
||||
|
||||
#### 测试数据准备
|
||||
- `@BeforeEach` 插入测试数据(可选)
|
||||
- `@AfterEach` 清理测试数据(可选)
|
||||
- 使用 `@Transactional` 自动回滚(推荐)
|
||||
|
||||
---
|
||||
|
||||
### 测试生成触发条件
|
||||
|
||||
| 场景 | 单元测试 | 集成测试 |
|
||||
|------|---------|---------|
|
||||
| 新增业务模块 | ✅ 必选 | ✅ 推荐 |
|
||||
| 新增字典模块 | ✅ 必选 | ⏸️ 可选 |
|
||||
| 修改核心逻辑 | ✅ 必选 | ⏸️ 可选 |
|
||||
| 修复 Bug | ✅ 添加回归测试 | ⏸️ 可选 |
|
||||
| 性能优化 | ⏸️ 可选 | ✅ 必选 |
|
||||
|
||||
---
|
||||
|
||||
## 🐛 常见问题修正清单
|
||||
|
||||
| # | 问题 | 修正方案 |
|
||||
|---|------|----------|
|
||||
| 1 | ResponseModel 静态引用 | `ResponseModel.succeed(data)` |
|
||||
| 2 | 分页 XML / 详情 MP 混合使用 | 分页用 XML,详情用 MP |
|
||||
| 3 | 编码查询不需要 | 移除编码查询条件 |
|
||||
| 4 | Feign 调用缺少日志 | 添加入参和耗时日志(debug 级别) |
|
||||
| 5 | Controller 层 ecid 处理 | Controller 层获取并传递 |
|
||||
| 6 | 分页 XML 查询被删除 | 恢复分页 XML 查询 |
|
||||
| 7 | 使用 PageHelper | 改用 PageDomain |
|
||||
| 8 | queryByCode 方法不需要 | 删除 |
|
||||
| 9 | ResponseModel 泛型参数化 | `ResponseModel<T>` |
|
||||
| 10 | Map 类型转换警告 | 添加 `@SuppressWarnings("unchecked")` |
|
||||
| 11 | XML 不方便联查 | 使用 `<sql>` + `<include>` 片段 |
|
||||
| 12 | ItemApi ResponseModel 静态引用 | 泛型参数化 |
|
||||
| 13 | ResponseModel<Void> 编译报错 | 使用 `ResponseModel<?>` 或无参 |
|
||||
| 14 | 日志记录返回值太大 | 只记录耗时,不记录返回值 |
|
||||
| 15 | JsonUtils 方法不存在 | 使用 `JSON.toJSONString()` (fastjson) |
|
||||
| 16 | fillDictionaryData 重复查询 | 接收 dictMaps 参数,避免 N+1 问题 |
|
||||
| 17 | 单元测试中文字符命名 | 改为英文命名 |
|
||||
| 18 | GlobalUtils 无法 Mock | 改为实例方法或传入参数 |
|
||||
|
||||
---
|
||||
|
||||
## 📊 性能优化要点
|
||||
|
||||
| 优化点 | 说明 | 效果 |
|
||||
|--------|------|------|
|
||||
| **批量查询字典** | 一次查询多个字典类型 | 避免多次数据库查询 |
|
||||
| **字典 Map 传入** | `fillDictionaryData()` 接收外部传入的 dictMaps | 避免重复查询 |
|
||||
| **列表查询优化** | 100 条数据从 101 次查询降低到 2 次 | 性能提升 50 倍 |
|
||||
| **枚举静态方法** | 枚举翻译使用静态方法 | 无运行时开销 |
|
||||
|
||||
---
|
||||
|
||||
## 🚀 使用流程
|
||||
|
||||
### 1. 需求分析阶段
|
||||
- 确认业务模块的表结构
|
||||
- 确认需要 Feign 远程调用还是本地 CRUD
|
||||
- 确认涉及的数据字典类型
|
||||
|
||||
### 2. 代码生成阶段
|
||||
- 生成数据字典模块 (5 个文件)
|
||||
- 生成枚举类 (按需)
|
||||
- 生成业务模块 (10 个文件)
|
||||
- 生成单元测试 (按需)
|
||||
- 生成集成测试 (按需)
|
||||
|
||||
### 3. 修正阶段
|
||||
- 对照 18 个常见问题修正清单
|
||||
- 运行 Maven 编译验证
|
||||
- 运行单元测试
|
||||
|
||||
### 4. 验证阶段
|
||||
- 编译通过
|
||||
- 单元测试通过
|
||||
- 集成测试通过(可选)
|
||||
|
||||
---
|
||||
|
||||
## 📝 输出物
|
||||
|
||||
1. 完整的骨架代码(10+5+2 个文件)
|
||||
2. 单元测试文件(按需)
|
||||
3. 集成测试文件(按需)
|
||||
4. 编译验证报告
|
||||
5. 测试通过报告
|
||||
|
||||
---
|
||||
|
||||
## 🔗 相关资源
|
||||
|
||||
- 数据库连接:`mysql -h 47.99.209.185 -P 50036 -u witsoftd -p mica`
|
||||
- 项目路径:`/root/projects/wit/`
|
||||
- 规范文档:`/root/projects/wit/mica-doc/主数据骨架代码.md`
|
||||
- 规范文档:`/root/projects/wit/mica-doc/数据字典模块.md`
|
||||
|
||||
---
|
||||
|
||||
## 🔄 技能更新机制
|
||||
|
||||
### 如何丰富这个技能
|
||||
|
||||
1. **发现新需求/问题**
|
||||
- 开发过程中遇到新问题
|
||||
- 用户提出新需求
|
||||
- 最佳实践总结
|
||||
|
||||
2. **添加到技能的对应扩展模块**
|
||||
- 新增测试类型 → 添加到"测试生成规范"
|
||||
- 新增文件类型 → 添加到"标准文件清单"
|
||||
- 新问题 → 添加到"常见问题修正清单"
|
||||
|
||||
3. **更新技能提案**
|
||||
```bash
|
||||
skill_workshop action=revise name=mica-smdm-scaffold \
|
||||
proposal_content="[完整技能内容]"
|
||||
```
|
||||
|
||||
4. **应用新版本**
|
||||
```bash
|
||||
skill_workshop action=apply proposal_id=mica-smdm-scaffold-xxxxx
|
||||
```
|
||||
|
||||
5. **后续开发自动使用新版本**
|
||||
|
||||
### 可扩展模块示例
|
||||
|
||||
| 模块 | 说明 | 状态 |
|
||||
|------|------|------|
|
||||
| 单元测试生成 | Service 层测试模板 | ✅ 已实现 |
|
||||
| 集成测试生成 | Controller 层测试模板 | ✅ 已实现 |
|
||||
| API 文档生成 | Swagger 注解规范 | ⏸️ 待添加 |
|
||||
| 前端代码生成 | Vue3 + TypeScript 模板 | ⏸️ 待添加 |
|
||||
| 数据迁移脚本 | Flyway 迁移脚本 | ⏸️ 待添加 |
|
||||
| 性能测试 | JMeter 测试脚本 | ⏸️ 待添加 |
|
||||
| 部署脚本 | Docker/K8s 配置 | ⏸️ 待添加 |
|
||||
@@ -0,0 +1 @@
|
||||
{"schema":"openclaw.skill-workshop.proposal.v1","id":"mica-smdm-scaffold-20260804-af318dd6c2","kind":"create","status":"applied","title":"Create mica-smdm-scaffold","description":"mica 项目 SMDM 模块骨架代码生成规范(含数据字典填充)","createdAt":"2026-08-04T08:59:50.395Z","updatedAt":"2026-08-04T09:12:42.043Z","createdBy":"skill-workshop","origin":{"agentId":"planner","sessionKey":"agent:planner:main","runId":"16c1345e-77e6-475b-8d0f-e25f2f5c99f1","messageId":"16c1345e-77e6-475b-8d0f-e25f2f5c99f1"},"proposedVersion":"v2","draftFile":"PROPOSAL.md","draftHash":"63dba30b3768a646bc9fd7dc3484738f7bf6cfdb80c3a58e9ebcde04a42c07e3","target":{"skillName":"mica-smdm-scaffold","skillKey":"mica-smdm-scaffold","skillDir":"/root/.openclaw/workspace-planner/skills/mica-smdm-scaffold","skillFile":"/root/.openclaw/workspace-planner/skills/mica-smdm-scaffold/SKILL.md","source":"openclaw-workspace"},"scan":{"state":"clean","scannedAt":"2026-08-04T09:12:42.015Z","critical":0,"warn":0,"info":0,"findings":[]},"appliedAt":"2026-08-04T09:12:42.043Z"}
|
||||
@@ -0,0 +1 @@
|
||||
{"schema":"openclaw.skill-workshop.rollback.v1","proposalId":"mica-smdm-scaffold-20260804-af318dd6c2","writtenAt":"2026-08-04T09:12:42.018Z","targetSkillFile":"/root/.openclaw/workspace-planner/skills/mica-smdm-scaffold/SKILL.md","action":"create"}
|
||||
@@ -18,5 +18,9 @@
|
||||
"e93ec401ac152a24ac60f3949838de21": {
|
||||
"sessionKey": "agent:frontend:main",
|
||||
"updatedAt": 1783936175588
|
||||
},
|
||||
"8e26fa36080dd3394a28fafce9b531aa": {
|
||||
"sessionKey": "agent:planner:main",
|
||||
"updatedAt": 1785809107092
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-02T01:12:29.527Z
|
||||
2026-08-04T09:52:44.904Z
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-10T12:10:35.917Z
|
||||
2026-08-04T05:33:45.985Z
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-11T04:17:27.887Z
|
||||
generated:TOOLS.md:15cdfe57fcfa6d83888e215176f40b415ff2b9a51afe96b4d4134f2f5a8cfe68
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-06-18T06:06:42.546Z
|
||||
2026-08-04T09:53:35.716Z
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-09T14:37:58.953Z
|
||||
generated:TOOLS.md:15cdfe57fcfa6d83888e215176f40b415ff2b9a51afe96b4d4134f2f5a8cfe68
|
||||
generated:USER.md:e418ca9a680553b3ad8f54aecb0d403330810bb77826ab5251cc1dc13368fe16
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-06-16T01:41:47.661Z
|
||||
generated:AGENTS.md:dda474224d5420e85d838fac5ffba4d3b4ef871977618865ec38a76b28a7d556
|
||||
generated:IDENTITY.md:d93cd095ac3b8d8135110230bc6f09738fb8029ca6f270001a928a1c1614bffb
|
||||
generated:TOOLS.md:15cdfe57fcfa6d83888e215176f40b415ff2b9a51afe96b4d4134f2f5a8cfe68
|
||||
generated:USER.md:e418ca9a680553b3ad8f54aecb0d403330810bb77826ab5251cc1dc13368fe16
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-09T10:44:56.583Z
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-06-29T03:05:39.425Z
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-13T09:55:37.594Z
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-14T09:11:58.580Z
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-09T14:35:29.688Z
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-10T14:27:02.080Z
|
||||
generated:HEARTBEAT.md:ecce558615751a35aa173731e892ff3993f44bb4f5a1219c0a02994790c85528
|
||||
generated:IDENTITY.md:d93cd095ac3b8d8135110230bc6f09738fb8029ca6f270001a928a1c1614bffb
|
||||
generated:TOOLS.md:15cdfe57fcfa6d83888e215176f40b415ff2b9a51afe96b4d4134f2f5a8cfe68
|
||||
generated:USER.md:e418ca9a680553b3ad8f54aecb0d403330810bb77826ab5251cc1dc13368fe16
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
openclaw-workspace-attestation:v1
|
||||
2026-07-10T06:48:27.495Z
|
||||
generated:HEARTBEAT.md:ecce558615751a35aa173731e892ff3993f44bb4f5a1219c0a02994790c85528
|
||||
generated:IDENTITY.md:d93cd095ac3b8d8135110230bc6f09738fb8029ca6f270001a928a1c1614bffb
|
||||
generated:TOOLS.md:15cdfe57fcfa6d83888e215176f40b415ff2b9a51afe96b4d4134f2f5a8cfe68
|
||||
generated:USER.md:e418ca9a680553b3ad8f54aecb0d403330810bb77826ab5251cc1dc13368fe16
|
||||
@@ -0,0 +1,405 @@
|
||||
{
|
||||
"version": 1,
|
||||
"skills": {
|
||||
"sql-toolkit": {
|
||||
"version": "1.0.0",
|
||||
"installedAt": 1785744535727,
|
||||
"registry": "https://clawhub.ai",
|
||||
"ownerHandle": "gitgoodordietrying",
|
||||
"artifact": {
|
||||
"kind": "archive",
|
||||
"sha256": "4f48da99f3b1beb878195590b3ed1c6a469ce554498831abdee42ca27468959f",
|
||||
"integrity": "sha256-T0jamfOxvrh4GVWQs+0cakac5VRJiDGr3uQsonRolZ8="
|
||||
},
|
||||
"skillFile": {
|
||||
"path": "SKILL.md",
|
||||
"sha256": "515ecf904449a3cd5ebb92e85e54127e216d9483ee9111705e75e686a0694285"
|
||||
},
|
||||
"verification": {
|
||||
"schema": "clawhub.skill.verify.v1",
|
||||
"ok": true,
|
||||
"decision": "pass",
|
||||
"reasons": [],
|
||||
"card": {
|
||||
"available": true,
|
||||
"path": "skill-card.md",
|
||||
"url": "https://wry-manatee-359.convex.site/api/v1/skills/sql-toolkit/card?ownerHandle=gitgoodordietrying&version=1.0.0",
|
||||
"sha256": "ecf10f8b45e67a00ae6b5c6ef5438feb44cd33f505666b4362c506172d39848d",
|
||||
"size": 1998,
|
||||
"contentType": "text/markdown; charset=utf-8"
|
||||
},
|
||||
"artifact": {
|
||||
"sourceFingerprint": "d90603335b0cc1e00d6da8eac9e1345d52453b894578bd2e8590fa20b1475484",
|
||||
"bundleFingerprints": [
|
||||
"b99edda9c4d7b4e0a78f172715644da5955da8bad18563789b4903f734c0baa2"
|
||||
],
|
||||
"files": [
|
||||
{
|
||||
"path": "SKILL.md",
|
||||
"size": 12080,
|
||||
"sha256": "515ecf904449a3cd5ebb92e85e54127e216d9483ee9111705e75e686a0694285",
|
||||
"contentType": "text/markdown"
|
||||
}
|
||||
]
|
||||
},
|
||||
"provenance": {
|
||||
"source": "unavailable",
|
||||
"reason": "No server-resolved GitHub import provenance is stored for this version."
|
||||
},
|
||||
"security": {
|
||||
"status": "clean",
|
||||
"passed": true,
|
||||
"rawStatus": "clean",
|
||||
"verdict": "benign",
|
||||
"confidence": "high",
|
||||
"summary": "This SQL helper skill is purpose-aligned documentation for database command-line workflows, with no evidence of hidden behavior or malicious activity, but users should be careful with restore examples that can overwrite data.",
|
||||
"model": "gpt-5.5",
|
||||
"checkedAt": 1783656186394,
|
||||
"signals": {
|
||||
"staticScan": {
|
||||
"status": "clean",
|
||||
"rawStatus": "clean",
|
||||
"reasonCodes": [],
|
||||
"summary": "No suspicious patterns detected.",
|
||||
"engineVersion": "v2.4.5",
|
||||
"checkedAt": 1777524980775
|
||||
},
|
||||
"virusTotal": {
|
||||
"status": "clean",
|
||||
"rawStatus": "clean",
|
||||
"verdict": "benign",
|
||||
"analysis": "Type: OpenClaw Skill\nName: sql-toolkit\nVersion: 1.0.0\n\nThe skill bundle is benign. It provides comprehensive documentation and examples for interacting with SQL databases (SQLite, PostgreSQL, MySQL) using standard command-line tools. While the skill inherently involves powerful commands with file system and network access (e.g., `psql`, `mysql`, `sqlite3`, `pg_dump`, `mysqldump`), all examples and instructions in `SKILL.md` are aligned with the stated purpose of a 'SQL Toolkit' and demonstrate legitimate, common database operations. There is no evidence of prompt injection, data exfiltration, malicious execution, persistence, or obfuscation.",
|
||||
"source": "palm",
|
||||
"scanner": "code_insight",
|
||||
"engineStats": {
|
||||
"harmless": 0,
|
||||
"malicious": 0,
|
||||
"suspicious": 0,
|
||||
"undetected": 64
|
||||
},
|
||||
"checkedAt": 1779161171837
|
||||
},
|
||||
"skillSpector": {
|
||||
"status": "clean",
|
||||
"rawStatus": "clean",
|
||||
"score": 8,
|
||||
"severity": "LOW",
|
||||
"recommendation": "SAFE",
|
||||
"issueCount": 1,
|
||||
"scannerVersion": "2.3.5",
|
||||
"summary": null,
|
||||
"error": null,
|
||||
"checkedAt": 1783656142755
|
||||
},
|
||||
"dependencyRegistry": null
|
||||
}
|
||||
},
|
||||
"signature": {
|
||||
"status": "unsigned"
|
||||
}
|
||||
}
|
||||
},
|
||||
"qiushi-openclaw-skill": {
|
||||
"version": "1.0.0",
|
||||
"installedAt": 1785745381570,
|
||||
"registry": "https://clawhub.ai",
|
||||
"ownerHandle": "skytodmoon",
|
||||
"artifact": {
|
||||
"kind": "archive",
|
||||
"sha256": "1e2d3712d2974143449c9e47b0379725a954794c498727799f782ac7b1db7a49",
|
||||
"integrity": "sha256-Hi03EtKXQUNEnJ5HsDeXJalUeUxJhyd5n3gqx7Hbekk="
|
||||
},
|
||||
"skillFile": {
|
||||
"path": "SKILL.md",
|
||||
"sha256": "b21d933b7f61584d2254fba25fd531c16f19e33e10016ddfbdea1a5e2d5d6d25"
|
||||
},
|
||||
"verification": {
|
||||
"schema": "clawhub.skill.verify.v1",
|
||||
"ok": true,
|
||||
"decision": "pass",
|
||||
"reasons": [],
|
||||
"card": {
|
||||
"available": true,
|
||||
"path": "skill-card.md",
|
||||
"url": "https://wry-manatee-359.convex.site/api/v1/skills/qiushi-openclaw-skill/card?ownerHandle=skytodmoon&version=1.0.0",
|
||||
"sha256": "7ffcf0eaab78e22dc18592df90bce922535f9ce092c53c3a68f5d020f698e081",
|
||||
"size": 2044,
|
||||
"contentType": "text/markdown; charset=utf-8"
|
||||
},
|
||||
"artifact": {
|
||||
"sourceFingerprint": "1d39ab4575f3ffec359865c03bed700ee3426f57f61d9fa9dad153fc60e5a3ae",
|
||||
"bundleFingerprints": [
|
||||
"8864f859b5a5b919d08ed0da8d37a79d4e5276ffd32a564ebe650f637423e296"
|
||||
],
|
||||
"files": [
|
||||
{
|
||||
"path": "README.md",
|
||||
"size": 3652,
|
||||
"sha256": "3454e7472626a033616d7d9f89c0ecf6b11aa5172774f0c07bca694c9d115f1f",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "SKILL.md",
|
||||
"size": 2385,
|
||||
"sha256": "b21d933b7f61584d2254fba25fd531c16f19e33e10016ddfbdea1a5e2d5d6d25",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "investigation-first/clawhub.json",
|
||||
"size": 387,
|
||||
"sha256": "48159dc63edec35d2ea36df30cb028bc89d5adf7e873e0bbd98c2b559b72d04b",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "investigation-first/README.md",
|
||||
"size": 2766,
|
||||
"sha256": "edc308afbcffb36f40f9e925e13dcc24f7c8b361af3a7c7c45af80f76cc96c3e",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "investigation-first/SKILL.md",
|
||||
"size": 2309,
|
||||
"sha256": "101212ce1723aaf92f7503b77fff35edbcccf22830dbe2f0f43cb995c166da2d",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "practice-cognition/clawhub.json",
|
||||
"size": 380,
|
||||
"sha256": "68bf1d476a88950059cb7dc52e78dee5583f7114472237bb2824d190119e9add",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "practice-cognition/README.md",
|
||||
"size": 2659,
|
||||
"sha256": "addd5a3c69d8559e659f507127877823727e03cdec2da0346c4a5dae4306b1bb",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "practice-cognition/SKILL.md",
|
||||
"size": 2457,
|
||||
"sha256": "204872d8135301e2ed07b696ef63dbe4081cce1ed3235221843fd4f97a0f42e9",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "concentrate-forces/clawhub.json",
|
||||
"size": 380,
|
||||
"sha256": "683dc297ed5d0f8a0b223f543fe54d445e8ebcaa39cd65d59cdca07e843f772c",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "concentrate-forces/README.md",
|
||||
"size": 2731,
|
||||
"sha256": "1666b93bcfdf78520b492bc196a901d465ce637c7d3b08520163a5f0609ff962",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "concentrate-forces/SKILL.md",
|
||||
"size": 2253,
|
||||
"sha256": "207b28f78ecb81d7c54f2ac8c6b3cdd58b4e10775a8e92f2f026bc3310d6f123",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "contradiction-analysis/clawhub.json",
|
||||
"size": 423,
|
||||
"sha256": "ef00074e7841d1698c0f0ea74c9e9dfc9e0923452e3d1475216bf945f147fd80",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "contradiction-analysis/README.md",
|
||||
"size": 3012,
|
||||
"sha256": "b4eeae7b315e024bf2c9f49d388d627cf2b0c3304d92d449f0c86abc3ee8d4b4",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "contradiction-analysis/SKILL.md",
|
||||
"size": 2919,
|
||||
"sha256": "1fd24138f9ab3b4bab002a771978356c673c24c7a5dce6c7acb37dc271dcd385",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "mass-line/clawhub.json",
|
||||
"size": 356,
|
||||
"sha256": "bac70025aedd0465607cbca72996bdf705a7d3a75c50bcc5da29c18147dee980",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "mass-line/README.md",
|
||||
"size": 2632,
|
||||
"sha256": "1c3c76199aa50ec1eca70b0463c42e09227777265a74e9f4b487483a8c5b5307",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "mass-line/SKILL.md",
|
||||
"size": 2169,
|
||||
"sha256": "f215fdf997b02cf314b6ba0e03e2425aae20904f55c4ce7734dcc8c32f64b78e",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "protracted-strategy/clawhub.json",
|
||||
"size": 372,
|
||||
"sha256": "5f54232101b8b48a38452b9cf69f9824914bb834cb03f06f4c0afc59429947dc",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "protracted-strategy/README.md",
|
||||
"size": 2954,
|
||||
"sha256": "d92f25b8ebfd8cd8999e56dbf79727e96f6c1502860dd2f37138795bea65e40e",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "protracted-strategy/SKILL.md",
|
||||
"size": 2418,
|
||||
"sha256": "7a69b073927a7426a01dc8e2979297f9a9b90f7b450e853bf2b877fb174422d2",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "workflows/clawhub.json",
|
||||
"size": 392,
|
||||
"sha256": "77497954f506f25351f35cf4e541a2e533501056ce7418b434ee24c6b9438ca4",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "workflows/README.md",
|
||||
"size": 2871,
|
||||
"sha256": "5b16dd2a4d5093494ace5d201c85d7cfd5e3409a93cb50176e269a987e0a7bc9",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "workflows/SKILL.md",
|
||||
"size": 2448,
|
||||
"sha256": "183fd3caa21f6ff5ebc9e725b59f4a0be3d83e5fdeb8587eb6d0b22859b768b1",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "overall-planning/clawhub.json",
|
||||
"size": 363,
|
||||
"sha256": "1e4a7014f0745993be50e1dd2813af364592e6cfbd87b68456c46543b6fc9797",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "overall-planning/README.md",
|
||||
"size": 2912,
|
||||
"sha256": "68c2f97a23befb87a11c612d862c0a77b5544a2cd8cd4e1f8bd2ba91c3eb9620",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "overall-planning/SKILL.md",
|
||||
"size": 2403,
|
||||
"sha256": "b3fdc6991bc211c2e83981e7ce53facfa1014cb7325452826cfc22ce056e36af",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "spark-prairie-fire/clawhub.json",
|
||||
"size": 383,
|
||||
"sha256": "17981f22cf824e28c2d770bcc21c9aa5087476326004eaae138b96a7b4fc4eae",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "spark-prairie-fire/README.md",
|
||||
"size": 2710,
|
||||
"sha256": "06a95aeafad95d606a742e4b99cb8ad257aeb65321305d318bbbf9b324299e63",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "spark-prairie-fire/SKILL.md",
|
||||
"size": 2232,
|
||||
"sha256": "e0eac250f3046cfcd8cdd95c3bd780ccefe7e9efbcb62de0a73f80986e78b2a8",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "arming-thought/clawhub.json",
|
||||
"size": 450,
|
||||
"sha256": "0a7cc0fb2129be03444e2fec5e8fb505cfcadbe2ed58ebef1fc37aaed28a0211",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "arming-thought/README.md",
|
||||
"size": 1955,
|
||||
"sha256": "6f1d3d9a0abcd5ad8fc90a1e0d18207d7e97ab53d947894aef049adf8807bdb2",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "arming-thought/SKILL.md",
|
||||
"size": 2271,
|
||||
"sha256": "6fa2855bcb06d1a136d916c9a07124dbd50adaac75b8037c86882b4c6c430735",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "criticism-self-criticism/clawhub.json",
|
||||
"size": 407,
|
||||
"sha256": "eda46316ce74edbf78c7210005d2785f1c2dbe7c0e8ae6809adb8f75a5e90e41",
|
||||
"contentType": "application/json"
|
||||
},
|
||||
{
|
||||
"path": "criticism-self-criticism/README.md",
|
||||
"size": 2811,
|
||||
"sha256": "d90d58b4e5707bdf4635aa85e147422bf8d18d79b3c4d24864f4f3fa7d7ad3e3",
|
||||
"contentType": "text/x-markdown"
|
||||
},
|
||||
{
|
||||
"path": "criticism-self-criticism/SKILL.md",
|
||||
"size": 2369,
|
||||
"sha256": "1f01760dbdffa7cd5acb95365e7866692d72c89061ed2240a05bbe1056794002",
|
||||
"contentType": "text/x-markdown"
|
||||
}
|
||||
]
|
||||
},
|
||||
"provenance": {
|
||||
"source": "unavailable",
|
||||
"reason": "No server-resolved GitHub import provenance is stored for this version."
|
||||
},
|
||||
"security": {
|
||||
"status": "clean",
|
||||
"passed": true,
|
||||
"rawStatus": "clean",
|
||||
"verdict": "benign",
|
||||
"confidence": "high",
|
||||
"summary": "This is a disclosed Chinese-language methodology skill pack that guides reasoning and planning without requesting tools, credentials, file access, network access, or persistence.",
|
||||
"model": "gpt-5.5",
|
||||
"checkedAt": 1779973863935,
|
||||
"signals": {
|
||||
"staticScan": {
|
||||
"status": "clean",
|
||||
"rawStatus": "clean",
|
||||
"reasonCodes": [],
|
||||
"summary": "No suspicious patterns detected.",
|
||||
"engineVersion": "v2.4.5",
|
||||
"checkedAt": 1777527313505
|
||||
},
|
||||
"virusTotal": {
|
||||
"status": "clean",
|
||||
"rawStatus": "clean",
|
||||
"verdict": null,
|
||||
"analysis": null,
|
||||
"source": "engines",
|
||||
"scanner": null,
|
||||
"engineStats": {
|
||||
"harmless": 0,
|
||||
"malicious": 0,
|
||||
"suspicious": 0,
|
||||
"undetected": 65
|
||||
},
|
||||
"checkedAt": 1780086996288
|
||||
},
|
||||
"skillSpector": {
|
||||
"status": "suspicious",
|
||||
"rawStatus": "suspicious",
|
||||
"score": 100,
|
||||
"severity": "CRITICAL",
|
||||
"recommendation": "DO_NOT_INSTALL",
|
||||
"issueCount": 16,
|
||||
"scannerVersion": "2.0.0",
|
||||
"summary": null,
|
||||
"error": null,
|
||||
"checkedAt": 1779973821578
|
||||
},
|
||||
"dependencyRegistry": null
|
||||
}
|
||||
},
|
||||
"signature": {
|
||||
"status": "unsigned"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,8 @@
|
||||
- 不要在没有询问的情况下运行破坏性命令。
|
||||
- `trash` 优于 `rm`(可恢复总是好过永久消失)
|
||||
- 有疑问时,请询问。
|
||||
- **禁止擅自提交项目代码到 git** - 必须先询问用户确认后再提交
|
||||
- **禁止 git push** - 只能 commit,push 操作必须由用户手动执行
|
||||
|
||||
## 外部 vs 内部
|
||||
|
||||
|
||||
@@ -22,5 +22,30 @@
|
||||
|
||||
## 项目别名
|
||||
|
||||
- `ruoyi后端` → `/home/yangxuan/Projects/IdeaProjects/ruoyi-vue-pro`
|
||||
- `tiny` / `tiny-erp` → `/home/yangxuan/Projects/IdeaProjects/tiny-erp`
|
||||
- `wit` → `/root/projects/wit`(前端 mica-web / 后端 mica-server / 文档 mica-doc)
|
||||
|
||||
### 🔴 mica 项目 git 操作红线
|
||||
|
||||
- **禁止 git push** - 只能 commit,push 操作必须由用户手动执行
|
||||
- **禁止擅自提交项目代码到 git** - 必须先询问用户确认后再提交
|
||||
|
||||
## mica 项目数据库配置
|
||||
|
||||
**连接信息:**
|
||||
- 主机:`47.99.209.185:50036`
|
||||
- 用户:`witsoftd`
|
||||
- 密码:见密码管理器
|
||||
|
||||
**数据库列表:**
|
||||
| 数据库 | 用途 |
|
||||
|--------|------|
|
||||
| `dmp_serp` | ERP 相关 |
|
||||
| `dmp_smdm` | 主数据管理 |
|
||||
| `dmp_smes` | 制造执行系统 |
|
||||
| `dmp_spom` | 订单管理 |
|
||||
| `dmp_secm` | 安全管理 |
|
||||
| `dmp_sportal` | 门户系统 |
|
||||
|
||||
**相关系统:** `witdmp_edge/scheduler/workflow`、`witdn_lcdp/server`、`witprint`、`nacos_k8s`、`tenant`
|
||||
|
||||
**技能:** sql-toolkit(`/root/.openclaw/workspace-backend/skills/sql-toolkit/SKILL.md`)
|
||||
|
||||
@@ -0,0 +1,455 @@
|
||||
# MICA-Server 开发规范
|
||||
|
||||
> 本文档是 mica-server 项目的权威开发规范,所有开发人员必须严格遵守。
|
||||
|
||||
---
|
||||
|
||||
## 一、技术栈与版本
|
||||
|
||||
### 1.1 核心技术栈
|
||||
|
||||
| 类别 | 技术 | 版本 | 说明 |
|
||||
|------|------|------|------|
|
||||
| **JDK** | Java | 1.8 | 禁止使用 Java 9+ 特性 |
|
||||
| **框架** | Spring Boot | 2.6.7 | 统一版本 |
|
||||
| **ORM** | MyBatis-Plus | 3.5.1 | 禁止手写原生 SQL(除非性能优化) |
|
||||
| **构建工具** | Maven | 3.6+ | 统一使用 Maven |
|
||||
| **数据库** | MySQL | 8.0+ | HikariCP 连接池 |
|
||||
| **注册/配置中心** | Nacos | 2.x | 服务注册与配置管理 |
|
||||
|
||||
### 1.2 工具库使用优先级
|
||||
|
||||
1. **优先使用**: `com.witsoft.common-utils` 中 utils 包封装的类和方法
|
||||
2. **其次使用**: **Hutool** 工具库
|
||||
3. **再次使用**: **Apache Commons** 系列
|
||||
4. **禁止**: 重复造轮子
|
||||
|
||||
---
|
||||
|
||||
## 二、代码规范
|
||||
|
||||
### 2.1 命名规范
|
||||
|
||||
#### 类命名
|
||||
- **类名**: UpperCamelCase 风格,必须为名词
|
||||
- 正确:`UserController`, `UserService`
|
||||
- 例外:领域模型 `DO`/`BO`/`DTO`/`VO` 等后缀
|
||||
|
||||
- **抽象类**: 使用 `Abstract` 或 `Base` 开头
|
||||
- 例如:`AbstractService`, `BaseController`
|
||||
|
||||
- **异常类**: 使用 `Exception` 结尾
|
||||
- 例如:`BizException`, `ValidationException`
|
||||
|
||||
- **测试类**: 以被测试类名开头,以 `Test` 结尾
|
||||
- 例如:`UserServiceTest`
|
||||
|
||||
#### 方法和变量命名
|
||||
- **方法名/变量名**: lowerCamelCase 风格
|
||||
- 正确:`queryUserList`, `localName`, `getUserName`
|
||||
- 禁止:拼音与英文混合、直接使用中文
|
||||
|
||||
- **Service/DAO 层方法前缀**:
|
||||
- 获取单个/多个对象:`query` (如 `queryUser`, `queryUserList`)
|
||||
- 插入:`insert` 或 `save` (如 `insertUser`, `saveOrder`)
|
||||
- 删除:`delete` 或 `batchDelete` (如 `deleteUser`, `batchDeleteOrders`)
|
||||
- 修改:`update` (如 `updateUser`, `updateOrderStatus`)
|
||||
|
||||
#### 常量命名
|
||||
- **常量名**: UPPER_CASE_UNDERSCORE 风格,力求语义完整
|
||||
- 正确:`MAX_USER_COUNT`, `DEFAULT_PAGE_SIZE`
|
||||
- 禁止:不规范的缩写 (如 `AbsClass` 代替 `AbstractClass`)
|
||||
|
||||
- **常量类组织**: 按功能分类,禁止一个常量类维护所有常量
|
||||
- 例如:`CacheConsts`, `ConfigConsts`, `UserConsts`
|
||||
|
||||
#### 包命名
|
||||
- **包名**: 统一使用小写,点分隔符之间有且仅有一个单词
|
||||
- 正确:`com.witsoft.mica.service`, `com.witsoft.util`
|
||||
- 禁止:`com.witsoft.mica.services` (复数)
|
||||
|
||||
#### 其他命名规则
|
||||
- **数组定义**: `String[] args` (中括号是数组类型的一部分)
|
||||
- **布尔类型变量**: 禁止加 `is` 前缀 (避免序列化错误)
|
||||
- 正确:`boolean success`, 方法名 `getSuccess()`
|
||||
- 错误:`boolean isSuccess`, 方法名 `isSuccess()`
|
||||
|
||||
### 2.2 代码格式
|
||||
|
||||
#### 大括号使用
|
||||
```java
|
||||
// 空代码块
|
||||
if (flag == 0) {}
|
||||
|
||||
// 非空代码块
|
||||
if (flag == 1) {
|
||||
System.out.println("world");
|
||||
} else {
|
||||
System.out.println("ok");
|
||||
}
|
||||
```
|
||||
|
||||
**规则**:
|
||||
- 左大括号前不换行
|
||||
- 左大括号后换行
|
||||
- 右大括号前换行
|
||||
- 右大括号后还有 `else` 等代码则不换行
|
||||
- 右大括号表示终止则必须换行
|
||||
|
||||
#### 缩进与空格
|
||||
- **缩进**: 4 个空格,禁止使用 tab 字符
|
||||
- **单行字符数**: 不超过 200 个,超出需换行
|
||||
- **运算符**: 左右必须有一个空格
|
||||
- **关键词**: `if`/`for`/`while` 等与括号之间必须有一个空格
|
||||
- **方法参数**: 多个参数逗号后必须加空格
|
||||
- 例如:`method("aa", "bb", "cc")`
|
||||
|
||||
#### 换行规则
|
||||
- 第二行相对第一行缩进 4 个空格,从第三行开始不再继续缩进
|
||||
- 运算符与下文一起换行
|
||||
- 方法调用的点符号与下文一起换行
|
||||
- 多个参数超长时,逗号后换行
|
||||
|
||||
#### 文件编码
|
||||
- **IDE 编码**: UTF-8
|
||||
- **换行符**: Unix 格式 (LF),禁止使用 Windows 格式 (CRLF)
|
||||
|
||||
### 2.3 OOP 规约
|
||||
|
||||
1. **静态访问**: 直接用类名访问静态变量/方法,禁止通过对象引用访问
|
||||
```java
|
||||
// 正确
|
||||
User user = UserService.getDefaultUser();
|
||||
|
||||
// 错误
|
||||
User user = new UserService().getDefaultUser();
|
||||
```
|
||||
|
||||
2. **覆写方法**: 必须加 `@Override` 注解
|
||||
|
||||
3. **可变参数**:
|
||||
- 相同参数类型、相同业务含义才可使用
|
||||
- 必须放置在参数列表最后
|
||||
- 避免使用 `Object` 类型
|
||||
```java
|
||||
public User getUsers(String type, Integer... ids)
|
||||
```
|
||||
|
||||
4. **接口签名**:
|
||||
- 原则上不允许修改方法签名
|
||||
- 接口过时必须加 `@Deprecated` 注解,并说明新接口
|
||||
|
||||
5. **equals 方法**: 使用常量或确定有值的对象调用
|
||||
```java
|
||||
// 正确
|
||||
"test".equals(object);
|
||||
|
||||
// 错误
|
||||
object.equals("test"); // 可能 NPE
|
||||
```
|
||||
|
||||
6. **序列化**:
|
||||
- 新增属性时不修改 `serialVersionUID`
|
||||
- 完全不兼容升级时修改 `serialVersionUID`
|
||||
|
||||
7. **toString 方法**: POJO 类必须编写,继承的 POJO 需调用 `super.toString()`
|
||||
|
||||
### 2.4 注释规范
|
||||
|
||||
#### 类注释模板
|
||||
```java
|
||||
/**
|
||||
* @menu : 类描述
|
||||
* @Description : 类描述
|
||||
* @ModifyBrief :
|
||||
* @Author : git 账号
|
||||
* @Date : 创建时间
|
||||
* @Version : 3.0
|
||||
* @Param :
|
||||
* @Return :
|
||||
*/
|
||||
```
|
||||
|
||||
#### 方法注释模板
|
||||
```java
|
||||
/**
|
||||
* @Description : 方法描述
|
||||
* @ModifyBrief :
|
||||
* @Author : git 账号
|
||||
* @Date : 创建时间
|
||||
* @Version : 3.0
|
||||
* @Param : 参数说明
|
||||
* @Return : 返回值说明
|
||||
*/
|
||||
```
|
||||
|
||||
#### 注释规则
|
||||
1. **所有公共接口和类**必须包含 Javadoc
|
||||
2. **注释语言**: 中文描述业务背景,技术术语保留英文 (如 NPE、DTO、API)
|
||||
3. **禁止**生成 "Gets the value of X" 这类无意义的 getter/setter 注释
|
||||
4. **复杂算法**必须在代码块上方解释核心逻辑
|
||||
5. **禁止使用 HTML 标签**
|
||||
6. **代码内注释**: 复杂逻辑必须包含行内注释,解释"为什么这样做"而非"做了什么"
|
||||
7. **代码与注释比例**: 约 5:1,行注释使用 `// xxxxxx`
|
||||
|
||||
---
|
||||
|
||||
## 三、异常处理规范
|
||||
|
||||
### 3.1 异常捕获
|
||||
|
||||
1. **禁止**: 捕获 `Exception` 或 `Throwable` 后不做任何处理 (吞掉异常)
|
||||
2. **规范**: 必须捕获具体的异常类
|
||||
3. **日志**: 捕获异常时,调用 `GlobalException.getExceptionMessage(e)`
|
||||
|
||||
### 3.2 异常示例
|
||||
```java
|
||||
// 正确
|
||||
try {
|
||||
userService.queryUser(userId);
|
||||
} catch (UserNotFoundException e) {
|
||||
log.error("用户不存在:userId={}", userId, e);
|
||||
throw new BizException("用户不存在");
|
||||
}
|
||||
|
||||
// 错误 - 禁止吞掉异常
|
||||
try {
|
||||
userService.queryUser(userId);
|
||||
} catch (Exception e) {
|
||||
// 什么都不做
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、数据库规范
|
||||
|
||||
### 4.1 建表规约
|
||||
|
||||
#### 表名命名
|
||||
- **不使用复数名词**
|
||||
- **业务表前缀**: `mica_`
|
||||
- **命名规则**: 小写字母或数字,下划线间隔
|
||||
- 正确:`mica_user_info`, `mica_order_detail`
|
||||
- 禁止:`mica_users`, `1_table`, `table__name`
|
||||
|
||||
#### 标准字段 (所有业务表必须包含)
|
||||
|
||||
| 字段名 | 类型 | 长度 | 是否 NULL | 主键 | 注释 |
|
||||
|--------|------|------|-----------|------|------|
|
||||
| `id` | varchar | 50 | 否 | 是 | 自然主键 |
|
||||
| `ecid` | varchar | 100 | 否 | 否 | 企业编码 (多租户) |
|
||||
| `create_time` | datetime | 3 | 是 | 否 | 创建时间 |
|
||||
| `created_by` | varchar | 50 | 是 | 否 | 创建人 |
|
||||
| `update_time` | datetime | 3 | 是 | 否 | 修改时间 |
|
||||
| `updated_by` | varchar | 50 | 是 | 否 | 修改人 |
|
||||
| `delete_time` | datetime | 3 | 是 | 否 | 删除时间 |
|
||||
| `deleted_by` | varchar | 50 | 是 | 否 | 删除人 |
|
||||
| `delete_mark` | tinyint | 1 | 默认 0 | 否 | 删除标志 0:未删除 1:已删除 |
|
||||
|
||||
#### 字段命名
|
||||
- **小写字母或数字**,下划线间隔
|
||||
- **禁止数字开头**
|
||||
- **禁止两个下划线中间只有数字**
|
||||
- **及时更新字段注释**: 修改字段含义或追加状态时
|
||||
|
||||
#### 索引命名
|
||||
- **唯一索引**: `uk_字段名` (如 `uk_user_name`)
|
||||
- **普通索引**: `idx_字段名` (如 `idx_create_time`)
|
||||
|
||||
#### 数据类型
|
||||
- **小数**: 必须使用 `decimal`,禁止使用 `float` 和 `double`
|
||||
- **字符串**:
|
||||
- `varchar` 长度不超过 5000
|
||||
- 超过 5000 使用 `text` 类型,独立成表,用主键对应
|
||||
|
||||
### 4.2 索引规约
|
||||
|
||||
1. **唯一特性字段**: 即使组合字段也必须建立唯一索引
|
||||
2. **关联查询**: 超过 3 个表禁止 join,被关联字段必须有索引
|
||||
3. **varchar 索引**: 必须指定索引长度 (一般 20 即可达到 90% 区分度)
|
||||
|
||||
### 4.3 SQL 规约
|
||||
|
||||
1. **COUNT 统计**: 使用 `count(*)`,禁止使用 `count(列名)` 或 `count(常量)`
|
||||
2. **NULL 判断**: 使用 `ISNULL()` 函数
|
||||
- `NULL <> NULL` 返回 `NULL`
|
||||
- `NULL = NULL` 返回 `NULL`
|
||||
3. **IN 操作**: 能避免则避免,可用 `EXISTS` 替换,集合元素控制在 1000 个内
|
||||
4. **数据订正**: 删除/修改前先 `SELECT` 确认
|
||||
|
||||
### 4.4 ORM 规约
|
||||
|
||||
1. **查询字段**: 禁止使用 `*`,必须明确写明需要的字段
|
||||
2. **参数传递**: 使用 `#{}`,禁止使用 `${}` (防止 SQL 注入)
|
||||
3. **返回结果**: 禁止直接使用 `HashMap` 或 `Hashtable`
|
||||
4. **更新接口**: 只更新有改动的字段,禁止全字段更新
|
||||
5. **事务控制**:
|
||||
- 不要滥用 `@Transactional`
|
||||
- 考虑缓存回滚、消息补偿等回滚方案
|
||||
|
||||
---
|
||||
|
||||
## 五、统一响应格式
|
||||
|
||||
所有 Controller 层方法返回必须遵循以下 JSON 结构:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": [],
|
||||
"extra": {},
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 六、项目结构规范
|
||||
|
||||
### 6.1 标准分层结构
|
||||
|
||||
```
|
||||
com.witsoft.mica.xxx/
|
||||
├── controller/ # REST 接口层
|
||||
├── domain/ # DTO / VO / 查询参数
|
||||
├── entity/ # 数据库实体 (DO)
|
||||
├── mapper/ # MyBatis-Plus Mapper
|
||||
└── service/ # 业务逻辑层
|
||||
├── XxxService.java
|
||||
└── impl/
|
||||
└── XxxServiceImpl.java
|
||||
```
|
||||
|
||||
### 6.2 各层职责
|
||||
|
||||
- **Controller**: 参数校验、调用 Service、返回统一响应
|
||||
- **Service**: 业务逻辑、事务控制、数据填充
|
||||
- **Mapper**: 数据持久化 (仅简单 CRUD,复杂查询用 XML)
|
||||
- **Entity**: 数据库实体映射 (DO)
|
||||
- **Domain**:
|
||||
- DTO: 数据传输对象
|
||||
- VO: 展示对象
|
||||
- Query: 查询参数对象
|
||||
|
||||
---
|
||||
|
||||
## 七、开发注意事项
|
||||
|
||||
### 7.1 代码复用
|
||||
|
||||
1. **复用优先**: 逻辑雷同时提取公共方法,避免重复代码
|
||||
2. **工具类优先**: 优先使用已有工具类方法
|
||||
|
||||
### 7.2 物料数据规范
|
||||
|
||||
1. **业务表仅存物料 id**: 物料相关字段仅存 `material_id`
|
||||
2. **关联查询填充**: 编码、名称、规格、单位等通过关联查询填充
|
||||
3. **填充在 Service 层**: 关联数据填充逻辑统一在 Service 层处理
|
||||
|
||||
### 7.3 字典使用
|
||||
|
||||
1. **优先使用 DictService**: 字典取值优先使用 `DictService` 公共方法
|
||||
2. **禁止手写**: 不手写字典查询逻辑
|
||||
|
||||
### 7.4 Java 8 兼容性
|
||||
|
||||
1. **禁止 List.of()**: Java 8 不兼容
|
||||
2. **使用**: `Collections.emptyList()` 替代
|
||||
|
||||
### 7.5 版本管理
|
||||
|
||||
1. **首个版本直接改 DDL**: v1.0 脚本直接修改建表语句
|
||||
2. **不需要 ALTER TABLE**: 初始版本不需要写迁移脚本
|
||||
|
||||
---
|
||||
|
||||
## 八、Git 提交约定
|
||||
|
||||
### 8.1 提交规范
|
||||
|
||||
1. **禁止 Agent commit**: Agent 不做任何 commit 操作,只允许查看、修改代码
|
||||
2. **Commit Message**: 提示 commit 时必须附带 commit message,让用户可直接复制运行
|
||||
3. **用户手动提交**: 如需提交代码,由用户手动执行 commit
|
||||
|
||||
### 8.2 配置文件
|
||||
|
||||
- **`application.yml` / `application-local.yml`**: 由用户自行提交
|
||||
- **Agent 绝不碰**: 这两个配置文件的版本管理
|
||||
|
||||
---
|
||||
|
||||
## 九、部署约定
|
||||
|
||||
### 9.1 部署规范
|
||||
|
||||
1. **禁止自动部署**: Agent 不做任何自动部署操作
|
||||
2. **用户手动决定**: 代码修改后由用户手动决定何时部署
|
||||
|
||||
### 9.2 数据库脚本管理
|
||||
|
||||
所有数据库脚本必须按顺序编号,并在 MEMORY.md 中记录执行状态:
|
||||
|
||||
```
|
||||
✅ 00-init.sql - 基础表结构
|
||||
✅ 10-system.sql - 系统数据
|
||||
✅ 20-master-data-init.sql - 基础数据
|
||||
...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 十、物料近似查询规范 (2026-05-29 产品决策)
|
||||
|
||||
### 10.1 searchSimilar() 优先级
|
||||
|
||||
产品决定**不查询规格字段**,按以下优先级分步查询:
|
||||
|
||||
1. **名称精确匹配** (`material_name = keyword`) — 优先级最高
|
||||
2. **名称前缀匹配** (`material_name LIKE 'keyword%'`)
|
||||
3. **名称模糊匹配** (`material_name LIKE '%keyword%'`)
|
||||
4. **编码模糊匹配** (`material_code LIKE '%keyword%'`) — 兜底
|
||||
|
||||
### 10.2 去重原则
|
||||
|
||||
已在前置层级匹配的物料不再在后置层级重复出现。
|
||||
|
||||
### 10.3 旧方法保留
|
||||
|
||||
保留旧 `searchByNameLike()` 方法不动,保持向后兼容。
|
||||
|
||||
---
|
||||
|
||||
## 附录:快速参考
|
||||
|
||||
### 命名速查表
|
||||
|
||||
| 类型 | 规范 | 示例 |
|
||||
|------|------|------|
|
||||
| 类名 | UpperCamelCase | `UserController` |
|
||||
| 方法名 | lowerCamelCase | `queryUserList` |
|
||||
| 变量名 | lowerCamelCase | `userName` |
|
||||
| 常量名 | UPPER_CASE_UNDERSCORE | `MAX_COUNT` |
|
||||
| 包名 | 小写单数 | `com.witsoft.util` |
|
||||
| 表名 | 小写 + 下划线 | `mica_user_info` |
|
||||
| 字段名 | 小写 + 下划线 | `user_name` |
|
||||
| 唯一索引 | `uk_字段名` | `uk_user_name` |
|
||||
| 普通索引 | `idx_字段名` | `idx_create_time` |
|
||||
|
||||
### Service 方法前缀速查
|
||||
|
||||
| 操作 | 前缀 | 示例 |
|
||||
|------|------|------|
|
||||
| 查询单个 | `query` | `queryUser` |
|
||||
| 查询列表 | `query` | `queryUserList` |
|
||||
| 插入 | `insert`/`save` | `insertUser` |
|
||||
| 删除 | `delete` | `deleteUser` |
|
||||
| 批量删除 | `batchDelete` | `batchDeleteUsers` |
|
||||
| 更新 | `update` | `updateUser` |
|
||||
|
||||
---
|
||||
|
||||
**版本**: 1.0
|
||||
**最后更新**: 2026-08-04
|
||||
**维护者**: 后端开发团队
|
||||
@@ -1,88 +0,0 @@
|
||||
# 2026-05-23 会话记忆
|
||||
|
||||
## 项目:tiny-erp
|
||||
|
||||
### 核心决策
|
||||
|
||||
1. **包路径确定**:`com.witsoft.erp`(不是 com.example 或 com.witsoft.tinyerp)
|
||||
- tiny 是项目别名,包名使用正式名称 erp
|
||||
|
||||
2. **技术栈确认**:
|
||||
- JDK 11+(不是 1.8)
|
||||
- Spring Boot 2.7.18
|
||||
- MyBatis Plus 3.5.3.1
|
||||
- PostgreSQL 14+
|
||||
- Spring Security + JWT (jjwt 0.11.5)
|
||||
- SpringDoc OpenAPI 3(不是 Knife4j)
|
||||
|
||||
3. **多租户方案**:ecid 字段隔离 + TenantLineHandler 自动拦截
|
||||
- 系统表(sys_*)不进行租户隔离(登录时需要查询)
|
||||
- 业务表全部需要 ecid 隔离
|
||||
- **所有表的 ecid 字段为 NOT NULL**
|
||||
|
||||
4. **API 设计规范**:
|
||||
- 分页列表接口使用 POST(不是 GET)
|
||||
- 请求体携带查询条件 + 分页参数
|
||||
- 统一返回格式:{code, message, data}
|
||||
|
||||
5. **异常处理规范**:
|
||||
- BusinessException 支持自定义错误码
|
||||
- GlobalExceptionHandler 统一处理各类异常
|
||||
- 参数校验失败返回 400 + 具体错误信息
|
||||
|
||||
6. **模块命名**:基础数据模块(bd)替代主数据模块(md)
|
||||
|
||||
### 已完成模块
|
||||
|
||||
| 模块 | 功能 | 状态 |
|
||||
|------|------|------|
|
||||
| system | 租户、用户、字典、JWT 认证 | ✅ |
|
||||
| bd | 物料分类、工厂、仓库、物料 | ✅ |
|
||||
| om | 销售订单、发货单(含库存扣减) | ✅ |
|
||||
| mc | 采购订单 | ✅ |
|
||||
| im | 库存查询、库存流水 | ✅ |
|
||||
|
||||
### 数据库脚本结构
|
||||
|
||||
```
|
||||
scripts/postgresql/
|
||||
├── 00-init.sql # 数据库初始化
|
||||
├── 10-system.sql # 系统模块
|
||||
├── 20-basic-data.sql # 基础数据模块
|
||||
├── 30-sales.sql # 销售模块
|
||||
├── 40-purchase.sql # 采购模块
|
||||
├── 50-inventory.sql # 库存模块
|
||||
└── 99-data.sql # 初始化数据
|
||||
```
|
||||
|
||||
### 默认账号
|
||||
|
||||
- admin / admin123 / default
|
||||
- test / admin123 / default
|
||||
|
||||
### 待开发功能
|
||||
|
||||
1. 采购收货单 + 库存增加(P0)
|
||||
2. 销售退货单(P1)
|
||||
3. 采购申请单(P1)
|
||||
4. 库存调拨(P1)
|
||||
5. 库存盘点(P1)
|
||||
6. 操作日志、登录日志(P1/P2)
|
||||
7. 报表统计(P2)
|
||||
|
||||
### 关键代码位置
|
||||
|
||||
- JWT 工具:`framework/security/JwtUtil.java`
|
||||
- 租户上下文:`framework/tenant/TenantContext.java`
|
||||
- 租户拦截器:`framework/tenant/TenantLineHandlerImpl.java`
|
||||
- 全局异常:`common/core/GlobalExceptionHandler.java`
|
||||
- 业务异常:`common/core/BusinessException.java`
|
||||
|
||||
### 文档位置
|
||||
|
||||
- README.md:项目根目录
|
||||
- 开发方案:`yangxuan/设计/01-开发方案.md`
|
||||
|
||||
---
|
||||
|
||||
> ⚠️ 2026-05-26: 当前只关注 md(主数据)和 im(库存)模块。om/mc/fin/system/home 代码已存在但不再关注。
|
||||
@@ -1,517 +0,0 @@
|
||||
# 2026-05-25 会话记录
|
||||
|
||||
## 系统模块开发(2026-05-25 13:28)
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **操作日志功能**
|
||||
- 实体类:`OperLog.java`
|
||||
- Mapper:`OperLogMapper.java`
|
||||
- Service:`OperLogService.java` + `OperLogServiceImpl.java`
|
||||
- Controller:`OperLogController.java`
|
||||
- 切面:`LogAspect.java`(自动记录带@Log 注解的方法)
|
||||
- 注解:`@Log`(module、businessType、isSaveRequestData、isSaveResponseData)
|
||||
|
||||
2. **数据字典增强**
|
||||
- 新增方法:`listDataBatch()` - 批量获取字典数据
|
||||
- 新增方法:`listOptions()` - 前端下拉框格式 [{label, value}]
|
||||
- 新增方法:`listOptionsBatch()` - 批量获取下拉框选项
|
||||
- 新增接口:`GET /system/dict/data/options/batch?dictTypes=xxx,yyy`
|
||||
|
||||
3. **文档**
|
||||
- `04-系统模块开发指南.md` - 包含使用示例、API 文档、前端集成示例
|
||||
|
||||
### 业务类型枚举
|
||||
|
||||
| 值 | 含义 |
|
||||
|----|------|
|
||||
| 0 | 其它 |
|
||||
| 1 | 新增 |
|
||||
| 2 | 修改 |
|
||||
| 3 | 删除 |
|
||||
| 4 | 导出 |
|
||||
| 5 | 导入 |
|
||||
| 6 | 审核 |
|
||||
|
||||
### 已初始化字典
|
||||
|
||||
- `inbound_type` - 入库类型(采购入库、退货入库、其他入库)
|
||||
- `outbound_type` - 出库类型(销售出库、领料出库、其他出库)
|
||||
- `stocktake_diff_result` - 盘点结果(相符、盘盈、盘亏)
|
||||
- `payment_method` - 收付款方式(现金、银行转账、承兑汇票)
|
||||
|
||||
### 下一步
|
||||
|
||||
- 主数据模块开发(供应商、客户) ✓
|
||||
- 库存模块开发(入库单、出库单) ✓
|
||||
- 财务模块开发(应收、应付、收款、付款)
|
||||
- 首页模块开发 ✓
|
||||
|
||||
---
|
||||
|
||||
## 首页模块开发(2026-05-25 15:15)
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **欢迎信息接口**
|
||||
- `GET /home/welcome` - 返回欢迎语、用户名、企业名、日期、问候语
|
||||
- 根据时间段自动切换问候语(早上好/中午好/下午好/晚上好/夜深了)
|
||||
- DTO:`HomeWelcomeResDTO.java`
|
||||
|
||||
2. **最新动态接口**
|
||||
- `GET /home/news` - 返回最近 20 条业务动态
|
||||
- 动态类型:入库完成、出库完成、盘点完成、新增供应商、新增客户
|
||||
- 按时间倒序排列
|
||||
- DTO:`HomeNewsItemDTO.java`
|
||||
|
||||
3. **文件清单**
|
||||
- `HomeController.java` - 首页控制器
|
||||
- `HomeService.java` / `HomeServiceImpl.java` - 首页服务
|
||||
- `HomeWelcomeResDTO.java` - 欢迎信息响应
|
||||
- `HomeNewsItemDTO.java` - 动态项 DTO
|
||||
|
||||
### API 示例
|
||||
|
||||
```http
|
||||
GET /home/welcome
|
||||
→ { welcome: "欢迎", userName: "张三", companyName: "某某公司", greeting: "下午好" }
|
||||
|
||||
GET /home/news
|
||||
→ [ { type: "inbound", title: "入库完成", content: "RK202605250001 - 成品仓", operator: "张三", operateTime: "..." } ]
|
||||
```
|
||||
|
||||
### TODO
|
||||
|
||||
- 从用户会话/配置中获取真实用户名和企业名(当前为默认值)
|
||||
|
||||
---
|
||||
|
||||
## 库存模块增强(2026-05-25 14:26)
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **入库单管理 CRUD**
|
||||
- 实体:`Inbound.java` + `InboundItem.java`
|
||||
- DTO:`InboundSaveReqDTO.java` + `InboundItemSaveReqDTO.java`
|
||||
- Mapper:`InboundMapper.java` + `InboundItemMapper.java`
|
||||
- Service:`InboundService.java` + `InboundServiceImpl.java`
|
||||
- Controller:`InboundController.java`
|
||||
- API:分页查询、详情、明细、新增、修改、审核、作废、删除
|
||||
- 审核逻辑:检查状态 → 更新状态 → 增加库存
|
||||
- 作废逻辑:检查状态 → 更新状态 → 扣减库存
|
||||
|
||||
2. **出库单管理 CRUD**
|
||||
- 实体:`Outbound.java` + `OutboundItem.java`
|
||||
- DTO:`OutboundSaveReqDTO.java` + `OutboundItemSaveReqDTO.java`
|
||||
- Mapper:`OutboundMapper.java` + `OutboundItemMapper.java`
|
||||
- Service:`OutboundService.java` + `OutboundServiceImpl.java`
|
||||
- Controller:`OutboundController.java`
|
||||
- API:分页查询、详情、明细、新增、修改、审核、作废、删除
|
||||
- 审核逻辑:检查状态 → **检查库存充足** → 更新状态 → 扣减库存
|
||||
- 作废逻辑:检查状态 → 更新状态 → 恢复库存
|
||||
|
||||
3. **盘点单管理 CRUD**
|
||||
- 实体:`Stocktake.java` + `StocktakeItem.java`
|
||||
- DTO:`StocktakeSaveReqDTO.java` + `StocktakeItemSaveReqDTO.java`
|
||||
- Mapper:`StocktakeMapper.java` + `StocktakeItemMapper.java`
|
||||
- Service:`StocktakeService.java` + `StocktakeServiceImpl.java`
|
||||
- Controller:`StocktakeController.java`
|
||||
- API:分页查询、详情、明细、新增、修改、审核、作废、删除
|
||||
- 审核逻辑:计算差异 → 设置盘点结果 → **调整库存**(盘盈 +,盘亏 -)
|
||||
- 作废逻辑:反向调整库存
|
||||
|
||||
4. **库存服务增强**
|
||||
- 新增方法:`addStock()` - 入库单调用(包含物料信息)
|
||||
- 新增方法:`reduceStock()` - 出库单调用
|
||||
- 新增方法:`checkStock()` - 检查库存是否充足
|
||||
|
||||
5. **文档**
|
||||
- `06-库存模块开发指南.md` - 完整 API 文档、业务流程、测试示例
|
||||
|
||||
### 业务类型字典
|
||||
|
||||
| 类型 | 值 | 标签 |
|
||||
|------|-----|------|
|
||||
| inbound_type | 10 | 采购入库 |
|
||||
| inbound_type | 20 | 退货入库 |
|
||||
| inbound_type | 30 | 其他入库 |
|
||||
| outbound_type | 10 | 销售出库 |
|
||||
| outbound_type | 20 | 领料出库 |
|
||||
| outbound_type | 30 | 其他出库 |
|
||||
| stocktake_diff_result | 0 | 相符 |
|
||||
| stocktake_diff_result | 1 | 盘盈 |
|
||||
| stocktake_diff_result | 2 | 盘亏 |
|
||||
|
||||
### 状态流转
|
||||
|
||||
```
|
||||
草稿 (0) → 已审核 (1) → 已作废 (2)
|
||||
```
|
||||
|
||||
### 编译状态
|
||||
|
||||
```
|
||||
✅ mvn compile 成功
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 主数据模块开发(2026-05-25 13:46)
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **供应商管理 CRUD**
|
||||
- 实体:`Supplier.java`(name、contact、mobile 等简洁字段)
|
||||
- DTO:`SupplierSaveReqDTO.java`
|
||||
- Mapper:`SupplierMapper.java`
|
||||
- Service:`SupplierService.java` + `SupplierServiceImpl.java`
|
||||
- Controller:`SupplierController.java`
|
||||
- API:分页查询、列表、详情、新增、修改、删除
|
||||
- 操作日志:@Log 注解自动记录
|
||||
|
||||
2. **客户管理 CRUD**
|
||||
- 实体:`Customer.java`(增加 level 客户级别字段)
|
||||
- DTO:`CustomerSaveReqDTODTO.java`
|
||||
- Mapper:`CustomerMapper.java`
|
||||
- Service:`CustomerService.java` + `CustomerServiceImpl.java`
|
||||
- Controller:`CustomerController.java`
|
||||
- API:分页查询、列表、详情、新增、修改、删除
|
||||
- 操作日志:@Log 注解自动记录
|
||||
|
||||
3. **文档**
|
||||
- `05-主数据模块开发指南.md` - 包含 API 文档、前端集成示例
|
||||
|
||||
### 设计特点
|
||||
|
||||
- 字段命名参考 ruoyi-pro:`name`、`contact`、`mobile`(简洁风格)
|
||||
- 必填字段仅 `name`,支持快捷新增
|
||||
- 客户级别:10-普通、20-重要、30-VIP(字典数据管理)
|
||||
- 所有操作自动记录日志
|
||||
|
||||
### 编译状态
|
||||
|
||||
```
|
||||
✅ mvn compile 成功
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Tiny-ERP 表架构设计与实现
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **表架构设计文档**
|
||||
- 位置:`/home/yangxuan/Projects/IdeaProjects/tiny-erp/yangxuan/设计/表架构设计.md`
|
||||
- 参考项目:ruoyi-vue-pro(别名 ruoyi-pro)
|
||||
- 设计原则:务实、简洁、不过度设计
|
||||
|
||||
2. **SQL 脚本生成与执行**
|
||||
- `20-master-data.sql` - 主数据模块(供应商、客户表参考 ruoyi-pro 风格)
|
||||
- `50-inventory.sql` - 库存模块(入库/出库/盘点单及明细)
|
||||
- `60-finance.sql` - 财务模块(应收/应付/收款/付款及核销明细)
|
||||
- `99-data.sql` - 初始化数据(修复为幂等脚本)
|
||||
|
||||
3. **数据库表统计**
|
||||
- 系统模块:5 表(含操作日志)
|
||||
- 主数据:6 表(供应商、客户)
|
||||
- 销售:4 表
|
||||
- 采购:2 表
|
||||
- 库存:8 表(入库/出库/盘点)
|
||||
- 财务:8 表(应收/应付/收款/付款 + 核销明细)
|
||||
- **总计:27 表**
|
||||
|
||||
4. **关键设计决策**
|
||||
- 供应商/客户字段命名参考 ruoyi-pro:`name`、`contact`、`mobile`(去掉冗余前缀)
|
||||
- 应收应付按物料明细记录(fi_receivable_item / fi_payable_item)
|
||||
- 数量:NUMERIC(12,3),金额/单价:NUMERIC(18,2)
|
||||
- 所有业务表包含 ecid 字段实现多租户隔离
|
||||
- 99-data.sql 使用 `INSERT ... SELECT ... WHERE NOT EXISTS` 实现幂等
|
||||
|
||||
### 待确认事项(已确认)
|
||||
|
||||
| 序号 | 事项 | 结论 |
|
||||
|------|------|------|
|
||||
| 1 | 多仓库管理 | 不需要 |
|
||||
| 2 | 批次/序列号 | 不需要 |
|
||||
| 3 | 应收应付物料明细 | 需要 ✓ |
|
||||
| 4 | 多计量单位换算 | 不需要 |
|
||||
|
||||
### 数据库状态
|
||||
|
||||
- 数据库名:`tinyerp`
|
||||
- 连接方式:Unix socket (`/var/run/postgresql`)
|
||||
- 所有脚本执行成功,无 ERROR
|
||||
- 初始化数据:1 租户、1 用户 (admin)、6 字典类型、16 字典数据
|
||||
|
||||
### 下一步
|
||||
|
||||
- 开始 Java 后端开发
|
||||
- 实体类设计参考 ruoyi-pro 的 DO 结构
|
||||
|
||||
---
|
||||
|
||||
## 入库出库优化(2026-05-25 16:44)
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **生产入库 & 采购入库**
|
||||
- DTO:`ProductionInboundSaveReqDTO.java`、`ProductionInboundItemReqDTO.java`
|
||||
- DTO:`PurchaseInboundSaveReqDTO.java`、`PurchaseInboundItemReqDTO.java`
|
||||
- 接口:`POST /im/inbound/production`、`POST /im/inbound/purchase`
|
||||
- 特点:生产入库无需单价,采购入库含单价
|
||||
|
||||
2. **领料出库 & 销售出库**
|
||||
- DTO:`MaterialOutboundSaveReqDTO.java`、`MaterialOutboundItemReqDTO.java`
|
||||
- DTO:`SalesOutboundSaveReqDTO.java`、`SalesOutboundItemReqDTO.java`
|
||||
- 接口:`POST /im/outbound/material`、`POST /im/outbound/sales`
|
||||
- 特点:领料出库无需单价,销售出库含单价
|
||||
|
||||
3. **入库/出库历史查询**
|
||||
- DTO:`InboundHistoryQueryReqDTO.java`、`InboundHistoryDTO.java`
|
||||
- DTO:`OutboundHistoryQueryReqDTO.java`、`OutboundHistoryDTO.java`
|
||||
- 接口:`POST /im/inbound/history-list`、`POST /im/outbound/history-list`
|
||||
- 功能:查询已审核的单据,返回汇总信息
|
||||
|
||||
4. **物料信息填充**
|
||||
- 保存时自动填充物料编码、名称、规格、单位
|
||||
- 避免后续关联查询,提高查询性能
|
||||
|
||||
5. **文档**
|
||||
- `04-入库出库优化 - 实现总结.md` - 完整 API 文档、测试示例
|
||||
|
||||
### 编译状态
|
||||
```
|
||||
✅ mvn compile 成功
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 实时库存 & 库存盘点(2026-05-25 17:16)
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **实时库存分页查询**
|
||||
- DTO:`StockPageQueryReqDTO.java`、`StockPageDTO.java`
|
||||
- 接口:`POST /im/stock/page`
|
||||
- 功能:带安全库存校验,返回 `isLowStock` 标识
|
||||
- 校验规则:最小安全库存 > 0 且 库存 < 最小安全库存 → 库存过低
|
||||
|
||||
2. **最小安全库存管理**
|
||||
- 接口:`PUT /md/material/{id}/safe-qty` - 更新最小安全库存
|
||||
- 接口:`PUT /md/material/{id}/safe-qty/clear` - 清除(设置为 0)
|
||||
- 使用 MyBatis XML 实现(支持设置为 0)
|
||||
- 字段:`md_material.min_safe_qty NUMERIC(12,3)`
|
||||
|
||||
3. **快速盘点**
|
||||
- DTO:`StocktakeQuickSaveReqDTO.java`、`StocktakeQuickItemReqDTO.java`
|
||||
- 接口:`POST /im/stocktake/quick-save`
|
||||
- 功能:批量保存盘点单(草稿),自动获取当前库存作为账面数量
|
||||
|
||||
4. **盘点历史列表**
|
||||
- DTO:`StocktakeHistoryQueryReqDTO.java`、`StocktakeHistoryDTO.java`
|
||||
- 接口:`POST /im/stocktake/history-list`
|
||||
- 日期范围:`today`(当日)、`week`(近 7 日)、`month`(近 30 日)
|
||||
|
||||
5. **MyBatis XML 按模块分类**
|
||||
- `mapper/md/material/MaterialMapper.xml` - 物料模块
|
||||
- `mapper/im/stock/StockMapper.xml` - 库存模块
|
||||
|
||||
### 数字格式规范
|
||||
| 字段类型 | 数据库类型 | 小数位 | 展示规则 |
|
||||
|---------|-----------|--------|---------|
|
||||
| 数量 | NUMERIC(12,3) | 3 | 小数全为 0 时不展示 |
|
||||
| 单价/金额 | NUMERIC(11,2) | 2 | 小数全为 0 时不展示 |
|
||||
|
||||
### 编译状态
|
||||
```
|
||||
✅ mvn compile 成功
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 库存积压分析(2026-05-25 17:23)
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **积压统计(按分类分组)**
|
||||
- DTO:`StockOverstockDTO.java`、`StockOverstockQueryReqDTO.java`
|
||||
- 接口:`POST /im/stock/overstock/summary`
|
||||
- 返回:分类、物料数量、积压金额、平均积压天数
|
||||
- 默认积压阈值:90 天
|
||||
|
||||
2. **积压明细(下钻页面)**
|
||||
- DTO:`StockOverstockDetailDTO.java`
|
||||
- 接口:`POST /im/stock/overstock/detail`
|
||||
- 参数:`category`(分类筛选)、`sortBy`(amount/qty 排序)
|
||||
- 返回:物料编码、名称、规格、库存数量、单价、积压天数、积压金额
|
||||
|
||||
3. **SQL 实现**
|
||||
- 积压判定:最后入库日期 < 当前日期 - 阈值
|
||||
- 单价计算:平均入库单价
|
||||
- 积压金额 = 库存数量 × 平均单价
|
||||
|
||||
### 新增文件
|
||||
- `StockMapper.xml` - 积压统计和明细 SQL
|
||||
- `06-库存积压分析 - 实现总结.md` - 完整文档
|
||||
|
||||
### 编译状态
|
||||
```
|
||||
✅ mvn compile 成功
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 项目规范建立(2026-05-25 17:17-18:32)
|
||||
|
||||
### Git 操作规范
|
||||
- ⛔ **禁止自动 push** - 所有 commit 后必须人工审查
|
||||
- ✅ 流程:编译验证 → 提交代码 → 停止等待 → 人工确认后手动 push
|
||||
|
||||
### Java 语法规范
|
||||
- ☕ **只能使用 Java 8 语法**
|
||||
- ❌ 禁止:`var`、`Map.of()`、`List.of()`、switch 表达式、文本块、record
|
||||
- ✅ 推荐:Lambda、Stream API、Optional、方法引用
|
||||
|
||||
### 状态字段规范
|
||||
| 值 | 含义 |
|
||||
|----|------|
|
||||
| 0 | 有效(默认) |
|
||||
| 1 | 无效 |
|
||||
|
||||
### 架构规范
|
||||
- Service 层处理业务逻辑(查询、填充、组装)
|
||||
- Controller 层保持简洁(调用 Service、返回结果)
|
||||
- 接口支持可选字段参数(`withStock`、`withCategoryName`)提高复用性
|
||||
|
||||
### 本地开发规范
|
||||
- ✅ 支持免登录(请求头 `X-User-Id` 或默认用户)
|
||||
- ⚠️ 仅 local 环境启用,生产环境严禁开启
|
||||
|
||||
---
|
||||
|
||||
## 物料分页查询重构(2026-05-25 18:15-18:37)
|
||||
|
||||
### 完成的工作
|
||||
|
||||
1. **Java 填充方案(替代 XML JOIN)**
|
||||
- 删除:`MaterialMapper.xml` 中的复杂 JOIN 查询
|
||||
- 删除:`MaterialListWithStockReqDTO.java`、`MaterialWithStockDTO.java`
|
||||
- 新增:`MaterialPageDTO.java`、`MaterialPageQueryReqDTO.java`
|
||||
- 逻辑:Service 层批量查询库存和分类,内存填充
|
||||
|
||||
2. **可选字段参数**
|
||||
- `withStock`(默认 true)- 是否返回库存数量
|
||||
- `withCategoryName`(默认 true)- 是否返回分类名称
|
||||
- 性能优化:不查关联时只需 1 次 SQL
|
||||
|
||||
3. **本地开发免登录**
|
||||
- 配置:`development.mock-auth.enabled`
|
||||
- 请求头:`X-User-Id`、`X-User-Name`、`X-Nickname` 等
|
||||
- 过滤器:`UserContextFilter` 支持免登录模式
|
||||
|
||||
4. **代码整理**
|
||||
- 简化 `MaterialController.java` - 移除 XML 查询接口
|
||||
- 精简 `MaterialMapper.java` - 只保留安全库存更新方法
|
||||
- 重构 `MaterialServiceImpl.java` - 添加 `pageWithStock()` 方法
|
||||
|
||||
### 性能对比
|
||||
| 场景 | withStock | withCategoryName | SQL 次数 |
|
||||
|------|-----------|------------------|---------|
|
||||
| 下拉选择器 | ❌ | ❌ | 1 |
|
||||
| 简单列表 | ❌ | ❌ | 1 |
|
||||
| 库存管理 | ✅ | ❌ | 2 |
|
||||
| 完整展示 | ✅ | ✅ | 3 |
|
||||
|
||||
### 编译状态
|
||||
```
|
||||
✅ mvn compile 成功
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 今日提交统计(未 push)
|
||||
|
||||
```
|
||||
feat: 实现入库出库优化功能
|
||||
feat: 实现实时库存和盘点功能
|
||||
feat: 实现库存积压分析功能
|
||||
refactor: 按模块分类 MyBatis XML 文件
|
||||
fix: 修复物料查询 XML 中的字段错误
|
||||
docs: 更新物料状态注释
|
||||
feat: 物料分页查询改为 Java 填充关联数据
|
||||
refactor: 物料分页查询逻辑移至 Service 层
|
||||
feat: 物料分页查询支持可选字段
|
||||
refactor: 删除物料 XML 查询,统一使用 Service 层 Java 填充
|
||||
feat: 本地开发支持免登录
|
||||
```
|
||||
|
||||
**总计**: 约 15 个 commit,4300+ 行新增,200+ 行删除
|
||||
|
||||
---
|
||||
|
||||
## 待办事项
|
||||
|
||||
1. **数据库迁移** - 添加 `md_material.min_safe_qty` 字段
|
||||
2. **前端开发** - 实时库存、盘点、积压分析页面
|
||||
3. **测试验证** - 使用 HTTP 测试文件验证所有接口
|
||||
4. **代码审查** - 人工审查后执行 git push
|
||||
## 下午-晚间增量(2026-05-25 18:37~20:18)
|
||||
|
||||
### 实体-DDL 字段对齐
|
||||
|
||||
| 文件 | 字段 | 操作 |
|
||||
|------|------|------|
|
||||
| `Stock.java` | `category`, `safeQty` | 彻底删除(非表字段) |
|
||||
| `Outbound.java` | `warehouseName`, `totalQuantity` | 彻底删除(非表字段) |
|
||||
| `Stocktake.java` | `warehouseName` | 彻底删除(非表字段) |
|
||||
| `StockServiceImpl.java` | `safeQty` 操作 | 改为读写 `md_material.min_safe_qty` |
|
||||
|
||||
### 模糊查询支持特殊字符
|
||||
|
||||
- 创建 `LikeEscapeUtil.java` — 转义 `\`、`%`、`_`
|
||||
- 物料/客户/供应商分页查询全部接入转义
|
||||
- 客户/供应商 `/list` 接口新增 `keyword` 参数支持名称+编码联合模糊
|
||||
- **踩坑**:`ESCAPE '\\'` 被 MyBatis-Plus COUNT 包装解析失败 → 移除 `ESCAPE` 子句,利用 PostgreSQL 默认 `\` 为转义字符
|
||||
|
||||
### 最小安全库存
|
||||
|
||||
- DDL `20-master-data.sql` 新增 `min_safe_qty NUMERIC(12,3) DEFAULT 0`
|
||||
- 升级脚本 `upgrade/v1.0.1-alter-material-add-min-safe-qty.sql`
|
||||
- 库存分页返回 `isLowStock` 标识(库存 < min_safe_qty → 过低)
|
||||
- 接口:`PUT /md/material/{id}/safe-qty` / `PUT /md/material/{id}/safe-qty/clear`
|
||||
|
||||
### 主数据初始化脚本修正
|
||||
|
||||
| 改动 | 说明 |
|
||||
|------|------|
|
||||
| `safety_stock` 列和值 | 从 INSERT 语句中删除 |
|
||||
| `supplier_code` / `customer_code` | 补全编码值 |
|
||||
| 物料名称规格空格 | 对齐文档(如"宝塔3斜纹") |
|
||||
|
||||
### DDL 补充字段
|
||||
|
||||
| 表 | 新增字段 |
|
||||
|----|---------|
|
||||
| `md_supplier` | `supplier_code VARCHAR(50)`, `phone VARCHAR(20)`, `address VARCHAR(200)` |
|
||||
| `md_customer` | `customer_code VARCHAR(50)`, `phone VARCHAR(20)`, `address VARCHAR(200)`, `level INTEGER DEFAULT 0` |
|
||||
|
||||
### 今日提交统计(全部未 push)
|
||||
|
||||
```
|
||||
418cd10 fix: 修复库存积压报表仅入库物料积压天数基准错误
|
||||
e8d7bb4 docs: 重构文档目录结构,按模块分类组织
|
||||
8a38d33 feat: 入库单/出库单 inboundDate/outboundDate 为空时默认当天
|
||||
373a292 feat: 供应商/客户DDL补充编码、联系电话、地址、客户级别字段
|
||||
6c338d1 feat: 根据文档补充default租户主数据初始化脚本的编码字段和物料名称修正
|
||||
d17b970 feat: 物料/客户/供应商模糊查询支持特殊字符转义及客户供应商列表接口
|
||||
f02f048 feat: DDL增加md_material.min_safe_qty字段及升级脚本
|
||||
5de00d3 feat: 清理非表字段,最小安全库存统一走md_material.min_safe_qty
|
||||
(plus safety_stock removal commit)
|
||||
```
|
||||
|
||||
**原则**: 代码改动与文档改动分 commit,禁止自动 push,人工审查后手动操作。
|
||||
|
||||
### 环境配置
|
||||
|
||||
- MySQL 运行时 `tiny_erp` 数据库已配置 `min_safe_qty`
|
||||
- 开发免登录配置:`development.mock-auth.enabled`
|
||||
@@ -1,699 +0,0 @@
|
||||
# 2026-05-26 会话记忆
|
||||
|
||||
## 本周聚焦
|
||||
|
||||
- 只关注 **tiny-erp**,不处理其他项目
|
||||
- 只关注 **md(主数据)** 和 **im(库存)** 两个模块
|
||||
- **不再关注** om(销售)、mc(采购)、fin(财务)、home、system 等其他模块
|
||||
|
||||
## 模块路径确认
|
||||
|
||||
包路径: `com.witsoft.erp`
|
||||
项目路径: `/home/yangxuan/Projects/IdeaProjects/tiny-erp`
|
||||
|
||||
### md 模块(主数据)
|
||||
`module/md/` — 已完整实现
|
||||
- `category` — 物料分类
|
||||
- `customer` — 客户
|
||||
- `factory` — 工厂
|
||||
- `material` — 物料
|
||||
- `supplier` — 供应商
|
||||
- `warehouse` — 仓库
|
||||
|
||||
### im 模块(库存)
|
||||
`module/im/` — 已完整实现
|
||||
- `inbound` — 入库单(含采购入库、生产入库)
|
||||
- `outbound` — 出库单
|
||||
- `stock` — 库存查询、库存流水、呆滞分析
|
||||
- `stocktake` — 库存盘点(含快速盘点)
|
||||
|
||||
## 原记忆清理
|
||||
|
||||
旧记忆(memory/2026-05-23.md)中关于 `bd` 模块的命名实际上是 `md`(代码实际使用的是 `md`,不是 `bd`)。
|
||||
ome/mc/fin/home/system 模块依然存在但不处理。
|
||||
|
||||
## 注释规范(已写入 MEMORY.md)
|
||||
|
||||
1. 所有公共接口和类必须包含 Javadoc
|
||||
2. 注释语言:中文描述业务背景,技术术语保留英文(如 NPE)
|
||||
3. 禁止生成 "Gets the value of X" 这类无意义的 getter/setter 注释
|
||||
4. 复杂算法必须在代码块上方解释核心逻辑
|
||||
5. 禁止使用 HTML 标签
|
||||
|
||||
## 开发注意事项(已写入 MEMORY.md)
|
||||
|
||||
1. **复用优先**:逻辑雷同时提取公共方法复用
|
||||
2. **业务表仅存物料 id**:物料相关字段仅存 `material_id`,其他数据通过关联查询填充
|
||||
3. **填充在 Service 层**:关联数据填充逻辑统一在 Service 层处理
|
||||
4. **首个版本直接改 DDL**:脚本直接修改建表语句,不需要写 ALTER TABLE
|
||||
5. **字典优先用 DictService**:字典取值优先使用 DictService 公共方法
|
||||
|
||||
## 库存业务表字段清理
|
||||
|
||||
**背景:** 业务表只存物料 ID,物料编码/名称/规格/单位通过关联查询填充。
|
||||
|
||||
**DDL 改动(50-inventory.sql):**
|
||||
- `im_stock` — 移除 material_code, material_name, spec, unit
|
||||
- `im_stock_transaction` — 移除 material_code, material_name
|
||||
- `im_inbound_item` — 移除 material_code, material_name, spec, unit
|
||||
- `im_outbound_item` — 移除 material_code, material_name, spec, unit
|
||||
|
||||
**实体类:** Stock, StockTransaction, InboundItem, OutboundItem — 移除对应字段
|
||||
|
||||
**请求 DTO:** InboundItemSaveReqDTO, OutboundItemSaveReqDTO, StocktakeItemSaveReqDTO, QuickStocktakeItemDTO — 只保留 materialId
|
||||
|
||||
**接口改动:**
|
||||
- StockTransactionService.recordTransaction() — 移除 materialCode/materialName 参数
|
||||
- MaterialService — 新增 searchMaterialIdsByKeyword() 方法
|
||||
|
||||
**Service 改动:**
|
||||
- StockTransactionServiceImpl — keyword 搜索改为两步(先查物料表匹配 ID);DTO 填充从 materialInfoMap 读取
|
||||
- StockServiceImpl — 同上
|
||||
- InboundServiceImpl — saveItems 不 set 冗余字段;recordTransaction 去参;history 从 material 填充
|
||||
- OutboundServiceImpl — 同上
|
||||
- MaterialServiceImpl — 实现 searchMaterialIdsByKeyword()
|
||||
|
||||
**编译验证:** `mvn compile -q` ✅
|
||||
|
||||
## Git 提交约定
|
||||
|
||||
- **commit 跳过 application.yml** — `git add` 时用 `git add . -- ':!application.yml'` 或手动排除
|
||||
- **commit 后不要 push** — 只做本地提交,不推送远程
|
||||
# 2026-05-26 会话记忆
|
||||
|
||||
## 物料信息填充公共服务 (MaterialFillService)
|
||||
|
||||
### 核心设计决策
|
||||
|
||||
1. **实体设计原则**
|
||||
- `InboundItem` 和 `OutboundItem` 只存储 `materialId`
|
||||
- 不存储物料编码、名称、规格、单位等字段
|
||||
- 防止物料信息变更后历史数据不一致
|
||||
|
||||
2. **批量查询模式**
|
||||
```java
|
||||
List<Long> materialIds = items.stream().map(Item::getMaterialId).collect(Collectors.toList());
|
||||
Map<Long, MaterialInfoDTO> materialInfoMap = materialFillService.getMaterialInfoMap(materialIds);
|
||||
```
|
||||
- 避免 N+1 查询问题
|
||||
- 一次查询所有物料信息,性能更优
|
||||
|
||||
3. **Service 层填充**
|
||||
- 所有物料信息填充逻辑在 Service 层处理
|
||||
- Controller 只负责返回 DTO
|
||||
- 不放在 Mapper 或 Controller 层
|
||||
|
||||
### 修改的 Service 类(共 6 个)
|
||||
|
||||
| Service | 方法 | 用途 |
|
||||
|---------|------|------|
|
||||
| InboundServiceImpl | executeInbound(), cancel() | 入库/冲销时记录流水 |
|
||||
| OutboundServiceImpl | executeOutbound(), cancel() | 出库/冲销时记录流水 |
|
||||
| FinAccountsAutoServiceImpl | createApFromInbound(), cancelApFromInbound() | 采购应付联动 |
|
||||
| FinAccountsAutoServiceImpl | createArFromOutbound(), cancelArFromOutbound() | 销售应收联动 |
|
||||
| HomeServiceImpl | getLatestNews() | 首页动态显示 |
|
||||
| DeliveryServiceImpl | confirmOutbound() | 发货确认 |
|
||||
|
||||
### 物料类型字典
|
||||
|
||||
- Dict Type: `material_type`
|
||||
- 值:`P`-原材料,`SA`-半成品,`FG`-成品
|
||||
- SQL 脚本:`scripts/postgresql/22-material-type-dict.sql`
|
||||
|
||||
### Git 状态
|
||||
|
||||
- 所有修改已 commit(13+ commits)
|
||||
- **禁止 push** - 用户明确要求
|
||||
- 分支:master
|
||||
|
||||
### 经验教训
|
||||
|
||||
1. 修改实体类后,所有引用该实类的地方都要检查
|
||||
2. 编译错误可能分散在多个模块(im, fin, home, om)
|
||||
3. 使用 `mvn clean compile` 确保完整编译,避免 IDE 缓存误导
|
||||
# 2026-05-26 会话记忆
|
||||
|
||||
## 本周聚焦
|
||||
|
||||
- 只关注 **tiny-erp**,不处理其他项目
|
||||
- 只关注 **md(主数据)** 和 **im(库存)** 两个模块
|
||||
- **不再关注** om(销售)、mc(采购)、fin(财务)、home、system 等其他模块
|
||||
|
||||
## 模块路径确认
|
||||
|
||||
包路径: `com.witsoft.erp`
|
||||
项目路径: `/home/yangxuan/Projects/IdeaProjects/tiny-erp`
|
||||
|
||||
### md 模块(主数据)
|
||||
`module/md/` — 已完整实现
|
||||
- `category` — 物料分类
|
||||
- `customer` — 客户
|
||||
- `factory` — 工厂
|
||||
- `material` — 物料
|
||||
- `supplier` — 供应商
|
||||
- `warehouse` — 仓库
|
||||
|
||||
### im 模块(库存)
|
||||
`module/im/` — 已完整实现
|
||||
- `inbound` — 入库单(含采购入库、生产入库)
|
||||
- `outbound` — 出库单
|
||||
- `stock` — 库存查询、库存流水、呆滞分析
|
||||
- `stocktake` — 库存盘点(含快速盘点)
|
||||
|
||||
## 原记忆清理
|
||||
|
||||
旧记忆(memory/2026-05-23.md)中关于 `bd` 模块的命名实际上是 `md`(代码实际使用的是 `md`,不是 `bd`)。
|
||||
ome/mc/fin/home/system 模块依然存在但不处理。
|
||||
|
||||
## 注释规范(已写入 MEMORY.md)
|
||||
|
||||
1. 所有公共接口和类必须包含 Javadoc
|
||||
2. 注释语言:中文描述业务背景,技术术语保留英文(如 NPE)
|
||||
3. 禁止生成 "Gets the value of X" 这类无意义的 getter/setter 注释
|
||||
4. 复杂算法必须在代码块上方解释核心逻辑
|
||||
5. 禁止使用 HTML 标签
|
||||
|
||||
## 开发注意事项(已写入 MEMORY.md)
|
||||
|
||||
1. **复用优先**:逻辑雷同时提取公共方法复用
|
||||
2. **业务表仅存物料 id**:物料相关字段仅存 `material_id`,其他数据通过关联查询填充
|
||||
3. **填充在 Service 层**:关联数据填充逻辑统一在 Service 层处理
|
||||
4. **首个版本直接改 DDL**:脚本直接修改建表语句,不需要写 ALTER TABLE
|
||||
5. **字典优先用 DictService**:字典取值优先使用 DictService 公共方法
|
||||
|
||||
## Git 提交约定
|
||||
|
||||
- **commit 跳过 application.yml** — `git add . -- ':!application.yml'` 排除,防止泄露配置
|
||||
- **commit 后不要 push** — 只做本地 commit,不推送远程仓库
|
||||
|
||||
## 库存业务表字段清理
|
||||
|
||||
**背景:** 业务表只存物料 ID,物料编码/名称/规格/单位通过关联查询填充。
|
||||
|
||||
**DDL 改动(50-inventory.sql):**
|
||||
- `im_stock` — 移除 material_code, material_name, spec, unit
|
||||
- `im_stock_transaction` — 移除 material_code, material_name
|
||||
- `im_inbound_item` — 移除 material_code, material_name, spec, unit
|
||||
- `im_outbound_item` — 移除 material_code, material_name, spec, unit
|
||||
|
||||
**实体类:** Stock, StockTransaction, InboundItem, OutboundItem — 移除对应字段
|
||||
|
||||
**请求 DTO:** InboundItemSaveReqDTO, OutboundItemSaveReqDTO, StocktakeItemSaveReqDTO, QuickStocktakeItemDTO — 只保留 materialId
|
||||
|
||||
**接口改动:**
|
||||
- StockTransactionService.recordTransaction() — 移除 materialCode/materialName 参数
|
||||
- MaterialService — 新增 searchMaterialIdsByKeyword() 方法
|
||||
|
||||
**Service 改动:**
|
||||
- StockTransactionServiceImpl — keyword 搜索改为两步(先查物料表匹配 ID);DTO 填充从 materialInfoMap 读取
|
||||
- StockServiceImpl — 同上
|
||||
- InboundServiceImpl — saveItems 不 set 冗余字段;recordTransaction 去参;history 从 material 填充
|
||||
- OutboundServiceImpl — 同上
|
||||
- MaterialServiceImpl — 实现 searchMaterialIdsByKeyword()
|
||||
|
||||
**编译验证:** `mvn compile -q` ✅
|
||||
|
||||
## 物料信息填充公共服务 (MaterialFillService)
|
||||
|
||||
### 核心设计决策
|
||||
|
||||
1. **实体设计原则**
|
||||
- `InboundItem` 和 `OutboundItem` 只存储 `materialId`
|
||||
- 不存储物料编码、名称、规格、单位等字段
|
||||
- 防止物料信息变更后历史数据不一致
|
||||
|
||||
2. **批量查询模式**
|
||||
```java
|
||||
List<Long> materialIds = items.stream().map(Item::getMaterialId).collect(Collectors.toList());
|
||||
Map<Long, MaterialInfoDTO> materialInfoMap = materialFillService.getMaterialInfoMap(materialIds);
|
||||
```
|
||||
- 避免 N+1 查询问题
|
||||
- 一次查询所有物料信息,性能更优
|
||||
|
||||
3. **Service 层填充**
|
||||
- 所有物料信息填充逻辑在 Service 层处理
|
||||
- Controller 只负责返回 DTO
|
||||
- 不放在 Mapper 或 Controller 层
|
||||
|
||||
### 修改的 Service 类(共 6 个)
|
||||
|
||||
| Service | 方法 | 用途 |
|
||||
|---------|------|------|
|
||||
| InboundServiceImpl | executeInbound(), cancel() | 入库/冲销时记录流水 |
|
||||
| OutboundServiceImpl | executeOutbound(), cancel() | 出库/冲销时记录流水 |
|
||||
| FinAccountsAutoServiceImpl | createApFromInbound(), cancelApFromInbound() | 采购应付联动 |
|
||||
| FinAccountsAutoServiceImpl | createArFromOutbound(), cancelArFromOutbound() | 销售应收联动 |
|
||||
| HomeServiceImpl | getLatestNews() | 首页动态显示 |
|
||||
| DeliveryServiceImpl | confirmOutbound() | 发货确认 |
|
||||
|
||||
### 物料类型字典
|
||||
|
||||
- Dict Type: `material_type`
|
||||
- 值:`P`-原材料,`SA`-半成品,`FG`-成品
|
||||
- SQL 脚本:`scripts/postgresql/22-material-type-dict.sql`
|
||||
|
||||
### Git 状态
|
||||
|
||||
- 所有修改已 commit(13+ commits)
|
||||
- **禁止 push** - 用户明确要求
|
||||
- 分支:master
|
||||
|
||||
## 物料选择器(Material Selector)
|
||||
|
||||
新增物料选择器功能,用于入库/出库操作时弹窗选物料。
|
||||
|
||||
### 接口
|
||||
|
||||
| 接口 | 位置 | 数据源 | 仓库参数 |
|
||||
|------|------|--------|---------|
|
||||
| `POST /im/inbound/material-selector` | InboundController | md_material | 不需要 |
|
||||
| `POST /im/outbound/material-selector` | OutboundController | im_stock JOIN md_material | 需要 warehouseId |
|
||||
|
||||
### 请求参数(MaterialSelectorReqDTO → md.material.dto)
|
||||
|
||||
- `categoryId` — 0=常用物料,>0=按分类筛选
|
||||
- `keyword` — 物料编码/名称/规格关键字
|
||||
- `warehouseId` — 出库场景需要
|
||||
- 继承 `PageQuery`(pageNum, pageSize)
|
||||
|
||||
### 常用物料 TOP10 逻辑
|
||||
|
||||
- **口径:** 近 30 天出入库明细条目数最多的 10 个物料
|
||||
- **入库:** `im_inbound_item` GROUP BY material_id ORDER BY COUNT(*) DESC LIMIT 10
|
||||
- **出库:** `im_outbound_item` 同上
|
||||
- **SQL 放 Mapper XML**(方便后续扩展)
|
||||
|
||||
### 分类筛选逻辑
|
||||
|
||||
- **入库:** MyBatis Plus LambdaQueryWrapper 查 `md_material` 表,按 `category_id` + `keyword` 分页
|
||||
- **出库:** XML 联表 `im_stock JOIN md_material`,按 `category_id` + `keyword` + `warehouseId` 分页,只查库存 > 0 的数据
|
||||
|
||||
### 响应
|
||||
|
||||
- 复用 `StockPageDTO`(im.stock.dto)
|
||||
- 物料编码/名称/规格/单位/分类等从 `MaterialFillService` 填充
|
||||
|
||||
### 新增文件(7个)
|
||||
|
||||
| 文件 | 路径 |
|
||||
|------|------|
|
||||
| MaterialSelectorReqDTO | md.material.dto |
|
||||
| MaterialSelectorService | md.material.service |
|
||||
| MaterialSelectorServiceImpl | md.material.service.impl |
|
||||
| InboundItemMapper.xml | resources/mapper/im/ |
|
||||
| OutboundItemMapper.xml | resources/mapper/im/ |
|
||||
| StockMapper.xml | resources/mapper/im/ |
|
||||
| | |
|
||||
|
||||
### 修改文件(5个)
|
||||
|
||||
| 文件 | 改动 |
|
||||
|------|------|
|
||||
| InboundItemMapper.java | + selectRecentMaterialIds() |
|
||||
| OutboundItemMapper.java | + selectRecentMaterialIds() |
|
||||
| StockMapper.java | + selectStockPage() / countStockPage() |
|
||||
| InboundController.java | + /material-selector 端点 |
|
||||
| OutboundController.java | + /material-selector 端点 |
|
||||
|
||||
## 历史单据创建人名称
|
||||
|
||||
### 改动
|
||||
|
||||
- **InboundHistoryItemDTO** — 新增 `creatorName` 字段
|
||||
- **OutboundHistoryItemDTO** — 新增 `creatorName` 字段
|
||||
- **InboundServiceImpl.listHistory()** — 收集 creators → 批量查 sys_user(username→nickname) → 填充
|
||||
- **OutboundServiceImpl.listHistory()** — 同上
|
||||
|
||||
### 逻辑
|
||||
|
||||
1. 从单据列表收集所有 `creator`(用户名)
|
||||
2. `userService.lambdaQuery().in(User::getUsername, creators).list()`
|
||||
3. 转 `Map<String, String>`(username → nickname)
|
||||
4. 逐行 `dto.setCreatorName()`
|
||||
5. 一次 SQL,不 N+1
|
||||
# 2026-05-26 会话记忆
|
||||
|
||||
## 本周聚焦
|
||||
|
||||
- 只关注 **tiny-erp**,不处理其他项目
|
||||
- 只关注 **md(主数据)** 和 **im(库存)** 两个模块
|
||||
- **不再关注** om(销售)、mc(采购)、fin(财务)、home、system 等其他模块
|
||||
|
||||
## 模块路径确认
|
||||
|
||||
包路径: `com.witsoft.erp`
|
||||
项目路径: `/home/yangxuan/Projects/IdeaProjects/tiny-erp`
|
||||
|
||||
### md 模块(主数据)
|
||||
`module/md/` — 已完整实现
|
||||
- `category` — 物料分类
|
||||
- `customer` — 客户
|
||||
- `factory` — 工厂
|
||||
- `material` — 物料
|
||||
- `supplier` — 供应商
|
||||
- `warehouse` — 仓库
|
||||
|
||||
### im 模块(库存)
|
||||
`module/im/` — 已完整实现
|
||||
- `inbound` — 入库单(含采购入库、生产入库)
|
||||
- `outbound` — 出库单
|
||||
- `stock` — 库存查询、库存流水、呆滞分析
|
||||
- `stocktake` — 库存盘点(含快速盘点)
|
||||
|
||||
## 原记忆清理
|
||||
|
||||
旧记忆(memory/2026-05-23.md)中关于 `bd` 模块的命名实际上是 `md`(代码实际使用的是 `md`,不是 `bd`)。
|
||||
ome/mc/fin/home/system 模块依然存在但不处理。
|
||||
|
||||
## 注释规范(已写入 MEMORY.md)
|
||||
|
||||
1. 所有公共接口和类必须包含 Javadoc
|
||||
2. 注释语言:中文描述业务背景,技术术语保留英文(如 NPE)
|
||||
3. 禁止生成 "Gets the value of X" 这类无意义的 getter/setter 注释
|
||||
4. 复杂算法必须在代码块上方解释核心逻辑
|
||||
5. 禁止使用 HTML 标签
|
||||
|
||||
## 开发注意事项(已写入 MEMORY.md)
|
||||
|
||||
1. **复用优先**:逻辑雷同时提取公共方法复用
|
||||
2. **业务表仅存物料 id**:物料相关字段仅存 `material_id`,其他数据通过关联查询填充
|
||||
3. **填充在 Service 层**:关联数据填充逻辑统一在 Service 层处理
|
||||
4. **首个版本直接改 DDL**:脚本直接修改建表语句,不需要写 ALTER TABLE
|
||||
5. **字典优先用 DictService**:字典取值优先使用 DictService 公共方法
|
||||
|
||||
## Git 提交约定
|
||||
|
||||
- **commit 跳过 application.yml** — `git add . -- ':!application.yml'` 排除,防止泄露配置
|
||||
- **commit 后不要 push** — 只做本地 commit,不推送远程仓库
|
||||
|
||||
## 库存业务表字段清理
|
||||
|
||||
**背景:** 业务表只存物料 ID,物料编码/名称/规格/单位通过关联查询填充。
|
||||
|
||||
**DDL 改动(50-inventory.sql):**
|
||||
- `im_stock` — 移除 material_code, material_name, spec, unit
|
||||
- `im_stock_transaction` — 移除 material_code, material_name
|
||||
- `im_inbound_item` — 移除 material_code, material_name, spec, unit
|
||||
- `im_outbound_item` — 移除 material_code, material_name, spec, unit
|
||||
|
||||
**实体类:** Stock, StockTransaction, InboundItem, OutboundItem — 移除对应字段
|
||||
|
||||
**请求 DTO:** InboundItemSaveReqDTO, OutboundItemSaveReqDTO, StocktakeItemSaveReqDTO, QuickStocktakeItemDTO — 只保留 materialId
|
||||
|
||||
**接口改动:**
|
||||
- StockTransactionService.recordTransaction() — 移除 materialCode/materialName 参数
|
||||
- MaterialService — 新增 searchMaterialIdsByKeyword() 方法
|
||||
|
||||
**Service 改动:**
|
||||
- StockTransactionServiceImpl — keyword 搜索改为两步(先查物料表匹配 ID);DTO 填充从 materialInfoMap 读取
|
||||
- StockServiceImpl — 同上
|
||||
- InboundServiceImpl — saveItems 不 set 冗余字段;recordTransaction 去参;history 从 material 填充
|
||||
- OutboundServiceImpl — 同上
|
||||
- MaterialServiceImpl — 实现 searchMaterialIdsByKeyword()
|
||||
|
||||
**编译验证:** `mvn compile -q` ✅
|
||||
|
||||
## 物料信息填充公共服务 (MaterialFillService)
|
||||
|
||||
### 核心设计决策
|
||||
|
||||
1. **实体设计原则**
|
||||
- `InboundItem` 和 `OutboundItem` 只存储 `materialId`
|
||||
- 不存储物料编码、名称、规格、单位等字段
|
||||
- 防止物料信息变更后历史数据不一致
|
||||
|
||||
2. **批量查询模式**
|
||||
```java
|
||||
List<Long> materialIds = items.stream().map(Item::getMaterialId).collect(Collectors.toList());
|
||||
Map<Long, MaterialInfoDTO> materialInfoMap = materialFillService.getMaterialInfoMap(materialIds);
|
||||
```
|
||||
- 避免 N+1 查询问题
|
||||
- 一次查询所有物料信息,性能更优
|
||||
|
||||
3. **Service 层填充**
|
||||
- 所有物料信息填充逻辑在 Service 层处理
|
||||
- Controller 只负责返回 DTO
|
||||
- 不放在 Mapper 或 Controller 层
|
||||
|
||||
### 修改的 Service 类(共 6 个)
|
||||
|
||||
| Service | 方法 | 用途 |
|
||||
|---------|------|------|
|
||||
| InboundServiceImpl | executeInbound(), cancel() | 入库/冲销时记录流水 |
|
||||
| OutboundServiceImpl | executeOutbound(), cancel() | 出库/冲销时记录流水 |
|
||||
| FinAccountsAutoServiceImpl | createApFromInbound(), cancelApFromInbound() | 采购应付联动 |
|
||||
| FinAccountsAutoServiceImpl | createArFromOutbound(), cancelArFromOutbound() | 销售应收联动 |
|
||||
| HomeServiceImpl | getLatestNews() | 首页动态显示 |
|
||||
| DeliveryServiceImpl | confirmOutbound() | 发货确认 |
|
||||
|
||||
### 物料类型字典
|
||||
|
||||
- Dict Type: `material_type`
|
||||
- 值:`P`-原材料,`SA`-半成品,`FG`-成品
|
||||
- SQL 脚本:`scripts/postgresql/22-material-type-dict.sql`
|
||||
|
||||
### Git 状态
|
||||
|
||||
- 所有修改已 commit(13+ commits)
|
||||
- **禁止 push** - 用户明确要求
|
||||
- 分支:master
|
||||
|
||||
## 物料选择器(Material Selector)
|
||||
|
||||
新增物料选择器功能,用于入库/出库操作时弹窗选物料。
|
||||
|
||||
### 接口
|
||||
|
||||
| 接口 | 位置 | 数据源 | 仓库参数 |
|
||||
|------|------|--------|---------|
|
||||
| `POST /im/inbound/material-selector` | InboundController | md_material | 不需要 |
|
||||
| `POST /im/outbound/material-selector` | OutboundController | im_stock JOIN md_material | 需要 warehouseId |
|
||||
|
||||
### 请求参数(MaterialSelectorReqDTO → md.material.dto)
|
||||
|
||||
- `categoryId` — 0=常用物料,>0=按分类筛选
|
||||
- `keyword` — 物料编码/名称/规格关键字
|
||||
- `warehouseId` — 出库场景需要
|
||||
- 继承 `PageQuery`(pageNum, pageSize)
|
||||
|
||||
### 常用物料 TOP10 逻辑
|
||||
|
||||
- **口径:** 近 30 天出入库明细条目数最多的 10 个物料
|
||||
- **入库:** `im_inbound_item` GROUP BY material_id ORDER BY COUNT(*) DESC LIMIT 10
|
||||
- **出库:** `im_outbound_item` 同上
|
||||
- **SQL 放 Mapper XML**(方便后续扩展)
|
||||
|
||||
### 分类筛选逻辑
|
||||
|
||||
- **入库:** MyBatis Plus LambdaQueryWrapper 查 `md_material` 表,按 `category_id` + `keyword` 分页
|
||||
- **出库:** XML 联表 `im_stock JOIN md_material`,按 `category_id` + `keyword` + `warehouseId` 分页,只查库存 > 0 的数据
|
||||
|
||||
### 响应
|
||||
|
||||
- 复用 `StockPageDTO`(im.stock.dto)
|
||||
- 物料编码/名称/规格/单位/分类等从 `MaterialFillService` 填充
|
||||
|
||||
### 新增文件(7个)
|
||||
|
||||
| 文件 | 路径 |
|
||||
|------|------|
|
||||
| MaterialSelectorReqDTO | md.material.dto |
|
||||
| MaterialSelectorService | md.material.service |
|
||||
| MaterialSelectorServiceImpl | md.material.service.impl |
|
||||
| InboundItemMapper.xml | resources/mapper/im/ |
|
||||
| OutboundItemMapper.xml | resources/mapper/im/ |
|
||||
| StockMapper.xml | resources/mapper/im/ |
|
||||
| | |
|
||||
|
||||
### 修改文件(5个)
|
||||
|
||||
| 文件 | 改动 |
|
||||
|------|------|
|
||||
| InboundItemMapper.java | + selectRecentMaterialIds() |
|
||||
| OutboundItemMapper.java | + selectRecentMaterialIds() |
|
||||
| StockMapper.java | + selectStockPage() / countStockPage() |
|
||||
| InboundController.java | + /material-selector 端点 |
|
||||
| OutboundController.java | + /material-selector 端点 |
|
||||
|
||||
## 历史单据创建人名称
|
||||
|
||||
### 改动
|
||||
|
||||
- **InboundHistoryItemDTO** — 新增 `creatorName` 字段
|
||||
- **OutboundHistoryItemDTO** — 新增 `creatorName` 字段
|
||||
- **InboundServiceImpl.listHistory()** — 收集 creators → 批量查 sys_user(username→nickname) → 填充
|
||||
- **OutboundServiceImpl.listHistory()** — 同上
|
||||
|
||||
### 逻辑
|
||||
|
||||
1. 从单据列表收集所有 `creator`(用户名)
|
||||
2. `userService.lambdaQuery().in(User::getUsername, creators).list()`
|
||||
3. 转 `Map<String, String>`(username → nickname)
|
||||
4. 逐行 `dto.setCreatorName()`
|
||||
5. 一次 SQL,不 N+1
|
||||
|
||||
## 实体名称字段清理(SupplierName/CustomerName/WarehouseName)
|
||||
|
||||
### 背景
|
||||
单据实体(Inbound、Outbound、PurchaseOrder、SalesOrder、Delivery)及其 Item 实体中,之前还存储了供应商名称、客户名称、仓库名称等冗余字段。本次清理全部移除,只存 ID,显示名称通过 master-data 查询填充。
|
||||
|
||||
### 涉及实体
|
||||
- **Inbound** — 移除 `supplierName`, `warehouseName`
|
||||
- **Outbound** — 移除 `customerName`, `warehouseName`
|
||||
- **PurchaseOrder** — 移除 `supplierName`
|
||||
- **PurchaseOrderItem** — 移除了 `materialCode`, `materialName`, `spec`, `unit`(之前已完成)
|
||||
- **SalesOrder** — 移除 `customerName`
|
||||
- **SalesOrderItem** — 移除了物料冗余字段(之前已完成)
|
||||
- **Delivery** — 移除 `customerName`
|
||||
- **DeliveryItem** — 移除了物料冗余字段(之前已完成)
|
||||
|
||||
### DTO 改动
|
||||
- **InboundSaveReqDTO / PurchaseInboundSaveReqDTO / ProductionInboundSaveReqDTO** — 只保留 supplierId/warehouseId,移除 supplierName/warehouseName
|
||||
- **OutboundSaveReqDTO / SalesOutboundSaveReqDTO / MaterialOutboundSaveReqDTO** — 只保留 customerId/warehouseId,移除 customerName/warehouseName
|
||||
- **InboundHistoryItemDTO / OutboundHistoryItemDTO** — **保留** display name 字段(响应 DTO 需要显示),通过 master-data lookup 填充
|
||||
|
||||
### 不做改动
|
||||
- **Ar.java / Ap.java** — 保留 customerName / supplierName 作为财务历史快照
|
||||
- **InboundHistoryItemDTO / OutboundHistoryItemDTO** — 保留 name 字段供前端展示
|
||||
|
||||
### 主要 Service 改动
|
||||
|
||||
| 文件 | 改动内容 |
|
||||
|------|---------|
|
||||
| **InboundServiceImpl.java** | 注入 WarehouseMapper;移除 entity setSupplierName/setWarehouseName;history DTO 名通过 supplierMapper + warehouseMapper 批量 lookup;autoInboundFromOrder 用 supplierId 取代 supplierName;updatePurchaseOrderAfterInbound 用 supplierId 查询 |
|
||||
| **OutboundServiceImpl.java** | 注入 WarehouseMapper;移除 entity setCustomerName;history DTO 名通过 customerMapper + warehouseMapper 批量 lookup |
|
||||
| **FinAccountsAutoServiceImpl.java** | `createApFromInbound`/`cancelApFromInbound` 使用 supplierMapper 查询 supplierName 填充 Ap;`createArFromOutbound`/`cancelArFromOutbound` 使用 customerMapper 查询 customerName |
|
||||
| **PurchaseOrderServiceImpl.java** | `setSupplierName(reqDTO.getSupplierName())` → `setSupplierId(reqDTO.getSupplierId())` |
|
||||
| **SalesOrderServiceImpl.java** | `setCustomerName(reqDTO.getCustomerName())` → `setCustomerId(reqDTO.getCustomerId())` |
|
||||
| **DeliveryServiceImpl.java** | `setCustomerName(order.getCustomerName())` → `setCustomerId(order.getCustomerId())`;item 用 `materialFillService` 填充物料信息 |
|
||||
|
||||
### 控制器查询条件
|
||||
- PurchaseOrderController / SalesOrderController / DeliveryController — 查询条件从名称改为 ID
|
||||
|
||||
### 编译验证
|
||||
- `mvn clean compile` ✅ — 零错误
|
||||
|
||||
## 集成测试(InboundOutboundIntegrationTest)
|
||||
|
||||
### 文件路径
|
||||
`src/test/java/com/witsoft/erp/im/InboundOutboundIntegrationTest.java`
|
||||
|
||||
### 设计
|
||||
- 使用 `TestRestTemplate`,`webEnvironment = RANDOM_PORT`
|
||||
- `@TestMethodOrder(MethodOrderer.OrderAnnotation.class)` 按顺序执行
|
||||
- 复用已有的 `Result<T>` 泛型返回包装类
|
||||
|
||||
### 测试覆盖(11 个用例)
|
||||
|
||||
| 序号 | 端点 | 说明 |
|
||||
|------|------|------|
|
||||
| 1 | POST /erp/system/user/login | 登录获取 Bearer token |
|
||||
| 2 | POST /erp/im/inbound/production | 生产入库(2 行物料) |
|
||||
| 3 | POST /erp/im/inbound/purchase | 采购入库(含单价) |
|
||||
| 4 | POST /erp/im/inbound/history-list | 查询入库历史 |
|
||||
| 5 | POST /erp/im/outbound/material | 领料出库 |
|
||||
| 6 | POST /erp/im/outbound/sales | 销售出库(含单价) |
|
||||
| 7 | POST /erp/im/outbound/history-list | 查询出库历史 |
|
||||
| 8 | POST /erp/im/inbound/auto-from-order | 自动入库(基于采购订单) |
|
||||
| 9 | POST /erp/im/stock/transaction/page | 查询库存流水 |
|
||||
| 10 | DELETE /erp/im/inbound/{id} | 撤销入库单 |
|
||||
| 11 | DELETE /erp/im/outbound/{id} | 撤销出库单 |
|
||||
|
||||
### 注意事项
|
||||
- `application.yml` 中 `server.servlet.context-path: /erp`,所有路径须带 `/erp` 前缀
|
||||
- 测试需要准备基础数据:物料 ID=3/4、供应商 ID=1、客户 ID=1、仓库 ID=1、采购订单 ID=1
|
||||
- 当前 `authToken` 未通过 TestRestTemplate 的 basic auth,走的是 token-auth 模式
|
||||
- 登录密码写的是 `***`,需要按实际数据库密码修改 `TEST_PASSWORD` 常量
|
||||
## Controller 集成测试(TestRestTemplate)
|
||||
|
||||
### 现有测试文件
|
||||
|
||||
| 测试类 | 路径 | 用例数 | 覆盖 Controller |
|
||||
|--------|------|--------|----------------|
|
||||
| InboundOutboundIntegrationTest | `im/InboundOutboundIntegrationTest.java` | 11 | Inbound + Outbound(合并) |
|
||||
| StockControllerTest | `im/stock/StockControllerTest.java` | 17 | StockController |
|
||||
| StocktakeControllerTest | `im/stocktake/StocktakeControllerTest.java` | 17 | StocktakeController |
|
||||
| InboundControllerTest | `im/inbound/InboundControllerTest.java` | 21 | InboundController |
|
||||
| OutboundControllerTest | `im/outbound/OutboundControllerTest.java` | 21 | OutboundController |
|
||||
|
||||
### 测试设计模式(所有测试统一)
|
||||
|
||||
1. **TestRestTemplate + RANDOM_PORT** — 自动分配端口,避免冲突
|
||||
2. **@TestMethodOrder(OrderAnnotation.class)** — 按 Order 顺序执行
|
||||
3. **CONTEXT_PATH = "/erp"** — 手动拼接,因为自动 context-path 处理不可靠
|
||||
4. **assumeToken() 守卫** — 登录失败后通过 `Assumptions.assumeTrue(authToken != null)` 跳过后续测试,避免 403
|
||||
5. **密码可配置** — `System.getProperty("test.password", "admin123")`,通过 `-Dtest.password=xxx` 覆盖
|
||||
6. **url() 辅助方法** — `"http://localhost:" + port + CONTEXT_PATH + path`
|
||||
|
||||
### InboundControllerTest(21 用例)
|
||||
|
||||
| 序号 | 端点 | 验证 |
|
||||
|------|------|------|
|
||||
| 1 | POST /system/user/login | 登录获取 Bearer token |
|
||||
| 2-3 | POST /im/inbound/material-selector | 物料选择器(分类筛选) |
|
||||
| 4-6 | POST /im/inbound | 新增 + 明细为空/类型为空校验边界 |
|
||||
| 7-8 | GET /im/inbound/{id} | 详情 / 不存在返回 null |
|
||||
| 9 | GET /im/inbound/{id}/items | 明细列表 |
|
||||
| 10 | PUT /im/inbound | 修改 |
|
||||
| 11-12 | PUT /im/inbound/{id}/cancel | 撤销 / 重复撤销 400 |
|
||||
| 13-14 | DELETE /im/inbound/{id} | 删除 |
|
||||
| 15-16 | POST /im/inbound/page | 分页(全查/仓库筛选) |
|
||||
| 17 | POST /im/inbound/history-list | 历史明细列表 |
|
||||
| 18 | POST /im/inbound/production | 生产入库 |
|
||||
| 19-20 | POST /im/inbound/purchase | 采购入库 / 供应商为空 400 |
|
||||
| 21 | POST /im/inbound/auto-from-order | 自动入库-订单不存在 400 |
|
||||
|
||||
### OutboundControllerTest(21 用例)
|
||||
|
||||
| 序号 | 端点 | 验证 |
|
||||
|------|------|------|
|
||||
| 1 | POST /system/user/login | 登录 |
|
||||
| 2-3 | POST /im/outbound/material-selector | 物料选择器 |
|
||||
| 4-6 | POST /im/outbound | 新增 + 明细为空/客户为空校验 |
|
||||
| 7-8 | GET /im/outbound/{id} | 详情 / 不存在 |
|
||||
| 9 | GET /im/outbound/{id}/items | 明细 |
|
||||
| 10 | PUT /im/outbound | 修改 |
|
||||
| 11-12 | PUT /im/outbound/{id}/cancel | 撤销 / 重复撤销 400 |
|
||||
| 13-14 | DELETE /im/outbound/{id} | 删除 |
|
||||
| 15-16 | POST /im/outbound/page | 分页(全查/客户筛选) |
|
||||
| 17 | POST /im/outbound/history-list | 历史明细 |
|
||||
| 18-19 | POST /im/outbound/material | 领料出库 / 明细为空 400 |
|
||||
| 20-21 | POST /im/outbound/sales | 销售出库 / 客户为空 400 |
|
||||
|
||||
### StockControllerTest(17 用例)
|
||||
|
||||
覆盖 StockController 全部 4 个端点:
|
||||
|
||||
| 序号 | 端点 | 验证 |
|
||||
|------|------|------|
|
||||
| 1 | POST /system/user/login | 登录 |
|
||||
| 2-6 | POST /im/stock/page | 空参数、仓库筛选、关键字、无匹配关键字、自定义分页 |
|
||||
| 7-11 | POST /im/stock/list | 空、仓库、关键字、预警筛选、无匹配关键字 |
|
||||
| 12-13 | GET /im/stock/{materialId} | 存在/不存在 |
|
||||
| 14-16 | PUT /im/stock/safe-qty | 正常设置、物料不存在 400、参数校验 |
|
||||
| 17 | POST /im/stock/page | DTO 字段完整性验证 |
|
||||
|
||||
### StocktakeControllerTest(17 用例)
|
||||
|
||||
覆盖 StocktakeController 全部 10 个端点:
|
||||
|
||||
| 序号 | 端点 | 验证 |
|
||||
|------|------|------|
|
||||
| 1 | POST /system/user/login | 登录 |
|
||||
| 2-3 | POST /im/stocktake | 新增(草稿)/ 明细为空 400 |
|
||||
| 4-5 | GET /im/stocktake/{id} | 详情 / 不存在 |
|
||||
| 6 | GET /im/stocktake/{id}/items | 明细(含物料信息) |
|
||||
| 7 | PUT /im/stocktake | 修改 |
|
||||
| 8-9 | PUT /im/stocktake/{id}/audit | 审核 / 重复审核 400 |
|
||||
| 10-11 | PUT /im/stocktake/{id}/cancel | 作废 |
|
||||
| 12 | DELETE /im/stocktake/{id} | 删除 |
|
||||
| 13 | POST /im/stocktake/quick-save | 快速盘点(创建即审核) |
|
||||
| 14-15 | POST /im/stocktake/page | 分页(筛选/空 body) |
|
||||
| 16-17 | POST /im/stocktake/history-list | 历史明细(空条件) |
|
||||
|
||||
### 已知问题
|
||||
- **InboundController.getPage() 有两个 @RequestBody** — 测试用 Map 代理
|
||||
- **OutboundController.getPage() 同理**
|
||||
- **StocktakeController.getPage() 同理**
|
||||
- 密码默认 `admin123`,通过 `-Dtest.password=xxx` 配置
|
||||
- IntelliJ 解析 `junit-platform-launcher:1.8.2` 失败,已在 pom.xml 中添加依赖
|
||||
@@ -1,422 +0,0 @@
|
||||
# 2026-05-27 会话记录
|
||||
|
||||
## 问题修复
|
||||
|
||||
### 1. MyBatis-Plus 空集合 IN 子句异常
|
||||
|
||||
**问题:** `selectBatchIds` 传入空集合时生成 `IN ()` 非法 SQL,导致 JSQLParser 解析失败。
|
||||
|
||||
**修复位置:**
|
||||
- `InboundServiceImpl.listHistory()` - 供应商、仓库查询
|
||||
- `OutboundServiceImpl.listHistory()` - 客户、仓库查询
|
||||
|
||||
**解决方案:** 使用三元表达式避免空集合查询
|
||||
```java
|
||||
Map<Long, String> supplierNameMap = supplierIds.isEmpty() ? new HashMap<>() :
|
||||
supplierMapper.selectBatchIds(supplierIds).stream()
|
||||
.collect(Collectors.toMap(Supplier::getId, Supplier::getName));
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2. JavaScript 精度丢失问题
|
||||
|
||||
**问题:** 雪花算法生成的 Long 类型 ID(如 `2059467259520360450`)超出 JS 安全整数范围,前端接收后精度丢失为 `2059467259520360400`。
|
||||
|
||||
**解决方案:** 创建 `JacksonConfig.java`,全局配置 Long 类型序列化为字符串
|
||||
```java
|
||||
@Configuration
|
||||
public class JacksonConfig {
|
||||
@Bean
|
||||
public Module longToStringModule() {
|
||||
return new SimpleModule()
|
||||
.addSerializer(Long.class, ToStringSerializer.instance)
|
||||
.addSerializer(long.class, ToStringSerializer.instance);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**效果:**
|
||||
- `Long` 类型 → 字符串(`"2059467259520360450"`)
|
||||
- `Integer` 类型 → 保持数字(`code: 200`)
|
||||
|
||||
---
|
||||
|
||||
### 3. creatorName 为 null
|
||||
|
||||
**根因:** `BaseEntity.creator` 字段自动填充时存的是用户昵称(如"管理员"),但查询逻辑错误地用 `creator` 的值去匹配 `sys_user.username` 字段。
|
||||
|
||||
**修复:**
|
||||
1. `MyMetaObjectHandler.java` - 添加默认值兜底:昵称 → 登录名 → "系统"
|
||||
2. `InboundServiceImpl` / `OutboundServiceImpl` - 直接使用 `creator` 字段值作为 `creatorName`
|
||||
|
||||
---
|
||||
|
||||
### 4. 安全库存字段命名
|
||||
|
||||
**问题:** `StockSafeQtyReqDTO.safeQty` 实际含义是最小安全库存,字段名不准确。
|
||||
|
||||
**修复:**
|
||||
- 字段名:`safeQty` → `minSafeQty`
|
||||
- 注释和验证提示同步更新
|
||||
|
||||
---
|
||||
|
||||
### 5. 库存详情接口填充物料信息
|
||||
|
||||
**需求:** `/im/stock/{materialId}` 接口需要返回物料相关信息。
|
||||
|
||||
**实现:**
|
||||
1. 新建 `StockDetailDTO` - 包含库存、物料、仓库信息
|
||||
2. `StockService.getStockDetail()` - 使用 `MaterialFillService` 填充物料信息
|
||||
3. 查询仓库信息填充仓库名称
|
||||
|
||||
---
|
||||
|
||||
## 部署操作
|
||||
|
||||
### 测试环境 Docker 重新部署
|
||||
|
||||
**命令:**
|
||||
```bash
|
||||
cd /home/yangxuan/Projects/IdeaProjects/tiny-erp
|
||||
docker compose stop app
|
||||
docker compose rm -f app
|
||||
docker compose build --no-cache app
|
||||
docker compose up -d app
|
||||
```
|
||||
|
||||
**状态:** ✅ 部署成功,健康检查通过
|
||||
|
||||
---
|
||||
|
||||
## 待办事项
|
||||
|
||||
- [x] 清理 `im_inbound_item` / `im_outbound_item` 脏数据(主表记录不存在的明细)
|
||||
- [x] 考虑添加外键约束防止未来产生脏数据
|
||||
- [x] 创建测试环境部署文档 → `/home/yangxuan/Projects/IdeaProjects/tiny-erp/doc/测试环境部署文档.md`
|
||||
- [x] 强调 Maven 构建前提(`mvn clean install`)
|
||||
# 2026-05-27 会话记录
|
||||
|
||||
## 问题修复
|
||||
|
||||
### 1. MyBatis-Plus 空集合 IN 子句异常
|
||||
|
||||
**问题:** `selectBatchIds` 传入空集合时生成 `IN ()` 非法 SQL,导致 JSQLParser 解析失败。
|
||||
|
||||
**修复位置:**
|
||||
- `InboundServiceImpl.listHistory()` - 供应商、仓库查询
|
||||
- `OutboundServiceImpl.listHistory()` - 客户、仓库查询
|
||||
|
||||
**解决方案:** 使用三元表达式避免空集合查询
|
||||
```java
|
||||
Map<Long, String> supplierNameMap = supplierIds.isEmpty() ? new HashMap<>() :
|
||||
supplierMapper.selectBatchIds(supplierIds).stream()
|
||||
.collect(Collectors.toMap(Supplier::getId, Supplier::getName));
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2. JavaScript 精度丢失问题
|
||||
|
||||
**问题:** 雪花算法生成的 Long 类型 ID(如 `2059467259520360450`)超出 JS 安全整数范围,前端接收后精度丢失为 `2059467259520360400`。
|
||||
|
||||
**解决方案:** 创建 `JacksonConfig.java`,全局配置 Long 类型序列化为字符串
|
||||
```java
|
||||
@Configuration
|
||||
public class JacksonConfig {
|
||||
@Bean
|
||||
public Module longToStringModule() {
|
||||
return new SimpleModule()
|
||||
.addSerializer(Long.class, ToStringSerializer.instance)
|
||||
.addSerializer(long.class, ToStringSerializer.instance);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**效果:**
|
||||
- `Long` 类型 → 字符串(`"2059467259520360450"`)
|
||||
- `Integer` 类型 → 保持数字(`code: 200`)
|
||||
|
||||
---
|
||||
|
||||
### 3. creatorName 为 null
|
||||
|
||||
**根因:** `BaseEntity.creator` 字段自动填充时存的是用户昵称(如"管理员"),但查询逻辑错误地用 `creator` 的值去匹配 `sys_user.username` 字段。
|
||||
|
||||
**修复:**
|
||||
1. `MyMetaObjectHandler.java` - 添加默认值兜底:昵称 → 登录名 → "系统"
|
||||
2. `InboundServiceImpl` / `OutboundServiceImpl` - 直接使用 `creator` 字段值作为 `creatorName`
|
||||
|
||||
---
|
||||
|
||||
### 4. 安全库存字段命名
|
||||
|
||||
**问题:** `StockSafeQtyReqDTO.safeQty` 实际含义是最小安全库存,字段名不准确。
|
||||
|
||||
**修复:**
|
||||
- 字段名:`safeQty` → `minSafeQty`
|
||||
- 注释和验证提示同步更新
|
||||
|
||||
---
|
||||
|
||||
### 5. 库存详情接口填充物料信息
|
||||
|
||||
**需求:** `/im/stock/{materialId}` 接口需要返回物料相关信息。
|
||||
|
||||
**实现:**
|
||||
1. 新建 `StockDetailDTO` - 包含库存、物料、仓库信息
|
||||
2. `StockService.getStockDetail()` - 使用 `MaterialFillService` 填充物料信息
|
||||
3. 查询仓库信息填充仓库名称
|
||||
|
||||
---
|
||||
|
||||
### 6. 安全库存接口统一
|
||||
|
||||
**需求:** 将安全库存相关接口从 `MaterialController` 统一迁移到 `StockController`。
|
||||
|
||||
**修改内容:**
|
||||
- ✅ `StockController` - 新增 3 个接口(设置、批量设置、清除安全库存)
|
||||
- ✅ `StockService` / `StockServiceImpl` - 实现新增方法
|
||||
- ❌ `MaterialController` - 删除 2 个安全库存接口
|
||||
- ❌ `MaterialService` / `MaterialServiceImpl` - 删除相关方法
|
||||
- ❌ `MaterialMapper` / `MaterialMapper.xml` - 删除相关 SQL
|
||||
|
||||
**新 API:**
|
||||
- `PUT /im/stock/safe-qty` - 设置安全库存(单个)
|
||||
- `PUT /im/stock/safe-qty/batch` - 批量设置安全库存
|
||||
- `PUT /im/stock/{materialId}/safe-qty/clear` - 清除安全库存
|
||||
|
||||
---
|
||||
|
||||
### 7. 库存详情接口填充 minSafeQty
|
||||
|
||||
**问题:** `StockServiceImpl.getStockDetail()` 漏掉了 `minSafeQty` 字段填充。
|
||||
|
||||
**修复:** 添加 `dto.setMinSafeQty(material.getMinSafeQty());`
|
||||
|
||||
---
|
||||
|
||||
### 8. /home/welcome 接口数据写死
|
||||
|
||||
**问题:** 用户名、公司名、欢迎语都是硬编码。
|
||||
|
||||
**修复:**
|
||||
- 使用 `UserContext.getNickname()` 获取真实用户名
|
||||
- 使用 `TenantContext.getTenantName()` 获取企业名称
|
||||
- 保留兜底逻辑("用户"、"企业")
|
||||
|
||||
---
|
||||
|
||||
## 数据库变更
|
||||
|
||||
### 增量脚本执行
|
||||
|
||||
**脚本 1:** `scripts/postgresql/fix-fin-add-order-date.sql`
|
||||
- `fin_ar` 表:添加 `order_date` 字段(DATE 类型)
|
||||
- `fin_ap` 表:添加 `order_date` 字段(DATE 类型)
|
||||
- 数据初始化:将 `create_time` 转换为日期赋值给 `order_date`
|
||||
|
||||
**脚本 2:** `scripts/postgresql/fix-write-off-add-updater.sql`
|
||||
- `fin_ar_write_off` 表:添加 `updater`、`update_time` 字段
|
||||
- `fin_ap_write_off` 表:添加 `updater`、`update_time` 字段
|
||||
- 数据初始化:将 `creator`/`create_time` 赋值给 `updater`/`update_time`
|
||||
|
||||
**执行方式:**
|
||||
```bash
|
||||
docker compose exec db psql -U postgres -d tinyerp \
|
||||
-f /docker-entrypoint-initdb.d/migrations/20260527_add_column.sql
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 文档更新
|
||||
|
||||
### 1. 部署文档合并
|
||||
|
||||
- ✅ 将 `~/tiny/测试环境部署文档.md` 合并到 `DOCKER.md`
|
||||
- ✅ 新增 4 个部署场景(首次部署、重新部署、只重启、彻底重置)
|
||||
- ✅ 强调 Maven 构建前提(`mvn clean install -DskipTests`)
|
||||
- ✅ 完善故障排查表格
|
||||
- ❌ 删除重复文档 `~/tiny/测试环境部署文档.md`
|
||||
|
||||
### 2. 库存接口文档
|
||||
|
||||
- ✅ 创建 `doc/stock-api.md`
|
||||
- 包含 6 个库存管理接口 + 1 个相关接口
|
||||
- 字段说明、物料类型枚举、注意事项
|
||||
|
||||
---
|
||||
|
||||
## 部署操作
|
||||
|
||||
### 测试环境 Docker 重新部署
|
||||
|
||||
**命令:**
|
||||
```bash
|
||||
cd /home/yangxuan/Projects/IdeaProjects/tiny-erp
|
||||
mvn clean install -DskipTests
|
||||
docker compose stop app
|
||||
docker compose rm -f app
|
||||
docker compose build --no-cache app
|
||||
docker compose up -d app
|
||||
```
|
||||
|
||||
**状态:** ✅ 部署成功,健康检查通过
|
||||
|
||||
---
|
||||
|
||||
## 经验教训
|
||||
|
||||
1. **Maven 构建前提**:Docker 镜像构建复制本地 `target/` 目录,必须先执行 `mvn clean install`
|
||||
2. **Long 类型精度丢失**:雪花算法 ID 超出 JS 安全范围,全局序列化为字符串
|
||||
3. **空集合 IN 子句**:MyBatis-Plus `selectBatchIds` 不处理空集合,需要手动判断
|
||||
4. **creator 字段含义**:自动填充存的是昵称,不是用户名,查询时要注意匹配字段
|
||||
5. **接口职责分离**:库存相关操作统一在 `StockController`,物料相关在 `MaterialController`
|
||||
|
||||
---
|
||||
|
||||
## 数据库环境(双数据库)
|
||||
|
||||
| 环境 | 类型 | 端口 | 连接方式 | sys_tenant.tenant_name |
|
||||
|------|------|------|----------|------------------------|
|
||||
| **测试库** | Docker 容器 tiny-erp-db (postgres:18.1) | 未暴露 | 仅 Docker 内部访问 (db:5432) | 默认租户 → 已改为**水晶科技有限公司** |
|
||||
| **本地库** | WSL apt 安装的 pgsql 16 | localhost:31983 | IntelliJ / psql 直接连接 | 水晶科技有限公司 |
|
||||
|
||||
- Docker 应用 `tiny-erp-app` 连接的是**测试库**(Docker 内部 `tiny-erp-db`)
|
||||
- `application-local.yml` → `localhost:31983`(本地库),绑定 `server.port=8081`
|
||||
- `application-test.yml` → `db:5432`(测试库),Docker 运行时通过 `SPRING_PROFILES_ACTIVE=test` 激活
|
||||
|
||||
## 待办事项
|
||||
|
||||
- [ ] 更新 Java 实体类(`FinAr`、`FinAp`、`FinArWriteOff`、`FinApWriteOff`)
|
||||
- [ ] 记录数据库变更日志到 `doc/数据库变更日志.md`
|
||||
- [ ] 考虑添加外键约束防止 `im_inbound_item` / `im_outbound_item` 脏数据
|
||||
|
||||
---
|
||||
|
||||
## 新增功能
|
||||
|
||||
### 9. 物料选择器返回上次单价
|
||||
|
||||
**需求:** 采购入库/销售出库时单价必填,物料选择器返回上次单价供用户参考。
|
||||
|
||||
**修改内容:**
|
||||
1. ✅ `StockPageDTO` - 新增 `lastInboundPrice` 和 `lastOutboundPrice` 字段
|
||||
2. ✅ `Material` 实体 - 新增 `lastInboundPrice` 和 `lastOutboundPrice` 字段(数据库已有 `last_inbound_price`、`last_outbound_price`)
|
||||
3. ✅ `MaterialSelectorServiceImpl` - 实现批量查询和填充逻辑
|
||||
- `queryLastInboundPrices()` - 批量查询上次入库单价
|
||||
- `queryLastOutboundPrices()` - 批量查询上次出库单价
|
||||
- `pageInboundMaterial()` / `pageOutboundMaterial()` - 填充单价字段
|
||||
- 常用物料场景也支持单价填充
|
||||
|
||||
**API 响应示例:**
|
||||
```json
|
||||
{
|
||||
"materialId": 4,
|
||||
"materialName": "测试物料 A",
|
||||
"lastInboundPrice": 12.50, // 采购入库参考
|
||||
"lastOutboundPrice": 18.80 // 销售出库参考
|
||||
}
|
||||
```
|
||||
|
||||
**前端使用:**
|
||||
- 采购入库单:显示 `lastInboundPrice` 作为参考,单价必填
|
||||
- 销售出库单:显示 `lastOutboundPrice` 作为参考,单价必填
|
||||
- 后端自动填充逻辑:如果用户未填单价,保存时自动使用上次单价
|
||||
|
||||
**测试验证:** ✅ 66 个集成测试全部通过(物料 20 + 入库 23 + 出库 23)
|
||||
|
||||
---
|
||||
|
||||
### 10. 首页动态数量格式化
|
||||
|
||||
**问题:** 首页动态显示的数量带有末尾多余的 0(如 `10.5000 个`)。
|
||||
|
||||
**修复:** `HomeServiceImpl.getLatestNews()` 中使用 `stripTrailingZeros().toPlainString()` 格式化数量
|
||||
|
||||
```java
|
||||
// 修改前
|
||||
String.format("%s入库%s%s", materialName, item.getQuantity(), unit)
|
||||
// 修改后
|
||||
String.format("%s入库%s%s", materialName, item.getQuantity().stripTrailingZeros().toPlainString(), unit)
|
||||
```
|
||||
|
||||
**效果对比:**
|
||||
| 修改前 | 修改后 |
|
||||
|--------|--------|
|
||||
| `测试物料入库 10.5000 个` | `测试物料入库 10.5 个` |
|
||||
| `测试物料出库 100.0000 个` | `测试物料出库 100 个` |
|
||||
|
||||
---
|
||||
|
||||
## 问题修复
|
||||
|
||||
### 11. operator 字段违反 NOT NULL 约束
|
||||
|
||||
**问题:** 出入库单自动生成应收/应付时,`fin_ar_receipt` 表的 `operator` 字段为 null,导致插入失败。
|
||||
|
||||
**错误日志:**
|
||||
```
|
||||
ERROR: null value in column "operator" of relation "fin_ar_receipt" violates not-null constraint
|
||||
```
|
||||
|
||||
**根因:** `MyMetaObjectHandler` 自动填充处理器没有填充 `operator` 字段,当 `UserContext.getUserName()` 返回 null 时导致插入失败。
|
||||
|
||||
**修复方案:** 在 `MyMetaObjectHandler.insertFill()` 中添加 `operator` 字段的自动填充,但**仅在用户未设置时才填充**:
|
||||
|
||||
```java
|
||||
// 操作人(operator 字段,用于财务收款/付款单)- 仅当未设置时自动填充
|
||||
String operatorName = UserContext.getUserName();
|
||||
if (operatorName == null || operatorName.isEmpty()) {
|
||||
operatorName = "管理员";
|
||||
}
|
||||
// 检查是否已有值,有值则不覆盖
|
||||
if (metaObject.hasGetter("operator") && metaObject.getValue("operator") == null) {
|
||||
this.strictInsertFill(metaObject, "operator", String.class, operatorName);
|
||||
}
|
||||
```
|
||||
|
||||
**行为说明:**
|
||||
- ✅ 用户手动设置 `operator` → 保留用户设置的值
|
||||
- ✅ 用户未设置 `operator` → 自动填充当前登录用户(兜底"管理员")
|
||||
- ✅ 自动生成场景(无用户上下文)→ 自动填充"管理员"
|
||||
|
||||
**影响范围:** 适用于 `fin_ar_receipt`(收款单)和 `fin_ap_payment`(付款单)等需要 `operator` 的表
|
||||
|
||||
---
|
||||
|
||||
## 测试进展
|
||||
|
||||
### 集成测试覆盖率
|
||||
|
||||
| 测试类 | 测试数 | 通过 | 失败 | 覆盖率 |
|
||||
|--------|--------|------|------|--------|
|
||||
| `MaterialControllerTest` | 20 | 20 | 0 | 100% ✅ |
|
||||
| `InboundControllerTest` | 23 | 23 | 0 | 100% ✅ |
|
||||
| `OutboundControllerTest` | 23 | 23 | 0 | 100% ✅ |
|
||||
| **总计** | **66** | **66** | **0** | **100%** ✅ |
|
||||
|
||||
**测试覆盖的功能:**
|
||||
- ✅ 物料 CRUD、分页查询、详情查询
|
||||
- ✅ 采购入库单保存、自动填充单价、更新物料最后入库价
|
||||
- ✅ 销售出库单保存、自动填充单价、更新物料最后出库价
|
||||
- ✅ 编码唯一性校验、必填字段校验、BigDecimal 精度比较
|
||||
|
||||
---
|
||||
|
||||
## 经验教训
|
||||
|
||||
1. **BigDecimal 比较**:测试断言使用 `compareTo()` 而非 `equals()`,避免精度差异(`10.50` vs `10.5000`)
|
||||
2. **自动填充优先级**:用户手动设置的值优先于自动填充,`MyMetaObjectHandler` 需要先检查字段是否已有值
|
||||
3. **批量查询优化**:物料选择器使用 `selectBatchIds` 批量查询上次单价,避免 N+1 查询问题
|
||||
4. **数量格式化**:`BigDecimal` 转字符串时使用 `stripTrailingZeros().toPlainString()` 去除末尾多余的 0,同时避免科学计数法
|
||||
|
||||
---
|
||||
|
||||
## 待办事项
|
||||
|
||||
- [ ] 前端对接物料选择器接口,显示上次单价参考
|
||||
- [ ] 验证采购入库/销售出库单价必填的前端校验
|
||||
- [ ] 运行完整测试套件确保无回归
|
||||
- [ ] 记录数据库变更日志到 `doc/数据库变更日志.md`
|
||||
@@ -1,330 +0,0 @@
|
||||
## 10:50 — AI 调用记录方案评估
|
||||
|
||||
**话题:** 记录 AI 调用(session_id, tokens, 返回结果),复用操作日志机制
|
||||
|
||||
**评估结论:方案 A — 扩展 OperLog**
|
||||
- `sys_oper_log` 新增 5 字段:`ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`
|
||||
- `module` 复用为 `"AI识别"` / `"AI对话"` 区分业务
|
||||
- 复用现有 OperLog 全部基础设施(service/mapper/controller/分页/查询)
|
||||
- 工作量最小,约 20min
|
||||
- 方案已确认,待实现
|
||||
|
||||
## 10:50 — Git 约定提醒
|
||||
|
||||
提示 commit 时必须附带 commit message,让用户可直接复制运行。
|
||||
|
||||
## 11:08~11:18 — AI 调用记录实现 ✅
|
||||
|
||||
**改动点:**
|
||||
1. `scripts/postgresql/10-system.sql` — DDL 新增 `ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`
|
||||
2. `scripts/postgresql/fix-ai-oper-log.sql` — 迁移脚本(新增)
|
||||
3. `OperLog.java` — 实体添加 5 个对应字段
|
||||
4. `AiServiceImpl.java` — 注入 `OperLogService`,在 `chatText()`/`chatWithImages()` 调用前后记录日志(含 sessionId, tokens, 耗时, 输入/输出摘要)
|
||||
5. `AiChatResponseDTO` — 新增 `sessionId` 字段
|
||||
6. `DeepSeekChatRequestDTO` — 新增 `sessionId` 字段(`@JsonIgnore`,仅用于日志传递)
|
||||
|
||||
**执行迁移:** 本地库(localhost:31983)跑 `fix-ai-oper-log.sql`
|
||||
|
||||
**测试结果:** ✅ `Tests run: 2, Failures: 0, Errors: 0` — 日志成功写入 sys_oper_log(ai_model=qwen3.5-plus 等字段正确)
|
||||
## 13:00~13:06 — 测试库执行 AI 迁移 ✅
|
||||
|
||||
- 本地 WSL Docker 可连接测试库(`docker exec -i tiny-erp-db psql -U postgres -d tinyerp`)
|
||||
- 执行 `fix-ai-oper-log.sql`,5 个 AI 字段(`ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`)已添加
|
||||
- 验证本地库(localhost:31983)和测试库(Docker db:5432)字段均存在 ✅
|
||||
|
||||
## 13:08~13:10 — 日志文件冲突问题 → 方案A
|
||||
|
||||
**问题:** IDEA 和 Docker 都在 WSL 同一机器运行,`./logs/` 会互相覆盖
|
||||
|
||||
**方案A:** docker-compose 挂载路径改为 `./logs-docker:/app/logs`
|
||||
- `.gitignore` 添加 `logs-docker/`
|
||||
- `Dockerfile` 保留 root 运行(无 `USER appuser`)
|
||||
- 已实施 ✅
|
||||
|
||||
## 13:11~13:13 — deploy-test.sh 脚本
|
||||
|
||||
创建 `deploy-test.sh` 一键部署脚本:
|
||||
1. `mvn clean install -DskipTests`
|
||||
2. `docker compose stop/rm/build/up app`
|
||||
3. `curl health` 自动验证(失败重试 15s)
|
||||
|
||||
## 13:14~13:22 — 测试目录规范化
|
||||
|
||||
**问题:** 大部分测试包路径缺少 `module` 层级,与源码不一致
|
||||
|
||||
- 移动所有测试到 `com.witsoft.erp.module.*` 包下
|
||||
- 统一先删旧包(git rm)、再建新包、再写入
|
||||
- 运行全量测试通过 ✅
|
||||
- `test.base.BaseControllerTest` 保留在 `com.witsoft.erp.test.base`(基建归 test,不归 module)
|
||||
|
||||
## 13:38~14:11 — docs/ 目录全面清理
|
||||
|
||||
**整理方向:**
|
||||
|
||||
| 操作 | 说明 |
|
||||
|------|------|
|
||||
| ✅ 合并 API 规范到项目规范.md | 删除 `docs/API/` |
|
||||
| ✅ 删除 `docs/数据库/` | 以 SQL 脚本为唯一来源 |
|
||||
| ✅ 文档按模块移入对应子目录 | `06-AI单据识别需求.md` → `需求/AI模块`,`物料信息填充公共服务总结.md` → `设计/主数据模块` |
|
||||
| ✅ 按模块独立编号 | 全局连续 → 每个模块 01- 起编 |
|
||||
| ✅ 测试文件重排序 | 按 登录→首页→物料→字典→入库出库→库存盘点→操作日志 排列 |
|
||||
| ✅ README.md 同步 | 目录结构、版本历史逐一同步,标注"(预留)"空目录 |
|
||||
|
||||
**编号规则变更:** 跨模块连续编号(旧)→ 按模块独立编号(新),新增文档只加模块内序号,不碰其他模块。
|
||||
|
||||
## 14:14 — UserContext 使用指南.md 文件缺失
|
||||
|
||||
文档中引用 `设计/系统模块/UserContext 使用指南.md`,但实际文件不存在(被 `yangxuan/` → `docs/` 重命名遗漏)。已补充。
|
||||
## 10:50 — AI 调用记录方案评估
|
||||
|
||||
**话题:** 记录 AI 调用(session_id, tokens, 返回结果),复用操作日志机制
|
||||
|
||||
**评估结论:方案 A — 扩展 OperLog**
|
||||
- `sys_oper_log` 新增 5 字段:`ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`
|
||||
- `module` 复用为 `"AI识别"` / `"AI对话"` 区分业务
|
||||
- 复用现有 OperLog 全部基础设施(service/mapper/controller/分页/查询)
|
||||
- 工作量最小,约 20min
|
||||
- 方案已确认,待实现
|
||||
|
||||
## 10:50 — Git 约定提醒
|
||||
|
||||
提示 commit 时必须附带 commit message,让用户可直接复制运行。
|
||||
|
||||
## 11:08~11:18 — AI 调用记录实现 ✅
|
||||
|
||||
**改动点:**
|
||||
1. `scripts/postgresql/10-system.sql` — DDL 新增 `ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`
|
||||
2. `scripts/postgresql/fix-ai-oper-log.sql` — 迁移脚本(新增)
|
||||
3. `OperLog.java` — 实体添加 5 个对应字段
|
||||
4. `AiServiceImpl.java` — 注入 `OperLogService`,在 `chatText()`/`chatWithImages()` 调用前后记录日志(含 sessionId, tokens, 耗时, 输入/输出摘要)
|
||||
5. `AiChatResponseDTO` — 新增 `sessionId` 字段
|
||||
6. `DeepSeekChatRequestDTO` — 新增 `sessionId` 字段(`@JsonIgnore`,仅用于日志传递)
|
||||
|
||||
**执行迁移:** 本地库(localhost:31983)跑 `fix-ai-oper-log.sql`
|
||||
|
||||
**测试结果:** ✅ `Tests run: 2, Failures: 0, Errors: 0` — 日志成功写入 sys_oper_log(ai_model=qwen3.5-plus 等字段正确)
|
||||
## 13:00~13:06 — 测试库执行 AI 迁移 ✅
|
||||
|
||||
- 本地 WSL Docker 可连接测试库(`docker exec -i tiny-erp-db psql -U postgres -d tinyerp`)
|
||||
- 执行 `fix-ai-oper-log.sql`,5 个 AI 字段(`ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`)已添加
|
||||
- 验证本地库(localhost:31983)和测试库(Docker db:5432)字段均存在 ✅
|
||||
|
||||
## 13:08~13:10 — 日志文件冲突问题 → 方案A
|
||||
|
||||
**问题:** IDEA 和 Docker 都在 WSL 同一机器运行,`./logs/` 会互相覆盖
|
||||
|
||||
**方案A:** docker-compose 挂载路径改为 `./logs-docker:/app/logs`
|
||||
- `.gitignore` 添加 `logs-docker/`
|
||||
- `Dockerfile` 保留 root 运行(无 `USER appuser`)
|
||||
- 已实施 ✅
|
||||
|
||||
## 13:11~13:13 — deploy-test.sh 脚本
|
||||
|
||||
创建 `deploy-test.sh` 一键部署脚本:
|
||||
1. `mvn clean install -DskipTests`
|
||||
2. `docker compose stop/rm/build/up app`
|
||||
3. `curl health` 自动验证(失败重试 15s)
|
||||
|
||||
## 13:14~13:22 — 测试目录规范化
|
||||
|
||||
**问题:** 大部分测试包路径缺少 `module` 层级,与源码不一致
|
||||
|
||||
- 移动所有测试到 `com.witsoft.erp.module.*` 包下
|
||||
- 统一先删旧包(git rm)、再建新包、再写入
|
||||
- 运行全量测试通过 ✅
|
||||
- `test.base.BaseControllerTest` 保留在 `com.witsoft.erp.test.base`(基建归 test,不归 module)
|
||||
|
||||
## 13:38~14:11 — docs/ 目录全面清理
|
||||
|
||||
**整理方向:**
|
||||
|
||||
| 操作 | 说明 |
|
||||
|------|------|
|
||||
| ✅ 合并 API 规范到项目规范.md | 删除 `docs/API/` |
|
||||
| ✅ 删除 `docs/数据库/` | 以 SQL 脚本为唯一来源 |
|
||||
| ✅ 文档按模块移入对应子目录 | `06-AI单据识别需求.md` → `需求/AI模块`,`物料信息填充公共服务总结.md` → `设计/主数据模块` |
|
||||
| ✅ 按模块独立编号 | 全局连续 → 每个模块 01- 起编 |
|
||||
| ✅ 测试文件重排序 | 按 登录→首页→物料→字典→入库出库→库存盘点→操作日志 排列 |
|
||||
| ✅ README.md 同步 | 目录结构、版本历史逐一同步,标注"(预留)"空目录 |
|
||||
|
||||
**编号规则变更:** 跨模块连续编号(旧)→ 按模块独立编号(新),新增文档只加模块内序号,不碰其他模块。
|
||||
|
||||
## 14:14 — UserContext 使用指南.md 文件缺失
|
||||
|
||||
文档中引用 `设计/系统模块/UserContext 使用指南.md`,但实际文件不存在(被 `yangxuan/` → `docs/` 重命名遗漏)。已补充。
|
||||
|
||||
## 14:18 — docs/测试 HTTP 文件重排序 ✅
|
||||
|
||||
按执行依赖逻辑重新编号:
|
||||
|
||||
| 序号 | 文件 | 说明 |
|
||||
|------|------|------|
|
||||
| 00 | 登录登出 | 先拿 token |
|
||||
| 01 | 首页 API 测试 | 仪表盘概览 |
|
||||
| 02 | 物料分页 | 基础数据查询 |
|
||||
| 03 | 数据字典与映射 | 字典+翻译 |
|
||||
| 04 | 入库出库 | 核心业务流程 |
|
||||
| 05 | 实时库存&盘点 | 库存状态 |
|
||||
| 06 | 操作日志 | 审计兜底 |
|
||||
|
||||
同步更新了 `docs/README.md`。
|
||||
|
||||
## 14:24 — scripts/postgresql 目录组织讨论
|
||||
|
||||
**话题:** 杨轩问脚本目录是否可以按 ddl/dml/init 或按模块区分。
|
||||
|
||||
**分析结果:** 当前脚本目录的问题:
|
||||
1. 编号混乱(00/03/10/20/21/22...99,无一致规则)
|
||||
2. DDL/DML 混在一起(如 10-system.sql 既建表又插数据)
|
||||
3. fix- 前缀不统一(26-material-last-price.sql 也是 ALTER 但没用 fix- 前缀)
|
||||
|
||||
**方案A(用户选中):** 二级目录 `ddl/`、`dml/`、`migration/`、`mock/`,根目录保留一个 `init.sql` 通过 `\i` 引用子目录文件(因为 `docker-entrypoint-initdb.d` 只处理扁平 .sql 文件)。
|
||||
|
||||
**待实现:** [not yet started — compaction happened before implementation]
|
||||
## 10:50 — AI 调用记录方案评估
|
||||
|
||||
**话题:** 记录 AI 调用(session_id, tokens, 返回结果),复用操作日志机制
|
||||
|
||||
**评估结论:方案 A — 扩展 OperLog**
|
||||
- `sys_oper_log` 新增 5 字段:`ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`
|
||||
- `module` 复用为 `"AI识别"` / `"AI对话"` 区分业务
|
||||
- 复用现有 OperLog 全部基础设施(service/mapper/controller/分页/查询)
|
||||
- 工作量最小,约 20min
|
||||
- 方案已确认,待实现
|
||||
|
||||
## 10:50 — Git 约定提醒
|
||||
|
||||
提示 commit 时必须附带 commit message,让用户可直接复制运行。
|
||||
|
||||
## 11:08~11:18 — AI 调用记录实现 ✅
|
||||
|
||||
**改动点:**
|
||||
1. `scripts/postgresql/10-system.sql` — DDL 新增 `ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`
|
||||
2. `scripts/postgresql/fix-ai-oper-log.sql` — 迁移脚本(新增)
|
||||
3. `OperLog.java` — 实体添加 5 个对应字段
|
||||
4. `AiServiceImpl.java` — 注入 `OperLogService`,在 `chatText()`/`chatWithImages()` 调用前后记录日志(含 sessionId, tokens, 耗时, 输入/输出摘要)
|
||||
5. `AiChatResponseDTO` — 新增 `sessionId` 字段
|
||||
6. `DeepSeekChatRequestDTO` — 新增 `sessionId` 字段(`@JsonIgnore`,仅用于日志传递)
|
||||
|
||||
**执行迁移:** 本地库(localhost:31983)跑 `fix-ai-oper-log.sql`
|
||||
|
||||
**测试结果:** ✅ `Tests run: 2, Failures: 0, Errors: 0` — 日志成功写入 sys_oper_log(ai_model=qwen3.5-plus 等字段正确)
|
||||
## 13:00~13:06 — 测试库执行 AI 迁移 ✅
|
||||
|
||||
- 本地 WSL Docker 可连接测试库(`docker exec -i tiny-erp-db psql -U postgres -d tinyerp`)
|
||||
- 执行 `fix-ai-oper-log.sql`,5 个 AI 字段(`ai_session_id`, `ai_model`, `prompt_tokens`, `completion_tokens`, `total_tokens`)已添加
|
||||
- 验证本地库(localhost:31983)和测试库(Docker db:5432)字段均存在 ✅
|
||||
|
||||
## 13:08~13:10 — 日志文件冲突问题 → 方案A
|
||||
|
||||
**问题:** IDEA 和 Docker 都在 WSL 同一机器运行,`./logs/` 会互相覆盖
|
||||
|
||||
**方案A:** docker-compose 挂载路径改为 `./logs-docker:/app/logs`
|
||||
- `.gitignore` 添加 `logs-docker/`
|
||||
- `Dockerfile` 保留 root 运行(无 `USER appuser`)
|
||||
- 已实施 ✅
|
||||
|
||||
## 13:11~13:13 — deploy-test.sh 脚本
|
||||
|
||||
创建 `deploy-test.sh` 一键部署脚本:
|
||||
1. `mvn clean install -DskipTests`
|
||||
2. `docker compose stop/rm/build/up app`
|
||||
3. `curl health` 自动验证(失败重试 15s)
|
||||
|
||||
## 13:14~13:22 — 测试目录规范化
|
||||
|
||||
**问题:** 大部分测试包路径缺少 `module` 层级,与源码不一致
|
||||
|
||||
- 移动所有测试到 `com.witsoft.erp.module.*` 包下
|
||||
- 统一先删旧包(git rm)、再建新包、再写入
|
||||
- 运行全量测试通过 ✅
|
||||
- `test.base.BaseControllerTest` 保留在 `com.witsoft.erp.test.base`(基建归 test,不归 module)
|
||||
|
||||
## 13:38~14:11 — docs/ 目录全面清理
|
||||
|
||||
**整理方向:**
|
||||
|
||||
| 操作 | 说明 |
|
||||
|------|------|
|
||||
| ✅ 合并 API 规范到项目规范.md | 删除 `docs/API/` |
|
||||
| ✅ 删除 `docs/数据库/` | 以 SQL 脚本为唯一来源 |
|
||||
| ✅ 文档按模块移入对应子目录 | `06-AI单据识别需求.md` → `需求/AI模块`,`物料信息填充公共服务总结.md` → `设计/主数据模块` |
|
||||
| ✅ 按模块独立编号 | 全局连续 → 每个模块 01- 起编 |
|
||||
| ✅ 测试文件重排序 | 按 登录→首页→物料→字典→入库出库→库存盘点→操作日志 排列 |
|
||||
| ✅ README.md 同步 | 目录结构、版本历史逐一同步,标注"(预留)"空目录 |
|
||||
|
||||
**编号规则变更:** 跨模块连续编号(旧)→ 按模块独立编号(新),新增文档只加模块内序号,不碰其他模块。
|
||||
|
||||
## 14:14 — UserContext 使用指南.md 文件缺失
|
||||
|
||||
文档中引用 `设计/系统模块/UserContext 使用指南.md`,但实际文件不存在(被 `yangxuan/` → `docs/` 重命名遗漏)。已补充。
|
||||
|
||||
## 14:18 — docs/测试 HTTP 文件重排序 ✅
|
||||
|
||||
按执行依赖逻辑重新编号:
|
||||
|
||||
| 序号 | 文件 | 说明 |
|
||||
|------|------|------|
|
||||
| 00 | 登录登出 | 先拿 token |
|
||||
| 01 | 首页 API 测试 | 仪表盘概览 |
|
||||
| 02 | 物料分页 | 基础数据查询 |
|
||||
| 03 | 数据字典与映射 | 字典+翻译 |
|
||||
| 04 | 入库出库 | 核心业务流程 |
|
||||
| 05 | 实时库存&盘点 | 库存状态 |
|
||||
| 06 | 操作日志 | 审计兜底 |
|
||||
|
||||
同步更新了 `docs/README.md`。
|
||||
|
||||
## 14:24 — scripts/postgresql 目录组织讨论
|
||||
|
||||
**话题:** 杨轩问脚本目录是否可以按 ddl/dml/init 或按模块区分。
|
||||
|
||||
**分析结果:** 当前脚本目录的问题:
|
||||
1. 编号混乱(00/03/10/20/21/22...99,无一致规则)
|
||||
2. DDL/DML 混在一起(如 10-system.sql 既建表又插数据)
|
||||
3. fix- 前缀不统一(26-material-last-price.sql 也是 ALTER 但没用 fix- 前缀)
|
||||
|
||||
**方案A(用户选中):** 二级目录 `ddl/`、`dml/`、`migration/`、`mock/`,根目录保留一个 `init.sql` 通过 `\i` 引用子目录文件(因为 `docker-entrypoint-initdb.d` 只处理扁平 .sql 文件)。
|
||||
|
||||
**待实现:** [not yet started — compaction happened before implementation]
|
||||
|
||||
## 14:47~15:30 — AI 接口文档 + 测试文件 ✅
|
||||
|
||||
**AI 接口文档:** `docs/需求/AI模块/02-AI单据识别接口文档.md`
|
||||
**AI 测试文件:** `docs/测试/07-AI单据识别.http`
|
||||
- 解释了 exactMatch=false 仍有 materialId 的语义:近似匹配自动选最佳,前端标黄提示
|
||||
- `docs/README.md` 同步更新
|
||||
|
||||
**提交策略:** 用户自行处理敏感配置文件的版本管理(`application.yml`、`application-local.yml`、`scripts/idea/http-client.env.json`)
|
||||
|
||||
## 15:30~16:20 — 物料选择器 excludedMaterialIds 实现 ✅
|
||||
|
||||
**需求:** 出库/入库选择器支持排除已选物料
|
||||
|
||||
**改动点:**
|
||||
1. `MaterialSelectorReqDTO` — 新增 `excludedMaterialIds`(`List<Long>`)
|
||||
2. `MaterialServiceImpl` — 4 个分页/计数方法加 `excludedMaterialIds` 参数
|
||||
3. `StockMapper.xml` — 4 个 SQL 加 `<if test="excludedMaterialIds != null and excludedMaterialIds.size() > 0"> AND s.material_id NOT IN ...</if>`
|
||||
4. `MaterialSelectorServiceImpl` — 新增 `filterExcludedIds()` 私有方法做内存过滤 + queryByIds 方法加上排除逻辑
|
||||
|
||||
**MyBatis <if> 行为验证:**
|
||||
- `null` → false,跳过 NOT IN
|
||||
- `[]`(空列表)→ `size() > 0` 为 false,跳过 NOT IN
|
||||
- `[1, 2]` → 进 NOT IN,WHERE 过滤
|
||||
|
||||
**测试覆盖:** 集成测试三类场景全部通过 ✅
|
||||
- `testMaterialSelector_empty`(传 null)✅
|
||||
- `testMaterialSelector_emptyExcludeList`(传 `[]`)✅
|
||||
- `testMaterialSelector_withExcludedIds`(传实际 ID,验证排除正确)✅
|
||||
|
||||
## 15:55 — 测试编号冲突修复
|
||||
|
||||
**问题:** 新增物料选择器测试插入 `@Order(4)/@Order(5)` 后,原有的 `@Order(4)`(新增出库单)和 `@Order(5)`(明细为空)未重编号,导致 `@Order(4)/@Order(5)/@Order(7)` 重复
|
||||
|
||||
**修复:** 将所有 `@Order(n)` 增加 2(n>=4 的改成 n+2),最后 2 个测试增加 2。涉及约 20 个测试方法。
|
||||
|
||||
## 16:05 — 测试 bug 修复
|
||||
|
||||
**问题:** 排除测试中 `assertFalse(list.stream().anyMatch(s -> s.getId().equals(excludedId)))` 失败
|
||||
**原因:** `StockPageDTO.getId()` 返回库存记录 ID(`s.id`),而非物料 ID(`s.material_id`)。SQL NOT IN 排除的是 `material_id`,但测试用 `getId()` 取了库存记录 ID
|
||||
**修复:** 改用 `getMaterialId()` 验证排除
|
||||
@@ -1,14 +0,0 @@
|
||||
# 2026-07-09
|
||||
|
||||
## DailyHotJob 改造完成
|
||||
- planner 派发任务 → backend 执行改造 → planner review 通过,共 7 个 commit
|
||||
- 涉及:异常传播、租户注解、批量查重插入、并发搜索、文件分片、时间窗口、Redis Key 可配置
|
||||
- 任务文档存档于 `tasks/dailyhot-job-fix-tasks.md`
|
||||
|
||||
## 教训:不能越权
|
||||
- 杨轩明确强调:**不能越权** — 不要替用户做决定,不要自行启动或派发任务,由用户决策后再执行
|
||||
|
||||
## 编译修复
|
||||
- `JavInfoMapper.insertBatch(Collection<JavInfoDO>)` 返回类型 `int` → `Boolean`(与父类 `BaseMapperX` 一致)
|
||||
- `JackettController.dailyHot()` 加 `throws Exception`(顺带修复同一 module 编译错误)
|
||||
- Maven 编译验证通过
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"registry": "https://clawhub.ai",
|
||||
"slug": "qiushi-openclaw-skill",
|
||||
"ownerHandle": "skytodmoon",
|
||||
"installedVersion": "1.0.0",
|
||||
"installedAt": 1785745381570,
|
||||
"artifact": {
|
||||
"kind": "archive",
|
||||
"sha256": "1e2d3712d2974143449c9e47b0379725a954794c498727799f782ac7b1db7a49",
|
||||
"integrity": "sha256-Hi03EtKXQUNEnJ5HsDeXJalUeUxJhyd5n3gqx7Hbekk="
|
||||
},
|
||||
"skillFile": {
|
||||
"path": "SKILL.md",
|
||||
"sha256": "b21d933b7f61584d2254fba25fd531c16f19e33e10016ddfbdea1a5e2d5d6d25"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
# 求是 OpenClaw Skills
|
||||
|
||||
## 项目介绍
|
||||
|
||||
求是 OpenClaw Skills 是基于毛泽东思想方法论的 AI Agent 技能集合,按照 OpenClaw 技能格式进行改造,旨在为 AI 提供系统化的思考和行动框架。
|
||||
|
||||
## 技能列表
|
||||
|
||||
| 技能名称 | 核心要义 | 适用场景 |
|
||||
|---------|---------|---------|
|
||||
| arming-thought | 武装思想,实事求是总原则 | 对话开始时建立方法论基础 |
|
||||
| contradiction-analysis | 矛盾分析法,抓主要矛盾 | 复杂问题分析 |
|
||||
| practice-cognition | 实践认识论,实践→认识→再实践 | 方案验证与迭代 |
|
||||
| investigation-first | 调查研究,没有调查就没有发言权 | 决策前的信息收集 |
|
||||
| mass-line | 群众路线,从群众中来到群众中去 | 反馈整合与方案验证 |
|
||||
| criticism-self-criticism | 批评与自我批评,惩前毖后治病救人 | 工作审视与质量改进 |
|
||||
| protracted-strategy | 持久战略,战略上藐视战术上重视 | 长期复杂任务规划 |
|
||||
| concentrate-forces | 集中兵力,伤其十指不如断其一指 | 优先级决策与资源聚焦 |
|
||||
| spark-prairie-fire | 星火燎原,建立根据地不做流寇 | 从零开始的发展策略 |
|
||||
| overall-planning | 统筹兼顾,调动一切积极因素 | 多目标平衡与权衡 |
|
||||
| workflows | 工作流组合,多种方法串联 | 复杂任务的流程设计 |
|
||||
|
||||
## 安装方法
|
||||
|
||||
### 手动安装
|
||||
|
||||
1. 将 `qiushi-openclaw-skills` 目录复制到 OpenClaw 的技能目录:
|
||||
```bash
|
||||
cp -r qiushi-openclaw-skills ~/.openclaw/skills/
|
||||
```
|
||||
|
||||
2. 重启 OpenClaw 或刷新技能列表。
|
||||
|
||||
### ClawHub 安装(未来支持)
|
||||
|
||||
未来将支持通过 ClawHub 一键安装。
|
||||
|
||||
## 技能结构
|
||||
|
||||
每个技能都遵循 OpenClaw 的标准结构:
|
||||
|
||||
```
|
||||
skill-name/
|
||||
└── SKILL.md # 技能定义文件
|
||||
```
|
||||
|
||||
### SKILL.md 结构
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: skill-name
|
||||
description: "技能描述,决定 AI 何时自动触发此技能"
|
||||
tools: [] # 技能需要使用的工具
|
||||
---
|
||||
|
||||
# 技能名称
|
||||
|
||||
## 触发条件
|
||||
当...时触发此技能。
|
||||
|
||||
## 执行步骤
|
||||
1. 第一步...
|
||||
2. 第二步...
|
||||
|
||||
## 核心原则
|
||||
...
|
||||
|
||||
## 不适用场景
|
||||
- ...
|
||||
|
||||
## 应用场景
|
||||
- ...
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| ... | ... |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. ...
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- ...
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
1. **自动触发**:OpenClaw 会根据技能的 `description` 字段自动判断何时触发相应技能。
|
||||
|
||||
2. **手动触发**:在 OpenClaw 中使用 `/skill-name` 命令手动触发技能。
|
||||
|
||||
3. **工作流组合**:使用 `workflows` 技能组合多个技能,形成完整的工作流程。
|
||||
|
||||
## 核心原则
|
||||
|
||||
- **实事求是**:从客观存在着的实际事物出发,让事实规定判断,让现实修正理论。
|
||||
- **矛盾分析**:识别矛盾、抓住主要矛盾、区分矛盾性质。
|
||||
- **实践认识论**:实践→认识→再实践,螺旋上升。
|
||||
- **调查研究**:没有调查就没有发言权。
|
||||
- **群众路线**:从群众中来,到群众中去。
|
||||
- **批评与自我批评**:惩前毖后,治病救人。
|
||||
- **持久战略**:战略上藐视,战术上重视。
|
||||
- **集中兵力**:伤其十指不如断其一指。
|
||||
- **星火燎原**:建立根据地,不做流寇。
|
||||
- **统筹兼顾**:调动一切积极因素。
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 本项目的方法论来源于毛泽东思想,旨在为 AI 提供科学的思考和行动框架。
|
||||
- 技能的触发条件和执行步骤已经过优化,适合 AI 理解和执行。
|
||||
- 可以根据具体任务需求,灵活组合使用不同的技能。
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
name: qiushi-openclaw-skills
|
||||
description: "求是 OpenClaw Skills 是基于毛泽东思想方法论的 AI Agent 技能集合,按照 OpenClaw 技能格式进行改造,旨在为 AI 提供系统化的思考和行动框架。"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 求是 OpenClaw Skills
|
||||
|
||||
## 项目介绍
|
||||
|
||||
求是 OpenClaw Skills 是基于毛泽东思想方法论的 AI Agent 技能集合,按照 OpenClaw 技能格式进行改造,旨在为 AI 提供系统化的思考和行动框架。
|
||||
|
||||
## 技能列表
|
||||
|
||||
| 技能名称 | 核心要义 | 适用场景 |
|
||||
|---------|---------|---------|
|
||||
| arming-thought | 武装思想,实事求是总原则 | 对话开始时建立方法论基础 |
|
||||
| contradiction-analysis | 矛盾分析法,抓主要矛盾 | 复杂问题分析 |
|
||||
| practice-cognition | 实践认识论,实践→认识→再实践 | 方案验证与迭代 |
|
||||
| investigation-first | 调查研究,没有调查就没有发言权 | 决策前的信息收集 |
|
||||
| mass-line | 群众路线,从群众中来到群众中去 | 反馈整合与方案验证 |
|
||||
| criticism-self-criticism | 批评与自我批评,惩前毖后治病救人 | 工作审视与质量改进 |
|
||||
| protracted-strategy | 持久战略,战略上藐视战术上重视 | 长期复杂任务规划 |
|
||||
| concentrate-forces | 集中兵力,伤其十指不如断其一指 | 优先级决策与资源聚焦 |
|
||||
| spark-prairie-fire | 星火燎原,建立根据地不做流寇 | 从零开始的发展策略 |
|
||||
| overall-planning | 统筹兼顾,调动一切积极因素 | 多目标平衡与权衡 |
|
||||
| workflows | 工作流组合,多种方法串联 | 复杂任务的流程设计 |
|
||||
|
||||
## 核心原则
|
||||
|
||||
- **实事求是**:从客观存在着的实际事物出发,让事实规定判断,让现实修正理论。
|
||||
- **矛盾分析**:识别矛盾、抓住主要矛盾、区分矛盾性质。
|
||||
- **实践认识论**:实践→认识→再实践,螺旋上升。
|
||||
- **调查研究**:没有调查就没有发言权。
|
||||
- **群众路线**:从群众中来,到群众中去。
|
||||
- **批评与自我批评**:惩前毖后,治病救人。
|
||||
- **持久战略**:战略上藐视,战术上重视。
|
||||
- **集中兵力**:伤其十指不如断其一指。
|
||||
- **星火燎原**:建立根据地,不做流寇。
|
||||
- **统筹兼顾**:调动一切积极因素。
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install qiushi-openclaw-skills
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"ownerId": "kn77hfjtjjwht588zc4scw4qr582vrc6",
|
||||
"slug": "qiushi-openclaw-skill",
|
||||
"version": "1.0.0",
|
||||
"publishedAt": 1775635456843
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
# 武装思想
|
||||
|
||||
## 技能介绍
|
||||
|
||||
武装思想是求是 OpenClaw Skills 系列中的核心技能,在每次新的顶层对话开始时自动调用,用于建立"实事求是"的总原则,并在明确适用时为后续任务选择下游技能。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **实事求是总原则**:先看事实,再下判断,让事实规定判断,让现实修正理论
|
||||
- **技能调度**:根据任务需求自动选择合适的下游技能
|
||||
- **行为规范**:提供可观测的行为准则,确保 AI 行为符合方法论要求
|
||||
|
||||
## 触发条件
|
||||
|
||||
当开始新的顶层对话时触发,用于建立方法论基础和选择下游技能。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. 应用"实事求是"总原则:先看事实,再下判断
|
||||
2. 评估当前任务是否需要调用下游技能
|
||||
3. 如需要,选择最适合的技能进行调用
|
||||
|
||||
## 技能映射
|
||||
|
||||
| 遇到的情况 | 应调用的 skill |
|
||||
|-----------|---------------|
|
||||
| 面对复杂问题,不知从何入手 | contradiction-analysis |
|
||||
| 需要验证方案或迭代改进 | practice-cognition |
|
||||
| 要做决策但信息不足 | investigation-first |
|
||||
| 需要收集多方意见或整合多源信息 | mass-line |
|
||||
| 完成工作后需要审视质量 | criticism-self-criticism |
|
||||
| 面对长期复杂任务 | protracted-strategy |
|
||||
| 多个任务争夺注意力 | concentrate-forces |
|
||||
| 从零开始,资源有限 | spark-prairie-fire |
|
||||
| 多个目标需要平衡 | overall-planning |
|
||||
| 一个任务明确需要多种方法串联 | workflows |
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 子 agent 执行单一具体任务时
|
||||
- 用户需求非常具体,且执行路径单一明确
|
||||
- 只是一次性简单输出,不涉及调查、取舍、验证或复盘
|
||||
- 宿主平台已经在执行等价流程
|
||||
|
||||
## 指令优先级
|
||||
|
||||
1. 用户的明确指示
|
||||
2. 宿主平台的系统规则与安全约束
|
||||
3. qiushi skills 作为补充的方法论框架
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install arming-thought
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
name: arming-thought
|
||||
description: "在每次新的顶层对话开始时自动调用,用于建立'实事求是'的总原则,并在明确适用时为后续任务选择下游 skill"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 武装思想
|
||||
|
||||
## 触发条件
|
||||
当开始新的顶层对话时触发,用于建立方法论基础和选择下游技能。
|
||||
|
||||
## 执行步骤
|
||||
1. 应用"实事求是"总原则:先看事实,再下判断
|
||||
2. 评估当前任务是否需要调用下游技能
|
||||
3. 如需要,选择最适合的技能进行调用
|
||||
|
||||
## 总原则:实事求是
|
||||
"'实事'就是客观存在着的一切事物,'是'就是客观事物的内部联系,即规律性,'求'就是我们去研究。" —— 毛泽东《改造我们的学习》
|
||||
|
||||
**核心行为规则:**
|
||||
- 不空谈,看事实:每个结论后面附具体依据
|
||||
- 验证才算完成:声称"完成"之前执行验证动作
|
||||
- 承认不知道:遇到不确定信息时,明确标注"需要进一步确认"
|
||||
- 遇阻探原因:遇到失败时说明原因、补调查或更换路径
|
||||
|
||||
## 调度规则
|
||||
只有在下列任一条件成立时,才调用下游 skill:
|
||||
- 任务明显匹配某个 skill 的触发条件
|
||||
- 当前结果质量会因为该 skill 明显提升
|
||||
- 你已经遇到阻塞,需要一个明确的方法框架来推进
|
||||
|
||||
## 技能映射
|
||||
| 遇到的情况 | 应调用的 skill |
|
||||
|-----------|---------------|
|
||||
| 面对复杂问题,不知从何入手 | contradiction-analysis |
|
||||
| 需要验证方案或迭代改进 | practice-cognition |
|
||||
| 要做决策但信息不足 | investigation-first |
|
||||
| 需要收集多方意见或整合多源信息 | mass-line |
|
||||
| 完成工作后需要审视质量 | criticism-self-criticism |
|
||||
| 面对长期复杂任务 | protracted-strategy |
|
||||
| 多个任务争夺注意力 | concentrate-forces |
|
||||
| 从零开始,资源有限 | spark-prairie-fire |
|
||||
| 多个目标需要平衡 | overall-planning |
|
||||
| 一个任务明确需要多种方法串联 | workflows |
|
||||
|
||||
## 不要过度调用
|
||||
- 用户需求非常具体,且执行路径单一明确
|
||||
- 只是一次性简单输出,不涉及调查、取舍、验证或复盘
|
||||
- 宿主平台已经在执行等价流程
|
||||
|
||||
## 指令优先级
|
||||
1. 用户的明确指示
|
||||
2. 宿主平台的系统规则与安全约束
|
||||
3. qiushi skills 作为补充的方法论框架
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "arming-thought",
|
||||
"version": "1.0.0",
|
||||
"displayName": "武装思想",
|
||||
"description": "在每次新的顶层对话开始时自动调用,用于建立'实事求是'的总原则,并在明确适用时为后续任务选择下游 skill",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "实事求是"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
# 集中兵力
|
||||
|
||||
## 技能介绍
|
||||
|
||||
集中兵力是求是 OpenClaw Skills 系列中的核心技能,基于毛泽东的《中国革命战争的战略问题》,强调"伤其十指不如断其一指",用于当多个任务争夺注意力时优先处理重要任务。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **任务分析**:分析所有待处理的任务
|
||||
- **优先级排序**:根据重要性和紧急性对任务进行排序
|
||||
- **资源集中**:将资源集中到最重要的任务上
|
||||
- **各个击破**:逐个解决优先级高的任务
|
||||
|
||||
## 触发条件
|
||||
|
||||
当多个任务争夺注意力,需要优先处理重要任务时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **任务分析**:分析所有待处理的任务
|
||||
2. **优先级排序**:根据重要性和紧急性对任务进行排序
|
||||
3. **资源集中**:将资源集中到最重要的任务上
|
||||
4. **各个击破**:逐个解决优先级高的任务
|
||||
5. **动态调整**:根据情况动态调整优先级和资源分配
|
||||
|
||||
## 核心原则
|
||||
|
||||
伤其十指不如断其一指。不打无准备之仗。
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 只有一个任务
|
||||
- 所有任务都同等重要
|
||||
- 任务之间相互依赖,无法单独处理
|
||||
- 时间充足,不需要优先级排序
|
||||
|
||||
## 集中兵力的应用
|
||||
|
||||
- **任务管理**:管理多个并发任务
|
||||
- **项目规划**:规划项目的优先级
|
||||
- **资源分配**:合理分配有限的资源
|
||||
- **问题解决**:集中精力解决关键问题
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 平均分配资源 | 集中资源到最重要的任务 |
|
||||
| 同时处理多个任务 | 一次只处理一个重要任务 |
|
||||
| 忽视任务的重要性 | 认真评估任务的重要性和紧急性 |
|
||||
| 缺乏准备 | 充分准备后再行动 |
|
||||
| 不根据情况调整 | 动态调整优先级和资源分配 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **任务清单**:列出所有待处理的任务
|
||||
2. **评估排序**:评估每个任务的重要性和紧急性,进行排序
|
||||
3. **资源规划**:规划所需的资源,确保重要任务得到充分支持
|
||||
4. **执行计划**:制定详细的执行计划,明确每个任务的时间和资源需求
|
||||
5. **集中执行**:集中精力执行最重要的任务,确保完成质量
|
||||
6. **评估调整**:定期评估任务进展,根据情况调整优先级和资源分配
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **矛盾分析法**:集中兵力需要识别主要矛盾
|
||||
- **持久战略**:在持久战略中,需要在关键阶段集中兵力
|
||||
- **统筹兼顾**:集中兵力需要在全局范围内统筹兼顾
|
||||
- **实践认识论**:集中兵力的效果需要在实践中验证
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install concentrate-forces
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: concentrate-forces
|
||||
description: "当多个任务争夺注意力,需要优先处理重要任务时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 集中兵力
|
||||
|
||||
## 触发条件
|
||||
当多个任务争夺注意力,需要优先处理重要任务时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **任务分析**:分析所有待处理的任务
|
||||
2. **优先级排序**:根据重要性和紧急性对任务进行排序
|
||||
3. **资源集中**:将资源集中到最重要的任务上
|
||||
4. **各个击破**:逐个解决优先级高的任务
|
||||
5. **动态调整**:根据情况动态调整优先级和资源分配
|
||||
|
||||
## 核心原则
|
||||
伤其十指不如断其一指。不打无准备之仗。
|
||||
|
||||
## 不适用场景
|
||||
- 只有一个任务
|
||||
- 所有任务都同等重要
|
||||
- 任务之间相互依赖,无法单独处理
|
||||
- 时间充足,不需要优先级排序
|
||||
|
||||
## 集中兵力的应用
|
||||
- **任务管理**:管理多个并发任务
|
||||
- **项目规划**:规划项目的优先级
|
||||
- **资源分配**:合理分配有限的资源
|
||||
- **问题解决**:集中精力解决关键问题
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 平均分配资源 | 集中资源到最重要的任务 |
|
||||
| 同时处理多个任务 | 一次只处理一个重要任务 |
|
||||
| 忽视任务的重要性 | 认真评估任务的重要性和紧急性 |
|
||||
| 缺乏准备 | 充分准备后再行动 |
|
||||
| 不根据情况调整 | 动态调整优先级和资源分配 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **任务清单**:列出所有待处理的任务
|
||||
2. **评估排序**:评估每个任务的重要性和紧急性,进行排序
|
||||
3. **资源规划**:规划所需的资源,确保重要任务得到充分支持
|
||||
4. **执行计划**:制定详细的执行计划,明确每个任务的时间和资源需求
|
||||
5. **集中执行**:集中精力执行最重要的任务,确保完成质量
|
||||
6. **评估调整**:定期评估任务进展,根据情况调整优先级和资源分配
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **矛盾分析法**:集中兵力需要识别主要矛盾
|
||||
- **持久战略**:在持久战略中,需要在关键阶段集中兵力
|
||||
- **统筹兼顾**:集中兵力需要在全局范围内统筹兼顾
|
||||
- **实践认识论**:集中兵力的效果需要在实践中验证
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "concentrate-forces",
|
||||
"version": "1.0.0",
|
||||
"displayName": "集中兵力",
|
||||
"description": "当多个任务争夺注意力,需要优先处理重要任务时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "集中兵力"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
# 矛盾分析法
|
||||
|
||||
## 技能介绍
|
||||
|
||||
矛盾分析法是求是 OpenClaw Skills 系列中的核心技能,用于分析复杂问题,识别矛盾,抓住主要矛盾,区分矛盾性质,从而找到解决问题的方法。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **矛盾识别**:识别问题中的所有矛盾
|
||||
- **主要矛盾判定**:找出规定或影响其他矛盾的主要矛盾
|
||||
- **矛盾性质分析**:区分对抗性矛盾和非对抗性矛盾
|
||||
- **解决方案选择**:根据矛盾性质选择合适的解决方法
|
||||
- **矛盾转化监控**:持续关注矛盾的变化和转化
|
||||
|
||||
## 触发条件
|
||||
|
||||
当问题复杂、存在多个冲突因素、优先级不清,或你不知道应该先解决什么时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **识别所有矛盾**:列出当前情境中所有对立的、互相制约的因素
|
||||
2. **判定主要矛盾**:找出那个规定或影响着其他矛盾的主要矛盾
|
||||
3. **分析矛盾的主要方面**:判断哪一方面占支配地位
|
||||
4. **区分矛盾性质**:判断矛盾是对抗性的还是非对抗性的
|
||||
5. **选择解决方法**:根据矛盾性质,选择对应方法
|
||||
6. **监控矛盾转化**:持续关注矛盾的变化
|
||||
|
||||
## 矛盾性质判断
|
||||
|
||||
**对抗性矛盾**(根本利益冲突):
|
||||
- 需要明确立场,果断处理
|
||||
- 不能调和,只能选择一方
|
||||
|
||||
**非对抗性矛盾**(共同利益下的分歧):
|
||||
- 使用"团结——批评——团结"的方法
|
||||
- 从团结的愿望出发,通过讨论和批评解决分歧,达到新的团结
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 不做矛盾分析就动手 | 先分析,后行动 |
|
||||
| 搞一刀切 | 每个矛盾都有其特殊性,不能套用模板 |
|
||||
| 抓不住主要矛盾 | 全局着眼,抓住牛鼻子 |
|
||||
| 忽视矛盾转化 | 持续监控,动态调整 |
|
||||
| 把非对抗性矛盾当对抗性处理 | 先判断性质,再选择方法 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下具体步骤并输出结构化的矛盾分析表:
|
||||
1. **列矛盾清单**:用 bullet list 列出当前情境中所有可识别的对立面,格式为 `[A] vs [B]`
|
||||
2. **判定主要矛盾**:在列表中标记一个矛盾为 `⭐ 主要矛盾`,并用一句话说明理由
|
||||
3. **判断性质**:对主要矛盾标注:`对抗性`或 `非对抗性`
|
||||
4. **选择应对方法**:根据性质,选择对应方法,并明确写出"接下来我将……"
|
||||
5. **设置监控提示**:在分析末尾加一行:"⚠️ 需监控:[次要矛盾X] 是否上升为主要矛盾"
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **实践认识论**:矛盾分析得出的结论需要在实践中验证
|
||||
- **调查研究**:识别矛盾的前提是充分的调查研究
|
||||
- **集中兵力**:抓住主要矛盾后,集中力量解决它
|
||||
- **统筹兼顾**:当多对矛盾都需要处理时,需要统筹兼顾
|
||||
- **批评与自我批评**:矛盾分析也适用于审视自己的工作
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install contradiction-analysis
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
name: contradiction-analysis
|
||||
description: "当问题复杂、存在多个冲突因素、优先级不清,或你不知道应该先解决什么时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 矛盾分析法
|
||||
|
||||
## 触发条件
|
||||
当问题复杂、存在多个冲突因素、优先级不清,或你不知道应该先解决什么时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. 识别所有矛盾:列出当前情境中所有对立的、互相制约的因素
|
||||
2. 判定主要矛盾:找出那个规定或影响着其他矛盾的主要矛盾
|
||||
3. 分析矛盾的主要方面:判断哪一方面占支配地位
|
||||
4. 区分矛盾性质:判断矛盾是对抗性的还是非对抗性的
|
||||
5. 选择解决方法:根据矛盾性质,选择对应方法
|
||||
6. 监控矛盾转化:持续关注矛盾的变化
|
||||
|
||||
## 核心原则
|
||||
一切事物都包含矛盾,分析任何问题的方法就是找到其中的矛盾,区分主要矛盾和次要矛盾,然后集中力量解决主要矛盾。
|
||||
|
||||
## 不适用场景
|
||||
- 任务是直接执行性的(如"帮我把这段代码格式化")
|
||||
- 用户已经明确指定了解决方案,只需要实现
|
||||
- 问题只有一个维度,不存在对立面
|
||||
- 时间紧急且问题属于已知模式
|
||||
|
||||
## 矛盾性质判断
|
||||
**对抗性矛盾**(根本利益冲突):
|
||||
- 需要明确立场,果断处理
|
||||
- 不能调和,只能选择一方
|
||||
|
||||
**非对抗性矛盾**(共同利益下的分歧):
|
||||
- 使用"团结——批评——团结"的方法
|
||||
- 从团结的愿望出发,通过讨论和批评解决分歧,达到新的团结
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 不做矛盾分析就动手 | 先分析,后行动 |
|
||||
| 搞一刀切 | 每个矛盾都有其特殊性,不能套用模板 |
|
||||
| 抓不住主要矛盾 | 全局着眼,抓住牛鼻子 |
|
||||
| 忽视矛盾转化 | 持续监控,动态调整 |
|
||||
| 把非对抗性矛盾当对抗性处理 | 先判断性质,再选择方法 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下具体步骤并输出结构化的矛盾分析表:
|
||||
1. **列矛盾清单**:用 bullet list 列出当前情境中所有可识别的对立面,格式为 `[A] vs [B]`
|
||||
2. **判定主要矛盾**:在列表中标记一个矛盾为 `⭐ 主要矛盾`,并用一句话说明理由
|
||||
3. **判断性质**:对主要矛盾标注:`对抗性`或 `非对抗性`
|
||||
4. **选择应对方法**:根据性质,选择对应方法,并明确写出"接下来我将……"
|
||||
5. **设置监控提示**:在分析末尾加一行:"⚠️ 需监控:[次要矛盾X] 是否上升为主要矛盾"
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **实践认识论**:矛盾分析得出的结论需要在实践中验证
|
||||
- **调查研究**:识别矛盾的前提是充分的调查研究
|
||||
- **集中兵力**:抓住主要矛盾后,集中力量解决它
|
||||
- **统筹兼顾**:当多对矛盾都需要处理时,需要统筹兼顾
|
||||
- **批评与自我批评**:矛盾分析也适用于审视自己的工作
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "contradiction-analysis",
|
||||
"version": "1.0.0",
|
||||
"displayName": "矛盾分析法",
|
||||
"description": "当问题复杂、存在多个冲突因素、优先级不清,或你不知道应该先解决什么时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "矛盾分析"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
# 批评与自我批评
|
||||
|
||||
## 技能介绍
|
||||
|
||||
批评与自我批评是求是 OpenClaw Skills 系列中的核心技能,基于毛泽东的《论联合政府》,强调"惩前毖后,治病救人",用于完成工作后审视质量,或改进自身表现。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **自我检查**:对自己的工作进行全面检查
|
||||
- **自我批评**:诚恳地找出自己的不足和错误
|
||||
- **接受批评**:虚心接受他人的批评和建议
|
||||
- **改进计划**:制定具体的改进措施
|
||||
|
||||
## 触发条件
|
||||
|
||||
当完成工作后需要审视质量,或需要改进自身表现时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **自我检查**:对自己的工作进行全面检查
|
||||
2. **自我批评**:诚恳地找出自己的不足和错误
|
||||
3. **接受批评**:虚心接受他人的批评和建议
|
||||
4. **分析原因**:分析产生问题的原因
|
||||
5. **制定改进计划**:制定具体的改进措施
|
||||
6. **落实改进**:认真落实改进计划
|
||||
|
||||
## 核心原则
|
||||
|
||||
惩前毖后,治病救人。房子是应该经常打扫的。
|
||||
|
||||
## 批评与自我批评的方法
|
||||
|
||||
- **实事求是**:基于事实进行批评和自我批评
|
||||
- **与人为善**:以帮助他人为目的,不搞人身攻击
|
||||
- **治病救人**:通过批评帮助他人改进,而不是惩罚
|
||||
- **知无不言**:坦诚地表达自己的意见和看法
|
||||
- **言无不尽**:充分表达自己的想法和建议
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 工作尚未完成
|
||||
- 问题已经解决
|
||||
- 不需要改进的简单任务
|
||||
- 纯粹的理论探讨
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 敷衍了事 | 认真对待批评和自我批评 |
|
||||
| 只批评别人不自我批评 | 首先进行自我批评 |
|
||||
| 搞人身攻击 | 针对问题,不针对个人 |
|
||||
| 不接受批评 | 虚心接受他人的批评和建议 |
|
||||
| 批评后不改进 | 认真落实改进措施 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **准备阶段**:回顾工作内容,收集相关信息
|
||||
2. **自我检查**:对工作进行全面检查,找出问题和不足
|
||||
3. **自我批评**:诚恳地进行自我批评,分析问题原因
|
||||
4. **征求意见**:主动征求他人的批评和建议
|
||||
5. **分析总结**:分析批评意见,总结经验教训
|
||||
6. **改进计划**:制定具体的改进计划和措施
|
||||
7. **落实改进**:认真落实改进计划,定期检查改进效果
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **实践认识论**:批评与自我批评是实践后的重要环节
|
||||
- **调查研究**:批评与自我批评可以发现调查研究中的问题
|
||||
- **群众路线**:批评与自我批评需要群众的参与和监督
|
||||
- **矛盾分析法**:批评与自我批评可以帮助识别和解决内部矛盾
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install criticism-self-criticism
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
name: criticism-self-criticism
|
||||
description: "当完成工作后需要审视质量,或需要改进自身表现时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 批评与自我批评
|
||||
|
||||
## 触发条件
|
||||
当完成工作后需要审视质量,或需要改进自身表现时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **自我检查**:对自己的工作进行全面检查
|
||||
2. **自我批评**:诚恳地找出自己的不足和错误
|
||||
3. **接受批评**:虚心接受他人的批评和建议
|
||||
4. **分析原因**:分析产生问题的原因
|
||||
5. **制定改进计划**:制定具体的改进措施
|
||||
6. **落实改进**:认真落实改进计划
|
||||
|
||||
## 核心原则
|
||||
惩前毖后,治病救人。房子是应该经常打扫的。
|
||||
|
||||
## 不适用场景
|
||||
- 工作尚未完成
|
||||
- 问题已经解决
|
||||
- 不需要改进的简单任务
|
||||
- 纯粹的理论探讨
|
||||
|
||||
## 批评与自我批评的方法
|
||||
- **实事求是**:基于事实进行批评和自我批评
|
||||
- **与人为善**:以帮助他人为目的,不搞人身攻击
|
||||
- **治病救人**:通过批评帮助他人改进,而不是惩罚
|
||||
- **知无不言**:坦诚地表达自己的意见和看法
|
||||
- **言无不尽**:充分表达自己的想法和建议
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 敷衍了事 | 认真对待批评和自我批评 |
|
||||
| 只批评别人不自我批评 | 首先进行自我批评 |
|
||||
| 搞人身攻击 | 针对问题,不针对个人 |
|
||||
| 不接受批评 | 虚心接受他人的批评和建议 |
|
||||
| 批评后不改进 | 认真落实改进措施 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **准备阶段**:回顾工作内容,收集相关信息
|
||||
2. **自我检查**:对工作进行全面检查,找出问题和不足
|
||||
3. **自我批评**:诚恳地进行自我批评,分析问题原因
|
||||
4. **征求意见**:主动征求他人的批评和建议
|
||||
5. **分析总结**:分析批评意见,总结经验教训
|
||||
6. **改进计划**:制定具体的改进计划和措施
|
||||
7. **落实改进**:认真落实改进计划,定期检查改进效果
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **实践认识论**:批评与自我批评是实践后的重要环节
|
||||
- **调查研究**:批评与自我批评可以发现调查研究中的问题
|
||||
- **群众路线**:批评与自我批评需要群众的参与和监督
|
||||
- **矛盾分析法**:批评与自我批评可以帮助识别和解决内部矛盾
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "criticism-self-criticism",
|
||||
"version": "1.0.0",
|
||||
"displayName": "批评与自我批评",
|
||||
"description": "当完成工作后需要审视质量,或需要改进自身表现时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "批评与自我批评"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
# 调查研究
|
||||
|
||||
## 技能介绍
|
||||
|
||||
调查研究是求是 OpenClaw Skills 系列中的核心技能,基于毛泽东的《反对本本主义》,强调"没有调查就没有发言权",用于在做决策前收集充分的信息,深入了解问题背景。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **信息收集**:通过各种渠道收集相关信息
|
||||
- **信息分析**:对收集到的信息进行整理和分析
|
||||
- **结论形成**:基于分析结果形成调查结论
|
||||
- **建议提出**:根据结论提出具体的建议
|
||||
|
||||
## 触发条件
|
||||
|
||||
当需要做决策但信息不足,或需要深入了解问题背景时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **明确调查目标**:确定需要了解的问题和信息
|
||||
2. **制定调查计划**:设计调查方法、步骤和时间安排
|
||||
3. **收集信息**:通过各种渠道收集相关信息
|
||||
4. **分析信息**:对收集到的信息进行整理和分析
|
||||
5. **形成结论**:基于分析结果形成调查结论
|
||||
6. **提出建议**:根据结论提出具体的建议
|
||||
|
||||
## 核心原则
|
||||
|
||||
没有调查就没有发言权。调查就像"十月怀胎",解决问题就像"一朝分娩"。
|
||||
|
||||
## 调查方法
|
||||
|
||||
- **观察法**:直接观察相关现象和行为
|
||||
- **访谈法**:与相关人员进行交流和访谈
|
||||
- **文献法**:查阅相关文献和资料
|
||||
- **实验法**:通过实验验证假设
|
||||
- **问卷调查法**:通过问卷收集大量信息
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 已经有足够的信息做出决策
|
||||
- 时间紧急且问题属于已知模式
|
||||
- 纯粹的理论探讨,不需要实际信息
|
||||
- 问题本身不涉及具体事实
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 没有调查就下结论 | 先调查,后结论 |
|
||||
| 调查不全面 | 从多个角度收集信息 |
|
||||
| 调查不深入 | 深入分析问题的本质 |
|
||||
| 只收集有利信息 | 客观收集各种信息,包括不利信息 |
|
||||
| 调查后不分析 | 对收集到的信息进行系统分析 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **明确问题**:清楚定义需要调查的问题
|
||||
2. **确定范围**:确定调查的范围和边界
|
||||
3. **选择方法**:根据问题特点选择合适的调查方法
|
||||
4. **实施调查**:按照计划进行调查,收集信息
|
||||
5. **分析数据**:对收集到的数据进行整理和分析
|
||||
6. **形成报告**:撰写调查报告,包括发现和建议
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **矛盾分析法**:调查研究是识别矛盾的前提
|
||||
- **实践认识论**:调查研究是实践的重要组成部分
|
||||
- **群众路线**:调查研究需要深入群众,了解实际情况
|
||||
- **批评与自我批评**:调查研究可以发现自身存在的问题
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install investigation-first
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
name: investigation-first
|
||||
description: "当需要做决策但信息不足,或需要深入了解问题背景时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 调查研究
|
||||
|
||||
## 触发条件
|
||||
当需要做决策但信息不足,或需要深入了解问题背景时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **明确调查目标**:确定需要了解的问题和信息
|
||||
2. **制定调查计划**:设计调查方法、步骤和时间安排
|
||||
3. **收集信息**:通过各种渠道收集相关信息
|
||||
4. **分析信息**:对收集到的信息进行整理和分析
|
||||
5. **形成结论**:基于分析结果形成调查结论
|
||||
6. **提出建议**:根据结论提出具体的建议
|
||||
|
||||
## 核心原则
|
||||
没有调查就没有发言权。调查就像"十月怀胎",解决问题就像"一朝分娩"。
|
||||
|
||||
## 不适用场景
|
||||
- 已经有足够的信息做出决策
|
||||
- 时间紧急且问题属于已知模式
|
||||
- 纯粹的理论探讨,不需要实际信息
|
||||
- 问题本身不涉及具体事实
|
||||
|
||||
## 调查方法
|
||||
- **观察法**:直接观察相关现象和行为
|
||||
- **访谈法**:与相关人员进行交流和访谈
|
||||
- **文献法**:查阅相关文献和资料
|
||||
- **实验法**:通过实验验证假设
|
||||
- **问卷调查法**:通过问卷收集大量信息
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 没有调查就下结论 | 先调查,后结论 |
|
||||
| 调查不全面 | 从多个角度收集信息 |
|
||||
| 调查不深入 | 深入分析问题的本质 |
|
||||
| 只收集有利信息 | 客观收集各种信息,包括不利信息 |
|
||||
| 调查后不分析 | 对收集到的信息进行系统分析 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **明确问题**:清楚定义需要调查的问题
|
||||
2. **确定范围**:确定调查的范围和边界
|
||||
3. **选择方法**:根据问题特点选择合适的调查方法
|
||||
4. **实施调查**:按照计划进行调查,收集信息
|
||||
5. **分析数据**:对收集到的数据进行整理和分析
|
||||
6. **形成报告**:撰写调查报告,包括发现和建议
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **矛盾分析法**:调查研究是识别矛盾的前提
|
||||
- **实践认识论**:调查研究是实践的重要组成部分
|
||||
- **群众路线**:调查研究需要深入群众,了解实际情况
|
||||
- **批评与自我批评**:调查研究可以发现自身存在的问题
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "investigation-first",
|
||||
"version": "1.0.0",
|
||||
"displayName": "调查研究",
|
||||
"description": "当需要做决策但信息不足,或需要深入了解问题背景时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "调查研究"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
# 群众路线
|
||||
|
||||
## 技能介绍
|
||||
|
||||
群众路线是求是 OpenClaw Skills 系列中的核心技能,基于毛泽东的《关于领导方法的若干问题》,强调"从群众中来,到群众中去",用于收集多方意见和整合多源信息。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **意见收集**:收集群众的意见和建议
|
||||
- **意见分析**:对收集到的意见进行整理和分析
|
||||
- **意见反馈**:将整理后的意见反馈给群众
|
||||
- **方案优化**:根据群众反馈优化方案
|
||||
|
||||
## 触发条件
|
||||
|
||||
当需要收集多方意见或整合多源信息时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **从群众中来**:收集群众的意见和建议
|
||||
2. **集中起来**:对收集到的意见进行整理和分析
|
||||
3. **到群众中去**:将整理后的意见反馈给群众
|
||||
4. **坚持下去**:根据群众的反馈进一步调整和完善
|
||||
|
||||
## 核心原则
|
||||
|
||||
从群众中来,到群众中去。收集→系统化→返回→验证→再收集。
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 问题只涉及少数专业人士的意见
|
||||
- 时间紧急且需要快速决策
|
||||
- 问题本身不需要多方意见
|
||||
- 已经有明确的解决方案
|
||||
|
||||
## 群众路线的应用
|
||||
|
||||
- **决策参考**:收集群众意见作为决策的参考
|
||||
- **方案优化**:根据群众反馈优化方案
|
||||
- **问题解决**:依靠群众的智慧解决问题
|
||||
- **关系维护**:通过群众路线维护良好的关系
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 忽视群众意见 | 认真倾听群众的意见和建议 |
|
||||
| 只收集不反馈 | 及时将处理结果反馈给群众 |
|
||||
| 形式主义 | 真正深入群众,了解实际情况 |
|
||||
| 选择性收集 | 客观收集各种意见,包括批评意见 |
|
||||
| 不重视反馈 | 认真对待群众的反馈,及时调整 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **确定范围**:确定需要收集意见的范围和对象
|
||||
2. **设计方法**:设计收集意见的方法和工具
|
||||
3. **收集意见**:通过各种渠道收集群众的意见
|
||||
4. **整理分析**:对收集到的意见进行整理和分析
|
||||
5. **形成方案**:基于分析结果形成初步方案
|
||||
6. **反馈验证**:将方案反馈给群众,征求意见
|
||||
7. **调整完善**:根据反馈调整和完善方案
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **调查研究**:群众路线是调查研究的重要方法
|
||||
- **实践认识论**:群众的实践是认识的重要来源
|
||||
- **批评与自我批评**:群众的批评是自我批评的重要参考
|
||||
- **统筹兼顾**:群众路线需要统筹兼顾各方利益
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install mass-line
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: mass-line
|
||||
description: "当需要收集多方意见或整合多源信息时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 群众路线
|
||||
|
||||
## 触发条件
|
||||
当需要收集多方意见或整合多源信息时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **从群众中来**:收集群众的意见和建议
|
||||
2. **集中起来**:对收集到的意见进行整理和分析
|
||||
3. **到群众中去**:将整理后的意见反馈给群众
|
||||
4. **坚持下去**:根据群众的反馈进一步调整和完善
|
||||
|
||||
## 核心原则
|
||||
从群众中来,到群众中去。收集→系统化→返回→验证→再收集。
|
||||
|
||||
## 不适用场景
|
||||
- 问题只涉及少数专业人士的意见
|
||||
- 时间紧急且需要快速决策
|
||||
- 问题本身不需要多方意见
|
||||
- 已经有明确的解决方案
|
||||
|
||||
## 群众路线的应用
|
||||
- **决策参考**:收集群众意见作为决策的参考
|
||||
- **方案优化**:根据群众反馈优化方案
|
||||
- **问题解决**:依靠群众的智慧解决问题
|
||||
- **关系维护**:通过群众路线维护良好的关系
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 忽视群众意见 | 认真倾听群众的意见和建议 |
|
||||
| 只收集不反馈 | 及时将处理结果反馈给群众 |
|
||||
| 形式主义 | 真正深入群众,了解实际情况 |
|
||||
| 选择性收集 | 客观收集各种意见,包括批评意见 |
|
||||
| 不重视反馈 | 认真对待群众的反馈,及时调整 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **确定范围**:确定需要收集意见的范围和对象
|
||||
2. **设计方法**:设计收集意见的方法和工具
|
||||
3. **收集意见**:通过各种渠道收集群众的意见
|
||||
4. **整理分析**:对收集到的意见进行整理和分析
|
||||
5. **形成方案**:基于分析结果形成初步方案
|
||||
6. **反馈验证**:将方案反馈给群众,征求意见
|
||||
7. **调整完善**:根据反馈调整和完善方案
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **调查研究**:群众路线是调查研究的重要方法
|
||||
- **实践认识论**:群众的实践是认识的重要来源
|
||||
- **批评与自我批评**:群众的批评是自我批评的重要参考
|
||||
- **统筹兼顾**:群众路线需要统筹兼顾各方利益
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "mass-line",
|
||||
"version": "1.0.0",
|
||||
"displayName": "群众路线",
|
||||
"description": "当需要收集多方意见或整合多源信息时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "群众路线"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
# 统筹兼顾
|
||||
|
||||
## 技能介绍
|
||||
|
||||
统筹兼顾是求是 OpenClaw Skills 系列中的核心技能,基于毛泽东的《论十大关系》,强调"调动一切积极因素",用于当多个目标需要平衡时统筹兼顾各方面因素。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **目标分析**:分析所有需要实现的目标
|
||||
- **资源评估**:评估可用的资源和约束条件
|
||||
- **优先级确定**:确定各目标的优先级
|
||||
- **方案制定**:制定统筹兼顾的方案
|
||||
- **资源分配**:合理分配资源,确保各目标的实现
|
||||
|
||||
## 触发条件
|
||||
|
||||
当多个目标需要平衡,需要统筹兼顾时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **目标分析**:分析所有需要实现的目标
|
||||
2. **资源评估**:评估可用的资源和约束条件
|
||||
3. **优先级确定**:确定各目标的优先级
|
||||
4. **方案制定**:制定统筹兼顾的方案
|
||||
5. **资源分配**:合理分配资源,确保各目标的实现
|
||||
6. **执行监控**:监控执行情况,及时调整方案
|
||||
7. **平衡优化**:不断优化,确保各目标的平衡实现
|
||||
|
||||
## 核心原则
|
||||
|
||||
调动一切积极因素。拒绝片面性,寻找动态平衡。
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 只有一个目标
|
||||
- 目标之间没有冲突
|
||||
- 资源充足,不需要平衡
|
||||
- 时间紧急,不需要统筹规划
|
||||
|
||||
## 统筹兼顾的应用
|
||||
|
||||
- **项目管理**:管理多个项目目标
|
||||
- **资源分配**:分配有限的资源
|
||||
- **决策制定**:制定兼顾各方利益的决策
|
||||
- **战略规划**:规划长期战略目标
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 片面追求单一目标 | 兼顾所有重要目标 |
|
||||
| 忽视资源约束 | 考虑资源约束,合理分配 |
|
||||
| 缺乏整体规划 | 制定整体规划,协调各目标 |
|
||||
| 不考虑长期影响 | 考虑长期影响,保持可持续发展 |
|
||||
| 不根据情况调整 | 动态调整,保持平衡 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **目标清单**:列出所有需要实现的目标
|
||||
2. **目标分析**:分析各目标的重要性、紧迫性和相互关系
|
||||
3. **资源评估**:评估可用的资源和约束条件
|
||||
4. **优先级排序**:根据分析结果,确定各目标的优先级
|
||||
5. **方案制定**:制定统筹兼顾的方案,确保各目标的平衡实现
|
||||
6. **资源分配**:根据优先级和需求,合理分配资源
|
||||
7. **执行实施**:按照方案执行,监控执行情况
|
||||
8. **调整优化**:根据执行情况,及时调整方案,确保各目标的平衡实现
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **矛盾分析法**:统筹兼顾需要分析和平衡各种矛盾
|
||||
- **集中兵力**:在统筹兼顾的基础上,需要集中兵力于关键目标
|
||||
- **持久战略**:统筹兼顾需要考虑长期战略目标
|
||||
- **群众路线**:统筹兼顾需要考虑各方利益和意见
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install overall-planning
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
name: overall-planning
|
||||
description: "当多个目标需要平衡,需要统筹兼顾时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 统筹兼顾
|
||||
|
||||
## 触发条件
|
||||
当多个目标需要平衡,需要统筹兼顾时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **目标分析**:分析所有需要实现的目标
|
||||
2. **资源评估**:评估可用的资源和约束条件
|
||||
3. **优先级确定**:确定各目标的优先级
|
||||
4. **方案制定**:制定统筹兼顾的方案
|
||||
5. **资源分配**:合理分配资源,确保各目标的实现
|
||||
6. **执行监控**:监控执行情况,及时调整方案
|
||||
7. **平衡优化**:不断优化,确保各目标的平衡实现
|
||||
|
||||
## 核心原则
|
||||
调动一切积极因素。拒绝片面性,寻找动态平衡。
|
||||
|
||||
## 不适用场景
|
||||
- 只有一个目标
|
||||
- 目标之间没有冲突
|
||||
- 资源充足,不需要平衡
|
||||
- 时间紧急,不需要统筹规划
|
||||
|
||||
## 统筹兼顾的应用
|
||||
- **项目管理**:管理多个项目目标
|
||||
- **资源分配**:分配有限的资源
|
||||
- **决策制定**:制定兼顾各方利益的决策
|
||||
- **战略规划**:规划长期战略目标
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 片面追求单一目标 | 兼顾所有重要目标 |
|
||||
| 忽视资源约束 | 考虑资源约束,合理分配 |
|
||||
| 缺乏整体规划 | 制定整体规划,协调各目标 |
|
||||
| 不考虑长期影响 | 考虑长期影响,保持可持续发展 |
|
||||
| 不根据情况调整 | 动态调整,保持平衡 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **目标清单**:列出所有需要实现的目标
|
||||
2. **目标分析**:分析各目标的重要性、紧迫性和相互关系
|
||||
3. **资源评估**:评估可用的资源和约束条件
|
||||
4. **优先级排序**:根据分析结果,确定各目标的优先级
|
||||
5. **方案制定**:制定统筹兼顾的方案,确保各目标的平衡实现
|
||||
6. **资源分配**:根据优先级和需求,合理分配资源
|
||||
7. **执行实施**:按照方案执行,监控执行情况
|
||||
8. **调整优化**:根据执行情况,及时调整方案,确保各目标的平衡实现
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **矛盾分析法**:统筹兼顾需要分析和平衡各种矛盾
|
||||
- **集中兵力**:在统筹兼顾的基础上,需要集中兵力于关键目标
|
||||
- **持久战略**:统筹兼顾需要考虑长期战略目标
|
||||
- **群众路线**:统筹兼顾需要考虑各方利益和意见
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "overall-planning",
|
||||
"version": "1.0.0",
|
||||
"displayName": "统筹兼顾",
|
||||
"description": "当多个目标需要平衡,需要统筹兼顾时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "统筹兼顾"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
# 实践认识论
|
||||
|
||||
## 技能介绍
|
||||
|
||||
实践认识论是求是 OpenClaw Skills 系列中的核心技能,基于毛泽东的《实践论》,强调实践→认识→再实践→再认识的螺旋上升过程,用于验证方案、迭代改进和从实践中学习。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **方案验证**:通过实践验证方案的可行性
|
||||
- **迭代改进**:根据实践结果不断调整和优化方案
|
||||
- **经验总结**:从成功和失败中提炼出可复用的经验
|
||||
- **规律发现**:通过多次实践发现事物的内在规律
|
||||
|
||||
## 触发条件
|
||||
|
||||
当需要验证方案、迭代改进、从实践中学习时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **实践**:制定并执行具体方案
|
||||
2. **认识**:分析实践结果,总结经验教训
|
||||
3. **再实践**:根据认识调整方案,再次执行
|
||||
4. **再认识**:继续总结,形成更深刻的认识
|
||||
5. **循环往复**:直到问题解决或形成稳定的方法论
|
||||
|
||||
## 核心原则
|
||||
|
||||
实践→认识→再实践→再认识,螺旋上升。实践是检验真理的唯一标准。
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 纯粹的理论探讨,不需要实际验证
|
||||
- 已经有明确且经过验证的解决方案
|
||||
- 时间或资源不允许进行实践验证
|
||||
- 问题本身不涉及实践操作
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 只实践不总结 | 每次实践后都要进行总结和反思 |
|
||||
| 只理论不实践 | 将理论与实践相结合,用实践检验理论 |
|
||||
| 一次实践就下结论 | 多次实践,综合分析结果 |
|
||||
| 忽视实践中的细节 | 关注实践中的具体情况,细节决定成败 |
|
||||
| 拒绝根据实践调整方案 | 保持开放心态,根据实践结果灵活调整 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **明确目标**:清楚定义要验证的假设或要解决的问题
|
||||
2. **制定方案**:设计具体的实践步骤和评估标准
|
||||
3. **执行实践**:按照方案进行操作,记录过程和结果
|
||||
4. **分析结果**:客观分析实践结果,找出成功和失败的原因
|
||||
5. **调整方案**:根据分析结果调整方案,准备下一次实践
|
||||
6. **总结经验**:提炼出可复用的经验和方法论
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **矛盾分析法**:实践认识论可以验证矛盾分析的结论
|
||||
- **调查研究**:实践是调查研究的延伸,也是验证调查结果的方法
|
||||
- **批评与自我批评**:实践中的失败和不足是批评与自我批评的重要内容
|
||||
- **持久战略**:长期复杂任务需要通过实践认识论不断调整策略
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install practice-cognition
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: practice-cognition
|
||||
description: "当需要验证方案、迭代改进、从实践中学习时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 实践认识论
|
||||
|
||||
## 触发条件
|
||||
当需要验证方案、迭代改进、从实践中学习时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **实践**:制定并执行具体方案
|
||||
2. **认识**:分析实践结果,总结经验教训
|
||||
3. **再实践**:根据认识调整方案,再次执行
|
||||
4. **再认识**:继续总结,形成更深刻的认识
|
||||
5. **循环往复**:直到问题解决或形成稳定的方法论
|
||||
|
||||
## 核心原则
|
||||
实践→认识→再实践→再认识,螺旋上升。实践是检验真理的唯一标准。
|
||||
|
||||
## 不适用场景
|
||||
- 纯粹的理论探讨,不需要实际验证
|
||||
- 已经有明确且经过验证的解决方案
|
||||
- 时间或资源不允许进行实践验证
|
||||
- 问题本身不涉及实践操作
|
||||
|
||||
## 实践认识论的应用
|
||||
- **方案验证**:通过小规模实践验证方案的可行性
|
||||
- **迭代改进**:根据实践结果不断调整和优化方案
|
||||
- **经验总结**:从成功和失败中提炼出可复用的经验
|
||||
- **规律发现**:通过多次实践发现事物的内在规律
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 只实践不总结 | 每次实践后都要进行总结和反思 |
|
||||
| 只理论不实践 | 将理论与实践相结合,用实践检验理论 |
|
||||
| 一次实践就下结论 | 多次实践,综合分析结果 |
|
||||
| 忽视实践中的细节 | 关注实践中的具体情况,细节决定成败 |
|
||||
| 拒绝根据实践调整方案 | 保持开放心态,根据实践结果灵活调整 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **明确目标**:清楚定义要验证的假设或要解决的问题
|
||||
2. **制定方案**:设计具体的实践步骤和评估标准
|
||||
3. **执行实践**:按照方案进行操作,记录过程和结果
|
||||
4. **分析结果**:客观分析实践结果,找出成功和失败的原因
|
||||
5. **调整方案**:根据分析结果调整方案,准备下一次实践
|
||||
6. **总结经验**:提炼出可复用的经验和方法论
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **矛盾分析法**:实践认识论可以验证矛盾分析的结论
|
||||
- **调查研究**:实践是调查研究的延伸,也是验证调查结果的方法
|
||||
- **批评与自我批评**:实践中的失败和不足是批评与自我批评的重要内容
|
||||
- **持久战略**:长期复杂任务需要通过实践认识论不断调整策略
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "practice-cognition",
|
||||
"version": "1.0.0",
|
||||
"displayName": "实践认识论",
|
||||
"description": "当需要验证方案、迭代改进、从实践中学习时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "实践认识论"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
# 持久战略
|
||||
|
||||
## 技能介绍
|
||||
|
||||
持久战略是求是 OpenClaw Skills 系列中的核心技能,基于毛泽东的《论持久战》,强调"战略上藐视,战术上重视",用于面对长期复杂任务时制定长期计划。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **战略分析**:分析任务的性质、特点和挑战
|
||||
- **阶段划分**:将长期任务划分为多个阶段
|
||||
- **计划制定**:为每个阶段制定具体的计划和目标
|
||||
- **资源分配**:合理分配资源,确保各阶段的顺利进行
|
||||
- **执行监控**:监控执行情况,及时调整计划
|
||||
|
||||
## 触发条件
|
||||
|
||||
当面对长期复杂任务,需要制定长期计划时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **战略分析**:分析任务的性质、特点和挑战
|
||||
2. **阶段划分**:将长期任务划分为多个阶段
|
||||
3. **制定计划**:为每个阶段制定具体的计划和目标
|
||||
4. **资源分配**:合理分配资源,确保各阶段的顺利进行
|
||||
5. **执行监控**:监控执行情况,及时调整计划
|
||||
6. **阶段评估**:对每个阶段的成果进行评估
|
||||
7. **持续推进**:保持动力,持续推进任务的完成
|
||||
|
||||
## 核心原则
|
||||
|
||||
战略上藐视,战术上重视。不急于求成,也不畏难放弃。
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 短期简单任务
|
||||
- 已经有明确的解决方案
|
||||
- 时间紧急且需要快速完成的任务
|
||||
- 不需要长期规划的任务
|
||||
|
||||
## 持久战略的应用
|
||||
|
||||
- **长期项目**:制定长期项目的阶段性计划
|
||||
- **职业发展**:规划个人或组织的长期发展
|
||||
- **问题解决**:解决复杂的长期问题
|
||||
- **能力建设**:长期能力建设和培养
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 急于求成 | 制定合理的时间表,稳步推进 |
|
||||
| 畏难放弃 | 保持信心,坚持到底 |
|
||||
| 缺乏规划 | 制定详细的阶段计划 |
|
||||
| 资源分配不当 | 合理分配资源,确保各阶段的需求 |
|
||||
| 监控不力 | 定期监控执行情况,及时调整 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **任务分析**:分析任务的性质、难度和时间要求
|
||||
2. **阶段划分**:将任务划分为多个合理的阶段
|
||||
3. **目标设定**:为每个阶段设定具体的目标和指标
|
||||
4. **计划制定**:制定每个阶段的详细计划和行动方案
|
||||
5. **资源规划**:规划所需的资源和支持
|
||||
6. **执行实施**:按照计划执行,定期检查进度
|
||||
7. **评估调整**:对每个阶段进行评估,根据情况调整计划
|
||||
8. **持续推进**:保持动力,直至任务完成
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **矛盾分析法**:持久战略需要分析长期任务中的矛盾
|
||||
- **实践认识论**:持久战略需要通过实践不断调整
|
||||
- **集中兵力**:在持久战略中,需要在关键阶段集中兵力
|
||||
- **统筹兼顾**:持久战略需要统筹兼顾各方面的因素
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install protracted-strategy
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
name: protracted-strategy
|
||||
description: "当面对长期复杂任务,需要制定长期计划时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 持久战略
|
||||
|
||||
## 触发条件
|
||||
当面对长期复杂任务,需要制定长期计划时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **战略分析**:分析任务的性质、特点和挑战
|
||||
2. **阶段划分**:将长期任务划分为多个阶段
|
||||
3. **制定计划**:为每个阶段制定具体的计划和目标
|
||||
4. **资源分配**:合理分配资源,确保各阶段的顺利进行
|
||||
5. **执行监控**:监控执行情况,及时调整计划
|
||||
6. **阶段评估**:对每个阶段的成果进行评估
|
||||
7. **持续推进**:保持动力,持续推进任务的完成
|
||||
|
||||
## 核心原则
|
||||
战略上藐视,战术上重视。不急于求成,也不畏难放弃。
|
||||
|
||||
## 不适用场景
|
||||
- 短期简单任务
|
||||
- 已经有明确的解决方案
|
||||
- 时间紧急且需要快速完成的任务
|
||||
- 不需要长期规划的任务
|
||||
|
||||
## 持久战略的应用
|
||||
- **长期项目**:制定长期项目的阶段性计划
|
||||
- **职业发展**:规划个人或组织的长期发展
|
||||
- **问题解决**:解决复杂的长期问题
|
||||
- **能力建设**:长期能力建设和培养
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 急于求成 | 制定合理的时间表,稳步推进 |
|
||||
| 畏难放弃 | 保持信心,坚持到底 |
|
||||
| 缺乏规划 | 制定详细的阶段计划 |
|
||||
| 资源分配不当 | 合理分配资源,确保各阶段的需求 |
|
||||
| 监控不力 | 定期监控执行情况,及时调整 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **任务分析**:分析任务的性质、难度和时间要求
|
||||
2. **阶段划分**:将任务划分为多个合理的阶段
|
||||
3. **目标设定**:为每个阶段设定具体的目标和指标
|
||||
4. **计划制定**:制定每个阶段的详细计划和行动方案
|
||||
5. **资源规划**:规划所需的资源和支持
|
||||
6. **执行实施**:按照计划执行,定期检查进度
|
||||
7. **评估调整**:对每个阶段进行评估,根据情况调整计划
|
||||
8. **持续推进**:保持动力,直至任务完成
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **矛盾分析法**:持久战略需要分析长期任务中的矛盾
|
||||
- **实践认识论**:持久战略需要通过实践不断调整
|
||||
- **集中兵力**:在持久战略中,需要在关键阶段集中兵力
|
||||
- **统筹兼顾**:持久战略需要统筹兼顾各方面的因素
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "protracted-strategy",
|
||||
"version": "1.0.0",
|
||||
"displayName": "持久战略",
|
||||
"description": "当面对长期复杂任务,需要制定长期计划时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "持久战略"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
## Description: <br>
|
||||
求是 OpenClaw Skills 是基于毛泽东思想方法论的 AI Agent 技能集合,按照 OpenClaw 技能格式进行改造,旨在为 AI 提供系统化的思考和行动框架。 <br>
|
||||
|
||||
This skill is ready for commercial/non-commercial use. <br>
|
||||
|
||||
## Publisher: <br>
|
||||
[skytodmoon](https://clawhub.ai/user/skytodmoon) <br>
|
||||
|
||||
### License/Terms of Use: <br>
|
||||
MIT-0 <br>
|
||||
|
||||
|
||||
## Use Case: <br>
|
||||
Developers and agent users use this Chinese-language skill pack to guide planning, prioritization, investigation, review, and multi-skill workflow selection with a Mao-inspired methodology framework. <br>
|
||||
|
||||
### Deployment Geography for Use: <br>
|
||||
Global <br>
|
||||
|
||||
## Known Risks and Mitigations: <br>
|
||||
Risk: The broad arming-thought trigger can influence planning, prioritization, review, and skill routing at the start of new top-level conversations. <br>
|
||||
Mitigation: Install only where this Chinese-language Mao-inspired reasoning framework is desired, and review the automatic trigger behavior before enabling the pack. <br>
|
||||
|
||||
|
||||
## Reference(s): <br>
|
||||
- [ClawHub skill page](https://clawhub.ai/skytodmoon/qiushi-openclaw-skill) <br>
|
||||
- [Publisher profile](https://clawhub.ai/user/skytodmoon) <br>
|
||||
- [Referenced project homepage](https://github.com/skytodmoon/qiushi-skill) <br>
|
||||
|
||||
|
||||
## Skill Output: <br>
|
||||
**Output Type(s):** [guidance, markdown, analysis] <br>
|
||||
**Output Format:** [Markdown guidance with structured checklists, tables, and step-by-step reasoning prompts] <br>
|
||||
**Output Parameters:** [1D] <br>
|
||||
**Other Properties Related to Output:** [No tools, environment variables, credentials, file access, network access, or persistence requested by the artifact.] <br>
|
||||
|
||||
## Skill Version(s): <br>
|
||||
1.0.0 (source: server release evidence and clawhub.json manifests) <br>
|
||||
|
||||
## Ethical Considerations: <br>
|
||||
Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>
|
||||
@@ -0,0 +1,79 @@
|
||||
# 星火燎原
|
||||
|
||||
## 技能介绍
|
||||
|
||||
星火燎原是求是 OpenClaw Skills 系列中的核心技能,基于毛泽东的《星星之火,可以燎原》,强调"建立根据地,不做流寇",用于从零开始、资源有限时从小处着手积累发展。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **根据地建立**:选择适合的起点,建立基础
|
||||
- **经验积累**:在小范围内积累经验和资源
|
||||
- **逐步扩展**:在基础稳固后,逐步扩展范围
|
||||
- **规模效应**:通过不断积累和扩展,形成规模效应
|
||||
|
||||
## 触发条件
|
||||
|
||||
当从零开始,资源有限,需要从小处着手积累发展时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **建立根据地**:选择一个适合的起点,建立基础
|
||||
2. **积累经验**:在小范围内积累经验和资源
|
||||
3. **逐步扩展**:在基础稳固后,逐步扩展范围
|
||||
4. **形成规模**:通过不断积累和扩展,形成规模效应
|
||||
5. **持续发展**:保持发展势头,持续创新和改进
|
||||
|
||||
## 核心原则
|
||||
|
||||
建立根据地,不做流寇。从小处着手,积累发展。
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 资源充足,不需要从小处着手
|
||||
- 已经有成熟的基础和规模
|
||||
- 时间紧急,需要快速达到规模
|
||||
- 不需要长期发展的项目
|
||||
|
||||
## 星火燎原的应用
|
||||
|
||||
- **创业初期**:从零开始创业,建立基础
|
||||
- **新领域探索**:进入新领域,积累经验
|
||||
- **能力建设**:从小处着手,逐步提升能力
|
||||
- **市场开拓**:从局部市场开始,逐步扩展
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 急于求成 | 稳扎稳打,逐步发展 |
|
||||
| 忽视基础 | 重视基础建设,确保稳固 |
|
||||
| 盲目扩张 | 在基础稳固后再扩展 |
|
||||
| 缺乏耐心 | 保持耐心,注重积累 |
|
||||
| 不适应变化 | 灵活适应环境变化,及时调整策略 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **起点选择**:选择一个适合的起点,考虑资源和环境因素
|
||||
2. **基础建设**:在起点建立稳固的基础,积累经验和资源
|
||||
3. **经验总结**:总结初期经验,优化方法和策略
|
||||
4. **逐步扩展**:在基础稳固后,逐步扩展范围和规模
|
||||
5. **规模效应**:通过扩展形成规模效应,提高效率和影响力
|
||||
6. **持续创新**:保持创新,适应变化,持续发展
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **持久战略**:星火燎原需要长期的战略规划
|
||||
- **集中兵力**:在发展过程中,需要集中兵力于关键领域
|
||||
- **实践认识论**:通过实践不断积累经验和改进
|
||||
- **统筹兼顾**:在发展过程中需要统筹兼顾各方面的因素
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install spark-prairie-fire
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: spark-prairie-fire
|
||||
description: "当从零开始,资源有限,需要从小处着手积累发展时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 星火燎原
|
||||
|
||||
## 触发条件
|
||||
当从零开始,资源有限,需要从小处着手积累发展时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **建立根据地**:选择一个适合的起点,建立基础
|
||||
2. **积累经验**:在小范围内积累经验和资源
|
||||
3. **逐步扩展**:在基础稳固后,逐步扩展范围
|
||||
4. **形成规模**:通过不断积累和扩展,形成规模效应
|
||||
5. **持续发展**:保持发展势头,持续创新和改进
|
||||
|
||||
## 核心原则
|
||||
建立根据地,不做流寇。从小处着手,积累发展。
|
||||
|
||||
## 不适用场景
|
||||
- 资源充足,不需要从小处着手
|
||||
- 已经有成熟的基础和规模
|
||||
- 时间紧急,需要快速达到规模
|
||||
- 不需要长期发展的项目
|
||||
|
||||
## 星火燎原的应用
|
||||
- **创业初期**:从零开始创业,建立基础
|
||||
- **新领域探索**:进入新领域,积累经验
|
||||
- **能力建设**:从小处着手,逐步提升能力
|
||||
- **市场开拓**:从局部市场开始,逐步扩展
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 急于求成 | 稳扎稳打,逐步发展 |
|
||||
| 忽视基础 | 重视基础建设,确保稳固 |
|
||||
| 盲目扩张 | 在基础稳固后再扩展 |
|
||||
| 缺乏耐心 | 保持耐心,注重积累 |
|
||||
| 不适应变化 | 灵活适应环境变化,及时调整策略 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **起点选择**:选择一个适合的起点,考虑资源和环境因素
|
||||
2. **基础建设**:在起点建立稳固的基础,积累经验和资源
|
||||
3. **经验总结**:总结初期经验,优化方法和策略
|
||||
4. **逐步扩展**:在基础稳固后,逐步扩展范围和规模
|
||||
5. **规模效应**:通过扩展形成规模效应,提高效率和影响力
|
||||
6. **持续创新**:保持创新,适应变化,持续发展
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **持久战略**:星火燎原需要长期的战略规划
|
||||
- **集中兵力**:在发展过程中,需要集中兵力于关键领域
|
||||
- **实践认识论**:通过实践不断积累经验和改进
|
||||
- **统筹兼顾**:在发展过程中需要统筹兼顾各方面的因素
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "spark-prairie-fire",
|
||||
"version": "1.0.0",
|
||||
"displayName": "星火燎原",
|
||||
"description": "当从零开始,资源有限,需要从小处着手积累发展时调用",
|
||||
"author": "求是 Skill",
|
||||
"homepage": "https://github.com/skytodmoon/qiushi-skill",
|
||||
"tags": ["方法论", "毛泽东思想", "星火燎原"],
|
||||
"requires": {
|
||||
"env": []
|
||||
},
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
# 工作流组合
|
||||
|
||||
## 技能介绍
|
||||
|
||||
工作流组合是求是 OpenClaw Skills 系列中的核心技能,用于当一个任务明确需要多种方法串联时,组合使用多个技能形成完整的工作流程。
|
||||
|
||||
## 核心功能
|
||||
|
||||
- **任务分析**:分析任务的性质和需求
|
||||
- **技能选择**:选择适合的技能组合
|
||||
- **顺序确定**:确定技能的调用顺序
|
||||
- **流程设计**:设计详细的工作流程
|
||||
- **执行监控**:监控工作流程的执行情况
|
||||
|
||||
## 触发条件
|
||||
|
||||
当一个任务明确需要多种方法串联,需要组合使用多个技能时触发。
|
||||
|
||||
## 执行步骤
|
||||
|
||||
1. **任务分析**:分析任务的性质和需求
|
||||
2. **技能选择**:选择适合的技能组合
|
||||
3. **顺序确定**:确定技能的调用顺序
|
||||
4. **流程设计**:设计详细的工作流程
|
||||
5. **执行监控**:监控工作流程的执行情况
|
||||
6. **调整优化**:根据执行情况调整工作流程
|
||||
|
||||
## 核心原则
|
||||
|
||||
根据任务需求,灵活组合使用各种技能,形成完整的工作流程。
|
||||
|
||||
## 不适用场景
|
||||
|
||||
- 任务只需要单一技能
|
||||
- 任务流程简单,不需要复杂的技能组合
|
||||
- 时间紧急,不需要详细的工作流程设计
|
||||
- 已经有明确的工作流程
|
||||
|
||||
## 工作流组合的应用
|
||||
|
||||
- **复杂项目**:处理复杂的项目任务
|
||||
- **多阶段任务**:处理需要多个阶段的任务
|
||||
- **跨领域任务**:处理涉及多个领域的任务
|
||||
- **创新任务**:处理需要创新思维的任务
|
||||
|
||||
## 常见错误
|
||||
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 技能选择不当 | 根据任务需求选择合适的技能 |
|
||||
| 顺序安排不合理 | 合理安排技能的调用顺序 |
|
||||
| 流程设计过于复杂 | 设计简洁有效的工作流程 |
|
||||
| 缺乏监控和调整 | 监控执行情况,及时调整流程 |
|
||||
| 忽视技能间的协同 | 注重技能间的协同效应 |
|
||||
|
||||
## 操作规程
|
||||
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **任务分析**:详细分析任务的性质、需求和挑战
|
||||
2. **技能评估**:评估各种技能的适用性和可行性
|
||||
3. **技能选择**:选择最适合的技能组合
|
||||
4. **顺序设计**:设计合理的技能调用顺序
|
||||
5. **流程制定**:制定详细的工作流程,包括每个阶段的目标和任务
|
||||
6. **资源规划**:规划所需的资源和支持
|
||||
7. **执行实施**:按照工作流程执行,监控执行情况
|
||||
8. **评估调整**:评估工作流程的效果,根据情况调整流程
|
||||
|
||||
## 与其他 skill 的关系
|
||||
|
||||
- **矛盾分析法**:工作流组合需要分析任务中的矛盾
|
||||
- **实践认识论**:工作流组合需要通过实践不断调整和优化
|
||||
- **集中兵力**:在工作流程中,需要在关键阶段集中兵力
|
||||
- **统筹兼顾**:工作流组合需要统筹兼顾各方面的因素
|
||||
|
||||
## 安装方法
|
||||
|
||||
```bash
|
||||
clawhub install workflows
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
name: workflows
|
||||
description: "当一个任务明确需要多种方法串联,需要组合使用多个技能时调用"
|
||||
tools: []
|
||||
---
|
||||
|
||||
# 工作流组合
|
||||
|
||||
## 触发条件
|
||||
当一个任务明确需要多种方法串联,需要组合使用多个技能时触发。
|
||||
|
||||
## 执行步骤
|
||||
1. **任务分析**:分析任务的性质和需求
|
||||
2. **技能选择**:选择适合的技能组合
|
||||
3. **顺序确定**:确定技能的调用顺序
|
||||
4. **流程设计**:设计详细的工作流程
|
||||
5. **执行监控**:监控工作流程的执行情况
|
||||
6. **调整优化**:根据执行情况调整工作流程
|
||||
|
||||
## 核心原则
|
||||
根据任务需求,灵活组合使用各种技能,形成完整的工作流程。
|
||||
|
||||
## 不适用场景
|
||||
- 任务只需要单一技能
|
||||
- 任务流程简单,不需要复杂的技能组合
|
||||
- 时间紧急,不需要详细的工作流程设计
|
||||
- 已经有明确的工作流程
|
||||
|
||||
## 工作流组合的应用
|
||||
- **复杂项目**:处理复杂的项目任务
|
||||
- **多阶段任务**:处理需要多个阶段的任务
|
||||
- **跨领域任务**:处理涉及多个领域的任务
|
||||
- **创新任务**:处理需要创新思维的任务
|
||||
|
||||
## 常见错误
|
||||
| 错误 | 正确做法 |
|
||||
|------|---------|
|
||||
| 技能选择不当 | 根据任务需求选择合适的技能 |
|
||||
| 顺序安排不合理 | 合理安排技能的调用顺序 |
|
||||
| 流程设计过于复杂 | 设计简洁有效的工作流程 |
|
||||
| 缺乏监控和调整 | 监控执行情况,及时调整流程 |
|
||||
| 忽视技能间的协同 | 注重技能间的协同效应 |
|
||||
|
||||
## 操作规程
|
||||
当本 skill 被触发时,执行以下步骤:
|
||||
1. **任务分析**:详细分析任务的性质、需求和挑战
|
||||
2. **技能评估**:评估各种技能的适用性和可行性
|
||||
3. **技能选择**:选择最适合的技能组合
|
||||
4. **顺序设计**:设计合理的技能调用顺序
|
||||
5. **流程制定**:制定详细的工作流程,包括每个阶段的目标和任务
|
||||
6. **资源规划**:规划所需的资源和支持
|
||||
7. **执行实施**:按照工作流程执行,监控执行情况
|
||||
8. **评估调整**:评估工作流程的效果,根据情况调整流程
|
||||
|
||||
## 与其他 skill 的关系
|
||||
- **矛盾分析法**:工作流组合需要分析任务中的矛盾
|
||||
- **实践认识论**:工作流组合需要通过实践不断调整和优化
|
||||
- **集中兵力**:在工作流程中,需要在关键阶段集中兵力
|
||||
- **统筹兼顾**:工作流组合需要统筹兼顾各方面的因素
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user