mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 03:10:38 +09:00
Bundle default CEO onboarding instructions
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
bee814787a
commit
0f45999df9
10 changed files with 210 additions and 9 deletions
22
server/src/services/default-agent-instructions.ts
Normal file
22
server/src/services/default-agent-instructions.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import fs from "node:fs/promises";
|
||||
|
||||
const DEFAULT_AGENT_BUNDLE_FILES = {
|
||||
ceo: ["AGENTS.md", "HEARTBEAT.md", "SOUL.md", "TOOLS.md"],
|
||||
} as const;
|
||||
|
||||
type DefaultAgentBundleRole = keyof typeof DEFAULT_AGENT_BUNDLE_FILES;
|
||||
|
||||
function resolveDefaultAgentBundleUrl(role: DefaultAgentBundleRole, fileName: string) {
|
||||
return new URL(`../onboarding-assets/${role}/${fileName}`, import.meta.url);
|
||||
}
|
||||
|
||||
export async function loadDefaultAgentInstructionsBundle(role: DefaultAgentBundleRole): Promise<Record<string, string>> {
|
||||
const fileNames = DEFAULT_AGENT_BUNDLE_FILES[role];
|
||||
const entries = await Promise.all(
|
||||
fileNames.map(async (fileName) => {
|
||||
const content = await fs.readFile(resolveDefaultAgentBundleUrl(role, fileName), "utf8");
|
||||
return [fileName, content] as const;
|
||||
}),
|
||||
);
|
||||
return Object.fromEntries(entries);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue