@rezti/dsh-rez-suite 0.1.16 → 0.1.18
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/lib/client.d.ts +3 -2
- package/lib/client.js +9 -4
- package/lib/index.d.ts +2 -1
- package/lib/index.js +23 -18
- package/package.json +5 -5
- package/src/boss/mount.ts +8 -15
- package/src/client/index.ts +2 -3
- package/src/client/locales.ts +4 -2
- package/src/client/panel/ConfigTab.tsx +1 -0
- package/src/index.ts +1 -1
- package/src/presets.ts +3 -3
- package/src/protocol.ts +6 -1
- package/src/routes.ts +3 -3
- package/src/store.ts +2 -1
package/lib/client.d.ts
CHANGED
|
@@ -7262,8 +7262,9 @@ declare const zh: {
|
|
|
7262
7262
|
readonly 'tab.status': "状态";
|
|
7263
7263
|
readonly 'tab.audit': "用量";
|
|
7264
7264
|
readonly 'config.role': "角色";
|
|
7265
|
-
readonly 'config.roleHint': "
|
|
7265
|
+
readonly 'config.roleHint': "选「老板」会在左侧出现搞钱 / 产品 / 运营三室;其他角色决定 MCP 工具";
|
|
7266
7266
|
readonly 'role.all': "全部";
|
|
7267
|
+
readonly 'role.boss': "老板";
|
|
7267
7268
|
readonly 'role.engineer': "工程师";
|
|
7268
7269
|
readonly 'role.sales': "销售";
|
|
7269
7270
|
readonly 'role.operations': "运营";
|
|
@@ -7358,7 +7359,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
7358
7359
|
}
|
|
7359
7360
|
interface SlotMap {
|
|
7360
7361
|
'settings.plugin.item': {
|
|
7361
|
-
kind: '
|
|
7362
|
+
kind: 'keyed';
|
|
7362
7363
|
scope: 'root';
|
|
7363
7364
|
owner: {
|
|
7364
7365
|
children?: never;
|
package/lib/client.js
CHANGED
|
@@ -23,8 +23,9 @@ const zh = {
|
|
|
23
23
|
"tab.status": "状态",
|
|
24
24
|
"tab.audit": "用量",
|
|
25
25
|
"config.role": "角色",
|
|
26
|
-
"config.roleHint": "
|
|
26
|
+
"config.roleHint": "选「老板」会在左侧出现搞钱 / 产品 / 运营三室;其他角色决定 MCP 工具",
|
|
27
27
|
"role.all": "全部",
|
|
28
|
+
"role.boss": "老板",
|
|
28
29
|
"role.engineer": "工程师",
|
|
29
30
|
"role.sales": "销售",
|
|
30
31
|
"role.operations": "运营",
|
|
@@ -121,8 +122,9 @@ const en = {
|
|
|
121
122
|
"tab.status": "Status",
|
|
122
123
|
"tab.audit": "Usage",
|
|
123
124
|
"config.role": "Role",
|
|
124
|
-
"config.roleHint": "
|
|
125
|
+
"config.roleHint": "Boss adds 搞钱 / 产品 / 运营 workspaces; other roles filter MCP tools",
|
|
125
126
|
"role.all": "All",
|
|
127
|
+
"role.boss": "Boss",
|
|
126
128
|
"role.engineer": "Engineer",
|
|
127
129
|
"role.sales": "Sales",
|
|
128
130
|
"role.operations": "Operations",
|
|
@@ -515,6 +517,10 @@ const ROLES = [
|
|
|
515
517
|
value: "all",
|
|
516
518
|
label: "role.all"
|
|
517
519
|
},
|
|
520
|
+
{
|
|
521
|
+
value: "boss",
|
|
522
|
+
label: "role.boss"
|
|
523
|
+
},
|
|
518
524
|
{
|
|
519
525
|
value: "engineer",
|
|
520
526
|
label: "role.engineer"
|
|
@@ -1254,8 +1260,7 @@ function apply(ctx) {
|
|
|
1254
1260
|
}), "dsh-rez-suite: dictionaries");
|
|
1255
1261
|
ctx.slots.inject("settings.plugin.item", () => ctx.slots.register({
|
|
1256
1262
|
name: "settings.plugin.item",
|
|
1257
|
-
|
|
1258
|
-
order: 40,
|
|
1263
|
+
key: NS,
|
|
1259
1264
|
locale: NS
|
|
1260
1265
|
}, RezPluginCard));
|
|
1261
1266
|
ctx.slots.inject("settings.plugins.tab", () => ctx.slots.register({
|
package/lib/index.d.ts
CHANGED
|
@@ -1678,7 +1678,8 @@ declare abstract class SettingsProvider extends Service {
|
|
|
1678
1678
|
//#endregion
|
|
1679
1679
|
//#region src/protocol.d.ts
|
|
1680
1680
|
/** Agent role, the preset-loader key. */
|
|
1681
|
-
|
|
1681
|
+
declare const REZ_ROLE_IDS: readonly ["all", "boss", "engineer", "sales", "operations"];
|
|
1682
|
+
type RezRoleId = (typeof REZ_ROLE_IDS)[number];
|
|
1682
1683
|
/** Transport kinds the in-plugin MCP host can connect. */
|
|
1683
1684
|
type RezMcpTransport = 'stdio' | 'streamable-http';
|
|
1684
1685
|
/** One MCP server launch descriptor (standard MCP-style config). */
|
package/lib/index.js
CHANGED
|
@@ -2937,6 +2937,17 @@ function testComposedServers(input) {
|
|
|
2937
2937
|
}
|
|
2938
2938
|
//#endregion
|
|
2939
2939
|
//#region src/protocol.ts
|
|
2940
|
+
/** Agent role, the preset-loader key. */
|
|
2941
|
+
const REZ_ROLE_IDS = [
|
|
2942
|
+
"all",
|
|
2943
|
+
"boss",
|
|
2944
|
+
"engineer",
|
|
2945
|
+
"sales",
|
|
2946
|
+
"operations"
|
|
2947
|
+
];
|
|
2948
|
+
function isRezRoleId(value) {
|
|
2949
|
+
return typeof value === "string" && REZ_ROLE_IDS.includes(value);
|
|
2950
|
+
}
|
|
2940
2951
|
const REZ_API = {
|
|
2941
2952
|
config: "/api/dsh-rez-suite/config",
|
|
2942
2953
|
test: "/api/dsh-rez-suite/test",
|
|
@@ -3033,7 +3044,7 @@ function mergeConfig(base, override) {
|
|
|
3033
3044
|
const result = JSON.parse(JSON.stringify(base));
|
|
3034
3045
|
if (typeof value.enabled === "boolean") result.enabled = value.enabled;
|
|
3035
3046
|
if (typeof value.announceToAgent === "boolean") result.announceToAgent = value.announceToAgent;
|
|
3036
|
-
if (value.role
|
|
3047
|
+
if (isRezRoleId(value.role)) result.role = value.role;
|
|
3037
3048
|
result.connections = mergeConnections(value.connections ?? result.connections);
|
|
3038
3049
|
if (typeof value.servers === "object" && value.servers !== null) for (const [id, raw] of Object.entries(value.servers)) {
|
|
3039
3050
|
if (typeof raw !== "object" || raw === null) continue;
|
|
@@ -3145,7 +3156,7 @@ function applyPublicPatch(current, patch) {
|
|
|
3145
3156
|
const next = JSON.parse(JSON.stringify(current));
|
|
3146
3157
|
const secrets = [];
|
|
3147
3158
|
if (typeof patch.enabled === "boolean") next.enabled = patch.enabled;
|
|
3148
|
-
if (patch.role
|
|
3159
|
+
if (isRezRoleId(patch.role)) next.role = patch.role;
|
|
3149
3160
|
if (typeof patch.connections === "object" && patch.connections !== null) {
|
|
3150
3161
|
const incoming = patch.connections;
|
|
3151
3162
|
next.connections = mergeConnections({
|
|
@@ -7757,7 +7768,7 @@ function listFiles(root) {
|
|
|
7757
7768
|
//#region src/boss/mount.ts
|
|
7758
7769
|
const BOSS_GUIDANCE = [
|
|
7759
7770
|
"老板三室已播种并登记为侧栏工作区:~/.dsh/workspaces/搞钱、产品、运营。不必手动「添加工作区」。",
|
|
7760
|
-
"
|
|
7771
|
+
"设置 → 插件 → ReZ-TI → 角色选「老板」。每个文件夹是独立作战室,官方 dsh 会注入该目录 AGENTS.md。",
|
|
7761
7772
|
"若该室仍有 BOOTSTRAP.md:本会话先做短问三拍,沉淀到 PRIORITIES.md / MEMORY.md,然后删除 BOOTSTRAP.md。",
|
|
7762
7773
|
"已初始化后:读 PRIORITIES.md + MEMORY.md + 今日/昨日 memory/;回答固定四行:结论 → 数字(哪家公司、哪段时间)→ 拍板 1~3 件事 → 未执行任何过账/付款/对外发送。",
|
|
7763
7774
|
"微信文件夹仍是收件箱,不要在那边查账或砍 SKU。"
|
|
@@ -7766,21 +7777,14 @@ function destRoot(env = process.env) {
|
|
|
7766
7777
|
if (env.REZ_BOSS_WORKSPACES !== void 0 && env.REZ_BOSS_WORKSPACES !== "") return env.REZ_BOSS_WORKSPACES;
|
|
7767
7778
|
return join(env.DSH_HOME !== void 0 && env.DSH_HOME !== "" ? env.DSH_HOME : join(homedir(), ".dsh"), "workspaces");
|
|
7768
7779
|
}
|
|
7769
|
-
|
|
7770
|
-
try {
|
|
7771
|
-
return ctx.get("workspaceRegistry");
|
|
7772
|
-
} catch {
|
|
7773
|
-
return;
|
|
7774
|
-
}
|
|
7775
|
-
}
|
|
7776
|
-
/** Seed files and register official workspaces. Safe when registry is absent. */
|
|
7780
|
+
/** Seed files, then register official workspaces once workspaceRegistry is ready. */
|
|
7777
7781
|
function mountBossDesk(ctx) {
|
|
7778
7782
|
const seeded = seedBossWorkspaces({ destRoot: destRoot() });
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7783
|
+
ctx.inject(["workspaceRegistry"], (inner) => {
|
|
7784
|
+
registerBossWorkspaces(inner.get("workspaceRegistry"), seeded.rooms).catch((error) => {
|
|
7785
|
+
const why = error instanceof Error ? error.message : String(error);
|
|
7786
|
+
console.error("[dsh-rez-suite] workspaceRegistry.create failed:", why);
|
|
7787
|
+
});
|
|
7784
7788
|
});
|
|
7785
7789
|
}
|
|
7786
7790
|
//#endregion
|
|
@@ -7807,10 +7811,11 @@ const Config = Schema.object({
|
|
|
7807
7811
|
enabled: Schema.boolean().default(true),
|
|
7808
7812
|
announceToAgent: Schema.boolean().default(true),
|
|
7809
7813
|
role: Schema.union([
|
|
7814
|
+
"all",
|
|
7815
|
+
"boss",
|
|
7810
7816
|
"engineer",
|
|
7811
7817
|
"sales",
|
|
7812
|
-
"operations"
|
|
7813
|
-
"all"
|
|
7818
|
+
"operations"
|
|
7814
7819
|
]).default("all"),
|
|
7815
7820
|
servers: Schema.dict(serverSchema).default({}),
|
|
7816
7821
|
connections: Schema.object({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rezti/dsh-rez-suite",
|
|
3
3
|
"description": "ReZ-TI one-package install for DeepSeek Harness. Update with: dsh plugin --profile web update @rezti/dsh-rez-suite",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.18",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": "^22.19.0 || >=24.0.0"
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
40
40
|
"zod": "^4.4.3",
|
|
41
|
-
"@rezti/dsh-rez-
|
|
42
|
-
"@rezti/dsh-rez-odoo": "0.1.7",
|
|
41
|
+
"@rezti/dsh-rez-ha-bridge": "0.1.7",
|
|
43
42
|
"@rezti/dsh-rez-intent": "0.1.4",
|
|
44
|
-
"@rezti/dsh-rez-
|
|
43
|
+
"@rezti/dsh-rez-nextcloud": "0.1.7",
|
|
45
44
|
"@rezti/dsh-rez-token-manager": "0.1.4",
|
|
46
45
|
"@rezti/dsh-rez-wechat": "0.1.11",
|
|
47
|
-
"@rezti/dsh-rez-
|
|
46
|
+
"@rezti/dsh-rez-odoo": "0.1.7",
|
|
47
|
+
"@rezti/dsh-rez-sso": "0.1.7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": "^18.2.0",
|
package/src/boss/mount.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { seedBossWorkspaces } from './seed.ts'
|
|
|
6
6
|
|
|
7
7
|
export const BOSS_GUIDANCE = [
|
|
8
8
|
'老板三室已播种并登记为侧栏工作区:~/.dsh/workspaces/搞钱、产品、运营。不必手动「添加工作区」。',
|
|
9
|
-
'
|
|
9
|
+
'设置 → 插件 → ReZ-TI → 角色选「老板」。每个文件夹是独立作战室,官方 dsh 会注入该目录 AGENTS.md。',
|
|
10
10
|
'若该室仍有 BOOTSTRAP.md:本会话先做短问三拍,沉淀到 PRIORITIES.md / MEMORY.md,然后删除 BOOTSTRAP.md。',
|
|
11
11
|
'已初始化后:读 PRIORITIES.md + MEMORY.md + 今日/昨日 memory/;回答固定四行:结论 → 数字(哪家公司、哪段时间)→ 拍板 1~3 件事 → 未执行任何过账/付款/对外发送。',
|
|
12
12
|
'微信文件夹仍是收件箱,不要在那边查账或砍 SKU。',
|
|
@@ -18,21 +18,14 @@ function destRoot(env: NodeJS.ProcessEnv = process.env): string {
|
|
|
18
18
|
return join(home, 'workspaces')
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
return ctx.get('workspaceRegistry') as WorkspaceRegistrar
|
|
24
|
-
} catch {
|
|
25
|
-
return undefined
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Seed files and register official workspaces. Safe when registry is absent. */
|
|
21
|
+
/** Seed files, then register official workspaces once workspaceRegistry is ready. */
|
|
30
22
|
export function mountBossDesk(ctx: Context): void {
|
|
31
23
|
const seeded = seedBossWorkspaces({ destRoot: destRoot() })
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
ctx.inject(['workspaceRegistry'], (inner) => {
|
|
25
|
+
const registry = inner.get('workspaceRegistry') as WorkspaceRegistrar
|
|
26
|
+
void registerBossWorkspaces(registry, seeded.rooms).catch((error: unknown) => {
|
|
27
|
+
const why = error instanceof Error ? error.message : String(error)
|
|
28
|
+
console.error('[dsh-rez-suite] workspaceRegistry.create failed:', why)
|
|
29
|
+
})
|
|
37
30
|
})
|
|
38
31
|
}
|
package/src/client/index.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
20
20
|
}
|
|
21
21
|
interface SlotMap {
|
|
22
22
|
'settings.plugin.item': {
|
|
23
|
-
kind: '
|
|
23
|
+
kind: 'keyed'
|
|
24
24
|
scope: 'root'
|
|
25
25
|
owner: { children?: never }
|
|
26
26
|
}
|
|
@@ -42,8 +42,7 @@ export function apply(ctx: ClientContext): void {
|
|
|
42
42
|
|
|
43
43
|
ctx.slots.inject('settings.plugin.item', () => ctx.slots.register({
|
|
44
44
|
name: 'settings.plugin.item',
|
|
45
|
-
|
|
46
|
-
order: 40,
|
|
45
|
+
key: NS,
|
|
47
46
|
locale: NS,
|
|
48
47
|
}, RezPluginCard))
|
|
49
48
|
|
package/src/client/locales.ts
CHANGED
|
@@ -14,8 +14,9 @@ export const zh = {
|
|
|
14
14
|
'tab.audit': '用量',
|
|
15
15
|
// config
|
|
16
16
|
'config.role': '角色',
|
|
17
|
-
'config.roleHint': '
|
|
17
|
+
'config.roleHint': '选「老板」会在左侧出现搞钱 / 产品 / 运营三室;其他角色决定 MCP 工具',
|
|
18
18
|
'role.all': '全部',
|
|
19
|
+
'role.boss': '老板',
|
|
19
20
|
'role.engineer': '工程师',
|
|
20
21
|
'role.sales': '销售',
|
|
21
22
|
'role.operations': '运营',
|
|
@@ -118,8 +119,9 @@ export const en: Record<RezKey, string> = {
|
|
|
118
119
|
'tab.status': 'Status',
|
|
119
120
|
'tab.audit': 'Usage',
|
|
120
121
|
'config.role': 'Role',
|
|
121
|
-
'config.roleHint': '
|
|
122
|
+
'config.roleHint': 'Boss adds 搞钱 / 产品 / 运营 workspaces; other roles filter MCP tools',
|
|
122
123
|
'role.all': 'All',
|
|
124
|
+
'role.boss': 'Boss',
|
|
123
125
|
'role.engineer': 'Engineer',
|
|
124
126
|
'role.sales': 'Sales',
|
|
125
127
|
'role.operations': 'Operations',
|
|
@@ -11,6 +11,7 @@ import css from './panel.module.css'
|
|
|
11
11
|
|
|
12
12
|
const ROLES: Array<{ value: RezRoleId; label: string }> = [
|
|
13
13
|
{ value: 'all', label: 'role.all' },
|
|
14
|
+
{ value: 'boss', label: 'role.boss' },
|
|
14
15
|
{ value: 'engineer', label: 'role.engineer' },
|
|
15
16
|
{ value: 'sales', label: 'role.sales' },
|
|
16
17
|
{ value: 'operations', label: 'role.operations' },
|
package/src/index.ts
CHANGED
|
@@ -50,7 +50,7 @@ const serverSchema = z.object({
|
|
|
50
50
|
export const Config: z<RezConfig> = z.object({
|
|
51
51
|
enabled: z.boolean().default(true),
|
|
52
52
|
announceToAgent: z.boolean().default(true),
|
|
53
|
-
role: z.union(['
|
|
53
|
+
role: z.union(['all', 'boss', 'engineer', 'sales', 'operations'] as const).default('all'),
|
|
54
54
|
servers: z.dict(serverSchema).default({}),
|
|
55
55
|
connections: z.object({
|
|
56
56
|
odoo: z.object({
|
package/src/presets.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface RoleRule {
|
|
|
13
13
|
pattern: string
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const RULES: Record<Exclude<RezRoleId, 'all'>, RoleRule[]> = {
|
|
16
|
+
const RULES: Record<Exclude<RezRoleId, 'all' | 'boss'>, RoleRule[]> = {
|
|
17
17
|
engineer: [
|
|
18
18
|
// Odoo lookups and reads.
|
|
19
19
|
{ server: 'odoo', pattern: '*search*' },
|
|
@@ -111,7 +111,7 @@ function compilePattern(pattern: string): RegExp {
|
|
|
111
111
|
return new RegExp(source, 'i')
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
const COMPILED: Record<Exclude<RezRoleId, 'all'>, { server: RezServerId; test: RegExp }[]> = {
|
|
114
|
+
const COMPILED: Record<Exclude<RezRoleId, 'all' | 'boss'>, { server: RezServerId; test: RegExp }[]> = {
|
|
115
115
|
engineer: RULES.engineer.map(rule => ({ server: rule.server, test: compilePattern(rule.pattern) })),
|
|
116
116
|
sales: RULES.sales.map(rule => ({ server: rule.server, test: compilePattern(rule.pattern) })),
|
|
117
117
|
operations: RULES.operations.map(rule => ({ server: rule.server, test: compilePattern(rule.pattern) })),
|
|
@@ -119,7 +119,7 @@ const COMPILED: Record<Exclude<RezRoleId, 'all'>, { server: RezServerId; test: R
|
|
|
119
119
|
|
|
120
120
|
/** Whether one MCP tool may be registered for the selected role. */
|
|
121
121
|
export function isToolAllowed(role: RezRoleId, server: string, rawName: string): boolean {
|
|
122
|
-
if (role === 'all') return true
|
|
122
|
+
if (role === 'all' || role === 'boss') return true
|
|
123
123
|
const rules = COMPILED[role]
|
|
124
124
|
return rules.some(rule => rule.server === server && rule.test.test(rawName))
|
|
125
125
|
}
|
package/src/protocol.ts
CHANGED
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
export type RezServerId = string
|
|
9
9
|
|
|
10
10
|
/** Agent role, the preset-loader key. */
|
|
11
|
-
export
|
|
11
|
+
export const REZ_ROLE_IDS = ['all', 'boss', 'engineer', 'sales', 'operations'] as const
|
|
12
|
+
export type RezRoleId = (typeof REZ_ROLE_IDS)[number]
|
|
13
|
+
|
|
14
|
+
export function isRezRoleId(value: unknown): value is RezRoleId {
|
|
15
|
+
return typeof value === 'string' && (REZ_ROLE_IDS as readonly string[]).includes(value)
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
/** Transport kinds the in-plugin MCP host can connect. */
|
|
14
19
|
export type RezMcpTransport = 'stdio' | 'streamable-http'
|
package/src/routes.ts
CHANGED
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
writeManagedCredential,
|
|
14
14
|
type RezSystem,
|
|
15
15
|
} from '@rezti/dsh-rez-sso'
|
|
16
|
-
import type { RezConfig, RezMcpServerSpec
|
|
17
|
-
import { REZ_API } from './protocol.ts'
|
|
16
|
+
import type { RezConfig, RezMcpServerSpec } from './protocol.ts'
|
|
17
|
+
import { isRezRoleId, REZ_API } from './protocol.ts'
|
|
18
18
|
import type { McpHost } from './mcp-host.ts'
|
|
19
19
|
import type { TokenManager } from './token-manager.ts'
|
|
20
20
|
import { publicConfig } from './store.ts'
|
|
@@ -85,7 +85,7 @@ function applyPublicPatch(current: RezConfig, patch: Record<string, unknown>): {
|
|
|
85
85
|
const next: RezConfig = JSON.parse(JSON.stringify(current)) as RezConfig
|
|
86
86
|
const secrets: Array<{ system: RezSystem; value: string }> = []
|
|
87
87
|
if (typeof patch.enabled === 'boolean') next.enabled = patch.enabled
|
|
88
|
-
if (patch.role
|
|
88
|
+
if (isRezRoleId(patch.role)) next.role = patch.role
|
|
89
89
|
|
|
90
90
|
if (typeof patch.connections === 'object' && patch.connections !== null) {
|
|
91
91
|
const incoming = patch.connections as Record<string, unknown>
|
package/src/store.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
secretConfigured,
|
|
16
16
|
} from '@rezti/dsh-rez-sso'
|
|
17
17
|
import type { RezConfig, RezMcpServerSpec, RezPublicConfig } from './protocol.ts'
|
|
18
|
+
import { isRezRoleId } from './protocol.ts'
|
|
18
19
|
|
|
19
20
|
/** File format version. */
|
|
20
21
|
const FORMAT_VERSION = 1
|
|
@@ -128,7 +129,7 @@ export function mergeConfig(base: RezConfig, override: unknown): RezConfig {
|
|
|
128
129
|
const result: RezConfig = JSON.parse(JSON.stringify(base)) as RezConfig
|
|
129
130
|
if (typeof value.enabled === 'boolean') result.enabled = value.enabled
|
|
130
131
|
if (typeof value.announceToAgent === 'boolean') result.announceToAgent = value.announceToAgent
|
|
131
|
-
if (value.role
|
|
132
|
+
if (isRezRoleId(value.role)) result.role = value.role
|
|
132
133
|
|
|
133
134
|
result.connections = mergeConnections(value.connections ?? result.connections)
|
|
134
135
|
|