docs+prompt: add bootstrap/heartbeat docs and update prompt template
This commit is contained in:
@@ -144,15 +144,19 @@ describe('assembleSystemPrompt', () => {
|
||||
writeFileSync(join(dir, 'IDENTITY.md'), 'Identity.');
|
||||
writeFileSync(join(dir, 'USER.md'), 'User.');
|
||||
writeFileSync(join(dir, 'TOOLS.md'), 'Tools.');
|
||||
writeFileSync(join(dir, 'BOOTSTRAP.md'), 'Bootstrap.');
|
||||
writeFileSync(join(dir, 'HEARTBEAT.md'), 'Heartbeat.');
|
||||
|
||||
const result = assembleSystemPrompt({ searchDirs: [dir] });
|
||||
|
||||
expect(result.loadedFiles).toHaveLength(5);
|
||||
expect(result.loadedFiles).toHaveLength(7);
|
||||
expect(result.prompt).toContain('Soul.');
|
||||
expect(result.prompt).toContain('# Agent Instructions\n\nAgents.');
|
||||
expect(result.prompt).toContain('# Identity Customization\n\nIdentity.');
|
||||
expect(result.prompt).toContain('# User Context\n\nUser.');
|
||||
expect(result.prompt).toContain('# Tool Instructions\n\nTools.');
|
||||
expect(result.prompt).toContain('# Bootstrap Protocol\n\nBootstrap.');
|
||||
expect(result.prompt).toContain('# Heartbeat Protocol\n\nHeartbeat.');
|
||||
});
|
||||
|
||||
it('trims whitespace from loaded file content', () => {
|
||||
@@ -207,6 +211,8 @@ describe('assembleSystemPrompt', () => {
|
||||
writeFileSync(join(dir, 'IDENTITY.md'), 'Do not include.');
|
||||
writeFileSync(join(dir, 'USER.md'), 'Do not include.');
|
||||
writeFileSync(join(dir, 'TOOLS.md'), 'Do not include.');
|
||||
writeFileSync(join(dir, 'BOOTSTRAP.md'), 'Do not include.');
|
||||
writeFileSync(join(dir, 'HEARTBEAT.md'), 'Do not include.');
|
||||
|
||||
const result = assembleSystemPrompt({
|
||||
searchDirs: [dir],
|
||||
@@ -220,6 +226,8 @@ describe('assembleSystemPrompt', () => {
|
||||
expect(result.prompt).not.toContain('# Identity Customization');
|
||||
expect(result.prompt).not.toContain('# User Context');
|
||||
expect(result.prompt).not.toContain('# Tool Instructions');
|
||||
expect(result.prompt).not.toContain('# Bootstrap Protocol');
|
||||
expect(result.prompt).not.toContain('# Heartbeat Protocol');
|
||||
expect(result.prompt).not.toContain('# Custom');
|
||||
});
|
||||
|
||||
@@ -230,6 +238,8 @@ describe('assembleSystemPrompt', () => {
|
||||
writeFileSync(join(dir, 'IDENTITY.md'), 'Identity.');
|
||||
writeFileSync(join(dir, 'USER.md'), 'User.');
|
||||
writeFileSync(join(dir, 'TOOLS.md'), 'Tools.');
|
||||
writeFileSync(join(dir, 'BOOTSTRAP.md'), 'Bootstrap.');
|
||||
writeFileSync(join(dir, 'HEARTBEAT.md'), 'Heartbeat.');
|
||||
|
||||
const result = assembleSystemPrompt({
|
||||
searchDirs: [dir],
|
||||
@@ -241,6 +251,8 @@ describe('assembleSystemPrompt', () => {
|
||||
expect(result.prompt).toContain('# Identity Customization\n\nIdentity.');
|
||||
expect(result.prompt).toContain('# User Context\n\nUser.');
|
||||
expect(result.prompt).toContain('# Tool Instructions\n\nTools.');
|
||||
expect(result.prompt).toContain('# Bootstrap Protocol\n\nBootstrap.');
|
||||
expect(result.prompt).toContain('# Heartbeat Protocol\n\nHeartbeat.');
|
||||
});
|
||||
|
||||
it('detailed includes extra sections', () => {
|
||||
|
||||
@@ -10,6 +10,8 @@ const PROMPT_FILES = [
|
||||
{ name: 'IDENTITY.md', section: 'Identity Customization', required: false },
|
||||
{ name: 'USER.md', section: 'User Context', required: false },
|
||||
{ name: 'TOOLS.md', section: 'Tool Instructions', required: false },
|
||||
{ name: 'BOOTSTRAP.md', section: 'Bootstrap Protocol', required: false },
|
||||
{ name: 'HEARTBEAT.md', section: 'Heartbeat Protocol', required: false },
|
||||
] as const;
|
||||
|
||||
export interface PromptTemplateConfig {
|
||||
|
||||
Reference in New Issue
Block a user