merge: integrate upstream main with local Makelore changes

This commit is contained in:
inman
2026-08-31 10:55:48 +08:00
128 changed files with 8278 additions and 3030 deletions

View File

@@ -15,6 +15,13 @@ export interface PiSkillEntry {
packageRoot?: string;
}
export const MAKELORE_DEFAULT_LANGUAGE_PROMPT = `你正在 Makelore 中工作,产品默认服务中文用户。
语言要求:
- 默认使用简体中文进行所有自然语言表达,包括可见的思考过程、进度说明、工具调用说明、提问、总结和最终回复。
- 代码、命令、标识符、文件路径、日志、错误原文,以及为保证准确性必须保留原文的引用,可以使用其原始语言。
- 只有当用户或项目智能体的自定义系统指令明确要求其他语言时,才改用对应语言。`;
export interface BundledCodingSkillsPathInput {
isPackaged: boolean;
resourcesPath: string;
@@ -52,6 +59,7 @@ export interface PiAgentResourceManifest {
projectId: string;
agentId: string;
promptFile: string;
languagePromptFile: string;
skillIds: string[];
skillEntries: PiSkillEntry[];
catalogRevision: number;
@@ -63,6 +71,7 @@ export interface PiAgentResourceSnapshot {
paths: PiManagedPaths;
projectSessionsDir: string;
promptPath: string;
languagePromptPath: string;
manifestPath: string;
skillIds: string[];
skillEntries: PiSkillEntry[];
@@ -263,24 +272,30 @@ export async function materializePiAgentResources(
);
const resolvedCatalogRevision = catalogRevision(options.catalogRevision);
const promptPath = path.join(projectPromptsDir, `${agentId}.md`);
const languagePromptPath = path.join(projectPromptsDir, `${agentId}.language.md`);
const manifestPath = path.join(projectPromptsDir, `${agentId}.manifest.json`);
const manifest: PiAgentResourceManifest = {
schemaVersion: 1,
projectId,
agentId,
promptFile: path.basename(promptPath),
languagePromptFile: path.basename(languagePromptPath),
skillIds: [...skillIds],
skillEntries: structuredClone(skillEntries),
catalogRevision: resolvedCatalogRevision,
revision: { ...options.revision },
...(options.effectiveSnapshot ? { effectivePluginSnapshot: structuredClone(options.effectiveSnapshot) } : {}),
};
await atomicWriteText(promptPath, options.prompt);
await Promise.all([
atomicWriteText(promptPath, options.prompt),
atomicWriteText(languagePromptPath, MAKELORE_DEFAULT_LANGUAGE_PROMPT),
]);
await atomicWriteJson(manifestPath, manifest);
return {
paths,
projectSessionsDir,
promptPath,
languagePromptPath,
manifestPath,
skillIds: [...skillIds],
skillEntries: structuredClone(skillEntries),
@@ -309,6 +324,7 @@ export function buildPiManagedInputArgs(
'--model', selection.modelId,
'--thinking', selection.thinkingLevel,
'--system-prompt', resources.promptPath,
'--append-system-prompt', resources.languagePromptPath,
];
for (const skillPath of resources.skillPaths) args.push('--skill', skillPath);
return args;