增强进料配方注入,并拆分转述侧创作与跑团体验配方。

让文本生成器与数值跑团各走清晰进料路径,开玩后槽位与分工自动对齐。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-10 02:18:23 +08:00
co-authored by Cursor
parent 3d720f23fe
commit 92dd412e14
15 changed files with 292 additions and 36 deletions
+2
View File
@@ -54,6 +54,8 @@ const SKILL_PACK_LABELS: Record<string, string> = {
"expand-assistant": "扩写助手",
文本生成器: "文本生成器",
"text-generator": "文本生成器",
交互式长文生成器: "交互式长文生成器",
数据化跑团体验: "数据化跑团体验",
};
/** 生命周期 / 相位 */
+36 -3
View File
@@ -109,6 +109,7 @@ import {
creationFlowFromRecipeSeed,
findRecipeCatalogEntry,
formatCreationFlowForUser,
formatDictateRecipeBrief,
findModuleByName,
findStepByRef,
type FlowStepTitleHint,
@@ -682,14 +683,17 @@ export class SessionManager {
s.runtime.getBlackboard(),
s.recipeOptions,
);
const recipeBrief = await resolveDictateRecipeBriefForSession({
skillName: s.runtime.getActiveSkill()?.name,
recipeView,
recipeOptions: s.recipeOptions,
});
const result = await runDictateTurn({
llm,
dialogue,
recipeName: recipeView?.name,
recipeBrief: recipeView
? [recipeView.declaration].filter(Boolean).join(";")
: undefined,
recipeBrief,
handlers: {
listProducts: () => this.listDictateProducts(s),
writeProduct: (tag, content, order) => {
@@ -3586,6 +3590,35 @@ function resolveSelectedRecipeView(
return { id: ref, name: ref, declaration: "" };
}
/** Boss 直聘:优先注入 recipe.yaml 方法论,缺则退回 catalog declaration */
async function resolveDictateRecipeBriefForSession(params: {
skillName?: string | null;
recipeView: { id: string; name: string; declaration: string } | null;
recipeOptions?: RecipeCatalogEntry[];
}): Promise<string | undefined> {
const view = params.recipeView;
if (!view) return undefined;
const entry = findRecipeCatalogEntry(
params.recipeOptions?.length ? { recipes: params.recipeOptions } : null,
view.id,
);
const skillName = params.skillName?.trim();
if (entry && skillName) {
try {
const skill = await loadSkill(skillName);
const packRoot = skill.skillPackRoot?.trim();
if (packRoot) {
const detail = await loadRecipeDetail(packRoot, entry);
const brief = formatDictateRecipeBrief(detail);
if (brief) return brief;
}
} catch (err) {
console.error("[会话] 加载转述配方要点失败", err);
}
}
return view.declaration?.trim() || undefined;
}
function buildWorkerSetUserView(
blackboard: Blackboard,
session?: RuntimeSession,