feat: add CLI submitted task query

This commit is contained in:
gitea committed 2026-09-05 13:51:33 +08:00
1 parent 12247fd350
commit 97abdb4f96
7 files changed
+62 -7

No files matched your search

+10 -2
View File
@@ -25,9 +25,11 @@ export async function handleTaskCommand(parsed: CliParsedArgs, runtime: CliRunti
? "processed"
: action === "cc" || action === "carboncopy" || action === "carbon-copy"
? "cc"
: action === "submitted" || action === "mine" || action === "created"
? "submitted"
: undefined;
if (!view) {
throw new Error("未知 task 子命令。支持: todo, approved, records, cc");
throw new Error("未知 task 子命令。支持: todo, approved, records, submitted, cc");
}
const count = numberOption(parsed.options, ["count", "limit", "n"], 20);
const start = numberOption(parsed.options, ["start", "offset"], 0);
@@ -56,7 +58,13 @@ export async function handleTaskCommand(parsed: CliParsedArgs, runtime: CliRunti
item.nodeName || "-",
item.action || "-",
]);
const labels: Record<TaskView, string> = { todo: "待审批", approved: "已审批", processed: "审批记录", cc: readFilter ? "抄送(已读)" : "抄送(未读)" };
const labels: Record<TaskView, string> = {
todo: "待审批",
approved: "已审批",
processed: "审批记录",
submitted: "我发起的",
cc: readFilter ? "抄送(已读)" : "抄送(未读)",
};
return {
stdout: `====== ${labels[view]}任务 (企业: ${corp.name} | 总数: ${result.total} | 当前返回: ${result.items.length}) ======\n${printTable(headers, rows)}\n`,
stderr: "",
+2 -1
View File
@@ -121,7 +121,7 @@ export function printHelp(): string {
workflow 工作流管理 (list, get, find, toggle)
bill 单据与费用明细检索 (list, get <单号|ID>, schema, link <单号|ID>)
contact 企业通讯录与人员检索 (list, search <关键词>, get <staffId>)
task 待办中心与审批任务 (todo, approved, records, cc)
task 待办中心与审批任务 (todo, approved, records, submitted, cc)
platform 自建应用管理 (list)
skill Agent Skill 管理 (install, status, dump)
probe 连通性诊断 (probe [corpId])
@@ -152,6 +152,7 @@ export function printHelp(): string {
hose-use contact list --limit=20 # 采样查看企业通讯录(带防爆截断保护)
hose-use task todo --json # 查看当前待我审批任务
hose-use task approved # 查看我已审批任务
hose-use task submitted # 查看我发起的单据
hose-use task cc --unread # 查看未读抄送
hose-use workflow list # 汇总查看全部工作流
hose-use workflow find --task=code-js2 # 搜索包含自定义脚本的工作流