dsh-agent-persona 0.1.3 → 0.1.4
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/CHANGELOG.md +23 -0
- package/lib/client.js +60 -25
- package/lib/remote.d.ts +5 -0
- package/lib/remote.js +11 -5
- package/lib/typert.d.ts +6 -0
- package/lib/typert.js +11 -5
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ All notable changes to this project are documented here.
|
|
|
4
4
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.1.4] - 2026-10-08
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **适配 DSH 0.2.0-rc.2。** 三处不兼容导致插件在新版本上完全无法使用:
|
|
12
|
+
|
|
13
|
+
1. **Typert strict codec 缺少 `create()` 工厂方法。** 0.2.0 的 typert-loader 和 gateway 要求每个 strict codec
|
|
14
|
+
提供 `create()` 并返回一个带 `parse()` 方法的对象,gateway 在处理 RPC 调用时执行 `codec.create().parse(value)`
|
|
15
|
+
进行边界校验。`generate-remote.mjs` 生成的 `remote.ts` 和 `typert.ts` 中的 codec 都只有
|
|
16
|
+
`{ mode, typeSymbol, schema }` 三个字段,缺少 `create`/`decode`/`encode`,导致宿主端 typert-loader 注册失败
|
|
17
|
+
(启动时报 warning "1 entry did not activate"),客户端 `ctx.remote.$mount()` 抛出异常使 `capturedApi` 始终
|
|
18
|
+
为 `undefined`,页面渲染回退为"插件还没加载好"错误提示,同时所有带参数的 RPC 调用(如 `sessionPrompt`、
|
|
19
|
+
`savePersona`)在 gateway 层因 `codec.create()` 返回 `undefined` 而报
|
|
20
|
+
"wire field \"input\" failed boundary validation"。
|
|
21
|
+
|
|
22
|
+
2. **图标组件名称变更。** `dsh-client-ui-primitives` 0.2.0-rc.2 将图标命名规则从尺寸后缀(如 `IconPlusOutline16`)
|
|
23
|
+
改为粗细后缀(如 `IconPlusOutlineRegular`),旧名称不再导出。从 primitives 解构出的 18 个图标全部为 `undefined`,
|
|
24
|
+
`verifyElements()` 检查失败,页面无法渲染。
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- `dsh.compatibility.dshReleases` 新增 `0.2.0-rc.2: compatible`。
|
|
29
|
+
|
|
7
30
|
## [0.1.3] - 2026-09-23
|
|
8
31
|
|
|
9
32
|
### Fixed
|
package/lib/client.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
// src/remote.ts
|
|
3
3
|
var PKG = "dsh-agent-persona";
|
|
4
|
-
var codec = (typeSymbol, parse) =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
var codec = (typeSymbol, parse) => {
|
|
5
|
+
const schema = { parse };
|
|
6
|
+
return {
|
|
7
|
+
mode: "strict",
|
|
8
|
+
typeSymbol: `${PKG}#${typeSymbol}`,
|
|
9
|
+
schema,
|
|
10
|
+
create: () => schema,
|
|
11
|
+
decode: (v) => v,
|
|
12
|
+
encode: (v) => v
|
|
13
|
+
};
|
|
14
|
+
};
|
|
9
15
|
var passthrough = (value) => value;
|
|
10
16
|
var asInput = (value) => {
|
|
11
17
|
if (value === void 0 || value === null) return {};
|
|
@@ -61,25 +67,44 @@
|
|
|
61
67
|
Toast,
|
|
62
68
|
Pill,
|
|
63
69
|
Tooltip,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
IconCheckOutlineRegular,
|
|
71
|
+
IconChevronDownOutlineRegular,
|
|
72
|
+
IconChevronRightOutlineRegular,
|
|
73
|
+
IconAgentPresetOutlineRegular,
|
|
74
|
+
IconBrowseOutlineRegular,
|
|
75
|
+
IconChevronUpOutlineRegular,
|
|
76
|
+
IconCloseOutlineRegular,
|
|
77
|
+
IconEditOutlineRegular,
|
|
78
|
+
IconEllipsisOutlineRegular,
|
|
79
|
+
IconEnhanceOutlineRegular,
|
|
80
|
+
IconFolderOpenRegular,
|
|
81
|
+
IconListPenOutlineRegular,
|
|
82
|
+
IconPersonalizationOutlineRegular,
|
|
83
|
+
IconRefreshOutlineRegular,
|
|
84
|
+
IconUserOutlineRegular,
|
|
85
|
+
IconWarningOutlineRegular,
|
|
86
|
+
IconPlusOutlineRegular,
|
|
87
|
+
IconTrashOutlineRegular
|
|
82
88
|
} = primitives;
|
|
89
|
+
const sized = (icon, size) => (props) => h(icon, { size, ...props });
|
|
90
|
+
const IconCheckOutline14 = sized(IconCheckOutlineRegular, 14);
|
|
91
|
+
const IconChevronDownOutline14 = sized(IconChevronDownOutlineRegular, 14);
|
|
92
|
+
const IconChevronRightOutline14 = sized(IconChevronRightOutlineRegular, 14);
|
|
93
|
+
const IconChevronUpOutline14 = sized(IconChevronUpOutlineRegular, 14);
|
|
94
|
+
const IconAgentPresetOutline16 = sized(IconAgentPresetOutlineRegular, 16);
|
|
95
|
+
const IconBrowseOutline16 = sized(IconBrowseOutlineRegular, 16);
|
|
96
|
+
const IconCloseOutline16 = sized(IconCloseOutlineRegular, 16);
|
|
97
|
+
const IconEditOutline16 = sized(IconEditOutlineRegular, 16);
|
|
98
|
+
const IconEllipsisOutline16 = sized(IconEllipsisOutlineRegular, 16);
|
|
99
|
+
const IconEnhanceOutline16 = sized(IconEnhanceOutlineRegular, 16);
|
|
100
|
+
const IconFolderOpen16 = sized(IconFolderOpenRegular, 16);
|
|
101
|
+
const IconListPenOutline16 = sized(IconListPenOutlineRegular, 16);
|
|
102
|
+
const IconPersonalizationOutline16 = sized(IconPersonalizationOutlineRegular, 16);
|
|
103
|
+
const IconRefreshOutline16 = sized(IconRefreshOutlineRegular, 16);
|
|
104
|
+
const IconUserOutline16 = sized(IconUserOutlineRegular, 16);
|
|
105
|
+
const IconWarningOutline16 = sized(IconWarningOutlineRegular, 16);
|
|
106
|
+
const IconPlusOutline16 = sized(IconPlusOutlineRegular, 16);
|
|
107
|
+
const IconTrashOutline16 = sized(IconTrashOutlineRegular, 16);
|
|
83
108
|
const NS = "agent-persona";
|
|
84
109
|
const MOD_KEY = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform ?? navigator.userAgent ?? "") ? "\u2318" : "Ctrl+";
|
|
85
110
|
const DESCRIPTION = "\u7ED9\u4E0D\u540C\u7684\u5DE5\u4F5C\u533A\u3001\u4E0D\u540C\u7684\u4F1A\u8BDD\u7528\u4E0D\u540C\u7684\u4EBA\u8BBE\u3002\u4EBA\u8BBE\u4F1A\u4F5C\u4E3A\u7CFB\u7EDF\u63D0\u793A\u8BCD\u6CE8\u5165\uFF0C\u4F18\u5148\u7EA7\u9AD8\u4E8E\u5DE5\u4F5C\u533A\u91CC\u7684 AGENTS.md\u3002";
|
|
@@ -784,6 +809,10 @@
|
|
|
784
809
|
}
|
|
785
810
|
return raw;
|
|
786
811
|
};
|
|
812
|
+
const sessionIdOf = (props) => {
|
|
813
|
+
const id = props?.sessionId ?? props?.session?.id ?? props?.scope?.sessionId;
|
|
814
|
+
return typeof id === "string" && id !== "" ? id : null;
|
|
815
|
+
};
|
|
787
816
|
const SidebarPersonaView = (props) => h(PersonaView, { ...props, host: "sidebar" });
|
|
788
817
|
class PersonaView extends React.Component {
|
|
789
818
|
constructor(props) {
|
|
@@ -793,9 +822,15 @@
|
|
|
793
822
|
componentDidMount() {
|
|
794
823
|
void this.load();
|
|
795
824
|
}
|
|
825
|
+
/**
|
|
826
|
+
* A sidebar tab stays mounted while the reader moves between sessions, so the view has to follow the
|
|
827
|
+
* session it is showing; otherwise it keeps rendering the one it was first opened for.
|
|
828
|
+
*/
|
|
829
|
+
componentDidUpdate(previous) {
|
|
830
|
+
if (this.sessionId() !== sessionIdOf(previous)) void this.load();
|
|
831
|
+
}
|
|
796
832
|
sessionId() {
|
|
797
|
-
|
|
798
|
-
return typeof id === "string" && id !== "" ? id : null;
|
|
833
|
+
return sessionIdOf(this.props);
|
|
799
834
|
}
|
|
800
835
|
async load() {
|
|
801
836
|
const api = apiOf(this.props);
|
package/lib/remote.d.ts
CHANGED
package/lib/remote.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
// 该文件由 scripts/generate-remote.mjs 生成,请勿手改(改 src/endpoints.ts 后重新生成)。
|
|
2
2
|
const PKG = "dsh-agent-persona";
|
|
3
|
-
const codec = (typeSymbol, parse) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
3
|
+
const codec = (typeSymbol, parse) => {
|
|
4
|
+
const schema = { parse };
|
|
5
|
+
return {
|
|
6
|
+
mode: "strict",
|
|
7
|
+
typeSymbol: `${PKG}#${typeSymbol}`,
|
|
8
|
+
schema,
|
|
9
|
+
create: () => schema,
|
|
10
|
+
decode: (v) => v,
|
|
11
|
+
encode: (v) => v,
|
|
12
|
+
};
|
|
13
|
+
};
|
|
8
14
|
const passthrough = (value) => value;
|
|
9
15
|
const asInput = (value) => {
|
|
10
16
|
if (value === undefined || value === null)
|
package/lib/typert.d.ts
CHANGED
|
@@ -37,12 +37,18 @@ export declare const TYPERT: {
|
|
|
37
37
|
mode: string;
|
|
38
38
|
typeSymbol: string;
|
|
39
39
|
schema: z.ZodUnknown;
|
|
40
|
+
create: () => z.ZodUnknown;
|
|
41
|
+
decode: (v: any) => any;
|
|
42
|
+
encode: (v: any) => any;
|
|
40
43
|
};
|
|
41
44
|
}[];
|
|
42
45
|
result: {
|
|
43
46
|
mode: string;
|
|
44
47
|
typeSymbol: string;
|
|
45
48
|
schema: z.ZodUnknown;
|
|
49
|
+
create: () => z.ZodUnknown;
|
|
50
|
+
decode: (v: any) => any;
|
|
51
|
+
encode: (v: any) => any;
|
|
46
52
|
};
|
|
47
53
|
}[];
|
|
48
54
|
};
|
package/lib/typert.js
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
const PKG = "dsh-agent-persona";
|
|
4
4
|
const direct = { kind: "direct" };
|
|
5
|
-
const jsonCodec = (typeSymbol) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
const jsonCodec = (typeSymbol) => {
|
|
6
|
+
const schema = z.unknown();
|
|
7
|
+
return {
|
|
8
|
+
mode: "strict",
|
|
9
|
+
typeSymbol: `${PKG}#${typeSymbol}`,
|
|
10
|
+
schema,
|
|
11
|
+
create: () => schema,
|
|
12
|
+
decode: (v) => v,
|
|
13
|
+
encode: (v) => v,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
10
16
|
const result = (typeSymbol) => jsonCodec(typeSymbol);
|
|
11
17
|
export const TYPERT = {
|
|
12
18
|
package: PKG,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agent-persona",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Workspace personas for DeepSeek Harness (DSH): create many system-prompt personas and scope each one by workspace path or session id (exact / prefix / regex / contains), managed from a Web settings page with Markdown editing and AI tuning.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -81,7 +81,8 @@
|
|
|
81
81
|
"compatibility": {
|
|
82
82
|
"dshReleases": {
|
|
83
83
|
"0.1.5-rc.1": "compatible",
|
|
84
|
-
"0.1.5-rc.2": "compatible"
|
|
84
|
+
"0.1.5-rc.2": "compatible",
|
|
85
|
+
"0.2.0-rc.2": "compatible"
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
},
|