Register KB pack skills from operator-subset _skills (P2).

Load hasSkills packs onto preset/public planes with groupKb toggles; unify content has* keys and keep netx-ops pure.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-13 11:46:31 +08:00
parent fcdd11ac59
commit 2caa3c98d7
26 changed files with 1122 additions and 106 deletions

View file

@ -569,10 +569,11 @@ var posix = ((p) => (p.posix = p, p))({ resolve, normalize, isAbsolute, join, re
// src/netx/kb-manifest.ts
var EMPTY_CONTENT = {
regions: false,
theory: false,
packet: false,
skills: false
hasRegions: false,
hasTheory: false,
hasPacket: false,
hasCommon: false,
hasSkills: false
};
function unconfiguredKbSnapshot() {
return {
@ -1410,6 +1411,20 @@ function NetxopsCard(props) {
children: state.kbStatus.realRoot
}) : null
]
}),
/* @__PURE__ */ jsx_runtime.jsx(CapabilityGroupBlock, {
title: t("groupKb"),
inPresetLabel: t("groupInPreset"),
publicLabel: t("groupPublic"),
inPreset: state.groupKbInPreset,
published: state.groupKbPublic,
disabled,
onEditInPreset: (checked) => {
props.edit("groupKbInPreset", checked ? "true" : "false");
},
onEditPublic: (checked) => {
props.edit("groupKbPublic", checked ? "true" : "false");
}
})
]
}),
@ -1841,6 +1856,8 @@ class NetxopsCardController {
booleanField("groupOpsPublic"),
booleanField("groupTopologyInPreset"),
booleanField("groupTopologyPublic"),
booleanFieldPersistFalse("groupKbInPreset"),
booleanField("groupKbPublic"),
booleanField("alarmPushEnabled"),
booleanFieldPersistFalse("alarmDeliverDsh"),
booleanField("alarmDeliverIm"),
@ -2106,6 +2123,8 @@ class NetxopsCardController {
groupOpsPublic: this.form.field("groupOpsPublic"),
groupTopologyInPreset: this.form.field("groupTopologyInPreset"),
groupTopologyPublic: this.form.field("groupTopologyPublic"),
groupKbInPreset: this.form.field("groupKbInPreset"),
groupKbPublic: this.form.field("groupKbPublic"),
alarmPushEnabled: this.form.field("alarmPushEnabled"),
alarmDeliverDsh: this.form.field("alarmDeliverDsh"),
alarmDeliverIm: this.form.field("alarmDeliverIm"),
@ -2259,10 +2278,11 @@ var en = {
nmsProviderHint: "zte-ume",
groupOps: "ops",
groupTopology: "topology",
groupKb: "Knowledge skills",
groupInPreset: "In Netx Ops preset",
groupPublic: "Publish to other presets",
kbRoot: "Package root",
kbRootHint: "Folder with MANIFEST.json (operator-subset v1.0). Browse auto-saves.",
kbRootHint: "Folder with MANIFEST.json (operator-subset v1.0). Browse auto-saves. Pack skills load from _skills/ when hasSkills.",
kbBrowse: "Browse…",
kbBrowseUnavailable: "Directory picker unavailable — paste an absolute folder path, then Save.",
kbBrowseFailed: "Browse failed: {detail}",
@ -2331,10 +2351,11 @@ var zh = {
nmsProviderHint: "zte-ume",
groupOps: "ops",
groupTopology: "topology",
groupKb: "知识库技能",
groupInPreset: "在 Netx Ops 预设中启用",
groupPublic: "对其他预设公开",
kbRoot: "知识包根目录",
kbRootHint: "含 MANIFEST.json 的运营商子集包(v1.0)。浏览选目录后会自动保存。",
kbRootHint: "含 MANIFEST.json 的运营商子集包(v1.0)。浏览选目录后会自动保存;hasSkills 时加载 _skills/。",
kbBrowse: "浏览…",
kbBrowseUnavailable: "目录选择器不可用 — 请粘贴绝对目录路径后点保存。",
kbBrowseFailed: "浏览失败:{detail}",