@istarry/dsh-assistant-profile 0.3.2 → 0.4.1
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/lib/client.js +5110 -5
- package/lib/client.js.map +1 -1
- package/lib/index.js +21 -21
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +285 -0
- package/lib/typert.remote-client.d.ts +32 -0
- package/lib/typert.remote-client.js +202 -0
- package/package.json +17 -5
package/lib/index.js
CHANGED
|
@@ -2742,45 +2742,45 @@ const REMEMBER_INSTRUCTION = "你是一个长期记忆提炼引擎。用户从
|
|
|
2742
2742
|
let AssistantProfile = (() => {
|
|
2743
2743
|
let _classSuper = TypertRemoteService;
|
|
2744
2744
|
let _instanceExtraInitializers = [];
|
|
2745
|
-
let
|
|
2746
|
-
let
|
|
2747
|
-
let
|
|
2745
|
+
let _readGlobal_decorators;
|
|
2746
|
+
let _writeGlobal_decorators;
|
|
2747
|
+
let _remember_decorators;
|
|
2748
2748
|
return class AssistantProfile extends _classSuper {
|
|
2749
2749
|
static {
|
|
2750
2750
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
__esDecorate(this, null,
|
|
2751
|
+
_readGlobal_decorators = [Remote("readGlobal")];
|
|
2752
|
+
_writeGlobal_decorators = [Remote("writeGlobal")];
|
|
2753
|
+
_remember_decorators = [Remote("remember")];
|
|
2754
|
+
__esDecorate(this, null, _readGlobal_decorators, {
|
|
2755
2755
|
kind: "method",
|
|
2756
|
-
name: "
|
|
2756
|
+
name: "readGlobal",
|
|
2757
2757
|
static: false,
|
|
2758
2758
|
private: false,
|
|
2759
2759
|
access: {
|
|
2760
|
-
has: (obj) => "
|
|
2761
|
-
get: (obj) => obj.
|
|
2760
|
+
has: (obj) => "readGlobal" in obj,
|
|
2761
|
+
get: (obj) => obj.readGlobal
|
|
2762
2762
|
},
|
|
2763
2763
|
metadata: _metadata
|
|
2764
2764
|
}, null, _instanceExtraInitializers);
|
|
2765
|
-
__esDecorate(this, null,
|
|
2765
|
+
__esDecorate(this, null, _writeGlobal_decorators, {
|
|
2766
2766
|
kind: "method",
|
|
2767
|
-
name: "
|
|
2767
|
+
name: "writeGlobal",
|
|
2768
2768
|
static: false,
|
|
2769
2769
|
private: false,
|
|
2770
2770
|
access: {
|
|
2771
|
-
has: (obj) => "
|
|
2772
|
-
get: (obj) => obj.
|
|
2771
|
+
has: (obj) => "writeGlobal" in obj,
|
|
2772
|
+
get: (obj) => obj.writeGlobal
|
|
2773
2773
|
},
|
|
2774
2774
|
metadata: _metadata
|
|
2775
2775
|
}, null, _instanceExtraInitializers);
|
|
2776
|
-
__esDecorate(this, null,
|
|
2776
|
+
__esDecorate(this, null, _remember_decorators, {
|
|
2777
2777
|
kind: "method",
|
|
2778
|
-
name: "
|
|
2778
|
+
name: "remember",
|
|
2779
2779
|
static: false,
|
|
2780
2780
|
private: false,
|
|
2781
2781
|
access: {
|
|
2782
|
-
has: (obj) => "
|
|
2783
|
-
get: (obj) => obj.
|
|
2782
|
+
has: (obj) => "remember" in obj,
|
|
2783
|
+
get: (obj) => obj.remember
|
|
2784
2784
|
},
|
|
2785
2785
|
metadata: _metadata
|
|
2786
2786
|
}, null, _instanceExtraInitializers);
|
|
@@ -2888,11 +2888,11 @@ let AssistantProfile = (() => {
|
|
|
2888
2888
|
};
|
|
2889
2889
|
}
|
|
2890
2890
|
/** 读取记忆全文(设置页编辑框)。 */
|
|
2891
|
-
|
|
2891
|
+
readGlobal() {
|
|
2892
2892
|
return readMemoryText();
|
|
2893
2893
|
}
|
|
2894
2894
|
/** 整体保存记忆(设置页编辑框的保存按钮)。 */
|
|
2895
|
-
|
|
2895
|
+
writeGlobal(text) {
|
|
2896
2896
|
writeMemory(text);
|
|
2897
2897
|
}
|
|
2898
2898
|
/** 追加一条记忆(内部使用/将来的其它入口)。 */
|
|
@@ -2908,7 +2908,7 @@ let AssistantProfile = (() => {
|
|
|
2908
2908
|
* @param text - 选中的对话文本。
|
|
2909
2909
|
* @returns 是否写入、写入了哪些条目,以及失败原因。
|
|
2910
2910
|
*/
|
|
2911
|
-
async
|
|
2911
|
+
async remember(sessionId, text) {
|
|
2912
2912
|
const agent = this.ctx.get("agents")?.get(SessionId(sessionId));
|
|
2913
2913
|
if (agent === void 0) return {
|
|
2914
2914
|
saved: false,
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_parameter_0$schema$value
|
|
5
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_parameter_0$schema$value ??= z.string())
|
|
6
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_result$schema$value
|
|
7
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_result$schema$value ??= z.void())
|
|
8
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_parameter_0$schema$value
|
|
9
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_parameter_0$schema$value ??= z.string())
|
|
10
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_result$schema$value
|
|
11
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_result$schema$value ??= z.string())
|
|
12
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_readGlobal_result$schema$value
|
|
13
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_readGlobal_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_readGlobal_result$schema$value ??= z.string())
|
|
14
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_0$schema$value
|
|
15
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_0$schema$value ??= z.string())
|
|
16
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_1$schema$value
|
|
17
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_1$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_1$schema$value ??= z.string())
|
|
18
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_remember_result$schema$value
|
|
19
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_remember_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_remember_result$schema$value ??= z.object({
|
|
20
|
+
'saved': z.boolean().readonly(),
|
|
21
|
+
'agentId': z.string().readonly().optional(),
|
|
22
|
+
'outcome': z.string().readonly().optional(),
|
|
23
|
+
'entries': z.array(z.string()).readonly().optional(),
|
|
24
|
+
}))
|
|
25
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_0$schema$value
|
|
26
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_0$schema$value ??= z.string())
|
|
27
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_1$schema$value
|
|
28
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_1$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_1$schema$value ??= z.string())
|
|
29
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_result$schema$value
|
|
30
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_result$schema$value ??= z.void())
|
|
31
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_parameter_0$schema$value
|
|
32
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_parameter_0$schema$value ??= z.string())
|
|
33
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_result$schema$value
|
|
34
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_result$schema$value ??= z.void())
|
|
35
|
+
|
|
36
|
+
export const TYPERT = {
|
|
37
|
+
package: '@istarry/dsh-assistant-profile',
|
|
38
|
+
face: 'host',
|
|
39
|
+
schemas: [
|
|
40
|
+
],
|
|
41
|
+
invocations: [
|
|
42
|
+
{
|
|
43
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/purgeAgent',
|
|
44
|
+
service: 'assistantProfile',
|
|
45
|
+
namespace: 'assistantProfile',
|
|
46
|
+
method: 'purgeAgent',
|
|
47
|
+
invocation: { kind: 'direct' },
|
|
48
|
+
parameters: [
|
|
49
|
+
{
|
|
50
|
+
name: 'agentId',
|
|
51
|
+
wire: 'agentId',
|
|
52
|
+
source: 'json',
|
|
53
|
+
codec: {
|
|
54
|
+
mode: 'strict',
|
|
55
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/purgeAgent:agentId',
|
|
56
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_parameter_0$schema,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
result: {
|
|
61
|
+
mode: 'strict',
|
|
62
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/purgeAgent:result',
|
|
63
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_result$schema,
|
|
64
|
+
},
|
|
65
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":325,"column":3},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/readAgent',
|
|
69
|
+
service: 'assistantProfile',
|
|
70
|
+
namespace: 'assistantProfile',
|
|
71
|
+
method: 'readAgent',
|
|
72
|
+
invocation: { kind: 'direct' },
|
|
73
|
+
parameters: [
|
|
74
|
+
{
|
|
75
|
+
name: 'agentId',
|
|
76
|
+
wire: 'agentId',
|
|
77
|
+
source: 'json',
|
|
78
|
+
codec: {
|
|
79
|
+
mode: 'strict',
|
|
80
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/readAgent:agentId',
|
|
81
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_parameter_0$schema,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
result: {
|
|
86
|
+
mode: 'strict',
|
|
87
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/readAgent:result',
|
|
88
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_result$schema,
|
|
89
|
+
},
|
|
90
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":313,"column":3},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/readGlobal',
|
|
94
|
+
service: 'assistantProfile',
|
|
95
|
+
namespace: 'assistantProfile',
|
|
96
|
+
method: 'readGlobal',
|
|
97
|
+
invocation: { kind: 'direct' },
|
|
98
|
+
parameters: [
|
|
99
|
+
],
|
|
100
|
+
result: {
|
|
101
|
+
mode: 'strict',
|
|
102
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/readGlobal:result',
|
|
103
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_readGlobal_result$schema,
|
|
104
|
+
},
|
|
105
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":301,"column":3},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/remember',
|
|
109
|
+
service: 'assistantProfile',
|
|
110
|
+
namespace: 'assistantProfile',
|
|
111
|
+
method: 'remember',
|
|
112
|
+
invocation: { kind: 'direct' },
|
|
113
|
+
parameters: [
|
|
114
|
+
{
|
|
115
|
+
name: 'sessionId',
|
|
116
|
+
wire: 'sessionId',
|
|
117
|
+
source: 'json',
|
|
118
|
+
codec: {
|
|
119
|
+
mode: 'strict',
|
|
120
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/remember:sessionId',
|
|
121
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_0$schema,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'text',
|
|
126
|
+
wire: 'text',
|
|
127
|
+
source: 'json',
|
|
128
|
+
codec: {
|
|
129
|
+
mode: 'strict',
|
|
130
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/remember:text',
|
|
131
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_1$schema,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
result: {
|
|
136
|
+
mode: 'strict',
|
|
137
|
+
typeSymbol: '@istarry/dsh-assistant-profile/types#RememberValue',
|
|
138
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_remember_result$schema,
|
|
139
|
+
},
|
|
140
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":347,"column":9},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/writeAgent',
|
|
144
|
+
service: 'assistantProfile',
|
|
145
|
+
namespace: 'assistantProfile',
|
|
146
|
+
method: 'writeAgent',
|
|
147
|
+
invocation: { kind: 'direct' },
|
|
148
|
+
parameters: [
|
|
149
|
+
{
|
|
150
|
+
name: 'agentId',
|
|
151
|
+
wire: 'agentId',
|
|
152
|
+
source: 'json',
|
|
153
|
+
codec: {
|
|
154
|
+
mode: 'strict',
|
|
155
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeAgent:agentId',
|
|
156
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_0$schema,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'text',
|
|
161
|
+
wire: 'text',
|
|
162
|
+
source: 'json',
|
|
163
|
+
codec: {
|
|
164
|
+
mode: 'strict',
|
|
165
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeAgent:text',
|
|
166
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_1$schema,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
result: {
|
|
171
|
+
mode: 'strict',
|
|
172
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeAgent:result',
|
|
173
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_result$schema,
|
|
174
|
+
},
|
|
175
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":319,"column":3},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/writeGlobal',
|
|
179
|
+
service: 'assistantProfile',
|
|
180
|
+
namespace: 'assistantProfile',
|
|
181
|
+
method: 'writeGlobal',
|
|
182
|
+
invocation: { kind: 'direct' },
|
|
183
|
+
parameters: [
|
|
184
|
+
{
|
|
185
|
+
name: 'text',
|
|
186
|
+
wire: 'text',
|
|
187
|
+
source: 'json',
|
|
188
|
+
codec: {
|
|
189
|
+
mode: 'strict',
|
|
190
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeGlobal:text',
|
|
191
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_parameter_0$schema,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
result: {
|
|
196
|
+
mode: 'strict',
|
|
197
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeGlobal:result',
|
|
198
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_result$schema,
|
|
199
|
+
},
|
|
200
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":307,"column":3},
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
model: {
|
|
204
|
+
"services": [
|
|
205
|
+
{
|
|
206
|
+
"description": "Memory service: the harness-home stores, the switches, the prompt sections, and the model-facing `memory_add` tool.",
|
|
207
|
+
"summary": "Memory service: the harness-home stores, the switches, the prompt sections, and the model-facing `memory_add` tool.",
|
|
208
|
+
"tags": [],
|
|
209
|
+
"jsDoc": "/** Memory service: the harness-home stores, the switches, the prompt sections, and the model-facing `memory_add` tool. */",
|
|
210
|
+
"key": "assistantProfile",
|
|
211
|
+
"exportName": "default",
|
|
212
|
+
"members": [
|
|
213
|
+
{
|
|
214
|
+
"kind": "method",
|
|
215
|
+
"name": "resolveAgentId",
|
|
216
|
+
"signature": "resolveAgentId(agent: { id: string; ctx: Context }): string",
|
|
217
|
+
"summary": "The user-agent id behind one live agent.",
|
|
218
|
+
"jsDoc": "/**\n * The user-agent id behind one live agent. `agent.id` is the SessionId, not\n * a preset id: the owning user agent is the preset the agent joined\n * (`composedPreset` -> `<agentId>-<modeId>`), split back to `<agentId>`.\n * @param agent - a live agent (or the slim `{ id, ctx }` shape).\n * @returns the user-agent id whose memory store applies.\n */"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"kind": "method",
|
|
222
|
+
"name": "readGlobal",
|
|
223
|
+
"signature": "@Remote('readGlobal') readGlobal(): string",
|
|
224
|
+
"summary": "Global store text (editor read).",
|
|
225
|
+
"jsDoc": "/** Global store text (editor read). */"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"kind": "method",
|
|
229
|
+
"name": "writeGlobal",
|
|
230
|
+
"signature": "@Remote('writeGlobal') writeGlobal(text: string): void",
|
|
231
|
+
"summary": "Global store save (editor write).",
|
|
232
|
+
"jsDoc": "/** Global store save (editor write). */"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"kind": "method",
|
|
236
|
+
"name": "readAgent",
|
|
237
|
+
"signature": "@Remote('readAgent') readAgent(agentId: string): string",
|
|
238
|
+
"summary": "One agent store text (editor read).",
|
|
239
|
+
"jsDoc": "/** One agent store text (editor read). */"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"kind": "method",
|
|
243
|
+
"name": "writeAgent",
|
|
244
|
+
"signature": "@Remote('writeAgent') writeAgent(agentId: string, text: string): void",
|
|
245
|
+
"summary": "One agent store save (editor write).",
|
|
246
|
+
"jsDoc": "/** One agent store save (editor write). */"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"kind": "method",
|
|
250
|
+
"name": "purgeAgent",
|
|
251
|
+
"signature": "@Remote('purgeAgent') purgeAgent(agentId: string): void",
|
|
252
|
+
"summary": "Remove one agent's whole memory store directory (the agent-delete purge).",
|
|
253
|
+
"jsDoc": "/** Remove one agent's whole memory store directory (the agent-delete purge). */"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"kind": "method",
|
|
257
|
+
"name": "appendAgent",
|
|
258
|
+
"signature": "appendAgent(agentId: string, content: string): MemoryAppendResult",
|
|
259
|
+
"summary": "Append one fact to an agent store (deduped, timestamped).",
|
|
260
|
+
"jsDoc": "/** Append one fact to an agent store (deduped, timestamped). */"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"kind": "method",
|
|
264
|
+
"name": "remember",
|
|
265
|
+
"signature": "@Remote('remember') async remember(sessionId: string, text: string): Promise<RememberValue>",
|
|
266
|
+
"summary": "Analyze selected conversation text with the agent's own model and write the resulting memory entries to the agent's store.",
|
|
267
|
+
"jsDoc": "/**\n * Analyze selected conversation text with the agent's own model and write\n * the resulting memory entries to the agent's store. This is the UI-driven\n * path (the memory button): the human selects messages in an open chat, and\n * the model condenses them into stable facts. The session must be live (its\n * agent supplies the model config) and must belong to an authored agent — a\n * plain chat has no agent store to write to. The write always targets the\n * calling agent's store — never global — mirroring the tool's policy.\n * @param sessionId - the live session whose agent performs the analysis.\n * @param text - the selected conversation text to condense.\n * @returns whether anything landed, plus the entries and any outcome detail.\n */"
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"types": [
|
|
271
|
+
{
|
|
272
|
+
"name": "MemoryAppendResult",
|
|
273
|
+
"declaration": "export interface MemoryAppendResult {\n readonly appended: boolean;\n readonly refreshed: boolean;\n readonly content: string;\n}"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "RememberValue",
|
|
277
|
+
"declaration": "export interface RememberValue {\n readonly saved: boolean;\n readonly agentId?: string;\n readonly outcome?: string;\n readonly entries?: readonly string[];\n}"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"events": [],
|
|
283
|
+
"objects": []
|
|
284
|
+
},
|
|
285
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import type {
|
|
3
|
+
RemoteResult,
|
|
4
|
+
TypertRemoteContribution,
|
|
5
|
+
} from '@deepseek-ai/dsh-typert-protocol'
|
|
6
|
+
import type { RememberValue } from '@istarry/dsh-assistant-profile/types'
|
|
7
|
+
|
|
8
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
9
|
+
interface TypertRemoteNamespace$6167656e744d656d6f7279 {
|
|
10
|
+
purgeAgent: (agentId: string) => Promise<RemoteResult<void>>
|
|
11
|
+
readAgent: (agentId: string) => Promise<RemoteResult<string>>
|
|
12
|
+
readGlobal: () => Promise<RemoteResult<string>>
|
|
13
|
+
remember: (sessionId: string, text: string) => Promise<RemoteResult<RememberValue>>
|
|
14
|
+
writeAgent: (agentId: string, text: string) => Promise<RemoteResult<void>>
|
|
15
|
+
writeGlobal: (text: string) => Promise<RemoteResult<void>>
|
|
16
|
+
}
|
|
17
|
+
interface TypertRemoteMap {
|
|
18
|
+
'assistantProfile/purgeAgent': (agentId: string) => Promise<RemoteResult<void>>
|
|
19
|
+
'assistantProfile/readAgent': (agentId: string) => Promise<RemoteResult<string>>
|
|
20
|
+
'assistantProfile/readGlobal': () => Promise<RemoteResult<string>>
|
|
21
|
+
'assistantProfile/remember': (sessionId: string, text: string) => Promise<RemoteResult<RememberValue>>
|
|
22
|
+
'assistantProfile/writeAgent': (agentId: string, text: string) => Promise<RemoteResult<void>>
|
|
23
|
+
'assistantProfile/writeGlobal': (text: string) => Promise<RemoteResult<void>>
|
|
24
|
+
}
|
|
25
|
+
interface TypertRemoteNamespaceMap {
|
|
26
|
+
'assistantProfile': TypertRemoteNamespace$6167656e744d656d6f7279
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare const TYPERT_REMOTE: TypertRemoteContribution
|
|
31
|
+
export default TYPERT_REMOTE
|
|
32
|
+
//# sourceMappingURL=typert.remote-client.d.ts.map
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_parameter_0$schema$value
|
|
5
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_parameter_0$schema$value ??= z.string())
|
|
6
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_result$schema$value
|
|
7
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_result$schema$value ??= z.void())
|
|
8
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_parameter_0$schema$value
|
|
9
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_parameter_0$schema$value ??= z.string())
|
|
10
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_result$schema$value
|
|
11
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_result$schema$value ??= z.string())
|
|
12
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_readGlobal_result$schema$value
|
|
13
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_readGlobal_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_readGlobal_result$schema$value ??= z.string())
|
|
14
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_0$schema$value
|
|
15
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_0$schema$value ??= z.string())
|
|
16
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_1$schema$value
|
|
17
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_1$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_1$schema$value ??= z.string())
|
|
18
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_remember_result$schema$value
|
|
19
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_remember_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_remember_result$schema$value ??= z.object({
|
|
20
|
+
'saved': z.boolean().readonly(),
|
|
21
|
+
'agentId': z.string().readonly().optional(),
|
|
22
|
+
'outcome': z.string().readonly().optional(),
|
|
23
|
+
'entries': z.array(z.string()).readonly().optional(),
|
|
24
|
+
}))
|
|
25
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_0$schema$value
|
|
26
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_0$schema$value ??= z.string())
|
|
27
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_1$schema$value
|
|
28
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_1$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_1$schema$value ??= z.string())
|
|
29
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_result$schema$value
|
|
30
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_result$schema$value ??= z.void())
|
|
31
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_parameter_0$schema$value
|
|
32
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_parameter_0$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_parameter_0$schema$value ??= z.string())
|
|
33
|
+
let _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_result$schema$value
|
|
34
|
+
const _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_result$schema = () => (_deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_result$schema$value ??= z.void())
|
|
35
|
+
|
|
36
|
+
export const TYPERT_REMOTE = {
|
|
37
|
+
package: '@istarry/dsh-assistant-profile',
|
|
38
|
+
descriptors: [
|
|
39
|
+
{
|
|
40
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/purgeAgent',
|
|
41
|
+
service: 'assistantProfile',
|
|
42
|
+
namespace: 'assistantProfile',
|
|
43
|
+
method: 'purgeAgent',
|
|
44
|
+
invocation: { kind: 'direct' },
|
|
45
|
+
parameters: [
|
|
46
|
+
{
|
|
47
|
+
name: 'agentId',
|
|
48
|
+
wire: 'agentId',
|
|
49
|
+
source: 'json',
|
|
50
|
+
codec: {
|
|
51
|
+
mode: 'strict',
|
|
52
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/purgeAgent:agentId',
|
|
53
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_parameter_0$schema,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
result: {
|
|
58
|
+
mode: 'strict',
|
|
59
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/purgeAgent:result',
|
|
60
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_purgeAgent_result$schema,
|
|
61
|
+
},
|
|
62
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":325,"column":3},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/readAgent',
|
|
66
|
+
service: 'assistantProfile',
|
|
67
|
+
namespace: 'assistantProfile',
|
|
68
|
+
method: 'readAgent',
|
|
69
|
+
invocation: { kind: 'direct' },
|
|
70
|
+
parameters: [
|
|
71
|
+
{
|
|
72
|
+
name: 'agentId',
|
|
73
|
+
wire: 'agentId',
|
|
74
|
+
source: 'json',
|
|
75
|
+
codec: {
|
|
76
|
+
mode: 'strict',
|
|
77
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/readAgent:agentId',
|
|
78
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_parameter_0$schema,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
result: {
|
|
83
|
+
mode: 'strict',
|
|
84
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/readAgent:result',
|
|
85
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_readAgent_result$schema,
|
|
86
|
+
},
|
|
87
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":313,"column":3},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/readGlobal',
|
|
91
|
+
service: 'assistantProfile',
|
|
92
|
+
namespace: 'assistantProfile',
|
|
93
|
+
method: 'readGlobal',
|
|
94
|
+
invocation: { kind: 'direct' },
|
|
95
|
+
parameters: [
|
|
96
|
+
],
|
|
97
|
+
result: {
|
|
98
|
+
mode: 'strict',
|
|
99
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/readGlobal:result',
|
|
100
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_readGlobal_result$schema,
|
|
101
|
+
},
|
|
102
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":301,"column":3},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/remember',
|
|
106
|
+
service: 'assistantProfile',
|
|
107
|
+
namespace: 'assistantProfile',
|
|
108
|
+
method: 'remember',
|
|
109
|
+
invocation: { kind: 'direct' },
|
|
110
|
+
parameters: [
|
|
111
|
+
{
|
|
112
|
+
name: 'sessionId',
|
|
113
|
+
wire: 'sessionId',
|
|
114
|
+
source: 'json',
|
|
115
|
+
codec: {
|
|
116
|
+
mode: 'strict',
|
|
117
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/remember:sessionId',
|
|
118
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_0$schema,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'text',
|
|
123
|
+
wire: 'text',
|
|
124
|
+
source: 'json',
|
|
125
|
+
codec: {
|
|
126
|
+
mode: 'strict',
|
|
127
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/remember:text',
|
|
128
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_remember_parameter_1$schema,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
result: {
|
|
133
|
+
mode: 'strict',
|
|
134
|
+
typeSymbol: '@istarry/dsh-assistant-profile/types#RememberValue',
|
|
135
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_remember_result$schema,
|
|
136
|
+
},
|
|
137
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":347,"column":9},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/writeAgent',
|
|
141
|
+
service: 'assistantProfile',
|
|
142
|
+
namespace: 'assistantProfile',
|
|
143
|
+
method: 'writeAgent',
|
|
144
|
+
invocation: { kind: 'direct' },
|
|
145
|
+
parameters: [
|
|
146
|
+
{
|
|
147
|
+
name: 'agentId',
|
|
148
|
+
wire: 'agentId',
|
|
149
|
+
source: 'json',
|
|
150
|
+
codec: {
|
|
151
|
+
mode: 'strict',
|
|
152
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeAgent:agentId',
|
|
153
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_0$schema,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'text',
|
|
158
|
+
wire: 'text',
|
|
159
|
+
source: 'json',
|
|
160
|
+
codec: {
|
|
161
|
+
mode: 'strict',
|
|
162
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeAgent:text',
|
|
163
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_parameter_1$schema,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
result: {
|
|
168
|
+
mode: 'strict',
|
|
169
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeAgent:result',
|
|
170
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeAgent_result$schema,
|
|
171
|
+
},
|
|
172
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":319,"column":3},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: '@istarry/dsh-assistant-profile#assistantProfile/writeGlobal',
|
|
176
|
+
service: 'assistantProfile',
|
|
177
|
+
namespace: 'assistantProfile',
|
|
178
|
+
method: 'writeGlobal',
|
|
179
|
+
invocation: { kind: 'direct' },
|
|
180
|
+
parameters: [
|
|
181
|
+
{
|
|
182
|
+
name: 'text',
|
|
183
|
+
wire: 'text',
|
|
184
|
+
source: 'json',
|
|
185
|
+
codec: {
|
|
186
|
+
mode: 'strict',
|
|
187
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeGlobal:text',
|
|
188
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_parameter_0$schema,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
result: {
|
|
193
|
+
mode: 'strict',
|
|
194
|
+
typeSymbol: '@istarry/dsh-assistant-profile#assistantProfile/writeGlobal:result',
|
|
195
|
+
create: _deepseek_ai_dsh_agent_memory_assistantProfile_writeGlobal_result$schema,
|
|
196
|
+
},
|
|
197
|
+
sourceLocation: {"file":"packages/preset/agent-memory/src/index.ts","line":307,"column":3},
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export default TYPERT_REMOTE
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@istarry/dsh-assistant-profile",
|
|
3
3
|
"description": "助理档案:给 DSH 一份全局人格(名称 / 风格 / 语言 / 人格提示词),每个新会话的系统提示最前面都带着它;侧栏「新会话」上方显示助理名",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -14,10 +14,18 @@
|
|
|
14
14
|
"url": "git+https://github.com/iStarryDust/dsh-assistant-profile.git"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
|
-
".":
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./typert": {
|
|
22
|
+
"types": "./lib/typert.host.d.ts",
|
|
23
|
+
"default": "./lib/typert.host.js"
|
|
24
|
+
},
|
|
25
|
+
"./remote": {
|
|
26
|
+
"types": "./lib/typert.remote-client.d.ts",
|
|
27
|
+
"default": "./lib/typert.remote-client.js"
|
|
28
|
+
},
|
|
21
29
|
"./package.json": "./package.json"
|
|
22
30
|
},
|
|
23
31
|
"files": [
|
|
@@ -26,6 +34,10 @@
|
|
|
26
34
|
"lib/index.js",
|
|
27
35
|
"lib/client.js",
|
|
28
36
|
"lib/client.js.map",
|
|
37
|
+
"lib/typert.host.js",
|
|
38
|
+
"lib/typert.host.d.ts",
|
|
39
|
+
"lib/typert.remote-client.js",
|
|
40
|
+
"lib/typert.remote-client.d.ts",
|
|
29
41
|
"cordis.patch.yml",
|
|
30
42
|
"LICENSE",
|
|
31
43
|
"README*.md"
|