@openbkn/bkn-sdk 0.1.1-alpha.9 → 0.1.2
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/LICENSE +1 -0
- package/NOTICE +21 -0
- package/README.md +33 -26
- package/README.zh.md +11 -12
- package/dist/{chunk-BFE4SU3V.js → chunk-LH3ONZGQ.js} +2345 -220
- package/dist/cli.js +617 -208
- package/dist/index.d.ts +974 -81
- package/dist/index.js +3 -1
- package/package.json +6 -4
- package/dist/chunk-BFE4SU3V.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.js.map +0 -1
package/LICENSE
CHANGED
package/NOTICE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
BKN SDK
|
|
2
|
+
Copyright 2026 OpenBKN
|
|
3
|
+
|
|
4
|
+
BKN SDK is part of the OpenBKN project.
|
|
5
|
+
|
|
6
|
+
================================================================
|
|
7
|
+
1. BKN SDK (Apache License 2.0)
|
|
8
|
+
================================================================
|
|
9
|
+
BKN SDK is independently developed by OpenBKN, is copyright OpenBKN,
|
|
10
|
+
and is licensed under the Apache License, Version 2.0.
|
|
11
|
+
|
|
12
|
+
Full license text: LICENSE
|
|
13
|
+
Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
|
|
15
|
+
================================================================
|
|
16
|
+
2. Third-party dependencies
|
|
17
|
+
================================================================
|
|
18
|
+
This product depends on and may bundle third-party software, each of
|
|
19
|
+
which remains under its own license as declared in its package
|
|
20
|
+
metadata (see package.json and the dependency manifests). Those
|
|
21
|
+
licenses are not altered by this project's license.
|
package/README.md
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Unified TypeScript SDK + CLI for the **BKN** (Business Knowledge Network) platform.
|
|
4
4
|
One toolkit, two surfaces: the importable SDK and the `openbkn` CLI — both backed
|
|
5
|
-
by the same domain logic. A
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
>
|
|
10
|
-
>
|
|
11
|
-
>
|
|
12
|
-
>
|
|
13
|
-
> upstream, physical-catalog `create-from-*`, populated trace index) — see
|
|
5
|
+
by the same domain logic. A single unified CLI for the BKN platform, with the
|
|
6
|
+
operator surface nested under `openbkn admin`. Backend-only; no web UI.
|
|
7
|
+
|
|
8
|
+
> Status: every command/subcommand is implemented and self-consistent, with a
|
|
9
|
+
> full-depth grouped `--help` for every node. Reads + writes across all domains
|
|
10
|
+
> are validated against a live platform; a few paths are environment-gated on the
|
|
11
|
+
> test cluster (EACP `change-password`/`audit` upstream, physical-catalog
|
|
12
|
+
> `create-from-*`, populated trace index) — see
|
|
14
13
|
> `docs/exec-plans/tech-debt-tracker.md`.
|
|
15
14
|
|
|
16
15
|
## Install
|
|
@@ -46,14 +45,15 @@ openbkn model llm list
|
|
|
46
45
|
openbkn agent list
|
|
47
46
|
openbkn agent sessions <agent-key>
|
|
48
47
|
|
|
49
|
-
# Operator (
|
|
48
|
+
# Operator (nested)
|
|
50
49
|
openbkn admin org list
|
|
51
50
|
openbkn admin role list
|
|
52
51
|
|
|
53
52
|
# Raw passthrough to any endpoint
|
|
54
53
|
openbkn call /api/ontology-manager/v1/knowledge-networks
|
|
55
54
|
|
|
56
|
-
# Global flags: --base-url, --token, --user, --json/--compact, -bd/--biz-domain, -k/--insecure
|
|
55
|
+
# Global flags: --base-url, --token, --user, --json/--compact, -bd/--biz-domain, -k/--insecure,
|
|
56
|
+
# --conversation-id/--interaction-id (BKN Trace correlation; also BKN_CONVERSATION_ID/BKN_INTERACTION_ID)
|
|
57
57
|
openbkn --help # grouped command map
|
|
58
58
|
```
|
|
59
59
|
|
|
@@ -78,17 +78,15 @@ Importing the package has no side effects; `createClient` resolves config explic
|
|
|
78
78
|
```bash
|
|
79
79
|
npm install
|
|
80
80
|
npm run lint # biome + tsc --noEmit
|
|
81
|
-
npm test # vitest (unit
|
|
81
|
+
npm test # vitest (unit)
|
|
82
82
|
npm run build # tsup → dist/ (library + `openbkn` bin)
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
##
|
|
85
|
+
## Help system
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
`test/equivalence/` — **196/196** commands match (every node exists and its
|
|
91
|
-
`--help` covers the legacy flags + arguments). Run live with `BKN_EQUIV_LIVE=1`.
|
|
87
|
+
Every command, subcommand, and sub-subcommand ships a grouped `--help` that
|
|
88
|
+
lists its flags and arguments, so the tree is discoverable end to end.
|
|
89
|
+
`openbkn help all` dumps the full per-action signature list.
|
|
92
90
|
|
|
93
91
|
## Agent skill
|
|
94
92
|
|
|
@@ -99,21 +97,30 @@ command-group map, examples, and cautions) plus per-domain cheat sheets under
|
|
|
99
97
|
`references/` (auth, bkn, agent, model, vega, resource, dataflow, context,
|
|
100
98
|
skill, toolbox, trace, admin, call) and two how-tos (build-a-KN, troubleshooting).
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
A second skill, `skills/create-bkn/`, guides an AI through **authoring** a BKN
|
|
101
|
+
definition tree (`network.bkn` + typed `object_types/` / `relation_types/` /
|
|
102
|
+
`action_types/` / `concept_groups/` files, per the v2.0.1 spec) — with the
|
|
103
|
+
format spec, templates, and a worked example under `references/`. It pairs with
|
|
104
|
+
the `openbkn` skill, which then runs `openbkn bkn validate` / `push` on the
|
|
105
|
+
tree it produced.
|
|
106
|
+
|
|
107
|
+
Neither skill is part of the npm package — they're registered separately:
|
|
103
108
|
|
|
104
109
|
```bash
|
|
105
|
-
# Install
|
|
106
|
-
npx skills add openbkn-ai/bkn-sdk@openbkn -g -y
|
|
110
|
+
# Install a skill (globally), then ask in natural language:
|
|
111
|
+
npx skills add openbkn-ai/bkn-sdk@openbkn -g -y # operate the platform
|
|
112
|
+
npx skills add openbkn-ai/bkn-sdk@create-bkn -g -y # author .bkn files
|
|
107
113
|
|
|
108
114
|
# "列出所有知识网络" / "list all knowledge networks"
|
|
109
115
|
# "从 Vega catalog vcat-1 建一个名为 customers 的知识网络并构建索引"
|
|
110
|
-
# "
|
|
116
|
+
# "帮我建一个描述订单域的 BKN 知识网络文件" / "author a BKN network for the orders domain"
|
|
111
117
|
```
|
|
112
118
|
|
|
113
|
-
The skill assumes the `openbkn` CLI is installed (`npm i -g
|
|
114
|
-
and you are logged in (`openbkn auth login`). It always defers
|
|
115
|
-
`openbkn <group> <sub> --help` for exact flags.
|
|
119
|
+
The `openbkn` skill assumes the `openbkn` CLI is installed (`npm i -g
|
|
120
|
+
@openbkn/bkn-sdk`) and you are logged in (`openbkn auth login`). It always defers
|
|
121
|
+
to live `openbkn <group> <sub> --help` for exact flags.
|
|
116
122
|
|
|
117
123
|
## License
|
|
118
124
|
|
|
119
|
-
|
|
125
|
+
BKN SDK is part of the OpenBKN project and is licensed under the
|
|
126
|
+
**Apache License, Version 2.0**. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
package/README.zh.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# @openbkn/bkn-sdk
|
|
2
2
|
|
|
3
3
|
BKN(Business Knowledge Network)平台的统一 TypeScript SDK + CLI。一套工具、两个入口:
|
|
4
|
-
可 import 的 SDK 与 `openbkn`
|
|
5
|
-
`
|
|
6
|
-
`openbkn admin` 子命令)。纯后端,无 Web UI。
|
|
4
|
+
可 import 的 SDK 与 `openbkn` 命令行——共享同一套领域逻辑。面向 BKN 平台的
|
|
5
|
+
统一命令行工具,运维面收进 `openbkn admin` 子命令。纯后端,无 Web UI。
|
|
7
6
|
|
|
8
|
-
> 状态:预发布。各域的读命令已实现并在真实平台上验证;部分写操作与 Trace
|
|
7
|
+
> 状态:预发布。各域的读命令已实现并在真实平台上验证;部分写操作与 BKN Trace
|
|
9
8
|
> 引擎仍在进行中(见 `docs/exec-plans/tech-debt-tracker.md`)。
|
|
10
9
|
|
|
11
10
|
## 安装
|
|
@@ -40,7 +39,7 @@ openbkn model llm list
|
|
|
40
39
|
openbkn agent list
|
|
41
40
|
openbkn agent sessions <agent-key>
|
|
42
41
|
|
|
43
|
-
#
|
|
42
|
+
# 运维(嵌套)
|
|
44
43
|
openbkn admin org list
|
|
45
44
|
openbkn admin role list
|
|
46
45
|
|
|
@@ -48,6 +47,7 @@ openbkn admin role list
|
|
|
48
47
|
openbkn call /api/ontology-manager/v1/knowledge-networks
|
|
49
48
|
|
|
50
49
|
# 全局参数:--base-url --token --user --json/--compact -bd/--biz-domain -k/--insecure
|
|
50
|
+
# --conversation-id/--interaction-id(BKN Trace 关联,等价 env:BKN_CONVERSATION_ID/BKN_INTERACTION_ID)
|
|
51
51
|
openbkn --help # 分组命令树
|
|
52
52
|
```
|
|
53
53
|
|
|
@@ -72,17 +72,16 @@ import 本包无副作用;`createClient` 显式解析配置。
|
|
|
72
72
|
```bash
|
|
73
73
|
npm install
|
|
74
74
|
npm run lint # biome + tsc --noEmit
|
|
75
|
-
npm test # vitest
|
|
75
|
+
npm test # vitest(单测)
|
|
76
76
|
npm run build # tsup → dist/(库 + openbkn bin)
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
##
|
|
79
|
+
## 帮助系统
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
全深度 `--help` 黄金基线与一致性测试见 `test/equivalence/`
|
|
84
|
-
(用 `BKN_EQUIV_LIVE=1` 真机跑)。
|
|
81
|
+
每个命令、子命令、孙命令都带分组 `--help`,列出各自的参数与位置参数,
|
|
82
|
+
整棵命令树可端到端发现。`openbkn help all` 输出全深度的逐动作签名清单。
|
|
85
83
|
|
|
86
84
|
## 许可证
|
|
87
85
|
|
|
88
|
-
Apache
|
|
86
|
+
BKN SDK 是 OpenBKN 项目的一部分,采用 **Apache License, Version 2.0**。
|
|
87
|
+
见 [LICENSE](LICENSE) 与 [NOTICE](NOTICE)。
|