@michengai/dsh-agency-agents 1.2.13 → 1.2.15
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 +22 -0
- package/CHANGELOG.zh-CN.md +22 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/lib/client.js +26 -23
- package/lib/index.js +1 -1
- package/lib/remote.d.ts +111 -1
- package/lib/remote.js +53 -1
- package/lib/{src-9NxK49RV.js → src-D3NK414L.js} +585 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as unquote,
|
|
1
|
+
import { C as unquote, I as ZH_NAME, S as truncate, _ as resolveCatalogRoot, a as SUMMON_EXPERTS_MAX, b as stripBom, c as createAgencyPersonaSource, d as loadCatalog, f as mapPool, g as readLocalizedExpertPrompt, h as readExpertPrompt, i as SUMMON_EXPERTS_CONCURRENCY, l as inject, m as parseFrontmatter, n as Config, o as SUMMON_TASK_MAX_CHARS, p as name, r as DEFAULT_DIVISIONS, s as apply, t as AGENCY_PERSONA_SERVICE, u as liveSchemaField, v as resolveExpert, w as validateSummonSpecs, x as toSummonItemResult, y as sanitize } from "./src-D3NK414L.js";
|
|
2
2
|
export { AGENCY_PERSONA_SERVICE, Config, DEFAULT_DIVISIONS, SUMMON_EXPERTS_CONCURRENCY, SUMMON_EXPERTS_MAX, SUMMON_TASK_MAX_CHARS, ZH_NAME, apply, createAgencyPersonaSource, inject, liveSchemaField, loadCatalog, mapPool, name, parseFrontmatter, readExpertPrompt, readLocalizedExpertPrompt, resolveCatalogRoot, resolveExpert, sanitize, stripBom, toSummonItemResult, truncate, unquote, validateSummonSpecs };
|
package/lib/remote.d.ts
CHANGED
|
@@ -73,9 +73,9 @@ declare const teamSnapshotSchema: z.ZodObject<{
|
|
|
73
73
|
revision: z.ZodNumber;
|
|
74
74
|
engine: z.ZodOptional<z.ZodObject<{
|
|
75
75
|
state: z.ZodEnum<{
|
|
76
|
-
enabled: "enabled";
|
|
77
76
|
unsupported: "unsupported";
|
|
78
77
|
disabled: "disabled";
|
|
78
|
+
enabled: "enabled";
|
|
79
79
|
}>;
|
|
80
80
|
mode: z.ZodEnum<{
|
|
81
81
|
subagent: "subagent";
|
|
@@ -118,6 +118,112 @@ declare const catalogSnapshotSchema: z.ZodObject<{
|
|
|
118
118
|
}, z.core.$strip>;
|
|
119
119
|
type CatalogSnapshot = z.infer<typeof catalogSnapshotSchema>;
|
|
120
120
|
//#endregion
|
|
121
|
+
//#region src/creation-tools.d.ts
|
|
122
|
+
declare const storedProposalItemSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
123
|
+
kind: z.ZodLiteral<"expert">;
|
|
124
|
+
data: z.ZodObject<{
|
|
125
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
126
|
+
name: z.ZodString;
|
|
127
|
+
description: z.ZodString;
|
|
128
|
+
division: z.ZodString;
|
|
129
|
+
emoji: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<string, string>>;
|
|
130
|
+
avatar: z.ZodDefault<z.ZodNumber>;
|
|
131
|
+
prompt: z.ZodString;
|
|
132
|
+
}, z.core.$strict>;
|
|
133
|
+
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
+
kind: z.ZodLiteral<"team">;
|
|
137
|
+
data: z.ZodObject<{
|
|
138
|
+
id: z.ZodOptional<z.ZodString>;
|
|
139
|
+
builtin: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
description: z.ZodString;
|
|
142
|
+
tags: z.ZodArray<z.ZodString>;
|
|
143
|
+
goal: z.ZodString;
|
|
144
|
+
constraints: z.ZodString;
|
|
145
|
+
deliveryRequirements: z.ZodString;
|
|
146
|
+
members: z.ZodArray<z.ZodObject<{
|
|
147
|
+
expertSlug: z.ZodString;
|
|
148
|
+
duty: z.ZodString;
|
|
149
|
+
instructions: z.ZodString;
|
|
150
|
+
}, z.core.$strict>>;
|
|
151
|
+
examples: z.ZodArray<z.ZodString>;
|
|
152
|
+
coordinatorMode: z.ZodEnum<{
|
|
153
|
+
custom: "custom";
|
|
154
|
+
template: "template";
|
|
155
|
+
}>;
|
|
156
|
+
coordinatorTemplateId: z.ZodEnum<{
|
|
157
|
+
product: "product";
|
|
158
|
+
research: "research";
|
|
159
|
+
general: "general";
|
|
160
|
+
technical: "technical";
|
|
161
|
+
content: "content";
|
|
162
|
+
data: "data";
|
|
163
|
+
}>;
|
|
164
|
+
coordinatorTemplateVersion: z.ZodLiteral<1>;
|
|
165
|
+
coordinatorPrompt: z.ZodString;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
memberReasons: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
168
|
+
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strip>]>;
|
|
171
|
+
type StoredProposal = z.infer<typeof storedProposalItemSchema>;
|
|
172
|
+
declare const latestProposalSchema: z.ZodNullable<z.ZodObject<{
|
|
173
|
+
id: z.ZodString;
|
|
174
|
+
proposal: z.ZodUnion<readonly [z.ZodObject<{
|
|
175
|
+
kind: z.ZodLiteral<"expert">;
|
|
176
|
+
data: z.ZodObject<{
|
|
177
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
178
|
+
name: z.ZodString;
|
|
179
|
+
description: z.ZodString;
|
|
180
|
+
division: z.ZodString;
|
|
181
|
+
emoji: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<string, string>>;
|
|
182
|
+
avatar: z.ZodDefault<z.ZodNumber>;
|
|
183
|
+
prompt: z.ZodString;
|
|
184
|
+
}, z.core.$strict>;
|
|
185
|
+
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
187
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
188
|
+
kind: z.ZodLiteral<"team">;
|
|
189
|
+
data: z.ZodObject<{
|
|
190
|
+
id: z.ZodOptional<z.ZodString>;
|
|
191
|
+
builtin: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
name: z.ZodString;
|
|
193
|
+
description: z.ZodString;
|
|
194
|
+
tags: z.ZodArray<z.ZodString>;
|
|
195
|
+
goal: z.ZodString;
|
|
196
|
+
constraints: z.ZodString;
|
|
197
|
+
deliveryRequirements: z.ZodString;
|
|
198
|
+
members: z.ZodArray<z.ZodObject<{
|
|
199
|
+
expertSlug: z.ZodString;
|
|
200
|
+
duty: z.ZodString;
|
|
201
|
+
instructions: z.ZodString;
|
|
202
|
+
}, z.core.$strict>>;
|
|
203
|
+
examples: z.ZodArray<z.ZodString>;
|
|
204
|
+
coordinatorMode: z.ZodEnum<{
|
|
205
|
+
custom: "custom";
|
|
206
|
+
template: "template";
|
|
207
|
+
}>;
|
|
208
|
+
coordinatorTemplateId: z.ZodEnum<{
|
|
209
|
+
product: "product";
|
|
210
|
+
research: "research";
|
|
211
|
+
general: "general";
|
|
212
|
+
technical: "technical";
|
|
213
|
+
content: "content";
|
|
214
|
+
data: "data";
|
|
215
|
+
}>;
|
|
216
|
+
coordinatorTemplateVersion: z.ZodLiteral<1>;
|
|
217
|
+
coordinatorPrompt: z.ZodString;
|
|
218
|
+
}, z.core.$strict>;
|
|
219
|
+
memberReasons: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
220
|
+
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, z.core.$strip>]>;
|
|
223
|
+
timestamp: z.ZodNumber;
|
|
224
|
+
}, z.core.$strip>>;
|
|
225
|
+
type LatestProposal = z.infer<typeof latestProposalSchema>;
|
|
226
|
+
//#endregion
|
|
121
227
|
//#region src/remote.d.ts
|
|
122
228
|
/** 供客户端读取和保存已启用专家的顶层 Host Remote 服务。 */
|
|
123
229
|
declare class AgencyAgentsRemote extends TypertRemoteService {
|
|
@@ -149,6 +255,10 @@ declare class AgencyAgentsRemote extends TypertRemoteService {
|
|
|
149
255
|
getPrompt(slug: string, division: string): Promise<{
|
|
150
256
|
prompt: string;
|
|
151
257
|
}>;
|
|
258
|
+
/** 获取暂存的专家或专家团提案,用于前端弹窗回显。 */
|
|
259
|
+
getPendingProposal(id: string): Promise<StoredProposal | null>;
|
|
260
|
+
/** 获取自某时间戳之后产生的最新已确认专家或专家团草案,支持前端自动呼出弹窗。草案打磨期不返回。 */
|
|
261
|
+
getLatestProposal(afterTimestamp: number, sessionId?: string): Promise<LatestProposal>;
|
|
152
262
|
}
|
|
153
263
|
//#endregion
|
|
154
264
|
export { AgencyAgentsRemote as default, readExpertPrompt, readLocalizedExpertPrompt };
|
package/lib/remote.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as settingsNamespaceCompat, B as teamText, D as storedProposalSchema, E as latestProposalSchema, F as expertEditSchema, L as AGENCY_TEAM_SERVICE, M as CUSTOM_EXPERT_SLUG, N as catalogSnapshotSchema, O as formatHost, P as customExpertInputSchema, R as teamInputSchema, T as nativeTeamMemberName, g as readLocalizedExpertPrompt, h as readExpertPrompt, j as AGENCY_LIBRARY_SERVICE, k as readHostLocale, t as AGENCY_PERSONA_SERVICE, z as teamSnapshotSchema } from "./src-D3NK414L.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
4
4
|
//#region src/remote-contract.ts
|
|
@@ -120,6 +120,24 @@ const AGENCY_AGENTS_DESCRIPTORS = [
|
|
|
120
120
|
invocation: { kind: "direct" },
|
|
121
121
|
parameters: [jsonParameter("slug", "string", z.string().min(1).max(128)), jsonParameter("division", "string", z.string().min(1).max(64))],
|
|
122
122
|
result: strictCodec("AgencyAgentsPrompt", expertPromptSchema)
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "@michengai/dsh-agency-agents#agencyAgents/getPendingProposal",
|
|
126
|
+
service: "agencyAgents",
|
|
127
|
+
namespace: "agencyAgents",
|
|
128
|
+
method: "getPendingProposal",
|
|
129
|
+
invocation: { kind: "direct" },
|
|
130
|
+
parameters: [jsonParameter("id", "string", z.string().min(1).max(128))],
|
|
131
|
+
result: strictCodec("PendingProposalResult", storedProposalSchema)
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "@michengai/dsh-agency-agents#agencyAgents/getLatestProposal",
|
|
135
|
+
service: "agencyAgents",
|
|
136
|
+
namespace: "agencyAgents",
|
|
137
|
+
method: "getLatestProposal",
|
|
138
|
+
invocation: { kind: "direct" },
|
|
139
|
+
parameters: [jsonParameter("afterTimestamp", "number", z.number()), jsonParameter("sessionId", "string?", z.string().optional())],
|
|
140
|
+
result: strictCodec("LatestProposalResult", latestProposalSchema)
|
|
123
141
|
}
|
|
124
142
|
];
|
|
125
143
|
//#endregion
|
|
@@ -203,6 +221,8 @@ let AgencyAgentsRemote = (() => {
|
|
|
203
221
|
let _getEnabled_decorators;
|
|
204
222
|
let _setEnabled_decorators;
|
|
205
223
|
let _getPrompt_decorators;
|
|
224
|
+
let _getPendingProposal_decorators;
|
|
225
|
+
let _getLatestProposal_decorators;
|
|
206
226
|
return class AgencyAgentsRemote extends _classSuper {
|
|
207
227
|
static {
|
|
208
228
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -217,6 +237,8 @@ let AgencyAgentsRemote = (() => {
|
|
|
217
237
|
_getEnabled_decorators = [Remote("getEnabled")];
|
|
218
238
|
_setEnabled_decorators = [Remote("setEnabled")];
|
|
219
239
|
_getPrompt_decorators = [Remote("getPrompt")];
|
|
240
|
+
_getPendingProposal_decorators = [Remote("getPendingProposal")];
|
|
241
|
+
_getLatestProposal_decorators = [Remote("getLatestProposal")];
|
|
220
242
|
__esDecorate(this, null, _getTeams_decorators, {
|
|
221
243
|
kind: "method",
|
|
222
244
|
name: "getTeams",
|
|
@@ -338,6 +360,28 @@ let AgencyAgentsRemote = (() => {
|
|
|
338
360
|
},
|
|
339
361
|
metadata: _metadata
|
|
340
362
|
}, null, _instanceExtraInitializers);
|
|
363
|
+
__esDecorate(this, null, _getPendingProposal_decorators, {
|
|
364
|
+
kind: "method",
|
|
365
|
+
name: "getPendingProposal",
|
|
366
|
+
static: false,
|
|
367
|
+
private: false,
|
|
368
|
+
access: {
|
|
369
|
+
has: (obj) => "getPendingProposal" in obj,
|
|
370
|
+
get: (obj) => obj.getPendingProposal
|
|
371
|
+
},
|
|
372
|
+
metadata: _metadata
|
|
373
|
+
}, null, _instanceExtraInitializers);
|
|
374
|
+
__esDecorate(this, null, _getLatestProposal_decorators, {
|
|
375
|
+
kind: "method",
|
|
376
|
+
name: "getLatestProposal",
|
|
377
|
+
static: false,
|
|
378
|
+
private: false,
|
|
379
|
+
access: {
|
|
380
|
+
has: (obj) => "getLatestProposal" in obj,
|
|
381
|
+
get: (obj) => obj.getLatestProposal
|
|
382
|
+
},
|
|
383
|
+
metadata: _metadata
|
|
384
|
+
}, null, _instanceExtraInitializers);
|
|
341
385
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, {
|
|
342
386
|
enumerable: true,
|
|
343
387
|
configurable: true,
|
|
@@ -414,6 +458,14 @@ let AgencyAgentsRemote = (() => {
|
|
|
414
458
|
async getPrompt(slug, division) {
|
|
415
459
|
return personaSource(this.ctx).getPrompt(slug, division, readHostLocale(this.ctx));
|
|
416
460
|
}
|
|
461
|
+
/** 获取暂存的专家或专家团提案,用于前端弹窗回显。 */
|
|
462
|
+
async getPendingProposal(id) {
|
|
463
|
+
return this.ctx.get("agencyProposalRegistry")?.get(id) ?? null;
|
|
464
|
+
}
|
|
465
|
+
/** 获取自某时间戳之后产生的最新已确认专家或专家团草案,支持前端自动呼出弹窗。草案打磨期不返回。 */
|
|
466
|
+
async getLatestProposal(afterTimestamp, sessionId) {
|
|
467
|
+
return this.ctx.get("agencyProposalRegistry")?.getLatestConfirmed(afterTimestamp, sessionId) ?? null;
|
|
468
|
+
}
|
|
417
469
|
};
|
|
418
470
|
})();
|
|
419
471
|
//#endregion
|