@lemoncat7/dsh-partner 1.14.0 → 1.14.2
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.md +5 -1
- package/docs/architecture.md +1 -1
- package/docs/releases/1.14.1.md +11 -0
- package/docs/releases/1.14.2.md +10 -0
- package/lib/client-controller.d.ts.map +1 -1
- package/lib/client-controller.js +3 -3
- package/lib/client-controller.js.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +83 -41
- package/lib/client.js.map +4 -4
- package/lib/heartbeat.d.ts.map +1 -1
- package/lib/heartbeat.js +35 -12
- package/lib/heartbeat.js.map +1 -1
- package/lib/main-panel-compat.d.ts +5 -0
- package/lib/main-panel-compat.d.ts.map +1 -0
- package/lib/main-panel-compat.js +38 -0
- package/lib/main-panel-compat.js.map +1 -0
- package/lib/observation-budget.d.ts +5 -6
- package/lib/observation-budget.d.ts.map +1 -1
- package/lib/observation-budget.js +6 -8
- package/lib/observation-budget.js.map +1 -1
- package/lib/observation-errors.d.ts +0 -1
- package/lib/observation-errors.d.ts.map +1 -1
- package/lib/observation-errors.js +4 -5
- package/lib/observation-errors.js.map +1 -1
- package/lib/observation-loop.d.ts.map +1 -1
- package/lib/observation-loop.js +15 -30
- package/lib/observation-loop.js.map +1 -1
- package/lib/ui/identity-editor.js +1 -1
- package/lib/ui/identity-editor.js.map +1 -1
- package/package.json +16 -14
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
伙伴不是一次会话中的临时提示词。每个伙伴拥有独立身份、Agent Preset、模型路由、能力声明,以及按微信联系人隔离的 DSH Session。第一版以微信为主要渠道,使用腾讯微信 iLink Bot API,不模拟个人微信网页版协议。
|
|
6
6
|
|
|
7
|
+
## 1.14.2 更新:新版宿主适配与身份页统一
|
|
8
|
+
|
|
9
|
+
插件正式版,已在 DSH `0.1.5-rc.1` 验证新版主面板导航,保留旧版回退。身份页采用伙伴统一卡片与限定作用域的表单样式;不修改记忆、持续关注或工具授权。详见 [更新说明](docs/releases/1.14.2.md)。
|
|
10
|
+
|
|
7
11
|
## 1.13.0 更新:Skill 包导入与看板分工
|
|
8
12
|
|
|
9
13
|
正式版,适配 DSH **0.1.2-rc.1**,需要 Node.js **^22.19.0 或 >=24.0.0**。
|
|
@@ -327,7 +331,7 @@ ClawHub、LoopHub、SkillHub 是内置公共来源,默认启用且不能删除
|
|
|
327
331
|
|
|
328
332
|
## 关注依据与记录位置
|
|
329
333
|
|
|
330
|
-
关注使用后台轻量模型循环,不创建临时 Agent
|
|
334
|
+
关注使用后台轻量模型循环,不创建临时 Agent 或向聊天写入过程消息。每条关注独立执行,最多 12 轮工具交互和一轮无工具收尾,不再共用整批总时限或工具调用次数。单次模型请求最多 180 秒,单次工具最多 60 秒(工具自身可有更短限制),收尾有独立请求时间。每条完成立即保存;失败只保留未完成关注等待重试。只提供关联依据与记录目标,按文档完成代理、登录和查询;工具走来源作用域的 DSH 执行和审批,不自动批准。输出截断需按需分页。依据只读,结果仅写指定目标;检查受阻不能当作无变化。工具审计不复制参数正文。任意命令的文件隔离仍依赖 DSH 沙箱,工具名限制不等同文件系统隔离。
|
|
331
335
|
|
|
332
336
|
“交代一件事”中的 @文件或 @知识文档是只读检查依据;“需要记录的地方”另选现存本地文件或可编辑笔记。没有记录位置时不写文档,旧关注不自动把依据迁移成输出位置。有依据按依据整理,没有依据自主记录核实的现状和进展;笔记使用稳定 ID 绑定,知识库插件需提供 `dshKnowledgeNoteRecording` 宿主接口。心跳的笔记工具只接收 concernId,不允许模型选择其他笔记 ID;本地文件写权限只覆盖用户选择的现存文件。该入口不包含创建、删除、移动或重命名记录目标。首次可初始化已核实现状,后续避免重复追加,写入与通知判断相互独立。
|
|
333
337
|
|
package/docs/architecture.md
CHANGED
|
@@ -297,4 +297,4 @@ form and save feedback, using the shared companion draft and existing UI tokens.
|
|
|
297
297
|
- 卡面验证:`test/pendant-motion-glare.test.mjs` 覆盖角度往返、固定姿态十秒不漂移、四元数等价、强度边界、减少动态效果和背面关闭;`test/pendant-surface.test.mjs` 覆盖共享 uniform 与背面不变。`scripts/verify-pendant-gloss.mjs` 检查 162 组原色误差、渐变参考对照、不同倾角的光带位移与对比度保护及无额外绘制。浏览器测试覆盖 hover 不改变反光、拖拽改变角度时更新、握持静止高光不循环并正常休眠。
|
|
298
298
|
## 轻量关注执行
|
|
299
299
|
|
|
300
|
-
`observation-loop.ts` 维护私有消息缓冲,继承来源工具作用域,不启动 Agent turn 或新会话。按需暴露检查工具和指定记录工具,保留 DSH guard
|
|
300
|
+
`observation-loop.ts` 维护私有消息缓冲,继承来源工具作用域,不启动 Agent turn 或新会话。按需暴露检查工具和指定记录工具,保留 DSH guard/审批。`heartbeat.ts` 逐条调用并立即持久化结果,单条失败不终止后续关注。每条独享 12 轮检查和一轮无工具收尾;模型请求 180 秒、工具执行 60 秒分别计时,无整批总时限和共享调用次数限制。重试退避从执行结束计算,已完成关注按自身 nextCheckAt 调度。结束必须给出 completed/blocked,失败不写成无变化。来源知识挂载沿用原 session,无需临时知识映射。记录内容不回写依据。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# 1.14.1
|
|
2
|
+
|
|
3
|
+
正式版,适配 DSH **0.1.2-rc.1**;需要 Node.js 22.19+ 或 24+。
|
|
4
|
+
|
|
5
|
+
- 心跳逐条执行关注,每条独享 12 轮检查与一轮无工具收尾,移除整批 180 秒总时限和共享 24 次工具调用额度。
|
|
6
|
+
- 单次模型请求限时 180 秒,单次工具限时 60 秒;工具自身可设置更短时限,原有权限与审批保留。
|
|
7
|
+
- 每条完成立即保存,单条失败不阻止后续关注;重试仅检查仍到期的关注,已保存通知支持补发。
|
|
8
|
+
- 重试退避从执行结束计算,避免长检查结束后立即再次触发。
|
|
9
|
+
- 更新诊断与架构说明;不修改界面、用户配置或知识内容。
|
|
10
|
+
|
|
11
|
+
验证:342 项自动化测试通过。保留现有数据,无新增迁移。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 1.14.2
|
|
2
|
+
|
|
3
|
+
插件正式版,适配 DSH 0.1.5 主面板导航,保留旧版主面板回退。已在 DSH 0.1.5-rc.1 镜像验证;DSH 本身仍是 RC 版本。
|
|
4
|
+
|
|
5
|
+
- 伙伴工作区使用新版主面板注册与导航,卸载时同步工作区打开状态。
|
|
6
|
+
- 身份页补齐伙伴统一卡片材质,限定表单样式作用域,避免普通宿主主题规则覆盖输入框和按钮。
|
|
7
|
+
- 身份表单保留焦点反馈、保存状态与删除确认,窄屏字段可折行;不增加 WebGL 或大面积动态玻璃开销。
|
|
8
|
+
- 不修改伙伴身份内容、工具权限、记忆提炼、持续关注与通知规则,无新增数据迁移。
|
|
9
|
+
|
|
10
|
+
验证:346 项自动化测试通过;身份控件主题覆盖、焦点及工作区浏览器检查通过。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-controller.d.ts","sourceRoot":"","sources":["../src/client-controller.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"client-controller.d.ts","sourceRoot":"","sources":["../src/client-controller.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAMpE,MAAM,WAAW,kBAAkB;IAAG,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;AAC7F,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAClE,WAAW,IAAI,kBAAkB,GAAG,SAAS,CAAA;IAC7C,KAAK,IAAI,IAAI,CAAA;IACb,MAAM,IAAI,IAAI,CAAA;IACd,MAAM,IAAI,OAAO,CAAA;IACjB,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAA;IAC9B,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9D,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAChD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC5C;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,UAAU,EAAE,iBAAiB,KAAK,GAAG,CAAC,OAAO,GAAG,iBAAiB,CA2C5L"}
|
package/lib/client-controller.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { api } from './client-api.js';
|
|
2
|
+
import { registerMainPanel } from './main-panel-compat.js';
|
|
2
3
|
import { activatePluginWorkspace } from './workspace-ownership.js';
|
|
3
4
|
export function createPartnerController(ctx, pluginId, render) {
|
|
4
5
|
const listeners = new Set();
|
|
@@ -14,7 +15,7 @@ export function createPartnerController(ctx, pluginId, render) {
|
|
|
14
15
|
selected = companionId;
|
|
15
16
|
if (dispose === undefined) {
|
|
16
17
|
activatePluginWorkspace(pluginId);
|
|
17
|
-
dispose = ctx
|
|
18
|
+
dispose = registerMainPanel(ctx, pluginId, -3, props => render(props, controller), () => controller.close());
|
|
18
19
|
}
|
|
19
20
|
notify();
|
|
20
21
|
},
|
|
@@ -37,8 +38,7 @@ export function createPartnerController(ctx, pluginId, render) {
|
|
|
37
38
|
async startSession(companionId) {
|
|
38
39
|
const created = await api(`/companions/${encodeURIComponent(companionId)}/session`, { method: 'POST' });
|
|
39
40
|
await waitForClientSession(ctx, created.sessionId);
|
|
40
|
-
|
|
41
|
-
dispose = undefined;
|
|
41
|
+
controller.close();
|
|
42
42
|
sessions(ctx).open(created.sessionId);
|
|
43
43
|
},
|
|
44
44
|
async renewSession(routeId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-controller.js","sourceRoot":"","sources":["../src/client-controller.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAgBlE,MAAM,UAAU,uBAAuB,CAAC,GAAkB,EAAE,QAAgB,EAAE,MAA2F;IACvK,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAA;IACvC,IAAI,QAA4B,CAAA;IAChC,IAAI,WAA2C,CAAA;IAC/C,IAAI,OAAiC,CAAA;IACrC,MAAM,MAAM,GAAG,GAAS,EAAE,GAAG,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,QAAQ,EAAE,CAAA,CAAC,CAAC,CAAA;IAC3E,MAAM,UAAU,GAAsB;QACpC,IAAI,CAAC,WAAW,EAAE,MAAM;YACtB,WAAW,GAAG,MAAM,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;YACxC,IAAI,WAAW,KAAK,SAAS;gBAAE,QAAQ,GAAG,WAAW,CAAA;YACrD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,uBAAuB,CAAC,QAAQ,CAAC,CAAA;gBACjC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"client-controller.js","sourceRoot":"","sources":["../src/client-controller.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,uBAA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{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAsDnE,eAAO,MAAM,MAAM,UAAkC,CAAA;AAErD,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAS9C"}
|
package/lib/client.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(client_exports, {
|
|
|
35
35
|
inject: () => inject
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(client_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_react40 = require("react");
|
|
39
39
|
|
|
40
40
|
// src/workspace-ownership.ts
|
|
41
41
|
var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
|
|
@@ -8218,23 +8218,25 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
8218
8218
|
if (alive.current) setOperation(void 0);
|
|
8219
8219
|
}
|
|
8220
8220
|
};
|
|
8221
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("form", { className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
|
|
8221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("form", { id: "dsh-partner-identity-editor", className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
|
|
8222
8222
|
void submit(event);
|
|
8223
8223
|
}, children: [
|
|
8224
8224
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SectionHeading, { eyebrow: "IDENTITY", title: "\u5DE5\u4F5C\u8EAB\u4EFD", detail: "\u5B83\u4E0D\u662F\u4E00\u6B21\u5BF9\u8BDD\u7684\u63D0\u793A\u8BCD\uFF0C\u800C\u662F\u8FD9\u4E2A\u4F19\u4F34\u5728\u684C\u9762\u548C\u5FAE\u4FE1\u4E2D\u7684\u957F\u671F\u884C\u4E3A\u57FA\u7EBF\u3002" }),
|
|
8225
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("
|
|
8226
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.
|
|
8234
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8225
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { className: "dsh-partner-identity-card", "aria-label": "\u8EAB\u4EFD\u914D\u7F6E", children: [
|
|
8226
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-fields two", children: [
|
|
8227
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
|
|
8228
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
|
|
8229
|
+
] }),
|
|
8230
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormField, { label: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D", hint: "\u7528\u4E8E\u540D\u518C\u8BC6\u522B\uFF0C\u4E0D\u4F1A\u66FF\u4EE3\u5B8C\u6574\u884C\u4E3A\u51C6\u5219\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
|
|
8231
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormField, { label: "\u957F\u671F\u884C\u4E3A\u51C6\u5219", hint: "\u5EFA\u8BAE\u5199\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u4E0E\u8FB9\u754C\uFF1B\u6E20\u9053\u3001\u5DE5\u5177\u548C\u6388\u6743\u7531\u7CFB\u7EDF\u5355\u72EC\u63A7\u5236\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
|
|
8232
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
8233
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
8234
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
8235
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives19.IconCheckOutline14, { size: 14 }),
|
|
8236
|
+
"\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
|
|
8237
|
+
] }) }),
|
|
8238
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
|
|
8239
|
+
] })
|
|
8238
8240
|
] }),
|
|
8239
8241
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirming, children: [
|
|
8240
8242
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
|
|
@@ -8252,6 +8254,9 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
8252
8254
|
] });
|
|
8253
8255
|
}
|
|
8254
8256
|
|
|
8257
|
+
// src/ui/identity-editor.css
|
|
8258
|
+
var identity_editor_default = "/* Own the identity form skin without changing host forms or theme tokens. */\n#dsh-partner-identity-editor.dsh-partner-form {\n min-width: 0;\n padding: 0;\n border: 0;\n background: transparent;\n box-shadow: none;\n color: var(--partner-text);\n font-family: var(--partner-font-family);\n}\n#dsh-partner-identity-editor .dsh-partner-identity-card {\n min-width: 0;\n padding: 20px;\n border: 1px solid var(--partner-border);\n border-radius: 15px;\n background: var(--partner-card-surface);\n box-shadow: var(--partner-card-shadow);\n}\n#dsh-partner-identity-editor .dsh-partner-field > span { flex-wrap: wrap; gap: 4px 12px; }\n#dsh-partner-identity-editor .dsh-partner-field small { text-align: start; }\n#dsh-partner-identity-editor .dsh-partner-field :is(input, textarea) {\n appearance: none;\n box-sizing: border-box;\n width: 100%;\n min-height: 40px;\n padding: 10px 12px;\n border: 1px solid var(--partner-border);\n border-radius: 10px;\n outline: none;\n color: var(--partner-text);\n background: var(--partner-control);\n font: var(--partner-font-label)/1.5 var(--partner-font-family);\n box-shadow: inset 0 1px 0 var(--partner-glass-highlight);\n}\n#dsh-partner-identity-editor .dsh-partner-field textarea { resize: vertical; }\n#dsh-partner-identity-editor .dsh-partner-field :is(input, textarea):focus {\n border-color: var(--partner-focus-ring);\n background: var(--partner-raised);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 18%, transparent);\n}\n#dsh-partner-identity-editor .dsh-partner-form-actions { flex-wrap: wrap; gap: 12px; }\n#dsh-partner-identity-editor .dsh-partner-form-actions > button {\n min-height: 40px;\n padding: 0 16px;\n border: 1px solid var(--partner-border);\n border-radius: 10px;\n color: var(--partner-on-accent);\n background: var(--partner-accent-strong);\n box-shadow: none;\n font: 600 var(--partner-font-body)/1.4 var(--partner-font-family);\n}\n#dsh-partner-identity-editor .dsh-partner-form-actions > button:hover:not(:disabled) { filter: brightness(.94); }\n#dsh-partner-identity-editor .dsh-partner-identity-danger { flex-wrap: wrap; }\n#dsh-partner-identity-editor .dsh-partner-identity-danger > span { flex: 1 1 250px; }\n#dsh-partner-identity-editor .dsh-partner-identity-danger > div { display: flex; flex-wrap: wrap; gap: 8px; }\n#dsh-partner-identity-editor .dsh-partner-identity-danger button {\n min-height: 36px;\n padding: 6px 12px;\n border: 1px solid color-mix(in srgb, var(--partner-danger) 24%, transparent);\n border-radius: 8px;\n color: var(--partner-danger);\n background: transparent;\n box-shadow: none;\n font: var(--partner-font-caption)/1.4 var(--partner-font-family);\n}\n#dsh-partner-identity-editor button:focus-visible { outline: 2px solid var(--partner-focus-ring); outline-offset: 3px; }\n#dsh-partner-identity-editor :is(input, textarea, button):disabled { opacity: .55; cursor: default; }\n@media (max-width: 640px) {\n #dsh-partner-identity-editor .dsh-partner-identity-card { padding: 14px; }\n #dsh-partner-identity-editor .dsh-partner-fields.two { grid-template-columns: minmax(0, 1fr); }\n}\n@media (forced-colors: active) {\n #dsh-partner-identity-editor .dsh-partner-field :is(input, textarea):focus { outline: 2px solid Highlight; }\n}\n";
|
|
8259
|
+
|
|
8255
8260
|
// src/ui/companion-create.tsx
|
|
8256
8261
|
var import_react38 = require("react");
|
|
8257
8262
|
var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
@@ -8307,6 +8312,43 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
8307
8312
|
] }) });
|
|
8308
8313
|
}
|
|
8309
8314
|
|
|
8315
|
+
// src/main-panel-compat.ts
|
|
8316
|
+
var import_react39 = require("react");
|
|
8317
|
+
function registerMainPanel(ctx, id, priority, render, onHidden = () => {
|
|
8318
|
+
}) {
|
|
8319
|
+
const layout = ctx.layout;
|
|
8320
|
+
if (typeof layout.selectPanel !== "function") {
|
|
8321
|
+
return ctx.slots.register({ name: "conversation", priority }, render);
|
|
8322
|
+
}
|
|
8323
|
+
const slots = ctx.slots;
|
|
8324
|
+
let disposed = false;
|
|
8325
|
+
let generation = 0;
|
|
8326
|
+
const Body = (props) => {
|
|
8327
|
+
(0, import_react39.useEffect)(() => {
|
|
8328
|
+
const current2 = ++generation;
|
|
8329
|
+
return () => {
|
|
8330
|
+
queueMicrotask(() => {
|
|
8331
|
+
if (!disposed && generation === current2) onHidden();
|
|
8332
|
+
});
|
|
8333
|
+
};
|
|
8334
|
+
}, []);
|
|
8335
|
+
return render(props);
|
|
8336
|
+
};
|
|
8337
|
+
const remove = slots.register({ name: "main", key: id }, Body);
|
|
8338
|
+
const dispose = () => {
|
|
8339
|
+
if (disposed) return;
|
|
8340
|
+
disposed = true;
|
|
8341
|
+
remove();
|
|
8342
|
+
};
|
|
8343
|
+
try {
|
|
8344
|
+
layout.selectPanel(id);
|
|
8345
|
+
} catch (error) {
|
|
8346
|
+
dispose();
|
|
8347
|
+
throw error;
|
|
8348
|
+
}
|
|
8349
|
+
return dispose;
|
|
8350
|
+
}
|
|
8351
|
+
|
|
8310
8352
|
// src/client-controller.tsx
|
|
8311
8353
|
function createPartnerController(ctx, pluginId, render) {
|
|
8312
8354
|
const listeners2 = /* @__PURE__ */ new Set();
|
|
@@ -8322,7 +8364,7 @@ function createPartnerController(ctx, pluginId, render) {
|
|
|
8322
8364
|
if (companionId !== void 0) selected = companionId;
|
|
8323
8365
|
if (dispose === void 0) {
|
|
8324
8366
|
activatePluginWorkspace(pluginId);
|
|
8325
|
-
dispose = ctx
|
|
8367
|
+
dispose = registerMainPanel(ctx, pluginId, -3, (props) => render(props, controller), () => controller.close());
|
|
8326
8368
|
}
|
|
8327
8369
|
notify();
|
|
8328
8370
|
},
|
|
@@ -8349,8 +8391,7 @@ function createPartnerController(ctx, pluginId, render) {
|
|
|
8349
8391
|
async startSession(companionId) {
|
|
8350
8392
|
const created = await api(`/companions/${encodeURIComponent(companionId)}/session`, { method: "POST" });
|
|
8351
8393
|
await waitForClientSession(ctx, created.sessionId);
|
|
8352
|
-
|
|
8353
|
-
dispose = void 0;
|
|
8394
|
+
controller.close();
|
|
8354
8395
|
sessions(ctx).open(created.sessionId);
|
|
8355
8396
|
},
|
|
8356
8397
|
async renewSession(routeId) {
|
|
@@ -8400,7 +8441,8 @@ ${responsive_ui_default}
|
|
|
8400
8441
|
${requirement_board_default}
|
|
8401
8442
|
${widget_default}
|
|
8402
8443
|
${settings_panel_default}
|
|
8403
|
-
${memory_ui_default}
|
|
8444
|
+
${memory_ui_default}
|
|
8445
|
+
${identity_editor_default}`;
|
|
8404
8446
|
var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "pendant"]);
|
|
8405
8447
|
var inject = ["slots", "layout", "sessions"];
|
|
8406
8448
|
function apply(ctx) {
|
|
@@ -8416,13 +8458,13 @@ function apply(ctx) {
|
|
|
8416
8458
|
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
|
|
8417
8459
|
}
|
|
8418
8460
|
function PartnerSidebar(props) {
|
|
8419
|
-
const ref = (0,
|
|
8461
|
+
const ref = (0, import_react40.useRef)(null);
|
|
8420
8462
|
useWorkspaceTopAnchor(ref);
|
|
8421
|
-
const [open, setOpen] = (0,
|
|
8422
|
-
const [snapshot, setSnapshot] = (0,
|
|
8423
|
-
const [, update] = (0,
|
|
8424
|
-
(0,
|
|
8425
|
-
(0,
|
|
8463
|
+
const [open, setOpen] = (0, import_react40.useState)(true);
|
|
8464
|
+
const [snapshot, setSnapshot] = (0, import_react40.useState)();
|
|
8465
|
+
const [, update] = (0, import_react40.useState)(0);
|
|
8466
|
+
(0, import_react40.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
|
|
8467
|
+
(0, import_react40.useEffect)(() => {
|
|
8426
8468
|
void loadPartner().then(setSnapshot).catch(() => {
|
|
8427
8469
|
});
|
|
8428
8470
|
}, [props.controller.isOpen()]);
|
|
@@ -8447,17 +8489,17 @@ function PartnerSidebar(props) {
|
|
|
8447
8489
|
] });
|
|
8448
8490
|
}
|
|
8449
8491
|
function PartnerWorkspace({ controller }) {
|
|
8450
|
-
const [snapshot, setSnapshot] = (0,
|
|
8451
|
-
const [selectedId, setSelectedId] = (0,
|
|
8452
|
-
const [view, setView] = (0,
|
|
8453
|
-
const [requestedDestination, setRequestedDestination] = (0,
|
|
8454
|
-
const [error, setError] = (0,
|
|
8455
|
-
const [loading, setLoading] = (0,
|
|
8456
|
-
const [creatingCompanion, setCreatingCompanion] = (0,
|
|
8457
|
-
const [notice, setNotice] = (0,
|
|
8458
|
-
const selectionRef = (0,
|
|
8492
|
+
const [snapshot, setSnapshot] = (0, import_react40.useState)();
|
|
8493
|
+
const [selectedId, setSelectedId] = (0, import_react40.useState)(controller.selected());
|
|
8494
|
+
const [view, setView] = (0, import_react40.useState)(controller.destination()?.page ?? "home");
|
|
8495
|
+
const [requestedDestination, setRequestedDestination] = (0, import_react40.useState)(controller.destination());
|
|
8496
|
+
const [error, setError] = (0, import_react40.useState)();
|
|
8497
|
+
const [loading, setLoading] = (0, import_react40.useState)(true);
|
|
8498
|
+
const [creatingCompanion, setCreatingCompanion] = (0, import_react40.useState)(false);
|
|
8499
|
+
const [notice, setNotice] = (0, import_react40.useState)();
|
|
8500
|
+
const selectionRef = (0, import_react40.useRef)({ selectedId, companions: snapshot?.companions });
|
|
8459
8501
|
selectionRef.current = { selectedId, companions: snapshot?.companions };
|
|
8460
|
-
const refresh = (0,
|
|
8502
|
+
const refresh = (0, import_react40.useCallback)(async (throwOnError = false) => {
|
|
8461
8503
|
try {
|
|
8462
8504
|
const next = await loadPartner();
|
|
8463
8505
|
setSnapshot(next);
|
|
@@ -8470,10 +8512,10 @@ function PartnerWorkspace({ controller }) {
|
|
|
8470
8512
|
setLoading(false);
|
|
8471
8513
|
}
|
|
8472
8514
|
}, []);
|
|
8473
|
-
(0,
|
|
8515
|
+
(0, import_react40.useEffect)(() => {
|
|
8474
8516
|
void refresh();
|
|
8475
8517
|
}, [refresh]);
|
|
8476
|
-
(0,
|
|
8518
|
+
(0, import_react40.useEffect)(() => controller.subscribe(() => {
|
|
8477
8519
|
const next = controller.selected();
|
|
8478
8520
|
if (next) setSelectedId(next);
|
|
8479
8521
|
const destination = controller.destination();
|
|
@@ -8754,10 +8796,10 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
8754
8796
|
}
|
|
8755
8797
|
function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
8756
8798
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
8757
|
-
const [login, setLogin] = (0,
|
|
8758
|
-
const [busy, setBusy] = (0,
|
|
8759
|
-
const [error, setError] = (0,
|
|
8760
|
-
(0,
|
|
8799
|
+
const [login, setLogin] = (0, import_react40.useState)();
|
|
8800
|
+
const [busy, setBusy] = (0, import_react40.useState)(false);
|
|
8801
|
+
const [error, setError] = (0, import_react40.useState)();
|
|
8802
|
+
(0, import_react40.useEffect)(() => {
|
|
8761
8803
|
if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
|
|
8762
8804
|
const timer = window.setInterval(() => {
|
|
8763
8805
|
void api(`/weixin/login/${login.id}`).then(async (result) => {
|