This commit is contained in:
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
|
||||
import { mkdtempSync, readFileSync, existsSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { ensureAgentWorkspace, applyAssistantName, normalizeAssistantName, templateWorkspaceDir } from '../daemon/agent-workspace.js';
|
||||
import { ensureAgentWorkspace, applyAssistantName, applyAssistantPrompt, normalizeAssistantName, templateWorkspaceDir } from '../daemon/agent-workspace.js';
|
||||
|
||||
const previous = process.env.XDG_DATA_HOME;
|
||||
const data = mkdtempSync(path.join(tmpdir(), 'jarvis-workspace-'));
|
||||
@@ -23,7 +23,10 @@ test('workspace seed copies SOUL and bootstrap, then name writes IDENTITY.md', (
|
||||
const again = ensureAgentWorkspace({ name: 'Ada' });
|
||||
assert.equal(again, dir);
|
||||
assert.match(readFileSync(path.join(dir, 'IDENTITY.md'), 'utf8'), /\*\*Name:\*\* Ada/);
|
||||
assert.equal(normalizeAssistantName(' '), 'Jarvis');
|
||||
applyAssistantPrompt(dir, 'Be a dry ship cook. Never say great question.');
|
||||
assert.match(readFileSync(path.join(dir, 'PERSONA.md'), 'utf8'), /dry ship cook/);
|
||||
applyAssistantPrompt(dir, '');
|
||||
assert.equal(readFileSync(path.join(dir, 'PERSONA.md'), 'utf8').trim(), '# PERSONA.md');
|
||||
assert.match(templateWorkspaceDir(), /agent-workspace$/);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user