bpmax-cli 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -0
- package/dist/bin.js +530 -31
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/skills/bpmax-cli/SKILL.md +1 -0
- package/skills/bpmax-project/SKILL.md +5 -0
- package/skills/bpmax-shared/SKILL.md +47 -0
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@ metadata:
|
|
|
19
19
|
- 当前用户:读 `../bpmax-user/SKILL.md`
|
|
20
20
|
- 流程列表、流程选项、流程详情:读 `../bpmax-flow/SKILL.md`
|
|
21
21
|
- 项目列表、项目详情、我的待办、最小创建:读 `../bpmax-project/SKILL.md`
|
|
22
|
+
- 系统内页面 URL 生成:先读 `../bpmax-shared/SKILL.md` 的“系统内 URL 生成”
|
|
22
23
|
- 本地 schema manifest:读 `../bpmax-schema/SKILL.md`
|
|
23
24
|
|
|
24
25
|
## 规则
|
|
@@ -21,6 +21,8 @@ bpmax-cli project get --project-id 1001 --format json
|
|
|
21
21
|
bpmax-cli project my-step --format table
|
|
22
22
|
bpmax-cli project create --flow-id 123 --name "Demo" --format json
|
|
23
23
|
bpmax-cli project create --flow-id 123 --name "Demo" --json '{"priority":"P1"}' --format json
|
|
24
|
+
bpmax-cli url project-detail 1001
|
|
25
|
+
bpmax-cli url project-step 1001 --step-id 2002
|
|
24
26
|
```
|
|
25
27
|
|
|
26
28
|
## 何时使用
|
|
@@ -36,6 +38,9 @@ bpmax-cli project create --flow-id 123 --name "Demo" --json '{"priority":"P1"}'
|
|
|
36
38
|
- 单项目详情走 `project get`
|
|
37
39
|
- 待办相关优先 `project my-step`
|
|
38
40
|
- 创建优先 `project create`
|
|
41
|
+
- 用户询问详情页、项目列表页或步骤处理页地址时,走 `bpmax-cli url ...` 生成,不要手写 URL
|
|
42
|
+
- 创建或查询项目后必须返回可打开链接;如果 `project create/get` 输出已有 `url` 字段,直接使用;否则用 `bpmax-cli url project-detail <project_id>`
|
|
43
|
+
- 如果新建项目还需要用户处理当前步骤,并且已知 step id,额外返回 `bpmax-cli url project-step <project_id> --step-id <step_id>`
|
|
39
44
|
|
|
40
45
|
## 创建规则
|
|
41
46
|
|
|
@@ -54,6 +54,23 @@ bpmax-cli auth status
|
|
|
54
54
|
- 如果当前 profile 没有可用 API Key,先走 `auth login`
|
|
55
55
|
- 如果用户明确指定环境,始终显式加 `--profile <name>`
|
|
56
56
|
|
|
57
|
+
## Profile Recipes
|
|
58
|
+
|
|
59
|
+
对环境强绑定、流程/表单强绑定的操作,不要直接沉淀到通用 `bpmax-*` skill。先检查当前 profile/workspace 是否已有本地 recipe:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
bpmax-cli recipe list --format table
|
|
63
|
+
bpmax-cli recipe show <name> --format json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
规则:
|
|
67
|
+
|
|
68
|
+
- recipe 存储在 `~/.bpmax/profiles/<profile>/recipes/<workspace>/<recipe-name>/`
|
|
69
|
+
- 适合沉淀“创建店员”“发起某个固定业务流程”这类依赖具体环境 flow/template/key 的操作
|
|
70
|
+
- 执行 recipe 用 `bpmax-cli recipe run <name> --var key=value --vars '{...}' --yes`
|
|
71
|
+
- mutating recipe 必须显式 `--yes`
|
|
72
|
+
- 找不到 recipe 时,再走 flow/project/api 的通用发现流程,并建议用户把验证成功的操作沉淀为 profile recipe
|
|
73
|
+
|
|
57
74
|
## 配置与环境
|
|
58
75
|
|
|
59
76
|
多环境 profile 管理统一走这里:
|
|
@@ -87,6 +104,36 @@ bpmax-cli config profile remove test
|
|
|
87
104
|
- 面向用户概览可用 `--format table`
|
|
88
105
|
- 需要流式处理时再用 `--format ndjson`
|
|
89
106
|
|
|
107
|
+
## 系统内 URL 生成
|
|
108
|
+
|
|
109
|
+
需要返回 BPMAX 页面链接时,优先使用 `bpmax-cli url`,不要手写路由模板:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
bpmax-cli url workspace
|
|
113
|
+
bpmax-cli url project-list
|
|
114
|
+
bpmax-cli url project-detail <project_id>
|
|
115
|
+
bpmax-cli url project-step <project_id> --step-id <step_id>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
规则:
|
|
119
|
+
|
|
120
|
+
- 默认 `pretty` 输出只打印 URL,适合直接发给用户
|
|
121
|
+
- Agent 需要结构化字段时追加 `--format json`
|
|
122
|
+
- 用户指定环境或工作区时,继续使用 `--profile <name>`、`--workspace <workspace>`
|
|
123
|
+
- `--workspace store_mgr` 会规范成 URL 中的 `w:store_mgr`;`default` 不补 `w:`
|
|
124
|
+
|
|
125
|
+
## 创建结果链接
|
|
126
|
+
|
|
127
|
+
执行创建、创作、录入、发起流程、生成配置、上传产物等会产生新对象的操作后,只要结果能在 BPMAX 页面中打开,就必须在最终回复里返回可访问 URL。
|
|
128
|
+
|
|
129
|
+
规则:
|
|
130
|
+
|
|
131
|
+
- 优先从 CLI/API 返回值里读取对象 id、project_id、step_id 等标识
|
|
132
|
+
- 项目类结果优先使用 `bpmax-cli url project-detail <project_id>` 生成详情页
|
|
133
|
+
- 如果当前结果需要用户继续处理某个步骤,并且已知 step id,额外返回 `bpmax-cli url project-step <project_id> --step-id <step_id>`
|
|
134
|
+
- 如果 CLI 输出已经带 `url` 字段,直接使用该 URL;不要再手写或重复拼接
|
|
135
|
+
- 找不到可打开页面或缺少必要 id 时,说明“未能生成结果 URL”的原因
|
|
136
|
+
|
|
90
137
|
## 原始 API 降级
|
|
91
138
|
|
|
92
139
|
只有 CLI shortcut 未覆盖时才使用:
|