diff --git a/sansheng/client.js b/sansheng/client.js new file mode 100644 index 0000000..1422ea6 --- /dev/null +++ b/sansheng/client.js @@ -0,0 +1,1355 @@ +// Generated from src/client by `npm run build` (scripts/build-client.mjs). Do not edit by hand. +window.__ModuleLoader__.load({ + id: 'sansheng', + factory: (require) => { +const module = { exports: {} } +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/client/index.js +var index_exports = {}; +__export(index_exports, { + apply: () => apply, + inject: () => inject +}); +module.exports = __toCommonJS(index_exports); + +// src/shared/roles.js +var SEAT_IDS = Object.freeze([ + "lead", + "zhongshu", + "shangshu", + "menxia", + "libu", + "hubu", + "lipu", + "bingbu", + "xingbu", + "gongbu" +]); +var SEATS = Object.freeze({ + lead: { + id: "lead", + label: "丞相", + duty: "接需求 · 协调汇报", + responsibility: "面向用户承接想法:判断是否需要开工、必要时派给具体部门,并把各部门结果汇总成对用户的一次交付。" + }, + zhongshu: { + id: "zhongshu", + label: "中书", + duty: "调查 · 澄清 · 规划", + responsibility: "先把问题问清、把材料看全,再给出可执行的方案与验收标准草案,不直接产出最终交付物。" + }, + shangshu: { + id: "shangshu", + label: "尚书", + duty: "分工 · 组织交付", + responsibility: "把已经明确的方案拆成部门分工并组织交付;六部直属于尚书这一同级分组,六部之间不是上下级。" + }, + menxia: { + id: "menxia", + label: "门下", + duty: "审议 · 整体审核", + responsibility: "对方案和交付做独立审议,指出风险与不达标处。首版没有门下审核的任务必须如实标注“未审核”。" + }, + libu: { + id: "libu", + label: "吏部", + duty: "角色 · 技能配置", + responsibility: "对角色、技能与编制给出建议;职责不含绕过用户授权去改权限或其他项目设置。" + }, + hubu: { + id: "hubu", + label: "户部", + duty: "数据 · 表格计算", + responsibility: "处理数据、表格与计算,结论应可复算。" + }, + lipu: { + id: "lipu", + label: "礼部", + duty: "文档 · 内容呈现", + responsibility: "负责文档、内容与呈现形式,产出可编辑的源文件。" + }, + bingbu: { + id: "bingbu", + label: "兵部", + duty: "环境 · 调试部署", + responsibility: "负责环境、调试与部署;部署/发布等外部副作用仍服从用户授权与宿主审批。" + }, + xingbu: { + id: "xingbu", + label: "刑部", + duty: "测试 · 风险检查", + responsibility: "做测试与风险检查,给出可追溯的检查结果,而不是一句“已通过”。" + }, + gongbu: { + id: "gongbu", + label: "工部", + duty: "代码 · 工程产出", + responsibility: "负责代码实现与工程产出,交付可编辑源文件与真实检查结果。" + } +}); +var SEAT_GROUPS = Object.freeze({ + lead: Object.freeze(["lead"]), + sansheng: Object.freeze(["zhongshu", "shangshu", "menxia"]), + liubu: Object.freeze(["libu", "hubu", "lipu", "bingbu", "xingbu", "gongbu"]) +}); +function isSeatId(id) { + return SEAT_IDS.includes(id); +} +function seatOf(id) { + return SEATS[id]; +} +function seatLabel(id) { + return SEATS[id]?.label ?? ""; +} +function seatBySessionId(projects, sessionId) { + if (!sessionId || !projects) return void 0; + for (const project of Object.values(projects)) { + for (const seatId of SEAT_IDS) { + if (project?.seats?.[seatId]?.sessionId === sessionId) { + return { project, seatId, seat: SEATS[seatId] }; + } + } + } + return void 0; +} + +// src/client/workbench.js +var UNCHOSEN_MODEL_LABEL = "请选择模型"; +var SEAT_STATUS_LABELS = Object.freeze({ + pending: "待启用", + creating: "创建中", + bound: "已绑定", + failed: "创建失败", + missing: "会话缺失" +}); +var DEFAULT_SEAT_STATUS = "pending"; +function seatStatusLabel(status) { + if (typeof status !== "string") return "未知状态"; + return SEAT_STATUS_LABELS[status] ?? "未知状态"; +} +function projectStatusLabel(status) { + switch (status) { + case "pending": + return "待启用"; + case "provisioning": + return "启用中"; + case "ready": + return "已启用"; + case "error": + return "启用失败"; + default: + return "未知状态"; + } +} +function collectModelOptions(models) { + const out = []; + const seen = /* @__PURE__ */ new Set(); + const providers = Array.isArray(models?.providers) ? models.providers : []; + for (const entry of providers) { + const provider = typeof entry?.provider === "string" ? entry.provider : ""; + if (!provider) continue; + const list = Array.isArray(entry?.models) ? entry.models : []; + for (const item of list) { + const model = typeof item?.model === "string" ? item.model : ""; + if (!model) continue; + const efforts = Array.isArray(item?.reasoningEffort) ? item.reasoningEffort.filter((e) => typeof e === "string" && e.trim() !== "") : []; + if (efforts.length > 0) { + for (const effort of efforts) { + const value = provider + "::" + model + "::" + effort; + if (value === "inherit" || seen.has(value)) continue; + seen.add(value); + out.push({ value, label: model + " · " + effort, provider, model, reasoningEffort: effort }); + } + } else { + const value = provider + "::" + model; + if (value === "inherit" || seen.has(value)) continue; + seen.add(value); + out.push({ value, label: model, provider, model }); + } + } + } + return out; +} +function findModelOption(options, modelValue2) { + if (!Array.isArray(options)) return void 0; + return options.find((option) => option.value === modelValue2); +} +function describeModel(model, options) { + if (!model || typeof model !== "object" || typeof model.provider !== "string" || typeof model.model !== "string") { + return { modelValue: "", modelLabel: UNCHOSEN_MODEL_LABEL }; + } + const effort = typeof model.reasoningEffort === "string" && model.reasoningEffort ? model.reasoningEffort : void 0; + const match = (Array.isArray(options) ? options : []).find((option) => option.provider === model.provider && option.model === model.model && (option.reasoningEffort ?? void 0) === effort); + if (match) return { modelValue: match.value, modelLabel: match.label }; + const modelLabel = effort ? model.model + " · " + effort : model.model; + const modelValue2 = effort ? model.provider + "::" + model.model + "::" + effort : model.provider + "::" + model.model; + return { modelValue: modelValue2, modelLabel }; +} +function normalizeSeats(seats) { + const map = {}; + if (Array.isArray(seats)) { + for (const seat of seats) { + if (seat && typeof seat === "object" && typeof seat.id === "string") map[seat.id] = seat; + } + } else if (seats && typeof seats === "object") { + for (const [id, seat] of Object.entries(seats)) { + if (seat && typeof seat === "object") map[id] = { id, ...seat }; + } + } + return map; +} +function cloneGroups() { + const out = {}; + for (const key of Object.keys(SEAT_GROUPS)) out[key] = Array.from(SEAT_GROUPS[key]); + return out; +} +function pickSelectedId(requested) { + if (typeof requested === "string" && SEAT_IDS.includes(requested)) return requested; + return SEAT_IDS[0]; +} +function hasOwn(obj, key) { + return obj !== null && obj !== void 0 && Object.prototype.hasOwnProperty.call(obj, key); +} +function draftOf(draft, seatId) { + if (!draft || typeof draft !== "object") return {}; + const entry = draft[seatId]; + return entry && typeof entry === "object" ? entry : {}; +} +function updateDraft(draft, seatId, patch) { + const base = draft && typeof draft === "object" ? draft : {}; + const previous = base[seatId] && typeof base[seatId] === "object" ? base[seatId] : {}; + return { ...base, [seatId]: { ...previous, ...patch ?? {} } }; +} +function clearDraft(draft, seatId) { + if (!draft || typeof draft !== "object" || !hasOwn(draft, seatId)) return draft ?? {}; + const next = { ...draft }; + delete next[seatId]; + return next; +} +function buildWorkbenchView(view, ui) { + const safeView = view && typeof view === "object" ? view : {}; + const project = safeView.project && typeof safeView.project === "object" ? safeView.project : {}; + const status = typeof project.status === "string" ? project.status : "pending"; + const ready = status === "ready"; + const seatMap = normalizeSeats(project.seats); + const selectedSeatId = pickSelectedId(ui?.selectedSeatId); + const models = ui?.models ?? null; + const modelOptions = collectModelOptions(models); + const draft = ui?.draft ?? null; + const seats = SEAT_IDS.map((id) => { + const def = SEATS[id]; + const rec = seatMap[id] ?? {}; + const seatStatus = typeof rec.status === "string" ? rec.status : DEFAULT_SEAT_STATUS; + return { + id, + name: def.label, + duty: def.duty, + status: seatStatus, + statusLabel: seatStatusLabel(seatStatus), + selected: id === selectedSeatId + }; + }); + const seatDef = SEATS[selectedSeatId]; + const seatRec = seatMap[selectedSeatId] ?? {}; + const draftEntry = draftOf(draft, selectedSeatId); + let described; + if (hasOwn(draftEntry, "modelValue")) { + const raw = draftEntry.modelValue; + if (raw === "" || raw === null || raw === void 0) { + described = { modelValue: "", modelLabel: UNCHOSEN_MODEL_LABEL }; + } else { + const match = findModelOption(modelOptions, raw); + described = match ? { modelValue: match.value, modelLabel: match.label } : { modelValue: String(raw), modelLabel: String(raw) }; + } + } else if (hasOwn(draftEntry, "model")) { + described = describeModel(draftEntry.model, modelOptions); + } else { + described = describeModel(seatRec.model ?? null, modelOptions); + } + const instructions = hasOwn(draftEntry, "instructions") ? draftEntry.instructions : typeof seatRec.instructions === "string" ? seatRec.instructions : ""; + const selectedStatus = typeof seatRec.status === "string" ? seatRec.status : DEFAULT_SEAT_STATUS; + let boundCount = 0; + let sessionCount = 0; + for (const id of SEAT_IDS) { + const rec = seatMap[id]; + if (rec?.status === "bound") boundCount += 1; + if (rec?.sessionId) sessionCount += 1; + } + return { + projectTitle: typeof project.name === "string" ? project.name : "", + ready, + project: { + id: project.id ?? "", + name: typeof project.name === "string" ? project.name : "", + status, + statusLabel: projectStatusLabel(status), + workspaceId: project.workspaceId ?? null, + path: project.path ?? null, + seatCount: seats.length, + boundCount, + sessionCount + }, + seats, + groups: cloneGroups(), + selected: { + id: selectedSeatId, + name: seatDef.label, + duty: seatDef.duty, + responsibility: seatDef.responsibility, + status: selectedStatus, + statusLabel: seatStatusLabel(selectedStatus), + sessionId: seatRec.sessionId ?? null, + modelValue: described.modelValue, + modelLabel: described.modelLabel, + instructions, + modelOptions, + dirty: Object.keys(draftEntry).length > 0 + } + }; +} + +// src/client/transport.js +var ROUTE = "api/sansheng"; +var SanshengRequestError = class extends Error { + constructor(message, code) { + super(message); + this.name = "SanshengRequestError"; + this.code = code || "sansheng/error"; + } +}; +async function request(endpoint, payload, signal) { + let response; + try { + response = await fetch(ROUTE, { + method: "POST", + credentials: "same-origin", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ endpoint, payload: payload ?? null }), + signal + }); + } catch (error) { + if (error && error.name === "AbortError") throw error; + const detail = error && error.message ? error.message : String(error); + throw new SanshengRequestError("无法连接 DSH,请确认它仍在运行(" + detail + ")", "NETWORK"); + } + if (!response.ok) { + throw new SanshengRequestError("HTTP " + response.status, "HTTP_" + response.status); + } + let result; + try { + result = await response.json(); + } catch (error) { + throw new SanshengRequestError("响应不是合法 JSON", "sansheng/bad-response"); + } + if (!result || result.ok !== true) { + const code = result && result.error && result.error.code ? result.error.code : "sansheng/error"; + const message = result && result.error && result.error.message ? result.error.message : "请求失败"; + throw new SanshengRequestError(message, code); + } + return result.value; +} +var transport_default = request; + +// src/client/styles.js +var CSS = ` +.ssw-scope{--ssw-bg:#ffffff;--ssw-side:#f8f9fa;--ssw-rail:#f7f9fc;--ssw-card:#ffffff;--ssw-line:#e3e8ef;--ssw-strong:#c7d8f5;--ssw-ink:#0f172a;--ssw-muted:#667085;--ssw-faint:#98a2b3;--ssw-blue:#3b82f6;--ssw-wash:#eff6ff;--ssw-wire:#c9d6ea;--ssw-danger:#dc2626;--ssw-ok:#16a34a;box-sizing:border-box;color:var(--ssw-ink);font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;font-size:13px;line-height:1.5} +.ssw-scope *,.ssw-scope *::before,.ssw-scope *::after{box-sizing:border-box} +.ssw-scope button{font:inherit;color:inherit;background:transparent;border:0;cursor:pointer} +.ssw-scope button:disabled{cursor:default;opacity:.55} +.ssw-scope :focus-visible{outline:2px solid var(--ssw-blue);outline-offset:2px} +body[data-ds-dark-theme] .ssw-scope,html[data-theme=dark] .ssw-scope,.ssw-scope[data-ssw-theme=dark]{--ssw-bg:#14171c;--ssw-side:#171b21;--ssw-rail:#161a20;--ssw-card:#1e232b;--ssw-line:#2c333d;--ssw-strong:#3b4a63;--ssw-ink:#e6ebf2;--ssw-muted:#a9b4c2;--ssw-faint:#7b8797;--ssw-blue:#6ea8ff;--ssw-wash:#1d2b40;--ssw-wire:#3a4350;--ssw-danger:#f87171;--ssw-ok:#4ade80} +.ssw-float{position:fixed;right:14px;bottom:70px;z-index:2147483000;width:min(374px,calc(100vw - 28px));max-height:calc(100vh - 96px);display:flex;flex-direction:column;background:#ffffff;border:1px solid #e3e8ef;border-radius:12px;box-shadow:0 18px 50px -12px rgba(16,24,40,.28),0 4px 12px -2px rgba(16,24,40,.12);overflow:hidden} +body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:#161a20;border-color:#2c333d} +.ssw-root{display:flex;flex-direction:column;min-height:0;height:100%;overflow:auto;background:var(--ssw-rail);color:var(--ssw-ink)} +.ssw-head{flex:none;height:52px;display:flex;align-items:center;gap:8px;padding:0 16px;border-bottom:1px solid var(--ssw-line);background:var(--ssw-card)} +.ssw-head svg{width:18px;height:18px;color:var(--ssw-muted)} +.ssw-head-title{font-size:13px;font-weight:600} +.ssw-icon-btn{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:6px;color:var(--ssw-muted)} +.ssw-icon-btn:hover{background:var(--ssw-wash);color:var(--ssw-blue)} +.ssw-project{padding:18px 16px 0} +.ssw-project-line{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px} +.ssw-eyebrow{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--ssw-muted)} +.ssw-eyebrow svg{width:14px;height:14px} +.ssw-count{font-size:10px;color:var(--ssw-faint)} +.ssw-project-title{font-size:17px;font-weight:600;letter-spacing:.3px;margin:0 0 14px} +.ssw-enable{margin:0 16px 4px;padding:12px;border:1px solid var(--ssw-strong);background:var(--ssw-wash);border-radius:10px} +.ssw-enable-note{margin:0 0 10px;font-size:12px;color:var(--ssw-muted);line-height:1.7} +.ssw-primary{background:var(--ssw-blue);color:#ffffff;border-radius:7px;padding:8px 13px;font-size:12px;font-weight:500} +.ssw-primary:hover{filter:brightness(1.05)} +.ssw-tree{padding:14px 16px 4px;position:relative} +.ssw-lead{width:150px;margin:0 auto;position:relative} +.ssw-lead::after{content:"";position:absolute;left:50%;top:100%;height:20px;border-left:1px solid var(--ssw-wire)} +.ssw-trio{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:34px;position:relative} +.ssw-trio::before{content:"";position:absolute;left:16.66%;right:16.66%;top:-15px;border-top:1px solid var(--ssw-wire)} +.ssw-trio .ssw-seat::before{content:"";position:absolute;left:50%;bottom:100%;height:15px;border-left:1px solid var(--ssw-wire)} +.ssw-seat{position:relative;width:100%;display:flex;flex-direction:column;gap:6px;padding:10px 9px 8px;border:1px solid var(--ssw-line);border-radius:10px;background:var(--ssw-card);text-align:left;min-height:70px;box-shadow:0 1px 2px rgba(16,24,40,.04);transition:border-color .15s,box-shadow .15s,transform .15s} +.ssw-seat:hover{border-color:var(--ssw-strong);transform:translateY(-1px);box-shadow:0 3px 8px rgba(16,24,40,.06)} +.ssw-seat[aria-pressed=true]{border-color:var(--ssw-blue);background:var(--ssw-wash);box-shadow:0 0 0 2px rgba(59,130,246,.12)} +.ssw-lead .ssw-seat{border-color:var(--ssw-strong)} +.ssw-role-top{display:flex;align-items:center;justify-content:space-between;gap:6px} +.ssw-role-name{font-size:14px;font-weight:600;letter-spacing:2px} +.ssw-role-duty{font-size:10px;color:var(--ssw-muted);line-height:1.5} +.ssw-dot{flex:none;width:6px;height:6px;border-radius:50%;border:1px solid var(--ssw-faint);background:transparent} +.ssw-dot[data-status=bound]{background:var(--ssw-ok);border-color:var(--ssw-ok)} +.ssw-dot[data-status=failed],.ssw-dot[data-status=missing]{background:var(--ssw-danger);border-color:var(--ssw-danger)} +.ssw-dot[data-status=creating]{background:var(--ssw-blue);border-color:var(--ssw-blue)} +.ssw-ministries{position:relative;border:1px dashed var(--ssw-wire);border-radius:12px;margin-top:26px;padding:14px 8px 9px} +.ssw-ministries::before{content:"";position:absolute;bottom:100%;height:26px;border-left:1px solid var(--ssw-wire);left:50%} +.ssw-group-label{position:absolute;top:-8px;left:10px;padding:0 5px;background:var(--ssw-rail);font-size:10px;color:var(--ssw-faint)} +.ssw-six{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px} +.ssw-six .ssw-seat{min-height:66px;padding:9px 8px} +.ssw-current{margin:16px 16px 0;padding:13px;border:1px solid var(--ssw-line);border-radius:11px;background:var(--ssw-card)} +.ssw-current-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px} +.ssw-current-name{font-size:13px;font-weight:600} +.ssw-current-label{font-size:10px;color:var(--ssw-faint)} +.ssw-current-text{margin:0;font-size:12px;line-height:1.8;color:var(--ssw-muted)} +.ssw-config{margin:10px 16px 0;border:1px solid var(--ssw-line);border-radius:10px;background:var(--ssw-card);overflow:hidden} +.ssw-config-toggle{display:flex;align-items:center;gap:8px;width:100%;padding:12px 13px;font-size:12px;color:var(--ssw-ink)} +.ssw-config-toggle svg{width:15px;height:15px;color:var(--ssw-muted)} +.ssw-chevron{margin-left:auto;transition:transform .2s} +.ssw-config-toggle[aria-expanded=true] .ssw-chevron{transform:rotate(180deg)} +.ssw-config-body{padding:0 13px 14px} +.ssw-label{display:block;font-size:11px;color:var(--ssw-muted);margin:12px 0 6px} +.ssw-field{width:100%;border:1px solid var(--ssw-line);background:var(--ssw-bg);color:var(--ssw-ink);border-radius:6px;padding:8px;font-size:12px;line-height:1.5} +.ssw-textarea{resize:vertical;min-height:84px;font-family:inherit} +.ssw-scope-note{margin:10px 0;font-size:10px;line-height:1.6;color:var(--ssw-faint)} +.ssw-save-row{display:flex;align-items:center;gap:10px} +.ssw-save-status{font-size:10px;color:var(--ssw-muted)} +.ssw-notice{margin:12px 16px 16px;font-size:11px;color:var(--ssw-muted)} +.ssw-error{margin:12px 16px 16px;font-size:11px;color:var(--ssw-danger)} +.ssw-loading,.ssw-empty{padding:36px 20px;text-align:center;font-size:12px;color:var(--ssw-muted)} +.ssw-empty .ssw-primary{margin-top:12px} +.ssw-entry{display:flex;align-items:center;gap:9px;width:100%;padding:0 10px;height:35px;border-radius:7px;font-size:13px;color:inherit;text-align:left} +.ssw-entry:hover{background:#eef4ff} +.ssw-entry[aria-expanded=true]{color:#2563eb;background:#eaf1fe;font-weight:600} +.ssw-entry svg{width:16px;height:16px;flex:none} +.ssw-entry-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +body[data-ds-dark-theme] .ssw-entry:hover{background:#1d2b40} +body[data-ds-dark-theme] .ssw-entry[aria-expanded=true]{color:#91bafa;background:#1d2b40} +@media (prefers-reduced-motion:reduce){.ssw-scope *{transition:none!important}} +`; + +// src/native/panel.js +var GROUP_ORDER = ["lead", "sansheng", "liubu"]; +var GROUP_TITLE = { lead: "统领", sansheng: "三省", liubu: "六部" }; +var MAX_OPTIONS = 8; +var PROJECT_STATUS_TEXT = { + pending: "待启用", + provisioning: "启用中", + ready: "已就绪", + error: "异常" +}; +var SEAT_STATUS_TEXT = { + pending: "待启用", + creating: "创建中", + bound: "已绑定", + failed: "失败", + missing: "缺失" +}; +function asText(v) { + return typeof v === "string" ? v : ""; +} +function seatRecords(project) { + const out = {}; + const seats = project ? project.seats : null; + if (Array.isArray(seats)) { + for (const s of seats) if (s && SEATS[s.id]) out[s.id] = s; + } else if (seats && typeof seats === "object") { + for (const id of SEAT_IDS) if (seats[id]) out[id] = seats[id]; + } + return out; +} +function isBound(seat) { + return !!seat && typeof seat.sessionId === "string" && seat.sessionId.length > 0; +} +function modelValue(model) { + if (!model || typeof model !== "object") return ""; + if (typeof model.provider !== "string" || typeof model.model !== "string") return ""; + return model.provider + "::" + model.model; +} +function flattenModels(models) { + const opts = []; + const providers = models && Array.isArray(models.providers) ? models.providers : []; + for (const p of providers) { + const pid = asText(p && p.provider); + if (!pid) continue; + const list = Array.isArray(p && p.models) ? p.models : []; + for (const m of list) { + const mid = typeof m === "string" ? m : asText(m && m.model); + if (!mid) continue; + opts.push({ value: pid + "::" + mid, label: pid + " / " + mid }); + if (opts.length >= MAX_OPTIONS - 1) break; + } + if (opts.length >= MAX_OPTIONS - 1) break; + } + return opts; +} +function buildModelSelect(project, seat, models) { + const real = flattenModels(models); + const options = [{ value: "", label: "请选择模型" }].concat(real).slice(0, MAX_OPTIONS); + const want = modelValue(seat && seat.model); + const value = options.some((o) => o.value === want) ? want : ""; + return { + type: "select", + label: "模型", + value, + options, + action: { type: "sansheng/select-model", seatId: seat && seat.id || null, projectId: project && project.id || null } + }; +} +function seatButton(project, seat, selectedSeatId) { + const meta = SEATS[seat.id]; + const selected = seat.id === selectedSeatId; + return { + type: "button", + seatId: seat.id, + label: meta.label, + selected, + variant: selected ? "primary" : "ghost", + action: { type: "sansheng/select-seat", seatId: seat.id, projectId: project && project.id || null } + }; +} +function groupNode(project, records, key, selectedSeatId) { + const ids = (SEAT_GROUPS[key] || []).filter((id) => records[id] && SEATS[id]); + if (ids.length === 0) return null; + const perRow = key === "liubu" ? 3 : ids.length; + const rows = []; + for (let i = 0; i < ids.length; i += perRow) { + const slice = ids.slice(i, i + perRow); + rows.push({ type: "row", children: slice.map((id) => seatButton(project, records[id], selectedSeatId)) }); + } + return { + type: "stack", + group: key, + children: [{ type: "text", text: GROUP_TITLE[key] + " · " + ids.length + " 席" }].concat(rows) + }; +} +function selectedDetail(project, records, selectedSeatId, models) { + const seat = selectedSeatId ? records[selectedSeatId] : null; + if (!seat) { + return { type: "callout", tone: "info", text: "点击上方角色卡片查看职责、模型与进入会话。" }; + } + const meta = SEATS[seat.id]; + const bound = isBound(seat); + const statusLabel = SEAT_STATUS_TEXT[seat.status] || asText(seat.status) || "未知"; + const instructions = asText(seat.instructions).trim() || "(未填写)"; + return { + type: "stack", + detail: seat.id, + children: [ + { type: "text", text: meta.label + " · " + meta.duty + " · " + statusLabel }, + { type: "callout", tone: "info", text: "职责:" + meta.responsibility }, + { type: "text", text: "角色补充说明(只读,请在 Web 端编辑)" }, + { type: "callout", tone: "warn", text: instructions }, + buildModelSelect(project, seat, models), + { + type: "button", + label: bound ? "进入" + meta.label + "会话" : meta.label + "尚未绑定会话", + variant: bound ? "primary" : "ghost", + disabled: !bound, + action: { + type: "sansheng/enter-session", + seatId: seat.id, + projectId: project && project.id || null, + sessionId: isBound(seat) ? seat.sessionId : null + } + } + ] + }; +} +function buildPanelView(input) { + const { project = null, selectedSeatId = null, models = null } = input || {}; + if (!project || typeof project !== "object") { + return { + type: "stack", + children: [ + { type: "text", text: "三省六部" }, + { + type: "callout", + tone: "warn", + text: "无法确定当前项目:原生面板作用域不含 workspaceId,且未能由 sessionId 反查到所属项目。请从已启用「三省六部」的项目会话中打开,或在 Web 工作台查看。" + } + ] + }; + } + const records = seatRecords(project); + const sel = selectedSeatId && records[selectedSeatId] ? selectedSeatId : records.lead ? "lead" : null; + const ready = project.status === "ready"; + const boundCount = SEAT_IDS.filter((id) => isBound(records[id])).length; + const children = [ + { type: "text", text: "三省六部 · " + (asText(project.name) || "未命名项目") }, + { + type: "callout", + tone: ready ? "good" : "warn", + text: (PROJECT_STATUS_TEXT[project.status] || "状态未知") + " · 已绑定 " + boundCount + "/10 席" + } + ]; + for (const key of GROUP_ORDER) { + const g = groupNode(project, records, key, sel); + if (g) children.push(g); + } + children.push(selectedDetail(project, records, sel, models)); + return { type: "stack", children }; +} +var panel_default = buildPanelView; + +// src/native/index.js +var PANEL_ID = "sansheng"; +var viewBySession = /* @__PURE__ */ new Map(); +var selectionBySession = /* @__PURE__ */ new Map(); +var modelsBySession = /* @__PURE__ */ new Map(); +function cacheProject(project) { + if (!project || typeof project !== "object") return; + const seats = project.seats; + for (const id of SEAT_IDS) { + let seat = null; + if (Array.isArray(seats)) seat = seats.find((s) => s && s.id === id) || null; + else if (seats && typeof seats === "object") seat = seats[id] || null; + if (seat && typeof seat.sessionId === "string" && seat.sessionId) { + viewBySession.set(seat.sessionId, project); + } + } +} +function resolveProject(native, scope) { + const sid = scope && typeof scope.sessionId === "string" ? scope.sessionId : null; + const lookup = native && (native.sansheng || native.sanshengProjects) || null; + if (lookup && typeof lookup.projectForScope === "function") { + try { + const p = lookup.projectForScope(scope); + if (p) { + cacheProject(p); + return p; + } + } catch (e) { + } + } + if (lookup && typeof lookup.projectForSession === "function" && sid) { + try { + const p = lookup.projectForSession(sid); + if (p) { + cacheProject(p); + return p; + } + } catch (e) { + } + } + let workspaceId = null; + try { + const sessions = native && native.sessions; + if (sessions && typeof sessions.binding === "function" && sid) { + const b = sessions.binding(sid); + workspaceId = b && (b.workspaceId || b.workspace && b.workspace.id) || null; + } + } catch (e) { + } + if (lookup && typeof lookup.projectForWorkspace === "function" && workspaceId) { + try { + const p = lookup.projectForWorkspace(workspaceId); + if (p) { + cacheProject(p); + return p; + } + } catch (e) { + } + } + if (sid && viewBySession.has(sid)) return viewBySession.get(sid); + return null; +} +function makeView(native, scope) { + const sid = scope && typeof scope.sessionId === "string" ? scope.sessionId : null; + const project = resolveProject(native, scope); + const selectedSeatId = sid && selectionBySession.has(sid) ? selectionBySession.get(sid) : null; + const models = sid && modelsBySession.has(sid) ? modelsBySession.get(sid) : null; + return buildPanelView({ project, selectedSeatId, models }); +} +function normalizeAction(event) { + const a = event && event.action; + if (a && typeof a === "object") return a; + const v = event && event.value; + if (v && typeof v === "object" && typeof v.type === "string") return v; + if (typeof a === "string") return Object.assign({ type: a }, v && typeof v === "object" ? v : {}); + return null; +} +async function handleEvent(native, scope, event) { + const sid = scope && typeof scope.sessionId === "string" ? scope.sessionId : null; + const action = normalizeAction(event); + if (!action || typeof action.type !== "string") return []; + switch (action.type) { + case "sansheng/select-seat": { + if (sid && action.seatId) selectionBySession.set(sid, action.seatId); + return [{ type: "refresh", id: PANEL_ID }]; + } + case "sansheng/select-model": { + if (sid && action.seatId) selectionBySession.set(sid, action.seatId); + return [{ type: "toast", text: "模型选择在原生面板暂未接持久化,请在 Web 端保存(需真机核验)" }]; + } + case "sansheng/enter-session": { + const bridged = native && native.dshGo; + const open = bridged && (bridged.openSession || bridged.navigate) || native && native.sansheng && native.sansheng.openSession; + if (typeof open === "function" && action.sessionId) { + try { + await open(action.sessionId); + return [{ type: "toast", text: "已请求打开会话" }]; + } catch (e) { + } + } + return [{ type: "toast", text: "原生 effect 暂不支持会话跳转,请从宿主会话列表进入(需真机核验)" }]; + } + default: + return []; + } +} +function makeDataProvider(native, dshGo) { + return function data(scope, emit) { + let cancelled = false; + const run = async () => { + if (typeof fetch !== "function") return; + const sid = scope && typeof scope.sessionId === "string" ? scope.sessionId : null; + if (!sid) return; + const post = async (endpoint, payload) => { + const res = await fetch("/api/sansheng", { + method: "POST", + credentials: "same-origin", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ endpoint, payload: payload == null ? null : payload }) + }); + if (!res.ok) throw new Error("HTTP " + res.status); + const r = await res.json(); + if (!r || r.ok !== true) throw new Error(r && r.error && r.error.message || "request failed"); + return r.value; + }; + const list = await post("list"); + const projects = list && Array.isArray(list.projects) ? list.projects : []; + for (const meta of projects) { + const value = await post("project", { projectId: meta.id }); + const project = value && value.project ? value.project : value; + cacheProject(project); + const seats = project && project.seats; + const found = Array.isArray(seats) ? seats.some((s) => s && s.sessionId === sid) : seats && Object.values(seats).some((s) => s && s.sessionId === sid); + if (found) { + if (!cancelled) { + try { + emit({ project }); + } catch (e) { + } + try { + if (dshGo && typeof dshGo.refresh === "function") dshGo.refresh(PANEL_ID, scope); + } catch (e) { + } + } + return; + } + } + }; + run().catch(() => { + }); + return () => { + cancelled = true; + }; + }; +} +function install(ctx) { + if (!ctx || typeof ctx.inject !== "function") return () => { + }; + return ctx.inject(["dshGo", "sessions"], (native) => { + const dshGo = native && native.dshGo; + if (!dshGo || typeof dshGo.panel !== "function") return () => { + }; + const disposers = []; + try { + const offPanel = native.dshGo.panel(PANEL_ID, { + view: (scope, caps) => makeView(native, scope), + data: makeDataProvider(native, native.dshGo) + }); + if (typeof offPanel === "function") disposers.push(offPanel); + } catch (e) { + } + if (typeof native.dshGo.on === "function") { + try { + const offOn = native.dshGo.on(PANEL_ID, (scope, event) => handleEvent(native, scope, event)); + if (typeof offOn === "function") disposers.push(offOn); + } catch (e) { + } + } + return () => { + for (const off of disposers) { + try { + off(); + } catch (e) { + } + } + }; + }); +} +var native_default = { install }; + +// src/client/index.js +var import_react = require("react"); +var import_react_dom = require("react-dom"); +var inject = ["sessions", "uiWorkspace", "uiConversation", "slots", "theme", "layout"]; +var PLUGIN_ID = "dsh-sansheng"; +var TAB_ID = "sansheng-workbench"; +function installStyles(doc, tag, text) { + if (!doc || !doc.head) return null; + const style = doc.createElement("style"); + style.dataset.plugin = PLUGIN_ID; + style.dataset.sansheng = tag; + style.textContent = text; + doc.head.appendChild(style); + return style; +} +function svgWrap(children, props) { + return (0, import_react.createElement)("svg", { + viewBox: "0 0 24 24", + width: 16, + height: 16, + fill: "none", + stroke: "currentColor", + strokeWidth: 1.6, + strokeLinecap: "round", + strokeLinejoin: "round", + "aria-hidden": "true", + ...props || {} + }, children); +} +var TreeIcon = (props) => svgWrap([ + (0, import_react.createElement)("rect", { key: "a", x: 9, y: 2, width: 6, height: 5, rx: 1 }), + (0, import_react.createElement)("path", { key: "b", d: "M12 7v5M5 16v-4h14v4" }), + (0, import_react.createElement)("rect", { key: "c", x: 2, y: 16, width: 6, height: 5, rx: 1 }), + (0, import_react.createElement)("rect", { key: "d", x: 16, y: 16, width: 6, height: 5, rx: 1 }) +], props); +var CloseIcon = (props) => svgWrap([(0, import_react.createElement)("path", { key: "p", d: "m6 6 12 12M6 18 18 6" })], props); +var FolderIcon = (props) => svgWrap([(0, import_react.createElement)("path", { key: "p", d: "M3 7V5a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v11H3Z" })], props); +var GearIcon = (props) => svgWrap([ + (0, import_react.createElement)("path", { key: "a", d: "M4 6h16M4 12h16M4 18h16" }), + (0, import_react.createElement)("circle", { key: "b", cx: 9, cy: 6, r: 2 }), + (0, import_react.createElement)("circle", { key: "c", cx: 16, cy: 12, r: 2 }), + (0, import_react.createElement)("circle", { key: "d", cx: 8, cy: 18, r: 2 }) +], props); +var ChevronIcon = (props) => (0, import_react.createElement)("svg", { + viewBox: "0 0 24 24", + width: 14, + height: 14, + fill: "none", + stroke: "currentColor", + strokeWidth: 1.6, + strokeLinecap: "round", + strokeLinejoin: "round", + className: "ssw-chevron", + "aria-hidden": "true" +}, (0, import_react.createElement)("path", { d: "m6 9 6 6 6-6" })); +function isFn(value) { + return typeof value === "function"; +} +function safeCall(obj, name) { + try { + if (!obj || !isFn(obj[name])) return void 0; + return obj[name](); + } catch { + return void 0; + } +} +function snapshotOf(obj) { + if (!obj) return void 0; + if (isFn(obj.getSnapshot)) { + try { + return obj.getSnapshot(); + } catch { + return void 0; + } + } + return obj; +} +function apply(ctx) { + if (typeof document !== "undefined") installStyles(document, "workbench", CSS); + const get = (name) => { + try { + return ctx.get(name); + } catch { + return void 0; + } + }; + function workspaceItems() { + const fromWorkspaces = snapshotOf(get("workspaces")?.list)?.items; + if (Array.isArray(fromWorkspaces)) return fromWorkspaces; + const fromUi = snapshotOf(get("uiWorkspace")?.workspaces)?.items; + if (Array.isArray(fromUi)) return fromUi; + return []; + } + function normalizeWorkspace(item) { + if (!item || typeof item !== "object") return null; + const workspaceId = item.workspaceId ?? item.id ?? null; + if (typeof workspaceId !== "string" || !workspaceId) return null; + return { + workspaceId, + name: typeof item.name === "string" ? item.name : typeof item.title === "string" ? item.title : void 0, + path: typeof item.path === "string" ? item.path : void 0 + }; + } + function currentSessionId() { + const snap = snapshotOf(get("sessions")?.list) ?? snapshotOf(get("sessions")); + if (!snap || typeof snap !== "object") return null; + for (const key of ["activeId", "currentId", "selectedId"]) { + if (typeof snap[key] === "string" && snap[key]) return snap[key]; + } + if (snap.byId && typeof snap.byId === "object") { + const main = Object.values(snap.byId).find((session) => (session?.retainedBy?.mainView ?? 0) > 0); + if (main && typeof main.id === "string") return main.id; + } + return null; + } + function currentWorkspaceId() { + const candidates = []; + for (const holder of [get("workspaces"), get("uiWorkspace")]) { + if (!holder) continue; + for (const key of ["currentWorkspaceId", "currentId", "activeId"]) { + if (isFn(holder[key])) candidates.push(safeCall(holder, key)); + else if (typeof holder[key] === "string") candidates.push(holder[key]); + } + for (const key of ["current", "active", "selected", "currentWorkspace"]) { + const value = holder[key]; + const snap = snapshotOf(value); + if (snap && typeof snap === "object") candidates.push(snap.workspaceId ?? snap.id); + else if (typeof value === "string") candidates.push(value); + } + } + const sessionId = currentSessionId(); + if (sessionId) { + const owner = workspaceItems().find((item) => Array.isArray(item.sessionIds) && item.sessionIds.includes(sessionId)); + if (owner) candidates.push(owner.workspaceId ?? owner.id); + } + return candidates.find((id) => typeof id === "string" && id) ?? null; + } + function currentWorkspace() { + const items = workspaceItems().map(normalizeWorkspace).filter(Boolean); + const id = currentWorkspaceId(); + if (id) { + const hit = items.find((item) => item.workspaceId === id); + return hit || { workspaceId: id, name: void 0, path: void 0 }; + } + if (items.length === 1) return items[0]; + return null; + } + function seatRecordOf(view, id) { + const seats = view && view.project ? view.project.seats : null; + if (Array.isArray(seats)) return seats.find((seat) => seat && seat.id === id) || null; + if (seats && typeof seats === "object") return seats[id] || null; + return null; + } + function navigateToSession(sessionId) { + if (!sessionId) return false; + const attempts = []; + const ui = get("uiWorkspace"); + if (ui) { + if (isFn(ui.openSession)) attempts.push(() => ui.openSession(sessionId)); + if (isFn(ui.open)) attempts.push(() => ui.open(sessionId)); + } + const sessions = get("sessions"); + if (sessions) { + if (isFn(sessions.open)) attempts.push(() => sessions.open(sessionId)); + if (isFn(sessions.openSession)) attempts.push(() => sessions.openSession(sessionId)); + if (isFn(sessions.select)) attempts.push(() => sessions.select(sessionId)); + } + for (const name of ["navigation", "navigator", "router"]) { + const svc = get(name); + if (!svc) continue; + if (isFn(svc.openSession)) attempts.push(() => svc.openSession(sessionId)); + if (isFn(svc.navigate)) attempts.push(() => svc.navigate({ sessionId })); + if (isFn(svc.open)) attempts.push(() => svc.open(sessionId)); + } + for (const run of attempts) { + try { + const result = run(); + if (result && isFn(result.then)) result.catch(() => { + }); + return true; + } catch { + } + } + console.warn("[sansheng] 未找到可用的会话导航接口,仅发出 navigate 意图:", sessionId); + try { + if (typeof window !== "undefined") { + window.dispatchEvent(new CustomEvent("sansheng:navigate", { detail: { sessionId } })); + } + } catch { + } + return false; + } + let rightTabReady = false; + function closeRightTab() { + const right = get("sidebarRight"); + try { + if (right && isFn(right.closeTab)) right.closeTab(TAB_ID); + } catch { + } + } + function ensureRightTab() { + if (rightTabReady) return true; + const tabs = get("sidebarRightTabs"); + if (!tabs) return false; + try { + if (isFn(tabs.get) && tabs.get(TAB_ID)) { + rightTabReady = true; + return true; + } + if (isFn(tabs.register)) { + tabs.register(TAB_ID, { title: "三省六部", render: () => (0, import_react.createElement)(SanshengWorkbench, { onClose: closeRightTab }) }); + rightTabReady = true; + return true; + } + } catch (error) { + console.warn("[sansheng] 无法注册右侧标签页,回退为浮动面板:", error && error.message ? error.message : error); + } + return false; + } + function tryOpenRightTab() { + const right = get("sidebarRight"); + if (!right || !isFn(right.openTab)) return false; + if (!ensureRightTab()) return false; + try { + right.openTab(TAB_ID); + return true; + } catch (error) { + console.warn("[sansheng] 打开右侧标签失败,回退为浮动面板:", error && error.message ? error.message : error); + return false; + } + } + function SanshengWorkbench(props) { + const onClose = props && props.onClose ? props.onClose : null; + const [phase, setPhase] = (0, import_react.useState)("loading"); + const [error, setError] = (0, import_react.useState)(null); + const [notice, setNotice] = (0, import_react.useState)(null); + const [view, setView] = (0, import_react.useState)(null); + const [models, setModels] = (0, import_react.useState)(null); + const [selectedSeatId, setSelectedSeatId] = (0, import_react.useState)(SEAT_IDS[0]); + const [draft, setDraft] = (0, import_react.useState)({}); + const [busy, setBusy] = (0, import_react.useState)(false); + const [configOpen, setConfigOpen] = (0, import_react.useState)(false); + const alive = (0, import_react.useRef)(true); + (0, import_react.useEffect)(() => () => { + alive.current = false; + }, []); + const loadProject = (0, import_react.useCallback)(async () => { + setPhase("loading"); + setError(null); + setNotice(null); + const workspace = currentWorkspace(); + if (!workspace) { + setPhase("no-workspace"); + return; + } + try { + const projectView = await request("open", { + workspaceId: workspace.workspaceId, + name: workspace.name, + path: workspace.path + }); + let modelCatalog = null; + try { + modelCatalog = await request("models"); + } catch (modelError) { + console.warn("[sansheng] 模型目录加载失败:", modelError && modelError.message ? modelError.message : modelError); + } + if (!alive.current) return; + setView(projectView); + setModels(modelCatalog); + setPhase("ready"); + } catch (loadError) { + if (!alive.current) return; + setError(loadError && loadError.message ? loadError.message : "加载失败"); + setPhase("error"); + } + }, []); + (0, import_react.useEffect)(() => { + void loadProject(); + }, [loadProject]); + const wb = buildWorkbenchView(view, { selectedSeatId, models, draft }); + const seatById = (0, import_react.useMemo)(() => { + const map = {}; + for (const seat of wb.seats) map[seat.id] = seat; + return map; + }, [wb.seats]); + function pickSeat(id) { + if (!id) return; + if (id !== selectedSeatId) { + setSelectedSeatId(id); + setConfigOpen(false); + } + const seat = seatById[id]; + if (wb.ready && seat && seat.status === "bound") { + const rec = seatRecordOf(view, id); + if (rec && rec.sessionId) { + navigateToSession(rec.sessionId); + setNotice("已切换到" + seat.name + "会话"); + return; + } + } + if (wb.ready && seat && seat.status !== "bound") setNotice("该席尚未绑定会话,先启用或重试启用"); + } + function setModelValue(value) { + setDraft((prev) => updateDraft(prev, selectedSeatId, { modelValue: value })); + } + function setInstructions(value) { + setDraft((prev) => updateDraft(prev, selectedSeatId, { instructions: value })); + } + async function enableSeats() { + const projectId = view && view.project ? view.project.id : null; + if (!projectId) return; + setBusy(true); + setError(null); + setNotice("正在启用十席…"); + try { + const next = await request("enable", { projectId }); + if (!alive.current) return; + setView(next); + setNotice("十席已启用(建立独立会话,不自动运行模型)"); + } catch (enableError) { + if (alive.current) setError(enableError && enableError.message ? enableError.message : "启用失败"); + } finally { + if (alive.current) setBusy(false); + } + } + async function saveConfig() { + const projectId = view && view.project ? view.project.id : null; + if (!projectId) return; + const seatId = wb.selected.id; + const value = wb.selected.modelValue; + if (!value) { + setNotice("请先为当前角色选择模型"); + return; + } + const option = findModelOption(wb.selected.modelOptions, value); + const model = option ? option.reasoningEffort ? { provider: option.provider, model: option.model, reasoningEffort: option.reasoningEffort } : { provider: option.provider, model: option.model } : null; + setBusy(true); + setError(null); + setNotice("保存中…"); + try { + await request("configure", { projectId, seatId, model, instructions: wb.selected.instructions }); + const next = await request("project", { projectId }); + if (!alive.current) return; + setView(next); + setDraft((prev) => clearDraft(prev, seatId)); + setNotice("已保存"); + } catch (saveError) { + if (alive.current) setError(saveError && saveError.message ? saveError.message : "保存失败"); + } finally { + if (alive.current) setBusy(false); + } + } + const seatCard = (seat) => (0, import_react.createElement)( + "button", + { + key: seat.id, + type: "button", + className: "ssw-seat", + "aria-pressed": seat.selected ? "true" : "false", + title: seat.name + " · " + seat.duty + "(" + seat.statusLabel + ")", + onClick: () => pickSeat(seat.id) + }, + (0, import_react.createElement)( + "span", + { className: "ssw-role-top" }, + (0, import_react.createElement)("span", { className: "ssw-role-name" }, seat.name), + (0, import_react.createElement)("span", { className: "ssw-dot", "data-status": seat.status, "aria-hidden": "true" }) + ), + (0, import_react.createElement)("span", { className: "ssw-role-duty" }, seat.duty) + ); + const pickList = (ids) => ids.map((id) => seatById[id]).filter(Boolean); + const tree = (0, import_react.createElement)( + "section", + { className: "ssw-tree", "aria-label": "切换角色" }, + (0, import_react.createElement)("div", { className: "ssw-lead" }, pickList(wb.groups.lead).map(seatCard)), + (0, import_react.createElement)("div", { className: "ssw-trio" }, pickList(wb.groups.sansheng).map(seatCard)), + (0, import_react.createElement)( + "div", + { className: "ssw-ministries" }, + (0, import_react.createElement)("span", { className: "ssw-group-label" }, "六部 · 尚书统筹"), + (0, import_react.createElement)("div", { className: "ssw-six" }, pickList(wb.groups.liubu).map(seatCard)) + ) + ); + const head = (0, import_react.createElement)( + "header", + { className: "ssw-head" }, + (0, import_react.createElement)(TreeIcon), + (0, import_react.createElement)("strong", { className: "ssw-head-title" }, "工作台"), + onClose ? (0, import_react.createElement)("button", { type: "button", className: "ssw-icon-btn", onClick: onClose, "aria-label": "收起工作台" }, (0, import_react.createElement)(CloseIcon)) : null + ); + const projectInfo = (0, import_react.createElement)( + "div", + { className: "ssw-project" }, + (0, import_react.createElement)( + "div", + { className: "ssw-project-line" }, + (0, import_react.createElement)("span", { className: "ssw-eyebrow" }, (0, import_react.createElement)(FolderIcon), "当前项目"), + (0, import_react.createElement)("span", { className: "ssw-count" }, wb.project.seatCount + " 个角色 · " + wb.project.sessionCount + " 个会话") + ), + (0, import_react.createElement)("div", { className: "ssw-project-title" }, wb.projectTitle || "未命名项目") + ); + const enableBlock = !wb.ready ? (0, import_react.createElement)( + "div", + { className: "ssw-enable" }, + (0, import_react.createElement)("p", { className: "ssw-enable-note" }, "这个项目还没有启用十席。启用会建立十个独立会话,但不会自动运行模型。"), + (0, import_react.createElement)("button", { + type: "button", + className: "ssw-primary", + disabled: busy, + onClick: enableSeats + }, busy ? "正在启用…" : "启用此项目的十席") + ) : null; + const currentCard = (0, import_react.createElement)( + "section", + { className: "ssw-current" }, + (0, import_react.createElement)( + "div", + { className: "ssw-current-top" }, + (0, import_react.createElement)("strong", { className: "ssw-current-name" }, wb.selected.name), + (0, import_react.createElement)("span", { className: "ssw-current-label" }, "角色职责 · " + wb.selected.statusLabel) + ), + (0, import_react.createElement)("p", { className: "ssw-current-text" }, wb.selected.responsibility) + ); + const optionEls = wb.selected.modelOptions.map((option) => (0, import_react.createElement)("option", { key: option.value, value: option.value }, option.label)); + if (wb.selected.modelValue && !wb.selected.modelOptions.some((option) => option.value === wb.selected.modelValue)) { + optionEls.push((0, import_react.createElement)("option", { key: "__current__", value: wb.selected.modelValue }, wb.selected.modelLabel)); + } + const config = (0, import_react.createElement)( + "section", + { className: "ssw-config" }, + (0, import_react.createElement)( + "button", + { + type: "button", + className: "ssw-config-toggle", + "aria-expanded": configOpen ? "true" : "false", + onClick: () => setConfigOpen((value) => !value) + }, + (0, import_react.createElement)(GearIcon), + (0, import_react.createElement)("span", null, "配置" + wb.selected.name + (wb.selected.dirty ? " · 未保存" : "")), + (0, import_react.createElement)(ChevronIcon) + ), + configOpen ? (0, import_react.createElement)( + "div", + { className: "ssw-config-body" }, + (0, import_react.createElement)("label", { className: "ssw-label" }, "会话模型"), + (0, import_react.createElement)( + "select", + { + className: "ssw-field", + value: wb.selected.modelValue, + disabled: busy, + onChange: (event) => setModelValue(event.target.value) + }, + (0, import_react.createElement)("option", { value: "", disabled: true }, UNCHOSEN_MODEL_LABEL), + ...optionEls + ), + (0, import_react.createElement)("label", { className: "ssw-label" }, "角色补充说明"), + (0, import_react.createElement)("textarea", { + className: "ssw-field ssw-textarea", + rows: 4, + value: wb.selected.instructions, + disabled: busy, + placeholder: "补充该角色在当前项目中的工作要求", + onChange: (event) => setInstructions(event.target.value) + }), + (0, import_react.createElement)("p", { className: "ssw-scope-note" }, "每个角色是独立会话;模型与说明只影响当前项目当前角色,不改变宿主默认模型。"), + (0, import_react.createElement)( + "div", + { className: "ssw-save-row" }, + (0, import_react.createElement)("button", { type: "button", className: "ssw-primary", disabled: busy, onClick: saveConfig }, busy ? "保存中…" : "保存配置"), + wb.selected.dirty ? (0, import_react.createElement)("span", { className: "ssw-save-status" }, "有未保存修改") : null + ) + ) : null + ); + const statusEl = error ? (0, import_react.createElement)("p", { className: "ssw-error", role: "alert" }, error) : notice ? (0, import_react.createElement)("p", { className: "ssw-notice", role: "status" }, notice) : null; + let body; + if (phase === "loading") body = (0, import_react.createElement)("div", { className: "ssw-loading" }, "正在加载工作台…"); + else if (phase === "no-workspace") body = (0, import_react.createElement)( + "div", + { className: "ssw-empty" }, + (0, import_react.createElement)("p", null, "先从左侧选择一个项目"), + (0, import_react.createElement)("button", { type: "button", className: "ssw-primary", onClick: loadProject }, "重试") + ); + else if (phase === "error" && !view) body = (0, import_react.createElement)( + "div", + { className: "ssw-empty" }, + (0, import_react.createElement)("p", { className: "ssw-error" }, error || "加载失败"), + (0, import_react.createElement)("button", { type: "button", className: "ssw-primary", onClick: loadProject }, "重试") + ); + else body = (0, import_react.createElement)(import_react.Fragment, null, projectInfo, enableBlock, tree, currentCard, config, statusEl); + return (0, import_react.createElement)("div", { className: "ssw-root ssw-scope" }, head, body); + } + function SanshengEntry() { + const [floating, setFloating] = (0, import_react.useState)(false); + const onClick = () => { + if (tryOpenRightTab()) { + setFloating(false); + return; + } + setFloating((value) => !value); + }; + let panel = null; + if (floating) { + const card = (0, import_react.createElement)( + "div", + { className: "ssw-float", role: "dialog", "aria-label": "三省六部工作台" }, + (0, import_react.createElement)(SanshengWorkbench, { onClose: () => setFloating(false) }) + ); + const canPortal = typeof document !== "undefined" && document.body && isFn(import_react_dom.createPortal); + panel = canPortal ? (0, import_react_dom.createPortal)(card, document.body) : card; + } + return (0, import_react.createElement)( + import_react.Fragment, + null, + (0, import_react.createElement)( + "button", + { + type: "button", + className: "ssw-entry", + title: "三省六部", + "aria-expanded": floating ? "true" : "false", + onClick + }, + (0, import_react.createElement)(TreeIcon), + (0, import_react.createElement)("span", { className: "ssw-entry-label" }, "三省六部") + ), + panel + ); + } + try { + if (ctx.slots && isFn(ctx.slots.inject) && isFn(ctx.slots.register)) { + ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({ + name: "sidebar.footer.action", + id: "sansheng-entry", + order: 40 + }, SanshengEntry)); + } else { + console.warn("[sansheng] 宿主未提供 slots.inject / slots.register,无法注册侧栏入口"); + } + } catch (error) { + console.warn("[sansheng] 注册侧栏入口失败:", error && error.message ? error.message : error); + } + try { + install(ctx); + } catch (error) { + console.warn("[sansheng] 原生面板注册失败:", error && error.message ? error.message : error); + } +} +return Object.defineProperty({ ...module.exports }, Symbol.toStringTag, { value: 'Module' }) + }, +}) diff --git a/sansheng/pnpm-lock.yaml b/sansheng/pnpm-lock.yaml new file mode 100644 index 0000000..676fa64 --- /dev/null +++ b/sansheng/pnpm-lock.yaml @@ -0,0 +1,407 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@deepseek-ai/cordis': + specifier: '*' + version: 4.1.0 + '@deepseek-ai/dsh-llm': + specifier: '*' + version: 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-attachment@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-timeout@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-web': + specifier: '*' + version: 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-attachment@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-timeout@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))) + devDependencies: + esbuild: + specifier: 0.28.2 + version: 0.28.2 + +packages: + + '@deepseek-ai/cordis@4.1.0': + resolution: {integrity: sha512-CJrjNyBkKn1SfvBQUcgFYKFnLjS+uKrhdMsbHU60xabvi12d+xQ+IQSNlME5Z+B+4Zi6n4BDknKY94tEPeo47w==} + hasBin: true + peerDependencies: + '@deepseek-ai/cordis-plugin-include': ~1.1.0 + '@deepseek-ai/cordis-plugin-loader': ~1.1.0 + peerDependenciesMeta: + '@deepseek-ai/cordis-plugin-include': + optional: true + '@deepseek-ai/cordis-plugin-loader': + optional: true + + '@deepseek-ai/cosmokit@1.9.0': + resolution: {integrity: sha512-5O1S53mZiJyZYcvxxD0Qv1EY7qFPSxbGyD8CbVK6gw7W9FvcXZj2YIX1ZkOqyQQ3Xt2rFkZDHJv0+V3Zmmp8CA==} + + '@deepseek-ai/dsh-attachment@0.0.1-rc.1': + resolution: {integrity: sha512-zBBw6h+YKOf7U8uEZezbFUjLsA8VU1GfCIUonAZHG2hWDWhWbrGaoO9fL8KyncEDSWMLMoIoGo+ZxDEPVJZYOA==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.1-rc.1 + '@deepseek-ai/dsh-brand': ^0.0.1-rc.1 + '@deepseek-ai/dsh-invariants': ^0.0.1-rc.1 + + '@deepseek-ai/dsh-brand@0.0.1-rc.1': + resolution: {integrity: sha512-XhwNAugG/baCVA+BMMvjihYi9XMLcDUew3G63i+ATWIZCvpx8CghbgcV93DEeMH2sqhNuQAssmHgXkpRld3gyQ==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.1-rc.1 + '@deepseek-ai/dsh-invariants': ^0.0.1-rc.1 + + '@deepseek-ai/dsh-invariants@0.0.1-rc.1': + resolution: {integrity: sha512-ZoGCGColviu3Tkdnv9hMkgBE4eg0hAz5GXR/knqRf7mJUeBlTCya2dIckYlqekYmp5L+1AeWxf9j+Lv1YRcvXw==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.1-rc.1 + + '@deepseek-ai/dsh-llm@0.0.1-rc.1': + resolution: {integrity: sha512-mRJj07IQNfRReGrhpMpL8AONiYKqfwzxvepg/ut9Wkj8oH2BuoftPS4cMnnXFFCUlYql04/sezwDLriYks/bmw==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.1-rc.1 + '@deepseek-ai/dsh-attachment': ^0.0.1-rc.1 + '@deepseek-ai/dsh-brand': ^0.0.1-rc.1 + '@deepseek-ai/dsh-invariants': ^0.0.1-rc.1 + '@deepseek-ai/dsh-timeout': ^0.0.1-rc.1 + + '@deepseek-ai/dsh-timeout@0.0.1-rc.1': + resolution: {integrity: sha512-lIMhY/JqA+eLpXXUN33xA7mlAYeHTDTWfcJ3CmEtplvGnvpDAHQ6oPeFs9JtWcfKbuNDZFMNutyhD0qoRkFQeg==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.1-rc.1 + '@deepseek-ai/dsh-invariants': ^0.0.1-rc.1 + + '@deepseek-ai/dsh-web@0.0.1-rc.1': + resolution: {integrity: sha512-kbfr8aPtbsO9XOYqbdy39HwLPlVDH3GWjg9J2cJge5jgGPfN0lGlh5hcj4wvHxUEhGOZF+vieR/U8NmzeaeZMw==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.1-rc.1 + '@deepseek-ai/dsh-invariants': ^0.0.1-rc.1 + '@deepseek-ai/dsh-llm': ^0.0.1-rc.1 + + '@deepseek-ai/schemastery@3.19.0': + resolution: {integrity: sha512-bDXoYQa7ghAhmdYD5VPlzKxEzJV/aKkz5l4V5h1u06z8GAPN1ROewSjvR9WiXhpa52E9fng8lpH5QdCRIQgnyQ==} + + '@esbuild/aix-ppc64@0.28.2': + resolution: {integrity: sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.28.2': + resolution: {integrity: sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.28.2': + resolution: {integrity: sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.28.2': + resolution: {integrity: sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.28.2': + resolution: {integrity: sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.28.2': + resolution: {integrity: sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.28.2': + resolution: {integrity: sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.28.2': + resolution: {integrity: sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.28.2': + resolution: {integrity: sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.28.2': + resolution: {integrity: sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.28.2': + resolution: {integrity: sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.28.2': + resolution: {integrity: sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.28.2': + resolution: {integrity: sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.28.2': + resolution: {integrity: sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.28.2': + resolution: {integrity: sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.28.2': + resolution: {integrity: sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.28.2': + resolution: {integrity: sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.28.2': + resolution: {integrity: sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.28.2': + resolution: {integrity: sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.28.2': + resolution: {integrity: sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.28.2': + resolution: {integrity: sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.28.2': + resolution: {integrity: sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.28.2': + resolution: {integrity: sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.28.2': + resolution: {integrity: sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.28.2': + resolution: {integrity: sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.28.2': + resolution: {integrity: sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + esbuild@0.28.2: + resolution: {integrity: sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==} + engines: {node: '>=18'} + hasBin: true + +snapshots: + + '@deepseek-ai/cordis@4.1.0': + dependencies: + '@deepseek-ai/cosmokit': 1.9.0 + '@standard-schema/spec': 1.1.0 + + '@deepseek-ai/cosmokit@1.9.0': {} + + '@deepseek-ai/dsh-attachment@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0 + '@deepseek-ai/dsh-brand': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-invariants': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0 + '@deepseek-ai/dsh-invariants': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0 + '@deepseek-ai/schemastery': 3.19.0 + + '@deepseek-ai/dsh-llm@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-attachment@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-timeout@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))': + dependencies: + '@deepseek-ai/cordis': 4.1.0 + '@deepseek-ai/dsh-attachment': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-brand': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-invariants': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-timeout': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/schemastery': 3.19.0 + + '@deepseek-ai/dsh-timeout@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0 + '@deepseek-ai/dsh-invariants': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-web@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-attachment@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-timeout@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0 + '@deepseek-ai/dsh-invariants': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-attachment@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-brand@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-timeout@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.0.1-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/schemastery': 3.19.0 + + '@deepseek-ai/schemastery@3.19.0': + dependencies: + '@deepseek-ai/cosmokit': 1.9.0 + '@standard-schema/spec': 1.1.0 + + '@esbuild/aix-ppc64@0.28.2': + optional: true + + '@esbuild/android-arm64@0.28.2': + optional: true + + '@esbuild/android-arm@0.28.2': + optional: true + + '@esbuild/android-x64@0.28.2': + optional: true + + '@esbuild/darwin-arm64@0.28.2': + optional: true + + '@esbuild/darwin-x64@0.28.2': + optional: true + + '@esbuild/freebsd-arm64@0.28.2': + optional: true + + '@esbuild/freebsd-x64@0.28.2': + optional: true + + '@esbuild/linux-arm64@0.28.2': + optional: true + + '@esbuild/linux-arm@0.28.2': + optional: true + + '@esbuild/linux-ia32@0.28.2': + optional: true + + '@esbuild/linux-loong64@0.28.2': + optional: true + + '@esbuild/linux-mips64el@0.28.2': + optional: true + + '@esbuild/linux-ppc64@0.28.2': + optional: true + + '@esbuild/linux-riscv64@0.28.2': + optional: true + + '@esbuild/linux-s390x@0.28.2': + optional: true + + '@esbuild/linux-x64@0.28.2': + optional: true + + '@esbuild/netbsd-arm64@0.28.2': + optional: true + + '@esbuild/netbsd-x64@0.28.2': + optional: true + + '@esbuild/openbsd-arm64@0.28.2': + optional: true + + '@esbuild/openbsd-x64@0.28.2': + optional: true + + '@esbuild/openharmony-arm64@0.28.2': + optional: true + + '@esbuild/sunos-x64@0.28.2': + optional: true + + '@esbuild/win32-arm64@0.28.2': + optional: true + + '@esbuild/win32-ia32@0.28.2': + optional: true + + '@esbuild/win32-x64@0.28.2': + optional: true + + '@standard-schema/spec@1.1.0': {} + + esbuild@0.28.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.28.2 + '@esbuild/android-arm': 0.28.2 + '@esbuild/android-arm64': 0.28.2 + '@esbuild/android-x64': 0.28.2 + '@esbuild/darwin-arm64': 0.28.2 + '@esbuild/darwin-x64': 0.28.2 + '@esbuild/freebsd-arm64': 0.28.2 + '@esbuild/freebsd-x64': 0.28.2 + '@esbuild/linux-arm': 0.28.2 + '@esbuild/linux-arm64': 0.28.2 + '@esbuild/linux-ia32': 0.28.2 + '@esbuild/linux-loong64': 0.28.2 + '@esbuild/linux-mips64el': 0.28.2 + '@esbuild/linux-ppc64': 0.28.2 + '@esbuild/linux-riscv64': 0.28.2 + '@esbuild/linux-s390x': 0.28.2 + '@esbuild/linux-x64': 0.28.2 + '@esbuild/netbsd-arm64': 0.28.2 + '@esbuild/netbsd-x64': 0.28.2 + '@esbuild/openbsd-arm64': 0.28.2 + '@esbuild/openbsd-x64': 0.28.2 + '@esbuild/openharmony-arm64': 0.28.2 + '@esbuild/sunos-x64': 0.28.2 + '@esbuild/win32-arm64': 0.28.2 + '@esbuild/win32-ia32': 0.28.2 + '@esbuild/win32-x64': 0.28.2