chore(integration): snapshot local main worktree

This commit is contained in:
inman
2026-08-31 10:23:21 +08:00
parent 48a9189939
commit 33fb31fb28
116 changed files with 8108 additions and 3026 deletions

View File

@@ -11,6 +11,13 @@ import type { PiManagedInputRevision } from './managed-input-revision';
const MANAGED_SEGMENT_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;
export const MAKELORE_DEFAULT_LANGUAGE_PROMPT = `你正在 Makelore 中工作,产品默认服务中文用户。
语言要求:
- 默认使用简体中文进行所有自然语言表达,包括可见的思考过程、进度说明、工具调用说明、提问、总结和最终回复。
- 代码、命令、标识符、文件路径、日志、错误原文,以及为保证准确性必须保留原文的引用,可以使用其原始语言。
- 只有当用户或项目智能体的自定义系统指令明确要求其他语言时,才改用对应语言。`;
export interface BundledCodingSkillsPathInput {
isPackaged: boolean;
resourcesPath: string;
@@ -43,6 +50,7 @@ export interface PiAgentResourceManifest {
projectId: string;
agentId: string;
promptFile: string;
languagePromptFile: string;
skillIds: BundledCodingSkillId[];
revision: PiManagedInputRevision;
}
@@ -51,6 +59,7 @@ export interface PiAgentResourceSnapshot {
paths: PiManagedPaths;
projectSessionsDir: string;
promptPath: string;
languagePromptPath: string;
manifestPath: string;
skillIds: BundledCodingSkillId[];
skillPaths: string[];
@@ -176,21 +185,27 @@ export async function materializePiAgentResources(
options.skillIds,
);
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],
revision: { ...options.revision },
};
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],
skillPaths,
@@ -213,6 +228,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;