@openbkn/bkn-sdk 0.1.3 → 0.1.5-rc.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/README.md CHANGED
@@ -20,7 +20,7 @@ npm install -g @openbkn/bkn-sdk # CLI: `openbkn`
20
20
  npm install @openbkn/bkn-sdk
21
21
  ```
22
22
 
23
- Requires Node ≥ 22.19.
23
+ Requires Node ≥ 22.19.0.
24
24
 
25
25
  ## CLI
26
26
 
@@ -38,25 +38,27 @@ openbkn bkn object-type list <kn-id>
38
38
  # Data platform
39
39
  openbkn resource list --type table
40
40
  openbkn vega catalog list
41
- openbkn dataflow list
42
41
  openbkn model llm list
43
42
 
44
- # Agents
45
- openbkn agent list
46
- openbkn agent sessions <agent-key>
47
-
48
43
  # Operator (nested)
49
44
  openbkn admin org list
50
45
  openbkn admin role list
51
46
 
52
47
  # Raw passthrough to any endpoint
53
- openbkn call /api/ontology-manager/v1/knowledge-networks
48
+ openbkn call /api/bkn-backend/v1/knowledge-networks
54
49
 
55
50
  # Global flags: --base-url, --token, --user, --json/--compact, -bd/--biz-domain, -k/--insecure,
56
51
  # --conversation-id/--interaction-id (BKN Trace correlation; also BKN_CONVERSATION_ID/BKN_INTERACTION_ID)
52
+ # --new-conversation (ignore the remembered conversation for this command)
57
53
  openbkn --help # grouped command map
58
54
  ```
59
55
 
56
+ On a `managed-v2` deploy, commands continue the conversation the previous one
57
+ opened, so work spanning several commands lands in one thread. `openbkn context conversation` shows which
58
+ is in force and where it came from; `--forget` drops it. An explicit `--token` /
59
+ `BKN_TOKEN` opts out (identity there is the token, not the stored user) — use
60
+ `BKN_CONVERSATION_ID` to thread such a script's commands together.
61
+
60
62
  Tokens are stored per platform/user under `~/.bkn/` (override: `BKN_CONFIG_DIR`).
61
63
 
62
64
  ## SDK
@@ -73,6 +75,10 @@ const raw = await bkn.call("/api/...", { method: "GET" });
73
75
 
74
76
  Importing the package has no side effects; `createClient` resolves config explicitly.
75
77
 
78
+ Dynamic-data responses (including Vega and ontology queries) may contain native
79
+ `bigint` values for integers outside JavaScript's safe range. Serialize such a result with the exported
80
+ `stringifyBigIntJSON()` helper instead of native `JSON.stringify()`.
81
+
76
82
  ## Develop
77
83
 
78
84
  ```bash
@@ -86,7 +92,8 @@ npm run build # tsup → dist/ (library + `openbkn` bin)
86
92
 
87
93
  Every command, subcommand, and sub-subcommand ships a grouped `--help` that
88
94
  lists its flags and arguments, so the tree is discoverable end to end.
89
- `openbkn help all` dumps the full per-action signature list.
95
+ `openbkn describe` prints the whole tree at once — sections, arguments, and
96
+ where each id comes from; `--json` ships the same thing as data.
90
97
 
91
98
  ## Agent skill
92
99
 
@@ -94,8 +101,9 @@ lists its flags and arguments, so the tree is discoverable end to end.
94
101
  ecosystem) that lets an AI drive the `openbkn` CLI from natural language. It
95
102
  ships a `SKILL.md` (trigger intents, `allowed-tools: Bash(openbkn *)`, a
96
103
  command-group map, examples, and cautions) plus per-domain cheat sheets under
97
- `references/` (auth, bkn, agent, model, vega, resource, dataflow, context,
98
- skill, toolbox, trace, admin, call) and two how-tos (build-a-KN, troubleshooting).
104
+ `references/` (auth, bkn, model, vega, resource, context,
105
+ skill, toolbox, function, trace, admin, call) and two how-tos
106
+ (build-a-KN, troubleshooting).
99
107
 
100
108
  A second skill, `skills/create-bkn/`, guides an AI through **authoring** a BKN
101
109
  definition tree (`network.bkn` + typed `object_types/` / `relation_types/` /
package/README.zh.md CHANGED
@@ -15,7 +15,7 @@ npm install -g @openbkn/bkn-sdk # CLI:openbkn
15
15
  npm install @openbkn/bkn-sdk
16
16
  ```
17
17
 
18
- 需要 Node ≥ 22.19。
18
+ 需要 Node ≥ 22.19.0
19
19
 
20
20
  ## CLI
21
21
 
@@ -32,25 +32,26 @@ openbkn bkn object-type list <kn-id>
32
32
  # 数据平台
33
33
  openbkn resource list --type table
34
34
  openbkn vega catalog list
35
- openbkn dataflow list
36
35
  openbkn model llm list
37
36
 
38
- # 智能体
39
- openbkn agent list
40
- openbkn agent sessions <agent-key>
41
-
42
37
  # 运维(嵌套)
43
38
  openbkn admin org list
44
39
  openbkn admin role list
45
40
 
46
41
  # 任意端点的原始透传
47
- openbkn call /api/ontology-manager/v1/knowledge-networks
42
+ openbkn call /api/bkn-backend/v1/knowledge-networks
48
43
 
49
44
  # 全局参数:--base-url --token --user --json/--compact -bd/--biz-domain -k/--insecure
50
45
  # --conversation-id/--interaction-id(BKN Trace 关联,等价 env:BKN_CONVERSATION_ID/BKN_INTERACTION_ID)
46
+ # --new-conversation(这条命令不沿用记住的 conversation)
51
47
  openbkn --help # 分组命令树
52
48
  ```
53
49
 
50
+ `managed-v2` 部署上,命令会接着上一条开的 conversation,跨命令的一件事因此落在同一个线程里。
51
+ `openbkn context conversation` 显示当前生效的是哪个、来自哪一层;`--forget` 丢掉它。
52
+ 显式 `--token` / `BKN_TOKEN` 不参与(那里的身份是 token 本身,不是存下来的用户)——
53
+ 这类脚本用 `BKN_CONVERSATION_ID` 把多条命令串起来。
54
+
54
55
  Token 按平台/用户存于 `~/.bkn/`(可用 `BKN_CONFIG_DIR` 覆盖)。
55
56
 
56
57
  ## SDK
@@ -67,6 +68,10 @@ const raw = await bkn.call("/api/...", { method: "GET" });
67
68
 
68
69
  import 本包无副作用;`createClient` 显式解析配置。
69
70
 
71
+ Vega 和本体查询等动态数据响应中,超出 JavaScript 安全整数范围的值可能是原生 `bigint`。
72
+ 序列化这类结果时,请使用导出的 `stringifyBigIntJSON()`,不要使用原生
73
+ `JSON.stringify()`。
74
+
70
75
  ## 开发
71
76
 
72
77
  ```bash