dsh-plugin-workspace-capabilities 1.3.4 → 1.3.5

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.en.md CHANGED
@@ -10,21 +10,13 @@ The interface uses DSH native i18n and follows language changes immediately. Chi
10
10
 
11
11
  ## One-command installation
12
12
 
13
- Compatible with DeepSeek Harness **0.2.1-rc.3 / 0.2.1-rc.5 / 0.2.2-rc.2** and Node.js **26**.
14
-
15
- Install with **npx** (Node.js 26; no global dsh or pnpm installation required):
16
-
17
- ```bash
18
- npx --yes --package=@deepseek-ai/dsh@0.2.2-rc.2 --package=pnpm@11.28.5 dsh plugin --profile web add dsh-plugin-workspace-capabilities@latest
19
- ```
20
-
21
- Run this on the DSH host with the same account and `DSH_HOME` as your existing instance. The command pins the verified official CLI and installs the latest plugin into the `web` profile. With the DSH CLI already installed, you can also use:
13
+ Requires Node.js 26 or newer. Supports DSH Web `0.2.1-rc.3`, `0.2.1-rc.5`, `0.2.2-rc.2`, and `0.2.3-alpha.2`.
22
14
 
23
15
  ```bash
24
- dsh plugin --profile web add dsh-plugin-workspace-capabilities
16
+ npx --yes --package=@deepseek-ai/dsh@0.2.3-alpha.2 --package=pnpm@11.28.5 dsh plugin --profile web add dsh-plugin-workspace-capabilities@1.3.5
25
17
  ```
26
18
 
27
- Enable the plugin in DSH's plugin manager, restart DSH, refresh the page, and open **Settings → Skills & MCP**.
19
+ Run on the DSH host with the same account and `DSH_HOME` as the existing instance. Replace `web` with your target profile.
28
20
 
29
21
  ## Agent preset compatibility
30
22
 
package/README.md CHANGED
@@ -10,21 +10,13 @@ DeepSeek Harness 的 Skill 与 MCP 管理插件。按全局或工作区设置可
10
10
 
11
11
  ## 一键安装
12
12
 
13
- 兼容 DeepSeek Harness **0.2.1-rc.3 / 0.2.1-rc.5 / 0.2.2-rc.2**,Node.js **26**。
14
-
15
- 通过 **npx** 安装(Node.js 26,无需全局安装 dsh 或 pnpm):
16
-
17
- ```bash
18
- npx --yes --package=@deepseek-ai/dsh@0.2.2-rc.2 --package=pnpm@11.28.5 dsh plugin --profile web add dsh-plugin-workspace-capabilities@latest
19
- ```
20
-
21
- 在运行 DSH 的主机上,用原实例相同的账户和 `DSH_HOME` 执行。命令固定本轮验证的官方 DSH CLI,插件安装最新版;`web` 是目标 profile。已安装 DSH CLI 时也可使用:
13
+ 需要 Node.js 26 或更新版本。支持 DSH Web `0.2.1-rc.3`、`0.2.1-rc.5`、`0.2.2-rc.2` 和 `0.2.3-alpha.2`。
22
14
 
23
15
  ```bash
24
- dsh plugin --profile web add dsh-plugin-workspace-capabilities
16
+ npx --yes --package=@deepseek-ai/dsh@0.2.3-alpha.2 --package=pnpm@11.28.5 dsh plugin --profile web add dsh-plugin-workspace-capabilities@1.3.5
25
17
  ```
26
18
 
27
- 在插件管理中启用插件,重启 DSH 并刷新页面,打开 **设置 → Skill 与 MCP**。
19
+ 在 DSH 主机上用原实例相同的账户和 `DSH_HOME` 执行。将 `web` 改为你的目标 profile。
28
20
 
29
21
  ## Agent 预设兼容性
30
22
 
package/client.js CHANGED
@@ -6,6 +6,7 @@ window.__ModuleLoader__.load({
6
6
  /* i18n:start */
7
7
  const NS="capabilityDesk";
8
8
  const zh={
9
+ "旧 Office 格式的权限不同。请选择统一的 Office 规则。": "旧 Office 格式的权限不同。请选择统一的 Office 规则。",
9
10
  "翻译任务队列已满,请稍后重试。": "翻译任务队列已满,请稍后重试。",
10
11
  "翻译任务已过期,请重试。": "翻译任务已过期,请重试。",
11
12
  "翻译任务:{p0} 项处理中 · {p1} 项排队 · 已完成 {p2}/{p3}": "翻译任务:{p0} 项处理中 · {p1} 项排队 · 已完成 {p2}/{p3}",
@@ -144,6 +145,7 @@ const zh={
144
145
  "策略文件无法读取,Skill 和 MCP 已暂停。请恢复 policy.json 备份后重启服务。": "策略文件无法读取,Skill 和 MCP 已暂停。请恢复 policy.json 备份后重启服务。"
145
146
  };
146
147
  const en={
148
+ "旧 Office 格式的权限不同。请选择统一的 Office 规则。": "The former Office formats have different permissions. Choose one rule for Office.",
147
149
  "翻译任务队列已满,请稍后重试。": "The translation queue is full. Try again later.",
148
150
  "翻译任务已过期,请重试。": "The translation task has expired. Retry.",
149
151
  "翻译任务:{p0} 项处理中 · {p1} 项排队 · 已完成 {p2}/{p3}": "Translation tasks: {p0} processing · {p1} queued · {p2}/{p3} done",
@@ -310,15 +312,19 @@ function installLocale(ctx) {
310
312
  .wc-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;min-width:0}.wc-row>.wc-grow{flex:1;min-width:0}
311
313
  .wc-scope-controls,.wc-language-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end}
312
314
  .wc-field,.wc-scope-field{display:flex;flex-direction:column;gap:6px;min-width:0}.wc-input{width:100%;min-width:0}.wc-language-input{height:36px}
313
- .wc-scope-menu{width:100%;min-width:0}.wc-scope-trigger{width:100%;min-width:0;justify-content:space-between;gap:8px;text-align:left}.wc-scope-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wc-scope-trigger>svg{flex:none}
315
+ .wc-scope-menu{width:100%;min-width:0}
316
+ .wc-page :is(.wc-scope-trigger,.wc-rule-trigger){width:100%;min-width:0;justify-content:space-between;gap:8px;text-align:left}
317
+ .wc-scope-name,.wc-rule-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
318
+ :is(.wc-scope-trigger,.wc-rule-trigger)>svg{flex:none}
314
319
  .wc-scope-option{display:flex;flex-direction:column;gap:3px;min-width:0;max-width:100%}.wc-scope-path{color:var(--dsw-alias-label-caption);font-size:11px;line-height:15px;font-weight:400;white-space:normal;overflow-wrap:anywhere}.wc-scope-option>span{white-space:normal;overflow-wrap:anywhere}
315
320
  .wc-card{border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);padding:13px;display:flex;flex-direction:column;gap:9px;min-width:0}
316
321
  .wc-name{font-size:14px;font-weight:600;overflow-wrap:anywhere;min-width:0;flex:1}.wc-badge{font-size:11px;border-radius:var(--dsw-radius-md);padding:2px 8px;background:var(--dsw-alias-interactive-bg-hover);white-space:nowrap}.wc-on,.wc-success{color:var(--dsw-alias-state-success-primary)}.wc-off{color:var(--dsw-alias-label-secondary)}
317
322
  .wc-error{color:var(--dsw-alias-state-error-primary);white-space:pre-wrap;overflow-wrap:anywhere}.wc-success,.wc-description{font-size:12px}.wc-description{overflow-wrap:anywhere}.wc-source{font-size:11px;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}
318
323
  .wc-translated{white-space:pre-wrap;overflow-wrap:anywhere}.wc-translated-title{font-size:13px;font-weight:500;color:var(--dsw-alias-label-secondary)}.wc-tools{display:flex;flex-direction:column;gap:10px}.wc-tool{display:flex;flex-direction:column;gap:7px;border-top:1px solid var(--dsw-alias-border-l2);padding-top:9px;min-width:0}.wc-progress{font-size:12px;color:var(--dsw-alias-state-business-primary);overflow-wrap:anywhere}
319
- .wc-item-footer{display:flex;align-items:center;gap:8px;min-width:0}.wc-item-path{flex:1;min-width:0;font-size:10px;line-height:14px;overflow-wrap:anywhere}.wc-translation-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex:none;min-width:0}.wc-translation-actions button{flex:none}.wc-translate-icon,.wc-clear-translation-icon{width:28px;padding:0}
324
+ .wc-item-footer{display:flex;align-items:center;gap:8px;min-width:0}.wc-item-path{flex:1;min-width:0;font-size:10px;line-height:14px;overflow-wrap:anywhere}.wc-translation-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex:none;min-width:0}.wc-translation-actions button{flex:none}
325
+ .wc-translation-actions :is(.wc-translate-icon,.wc-clear-translation-icon){width:28px;padding:0}
320
326
  .wc-workspace-add{display:flex;flex-direction:column;gap:6px;min-width:0}
321
- .wc-list{display:flex;flex-direction:column;gap:10px}.wc-rule{width:124px;flex:none;min-width:0}.wc-rule-trigger{width:100%;justify-content:space-between;gap:8px}.wc-rule-trigger>svg{flex:none}.wc-count{font-size:12px}.wc-page details summary{cursor:pointer}
327
+ .wc-list{display:flex;flex-direction:column;gap:10px}.wc-rule{width:124px;flex:none;min-width:0}.wc-count{font-size:12px}.wc-page details summary{cursor:pointer}
322
328
  .wc-toggle{display:flex;align-items:center;gap:8px;min-width:0}.wc-toggle>button{flex:none}.wc-toggle>span{min-width:0;overflow-wrap:anywhere}
323
329
  @container(max-width:420px){.wc-rule{width:100%}.wc-card{padding:11px}}
324
330
  .wc-page{container-type:inline-size}
@@ -368,7 +374,7 @@ function installLocale(ctx) {
368
374
  function RuleSelect({label,value,options,disabled,onChange}) {
369
375
  const [open,setOpen]=React.useState(false),anchorRef=React.useRef(null);
370
376
  React.useEffect(()=>{if(disabled)setOpen(false);},[disabled]);
371
- return h(AnchoredMenu,{anchorRef,open:open&&!disabled,items:options,selectedId:value,portal:true,minWidthFromAnchor:true,className:'wc-rule',onClose:()=>setOpen(false),onSelect:id=>{setOpen(false);onChange(id);},anchor:h(Button,{ref:anchorRef,variant:'outline',className:'wc-rule-trigger',disabled,'aria-label':label,'aria-haspopup':'menu','aria-expanded':open&&!disabled,onClick:()=>setOpen(current=>!current)},options.find(item=>item.id===value)?.label,h(IconChevronDownOutlineRegular,{size:14,'aria-hidden':true}))});
377
+ return h(AnchoredMenu,{anchorRef,open:open&&!disabled,items:options,selectedId:value,portal:true,minWidthFromAnchor:true,className:'wc-rule',onClose:()=>setOpen(false),onSelect:id=>{setOpen(false);onChange(id);},anchor:h(Button,{ref:anchorRef,variant:'outline',className:'wc-rule-trigger',disabled,'aria-label':label,'aria-haspopup':'menu','aria-expanded':open&&!disabled,onClick:()=>setOpen(current=>!current)},h('span',{className:'wc-rule-label'},options.find(item=>item.id===value)?.label),h(IconChevronDownOutlineRegular,{size:14,'aria-hidden':true}))});
372
378
  }
373
379
  function ScopeSelect({value,workspaces,disabled,onChange}) {
374
380
  const [open,setOpen]=React.useState(false),anchorRef=React.useRef(null);
@@ -526,6 +532,7 @@ function installLocale(ctx) {
526
532
  h('div', { className: 'wc-row' }, h('strong', { className: 'wc-name' }, item.name),
527
533
  h('span', { className: 'wc-badge ' + (item.enabled ? 'wc-on' : 'wc-off') }, item.enabled ? tr("可用") : isMcp && item.requested && !item.approved ? tr("待批准") : tr("已禁用")), select),
528
534
  description(item, (isMcp ? 'mcp:' : 'skill:') + key),
535
+ item.mixedOfficeRules && h('p', { className: 'wc-muted' }, tr("旧 Office 格式的权限不同。请选择统一的 Office 规则。")),
529
536
  isMcp && h(React.Fragment, null,
530
537
  item.workspace && h('p', { className: 'wc-source' }, tr("所属工作区:") + item.workspace),
531
538
  h('p', { className: 'wc-muted' }, item.transport + ' · ' + item.launch),
package/discovery.js CHANGED
@@ -54,7 +54,18 @@ export function normalizeMcp(name, raw, source, workspace = '', native = false)
54
54
  config = { transport: 'streamable-http', serverName: namespace, url: url.toString(), headers };
55
55
  } else throw new Error('未发现 command 或 url。');
56
56
  if (JSON.stringify(config).includes('${env:')) throw new Error('DSH 服务环境中缺少配置引用的环境变量。');
57
- config.toolCallTimeoutMs = 60000; config.failOnStartupError = true;
57
+ if (value.toolLoading !== undefined) {
58
+ if (!['eager','on-demand'].includes(value.toolLoading)) throw new Error('无效的 MCP 工具加载方式。');
59
+ config.toolLoading = value.toolLoading;
60
+ }
61
+ if (value.oauth !== undefined) {
62
+ if (!object(value.oauth) || config.transport !== 'streamable-http' || Object.keys(config.headers).some(key=>key.toLowerCase()==='authorization')) throw new Error('OAuth 仅适用于未设置 Authorization 的 HTTP 服务。');
63
+ // Imports receive their own credential address. Native entries retain the host-managed address.
64
+ config.oauth = {...value.oauth, credentialKey:native?value.oauth.credentialKey:'mcp-client/'+namespace};
65
+ }
66
+ config.toolCallTimeoutMs = value.toolCallTimeoutMs ?? 60000;
67
+ if (!Number.isSafeInteger(config.toolCallTimeoutMs) || config.toolCallTimeoutMs <= 0) throw new Error('无效的 MCP 工具超时。');
68
+ config.failOnStartupError = true;
58
69
  config.reconnect = { enabled: true, initialDelayMs: 1000, maxDelayMs: 30000, maxAttempts: 10 };
59
70
  } catch (error) { problem = error.message; }
60
71
  // Raw credentials never leave the backend; approval also invalidates on credential rotation.
package/http-api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { stat } from 'node:fs/promises';
3
- import { canonical, allowed, PolicyError } from './policy.js';
3
+ import { canonical, allowed, inheritedOfficeRule, PolicyError } from './policy.js';
4
4
  import { publicMcp } from './discovery.js';
5
5
  import { translationTargets } from './translations.js';
6
6
 
@@ -22,6 +22,7 @@ export function createApi(ctx, store, discovery, runtime, { syncSources, transla
22
22
  const observation = await runtime.originalSnapshot(workspace ? { cwd: workspace } : {});
23
23
  const rules = workspace ? state.workspaces[workspace] ?? { skills: {}, mcp: {} } : state.global;
24
24
  const skills = observation.skills.map(item => ({ name: item.name, description: item.description, source: item.source,
25
+ ...(item.name === 'office' && inheritedOfficeRule(state, workspace)?.mixed ? { mixedOfficeRules: true } : {}),
25
26
  path: item.path ?? '', provider: item.provider, rule: rules.skills[item.name] ?? null,
26
27
  global: allowed(state, 'skills', item.name), enabled: allowed(state, 'skills', item.name, workspace), invocation: item.invocation }));
27
28
  const mcp = [...discovery.rows.values()].filter(row => !row.external || state.discovery.includeExternal).map(row => ({ ...publicMcp(row), rule: rules.mcp[row.id] ?? null,
@@ -126,8 +127,9 @@ export function createApi(ctx, store, discovery, runtime, { syncSources, transla
126
127
  const task = tasks.get(id); if (task) { task.controller.abort(); tasks.delete(id); }
127
128
  return { cancelled: true };
128
129
  }
129
- async function handler(request, response) {
130
- const rejection = ctx.connection.requestRejection(request);
130
+ async function handler(request, response, peer) {
131
+ const rejection = peer ? (peer.principal?.kind === 'owner' ? undefined : 403)
132
+ : typeof ctx.connection.requestRejection === 'function' ? ctx.connection.requestRejection(request) : 401;
131
133
  if (rejection !== undefined) return send(response, rejection, { error: '请使用受信任的 Harness 页面访问设置。' });
132
134
  const controller = new AbortController();
133
135
  const abort = () => { if (!response.writableEnded) controller.abort(); };
package/index.js CHANGED
@@ -52,7 +52,7 @@ export async function apply(ctx, config) {
52
52
  ctx.inject(['settings'], child => child.settings.configure({ auto: false }, ctx.fiber));
53
53
  ctx.inject(['webServer', 'connection'], child => {
54
54
  const api = createApi(child, store, discovery, runtime, { syncSources, translations });
55
- child.effect(() => child.webServer.register({ kind: 'prefix', path: BASE, handler: api.handler }), 'capabilities: authenticated settings API');
55
+ child.effect(() => child.webServer.register({ kind: 'prefix', path: BASE, auth: 'required', handler: api.handler }), 'capabilities: authenticated settings API');
56
56
  });
57
57
  let scanning = false;
58
58
  const timer = setInterval(async () => {
package/locales.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export const zh = {
2
+ "旧 Office 格式的权限不同。请选择统一的 Office 规则。": "旧 Office 格式的权限不同。请选择统一的 Office 规则。",
2
3
  "翻译任务队列已满,请稍后重试。": "翻译任务队列已满,请稍后重试。",
3
4
  "翻译任务已过期,请重试。": "翻译任务已过期,请重试。",
4
5
  "翻译任务:{p0} 项处理中 · {p1} 项排队 · 已完成 {p2}/{p3}": "翻译任务:{p0} 项处理中 · {p1} 项排队 · 已完成 {p2}/{p3}",
@@ -138,6 +139,7 @@ export const zh = {
138
139
  "策略文件无法读取,Skill 和 MCP 已暂停。请恢复 policy.json 备份后重启服务。": "策略文件无法读取,Skill 和 MCP 已暂停。请恢复 policy.json 备份后重启服务。"
139
140
  };
140
141
  export const en = {
142
+ "旧 Office 格式的权限不同。请选择统一的 Office 规则。": "The former Office formats have different permissions. Choose one rule for Office.",
141
143
  "翻译任务队列已满,请稍后重试。": "The translation queue is full. Try again later.",
142
144
  "翻译任务已过期,请重试。": "The translation task has expired. Retry.",
143
145
  "翻译任务:{p0} 项处理中 · {p1} 项排队 · 已完成 {p2}/{p3}": "Translation tasks: {p0} processing · {p1} queued · {p2}/{p3} done",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-workspace-capabilities",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "DSH Capability Desk: workspace Skill/MCP controls and model-powered translations for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "exports": {
@@ -31,13 +31,13 @@
31
31
  "yaml": "^2.8.1"
32
32
  },
33
33
  "peerDependencies": {
34
- "@deepseek-ai/cordis": "4.0.5 || 4.1.0",
35
- "@deepseek-ai/schemastery": "3.18.5 || 3.19.0",
36
- "@deepseek-ai/dsh-skill": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2",
37
- "@deepseek-ai/dsh-skill-filesystem": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2",
38
- "@deepseek-ai/dsh-scope": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2",
39
- "@deepseek-ai/dsh-mcp-client": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2",
40
- "@deepseek-ai/dsh-tools": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2"
34
+ "@deepseek-ai/cordis": "4.0.5 || 4.1.0 || 4.2.0-alpha.1",
35
+ "@deepseek-ai/schemastery": "3.18.5 || 3.19.0 || 3.20.0-alpha.1",
36
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2 || 0.2.3-alpha.2",
37
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2 || 0.2.3-alpha.2",
38
+ "@deepseek-ai/dsh-scope": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2 || 0.2.3-alpha.2",
39
+ "@deepseek-ai/dsh-mcp-client": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2 || 0.2.3-alpha.2",
40
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.2 || 0.2.3-alpha.2"
41
41
  },
42
42
  "dsh": {
43
43
  "bundle": {
@@ -84,16 +84,16 @@
84
84
  },
85
85
  "packageManager": "npm@11.20.0",
86
86
  "devDependencies": {
87
- "@deepseek-ai/cordis": "4.1.0",
88
- "@deepseek-ai/schemastery": "3.19.0",
89
- "@deepseek-ai/dsh-skill": "0.2.2-rc.2",
90
- "@deepseek-ai/dsh-skill-filesystem": "0.2.2-rc.2",
91
- "@deepseek-ai/dsh-scope": "0.2.2-rc.2",
92
- "@deepseek-ai/dsh-mcp-client": "0.2.2-rc.2",
93
- "@deepseek-ai/dsh-tools": "0.2.2-rc.2",
94
- "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.2",
95
- "@deepseek-ai/dsh-mcp-resources": "0.2.2-rc.2",
87
+ "@deepseek-ai/cordis": "4.2.0-alpha.1",
88
+ "@deepseek-ai/schemastery": "3.20.0-alpha.1",
89
+ "@deepseek-ai/dsh-skill": "0.2.3-alpha.2",
90
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.3-alpha.2",
91
+ "@deepseek-ai/dsh-scope": "0.2.3-alpha.2",
92
+ "@deepseek-ai/dsh-mcp-client": "0.2.3-alpha.2",
93
+ "@deepseek-ai/dsh-tools": "0.2.3-alpha.2",
94
+ "@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.2",
95
+ "@deepseek-ai/dsh-mcp-resources": "0.2.3-alpha.2",
96
96
  "playwright": "1.64.1",
97
- "@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.2"
97
+ "@deepseek-ai/dsh-tool-executor-native": "0.2.3-alpha.2"
98
98
  }
99
99
  }
package/policy.js CHANGED
@@ -21,11 +21,25 @@ export function workspaceOf(scope, cwd) {
21
21
  export function emptyPolicy() {
22
22
  return { version: 1, revision: 0, discovery: { includeExternal: false }, defaults: { skills: false, mcp: false }, global: { skills: {}, mcp: {} }, workspaces: {}, approvals: {} };
23
23
  }
24
+ const officeFormats = ['office-docx', 'office-pptx', 'office-xlsx'];
25
+ export function inheritedOfficeRule(state, workspace) {
26
+ const local = state.workspaces[canonical(workspace)]?.skills ?? {};
27
+ const global = state.global.skills;
28
+ if (Object.hasOwn(local, 'office')) return;
29
+ const hasLocal = officeFormats.some(name => Object.hasOwn(local, name));
30
+ if (!hasLocal && (Object.hasOwn(global, 'office') || !officeFormats.some(name => Object.hasOwn(global, name)))) return;
31
+ const values = officeFormats.map(name => local[name] ?? global.office ?? global[name] ?? state.defaults.skills);
32
+ return { enabled: values.every(Boolean), mixed: new Set(values).size > 1 };
33
+ }
24
34
  export function allowed(state, kind, key, workspace = '', sourceWorkspace = '') {
25
35
  if (!state || state.blocked) return false;
26
36
  if (sourceWorkspace && canonical(sourceWorkspace) !== canonical(workspace)) return false;
27
37
  const rules = state.workspaces[canonical(workspace)]?.[kind];
28
38
  if (rules && Object.hasOwn(rules, key)) return rules[key];
39
+ if (kind === 'skills' && key === 'office') {
40
+ const inherited = inheritedOfficeRule(state, workspace);
41
+ if (inherited) return inherited.enabled;
42
+ }
29
43
  if (Object.hasOwn(state.global[kind], key)) return state.global[kind][key];
30
44
  return state.defaults[kind];
31
45
  }
package/runtime.js CHANGED
@@ -100,8 +100,8 @@ export function createRuntime(ctx, store, discovery) {
100
100
  })} : {}),
101
101
  sections: result.sections.flatMap(section => {
102
102
  if (section.name.startsWith('mcp:')) {
103
- const name = section.name.slice(4);
104
- return allowedRows.some(row => row.namespace === name) ? [section] : [];
103
+ return allowedRows.some(({ namespace }) => section.name === 'mcp:' + namespace ||
104
+ section.name === 'mcp:' + namespace + ':tools') ? [section] : [];
105
105
  }
106
106
  if (section.name === 'mcp-resource-servers') return allowedRows.length ? [{ ...section,
107
107
  text: 'Available MCP resource servers for this workspace: ' + JSON.stringify([...new Set(allowedRows.map(row => row.namespace))]) + '. Use these names as the server argument for MCP resource tools.' }] : [];