You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9cf5883
Browse filesBrowse the repository at this point in the historyBrowse files
feat(bailian-kb-dsh): update dependencies and configuration for new plugin architecture
- Updated `pnpm-lock.yaml` to reflect new versions for dependencies, including `@deepseek-ai/cordis` and `@deepseek-ai/dsh-agent`.
- Refactored `dsh-plugin.md` documentation to clarify plugin responsibilities and configuration.
- Introduced a new implementation plan for Dsh plugin configuration in `2026-10-09-dsh-config.md`.
- Enhanced `README.md` and `README.zh.md` to provide clearer instructions on plugin setup and usage.
- Added new configuration and credential management files to streamline API key handling and workspace settings.
- Improved error handling and validation for API key and workspace configurations in the plugin.
Copy file name to clipboardExpand all lines: packages/bailian-kb-dsh/README.md
+16-52Lines changed: 16 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,71 +50,33 @@ Verify the plugin is composed — `dsh --profile web --dump-config` should list
50
50
51
51
## Configuration
52
52
53
-
### Option 1 — Settings page (recommended)
53
+
Configure the plugin from its dsh settings page. The API key belongs only to this plugin in dsh credentials (`BAILIAN_KB_API_KEY`, normally `~/.dsh/.credentials.yaml`; the host owns the actual path). All business settings belong exclusively to this plugin's dsh configuration:
54
54
55
-
After installation, **Settings → Bailian KB** appears in the web UI:
|`workspaceId`| Workspace for all knowledge calls | Required |
58
+
|`defaultRetrieveAgentId`| Default retrieval service | Unset |
59
+
|`defaultChatAgentId`| Default Q&A service | Unset |
60
+
|`agentVersion`| Draft `beta` or published service version | Latest published |
61
+
|`chatTimeoutMs`| Chat timeout in milliseconds | 300000 |
56
62
57
-
-**Fetch from console login** — opens the Bailian console in a browser on the host machine; when you finish signing in, the API key and workspace id of that account are stored on the host (the key never travels to the browser). Each login requests a freshly issued key, so switching accounts is one click.
58
-
-**API key** — write-only: the stored value is never echoed back, only reported as configured or not.
59
-
-**Workspace id / default retrieval service / default Q&A service** — editable with echo; the service ids can be picked from the cached service list. Clearing a value falls back to the layers below.
60
-
-**Retrieval service cache** — shows when the injected service list was last fetched, how many services it holds, and offers a manual refresh for a service you just created.
63
+
The endpoint is fixed to `cn-beijing.maas.aliyuncs.com`. There is no endpoint setting. Settings page edits apply to the next call.
61
64
62
-
If you have already run `bl auth login`, the API key and workspace id are adopted once from `~/.bailian/config.json` at startup. A value you deliberately clear is never re-filled.
65
+
At startup, a missing API key may be imported from the active profile in `~/.bailian/config.json`. On the first configuration migration, missing workspace/default-service fields are imported from legacy dsh credentials, with the bl profile as the workspace default. Explicit dsh settings win. The internal `configInitialized` marker prevents cleared settings from being imported again. A missing API key can still be seeded on subsequent startups.
63
66
64
-
### Option 2 — Environment and credential files
67
+
After initialization, business fields are read only from dsh plugin settings, never from bl or legacy credential fields. Clearing Workspace makes calls fail until it is configured again. Console login saves the key in dsh credentials and Workspace in dsh settings. KB does not create a `personal-kb/config.json` file.
65
68
66
-
```sh
67
-
# ~/.dsh/.env, or the credential store at ~/.dsh/.credentials.yaml
The bundle inserts its own entry into the profile; you can override it by id in `~/.dsh/cordis.patch.yml` or the profile's patch file. An override **replaces the whole config object** (no deep merge):
77
-
78
-
```yaml
79
-
- id: tool-bailian-kb
80
-
config:
81
-
defaultRetrieveAgentId: aid-search-service
82
-
defaultChatAgentId: aid-chat-service
83
-
chatTimeoutMs: 600000
84
-
```
85
-
86
-
Disable the plugin with `- id: tool-bailian-kb` plus `disabled: true`.
69
+
The connection panel also accepts a new API key in a password field. Leave it blank to retain the current key, then use **Verify and save** to validate the key/Workspace pair before saving. Failed validation changes neither value; a settings-write failure attempts to restore the previous pair. The key is never read back and the input is cleared after success. Each plugin keeps its own API key and Workspace; editing one plugin does not affect the other. A key supplied by the launch environment must be changed there.
87
70
88
-
### Config fields
89
-
90
-
The config doubles as the `bailian-kb` settings section, so edits in the settings page or settings document apply to the next call without a restart.
Every value is re-read per call, so a rotated key or a switched workspace takes effect immediately. The API key and workspace id are mandatory: without them the tools fail with a message pointing at these configuration paths. Default services are optional — when the workspace has exactly one deployed service for a scene, that one is used.
71
+
Management uses `kb_manage` with arguments after `bl knowledge`, for example `{"args":["service","list","--scene","search"]}`. The host executes the installed `bl` executable with a temporary isolated config directory and the same current key/Workspace as the native tools. Connection override flags are rejected. Secrets are passed through the child environment, never tool arguments. Direct shell invocation of bl remains independent and is not the plugin management path.
|`kb_search`|`query`, `agent_id` (required), `top_k?` (default 5, applied client-side), `images?` (image URLs for multimodal) | Scored chunks with source references, plus a total |
117
78
|`kb_chat`|`message`, `agent_id` (required) | The complete answer plus a `request_id`|
79
+
|`kb_manage`|`args`| Knowledge management using dsh configuration |
118
80
119
81
`agent_id` is required in both schemas: the schema cannot tell the model whether this deployment pins a default, and discovering a missing default at call time wastes a round-trip. The configured default is still honoured for programmatic calls that omit it.
120
82
@@ -157,3 +119,5 @@ Bug reports, feature requests, and PRs are welcome. See [CONTRIBUTING.md](https:
157
119
## License
158
120
159
121
[Apache 2.0](LICENSE)
122
+
123
+
The former shared `DASHSCOPE_API_KEY` is no longer read, modified, or deleted. If the plugin-specific key is absent and bl has no default to import, save a key on each plugin’s page.
0 commit comments