bpmax-cli 0.1.32 → 0.1.34
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 +7 -2
- package/dist/bin.js +85 -14
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install-skills.mjs +3 -2
- package/skills/bpmax-auth/SKILL.md +4 -2
- package/skills/bpmax-cli/SKILL.md +3 -3
- package/skills/bpmax-shared/SKILL.md +3 -1
package/package.json
CHANGED
|
@@ -13,13 +13,14 @@ const effectiveAgent = targetAgent || '<agent>';
|
|
|
13
13
|
const agentGuidance = {
|
|
14
14
|
initialization: [
|
|
15
15
|
'Agent action: ask the user to directly input a BPMAX workspace page URL, for example http://127.0.0.1:10018/w:store_mgr.',
|
|
16
|
-
`After the user replies with the URL, run: bpmax-cli init --agent ${effectiveAgent} --channel feishu --url "<USER_URL>" --name local --format json`,
|
|
16
|
+
`After the user replies with the URL, run: bpmax-cli init --agent ${effectiveAgent} --channel feishu --url "<USER_URL>" --name local --profile-scope "<TRUSTED_RUNTIME_SCOPE>" --format json`,
|
|
17
|
+
'For OpenClaw multi-user deployments, TRUSTED_RUNTIME_SCOPE must come from trusted runtime metadata such as channel + peer/user, or at least a stable user id. Do not invent it from natural language.',
|
|
17
18
|
'For a local terminal/browser setup path, run instead: bpmax-cli setup "<USER_URL>" --name local',
|
|
18
19
|
],
|
|
19
20
|
core_usage: [
|
|
20
21
|
'Read JSON output first. Show message_card.authorization_url and message_card.user_code to the user.',
|
|
21
22
|
'After the user confirms the short code in BPMAX, run message_card.next_command exactly; do not guess commands from natural-language next_action text.',
|
|
22
|
-
'For later bpmax-cli decisions, prefer --format json and pass --profile <profile> when the target environment matters.',
|
|
23
|
+
'For later bpmax-cli decisions, prefer --format json and pass the returned --profile <profile> when the target environment matters.',
|
|
23
24
|
],
|
|
24
25
|
bbs_policy: [
|
|
25
26
|
'For business requests, first look for BPMAX Business Skills (BBS): bpmax-cli bbs list --profile <profile> --format json',
|
|
@@ -24,8 +24,8 @@ metadata:
|
|
|
24
24
|
## 命令
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
bpmax-cli
|
|
28
|
-
bpmax-cli auth device complete --profile
|
|
27
|
+
bpmax-cli init --agent openclaw --channel feishu --url <BPMAX_URL> --name local --profile-scope <TRUSTED_RUNTIME_SCOPE> --format json
|
|
28
|
+
bpmax-cli auth device complete --profile <profile_from_init> --session <device_code> --format json
|
|
29
29
|
bpmax-cli auth login --mode device --profile local
|
|
30
30
|
bpmax-cli auth login
|
|
31
31
|
bpmax-cli auth status
|
|
@@ -35,8 +35,10 @@ bpmax-cli auth logout
|
|
|
35
35
|
## 路由规则
|
|
36
36
|
|
|
37
37
|
- 首次接入某个环境且在 Agent/飞书中交互:优先用 `bpmax-cli init --agent openclaw|aily|generic --channel feishu --url <BPMAX_URL> --format json`
|
|
38
|
+
- OpenClaw 多用户场景必须传 `--profile-scope <TRUSTED_RUNTIME_SCOPE>`;scope 来自可信 runtime metadata,不能由 LLM 猜测
|
|
38
39
|
- 只需要发起无浏览器授权:用 `auth device start`,把返回的 `message_card.authorization_url` 和 `message_card.user_code` 发给用户
|
|
39
40
|
- 用户确认短码后:优先执行返回的 `message_card.next_command`;不要从 `next_action` 自然语言里猜命令
|
|
41
|
+
- 后续授权状态只使用 `init` 返回的 `profile`;不要自行把 profile 写成 `local`
|
|
40
42
|
- 本地终端可继续用 `auth login`
|
|
41
43
|
- 只想确认当前身份和连通性:`auth status`
|
|
42
44
|
- 只清空当前 profile 的本地 API Key:`auth logout`
|
|
@@ -15,14 +15,14 @@ metadata:
|
|
|
15
15
|
## Agent 基础行为
|
|
16
16
|
|
|
17
17
|
- 先应用 `../bpmax-shared/SKILL.md` 的命令发现、profile/auth 检查、全局参数、JSON 输出、URL 生成和原始 API 降级规则。
|
|
18
|
-
- 未初始化时,不要直接编造 profile 或 API Key;先要求用户提供 BPMAX workspace 页面 URL
|
|
18
|
+
- 未初始化时,不要直接编造 profile 或 API Key;先要求用户提供 BPMAX workspace 页面 URL。OpenClaw 多用户环境必须从可信 runtime metadata 读取稳定用户/会话 scope,优先使用 channel + peer/user,至少使用 user id,再运行:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
bpmax-cli init --agent <agent> --channel feishu --url "<BPMAX_URL>" --name local --format json
|
|
21
|
+
bpmax-cli init --agent <agent> --channel feishu --url "<BPMAX_URL>" --name local --profile-scope "<TRUSTED_RUNTIME_SCOPE>" --format json
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
- `init` 返回后,Agent 必须展示 `message_card.authorization_url` 和 `message_card.user_code` 给用户;用户确认短码后,逐字执行 `message_card.next_command`,不要从 `message_card.next_action` 自然语言里猜命令。
|
|
25
|
-
-
|
|
25
|
+
- `profile` 的最终值只以 `init` JSON 返回为准;不要自行拼接或复用 `local`。后续需要 Agent 判断或串联操作时,优先使用 `--format json`;用户明确环境时显式加返回的 `--profile <name>`。
|
|
26
26
|
|
|
27
27
|
## 业务需求优先 BBS
|
|
28
28
|
|
|
@@ -53,6 +53,7 @@ bpmax-cli auth status
|
|
|
53
53
|
- 如果 profile 未配置,先走 `config profile add` 或 `config profile use`
|
|
54
54
|
- 如果当前 profile 没有可用 API Key:
|
|
55
55
|
- OpenClaw/Aily/飞书等无浏览器 Agent 场景,优先走 `bpmax-cli init --agent <agent> --channel feishu --url <BPMAX_URL> --format json` 或 `auth device start/complete`
|
|
56
|
+
- OpenClaw 多用户场景必须额外传 `--profile-scope <TRUSTED_RUNTIME_SCOPE>`;scope 必须来自可信 runtime metadata,不得由 LLM 猜测
|
|
56
57
|
- 本地终端场景才走 `auth login`
|
|
57
58
|
- 如果用户明确指定环境,始终显式加 `--profile <name>`
|
|
58
59
|
|
|
@@ -61,7 +62,7 @@ bpmax-cli auth status
|
|
|
61
62
|
无浏览器 Agent 推荐统一入口:
|
|
62
63
|
|
|
63
64
|
```bash
|
|
64
|
-
bpmax-cli init --agent openclaw --channel feishu --url "https://example.com/w:store_mgr" --name
|
|
65
|
+
bpmax-cli init --agent openclaw --channel feishu --url "https://example.com/w:store_mgr" --name local --profile-scope "<TRUSTED_RUNTIME_SCOPE>" --format json
|
|
65
66
|
```
|
|
66
67
|
|
|
67
68
|
规则:
|
|
@@ -71,6 +72,7 @@ bpmax-cli init --agent openclaw --channel feishu --url "https://example.com/w:st
|
|
|
71
72
|
- 返回中的 `message_card` 是通用抽象,不是飞书专属协议
|
|
72
73
|
- Agent 应把 `message_card.authorization_url` 和 `message_card.user_code` 展示给用户
|
|
73
74
|
- 用户确认短码后,优先执行 `message_card.next_command`;不要从 `message_card.next_action` 自然语言里猜命令
|
|
75
|
+
- `profile` 最终值只以 `init` 返回为准;后续命令使用返回的 `profile` 或 `message_card.next_command`,不要自行拼接 profile
|
|
74
76
|
|
|
75
77
|
## Profile Recipes
|
|
76
78
|
|