Repository navigation
refactor(knowledge-base): separate frontend sources from the installable runtime #2967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5135a48
2d4940e
f061101
f5ab2c6
42cc8b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||||||||||||||||||||||||||||||||
| # First-party Server plugins | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| Each subdirectory is the source root of one first-party PowerContext Server plugin. A plugin with a separately built | ||||||||||||||||||||||||||||||||||||
| Dashboard keeps its frontend sources under `frontend/` and the installable files under `runtime/`; only the contents of | ||||||||||||||||||||||||||||||||||||
| `runtime/` are copied into `<configured-plugins-dir>/<plugin-name>/`, so `plugin.py` is directly inside the named | ||||||||||||||||||||||||||||||||||||
| directory. For example, the knowledge-base runtime is installed at `<configured-plugins-dir>/knowledge-base/`. | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - [Knowledge-base plugin](knowledge-base/README.md) | ||||||||||||||||||||||||||||||||||||
| - [Write a plugin](../docs/en/docs/develop/plugins.md) · [编写插件](../docs/zh/docs/develop/plugins.md) | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+9
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep
Suggested change
|
||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,20 @@ A knowledge base is a core Scope; spaces and their membership/defaults live only | |
| - [中文指南](../../docs/zh/docs/workflows/knowledge-base.md) | ||
| - [Design RFC #2570](https://github.com/oceanbase/powercontext/pull/2570) | ||
|
|
||
| Copy this **whole directory**, keeping its name `knowledge-base`, into the configured Server plugin directory. | ||
| Copy the **contents** of `runtime/` into a directory named `knowledge-base` in the configured Server plugin directory. | ||
| Copying the `runtime` directory itself would give the plugin the wrong identity: | ||
|
|
||
| ```bash | ||
| mkdir -p "$POWERCONTEXT_SERVER_PLUGINS_DIR/knowledge-base" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Make the installation destination explicit before creating it. A Server configured through its service environment can have a plugin directory even when the shell running these commands has no |
||
| cp -R plugins/knowledge-base/runtime/. "$POWERCONTEXT_SERVER_PLUGINS_DIR/knowledge-base/" | ||
| ``` | ||
|
|
||
| The Dashboard is built from `frontend/` and the result is checked in under `runtime/ui/`: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please put the optional Dashboard build before the install step and state that both examples run from the repository root. Someone installing a checkout can use the assets already committed under |
||
|
|
||
| ```bash | ||
| npm ci --prefix plugins/knowledge-base/frontend | ||
| npm run build --prefix plugins/knowledge-base/frontend | ||
| ``` | ||
| Install `powercontext[server,knowledge-base]` into the same environment used by Server and Workers. The plugin is | ||
| copy-installed rather than automatically enabled by installing the Python extra. | ||
|
|
||
|
|
@@ -16,4 +29,4 @@ and [#2660](https://github.com/oceanbase/powercontext/pull/2660). The plugin doe | |
| It uses `ctx.storage`, the framework writer, and the Dashboard `client.artifacts` bridge. | ||
|
|
||
| The bundled Dashboard provides a document table, separate chunk reader, retrieval testing and settings. | ||
| Frontend development and rebuild instructions are in [frontend/knowledge-base](../../frontend/knowledge-base/README.md). | ||
| Frontend development and rebuild instructions are in [frontend](frontend/README.md). | ||
|
Zxf-xufeng marked this conversation as resolved.
Resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.