325 lines
9.5 KiB
JSON
325 lines
9.5 KiB
JSON
{
|
||
"schemaVersion": 1,
|
||
"skill": "account-manager",
|
||
"actions": [
|
||
{
|
||
"id": "platform-ensure",
|
||
"label": "新增平台",
|
||
"description": "登记平台:小写英文键 + 展示名必须分开。不会把中文名当成键。",
|
||
"replaces": "create",
|
||
"placements": [],
|
||
"executionProfile": "sync",
|
||
"interaction": "form",
|
||
"bind": {
|
||
"tables": ["platforms"]
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["platform_key", "display_name"],
|
||
"properties": {
|
||
"platform_key": {
|
||
"type": "string",
|
||
"title": "平台键",
|
||
"description": "小写英文/数字/下划线或连字符,例如 douyin、deepseek。不要填中文。"
|
||
},
|
||
"display_name": {
|
||
"type": "string",
|
||
"title": "展示名称",
|
||
"description": "给人看的名称,可以是中文,例如 抖音。"
|
||
},
|
||
"default_url": {
|
||
"type": "string",
|
||
"title": "默认链接"
|
||
}
|
||
}
|
||
},
|
||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||
"entrypoint": {
|
||
"type": "cli",
|
||
"command": "platform",
|
||
"args": [
|
||
"ensure",
|
||
"--key", "{{platform_key}}",
|
||
"--display-name", "{{display_name}}",
|
||
"--url", "{{default_url}}"
|
||
]
|
||
}
|
||
},
|
||
{
|
||
"id": "account-add-web",
|
||
"label": "新增账号",
|
||
"description": "登记网页/RPA 账号并自动创建浏览器 Profile 目录(走 account add-web,非宿主直写库)。",
|
||
"replaces": "create",
|
||
"placements": [],
|
||
"executionProfile": "sync",
|
||
"interaction": "form",
|
||
"bind": {
|
||
"tables": ["accounts"]
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["platform_key", "account_label"],
|
||
"properties": {
|
||
"platform_key": {
|
||
"type": "string",
|
||
"title": "平台",
|
||
"display_type": "lookup",
|
||
"lookup": {
|
||
"ref_table": "platforms",
|
||
"value_column": "platform_key",
|
||
"label_column": "display_name",
|
||
"filter_column": "enabled",
|
||
"filter_value": 1
|
||
}
|
||
},
|
||
"account_label": {
|
||
"type": "string",
|
||
"title": "账号名称"
|
||
},
|
||
"login_id": {
|
||
"type": "string",
|
||
"title": "登录账号"
|
||
}
|
||
}
|
||
},
|
||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||
"entrypoint": {
|
||
"type": "cli",
|
||
"command": "account",
|
||
"args": [
|
||
"add-web",
|
||
"--platform", "{{platform_key}}",
|
||
"--label", "{{account_label}}",
|
||
"--login-id", "{{login_id}}"
|
||
]
|
||
}
|
||
},
|
||
{
|
||
"id": "account-update",
|
||
"label": "编辑账号",
|
||
"description": "只改名称、登录账号、标识类型、入口链接和启用状态。",
|
||
"replaces": "update",
|
||
"placements": [],
|
||
"executionProfile": "sync",
|
||
"interaction": "form",
|
||
"bind": {
|
||
"tables": ["accounts"],
|
||
"inputMapping": {
|
||
"accountId": "$row.$pk",
|
||
"account_label": "$row.account_label",
|
||
"login_id": "$row.login_id",
|
||
"login_id_type": "$row.login_id_type",
|
||
"url": "$row.url",
|
||
"status": "$row.status"
|
||
}
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["accountId", "account_label", "status"],
|
||
"properties": {
|
||
"accountId": {
|
||
"type": "number",
|
||
"title": "编号",
|
||
"readOnly": true
|
||
},
|
||
"account_label": {
|
||
"type": "string",
|
||
"title": "账号名称"
|
||
},
|
||
"login_id": {
|
||
"type": "string",
|
||
"title": "登录账号"
|
||
},
|
||
"login_id_type": {
|
||
"type": "string",
|
||
"title": "登录标识类型",
|
||
"enum": ["unknown", "phone", "email", "username", "customer_code", "api_account"]
|
||
},
|
||
"url": {
|
||
"type": "string",
|
||
"title": "入口链接",
|
||
"display_type": "url"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"title": "状态",
|
||
"enum": ["active", "disabled", "needs_review"]
|
||
}
|
||
}
|
||
},
|
||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||
"entrypoint": {
|
||
"type": "cli",
|
||
"command": "account",
|
||
"args": [
|
||
"update",
|
||
"--id", "{{accountId}}",
|
||
"--label", "{{account_label}}",
|
||
"--login-id", "{{login_id}}",
|
||
"--login-id-type", "{{login_id_type}}",
|
||
"--url", "{{url}}",
|
||
"--status", "{{status}}"
|
||
]
|
||
}
|
||
},
|
||
{
|
||
"id": "account-delete",
|
||
"label": "删除账号",
|
||
"description": "删除账号记录、关联凭证,以及硬盘上的浏览器 Profile 目录。再建同名账号会得到空 Profile,不会带回旧登录态。",
|
||
"replaces": "delete",
|
||
"placements": [],
|
||
"executionProfile": "sync",
|
||
"interaction": "confirm",
|
||
"confirmation": {
|
||
"message": "将删除这条账号、关联凭证,以及硬盘上的浏览器 Profile 目录。登录态不可恢复。是否继续?"
|
||
},
|
||
"bind": {
|
||
"tables": ["accounts"],
|
||
"inputMapping": { "accountId": "$row.$pk" }
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["accountId"],
|
||
"properties": {
|
||
"accountId": {
|
||
"type": "number",
|
||
"title": "账号 ID",
|
||
"readOnly": true
|
||
}
|
||
}
|
||
},
|
||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||
"entrypoint": {
|
||
"type": "cli",
|
||
"command": "delete",
|
||
"args": ["id", "{{accountId}}"]
|
||
}
|
||
},
|
||
{
|
||
"id": "account-copy",
|
||
"label": "复制",
|
||
"description": "复制为同平台新账号:新空 Profile,登录账号留空,名称自动加「副本」。",
|
||
"placements": ["row"],
|
||
"executionProfile": "sync",
|
||
"interaction": "direct",
|
||
"bind": {
|
||
"tables": ["accounts"],
|
||
"inputMapping": { "accountId": "$row.$pk" }
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["accountId"],
|
||
"properties": {
|
||
"accountId": {
|
||
"type": "number",
|
||
"title": "账号 ID",
|
||
"readOnly": true
|
||
}
|
||
}
|
||
},
|
||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||
"entrypoint": {
|
||
"type": "cli",
|
||
"command": "account",
|
||
"args": ["copy", "{{accountId}}"]
|
||
}
|
||
},
|
||
{
|
||
"id": "reveal-profile",
|
||
"label": "打开目录",
|
||
"description": "在系统文件管理器中打开该账号的浏览器 Profile 目录。",
|
||
"placements": ["row"],
|
||
"executionProfile": "sync",
|
||
"interaction": "direct",
|
||
"bind": {
|
||
"tables": ["accounts"],
|
||
"inputMapping": { "accountId": "$row.$pk" }
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["accountId"],
|
||
"properties": {
|
||
"accountId": {
|
||
"type": "number",
|
||
"title": "账号 ID",
|
||
"description": "accounts 表主键",
|
||
"readOnly": true
|
||
}
|
||
}
|
||
},
|
||
"entrypoint": {
|
||
"type": "cli",
|
||
"command": "account",
|
||
"args": ["reveal-profile", "{{accountId}}"]
|
||
}
|
||
},
|
||
{
|
||
"id": "open-browser",
|
||
"label": "打开浏览器",
|
||
"description": "用该账号持久化 Profile 直接打开系统 Chrome/Edge,仅供肉眼核对(不做登录判定)。与打开目录同为一点即开。",
|
||
"placements": ["row"],
|
||
"executionProfile": "sync",
|
||
"interaction": "direct",
|
||
"bind": {
|
||
"tables": ["accounts"],
|
||
"inputMapping": { "accountId": "$row.$pk" }
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["accountId"],
|
||
"properties": {
|
||
"accountId": {
|
||
"type": "number",
|
||
"title": "账号 ID",
|
||
"description": "accounts 表主键",
|
||
"readOnly": true
|
||
}
|
||
}
|
||
},
|
||
"entrypoint": {
|
||
"type": "cli",
|
||
"command": "account",
|
||
"args": ["open", "{{accountId}}"]
|
||
}
|
||
},
|
||
{
|
||
"id": "lease-force-release",
|
||
"label": "强制释放租约",
|
||
"description": "强制释放这条活跃租约,让账号立刻可被其它任务占用。仅状态为 active 时可用。",
|
||
"placements": ["row"],
|
||
"executionProfile": "sync",
|
||
"interaction": "confirm",
|
||
"confirmation": {
|
||
"message": "强制释放后,其它任务可立刻占用该账号。若原任务仍在跑,可能冲突。是否继续?"
|
||
},
|
||
"bind": {
|
||
"tables": ["account_leases"],
|
||
"inputMapping": {
|
||
"leaseId": "$row.$pk"
|
||
},
|
||
"visibleWhen": {
|
||
"status": "active"
|
||
}
|
||
},
|
||
"inputSchema": {
|
||
"type": "object",
|
||
"required": ["leaseId"],
|
||
"properties": {
|
||
"leaseId": {
|
||
"type": "number",
|
||
"title": "租约编号",
|
||
"description": "当前行编号,一般无需修改",
|
||
"readOnly": true
|
||
}
|
||
}
|
||
},
|
||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||
"entrypoint": {
|
||
"type": "cli",
|
||
"command": "lease",
|
||
"args": ["force-release", "--id", "{{leaseId}}"]
|
||
}
|
||
}
|
||
]
|
||
}
|