Skip to content

Commit 859ee5a

Browse files
feat(lightspeed): rename config namespace to intelligent-assistant and update rbac policy name (#3538)
* feat(lightspeed): rename config namespace to intelligent-assistant and update rbac policy name Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> * updating change to major Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> * added depreciation warning Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> --------- Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8c01306 commit 859ee5a

26 files changed

Lines changed: 163 additions & 75 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-lightspeed': major
3+
'@red-hat-developer-hub/backstage-plugin-lightspeed-backend': major
4+
'@red-hat-developer-hub/backstage-plugin-lightspeed-common': major
5+
---
6+
7+
BREAKING CHANGE: The configuration namespace has been renamed from `lightspeed` to `intelligent-assistant`. Update your `app-config.yaml` to replace `lightspeed:` with `intelligent-assistant:`. RBAC permission policy names have also been renamed (e.g., `lightspeed.chat.read``intelligent-assistant.chat.read`). Update your `rbac-policy.csv` accordingly. See the migration guide in the lightspeed-backend plugin's README for full details.

workspaces/lightspeed/app-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ organization:
1717
name: Red Hat
1818

1919
# Disable AI Notebooks feature by default
20-
lightspeed:
20+
intelligent-assistant:
2121
notebooks:
2222
enabled: ${NOTEBOOKS_ENABLED:-false}
2323
queryDefaults:

workspaces/lightspeed/packages/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"lint": "backstage-cli package lint"
2020
},
2121
"dependencies": {
22+
"@backstage-community/plugin-rbac": "^1.51.0",
2223
"@backstage/cli": "^0.36.0",
2324
"@backstage/core-compat-api": "^0.5.6",
2425
"@backstage/core-components": "^0.18.8",

workspaces/lightspeed/packages/app/src/modules/nav/Sidebar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const SidebarContent = NavContentBlueprint.make({
4646
</SidebarGroup>
4747
<SidebarSpace />
4848
<SidebarDivider />
49+
{nav.take('page:rbac')}
4950
{nav.take('page:user-settings')}
5051
</Sidebar>
5152
);

workspaces/lightspeed/plugins/lightspeed-backend/README.md

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,43 @@ backend.add(
2525
backend.start();
2626
```
2727

28+
### Migration from `lightspeed` to `intelligent-assistant`
29+
30+
If you are upgrading from a previous version, the configuration namespace and RBAC permission names have changed:
31+
32+
**Configuration** — rename the top-level key in `app-config.yaml`:
33+
34+
| Before | After |
35+
| ------------- | ------------------------ |
36+
| `lightspeed:` | `intelligent-assistant:` |
37+
38+
All nested keys (`servicePort`, `systemPrompt`, `prompts`, `mcpServers`, `notebooks`, etc.) remain the same.
39+
40+
**RBAC policies** — update permission names in your `rbac-policy.csv`:
41+
42+
| Before | After |
43+
| -------------------------- | ------------------------------------- |
44+
| `lightspeed.chat.read` | `intelligent-assistant.chat.read` |
45+
| `lightspeed.chat.create` | `intelligent-assistant.chat.create` |
46+
| `lightspeed.chat.delete` | `intelligent-assistant.chat.delete` |
47+
| `lightspeed.chat.update` | `intelligent-assistant.chat.update` |
48+
| `lightspeed.notebooks.use` | `intelligent-assistant.notebooks.use` |
49+
| `lightspeed.mcp.read` | `intelligent-assistant.mcp.read` |
50+
| `lightspeed.mcp.manage` | `intelligent-assistant.mcp.manage` |
51+
52+
> **Warning**: The old `lightspeed:` config key and `lightspeed.*` permission names are no longer recognized. Existing deployments that do not update will silently lose functionality.
53+
2854
### Plugin Configurations
2955

3056
Add the following lightspeed configurations into your `app-config.yaml` file:
3157

3258
```yaml
33-
lightspeed:
59+
intelligent-assistant:
3460
servicePort: <portNumber> # Optional - Change the LS service port number. Defaults to 8080.
3561
systemPrompt: <system prompt> # Optional - Override the default system prompt.
62+
prompts: # Optional - Custom prompts displayed to users in the chat UI
63+
- title: <prompt_title>
64+
message: <prompt_message>
3665
mcpServers: # Optional - one or more MCP servers
3766
- name: <mcp server name> # must match the name configured in LCS
3867
token: ${MCP_TOKEN}
@@ -63,9 +92,17 @@ The Lightspeed Backend plugin has support for the permission framework.
6392
- When [RBAC permission](https://github.com/backstage/community-plugins/tree/main/workspaces/rbac/plugins/rbac-backend#installation) framework is enabled, for non-admin users to access lightspeed backend API, the role associated with your user should have the following permission policies associated with it. Add the following in your permission policies configuration file named `rbac-policy.csv`:
6493

6594
```CSV
66-
p, role:default/team_a, lightspeed.chat.read, read, allow
67-
p, role:default/team_a, lightspeed.chat.create, create, allow
68-
p, role:default/team_a, lightspeed.chat.delete, delete, allow
95+
p, role:default/team_a, intelligent-assistant.chat.read, read, allow
96+
p, role:default/team_a, intelligent-assistant.chat.create, create, allow
97+
p, role:default/team_a, intelligent-assistant.chat.delete, delete, allow
98+
p, role:default/team_a, intelligent-assistant.chat.update, update, allow
99+
100+
# Required for Notebooks feature (if enabled)
101+
p, role:default/team_a, intelligent-assistant.notebooks.use, update, allow
102+
103+
# Required for MCP server management (if configured)
104+
p, role:default/team_a, intelligent-assistant.mcp.read, read, allow
105+
p, role:default/team_a, intelligent-assistant.mcp.manage, update, allow
69106
70107
g, user:default/<your-user-name>, role:default/team_a
71108
@@ -101,7 +138,7 @@ For Llama Stack setup and configuration, refer to the [Llama Stack documentation
101138
To enable Notebooks, add the following configuration to your `app-config.yaml`:
102139

103140
```yaml
104-
lightspeed:
141+
intelligent-assistant:
105142
servicePort: 8080 # Optional: Lightspeed Core service port (default: 8080)
106143
107144
notebooks:
@@ -125,7 +162,7 @@ lightspeed:
125162

126163
**Core Settings**:
127164

128-
- **`lightspeed.servicePort`** _(optional)_: Port where Lightspeed Core service is running (default: `8080`). The backend connects to Lightspeed Core at `http://{DEFAULT_LIGHTSPEED_SERVICE_HOST}:{servicePort}` to proxy vector store operations. The host is defined by the `DEFAULT_LIGHTSPEED_SERVICE_HOST` constant in the source.
165+
- **`intelligent-assistant.servicePort`** _(optional)_: Port where Lightspeed Core service is running (default: `8080`). The backend connects to Lightspeed Core at `http://{DEFAULT_LIGHTSPEED_SERVICE_HOST}:{servicePort}` to proxy vector store operations. The host is defined by the `DEFAULT_LIGHTSPEED_SERVICE_HOST` constant in the source.
129166

130167
**Notebooks Settings**:
131168

@@ -177,7 +214,7 @@ When enabled, Notebooks exposes the following REST API endpoints:
177214
**Notes**:
178215

179216
- All endpoints require authentication (user context is automatically provided by Backstage)
180-
- All `/v1/*` endpoints require the `lightspeed.notebooks.use` permission
217+
- All `/v1/*` endpoints require the `intelligent-assistant.notebooks.use` permission
181218
- Document endpoints verify session ownership before allowing operations
182219
- `documentId` in paths is the document title (URL-encoded for special characters)
183220

@@ -186,9 +223,9 @@ When enabled, Notebooks exposes the following REST API endpoints:
186223
When RBAC is enabled, users need the following permission to use Notebooks:
187224

188225
```CSV
189-
p, role:default/team_a, lightspeed.notebooks.use, update, allow
226+
p, role:default/team_a, intelligent-assistant.notebooks.use, update, allow
190227
191228
g, user:default/<your-user-name>, role:default/team_a
192229
```
193230

194-
Add this to your `rbac-policy.csv` file along with the existing lightspeed permissions.
231+
Add this to your `rbac-policy.csv` file along with the existing intelligent-assistant permissions.

workspaces/lightspeed/plugins/lightspeed-backend/app-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OPTIONAL: Backend-only configurations
2-
#lightspeed:
2+
#intelligent-assistant:
33
# servicePort: 8080 # OPTIONAL: Port for lightspeed-core service (default: 8080)
44
# systemPrompt: <custom_system_prompt> # OPTIONAL: Override default RHDH system prompt
55
#

workspaces/lightspeed/plugins/lightspeed-backend/config.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
export interface Config {
1818
/**
19-
* Configuration required for using lightspeed
19+
* Configuration required for using intelligent-assistant
2020
* @visibility frontend
2121
*/
22-
lightspeed?: {
22+
'intelligent-assistant'?: {
2323
/**
2424
* configure the port number for the lightspeed service.
2525
* @visibility backend

workspaces/lightspeed/plugins/lightspeed-backend/src/plugin.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,31 @@ export const lightspeedPlugin = createBackendPlugin({
5151
}) {
5252
await migrate(database);
5353

54+
if (config.has('lightspeed')) {
55+
logger.warn(
56+
'DEPRECATED: The "lightspeed" configuration key has been renamed to "intelligent-assistant". ' +
57+
'Please update your app-config.yaml. The old "lightspeed" key is no longer read. ' +
58+
'Migration guide: https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/lightspeed/plugins/lightspeed-backend/README.md#migration-from-lightspeed-to-intelligent-assistant',
59+
);
60+
}
61+
5462
const aiNotebooksEnabled =
55-
config.getOptionalBoolean('lightspeed.notebooks.enabled') ?? false;
63+
config.getOptionalBoolean(
64+
'intelligent-assistant.notebooks.enabled',
65+
) ?? false;
5666

5767
if (aiNotebooksEnabled) {
5868
const queryModel = config.getOptionalString(
59-
'lightspeed.notebooks.queryDefaults.model',
69+
'intelligent-assistant.notebooks.queryDefaults.model',
6070
);
6171
const queryProvider = config.getOptionalString(
62-
'lightspeed.notebooks.queryDefaults.provider_id',
72+
'intelligent-assistant.notebooks.queryDefaults.provider_id',
6373
);
6474

6575
if (!queryModel || !queryProvider) {
6676
logger.warn(
6777
'AI Notebooks feature is enabled but required configuration is missing. ' +
68-
'Please configure lightspeed.notebooks.queryDefaults.model and lightspeed.notebooks.queryDefaults.provider_id. ' +
78+
'Please configure intelligent-assistant.notebooks.queryDefaults.model and intelligent-assistant.notebooks.queryDefaults.provider_id. ' +
6979
'Notebooks will not be available until these are set.',
7080
);
7181
} else {

workspaces/lightspeed/plugins/lightspeed-backend/src/service/mcp-server.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { lightspeedPlugin } from '../plugin';
3838
const mockUserId = 'user:default/user1';
3939

4040
const BASE_CONFIG = {
41-
lightspeed: {
41+
'intelligent-assistant': {
4242
servers: [
4343
{
4444
id: 'test-server',
@@ -52,8 +52,8 @@ const BASE_CONFIG = {
5252
// URLs are not in app-config — they come from LCS (GET /v1/mcp-servers).
5353
// The LCS mock in lcsHandlers returns URLs for 'static-mcp' and 'no-token-server'.
5454
const MCP_CONFIG = {
55-
lightspeed: {
56-
...BASE_CONFIG.lightspeed,
55+
'intelligent-assistant': {
56+
...BASE_CONFIG['intelligent-assistant'],
5757
mcpServers: [
5858
{
5959
name: 'static-mcp',
@@ -64,8 +64,8 @@ const MCP_CONFIG = {
6464
};
6565

6666
const MCP_CONFIG_MULTI = {
67-
lightspeed: {
68-
...BASE_CONFIG.lightspeed,
67+
'intelligent-assistant': {
68+
...BASE_CONFIG['intelligent-assistant'],
6969
mcpServers: [
7070
{
7171
name: 'static-mcp',
@@ -84,8 +84,8 @@ const MCP_CONFIG_ENCRYPTED = {
8484
keys: [{ secret: 'EXAMPLE-key-EXAMPLE-key-EXAMPLE!' }], // notsecret
8585
},
8686
},
87-
lightspeed: {
88-
...BASE_CONFIG.lightspeed,
87+
'intelligent-assistant': {
88+
...BASE_CONFIG['intelligent-assistant'],
8989
mcpServers: [
9090
{
9191
name: 'static-mcp',

workspaces/lightspeed/plugins/lightspeed-backend/src/service/notebooks/documents/documentService.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('DocumentService', () => {
5151
resetMockStorage();
5252
const config = mockServices.rootConfig({
5353
data: {
54-
lightspeed: {
54+
'intelligent-assistant': {
5555
notebooks: {
5656
sessionDefaults: {
5757
provider_id: 'test-notebooks',

0 commit comments

Comments
 (0)