@lovrabet/lovrabet-cli 2.3.0 → 2.3.1-beta.1
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/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.d.ts +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.d.ts +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +6 -3
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +0 -16
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.d.ts +30 -0
- package/lib/core/kb-search-client.js +1 -0
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.d.ts +2 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +3 -2
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +1 -1
- package/skills/lovrabet/references/lovrabet-config-commands.md +7 -6
- package/skills/lovrabet/references/lovrabet-config.md +9 -8
- package/skills/lovrabet/references/lovrabet-doctor.md +2 -0
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +3 -1
- package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +32 -0
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -21,11 +21,11 @@ lovrabet config init --domain-config ./lovrabet-domains.json
|
|
|
21
21
|
|
|
22
22
|
- `--region` 只接受 `cn` / `id`
|
|
23
23
|
- 选择 `cn` 时省略冗余的 `region` 字段,以默认值保持向前兼容;选择 `id` 时写入 `"region": "id"`
|
|
24
|
-
-
|
|
24
|
+
- 切回官方节点会删除全局配置里的六个显式 Domain,以及兼容读取的旧 Domain 字段
|
|
25
25
|
|
|
26
26
|
### 独立部署模式
|
|
27
27
|
|
|
28
|
-
Domain 文件必须是 JSON
|
|
28
|
+
Domain 文件必须是 JSON 对象,只允许以下六个字段,且至少提供一个:
|
|
29
29
|
|
|
30
30
|
```json
|
|
31
31
|
{
|
|
@@ -33,15 +33,16 @@ Domain 文件必须是 JSON 对象,只允许以下五个字段,且至少提
|
|
|
33
33
|
"apiDomain": "https://api.customer.example.com",
|
|
34
34
|
"runtimeDomain": "https://runtime.customer.example.com",
|
|
35
35
|
"skillDomain": "https://skills.customer.example.com",
|
|
36
|
-
"kbDomain": "https://kb.customer.example.com"
|
|
36
|
+
"kbDomain": "https://kb.customer.example.com",
|
|
37
|
+
"kbSearchDomain": "https://kb-search.customer.example.com"
|
|
37
38
|
}
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
也可以用 `--user-domain`、`--api-domain`、`--runtime-domain`、`--skill-domain`、`--kb-domain` 逐项传入;显式 flag 覆盖文件里的同名字段。所有值必须是无账号、路径、query 和 fragment 的 HTTPS origin。
|
|
41
|
+
也可以用 `--user-domain`、`--api-domain`、`--runtime-domain`、`--skill-domain`、`--kb-domain`、`--kb-search-domain` 逐项传入;显式 flag 覆盖文件里的同名字段。所有值必须是无账号、路径、query 和 fragment 的 HTTPS origin。
|
|
41
42
|
|
|
42
|
-
进入独立部署模式会删除全局 `region` 和旧 Domain 字段,再写入本次提供的 Domain
|
|
43
|
+
进入独立部署模式会删除全局 `region` 和旧 Domain 字段,再写入本次提供的 Domain。未提供的普通 Domain 仍按默认 `cn` 节点和当前 `env` 回退到 Lovrabet 公共服务;`kbSearchDomain` 在中国大陆使用登记地址,其他区域没有默认搜索地址。企业部署需要所有请求进入私有服务时,应完整提供六个 Domain。
|
|
43
44
|
|
|
44
|
-
两种模式都保留 AccessKey、env、format、locale、应用绑定等其他全局配置。当前目录 `.lovrabet.json` 的同名字段仍会覆盖全局配置;初始化后用 `lovrabet doctor` 核对最终生效的 region
|
|
45
|
+
两种模式都保留 AccessKey、env、format、locale、应用绑定等其他全局配置。当前目录 `.lovrabet.json` 的同名字段仍会覆盖全局配置;初始化后用 `lovrabet doctor` 核对最终生效的 region 和 API Endpoint。
|
|
45
46
|
|
|
46
47
|
## config list — 查看完整配置
|
|
47
48
|
|
|
@@ -60,16 +60,17 @@
|
|
|
60
60
|
| `apiDomain` | string | 节点内置值 | 平台 API HTTPS origin 覆盖 |
|
|
61
61
|
| `runtimeDomain` | string | 节点内置值 | 普通 Runtime HTTPS origin 覆盖 |
|
|
62
62
|
| `skillDomain` | string | 节点默认 | SkillHub HTTPS origin 覆盖 |
|
|
63
|
-
| `kbDomain` | string | 节点默认 |
|
|
63
|
+
| `kbDomain` | string | 节点默认 | Personal KB 管理 HTTPS origin 覆盖 |
|
|
64
|
+
| `kbSearchDomain` | string | CN 已登记 KB Service;其他区域无默认值 | `kb search` 专用 HTTPS origin;与管理域独立,未登记区域不回退 |
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
六个 Domain 各自独立覆盖同名服务地址。没有显式配置的普通字段按 `region` 和 `env` 使用内置值;`development` 与 `daily` 共用非生产地址。`kbSearchDomain` 只有中国大陆内置地址,其他区域失败关闭。当前开放的官方节点如下:
|
|
66
67
|
|
|
67
|
-
| region | env | userDomain | apiDomain | runtimeDomain | skillDomain | kbDomain |
|
|
68
|
-
|
|
69
|
-
| `cn` | `production` | `https://user.lovrabet.com` | `https://api.lovrabet.com` | `https://runtime.lovrabet.com` | `https://skills.lovrabet.com` | `https://runtime.lovrabet.com` |
|
|
70
|
-
| `cn` | `development` / `daily` | `https://user-daily.lovrabet.com` | `https://daily-api.lovrabet.com` | `https://daily-runtime.lovrabet.com` | `https://skills-daily.lovrabet.com` | `https://daily-runtime.lovrabet.com` |
|
|
71
|
-
| `id` | `production` | `https://user.lovrabet.id` | `https://api.lovrabet.id` | `https://runtime.lovrabet.id` | `https://skills.lovrabet.id` | `https://runtime.lovrabet.id` |
|
|
72
|
-
| `id` | `development` / `daily` | `https://user-daily.lovrabet.id` | `https://daily-api.lovrabet.id` | `https://daily-runtime.lovrabet.id` | `https://skills-daily.lovrabet.id` | `https://daily-runtime.lovrabet.id` |
|
|
68
|
+
| region | env | userDomain | apiDomain | runtimeDomain | skillDomain | kbDomain | kbSearchDomain |
|
|
69
|
+
|--------|-----|------------|-----------|---------------|-------------|----------|----------------|
|
|
70
|
+
| `cn` | `production` | `https://user.lovrabet.com` | `https://api.lovrabet.com` | `https://runtime.lovrabet.com` | `https://skills.lovrabet.com` | `https://runtime.lovrabet.com` | `https://kb-service.lovrabet.com` |
|
|
71
|
+
| `cn` | `development` / `daily` | `https://user-daily.lovrabet.com` | `https://daily-api.lovrabet.com` | `https://daily-runtime.lovrabet.com` | `https://skills-daily.lovrabet.com` | `https://daily-runtime.lovrabet.com` | `https://kb-service-daily.lovrabet.com` |
|
|
72
|
+
| `id` | `production` | `https://user.lovrabet.id` | `https://api.lovrabet.id` | `https://runtime.lovrabet.id` | `https://skills.lovrabet.id` | `https://runtime.lovrabet.id` | 未登记 |
|
|
73
|
+
| `id` | `development` / `daily` | `https://user-daily.lovrabet.id` | `https://daily-api.lovrabet.id` | `https://daily-runtime.lovrabet.id` | `https://skills-daily.lovrabet.id` | `https://daily-runtime.lovrabet.id` | 未登记 |
|
|
73
74
|
|
|
74
75
|
`config init` 的完整模式切换、独立部署 JSON 和校验规则见 [配置管理](lovrabet-config-commands.md#config-init--初始化连接配置)。
|
|
75
76
|
|
|
@@ -10,7 +10,9 @@ lovrabet kb detail --id <id> --format compress
|
|
|
10
10
|
lovrabet kb search --query "订单审批" --topk 5 --format compress
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
`kb search`
|
|
13
|
+
`kb search` 只携带当前 AK,使用独立 `kbSearchDomain` 调用固定 Runtime 搜索接口。中国大陆 daily/production 使用已登记 KB Service;其他区域未显式配置搜索域时失败关闭,不回退到 `kbDomain` 或其他服务。返回范围是 `public/company/personal`,使用 `scope` 区分来源。
|
|
14
|
+
|
|
15
|
+
结构化输出固定为 `data: { schemaVersion:2, profile:"runtime", total, strategyFingerprint, timingsMs, hits }`。`--topk` 可选且必须是 1–50 的整数;命中完整保留 `documentId/revision/chunkId/scope/title/text/tags/rank/rawScore/finalScore/scoreKind` 的服务端顺序和值,不输出 legacy 别名。无命中是 `total:0/hits:[]` 的成功;字段、rank、score、timing、`no-store` 或 scope 漂移都会以脱敏错误失败。
|
|
14
16
|
|
|
15
17
|
## 业务执行中的 KB 消费
|
|
16
18
|
|
|
@@ -134,3 +134,35 @@ lovrabet personal-bff exec --id <id> --params '{"status":"active"}' --format com
|
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
确认字段、空态和错误形状后,再按下游调用方的契约完成接入。
|
|
137
|
+
|
|
138
|
+
### 前端 SDK 调用
|
|
139
|
+
|
|
140
|
+
页面通过 `client.personal.bff.execute({ scriptId, params })` 调用已经确认的 Personal Backend Function。`scriptId` 必须是 `list`、`detail`、`create` 或前序可信上下文得到的正整数,并且属于当前用户和当前应用;不要猜测 ID。
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
interface OrderSummary {
|
|
144
|
+
total: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const personalBff = lovrabetClient?.personal?.bff;
|
|
148
|
+
if (typeof personalBff?.execute !== "function") {
|
|
149
|
+
throw new Error("client.personal.bff.execute is not available");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const summary = await personalBff.execute<OrderSummary>({
|
|
153
|
+
scriptId: 123,
|
|
154
|
+
params: { status: "active" },
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
if (!summary || typeof summary.total !== "number") {
|
|
158
|
+
throw new Error("Unexpected Personal Backend Function response");
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
安全边界:
|
|
163
|
+
|
|
164
|
+
- 浏览器使用当前登录 Cookie,不在前端源码、构建变量、页面配置或日志中保存 Cookie、Client AK、SecretKey 或 token。
|
|
165
|
+
- 服务端使用 Client AK 时,凭据只保存在服务端,并显式设置 `authMode: "client-ak"`;Personal Backend Function 不支持 OpenAPI。
|
|
166
|
+
- 可选链只用于读取能力。禁止使用 `lovrabetClient?.personal?.bff?.execute?.(...)`,因为方法缺失时会静默得到 `undefined`。
|
|
167
|
+
- 能力不存在时明确失败,并升级到包含 `client.personal.bff.execute` 的 SDK 版本。检测通过后通过 `personalBff.execute(...)` 调用,不要提取方法后裸调用。
|
|
168
|
+
- SDK 直接返回个人函数的业务结果,不带 `execSuccess` 或 `execResult`。按前序 CLI 验证得到的返回契约检查必需字段和空态,不用 `result === undefined` 猜测 SDK 能力是否存在。
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "lovrabet",
|
|
4
4
|
"packageName": "@lovrabet/lovrabet-cli",
|
|
5
|
-
"packageVersion": "2.3.
|
|
6
|
-
"skillVersion": "2.3.
|
|
5
|
+
"packageVersion": "2.3.1-beta.1",
|
|
6
|
+
"skillVersion": "2.3.1-beta.1",
|
|
7
7
|
"files": [
|
|
8
8
|
"SKILL.md",
|
|
9
9
|
"guides/app-resolution.md",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"references/lovrabet-user-account.md",
|
|
38
38
|
"references/lovrabet-workspace.md"
|
|
39
39
|
],
|
|
40
|
-
"digest": "
|
|
40
|
+
"digest": "314d8c3b700b0583c7601211c9afe4ccac5f7117edbf231ad07810b90d1dbdb2"
|
|
41
41
|
}
|