@lovrabet/lovrabet-cli 2.3.1-beta.1 → 2.3.1-beta.3
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 +53 -1
- 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.d.ts +2 -0
- 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 +3 -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 +34 -2
- 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 +3 -6
- 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.d.ts +0 -51
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.d.ts +3 -5
- 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 +16 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- 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 +0 -2
- 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/generated/official-routing.d.ts +59 -0
- package/lib/generated/official-routing.js +1 -0
- package/lib/generated/routing-contract.d.ts +9 -0
- package/lib/generated/routing-contract.js +1 -0
- 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 +2 -1
- package/skills/lovrabet/SKILL.md +4 -4
- package/skills/lovrabet/guides/troubleshooting.md +3 -5
- package/skills/lovrabet/references/lovrabet-config-commands.md +35 -13
- package/skills/lovrabet/references/lovrabet-config.md +8 -21
- package/skills/lovrabet/references/lovrabet-doctor.md +0 -2
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -3
- package/skills/lovrabet.manifest.json +3 -3
- package/lib/core/kb-search-client.d.ts +0 -30
- package/lib/core/kb-search-client.js +0 -1
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
`.lovrabet.json` 现在只承载**用户意图配置**,不再承载平台应用目录。
|
|
4
4
|
|
|
5
5
|
这意味着:
|
|
6
|
-
- `accessKey` / `
|
|
6
|
+
- `accessKey` / `format` / `riskLevel` / `defaultApp` 等仍然放在 `.lovrabet.json`
|
|
7
7
|
- 当前 AK 在平台上可见的应用列表,放在 `~/.lovrabet/cache/.../my-apps.json`
|
|
8
|
-
- 首次使用推荐执行 `lovrabet config init`
|
|
8
|
+
- 首次使用推荐执行 `lovrabet config init` 配置全局节点。未执行时仍按默认中国大陆节点 `cn` 工作
|
|
9
9
|
|
|
10
10
|
只自动读取 `.lovrabet.json`;`.lovrabetrc` 和其他 CLI 的配置文件不参与运行态配置发现。需要导入外部配置时,显式执行 `lovrabet app import --file <path>`。
|
|
11
11
|
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
```json
|
|
15
15
|
{
|
|
16
16
|
"appcode": "app-xxxxxxxx",
|
|
17
|
-
"env": "daily",
|
|
18
17
|
"accessKey": "<ACCESS_KEY>"
|
|
19
18
|
}
|
|
20
19
|
```
|
|
@@ -24,7 +23,6 @@
|
|
|
24
23
|
```json
|
|
25
24
|
{
|
|
26
25
|
"accessKey": "<ACCESS_KEY>",
|
|
27
|
-
"env": "daily",
|
|
28
26
|
"defaultApp": "crm"
|
|
29
27
|
}
|
|
30
28
|
```
|
|
@@ -36,7 +34,7 @@
|
|
|
36
34
|
平台应用列表缓存路径:
|
|
37
35
|
|
|
38
36
|
```text
|
|
39
|
-
~/.lovrabet/cache
|
|
37
|
+
~/.lovrabet/cache/.../my-apps.json
|
|
40
38
|
```
|
|
41
39
|
|
|
42
40
|
这个 cache 由以下命令维护:
|
|
@@ -49,7 +47,6 @@
|
|
|
49
47
|
| 字段 | 类型 | 默认值 | 说明 |
|
|
50
48
|
|------|------|--------|------|
|
|
51
49
|
| `appcode` | string | — | 兼容单应用模式,直接指定 appcode |
|
|
52
|
-
| `env` | string | `production` | 环境:`production` / `development` / `daily` |
|
|
53
50
|
| `accessKey` | string | — | User Access Key(client-ak) |
|
|
54
51
|
| `format` | string | — | 默认输出格式:`json` / `pretty` / `compress` |
|
|
55
52
|
| `pageSize` | number | — | 默认分页大小 |
|
|
@@ -60,26 +57,18 @@
|
|
|
60
57
|
| `apiDomain` | string | 节点内置值 | 平台 API HTTPS origin 覆盖 |
|
|
61
58
|
| `runtimeDomain` | string | 节点内置值 | 普通 Runtime HTTPS origin 覆盖 |
|
|
62
59
|
| `skillDomain` | string | 节点默认 | SkillHub HTTPS origin 覆盖 |
|
|
63
|
-
| `kbDomain` | string | 节点默认 |
|
|
64
|
-
| `kbSearchDomain` | string | CN 已登记 KB Service;其他区域无默认值 | `kb search` 专用 HTTPS origin;与管理域独立,未登记区域不回退 |
|
|
60
|
+
| `kbDomain` | string | 节点默认 | 知识库 HTTPS origin 覆盖 |
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
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` | 未登记 |
|
|
62
|
+
五个 Domain 各自独立覆盖同名服务地址。没有显式配置时,CLI 按 `region` 使用内置节点:`cn` 对应中国大陆,`id` 对应 Indonesia,且 Indonesia 的最终服务地址统一使用 `*.lovrabet.id`。执行 `lovrabet doctor` 可查看当前实际生效的五个 Domain,无需理解内部地址层级。
|
|
74
63
|
|
|
75
64
|
`config init` 的完整模式切换、独立部署 JSON 和校验规则见 [配置管理](lovrabet-config-commands.md#config-init--初始化连接配置)。
|
|
76
65
|
|
|
77
66
|
## 解析优先级
|
|
78
67
|
|
|
79
68
|
```
|
|
80
|
-
CLI flag (--appcode, --
|
|
69
|
+
CLI flag (--appcode, --format, --app ...)
|
|
81
70
|
↓
|
|
82
|
-
环境变量 (LOVRABET_APPCODE,
|
|
71
|
+
环境变量 (LOVRABET_APPCODE, LOVRABET_FORMAT ...)
|
|
83
72
|
↓
|
|
84
73
|
当前目录 .lovrabet.json(兼容本地配置)
|
|
85
74
|
↓
|
|
@@ -102,7 +91,6 @@ CLI flag (--appcode, --env, --format, --app ...)
|
|
|
102
91
|
| 环境变量 | 对应字段 |
|
|
103
92
|
|----------|----------|
|
|
104
93
|
| `LOVRABET_APPCODE` | `appcode` |
|
|
105
|
-
| `LOVRABET_ENV` | `env` |
|
|
106
94
|
| `LOVRABET_ACCESS_KEY` | `accessKey` |
|
|
107
95
|
| `LOVRABET_FORMAT` | `format` |
|
|
108
96
|
| `LOVRABET_PAGE_SIZE` | `pageSize` |
|
|
@@ -122,7 +110,7 @@ CLI flag (--appcode, --env, --format, --app ...)
|
|
|
122
110
|
- `apps`:当前目录显式声明时整体覆盖全局 `apps`;当前目录未声明时使用全局 `apps`
|
|
123
111
|
- `inherit` 不是受支持的配置项;旧字段会被忽略,可用 `lovrabet config delete inherit` 清理
|
|
124
112
|
|
|
125
|
-
因此,`lovrabet config init`
|
|
113
|
+
因此,`lovrabet config init` 固定更新全局连接配置;当前目录文件中的兼容路由字段仍可能覆盖全局同名字段。初始化后可执行 `lovrabet doctor` 查看最终生效值。
|
|
126
114
|
|
|
127
115
|
## 示例
|
|
128
116
|
|
|
@@ -131,7 +119,6 @@ CLI flag (--appcode, --env, --format, --app ...)
|
|
|
131
119
|
```json
|
|
132
120
|
{
|
|
133
121
|
"accessKey": "<ACCESS_KEY>",
|
|
134
|
-
"env": "daily",
|
|
135
122
|
"defaultApp": "crm"
|
|
136
123
|
}
|
|
137
124
|
```
|
|
@@ -10,9 +10,7 @@ lovrabet kb detail --id <id> --format compress
|
|
|
10
10
|
lovrabet kb search --query "订单审批" --topk 5 --format compress
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
`kb search`
|
|
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 漂移都会以脱敏错误失败。
|
|
13
|
+
`kb search` 会返回当前用户可见的多来源知识,使用 `scope` 区分来源。结果顺序由服务端当前检索策略决定;CLI 保留服务端返回顺序,不在本地重新排序,也不根据 `scope` 推断固定来源优先级。
|
|
16
14
|
|
|
17
15
|
## 业务执行中的 KB 消费
|
|
18
16
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "lovrabet",
|
|
4
4
|
"packageName": "@lovrabet/lovrabet-cli",
|
|
5
|
-
"packageVersion": "2.3.1-beta.
|
|
6
|
-
"skillVersion": "2.3.1-beta.
|
|
5
|
+
"packageVersion": "2.3.1-beta.3",
|
|
6
|
+
"skillVersion": "2.3.1-beta.3",
|
|
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": "a731aa4a6155920b8d585bd588c640933ef8d32de8567d7c88a9ceb3e6221be5"
|
|
41
41
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export type KnowledgeSearchScope = "public" | "company" | "personal";
|
|
2
|
-
export interface KnowledgeSearchHit {
|
|
3
|
-
documentId: string;
|
|
4
|
-
revision: number;
|
|
5
|
-
chunkId: string;
|
|
6
|
-
scope: KnowledgeSearchScope;
|
|
7
|
-
title: string;
|
|
8
|
-
text: string;
|
|
9
|
-
tags: string[];
|
|
10
|
-
rank: number;
|
|
11
|
-
rawScore: number;
|
|
12
|
-
finalScore: number;
|
|
13
|
-
scoreKind: string;
|
|
14
|
-
}
|
|
15
|
-
export interface RuntimeKnowledgeSearchResult {
|
|
16
|
-
schemaVersion: 2;
|
|
17
|
-
profile: "runtime";
|
|
18
|
-
total: number;
|
|
19
|
-
strategyFingerprint: string;
|
|
20
|
-
timingsMs: Record<string, number>;
|
|
21
|
-
hits: KnowledgeSearchHit[];
|
|
22
|
-
}
|
|
23
|
-
export interface RuntimeKnowledgeSearchInput {
|
|
24
|
-
appCode: string;
|
|
25
|
-
accessKey: string;
|
|
26
|
-
query: string;
|
|
27
|
-
topK?: number;
|
|
28
|
-
signal?: AbortSignal;
|
|
29
|
-
}
|
|
30
|
-
export declare function searchRuntimeKnowledge(input: RuntimeKnowledgeSearchInput): Promise<RuntimeKnowledgeSearchResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a105_0x3724e0=a105_0x2957;(function(_0x1acf32,_0x2a9790){const _0x1ea416=a105_0x2957,_0x2f79d8=_0x1acf32();while(!![]){try{const _0x4cccb9=parseInt(_0x1ea416(0x135))/0x1*(-parseInt(_0x1ea416(0x121))/0x2)+parseInt(_0x1ea416(0x137))/0x3*(-parseInt(_0x1ea416(0x120))/0x4)+-parseInt(_0x1ea416(0x105))/0x5*(parseInt(_0x1ea416(0x147))/0x6)+-parseInt(_0x1ea416(0x136))/0x7*(parseInt(_0x1ea416(0x139))/0x8)+-parseInt(_0x1ea416(0x12a))/0x9*(-parseInt(_0x1ea416(0x133))/0xa)+-parseInt(_0x1ea416(0xff))/0xb*(parseInt(_0x1ea416(0x129))/0xc)+parseInt(_0x1ea416(0x142))/0xd*(parseInt(_0x1ea416(0x12c))/0xe);if(_0x4cccb9===_0x2a9790)break;else _0x2f79d8['push'](_0x2f79d8['shift']());}catch(_0x102291){_0x2f79d8['push'](_0x2f79d8['shift']());}}}(a105_0xd868,0x363b2));import{getKbSearchDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a105_0x3724e0(0x13b),a105_0x3724e0(0x11c),a105_0x3724e0(0x12f)],HIT_KEYS=[a105_0x3724e0(0x13c),a105_0x3724e0(0x119),'chunkId',a105_0x3724e0(0x126),a105_0x3724e0(0x109),a105_0x3724e0(0x12b),a105_0x3724e0(0x144),a105_0x3724e0(0x13f),a105_0x3724e0(0x114),a105_0x3724e0(0x10c),'scoreKind'];export async function searchRuntimeKnowledge(_0x44cef8){const _0x210497=a105_0x3724e0,_0x4ba781=_0x44cef8[_0x210497(0xfe)][_0x210497(0x125)](),_0xe1ddd5=_0x44cef8[_0x210497(0x116)][_0x210497(0x125)]();if(!_0x4ba781)throw CliErrors['validation'](_0x210497(0x128));if(!_0x44cef8[_0x210497(0x13a)][_0x210497(0x125)]())throw CliErrors[_0x210497(0x13d)]();if(!_0xe1ddd5)throw CliErrors['validation']('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x44cef8[_0x210497(0x124)]);const _0x25ffb5=getKbSearchDomain()+'/v1/apps/'+encodeURIComponent(_0x4ba781)+_0x210497(0x103);let _0x3af147;try{_0x3af147=await fetch(_0x25ffb5,{'method':_0x210497(0x11a),'headers':{'Content-Type':_0x210497(0x11d),'X-User-AK':_0x44cef8[_0x210497(0x13a)],'X-Invoke-Source':'cli:lovrabet'},'body':JSON[_0x210497(0x106)]({'query':_0xe1ddd5,..._0x44cef8[_0x210497(0x124)]!==undefined?{'topK':_0x44cef8[_0x210497(0x124)]}:{}}),'signal':_0x44cef8[_0x210497(0x12e)]});}catch(_0x557d0e){if(_0x557d0e instanceof CliError)throw _0x557d0e;if(_0x557d0e instanceof Error&&_0x557d0e[_0x210497(0x148)]===_0x210497(0x130))throw _0x557d0e;throw CliErrors[_0x210497(0x10f)]('KB\x20Service\x20search\x20request\x20failed.');}if(!hasNoStore(_0x3af147[_0x210497(0x131)]))throw CliErrors[_0x210497(0x11b)]('KB\x20Service\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(_0x3af147[_0x210497(0x11e)]===0x191)throw CliErrors['authRequired']();if(!_0x3af147['ok'])throw CliErrors['apiError'](_0x210497(0x101)+_0x3af147[_0x210497(0x11e)]+').');if(!(_0x3af147['headers'][_0x210497(0x12d)](_0x210497(0x117))??'')[_0x210497(0x100)]()[_0x210497(0x111)](_0x210497(0x11d)))throw CliErrors[_0x210497(0x11b)](_0x210497(0x118));let _0x597371;try{_0x597371=await _0x3af147['json']();}catch{throw CliErrors[_0x210497(0x11b)](_0x210497(0x10e));}return parseRuntimeSearchResponse(_0x597371,_0x44cef8[_0x210497(0x124)]);}function validateTopK(_0x1d31f4){const _0x38e130=a105_0x3724e0;if(_0x1d31f4!==undefined&&(!Number[_0x38e130(0x134)](_0x1d31f4)||_0x1d31f4<0x1||_0x1d31f4>0x32))throw CliErrors[_0x38e130(0x140)]('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function hasNoStore(_0x377f56){const _0x22b09e=a105_0x3724e0;return(_0x377f56[_0x22b09e(0x12d)](_0x22b09e(0x10a))??'')[_0x22b09e(0x146)](',')[_0x22b09e(0x122)](_0x3677e8=>_0x3677e8[_0x22b09e(0x125)]()['toLowerCase']()===_0x22b09e(0x123));}function parseRuntimeSearchResponse(_0x29cb7f,_0x461b40){const _0x203da2=a105_0x3724e0,_0x368e45=requireExactRecord(_0x29cb7f,RESPONSE_KEYS,_0x203da2(0x115));if(!Array[_0x203da2(0x112)](_0x368e45['hits'])||_0x368e45[_0x203da2(0x13b)][_0x203da2(0x145)]>(_0x461b40??0x32))throw invalidContract(_0x203da2(0x13b));if(typeof _0x368e45[_0x203da2(0x11c)]!==_0x203da2(0x113)||!/^sha256:[0-9a-f]{64}$/[_0x203da2(0x13e)](_0x368e45[_0x203da2(0x11c)]))throw invalidContract('strategyFingerprint');const _0x3ced1d=requireRecord(_0x368e45['timingsMs'],'timingsMs'),_0x5a9aa1={};for(const [_0x59338f,_0x1e3aa5]of Object[_0x203da2(0x132)](_0x3ced1d)){if(!/^[A-Za-z][A-Za-z0-9]*$/['test'](_0x59338f)||typeof _0x1e3aa5!==_0x203da2(0x143)||!Number[_0x203da2(0x10b)](_0x1e3aa5)||_0x1e3aa5<0x0)throw invalidContract('timingsMs');_0x5a9aa1[_0x59338f]=_0x1e3aa5;}const _0x2498b5=_0x368e45[_0x203da2(0x13b)][_0x203da2(0x108)]((_0x69b401,_0xe8d3e5)=>parseHit(_0x69b401,_0xe8d3e5));return{'schemaVersion':0x2,'profile':'runtime','total':_0x2498b5[_0x203da2(0x145)],'strategyFingerprint':_0x368e45[_0x203da2(0x11c)],'timingsMs':_0x5a9aa1,'hits':_0x2498b5};}function a105_0x2957(_0x2bdd01,_0x24d20d){_0x2bdd01=_0x2bdd01-0xfe;const _0xd8689e=a105_0xd868();let _0x295749=_0xd8689e[_0x2bdd01];return _0x295749;}function parseHit(_0x3459eb,_0x586dd6){const _0x41714b=a105_0x3724e0,_0x437811=requireExactRecord(_0x3459eb,HIT_KEYS,'hits['+_0x586dd6+']'),_0x490c6a=_0x3a9ff1=>{const _0x9f3126=_0x437811[_0x3a9ff1];if(typeof _0x9f3126!=='string'||!_0x9f3126)throw invalidContract(_0x3a9ff1);return _0x9f3126;};if(!Number[_0x41714b(0x134)](_0x437811[_0x41714b(0x119)])||_0x437811[_0x41714b(0x119)]<0x1)throw invalidContract(_0x41714b(0x119));if(_0x437811['scope']!==_0x41714b(0x127)&&_0x437811[_0x41714b(0x126)]!==_0x41714b(0x107)&&_0x437811['scope']!==_0x41714b(0x104))throw invalidContract(_0x41714b(0x126));if(typeof _0x437811[_0x41714b(0x109)]!==_0x41714b(0x113)||typeof _0x437811['text']!==_0x41714b(0x113))throw invalidContract(_0x41714b(0x12b));if(!Array['isArray'](_0x437811[_0x41714b(0x144)])||_0x437811['tags'][_0x41714b(0x122)](_0x32c88c=>typeof _0x32c88c!==_0x41714b(0x113)))throw invalidContract(_0x41714b(0x144));if(!Number['isSafeInteger'](_0x437811['rank'])||_0x437811['rank']!==_0x586dd6+0x1)throw invalidContract(_0x41714b(0x13f));if(!isFiniteNumber(_0x437811[_0x41714b(0x114)])||!isFiniteNumber(_0x437811[_0x41714b(0x10c)]))throw invalidContract(_0x41714b(0x141));return{'documentId':_0x490c6a(_0x41714b(0x13c)),'revision':_0x437811[_0x41714b(0x119)],'chunkId':_0x490c6a(_0x41714b(0x11f)),'scope':_0x437811[_0x41714b(0x126)],'title':_0x437811[_0x41714b(0x109)],'text':_0x437811[_0x41714b(0x12b)],'tags':[..._0x437811[_0x41714b(0x144)]],'rank':_0x437811[_0x41714b(0x13f)],'rawScore':_0x437811['rawScore'],'finalScore':_0x437811[_0x41714b(0x10c)],'scoreKind':_0x490c6a(_0x41714b(0x110))};}function a105_0xd868(){const _0x4cd32e=['company','map','title','cache-control','isFinite','finalScore','\x20contract.','KB\x20Service\x20search\x20returned\x20invalid\x20JSON.','networkError','scoreKind','includes','isArray','string','rawScore','response','query','content-type','KB\x20Service\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','revision','POST','apiError','strategyFingerprint','application/json','status','chunkId','30572GEqXDE','154qwLHBQ','some','no-store','topK','trim','scope','public','Knowledge\x20search\x20appCode\x20is\x20required.','660QZaOQe','9JVwuoi','text','896TxaZNp','get','signal','timingsMs','AbortError','headers','entries','3263510NQxZoA','isSafeInteger','4919xVzyLB','14avcPVX','33aHNDbP','object','1025824lIQzet','accessKey','hits','documentId','authRequired','test','rank','validation','score','241215wbOcga','number','tags','length','split','522oeWofU','name','appCode','82874lfSGoE','toLowerCase','KB\x20Service\x20search\x20failed\x20(HTTP\x20','sort','/knowledge/search','personal','9085IBBZcn','stringify'];a105_0xd868=function(){return _0x4cd32e;};return a105_0xd868();}function requireExactRecord(_0x2469b4,_0x4d83e8,_0x4046bf){const _0x3f6599=a105_0x3724e0,_0x51e427=requireRecord(_0x2469b4,_0x4046bf),_0x445315=Object['keys'](_0x51e427)[_0x3f6599(0x102)](),_0x5ee704=[..._0x4d83e8][_0x3f6599(0x102)]();if(_0x445315[_0x3f6599(0x145)]!==_0x5ee704[_0x3f6599(0x145)]||_0x445315['some']((_0xf5b706,_0x26db5e)=>_0xf5b706!==_0x5ee704[_0x26db5e]))throw invalidContract(_0x4046bf);return _0x51e427;}function requireRecord(_0x271d10,_0x2d4925){const _0x3ae9ef=a105_0x3724e0;if(!_0x271d10||typeof _0x271d10!==_0x3ae9ef(0x138)||Array['isArray'](_0x271d10))throw invalidContract(_0x2d4925);return _0x271d10;}function isFiniteNumber(_0x85cb){const _0x5529a8=a105_0x3724e0;return typeof _0x85cb==='number'&&Number[_0x5529a8(0x10b)](_0x85cb);}function invalidContract(_0x2f76f8){const _0x5056ad=a105_0x3724e0;return CliErrors[_0x5056ad(0x11b)]('KB\x20Service\x20search\x20returned\x20an\x20invalid\x20'+_0x2f76f8+_0x5056ad(0x10d));}
|